govuk_publishing_components 51.1.1 → 51.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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +29 -34
  3. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +7 -2
  4. data/app/assets/stylesheets/component_guide/application.scss +1 -1
  5. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +2 -2
  7. data/app/models/govuk_publishing_components/audit_comparer.rb +3 -3
  8. data/app/views/govuk_publishing_components/components/_title.html.erb +2 -3
  9. data/app/views/govuk_publishing_components/components/docs/add_another.yml +1 -1
  10. data/app/views/govuk_publishing_components/components/docs/feedback.yml +1 -1
  11. data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +1 -1
  12. data/lib/govuk_publishing_components/presenters/shared_helper.rb +0 -11
  13. data/lib/govuk_publishing_components/version.rb +1 -1
  14. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +217 -184
  15. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  16. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +216 -184
  17. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  18. data/node_modules/govuk-frontend/dist/govuk/all.mjs +1 -0
  19. data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
  20. data/node_modules/govuk-frontend/dist/govuk/all.scss +6 -0
  21. data/node_modules/govuk-frontend/dist/govuk/all.scss.map +1 -1
  22. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +164 -0
  23. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -0
  24. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  25. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +1 -87
  26. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
  27. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +149 -112
  28. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  29. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +148 -111
  30. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  31. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +5 -8
  32. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
  33. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +149 -112
  34. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
  35. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +148 -111
  36. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
  37. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +5 -8
  38. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
  39. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +174 -140
  40. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  41. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +173 -139
  42. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  43. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +17 -16
  44. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
  45. data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +4 -4
  46. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +1 -24
  47. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
  48. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +0 -23
  49. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
  50. data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro-options.json +2 -2
  51. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +149 -112
  52. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
  53. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +148 -111
  54. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
  55. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +6 -8
  56. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
  57. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +149 -112
  58. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  59. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +148 -111
  60. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  61. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +5 -8
  62. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
  63. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +1 -24
  64. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +1 -1
  65. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -23
  66. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +1 -1
  67. data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +4 -4
  68. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +149 -112
  69. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
  70. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +148 -111
  71. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
  72. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +6 -8
  73. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
  74. data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro-options.json +1 -1
  75. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +149 -112
  76. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
  77. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +148 -111
  78. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
  79. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +5 -8
  80. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -1
  81. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +1 -24
  82. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
  83. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +0 -23
  84. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
  85. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +1 -24
  86. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
  87. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +0 -23
  88. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
  89. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +1 -24
  90. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
  91. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +0 -23
  92. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
  93. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +1 -24
  94. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
  95. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +0 -23
  96. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
  97. data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +1 -1
  98. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
  99. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +1 -1
  100. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  101. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  102. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  103. data/node_modules/govuk-frontend/dist/govuk/init.mjs +17 -13
  104. data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
  105. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +5 -10
  106. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss.map +1 -1
  107. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
  108. data/node_modules/govuk-frontend/package.json +9 -9
  109. metadata +4 -6
  110. data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs +0 -18
  111. data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs.map +0 -1
  112. data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs +0 -31
  113. data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs.map +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b340b1565779a9e7ae1a1c56063a386e1083cad425b65b5b77313233767bf48
4
- data.tar.gz: ee7fd33d63fd4a00e2d8820637c859153d49047040df417453274eec0a81f048
3
+ metadata.gz: c50d14be7610561ed91341a0824caa29b9c767d839acb2c6f7c65b5f58514ac4
4
+ data.tar.gz: d8bd8854736387adecda29ca77c0f31af6b7e5f0d8123c30c4b9fa5223e2530e
5
5
  SHA512:
6
- metadata.gz: 20d167ef2111b13c7e9c97b6e2171cd85c426a713269e32c5cdc5b51459b1c14782a3975f1481e29046656461aa74f819f198e9edfb73750afd3a9774339d960
7
- data.tar.gz: 185782d6c5e7b10409bdd9a6dfc60c063bde552d9ecf2d3c8eede100a230feb189e1add437a927786dce35ad667a503b9f835153286a145fb5aea05358700ac8
6
+ metadata.gz: 8a3fd0fbac03888e39e3aecd3adcc1c69dd9c1f3b179f8eeb853c14cb3edbea20df8593a00126fc3d23fa3b550af45746f6b42679a145287abf31b92e20886a1
7
+ data.tar.gz: e26f92b617d944bee8ffaee93c200eef6bf1b8596c946092e5646f4862d9043a7c4ba26e9d784ce4f0445cda143ef57f27003c94275b2c2423e8117a743553de
@@ -69,40 +69,35 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
69
69
  }.bind(this), 1000)
70
70
  }.bind(this))
71
71
 
