govuk_publishing_components 24.3.0 → 24.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/details.js +1 -1
  3. data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +108 -0
  4. data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +7 -2
  5. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +6 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +1 -1
  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 +8 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +117 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -13
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-list.scss +12 -0
  13. data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
  14. data/app/models/govuk_publishing_components/audit_comparer.rb +2 -2
  15. data/app/models/govuk_publishing_components/component_example.rb +4 -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 +6 -6
  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/_list.html.erb +5 -5
  22. data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
  23. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +1 -1
  25. data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -1
  26. data/app/views/govuk_publishing_components/components/_reorderable_list.html.erb +45 -0
  27. data/app/views/govuk_publishing_components/components/_search.html.erb +27 -16
  28. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
  29. data/app/views/govuk_publishing_components/components/_show_password.html.erb +6 -4
  30. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -1
  31. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  32. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
  33. data/app/views/govuk_publishing_components/components/_summary_list.html.erb +73 -31
  34. data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +1 -1
  35. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
  36. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +1 -1
  37. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +22 -0
  38. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
  39. data/app/views/govuk_publishing_components/components/docs/radio.yml +14 -1
  40. data/app/views/govuk_publishing_components/components/docs/reorderable_list.yml +85 -0
  41. data/app/views/govuk_publishing_components/components/docs/search.yml +10 -0
  42. data/app/views/govuk_publishing_components/components/docs/summary_list.yml +33 -19
  43. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +2 -0
  44. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +17 -3
  45. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +2 -2
  46. data/config/locales/en.yml +25 -15
  47. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +2 -1
  48. data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +1 -1
  49. data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +1 -7
  50. data/lib/govuk_publishing_components/presenters/meta_tags.rb +1 -2
  51. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +2 -2
  52. data/lib/govuk_publishing_components/version.rb +1 -1
  53. data/lib/tasks/govuk_publishing_components_tasks.rake +1 -1
  54. data/node_modules/sortablejs/LICENSE +21 -0
  55. data/node_modules/sortablejs/README.md +815 -0
  56. data/node_modules/sortablejs/Sortable.js +3721 -0
  57. data/node_modules/sortablejs/Sortable.min.js +2 -0
  58. data/node_modules/sortablejs/modular/sortable.complete.esm.js +3713 -0
  59. data/node_modules/sortablejs/modular/sortable.core.esm.js +3710 -0
  60. data/node_modules/sortablejs/modular/sortable.esm.js +3711 -0
  61. data/node_modules/sortablejs/package.json +56 -0
  62. metadata +19 -7
@@ -9,7 +9,7 @@
9
9
  taxonomy_list_helper = GovukPublishingComponents::Presenters::TaxonomyListHelper.new(image_cards)
10
10
  %>
11
11
  <% if highlight_box || document_list || image_cards %>
12
- <ul class="gem-c-taxonomy-list" data-module="track-click">
12
+ <ul class="gem-c-taxonomy-list" data-module="gem-track-click">
13
13
  <% if image_cards %>
14
14
  <% taxonomy_list_helper.image_card_data.each do |image_card| %>
15
15
  <li class="gem-c-taxonomy-list__item">
@@ -7,7 +7,7 @@
7
7
  <nav role="navigation"
8
8
  class="gem-c-translation-nav <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
9
9
  aria-label="<%= t("common.translations") %>"
10
- <%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
10
+ <%= "data-module=\"gem-track-click\"" if translation_helper.tracking_is_present? %>
11
11
  >
12
12
  <ul class="gem-c-translation-nav__list">
13
13
  <% translation_helper.translations.each.with_index do |translation, i| %>
@@ -3,7 +3,7 @@
3
3
  <% link_path = t("components.related_navigation.transition.link_path") %>
4
4
 
