govuk_tech_docs 5.2.2 → 6.0.0.beta

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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +15 -0
  4. data/README.md +11 -3
  5. data/example/config/tech-docs.yml +1 -1
  6. data/govuk_tech_docs.gemspec +1 -1
  7. data/lib/assets/stylesheets/_core.scss +1 -0
  8. data/lib/assets/stylesheets/_govuk_tech_docs.scss +13 -15
  9. data/lib/assets/stylesheets/modules/_app-pane.scss +3 -3
  10. data/lib/assets/stylesheets/modules/_page-review.scss +4 -4
  11. data/lib/assets/stylesheets/modules/_search.scss +3 -3
  12. data/lib/assets/stylesheets/modules/_service-navigation.scss +5 -0
  13. data/lib/assets/stylesheets/modules/_technical-documentation.scss +7 -7
  14. data/lib/assets/stylesheets/modules/_toc.scss +13 -13
  15. data/lib/assets/stylesheets/palette/_syntax-highlighting.scss +9 -7
  16. data/lib/govuk_tech_docs/meta_tags.rb +1 -1
  17. data/lib/govuk_tech_docs/version.rb +1 -1
  18. data/lib/source/layouts/_header.erb +2 -16
  19. data/lib/source/layouts/_service_navigation.erb +27 -0
  20. data/lib/source/layouts/core.erb +7 -7
  21. data/node_modules/govuk-frontend/dist/govuk/_base.scss +1 -0
  22. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +87 -229
  23. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +88 -229
  24. data/node_modules/govuk-frontend/dist/govuk/all.mjs +0 -1
  25. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.ico +0 -0
  26. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -1
  27. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
  28. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
  29. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
  30. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
  31. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  32. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +18 -15
  33. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +1 -126
  34. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +1 -126
  35. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +2 -2
  36. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +2 -2
  37. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +18 -21
  38. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -2
  39. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +20 -135
  40. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +20 -135
  41. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +19 -9
  42. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +7 -6
  43. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -5
  44. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +5 -0
  45. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +6 -4
  46. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +1 -1
  47. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +4 -2
  48. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +1 -1
  49. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +1 -126
  50. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +1 -126
  51. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +30 -38
  52. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +36 -132
  53. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +36 -132
  54. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +35 -6
  55. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +30 -27
  56. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +89 -449
  57. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +1 -1
  58. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +14 -20
  59. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +2 -1
  60. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +10 -8
  61. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +12 -11
  62. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +4 -4
  63. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -2
  64. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +1 -126
  65. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +1 -126
  66. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +12 -6
  67. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +8 -7
  68. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +6 -11
  69. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +55 -76
  70. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +30 -2
  71. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +30 -2
  72. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +30 -2
  73. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +7 -2
  74. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +25 -21
  75. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +7 -8
  76. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +9 -6
  77. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +66 -31
  78. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +7 -5
  79. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +5 -10
  80. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +5 -4
  81. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +0 -1
  82. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +2 -2
  83. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +2 -1
  84. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +6 -20
  85. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss +17 -0
  86. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +15 -0
  87. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +17 -0
  88. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss +5 -0
  89. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  90. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +168 -82
  91. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +41 -6
  92. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
  93. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +24 -40
  94. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +172 -33
  95. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +1 -1
  96. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +6 -30
  97. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +1 -126
  98. data/node_modules/govuk-frontend/dist/govuk/init.mjs +1 -2
  99. data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +1 -1
  100. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss +2 -1
  101. data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +1 -1
  102. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +3 -7
  103. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +2 -2
  104. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +1 -1
  105. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +0 -2
  106. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +5 -5
  107. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +3 -188
  108. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +366 -0
  109. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +9 -255
  110. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +117 -25
  111. data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss +18 -0
  112. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +3 -14
  113. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +0 -9
  114. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +12 -189
  115. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +0 -1
  116. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +4 -2
  117. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +2 -0
  118. data/package-lock.json +3228 -4
  119. data/package.json +1 -1
  120. metadata +10 -26
  121. data/node_modules/govuk-frontend/dist/govuk/all.scss +0 -9
  122. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
  123. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +0 -1
  124. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +0 -1
  125. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
  126. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
  127. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
  128. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +0 -1
  129. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  130. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +0 -39
  131. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +0 -10
  132. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +0 -238
  133. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -230
  134. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +0 -89
  135. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +0 -10
  136. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +0 -15
  137. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +0 -10
  138. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +0 -10
  139. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +0 -9
  140. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +0 -10
  141. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +0 -10
  142. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +0 -65
  143. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +0 -10
  144. data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +0 -349
  145. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +0 -25
