govuk_publishing_components 55.0.1 → 55.1.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 (167) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/file-upload.js +5 -0
  3. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +5 -2
  5. data/app/views/govuk_publishing_components/components/_file_upload.html.erb +13 -1
  6. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +0 -1
  7. data/app/views/govuk_publishing_components/components/docs/file_upload.yml +6 -0
  8. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +1 -1
  9. data/lib/govuk_publishing_components/version.rb +1 -1
  10. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +313 -47
  11. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  12. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +312 -47
  13. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  14. data/node_modules/govuk-frontend/dist/govuk/all.mjs +2 -1
  15. data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
  16. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +21 -16
  17. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -1
  18. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  19. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +3 -0
  20. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
  21. data/node_modules/govuk-frontend/dist/govuk/{govuk-frontend-component.mjs → component.mjs} +5 -5
  22. data/node_modules/govuk-frontend/dist/govuk/component.mjs.map +1 -0
  23. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +27 -19
  24. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  25. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +27 -19
  26. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  27. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +1 -1
  28. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
  29. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +27 -19
  30. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
  31. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +27 -19
  32. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
  33. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +1 -1
  34. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
  35. data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +2 -1
  36. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +8 -0
  37. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
  38. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +28 -20
  39. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  40. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +28 -20
  41. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  42. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +2 -2
  43. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
  44. data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +16 -1
  45. data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +2 -2
  46. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template.njk +5 -4
  47. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +8 -5
  48. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
  49. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +8 -5
  50. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
  51. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs +2 -2
  52. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -1
  53. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +27 -19
  54. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
  55. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +27 -19
  56. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
  57. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +1 -1
  58. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
  59. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +27 -19
  60. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  61. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +27 -19
  62. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  63. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +1 -1
  64. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
  65. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +167 -0
  66. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
  67. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +754 -0
  68. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -0
  69. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +746 -0
  70. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -0
  71. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +267 -0
  72. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -0
  73. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +207 -16
  74. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +52 -3
  75. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-direct-media-capture.html +6 -0
  76. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-image-files-only.html +6 -0
  77. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-multiple-files.html +6 -0
  78. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-disabled.html +6 -0
  79. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-disabled.html +13 -0
  80. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-with-error-message-and-hint.html +16 -0
  81. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html +10 -0
  82. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html +10 -0
  83. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +42 -5
  84. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +14 -10
  85. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  86. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +8 -5
  87. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +1 -1
  88. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +8 -5
  89. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +1 -1
  90. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +2 -2
  91. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +1 -1
  92. data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +25 -12
  93. data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +16 -2
  94. data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +2 -2
  95. data/node_modules/govuk-frontend/dist/govuk/components/input/template-default.html +2 -2
  96. data/node_modules/govuk-frontend/dist/govuk/components/input/template.njk +5 -4
  97. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +27 -19
  98. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
  99. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +27 -19
  100. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
  101. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +1 -1
  102. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
  103. data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +16 -2
  104. data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro-options.json +2 -2
  105. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +27 -20
  106. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
  107. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +27 -20
  108. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
  109. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +1 -2
  110. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -1
  111. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-default.html +3 -3
  112. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template.njk +4 -2
  113. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +8 -5
  114. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
  115. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +8 -5
  116. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
  117. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs +2 -2
  118. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -1
  119. data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +16 -1
  120. data/node_modules/govuk-frontend/dist/govuk/components/select/macro-options.json +2 -2
  121. data/node_modules/govuk-frontend/dist/govuk/components/select/template-id.html +7 -0
  122. data/node_modules/govuk-frontend/dist/govuk/components/select/template.njk +6 -4
  123. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +8 -5
  124. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
  125. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +8 -5
  126. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
  127. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +2 -2
  128. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -1
  129. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +9 -6
  130. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
  131. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +9 -6
  132. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
  133. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +3 -3
  134. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -1
  135. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +12 -21
  136. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
  137. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +142 -0
  138. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-extreme.html +106 -0
  139. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +8 -5
  140. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
  141. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +8 -5
  142. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
  143. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +2 -2
  144. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -1
  145. data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +15 -1
  146. data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +2 -2
  147. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template.njk +6 -4
  148. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
  149. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +1 -1
  150. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -1
  151. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  152. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  153. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  154. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  155. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +2 -2
  156. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
  157. data/node_modules/govuk-frontend/dist/govuk/init.mjs +11 -11
  158. data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
  159. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +18 -5
  160. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
  161. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +1 -1
  162. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +1 -1
  163. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
  164. data/node_modules/govuk-frontend/package.json +7 -7
  165. metadata +21 -5
  166. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-value.html +0 -6
  167. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs.map +0 -1
@@ -67,7 +67,7 @@
67
67
  }
68
68
 
69
69
  // Output a warning if $websafe is set.
