govuk_publishing_components 59.1.1 → 59.2.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 (23) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +6 -6
  3. data/app/assets/javascripts/govuk_publishing_components/components/add-another.js +7 -6
  4. data/app/assets/stylesheets/component_guide/application.scss +3 -3
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +0 -1
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +55 -31
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +1 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +274 -231
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +11 -9
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +1 -2
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +2 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_secondary-navigation.scss +2 -4
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +2 -3
  15. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +1 -1
  16. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +18 -14
  17. data/app/views/govuk_publishing_components/components/_action_link.html.erb +25 -14
  18. data/app/views/govuk_publishing_components/components/_add_another.html.erb +9 -0
  19. data/app/views/govuk_publishing_components/components/_cross_service_header.html.erb +1 -2
  20. data/app/views/govuk_publishing_components/components/cross_service_header/_one_login_header.html.erb +41 -68
  21. data/app/views/govuk_publishing_components/components/docs/add_another.yml +38 -0
  22. data/lib/govuk_publishing_components/version.rb +1 -1
  23. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bf3ab25ab42797830c9959305eb90b72e2d5cb4850ffe2f9d0a0092b84ee784
4
- data.tar.gz: bc7546e1616973abe9f4bafb0b244bd0e483f977122a626e5debe39a15fa59c7
3
+ metadata.gz: 7417948ab55013ddbb82d195f372b4a68010acc0859b7afff3f04ad23968a2db
4
+ data.tar.gz: 81f599c8fd2535efb10a130941d2226a7f2738ab79ae1066a7341b687d326ae6
5
5
  SHA512:
6
- metadata.gz: 7241b5c9233ab7df264c4ddc82e4a4533fb8b336d7afd5e952ea13f0a7dcaf673ad66658c8333324bf99025a92c8f549b606660d936c1230db6522f8670520dd
7
- data.tar.gz: f551678d5847390efcae700a1cf6678d5eeb7604224fb428e0f0cf9aa170b9b36fbd2228bc28692c14283fb8374e43301691b9e62d99d245899d0687aabffad0
6
+ metadata.gz: ae96349a76eabcf7bdc895efbb6fc9dc96fab3b09879f5a0da5ea86b0b4c165bb1a1b569fcb6102939f3e158d5e2294e877af4b9c7c343bf23b2a950bcc1cabc
7
+ data.tar.gz: 9a7913f2b23f58f8b82a27cdc47f55c20ea158b9212fa2eecd7642bd747e56aa7e42275274c97dae8043c5b79ab8d1221bdd84ef8f27003a359fefb66db63943
@@ -36,12 +36,12 @@
36
36
  // e.g. 'AB123456A', 'AB 12 34 56 A', 'ab 123456 a', 'ab 12 34 56 a', 'AB+12+34+56+A'
37
37
  var NATIONAL_INSURANCE_NUMBER = /[A-CEGHJ-OPR-TW-Z]{2}(\s+|\++)?(\d{2}(\s+|\++)?){3}[A-D]/gi
38
38
 
39
- var UK_MOBILE_NUMBER = /07\d{3}\s?\d{6}/g // 07123 123456 or 07123123456
40
- var UK_MOBILE_NUMBER_INTERNATIONAL = /\+447\d{3}\s?\d{6}/g // +447123 123456 or +447123123456
41
- var UK_LANDLINE_NUMBER = /0[1246]\d{1}\s?\d{3,4}\s?\d{4}/g // 020 123 1234 or 020 1234 1234 or 0201231234 or 02012341234
42
- var UK_LANDLINE_NUMBER_2 = /0[1246]\d{3}\s\d{6}/g // 02123 123456
43
- var UK_LANDLINE_NUMBER_INTERNATIONAL = /\+44[1246]\d{1}\s?\d{3,4}\s?\d{4}/g // +4420 123 1234 or +4420 1234 1234
44
- var UK_LANDLINE_NUMBER_INTERNATIONAL_2 = /\+44[1246]\d{3}\s\d{6}/g // +442123 123456
39
+ var UK_MOBILE_NUMBER = /07\d{3}[\s%20+]?\d{6,8}/g // 07123 123456 or 07123123456 or 07123+123456 or 07123%20123456
40
+ var UK_MOBILE_NUMBER_INTERNATIONAL = /(\+|%2B)?447\d{3}[\s%20+]?\d{6,8}/gi // +447123 123456 or +447123123456 or +447123%20123456 or +447123+123456 or %2B447123123456. Plus at start is optional.
41
+ var UK_LANDLINE_NUMBER = /0[1246]\d{1}[\s%20+]?\d{3,6}[\s%20+]?\d{4,6}/g // 020 123 1234 or 020 1234 1234 or 0201231234 or 02012341234 or 020+123+1234 or 020+1234+1234 or 020%20123%201234 or 020%201234%201234
42
+ var UK_LANDLINE_NUMBER_2 = /0[1246]\d{3}[\s%20+]\d{6,8}/g // 02123 123456 or 02123+123456 or 02123%20123456
43
+ var UK_LANDLINE_NUMBER_INTERNATIONAL = /(\+|%2B)?44[1246]\d{1}[\s%20+]?\d{3,6}[\s%20+]?\d{4,6}/g // // +4420 123 1234 or +4420 1234 1234 or +4420+123+1234 or +4420%20123%201234 or %2B4420 123 1234. Plus at start is optional.
44
+ var UK_LANDLINE_NUMBER_INTERNATIONAL_2 = /(\+|%2B)?44[1246]\d{3}[\s%20+]\d{6,8}/g // +442123 123456 or +442123%20123456 or +442123+123456 or %2B442123+123456. Plus at start is optional.
45
45
 
