defra_ruby_template 5.11.1 → 6.4.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.
- checksums.yaml +4 -4
- data/README.md +133 -9
- data/Rakefile +146 -22
- data/app/views/layouts/defra_ruby_template.html.erb +108 -60
- data/lib/defra_ruby_template/version.rb +1 -1
- data/lib/defra_ruby_template.rb +12 -8
- data/node_modules/govuk-frontend/README.md +1 -1
- data/node_modules/govuk-frontend/dist/govuk/_base.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/_base.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +214 -325
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +215 -325
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.mjs +0 -1
- data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +29 -2
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +5 -11
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/component.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/_index.import.scss +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +37 -39
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +3 -368
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_mixin.scss +375 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +14 -137
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +14 -137
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/fixtures.json +102 -97
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +3 -81
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_mixin.scss +87 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/fixtures.json +21 -32
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +3 -132
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_mixin.scss +134 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/fixtures.json +25 -45
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-default.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.import.scss +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +9 -260
- data/node_modules/govuk-frontend/dist/govuk/components/button/_mixin.scss +233 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/_settings.import.scss +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/_settings.scss +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +193 -209
- data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +12 -19
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-disabled.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template.njk +20 -20
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.import.scss +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +7 -42
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_mixin.scss +41 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +30 -143
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +30 -143
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +20 -10
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +72 -86
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.import.scss +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +7 -309
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_mixin.scss +317 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +10 -5
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +10 -5
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +326 -480
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro-options.json +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-conditional-reveal.html +21 -21
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-divider-and-none.html +30 -30
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-error.html +26 -26
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-hint.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-long-text.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +30 -32
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +40 -42
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +32 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hint.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +21 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-legend-as-a-page-heading.html +27 -27
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-optional-form-group-classes-showing-group-error.html +36 -36
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-pre-checked-values.html +25 -16
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +27 -30
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.import.scss +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +4 -56
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_mixin.scss +56 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/fixtures.json +82 -82
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-default.html +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-with-html.html +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.import.scss +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +8 -26
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_mixin.scss +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/fixtures.json +780 -150
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro-options.json +50 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-day-and-month-using-items.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-default.html +30 -22
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-month-and-year-using-items.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-message-and-hint-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-message-and-hint.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-day-input-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-day-input.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-month-input-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-month-input.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-year-input-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-year-input.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-classes.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-items-and-classes.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-items.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only.html +5 -8
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-translations.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values-and-name-prefix.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values-name-prefix-and-custom-names.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template.njk +84 -29
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +3 -137
- data/node_modules/govuk-frontend/dist/govuk/components/details/_mixin.scss +143 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/fixtures.json +22 -22
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +3 -12
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_mixin.scss +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/fixtures.json +10 -10
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +3 -53
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_mixin.scss +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +8 -12
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +8 -12
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/fixtures.json +21 -21
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.import.scss +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +4 -89
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_mixin.scss +96 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +10 -133
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +10 -133
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/fixtures.json +19 -19
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -67
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_mixin.scss +71 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/fixtures.json +19 -19
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.import.scss +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +6 -216
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_mixin.scss +217 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +76 -164
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +76 -164
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +66 -32
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +125 -138
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +15 -10
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-custom-wrapper-classes-and-attributes.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-multiple-files.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-with-error-message-and-hint.html +3 -2
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html +3 -2
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html +3 -2
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +3 -192
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_mixin.scss +199 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +129 -81
- data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +1 -7
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +45 -24
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +45 -24
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +45 -24
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +40 -19
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +45 -24
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +40 -19
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +45 -24
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +45 -24
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +45 -24
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +45 -24
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-no-content-licence.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-custom-meta.html +41 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-meta-links.html +80 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +36 -39
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_generic-header.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_index.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/_mixin.scss +140 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/fixtures.json +90 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-default.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-full-width.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-with-image-logo.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-with-text-and-image-logo.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template.njk +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/README.md +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +3 -546
- data/node_modules/govuk-frontend/dist/govuk/components/header/_mixin.scss +119 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +15 -492
- data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +2 -101
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-default.html +12 -7
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +12 -8
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +11 -7
- data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +20 -63
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +3 -43
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_mixin.scss +47 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/fixtures.json +7 -7
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.import.scss +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +6 -166
- data/node_modules/govuk-frontend/dist/govuk/components/input/_input.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_mixin.scss +161 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +161 -180
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-extra-letter-spacing.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +3 -24
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_mixin.scss +31 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/fixtures.json +7 -7
- data/node_modules/govuk-frontend/dist/govuk/components/label/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss +3 -44
- data/node_modules/govuk-frontend/dist/govuk/components/label/_label.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/_mixin.scss +48 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/fixtures.json +20 -20
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +3 -91
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_mixin.scss +100 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/fixtures.json +74 -108
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +7 -5
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-text-as-html.html +7 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +3 -226
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_mixin.scss +235 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +109 -105
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-default.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-first-page.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-last-page.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +9 -9
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +4 -2
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +3 -56
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_mixin.scss +94 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/fixtures.json +249 -16
- data/node_modules/govuk-frontend/dist/govuk/components/panel/macro-options.json +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-default.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption-with-content-with-long-line-length.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption-with-headings-content-and-lists.html +18 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption.html +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template.njk +42 -2
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.import.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +5 -54
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_mixin.scss +56 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +53 -48
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +10 -133
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +10 -133
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.import.scss +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +4 -33
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_mixin.scss +42 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/fixtures.json +15 -15
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template-default.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.import.scss +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +7 -325
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_mixin.scss +336 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +244 -354
- data/node_modules/govuk-frontend/dist/govuk/components/radios/macro-options.json +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +10 -5
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +10 -5
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-default.html +5 -3
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-inline.html +19 -19
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-a-divider.html +24 -24
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-conditional-reveal.html +27 -27
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-error.html +26 -26
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-hint.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-long-text.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-divider.html +24 -24
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-item-checked.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-and-pre-checked-value.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-fieldset-and-error-message.html +20 -20
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hint.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hints-on-items.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-legend-as-page-heading.html +21 -21
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-optional-form-group-classes-showing-group-error.html +36 -36
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-very-long-option-text.html +28 -28
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.import.scss +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +6 -56
- data/node_modules/govuk-frontend/dist/govuk/components/select/_mixin.scss +45 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +99 -115
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +3 -185
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_mixin.scss +238 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +210 -69
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro-options.json +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +41 -8
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +41 -8
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +30 -2
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-default.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-inverse.html +63 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item-and-collapsenavigationonmobile-set-to-true.html +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item.html +35 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-collapsenavigationonmobile-set-to-false.html +60 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-html-navigation-items.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-large-navigation.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-a-current-item.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-non-link-navigation-items.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name-and-navigation.html +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +3 -50
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_mixin.scss +60 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/fixtures.json +10 -10
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +12 -19
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +12 -19
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +3 -9
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +3 -267
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_mixin.scss +286 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +282 -518
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +3 -73
- data/node_modules/govuk-frontend/dist/govuk/components/table/_mixin.scss +77 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/_table.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/fixtures.json +75 -75
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +3 -132
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_mixin.scss +140 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/fixtures.json +44 -39
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +13 -14
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +13 -14
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +3 -94
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_mixin.scss +135 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/fixtures.json +19 -43
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-pink.html +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-turquoise.html +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.import.scss +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +4 -76
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_mixin.scss +83 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +35 -58
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-forced-hover-state.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-all-possible-colours.html +131 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-hint-text-and-additional-states.html +77 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.import.scss +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +6 -47
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_mixin.scss +43 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +81 -81
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +3 -64
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_mixin.scss +69 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/fixtures.json +9 -9
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.import.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.mixin.scss +19 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss +5 -18
- data/node_modules/govuk-frontend/dist/govuk/core/_index.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +6 -7
- data/node_modules/govuk-frontend/dist/govuk/core/_links.import.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_links.mixin.scss +44 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_links.scss +3 -40
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.import.scss +14 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.mixin.scss +74 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +6 -64
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.mixin.scss +54 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +3 -49
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.mixin.scss +173 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +3 -187
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.mixin.scss +15 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.mixin.scss +13 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.mixin.scss +21 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.import.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +5 -3
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_clearfix.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_clearfix.scss +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +190 -89
- data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss +2 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +44 -7
- data/node_modules/govuk-frontend/dist/govuk/helpers/_font-faces--internal.scss +41 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +7 -4
- data/node_modules/govuk-frontend/dist/govuk/helpers/_index.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_index.scss +12 -13
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +35 -46
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +174 -34
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +2 -3
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing--internal.scss +80 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +27 -82
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography--internal.scss +24 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +55 -74
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +17 -13
- data/node_modules/govuk-frontend/dist/govuk/helpers/_width-container.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_width-container.scss +73 -0
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +5 -128
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/index.import.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/index.scss +6 -7
- data/node_modules/govuk-frontend/dist/govuk/init.mjs +53 -45
- data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/macros/attributes.njk +30 -14
- data/node_modules/govuk-frontend/dist/govuk/macros/logo.njk +7 -29
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.mixin.scss +80 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +3 -78
- data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.mixin.scss +26 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss +3 -23
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.mixin.scss +28 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss +3 -24
- data/node_modules/govuk-frontend/dist/govuk/objects/_index.import.scss +7 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_index.scss +6 -7
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.mixin.scss +55 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +3 -53
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.mixin.scss +53 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +3 -55
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.mixin.scss +9 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +3 -75
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.mixin.scss +26 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +2 -24
- data/node_modules/govuk-frontend/dist/govuk/overrides/_index.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss +5 -6
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.mixin.scss +89 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss +2 -84
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.mixin.scss +16 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss +2 -14
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.mixin.scss +43 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +2 -40
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.mixin.scss +50 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +2 -46
- data/node_modules/govuk-frontend/dist/govuk/settings/_assets.import.scss +13 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss +50 -21
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.import.scss +13 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +168 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-legacy-functional.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-legacy-functional.scss +188 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +9 -274
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette--internal.scss +128 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss +17 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_global-styles.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_global-styles.scss +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_index.import.scss +24 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +14 -13
- data/node_modules/govuk-frontend/dist/govuk/settings/_links.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss +3 -3
- data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss +8 -17
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/settings/_spacing.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_spacing.scss +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +12 -190
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings--internal.scss +69 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss +9 -56
- data/node_modules/govuk-frontend/dist/govuk/template.njk +61 -23
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss +12 -6
- data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.import.scss +31 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss +22 -6
- data/node_modules/govuk-frontend/dist/govuk/tools/_if.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss +23 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.import.scss +31 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss +22 -6
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +6 -7
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +9 -6
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +6 -3
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.mixin.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss +3 -6
- data/node_modules/govuk-frontend/dist/govuk/utilities/_index.import.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss +2 -3
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.mixin.scss +14 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss +2 -9
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +4 -3
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +5 -4
- data/node_modules/govuk-frontend/package.json +27 -22
- data/vendor/assets/assets/images/favicon.ico +0 -0
- data/vendor/assets/assets/images/favicon.svg +1 -1
- data/vendor/assets/assets/images/govuk-icon-180.png +0 -0
- data/vendor/assets/assets/images/govuk-icon-192.png +0 -0
- data/vendor/assets/assets/images/govuk-icon-512.png +0 -0
- data/vendor/assets/assets/images/govuk-opengraph-image.png +0 -0
- data/vendor/assets/assets/manifest.json.erb +39 -0
- data/vendor/assets/images/favicon.ico +0 -0
- data/vendor/assets/images/favicon.svg +1 -1
- data/vendor/assets/images/govuk-icon-180.png +0 -0
- data/vendor/assets/images/govuk-icon-192.png +0 -0
- data/vendor/assets/images/govuk-icon-512.png +0 -0
- data/vendor/assets/images/govuk-opengraph-image.png +0 -0
- data/vendor/assets/javascripts/defra_ruby_template.js +214 -325
- data/vendor/assets/javascripts/defra_ruby_template_supported.js +4 -0
- data/vendor/assets/stylesheets/_base.import.scss +6 -0
- data/vendor/assets/stylesheets/_base.scss +4 -4
- data/vendor/assets/stylesheets/components/_index.import.scss +38 -0
- data/vendor/assets/stylesheets/components/_index.scss +37 -39
- data/vendor/assets/stylesheets/components/accordion/_accordion.import.scss +6 -0
- data/vendor/assets/stylesheets/components/accordion/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/accordion/_index.scss +3 -368
- data/vendor/assets/stylesheets/components/accordion/_mixin.scss +375 -0
- data/vendor/assets/stylesheets/components/back-link/_back-link.import.scss +6 -0
- data/vendor/assets/stylesheets/components/back-link/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/back-link/_index.scss +3 -81
- data/vendor/assets/stylesheets/components/back-link/_mixin.scss +87 -0
- data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.import.scss +6 -0
- data/vendor/assets/stylesheets/components/breadcrumbs/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +3 -132
- data/vendor/assets/stylesheets/components/breadcrumbs/_mixin.scss +134 -0
- data/vendor/assets/stylesheets/components/button/_button.import.scss +6 -0
- data/vendor/assets/stylesheets/components/button/_index.import.scss +13 -0
- data/vendor/assets/stylesheets/components/button/_index.scss +9 -260
- data/vendor/assets/stylesheets/components/button/_mixin.scss +233 -0
- data/vendor/assets/stylesheets/components/button/_settings.import.scss +32 -0
- data/vendor/assets/stylesheets/components/button/_settings.scss +34 -0
- data/vendor/assets/stylesheets/components/character-count/_character-count.import.scss +6 -0
- data/vendor/assets/stylesheets/components/character-count/_index.import.scss +12 -0
- data/vendor/assets/stylesheets/components/character-count/_index.scss +7 -42
- data/vendor/assets/stylesheets/components/character-count/_mixin.scss +41 -0
- data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.import.scss +6 -0
- data/vendor/assets/stylesheets/components/checkboxes/_index.import.scss +12 -0
- data/vendor/assets/stylesheets/components/checkboxes/_index.scss +7 -309
- data/vendor/assets/stylesheets/components/checkboxes/_mixin.scss +317 -0
- data/vendor/assets/stylesheets/components/cookie-banner/_cookie-banner.import.scss +6 -0
- data/vendor/assets/stylesheets/components/cookie-banner/_index.import.scss +9 -0
- data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +4 -56
- data/vendor/assets/stylesheets/components/cookie-banner/_mixin.scss +56 -0
- data/vendor/assets/stylesheets/components/date-input/_date-input.import.scss +6 -0
- data/vendor/assets/stylesheets/components/date-input/_index.import.scss +13 -0
- data/vendor/assets/stylesheets/components/date-input/_index.scss +8 -26
- data/vendor/assets/stylesheets/components/date-input/_mixin.scss +29 -0
- data/vendor/assets/stylesheets/components/details/_details.import.scss +6 -0
- data/vendor/assets/stylesheets/components/details/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/details/_index.scss +3 -137
- data/vendor/assets/stylesheets/components/details/_mixin.scss +143 -0
- data/vendor/assets/stylesheets/components/error-message/_error-message.import.scss +6 -0
- data/vendor/assets/stylesheets/components/error-message/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/error-message/_index.scss +3 -12
- data/vendor/assets/stylesheets/components/error-message/_mixin.scss +16 -0
- data/vendor/assets/stylesheets/components/error-summary/_error-summary.import.scss +6 -0
- data/vendor/assets/stylesheets/components/error-summary/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/error-summary/_index.scss +3 -53
- data/vendor/assets/stylesheets/components/error-summary/_mixin.scss +58 -0
- data/vendor/assets/stylesheets/components/exit-this-page/_exit-this-page.import.scss +6 -0
- data/vendor/assets/stylesheets/components/exit-this-page/_index.import.scss +9 -0
- data/vendor/assets/stylesheets/components/exit-this-page/_index.scss +4 -89
- data/vendor/assets/stylesheets/components/exit-this-page/_mixin.scss +96 -0
- data/vendor/assets/stylesheets/components/fieldset/_fieldset.import.scss +6 -0
- data/vendor/assets/stylesheets/components/fieldset/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/fieldset/_index.scss +3 -67
- data/vendor/assets/stylesheets/components/fieldset/_mixin.scss +71 -0
- data/vendor/assets/stylesheets/components/file-upload/_file-upload.import.scss +6 -0
- data/vendor/assets/stylesheets/components/file-upload/_index.import.scss +11 -0
- data/vendor/assets/stylesheets/components/file-upload/_index.scss +6 -216
- data/vendor/assets/stylesheets/components/file-upload/_mixin.scss +217 -0
- data/vendor/assets/stylesheets/components/footer/_footer.import.scss +6 -0
- data/vendor/assets/stylesheets/components/footer/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/footer/_index.scss +3 -192
- data/vendor/assets/stylesheets/components/footer/_mixin.scss +199 -0
- data/vendor/assets/stylesheets/components/generic-header/_generic-header.import.scss +6 -0
- data/vendor/assets/stylesheets/components/generic-header/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/generic-header/_index.scss +5 -0
- data/vendor/assets/stylesheets/components/generic-header/_mixin.scss +140 -0
- data/vendor/assets/stylesheets/components/header/_header.import.scss +6 -0
- data/vendor/assets/stylesheets/components/header/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/header/_index.scss +3 -546
- data/vendor/assets/stylesheets/components/header/_mixin.scss +119 -0
- data/vendor/assets/stylesheets/components/hint/_hint.import.scss +6 -0
- data/vendor/assets/stylesheets/components/hint/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/hint/_index.scss +3 -43
- data/vendor/assets/stylesheets/components/hint/_mixin.scss +47 -0
- data/vendor/assets/stylesheets/components/input/_index.import.scss +11 -0
- data/vendor/assets/stylesheets/components/input/_index.scss +6 -166
- data/vendor/assets/stylesheets/components/input/_input.import.scss +6 -0
- data/vendor/assets/stylesheets/components/input/_mixin.scss +161 -0
- data/vendor/assets/stylesheets/components/inset-text/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/inset-text/_index.scss +3 -24
- data/vendor/assets/stylesheets/components/inset-text/_inset-text.import.scss +6 -0
- data/vendor/assets/stylesheets/components/inset-text/_mixin.scss +31 -0
- data/vendor/assets/stylesheets/components/label/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/label/_index.scss +3 -44
- data/vendor/assets/stylesheets/components/label/_label.import.scss +6 -0
- data/vendor/assets/stylesheets/components/label/_mixin.scss +48 -0
- data/vendor/assets/stylesheets/components/notification-banner/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/notification-banner/_index.scss +3 -91
- data/vendor/assets/stylesheets/components/notification-banner/_mixin.scss +100 -0
- data/vendor/assets/stylesheets/components/notification-banner/_notification-banner.import.scss +6 -0
- data/vendor/assets/stylesheets/components/pagination/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/pagination/_index.scss +3 -226
- data/vendor/assets/stylesheets/components/pagination/_mixin.scss +235 -0
- data/vendor/assets/stylesheets/components/pagination/_pagination.import.scss +6 -0
- data/vendor/assets/stylesheets/components/panel/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/panel/_index.scss +3 -56
- data/vendor/assets/stylesheets/components/panel/_mixin.scss +94 -0
- data/vendor/assets/stylesheets/components/panel/_panel.import.scss +6 -0
- data/vendor/assets/stylesheets/components/password-input/_index.import.scss +10 -0
- data/vendor/assets/stylesheets/components/password-input/_index.scss +5 -54
- data/vendor/assets/stylesheets/components/password-input/_mixin.scss +56 -0
- data/vendor/assets/stylesheets/components/password-input/_password-input.import.scss +6 -0
- data/vendor/assets/stylesheets/components/phase-banner/_index.import.scss +9 -0
- data/vendor/assets/stylesheets/components/phase-banner/_index.scss +4 -33
- data/vendor/assets/stylesheets/components/phase-banner/_mixin.scss +42 -0
- data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.import.scss +6 -0
- data/vendor/assets/stylesheets/components/radios/_index.import.scss +12 -0
- data/vendor/assets/stylesheets/components/radios/_index.scss +7 -325
- data/vendor/assets/stylesheets/components/radios/_mixin.scss +336 -0
- data/vendor/assets/stylesheets/components/radios/_radios.import.scss +6 -0
- data/vendor/assets/stylesheets/components/select/_index.import.scss +11 -0
- data/vendor/assets/stylesheets/components/select/_index.scss +6 -56
- data/vendor/assets/stylesheets/components/select/_mixin.scss +45 -0
- data/vendor/assets/stylesheets/components/select/_select.import.scss +6 -0
- data/vendor/assets/stylesheets/components/service-navigation/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/service-navigation/_index.scss +3 -185
- data/vendor/assets/stylesheets/components/service-navigation/_mixin.scss +238 -0
- data/vendor/assets/stylesheets/components/service-navigation/_service-navigation.import.scss +6 -0
- data/vendor/assets/stylesheets/components/skip-link/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/skip-link/_index.scss +3 -50
- data/vendor/assets/stylesheets/components/skip-link/_mixin.scss +60 -0
- data/vendor/assets/stylesheets/components/skip-link/_skip-link.import.scss +6 -0
- data/vendor/assets/stylesheets/components/summary-list/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/summary-list/_index.scss +3 -267
- data/vendor/assets/stylesheets/components/summary-list/_mixin.scss +286 -0
- data/vendor/assets/stylesheets/components/summary-list/_summary-list.import.scss +6 -0
- data/vendor/assets/stylesheets/components/table/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/table/_index.scss +3 -73
- data/vendor/assets/stylesheets/components/table/_mixin.scss +77 -0
- data/vendor/assets/stylesheets/components/table/_table.import.scss +6 -0
- data/vendor/assets/stylesheets/components/tabs/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/tabs/_index.scss +3 -132
- data/vendor/assets/stylesheets/components/tabs/_mixin.scss +140 -0
- data/vendor/assets/stylesheets/components/tabs/_tabs.import.scss +6 -0
- data/vendor/assets/stylesheets/components/tag/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/tag/_index.scss +3 -94
- data/vendor/assets/stylesheets/components/tag/_mixin.scss +135 -0
- data/vendor/assets/stylesheets/components/tag/_tag.import.scss +6 -0
- data/vendor/assets/stylesheets/components/task-list/_index.import.scss +9 -0
- data/vendor/assets/stylesheets/components/task-list/_index.scss +4 -76
- data/vendor/assets/stylesheets/components/task-list/_mixin.scss +83 -0
- data/vendor/assets/stylesheets/components/task-list/_task-list.import.scss +6 -0
- data/vendor/assets/stylesheets/components/textarea/_index.import.scss +11 -0
- data/vendor/assets/stylesheets/components/textarea/_index.scss +6 -47
- data/vendor/assets/stylesheets/components/textarea/_mixin.scss +43 -0
- data/vendor/assets/stylesheets/components/textarea/_textarea.import.scss +6 -0
- data/vendor/assets/stylesheets/components/warning-text/_index.import.scss +8 -0
- data/vendor/assets/stylesheets/components/warning-text/_index.scss +3 -64
- data/vendor/assets/stylesheets/components/warning-text/_mixin.scss +69 -0
- data/vendor/assets/stylesheets/components/warning-text/_warning-text.import.scss +6 -0
- data/vendor/assets/stylesheets/core/_global-styles.import.scss +10 -0
- data/vendor/assets/stylesheets/core/_global-styles.mixin.scss +19 -0
- data/vendor/assets/stylesheets/core/_global-styles.scss +5 -18
- data/vendor/assets/stylesheets/core/_index.import.scss +6 -0
- data/vendor/assets/stylesheets/core/_index.scss +6 -7
- data/vendor/assets/stylesheets/core/_links.import.scss +10 -0
- data/vendor/assets/stylesheets/core/_links.mixin.scss +44 -0
- data/vendor/assets/stylesheets/core/_links.scss +3 -40
- data/vendor/assets/stylesheets/core/_lists.import.scss +14 -0
- data/vendor/assets/stylesheets/core/_lists.mixin.scss +74 -0
- data/vendor/assets/stylesheets/core/_lists.scss +6 -64
- data/vendor/assets/stylesheets/core/_section-break.import.scss +8 -0
- data/vendor/assets/stylesheets/core/_section-break.mixin.scss +54 -0
- data/vendor/assets/stylesheets/core/_section-break.scss +3 -49
- data/vendor/assets/stylesheets/core/_typography.import.scss +8 -0
- data/vendor/assets/stylesheets/core/_typography.mixin.scss +173 -0
- data/vendor/assets/stylesheets/core/_typography.scss +3 -187
- data/vendor/assets/stylesheets/custom-properties/_breakpoints.import.scss +8 -0
- data/vendor/assets/stylesheets/custom-properties/_breakpoints.mixin.scss +15 -0
- data/vendor/assets/stylesheets/custom-properties/_breakpoints.scss +4 -0
- data/vendor/assets/stylesheets/custom-properties/_frontend-version.import.scss +8 -0
- data/vendor/assets/stylesheets/custom-properties/_frontend-version.mixin.scss +13 -0
- data/vendor/assets/stylesheets/custom-properties/_frontend-version.scss +4 -0
- data/vendor/assets/stylesheets/custom-properties/_functional-colours.import.scss +8 -0
- data/vendor/assets/stylesheets/custom-properties/_functional-colours.mixin.scss +21 -0
- data/vendor/assets/stylesheets/custom-properties/_functional-colours.scss +4 -0
- data/vendor/assets/stylesheets/custom-properties/_index.import.scss +4 -0
- data/vendor/assets/stylesheets/custom-properties/_index.scss +4 -0
- data/vendor/assets/stylesheets/defra_ruby_template.scss +29 -10
- data/vendor/assets/stylesheets/govuk-frontend.min.css +2 -2
- data/vendor/assets/stylesheets/helpers/_clearfix.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_clearfix.scss +0 -1
- data/vendor/assets/stylesheets/helpers/_colour.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_colour.scss +190 -89
- data/vendor/assets/stylesheets/helpers/_device-pixels.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_device-pixels.scss +2 -1
- data/vendor/assets/stylesheets/helpers/_focused.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_focused.scss +44 -7
- data/vendor/assets/stylesheets/helpers/_font-faces--internal.scss +41 -0
- data/vendor/assets/stylesheets/helpers/_grid.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_grid.scss +7 -4
- data/vendor/assets/stylesheets/helpers/_index.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_index.scss +12 -13
- data/vendor/assets/stylesheets/helpers/_links.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_links.scss +35 -46
- data/vendor/assets/stylesheets/helpers/_media-queries.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_media-queries.scss +174 -34
- data/vendor/assets/stylesheets/helpers/_shape-arrow.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +2 -3
- data/vendor/assets/stylesheets/helpers/_spacing--internal.scss +80 -0
- data/vendor/assets/stylesheets/helpers/_spacing.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_spacing.scss +27 -82
- data/vendor/assets/stylesheets/helpers/_typography--internal.scss +24 -0
- data/vendor/assets/stylesheets/helpers/_typography.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_typography.scss +55 -74
- data/vendor/assets/stylesheets/helpers/_visually-hidden.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +17 -13
- data/vendor/assets/stylesheets/helpers/_width-container.import.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_width-container.scss +73 -0
- data/vendor/assets/stylesheets/index.import.scss +10 -0
- data/vendor/assets/stylesheets/index.scss +6 -7
- data/vendor/assets/stylesheets/objects/_button-group.import.scss +8 -0
- data/vendor/assets/stylesheets/objects/_button-group.mixin.scss +80 -0
- data/vendor/assets/stylesheets/objects/_button-group.scss +3 -78
- data/vendor/assets/stylesheets/objects/_form-group.import.scss +8 -0
- data/vendor/assets/stylesheets/objects/_form-group.mixin.scss +26 -0
- data/vendor/assets/stylesheets/objects/_form-group.scss +3 -23
- data/vendor/assets/stylesheets/objects/_grid.import.scss +8 -0
- data/vendor/assets/stylesheets/objects/_grid.mixin.scss +28 -0
- data/vendor/assets/stylesheets/objects/_grid.scss +3 -24
- data/vendor/assets/stylesheets/objects/_index.import.scss +7 -0
- data/vendor/assets/stylesheets/objects/_index.scss +6 -7
- data/vendor/assets/stylesheets/objects/_main-wrapper.import.scss +8 -0
- data/vendor/assets/stylesheets/objects/_main-wrapper.mixin.scss +55 -0
- data/vendor/assets/stylesheets/objects/_main-wrapper.scss +3 -53
- data/vendor/assets/stylesheets/objects/_template.import.scss +8 -0
- data/vendor/assets/stylesheets/objects/_template.mixin.scss +53 -0
- data/vendor/assets/stylesheets/objects/_template.scss +3 -55
- data/vendor/assets/stylesheets/objects/_width-container.import.scss +8 -0
- data/vendor/assets/stylesheets/objects/_width-container.mixin.scss +9 -0
- data/vendor/assets/stylesheets/objects/_width-container.scss +3 -75
- data/vendor/assets/stylesheets/overrides/_display.import.scss +8 -0
- data/vendor/assets/stylesheets/overrides/_display.mixin.scss +26 -0
- data/vendor/assets/stylesheets/overrides/_display.scss +2 -24
- data/vendor/assets/stylesheets/overrides/_index.import.scss +6 -0
- data/vendor/assets/stylesheets/overrides/_index.scss +5 -6
- data/vendor/assets/stylesheets/overrides/_spacing.import.scss +8 -0
- data/vendor/assets/stylesheets/overrides/_spacing.mixin.scss +89 -0
- data/vendor/assets/stylesheets/overrides/_spacing.scss +2 -84
- data/vendor/assets/stylesheets/overrides/_text-align.import.scss +8 -0
- data/vendor/assets/stylesheets/overrides/_text-align.mixin.scss +16 -0
- data/vendor/assets/stylesheets/overrides/_text-align.scss +2 -14
- data/vendor/assets/stylesheets/overrides/_typography.import.scss +8 -0
- data/vendor/assets/stylesheets/overrides/_typography.mixin.scss +43 -0
- data/vendor/assets/stylesheets/overrides/_typography.scss +2 -40
- data/vendor/assets/stylesheets/overrides/_width.import.scss +8 -0
- data/vendor/assets/stylesheets/overrides/_width.mixin.scss +50 -0
- data/vendor/assets/stylesheets/overrides/_width.scss +2 -46
- data/vendor/assets/stylesheets/settings/_assets.import.scss +13 -0
- data/vendor/assets/stylesheets/settings/_assets.scss +50 -21
- data/vendor/assets/stylesheets/settings/_colours-applied.import.scss +13 -0
- data/vendor/assets/stylesheets/settings/_colours-functional.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_colours-functional.scss +168 -0
- data/vendor/assets/stylesheets/settings/_colours-legacy-functional.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_colours-legacy-functional.scss +188 -0
- data/vendor/assets/stylesheets/settings/_colours-organisations.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_colours-organisations.scss +9 -274
- data/vendor/assets/stylesheets/settings/_colours-palette--internal.scss +128 -0
- data/vendor/assets/stylesheets/settings/_custom-properties.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_custom-properties.scss +17 -0
- data/vendor/assets/stylesheets/settings/_global-styles.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_global-styles.scss +0 -1
- data/vendor/assets/stylesheets/settings/_index.import.scss +24 -0
- data/vendor/assets/stylesheets/settings/_index.scss +14 -13
- data/vendor/assets/stylesheets/settings/_links.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_links.scss +3 -3
- data/vendor/assets/stylesheets/settings/_measurements.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_measurements.scss +8 -17
- data/vendor/assets/stylesheets/settings/_media-queries.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_media-queries.scss +0 -10
- data/vendor/assets/stylesheets/settings/_spacing.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_spacing.scss +0 -1
- data/vendor/assets/stylesheets/settings/_typography-font.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_typography-font.scss +3 -2
- data/vendor/assets/stylesheets/settings/_typography-responsive.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_typography-responsive.scss +12 -190
- data/vendor/assets/stylesheets/settings/_warnings--internal.scss +69 -0
- data/vendor/assets/stylesheets/settings/_warnings.import.scss +2 -0
- data/vendor/assets/stylesheets/settings/_warnings.scss +9 -56
- data/vendor/assets/stylesheets/tools/_exports.import.scss +2 -0
- data/vendor/assets/stylesheets/tools/_exports.scss +12 -6
- data/vendor/assets/stylesheets/tools/_font-url.import.scss +31 -0
- data/vendor/assets/stylesheets/tools/_font-url.scss +22 -6
- data/vendor/assets/stylesheets/tools/_if.import.scss +2 -0
- data/vendor/assets/stylesheets/tools/_if.scss +23 -0
- data/vendor/assets/stylesheets/tools/_image-url.import.scss +31 -0
- data/vendor/assets/stylesheets/tools/_image-url.scss +22 -6
- data/vendor/assets/stylesheets/tools/_index.import.scss +2 -0
- data/vendor/assets/stylesheets/tools/_index.scss +6 -7
- data/vendor/assets/stylesheets/tools/_px-to-em.import.scss +2 -0
- data/vendor/assets/stylesheets/tools/_px-to-em.scss +9 -6
- data/vendor/assets/stylesheets/tools/_px-to-rem.import.scss +2 -0
- data/vendor/assets/stylesheets/tools/_px-to-rem.scss +6 -3
- data/vendor/assets/stylesheets/utilities/_clearfix.import.scss +8 -0
- data/vendor/assets/stylesheets/utilities/_clearfix.mixin.scss +10 -0
- data/vendor/assets/stylesheets/utilities/_clearfix.scss +3 -6
- data/vendor/assets/stylesheets/utilities/_index.import.scss +3 -0
- data/vendor/assets/stylesheets/utilities/_index.scss +2 -3
- data/vendor/assets/stylesheets/utilities/_visually-hidden.import.scss +8 -0
- data/vendor/assets/stylesheets/utilities/_visually-hidden.mixin.scss +14 -0
- data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +2 -9
- metadata +490 -408
- data/node_modules/govuk-frontend/dist/govuk/_base.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/all.scss +0 -9
- data/node_modules/govuk-frontend/dist/govuk/all.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +0 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +0 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +0 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +0 -39
- data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/components/_all.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-focusable-elements-inside.html +0 -26
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-one-section-open.html +0 -30
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-translations.html +0 -30
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-with-custom-link.html +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-with-custom-text.html +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-multiple-levels.html +0 -16
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-input-disabled.html +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-input.html +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-link.html +0 -3
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-start.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-prevent-double-click.html +0 -3
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-link.html +0 -3
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-start-link.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-link.html +0 -3
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-active-state.html +0 -3
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-focus-state.html +0 -3
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-hover-state.html +0 -3
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-custom-textarea-description.html +0 -9
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-error.html +0 -12
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-translations.html +0 -9
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-disabled.html +0 -27
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-a-medium-legend.html +0 -33
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-item-checked.html +0 -39
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items-with-special-characters.html +0 -39
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-disabled-item.html +0 -29
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message-and-hints-on-items.html +0 -39
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-fieldset-and-error-message.html +0 -30
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-id-and-name.html +0 -30
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-and-hint-set-aria-describedby-on-input.html +0 -16
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-set-aria-describedby-on-input.html +0 -13
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-without-fieldset.html +0 -22
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-client-side-implementation.html +0 -60
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-autocomplete-values.html +0 -36
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-default-items.html +0 -36
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-and-hint.html +0 -39
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-input-attributes.html +0 -36
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-optional-form-group-classes.html +0 -36
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/template-translated.html +0 -5
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-direct-media-capture.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-image-files-only.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-multiple-files.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-disabled.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-disabled.html +0 -13
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-optional-form-group-classes.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta.html +0 -56
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +0 -233
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -225
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +0 -89
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html +0 -55
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html +0 -57
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html +0 -51
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html +0 -59
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html +0 -59
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html +0 -59
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-full-width-border.html +0 -30
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html +0 -119
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-navigation.html +0 -59
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html +0 -62
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html +0 -34
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name.html +0 -34
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html +0 -19
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-disabled.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-autocapitalize-turned-off.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-autocomplete-attribute.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-optional-form-group-classes.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-pattern-attribute.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-long-suffix.html +0 -10
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-spellcheck-disabled.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-spellcheck-enabled.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-disabled-with-type-as-success.html +0 -12
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-explicitly-enabled-with-type-as-success.html +0 -12
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-custom-tabindex.html +0 -12
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-paragraph-as-html-heading.html +0 -10
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-rolealert-overridden-to-roleregion-with-type-as-success.html +0 -12
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-success-with-custom-html.html +0 -16
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-a-list.html +0 -16
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-accessible-labels-on-item-links.html +0 -39
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-navigation-landmark.html +0 -39
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-in-a-different-language.html +0 -22
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-custom-heading-level.html +0 -8
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-new-password-autocomplete.html +0 -11
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-translations.html +0 -11
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked-using-value.html +0 -16
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked.html +0 -19
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline-extreme.html +0 -69
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-disabled.html +0 -27
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-medium-legend.html +0 -24
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-with-special-characters.html +0 -39
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-disabled.html +0 -29
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-idprefix.html +0 -16
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-id.html +0 -7
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-no-items.html +0 -7
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-optional-form-group-classes.html +0 -10
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-selected-value.html +0 -10
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-an-active-item.html +0 -58
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-custom-header-level.html +0 -28
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-check-your-answers.html +0 -98
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-overridden-widths.html +0 -58
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-translated.html +0 -51
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-no-first-action.html +0 -58
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-some-actions.html +0 -45
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/template-with-small-text-modifier-for-tables-with-a-lot-of-data.html +0 -19
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-blue.html +0 -3
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-light-blue.html +0 -3
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-3-states.html +0 -49
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-all-possible-colours.html +0 -143
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-hint-text-and-additional-states.html +0 -77
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-autocomplete-attribute.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-optional-form-group-classes.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-spellcheck-disabled.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-spellcheck-enabled.html +0 -6
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +0 -4
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/core/_all.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +0 -12
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_links.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_clearfix.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_font-faces.scss +0 -41
- data/node_modules/govuk-frontend/dist/govuk/helpers/_font-faces.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +0 -9
- data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +0 -195
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +0 -37
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_global-styles.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_spacing.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +0 -65
- data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +0 -10
- data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +0 -349
- data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss.map +0 -1
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +0 -25
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +0 -1
- data/spec/spec_helper.rb +0 -98
- data/spec/tasks/assets_spec.rb +0 -53
- data/vendor/assets/assets/manifest.json +0 -39
- data/vendor/assets/assets/rebrand/images/favicon.ico +0 -0
- data/vendor/assets/assets/rebrand/images/favicon.svg +0 -1
- data/vendor/assets/assets/rebrand/images/govuk-crest.svg +0 -1
- data/vendor/assets/assets/rebrand/images/govuk-icon-180.png +0 -0
- data/vendor/assets/assets/rebrand/images/govuk-icon-192.png +0 -0
- data/vendor/assets/assets/rebrand/images/govuk-icon-512.png +0 -0
- data/vendor/assets/assets/rebrand/images/govuk-icon-mask.svg +0 -1
- data/vendor/assets/assets/rebrand/images/govuk-opengraph-image.png +0 -0
- data/vendor/assets/assets/rebrand/manifest.json +0 -39
- data/vendor/assets/images/govuk-crest-2x.png +0 -0
- data/vendor/assets/images/govuk-crest.png +0 -0
- data/vendor/assets/stylesheets/all.scss +0 -9
- data/vendor/assets/stylesheets/components/_all.scss +0 -10
- data/vendor/assets/stylesheets/components/accordion/_accordion.scss +0 -4
- data/vendor/assets/stylesheets/components/back-link/_back-link.scss +0 -4
- data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +0 -4
- data/vendor/assets/stylesheets/components/button/_button.scss +0 -4
- data/vendor/assets/stylesheets/components/character-count/_character-count.scss +0 -4
- data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +0 -4
- data/vendor/assets/stylesheets/components/cookie-banner/_cookie-banner.scss +0 -4
- data/vendor/assets/stylesheets/components/date-input/_date-input.scss +0 -4
- data/vendor/assets/stylesheets/components/details/_details.scss +0 -4
- data/vendor/assets/stylesheets/components/error-message/_error-message.scss +0 -4
- data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +0 -4
- data/vendor/assets/stylesheets/components/exit-this-page/_exit-this-page.scss +0 -4
- data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +0 -4
- data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +0 -4
- data/vendor/assets/stylesheets/components/footer/_footer.scss +0 -4
- data/vendor/assets/stylesheets/components/header/_header.scss +0 -4
- data/vendor/assets/stylesheets/components/hint/_hint.scss +0 -4
- data/vendor/assets/stylesheets/components/input/_input.scss +0 -4
- data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +0 -4
- data/vendor/assets/stylesheets/components/label/_label.scss +0 -4
- data/vendor/assets/stylesheets/components/notification-banner/_notification-banner.scss +0 -4
- data/vendor/assets/stylesheets/components/pagination/_pagination.scss +0 -4
- data/vendor/assets/stylesheets/components/panel/_panel.scss +0 -4
- data/vendor/assets/stylesheets/components/password-input/_password-input.scss +0 -4
- data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +0 -4
- data/vendor/assets/stylesheets/components/radios/_radios.scss +0 -4
- data/vendor/assets/stylesheets/components/select/_select.scss +0 -4
- data/vendor/assets/stylesheets/components/service-navigation/_service-navigation.scss +0 -4
- data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +0 -4
- data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +0 -4
- data/vendor/assets/stylesheets/components/table/_table.scss +0 -4
- data/vendor/assets/stylesheets/components/tabs/_tabs.scss +0 -4
- data/vendor/assets/stylesheets/components/tag/_tag.scss +0 -4
- data/vendor/assets/stylesheets/components/task-list/_task-list.scss +0 -4
- data/vendor/assets/stylesheets/components/textarea/_textarea.scss +0 -4
- data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +0 -4
- data/vendor/assets/stylesheets/core/_all.scss +0 -10
- data/vendor/assets/stylesheets/core/_govuk-frontend-properties.scss +0 -12
- data/vendor/assets/stylesheets/helpers/_all.scss +0 -10
- data/vendor/assets/stylesheets/helpers/_font-faces.scss +0 -41
- data/vendor/assets/stylesheets/objects/_all.scss +0 -10
- data/vendor/assets/stylesheets/overrides/_all.scss +0 -9
- data/vendor/assets/stylesheets/settings/_all.scss +0 -10
- data/vendor/assets/stylesheets/settings/_colours-applied.scss +0 -195
- data/vendor/assets/stylesheets/settings/_colours-palette.scss +0 -37
- data/vendor/assets/stylesheets/tools/_all.scss +0 -10
- data/vendor/assets/stylesheets/tools/_rebrand.scss +0 -65
- data/vendor/assets/stylesheets/utilities/_all.scss +0 -10
- data/vendor/assets/stylesheets/vendor/_sass-mq.scss +0 -349
- /data/node_modules/govuk-frontend/dist/govuk/components/date-input/{template-complete-question.html → template-with-items.html} +0 -0
- /data/node_modules/govuk-frontend/dist/govuk/components/table/{template-table-with-head-and-caption.html → template-with-head-and-caption.html} +0 -0
- /data/node_modules/govuk-frontend/dist/govuk/components/table/{template-table-with-head.html → template-with-head.html} +0 -0
- /data/node_modules/govuk-frontend/dist/govuk/components/task-list/{template-example-with-very-long-single-word-tags.html → template-with-very-long-single-word-tags.html} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isObject } from './common/index.mjs';
|
|
2
|
+
|
|
1
3
|
class I18n {
|
|
2
4
|
constructor(translations = {}, config = {}) {
|
|
3
5
|
var _config$locale;
|
|
@@ -11,7 +13,7 @@ class I18n {
|
|
|
11
13
|
throw new Error('i18n: lookup key missing');
|
|
12
14
|
}
|
|
13
15
|
let translation = this.translations[lookupKey];
|
|
14
|
-
if (typeof (options == null ? void 0 : options.count) === 'number' &&
|
|
16
|
+
if (typeof (options == null ? void 0 : options.count) === 'number' && isObject(translation)) {
|
|
15
17
|
const translationPluralForm = translation[this.getPluralSuffix(lookupKey, options.count)];
|
|
16
18
|
if (translationPluralForm) {
|
|
17
19
|
translation = translationPluralForm;
|
|
@@ -53,8 +55,8 @@ class I18n {
|
|
|
53
55
|
return 'other';
|
|
54
56
|
}
|
|
55
57
|
const translation = this.translations[lookupKey];
|
|
56
|
-
const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) :
|
|
57
|
-
if (
|
|
58
|
+
const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : 'other';
|
|
59
|
+
if (isObject(translation)) {
|
|
58
60
|
if (preferredForm in translation) {
|
|
59
61
|
return preferredForm;
|
|
60
62
|
} else if ('other' in translation) {
|
|
@@ -64,132 +66,7 @@ class I18n {
|
|
|
64
66
|
}
|
|
65
67
|
throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
|
|
66
68
|
}
|
|
67
|
-
selectPluralFormUsingFallbackRules(count) {
|
|
68
|
-
count = Math.abs(Math.floor(count));
|
|
69
|
-
const ruleset = this.getPluralRulesForLocale();
|
|
70
|
-
if (ruleset) {
|
|
71
|
-
return I18n.pluralRules[ruleset](count);
|
|
72
|
-
}
|
|
73
|
-
return 'other';
|
|
74
|
-
}
|
|
75
|
-
getPluralRulesForLocale() {
|
|
76
|
-
const localeShort = this.locale.split('-')[0];
|
|
77
|
-
for (const pluralRule in I18n.pluralRulesMap) {
|
|
78
|
-
const languages = I18n.pluralRulesMap[pluralRule];
|
|
79
|
-
if (languages.includes(this.locale) || languages.includes(localeShort)) {
|
|
80
|
-
return pluralRule;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
69
|
}
|
|
85
|
-
I18n.pluralRulesMap = {
|
|
86
|
-
arabic: ['ar'],
|
|
87
|
-
chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
|
|
88
|
-
french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
|
|
89
|
-
german: ['af', 'sq', 'az', 'eu', 'bg', 'ca', 'da', 'nl', 'en', 'et', 'fi', 'ka', 'de', 'el', 'hu', 'lb', 'no', 'so', 'sw', 'sv', 'ta', 'te', 'tr', 'ur'],
|
|
90
|
-
irish: ['ga'],
|
|
91
|
-
russian: ['ru', 'uk'],
|
|
92
|
-
scottish: ['gd'],
|
|
93
|
-
spanish: ['pt-PT', 'it', 'es'],
|
|
94
|
-
welsh: ['cy']
|
|
95
|
-
};
|
|
96
|
-
I18n.pluralRules = {
|
|
97
|
-
arabic(n) {
|
|
98
|
-
if (n === 0) {
|
|
99
|
-
return 'zero';
|
|
100
|
-
}
|
|
101
|
-
if (n === 1) {
|
|
102
|
-
return 'one';
|
|
103
|
-
}
|
|
104
|
-
if (n === 2) {
|
|
105
|
-
return 'two';
|
|
106
|
-
}
|
|
107
|
-
if (n % 100 >= 3 && n % 100 <= 10) {
|
|
108
|
-
return 'few';
|
|
109
|
-
}
|
|
110
|
-
if (n % 100 >= 11 && n % 100 <= 99) {
|
|
111
|
-
return 'many';
|
|
112
|
-
}
|
|
113
|
-
return 'other';
|
|
114
|
-
},
|
|
115
|
-
chinese() {
|
|
116
|
-
return 'other';
|
|
117
|
-
},
|
|
118
|
-
french(n) {
|
|
119
|
-
return n === 0 || n === 1 ? 'one' : 'other';
|
|
120
|
-
},
|
|
121
|
-
german(n) {
|
|
122
|
-
return n === 1 ? 'one' : 'other';
|
|
123
|
-
},
|
|
124
|
-
irish(n) {
|
|
125
|
-
if (n === 1) {
|
|
126
|
-
return 'one';
|
|
127
|
-
}
|
|
128
|
-
if (n === 2) {
|
|
129
|
-
return 'two';
|
|
130
|
-
}
|
|
131
|
-
if (n >= 3 && n <= 6) {
|
|
132
|
-
return 'few';
|
|
133
|
-
}
|
|
134
|
-
if (n >= 7 && n <= 10) {
|
|
135
|
-
return 'many';
|
|
136
|
-
}
|
|
137
|
-
return 'other';
|
|
138
|
-
},
|
|
139
|
-
russian(n) {
|
|
140
|
-
const lastTwo = n % 100;
|
|
141
|
-
const last = lastTwo % 10;
|
|
142
|
-
if (last === 1 && lastTwo !== 11) {
|
|
143
|
-
return 'one';
|
|
144
|
-
}
|
|
145
|
-
if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {
|
|
146
|
-
return 'few';
|
|
147
|
-
}
|
|
148
|
-
if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {
|
|
149
|
-
return 'many';
|
|
150
|
-
}
|
|
151
|
-
return 'other';
|
|
152
|
-
},
|
|
153
|
-
scottish(n) {
|
|
154
|
-
if (n === 1 || n === 11) {
|
|
155
|
-
return 'one';
|
|
156
|
-
}
|
|
157
|
-
if (n === 2 || n === 12) {
|
|
158
|
-
return 'two';
|
|
159
|
-
}
|
|
160
|
-
if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {
|
|
161
|
-
return 'few';
|
|
162
|
-
}
|
|
163
|
-
return 'other';
|
|
164
|
-
},
|
|
165
|
-
spanish(n) {
|
|
166
|
-
if (n === 1) {
|
|
167
|
-
return 'one';
|
|
168
|
-
}
|
|
169
|
-
if (n % 1000000 === 0 && n !== 0) {
|
|
170
|
-
return 'many';
|
|
171
|
-
}
|
|
172
|
-
return 'other';
|
|
173
|
-
},
|
|
174
|
-
welsh(n) {
|
|
175
|
-
if (n === 0) {
|
|
176
|
-
return 'zero';
|
|
177
|
-
}
|
|
178
|
-
if (n === 1) {
|
|
179
|
-
return 'one';
|
|
180
|
-
}
|
|
181
|
-
if (n === 2) {
|
|
182
|
-
return 'two';
|
|
183
|
-
}
|
|
184
|
-
if (n === 3) {
|
|
185
|
-
return 'few';
|
|
186
|
-
}
|
|
187
|
-
if (n === 6) {
|
|
188
|
-
return 'many';
|
|
189
|
-
}
|
|
190
|
-
return 'other';
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
70
|
|
|
194
71
|
export { I18n };
|
|
195
72
|
//# sourceMappingURL=i18n.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.mjs","sources":["../../src/govuk/i18n.mjs"],"sourcesContent":["/**\n * Internal support for selecting messages to render, with placeholder\n * interpolation and locale-aware number formatting and pluralisation\n *\n * @internal\n */\nexport class I18n {\n translations\n locale\n\n /**\n * @internal\n * @param {{ [key: string]: string | TranslationPluralForms }} translations - Key-value pairs of the translation strings to use.\n * @param {object} [config] - Configuration options for the function.\n * @param {string | null} [config.locale] - An overriding locale for the PluralRules functionality.\n */\n constructor(translations = {}, config = {}) {\n // Make list of translations available throughout function\n this.translations = translations\n\n // The locale to use for PluralRules and NumberFormat\n this.locale = config.locale ?? (document.documentElement.lang || 'en')\n }\n\n /**\n * The most used function - takes the key for a given piece of UI text and\n * returns the appropriate string.\n *\n * @internal\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {{ [key: string]: unknown }} [options] - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The appropriate translation string.\n * @throws {Error} Lookup key required\n * @throws {Error} Options required for `${}` placeholders\n */\n t(lookupKey, options) {\n if (!lookupKey) {\n // Print a console error if no lookup key has been provided\n throw new Error('i18n: lookup key missing')\n }\n\n // Fetch the translation for that lookup key\n let translation = this.translations[lookupKey]\n\n // If the `count` option is set, determine which plural suffix is needed and\n // change the lookupKey to match. We check to see if it's numeric instead of\n // falsy, as this could legitimately be 0.\n if (typeof options?.count === 'number' && typeof translation === 'object') {\n const translationPluralForm =\n translation[this.getPluralSuffix(lookupKey, options.count)]\n\n // Update translation with plural suffix\n if (translationPluralForm) {\n translation = translationPluralForm\n }\n }\n\n if (typeof translation === 'string') {\n // Check for ${} placeholders in the translation string\n if (translation.match(/%{(.\\S+)}/)) {\n if (!options) {\n throw new Error(\n 'i18n: cannot replace placeholders in string if no option data provided'\n )\n }\n\n return this.replacePlaceholders(translation, options)\n }\n\n return translation\n }\n\n // If the key wasn't found in our translations object,\n // return the lookup key itself as the fallback\n return lookupKey\n }\n\n /**\n * Takes a translation string with placeholders, and replaces the placeholders\n * with the provided data\n *\n * @internal\n * @param {string} translationString - The translation string\n * @param {{ [key: string]: unknown }} options - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The translation string to output, with $\\{\\} placeholders replaced\n */\n replacePlaceholders(translationString, options) {\n const formatter = Intl.NumberFormat.supportedLocalesOf(this.locale).length\n ? new Intl.NumberFormat(this.locale)\n : undefined\n\n return translationString.replace(\n /%{(.\\S+)}/g,\n\n /**\n * Replace translation string placeholders\n *\n * @internal\n * @param {string} placeholderWithBraces - Placeholder with braces\n * @param {string} placeholderKey - Placeholder key\n * @returns {string} Placeholder value\n */\n function (placeholderWithBraces, placeholderKey) {\n if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {\n const placeholderValue = options[placeholderKey]\n\n // If a user has passed `false` as the value for the placeholder\n // treat it as though the value should not be displayed\n if (\n placeholderValue === false ||\n (typeof placeholderValue !== 'number' &&\n typeof placeholderValue !== 'string')\n ) {\n return ''\n }\n\n // If the placeholder's value is a number, localise the number formatting\n if (typeof placeholderValue === 'number') {\n return formatter\n ? formatter.format(placeholderValue)\n : `${placeholderValue}`\n }\n\n return placeholderValue\n }\n\n throw new Error(\n `i18n: no data found to replace ${placeholderWithBraces} placeholder in string`\n )\n }\n )\n }\n\n /**\n * Check to see if the browser supports Intl.PluralRules\n *\n * It requires all conditions to be met in order to be supported:\n * - The implementation of Intl supports PluralRules (NOT true in Safari 10–12)\n * - The browser/OS has plural rules for the current locale (browser dependent)\n *\n * {@link https://browsersl.ist/#q=supports+es6-module+and+not+supports+intl-pluralrules}\n *\n * @internal\n * @returns {boolean} Returns true if all conditions are met. Returns false otherwise.\n */\n hasIntlPluralRulesSupport() {\n return Boolean(\n 'PluralRules' in window.Intl &&\n Intl.PluralRules.supportedLocalesOf(this.locale).length\n )\n }\n\n /**\n * Get the appropriate suffix for the plural form.\n *\n * Uses Intl.PluralRules (or our own fallback implementation) to get the\n * 'preferred' form to use for the given count.\n *\n * Checks that a translation has been provided for that plural form – if it\n * hasn't, it'll fall back to the 'other' plural form (unless that doesn't exist\n * either, in which case an error will be thrown)\n *\n * @internal\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {number} count - Number used to determine which pluralisation to use.\n * @returns {PluralRule} The suffix associated with the correct pluralisation for this locale.\n * @throws {Error} Plural form `.other` required when preferred plural form is missing\n */\n getPluralSuffix(lookupKey, count) {\n // Validate that the number is actually a number.\n //\n // Number(count) will turn anything that can't be converted to a Number type\n // into 'NaN'. isFinite filters out NaN, as it isn't a finite number.\n count = Number(count)\n if (!isFinite(count)) {\n return 'other'\n }\n\n // Fetch the translation for that lookup key\n const translation = this.translations[lookupKey]\n\n // Check to verify that all the requirements for Intl.PluralRules are met.\n // If so, we can use that instead of our custom implementation. Otherwise,\n // use the hardcoded fallback.\n const preferredForm = this.hasIntlPluralRulesSupport()\n ? new Intl.PluralRules(this.locale).select(count)\n : this.selectPluralFormUsingFallbackRules(count)\n\n // Use the correct plural form if provided\n if (typeof translation === 'object') {\n if (preferredForm in translation) {\n return preferredForm\n // Fall back to `other` if the plural form is missing, but log a warning\n // to the console\n } else if ('other' in translation) {\n console.warn(\n `i18n: Missing plural form \".${preferredForm}\" for \"${this.locale}\" locale. Falling back to \".other\".`\n )\n\n return 'other'\n }\n }\n\n // If the required `other` plural form is missing, all we can do is error\n throw new Error(\n `i18n: Plural form \".other\" is required for \"${this.locale}\" locale`\n )\n }\n\n /**\n * Get the plural form using our fallback implementation\n *\n * This is split out into a separate function to make it easier to test the\n * fallback behaviour in an environment where Intl.PluralRules exists.\n *\n * @internal\n * @param {number} count - Number used to determine which pluralisation to use.\n * @returns {PluralRule} The pluralisation form for count in this locale.\n */\n selectPluralFormUsingFallbackRules(count) {\n // Currently our custom code can only handle positive integers, so let's\n // make sure our number is one of those.\n count = Math.abs(Math.floor(count))\n\n const ruleset = this.getPluralRulesForLocale()\n\n if (ruleset) {\n return I18n.pluralRules[ruleset](count)\n }\n\n return 'other'\n }\n\n /**\n * Work out which pluralisation rules to use for the current locale\n *\n * The locale may include a regional indicator (such as en-GB), but we don't\n * usually care about this part, as pluralisation rules are usually the same\n * regardless of region. There are exceptions, however, (e.g. Portuguese) so\n * this searches by both the full and shortened locale codes, just to be sure.\n *\n * @internal\n * @returns {string | undefined} The name of the pluralisation rule to use (a key for one\n * of the functions in this.pluralRules)\n */\n getPluralRulesForLocale() {\n const localeShort = this.locale.split('-')[0]\n\n // Look through the plural rules map to find which `pluralRule` is\n // appropriate for our current `locale`.\n for (const pluralRule in I18n.pluralRulesMap) {\n const languages = I18n.pluralRulesMap[pluralRule]\n if (languages.includes(this.locale) || languages.includes(localeShort)) {\n return pluralRule\n }\n }\n }\n\n /**\n * Map of plural rules to languages where those rules apply.\n *\n * Note: These groups are named for the most dominant or recognisable language\n * that uses each system. The groupings do not imply that the languages are\n * related to one another. Many languages have evolved the same systems\n * independently of one another.\n *\n * Code to support more languages can be found in the i18n spike:\n * {@link https://github.com/alphagov/govuk-frontend/blob/spike-i18n-support/src/govuk/i18n.mjs}\n *\n * Languages currently supported:\n *\n * Arabic: Arabic (ar)\n * Chinese: Burmese (my), Chinese (zh), Indonesian (id), Japanese (ja),\n * Javanese (jv), Korean (ko), Malay (ms), Thai (th), Vietnamese (vi)\n * French: Armenian (hy), Bangla (bn), French (fr), Gujarati (gu), Hindi (hi),\n * Persian Farsi (fa), Punjabi (pa), Zulu (zu)\n * German: Afrikaans (af), Albanian (sq), Azerbaijani (az), Basque (eu),\n * Bulgarian (bg), Catalan (ca), Danish (da), Dutch (nl), English (en),\n * Estonian (et), Finnish (fi), Georgian (ka), German (de), Greek (el),\n * Hungarian (hu), Luxembourgish (lb), Norwegian (no), Somali (so),\n * Swahili (sw), Swedish (sv), Tamil (ta), Telugu (te), Turkish (tr),\n * Urdu (ur)\n * Irish: Irish Gaelic (ga)\n * Russian: Russian (ru), Ukrainian (uk)\n * Scottish: Scottish Gaelic (gd)\n * Spanish: European Portuguese (pt-PT), Italian (it), Spanish (es)\n * Welsh: Welsh (cy)\n *\n * @internal\n * @type {{ [key: string]: string[] }}\n */\n static pluralRulesMap = {\n arabic: ['ar'],\n chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],\n french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],\n german: [\n 'af',\n 'sq',\n 'az',\n 'eu',\n 'bg',\n 'ca',\n 'da',\n 'nl',\n 'en',\n 'et',\n 'fi',\n 'ka',\n 'de',\n 'el',\n 'hu',\n 'lb',\n 'no',\n 'so',\n 'sw',\n 'sv',\n 'ta',\n 'te',\n 'tr',\n 'ur'\n ],\n irish: ['ga'],\n russian: ['ru', 'uk'],\n scottish: ['gd'],\n spanish: ['pt-PT', 'it', 'es'],\n welsh: ['cy']\n }\n\n /**\n * Different pluralisation rule sets\n *\n * Returns the appropriate suffix for the plural form associated with `n`.\n * Possible suffixes: 'zero', 'one', 'two', 'few', 'many', 'other' (the actual\n * meaning of each differs per locale). 'other' should always exist, even in\n * languages without plurals, such as Chinese.\n * {@link https://cldr.unicode.org/index/cldr-spec/plural-rules}\n *\n * The count must be a positive integer. Negative numbers and decimals aren't accounted for\n *\n * @internal\n * @type {{ [key: string]: (count: number) => PluralRule }}\n */\n static pluralRules = {\n arabic(n) {\n if (n === 0) {\n return 'zero'\n }\n if (n === 1) {\n return 'one'\n }\n if (n === 2) {\n return 'two'\n }\n if (n % 100 >= 3 && n % 100 <= 10) {\n return 'few'\n }\n if (n % 100 >= 11 && n % 100 <= 99) {\n return 'many'\n }\n return 'other'\n },\n chinese() {\n return 'other'\n },\n french(n) {\n return n === 0 || n === 1 ? 'one' : 'other'\n },\n german(n) {\n return n === 1 ? 'one' : 'other'\n },\n irish(n) {\n if (n === 1) {\n return 'one'\n }\n if (n === 2) {\n return 'two'\n }\n if (n >= 3 && n <= 6) {\n return 'few'\n }\n if (n >= 7 && n <= 10) {\n return 'many'\n }\n return 'other'\n },\n russian(n) {\n const lastTwo = n % 100\n const last = lastTwo % 10\n if (last === 1 && lastTwo !== 11) {\n return 'one'\n }\n if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {\n return 'few'\n }\n if (\n last === 0 ||\n (last >= 5 && last <= 9) ||\n (lastTwo >= 11 && lastTwo <= 14)\n ) {\n return 'many'\n }\n // Note: The 'other' suffix is only used by decimal numbers in Russian.\n // We don't anticipate it being used, but it's here for consistency.\n return 'other'\n },\n scottish(n) {\n if (n === 1 || n === 11) {\n return 'one'\n }\n if (n === 2 || n === 12) {\n return 'two'\n }\n if ((n >= 3 && n <= 10) || (n >= 13 && n <= 19)) {\n return 'few'\n }\n return 'other'\n },\n spanish(n) {\n if (n === 1) {\n return 'one'\n }\n if (n % 1000000 === 0 && n !== 0) {\n return 'many'\n }\n return 'other'\n },\n welsh(n) {\n if (n === 0) {\n return 'zero'\n }\n if (n === 1) {\n return 'one'\n }\n if (n === 2) {\n return 'two'\n }\n if (n === 3) {\n return 'few'\n }\n if (n === 6) {\n return 'many'\n }\n return 'other'\n }\n }\n}\n\n/**\n * Plural rule category mnemonic tags\n *\n * @internal\n * @typedef {'zero' | 'one' | 'two' | 'few' | 'many' | 'other'} PluralRule\n */\n\n/**\n * Translated message by plural rule they correspond to.\n *\n * Allows to group pluralised messages under a single key when passing\n * translations to a component's constructor\n *\n * @internal\n * @typedef {object} TranslationPluralForms\n * @property {string} [other] - General plural form\n * @property {string} [zero] - Plural form used with 0\n * @property {string} [one] - Plural form used with 1\n * @property {string} [two] - Plural form used with 2\n * @property {string} [few] - Plural form used for a few\n * @property {string} [many] - Plural form used for many\n */\n"],"names":["I18n","constructor","translations","config","_config$locale","locale","document","documentElement","lang","t","lookupKey","options","Error","translation","count","translationPluralForm","getPluralSuffix","match","replacePlaceholders","translationString","formatter","Intl","NumberFormat","supportedLocalesOf","length","undefined","replace","placeholderWithBraces","placeholderKey","Object","prototype","hasOwnProperty","call","placeholderValue","format","hasIntlPluralRulesSupport","Boolean","window","PluralRules","Number","isFinite","preferredForm","select","selectPluralFormUsingFallbackRules","console","warn","Math","abs","floor","ruleset","getPluralRulesForLocale","pluralRules","localeShort","split","pluralRule","pluralRulesMap","languages","includes","arabic","chinese","french","german","irish","russian","scottish","spanish","welsh","n","lastTwo","last"],"mappings":"AAMO,MAAMA,IAAI,CAAC;EAUhBC,WAAWA,CAACC,YAAY,GAAG,EAAE,EAAEC,MAAM,GAAG,EAAE,EAAE;AAAA,IAAA,IAAAC,cAAA;AAAA,IAAA,IAAA,CAT5CF,YAAY,GAAA,MAAA;AAAA,IAAA,IAAA,CACZG,MAAM,GAAA,MAAA;IAUJ,IAAI,CAACH,YAAY,GAAGA,YAAY;AAGhC,IAAA,IAAI,CAACG,MAAM,GAAA,CAAAD,cAAA,GAAGD,MAAM,CAACE,MAAM,KAAAD,IAAAA,GAAAA,cAAA,GAAKE,QAAQ,CAACC,eAAe,CAACC,IAAI,IAAI,IAAK;AACxE;AAaAC,EAAAA,CAACA,CAACC,SAAS,EAAEC,OAAO,EAAE;IACpB,IAAI,CAACD,SAAS,EAAE;AAEd,MAAA,MAAM,IAAIE,KAAK,CAAC,0BAA0B,CAAC;AAC7C;AAGA,IAAA,IAAIC,WAAW,GAAG,IAAI,CAACX,YAAY,CAACQ,SAAS,CAAC;AAK9C,IAAA,IAAI,QAAOC,OAAO,IAAPA,IAAAA,GAAAA,MAAAA,GAAAA,OAAO,CAAEG,KAAK,CAAK,KAAA,QAAQ,IAAI,OAAOD,WAAW,KAAK,QAAQ,EAAE;AACzE,MAAA,MAAME,qBAAqB,GACzBF,WAAW,CAAC,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A,CAAC,IAAI,EAAE,IAAMA,CAAC,IAAI,EAAE,IAAIA,CAAC,IAAI,EAAG,EAAE;AAC/C,MAAA,OAAO,KAAK;AACd;AACA,IAAA,OAAO,OAAO;GACf;EACDF,OAAOA,CAACE,CAAC,EAAE;IACT,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK;AACd;IACA,IAAIA,CAAC,GAAG,OAAO,KAAK,CAAC,IAAIA,CAAC,KAAK,CAAC,EAAE;AAChC,MAAA,OAAO,MAAM;AACf;AACA,IAAA,OAAO,OAAO;GACf;EACDD,KAAKA,CAACC,CAAC,EAAE;IACP,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,MAAM;AACf;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK;AACd;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK;AACd;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,KAAK;AACd;IACA,IAAIA,CAAC,KAAK,CAAC,EAAE;AACX,MAAA,OAAO,MAAM;AACf;AACA,IAAA,OAAO,OAAO;AAChB;AACF,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"i18n.mjs","sources":["../../src/govuk/i18n.mjs"],"sourcesContent":["import { isObject } from './common/index.mjs'\n\n/**\n * Internal support for selecting messages to render, with placeholder\n * interpolation and locale-aware number formatting and pluralisation\n *\n * @internal\n */\nexport class I18n {\n translations\n locale\n\n /**\n * @internal\n * @param {{ [key: string]: string | TranslationPluralForms }} translations - Key-value pairs of the translation strings to use.\n * @param {object} [config] - Configuration options for the function.\n * @param {string | null} [config.locale] - An overriding locale for the PluralRules functionality.\n */\n constructor(translations = {}, config = {}) {\n // Make list of translations available throughout function\n this.translations = translations\n\n // The locale to use for PluralRules and NumberFormat\n this.locale = config.locale ?? (document.documentElement.lang || 'en')\n }\n\n /**\n * The most used function - takes the key for a given piece of UI text and\n * returns the appropriate string.\n *\n * @internal\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {{ [key: string]: unknown }} [options] - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The appropriate translation string.\n * @throws {Error} Lookup key required\n * @throws {Error} Options required for `${}` placeholders\n */\n t(lookupKey, options) {\n if (!lookupKey) {\n // Print a console error if no lookup key has been provided\n throw new Error('i18n: lookup key missing')\n }\n\n // Fetch the translation for that lookup key\n let translation = this.translations[lookupKey]\n\n // If the `count` option is set, determine which plural suffix is needed and\n // change the lookupKey to match. We check to see if it's numeric instead of\n // falsy, as this could legitimately be 0.\n if (typeof options?.count === 'number' && isObject(translation)) {\n const translationPluralForm =\n translation[this.getPluralSuffix(lookupKey, options.count)]\n\n // Update translation with plural suffix\n if (translationPluralForm) {\n translation = translationPluralForm\n }\n }\n\n if (typeof translation === 'string') {\n // Check for ${} placeholders in the translation string\n // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec\n if (translation.match(/%{(.\\S+)}/)) {\n if (!options) {\n throw new Error(\n 'i18n: cannot replace placeholders in string if no option data provided'\n )\n }\n\n return this.replacePlaceholders(translation, options)\n }\n\n return translation\n }\n\n // If the key wasn't found in our translations object,\n // return the lookup key itself as the fallback\n return lookupKey\n }\n\n /**\n * Takes a translation string with placeholders, and replaces the placeholders\n * with the provided data\n *\n * @internal\n * @param {string} translationString - The translation string\n * @param {{ [key: string]: unknown }} options - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The translation string to output, with $\\{\\} placeholders replaced\n */\n replacePlaceholders(translationString, options) {\n const formatter = Intl.NumberFormat.supportedLocalesOf(this.locale).length\n ? new Intl.NumberFormat(this.locale)\n : undefined\n\n return translationString.replace(\n /%{(.\\S+)}/g,\n\n /**\n * Replace translation string placeholders\n *\n * @internal\n * @param {string} placeholderWithBraces - Placeholder with braces\n * @param {string} placeholderKey - Placeholder key\n * @returns {string} Placeholder value\n */\n function (placeholderWithBraces, placeholderKey) {\n if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {\n const placeholderValue = options[placeholderKey]\n\n // If a user has passed `false` as the value for the placeholder\n // treat it as though the value should not be displayed\n if (\n placeholderValue === false ||\n (typeof placeholderValue !== 'number' &&\n typeof placeholderValue !== 'string')\n ) {\n return ''\n }\n\n // If the placeholder's value is a number, localise the number formatting\n if (typeof placeholderValue === 'number') {\n return formatter\n ? formatter.format(placeholderValue)\n : `${placeholderValue}`\n }\n\n return placeholderValue\n }\n\n throw new Error(\n `i18n: no data found to replace ${placeholderWithBraces} placeholder in string`\n )\n }\n )\n }\n\n /**\n * Check to see if the browser supports Intl.PluralRules\n *\n * It requires all conditions to be met in order to be supported:\n * - The implementation of Intl supports PluralRules (NOT true in Safari 10–12)\n * - The browser/OS has plural rules for the current locale (browser dependent)\n *\n * {@link https://browsersl.ist/#q=supports+es6-module+and+not+supports+intl-pluralrules}\n *\n * @internal\n * @returns {boolean} Returns true if all conditions are met. Returns false otherwise.\n */\n hasIntlPluralRulesSupport() {\n return Boolean(\n 'PluralRules' in window.Intl &&\n Intl.PluralRules.supportedLocalesOf(this.locale).length\n )\n }\n\n /**\n * Get the appropriate suffix for the plural form.\n *\n * Uses Intl.PluralRules (or our own fallback implementation) to get the\n * 'preferred' form to use for the given count.\n *\n * Checks that a translation has been provided for that plural form – if it\n * hasn't, it'll fall back to the 'other' plural form (unless that doesn't exist\n * either, in which case an error will be thrown)\n *\n * @internal\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {number} count - Number used to determine which pluralisation to use.\n * @returns {PluralRule} The suffix associated with the correct pluralisation for this locale.\n * @throws {Error} Plural form `.other` required when preferred plural form is missing\n */\n getPluralSuffix(lookupKey, count) {\n // Validate that the number is actually a number.\n //\n // Number(count) will turn anything that can't be converted to a Number type\n // into 'NaN'. isFinite filters out NaN, as it isn't a finite number.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion\n count = Number(count)\n if (!isFinite(count)) {\n return 'other'\n }\n\n // Fetch the translation for that lookup key\n const translation = this.translations[lookupKey]\n\n // Check to verify that all the requirements for Intl.PluralRules are met.\n // If so, we can use that instead of our custom implementation. Otherwise,\n // use the hardcoded fallback.\n const preferredForm = this.hasIntlPluralRulesSupport()\n ? new Intl.PluralRules(this.locale).select(count)\n : 'other'\n\n // Use the correct plural form if provided\n if (isObject(translation)) {\n if (preferredForm in translation) {\n return preferredForm\n // Fall back to `other` if the plural form is missing, but log a warning\n // to the console\n } else if ('other' in translation) {\n console.warn(\n `i18n: Missing plural form \".${preferredForm}\" for \"${this.locale}\" locale. Falling back to \".other\".`\n )\n\n return 'other'\n }\n }\n\n // If the required `other` plural form is missing, all we can do is error\n throw new Error(\n `i18n: Plural form \".other\" is required for \"${this.locale}\" locale`\n )\n }\n}\n\n/**\n * Plural rule category mnemonic tags\n *\n * @internal\n * @typedef {'zero' | 'one' | 'two' | 'few' | 'many' | 'other'} PluralRule\n */\n\n/**\n * Translated message by plural rule they correspond to.\n *\n * Allows to group pluralised messages under a single key when passing\n * translations to a component's constructor\n *\n * @internal\n * @typedef {object} TranslationPluralForms\n * @property {string} [other] - General plural form\n * @property {string} [zero] - Plural form used with 0\n * @property {string} [one] - Plural form used with 1\n * @property {string} [two] - Plural form used with 2\n * @property {string} [few] - Plural form used for a few\n * @property {string} [many] - Plural form used for many\n */\n"],"names":["I18n","constructor","translations","config","_config$locale","locale","document","documentElement","lang","t","lookupKey","options","Error","translation","count","isObject","translationPluralForm","getPluralSuffix","match","replacePlaceholders","translationString","formatter","Intl","NumberFormat","supportedLocalesOf","length","undefined","replace","placeholderWithBraces","placeholderKey","Object","prototype","hasOwnProperty","call","placeholderValue","format","hasIntlPluralRulesSupport","Boolean","window","PluralRules","Number","isFinite","preferredForm","select","console","warn"],"mappings":";;AAQO,MAAMA,IAAI,CAAC;EAUhBC,WAAWA,CAACC,YAAY,GAAG,EAAE,EAAEC,MAAM,GAAG,EAAE,EAAE;AAAA,IAAA,IAAAC,cAAA;AAAA,IAAA,IAAA,CAT5CF,YA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I,CAAC2B,QAAQ,CAAC3B,KAAK,CAAC,EAAE;AACpB,MAAA,OAAO,OAAO;AAChB,IAAA;AAGA,IAAA,MAAMD,WAAW,GAAG,IAAI,CAACX,YAAY,CAACQ,SAAS,CAAC;IAKhD,MAAMgC,aAAa,GAAG,IAAI,CAACN,yBAAyB,EAAE,GAClD,IAAId,IAAI,CAACiB,WAAW,CAAC,IAAI,CAAClC,MAAM,CAAC,CAACsC,MAAM,CAAC7B,KAAK,CAAC,GAC/C,OAAO;AAGX,IAAA,IAAIC,QAAQ,CAACF,WAAW,CAAC,EAAE;MACzB,IAAI6B,aAAa,IAAI7B,WAAW,EAAE;AAChC,QAAA,OAAO6B,aAAa;AAGtB,MAAA,CAAC,MAAM,IAAI,OAAO,IAAI7B,WAAW,EAAE;QACjC+B,OAAO,CAACC,IAAI,CACV,CAAA,4BAAA,EAA+BH,aAAa,UAAU,IAAI,CAACrC,MAAM,CAAA,mCAAA,CACnE,CAAC;AAED,QAAA,OAAO,OAAO;AAChB,MAAA;AACF,IAAA;IAGA,MAAM,IAAIO,KAAK,CACb,CAAA,4CAAA,EAA+C,IAAI,CAACP,MAAM,UAC5D,CAAC;AACH,EAAA;AACF;;;;"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
@
|
|
1
|
+
@forward "base";
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
@
|
|
3
|
+
@use "core";
|
|
4
|
+
@use "objects";
|
|
5
5
|
|
|
6
|
-
@
|
|
6
|
+
@use "components";
|
|
7
7
|
|
|
8
|
-
@
|
|
9
|
-
@
|
|
8
|
+
@use "utilities";
|
|
9
|
+
@use "overrides";
|
|
10
10
|
|
|
11
|
-
/*# sourceMappingURL=index.scss.map */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { normaliseOptions } from './common/configuration.mjs';
|
|
2
|
+
import { isSupported, isObject } from './common/index.mjs';
|
|
2
3
|
import { Accordion } from './components/accordion/accordion.mjs';
|
|
3
4
|
import { Button } from './components/button/button.mjs';
|
|
4
5
|
import { CharacterCount } from './components/character-count/character-count.mjs';
|
|
@@ -6,14 +7,13 @@ import { Checkboxes } from './components/checkboxes/checkboxes.mjs';
|
|
|
6
7
|
import { ErrorSummary } from './components/error-summary/error-summary.mjs';
|
|
7
8
|
import { ExitThisPage } from './components/exit-this-page/exit-this-page.mjs';
|
|
8
9
|
import { FileUpload } from './components/file-upload/file-upload.mjs';
|
|
9
|
-
import { Header } from './components/header/header.mjs';
|
|
10
10
|
import { NotificationBanner } from './components/notification-banner/notification-banner.mjs';
|
|
11
11
|
import { PasswordInput } from './components/password-input/password-input.mjs';
|
|
12
12
|
import { Radios } from './components/radios/radios.mjs';
|
|
13
13
|
import { ServiceNavigation } from './components/service-navigation/service-navigation.mjs';
|
|
14
14
|
import { SkipLink } from './components/skip-link/skip-link.mjs';
|
|
15
15
|
import { Tabs } from './components/tabs/tabs.mjs';
|
|
16
|
-
import { SupportError } from './errors/index.mjs';
|
|
16
|
+
import { SupportError, ElementError } from './errors/index.mjs';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Initialise all components
|
|
@@ -21,28 +21,34 @@ import { SupportError } from './errors/index.mjs';
|
|
|
21
21
|
* Use the `data-module` attributes to find, instantiate and init all of the
|
|
22
22
|
* components provided as part of GOV.UK Frontend.
|
|
23
23
|
*
|
|
24
|
-
* @param {Config
|
|
24
|
+
* @param {Config | Element | Document | null} [scopeOrConfig] - Scope of the document to search within or config for all components (with optional scope)
|
|
25
25
|
*/
|
|
26
|
-
function initAll(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
26
|
+
function initAll(scopeOrConfig = {}) {
|
|
27
|
+
const config = isObject(scopeOrConfig) ? scopeOrConfig : {};
|
|
28
|
+
const options = normaliseOptions(scopeOrConfig);
|
|
29
|
+
try {
|
|
30
|
+
if (!isSupported()) {
|
|
31
|
+
throw new SupportError();
|
|
32
|
+
}
|
|
33
|
+
if (options.scope === null) {
|
|
34
|
+
throw new ElementError({
|
|
35
|
+
element: options.scope,
|
|
36
|
+
identifier: 'GOV.UK Frontend scope element (`$scope`)'
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
} catch (error) {
|
|
40
|
+
if (options.onError) {
|
|
41
|
+
options.onError(error, {
|
|
32
42
|
config
|
|
33
43
|
});
|
|
34
44
|
} else {
|
|
35
|
-
console.log(
|
|
45
|
+
console.log(error);
|
|
36
46
|
}
|
|
37
47
|
return;
|
|
38
48
|
}
|
|
39
|
-
const components = [[Accordion, config.accordion], [Button, config.button], [CharacterCount, config.characterCount], [Checkboxes], [ErrorSummary, config.errorSummary], [ExitThisPage, config.exitThisPage], [FileUpload, config.fileUpload], [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
onError: config.onError
|
|
43
|
-
};
|
|
44
|
-
components.forEach(([Component, config]) => {
|
|
45
|
-
createAll(Component, config, options);
|
|
49
|
+
const components = [[Accordion, config.accordion], [Button, config.button], [CharacterCount, config.characterCount], [Checkboxes], [ErrorSummary, config.errorSummary], [ExitThisPage, config.exitThisPage], [FileUpload, config.fileUpload], [NotificationBanner, config.notificationBanner], [PasswordInput, config.passwordInput], [Radios], [ServiceNavigation], [SkipLink], [Tabs]];
|
|
50
|
+
components.forEach(([Component, componentConfig]) => {
|
|
51
|
+
createAll(Component, componentConfig, options);
|
|
46
52
|
});
|
|
47
53
|
}
|
|
48
54
|
|
|
@@ -58,42 +64,42 @@ function initAll(config) {
|
|
|
58
64
|
* @template {CompatibleClass} ComponentClass
|
|
59
65
|
* @param {ComponentClass} Component - class of the component to create
|
|
60
66
|
* @param {ComponentConfig<ComponentClass>} [config] - Config supplied to component
|
|
61
|
-
* @param {OnErrorCallback<ComponentClass> | Element | Document | CreateAllOptions<ComponentClass>
|
|
67
|
+
* @param {OnErrorCallback<ComponentClass> | Element | Document | null | CreateAllOptions<ComponentClass>} [scopeOrOptions] - options for createAll including scope of the document to search within and callback function if error throw by component on init
|
|
62
68
|
* @returns {Array<InstanceType<ComponentClass>>} - array of instantiated components
|
|
63
69
|
*/
|
|
64
|
-
function createAll(Component, config,
|
|
65
|
-
let $
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (onError) {
|
|
82
|
-
onError(
|
|
70
|
+
function createAll(Component, config, scopeOrOptions) {
|
|
71
|
+
let $elements;
|
|
72
|
+
const options = normaliseOptions(scopeOrOptions);
|
|
73
|
+
try {
|
|
74
|
+
var _options$scope;
|
|
75
|
+
if (!isSupported()) {
|
|
76
|
+
throw new SupportError();
|
|
77
|
+
}
|
|
78
|
+
if (options.scope === null) {
|
|
79
|
+
throw new ElementError({
|
|
80
|
+
element: options.scope,
|
|
81
|
+
component: Component,
|
|
82
|
+
identifier: 'Scope element (`$scope`)'
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
$elements = (_options$scope = options.scope) == null ? void 0 : _options$scope.querySelectorAll(`[data-module="${Component.moduleName}"]`);
|
|
86
|
+
} catch (error) {
|
|
87
|
+
if (options.onError) {
|
|
88
|
+
options.onError(error, {
|
|
83
89
|
component: Component,
|
|
84
90
|
config
|
|
85
91
|
});
|
|
86
92
|
} else {
|
|
87
|
-
console.log(
|
|
93
|
+
console.log(error);
|
|
88
94
|
}
|
|
89
95
|
return [];
|
|
90
96
|
}
|
|
91
|
-
return Array.from($elements).map($element => {
|
|
97
|
+
return Array.from($elements != null ? $elements : []).map($element => {
|
|
92
98
|
try {
|
|
93
99
|
return typeof config !== 'undefined' ? new Component($element, config) : new Component($element);
|
|
94
100
|
} catch (error) {
|
|
95
|
-
if (onError) {
|
|
96
|
-
onError(error, {
|
|
101
|
+
if (options.onError) {
|
|
102
|
+
options.onError(error, {
|
|
97
103
|
element: $element,
|
|
98
104
|
component: Component,
|
|
99
105
|
config
|
|
@@ -112,6 +118,8 @@ function createAll(Component, config, createAllOptions) {
|
|
|
112
118
|
* Config for all components via `initAll()`
|
|
113
119
|
*
|
|
114
120
|
* @typedef {object} Config
|
|
121
|
+
* @property {Element | Document | null} [scope] - Scope of the document to search within
|
|
122
|
+
* @property {OnErrorCallback<CompatibleClass>} [onError] - Initialisation error callback
|
|
115
123
|
* @property {AccordionConfig} [accordion] - Accordion config
|
|
116
124
|
* @property {ButtonConfig} [button] - Button config
|
|
117
125
|
* @property {CharacterCountConfig} [characterCount] - Character Count config
|
|
@@ -136,7 +144,7 @@ function createAll(Component, config, createAllOptions) {
|
|
|
136
144
|
/**
|
|
137
145
|
* Component config keys, e.g. `accordion` and `characterCount`
|
|
138
146
|
*
|
|
139
|
-
* @typedef {keyof Config} ConfigKey
|
|
147
|
+
* @typedef {keyof Omit<Config, 'scope' | 'onError'>} ConfigKey
|
|
140
148
|
*/
|
|
141
149
|
/**
|
|
142
150
|
* @template {CompatibleClass} ComponentClass
|
|
@@ -147,7 +155,7 @@ function createAll(Component, config, createAllOptions) {
|
|
|
147
155
|
* @typedef {object} ErrorContext
|
|
148
156
|
* @property {Element} [element] - Element used for component module initialisation
|
|
149
157
|
* @property {ComponentClass} [component] - Class of component
|
|
150
|
-
* @property {ComponentConfig<ComponentClass>} config - Config supplied to
|
|
158
|
+
* @property {Config | ComponentConfig<ComponentClass>} [config] - Config supplied to components
|
|
151
159
|
*/
|
|
152
160
|
/**
|
|
153
161
|
* @template {CompatibleClass} ComponentClass
|
|
@@ -158,7 +166,7 @@ function createAll(Component, config, createAllOptions) {
|
|
|
158
166
|
/**
|
|
159
167
|
* @template {CompatibleClass} ComponentClass
|
|
160
168
|
* @typedef {object} CreateAllOptions
|
|
161
|
-
* @property {Element | Document} [scope] - scope of the document to search within
|
|
169
|
+
* @property {Element | Document | null} [scope] - scope of the document to search within
|
|
162
170
|
* @property {OnErrorCallback<ComponentClass>} [onError] - callback function if error throw by component on init
|
|
163
171
|
*/
|
|
164
172
|
|
|
@@ -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 { 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":";;;;;;;;;;;;;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAOA,CAACC,MAAM,EAAE;AAAA,EAAA,IAAAC,aAAA;EACvBD,MAAM,GAAG,OAAOA,MAAM,KAAK,WAAW,GAAGA,MAAM,GAAG,EAAE;AAGpD,EAAA,IAAI,CAACE,WAAW,EAAE,EAAE;IAClB,IAAIF,MAAM,CAACG,OAAO,EAAE;AAClBH,MAAAA,MAAM,CAACG,OAAO,CAAC,IAAIC,YAAY,EAAE,EAAE;AACjCJ,QAAAA;AACF,OAAC,CAAC;AACJ,KAAC,MAAM;AACLK,MAAAA,OAAO,CAACC,GAAG,CAAC,IAAIF,YAA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;AACF,SAAC,CAAC;AACJ,OAAC,MAAM;AACLK,QAAAA,OAAO,CAACC,GAAG,CAAC0C,KAAK,CAAC;AACpB;AAEA,MAAA,OAAO,IAAI;AACb;AACF,GAAC,CAAC,CACDE,MAAM,CAACC,OAAO,CAAC;AACpB;AAUA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"init.mjs","sources":["../../src/govuk/init.mjs"],"sourcesContent":["import { normaliseOptions } from './common/configuration.mjs'\nimport { isObject, 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 { 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 { ElementError, 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 | Element | Document | null} [scopeOrConfig] - Scope of the document to search within or config for all components (with optional scope)\n */\nfunction initAll(scopeOrConfig = {}) {\n const config = isObject(scopeOrConfig) ? scopeOrConfig : {}\n\n // Extract initialisation options\n const options = normaliseOptions(scopeOrConfig)\n\n try {\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n throw new SupportError()\n }\n\n // Users can initialise GOV.UK Frontend in certain sections of the page\n // unless the scope is null (for example, query selector not found)\n if (options.scope === null) {\n throw new ElementError({\n element: options.scope,\n identifier: 'GOV.UK Frontend scope element (`$scope`)'\n })\n }\n } catch (error) {\n if (options.onError) {\n options.onError(error, {\n config\n })\n } else {\n console.log(error)\n }\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 [NotificationBanner, config.notificationBanner],\n [PasswordInput, config.passwordInput],\n [Radios],\n [ServiceNavigation],\n [SkipLink],\n [Tabs]\n ])\n\n components.forEach(([Component, componentConfig]) => {\n createAll(Component, componentConfig, 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 | null | CreateAllOptions<ComponentClass>} [scopeOrOptions] - 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, scopeOrOptions) {\n let /** @type {NodeListOf<Element> | undefined} */ $elements\n\n // Extract initialisation options\n const options = normaliseOptions(scopeOrOptions)\n\n try {\n // Skip initialisation when GOV.UK Frontend is not supported\n if (!isSupported()) {\n throw new SupportError()\n }\n\n // Users can initialise GOV.UK Frontend in certain sections of the page\n // unless the scope is null (for example, query selector not found)\n if (options.scope === null) {\n throw new ElementError({\n element: options.scope,\n component: Component,\n identifier: 'Scope element (`$scope`)'\n })\n }\n\n $elements = options.scope?.querySelectorAll(\n `[data-module=\"${Component.moduleName}\"]`\n )\n } catch (error) {\n if (options.onError) {\n options.onError(error, {\n component: Component,\n config\n })\n } else {\n console.log(error)\n }\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 (options.onError) {\n options.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 {Element | Document | null} [scope] - Scope of the document to search within\n * @property {OnErrorCallback<CompatibleClass>} [onError] - Initialisation error callback\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 Omit<Config, 'scope' | 'onError'>} 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 {Config | ComponentConfig<ComponentClass>} [config] - Config supplied to components\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 | null} [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","scopeOrConfig","config","isObject","options","normaliseOptions","isSupported","SupportError","scope","ElementError","element","identifier","error","onError","console","log","components","Accordion","accordion","Button","button","CharacterCount","characterCount","Checkboxes","ErrorSummary","errorSummary","ExitThisPage","exitThisPage","FileUpload","fileUpload","NotificationBanner","notificationBanner","PasswordInput","passwordInput","Radios","ServiceNavigation","SkipLink","Tabs","forEach","Component","componentConfig","createAll","scopeOrOptions","$elements","_options$scope","component","querySelectorAll","moduleName","Array","from","map","$element","filter","Boolean"],"mappings":";;;;;;;;;;;;;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAOA,CAACC,aAAa,GAAG,EAAE,EAAE;EACnC,MAAMC,MAAM,GAAGC,QAAQ,CAACF,aAAa,CAAC,GAAGA,aAAa,GAAG,EAAE;AAG3D,EAAA,MAAMG,OAAO,GAAGC,gBAAgB,CAACJ,aAAa,CAAC;EAE/C,IAAI;AAEF,IAAA,IAAI,CAACK,WAAW,EAAE,EAAE;MAClB,MAAM,IAAIC,YAAY,EAAE;AAC1B,IAAA;AAIA,IAAA,IAAIH,OAAO,CAACI,KAAK,KAAK,IAAI,EAAE;MAC1B,MAAM,IAAIC,YAAY,CAAC;QACrBC,OAAO,EAAEN,OAAO,CAACI,KAAK;AACtBG,QAAAA,UAAU,EAAE;AACd,OAAC,CAAC;AACJ,IAAA;EACF,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,IAAIR,OAAO,CAACS,OAAO,EAAE;AACnBT,MAAAA,OAAO,CAACS,OAAO,CAACD,KAAK,EAAE;AACrBV,QAAAA;AACF,OAAC,CAAC;AACJ,IAAA,CAAC,MAAM;AACLY,MAAAA,OAAO,CAACC,GAAG,CAACH,KAAK,CAAC;AACpB,IAAA;AAEA,IAAA;AACF,EAAA;AAEA,EAAA,MAAMI,UAAU,GAAyB,CACvC,CAACC,SAAS,EAAEf,MAAM,CAACgB,SAAS,CAAC,EAC7B,CAACC,MAAM,EAAEjB,MAAM,CAACkB,MAAM,CAAC,EACvB,CAACC,cAAc,EAAEnB,MAAM,CAACoB,cAAc,CAAC,EACvC,CAACC,UAAU,CAAC,EACZ,CAACC,YAAY,EAAEtB,MAAM,CAACuB,YAAY,CAAC,EACnC,CAACC,YAAY,EAAExB,MAAM,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ACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
|
@@ -62,30 +62,46 @@
|
|
|
62
62
|
@param {{ [attribute: string]: string | { value: string, optional?: boolean } } | string} attributes - Component attributes param
|
|
63
63
|
#}
|
|
64
64
|
{% macro govukAttributes(attributes) -%}
|
|
65
|
-
{#- Default attributes output -#}
|
|
65
|
+
{#- Default attributes output as string -#}
|
|
66
66
|
{% set attributesHtml = attributes if attributes is string else "" %}
|
|
67
67
|
|
|
68
|
-
{#-
|
|
69
|
-
{%- if attributes is
|
|
70
|
-
{%
|
|
71
|
-
{#- Detect if this is a `safe` filtered value. Just pass the value through if so. -#}
|
|
72
|
-
{#- https://github.com/alphagov/govuk-frontend/issues/4937 -#}
|
|
73
|
-
{% if value is mapping and not [undefined, null].includes(value.val) and value.length %}
|
|
74
|
-
{% set value = value.val %}
|
|
75
|
-
{% endif %}
|
|
68
|
+
{#- Default attributes output as `safe` filtered string -#}
|
|
69
|
+
{%- if attributes is escaped and attributes.val is string %}
|
|
70
|
+
{% set attributesHtml = attributes %}
|
|
76
71
|
|
|
72
|
+
{#- Append attribute name/value pairs -#}
|
|
73
|
+
{%- elif attributes is mapping and attributes is not escaped %}
|
|
74
|
+
{% for name, item in attributes %}
|
|
77
75
|
{#- Set default attribute options -#}
|
|
78
|
-
{% set options =
|
|
79
|
-
value:
|
|
76
|
+
{% set options = item if item is mapping and item is not escaped else {
|
|
77
|
+
value: item,
|
|
80
78
|
optional: false
|
|
81
79
|
} %}
|
|
82
80
|
|
|
81
|
+
{#- Remove values when not provided -#}
|
|
82
|
+
{%- if options.value in [undefined, null] %}
|
|
83
|
+
{% set value = null %}
|
|
84
|
+
{% set valueEscaped = "" %}
|
|
85
|
+
|
|
86
|
+
{#- Extract unescaped value when `safe` filtered -#}
|
|
87
|
+
{#- https://github.com/alphagov/govuk-frontend/issues/4937 -#}
|
|
88
|
+
{%- elif options.value is escaped %}
|
|
89
|
+
{% set value = options.value.val %}
|
|
90
|
+
{% set valueEscaped = options.value %}
|
|
91
|
+
|
|
92
|
+
{#- Otherwise assume escaping is necessary -#}
|
|
93
|
+
{#- https://github.com/alphagov/govuk-frontend/issues/4940 -#}
|
|
94
|
+
{%- else %}
|
|
95
|
+
{% set value = options.value %}
|
|
96
|
+
{% set valueEscaped = options.value | escape %}
|
|
97
|
+
{% endif %}
|
|
98
|
+
|
|
83
99
|
{#- Output ` name` only (no value) for boolean attributes -#}
|
|
84
|
-
{% if options.optional === true and
|
|
100
|
+
{% if options.optional === true and value === true %}
|
|
85
101
|
{% set attributesHtml = attributesHtml + " " + name | escape %}
|
|
86
102
|
{#- Skip optional empty attributes or output ` name="value"` pair by default -#}
|
|
87
|
-
{% elif (options.optional === true and not [undefined, null, false]
|
|
88
|
-
{% set attributesHtml = attributesHtml + " " + name | escape + '="' +
|
|
103
|
+
{% elif (options.optional === true and value not in [undefined, null, false]) or options.optional !== true %}
|
|
104
|
+
{% set attributesHtml = attributesHtml + " " + name | escape + '="' + valueEscaped + '"' %}
|
|
89
105
|
{% endif %}
|
|
90
106
|
{% endfor %}
|
|
91
107
|
{% endif -%}
|