@@ -347,7 +347,7 @@ class I18n {
347
347
  return 'other';
348
348
  }
349
349
  const translation = this.translations[lookupKey];
350
- const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);
350
+ const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : 'other';
351
351
  if (isObject(translation)) {
352
352
  if (preferredForm in translation) {
353
353
  return preferredForm;
@@ -358,132 +358,7 @@ class I18n {
358
358
  }
359
359
  throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
360
360
  }
361
- selectPluralFormUsingFallbackRules(count) {
362
- count = Math.abs(Math.floor(count));
363
- const ruleset = this.getPluralRulesForLocale();
364
- if (ruleset) {
365
- return I18n.pluralRules[ruleset](count);
366
- }
367
- return 'other';
368
- }
369
- getPluralRulesForLocale() {
370
- const localeShort = this.locale.split('-')[0];
371
- for (const pluralRule in I18n.pluralRulesMap) {
372
- const languages = I18n.pluralRulesMap[pluralRule];
373
- if (languages.includes(this.locale) || languages.includes(localeShort)) {
374
- return pluralRule;
375
- }
376
- }
377
- }
378
361
  }
379
- I18n.pluralRulesMap = {
380
- arabic: ['ar'],
381
- chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
382
- french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
383
- german: ['af', 'sq', 'az', 'eu', 'bg', 'ca', 'da', 'nl', 'en', 'et', 'fi', 'ka', 'de', 'el', 'hu', 'lb', 'no', 'so', 'sw', 'sv', 'ta', 'te', 'tr', 'ur'],
384
- irish: ['ga'],
385
- russian: ['ru', 'uk'],
386
- scottish: ['gd'],
387
- spanish: ['pt-PT', 'it', 'es'],
388
- welsh: ['cy']
389
- };
390
- I18n.pluralRules = {
391
- arabic(n) {
392
- if (n === 0) {
393
- return 'zero';
394
- }
395
- if (n === 1) {
396
- return 'one';
397
- }
398
- if (n === 2) {
399
- return 'two';
400
- }
401
- if (n % 100 >= 3 && n % 100 <= 10) {
402
- return 'few';
403
- }
404
- if (n % 100 >= 11 && n % 100 <= 99) {
405
- return 'many';
406
- }
407
- return 'other';
408
- },
409
- chinese() {
410
- return 'other';
411
- },
412
- french(n) {
413
- return n === 0 || n === 1 ? 'one' : 'other';
414
- },
415
- german(n) {
416
- return n === 1 ? 'one' : 'other';
417
- },
418
- irish(n) {
419
- if (n === 1) {
420
- return 'one';
421
- }
422
- if (n === 2) {
423
- return 'two';
424
- }
425
- if (n >= 3 && n <= 6) {
426
- return 'few';
427
- }
428
- if (n >= 7 && n <= 10) {
429
- return 'many';
430
- }
431
- return 'other';
432
- },
433
- russian(n) {
434
- const lastTwo = n % 100;
435
- const last = lastTwo % 10;
436
- if (last === 1 && lastTwo !== 11) {
437
- return 'one';
438
- }
439
- if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {
440
- return 'few';
441
- }
442
- if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {
443
- return 'many';
444
- }
445
- return 'other';
446
- },
447
- scottish(n) {
448
- if (n === 1 || n === 11) {
449
- return 'one';
450
- }
451
- if (n === 2 || n === 12) {
452
- return 'two';
453
- }
454
- if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {
455
- return 'few';
456
- }
457
- return 'other';
458
- },
459
- spanish(n) {
460
- if (n === 1) {
461
- return 'one';
462
- }
463
- if (n % 1000000 === 0 && n !== 0) {
464
- return 'many';
465
- }
466
- return 'other';
467
- },
468
- welsh(n) {
469
- if (n === 0) {
470
- return 'zero';
471
- }
472
- if (n === 1) {
473
- return 'one';
474
- }
475
- if (n === 2) {
476
- return 'two';
477
- }
478
- if (n === 3) {
479
- return 'few';
480
- }
481
- if (n === 6) {
482
- return 'many';
483
- }
484
- return 'other';
485
- }
486
- };
487
362
 
