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.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/component_guide/application.scss +13 -15
- data/app/assets/stylesheets/govuk_publishing_components/all-components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +25 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/specific-components.scss +0 -1
- data/app/controllers/govuk_publishing_components/applications_page_controller.rb +1 -1
- data/app/controllers/govuk_publishing_components/audit_controller.rb +0 -1
- data/app/models/govuk_publishing_components/component_doc.rb +10 -3
- data/app/models/govuk_publishing_components/component_wrapper_helper_options.rb +4 -2
- data/app/views/govuk_publishing_components/component_guide/component_doc/_component.html.erb +1 -1
- data/app/views/govuk_publishing_components/component_guide/component_doc/_preview.html.erb +2 -2
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +47 -33
- data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_option_select.html.erb +2 -2
- data/lib/govuk_publishing_components/presenters/devolved_nations_helper.rb +13 -7
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/choices.js/README.md +140 -30
- data/node_modules/choices.js/package.json +10 -13
- data/node_modules/choices.js/public/assets/scripts/choices.js +144 -89
- data/node_modules/choices.js/public/assets/scripts/choices.min.js +2 -2
- data/node_modules/choices.js/public/assets/scripts/choices.mjs +144 -89
- data/node_modules/choices.js/public/assets/scripts/choices.search-basic.js +144 -86
- data/node_modules/choices.js/public/assets/scripts/choices.search-basic.min.js +2 -2
- data/node_modules/choices.js/public/assets/scripts/choices.search-basic.mjs +144 -86
- data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.js +139 -77
- data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.min.js +2 -2
- data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.mjs +139 -77
- data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.js +137 -76
- data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.min.js +2 -2
- data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.mjs +137 -76
- data/node_modules/choices.js/public/assets/styles/base.css +39 -9
- data/node_modules/choices.js/public/assets/styles/base.css.map +1 -1
- data/node_modules/choices.js/public/assets/styles/base.min.css +1 -1
- data/node_modules/choices.js/public/assets/styles/choices.css +93 -95
- data/node_modules/choices.js/public/assets/styles/choices.css.map +1 -1
- data/node_modules/choices.js/public/assets/styles/choices.min.css +1 -1
- data/node_modules/choices.js/public/types/src/scripts/choices.d.ts +11 -0
- data/node_modules/choices.js/public/types/src/scripts/components/container.d.ts +2 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/choice-full.d.ts +2 -1
- data/node_modules/choices.js/public/types/src/scripts/interfaces/class-names.d.ts +2 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/input-choice.d.ts +2 -1
- data/node_modules/choices.js/public/types/src/scripts/interfaces/options.d.ts +19 -3
- data/node_modules/choices.js/public/types/src/scripts/interfaces/store.d.ts +2 -1
- data/node_modules/choices.js/public/types/src/scripts/interfaces/types.d.ts +2 -1
- data/node_modules/choices.js/public/types/src/scripts/lib/utils.d.ts +3 -1
- data/node_modules/choices.js/src/scripts/choices.ts +110 -64
- data/node_modules/choices.js/src/scripts/components/container.ts +8 -0
- data/node_modules/choices.js/src/scripts/components/wrapped-select.ts +3 -1
- data/node_modules/choices.js/src/scripts/defaults.ts +12 -7
- data/node_modules/choices.js/src/scripts/interfaces/choice-full.ts +2 -1
- data/node_modules/choices.js/src/scripts/interfaces/class-names.ts +2 -0
- data/node_modules/choices.js/src/scripts/interfaces/event-choice.ts +1 -0
- data/node_modules/choices.js/src/scripts/interfaces/input-choice.ts +4 -2
- data/node_modules/choices.js/src/scripts/interfaces/options.ts +21 -3
- data/node_modules/choices.js/src/scripts/interfaces/store.ts +2 -1
- data/node_modules/choices.js/src/scripts/interfaces/types.ts +3 -1
- data/node_modules/choices.js/src/scripts/lib/utils.ts +27 -4
- data/node_modules/choices.js/src/scripts/search/kmp.ts +2 -1
- data/node_modules/choices.js/src/scripts/store/store.ts +4 -1
- data/node_modules/choices.js/src/scripts/templates.ts +6 -3
- data/node_modules/choices.js/src/styles/base.scss +42 -9
- data/node_modules/choices.js/src/styles/choices.scss +119 -93
- metadata +2 -3
- 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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b8421678343bb40c9ee8e546ca65299cda8e4bb703979a2c3ca1604e8966b87a
|
|
4
|
+
data.tar.gz: 6c81db1b7aed47aaca271beaaf0211cbc2565fb136fb2798af621f0465889b79
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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(
|
|
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
|
-
.
|
|
175
|
-
|
|
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,
|
data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss
CHANGED
|
@@ -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
|
|
7
|
+
apps: %w[collections email-alert-frontend feedback finder-frontend frontend smart-answers].sort,
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
type: "publishing",
|
|
@@ -34,7 +34,10 @@ module GovukPublishingComponents
|
|
|
34
34
|
|
|
35
35
|
def component_wrapper_options
|
|
36
36
|
if uses_component_wrapper_helper?
|
|
37
|
-
|
|
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
|
|
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
|
data/app/views/govuk_publishing_components/component_guide/component_doc/_component.html.erb
CHANGED
|
@@ -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
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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-
|
|
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
|
-
</
|
|
79
|
+
</h3>
|
|
72
80
|
<%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, example: @component_doc.example %>
|
|
73
81
|
|
|
74
|
-
<
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
124
|
+
</div>
|
|
125
|
+
<% end %>
|
|
113
126
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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 |
|
|
37
|
-
<%= content_tag(:li, link_to(
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
-
.
|
|
38
|
-
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
|
|
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
|