70
- @if $websafe and not index($govuk-suppressed-warnings, "organisation-colour-websafe-param") {
70
+ @if $websafe and _should-warn("organisation-colour-websafe-param") {
71
71
  @warn _warning-text("organisation-colour-websafe-param",
72
72
  "The `$websafe` parameter of `govuk-organisation-colour` has been " +
73
73
  "renamed to `$contrast-safe`. The old parameter name will be removed in " +
@@ -77,7 +77,7 @@
77
77
 
78
78
  $org-colour: map-get($govuk-colours-organisations, $organisation);
79
79
 
80
- @if map-has-key($org-colour, deprecation-message) and not index($govuk-suppressed-warnings, "organisation-colours") {
80
+ @if map-has-key($org-colour, deprecation-message) and _should-warn("organisation-colours") {
81
81
  @warn _warning-text(
82
82
  "organisation-colours",
83
83
  map-get($org-colour, deprecation-message)
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/govuk/helpers/_colour.scss"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,2CAA2C;AAC3C,8BAA8B;;AAE9B,GAAG;AACH,wBAAwB;AACxB,GAAG;;AAEH,aAAa;AACb,EAAE;AACF,4EAA4E;AAC5E,uBAAuB;AACvB,mEAAmE;AACnE,yEAAyE;AACzE,6EAA6E;AAC7E,4BAA4B;AAC5B,kDAAkD;AAClD,EAAE;AACF,8DAA8D;AAC9D,iBAAiB;;AAEjB;EACE,iDAAiD;EACjD;IACE;;yCAEqC;EACvC;;EAEA;IACE,0EAA0E;IAC1E,4BAA4B;EAC9B;;EAEA;IACE,oCAAoC;EACtC;;EAEA,wCAAwC;AAC1C;;AAEA,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,sEAAsE;AACtE,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,oEAAoE;AACpE,EAAE;AACF,6DAA6D;AAC7D,wDAAwD;AACxD,iBAAiB;;AAEjB;EACE,yEAAyE;EACzE,8CAA8C;EAC9C;IACE,4EAA4E;EAC9E;;EAEA,yCAAyC;EACzC;IACE,gDAAgD;EAClD;;EAEA,sCAAsC;EACtC;IACE;;;;KAIC;EACH;;EAEA,iEAAiE;;EAEjE;IACE;;;KAGC;EACH;;EAEA,6EAA6E;EAC7E,6EAA6E;EAC7E,mDAAmD;EACnD;IACE,wBAAwB;EAC1B;;EAEA,0EAA0E;EAC1E,+BAA+B;EAC/B,iFAAiF;;EAEjF;IACE,uCAAuC;EACzC,EAAE;IACA,oCAAoC;EACtC;AACF;;AAEA,+CAA+C;AAC/C,EAAE;AACF,4CAA4C;AAC5C,wEAAwE;AACxE,mBAAmB;AACnB,iBAAiB;;AAEjB;EACE,0CAA0C;AAC5C;;AAEA,gDAAgD;AAChD,EAAE;AACF,2CAA2C;AAC3C,wEAAwE;AACxE,mBAAmB;AACnB,iBAAiB;;AAEjB;EACE,wDAAwD;AAC1D","file":"_colour.scss","sourcesContent":["@import \"../settings/colours-palette\";\n@import \"../settings/colours-organisations\";\n@import \"../settings/warnings\";\n\n////\n/// @group helpers/colour\n////\n\n/// Get colour\n///\n/// @param {String | Colour} $colour - Name of colour from the colour palette\n/// (`$govuk-colours`)\n/// @param {String | Colour | Boolean} $legacy [false] - Deprecated.\n/// The `$legacy` parameter is deprecated and is non-operational, as the\n/// legacy colour palette has been removed. The parameter will be removed in\n/// the next major version.\n/// @return {Colour} Representation of named colour\n///\n/// @throw if `$colour` is not a colour from the colour palette\n/// @access public\n\n@function govuk-colour($colour, $legacy: false) {\n // Output a warning if $legacy is set to anything.\n @if $legacy and _should-warn(\"legacy-colour-param\") {\n @warn _warning-text(\"legacy-colour-param\", \"The `$legacy` parameter of \" +\n \"`govuk-colour` is deprecated and is non-operational. It will be \" +\n \"removed in the next major version.\");\n }\n\n @if type-of($colour) == \"color\" {\n // stylelint-disable-next-line scss/function-quote-no-quoted-strings-inside\n $colour: quote(\"#{$colour}\");\n }\n\n @if not map-has-key($govuk-colours, $colour) {\n @error \"Unknown colour `#{$colour}`\";\n }\n\n @return map-get($govuk-colours, $colour);\n}\n\n/// Get the colour for a government organisation\n///\n/// @param {String} $organisation - Organisation name, lowercase, hyphenated\n/// @param {Boolean} $websafe - Deprecated. Use $contrast-safe instead.\n/// @param {Boolean} $contrast-safe [true] - By default a version of the colour\n/// will be returned which has a minimum 4.5:1 contrast ratio when used with\n/// white, as per the WCAG 2.1 Level AA guidelines. If you want to use the\n/// non-contrast safe version you can set this to `false` but your should\n/// ensure that you still meets contrast requirements for accessibility -\n/// for example, do not use the non-contrast safe version for text.\n///\n/// @return {Colour} Representation of colour for organisation\n/// @throw if `$organisation` is not a known organisation\n/// @access public\n\n@function govuk-organisation-colour($organisation, $websafe: null, $contrast-safe: true) {\n // Check if the $organisation exists in the aliases map. If so, change the\n // value of $organisation to the aliased value.\n @if map-has-key($_govuk_colours-organisations-aliases, $organisation) {\n $organisation: map-get($_govuk_colours-organisations-aliases, $organisation);\n }\n\n // Check to see if the organisation exists\n @if not map-has-key($govuk-colours-organisations, $organisation) {\n @error \"Unknown organisation `#{$organisation}`\";\n }\n\n // Output a warning if $websafe is set.\n @if $websafe and not index($govuk-suppressed-warnings, \"organisation-colour-websafe-param\") {\n @warn _warning-text(\"organisation-colour-websafe-param\",\n \"The `$websafe` parameter of `govuk-organisation-colour` has been \" +\n \"renamed to `$contrast-safe`. The old parameter name will be removed in \" +\n \"the next major version.\"\n );\n }\n\n $org-colour: map-get($govuk-colours-organisations, $organisation);\n\n @if map-has-key($org-colour, deprecation-message) and not index($govuk-suppressed-warnings, \"organisation-colours\") {\n @warn _warning-text(\n \"organisation-colours\",\n map-get($org-colour, deprecation-message)\n );\n }\n\n // If the $websafe parameter is being used (it has been explicitly set as true\n // or false), assume the user hasn't updated to use $contrast-safe yet and map\n // the old parameter's value onto the new parameter.\n @if type-of($websafe) != \"null\" {\n $contrast-safe: $websafe;\n }\n\n // Determine the contrast-safe key to use depending on whether it's the new\n // palette or the legacy palette\n $safe-key: if($govuk-new-organisation-colours, \"contrast-safe\", \"colour-websafe\");\n\n @if $contrast-safe and map-has-key($org-colour, $safe-key) {\n @return map-get($org-colour, $safe-key);\n } @else {\n @return map-get($org-colour, colour);\n }\n}\n\n/// Make a colour darker by mixing it with black\n///\n/// @param {Colour} $colour - colour to shade\n/// @param {Number} $percentage - percentage of black to mix with $colour\n/// @return {Colour}\n/// @access public\n\n@function govuk-shade($colour, $percentage) {\n @return mix(#000000, $colour, $percentage);\n}\n\n/// Make a colour lighter by mixing it with white\n///\n/// @param {Colour} $colour - colour to tint\n/// @param {Number} $percentage - percentage of white to mix with $colour\n/// @return {Colour}\n/// @access public\n\n@function govuk-tint($colour, $percentage) {\n @return mix(govuk-colour(\"white\"), $colour, $percentage);\n}\n"]}
1
+ {"version":3,"sources":["../../../src/govuk/helpers/_colour.scss"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,2CAA2C;AAC3C,8BAA8B;;AAE9B,GAAG;AACH,wBAAwB;AACxB,GAAG;;AAEH,aAAa;AACb,EAAE;AACF,4EAA4E;AAC5E,uBAAuB;AACvB,mEAAmE;AACnE,yEAAyE;AACzE,6EAA6E;AAC7E,4BAA4B;AAC5B,kDAAkD;AAClD,EAAE;AACF,8DAA8D;AAC9D,iBAAiB;;AAEjB;EACE,iDAAiD;EACjD;IACE;;yCAEqC;EACvC;;EAEA;IACE,0EAA0E;IAC1E,4BAA4B;EAC9B;;EAEA;IACE,oCAAoC;EACtC;;EAEA,wCAAwC;AAC1C;;AAEA,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,sEAAsE;AACtE,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,oEAAoE;AACpE,EAAE;AACF,6DAA6D;AAC7D,wDAAwD;AACxD,iBAAiB;;AAEjB;EACE,yEAAyE;EACzE,8CAA8C;EAC9C;IACE,4EAA4E;EAC9E;;EAEA,yCAAyC;EACzC;IACE,gDAAgD;EAClD;;EAEA,sCAAsC;EACtC;IACE;;;;KAIC;EACH;;EAEA,iEAAiE;;EAEjE;IACE;;;KAGC;EACH;;EAEA,6EAA6E;EAC7E,6EAA6E;EAC7E,mDAAmD;EACnD;IACE,wBAAwB;EAC1B;;EAEA,0EAA0E;EAC1E,+BAA+B;EAC/B,iFAAiF;;EAEjF;IACE,uCAAuC;EACzC,EAAE;IACA,oCAAoC;EACtC;AACF;;AAEA,+CAA+C;AAC/C,EAAE;AACF,4CAA4C;AAC5C,wEAAwE;AACxE,mBAAmB;AACnB,iBAAiB;;AAEjB;EACE,0CAA0C;AAC5C;;AAEA,gDAAgD;AAChD,EAAE;AACF,2CAA2C;AAC3C,wEAAwE;AACxE,mBAAmB;AACnB,iBAAiB;;AAEjB;EACE,wDAAwD;AAC1D","file":"_colour.scss","sourcesContent":["@import \"../settings/colours-palette\";\n@import \"../settings/colours-organisations\";\n@import \"../settings/warnings\";\n\n////\n/// @group helpers/colour\n////\n\n/// Get colour\n///\n/// @param {String | Colour} $colour - Name of colour from the colour palette\n/// (`$govuk-colours`)\n/// @param {String | Colour | Boolean} $legacy [false] - Deprecated.\n/// The `$legacy` parameter is deprecated and is non-operational, as the\n/// legacy colour palette has been removed. The parameter will be removed in\n/// the next major version.\n/// @return {Colour} Representation of named colour\n///\n/// @throw if `$colour` is not a colour from the colour palette\n/// @access public\n\n@function govuk-colour($colour, $legacy: false) {\n // Output a warning if $legacy is set to anything.\n @if $legacy and _should-warn(\"legacy-colour-param\") {\n @warn _warning-text(\"legacy-colour-param\", \"The `$legacy` parameter of \" +\n \"`govuk-colour` is deprecated and is non-operational. It will be \" +\n \"removed in the next major version.\");\n }\n\n @if type-of($colour) == \"color\" {\n // stylelint-disable-next-line scss/function-quote-no-quoted-strings-inside\n $colour: quote(\"#{$colour}\");\n }\n\n @if not map-has-key($govuk-colours, $colour) {\n @error \"Unknown colour `#{$colour}`\";\n }\n\n @return map-get($govuk-colours, $colour);\n}\n\n/// Get the colour for a government organisation\n///\n/// @param {String} $organisation - Organisation name, lowercase, hyphenated\n/// @param {Boolean} $websafe - Deprecated. Use $contrast-safe instead.\n/// @param {Boolean} $contrast-safe [true] - By default a version of the colour\n/// will be returned which has a minimum 4.5:1 contrast ratio when used with\n/// white, as per the WCAG 2.1 Level AA guidelines. If you want to use the\n/// non-contrast safe version you can set this to `false` but your should\n/// ensure that you still meets contrast requirements for accessibility -\n/// for example, do not use the non-contrast safe version for text.\n///\n/// @return {Colour} Representation of colour for organisation\n/// @throw if `$organisation` is not a known organisation\n/// @access public\n\n@function govuk-organisation-colour($organisation, $websafe: null, $contrast-safe: true) {\n // Check if the $organisation exists in the aliases map. If so, change the\n // value of $organisation to the aliased value.\n @if map-has-key($_govuk_colours-organisations-aliases, $organisation) {\n $organisation: map-get($_govuk_colours-organisations-aliases, $organisation);\n }\n\n // Check to see if the organisation exists\n @if not map-has-key($govuk-colours-organisations, $organisation) {\n @error \"Unknown organisation `#{$organisation}`\";\n }\n\n // Output a warning if $websafe is set.\n @if $websafe and _should-warn(\"organisation-colour-websafe-param\") {\n @warn _warning-text(\"organisation-colour-websafe-param\",\n \"The `$websafe` parameter of `govuk-organisation-colour` has been \" +\n \"renamed to `$contrast-safe`. The old parameter name will be removed in \" +\n \"the next major version.\"\n );\n }\n\n $org-colour: map-get($govuk-colours-organisations, $organisation);\n\n @if map-has-key($org-colour, deprecation-message) and _should-warn(\"organisation-colours\") {\n @warn _warning-text(\n \"organisation-colours\",\n map-get($org-colour, deprecation-message)\n );\n }\n\n // If the $websafe parameter is being used (it has been explicitly set as true\n // or false), assume the user hasn't updated to use $contrast-safe yet and map\n // the old parameter's value onto the new parameter.\n @if type-of($websafe) != \"null\" {\n $contrast-safe: $websafe;\n }\n\n // Determine the contrast-safe key to use depending on whether it's the new\n // palette or the legacy palette\n $safe-key: if($govuk-new-organisation-colours, \"contrast-safe\", \"colour-websafe\");\n\n @if $contrast-safe and map-has-key($org-colour, $safe-key) {\n @return map-get($org-colour, $safe-key);\n } @else {\n @return map-get($org-colour, colour);\n }\n}\n\n/// Make a colour darker by mixing it with black\n///\n/// @param {Colour} $colour - colour to shade\n/// @param {Number} $percentage - percentage of black to mix with $colour\n/// @return {Colour}\n/// @access public\n\n@function govuk-shade($colour, $percentage) {\n @return mix(#000000, $colour, $percentage);\n}\n\n/// Make a colour lighter by mixing it with white\n///\n/// @param {Colour} $colour - colour to tint\n/// @param {Number} $percentage - percentage of white to mix with $colour\n/// @return {Colour}\n/// @access public\n\n@function govuk-tint($colour, $percentage) {\n @return mix(govuk-colour(\"white\"), $colour, $percentage);\n}\n"]}
@@ -5,6 +5,7 @@ import { CharacterCount } from './components/character-count/character-count.mjs
5
5
  import { Checkboxes } from './components/checkboxes/checkboxes.mjs';
6
6
  import { ErrorSummary } from './components/error-summary/error-summary.mjs';
7
7
  import { ExitThisPage } from './components/exit-this-page/exit-this-page.mjs';
8
+ import { FileUpload } from './components/file-upload/file-upload.mjs';
8
9
  import { Header } from './components/header/header.mjs';
9
10
  import { NotificationBanner } from './components/notification-banner/notification-banner.mjs';
10
11
  import { PasswordInput } from './components/password-input/password-input.mjs';
@@ -35,7 +36,7 @@ function initAll(config) {
35
36
  }
36
37
  return;
37
38
  }
38
- const components = [[Accordion, config.accordion], [Button, config.button], [CharacterCount, config.characterCount], [Checkboxes], [ErrorSummary, config.errorSummary], [ExitThisPage, config.exitThisPage], [Header], [NotificationBanner, config.notificationBanner], [PasswordInput, config.passwordInput], [Radios], [ServiceNavigation], [SkipLink], [Tabs]];
39
+ const components = [[Accordion, config.accordion], [Button, config.button], [CharacterCount, config.characterCount], [Checkboxes], [ErrorSummary, config.errorSummary], [ExitThisPage, config.exitThisPage], [FileUpload, config.fileUpload], [Header], [NotificationBanner, config.notificationBanner], [PasswordInput, config.passwordInput], [Radios], [ServiceNavigation], [SkipLink], [Tabs]];
39
40
  const options = {
40
41
  scope: (_config$scope = config.scope) != null ? _config$scope : document,
41
42
  onError: config.onError
@@ -116,22 +117,21 @@ function createAll(Component, config, createAllOptions) {
116
117
  * @property {CharacterCountConfig} [characterCount] - Character Count config
117
118
  * @property {ErrorSummaryConfig} [errorSummary] - Error Summary config
118
119
  * @property {ExitThisPageConfig} [exitThisPage] - Exit This Page config
120
+ * @property {FileUploadConfig} [fileUpload] - File Upload config
119
121
  * @property {NotificationBannerConfig} [notificationBanner] - Notification Banner config
120
122
  * @property {PasswordInputConfig} [passwordInput] - Password input config
121
123
  */
122
124
  /**
123
125
  * Config for individual components
124
126
  *
125
- * @typedef {import('./components/accordion/accordion.mjs').AccordionConfig} AccordionConfig
126
- * @typedef {import('./components/accordion/accordion.mjs').AccordionTranslations} AccordionTranslations
127
- * @typedef {import('./components/button/button.mjs').ButtonConfig} ButtonConfig
128
- * @typedef {import('./components/character-count/character-count.mjs').CharacterCountConfig} CharacterCountConfig
129
- * @typedef {import('./components/character-count/character-count.mjs').CharacterCountTranslations} CharacterCountTranslations
130
- * @typedef {import('./components/error-summary/error-summary.mjs').ErrorSummaryConfig} ErrorSummaryConfig
131
- * @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageConfig} ExitThisPageConfig
132
- * @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageTranslations} ExitThisPageTranslations
133
- * @typedef {import('./components/notification-banner/notification-banner.mjs').NotificationBannerConfig} NotificationBannerConfig
134
- * @typedef {import('./components/password-input/password-input.mjs').PasswordInputConfig} PasswordInputConfig
127
+ * @import { AccordionConfig } from './components/accordion/accordion.mjs'
128
+ * @import { ButtonConfig } from './components/button/button.mjs'
129
+ * @import { CharacterCountConfig } from './components/character-count/character-count.mjs'
130
+ * @import { ErrorSummaryConfig } from './components/error-summary/error-summary.mjs'
131
+ * @import { ExitThisPageConfig } from './components/exit-this-page/exit-this-page.mjs'
132
+ * @import { NotificationBannerConfig } from './components/notification-banner/notification-banner.mjs'
133
+ * @import { PasswordInputConfig } from './components/password-input/password-input.mjs'
134
+ * @import { FileUploadConfig } from './components/file-upload/file-upload.mjs'
135
135
  */
136
136
  /**
137
137
  * Component config keys, e.g. `accordion` and `characterCount`
@@ -1 +1 @@
1
- {"version":3,"file":"init.mjs","sources":["../../src/govuk/init.mjs"],"sourcesContent":["import { isSupported } from './common/index.mjs'\nimport { Accordion } from './components/accordion/accordion.mjs'\nimport { Button } from './components/button/button.mjs'\nimport { CharacterCount } from './components/character-count/character-count.mjs'\nimport { Checkboxes } from './components/checkboxes/checkboxes.mjs'\nimport { ErrorSummary } from './components/error-summary/error-summary.mjs'\nimport { ExitThisPage } from './components/exit-this-page/exit-this-page.mjs'\nimport { Header } from './components/header/header.mjs'\nimport { NotificationBanner } from './components/notification-banner/notification-banner.mjs'\nimport { PasswordInput } from './components/password-input/password-input.mjs'\nimport { Radios } from './components/radios/radios.mjs'\nimport { ServiceNavigation } from './components/service-navigation/service-navigation.mjs'\nimport { SkipLink } from './components/skip-link/skip-link.mjs'\nimport { Tabs } from './components/tabs/tabs.mjs'\nimport { SupportError } from './errors/index.mjs'\n\n/**\n * Initialise all components\n *\n * Use the `data-module` attributes to find, instantiate and init all of the\n * components provided as part of GOV.UK Frontend.\n *\n * @param {Config & { scope?: Element, onError?: OnErrorCallback<CompatibleClass> }} [config] - Config for all components (with optional scope)\n */\nfunction initAll(config) {\n config = typeof config !== 'undefined' ? config : {}\n\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n if (config.onError) {\n config.onError(new SupportError(), {\n config\n })\n } else {\n console.log(new SupportError())\n }\n return\n }\n\n const components = /** @type {const} */ ([\n [Accordion, config.accordion],\n [Button, config.button],\n [CharacterCount, config.characterCount],\n [Checkboxes],\n [ErrorSummary, config.errorSummary],\n [ExitThisPage, config.exitThisPage],\n [Header],\n [NotificationBanner, config.notificationBanner],\n [PasswordInput, config.passwordInput],\n [Radios],\n [ServiceNavigation],\n [SkipLink],\n [Tabs]\n ])\n\n // Allow the user to initialise GOV.UK Frontend in only certain sections of the page\n // Defaults to the entire document if nothing is set.\n // const $scope = config.scope ?? document\n\n const options = {\n scope: config.scope ?? document,\n onError: config.onError\n }\n\n components.forEach(([Component, config]) => {\n createAll(Component, config, options)\n })\n}\n\n/**\n * Create all instances of a specific component on the page\n *\n * Uses the `data-module` attribute to find all elements matching the specified\n * component on the page, creating instances of the component object for each\n * of them.\n *\n * Any component errors will be caught and logged to the console.\n *\n * @template {CompatibleClass} ComponentClass\n * @param {ComponentClass} Component - class of the component to create\n * @param {ComponentConfig<ComponentClass>} [config] - Config supplied to component\n * @param {OnErrorCallback<ComponentClass> | Element | Document | CreateAllOptions<ComponentClass> } [createAllOptions] - options for createAll including scope of the document to search within and callback function if error throw by component on init\n * @returns {Array<InstanceType<ComponentClass>>} - array of instantiated components\n */\nfunction createAll(Component, config, createAllOptions) {\n let /** @type {Element | Document} */ $scope = document\n let /** @type {OnErrorCallback<Component> | undefined} */ onError\n\n if (typeof createAllOptions === 'object') {\n createAllOptions = /** @type {CreateAllOptions<Component>} */ (\n // eslint-disable-next-line no-self-assign\n createAllOptions\n )\n\n $scope = createAllOptions.scope ?? $scope\n onError = createAllOptions.onError\n }\n\n if (typeof createAllOptions === 'function') {\n onError = createAllOptions\n }\n\n if (createAllOptions instanceof HTMLElement) {\n $scope = createAllOptions\n }\n\n const $elements = $scope.querySelectorAll(\n `[data-module=\"${Component.moduleName}\"]`\n )\n\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n if (onError) {\n onError(new SupportError(), {\n component: Component,\n config\n })\n } else {\n console.log(new SupportError())\n }\n return []\n }\n\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-return --\n * We can't define CompatibleClass as `{new(): CompatibleClass, moduleName: string}`,\n * as when doing `typeof Accordion` (or any component), TypeScript doesn't seem\n * to acknowledge the static `moduleName` that's set in our component classes.\n * This means we have to set the constructor of `CompatibleClass` as `{new(): any}`,\n * leading to ESLint frowning that we're returning `any[]`.\n */\n return Array.from($elements)\n .map(($element) => {\n try {\n // Only pass config to components that accept it\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return typeof config !== 'undefined'\n ? new Component($element, config)\n : new Component($element)\n } catch (error) {\n if (onError) {\n onError(error, {\n element: $element,\n component: Component,\n config\n })\n } else {\n console.log(error)\n }\n\n return null\n }\n })\n .filter(Boolean) // Exclude components that errored\n}\n\nexport { initAll, createAll }\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef {{new (...args: any[]): any, moduleName: string}} CompatibleClass\n */\n\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * Config for all components via `initAll()`\n *\n * @typedef {object} Config\n * @property {AccordionConfig} [accordion] - Accordion config\n * @property {ButtonConfig} [button] - Button config\n * @property {CharacterCountConfig} [characterCount] - Character Count config\n * @property {ErrorSummaryConfig} [errorSummary] - Error Summary config\n * @property {ExitThisPageConfig} [exitThisPage] - Exit This Page config\n * @property {NotificationBannerConfig} [notificationBanner] - Notification Banner config\n * @property {PasswordInputConfig} [passwordInput] - Password input config\n */\n\n/**\n * Config for individual components\n *\n * @typedef {import('./components/accordion/accordion.mjs').AccordionConfig} AccordionConfig\n * @typedef {import('./components/accordion/accordion.mjs').AccordionTranslations} AccordionTranslations\n * @typedef {import('./components/button/button.mjs').ButtonConfig} ButtonConfig\n * @typedef {import('./components/character-count/character-count.mjs').CharacterCountConfig} CharacterCountConfig\n * @typedef {import('./components/character-count/character-count.mjs').CharacterCountTranslations} CharacterCountTranslations\n * @typedef {import('./components/error-summary/error-summary.mjs').ErrorSummaryConfig} ErrorSummaryConfig\n * @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageConfig} ExitThisPageConfig\n * @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageTranslations} ExitThisPageTranslations\n * @typedef {import('./components/notification-banner/notification-banner.mjs').NotificationBannerConfig} NotificationBannerConfig\n * @typedef {import('./components/password-input/password-input.mjs').PasswordInputConfig} PasswordInputConfig\n */\n\n/**\n * Component config keys, e.g. `accordion` and `characterCount`\n *\n * @typedef {keyof Config} ConfigKey\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {ConstructorParameters<ComponentClass>[1]} ComponentConfig\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} ErrorContext\n * @property {Element} [element] - Element used for component module initialisation\n * @property {ComponentClass} [component] - Class of component\n * @property {ComponentConfig<ComponentClass>} config - Config supplied to component\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @callback OnErrorCallback\n * @param {unknown} error - Thrown error\n * @param {ErrorContext<ComponentClass>} context - Object containing the element, component class and configuration\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} CreateAllOptions\n * @property {Element | Document} [scope] - scope of the document to search within\n * @property {OnErrorCallback<ComponentClass>} [onError] - callback function if error throw by component on init\n */\n"],"names":["initAll","config","_config$scope","isSupported","onError","SupportError","console","log","components","Accordion","accordion","Button","button","CharacterCount","characterCount","Checkboxes","ErrorSummary","errorSummary","ExitThisPage","exitThisPage","Header","NotificationBanner","notificationBanner","PasswordInput","passwordInput","Radios","ServiceNavigation","SkipLink","Tabs","options","scope","document","forEach","Component","createAll","createAllOptions","$scope","_createAllOptions$sco","HTMLElement","$elements","querySelectorAll","moduleName","component","Array","from","map","$element","error","element","filter","Boolean"],"mappings":"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"}
1
+ {"version":3,"file":"init.mjs","sources":["../../src/govuk/init.mjs"],"sourcesContent":["import { isSupported } from './common/index.mjs'\nimport { Accordion } from './components/accordion/accordion.mjs'\nimport { Button } from './components/button/button.mjs'\nimport { CharacterCount } from './components/character-count/character-count.mjs'\nimport { Checkboxes } from './components/checkboxes/checkboxes.mjs'\nimport { ErrorSummary } from './components/error-summary/error-summary.mjs'\nimport { ExitThisPage } from './components/exit-this-page/exit-this-page.mjs'\nimport { FileUpload } from './components/file-upload/file-upload.mjs'\nimport { Header } from './components/header/header.mjs'\nimport { NotificationBanner } from './components/notification-banner/notification-banner.mjs'\nimport { PasswordInput } from './components/password-input/password-input.mjs'\nimport { Radios } from './components/radios/radios.mjs'\nimport { ServiceNavigation } from './components/service-navigation/service-navigation.mjs'\nimport { SkipLink } from './components/skip-link/skip-link.mjs'\nimport { Tabs } from './components/tabs/tabs.mjs'\nimport { SupportError } from './errors/index.mjs'\n\n/**\n * Initialise all components\n *\n * Use the `data-module` attributes to find, instantiate and init all of the\n * components provided as part of GOV.UK Frontend.\n *\n * @param {Config & { scope?: Element, onError?: OnErrorCallback<CompatibleClass> }} [config] - Config for all components (with optional scope)\n */\nfunction initAll(config) {\n config = typeof config !== 'undefined' ? config : {}\n\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n if (config.onError) {\n config.onError(new SupportError(), {\n config\n })\n } else {\n console.log(new SupportError())\n }\n return\n }\n\n const components = /** @type {const} */ ([\n [Accordion, config.accordion],\n [Button, config.button],\n [CharacterCount, config.characterCount],\n [Checkboxes],\n [ErrorSummary, config.errorSummary],\n [ExitThisPage, config.exitThisPage],\n [FileUpload, config.fileUpload],\n [Header],\n [NotificationBanner, config.notificationBanner],\n [PasswordInput, config.passwordInput],\n [Radios],\n [ServiceNavigation],\n [SkipLink],\n [Tabs]\n ])\n\n // Allow the user to initialise GOV.UK Frontend in only certain sections of the page\n // Defaults to the entire document if nothing is set.\n // const $scope = config.scope ?? document\n\n const options = {\n scope: config.scope ?? document,\n onError: config.onError\n }\n\n components.forEach(([Component, config]) => {\n createAll(Component, config, options)\n })\n}\n\n/**\n * Create all instances of a specific component on the page\n *\n * Uses the `data-module` attribute to find all elements matching the specified\n * component on the page, creating instances of the component object for each\n * of them.\n *\n * Any component errors will be caught and logged to the console.\n *\n * @template {CompatibleClass} ComponentClass\n * @param {ComponentClass} Component - class of the component to create\n * @param {ComponentConfig<ComponentClass>} [config] - Config supplied to component\n * @param {OnErrorCallback<ComponentClass> | Element | Document | CreateAllOptions<ComponentClass> } [createAllOptions] - options for createAll including scope of the document to search within and callback function if error throw by component on init\n * @returns {Array<InstanceType<ComponentClass>>} - array of instantiated components\n */\nfunction createAll(Component, config, createAllOptions) {\n let /** @type {Element | Document} */ $scope = document\n let /** @type {OnErrorCallback<Component> | undefined} */ onError\n\n if (typeof createAllOptions === 'object') {\n createAllOptions = /** @type {CreateAllOptions<Component>} */ (\n // eslint-disable-next-line no-self-assign\n createAllOptions\n )\n\n $scope = createAllOptions.scope ?? $scope\n onError = createAllOptions.onError\n }\n\n if (typeof createAllOptions === 'function') {\n onError = createAllOptions\n }\n\n if (createAllOptions instanceof HTMLElement) {\n $scope = createAllOptions\n }\n\n const $elements = $scope.querySelectorAll(\n `[data-module=\"${Component.moduleName}\"]`\n )\n\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n if (onError) {\n onError(new SupportError(), {\n component: Component,\n config\n })\n } else {\n console.log(new SupportError())\n }\n return []\n }\n\n /* eslint-disable-next-line @typescript-eslint/no-unsafe-return --\n * We can't define CompatibleClass as `{new(): CompatibleClass, moduleName: string}`,\n * as when doing `typeof Accordion` (or any component), TypeScript doesn't seem\n * to acknowledge the static `moduleName` that's set in our component classes.\n * This means we have to set the constructor of `CompatibleClass` as `{new(): any}`,\n * leading to ESLint frowning that we're returning `any[]`.\n */\n return Array.from($elements)\n .map(($element) => {\n try {\n // Only pass config to components that accept it\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return typeof config !== 'undefined'\n ? new Component($element, config)\n : new Component($element)\n } catch (error) {\n if (onError) {\n onError(error, {\n element: $element,\n component: Component,\n config\n })\n } else {\n console.log(error)\n }\n\n return null\n }\n })\n .filter(Boolean) // Exclude components that errored\n}\n\nexport { initAll, createAll }\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef {{new (...args: any[]): any, moduleName: string}} CompatibleClass\n */\n\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * Config for all components via `initAll()`\n *\n * @typedef {object} Config\n * @property {AccordionConfig} [accordion] - Accordion config\n * @property {ButtonConfig} [button] - Button config\n * @property {CharacterCountConfig} [characterCount] - Character Count config\n * @property {ErrorSummaryConfig} [errorSummary] - Error Summary config\n * @property {ExitThisPageConfig} [exitThisPage] - Exit This Page config\n * @property {FileUploadConfig} [fileUpload] - File Upload config\n * @property {NotificationBannerConfig} [notificationBanner] - Notification Banner config\n * @property {PasswordInputConfig} [passwordInput] - Password input config\n */\n\n/**\n * Config for individual components\n *\n * @import { AccordionConfig } from './components/accordion/accordion.mjs'\n * @import { ButtonConfig } from './components/button/button.mjs'\n * @import { CharacterCountConfig } from './components/character-count/character-count.mjs'\n * @import { ErrorSummaryConfig } from './components/error-summary/error-summary.mjs'\n * @import { ExitThisPageConfig } from './components/exit-this-page/exit-this-page.mjs'\n * @import { NotificationBannerConfig } from './components/notification-banner/notification-banner.mjs'\n * @import { PasswordInputConfig } from './components/password-input/password-input.mjs'\n * @import { FileUploadConfig } from './components/file-upload/file-upload.mjs'\n */\n\n/**\n * Component config keys, e.g. `accordion` and `characterCount`\n *\n * @typedef {keyof Config} ConfigKey\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {ConstructorParameters<ComponentClass>[1]} ComponentConfig\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} ErrorContext\n * @property {Element} [element] - Element used for component module initialisation\n * @property {ComponentClass} [component] - Class of component\n * @property {ComponentConfig<ComponentClass>} config - Config supplied to component\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @callback OnErrorCallback\n * @param {unknown} error - Thrown error\n * @param {ErrorContext<ComponentClass>} context - Object containing the element, component class and configuration\n */\n\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} CreateAllOptions\n * @property {Element | Document} [scope] - scope of the document to search within\n * @property {OnErrorCallback<ComponentClass>} [onError] - callback function if error throw by component on init\n */\n"],"names":["initAll","config","_config$scope","isSupported","onError","SupportError","console","log","components","Accordion","accordion","Button","button","CharacterCount","characterCount","Checkboxes","ErrorSummary","errorSummary","ExitThisPage","exitThisPage","FileUpload","fileUpload","Header","NotificationBanner","notificationBanner","PasswordInput","passwordInput","Radios","ServiceNavigation","SkipLink","Tabs","options","scope","document","forEach","Component","createAll","createAllOptions","$scope","_createAllOptions$sco","HTMLElement","$elements","querySelectorAll","moduleName","component","Array","from","map","$element","error","element","filter","Boolean"],"mappings":"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"}
@@ -1,3 +1,5 @@
1
+ @import "../settings/warnings";
2
+
1
3
  ////
2
4
  /// @group settings/colours
3
5
  ////
@@ -11,6 +13,7 @@
11
13
  ///
12
14
  /// @type Boolean
13
15
  /// @access public
16
+ /// @deprecated Using new organisation colours will become the default in Frontend v6.0.
14
17
 
15
18
  $govuk-new-organisation-colours: false !default;
16
19
 
@@ -211,6 +214,7 @@ $_govuk-organisation-colours: (
211
214
  /// nor provide better contrast than the base colour.
212
215
  ///
213
216
  /// @access private
217
+ /// @deprecated Migrate to using the new organisation colour palette instead.
214
218
 
215
219
  $_govuk-legacy-organisation-colours: (
216
220
  "attorney-generals-office": (
@@ -349,11 +353,20 @@ $_govuk-legacy-organisation-colours: (
349
353
  /// @type Map
350
354
  /// @access public
351
355
 
352
- $govuk-colours-organisations: if(
353
- $govuk-new-organisation-colours,
354
- $_govuk-organisation-colours,
355
- $_govuk-legacy-organisation-colours
356
- ) !default;
356
+ $govuk-colours-organisations: $_govuk-legacy-organisation-colours !default;
357
+
358
+ @if $govuk-new-organisation-colours and $govuk-colours-organisations == $_govuk-legacy-organisation-colours {
359
+ $govuk-colours-organisations: $_govuk-organisation-colours;
360
+ }
361
+
362
+ // Output a deprecation warning if the legacy colour palette is being used.
363
+ // Remove in next major version.
364
+ @if $govuk-colours-organisations == $_govuk-legacy-organisation-colours {
365
+ @include _warning(
366
+ "legacy-organisation-colours",
367
+ "The legacy organisation colour palette has been deprecated and will be removed in the next major version."
368
+ );
369
+ }
357
370
 
358
371
  /// Organisation colour aliases
359
372
  ///
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/govuk/settings/_colours-organisations.scss"],"names":[],"mappings":"AAAA,GAAG;AACH,0BAA0B;AAC1B,GAAG;;AAEH,yDAAyD;AACzD,EAAE;AACF,kEAAkE;AAClE,0CAA0C;AAC1C,EAAE;AACF,4BAA4B;AAC5B,EAAE;AACF,gBAAgB;AAChB,iBAAiB;;AAEjB,+CAA+C;;AAE/C,+BAA+B;AAC/B,EAAE;AACF,YAAY;AACZ,EAAE;AACF,oEAAoE;AACpE,2EAA2E;AAC3E,uEAAuE;AACvE,6EAA6E;AAC7E,2BAA2B;AAC3B,uEAAuE;AACvE,sEAAsE;AACtE,+DAA+D;AAC/D,EAAE;AACF,kBAAkB;;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuKC;;AAED,8BAA8B;AAC9B,EAAE;AACF,4EAA4E;AAC5E,iDAAiD;AACjD,EAAE;AACF,YAAY;AACZ,EAAE;AACF,oEAAoE;AACpE,yEAAyE;AACzE,2EAA2E;AAC3E,sDAAsD;AACtD,EAAE;AACF,kBAAkB;;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiIC;;AAED,mEAAmE;AACnE,qEAAqE;AACrE,EAAE;AACF,YAAY;AACZ,iBAAiB;;AAEjB;;;;UAIU;;AAEV,8BAA8B;AAC9B,EAAE;AACF,0EAA0E;AAC1E,+CAA+C;AAC/C,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,kEAAkE;AAClE,mCAAmC;AACnC,EAAE;AACF,YAAY;AACZ,EAAE;AACF,kBAAkB;;AAElB;;;;CAIC","file":"_colours-organisations.scss","sourcesContent":["////\n/// @group settings/colours\n////\n\n/// Feature flag for updated organisation list and colours\n///\n/// When set to true, $govuk-colours-organisations will use the new\n/// organisation list and colour selection.\n///\n/// Should be removed in 6.0.\n///\n/// @type Boolean\n/// @access public\n\n$govuk-new-organisation-colours: false !default;\n\n/// Current organisation colours\n///\n/// @type Map\n///\n/// @prop $organisation.colour - Colour for the given `$organisation`\n/// @prop $organisation.contrast-safe - 'Contrast safe' colour for the given\n/// `$organisation`. This colour has at least a 4.5:1 contrast against\n/// white, to be used for copy and meet the AAA (large text) and AA (smaller\n/// copy) WCAG guidelines.\n/// @prop $organisation.deprecation-message - Marks this organisation as\n/// deprecated (usually because it has ceased to exist). Value is the\n/// deprecation message output to the terminal when compiling.\n///\n/// @access private\n\n$_govuk-organisation-colours: (\n \"attorney-generals-office\": (\n colour: #a91c8e\n ),\n \"cabinet-office\": (\n colour: #0056b8\n ),\n \"civil-service\": (\n colour: #b2292e\n ),\n \"department-for-business-trade\": (\n colour: #e52d13,\n contrast-safe: #e02c13\n ),\n \"department-for-business-energy-industrial-strategy\": (\n colour: #003479,\n deprecation-message:\n \"`department-for-business-energy-industrial-strategy` was dissolved in 2023. It was replaced by `department-for-business-trade`, `department-for-energy-security-net-zero` and `department-science-innovation-technology`.\"\n ),\n \"department-for-business-innovation-skills\": (\n colour: #003479,\n deprecation-message:\n \"`department-for-business-innovation-skills` became `department-for-business-energy-industrial-strategy` in 2016. As of 2023, it is equivalent to `department-for-business-trade` or `department-science-innovation-technology`.\"\n ),\n \"department-for-communities-local-government\": (\n colour: #009999,\n contrast-safe: #008080,\n deprecation-message:\n \"`department-for-communities-local-government` became `ministry-of-housing-communities-local-government` in 2018.\"\n ),\n \"department-for-culture-media-sport\": (\n colour: #ed1588,\n contrast-safe: #d6177a\n ),\n \"department-for-digital-culture-media-sport\": (\n colour: #d40072,\n deprecation-message:\n \"`department-for-digital-culture-media-sport` became `department-for-culture-media-sport` in 2023.\"\n ),\n \"department-for-education\": (\n colour: #003764\n ),\n \"department-for-energy-security-net-zero\": (\n colour: #00a33b,\n contrast-safe: #00852f\n ),\n \"department-for-environment-food-rural-affairs\": (\n colour: #00a33b,\n contrast-safe: #008531\n ),\n \"department-for-exiting-the-european-union\": (\n colour: #009fe3,\n contrast-safe: #007db6,\n deprecation-message: \"`department-for-exiting-the-european-union` was dissolved in 2020.\"\n ),\n \"department-for-international-development\": (\n colour: #002878,\n deprecation-message:\n \"`department-for-international-development` was merged into `foreign-commonwealth-development-office` in 2020.\"\n ),\n \"department-for-international-trade\": (\n colour: #cf102d,\n deprecation-message: \"`department-for-international-trade` was merged into `department-for-business-trade` in 2023.\"\n ),\n \"department-for-levelling-up-housing-communities\": (\n colour: #012169,\n deprecation-message:\n \"`department-for-levelling-up-housing-communities` was renamed to `ministry-of-housing-communities-local-government` in 2024.\"\n ),\n \"department-for-science-innovation-technology\": (\n colour: #00f8f8,\n contrast-safe: #008180\n ),\n \"department-for-transport\": (\n colour: #006853\n ),\n \"department-for-work-pensions\": (\n colour: #00bcb5,\n contrast-safe: #00857e\n ),\n \"department-of-energy-climate-change\": (\n colour: #009ddb,\n contrast-safe: #007db3,\n deprecation-message:\n \"`department-of-energy-climate-change` was merged into `department-for-business-energy-industrial-strategy` in 2016. As of 2023, it is equivalent to `department-for-energy-security-net-zero`.\"\n ),\n \"department-of-health\": (\n colour: #00ad93,\n contrast-safe: #008573,\n deprecation-message: \"`department-of-health` became `department-of-health-social-care` in 2018.\"\n ),\n \"department-of-health-social-care\": (\n colour: #00a990,\n contrast-safe: #008674\n ),\n \"foreign-commonwealth-office\": (\n colour: #003e74,\n deprecation-message: \"`foreign-commonwealth-office` became `foreign-commonwealth-development-office` in 2018.\"\n ),\n \"foreign-commonwealth-development-office\": (\n colour: #012069\n ),\n \"government-equalities-office\": (\n colour: #0056b8,\n deprecation-message: \"`government-equalities-office` is deprecated. Use `cabinet-office` instead.\"\n ),\n \"hm-government\": (\n colour: #266ebc\n ),\n \"hm-revenue-customs\": (\n colour: #008476\n ),\n \"hm-treasury\": (\n colour: #b2292e\n ),\n \"home-office\": (\n colour: #732282\n ),\n \"ministry-of-defence\": (\n colour: #532a45\n ),\n \"ministry-of-housing-communities-local-government\": (\n colour: #00625e\n ),\n \"ministry-of-justice\": (\n colour: #000000\n ),\n \"northern-ireland-office\": (\n colour: #00205c\n ),\n \"office-of-the-advocate-general-for-scotland\": (\n colour: #00205c\n ),\n \"office-of-the-leader-of-the-house-of-commons\": (\n colour: #497629\n ),\n \"office-of-the-leader-of-the-house-of-lords\": (\n colour: #9c182f\n ),\n \"office-of-the-secretary-of-state-for-scotland\": (\n colour: #00205c,\n deprecation-message: \"`office-of-the-secretary-of-state-for-scotland` was renamed to `scotland-office` in 2024.\"\n ),\n \"office-of-the-secretary-of-state-for-wales\": (\n colour: #a8353a,\n deprecation-message: \"`office-of-the-secretary-of-state-for-wales` was renamed to `wales-office` in 2024.\"\n ),\n \"prime-ministers-office-10-downing-street\": (\n colour: #0b0c0c\n ),\n \"scotland-office\": (\n colour: #00205c\n ),\n \"serious-fraud-office\": (\n colour: #82368c\n ),\n \"uk-export-finance\": (\n colour: #cf102d\n ),\n \"uk-trade-investment\": (\n colour: #c80651,\n deprecation-message:\n \"`uk-trade-investment` became `department-for-international-trade` in 2016. As of 2023, it is equivalent to `department-for-business-trade`.\"\n ),\n \"wales-office\": (\n colour: #a33038\n )\n);\n\n/// Legacy organisation colours\n///\n/// These are the colours included with Frontend prior to 5.3.0. They will be\n/// removed in a future major version of Frontend.\n///\n/// @type Map\n///\n/// @prop $organisation.colour - Colour for the given `$organisation`\n/// @prop $organisation.colour-websafe - Optional alternative shade of the\n/// organisation colour. Despite the name, is not guaranteed to be websafe\n/// nor provide better contrast than the base colour.\n///\n/// @access private\n\n$_govuk-legacy-organisation-colours: (\n \"attorney-generals-office\": (\n colour: #9f1888,\n colour-websafe: #a03a88\n ),\n \"cabinet-office\": (\n colour: #005abb,\n colour-websafe: #347da4\n ),\n \"civil-service\": (\n colour: #af292e\n ),\n \"department-for-business-innovation-skills\": (\n colour: #003479,\n colour-websafe: #347da4\n ),\n \"department-for-communities-local-government\": (\n colour: #009999,\n colour-websafe: #37836e\n ),\n \"department-for-culture-media-sport\": (\n colour: #d40072,\n colour-websafe: #a03155\n ),\n \"department-for-education\": (\n colour: #003a69,\n colour-websafe: #347ca9\n ),\n \"department-for-environment-food-rural-affairs\": (\n colour: #00a33b,\n colour-websafe: #008938\n ),\n \"department-for-international-development\": (\n colour: #002878,\n colour-websafe: #405e9a\n ),\n \"department-for-international-trade\": (\n colour: #cf102d,\n colour-websafe: #005ea5\n ),\n \"department-for-business-trade\": (\n colour: #cf102d,\n colour-websafe: #005ea5\n ),\n \"department-for-levelling-up-housing-communities\": (\n colour: #012169\n ),\n \"department-for-transport\": (\n colour: #006c56,\n colour-websafe: #398373\n ),\n \"department-for-work-pensions\": (\n colour: #00beb7,\n colour-websafe: #37807b\n ),\n \"department-of-energy-climate-change\": (\n colour: #009ddb,\n colour-websafe: #2b7cac\n ),\n \"department-of-health\": (\n colour: #00ad93,\n colour-websafe: #39836e\n ),\n \"foreign-commonwealth-development-office\": (\n colour: #012169\n ),\n \"foreign-commonwealth-office\": (\n colour: #003e74,\n colour-websafe: #406e97\n ),\n \"government-equalities-office\": (\n colour: #9325b2\n ),\n \"hm-government\": (\n colour: #0076c0,\n colour-websafe: #347da4\n ),\n \"hm-revenue-customs\": (\n colour: #009390,\n colour-websafe: #008670\n ),\n \"hm-treasury\": (\n colour: #af292e,\n colour-websafe: #832322\n ),\n \"home-office\": (\n colour: #9325b2,\n colour-websafe: #9440b2\n ),\n \"ministry-of-defence\": (\n colour: #4d2942,\n colour-websafe: #5a5c92\n ),\n \"ministry-of-justice\": (\n colour: #231f20,\n colour-websafe: #5a5c92\n ),\n \"northern-ireland-office\": (\n colour: #002663,\n colour-websafe: #3e598c\n ),\n \"office-of-the-advocate-general-for-scotland\": (\n colour: #002663,\n colour-websafe: #005ea5\n ),\n \"office-of-the-leader-of-the-house-of-commons\": (\n colour: #317023,\n colour-websafe: #005f8f\n ),\n \"office-of-the-leader-of-the-house-of-lords\": (\n colour: #9c132e,\n colour-websafe: #c2395d\n ),\n \"scotland-office\": (\n colour: #002663,\n colour-websafe: #405c8a\n ),\n \"uk-export-finance\": (\n colour: #005747,\n colour-websafe: #005ea5\n ),\n \"uk-trade-investment\": (\n colour: #c80651,\n colour-websafe: #005ea5\n ),\n \"wales-office\": (\n colour: #a33038,\n colour-websafe: #7a242a\n )\n);\n\n/// Set public organisation colours variable to one of the two maps.\n/// Users can also pass their own map to this to override it entirely.\n///\n/// @type Map\n/// @access public\n\n$govuk-colours-organisations: if(\n $govuk-new-organisation-colours,\n $_govuk-organisation-colours,\n $_govuk-legacy-organisation-colours\n) !default;\n\n/// Organisation colour aliases\n///\n/// Some organisations have been renamed within our code over time. Here we\n/// map the prior key to the new equivalent key.\n///\n/// Note: This is for internal renames only. If a department has changed name\n/// or brand colour in a machinery of government change, it should be added to\n/// $govuk-colours-organisations as a new entry with any superseded\n/// organisations marked deprecated.\n///\n/// @type Map\n///\n/// @access private\n\n$_govuk-colours-organisations-aliases: (\n \"department-for-business-and-trade\": \"department-for-business-trade\",\n \"department-for-communities-and-local-government\": \"department-for-communities-local-government\",\n \"department-for-levelling-up-housing-and-communities\": \"department-for-levelling-up-housing-communities\"\n);\n"]}
1
+ {"version":3,"sources":["../../../src/govuk/settings/_colours-organisations.scss"],"names":[],"mappings":"AAAA,8BAA8B;;AAE9B,GAAG;AACH,0BAA0B;AAC1B,GAAG;;AAEH,yDAAyD;AACzD,EAAE;AACF,kEAAkE;AAClE,0CAA0C;AAC1C,EAAE;AACF,4BAA4B;AAC5B,EAAE;AACF,gBAAgB;AAChB,iBAAiB;AACjB,uFAAuF;;AAEvF,+CAA+C;;AAE/C,+BAA+B;AAC/B,EAAE;AACF,YAAY;AACZ,EAAE;AACF,oEAAoE;AACpE,2EAA2E;AAC3E,uEAAuE;AACvE,6EAA6E;AAC7E,2BAA2B;AAC3B,uEAAuE;AACvE,sEAAsE;AACtE,+DAA+D;AAC/D,EAAE;AACF,kBAAkB;;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuKC;;AAED,8BAA8B;AAC9B,EAAE;AACF,4EAA4E;AAC5E,iDAAiD;AACjD,EAAE;AACF,YAAY;AACZ,EAAE;AACF,oEAAoE;AACpE,yEAAyE;AACzE,2EAA2E;AAC3E,sDAAsD;AACtD,EAAE;AACF,kBAAkB;AAClB,4EAA4E;;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiIC;;AAED,mEAAmE;AACnE,qEAAqE;AACrE,EAAE;AACF,YAAY;AACZ,iBAAiB;;AAEjB,0EAA0E;;AAE1E;EACE,0DAA0D;AAC5D;;AAEA,0EAA0E;AAC1E,+BAA+B;AAC/B;EACE;;;GAGC;AACH;;AAEA,8BAA8B;AAC9B,EAAE;AACF,0EAA0E;AAC1E,+CAA+C;AAC/C,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,kEAAkE;AAClE,mCAAmC;AACnC,EAAE;AACF,YAAY;AACZ,EAAE;AACF,kBAAkB;;AAElB;;;;CAIC","file":"_colours-organisations.scss","sourcesContent":["@import \"../settings/warnings\";\n\n////\n/// @group settings/colours\n////\n\n/// Feature flag for updated organisation list and colours\n///\n/// When set to true, $govuk-colours-organisations will use the new\n/// organisation list and colour selection.\n///\n/// Should be removed in 6.0.\n///\n/// @type Boolean\n/// @access public\n/// @deprecated Using new organisation colours will become the default in Frontend v6.0.\n\n$govuk-new-organisation-colours: false !default;\n\n/// Current organisation colours\n///\n/// @type Map\n///\n/// @prop $organisation.colour - Colour for the given `$organisation`\n/// @prop $organisation.contrast-safe - 'Contrast safe' colour for the given\n/// `$organisation`. This colour has at least a 4.5:1 contrast against\n/// white, to be used for copy and meet the AAA (large text) and AA (smaller\n/// copy) WCAG guidelines.\n/// @prop $organisation.deprecation-message - Marks this organisation as\n/// deprecated (usually because it has ceased to exist). Value is the\n/// deprecation message output to the terminal when compiling.\n///\n/// @access private\n\n$_govuk-organisation-colours: (\n \"attorney-generals-office\": (\n colour: #a91c8e\n ),\n \"cabinet-office\": (\n colour: #0056b8\n ),\n \"civil-service\": (\n colour: #b2292e\n ),\n \"department-for-business-trade\": (\n colour: #e52d13,\n contrast-safe: #e02c13\n ),\n \"department-for-business-energy-industrial-strategy\": (\n colour: #003479,\n deprecation-message:\n \"`department-for-business-energy-industrial-strategy` was dissolved in 2023. It was replaced by `department-for-business-trade`, `department-for-energy-security-net-zero` and `department-science-innovation-technology`.\"\n ),\n \"department-for-business-innovation-skills\": (\n colour: #003479,\n deprecation-message:\n \"`department-for-business-innovation-skills` became `department-for-business-energy-industrial-strategy` in 2016. As of 2023, it is equivalent to `department-for-business-trade` or `department-science-innovation-technology`.\"\n ),\n \"department-for-communities-local-government\": (\n colour: #009999,\n contrast-safe: #008080,\n deprecation-message:\n \"`department-for-communities-local-government` became `ministry-of-housing-communities-local-government` in 2018.\"\n ),\n \"department-for-culture-media-sport\": (\n colour: #ed1588,\n contrast-safe: #d6177a\n ),\n \"department-for-digital-culture-media-sport\": (\n colour: #d40072,\n deprecation-message:\n \"`department-for-digital-culture-media-sport` became `department-for-culture-media-sport` in 2023.\"\n ),\n \"department-for-education\": (\n colour: #003764\n ),\n \"department-for-energy-security-net-zero\": (\n colour: #00a33b,\n contrast-safe: #00852f\n ),\n \"department-for-environment-food-rural-affairs\": (\n colour: #00a33b,\n contrast-safe: #008531\n ),\n \"department-for-exiting-the-european-union\": (\n colour: #009fe3,\n contrast-safe: #007db6,\n deprecation-message: \"`department-for-exiting-the-european-union` was dissolved in 2020.\"\n ),\n \"department-for-international-development\": (\n colour: #002878,\n deprecation-message:\n \"`department-for-international-development` was merged into `foreign-commonwealth-development-office` in 2020.\"\n ),\n \"department-for-international-trade\": (\n colour: #cf102d,\n deprecation-message: \"`department-for-international-trade` was merged into `department-for-business-trade` in 2023.\"\n ),\n \"department-for-levelling-up-housing-communities\": (\n colour: #012169,\n deprecation-message:\n \"`department-for-levelling-up-housing-communities` was renamed to `ministry-of-housing-communities-local-government` in 2024.\"\n ),\n \"department-for-science-innovation-technology\": (\n colour: #00f8f8,\n contrast-safe: #008180\n ),\n \"department-for-transport\": (\n colour: #006853\n ),\n \"department-for-work-pensions\": (\n colour: #00bcb5,\n contrast-safe: #00857e\n ),\n \"department-of-energy-climate-change\": (\n colour: #009ddb,\n contrast-safe: #007db3,\n deprecation-message:\n \"`department-of-energy-climate-change` was merged into `department-for-business-energy-industrial-strategy` in 2016. As of 2023, it is equivalent to `department-for-energy-security-net-zero`.\"\n ),\n \"department-of-health\": (\n colour: #00ad93,\n contrast-safe: #008573,\n deprecation-message: \"`department-of-health` became `department-of-health-social-care` in 2018.\"\n ),\n \"department-of-health-social-care\": (\n colour: #00a990,\n contrast-safe: #008674\n ),\n \"foreign-commonwealth-office\": (\n colour: #003e74,\n deprecation-message: \"`foreign-commonwealth-office` became `foreign-commonwealth-development-office` in 2018.\"\n ),\n \"foreign-commonwealth-development-office\": (\n colour: #012069\n ),\n \"government-equalities-office\": (\n colour: #0056b8,\n deprecation-message: \"`government-equalities-office` is deprecated. Use `cabinet-office` instead.\"\n ),\n \"hm-government\": (\n colour: #266ebc\n ),\n \"hm-revenue-customs\": (\n colour: #008476\n ),\n \"hm-treasury\": (\n colour: #b2292e\n ),\n \"home-office\": (\n colour: #732282\n ),\n \"ministry-of-defence\": (\n colour: #532a45\n ),\n \"ministry-of-housing-communities-local-government\": (\n colour: #00625e\n ),\n \"ministry-of-justice\": (\n colour: #000000\n ),\n \"northern-ireland-office\": (\n colour: #00205c\n ),\n \"office-of-the-advocate-general-for-scotland\": (\n colour: #00205c\n ),\n \"office-of-the-leader-of-the-house-of-commons\": (\n colour: #497629\n ),\n \"office-of-the-leader-of-the-house-of-lords\": (\n colour: #9c182f\n ),\n \"office-of-the-secretary-of-state-for-scotland\": (\n colour: #00205c,\n deprecation-message: \"`office-of-the-secretary-of-state-for-scotland` was renamed to `scotland-office` in 2024.\"\n ),\n \"office-of-the-secretary-of-state-for-wales\": (\n colour: #a8353a,\n deprecation-message: \"`office-of-the-secretary-of-state-for-wales` was renamed to `wales-office` in 2024.\"\n ),\n \"prime-ministers-office-10-downing-street\": (\n colour: #0b0c0c\n ),\n \"scotland-office\": (\n colour: #00205c\n ),\n \"serious-fraud-office\": (\n colour: #82368c\n ),\n \"uk-export-finance\": (\n colour: #cf102d\n ),\n \"uk-trade-investment\": (\n colour: #c80651,\n deprecation-message:\n \"`uk-trade-investment` became `department-for-international-trade` in 2016. As of 2023, it is equivalent to `department-for-business-trade`.\"\n ),\n \"wales-office\": (\n colour: #a33038\n )\n);\n\n/// Legacy organisation colours\n///\n/// These are the colours included with Frontend prior to 5.3.0. They will be\n/// removed in a future major version of Frontend.\n///\n/// @type Map\n///\n/// @prop $organisation.colour - Colour for the given `$organisation`\n/// @prop $organisation.colour-websafe - Optional alternative shade of the\n/// organisation colour. Despite the name, is not guaranteed to be websafe\n/// nor provide better contrast than the base colour.\n///\n/// @access private\n/// @deprecated Migrate to using the new organisation colour palette instead.\n\n$_govuk-legacy-organisation-colours: (\n \"attorney-generals-office\": (\n colour: #9f1888,\n colour-websafe: #a03a88\n ),\n \"cabinet-office\": (\n colour: #005abb,\n colour-websafe: #347da4\n ),\n \"civil-service\": (\n colour: #af292e\n ),\n \"department-for-business-innovation-skills\": (\n colour: #003479,\n colour-websafe: #347da4\n ),\n \"department-for-communities-local-government\": (\n colour: #009999,\n colour-websafe: #37836e\n ),\n \"department-for-culture-media-sport\": (\n colour: #d40072,\n colour-websafe: #a03155\n ),\n \"department-for-education\": (\n colour: #003a69,\n colour-websafe: #347ca9\n ),\n \"department-for-environment-food-rural-affairs\": (\n colour: #00a33b,\n colour-websafe: #008938\n ),\n \"department-for-international-development\": (\n colour: #002878,\n colour-websafe: #405e9a\n ),\n \"department-for-international-trade\": (\n colour: #cf102d,\n colour-websafe: #005ea5\n ),\n \"department-for-business-trade\": (\n colour: #cf102d,\n colour-websafe: #005ea5\n ),\n \"department-for-levelling-up-housing-communities\": (\n colour: #012169\n ),\n \"department-for-transport\": (\n colour: #006c56,\n colour-websafe: #398373\n ),\n \"department-for-work-pensions\": (\n colour: #00beb7,\n colour-websafe: #37807b\n ),\n \"department-of-energy-climate-change\": (\n colour: #009ddb,\n colour-websafe: #2b7cac\n ),\n \"department-of-health\": (\n colour: #00ad93,\n colour-websafe: #39836e\n ),\n \"foreign-commonwealth-development-office\": (\n colour: #012169\n ),\n \"foreign-commonwealth-office\": (\n colour: #003e74,\n colour-websafe: #406e97\n ),\n \"government-equalities-office\": (\n colour: #9325b2\n ),\n \"hm-government\": (\n colour: #0076c0,\n colour-websafe: #347da4\n ),\n \"hm-revenue-customs\": (\n colour: #009390,\n colour-websafe: #008670\n ),\n \"hm-treasury\": (\n colour: #af292e,\n colour-websafe: #832322\n ),\n \"home-office\": (\n colour: #9325b2,\n colour-websafe: #9440b2\n ),\n \"ministry-of-defence\": (\n colour: #4d2942,\n colour-websafe: #5a5c92\n ),\n \"ministry-of-justice\": (\n colour: #231f20,\n colour-websafe: #5a5c92\n ),\n \"northern-ireland-office\": (\n colour: #002663,\n colour-websafe: #3e598c\n ),\n \"office-of-the-advocate-general-for-scotland\": (\n colour: #002663,\n colour-websafe: #005ea5\n ),\n \"office-of-the-leader-of-the-house-of-commons\": (\n colour: #317023,\n colour-websafe: #005f8f\n ),\n \"office-of-the-leader-of-the-house-of-lords\": (\n colour: #9c132e,\n colour-websafe: #c2395d\n ),\n \"scotland-office\": (\n colour: #002663,\n colour-websafe: #405c8a\n ),\n \"uk-export-finance\": (\n colour: #005747,\n colour-websafe: #005ea5\n ),\n \"uk-trade-investment\": (\n colour: #c80651,\n colour-websafe: #005ea5\n ),\n \"wales-office\": (\n colour: #a33038,\n colour-websafe: #7a242a\n )\n);\n\n/// Set public organisation colours variable to one of the two maps.\n/// Users can also pass their own map to this to override it entirely.\n///\n/// @type Map\n/// @access public\n\n$govuk-colours-organisations: $_govuk-legacy-organisation-colours !default;\n\n@if $govuk-new-organisation-colours and $govuk-colours-organisations == $_govuk-legacy-organisation-colours {\n $govuk-colours-organisations: $_govuk-organisation-colours;\n}\n\n// Output a deprecation warning if the legacy colour palette is being used.\n// Remove in next major version.\n@if $govuk-colours-organisations == $_govuk-legacy-organisation-colours {\n @include _warning(\n \"legacy-organisation-colours\",\n \"The legacy organisation colour palette has been deprecated and will be removed in the next major version.\"\n );\n}\n\n/// Organisation colour aliases\n///\n/// Some organisations have been renamed within our code over time. Here we\n/// map the prior key to the new equivalent key.\n///\n/// Note: This is for internal renames only. If a department has changed name\n/// or brand colour in a machinery of government change, it should be added to\n/// $govuk-colours-organisations as a new entry with any superseded\n/// organisations marked deprecated.\n///\n/// @type Map\n///\n/// @access private\n\n$_govuk-colours-organisations-aliases: (\n \"department-for-business-and-trade\": \"department-for-business-trade\",\n \"department-for-communities-and-local-government\": \"department-for-communities-local-government\",\n \"department-for-levelling-up-housing-and-communities\": \"department-for-levelling-up-housing-communities\"\n);\n"]}
@@ -8,6 +8,6 @@ $govuk-assets-path: if(
8
8
 
9
9
  $govuk-global-styles: true !default;
10
10
 
11
- @import "../govuk/all";
11
+ @import "../govuk/index";
12
12
 
13
13
  /*# sourceMappingURL=init.scss.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/govuk-prototype-kit/init.scss"],"names":[],"mappings":"AAAA,8CAA8C;;AAE9C;;;;UAIU;;AAEV,mCAAmC;;AAEnC,sBAAsB","file":"init.scss","sourcesContent":["$govuk-prototype-kit-major-version: 0 !default;\n\n$govuk-assets-path: if(\n $govuk-prototype-kit-major-version > 12,\n $govuk-extensions-url-context + \"/govuk-frontend/dist/govuk/assets/\",\n \"/govuk/assets/\"\n) !default;\n\n$govuk-global-styles: true !default;\n\n@import \"../govuk/all\";\n"]}
1
+ {"version":3,"sources":["../../src/govuk-prototype-kit/init.scss"],"names":[],"mappings":"AAAA,8CAA8C;;AAE9C;;;;UAIU;;AAEV,mCAAmC;;AAEnC,wBAAwB","file":"init.scss","sourcesContent":["$govuk-prototype-kit-major-version: 0 !default;\n\n$govuk-assets-path: if(\n $govuk-prototype-kit-major-version > 12,\n $govuk-extensions-url-context + \"/govuk-frontend/dist/govuk/assets/\",\n \"/govuk/assets/\"\n) !default;\n\n$govuk-global-styles: true !default;\n\n@import \"../govuk/index\";\n"]}
@@ -3,7 +3,7 @@
3
3
  "description": "GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.",
4
4
  "urls": {
5
5
  "documentation": "https://design-system.service.gov.uk/",
6
- "releaseNotes": "https://github.com/alphagov/govuk-frontend/releases/tag/v5.8.0",
6
+ "releaseNotes": "https://github.com/alphagov/govuk-frontend/releases/tag/v5.9.0",
7
7
  "versionHistory": "https://github.com/alphagov/govuk-frontend/releases"
8
8
  }
9
9
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "govuk-frontend",
3
3
  "description": "GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.",
4
- "version": "5.8.0",
4
+ "version": "5.9.0",
5
5
  "main": "dist/govuk/all.bundle.js",
6
6
  "module": "dist/govuk/all.mjs",
7
7
  "sass": "dist/govuk/index.scss",
@@ -62,8 +62,8 @@
62
62
  "version": "echo $npm_package_version"
63
63
  },
64
64
  "devDependencies": {
65
- "@babel/core": "^7.26.0",
66
- "@babel/preset-env": "^7.26.0",
65
+ "@babel/core": "^7.26.9",
66
+ "@babel/preset-env": "^7.26.9",
67
67
  "@govuk-frontend/config": "*",
68
68
  "@govuk-frontend/helpers": "*",
69
69
  "@govuk-frontend/lib": "*",
@@ -77,15 +77,15 @@
77
77
  "govuk-prototype-kit": "^13.16.2",
78
78
  "gulp": "^5.0.0",
79
79
  "gulp-cli": "^3.0.0",
80
- "html-validate": "8.27.0",
80
+ "html-validate": "9.4.1",
81
81
  "nunjucks": "^3.2.4",
82
82
  "outdent": "^0.8.0",
83
- "postcss": "^8.4.49",
83
+ "postcss": "^8.5.3",
84
84
  "postcss-scss": "^4.0.9",
85
- "puppeteer": "^23.6.0",
85
+ "puppeteer": "^24.3.0",
86
86
  "rollup": "^4.19.1",
87
87
  "sass-color-helpers": "^2.1.1",
88
- "sass-embedded": "^1.81.0",
88
+ "sass-embedded": "^1.85.1",
89
89
  "sassdoc": "^2.7.4",
90
90
  "slash": "^5.1.0"
91
91
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 55.0.1
4
+ version: 55.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-14 00:00:00.000000000 Z
10
+ date: 2025-03-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: govuk_app_config
@@ -480,6 +480,7 @@ files:
480
480
  - app/assets/javascripts/govuk_publishing_components/components/cross-service-header.js
481
481
  - app/assets/javascripts/govuk_publishing_components/components/error-summary.js
482
482
  - app/assets/javascripts/govuk_publishing_components/components/feedback.js
483
+ - app/assets/javascripts/govuk_publishing_components/components/file-upload.js
483
484
  - app/assets/javascripts/govuk_publishing_components/components/global-banner.js
484
485
  - app/assets/javascripts/govuk_publishing_components/components/govspeak.js
485
486
  - app/assets/javascripts/govuk_publishing_components/components/image-card.js
@@ -1109,6 +1110,8 @@ files:
1109
1110
  - node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs.map
1110
1111
  - node_modules/govuk-frontend/dist/govuk/common/index.mjs
1111
1112
  - node_modules/govuk-frontend/dist/govuk/common/index.mjs.map
1113
+ - node_modules/govuk-frontend/dist/govuk/component.mjs
1114
+ - node_modules/govuk-frontend/dist/govuk/component.mjs.map
1112
1115
  - node_modules/govuk-frontend/dist/govuk/components/_all.scss
1113
1116
  - node_modules/govuk-frontend/dist/govuk/components/_all.scss.map
1114
1117
  - node_modules/govuk-frontend/dist/govuk/components/_index.scss
@@ -1388,15 +1391,28 @@ files:
1388
1391
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss.map
1389
1392
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss
1390
1393
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map
1394
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js
1395
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map
1396
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs
1397
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map
1398
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs
1399
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map
1391
1400
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json
1392
1401
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json
1393
1402
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/macro.njk
1403
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-direct-media-capture.html
1404
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-image-files-only.html
1405
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-multiple-files.html
1394
1406
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-default.html
1407
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-disabled.html
1408
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-disabled.html
1409
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-with-error-message-and-hint.html
1410
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html
1411
+ - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html
1395
1412
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-error-message-and-hint.html
1396
1413
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-hint-text.html
1397
1414
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-label-as-page-heading.html
1398
1415
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-optional-form-group-classes.html
1399
- - node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-value.html
1400
1416
  - node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk
1401
1417
  - node_modules/govuk-frontend/dist/govuk/components/footer/README.md
1402
1418
  - node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss
@@ -1668,6 +1684,7 @@ files:
1668
1684
  - node_modules/govuk-frontend/dist/govuk/components/select/macro-options.json
1669
1685
  - node_modules/govuk-frontend/dist/govuk/components/select/macro.njk
1670
1686
  - node_modules/govuk-frontend/dist/govuk/components/select/template-default.html
1687
+ - node_modules/govuk-frontend/dist/govuk/components/select/template-id.html
1671
1688
  - node_modules/govuk-frontend/dist/govuk/components/select/template-with-full-width-override.html
1672
1689
  - node_modules/govuk-frontend/dist/govuk/components/select/template-with-hint-text-and-error-message.html
1673
1690
  - node_modules/govuk-frontend/dist/govuk/components/select/template-with-label-as-page-heading.html
@@ -1725,6 +1742,7 @@ files:
1725
1742
  - node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json
1726
1743
  - node_modules/govuk-frontend/dist/govuk/components/summary-list/macro-options.json
1727
1744
  - node_modules/govuk-frontend/dist/govuk/components/summary-list/macro.njk
1745
+ - node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-extreme.html
1728
1746
  - node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-custom-header-level.html
1729
1747
  - node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-html-header.html
1730
1748
  - node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-text-header.html
@@ -1854,8 +1872,6 @@ files:
1854
1872
  - node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map
1855
1873
  - node_modules/govuk-frontend/dist/govuk/errors/index.mjs
1856
1874
  - node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map
1857
- - node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs
1858
- - node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs.map
1859
1875
  - node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css
1860
1876
  - node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map
1861
1877
  - node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js
@@ -1,6 +0,0 @@
1
- <div class="govuk-form-group">
2
- <label class="govuk-label" for="file-upload-4">
3
- Upload a photo
4
- </label>
5
- <input class="govuk-file-upload" id="file-upload-4" name="file-upload-4" type="file" value="C:&#92;fakepath&#92;myphoto.jpg">
6
- </div>
@@ -1 +0,0 @@
1
- {"version":3,"file":"govuk-frontend-component.mjs","sources":["../../src/govuk/govuk-frontend-component.mjs"],"sourcesContent":["import { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class GOVUKFrontendComponent {\n /**\n * @type {typeof Element}\n */\n static elementType = HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof GOVUKFrontendComponent & ChildClass} ChildClassConstructor\n */\n"],"names":["GOVUKFrontendComponent","$root","_$root","constructor","childConstructor","moduleName","InitError","elementType","ElementError","element","component","identifier","expectedType","name","checkSupport","checkInitialised","setAttribute","isInitialised","isSupported","SupportError","HTMLElement"],"mappings":";;;AAWO,MAAMA,sBAAsB,CAAC;AASlC;AACF;AACA;AACA;AACA;AACA;EACE,IAAIC,KAAKA,GAAG;IACV,OAAO,IAAI,CAACC,MAAM,CAAA;AACpB,GAAA;EAcAC,WAAWA,CAACF,KAAK,EAAE;AAAA,IAAA,IAAA,CARnBC,MAAM,GAAA,KAAA,CAAA,CAAA;AASJ,IAAA,MAAME,gBAAgB,GACpB,IAAI,CAACD,WACN,CAAA;AASD,IAAA,IAAI,OAAOC,gBAAgB,CAACC,UAAU,KAAK,QAAQ,EAAE;AACnD,MAAA,MAAM,IAAIC,SAAS,CAAC,CAAA,uCAAA,CAAyC,CAAC,CAAA;AAChE,KAAA;AAEA,IAAA,IAAI,EAAEL,KAAK,YAAYG,gBAAgB,CAACG,WAAW,CAAC,EAAE;MACpD,MAAM,IAAIC,YAAY,CAAC;AACrBC,QAAAA,OAAO,EAAER,KAAK;AACdS,QAAAA,SAAS,EAAEN,gBAAgB;AAC3BO,QAAAA,UAAU,EAAE,wBAAwB;AACpCC,QAAAA,YAAY,EAAER,gBAAgB,CAACG,WAAW,CAACM,IAAAA;AAC7C,OAAC,CAAC,CAAA;AACJ,KAAC,MAAM;MACL,IAAI,CAACX,MAAM,GAAmCD,KAAM,CAAA;AACtD,KAAA;IAEAG,gBAAgB,CAACU,YAAY,EAAE,CAAA;IAE/B,IAAI,CAACC,gBAAgB,EAAE,CAAA;AAEvB,IAAA,MAAMV,UAAU,GAAGD,gBAAgB,CAACC,UAAU,CAAA;IAE9C,IAAI,CAACJ,KAAK,CAACe,YAAY,CAAC,QAAQX,UAAU,CAAA,KAAA,CAAO,EAAE,EAAE,CAAC,CAAA;AACxD,GAAA;AAQAU,EAAAA,gBAAgBA,GAAG;AACjB,IAAA,MAAMZ,WAAW,GAAyC,IAAI,CAACA,WAAY,CAAA;AAC3E,IAAA,MAAME,UAAU,GAAGF,WAAW,CAACE,UAAU,CAAA;IAEzC,IAAIA,UAAU,IAAIY,aAAa,CAAC,IAAI,CAAChB,KAAK,EAAEI,UAAU,CAAC,EAAE;AACvD,MAAA,MAAM,IAAIC,SAAS,CAACH,WAAW,CAAC,CAAA;AAClC,KAAA;AACF,GAAA;EAOA,OAAOW,YAAYA,GAAG;AACpB,IAAA,IAAI,CAACI,WAAW,EAAE,EAAE;MAClB,MAAM,IAAIC,YAAY,EAAE,CAAA;AAC1B,KAAA;AACF,GAAA;AACF,CAAA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AArGanB,sBAAsB,CAI1BO,WAAW,GAAGa,WAAW;;;;"}