govuk_publishing_components 68.2.0 → 68.3.0

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +44 -17
  3. data/app/assets/javascripts/govuk_publishing_components/components/option-select.js +26 -16
  4. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +12 -11
  5. data/app/assets/stylesheets/component_guide/application.scss +4 -4
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +5 -5
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +6 -5
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +1 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +2 -2
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +4 -4
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_figure.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +5 -6
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +1 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +7 -6
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +1 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +1 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +3 -3
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +1 -7
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +1 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_search-with-autocomplete.scss +1 -1
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +1 -1
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +1 -1
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_sub-navigation-menu.scss +1 -1
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-banner.scss +1 -1
  26. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +7 -7
  27. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +1 -1
  28. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -2
  29. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +1 -1
  30. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +1 -1
  31. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_form-download.scss +1 -1
  32. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +2 -2
  33. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +1 -1
  34. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -1
  35. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +1 -1
  36. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
  37. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -1
  38. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +2 -2
  39. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +3 -2
  40. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  41. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +4 -3
  42. data/app/views/govuk_publishing_components/components/_option_select.html.erb +9 -20
  43. data/lib/govuk_publishing_components/version.rb +1 -1
  44. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba5b24da8c7e37b1df6a4f4fec4aff4cd3b099923b888a2c844aef00fc54259f
4
- data.tar.gz: 39e1a0df6c03ca9cc320ec92a6e07738ab30e05a1b7b3c14f61197f23bd0387c
3
+ metadata.gz: 03455dfe8892b30b454209d8b8a490fd52abfbe5605d8f2823dbe9bd03d52979
4
+ data.tar.gz: c037b1fbba983e32b96b8abdc6e73cce0c7a2c448862982973f5d757ed324480
5
5
  SHA512:
6
- metadata.gz: 1547f4b8b7362ba0105d288a2f484f2a040dba2f7e4955597d040be78dc1b6d891c36856ffab79f88a0b72eb9be616b8b06e8f79c5ca6a5c0c756fec59ae14e9
7
- data.tar.gz: 35d2a6d741b9ec56ceecc69d311e9490d8c67bee32d4a86a7da37a8f82defe489906e8caa24f921aec4b88eb3fa812b528049bc446ccc36badf653890335edca
6
+ metadata.gz: f3e2136388c8bbc98caf66c605efc335139e485f59e15a4e1bffcc72b5f2ea94d67dcbcefb9dbde13ba8dc779dd465301ed25c22c0f2a88f0022f3ab2704d634
7
+ data.tar.gz: 275c48bef08012285e2091aef239b78effce8f893c5ed191fec261f05f708c5ef77241cc17a0763d2407a30512a4d4d040105b3aef9178dccc3fc45520e1d8ea
@@ -11,6 +11,7 @@
11
11
  this.useSelectCount = this.module.hasAttribute('data-ga4-form-use-select-count')
12
12
  this.redacted = false
13
13
  this.useFallbackValue = this.module.hasAttribute('data-ga4-form-no-answer-undefined') ? undefined : 'No answer given'
14
+ this.piiRemover = new window.GOVUK.analyticsGa4.PIIRemover()
14
15
  }
15
16
 
16
17
  Ga4FormTracker.prototype.init = function () {
@@ -117,6 +118,8 @@
117
118
 
118
119
  var isDateField = elem.closest('.govuk-date-input')
119
120
 
121
+ var forceReportValue = elem.hasAttribute('data-ga4-force-report-value-in-form-tracker')
122
+
120
123
  if (conditionalCheckbox && !conditionalCheckboxChecked) {
121
124
  // don't include conditional field if condition not checked
122
125
  inputs.splice(i, 1)
@@ -146,25 +149,10 @@
146
149
  // if placeholder value in select, do not include as not filled in
147
150
  inputs.splice(i, 1)
148
151
  } else {
149
- input.answer = this.useSelectCount && selectedOptions.length > 1 ? selectedOptions.length : selectedOptions.join(',')
152
+ input.answer = this.getInputAnswerFromSelect(selectedOptions, forceReportValue)
150
153
  }
151
154
  } else if (isTextField && elem.value) {
152
- if (this.includeTextInputValues || elem.hasAttribute('data-ga4-form-include-input')) {
153
- if (this.useTextCount && !isDateField) {
154
- input.answer = elem.value.length
155
- } else {
156
- var PIIRemover = new window.GOVUK.analyticsGa4.PIIRemover()
157
- input.answer = PIIRemover.stripPIIWithOverride(elem.value, true, true)
158
- }
159
- } else {
160
- // if recording JSON and text input not allowed
161
- // set the specific answer to '[REDACTED]'
162
- if (this.recordJson) {
163
- input.answer = '[REDACTED]'
164
- } else {
165
- this.redacted = true
166
- }
167
- }
155
+ input.answer = this.getInputAnswerFromText(elem, isDateField, forceReportValue)
168
156
  } else if (inputType === 'file') {
169
157
  input.answer = elem.files.length + ' files chosen'
170
158
  } else {
@@ -201,6 +189,45 @@
201
189
  return inputs
202
190
  }
203
191
 