72
- // much of the JS needed to support sending the form contents via this script is
73
- // unsupported by IE, even IE11. This check causes IE to not intercept form submits
74
- // and let them happen normally, which is handled already by the backend
75
- if (typeof window.URLSearchParams === 'function') {
76
- for (var f = 0; f < this.forms.length; f++) {
77
- this.forms[f].addEventListener('submit', function (e) {
78
- e.preventDefault()
79
- var $form = e.target
80
- var xhr = new XMLHttpRequest()
81
- var url = $form.getAttribute('action')
82
- var params = new FormData($form)
83
- params = new URLSearchParams(params).toString()
84
-
85
- this.done = function () {
86
- if (xhr.status === 200) {
87
- this.showFormSuccess(xhr.message)
88
- this.revealInitialPrompt()
89
- this.setInitialAriaAttributes()
90
- this.activeForm.hidden = true
91
- clearInterval(this.timerInterval)
92
- } else {
93
- this.showError(xhr)
94
- this.enableSubmitFormButton($form)
95
- }
96
- }.bind(this)
97
-
98
- xhr.addEventListener('loadend', this.done)
99
- xhr.open('POST', url, true)
100
- xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
101
-
102
- this.disableSubmitFormButton($form)
103
- xhr.send(params)
104
- }.bind(this))
105
- }
72
+ for (var f = 0; f < this.forms.length; f++) {
73
+ this.forms[f].addEventListener('submit', function (e) {
74
+ e.preventDefault()
75
+ var $form = e.target
76
+ var xhr = new XMLHttpRequest()
77
+ var url = $form.getAttribute('action')
78
+ var params = new FormData($form)
79
+ params = new URLSearchParams(params).toString()
80
+
81
+ this.done = function () {
82
+ if (xhr.status === 200) {
83
+ this.showFormSuccess(xhr.message)
84
+ this.revealInitialPrompt()
85
+ this.setInitialAriaAttributes()
86
+ this.activeForm.hidden = true
87
+ clearInterval(this.timerInterval)
88
+ } else {
89
+ this.showError(xhr)
90
+ this.enableSubmitFormButton($form)
91
+ }
92
+ }.bind(this)
93
+
94
+ xhr.addEventListener('loadend', this.done)
95
+ xhr.open('POST', url, true)
96
+ xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
97
+
98
+ this.disableSubmitFormButton($form)
99
+ xhr.send(params)
100
+ }.bind(this))
106
101
  }
107
102
  }
108
103
 
@@ -336,7 +336,7 @@
336
336
  return str;
337
337
  }
338
338
 
