govuk_publishing_components 65.1.0 → 65.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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/component_guide/application.scss +13 -15
  3. data/app/assets/stylesheets/govuk_publishing_components/all-components.scss +0 -1
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +25 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +1 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +4 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/specific-components.scss +0 -1
  8. data/app/controllers/govuk_publishing_components/applications_page_controller.rb +1 -1
  9. data/app/controllers/govuk_publishing_components/audit_controller.rb +0 -1
  10. data/app/models/govuk_publishing_components/component_doc.rb +10 -3
  11. data/app/models/govuk_publishing_components/component_wrapper_helper_options.rb +4 -2
  12. data/app/views/govuk_publishing_components/component_guide/component_doc/_component.html.erb +1 -1
  13. data/app/views/govuk_publishing_components/component_guide/component_doc/_preview.html.erb +2 -2
  14. data/app/views/govuk_publishing_components/component_guide/show.html.erb +47 -33
  15. data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +2 -2
  16. data/app/views/govuk_publishing_components/components/_option_select.html.erb +2 -2
  17. data/lib/govuk_publishing_components/presenters/devolved_nations_helper.rb +13 -7
  18. data/lib/govuk_publishing_components/version.rb +1 -1
  19. data/node_modules/choices.js/README.md +140 -30
  20. data/node_modules/choices.js/package.json +10 -13
  21. data/node_modules/choices.js/public/assets/scripts/choices.js +144 -89
  22. data/node_modules/choices.js/public/assets/scripts/choices.min.js +2 -2
  23. data/node_modules/choices.js/public/assets/scripts/choices.mjs +144 -89
  24. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.js +144 -86
  25. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.min.js +2 -2
  26. data/node_modules/choices.js/public/assets/scripts/choices.search-basic.mjs +144 -86
  27. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.js +139 -77
  28. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.min.js +2 -2
  29. data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.mjs +139 -77
  30. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.js +137 -76
  31. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.min.js +2 -2
  32. data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.mjs +137 -76
  33. data/node_modules/choices.js/public/assets/styles/base.css +39 -9
  34. data/node_modules/choices.js/public/assets/styles/base.css.map +1 -1
  35. data/node_modules/choices.js/public/assets/styles/base.min.css +1 -1
  36. data/node_modules/choices.js/public/assets/styles/choices.css +93 -95
  37. data/node_modules/choices.js/public/assets/styles/choices.css.map +1 -1
  38. data/node_modules/choices.js/public/assets/styles/choices.min.css +1 -1
  39. data/node_modules/choices.js/public/types/src/scripts/choices.d.ts +11 -0
  40. data/node_modules/choices.js/public/types/src/scripts/components/container.d.ts +2 -0
  41. data/node_modules/choices.js/public/types/src/scripts/interfaces/choice-full.d.ts +2 -1
  42. data/node_modules/choices.js/public/types/src/scripts/interfaces/class-names.d.ts +2 -0
  43. data/node_modules/choices.js/public/types/src/scripts/interfaces/input-choice.d.ts +2 -1
  44. data/node_modules/choices.js/public/types/src/scripts/interfaces/options.d.ts +19 -3
  45. data/node_modules/choices.js/public/types/src/scripts/interfaces/store.d.ts +2 -1
  46. data/node_modules/choices.js/public/types/src/scripts/interfaces/types.d.ts +2 -1
  47. data/node_modules/choices.js/public/types/src/scripts/lib/utils.d.ts +3 -1
  48. data/node_modules/choices.js/src/scripts/choices.ts +110 -64
  49. data/node_modules/choices.js/src/scripts/components/container.ts +8 -0
  50. data/node_modules/choices.js/src/scripts/components/wrapped-select.ts +3 -1
  51. data/node_modules/choices.js/src/scripts/defaults.ts +12 -7
  52. data/node_modules/choices.js/src/scripts/interfaces/choice-full.ts +2 -1
  53. data/node_modules/choices.js/src/scripts/interfaces/class-names.ts +2 -0
  54. data/node_modules/choices.js/src/scripts/interfaces/event-choice.ts +1 -0
  55. data/node_modules/choices.js/src/scripts/interfaces/input-choice.ts +4 -2
  56. data/node_modules/choices.js/src/scripts/interfaces/options.ts +21 -3
  57. data/node_modules/choices.js/src/scripts/interfaces/store.ts +2 -1
  58. data/node_modules/choices.js/src/scripts/interfaces/types.ts +3 -1
  59. data/node_modules/choices.js/src/scripts/lib/utils.ts +27 -4
  60. data/node_modules/choices.js/src/scripts/search/kmp.ts +2 -1
  61. data/node_modules/choices.js/src/scripts/store/store.ts +4 -1
  62. data/node_modules/choices.js/src/scripts/templates.ts +6 -3
  63. data/node_modules/choices.js/src/styles/base.scss +42 -9
  64. data/node_modules/choices.js/src/styles/choices.scss +119 -93
  65. metadata +2 -3
  66. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_contents-list-helper.scss +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a7948661e4bf8e19ab9c6a5510d300c61079c96f2cac1d573d7ef3ec1a3ddda
