govuk_publishing_components 23.8.0 → 23.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b355f4e112330597b8729fccdf92f6c93cf5fe6a7747085c7cbba64cab1f3ef8
4
- data.tar.gz: 955729aea91b01f3b0f1821760171ada7a753a61ccc67d340c1e933a488e82aa
3
+ metadata.gz: d2f681b78ca039b8a55b58be79b935acbb1f8c1ca30e010d8cbc26eaaf1b26b4
4
+ data.tar.gz: 0f7fdd2c05953ec4a4ccc73e7335d11195923a62fd959a1f99eebc5a944a0bc1
5
5
  SHA512:
6
- metadata.gz: 3c73ebd1e6e8891b6bc2cc5f9dfb0a0262fd0c8144c7201722b88bd9bcabafb52cb1af42e00a42295fbf5c370a0813a3ee2a7df3b033415116f65fe0bcfeb489
7
- data.tar.gz: a3c007af74d59f71a41a54328d2ee8682dcbf26779b8d366c9f47f96e330d9f21856e242bbef1223cf2d1490fa258ff3e658b84d7ae1c969d9db43a225067374
6
+ metadata.gz: 070cf7a1d723b8d4aaddb9cfc366ab2f8b25445316efa000f8eacc4ea4c852aa764da637714ff29073fa016f2056b9a6083e1ed35b75629aea3156068f051232
7
+ data.tar.gz: e5632bc51e2307471d9b48dd668f8b76ff3c1f52f138e4efd07f09580887d6df510153e13d3aa4bfe5f18396d3d7fedd7ab9067f73297752c950a2c2dd989098
@@ -14,3 +14,4 @@
14
14
  //= require ./analytics/ecommerce
15
15
  //= require ./analytics/init
16
16
  //= require ./analytics/scroll-tracker
17
+ //= require ./analytics/explicit-cross-domain-links
@@ -0,0 +1,34 @@
1
+ ;(function (global) {
2
+ 'use strict'
3
+
4
+ var GOVUK = global.GOVUK || {}
5
+ GOVUK.Modules = GOVUK.Modules || {}
6
+
7
+ GOVUK.Modules.ExplicitCrossDomainLinks = function () {
8
+ this.start = function ($module) {
9
+ var element = $module[0]
10
+
11
+ if (!global.ga) { return }
12
+
13
+ global.ga(function () {
14
+ var trackers = global.ga.getAll()
15
+
16
+ if (!trackers.length) { return }
17
+
18
+ var linker = new global.gaplugins.Linker(trackers[0])
19
+
20
+ var attrAction = element.getAttribute('action')
21
+ if (attrAction) {
22
+ element.setAttribute('action', linker.decorate(attrAction))
23
+ }
24
+
25
+ var attrHref = element.getAttribute('href')
26
+ if (attrHref) {
27
+ element.href = linker.decorate(attrHref)
28
+ }
29
+ })
30
+ }
31
+ }
32
+
33
+ global.GOVUK = GOVUK
34
+ })(window)
@@ -26,6 +26,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
26
26
  this.showHide = document.createElement('button')
27
27
  this.showHide.className = 'gem-c-show-password__toggle'
28
28
  this.showHide.setAttribute('aria-controls', this.input.getAttribute('id'))
29
+ this.showHide.setAttribute('type', 'button')
29
30
  this.showHide.innerHTML = this.showPasswordText
30
31
  this.wrapper.insertBefore(this.showHide, this.input.nextSibling)
31
32
 