339
- var VERSION = "4.0.29";
339
+ var VERSION = "4.0.30";
340
340
  /**
341
341
  * Returns the version of the script as a float to be stored in legacy systems that do not support
342
342
  * string versions.
@@ -622,6 +622,10 @@
622
622
  }
623
623
  var MAX_SELECTOR_LENGTH = 100;
624
624
  function getNodeSelector(node, selector) {
625
+ if (selector === void 0) { selector = ""; }
626
+ return _getNodeSelector(node, selector).slice(0, MAX_SELECTOR_LENGTH);
627
+ }
628
+ function _getNodeSelector(node, selector) {
625
629
  if (selector === void 0) { selector = ""; }
626
630
  try {
627
631
  if (selector &&
@@ -668,6 +672,7 @@
668
672
  var sessionAttributions = [];
669
673
  var largestEntry;
670
674
  var maximumSessionValue = 0;
675
+ var MAX_CLS_SOURCES = 50;
671
676
  function processEntry$2(entry) {
672
677
  if (!entry.hadRecentInput) {
673
678
  var firstEntry = sessionEntries[0];
@@ -717,7 +722,7 @@
717
722
  startTime: processTimeMetric(largestEntry.startTime),
718
723
  }
719
724
  : null,
720
- sources: sessionAttributions.length ? sessionAttributions : null,
725
+ sources: sessionAttributions.length ? sessionAttributions.slice(0, MAX_CLS_SOURCES) : null,
721
726
  };
722
727
  }
723
728
 
@@ -116,7 +116,7 @@ $gem-guide-border-width: 1px;
116
116
  }
117
117
 
118
118
  .component-guide-preview {
119
- padding: ($govuk-gutter * 1.5) $govuk-gutter $govuk-gutter;
119
+ padding: $govuk-gutter;
120
120
  border: $gem-guide-border-width solid $govuk-border-colour;
121
121
  position: relative;
122
122
 
@@ -38,6 +38,7 @@
38
38
  @import "components/fieldset";
39
39
  @import "components/file-upload";
40
40
  @import "components/glance-metric";
41
+ @import "components/global-banner";
41
42
  @import "components/govspeak-html-publication";
42
43
  @import "components/govspeak";
43
44
  @import "components/heading";
@@ -31,12 +31,11 @@
31
31
 
32
32
  h2 {
33
33
  margin-top: $govuk-gutter;
34
- margin-bottom: 0;
34
+ margin-bottom: govuk-spacing(4);
35
35
  @include govuk-font($size: 27, $weight: bold);
36
36
 
37
37
  @include govuk-media-query($from: desktop) {
38
38
  margin-top: $govuk-gutter * 1.5;
39
- margin-bottom: 0;
40
39
  }
41
40
  }
42
41
 
@@ -77,6 +76,7 @@
77
76
  a {
78
77
  @include govuk-link-common;
79
78
  @include govuk-link-style-default;
79
+ @include govuk-text-break-word;
80
80
 
81
81
  &:focus {
82
82
  @include govuk-focused-text;
@@ -182,7 +182,7 @@ module GovukPublishingComponents
182
182
  warnings = []
183
183
 
184
184
  locations.each do |location|
185
- next if location[:location] == "template" || location[:location] == "ruby"
185
+ next if %w[template ruby].include?(location[:location])
186
186
 
187
187
  location[:components].each do |component|
188
188
  raise_warning = asset_already_in_static(location[:location], component)
@@ -196,14 +196,14 @@ module GovukPublishingComponents
196
196
  def warn_about_missing_assets(components)
197
197
  warnings = []
198
198
 
199
- code = components.select { |c| c[:location] == "template" || c[:location] == "ruby" }
199
+ code = components.select { |c| %w[template ruby].include?(c[:location]) }
200
200
  code = [
201
201
  {
202
202
  location: "code",
203
203
  components: code.map { |c| c[:components] }.flatten.uniq.sort,
204
204
  },
205
205
  ]
206
- assets = components.select { |c| c[:location] == "stylesheet" || c[:location] == "javascript" }
206
+ assets = components.select { |c| %w[stylesheet javascript].include?(c[:location]) }
207
207
 
208
208
  warnings << find_missing_items(code, assets)
209
209
  warnings << find_missing_items(assets, code)
@@ -9,12 +9,11 @@
9
9
 
10
10
  inverse ||= false
11
11
  local_assigns[:margin_bottom] ||= 8
12
-
13
- shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
12
+ margin_bottom = [*0..9].include?(local_assigns[:margin_bottom]) ? "govuk-!-margin-bottom-#{local_assigns[:margin_bottom]}" : "govuk-!-margin-bottom-3"
14
13
 
15
14
  classes = %w[gem-c-title]
16
15
  classes << "gem-c-title--inverse" if inverse
17
- classes << shared_helper.get_margin_bottom
16
+ classes << margin_bottom
18
17
 
19
18
  heading_classes = %w[gem-c-title__text]
20
19
  heading_classes << (average_title_length.present? ? 'govuk-heading-l' : 'govuk-heading-xl')
@@ -35,7 +35,7 @@ examples:
35
35
  <input class="gem-c-input govuk-input" id="person_0_name" name="person[0]name">
36
36
  </div>
37
37
  destroy_checkbox: >
38
- <div class="govuk-checkboxes" data-module="govuk-checkboxes" data-govuk-checkboxes-init="">
38
+ <div class="govuk-checkboxes" data-module="govuk-checkboxes">
39
39
  <div class="govuk-checkboxes__item">
40
40
  <input type="checkbox" name="person[0][_destroy]" id="person_0__destroy" class="govuk-checkboxes__input">
41
41
  <label for="person_0__destroy" class="govuk-label govuk-checkboxes__label">Delete</label>
@@ -3,7 +3,7 @@ description: Invites user feedback on the current page.
3
3
  body: |
4
4
  This component is designed to sit at the bottom of pages on GOV.UK to allow users to submit feedback on that page.
5
5
 
6
- This component uses JavaScript for expanding and collapsing and also for submitting form responses. This code is not compatible with Internet Explorer, so IE11 and down do not use JavaScript to submit the forms, instead falling back to a normal form submission.
6
+ This component uses JavaScript for expanding and collapsing and also for submitting form responses. Users without JavaScript will fall back to a normal form submission.
7
7
  uses_component_wrapper_helper: true
8
8
  accessibility_criteria: |
9
9
  The form must:
@@ -34,7 +34,7 @@ module GovukPublishingComponents
34
34
  @is_page_heading = options[:is_page_heading]
35
35
  @description = options[:description] || nil
36
36
  @no_hint_text = options[:no_hint_text]
37
- @hint_text = options[:hint_text] || "Select all that apply." unless @no_hint_text
37
+ @hint_text = options[:hint_text] || "Select all that apply" unless @no_hint_text
38
38
  @visually_hide_heading = options[:visually_hide_heading]
39
39
  end
40
40
 
@@ -7,17 +7,6 @@ module GovukPublishingComponents
7
7
  @options = local_assigns
8
8
  @margin_bottom = @options[:margin_bottom] || 3
9
9
  @heading_level = @options[:heading_level] || 2
10
-
11
- if local_assigns.include?(:classes)
12
- @classes = local_assigns[:classes].split(" ")
13
- unless @classes.all? { |c| c.start_with?("js-") }
14
- raise(ArgumentError, "Passed classes must be prefixed with `js-`")
15
- end
16
- end
17
- end
18
-
19
- def get_margin_bottom
20
- [*0..9].include?(@margin_bottom) ? "govuk-!-margin-bottom-#{margin_bottom}" : "govuk-!-margin-bottom-3"
21
10
  end
22
11
 
23
12
  def get_heading_level
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "51.1.1".freeze
2
+ VERSION = "51.2.1".freeze
3
3
  end