4
- data.tar.gz: 10d2df108c49d0a839bb897a734d8775deac5a71361e677c3ca937a46c0421f1
3
+ metadata.gz: b8421678343bb40c9ee8e546ca65299cda8e4bb703979a2c3ca1604e8966b87a
4
+ data.tar.gz: 6c81db1b7aed47aaca271beaaf0211cbc2565fb136fb2798af621f0465889b79
5
5
  SHA512:
6
- metadata.gz: 8d374a98c7fd19c17b516a9a8c2a0b3e86dda144a0944e83121196af87b9f4b606f2088b799c873e4cdf2be1d82d552843c790b8094bf5b619c38ad08847e81c
7
- data.tar.gz: 0e56f97f572bc11756d4d49894a09a28f52e77b58a714f40b276bb82eaaa04dd843c9a854f24c7e8e6578f781c9b35812cf499c5b9cf2b66f5e879e376bb1ffc
6
+ metadata.gz: 782d6eb963bf3c7e5495fa6e39ee9959b4078ea23eb908835c74c3950e603bbecae7e9bb0c9bb01351bcae027222bd927a3782b857b0dbdc5fbc8d2e7f33d767
7
+ data.tar.gz: c5f772f69b48a63341335d40a6722873d0d3fa7bf337693abcef88fdaee5d35e841711f99b71080f3d2b72497786cd63363255703b6ed21c1d6c6df315989431
@@ -32,7 +32,7 @@ $gem-guide-border-width: 1px;
32
32
 
33
33
  .component-call {
34
34
  margin-top: -$gem-guide-border-width;
35
- margin-bottom: govuk-spacing(3);
35
+ margin-bottom: govuk-spacing(8);
36
36
 
37
37
  font-family: Consolas, Monaco, "Andale Mono", monospace;
38
38
  font-size: 16px;
@@ -71,6 +71,7 @@ $gem-guide-border-width: 1px;
71
71
  padding: govuk-spacing(8) govuk-spacing(6) govuk-spacing(6) govuk-spacing(6);
72
72
  border: $gem-guide-border-width solid $govuk-border-colour;
73
73
  position: relative;
74
+ margin-bottom: govuk-spacing(8);
74
75
 
75
76
  &.direction-rtl {
76
77
  direction: rtl;
@@ -98,6 +99,10 @@ $gem-guide-border-width: 1px;
98
99
  }
99
100
  }
100
101
 
102
+ .component-guide-preview--no-margin {
103
+ margin-bottom: 0;
104
+ }
105
+
101
106
  .component-guide-preview--simple {
102
107
  border: 0;
103
108
  padding: 0;
@@ -171,26 +176,19 @@ $gem-guide-border-width: 1px;
171
176
  }
172
177
  }
173
178
 
174
- .examples {
175
- .component-example {
176
- margin: 0 0 govuk-spacing(6) * 1.5;
177
-
178
- .example-title {
179
- margin: govuk-spacing(3) 0;
180
- @include govuk-text-colour;
181
- @include govuk-font($size: 24, $weight: bold);
182
- }
183
-
184
- .example-title small {
185
- @include govuk-font($size: 16, $weight: bold);
186
- }
187
- }
179
+ .component-example {
180
+ margin: 0 0 govuk-spacing(6) * 1.5;
188
181
  }
189
182
 
190
183
  .component-markdown {
184
+ margin-bottom: govuk-spacing(8);
191
185
  @include markdown-typography;
192
186
  }
193
187
 
188
+ .component-markdown--no-margin {
189
+ margin-bottom: 0;
190
+ }
191
+
194
192
  // Preview Page Styling
195
193
  html {
196
194
  background: govuk-colour("white");
@@ -6,7 +6,6 @@
6
6
  @import "govuk/overrides/index";
7
7
 
8
8
  @import "govuk_publishing_components/components/helpers/brand-colours";
9
- @import "govuk_publishing_components/components/helpers/contents-list-helper";
10
9
  @import "govuk_publishing_components/lib/link";
11
10
  @import "govuk_publishing_components/lib/print_support";
12
11
 
@@ -79,6 +79,31 @@
79
79
  }
80
80
  }