488
363
  /**
489
364
  * File upload component
@@ -598,7 +473,7 @@ class FileUpload extends ConfigurableComponent {
598
473
  if (this.$button.disabled) return;
599
474
  if (event.target instanceof Node) {
600
475
  if (this.$root.contains(event.target)) {
601
- if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {
476
+ if (event.dataTransfer && this.canDrop(event.dataTransfer)) {
602
477
  if (!this.$button.classList.contains('govuk-file-upload-button--dragging')) {
603
478
  this.showDraggingState();
604
479
  this.$announcements.innerText = this.i18n.t('enteredDropZone');
@@ -620,12 +495,30 @@ class FileUpload extends ConfigurableComponent {
620
495
  }
621
496
  onDrop(event) {
622
497
  event.preventDefault();
623
- if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {
498
+ if (event.dataTransfer && this.canFillInput(event.dataTransfer)) {
624
499
  this.$input.files = event.dataTransfer.files;
625
500
  this.$input.dispatchEvent(new CustomEvent('change'));
626
501
  this.hideDraggingState();
627
502
  }
628
503
  }
504
+ canFillInput(dataTransfer) {
505
+ return this.matchesInputCapacity(dataTransfer.files.length);
506
+ }
507
+ canDrop(dataTransfer) {
508
+ if (dataTransfer.items.length) {
509
+ return this.matchesInputCapacity(countFileItems(dataTransfer.items));
510
+ }
511
+ if (dataTransfer.types.length) {
512
+ return dataTransfer.types.includes('Files');
513
+ }
514
+ return true;
515
+ }
516
+ matchesInputCapacity(numberOfFiles) {
517
+ if (this.$input.multiple) {
518
+ return numberOfFiles > 0;
519
+ }
520
+ return numberOfFiles === 1;
521
+ }
629
522
  onChange() {
630
523
  const fileCount = this.$input.files.length;
631
524
  if (fileCount === 0) {
@@ -672,6 +565,13 @@ class FileUpload extends ConfigurableComponent {
672
565
  this.$root.classList.toggle('govuk-drop-zone--disabled', this.$button.disabled);
673
566
  }
674
567
  }
568
+
569
+ /**
570
+ * Counts the number of `DataTransferItem` whose kind is `file`
571
+ *
572
+ * @param {DataTransferItemList} list - The list
573
+ * @returns {number} - The number of items whose kind is `file` in the list
574
+ */
675
575
  FileUpload.moduleName = 'govuk-file-upload';
