govuk_publishing_components 34.6.0 → 34.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +2 -1
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +6 -4
  4. data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +6 -3
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +6 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +12 -0
  8. data/app/views/govuk_publishing_components/components/_document_list.html.erb +1 -0
  9. data/app/views/govuk_publishing_components/components/docs/document_list.yml +18 -1
  10. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +22 -1
  11. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +0 -7
  12. data/lib/govuk_publishing_components/version.rb +1 -1
  13. data/node_modules/govuk-frontend/govuk/all.js +4029 -3792
  14. data/node_modules/govuk-frontend/govuk/all.js.map +1 -0
  15. data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js +52 -51
  16. data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js.map +1 -0
  17. data/node_modules/govuk-frontend/govuk/common/index.js +153 -145
  18. data/node_modules/govuk-frontend/govuk/common/index.js.map +1 -0
  19. data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js +324 -321
  20. data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js.map +1 -0
  21. data/node_modules/govuk-frontend/govuk/common.js +154 -146
  22. data/node_modules/govuk-frontend/govuk/common.js.map +1 -0
  23. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -1
  24. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +23 -4
  25. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +2059 -1654
  26. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js.map +1 -0
  27. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +11 -11
  28. data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +1 -1
  29. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +19 -19
  30. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +21 -10
  31. data/node_modules/govuk-frontend/govuk/components/button/button.js +927 -917
  32. data/node_modules/govuk-frontend/govuk/components/button/button.js.map +1 -0
  33. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +2050 -2040
  34. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js.map +1 -0
  35. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +1155 -1147
  36. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js.map +1 -0
  37. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +23 -23
  38. data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +1 -1
  39. data/node_modules/govuk-frontend/govuk/components/details/details.js +800 -799
  40. data/node_modules/govuk-frontend/govuk/components/details/details.js.map +1 -0
  41. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +1058 -1045
  42. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js.map +1 -0
  43. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +6 -0
  44. data/node_modules/govuk-frontend/govuk/components/header/header.js +646 -998
  45. data/node_modules/govuk-frontend/govuk/components/header/header.js.map +1 -0
  46. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +760 -752
  47. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js.map +1 -0
  48. data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +61 -0
  49. data/node_modules/govuk-frontend/govuk/components/pagination/template.njk +1 -1
  50. data/node_modules/govuk-frontend/govuk/components/phase-banner/macro-options.json +1 -1
  51. data/node_modules/govuk-frontend/govuk/components/radios/radios.js +1110 -1107
  52. data/node_modules/govuk-frontend/govuk/components/radios/radios.js.map +1 -0
  53. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +1017 -1014
  54. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js.map +1 -0
  55. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +107 -0
  56. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +318 -23
  57. data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +110 -0
  58. data/node_modules/govuk-frontend/govuk/components/summary-list/template.njk +72 -28
  59. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +1392 -1264
  60. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js.map +1 -0
  61. data/node_modules/govuk-frontend/govuk/i18n.js +363 -364
  62. data/node_modules/govuk-frontend/govuk/i18n.js.map +1 -0
  63. data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +5 -5
  64. data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js +242 -241
  65. data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js.map +1 -0
  66. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js +13 -12
  67. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js.map +1 -0
  68. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js +17 -16
  69. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js.map +1 -0
  70. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js +547 -546
  71. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js.map +1 -0
  72. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js +37 -36
  73. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js.map +1 -0
  74. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js +251 -250
  75. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js.map +1 -0
  76. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js +21 -20
  77. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js.map +1 -0
  78. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +198 -197
  79. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js.map +1 -0
  80. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +198 -197
  81. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js.map +1 -0
  82. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js +106 -105
  83. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js.map +1 -0
  84. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js +400 -399
  85. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js.map +1 -0
  86. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js +239 -238
  87. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js.map +1 -0
  88. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js +72 -71
  89. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js.map +1 -0
  90. data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js +14 -13
  91. data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js.map +1 -0
  92. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js +17 -16
  93. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js.map +1 -0
  94. data/node_modules/govuk-frontend/govuk-esm/all.mjs +2 -2
  95. data/node_modules/govuk-frontend/govuk-esm/common/index.mjs +17 -10
  96. data/node_modules/govuk-frontend/govuk-esm/common/normalise-dataset.mjs +3 -1
  97. data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +135 -52
  98. data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +11 -9
  99. data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +10 -7
  100. data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +24 -18
  101. data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +23 -16
  102. data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +15 -11
  103. data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +3 -2
  104. data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +3 -4
  105. data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +10 -9
  106. data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +5 -3
  107. data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +165 -38
  108. data/node_modules/govuk-frontend/govuk-esm/i18n.mjs +9 -11
  109. data/node_modules/govuk-frontend/package.json +1 -1
  110. metadata +35 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e64d34524575e781292e650596fdb06fc0cf9644329d27aa66fd32e8d0dbdfd5