@@ -105,8 +105,10 @@
105
105
  events: {
106
106
  onReady: function (event) {
107
107
  // update iframe title attribute once video is ready
108
+ // this is done to let screen reader users know that they are focused on a video
109
+ // https://github.com/alphagov/govuk_publishing_components/pull/908#discussion_r302913995
108
110
  var videoTitle = options.title
109
- event.target.f.title = videoTitle + ' (video)'
111
+ event.target.getIframe().title = videoTitle + ' (video)'
110
112
  },
111
113
  onStateChange: function (event) {
112
114
  var eventData = event.data
@@ -36,10 +36,10 @@ $large-input-size: 50px;
36
36
 
37
37
  .gem-c-search__input[type="search"] { // overly specific to prevent some overrides from outside
38
38
  @include govuk-font($size: 19, $line-height: (28 / 19));
39
- padding: 6px;
40
39
  margin: 0;
41
40
  width: 100%;
42
- height: em(34, 16);
41
+ height: em(40, 16);
42
+ padding: em(6, 16);
43
43
  border: $govuk-border-width-form-element solid $govuk-input-border-colour;
44
44
  background: govuk-colour("white");
45
45
  border-radius: 0; //otherwise iphones apply an automatic border radius
@@ -47,6 +47,10 @@ $large-input-size: 50px;
47
47
  -webkit-appearance: none;
48
48
  -moz-appearance: none;
49
49
  appearance: none;
50
+ @include govuk-media-query($from: tablet) {
51
+ height: em(40, 19);
52
+ padding: em(6, 19);
53
+ }
50
54
 
51
55
  // the .focus class is added by JS and ensures that the input remains above the label once clicked/filled in
52
56
  &:focus,
@@ -39,6 +39,8 @@
39
39
 
40
40
  @include govuk-media-query($from: mobile) {
41
41
  margin-left: -2px;
42
+ margin-top: 0;
43
+ margin-bottom: 0;
42
44
  }
43
45
 
44
46
  &:hover {
@@ -4,7 +4,7 @@
4
4
  <div class="gem-c-contextual-sidebar">
5
5
  <% if navigation.show_brexit_cta? && navigation.step_by_step_count.zero? %>
6
6
  <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
7
- <% elsif navigation.step_by_step_count.zero? %>
7
+ <% elsif navigation.step_by_step_count.zero? && !navigation.transition_countdown_exception? %>
8
8
  <%= render 'govuk_publishing_components/components/transition_countdown', {
9
9
  title: t("components.related_navigation.transition.title"),
10
10
  url: t("components.related_navigation.transition.link_path"),
@@ -52,6 +52,10 @@ examples:
52
52
  data:
53
53
  text: "Secondary quiet button"
54
54
  secondary_quiet: true
55
+ secondary_solid_button:
56
+ data:
57
+ text: "Secondary solid button"
58
+ secondary_solid: true
55
59
  destructive_button:
56
60
  data:
57
61
  text: "Destructive button"
@@ -144,3 +144,23 @@ examples:
144
144
  - text: Find out what you’ll get
145
145
  href: "/settled-status-eu-citizens-families/what-settled-and-presettled-status-means"
146
146
  optional: false
147
+ transition_countdown_exception:
148
+ data:
149
+ content_item:
150
+ title: "30 creative teams awarded up to £100,000 each for Festival UK* 2022 R&D project"
151
+ content_id: "c3752802-f091-43a9-ba90-33568fccf391"
152
+ links:
153
+ ordered_related_items:
154
+ - title: Find an apprenticeship
155
+ base_path: /apply-apprenticeship
156
+ - title: Training and study at work
157
+ base_path: /training-study-work-your-rights
158
+ - title: Careers helpline for teenagers
159
+ base_path: /careers-helpline-for-teenagers
160
+ document_collections:
161
+ - title: Recruit an apprentice (formerly apprenticeship vacancies)
162
+ base_path: /government/collections/apprenticeship-vacancies
163
+ document_type: document_collection
164
+ - title: The future of jobs and skills
165
+ base_path: /government/collections/the-future-of-jobs-and-skills
166
+ document_type: document_collection
@@ -70,7 +70,7 @@ examples:
70
70
  description: Don't indent the extra links. Used for links to people pages.
71
71
  data:
72
72
  href: "/government/people/"
73
- image_src: "http://placekitten.com/215/140"
73
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
74
74
  image_alt: "some meaningful alt text please"
75
75
  context:
76
76
  text: "The Rt Hon"
@@ -85,7 +85,7 @@ examples:
85
85
  extra_links_with_no_main_link:
86
86
  description: If extra links are included, the main link is not needed. Note that in this configuration the image is not a link as no link has been supplied.
87
87
  data:
88
- image_src: "http://placekitten.com/215/140"
88
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
89
89
  image_alt: "some meaningful alt text please"
90
90
  heading_text: "John Whiskers MP"
91
91
  extra_links: [
@@ -151,7 +151,7 @@ examples:
151
151
  data:
152
152
  large: true
153
153
  href: "/still-not-a-page"
154
- image_src: "https://assets.publishing.service.gov.uk/frontend/homepage/uk-leaves-the-eu-d84d2981a9953d8b1261c9d25016223b0a8af3c096fa2d5e03510d73a78e3c60.jpg"
154
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
155
155
  image_alt: "some meaningful alt text please"
156
156
  context:
157
157
  date: 2017-06-14 11:30:00
@@ -208,7 +208,7 @@ examples:
208
208
  with_lang:
209
209
  description: |
210
210
  Pass through an appropriate `lang` to set a HTML lang attribute for the component.
211
-
211
+
212
212
  The `lang` attribute **must** be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is `en` or `eng`, Korean is `ko` or `kor` - but if in doubt please check.
213
213
  data:
214
214
  href: "/not-a-page"
@@ -1,9 +1,11 @@
1
- name: Show password input
1
+ name: Show password input (experimental)
2
2
  description: A password input field that allows the password to be shown.
3
3
  body: |
4
4
  Adds a password reveal button to an input that toggles its type from password to text, revealing the password. Does not appear if JavaScript is disabled.
5
5
 
6
6
  Uses a visually hidden bit of text to inform screen reader users of the state of the input rather than announcing the content of the password input when toggled.
7
+
8
+ This component is currently experimental. If you are using it, please feed back any research findings to the Accounts team.
7
9
  accessibility_criteria: |
8
10
  The component must:
9
11
 
@@ -17,6 +17,7 @@ module GovukPublishingComponents
17
17
  :start,
18
18
  :secondary,
19
19
  :secondary_quiet,
20
+ :secondary_solid,
20
21
  :destructive,
21
22
  :name,
22
23
  :value,
@@ -41,6 +42,7 @@ module GovukPublishingComponents
41
42
  @start = local_assigns[:start]
42
43
  @secondary = local_assigns[:secondary]
43
44
  @secondary_quiet = local_assigns[:secondary_quiet]
45
+ @secondary_solid = local_assigns[:secondary_solid]
44
46
  @destructive = local_assigns[:destructive]
45
47
  @name = local_assigns[:name]
46
48
  @value = local_assigns[:value]
@@ -77,6 +79,7 @@ module GovukPublishingComponents
77
79
  css_classes << "govuk-button--start" if start
78
80
  css_classes << "gem-c-button--secondary" if secondary
79
81
  css_classes << "gem-c-button--secondary-quiet" if secondary_quiet
82
+ css_classes << "govuk-button--secondary" if secondary_solid
80
83
  css_classes << "govuk-button--warning" if destructive
81
84
  css_classes << "gem-c-button--bottom-margin" if margin_bottom && !info_text
82
85
  css_classes << "gem-c-button--inline" if inline_layout
@@ -113,6 +113,10 @@ module GovukPublishingComponents
113
113
  tagged_to_brexit? && (page_content_id != brexit_start_page_content_id)
114
114
  end
115
115
 
116
+ def transition_countdown_exception?
117
+ content_item["content_id"] == "c3752802-f091-43a9-ba90-33568fccf391"
118
+ end
119
+
116
120
  def step_by_step_count
117
121
  step_nav_helper.step_navs.count
118
122
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "23.8.0".freeze
2
+ VERSION = "23.10.1".freeze
3
3
  end
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: 23.8.0
4
+ version: 23.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: 2020-12-07 00:00:00.000000000 Z
11
+ date: 2020-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -404,6 +404,7 @@ files:
404
404
  - app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js
405
405
  - app/assets/javascripts/govuk_publishing_components/analytics/ecommerce.js
406
406
  - app/assets/javascripts/govuk_publishing_components/analytics/error-tracking.js
407
+ - app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js
407
408
  - app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js
408
409
  - app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js
409
410
  - app/assets/javascripts/govuk_publishing_components/analytics/init.js