govuk_publishing_components 24.9.1 → 24.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +7 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +36 -6
- data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +12 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +34 -34
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +0 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +0 -37
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +1 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -11
- data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +4 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +20 -20
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +27 -24
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +17 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_form-download.scss +19 -16
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +30 -27
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +26 -21
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +19 -16
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss +21 -18
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +15 -0
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +2 -2
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +25 -0
- data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +7 -7
- data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +6 -6
- data/app/views/govuk_publishing_components/components/_notice.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_show_password.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +4 -4
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +5 -5
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +4 -4
- data/app/views/govuk_publishing_components/components/_success_alert.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +9 -27
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +73 -73
- data/app/views/govuk_publishing_components/components/docs/show_password.yml +10 -0
- data/app/views/govuk_publishing_components/components/docs/success_alert.yml +5 -0
- data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +4 -3
- data/config/locales/cy.yml +0 -5
- data/config/locales/en.yml +11 -8
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +36 -3
- data/app/assets/javascripts/component_guide/visual-regression.js +0 -71
@@ -79,3 +79,13 @@ examples:
|
|
79
79
|
error_items:
|
80
80
|
- text: Look I keep telling you
|
81
81
|
- text: This isn't your password
|
82
|
+
with_data_attributes:
|
83
|
+
description: Data attributes can be passed to add to the input element. If the data attribute starts with `data-button-` this attribute will be applied to the show/hide button, instead of the input. Note that if JS is disabled, all attributes are added to the input.
|
84
|
+
data:
|
85
|
+
label:
|
86
|
+
text: Your password
|
87
|
+
data:
|
88
|
+
example_1: value
|
89
|
+
example_2: thing
|
90
|
+
button_example_1: wotsit
|
91
|
+
button_example_2: doodad
|
@@ -24,6 +24,11 @@ examples:
|
|
24
24
|
data:
|
25
25
|
message: Message to alert the user to a successful action goes here
|
26
26
|
title_id: my-custom-success-id
|
27
|
+
with_styled_link:
|
28
|
+
description: If you need to include a link in your success alert, you need to specify the `govuk-link` and `govuk-notification-banner__link` classes on that link element. This is in line with Design System guidance that the colour of the link in success notification banners can look jarring if any links are a different colour to the principal colour used by the success banner.
|
29
|
+
data:
|
30
|
+
message: Message to alert the user to a successful action goes here
|
31
|
+
description: <p class="govuk-body">A further description with <a href="/a-cool-page" class="govuk-link govuk-notification-banner__link">a link</a></p>
|
27
32
|
long_example:
|
28
33
|
data:
|
29
34
|
message: |
|
@@ -28,7 +28,7 @@
|
|
28
28
|
</div>
|
29
29
|
<div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-questions--something-is-wrong js-prompt-questions">
|
30
30
|
<button class="govuk-button gem-c-feedback__prompt-link js-toggle-form js-something-is-wrong" data-track-category="Onsite Feedback" data-track-action="GOV-UK Open Form" aria-controls="something-is-wrong" aria-expanded="false">
|
31
|
-
<%= t("components.feedback.something_wrong", default: "
|
31
|
+
<%= t("components.feedback.something_wrong", default: "Report a problem with this page") %>
|
32
32
|
</button>
|
33
33
|
</div>
|
34
34
|
</div>
|
data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
class="govuk-header__menu-button govuk-js-header-toggle gem-c-header__menu-button"
|
8
8
|
type="button"
|
9
9
|
>
|
10
|
-
|
10
|
+
<%= t("components.layout_header.menu") %>
|
11
11
|
</button>
|
12
12
|
<%= tag.nav class: "gem-c-header__nav", aria: { label: navigation_aria_label } do %>
|
13
13
|
<ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end">
|
@@ -13,8 +13,8 @@
|
|
13
13
|
class="gem-c-metadata__definition-link"
|
14
14
|
data-controls="toggle-<%= toggle_id %>"
|
15
15
|
data-expanded="false"
|
16
|
-
data-toggled-text="<%= t("
|
17
|
-
<%= t("
|
16
|
+
data-toggled-text="<%= t("components.metadata.toggle_less", default: "Show fewer") %>">
|
17
|
+
<%= t("components.metadata.toggle_more", number: remaining.length, default: "+ #{remaining.length} more") %>
|
18
18
|
</a>
|
19
19
|
</div>
|
20
20
|
<span id="toggle-<%= toggle_id %>" class="gem-c-metadata__toggle-items js-hidden"><%= remaining.to_sentence.html_safe %></span>
|
@@ -23,10 +23,11 @@
|
|
23
23
|
|
24
24
|
<% links.each.with_index(1) do |link, index| %>
|
25
25
|
<%
|
26
|
+
link_class = "govuk-link #{related_nav_helper.section_css_class("govuk-link gem-c-related-navigation__section-link", section_title, link: link, link_is_inline: (index >= section_link_limit))}"
|
26
27
|
link_element = link_to(
|
27
28
|
link[:text],
|
28
29
|
link[:path],
|
29
|
-
class:
|
30
|
+
class: link_class,
|
30
31
|
rel: link[:rel],
|
31
32
|
lang: shared_helper.t_locale_check(link[:locale]),
|
32
33
|
data: {
|
@@ -53,8 +54,8 @@
|
|
53
54
|
class="gem-c-related-navigation__toggle"
|
54
55
|
data-controls="toggle_<%= section_title %>"
|
55
56
|
data-expanded="false"
|
56
|
-
data-toggled-text="<%= t("
|
57
|
-
<%= t("
|
57
|
+
data-toggled-text="<%= t("components.metadata.toggle_less", default: "Show fewer") %>">
|
58
|
+
<%= t("components.metadata.toggle_more",
|
58
59
|
number: related_nav_helper.remaining_link_count(links),
|
59
60
|
default: "+ #{related_nav_helper.remaining_link_count(links)} more") %>
|
60
61
|
</a>
|
data/config/locales/cy.yml
CHANGED
data/config/locales/en.yml
CHANGED
@@ -23,6 +23,12 @@ en:
|
|
23
23
|
common:
|
24
24
|
translations: "Translations"
|
25
25
|
components:
|
26
|
+
accordion:
|
27
|
+
show: "Show"
|
28
|
+
hide: "Hide"
|
29
|
+
show_all: "Show all sections"
|
30
|
+
hide_all: "Hide all sections"
|
31
|
+
this_section_visually_hidden: " this section"
|
26
32
|
attachment:
|
27
33
|
opendocument_html: "This file is in an <a href='https://www.gov.uk/guidance/using-open-document-formats-odf-in-your-organisation' target=%{target} class='govuk-link'>OpenDocument</a> format"
|
28
34
|
request_format_text: "This file may not be suitable for users of assistive technology."
|
@@ -38,13 +44,13 @@ en:
|
|
38
44
|
contents: "Contents"
|
39
45
|
feedback:
|
40
46
|
is_this_page_useful: "Is this page useful?"
|
41
|
-
yes: "Yes"
|
42
|
-
no: "No"
|
47
|
+
"yes": "Yes"
|
48
|
+
"no": "No"
|
43
49
|
maybe: "Maybe"
|
44
50
|
is_useful: "this page is useful"
|
45
51
|
is_not_useful: "this page is not useful"
|
46
52
|
thank_you_for_feedback: "Thank you for your feedback"
|
47
|
-
something_wrong: "
|
53
|
+
something_wrong: "Report a problem with this page"
|
48
54
|
close: "Close"
|
49
55
|
help_us_improve_govuk: "Help us improve GOV.UK"
|
50
56
|
more_about_visit: "To help us improve GOV.UK, we’d like to know more about your visit today. We’ll send you a link to a feedback form. It will take only 2 minutes to fill in. Don’t worry we won’t send you spam or share your email address with anyone."
|
@@ -58,6 +64,8 @@ en:
|
|
58
64
|
search_button: "Search GOV.UK"
|
59
65
|
show_button: "Show search"
|
60
66
|
hide_button: "Hide search"
|
67
|
+
top_level: "Top level"
|
68
|
+
menu: "Menu"
|
61
69
|
organisation_schema:
|
62
70
|
all_content_search_description: "Find all content from %{organisation}"
|
63
71
|
radio:
|
@@ -79,11 +87,6 @@ en:
|
|
79
87
|
title: "Brexit"
|
80
88
|
link_path: "/transition"
|
81
89
|
link_text: "Check what you need to do"
|
82
|
-
take_action_list:
|
83
|
-
red: "Check"
|
84
|
-
amber: "Change"
|
85
|
-
green: "Go"
|
86
|
-
aria_label: "Brexit campaign slogan, Check, Change, Go."
|
87
90
|
related_footer_navigation:
|
88
91
|
collections: "Collections"
|
89
92
|
policies: "Policies"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 24.
|
4
|
+
version: 24.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '2'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: i18n-coverage
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: jasmine
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,6 +206,26 @@ dependencies:
|
|
192
206
|
- - "~>"
|
193
207
|
- !ruby/object:Gem::Version
|
194
208
|
version: 3.0.0
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: percy-capybara
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '4.0'
|
216
|
+
- - ">="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: 4.0.2
|
219
|
+
type: :development
|
220
|
+
prerelease: false
|
221
|
+
version_requirements: !ruby/object:Gem::Requirement
|
222
|
+
requirements:
|
223
|
+
- - "~>"
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
version: '4.0'
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: 4.0.2
|
195
229
|
- !ruby/object:Gem::Dependency
|
196
230
|
name: pry-byebug
|
197
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -396,7 +430,6 @@ files:
|
|
396
430
|
- app/assets/javascripts/component_guide/filter-components.js
|
397
431
|
- app/assets/javascripts/component_guide/vendor/bind-polyfill.js
|
398
432
|
- app/assets/javascripts/component_guide/vendor/matches-polyfill.min.js
|
399
|
-
- app/assets/javascripts/component_guide/visual-regression.js
|
400
433
|
- app/assets/javascripts/govuk_publishing_components/all_components.js
|
401
434
|
- app/assets/javascripts/govuk_publishing_components/analytics.js
|
402
435
|
- app/assets/javascripts/govuk_publishing_components/analytics/analytics.js
|
@@ -1,71 +0,0 @@
|
|
1
|
-
(function (window, document) {
|
2
|
-
window.GOVUK = window.GOVUK || {}
|
3
|
-
|
4
|
-
window.GOVUK.VisualDiffTool = function (currentWindowLocation) {
|
5
|
-
var visualDiffSelector = 'visual-diff'
|
6
|
-
var existingIframe = document.getElementById(visualDiffSelector)
|
7
|
-
var windowLocation = currentWindowLocation || window.location
|
8
|
-
|
9
|
-
if (existingIframe) {
|
10
|
-
existingIframe.parentNode.removeChild(existingIframe)
|
11
|
-
document.body.style.filter = null
|
12
|
-
} else {
|
13
|
-
var iframe = document.createElement('iframe')
|
14
|
-
iframe.id = visualDiffSelector
|
15
|
-
iframe.setAttribute('scrolling', 'no')
|
16
|
-
_setElementStyles(iframe, {
|
17
|
-
width: '100%',
|
18
|
-
height: document.body.scrollHeight + 'px',
|
19
|
-
position: 'absolute',
|
20
|
-
top: '0',
|
21
|
-
'pointer-events': 'none',
|
22
|
-
border: '0'
|
23
|
-
})
|
24
|
-
iframe.style.setProperty('z-index', '999', 'important')
|
25
|
-
|
26
|
-
// For browsers that support it, do mix-blend-mode diff
|
27
|
-
if ('mix-blend-mode' in document.body.style) {
|
28
|
-
_setElementStyles(iframe, { 'mix-blend-mode': 'difference' })
|
29
|
-
document.body.style.filter = 'invert(100%)'
|
30
|
-
} else {
|
31
|
-
// Else do a simple overlay of the live page for comparison (IE and Edge)
|
32
|
-
_setElementStyles(iframe, { opacity: '0.7' })
|
33
|
-
}
|
34
|
-
|
35
|
-
iframe.src = _processComparisonURL(windowLocation)
|
36
|
-
|
37
|
-
if (iframe.src) {
|
38
|
-
document.body.appendChild(iframe)
|
39
|
-
console.log('comparing to ' + iframe.src)
|
40
|
-
}
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
var _processComparisonURL = function (url) {
|
45
|
-
var appName
|
46
|
-
var href = url.href
|
47
|
-
var host = url.host
|
48
|
-
|
49
|
-
if (href.includes('dev.gov.uk/component-guide')) {
|
50
|
-
appName = host.split('.')[0]
|
51
|
-
return _forceHTTPS(href.replace(host, appName + '.herokuapp.com'))
|
52
|
-
} else if (href.includes('dev.gov.uk')) {
|
53
|
-
return _forceHTTPS(href.replace(host, 'www.gov.uk'))
|
54
|
-
} else if (href.includes('-pr-')) {
|
55
|
-
appName = host.split('-pr')[0]
|
56
|
-
return _forceHTTPS(href.replace(host, appName + '.herokuapp.com'))
|
57
|
-
} else {
|
58
|
-
throw new Error('Visual Diff Tool: You need to run this tool against a page running on your local dev environment')
|
59
|
-
}
|
60
|
-
}
|
61
|
-
|
62
|
-
var _forceHTTPS = function (href) {
|
63
|
-
return href.replace('http://', 'https://')
|
64
|
-
}
|
65
|
-
|
66
|
-
var _setElementStyles = function (element, styles) {
|
67
|
-
for (var style in styles) {
|
68
|
-
element.style[style] = styles[style]
|
69
|
-
}
|
70
|
-
}
|
71
|
-
})(window, document)
|