4
- data.tar.gz: 757292d30401fc24dc3d99c2f67a5c7fc11f528e531a4e2605004bbd367b1c0c
3
+ metadata.gz: 0f9d8b0bbc2f5782c158e6f8cc16b7aab55063e31a4408e5079339141074fa8f
4
+ data.tar.gz: a7a9e1ce6693941a070f4a9044e3068fdf70b326e20308dc6efab1d47fa9494a
5
5
  SHA512:
6
- metadata.gz: 67e4ebd3c3796d54b3d514b65138f800db901996f39bf2a55559230eb3cd9c475c2ac5344d41b53ad41c0f24f42d6d92a9a90fd772dc2bc06d686e0642c75b4e
7
- data.tar.gz: 70758cb00c5f1d4726cae67de5036258f1dc5545397d9432227086b46b4ba98bf7f5644712be779c327f9065a693e749e5b42fc3d5288ef7d64166787ede4af5
6
+ metadata.gz: bc76829c0f80ffad61f561e0fd197967767137681936f1392040b8b44559c72b93c78cd92bedcb50ca3acfa3984f37aad8f42d9576fe90ec41ec99e2cf0273e9
7
+ data.tar.gz: 6e151edcbbb519a3073441eeb912f6a39ebc3216fd65a6f4362ac9ce70c7b5a8f91482c461a8bd5f8bd8ed0ec05bd5311641b97e44e08e420c0b17e4c6c7a686
@@ -72,7 +72,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
72
72
  schema.event = 'event_data'
73
73
  var text = data.text || event.target.textContent
74
74
  data.text = window.GOVUK.analyticsGa4.core.trackFunctions.removeLinesAndExtraSpaces(text)
75
- data.url = window.GOVUK.analyticsGa4.core.trackFunctions.removeCrossDomainParams(this.findLink(event.target).getAttribute('href'))
75
+ var url = data.url || this.findLink(event.target).getAttribute('href')
76
+ data.url = window.GOVUK.analyticsGa4.core.trackFunctions.removeCrossDomainParams(url)
76
77
  data.link_domain = window.GOVUK.analyticsGa4.core.trackFunctions.populateLinkDomain(data.url)
77
78
  data.link_path_parts = window.GOVUK.analyticsGa4.core.trackFunctions.populateLinkPathParts(data.url)
78
79
  data.method = window.GOVUK.analyticsGa4.core.trackFunctions.getClickType(event)
@@ -2,8 +2,6 @@ window.GOVUK = window.GOVUK || {}
2
2
  window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
3
3
 