192
+ Ga4FormTracker.prototype.getInputAnswerFromSelect = function (selectedOptions, forceReportValue) {
193
+ var joinedSelections = selectedOptions.join(',')
194
+
195
+ if (forceReportValue) {
196
+ return joinedSelections
197
+ }
198
+
199
+ if (this.useSelectCount && selectedOptions.length > 1) {
200
+ return selectedOptions.length
201
+ }
202
+
203
+ return joinedSelections
204
+ }
205
+
206
+ Ga4FormTracker.prototype.getInputAnswerFromText = function (inputElement, isDateField, forceReportValue) {
207
+ var willRecordInputValue = this.includeTextInputValues || inputElement.hasAttribute('data-ga4-form-include-input')
208
+ var willReplaceInputValueWithLength = this.useTextCount && !isDateField
209
+
210
+ if (forceReportValue) {
211
+ willReplaceInputValueWithLength = false
212
+ }
213
+
214
+ if (willRecordInputValue) {
215
+ if (willReplaceInputValueWithLength) {
216
+ return inputElement.value.length
217
+ }
218
+
219
+ return this.piiRemover.stripPIIWithOverride(inputElement.value, true, true)
220
+ }
221
+
222
+ // if recording JSON when recording text input not allowed
223
+ // set the specific answer to '[REDACTED]'
224
+ if (this.recordJson) {
225
+ return '[REDACTED]'
226
+ } else {
227
+ this.redacted = true
228
+ }
229
+ }
230
+
204
231
  Ga4FormTracker.prototype.combineGivenAnswers = function (data) {
205
232
  var answers = this.recordJson ? {} : []
206
233
 
@@ -1,15 +1,11 @@
1
1
  (function (Modules) {
2
- /* This JavaScript provides two functional enhancements to option-select components:
3
- 1) A count that shows how many results have been checked in the option-container
4
- 2) Open/closing of the list of checkboxes
5
- */
6
2
  function OptionSelect ($module) {
7
3
  this.$optionSelect = $module
8
4
  this.$options = this.$optionSelect.querySelectorAll("input[type='checkbox']")
9
5
  this.$optionsContainer = this.$optionSelect.querySelector('.js-options-container')
10
6
  this.$optionList = this.$optionsContainer.querySelector('.js-auto-height-inner')
11
7
  this.$allCheckboxes = this.$optionsContainer.querySelectorAll('.govuk-checkboxes__item')
12
- this.hasFilter = this.$optionSelect.getAttribute('data-filter-element') || ''
8
+ this.filterAttributes = this.$optionSelect.getAttribute('data-filter-attributes')
13
9
 
14
10
  this.checkedCheckboxes = []
15
11
 
@@ -19,15 +15,9 @@
19
15
  }
20
16
 
21
17
  OptionSelect.prototype.init = function () {
22
- if (this.hasFilter.length) {
23
- var filterEl = document.createElement('div')
24
- filterEl.innerHTML = this.hasFilter
25
-
26
- var optionSelectFilter = document.createElement('div')
27
- optionSelectFilter.classList.add('gem-c-option-select__filter')
28
- optionSelectFilter.innerHTML = filterEl.childNodes[0].nodeValue
29
-
30
- this.$optionsContainer.parentNode.insertBefore(optionSelectFilter, this.$optionsContainer)
18
+ if (this.filterAttributes) {
19
+ this.filterAttributes = JSON.parse(this.filterAttributes)
20
+ this.$optionsContainer.parentNode.insertBefore(this.createFilter(), this.$optionsContainer)
31
21
 
32
22
  this.$filter = this.$optionSelect.querySelector('input[name="option-select-filter"]')
33
23
  this.$filterCount = document.getElementById(this.$filter.getAttribute('aria-describedby'))
@@ -73,6 +63,26 @@
73
63
  }
74
64
  }
75
65
 
66
+ OptionSelect.prototype.createFilter = function () {
67
+ const filter = document.createElement('div')
68
+ filter.classList.add('gem-c-option-select__filter')
69
+
70
+ const label = document.createElement('label')
71
+ label.classList.add('govuk-label', 'govuk-visually-hidden')
72
+ label.setAttribute('for', this.filterAttributes.id)
73
+ label.textContent = this.filterAttributes.title
74
+
75
+ const input = document.createElement('input')
76
+ input.classList.add('gem-c-option-select__filter-input', 'govuk-input')
77
+ input.name = 'option-select-filter'
78
+ input.id = this.filterAttributes.id
79
+ input.setAttribute('aria-describedby', this.filterAttributes.describedby)
80
+ input.setAttribute('aria-controls', this.filterAttributes.controls)
81
+
82
+ filter.append(label, input)
83
+ return filter
84
+ }
85
+
76
86
  OptionSelect.prototype.toggleVisibility = function (isTabletOrLarger) {
77
87
  if (isTabletOrLarger) {
78
88
  if (this.isClosedOnLoad === 'true') {
@@ -142,8 +152,8 @@
142
152
 
143
153
  var lenChecked = obj.$optionsContainer.querySelectorAll('.govuk-checkboxes__input:checked').length
144
154
  var len = showCheckboxes.length + lenChecked
145
- var html = len + (len === 1 ? obj.filterTextSingle : obj.filterTextMultiple) + ', ' + lenChecked + obj.filterTextSelected
146
- obj.$filterCount.innerHTML = html
155
+ var hiddenText = len + (len === 1 ? obj.filterTextSingle : obj.filterTextMultiple) + ', ' + lenChecked + obj.filterTextSelected
156
+ obj.$filterCount.textContent = hiddenText
147
157
  }
148
158
 
149
159
  OptionSelect.prototype.replaceHeadingSpanWithButton = function replaceHeadingSpanWithButton () {
@@ -168,19 +168,20 @@
168
168
  var thisel = this.$module.steps[i]
169
169
  var title = thisel.querySelectorAll('.js-step-title')[0]
170
170
  var contentId = thisel.querySelectorAll('.js-panel')[0].getAttribute('id')
171
- var titleText = title.textContent || title.innerText // IE8 fallback
171
+ var titleText = title.textContent
172
172
 
173
173
  title.outerHTML =
174
- '<span class="js-step-title">' +
175
- '<button ' +
176
- 'class="gem-c-step-nav__button gem-c-step-nav__button--title js-step-title-button" ' +
177
- 'aria-expanded="false" aria-controls="' + contentId + '"' + '>' +
178
- '<span class="gem-c-step-nav____title-text-focus">' +
179
- '<span class="gem-c-step-nav__title-text js-step-title-text">' + titleText + '</span>' +
180
- '<span class="govuk-visually-hidden gem-c-step-nav__section-heading-divider">, </span>' +
181
- '</span>' +
182
- '</button>' +
183
- '</span>'
174
+ `<span class="js-step-title">
175
+ <button class="gem-c-step-nav__button gem-c-step-nav__button--title js-step-title-button"
176
+ aria-expanded="false" aria-controls="${contentId}">
177
+ <span class="gem-c-step-nav____title-text-focus">
178
+ <span class="gem-c-step-nav__title-text js-step-title-text"></span>
179
+ <span class="govuk-visually-hidden gem-c-step-nav__section-heading-divider">, </span>
180
+ </span>
181
+ </button>
182
+ </span>`
183
+
184
+ thisel.querySelector('.gem-c-step-nav__title-text').textContent = titleText
184
185
 
185
186
  if (this.$module.isGa4Enabled) {
186
187
  var ga4JSON = {
@@ -68,7 +68,7 @@ $gem-guide-border-width: 1px;
68
68
  }
69
69
 
70
70
  .component-guide-preview {
71
- padding: govuk-spacing(8) govuk-spacing(6) govuk-spacing(6) govuk-spacing(6);
71
+ padding: govuk-spacing(8) govuk-spacing(6) govuk-spacing(6);
72
72
  border: $gem-guide-border-width solid govuk-functional-colour(border);
73
73
  position: relative;
74
74
  margin-bottom: govuk-spacing(8);
@@ -475,7 +475,7 @@ $code-delete-bg: #fadddd;
475
475
 
476
476
  .gem-full-width__container {
477
477
  container-type: inline-size;
478
- container-name: gem_page;
478
+ container-name: gem-page;
479
479
  }
480
480
 
481
481
  .full-width__table-wrapper {
@@ -500,7 +500,7 @@ $code-delete-bg: #fadddd;
500
500
  }
501
501
  }
502
502
 
503
- @container gem_page (width > 1040px) {
503
+ @container gem-page (width > 1040px) {
504
504
  $w: 960px;
505
505
 
506
506
  .gem-full-width__element {
@@ -529,7 +529,7 @@ $code-delete-bg: #fadddd;
529
529
  .govuk-tabs {
530
530
  $w: 920px;
531
531
 
532
- @container gem_page (width > 1040px) {
532
+ @container gem-page (width > 1040px) {
533
533
  .full-width__table-wrapper {
534
534
  margin-left: calc(((-100cqw + $w) / 2) - 1px);
535
535
  margin-right: calc(((-100cqw + $w) / 2) - 1px);
@@ -44,8 +44,8 @@ $thumbnail-border-width: 5px;
44
44
 
45
45
  .gem-c-details {
46
46
  margin-top: govuk-spacing(3);
47
- word-break: break-word;
48
- word-wrap: break-word;
47
+ word-break: break-word; // stylelint-disable-line declaration-property-value-keyword-no-deprecated
48
+ overflow-wrap: break-word;
49
49
  }
50
50
  }
51
51
 
@@ -68,12 +68,12 @@ $thumbnail-border-width: 5px;
68
68
  .govspeak,
69
69
  .gem-c-govspeak {
70
70
  .gem-c-attachment__title {
71
- margin: 0 0 govuk-spacing(3) 0;
71
+ margin: 0 0 govuk-spacing(3);
72
72
  @include govuk-font($size: 27, $weight: regular);
73
73
  }
74
74
 
75
75
  .gem-c-attachment__metadata {
76
- margin: 0 0 govuk-spacing(3) 0;
76
+ margin: 0 0 govuk-spacing(3);
77
77
  }
78
78
  }
79
79
 
@@ -101,7 +101,7 @@ $thumbnail-border-width: 5px;
101
101
  }
102
102
 
103
103
  .gem-c-attachment__link.govuk-link {
104
- word-break: break-word;
104
+ word-break: break-word; // stylelint-disable-line declaration-property-value-keyword-no-deprecated
105
105
 
106
106
  &::after {
107
107
  font-size: 12pt;
@@ -7,6 +7,7 @@
7
7
  padding: 0;
8
8
  margin: 0;
9
9
  display: grid;
10
+ // stylelint-disable-next-line property-no-deprecated
10
11
  grid-column-gap: govuk-spacing(6); // Use deprecated grid-column-gap for Grade C browser support
11
12
  column-gap: govuk-spacing(6);
12
13
 
@@ -48,15 +49,15 @@
48
49
 
49
50
  .gem-c-cards__list--two-column-desktop {
50
51
  @include govuk-media-query($from: "tablet") {
51
- grid-auto-rows: fractions(1); // Set all rows to same fractional height of the complete grid
52
- grid-template-columns: fractions(2); // Note that browsers that don't support CSS grid display the component as one column on all breakpoints
52
+ grid-auto-rows: 1fr;
53
+ grid-template-columns: repeat(2, 1fr);
53
54
  }
54
55
  }
55
56
 
56
57
  .gem-c-cards__list--three-column-desktop {
57
58
  @include govuk-media-query($from: "desktop") {
58
- grid-auto-rows: fractions(1); // Set all rows to same fractional height of the complete grid
59
- grid-template-columns: fractions(3); // Note that browsers that don't support CSS grid display the component as one column on all breakpoints
59
+ grid-auto-rows: 1fr;
60
+ grid-template-columns: repeat(3, 1fr);
60
61
  }
61
62
  }
62
63
 
@@ -145,7 +146,7 @@
145
146
 
146
147
  .gem-c-cards__list-item {
147
148
  border-top: 1px solid govuk-functional-colour(border);
148
- padding: govuk-spacing(1) 0 govuk-spacing(4) 0;
149
+ padding: govuk-spacing(1) 0 govuk-spacing(4);
149
150
  }
150
151
 
151
152
  .gem-c-cards__list-item-wrapper {
@@ -305,6 +305,7 @@ $toggle-border-height: 3px;
305
305
  &-visible {
306
306
  @include toggle-button-focus;
307
307
 
308
+ // stylelint-disable-next-line selector-no-qualifying-type
308
309
  &.gem-c-rebranded-cross-service-header__toggle--open {
309
310
  @include toggle-button-focus;
310
311
  }
@@ -82,7 +82,7 @@
82
82
  @include govuk-text-colour;
83
83
  @include govuk-font(16);
84
84
 
85
- & { // stylelint-disable-line no-duplicate-selectors
85
+ & { // stylelint-disable-line no-duplicate-selectors, block-no-redundant-nested-style-rules
86
86
  // overriding govuk-text-colour mixin
87
87
  color: govuk-functional-colour(secondary-text);
88
88
  }
@@ -104,7 +104,7 @@
104
104
  }
105
105
 
106
106
  .gem-c-document-list__highlight-text {
107
- margin: 0 0 govuk-spacing(3) 0;
107
+ margin: 0 0 govuk-spacing(3);
108
108
  @include govuk-font(16, bold);
109
109
  }
110
110
 
@@ -175,13 +175,13 @@ $feedback-prompt-border-top-colour: $govuk-blue-tint-50;
175
175
 
176
176
  // this comes from the backend so we can't put a class on it
177
177
  h2 {
178
- margin: 0 0 govuk-spacing(3) 0;
178
+ margin: 0 0 govuk-spacing(3);
179
179
  @include govuk-text-colour;
180
180
  @include govuk-font($size: 24, $weight: bold);
181
181
  }
182
182
 
183
183
  p {
184
- margin: 0 0 govuk-spacing(3) 0;
184
+ margin: 0 0 govuk-spacing(3);
185
185
  @include govuk-text-colour;
186
186
  @include govuk-font($size: 19);
187
187
  }
@@ -210,13 +210,13 @@ $feedback-prompt-border-top-colour: $govuk-blue-tint-50;
210
210
  }
211
211
 
212
212
  .gem-c-feedback__form-heading {
213
- margin: 0 0 govuk-spacing(3) 0;
213
+ margin: 0 0 govuk-spacing(3);
214
214
  @include govuk-text-colour;
215
215
  @include govuk-font(24, $weight: bold);
216
216
  }
217
217
 
218
218
  .gem-c-feedback__form-paragraph {
219
- margin: 0 0 govuk-spacing(6) 0;
219
+ margin: 0 0 govuk-spacing(6);
220
220
  @include govuk-text-colour;
221
221
  @include govuk-font(19);
222
222
  }
@@ -20,7 +20,7 @@ $gap: govuk-spacing(1);
20
20
  }
21
21
 
22
22
  .gem-c-figure__figcaption-text {
23
- margin: govuk-spacing(2) 0 0 0;
23
+ margin: govuk-spacing(2) 0 0;
24
24
  color: govuk-functional-colour(secondary-text);
25
25
  @include govuk-font(19);
26
26
  }
@@ -11,7 +11,6 @@
11
11
  @include govuk-text-colour;
12
12
 
13
13
  @include govuk-media-query($until: tablet) {
14
- flex-direction: column-reverse;
15
14
  gap: govuk-spacing(3);
16
15
  }
17
16
  }
@@ -36,7 +35,7 @@
36
35
  height: auto;
37
36
  width: 100%;
38
37
  border: 0;
39
- border-top: 1px solid govuk-functional-colour(border);
38
+ border-top: 1px solid govuk-functional-colour("border");
40
39
  }
41
40
 
42
41
  .gem-c-image-card__title {
@@ -73,7 +72,7 @@
73
72
  .gem-c-image-card__context,
74
73
  .gem-c-image-card__metadata {
75
74
  font-size: govuk-px-to-rem(16px);
76
- margin: 0 0 calc(govuk-spacing(3) / 2);
75
+ margin: 0 0 govuk-spacing(2);
77
76
  color: govuk-functional-colour("secondary-text");
78
77
  @include govuk-font($size: false);
79
78
 
@@ -83,15 +82,15 @@
83
82
  }
84
83
 
85
84
  .gem-c-image-card__description {
86
- padding-top: calc(govuk-spacing(3) / 2);
87
- word-wrap: break-word;
85
+ padding-top: govuk-spacing(2);
86
+ overflow-wrap: break-word;
88
87
  @include govuk-font($size: 19);
89
88
  }
90
89
 
91
90
  .gem-c-image-card__list {
92
91
  position: relative;
93
92
  z-index: 2;
94
- padding: calc(govuk-spacing(3) / 2) 0 0 0;
93
+ padding: govuk-spacing(2) 0 0;
95
94
  margin: 0;
96
95
  list-style: none;
97
96
  @include govuk-font($size: 19);
@@ -2,7 +2,7 @@
2
2
  width: 100%;
3
3
  background-color: $govuk-blue-tint-80;
4
4
  margin-bottom: govuk-spacing(6);
5
- padding: govuk-spacing(3) govuk-spacing(6) govuk-spacing(6) govuk-spacing(6);
5
+ padding: govuk-spacing(3) govuk-spacing(6) govuk-spacing(6);
6
6
  box-sizing: border-box;
7
7
 
8
8
  @include govuk-media-query($until: desktop) {
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  .gem-c-layout-for-public-account-menu {
13
- margin: 0 0 govuk-spacing(6) 0;
13
+ margin: 0 0 govuk-spacing(6);
14
14
  padding: 0;
15
15
 
16
16
  @include govuk-media-query($from: desktop) {
@@ -81,6 +81,7 @@ $search-icon-height: 20px;
81
81
  // Undoes the :focus styles *only* for browsers that support :focus-visible.
82
82
  // See https://www.tpgi.com/focus-visible-and-backwards-compatibility/
83
83
  @mixin focus-not-focus-visible {
84
+ // stylelint-disable-next-line block-no-redundant-nested-style-rules
84
85
  & {
85
86
  @content;
86
87
  }
@@ -571,12 +572,12 @@ $search-icon-height: 20px;
571
572
  // JS available - styles the links in the dropdown menu
572
573
  .gem-c-layout-super-navigation-header__dropdown-list-item {
573
574
  box-sizing: border-box;
574
- padding: 0 0 govuk-spacing(3) 0;
575
+ padding: 0 0 govuk-spacing(3);
575
576
  position: relative;
576
- margin: 0 0 govuk-spacing(2) 0;
577
+ margin: 0 0 govuk-spacing(2);
577
578
  @include govuk-media-query($from: "desktop") {
578
- padding: 0 0 govuk-spacing(3) 0;
579
- margin: 0 govuk-spacing(3) govuk-spacing(1) govuk-spacing(3);
579
+ padding: 0 0 govuk-spacing(3);
580
+ margin: 0 govuk-spacing(3) govuk-spacing(1);
580
581
  }
581
582
  }
582
583
 
@@ -588,7 +589,7 @@ $search-icon-height: 20px;
588
589
 
589
590
  @include govuk-media-query($from: "desktop") {
590
591
  margin: 0 (0 - govuk-spacing(3)) govuk-spacing(9);
591
- padding: govuk-spacing(2) 0 0 0;
592
+ padding: govuk-spacing(2) 0 0;
592
593
  }
593
594
  }
594
595
 
@@ -642,7 +643,7 @@ $search-icon-height: 20px;
642
643
  .gem-c-layout-super-navigation-header__navigation-second-item-description {
643
644
  font-size: govuk-px-to-rem(16px);
644
645
  font-weight: normal;
645
- margin: govuk-spacing(1) 0 0 0;
646
+ margin: govuk-spacing(1) 0 0;
646
647
  @include govuk-typography-common;
647
648
  }
648
649
 
@@ -130,7 +130,7 @@
130
130
 
131
131
  .gem-c-metadata__change-date {
132
132
  display: block;
133
- margin: 0 0 govuk-spacing(3) 0;
133
+ margin: 0 0 govuk-spacing(3);
134
134
  @include govuk-font(16, $weight: bold);
135
135
  }
136
136
 
@@ -21,5 +21,5 @@
21
21
  }
22
22
 
23
23
  .gem-c-notice__description {
24
- word-wrap: break-word;
24
+ overflow-wrap: break-word;
25
25
  }
@@ -15,8 +15,8 @@
15
15
  ::-webkit-scrollbar-thumb {
16
16
  border-radius: 4px;
17
17
 
18
- background-color: rgba(0, 0, 0, .5);
19
- -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .87);
18
+ background-color: rgb(0, 0, 0, .5);
19
+ -webkit-box-shadow: 0 0 1px rgb(255, 255, 255, .87);
20
20
  }
21
21
  }
22
22
 
@@ -104,7 +104,7 @@
104
104
  .gem-c-option-select__filter {
105
105
  position: relative;
106
106
  background: govuk-colour("white");
107
- padding: 13px 13px govuk-spacing(2) 13px;
107
+ padding: 13px 13px govuk-spacing(2);
108
108
  }
109
109
 
110
110
  .gem-c-option-select__filter-input {
@@ -6,12 +6,6 @@
6
6
  margin: 0;
7
7
  @include govuk-typography-common;
8
8
  @include govuk-font-size(19);
9
-
10
- @include govuk-media-query($until: tablet) {
11
- // only override line-height on small screens otherwise use govuk-font-size
12
- // line-height
13
- line-height: 1.35;
14
- }
15
9
  }
16
10
 
17
11
  .gem-c-organisation-logo__container {
@@ -59,7 +53,7 @@
59
53
  @include govuk-link-common;
60
54
  @include govuk-link-style-text;
61
55
 
62
- & { // stylelint-disable-line no-duplicate-selectors
56
+ & { // stylelint-disable-line no-duplicate-selectors, block-no-redundant-nested-style-rules
63
57
  // overriding the govuk-link font
64
58
  font-family: HelveticaNeue, "Helvetica Neue", Arial, Helvetica, sans-serif;
65
59
  }
@@ -1,5 +1,5 @@
1
1
  @import "govuk/components/radios/radios";
2
2
 
3
3
  .gem-c-radio__heading-text {
4
- margin: 0 0 govuk-spacing(4) 0;
4
+ margin: 0 0 govuk-spacing(4);
5
5
  }
@@ -60,7 +60,7 @@ $large-input-size: 50px;
60
60
  // for everyone. This span is added dynamically only on iOS and not given a class, so we need to
61
61
  // target it in a roundabout way and make it invisible to non-screenreader users.
62
62
  & > span {
63
- clip: rect(0 0 0 0);
63
+ clip: rect(0 0 0 0); // stylelint-disable-line property-no-deprecated
64
64
  clip-path: inset(50%);
65
65
  height: 1px;
66
66
  overflow: hidden;
@@ -19,7 +19,7 @@
19
19
 
20
20
  @include govuk-media-query($media-type: print) {
21
21
  .gem-c-step-nav-header {
22
- padding: 0 0 govuk-spacing(4) 0;
22
+ padding: 0 0 govuk-spacing(4);
23
23
  background: none;
24
24
  border-color: govuk-functional-colour(print-text);
25
25
  }
@@ -185,7 +185,7 @@ $top-border: solid 1px govuk-functional-colour("border");
185
185
  position: relative;
186
186
  z-index: 1; // this and relative position stops focus outline underlap with border of accordion
187
187
  margin: .5em 0 14px;
188
- padding: govuk-spacing(1) 0 govuk-spacing(1);
188
+ padding: govuk-spacing(1) 0;
189
189
  @include step-nav-font(15);
190
190
 
191
191
  .gem-c-step-nav--large & {
@@ -20,7 +20,7 @@
20
20
  padding-left: govuk-spacing(3);
21
21
  padding-right: govuk-spacing(3);
22
22
  // Invisible border so the width of the collapsed button is the same as the expanded one.
23
- border-left: 1px solid rgba(0, 0, 0, 0);
23
+ border-left: 1px solid rgb(0, 0, 0, 0);
24
24
  border-right: 1px solid govuk-colour("black", $variant: "tint-95");
25
25
  cursor: pointer;
26
26
  position: relative;
@@ -17,7 +17,7 @@
17
17
  }
18
18
 
19
19
  .gem-c-summary-banner__title {
20
- margin: 0 0 govuk-spacing(6) 0;
20
+ margin: 0 0 govuk-spacing(6);
21
21
  color: govuk-colour("white");
22
22
  @include govuk-font(27, $weight: bold);
23
23
  }
@@ -14,7 +14,7 @@
14
14
 
15
15
  .attachment {
16
16
  position: relative;
17
- margin: 0 0 govuk-spacing(6) 0;
17
+ margin: 0 0 govuk-spacing(6);
18
18
  padding: 0 0 0 ($thumbnail-width + govuk-spacing(6));
19
19
  @include govuk-clearfix;
20
20
 
@@ -56,12 +56,12 @@
56
56
 
57
57
  .attachment-details {
58
58
  h2 {
59
- margin: 0 0 govuk-spacing(2) 0;
59
+ margin: 0 0 govuk-spacing(2);
60
60
  @include govuk-font($size: 27);
61
61
  }
62
62
 
63
63
  p {
64
- margin: 0 0 govuk-spacing(2) 0;
64
+ margin: 0 0 govuk-spacing(2);
65
65
  }
66
66
 
67
67
  .metadata {
@@ -69,8 +69,8 @@
69
69
  }
70
70
 
71
71
  .url {
72
- word-break: break-word;
73
- word-wrap: break-word;
72
+ word-break: break-word; // stylelint-disable-line declaration-property-value-keyword-no-deprecated
73
+ overflow-wrap: break-word;
74
74
  }
75
75
 
76
76
  .changed,
@@ -103,8 +103,8 @@
103
103
  }
104
104
 
105
105
  .accessibility-warning {
106
- word-break: break-word;
107
- word-wrap: break-word;
106
+ word-break: break-word; // stylelint-disable-line declaration-property-value-keyword-no-deprecated
107
+ overflow-wrap: break-word;
108
108
 
109
109
  h2 {
110
110
  margin: 0;
@@ -9,7 +9,7 @@
9
9
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
10
10
  .gem-c-govspeak {
11
11
  .call-to-action {
12
- margin: 0 0 govuk-spacing(4) 0;
12
+ margin: 0 0 govuk-spacing(4);
13
13
  background-color: govuk-colour("black", $variant: "tint-95");
14
14
  padding: govuk-spacing(6);
15
15
  padding-bottom: govuk-spacing(2);
@@ -14,7 +14,7 @@
14
14
  .contact {
15
15
  border-left: 1px solid govuk-functional-colour("border");
16
16
  padding-left: govuk-spacing(3);
17
- margin: 0 0 govuk-spacing(6) 0;
17
+ margin: 0 0 govuk-spacing(6);
18
18
  }
19
19
 
20
20
  .address {
@@ -38,7 +38,7 @@
38
38
 
39
39
  .email-url-number {
40
40
  .email {
41
- word-wrap: break-word;
41
+ overflow-wrap: break-word;
42
42
  }
43
43
 
44
44
  span {
@@ -10,7 +10,7 @@
10
10
  .example {
11
11
  border-left: 10px solid govuk-functional-colour("border");
12
12
  padding: govuk-spacing(4) 0 0.1234px govuk-spacing(4); // non-zero padding on bottom keeps margin of last element inside parent, simulating padding
13
- margin: 0 0 govuk-spacing(4) 0;
13
+ margin: 0 0 govuk-spacing(4);
14
14
 
15
15
  strong {
16
16
  display: block;
@@ -15,7 +15,7 @@
15
15
  .gem-c-govspeak {
16
16
  .footnotes {
17
17
  border-top: 1px solid govuk-functional-colour("border");
18
- margin: 0 0 govuk-spacing(4) 0;
18
+ margin: 0 0 govuk-spacing(4);
19
19
  padding-top: govuk-spacing(4);
20
20
  overflow-wrap: break-word;
21
21
 
@@ -1,7 +1,7 @@
1
1
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
2
2
  .gem-c-govspeak {
3
3
  .form-download {
4
- margin: 0 0 govuk-spacing(4) 0;
4
+ margin: 0 0 govuk-spacing(4);
5
5
 
6
6
  p {
7
7
  padding-right: 3em;
@@ -13,7 +13,7 @@
13
13
  }
14
14
 
15
15
  figure {
16
- margin: 0 0 govuk-spacing(4) 0;
16
+ margin: 0 0 govuk-spacing(4);
17
17
  display: table;
18
18
 
19
19
  &:has(img[src*=".svg"]) {
@@ -31,7 +31,7 @@
31
31
  }
32
32
 
33
33
  figcaption p {
34
- margin: govuk-spacing(2) 0 0 0;
34
+ margin: govuk-spacing(2) 0 0;
35
35
  color: govuk-functional-colour(secondary-text);
36
36
  @include govuk-font(19);
37
37
  }
@@ -11,7 +11,7 @@
11
11
  .info-notice {
12
12
  border-left: 10px solid govuk-functional-colour("border");
13
13
  padding: govuk-spacing(4) 0 0.1234px govuk-spacing(4); // non-zero padding on bottom keeps margin of last element inside parent, simulating padding
14
- margin: 0 0 govuk-spacing(4) 0;
14
+ margin: 0 0 govuk-spacing(4);
15
15
 
16
16
  @include govuk-media-query($media-type: print) {
17
17
  margin: govuk-spacing(3) 0;
@@ -9,7 +9,7 @@
9
9
  .gem-c-govspeak {
10
10
  .legislative-list {
11
11
  list-style: none;
12
- margin: 0 0 govuk-spacing(4) 0;
12
+ margin: 0 0 govuk-spacing(4);
13
13
 
14
14
  ol {
15
15
  margin: govuk-spacing(2) 0 govuk-spacing(2) govuk-spacing(6);
@@ -9,7 +9,7 @@
9
9
  position: relative;
10
10
  height: 0;
11
11
  overflow: hidden;
12
- margin: 0 0 govuk-spacing(4) 0;
12
+ margin: 0 0 govuk-spacing(4);
13
13
  padding-top: 0;
14
14
  padding-left: 0;
15
15
  padding-right: 0;
@@ -2,7 +2,7 @@
2
2
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
3
3
  .gem-c-govspeak {
4
4
  .place {
5
- margin: 0 0 govuk-spacing(4) 0;
5
+ margin: 0 0 govuk-spacing(4);
6
6
  border-bottom: solid 1px govuk-functional-colour("border");
7
7
  padding-bottom: 1.5em;
8
8
 
@@ -8,7 +8,7 @@
8
8
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
9
9
  .gem-c-govspeak {
10
10
  .stat-headline {
11
- margin: 0 0 govuk-spacing(4) 0;
11
+ margin: 0 0 govuk-spacing(4);
12
12
 
13
13
  p {
14
14
  margin: 0;
@@ -11,7 +11,7 @@
11
11
  border-collapse: collapse;
12
12
  border-spacing: 0;
13
13
  display: block;
14
- margin: 0 0 govuk-spacing(6) 0;
14
+ margin: 0 0 govuk-spacing(6);
15
15
  overflow-x: auto;
16
16
  width: 100%;
17
17
  @include govuk-font($size: 19);
@@ -28,7 +28,7 @@
28
28
  border-bottom: 1px solid govuk-functional-colour("border");
29
29
 
30
30
  &:last-child {
31
- padding: govuk-spacing(2) 0 govuk-spacing(2) 0;
31
+ padding: govuk-spacing(2) 0;
32
32
  }
33
33
  }
34
34
 
@@ -34,7 +34,7 @@
34
34
 
35
35
  blockquote {
36
36
  padding: 0 0 0 govuk-spacing(6);
37
- margin: 0 0 govuk-spacing(4) 0;
37
+ margin: 0 0 govuk-spacing(4);
38
38
  border: 0;
39
39
 
40
40
  p {
@@ -80,7 +80,7 @@
80
80
  a[href^="/"]:after,a[href^="http://"]:after,a[href^="https://"]:after {
81
81
  content: " (" attr(href) ")";
82
82
  font-size: 90%;
83
- word-wrap: break-word;
83
+ overflow-wrap: break-word;
84
84
  }
85
85
  }
86
86
  }
@@ -88,6 +88,7 @@
88
88
  .gem-c-govspeak--inverse {
89
89
  color: govuk-colour("white");
90
90
 
91
+ // stylelint-disable-next-line selector-no-qualifying-type
91
92
  a:not(.govuk-button) {
92
93
  @include govuk-link-common;
93
94
  @include govuk-link-style-inverse;
@@ -16,7 +16,7 @@
16
16
  $icon-spacing: 10px;
17
17
 
18
18
  padding: govuk-spacing(3) 0 0 calc($icon-size + $icon-spacing);
19
- margin: 0 0 govuk-spacing(6) 0;
19
+ margin: 0 0 govuk-spacing(6);
20
20
  position: relative;
21
21
 
22
22
  &::before {
@@ -5,7 +5,7 @@
5
5
  ol,
6
6
  ul,
7
7
  p {
8
- margin: 0 0 govuk-spacing(4) 0;
8
+ margin: 0 0 govuk-spacing(4);
9
9
  @include govuk-font($size: 19);
10
10
  }
11
11
 
@@ -30,13 +30,13 @@
30
30
  }
31
31
 
32
32
  h2 {
33
- margin: 0 0 govuk-spacing(4) 0;
33
+ margin: 0 0 govuk-spacing(4);
34
34
  @include govuk-font($size: 24, $weight: bold);
35
35
  @include govuk-text-break-word;
36
36
  }
37
37
 
38
38
  h3 {
39
- margin: 0 0 govuk-spacing(4) 0;
39
+ margin: 0 0 govuk-spacing(4);
40
40
  @include govuk-font($size: 19, $weight: bold);
41
41
  @include govuk-text-break-word;
42
42
  }
@@ -53,6 +53,7 @@
53
53
 
54
54
  // Links
55
55
 
56
+ // stylelint-disable-next-line selector-no-qualifying-type
56
57
  a:not(.govuk-button) {
57
58
  @include govuk-link-common;
58
59
  @include govuk-link-style-default;
@@ -4,35 +4,24 @@
4
4
  checkboxes_count_id = checkboxes_id + "-count"
5
5
  show_filter ||= false
6
6
  large ||= false
7
- %>
8
-
9
- <% if show_filter %>
10
- <% filter_id ||= "input-#{SecureRandom.hex(4)}" %>
11
- <% filter = capture do %>
12
- <%= tag.label for: filter_id, class: "govuk-label govuk-visually-hidden" do %>
13
- Filter <%= title %>
14
- <% end %>
15
7
 
16
- <%= tag.input name: "option-select-filter",
8
+ if show_filter
9
+ filter_id ||= "input-#{SecureRandom.hex(4)}"
10
+ filter_attributes = {
17
11
  id: filter_id,
18
- class: "gem-c-option-select__filter-input govuk-input",
19
- type: "text",
20
- aria: {
21
- describedby: checkboxes_count_id,
22
- controls: checkboxes_id,
23
- } %>
24
- <% end %>
25
- <% filter_element = CGI::escapeHTML(filter) %>
26
- <% end %>
12
+ title: "Filter #{title}",
13
+ describedby: checkboxes_count_id,
14
+ controls: checkboxes_id,
15
+ }
16
+ end
27
17
 
28
- <%
29
18
  helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
30
19
  helper.add_class("gem-c-option-select")
31
20
  helper.add_data_attribute({ module: "option-select" })
32
21
  helper.add_data_attribute({ "closed-on-load": true }) if local_assigns.include?(:closed_on_load) && closed_on_load
33
22
  helper.add_data_attribute({ "closed-on-load-mobile": "true" }) if local_assigns.include?(:closed_on_load_mobile) && closed_on_load_mobile
34
23
  helper.add_data_attribute({ "input-aria-controls": aria_controls_id }) if local_assigns.include?(:aria_controls_id)
35
- helper.add_data_attribute({ "filter-element": filter_element }) if show_filter
24
+ helper.add_data_attribute({ "filter-attributes": filter_attributes }) if filter_attributes
36
25
  helper.add_data_attribute({ "button-data-attributes": button_data_attributes }) if local_assigns.include?(:button_data_attributes)
37
26
 
38
27
  options_container_classes = %w[gem-c-option-select__container js-options-container]
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "68.2.0".freeze
2
+ VERSION = "68.3.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 68.2.0
4
+ version: 68.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
@@ -2118,7 +2118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2118
2118
  - !ruby/object:Gem::Version
2119
2119
  version: '0'
2120
2120
  requirements: []
2121
- rubygems_version: 4.0.18
2121
+ rubygems_version: 4.0.19
2122
2122
  specification_version: 4
2123
2123
  summary: A gem to document components in GOV.UK frontend applications
2124
2124
  test_files: []