676
576
  FileUpload.defaults = Object.freeze({
677
577
  i18n: {
@@ -693,10 +593,14 @@ FileUpload.schema = Object.freeze({
693
593
  }
694
594
  }
695
595
  });
696
- function isContainingFiles(dataTransfer) {
697
- const hasNoTypesInfo = dataTransfer.types.length === 0;
698
- const isDraggingFiles = dataTransfer.types.some(type => type === 'Files');
699
- return hasNoTypesInfo || isDraggingFiles;
596
+ function countFileItems(list) {
597
+ let result = 0;
598
+ for (let i = 0; i < list.length; i++) {
599
+ if (list[i].kind === 'file') {
600
+ result++;
601
+ }
602
+ }
603
+ return result;
700
604
  }
701
605
 
702
606
  /**
@@ -117,7 +117,7 @@ class FileUpload extends ConfigurableComponent {
117
117
  if (this.$button.disabled) return;
118
118
  if (event.target instanceof Node) {
119
119
  if (this.$root.contains(event.target)) {
120
- if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {
120
+ if (event.dataTransfer && this.canDrop(event.dataTransfer)) {
121
121
  if (!this.$button.classList.contains('govuk-file-upload-button--dragging')) {
122
122
  this.showDraggingState();
123
123
  this.$announcements.innerText = this.i18n.t('enteredDropZone');
@@ -139,12 +139,30 @@ class FileUpload extends ConfigurableComponent {
139
139
  }
140
140
  onDrop(event) {
141
141
  event.preventDefault();
142
- if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {
142
+ if (event.dataTransfer && this.canFillInput(event.dataTransfer)) {
143
143
  this.$input.files = event.dataTransfer.files;
144
144
  this.$input.dispatchEvent(new CustomEvent('change'));
145
145
  this.hideDraggingState();
146
146
  }
147
147
  }
148
+ canFillInput(dataTransfer) {
149
+ return this.matchesInputCapacity(dataTransfer.files.length);
150
+ }
151
+ canDrop(dataTransfer) {
152
+ if (dataTransfer.items.length) {
153
+ return this.matchesInputCapacity(countFileItems(dataTransfer.items));
154
+ }
155
+ if (dataTransfer.types.length) {
156
+ return dataTransfer.types.includes('Files');
157
+ }
158
+ return true;
159
+ }
160
+ matchesInputCapacity(numberOfFiles) {
161
+ if (this.$input.multiple) {
162
+ return numberOfFiles > 0;
163
+ }
164
+ return numberOfFiles === 1;
165
+ }
148
166
  onChange() {
149
167
  const fileCount = this.$input.files.length;
150
168
  if (fileCount === 0) {
@@ -191,6 +209,13 @@ class FileUpload extends ConfigurableComponent {
191
209
  this.$root.classList.toggle('govuk-drop-zone--disabled', this.$button.disabled);
192
210
  }
193
211
  }
212
+
213
+ /**
214
+ * Counts the number of `DataTransferItem` whose kind is `file`
215
+ *
216
+ * @param {DataTransferItemList} list - The list
217
+ * @returns {number} - The number of items whose kind is `file` in the list
218
+ */
194
219
  FileUpload.moduleName = 'govuk-file-upload';
195
220
  FileUpload.defaults = Object.freeze({
196
221
  i18n: {
@@ -212,10 +237,14 @@ FileUpload.schema = Object.freeze({
212
237
  }
213
238
  }
214
239
  });
215
- function isContainingFiles(dataTransfer) {
216
- const hasNoTypesInfo = dataTransfer.types.length === 0;
217
- const isDraggingFiles = dataTransfer.types.some(type => type === 'Files');
218
- return hasNoTypesInfo || isDraggingFiles;
240
+ function countFileItems(list) {
241
+ let result = 0;
242
+ for (let i = 0; i < list.length; i++) {
243
+ if (list[i].kind === 'file') {
244
+ result++;
245
+ }
246
+ }
247
+ return result;
219
248
  }
220
249
 
221
250
  /**
@@ -1,24 +1,21 @@
1
1
  @include govuk-exports("govuk/component/footer") {
2
- $govuk-footer-background: $govuk-template-background-colour;
3
- $govuk-footer-text: $govuk-text-colour;
4
- $govuk-footer-content-border: $govuk-border-colour;
2
+ $govuk-footer-background: govuk-functional-colour(surface-background);
3
+ $govuk-footer-text: govuk-functional-colour(surface-text);
4
+ $govuk-footer-content-border: govuk-functional-colour(surface-border);
5
5
 
6
6
  // Royal Arms image dimensions
7
7
  $govuk-footer-crest-image-width: 125px;
8
8
  $govuk-footer-crest-image-height: 102px;
9
9
 
10
10
  .govuk-footer {
11
- @include govuk-font($size: if($govuk-new-typography-scale, 19, 16));
11
+ @include govuk-font($size: 19);
12
12
  @include govuk-responsive-padding(7, "top");
13
13
  @include govuk-responsive-padding(5, "bottom");
14
14
 
15
- border-top: 10px solid $govuk-brand-colour;
15
+ border-top: 10px solid;
16
+ border-top-color: govuk-functional-colour(brand);
16
17
  color: $govuk-footer-text;
17
- @include _govuk-rebrand(
18
- "background",
19
- $from: $govuk-footer-background,
20
- $to: $_govuk-rebrand-template-background-colour
21
- );
18
+ background: govuk-functional-colour(template-background);
22
19
  }
23
20
 
24
21
  .govuk-footer__crown {
@@ -27,19 +24,16 @@
27
24
 
28
25
  .govuk-footer__link {
29
26
  @include govuk-link-common;
30
- @include govuk-link-style-text;
27
+ @include govuk-link-style-default;
31
28
  }
32
29
 
33
30
  .govuk-footer__section-break {
34
31
  margin: 0; // Reset `<hr>` default margins
35
32
  @include govuk-responsive-margin(8, "bottom");
36
33
  border: 0; // Reset `<hr>` default borders
37
- border-bottom: 1px solid;
38
- @include _govuk-rebrand(
39
- "border-bottom-color",
40
- $from: $govuk-footer-content-border,
41
- $to: $_govuk-rebrand-border-colour-on-blue-tint-95
42
- );
34
+ border-bottom-width: 1px;
35
+ border-bottom-style: solid;
36
+ border-bottom-color: $govuk-footer-content-border;
43
37
  }
44
38
 
45
39
  .govuk-footer__meta {
@@ -59,7 +53,7 @@
59
53
 
60
54
  .govuk-footer__meta-item--grow {
61
55
  flex: 1; // Support: Flexbox
62
- @include govuk-media-query($until: tablet) {
56
+ @media #{govuk-until-breakpoint(tablet)} {
63
57
  flex-basis: 320px; // Support: Flexbox
64
58
  }
65
59
  }
@@ -67,7 +61,7 @@
67
61
  .govuk-footer__licence-logo {
68
62
  display: inline-block;
69
63
  margin-right: govuk-spacing(2);
70
- @include govuk-media-query($until: desktop) {
64
+ @media #{govuk-until-breakpoint(desktop)} {
71
65
  margin-bottom: govuk-spacing(3);
72
66
  }
73
67
  vertical-align: top;
@@ -84,6 +78,10 @@
84
78
  text-wrap: balance;
85
79
  }
86
80
 
81
+ .govuk-footer__copyright-logo {
82
+ @include govuk-link-style-text;
83
+ }
84
+
87
85
  .govuk-footer__copyright-logo::before {
88
86
  content: "";
89
87
  display: block;
@@ -127,10 +125,18 @@
127
125
  padding: 0;
128
126
  }
129
127
 
128
+ .govuk-footer__inline-list:last-child {
129
+ margin-bottom: 0;
130
+ }
131
+
130
132
  .govuk-footer__meta-custom {
131
133
  margin-bottom: govuk-spacing(4);
132
134
  }
133
135
 
136
+ .govuk-footer__meta-custom:last-child {
137
+ margin-bottom: 0;
138
+ }
139
+
134
140
  .govuk-footer__inline-list-item {
135
141
  display: inline-block;
136
142
  margin-right: govuk-spacing(3);
@@ -141,16 +147,13 @@
141
147
  margin-bottom: govuk-spacing(6);
142
148
  padding-bottom: govuk-spacing(4);
143
149
 
144
- @include govuk-media-query($until: tablet) {
150
+ @media #{govuk-until-breakpoint(tablet)} {
145
151
  padding-bottom: govuk-spacing(2);
146
152
  }
147
153
 
148
- border-bottom: 1px solid;
149
- @include _govuk-rebrand(
150
- "border-bottom-color",
151
- $from: $govuk-footer-content-border,
152
- $to: $_govuk-rebrand-border-colour-on-blue-tint-95
153
- );
154
+ border-bottom-width: 1px;
155
+ border-bottom-style: solid;
156
+ border-bottom-color: $govuk-footer-content-border;
154
157
  }
155
158
 
156
159
  .govuk-footer__navigation {
@@ -172,7 +175,7 @@
172
175
  column-gap: $govuk-gutter; // Support: Columns
173
176
  }
174
177
 
175
- @include govuk-media-query($from: desktop) {
178
+ @media #{govuk-from-breakpoint(desktop)} {
176
179
  .govuk-footer__list--columns-2 {
177
180
  column-count: 2; // Support: Columns
178
181
  }