4
4
  var initFunction = function () {
5
- // to be added: digital identity consent mechanism
6
-
7
5
  var consentCookie = window.GOVUK.getConsentCookie()
8
6
 
9
7
  if (consentCookie && consentCookie.usage) {
@@ -16,10 +14,14 @@ var initFunction = function () {
16
14
  for (var property in analyticsModules) {
17
15
  var module = analyticsModules[property]
18
16
  if (typeof module.init === 'function') {
19
- module.init()
17
+ try {
18
+ module.init()
19
+ } catch (e) {
20
+ // if there's a problem with the module, catch the error to allow other modules to start
21
+ console.warn('Error starting analytics module ' + property + ': ' + e.message, window.location)
22
+ }
20
23
  }
21
24
  }
22
- // to be added: cross domain tracking code
23
25
  } else {
24
26
  window.addEventListener('cookie-consent', window.GOVUK.analyticsGa4.init)
25
27
  }
@@ -5,15 +5,18 @@
5
5
  window.GOVUK.loadAnalytics = {
6
6
  productionDomains: [
7
7
  'www.gov.uk',
8
- 'www-origin.publishing.service.gov.uk'
8
+ 'www-origin.publishing.service.gov.uk',
9
+ 'assets.publishing.service.gov.uk'
9
10
  ],
10
11
  stagingDomains: [
11
12
  'www.staging.publishing.service.gov.uk',
12
- 'www-origin.staging.publishing.service.gov.uk'
13
+ 'www-origin.staging.publishing.service.gov.uk',
14
+ 'assets.staging.publishing.service.gov.uk'
13
15
  ],
14
16
  integrationDomains: [
15
17
  'www.integration.publishing.service.gov.uk',
16
- 'www-origin.integration.publishing.service.gov.uk'
18
+ 'www-origin.integration.publishing.service.gov.uk',
19
+ 'assets.integration.publishing.service.gov.uk'
17
20
  ],
18
21
  developmentDomains: [
19
22
  'localhost', '127.0.0.1', '0.0.0.0'
@@ -29,6 +29,12 @@
29
29
  }
30
30
  }
31
31
 
32
+ .gem-c-document-list--no-top-border-first-child {
33
+ .gem-c-document-list__item:first-child {
34
+ border-top: none;
35
+ }
36
+ }
37
+
32
38
  .gem-c-document-list__item-title--context {
33
39
  margin-right: govuk-spacing(2);
34
40
 
@@ -741,9 +741,9 @@ $after-button-padding-left: govuk-spacing(4);
741
741
  .gem-c-layout-super-navigation-header__navigation-second-item-link {
742
742
  font-size: 16px;
743
743
  font-size: govuk-px-to-rem(16px);
744
+ font-weight: bold;
744
745
 
745
746
  @include govuk-media-query($from: "desktop") {
746
- font-weight: bold;
747
747
  padding: 0;
748
748
 
749
749
  &:after {
@@ -41,5 +41,17 @@
41
41
  td small {
42
42
  font-size: 1em;
43
43
  }
44
+
45
+ .cell-text-left {
46
+ text-align: left;
47
+ }
48
+
49
+ .cell-text-center {
50
+ text-align: center;
51
+ }
52
+
53
+ .cell-text-right {
54
+ text-align: right;
55
+ }
44
56
  }
45
57
  }
@@ -6,6 +6,7 @@
6
6
  classes << " gem-c-document-list--bottom-margin" if local_assigns[:margin_bottom]
7
7
  classes << " gem-c-document-list--no-underline" if local_assigns[:remove_underline]
8
8
  classes << " gem-c-document-list--no-top-border" if local_assigns[:remove_top_border]
9
+ classes << " gem-c-document-list--no-top-border-first-child" if local_assigns[:remove_top_border_from_first_child]
9
10
 
10
11
  within_multitype_list ||= false
11
12
  within_multitype_list_class = " gem-c-document-list__multi-list" if within_multitype_list
@@ -195,7 +195,7 @@ examples:
195
195
  document_type: 'Statistical data set'
196
196
  subtext: 'First published during the 1996 Conservative Government'
197
197
  without_top_border_on_list_element:
198
- description: Several interfaces across GOV.UK benefit from the semantics of the document list but have their own bespoke designs, sometimes meaning that the visual border element doesn't gel with said interface. Removing it using the below attribute allows for cleaner visual fidelity in this instances.
198
+ description: Several interfaces across GOV.UK benefit from the semantics of the document list but have their own bespoke designs, sometimes meaning that the visual border element doesn't gel with said interface. Removing it using the below attribute allows for cleaner visual fidelity in these instances.
199
199
  data:
200
200
  remove_top_border: true
201
201
  items:
@@ -211,6 +211,23 @@ examples:
211
211
  metadata:
212
212
  public_updated_at: 2017-07-19 15:01:48
213
213
  document_type: 'Statistical data set'
214
+ without_top_border_on_first_list_element:
215
+ description: Several interfaces across GOV.UK benefit from the semantics of the document list but have their own bespoke designs, sometimes meaning that the visual border element doesn't gel with said interface. Removing it using the below attribute allows for cleaner visual fidelity in these instances.
216
+ data:
217
+ remove_top_border_from_first_child: true
218
+ items:
219
+ - link:
220
+ text: 'Department for Education – Statistics at DfE'
221
+ path: '/government/organisations/department-for-education/about/statistics'
222
+ metadata:
223
+ public_updated_at: 2017-07-19 15:01:48
224
+ document_type: 'Corporate information'
225
+ - link:
226
+ text: 'State-funded school inspections and outcomes: management information'
227
+ path: '/government/organisations/department-for-education/about/statistics'
228
+ metadata:
229
+ public_updated_at: 2017-07-19 15:01:48
230
+ document_type: 'Statistical data set'
214
231
  highlighted_result:
215
232
  description: Highlight one or more of the items in the list. This is used on finders to provide a 'top result' for a search. The `highlight_text` parameter is optional.
216
233
  data:
@@ -180,11 +180,32 @@ examples:
180
180
  </tr>
181
181
  </tbody>
182
182
  </table>
183
+ tables_with_alignments:
184
+ data:
185
+ block: |
186
+ <table>
187
+ <thead>
188
+ <tr>
189
+ <th scope="col">Default aligned</th>
190
+ <th class="cell-text-left" scope="col">Left aligned</th>
191
+ <th class="cell-text-center" scope="col">Center aligned</th>
192
+ <th class="cell-text-right" scope="col">Right aligned</th>
193
+ </tr>
194
+ </thead>
195
+ <tbody>
196
+ <tr>
197
+ <td>First body part</td>
198
+ <td class="cell-text-left">Second cell</td>
199
+ <td class="cell-text-center">Third cell</td>
200
+ <td class="cell-text-right">fourth cell</td>
201
+ </tr>
202
+ </tbody>
203
+ </table>
183
204
  charts:
184
205
  description: |
185
206
  The Government Statistical Service (GSS) guidance recommends [a limit of four categories as best practice for basic data visualisations](https://gss.civilservice.gov.uk/policy-store/data-visualisation-colours-in-charts/#section-5).
186
207
 
187
- Note that charts which have up to 7 categories, [chart with colours](http://govuk-publishing-components.dev.gov.uk/component-guide/govspeak/chart_with_colours/preview), for example, will display subsequent bars in `#3d3d3d`, `#a285d1` and the 7th bar in the default colour of `#0b0c0c` and will still meet the colour contrast requirements for adjacent colours.
208
+ Note that charts which have up to 7 categories, [chart with colours](http://govuk-publishing-components.dev.gov.uk/component-guide/govspeak/chart_with_colours/preview), for example, will display subsequent bars in `#3d3d3d`, `#a285d1` and the 7th bar in the default colour of `#0b0c0c` and will still meet the colour contrast requirements for adjacent colours.
188
209
  Charts that have 8 or more categories will display additional bars in the default colour and will not meet colour contrast requirements for adjacent colours.
189
210
  data:
190
211
  block: |
@@ -12,9 +12,6 @@ module GovukPublishingComponents
12
12
  world_locations
13
13
  statistical_data_sets
14
14
  ].freeze
15
- WORLD_LOCATION_SPECIAL_CASES = {
16
- "UK Mission to the European Union" => "uk-mission-to-the-eu",
17
- }.freeze
18
15
 
19
16
  def initialize(options = {})
20
17
  @content_item = options.fetch(:content_item) { raise ArgumentError, "missing argument: content_item" }
@@ -115,10 +112,6 @@ module GovukPublishingComponents
115
112
 
116
113
  def related_world_locations
117
114
  content_item_links_for("world_locations")
118
- .map do |link|
119
- slug = WORLD_LOCATION_SPECIAL_CASES[link[:text]] || link[:text].parameterize
120
- link.merge(path: "/world/#{slug}/news")
121
- end
122
115
  end
123
116
 
124
117
  def related_statistical_data_sets
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "34.6.0".freeze
2
+ VERSION = "34.7.1".freeze
3
3
  end