5
5
  <% data_attributes = {
6
- "module": "track-click",
6
+ "module": "gem-track-click",
7
7
  "track-category": "relatedLinkClicked",
8
8
  "track-action": "1.0 Transition",
9
9
  "track-label": link_path,
@@ -97,3 +97,25 @@ examples:
97
97
  url: '/browse/abroad'
98
98
  - title: 'Travel abroad'
99
99
  url: '/browse/abroad/travel-abroad'
100
+ with_border:
101
+ description: "Set a border below the breadcrumb. Off by default."
102
+ data:
103
+ border: "bottom"
104
+ breadcrumbs:
105
+ - title: "Section"
106
+ url: "/section"
107
+ - title: "Sub-section"
108
+ url: "/section/sub-section"
109
+ - title: "Sub-sub-section"
110
+ url: "/section/sub-section/sub-section"
111
+ with_border_and_collapse_on_mobile:
112
+ data:
113
+ border: "bottom"
114
+ collapse_on_mobile: true
115
+ breadcrumbs:
116
+ - title: "Section"
117
+ url: "/section"
118
+ - title: "Sub-section"
119
+ url: "/section/sub-section"
120
+ - title: "Sub-sub-section"
121
+ url: "/section/sub-section/sub-section"
@@ -45,7 +45,7 @@ examples:
45
45
  data:
46
46
  padding_top: false
47
47
  block: |
48
- <div class="gem-c-breadcrumbs " data-module="track-click">
48
+ <div class="gem-c-breadcrumbs " data-module="gem-track-click">
49
49
  <ol>
50
50
  <li class="">
51
51
  <a data-track-category="breadcrumbClicked" data-track-action="1" data-track-label="/section" data-track-options="{&quot;dimension28&quot;:&quot;2&quot;,&quot;dimension29&quot;:&quot;Section&quot;}" class="gem-c-breadcrumbs--inverse" aria-current="false" href="/section">Section</a>
@@ -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"
@@ -0,0 +1,85 @@
1
+ name: Reorderable list
2
+ description: A list of items that can be reordered
3
+ body: |
4
+ List items can be reordered by drag and drop or by using the up/down buttons.
5
+ On small viewports the drag and drop feature is disabled to prevent being triggered
6
+ when scrolling on touch devices.
7
+
8
+ This component uses SortableJS - a JavaScript library for drag and drop interactions.
9
+ When JavaScript is disabled a set of inputs will be shown allowing users to provide
10
+ an order index for each item.
11
+
12
+ When this component is embedded into a form and that form is submit you will receive a
13
+ parameter of `ordering` (which can be customised with the `input_name` option).
14
+ This will contain item ids and ordering positions in a hash.
15
+
16
+ For example, for two items with id "a" and "b" that are ordered accordingly,
17
+ you'd receive a submission of `ordering[a]=1&ordering[b]=2`, which Rails can
18
+ translate to `"ordering" => { "a" => "1", "b" => "2" }`.
19
+
20
+ accessibility_criteria: |
21
+ Buttons in this component must:
22
+
23
+ * be keyboard focusable
24
+ * inform the user about which item they operate on
25
+ * preserve focus after interacting with them
26
+ examples:
27
+ default:
28
+ data:
29
+ items:
30
+ - id: "ce99dd60-67dc-11eb-ae93-0242ac130002"
31
+ title: "Budget 2018"
32
+ - id: "d321cb86-67dc-11eb-ae93-0242ac130002"
33
+ title: "Budget 2018 (web)"
34
+ - id: "63a6d29e-6b6d-4157-9067-84c1a390e352"
35
+ title: "Impact on households: distributional analysis to accompany Budget 2018"
36
+ - id: "0a4d377d-68f4-472f-b2e3-ef71dc750f85"
37
+ title: "Table 2.1: Budget 2018 policy decisions"
38
+ - id: "5ebd75d7-6c37-4b93-b444-1b7c49757fb9"
39
+ title: "Table 2.2: Measures announced at Autumn Budget 2017 or earlier that will take effect from November 2018 or later (£ million)"
40
+ with_description:
41
+ data:
42
+ items:
43
+ - id: "ce99dd60-67dc-11eb-ae93-0242ac130002"
44
+ title: "Budget 2018"
45
+ description: "PDF, 2.56MB, 48 pages"
46
+ - id: "d321cb86-67dc-11eb-ae93-0242ac130002"
47
+ title: "Budget 2018 (web)"
48
+ description: "HTML attachment"
49
+ - id: "63a6d29e-6b6d-4157-9067-84c1a390e352"
50
+ title: "Impact on households: distributional analysis to accompany Budget 2018"
51
+ description: "PDF, 592KB, 48 pages"
52
+ - id: "0a4d377d-68f4-472f-b2e3-ef71dc750f85"
53
+ title: "Table 2.1: Budget 2018 policy decisions"
54
+ description: "MS Excel Spreadsheet, 248KB"
55
+ - id: "5ebd75d7-6c37-4b93-b444-1b7c49757fb9"
56
+ title: "Table 2.2: Measures announced at Autumn Budget 2017 or earlier that will take effect from November 2018 or later (£ million)"
57
+ description: "MS Excel Spreadsheet, 248KB"
58
+ within_form:
59
+ embed: |
60
+ <form>
61
+ <%= component %>
62
+ <button class="govuk-button" type="submit">Save order</button>
63
+ </form>
64
+ data:
65
+ items:
66
+ - id: "ce99dd60-67dc-11eb-ae93-0242ac130002"
67
+ title: "Budget 2018"
68
+ - id: "d321cb86-67dc-11eb-ae93-0242ac130002"
69
+ title: "Budget 2018 (web)"
70
+ - id: "63a6d29e-6b6d-4157-9067-84c1a390e352"
71
+ title: "Impact on households: distributional analysis to accompany Budget 2018"
72
+ - id: "0a4d377d-68f4-472f-b2e3-ef71dc750f85"
73
+ title: "Table 2.1: Budget 2018 policy decisions"
74
+ - id: "5ebd75d7-6c37-4b93-b444-1b7c49757fb9"
75
+ title: "Table 2.2: Measures announced at Autumn Budget 2017 or earlier that will take effect from November 2018 or later (£ million)"
76
+ with_custom_input_name:
77
+ data:
78
+ input_name: "attachments[ordering]"
79
+ items:
80
+ - id: "5ebd75d7-6c37-4b93-b444-1b7c49757fb9"
81
+ title: "Budget 2018"
82
+ description: "PDF, 2.56MB, 48 pages"
83
+ - id: "0a4d377d-68f4-472f-b2e3-ef71dc750f85"
84
+ title: "Budget 2020"
85
+ description: "PDF, 2.56MB, 48 pages"
@@ -51,6 +51,16 @@ examples:
51
51
  with_aria_controls_attribute:
52
52
  description: |
53
53
  The aria-controls attribute is a 'relationship attribute' which denotes which elements in a page an interactive element or set of elements has control over and affects.
54
+
54
55
  For places like the finders where the page is updated dynamically after value changes to the input.
55
56
  data:
56
57
  aria_controls: "wrapper"
58
+ with_custom_button_text:
59
+ description: |
60
+ The search box component may be used multiple times on a page -- for example, on a [guidance and regulation finder results page](https://www.gov.uk/search/guidance-and-regulation?keywords=bananas&order=relevance) there is both the sitewide search in the header and also for the specific finder.
61
+
62
+ To avoid confusion, the text inside the button should be different for each form. This can be done by setting the `button_text` parameter.
63
+
64
+ This is visually hidden text -- to check for changes use a screen reader or inspect the button element.
65
+ data:
66
+ button_text: "Search absolutely everywhere"
@@ -35,6 +35,7 @@ examples:
35
35
  borderless: true
36
36
 
37
37
  with_edit_on_section:
38
+ description: For all links shown in the component, see the <a href="/component-guide/summary_list/with_customised_links">with customised links example</a> for guidance.
38
39
  data:
39
40
  <<: *default-example-data
40
41
  edit:
@@ -43,6 +44,7 @@ examples:
43
44
  gtm: "edit-title-summary-body"
44
45
 
45
46
  with_delete_on_section:
47
+ description: For all links shown in the component, see the <a href="/component-guide/summary_list/with_customised_links">with customised links example</a> for guidance.
46
48
  data:
47
49
  <<: *default-example-data
48
50
  delete:
@@ -51,6 +53,7 @@ examples:
51
53
  gtm: "delete-title-summary-body"
52
54
 
53
55
  with_edit_and_delete_on_section:
56
+ description: For all links shown in the component, see the <a href="/component-guide/summary_list/with_customised_links">with customised links example</a> for guidance.
54
57
  data:
55
58
  <<: *default-example-data
56
59
  edit:
@@ -62,32 +65,28 @@ examples:
62
65
  data_attributes:
63
66
  gtm: "delete-title-summary-body"
64
67
 
68
+ with_customised_links:
69
+ description: |
70
+ For all links shown in the component, visually hidden text containing the name of the thing it refers to is automatically appended. This offers a better experience for screen reader users by making the link text unique and more explicit. In the example below, the link text would be `Change Title, summary and body`.
71
+
72
+ The text of the link can be customised using the `link_text` option. Take care that the provided `link_text` still makes sense to screen readers when combined with the title. For instance, `Reorder` link text and `Items` title becomes `Reorder Items`, which reads fine, but link text of `Summary` would read as `Summary Items`, which does not make sense.
73
+
74
+ To override this behaviour, use `link_text_no_enhance` on the link in question, as shown. This will remove the visually hidden text, allowing you to add your own. The component will render a `span` element with a class of `govuk-visually-hidden` included in a passed [capture block](https://apidock.com/rails/ActionView/Helpers/CaptureHelper/capture) as the `link_text` parameter.
75
+ data:
76
+ <<: *default-example-data
77
+ edit:
78
+ href: "edit-title-summary-body"
79
+ link_text: Edit this document <span class="govuk-visually-hidden">my hidden text for screenreaders</span>
80
+ link_text_no_enhance: true
81
+
65
82
  with_custom_section_heading:
66
83
  data:
67
84
  <<: *default-example-data
68
85
  heading_level: 2
69
86
  heading_size: l
70
87
 
71
- with_custom_link_on_section:
72
- description: |
73
- Take care that the provided `link_text` still makes sense to screen readers when combined with the title.
74
- For instance, `Reorder` link text and `Items` title becomes `Reorder Items`, which reads fine, but link text
75
- of `Summary` would read as `Summary Items`, which does not make sense.
76
- data:
77
- edit:
78
- href: "custom-link"
79
- link_text: "Reorder"
80
- title: "Items"
81
- items:
82
- - field: "Item 1"
83
- value: "Value 2"
84
- - field: "Item 2"
85
- value: "Value 2"
86
- - field: "Item 3"
87
- value: "Value 3"
88
-
89
88
  with_edit_on_individual_items:
90
- description: The link text can be optionally modified using the 'link_text' parameter, as for the edit link in previous examples.
89
+ description: For all links shown in the component, see the <a href="/component-guide/summary_list/with_customised_links">with customised links example</a> for guidance.
91
90
  data:
92
91
  title: "Title, summary and body"
93
92
  items:
@@ -113,6 +112,21 @@ examples:
113
112
  href: "delete-body"
114
113
  link_text: "Remove"
115
114
 
115
+ wide_title_layout:
116
+ description: Allows a slightly adjusted layout for longer text in the field name.
117
+ data:
118
+ title: Privacy settings
119
+ wide_title: true
120
+ items:
121
+ - field: "GOV.UK can use cookies while you’re signed in"
122
+ value: "No"
123
+ edit:
124
+ href: "edit-cookies"
125
+ - field: "GOV.UK can send you feedback emails"
126
+ value: "Yes"
127
+ edit:
128
+ href: "edit-feedback"
129
+
116
130
  with_block:
117
131
  description: Use the summary list with a block when you need to show an empty state message or load another component.
118
132
  data:
@@ -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 %>
@@ -1,8 +1,22 @@
1
- <button class="search-toggle js-header-toggle" data-search-toggle-for="search">Show search</button>
2
- <form id="search" class="gem-c-layout-header__search-form govuk-clearfix" action="/search" method="get" role="search">
1
+ <button
2
+ class="search-toggle js-header-toggle"
3
+ data-search-toggle-for="search"
4
+ data-show-text="<%= t("components.layout_header.show_button") %>"
5
+ data-hide-text="<%= t("components.layout_header.hide_button") %>"
6
+ >
7
+ <%= t("components.layout_header.show_button") %>
8
+ </button>
9
+ <form
10
+ action="/search"
11
+ class="gem-c-layout-header__search-form govuk-clearfix"
12
+ id="search"
13
+ method="get"
14
+ role="search"
15
+ >
3
16
  <%= render "govuk_publishing_components/components/search", {
17
+ button_text: t("components.layout_header.search_button"),
4
18
  id: "site-search-text",
19
+ margin_bottom: 0,
5
20
  no_border: true,
6
- margin_bottom: 0
7
21
  } %>
8
22
  </form>
@@ -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: {
@@ -4,11 +4,11 @@
4
4
  #
5
5
  # To use the locales, use `I18n.t`:
6
6
  #
7
- # I18n.t 'hello'
7
+ # I18n.t "hello"
8
8
  #
9
9
  # In views, this is aliased to just `t`:
10
10
  #
11
- # <%= t('hello') %>
11
+ # <%= t("hello") %>
12
12
  #
13
13
  # To use a different locale, set it with `I18n.locale`:
14
14
  #
@@ -31,11 +31,11 @@ en:
31
31
  article_schema:
32
32
  scoped_search_description: "Search within %{title}"
33
33
  back_link:
34
- back: 'Back'
34
+ back: "Back"
35
35
  checkboxes:
36
- or: 'or'
36
+ or: "or"
37
37
  contents_list:
38
- contents: Contents
38
+ contents: "Contents"
39
39
  feedback:
40
40
  is_this_page_useful: "Is this page useful?"
41
41
  yes: "Yes"
@@ -54,15 +54,14 @@ 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
57
+ layout_header:
58
+ search_button: "Search GOV.UK"
59
+ show_button: "Show search"
60
+ hide_button: "Hide search"
62
61
  organisation_schema:
63
62
  all_content_search_description: "Find all content from %{organisation}"
64
63
  radio:
65
- or: 'or'
64
+ or: "or"
66
65
  related_navigation:
67
66
  collections: "Collection"
68
67
  external_links: "Elsewhere on the web"
@@ -81,15 +80,26 @@ en:
81
80
  link_path: "/transition"
82
81
  link_text: "Check what you need to do"
83
82
  take_action_list:
84
- red: Check
85
- amber: Change
86
- green: Go
87
- aria_label: Brexit campaign slogan, Check, Change, Go.
83
+ red: "Check"
84
+ amber: "Change"
85
+ green: "Go"
86
+ aria_label: "Brexit campaign slogan, Check, Change, Go."
88
87
  related_footer_navigation:
89
88
  collections: "Collections"
90
89
  policies: "Policies"
91
90
  statistical_data_sets: "Statistical data sets"
92
91
  topical_events: "Topical events"
92
+ search_box:
93
+ search_button: "Search"
94
+ label: "Search on GOV.UK"
95
+ input_title: "Search"
96
+ show_password:
97
+ show: "Show"
98
+ hide: "Hide"
99
+ show_password: "Show password"
100
+ hide_password: "Hide password"
101
+ announce_show: "Your password is shown"
102
+ announce_hide: "Your password is hidden"
93
103
  print_link:
94
104
  text: "Print this page"
95
105
  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