81
81
 
82
+ .gem-c-contents-list__list-item--numbered {
83
+ .gem-c-contents-list__link {
84
+ display: table;
85
+ }
86
+ }
87
+
88
+ .gem-c-contents-list__number,
89
+ .gem-c-contents-list__numbered-text {
90
+ display: table-cell;
91
+ }
92
+
93
+ .gem-c-contents-list__number {
94
+ min-width: 1.5em;
95
+ }
96
+
97
+ .gem-c-contents-list__numbered-text {
98
+ $contents-text-padding: .3em;
99
+ padding-left: $contents-text-padding;
100
+
101
+ .direction-rtl & {
102
+ padding-left: 0;
103
+ padding-right: $contents-text-padding;
104
+ }
105
+ }
106
+
82
107
  @include govuk-media-query($media-type: print) {
83
108
  // Override default browser indentation
84
109
  .gem-c-contents-list__list,
@@ -6,6 +6,7 @@
6
6
  // set balance as a fallback for firefox, pretty for other browsers
7
7
  text-wrap: balance;
8
8
  text-wrap: pretty;
9
+ @include govuk-text-break-word;
9
10
  }
10
11
  }
11
12
 
@@ -26,16 +26,19 @@
26
26
  margin: 0;
27
27
  padding: 0;
28
28
  @include govuk-font($size: 19);
29
+ @include govuk-text-break-word;
29
30
  }
30
31
 
31
32
  h2 {
32
33
  margin: 0 0 govuk-spacing(4) 0;
33
34
  @include govuk-font($size: 24, $weight: bold);
35
+ @include govuk-text-break-word;
34
36
  }
35
37
 
36
38
  h3 {
37
39
  margin: 0 0 govuk-spacing(4) 0;
38
40
  @include govuk-font($size: 19, $weight: bold);
41
+ @include govuk-text-break-word;
39
42
  }
40
43
 
41
44
  // H4, H5 and H6 are discouraged and thus styled the same
@@ -45,6 +48,7 @@
45
48
  h6 {
46
49
  margin: 0;
47
50
  @include govuk-font($size: 19, $weight: bold);
51
+ @include govuk-text-break-word;
48
52
  }
49
53
 
50
54
  // Links
@@ -6,6 +6,5 @@
6
6
  @import "govuk/overrides/index";
7
7
 
8
8
  @import "govuk_publishing_components/components/helpers/brand-colours";
9
- @import "govuk_publishing_components/components/helpers/contents-list-helper";
10
9
  @import "govuk_publishing_components/lib/link";
11
10
  @import "govuk_publishing_components/lib/print_support";
