govuk_publishing_components 7.0.0 → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/feed-icon-black.png +0 -0
- data/app/assets/images/govuk_publishing_components/mail-icon-x2.png +0 -0
- data/app/assets/images/govuk_publishing_components/mail-icon.png +0 -0
- data/app/assets/stylesheets/component_guide/all_components.scss +1 -0
- data/app/assets/stylesheets/component_guide/all_components_print.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +40 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +35 -0
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +21 -0
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +16 -0
- data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +17 -0
- data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +61 -0
- data/app/views/layouts/govuk_publishing_components/application.html.erb +6 -0
- data/config/initializers/assets.rb +9 -1
- data/config/locales/en.yml +2 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aea5cae481a9b11f30bd16a7146a2d0159c4503d0086a0f955f462f3c58c167a
|
4
|
+
data.tar.gz: 9f8de3bb34f9b81cc85e9ca201dd6ddbae8623c0ed069d8485a02d1aaf875ca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1add985825ea66e4feea446cd85d8acb649ffc5474513536acb1dcaab5cc004c108b6644393ba4a2bea47de1e0776e06a5f1bfb7adae8369b33c2695af9f43bf
|
7
|
+
data.tar.gz: 57938d8ca795fcc5fe03bef9be118faac6ea7ce16e38651cb231fea4f139872584a78c695039376b10afaf860460af57527b64fcd13ecd8095b64380ead5aa73
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "../govuk_publishing_components/all_components";
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "../govuk_publishing_components/all_components_print";
|
@@ -21,6 +21,8 @@
|
|
21
21
|
@import "components/step-by-step-nav";
|
22
22
|
@import "components/step-by-step-nav-header";
|
23
23
|
@import "components/step-by-step-nav-related";
|
24
|
+
@import "components/subscription-links";
|
25
|
+
@import "components/translation-nav";
|
24
26
|
@import "components/feedback";
|
25
27
|
@import "components/inverse-header";
|
26
28
|
@import "components/success-alert";
|
@@ -0,0 +1,40 @@
|
|
1
|
+
.gem-c-subscription-links {
|
2
|
+
@include bold-19;
|
3
|
+
|
4
|
+
.gem-c-subscription-links__list {
|
5
|
+
list-style: none;
|
6
|
+
margin-left: -$gutter-half / 2;
|
7
|
+
margin-right: -$gutter-half / 2;
|
8
|
+
}
|
9
|
+
|
10
|
+
.gem-c-subscription-links__list-item {
|
11
|
+
display: inline-block;
|
12
|
+
margin-left: $gutter-half / 2;
|
13
|
+
margin-right: $gutter-half / 2;
|
14
|
+
margin-bottom: $gutter-half;
|
15
|
+
}
|
16
|
+
|
17
|
+
.gem-c-subscription-links__link {
|
18
|
+
text-decoration: none;
|
19
|
+
padding-left: 28px;
|
20
|
+
background-repeat: no-repeat;
|
21
|
+
background-position: 0 20%;
|
22
|
+
|
23
|
+
@include media(tablet) {
|
24
|
+
background-position: 0 35%;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
.gem-c-subscription-links__link--feed {
|
29
|
+
background-image: image-url("govuk_publishing_components/feed-icon-black.png");
|
30
|
+
}
|
31
|
+
|
32
|
+
.gem-c-subscription-links__link--email-alerts {
|
33
|
+
background-image: image-url("govuk_publishing_components/mail-icon.png");
|
34
|
+
|
35
|
+
@include device-pixel-ratio() {
|
36
|
+
background-image: image-url("govuk_publishing_components/mail-icon-x2.png");
|
37
|
+
background-size: 20px 14px;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
.gem-c-translation-nav {
|
2
|
+
@include responsive-top-margin;
|
3
|
+
@include core-16;
|
4
|
+
margin-bottom: $gutter;
|
5
|
+
border-bottom: 1px solid $border-colour;
|
6
|
+
}
|
7
|
+
|
8
|
+
.gem-c-translation-nav__list {
|
9
|
+
@extend %contain-floats;
|
10
|
+
list-style: none;
|
11
|
+
margin-left: -$gutter-one-third;
|
12
|
+
margin-right: -$gutter-one-third;
|
13
|
+
}
|
14
|
+
|
15
|
+
.gem-c-translation-nav__list-item {
|
16
|
+
float: left;
|
17
|
+
padding-left: $gutter-one-third;
|
18
|
+
padding-right: $gutter-one-third;
|
19
|
+
margin-bottom: $gutter-one-third;
|
20
|
+
border-right: 1px solid $border-colour;
|
21
|
+
height: 16px;
|
22
|
+
|
23
|
+
.direction-rtl & {
|
24
|
+
direction: rtl;
|
25
|
+
float: right;
|
26
|
+
text-align: start;
|
27
|
+
border-left: 1px solid $border-colour;
|
28
|
+
border-right: 0;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
.gem-c-translation-nav__list-item:last-child {
|
33
|
+
border-right: 0;
|
34
|
+
border-left: 0;
|
35
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%
|
2
|
+
email_signup_link ||= false
|
3
|
+
feed_link ||= false
|
4
|
+
%>
|
5
|
+
<% if email_signup_link || feed_link %>
|
6
|
+
<section class="gem-c-subscription-links">
|
7
|
+
<h2 class="visuallyhidden">Subscriptions</h2>
|
8
|
+
<ul class="gem-c-subscription-links__list">
|
9
|
+
<% if email_signup_link.present? %>
|
10
|
+
<li class="gem-c-subscription-links__list-item">
|
11
|
+
<%= link_to "Get email alerts", email_signup_link, class: "gem-c-subscription-links__link gem-c-subscription-links__link--email-alerts" %>
|
12
|
+
</li>
|
13
|
+
<% end %>
|
14
|
+
<% if feed_link.present? %>
|
15
|
+
<li class="gem-c-subscription-links__list-item">
|
16
|
+
<%= link_to "Subscribe to feed", feed_link, class: "gem-c-subscription-links__link gem-c-subscription-links__link--feed" %>
|
17
|
+
</li>
|
18
|
+
<% end %>
|
19
|
+
</ul>
|
20
|
+
</section>
|
21
|
+
<% end %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% translations ||= [] %>
|
2
|
+
<% if translations.length > 1 %>
|
3
|
+
<nav role="navigation" class="gem-c-translation-nav" aria-label="<%= t("common.translations") %>">
|
4
|
+
<ul class="gem-c-translation-nav__list">
|
5
|
+
<% translations.each.with_index do |translation, i| %>
|
6
|
+
<li class="gem-c-translation-nav__list-item">
|
7
|
+
<% if translation[:active] %>
|
8
|
+
<span lang="<%= translation[:locale] %>"><%= translation[:text] %></span>
|
9
|
+
<% else %>
|
10
|
+
<%= link_to translation[:text], translation[:base_path], hreflang: translation[:locale], lang: translation[:locale], rel: "alternate" %>
|
11
|
+
<% end %>
|
12
|
+
</li>
|
13
|
+
<% end %>
|
14
|
+
</ul>
|
15
|
+
</nav>
|
16
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: Subscription links
|
2
|
+
description: Links to ‘Get email alerts’ and ‘Subscribe to feed’
|
3
|
+
accessibility_criteria: |
|
4
|
+
Icons in subscription links must be presentational and ignored by screen readers.
|
5
|
+
shared_accessibility_criteria:
|
6
|
+
- link
|
7
|
+
examples:
|
8
|
+
default:
|
9
|
+
data:
|
10
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
11
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
12
|
+
with_only_email_signup_link:
|
13
|
+
data:
|
14
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
15
|
+
with_only_feed_link:
|
16
|
+
data:
|
17
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
@@ -0,0 +1,61 @@
|
|
1
|
+
name: Translation navigation
|
2
|
+
description: A list of links to available translations
|
3
|
+
body: The active property indicates the current language.
|
4
|
+
accessibility_criteria: |
|
5
|
+
The component must:
|
6
|
+
|
7
|
+
- be [a landmark with a navigation role](https://accessibility.blog.gov.uk/2016/05/27/using-navigation-landmarks/)
|
8
|
+
- have an accessible name in the current language, eg "Translations"
|
9
|
+
|
10
|
+
The translation links must:
|
11
|
+
|
12
|
+
- [identify the language of the text](https://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html#meaning-other-lang-id-examples-head)
|
13
|
+
|
14
|
+
[Watch a screen reader pronounce text differently based on lang attribute](https://bit.ly/screenreaderpronunciation)
|
15
|
+
shared_accessibility_criteria:
|
16
|
+
- link
|
17
|
+
examples:
|
18
|
+
default:
|
19
|
+
data:
|
20
|
+
translations:
|
21
|
+
- locale: 'en'
|
22
|
+
base_path: '/en'
|
23
|
+
text: 'English'
|
24
|
+
active: true
|
25
|
+
- locale: 'hi'
|
26
|
+
base_path: '/hi'
|
27
|
+
text: 'हिंदी'
|
28
|
+
multiple_translations:
|
29
|
+
data:
|
30
|
+
translations:
|
31
|
+
- locale: 'en'
|
32
|
+
base_path: '/en'
|
33
|
+
text: 'English'
|
34
|
+
active: true
|
35
|
+
- locale: 'fr'
|
36
|
+
base_path: '/fr'
|
37
|
+
text: 'Français'
|
38
|
+
- locale: 'hi'
|
39
|
+
base_path: '/hi'
|
40
|
+
text: 'हिंदी'
|
41
|
+
- locale: 'ja'
|
42
|
+
base_path: '/ja'
|
43
|
+
text: '日本語'
|
44
|
+
- locale: 'ur'
|
45
|
+
base_path: '/ur'
|
46
|
+
text: 'اردو'
|
47
|
+
- locale: 'zh'
|
48
|
+
base_path: '/zh'
|
49
|
+
text: '中文'
|
50
|
+
right_to_left:
|
51
|
+
data:
|
52
|
+
translations:
|
53
|
+
- locale: 'en'
|
54
|
+
base_path: '/en'
|
55
|
+
text: 'English'
|
56
|
+
- locale: 'ar'
|
57
|
+
base_path: '/ar'
|
58
|
+
text: 'العربية'
|
59
|
+
active: true
|
60
|
+
context:
|
61
|
+
right_to_left: true
|
@@ -12,6 +12,12 @@
|
|
12
12
|
</title>
|
13
13
|
<%= stylesheet_link_tag "component_guide/application", media: "screen" %>
|
14
14
|
<%= stylesheet_link_tag "#{GovukPublishingComponents::Config.application_stylesheet}" %>
|
15
|
+
|
16
|
+
<% if GovukPublishingComponents::Config.static %>
|
17
|
+
<%= stylesheet_link_tag "component_guide/all_components", media: "screen" %>
|
18
|
+
<%= stylesheet_link_tag "component_guide/all_components_print", media: "print" %>
|
19
|
+
<% end %>
|
20
|
+
|
15
21
|
<% if GovukPublishingComponents::Config.application_print_stylesheet %>
|
16
22
|
<%= stylesheet_link_tag "#{GovukPublishingComponents::Config.application_print_stylesheet}", media: "print" %>
|
17
23
|
<% end %>
|
@@ -1 +1,9 @@
|
|
1
|
-
Rails.application.config.assets.precompile += %w(
|
1
|
+
Rails.application.config.assets.precompile += %w(
|
2
|
+
govuk_publishing_components/component_guide.css
|
3
|
+
component_guide/all_components.css
|
4
|
+
component_guide/all_components_print.css
|
5
|
+
govuk_publishing_components/search-button.png
|
6
|
+
govuk_publishing_components/feed-icon-black.png
|
7
|
+
govuk_publishing_components/mail-icon-x2.png
|
8
|
+
govuk_publishing_components/mail-icon.png
|
9
|
+
)
|
data/config/locales/en.yml
CHANGED
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: 7.
|
4
|
+
version: 7.1.0
|
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: 2018-
|
11
|
+
date: 2018-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -301,6 +301,9 @@ files:
|
|
301
301
|
- README.md
|
302
302
|
- Rakefile
|
303
303
|
- app/assets/config/govuk_publishing_components_manifest.js
|
304
|
+
- app/assets/images/govuk_publishing_components/feed-icon-black.png
|
305
|
+
- app/assets/images/govuk_publishing_components/mail-icon-x2.png
|
306
|
+
- app/assets/images/govuk_publishing_components/mail-icon.png
|
304
307
|
- app/assets/images/govuk_publishing_components/search-button.png
|
305
308
|
- app/assets/javascripts/component_guide/accessibility-test.js
|
306
309
|
- app/assets/javascripts/component_guide/application.js
|
@@ -315,6 +318,8 @@ files:
|
|
315
318
|
- app/assets/javascripts/govuk_publishing_components/lib/current-location.js
|
316
319
|
- app/assets/javascripts/govuk_publishing_components/lib/history-support.js
|
317
320
|
- app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
|
321
|
+
- app/assets/stylesheets/component_guide/all_components.scss
|
322
|
+
- app/assets/stylesheets/component_guide/all_components_print.scss
|
318
323
|
- app/assets/stylesheets/component_guide/application.scss
|
319
324
|
- app/assets/stylesheets/govuk_publishing_components/_all_components.scss
|
320
325
|
- app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss
|
@@ -334,8 +339,10 @@ files:
|
|
334
339
|
- app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss
|
335
340
|
- app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss
|
336
341
|
- app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss
|
342
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss
|
337
343
|
- app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss
|
338
344
|
- app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-navigation.scss
|
345
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss
|
339
346
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss
|
340
347
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss
|
341
348
|
- app/assets/stylesheets/govuk_publishing_components/components/mixins/_clearfix.scss
|
@@ -377,8 +384,10 @@ files:
|
|
377
384
|
- app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb
|
378
385
|
- app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
|
379
386
|
- app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb
|
387
|
+
- app/views/govuk_publishing_components/components/_subscription-links.html.erb
|
380
388
|
- app/views/govuk_publishing_components/components/_success_alert.html.erb
|
381
389
|
- app/views/govuk_publishing_components/components/_taxonomy_navigation.html.erb
|
390
|
+
- app/views/govuk_publishing_components/components/_translation-nav.html.erb
|
382
391
|
- app/views/govuk_publishing_components/components/docs/back_link.yml
|
383
392
|
- app/views/govuk_publishing_components/components/docs/button.yml
|
384
393
|
- app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml
|
@@ -398,8 +407,10 @@ files:
|
|
398
407
|
- app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml
|
399
408
|
- app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml
|
400
409
|
- app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml
|
410
|
+
- app/views/govuk_publishing_components/components/docs/subscription-links.yml
|
401
411
|
- app/views/govuk_publishing_components/components/docs/success_alert.yml
|
402
412
|
- app/views/govuk_publishing_components/components/docs/taxonomy_navigation.yml
|
413
|
+
- app/views/govuk_publishing_components/components/docs/translation-nav.yml
|
403
414
|
- app/views/govuk_publishing_components/components/related_navigation/_section.html.erb
|
404
415
|
- app/views/layouts/govuk_publishing_components/application.html.erb
|
405
416
|
- config/initializers/assets.rb
|