46
46
  function shouldStripDates () {
47
47
  var metas = document.querySelectorAll('meta[name="govuk:ga4-strip-dates"]')
@@ -5,7 +5,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
5
5
  function AddAnother (module) {
6
6
  this.module = module
7
7
  this.disableGa4 = this.module.dataset.disableGa4
8
- this.emptyFieldset = undefined
9
8
  this.addAnotherButton = undefined
10
9
  this.startIndex = Number(this.module.dataset.ga4StartIndex) || 1
11
10
  this.indexSectionCount = Number(this.module.dataset.ga4IndexSectionCount)
@@ -94,8 +93,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
94
93
  }
95
94
 
96
95
  AddAnother.prototype.removeEmptyFieldset = function () {
97
- this.emptyFieldset = this.module.querySelector('.js-add-another__empty')
98
- this.emptyFieldset.remove()
96
+ this.module.querySelector('.js-add-another__empty').remove()
99
97
  }
100
98
 
101
99
  AddAnother.prototype.updateFieldsetsAndButtons = function () {
@@ -129,15 +127,18 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
129
127
 
130
128
  AddAnother.prototype.addNewFieldset = function (event) {
131
129
  var button = event.target
132
- var newFieldset = this.emptyFieldset.cloneNode(true)
133
- newFieldset.classList.remove('js-add-another__empty')
130
+ var newFieldsetTemplate = this.module.querySelector('.js-add-another__empty-template')
131
+ var newFieldset = newFieldsetTemplate.content.cloneNode(true).children[0]
134
132
  newFieldset.classList.add('js-add-another__fieldset')
135
133
  this.createRemoveButton(newFieldset, this.removeNewFieldset.bind(this))
136
134
  button.before(newFieldset)
137
135
 
138
- this.incrementAttributes(this.emptyFieldset)
136
+ this.incrementAttributes(newFieldsetTemplate.content)
139
137
  this.updateFieldsetsAndButtons()
140
138
 
139
+ // Initialise any modules included in new fieldset
140
+ window.GOVUK.modules.start(newFieldset)
141
+
141
142
  // Move focus to first visible field in new set
142
143
  newFieldset
143
144
  .querySelector('input:not([type="hidden"]), select, textarea')
@@ -1,5 +1,5 @@
1
1
  // This file contains the styles for the Component Guide.
2
-
2
+ @use "sass:color";
3
3
  @import "govuk_publishing_components/govuk_frontend_support";
4
4
  @import "govuk_publishing_components/component_support";
5
5
 
@@ -267,10 +267,10 @@ html {
267
267
  // Rouge syntax highlighting
268
268
  // Based on https://github.com/alphagov/tech-docs-template/blob/master/template/source/stylesheets/palette/_syntax-highlighting.scss
269
269
 
270
- $code-00: scale-color(govuk-colour("light-grey"), $lightness: 50%); // Default Background
270
+ $code-00: color.scale(govuk-colour("light-grey"), $lightness: 50%); // Default Background
271
271
  $code-01: #f5f5f5; // Lighter Background (Unused)
272
272
  $code-02: #bfc1c3; // Selection Background
273
- $code-03: darken($govuk-secondary-text-colour, 2%); // Comments, Invisibles, Line Highlighting
273
+ $code-03: color.adjust($govuk-secondary-text-colour, $lightness: -2%); // Comments, Invisibles, Line Highlighting
274
274
  $code-04: #e8e8e8; // Dark Foreground (Unused)
275
275
  $code-05: $govuk-text-colour; // Default Foreground, Caret, Delimiters, Operators
276
276
  $code-06: #ffffff; // Light Foreground (Unused)
@@ -1,5 +1,4 @@
1
1
  @import "govuk_publishing_components/individual_component_support";
2
- @import "mixins/prefixed-transform";
3
2
  @import "govuk/components/accordion/accordion";
4
3
 
5
4
  // Prevent elements inside the button from receiving click events
@@ -6,49 +6,73 @@
6
6
  @include govuk-media-query($until: tablet) {
7
7
  max-width: 410px;
8
8
  }
9
+ }
10
+
11
+ .gem-c-action-link__icon {
12
+ display: table-cell;
13
+ line-height: 1;
14
+ width: 36px;
9
15
 
10
- &::before {
11
- content: "";
12
- display: table-cell;
13
- width: 36px;
16
+ svg {
14
17
  height: 28px;
15
- background: url("govuk_publishing_components/action-link-arrow--light.svg");
16
- background-repeat: no-repeat;
17
- background-size: 28px auto;
18
- background-position: 0 0;
18
+ vertical-align: middle;
19
+ width: 28px;
20
+
21
+ .gem-c-action-link__icon__circle {
22
+ fill: #eeefef;
23
+
24
+ // stylelint-disable max-nesting-depth
25
+ @media (forced-colors: active) {
26
+ fill: LinkText;
27
+ }
28
+ // stylelint-enable max-nesting-depth
29
+ }
19
30
 
20
- @include govuk-media-query($from: tablet) {
21
- width: 45px;
31
+ .gem-c-action-link__icon__arrow {
32
+ fill: #000000;
33
+
34
+ // stylelint-disable max-nesting-depth
35
+ @media (forced-colors: active) {
36
+ fill: Canvas;
37
+ }
38
+ // stylelint-enable max-nesting-depth
39
+ }
40
+ }
41
+
42
+ @include govuk-media-query($from: tablet) {
43
+ width: 45px;
44
+
45
+ svg {
22
46
  height: 35px;
23
- background-size: 35px auto;
47
+ width: 35px;
24
48
  }
25
49
  }
26
50
  }
27
51
 
28
- .gem-c-action-link__link-wrapper {
29
- display: table-cell;
30
- vertical-align: middle;
31
- @include govuk-font(19, $weight: bold, $line-height: 1.3);
32
- }
52
+ .gem-c-action-link__icon--simple {
53
+ padding-top: 2px;
54
+ width: 30px;
55
+
56
+ svg {
57
+ height: 25px;
58
+ width: 25px;
33
59
 
34
- .gem-c-action-link__link {
35
- color: inherit;
60
+ .gem-c-action-link__icon__arrow {
61
+ fill: #272828;
36
62
 
37
- &:focus {
38
- text-decoration: none;
39
- color: $govuk-focus-text-colour;
63
+ // stylelint-disable max-nesting-depth
64
+ @media (forced-colors: active) {
65
+ fill: currentcolor;
66
+ }
67
+ // stylelint-enable max-nesting-depth
68
+ }
40
69
  }
41
70
  }
42
71
 
43
- .gem-c-action-link--simple {
44
- &::before {
45
- width: 30px;
46
- height: 30px;
47
- background: url("govuk_publishing_components/action-link-arrow--simple.svg");
48
- background-repeat: no-repeat;
49
- background-size: 25px auto;
50
- background-position: 0 2px;
51
- }
72
+ .gem-c-action-link__link-wrapper {
73
+ display: table-cell;
74
+ vertical-align: middle;
75
+ @include govuk-font(19, $weight: bold, $line-height: 1.3);
52
76
  }
53
77
 
54
78
  @include govuk-media-query($media-type: print) {
@@ -57,7 +81,7 @@
57
81
  color: $govuk-print-text-colour !important; // stylelint-disable-line declaration-no-important
58
82
  }
59
83
 
60
- &::before {
84
+ .gem-c-action-link__icon {
61
85
  display: none;
62
86
  }
63
87
  }
@@ -77,8 +77,8 @@ $thumbnail-icon-border-colour: govuk-colour("mid-grey");
77
77
  .govspeak,
78
78
  .gem-c-govspeak {
79
79
  .gem-c-attachment__title {
80
- @include govuk-font($size: 27, $weight: regular);
81
80
  margin: 0 0 govuk-spacing(3) 0;
81
+ @include govuk-font($size: 27, $weight: regular);
82
82
  }
83
83
 
84
84
  .gem-c-attachment__metadata {