@@ -4,7 +4,7 @@ module GovukPublishingComponents
4
4
  applications = [
5
5
  {
6
6
  type: "public-facing",
7
- apps: %w[collections email-alert-frontend feedback finder-frontend frontend government-frontend smart-answers].sort,
7
+ apps: %w[collections email-alert-frontend feedback finder-frontend frontend smart-answers].sort,
8
8
  },
9
9
  {
10
10
  type: "publishing",
@@ -14,7 +14,6 @@ module GovukPublishingComponents
14
14
  feedback
15
15
  finder-frontend
16
16
  frontend
17
- government-frontend
18
17
  govspeak
19
18
  govspeak-preview
20
19
  govuk-chat
@@ -34,7 +34,10 @@ module GovukPublishingComponents
34
34
 
35
35
  def component_wrapper_options
36
36
  if uses_component_wrapper_helper?
37
- ComponentWrapperHelperOptions.description
37
+ {
38
+ intro: ComponentWrapperHelperOptions.intro,
39
+ description: ComponentWrapperHelperOptions.description,
40
+ }
38
41
  end
39
42
  end
40
43
 
@@ -74,8 +77,12 @@ module GovukPublishingComponents
74
77
  markdown_to_html(accessibility_criteria) if accessibility_criteria.present?
75
78
  end
76
79
 
77
- def html_component_wrapper_options
78
- markdown_to_html(component_wrapper_options) if component_wrapper_options.present?
80
+ def html_component_wrapper_options_intro
81
+ markdown_to_html(component_wrapper_options[:intro]) if component_wrapper_options.present?
82
+ end
83
+
84
+ def html_component_wrapper_options_description
85
+ markdown_to_html(component_wrapper_options[:description]) if component_wrapper_options.present?
79
86
  end
80
87
 
81
88
  def partial_path
@@ -1,9 +1,11 @@
1
1
  module GovukPublishingComponents
2
2
  module ComponentWrapperHelperOptions
3
+ def self.intro
4
+ "This component uses the component wrapper helper. It accepts the following options and applies them to the parent element of the component. See the [component wrapper helper documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component-wrapper-helper.md) for more detail."
5
+ end
6
+
3
7
  def self.description
4
8
  "
5
- This component uses the component wrapper helper. It accepts the following options and applies them to the parent element of the component. See the [component wrapper helper documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/component-wrapper-helper.md) for more detail.
6
-
7
9
  - `id` - accepts a string for the element ID attribute
8
10
  - `data_attributes` - accepts a hash of data attributes
9
11
  - `aria` - accepts a hash of aria attributes
@@ -1,4 +1,4 @@
1
- <div class="component-guide-preview
1
+ <div class="component-guide-preview component-guide-preview--no-margin
2
2
  <% if example.right_to_left? %>direction-rtl<% end %>
3
3
  <% if example.dark_background? %>dark-background<% end %>
4
4
  <% if example.black_background? %>black-background<% end %>
@@ -1,8 +1,8 @@
1
1
  <% if component_doc.display_preview? %>
2
2
  <div data-module="test-a11y" data-excluded-rules="<%= @component_doc.accessibility_excluded_rules %>">
3
3
  <%= render "govuk_publishing_components/component_guide/component_doc/component", component_doc: @component_doc, example: example, preview_page: false %>
4
- <div class="component-guide-preview component-guide-preview--violation" data-module="test-a11y-violation" data-content="Accessibility Issues"></div>
5
- <div class="component-guide-preview component-guide-preview--warning" data-module="test-a11y-warning" data-content="Potential accessibility issues: need manual check"></div>
4
+ <div class="component-guide-preview component-guide-preview--no-margin component-guide-preview--violation" data-module="test-a11y-violation" data-content="Accessibility Issues"></div>
5
+ <div class="component-guide-preview component-guide-preview--no-margin component-guide-preview--warning" data-module="test-a11y-warning" data-content="Potential accessibility issues: need manual check"></div>
6
6
  </div>
7
7
  <% end %>
8
8
 
@@ -48,10 +48,16 @@
48
48
  }
49
49
  end)
50
50
  content_items = [
51
- { href: "#how-it-looks", text: "How it looks" },
52
- { href: "#how-to-call-this-component", text: "How to call this component" },
53
- ({ href: "#govuk-design-system", text: "GOV.UK Design System" } if @component_doc.govuk_frontend_components.any?),
54
- ({ href: "#accessibility-acceptance-criteria", text: "Accessibility acceptance criteria" } if @component_doc.accessibility_criteria.present?),
51
+ ({
52
+ href: "#overview",
53
+ text: "Overview",
54
+ items: [
55
+ { href: "#how-it-looks", text: "How it looks" },
56
+ { href: "#how-to-call-this-component", text: "How to call this component" },
57
+ ({ href: "#govuk-design-system", text: "GOV.UK Design System" } if @component_doc.govuk_frontend_components.any?),
58
+ ({ href: "#accessibility-acceptance-criteria", text: "Accessibility acceptance criteria" } if @component_doc.accessibility_criteria.present?),
59
+ ].compact,
60
+ }),
55
61
  ({
56
62
  href: "#other-examples",
57
63
  text: "Other examples",
@@ -61,21 +67,23 @@
61
67
  %>
62
68
  <%= render "govuk_publishing_components/components/contents_list", {
63
69
  contents: content_items,
70
+ margin_bottom: 8,
64
71
  } %>
65
72
  </div>
66
73
 
67
- <h2 class="govuk-heading-m" id="how-it-looks">
74
+ <h2 class="govuk-heading-l" id="overview">Overview</h2>
75
+ <h3 class="govuk-heading-m" id="how-it-looks">
68
76
  <a href="<%= component_example_path(@component_doc.id, "default") %>" class="govuk-link">How it looks</a>
69
77
  <small class="govuk-!-font-size-16">(<a href="<%= component_preview_path(@component_doc.id, "default") %>" class="govuk-link">preview</a>)</small>
70
78
  <small class="govuk-!-font-size-16">(<a href="<%= component_preview_all_path(@component_doc.id) %>" class="govuk-link">preview all</a>)</small>
71
- </h2>
79
+ </h3>
72
80
  <%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, example: @component_doc.example %>
73
81
 
74
- <h2 class="govuk-heading-m govuk-!-margin-top-4" id="how-to-call-this-component">How to call this component</h2>
82
+ <h3 class="govuk-heading-m govuk-!-margin-top-4" id="how-to-call-this-component">How to call this component</h3>
75
83
  <%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, example: @component_doc.example %>
76
84
 
77
85
  <% if @component_doc.govuk_frontend_components.any? %>
78
- <h2 class="govuk-heading-m" id="govuk-design-system">GOV.UK Design System</h2>
86
+ <h3 class="govuk-heading-m" id="govuk-design-system">GOV.UK Design System</h3>
79
87
  <div class="component-markdown">
80
88
  <p>This component incorporates components from the <%= link_to "GOV.UK Design System", "https://design-system.service.gov.uk" %>:</p>
81
89
 
@@ -90,7 +98,7 @@
90
98
  <% if @component_doc.accessibility_criteria.present? %>
91
99
  <div class="govuk-grid-row component-accessibility-criteria" id="accessibility-acceptance-criteria">
92
100
  <div class="govuk-grid-column-two-thirds">
93
- <h2 class="govuk-heading-m">Accessibility acceptance criteria</h2>
101
+ <h3 class="govuk-heading-m">Accessibility acceptance criteria</h3>
94
102
  <div class="component-markdown">
95
103
  <%= raw(@component_doc.html_accessibility_criteria) %>
96
104
  </div>
@@ -99,34 +107,40 @@
99
107
  <% end %>
100
108
 
101
109
  <% if @component_doc.other_examples.any? or @component_doc.uses_component_wrapper_helper? %>
102
- <div class="examples">
103
- <h2 class="govuk-heading-m" id="other-examples">Other examples</h2>
110
+ <h2 class="govuk-heading-l" id="other-examples">Other examples</h2>
104
111
 
105
- <% if @component_doc.uses_component_wrapper_helper? %>
106
- <div class="component-example" id="standard-options">
107
- <h3 class="example-title">Standard options</h3>
108
- <div class="component-markdown">
109
- <%= raw(@component_doc.html_component_wrapper_options) %>
110
- </div>
112
+ <% if @component_doc.uses_component_wrapper_helper? %>
113
+ <div class="component-example" id="standard-options">
114
+ <h3 class="govuk-heading-m">Standard options</h3>
115
+ <div class="component-markdown">
116
+ <%= raw(@component_doc.html_component_wrapper_options_intro) %>
117
+ <%= render "govuk_publishing_components/components/details", {
118
+ title: "See all standard options",
119
+ disable_ga4: true,
120
+ } do %>
121
+ <%= raw(@component_doc.html_component_wrapper_options_description) %>
122
+ <% end %>
111
123
  </div>
112
- <% end %>
124
+ </div>
125
+ <% end %>
113
126
 
114
- <% @component_doc.other_examples.each do |example| %>
115
- <div class="component-example" id="<%= example.id %>">
116
- <h3 class="example-title">
117
- <a href="<%= component_example_path(@component_doc.id, example.id) %>" class="govuk-link"><%= example.name %></a>
118
- <small>(<a href="<%= component_preview_path(@component_doc.id, example.id) %>" class="govuk-link">preview</a>)</small>
119
- </h3>
120
- <div class="component-markdown">
127
+ <% @component_doc.other_examples.each do |example| %>
128
+ <div class="component-example" id="<%= example.id %>">
129
+ <h3 class="govuk-heading-m">
130
+ <a href="<%= component_example_path(@component_doc.id, example.id) %>" class="govuk-link"><%= example.name %></a>
131
+ <small>(<a href="<%= component_preview_path(@component_doc.id, example.id) %>" class="govuk-link">preview</a>)</small>
132
+ </h3>
133
+ <% if example.html_description %>
134
+ <div class="component-markdown component-markdown--no-margin">
121
135
  <%= raw(example.html_description) %>
122
136
  </div>
123
- <% code_example = capture do %>
124
- <%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, example: example %>
125
- <% end %>
126
- <%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, example: example %>
127
- <%= code_example %>
128
- </div>
129
- <% end %>
130
- </div>
137
+ <% end %>
138
+ <% code_example = capture do %>
139
+ <%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, example: example %>
140
+ <% end %>
141
+ <%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, example: example %>
142
+ <%= code_example %>
143
+ </div>
144
+ <% end %>
131
145
  <% end %>
132
146
  </div>
@@ -33,8 +33,8 @@
33
33
 
34
34
  <% if devolved_nations_helper.nations_with_urls.any? %>
35
35
  <%= content_tag :ul, class: "govuk-list govuk-!-margin-top-1 govuk-!-margin-bottom-0" do -%>
36
- <% devolved_nations_helper.nations_with_urls.each do |k, v| %>
37
- <%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link gem-print-force-link-styles")) %>
36
+ <% devolved_nations_helper.nations_with_urls.each do |alternative_url, nations| %>
37
+ <%= content_tag(:li, link_to(nations, alternative_url, class: "govuk-link gem-print-force-link-styles")) %>
38
38
  <% end %>
39
39
  <% end %>
40
40
  <% end %>
@@ -41,11 +41,11 @@
41
41
 
42
42
  <%= tag.div(**helper.all_attributes) do %>
43
43
  <h3 class="gem-c-option-select__heading js-container-heading">
44
- <div class="gem-c-option-select__toggle js-container-toggle">
44
+ <span class="gem-c-option-select__toggle js-container-toggle">
45
45
  <span class="gem-c-option-select__title js-container-button" id="<%= title_id %>"><%= title %></span>
46
46
  <svg version="1.1" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="0" height="0" class="gem-c-option-select__icon gem-c-option-select__icon--up" aria-hidden="true" focusable="false"><path d="m798.16 609.84l-256-256c-16.683-16.683-43.691-16.683-60.331 0l-256 256c-16.683 16.683-16.683 43.691 0 60.331s43.691 16.683 60.331 0l225.84-225.84 225.84 225.84c16.683 16.683 43.691 16.683 60.331 0s16.683-43.691 0-60.331z" /></svg>
47
47
  <svg version="1.1" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="0" height="0" class="gem-c-option-select__icon gem-c-option-select__icon--down" aria-hidden="true" focusable="false"><path d="m225.84 414.16l256 256c16.683 16.683 43.691 16.683 60.331 0l256-256c16.683-16.683 16.683-43.691 0-60.331s-43.691-16.683-60.331 0l-225.84 225.84-225.84-225.84c-16.683-16.683-43.691-16.683-60.331 0s-16.683 43.691 0 60.331z" /></svg>
48
- </div>
48
+ </span>
49
49
  </h3>
50
50
 
51
51
  <%= content_tag(:div, class: options_container_classes, id: options_container_id, tabindex: "-1") do %>
@@ -33,16 +33,22 @@ module GovukPublishingComponents
33
33
  end
34
34
 
35
35
  def nations_with_urls
36
- @national_applicability
37
- .select do |_, v|
38
- v[:alternative_url]
39
- .present?
36
+ url_to_nation_keys = @national_applicability.each_with_object(Hash.new { |h, k| h[k] = [] }) do |(nation_key, nation_data), hash|
37
+ if nation_data[:alternative_url].present?
38
+ hash[nation_data[:alternative_url]] << nation_key
40
39
  end
41
- end
40
+ end
41
+
42
+ url_to_nation_keys.transform_values do |nation_keys|
43
+ nations_text = nation_keys.each_with_index.map { |key, index|
44
+ name_for_position(key, index, nation_keys.count, true)
45
+ }.join
42
46
 
43
- def alternative_content_text(name)
44
- nation = I18n.t("components.devolved_nations.#{name}.start")
47
+ alternative_content_text(nations_text)
48
+ end
49
+ end
45
50
 
51
+ def alternative_content_text(nation)
46
52
  if I18n.exists?("components.devolved_nations.type.#{@content_type}")
47
53
  I18n.t("components.devolved_nations.type.#{@content_type}", nation:)
48
54
  else
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "65.1.0".freeze
2
+ VERSION = "65.1.1".freeze
3
3
  end