defra_ruby_template 3.15.0 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +4 -0
- data/.rspec +1 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +16 -1
- data/Rakefile +44 -24
- data/app/views/layouts/defra_ruby_template.html.erb +7 -11
- data/lib/defra_ruby_template/version.rb +1 -1
- data/node_modules/.package-lock.json +3 -3
- data/node_modules/govuk-frontend/README.md +14 -13
- data/node_modules/govuk-frontend/dist/govuk/_base.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/_base.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +2457 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +2435 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.mjs +15 -0
- data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -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-icon-mask.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/manifest.json +39 -0
- data/node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs +7 -0
- data/node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +4 -0
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +139 -0
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs +18 -0
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs +31 -0
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +366 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +729 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +721 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +368 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/fixtures.json +359 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/macro-options.json +142 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-default.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-additional-descriptions.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-all-sections-already-open.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-focusable-elements-inside.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-long-content-and-description.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-one-section-open.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template-with-translations.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template.njk +67 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +83 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/fixtures.json +87 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-default.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-inverse.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/template-with-custom-text.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +134 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/fixtures.json +240 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/macro-options.json +52 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-default.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-inverse.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-collapse-on-mobile.html +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-last-breadcrumb-as-current-page.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-multiple-levels.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-with-one-level.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-without-the-home-section.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template.njk +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +262 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +252 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +244 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +83 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +474 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +80 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-input-disabled.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-input.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-link.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-start.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-link.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-prevent-double-click.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-link.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-start-link.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-start.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-link.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-with-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template.njk +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +695 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +687 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +304 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +398 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +199 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-default.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-custom-rows.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-custom-textarea-description.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-default-value-exceeding-limit.html +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-default-value.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-hint.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-label-as-page-heading.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-threshold.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-translations.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-word-count.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template.njk +120 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +306 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +202 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +194 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs +120 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +1411 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro-options.json +229 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +22 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-conditional-reveal.html +25 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-disabled.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-error.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-hint.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-long-text.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-a-medium-legend.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-item-checked.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items-with-special-characters.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-disabled-item.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +46 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message-and-hints-on-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-fieldset-and-error-message.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-id-and-name.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-legend-as-a-page-heading.html +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-optional-form-group-classes-showing-group-error.html +40 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-pre-checked-values.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-and-hint-set-aria-describedby-on-input.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-single-option-set-aria-describedby-on-input.html +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-without-fieldset.html +22 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template.njk +122 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +50 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/fixtures.json +520 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/macro-options.json +132 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-accepted-confirmation-banner.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-client-side-implementation.html +60 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-default.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-rejected-confirmation-banner.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-with-html.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template.njk +57 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/fixtures.json +657 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro-options.json +163 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-complete-question.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-day-and-month.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-default.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-month-and-year.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-autocomplete-values.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-default-items.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-day-input.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-month-input.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-year-input.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-and-hint.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-input-attributes.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-optional-form-group-classes.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template.njk +106 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +134 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/fixtures.json +123 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/implementation.md +87 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/macro-options.json +56 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/template-default.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/template-expanded.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/template-with-html.html +18 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/template.njk +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/fixtures.json +104 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/template-translated.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/template.njk +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +52 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +312 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +304 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +113 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/fixtures.json +307 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/macro-options.json +82 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-default.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-mixed-with-and-without-links.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-with-description-only.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-with-everything.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template-without-links.html +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/template.njk +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +92 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +596 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +588 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +235 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/fixtures.json +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/macro-options.json +62 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/template-default.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/template-translated.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/template.njk +25 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +71 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/fixtures.json +242 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/macro-options.json +70 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-l.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-m.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-s.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-without-class.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-as-page-heading-xl.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-default.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-styled-as-large-text.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-styled-as-medium-text.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-styled-as-small-text.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template-styled-as-xl-text.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/template.njk +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +52 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +225 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +125 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-default.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-error-message-and-hint.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-hint-text.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-label-as-page-heading.html +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-optional-form-group-classes.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-value.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +53 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +152 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +691 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +164 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +212 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +146 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +42 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +76 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +76 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +84 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta.html +56 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +96 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +97 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +346 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +504 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +186 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +178 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +97 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +112 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-default.html +21 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html +43 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-label.html +51 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html +51 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-navigation-label.html +51 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html +111 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-navigation.html +51 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html +21 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +96 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +45 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/fixtures.json +71 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/template-default.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/template-with-html.html +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +165 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +781 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +245 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-default.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-autocapitalize-turned-off.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-autocomplete-attribute.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-error-message.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-extra-letter-spacing.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-hint-text.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-label-as-page-heading.html +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-optional-form-group-classes.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-pattern-attribute.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-long-suffix.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-suffix-and-error.html +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-suffix-and-width-modifier.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix-and-suffix.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-prefix.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-spellcheck-disabled.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-spellcheck-enabled.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-suffix.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-10-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-2-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-20-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-3-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-30-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-4-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-width-5-class.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template.njk +132 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/fixtures.json +70 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/template-with-html.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss +46 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/fixtures.json +193 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-l.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-m.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-s.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-without-class.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-as-page-heading-xl.html +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-styled-as-large-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-styled-as-medium-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-styled-as-small-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-styled-as-xl-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template-with-bold-text.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/template.njk +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +92 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/fixtures.json +270 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/macro-options.json +74 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +254 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +246 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +61 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-disabled-with-type-as-success.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-auto-focus-explicitly-enabled-with-type-as-success.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-custom-tabindex.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-default.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-paragraph-as-html-heading.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-rolealert-overridden-to-roleregion-with-type-as-success.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-success-with-custom-html.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-a-list.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-long-heading.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-lots-of-content.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-text-as-html.html +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template-with-type-as-success.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/template.njk +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +241 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +396 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/macro-options.json +140 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-default.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-first-page.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-last-page.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-accessible-labels-on-item-links.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-navigation-landmark.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +65 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-next-only.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-labels.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-and-very-long-labels.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only-in-a-different-language.html +22 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-prev-and-next-only.html +22 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-previous-only.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +85 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/fixtures.json +109 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/macro-options.json +50 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-custom-heading-level.html +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-default.html +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template.njk +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +185 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro-options.json +181 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +528 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +520 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +163 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-default.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-error-message.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-hint-text.html +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-input-width-class.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-label-as-page-heading.html +13 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-new-password-autocomplete.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-with-translations.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/template.njk +91 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +44 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/fixtures.json +90 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/macro-options.json +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template-default.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template.njk +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +326 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +1403 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/macro-options.json +211 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +179 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +171 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs +97 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-default.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-inline.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked-using-value.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-prechecked.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline-extreme.html +69 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-a-divider.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-conditional-reveal.html +31 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-disabled.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-error.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-hint.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-long-text.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-divider.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-medium-legend.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-item-checked.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-and-pre-checked-value.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-with-special-characters.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-disabled.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-fieldset-and-error-message.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hints-on-items.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-idprefix.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-legend-as-page-heading.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-optional-form-group-classes-showing-group-error.html +40 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-very-long-option-text.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-without-fieldset.html +22 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template.njk +115 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +59 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +532 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/macro-options.json +163 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-default.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-full-width-override.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-hint-text-and-error-message.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-label-as-page-heading.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-no-items.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-optional-form-group-classes.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template-with-selected-value.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/template.njk +66 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +50 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/fixtures.json +104 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +177 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +169 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +66 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/template-default.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/template-with-focus.html +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +277 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +1591 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/macro-options.json +248 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-custom-header-level.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-html-header.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-a-text-header.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-actions-plus-summary-list-actions.html +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-with-actions.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-check-your-answers.html +98 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-default.html +35 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-extreme.html +261 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-no-border-on-last-row.html +35 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-no-border.html +35 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-overridden-widths.html +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-translated.html +51 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-actions.html +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-no-first-action.html +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-with-some-actions.html +45 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template.njk +94 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +75 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/fixtures.json +630 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/macro-options.json +132 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template-default.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template-table-with-head-and-caption.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template-table-with-head.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template-with-small-text-modifier-for-tables-with-a-lot-of-data.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template.njk +57 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +134 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/fixtures.json +314 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/macro-options.json +84 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +391 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +383 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +296 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/template-default.html +117 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/template-tabs-with-anchor-in-panel.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/template.njk +48 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +94 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/fixtures.json +159 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/macro-options.json +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-blue.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-default.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-green.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-grey.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-light-blue.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-orange.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-pink.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-purple.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-red.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-turquoise.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template-yellow.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/template.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +77 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +542 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/macro-options.json +119 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-default.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-3-states.html +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-all-possible-colours.html +143 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-hint-text-and-additional-states.html +77 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-example-with-very-long-single-word-tags.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template.njk +41 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +50 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +285 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +143 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-default.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-autocomplete-attribute.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-custom-rows.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-default-value.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-error-message.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-hint.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-label-as-page-heading.html +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-optional-form-group-classes.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-spellcheck-disabled.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template-with-spellcheck-enabled.html +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/template.njk +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +65 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/fixtures.json +93 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/template-default.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/template-multiple-lines.html +7 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/template.njk +10 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss +20 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +12 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_links.scss +42 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_links.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +67 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +51 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +189 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +44 -0
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs +16 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +3 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_clearfix.scss +17 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_clearfix.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +91 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss +38 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +49 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_font-faces.scss +41 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_font-faces.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +63 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_index.scss +14 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +391 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +82 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +82 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +173 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +271 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +117 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +195 -0
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/index.scss +11 -0
- data/node_modules/govuk-frontend/dist/govuk/index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/init.mjs +100 -0
- data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/macros/attributes.njk +94 -0
- data/node_modules/govuk-frontend/dist/govuk/macros/i18n.njk +21 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +80 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss +25 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss +26 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_index.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +55 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +53 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +77 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +9 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +26 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss +7 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss +86 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss +16 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +38 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +48 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss +84 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +157 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +148 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +37 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_global-styles.scss +15 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_global-styles.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +23 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss +49 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss +107 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +25 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_spacing.scss +78 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_spacing.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss +52 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +322 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss +78 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/template.njk +58 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss +35 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss +28 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss +28 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +7 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +22 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +22 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +10 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss +7 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss +11 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +349 -0
- data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.js +15 -0
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +13 -0
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +1 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +165 -7
- data/node_modules/govuk-frontend/package.json +67 -4
- data/package-lock.json +4 -4
- data/package.json +1 -1
- data/vendor/assets/images/favicon.ico +0 -0
- data/vendor/assets/images/favicon.svg +1 -0
- 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-icon-mask.svg +1 -0
- data/vendor/assets/images/govuk-opengraph-image.png +0 -0
- data/vendor/assets/javascripts/defra_ruby_template.js +2374 -2533
- data/vendor/assets/stylesheets/_base.scss +5 -3
- data/vendor/assets/stylesheets/all.scss +2 -8
- data/vendor/assets/stylesheets/components/_all.scss +9 -32
- data/vendor/assets/stylesheets/components/_index.scss +39 -0
- data/vendor/assets/stylesheets/components/accordion/_accordion.scss +2 -0
- data/vendor/assets/stylesheets/components/accordion/_index.scss +270 -101
- data/vendor/assets/stylesheets/components/back-link/_back-link.scss +2 -0
- data/vendor/assets/stylesheets/components/back-link/_index.scss +27 -43
- data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +2 -0
- data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +37 -41
- data/vendor/assets/stylesheets/components/button/_button.scss +2 -0
- data/vendor/assets/stylesheets/components/button/_index.scss +79 -105
- data/vendor/assets/stylesheets/components/character-count/_character-count.scss +2 -0
- data/vendor/assets/stylesheets/components/character-count/_index.scss +12 -1
- data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +2 -0
- data/vendor/assets/stylesheets/components/checkboxes/_index.scss +119 -133
- data/vendor/assets/stylesheets/components/cookie-banner/_cookie-banner.scss +2 -0
- data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +3 -4
- data/vendor/assets/stylesheets/components/date-input/_date-input.scss +2 -0
- data/vendor/assets/stylesheets/components/date-input/_index.scss +2 -0
- data/vendor/assets/stylesheets/components/details/_details.scss +2 -0
- data/vendor/assets/stylesheets/components/details/_index.scss +97 -50
- data/vendor/assets/stylesheets/components/error-message/_error-message.scss +2 -0
- data/vendor/assets/stylesheets/components/error-message/_index.scss +3 -0
- data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +2 -0
- data/vendor/assets/stylesheets/components/error-summary/_index.scss +15 -6
- data/vendor/assets/stylesheets/components/exit-this-page/_exit-this-page.scss +4 -0
- data/vendor/assets/stylesheets/components/exit-this-page/_index.scss +92 -0
- data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +2 -0
- data/vendor/assets/stylesheets/components/fieldset/_index.scss +18 -11
- data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +2 -0
- data/vendor/assets/stylesheets/components/file-upload/_index.scss +8 -5
- data/vendor/assets/stylesheets/components/footer/_footer.scss +2 -0
- data/vendor/assets/stylesheets/components/footer/_index.scss +23 -112
- data/vendor/assets/stylesheets/components/header/_header.scss +2 -0
- data/vendor/assets/stylesheets/components/header/_index.scss +109 -94
- data/vendor/assets/stylesheets/components/hint/_hint.scss +2 -0
- data/vendor/assets/stylesheets/components/hint/_index.scss +4 -3
- data/vendor/assets/stylesheets/components/input/_index.scss +35 -61
- data/vendor/assets/stylesheets/components/input/_input.scss +2 -0
- data/vendor/assets/stylesheets/components/inset-text/_index.scss +2 -0
- data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +2 -0
- data/vendor/assets/stylesheets/components/label/_index.scss +12 -7
- data/vendor/assets/stylesheets/components/label/_label.scss +2 -0
- data/vendor/assets/stylesheets/components/notification-banner/_index.scss +8 -5
- data/vendor/assets/stylesheets/components/notification-banner/_notification-banner.scss +2 -0
- data/vendor/assets/stylesheets/components/pagination/_index.scss +241 -0
- data/vendor/assets/stylesheets/components/pagination/_pagination.scss +4 -0
- data/vendor/assets/stylesheets/components/panel/_index.scss +20 -10
- data/vendor/assets/stylesheets/components/panel/_panel.scss +2 -0
- data/vendor/assets/stylesheets/components/password-input/_index.scss +54 -0
- data/vendor/assets/stylesheets/components/password-input/_password-input.scss +4 -0
- data/vendor/assets/stylesheets/components/phase-banner/_index.scss +18 -1
- data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +2 -0
- data/vendor/assets/stylesheets/components/radios/_index.scss +104 -120
- data/vendor/assets/stylesheets/components/radios/_radios.scss +2 -0
- data/vendor/assets/stylesheets/components/select/_index.scss +20 -10
- data/vendor/assets/stylesheets/components/select/_select.scss +2 -0
- data/vendor/assets/stylesheets/components/skip-link/_index.scss +18 -4
- data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +2 -0
- data/vendor/assets/stylesheets/components/summary-list/_index.scss +167 -35
- data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +2 -0
- data/vendor/assets/stylesheets/components/table/_index.scss +21 -17
- data/vendor/assets/stylesheets/components/table/_table.scss +2 -0
- data/vendor/assets/stylesheets/components/tabs/_index.scss +15 -11
- data/vendor/assets/stylesheets/components/tabs/_tabs.scss +2 -0
- data/vendor/assets/stylesheets/components/tag/_index.scss +56 -48
- data/vendor/assets/stylesheets/components/tag/_tag.scss +2 -0
- data/vendor/assets/stylesheets/components/task-list/_index.scss +77 -0
- data/vendor/assets/stylesheets/components/task-list/_task-list.scss +4 -0
- data/vendor/assets/stylesheets/components/textarea/_index.scss +9 -6
- data/vendor/assets/stylesheets/components/textarea/_textarea.scss +2 -0
- data/vendor/assets/stylesheets/components/warning-text/_index.scss +10 -11
- data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +2 -0
- data/vendor/assets/stylesheets/core/_all.scss +10 -6
- data/vendor/assets/stylesheets/core/_global-styles.scss +2 -7
- data/vendor/assets/stylesheets/core/_govuk-frontend-properties.scss +12 -0
- data/vendor/assets/stylesheets/core/_index.scss +8 -0
- data/vendor/assets/stylesheets/core/_links.scss +8 -7
- data/vendor/assets/stylesheets/core/_lists.scss +2 -7
- data/vendor/assets/stylesheets/core/_section-break.scss +2 -13
- data/vendor/assets/stylesheets/core/_typography.scss +8 -11
- data/vendor/assets/stylesheets/defra_ruby_template.scss +2 -11
- data/vendor/assets/stylesheets/govuk-frontend.min.css +3 -0
- data/vendor/assets/stylesheets/helpers/_all.scss +10 -12
- data/vendor/assets/stylesheets/helpers/_clearfix.scss +3 -1
- data/vendor/assets/stylesheets/helpers/_colour.scss +20 -24
- data/vendor/assets/stylesheets/helpers/_device-pixels.scss +4 -3
- data/vendor/assets/stylesheets/helpers/_focused.scss +27 -6
- data/vendor/assets/stylesheets/helpers/_font-faces.scss +22 -22
- data/vendor/assets/stylesheets/helpers/_grid.scss +2 -0
- data/vendor/assets/stylesheets/helpers/_index.scss +14 -0
- data/vendor/assets/stylesheets/helpers/_links.scss +38 -74
- data/vendor/assets/stylesheets/helpers/_media-queries.scss +4 -13
- data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +3 -1
- data/vendor/assets/stylesheets/helpers/_spacing.scss +36 -16
- data/vendor/assets/stylesheets/helpers/_typography.scss +117 -53
- data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +33 -0
- data/vendor/assets/stylesheets/index.scss +11 -0
- data/vendor/assets/stylesheets/objects/_all.scss +10 -5
- data/vendor/assets/stylesheets/objects/_button-group.scss +7 -28
- data/vendor/assets/stylesheets/objects/_form-group.scss +2 -0
- data/vendor/assets/stylesheets/objects/_grid.scss +4 -2
- data/vendor/assets/stylesheets/objects/_index.scss +8 -0
- data/vendor/assets/stylesheets/objects/_main-wrapper.scss +17 -30
- data/vendor/assets/stylesheets/objects/_template.scss +53 -0
- data/vendor/assets/stylesheets/objects/_width-container.scss +2 -13
- data/vendor/assets/stylesheets/overrides/_all.scss +9 -4
- data/vendor/assets/stylesheets/overrides/_display.scss +2 -6
- data/vendor/assets/stylesheets/overrides/_index.scss +7 -0
- data/vendor/assets/stylesheets/overrides/_spacing.scss +49 -27
- data/vendor/assets/stylesheets/overrides/_text-align.scss +16 -0
- data/vendor/assets/stylesheets/overrides/_typography.scss +19 -8
- data/vendor/assets/stylesheets/overrides/_width.scss +2 -6
- data/vendor/assets/stylesheets/settings/_all.scss +8 -21
- data/vendor/assets/stylesheets/settings/_assets.scss +2 -0
- data/vendor/assets/stylesheets/settings/_colours-applied.scss +9 -7
- data/vendor/assets/stylesheets/settings/_colours-organisations.scss +10 -1
- data/vendor/assets/stylesheets/settings/_colours-palette.scss +8 -79
- data/vendor/assets/stylesheets/settings/_global-styles.scss +2 -0
- data/vendor/assets/stylesheets/settings/_index.scss +23 -0
- data/vendor/assets/stylesheets/settings/_links.scss +7 -20
- data/vendor/assets/stylesheets/settings/_measurements.scss +18 -16
- data/vendor/assets/stylesheets/settings/_media-queries.scss +5 -3
- data/vendor/assets/stylesheets/settings/_spacing.scss +6 -8
- data/vendor/assets/stylesheets/settings/_typography-font.scss +6 -43
- data/vendor/assets/stylesheets/settings/_typography-responsive.scss +179 -40
- data/vendor/assets/stylesheets/settings/_warnings.scss +78 -0
- data/vendor/assets/stylesheets/tools/_all.scss +10 -8
- data/vendor/assets/stylesheets/tools/_exports.scss +3 -1
- data/vendor/assets/stylesheets/tools/_font-url.scss +4 -1
- data/vendor/assets/stylesheets/tools/_image-url.scss +4 -1
- data/vendor/assets/stylesheets/tools/_index.scss +7 -0
- data/vendor/assets/stylesheets/tools/_px-to-em.scss +4 -2
- data/vendor/assets/stylesheets/tools/_px-to-rem.scss +3 -1
- data/vendor/assets/stylesheets/utilities/_all.scss +10 -2
- data/vendor/assets/stylesheets/utilities/_clearfix.scss +2 -0
- data/vendor/assets/stylesheets/utilities/_index.scss +4 -0
- data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +2 -0
- data/vendor/assets/stylesheets/vendor/_sass-mq.scss +3 -1
- metadata +906 -338
- data/node_modules/govuk-frontend/govuk/_base.scss +0 -3
- data/node_modules/govuk-frontend/govuk/all-ie8.scss +0 -6
- data/node_modules/govuk-frontend/govuk/all.js +0 -2616
- data/node_modules/govuk-frontend/govuk/all.scss +0 -9
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-logotype-crown.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-logotype-tudor-crown.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-mask-icon.svg +0 -1
- data/node_modules/govuk-frontend/govuk/common.js +0 -39
- data/node_modules/govuk-frontend/govuk/components/_all.scss +0 -33
- data/node_modules/govuk-frontend/govuk/components/accordion/_accordion.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +0 -197
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +0 -1011
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +0 -250
- data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +0 -76
- data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +0 -27
- data/node_modules/govuk-frontend/govuk/components/back-link/_back-link.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +0 -99
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +0 -62
- data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +0 -32
- data/node_modules/govuk-frontend/govuk/components/back-link/template.njk +0 -2
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +0 -138
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +0 -193
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +0 -52
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +0 -24
- data/node_modules/govuk-frontend/govuk/components/button/_button.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +0 -287
- data/node_modules/govuk-frontend/govuk/components/button/button.js +0 -724
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +0 -327
- data/node_modules/govuk-frontend/govuk/components/button/macro-options.json +0 -74
- data/node_modules/govuk-frontend/govuk/components/button/template.njk +0 -60
- data/node_modules/govuk-frontend/govuk/components/character-count/_character-count.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +0 -25
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +0 -1194
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +0 -240
- data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +0 -111
- data/node_modules/govuk-frontend/govuk/components/character-count/template.njk +0 -37
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +0 -334
- data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +0 -1192
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +0 -1189
- data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +0 -161
- data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +0 -119
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +0 -51
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +0 -443
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +0 -132
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +0 -73
- data/node_modules/govuk-frontend/govuk/components/date-input/_date-input.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/date-input/_index.scss +0 -26
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +0 -549
- data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +0 -117
- data/node_modules/govuk-frontend/govuk/components/date-input/template.njk +0 -97
- data/node_modules/govuk-frontend/govuk/components/details/_details.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +0 -88
- data/node_modules/govuk-frontend/govuk/components/details/details.js +0 -828
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +0 -103
- data/node_modules/govuk-frontend/govuk/components/details/implementation.md +0 -43
- data/node_modules/govuk-frontend/govuk/components/details/macro-options.json +0 -50
- data/node_modules/govuk-frontend/govuk/components/details/template.njk +0 -10
- data/node_modules/govuk-frontend/govuk/components/error-message/_error-message.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +0 -11
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +0 -77
- data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +0 -38
- data/node_modules/govuk-frontend/govuk/components/error-message/template.njk +0 -6
- data/node_modules/govuk-frontend/govuk/components/error-summary/_error-summary.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +0 -43
- data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +0 -853
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +0 -242
- data/node_modules/govuk-frontend/govuk/components/error-summary/macro-options.json +0 -70
- data/node_modules/govuk-frontend/govuk/components/error-summary/template.njk +0 -25
- data/node_modules/govuk-frontend/govuk/components/fieldset/_fieldset.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +0 -64
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +0 -103
- data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +0 -70
- data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +0 -22
- data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +0 -50
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +0 -198
- data/node_modules/govuk-frontend/govuk/components/file-upload/macro-options.json +0 -73
- data/node_modules/govuk-frontend/govuk/components/file-upload/template.njk +0 -44
- data/node_modules/govuk-frontend/govuk/components/footer/_footer.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -244
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +0 -501
- data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +0 -118
- data/node_modules/govuk-frontend/govuk/components/footer/template.njk +0 -87
- data/node_modules/govuk-frontend/govuk/components/header/_header.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +0 -347
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +0 -386
- data/node_modules/govuk-frontend/govuk/components/header/header.js +0 -1066
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +0 -112
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +0 -104
- data/node_modules/govuk-frontend/govuk/components/hint/_hint.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +0 -44
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +0 -59
- data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +0 -32
- data/node_modules/govuk-frontend/govuk/components/hint/template.njk +0 -4
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +0 -191
- data/node_modules/govuk-frontend/govuk/components/input/_input.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +0 -628
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +0 -167
- data/node_modules/govuk-frontend/govuk/components/input/template.njk +0 -65
- data/node_modules/govuk-frontend/govuk/components/inset-text/_index.scss +0 -24
- data/node_modules/govuk-frontend/govuk/components/inset-text/_inset-text.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +0 -58
- data/node_modules/govuk-frontend/govuk/components/inset-text/macro-options.json +0 -32
- data/node_modules/govuk-frontend/govuk/components/inset-text/template.njk +0 -4
- data/node_modules/govuk-frontend/govuk/components/label/_index.scss +0 -41
- data/node_modules/govuk-frontend/govuk/components/label/_label.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +0 -84
- data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +0 -38
- data/node_modules/govuk-frontend/govuk/components/label/template.njk +0 -15
- data/node_modules/govuk-frontend/govuk/components/notification-banner/_index.scss +0 -89
- data/node_modules/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +0 -212
- data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +0 -68
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +0 -61
- data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +0 -47
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +0 -56
- data/node_modules/govuk-frontend/govuk/components/panel/_panel.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +0 -91
- data/node_modules/govuk-frontend/govuk/components/panel/macro-options.json +0 -44
- data/node_modules/govuk-frontend/govuk/components/panel/template.njk +0 -13
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_index.scss +0 -27
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +0 -76
- data/node_modules/govuk-frontend/govuk/components/phase-banner/macro-options.json +0 -33
- data/node_modules/govuk-frontend/govuk/components/phase-banner/template.njk +0 -15
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +0 -356
- data/node_modules/govuk-frontend/govuk/components/radios/_radios.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +0 -1183
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +0 -143
- data/node_modules/govuk-frontend/govuk/components/radios/radios.js +0 -1148
- data/node_modules/govuk-frontend/govuk/components/radios/template.njk +0 -116
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +0 -49
- data/node_modules/govuk-frontend/govuk/components/select/_select.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +0 -327
- data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +0 -105
- data/node_modules/govuk-frontend/govuk/components/select/template.njk +0 -51
- data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +0 -36
- data/node_modules/govuk-frontend/govuk/components/skip-link/_skip-link.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +0 -84
- data/node_modules/govuk-frontend/govuk/components/skip-link/macro-options.json +0 -32
- data/node_modules/govuk-frontend/govuk/components/skip-link/template.njk +0 -3
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +0 -145
- data/node_modules/govuk-frontend/govuk/components/summary-list/_summary-list.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +0 -1084
- data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +0 -113
- data/node_modules/govuk-frontend/govuk/components/summary-list/template.njk +0 -47
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +0 -71
- data/node_modules/govuk-frontend/govuk/components/table/_table.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +0 -538
- data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +0 -132
- data/node_modules/govuk-frontend/govuk/components/table/template.njk +0 -45
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +0 -130
- data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +0 -286
- data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +0 -84
- data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +0 -1347
- data/node_modules/govuk-frontend/govuk/components/tabs/template.njk +0 -32
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -86
- data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +0 -131
- data/node_modules/govuk-frontend/govuk/components/tag/macro-options.json +0 -26
- data/node_modules/govuk-frontend/govuk/components/tag/template.njk +0 -3
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +0 -47
- data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +0 -250
- data/node_modules/govuk-frontend/govuk/components/textarea/macro-options.json +0 -91
- data/node_modules/govuk-frontend/govuk/components/textarea/template.njk +0 -45
- data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +0 -66
- data/node_modules/govuk-frontend/govuk/components/warning-text/_warning-text.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +0 -73
- data/node_modules/govuk-frontend/govuk/components/warning-text/macro-options.json +0 -32
- data/node_modules/govuk-frontend/govuk/components/warning-text/template.njk +0 -9
- data/node_modules/govuk-frontend/govuk/core/_all.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +0 -25
- data/node_modules/govuk-frontend/govuk/core/_links.scss +0 -41
- data/node_modules/govuk-frontend/govuk/core/_lists.scss +0 -72
- data/node_modules/govuk-frontend/govuk/core/_section-break.scss +0 -62
- data/node_modules/govuk-frontend/govuk/core/_template.scss +0 -36
- data/node_modules/govuk-frontend/govuk/core/_typography.scss +0 -192
- data/node_modules/govuk-frontend/govuk/helpers/_all.scss +0 -12
- data/node_modules/govuk-frontend/govuk/helpers/_clearfix.scss +0 -15
- data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +0 -95
- data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +0 -37
- data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +0 -28
- data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +0 -41
- data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +0 -61
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +0 -427
- data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +0 -91
- data/node_modules/govuk-frontend/govuk/helpers/_shape-arrow.scss +0 -80
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +0 -171
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +0 -207
- data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +0 -84
- data/node_modules/govuk-frontend/govuk/objects/_all.scss +0 -5
- data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +0 -101
- data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +0 -23
- data/node_modules/govuk-frontend/govuk/objects/_grid.scss +0 -24
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +0 -68
- data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +0 -88
- data/node_modules/govuk-frontend/govuk/overrides/_all.scss +0 -5
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +0 -30
- data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +0 -64
- data/node_modules/govuk-frontend/govuk/overrides/_text-align.scss +0 -20
- data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +0 -27
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +0 -52
- data/node_modules/govuk-frontend/govuk/settings/_all.scss +0 -23
- data/node_modules/govuk-frontend/govuk/settings/_assets.scss +0 -82
- data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +0 -155
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +0 -139
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +0 -108
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +0 -74
- data/node_modules/govuk-frontend/govuk/settings/_global-styles.scss +0 -13
- data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +0 -18
- data/node_modules/govuk-frontend/govuk/settings/_links.scss +0 -62
- data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -105
- data/node_modules/govuk-frontend/govuk/settings/_media-queries.scss +0 -23
- data/node_modules/govuk-frontend/govuk/settings/_spacing.scss +0 -80
- data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +0 -32
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +0 -89
- data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +0 -183
- data/node_modules/govuk-frontend/govuk/template.njk +0 -60
- data/node_modules/govuk-frontend/govuk/tools/_all.scss +0 -8
- data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +0 -36
- data/node_modules/govuk-frontend/govuk/tools/_exports.scss +0 -33
- data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +0 -25
- data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +0 -51
- data/node_modules/govuk-frontend/govuk/tools/_iff.scss +0 -17
- data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +0 -25
- data/node_modules/govuk-frontend/govuk/tools/_px-to-em.scss +0 -20
- data/node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss +0 -20
- data/node_modules/govuk-frontend/govuk/utilities/_all.scss +0 -2
- data/node_modules/govuk-frontend/govuk/utilities/_clearfix.scss +0 -5
- data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +0 -9
- data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +0 -347
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js +0 -272
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js +0 -34
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js +0 -589
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js +0 -54
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js +0 -31
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +0 -254
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +0 -254
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js +0 -147
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js +0 -504
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js +0 -252
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js +0 -94
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js +0 -28
- data/vendor/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon-180x180.png +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon.png +0 -0
- data/vendor/assets/images/govuk-logotype-crown.png +0 -0
- data/vendor/assets/images/govuk-mask-icon.svg +0 -7
- data/vendor/assets/stylesheets/all-ie8.scss +0 -6
- data/vendor/assets/stylesheets/core/_template.scss +0 -36
- data/vendor/assets/stylesheets/settings/_compatibility.scss +0 -74
- data/vendor/assets/stylesheets/settings/_ie8.scss +0 -18
- data/vendor/assets/stylesheets/settings/_typography-font-families.scss +0 -32
- data/vendor/assets/stylesheets/tools/_compatibility.scss +0 -36
- data/vendor/assets/stylesheets/tools/_ie8.scss +0 -51
- data/vendor/assets/stylesheets/tools/_iff.scss +0 -17
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/fonts/bold-affa96571d-v2.woff +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/fonts/light-f591b13f7d-v2.woff +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/images/favicon.ico +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/images/govuk-crest-2x.png +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/images/govuk-crest.png +0 -0
- /data/node_modules/govuk-frontend/{govuk/assets/images/govuk-apple-touch-icon-180x180.png → dist/govuk/assets/images/govuk-icon-180.png} +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/images/govuk-opengraph-image.png +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/accordion/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/accordion/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/back-link/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/back-link/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/breadcrumbs/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/breadcrumbs/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/button/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/button/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/character-count/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/character-count/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/checkboxes/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/checkboxes/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/cookie-banner/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/cookie-banner/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/date-input/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/date-input/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/details/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/details/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/error-message/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/error-message/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/error-summary/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/error-summary/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/fieldset/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/fieldset/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/file-upload/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/file-upload/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/footer/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/footer/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/header/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/header/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/hint/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/hint/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/input/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/input/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/inset-text/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/inset-text/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/label/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/label/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/notification-banner/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/notification-banner/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/panel/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/panel/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/phase-banner/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/phase-banner/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/radios/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/radios/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/select/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/select/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/skip-link/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/skip-link/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/summary-list/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/summary-list/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/table/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/table/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/tabs/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/tabs/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/tag/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/tag/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/textarea/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/textarea/macro.njk +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/warning-text/README.md +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/warning-text/macro.njk +0 -0
@@ -0,0 +1,2457 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = {}));
|
5
|
+
})(this, (function (exports) { 'use strict';
|
6
|
+
|
7
|
+
const version = '5.4.0';
|
8
|
+
|
9
|
+
function normaliseString(value, property) {
|
10
|
+
const trimmedValue = value ? value.trim() : '';
|
11
|
+
let output;
|
12
|
+
let outputType = property == null ? void 0 : property.type;
|
13
|
+
if (!outputType) {
|
14
|
+
if (['true', 'false'].includes(trimmedValue)) {
|
15
|
+
outputType = 'boolean';
|
16
|
+
}
|
17
|
+
if (trimmedValue.length > 0 && isFinite(Number(trimmedValue))) {
|
18
|
+
outputType = 'number';
|
19
|
+
}
|
20
|
+
}
|
21
|
+
switch (outputType) {
|
22
|
+
case 'boolean':
|
23
|
+
output = trimmedValue === 'true';
|
24
|
+
break;
|
25
|
+
case 'number':
|
26
|
+
output = Number(trimmedValue);
|
27
|
+
break;
|
28
|
+
default:
|
29
|
+
output = value;
|
30
|
+
}
|
31
|
+
return output;
|
32
|
+
}
|
33
|
+
|
34
|
+
/**
|
35
|
+
* @typedef {import('./index.mjs').SchemaProperty} SchemaProperty
|
36
|
+
*/
|
37
|
+
|
38
|
+
function mergeConfigs(...configObjects) {
|
39
|
+
const formattedConfigObject = {};
|
40
|
+
for (const configObject of configObjects) {
|
41
|
+
for (const key of Object.keys(configObject)) {
|
42
|
+
const option = formattedConfigObject[key];
|
43
|
+
const override = configObject[key];
|
44
|
+
if (isObject(option) && isObject(override)) {
|
45
|
+
formattedConfigObject[key] = mergeConfigs(option, override);
|
46
|
+
} else {
|
47
|
+
formattedConfigObject[key] = override;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
return formattedConfigObject;
|
52
|
+
}
|
53
|
+
function extractConfigByNamespace(Component, dataset, namespace) {
|
54
|
+
const property = Component.schema.properties[namespace];
|
55
|
+
if ((property == null ? void 0 : property.type) !== 'object') {
|
56
|
+
return;
|
57
|
+
}
|
58
|
+
const newObject = {
|
59
|
+
[namespace]: ({})
|
60
|
+
};
|
61
|
+
for (const [key, value] of Object.entries(dataset)) {
|
62
|
+
let current = newObject;
|
63
|
+
const keyParts = key.split('.');
|
64
|
+
for (const [index, name] of keyParts.entries()) {
|
65
|
+
if (typeof current === 'object') {
|
66
|
+
if (index < keyParts.length - 1) {
|
67
|
+
if (!isObject(current[name])) {
|
68
|
+
current[name] = {};
|
69
|
+
}
|
70
|
+
current = current[name];
|
71
|
+
} else if (key !== namespace) {
|
72
|
+
current[name] = normaliseString(value);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
return newObject[namespace];
|
78
|
+
}
|
79
|
+
function getFragmentFromUrl(url) {
|
80
|
+
if (!url.includes('#')) {
|
81
|
+
return undefined;
|
82
|
+
}
|
83
|
+
return url.split('#').pop();
|
84
|
+
}
|
85
|
+
function getBreakpoint(name) {
|
86
|
+
const property = `--govuk-frontend-breakpoint-${name}`;
|
87
|
+
const value = window.getComputedStyle(document.documentElement).getPropertyValue(property);
|
88
|
+
return {
|
89
|
+
property,
|
90
|
+
value: value || undefined
|
91
|
+
};
|
92
|
+
}
|
93
|
+
function setFocus($element, options = {}) {
|
94
|
+
var _options$onBeforeFocu;
|
95
|
+
const isFocusable = $element.getAttribute('tabindex');
|
96
|
+
if (!isFocusable) {
|
97
|
+
$element.setAttribute('tabindex', '-1');
|
98
|
+
}
|
99
|
+
function onFocus() {
|
100
|
+
$element.addEventListener('blur', onBlur, {
|
101
|
+
once: true
|
102
|
+
});
|
103
|
+
}
|
104
|
+
function onBlur() {
|
105
|
+
var _options$onBlur;
|
106
|
+
(_options$onBlur = options.onBlur) == null || _options$onBlur.call($element);
|
107
|
+
if (!isFocusable) {
|
108
|
+
$element.removeAttribute('tabindex');
|
109
|
+
}
|
110
|
+
}
|
111
|
+
$element.addEventListener('focus', onFocus, {
|
112
|
+
once: true
|
113
|
+
});
|
114
|
+
(_options$onBeforeFocu = options.onBeforeFocus) == null || _options$onBeforeFocu.call($element);
|
115
|
+
$element.focus();
|
116
|
+
}
|
117
|
+
function isSupported($scope = document.body) {
|
118
|
+
if (!$scope) {
|
119
|
+
return false;
|
120
|
+
}
|
121
|
+
return $scope.classList.contains('govuk-frontend-supported');
|
122
|
+
}
|
123
|
+
function validateConfig(schema, config) {
|
124
|
+
const validationErrors = [];
|
125
|
+
for (const [name, conditions] of Object.entries(schema)) {
|
126
|
+
const errors = [];
|
127
|
+
if (Array.isArray(conditions)) {
|
128
|
+
for (const {
|
129
|
+
required,
|
130
|
+
errorMessage
|
131
|
+
} of conditions) {
|
132
|
+
if (!required.every(key => !!config[key])) {
|
133
|
+
errors.push(errorMessage);
|
134
|
+
}
|
135
|
+
}
|
136
|
+
if (name === 'anyOf' && !(conditions.length - errors.length >= 1)) {
|
137
|
+
validationErrors.push(...errors);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
return validationErrors;
|
142
|
+
}
|
143
|
+
function isArray(option) {
|
144
|
+
return Array.isArray(option);
|
145
|
+
}
|
146
|
+
function isObject(option) {
|
147
|
+
return !!option && typeof option === 'object' && !isArray(option);
|
148
|
+
}
|
149
|
+
|
150
|
+
/**
|
151
|
+
* Schema for component config
|
152
|
+
*
|
153
|
+
* @typedef {object} Schema
|
154
|
+
* @property {{ [field: string]: SchemaProperty | undefined }} properties - Schema properties
|
155
|
+
* @property {SchemaCondition[]} [anyOf] - List of schema conditions
|
156
|
+
*/
|
157
|
+
|
158
|
+
/**
|
159
|
+
* Schema property for component config
|
160
|
+
*
|
161
|
+
* @typedef {object} SchemaProperty
|
162
|
+
* @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
|
163
|
+
*/
|
164
|
+
|
165
|
+
/**
|
166
|
+
* Schema condition for component config
|
167
|
+
*
|
168
|
+
* @typedef {object} SchemaCondition
|
169
|
+
* @property {string[]} required - List of required config fields
|
170
|
+
* @property {string} errorMessage - Error message when required config fields not provided
|
171
|
+
*/
|
172
|
+
|
173
|
+
function normaliseDataset(Component, dataset) {
|
174
|
+
const out = {};
|
175
|
+
for (const [field, property] of Object.entries(Component.schema.properties)) {
|
176
|
+
if (field in dataset) {
|
177
|
+
out[field] = normaliseString(dataset[field], property);
|
178
|
+
}
|
179
|
+
if ((property == null ? void 0 : property.type) === 'object') {
|
180
|
+
out[field] = extractConfigByNamespace(Component, dataset, field);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
return out;
|
184
|
+
}
|
185
|
+
|
186
|
+
class GOVUKFrontendError extends Error {
|
187
|
+
constructor(...args) {
|
188
|
+
super(...args);
|
189
|
+
this.name = 'GOVUKFrontendError';
|
190
|
+
}
|
191
|
+
}
|
192
|
+
class SupportError extends GOVUKFrontendError {
|
193
|
+
/**
|
194
|
+
* Checks if GOV.UK Frontend is supported on this page
|
195
|
+
*
|
196
|
+
* @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support
|
197
|
+
*/
|
198
|
+
constructor($scope = document.body) {
|
199
|
+
const supportMessage = 'noModule' in HTMLScriptElement.prototype ? 'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet' : 'GOV.UK Frontend is not supported in this browser';
|
200
|
+
super($scope ? supportMessage : 'GOV.UK Frontend initialised without `<script type="module">`');
|
201
|
+
this.name = 'SupportError';
|
202
|
+
}
|
203
|
+
}
|
204
|
+
class ConfigError extends GOVUKFrontendError {
|
205
|
+
constructor(...args) {
|
206
|
+
super(...args);
|
207
|
+
this.name = 'ConfigError';
|
208
|
+
}
|
209
|
+
}
|
210
|
+
class ElementError extends GOVUKFrontendError {
|
211
|
+
constructor(messageOrOptions) {
|
212
|
+
let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';
|
213
|
+
if (typeof messageOrOptions === 'object') {
|
214
|
+
const {
|
215
|
+
componentName,
|
216
|
+
identifier,
|
217
|
+
element,
|
218
|
+
expectedType
|
219
|
+
} = messageOrOptions;
|
220
|
+
message = `${componentName}: ${identifier}`;
|
221
|
+
message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';
|
222
|
+
}
|
223
|
+
super(message);
|
224
|
+
this.name = 'ElementError';
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
228
|
+
class GOVUKFrontendComponent {
|
229
|
+
constructor() {
|
230
|
+
this.checkSupport();
|
231
|
+
}
|
232
|
+
checkSupport() {
|
233
|
+
if (!isSupported()) {
|
234
|
+
throw new SupportError();
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
|
239
|
+
class I18n {
|
240
|
+
constructor(translations = {}, config = {}) {
|
241
|
+
var _config$locale;
|
242
|
+
this.translations = void 0;
|
243
|
+
this.locale = void 0;
|
244
|
+
this.translations = translations;
|
245
|
+
this.locale = (_config$locale = config.locale) != null ? _config$locale : document.documentElement.lang || 'en';
|
246
|
+
}
|
247
|
+
t(lookupKey, options) {
|
248
|
+
if (!lookupKey) {
|
249
|
+
throw new Error('i18n: lookup key missing');
|
250
|
+
}
|
251
|
+
let translation = this.translations[lookupKey];
|
252
|
+
if (typeof (options == null ? void 0 : options.count) === 'number' && typeof translation === 'object') {
|
253
|
+
const translationPluralForm = translation[this.getPluralSuffix(lookupKey, options.count)];
|
254
|
+
if (translationPluralForm) {
|
255
|
+
translation = translationPluralForm;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
if (typeof translation === 'string') {
|
259
|
+
if (translation.match(/%{(.\S+)}/)) {
|
260
|
+
if (!options) {
|
261
|
+
throw new Error('i18n: cannot replace placeholders in string if no option data provided');
|
262
|
+
}
|
263
|
+
return this.replacePlaceholders(translation, options);
|
264
|
+
}
|
265
|
+
return translation;
|
266
|
+
}
|
267
|
+
return lookupKey;
|
268
|
+
}
|
269
|
+
replacePlaceholders(translationString, options) {
|
270
|
+
const formatter = Intl.NumberFormat.supportedLocalesOf(this.locale).length ? new Intl.NumberFormat(this.locale) : undefined;
|
271
|
+
return translationString.replace(/%{(.\S+)}/g, function (placeholderWithBraces, placeholderKey) {
|
272
|
+
if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {
|
273
|
+
const placeholderValue = options[placeholderKey];
|
274
|
+
if (placeholderValue === false || typeof placeholderValue !== 'number' && typeof placeholderValue !== 'string') {
|
275
|
+
return '';
|
276
|
+
}
|
277
|
+
if (typeof placeholderValue === 'number') {
|
278
|
+
return formatter ? formatter.format(placeholderValue) : `${placeholderValue}`;
|
279
|
+
}
|
280
|
+
return placeholderValue;
|
281
|
+
}
|
282
|
+
throw new Error(`i18n: no data found to replace ${placeholderWithBraces} placeholder in string`);
|
283
|
+
});
|
284
|
+
}
|
285
|
+
hasIntlPluralRulesSupport() {
|
286
|
+
return Boolean('PluralRules' in window.Intl && Intl.PluralRules.supportedLocalesOf(this.locale).length);
|
287
|
+
}
|
288
|
+
getPluralSuffix(lookupKey, count) {
|
289
|
+
count = Number(count);
|
290
|
+
if (!isFinite(count)) {
|
291
|
+
return 'other';
|
292
|
+
}
|
293
|
+
const translation = this.translations[lookupKey];
|
294
|
+
const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);
|
295
|
+
if (typeof translation === 'object') {
|
296
|
+
if (preferredForm in translation) {
|
297
|
+
return preferredForm;
|
298
|
+
} else if ('other' in translation) {
|
299
|
+
console.warn(`i18n: Missing plural form ".${preferredForm}" for "${this.locale}" locale. Falling back to ".other".`);
|
300
|
+
return 'other';
|
301
|
+
}
|
302
|
+
}
|
303
|
+
throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
|
304
|
+
}
|
305
|
+
selectPluralFormUsingFallbackRules(count) {
|
306
|
+
count = Math.abs(Math.floor(count));
|
307
|
+
const ruleset = this.getPluralRulesForLocale();
|
308
|
+
if (ruleset) {
|
309
|
+
return I18n.pluralRules[ruleset](count);
|
310
|
+
}
|
311
|
+
return 'other';
|
312
|
+
}
|
313
|
+
getPluralRulesForLocale() {
|
314
|
+
const localeShort = this.locale.split('-')[0];
|
315
|
+
for (const pluralRule in I18n.pluralRulesMap) {
|
316
|
+
const languages = I18n.pluralRulesMap[pluralRule];
|
317
|
+
if (languages.includes(this.locale) || languages.includes(localeShort)) {
|
318
|
+
return pluralRule;
|
319
|
+
}
|
320
|
+
}
|
321
|
+
}
|
322
|
+
}
|
323
|
+
I18n.pluralRulesMap = {
|
324
|
+
arabic: ['ar'],
|
325
|
+
chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
|
326
|
+
french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
|
327
|
+
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'],
|
328
|
+
irish: ['ga'],
|
329
|
+
russian: ['ru', 'uk'],
|
330
|
+
scottish: ['gd'],
|
331
|
+
spanish: ['pt-PT', 'it', 'es'],
|
332
|
+
welsh: ['cy']
|
333
|
+
};
|
334
|
+
I18n.pluralRules = {
|
335
|
+
arabic(n) {
|
336
|
+
if (n === 0) {
|
337
|
+
return 'zero';
|
338
|
+
}
|
339
|
+
if (n === 1) {
|
340
|
+
return 'one';
|
341
|
+
}
|
342
|
+
if (n === 2) {
|
343
|
+
return 'two';
|
344
|
+
}
|
345
|
+
if (n % 100 >= 3 && n % 100 <= 10) {
|
346
|
+
return 'few';
|
347
|
+
}
|
348
|
+
if (n % 100 >= 11 && n % 100 <= 99) {
|
349
|
+
return 'many';
|
350
|
+
}
|
351
|
+
return 'other';
|
352
|
+
},
|
353
|
+
chinese() {
|
354
|
+
return 'other';
|
355
|
+
},
|
356
|
+
french(n) {
|
357
|
+
return n === 0 || n === 1 ? 'one' : 'other';
|
358
|
+
},
|
359
|
+
german(n) {
|
360
|
+
return n === 1 ? 'one' : 'other';
|
361
|
+
},
|
362
|
+
irish(n) {
|
363
|
+
if (n === 1) {
|
364
|
+
return 'one';
|
365
|
+
}
|
366
|
+
if (n === 2) {
|
367
|
+
return 'two';
|
368
|
+
}
|
369
|
+
if (n >= 3 && n <= 6) {
|
370
|
+
return 'few';
|
371
|
+
}
|
372
|
+
if (n >= 7 && n <= 10) {
|
373
|
+
return 'many';
|
374
|
+
}
|
375
|
+
return 'other';
|
376
|
+
},
|
377
|
+
russian(n) {
|
378
|
+
const lastTwo = n % 100;
|
379
|
+
const last = lastTwo % 10;
|
380
|
+
if (last === 1 && lastTwo !== 11) {
|
381
|
+
return 'one';
|
382
|
+
}
|
383
|
+
if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {
|
384
|
+
return 'few';
|
385
|
+
}
|
386
|
+
if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {
|
387
|
+
return 'many';
|
388
|
+
}
|
389
|
+
return 'other';
|
390
|
+
},
|
391
|
+
scottish(n) {
|
392
|
+
if (n === 1 || n === 11) {
|
393
|
+
return 'one';
|
394
|
+
}
|
395
|
+
if (n === 2 || n === 12) {
|
396
|
+
return 'two';
|
397
|
+
}
|
398
|
+
if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {
|
399
|
+
return 'few';
|
400
|
+
}
|
401
|
+
return 'other';
|
402
|
+
},
|
403
|
+
spanish(n) {
|
404
|
+
if (n === 1) {
|
405
|
+
return 'one';
|
406
|
+
}
|
407
|
+
if (n % 1000000 === 0 && n !== 0) {
|
408
|
+
return 'many';
|
409
|
+
}
|
410
|
+
return 'other';
|
411
|
+
},
|
412
|
+
welsh(n) {
|
413
|
+
if (n === 0) {
|
414
|
+
return 'zero';
|
415
|
+
}
|
416
|
+
if (n === 1) {
|
417
|
+
return 'one';
|
418
|
+
}
|
419
|
+
if (n === 2) {
|
420
|
+
return 'two';
|
421
|
+
}
|
422
|
+
if (n === 3) {
|
423
|
+
return 'few';
|
424
|
+
}
|
425
|
+
if (n === 6) {
|
426
|
+
return 'many';
|
427
|
+
}
|
428
|
+
return 'other';
|
429
|
+
}
|
430
|
+
};
|
431
|
+
|
432
|
+
/**
|
433
|
+
* Accordion component
|
434
|
+
*
|
435
|
+
* This allows a collection of sections to be collapsed by default, showing only
|
436
|
+
* their headers. Sections can be expanded or collapsed individually by clicking
|
437
|
+
* their headers. A "Show all sections" button is also added to the top of the
|
438
|
+
* accordion, which switches to "Hide all sections" when all the sections are
|
439
|
+
* expanded.
|
440
|
+
*
|
441
|
+
* The state of each section is saved to the DOM via the `aria-expanded`
|
442
|
+
* attribute, which also provides accessibility.
|
443
|
+
*
|
444
|
+
* @preserve
|
445
|
+
*/
|
446
|
+
class Accordion extends GOVUKFrontendComponent {
|
447
|
+
/**
|
448
|
+
* @param {Element | null} $module - HTML element to use for accordion
|
449
|
+
* @param {AccordionConfig} [config] - Accordion config
|
450
|
+
*/
|
451
|
+
constructor($module, config = {}) {
|
452
|
+
super();
|
453
|
+
this.$module = void 0;
|
454
|
+
this.config = void 0;
|
455
|
+
this.i18n = void 0;
|
456
|
+
this.controlsClass = 'govuk-accordion__controls';
|
457
|
+
this.showAllClass = 'govuk-accordion__show-all';
|
458
|
+
this.showAllTextClass = 'govuk-accordion__show-all-text';
|
459
|
+
this.sectionClass = 'govuk-accordion__section';
|
460
|
+
this.sectionExpandedClass = 'govuk-accordion__section--expanded';
|
461
|
+
this.sectionButtonClass = 'govuk-accordion__section-button';
|
462
|
+
this.sectionHeaderClass = 'govuk-accordion__section-header';
|
463
|
+
this.sectionHeadingClass = 'govuk-accordion__section-heading';
|
464
|
+
this.sectionHeadingDividerClass = 'govuk-accordion__section-heading-divider';
|
465
|
+
this.sectionHeadingTextClass = 'govuk-accordion__section-heading-text';
|
466
|
+
this.sectionHeadingTextFocusClass = 'govuk-accordion__section-heading-text-focus';
|
467
|
+
this.sectionShowHideToggleClass = 'govuk-accordion__section-toggle';
|
468
|
+
this.sectionShowHideToggleFocusClass = 'govuk-accordion__section-toggle-focus';
|
469
|
+
this.sectionShowHideTextClass = 'govuk-accordion__section-toggle-text';
|
470
|
+
this.upChevronIconClass = 'govuk-accordion-nav__chevron';
|
471
|
+
this.downChevronIconClass = 'govuk-accordion-nav__chevron--down';
|
472
|
+
this.sectionSummaryClass = 'govuk-accordion__section-summary';
|
473
|
+
this.sectionSummaryFocusClass = 'govuk-accordion__section-summary-focus';
|
474
|
+
this.sectionContentClass = 'govuk-accordion__section-content';
|
475
|
+
this.$sections = void 0;
|
476
|
+
this.browserSupportsSessionStorage = false;
|
477
|
+
this.$showAllButton = null;
|
478
|
+
this.$showAllIcon = null;
|
479
|
+
this.$showAllText = null;
|
480
|
+
if (!($module instanceof HTMLElement)) {
|
481
|
+
throw new ElementError({
|
482
|
+
componentName: 'Accordion',
|
483
|
+
element: $module,
|
484
|
+
identifier: 'Root element (`$module`)'
|
485
|
+
});
|
486
|
+
}
|
487
|
+
this.$module = $module;
|
488
|
+
this.config = mergeConfigs(Accordion.defaults, config, normaliseDataset(Accordion, $module.dataset));
|
489
|
+
this.i18n = new I18n(this.config.i18n);
|
490
|
+
const $sections = this.$module.querySelectorAll(`.${this.sectionClass}`);
|
491
|
+
if (!$sections.length) {
|
492
|
+
throw new ElementError({
|
493
|
+
componentName: 'Accordion',
|
494
|
+
identifier: `Sections (\`<div class="${this.sectionClass}">\`)`
|
495
|
+
});
|
496
|
+
}
|
497
|
+
this.$sections = $sections;
|
498
|
+
this.browserSupportsSessionStorage = helper.checkForSessionStorage();
|
499
|
+
this.initControls();
|
500
|
+
this.initSectionHeaders();
|
501
|
+
const areAllSectionsOpen = this.checkIfAllSectionsOpen();
|
502
|
+
this.updateShowAllButton(areAllSectionsOpen);
|
503
|
+
}
|
504
|
+
initControls() {
|
505
|
+
this.$showAllButton = document.createElement('button');
|
506
|
+
this.$showAllButton.setAttribute('type', 'button');
|
507
|
+
this.$showAllButton.setAttribute('class', this.showAllClass);
|
508
|
+
this.$showAllButton.setAttribute('aria-expanded', 'false');
|
509
|
+
this.$showAllIcon = document.createElement('span');
|
510
|
+
this.$showAllIcon.classList.add(this.upChevronIconClass);
|
511
|
+
this.$showAllButton.appendChild(this.$showAllIcon);
|
512
|
+
const $accordionControls = document.createElement('div');
|
513
|
+
$accordionControls.setAttribute('class', this.controlsClass);
|
514
|
+
$accordionControls.appendChild(this.$showAllButton);
|
515
|
+
this.$module.insertBefore($accordionControls, this.$module.firstChild);
|
516
|
+
this.$showAllText = document.createElement('span');
|
517
|
+
this.$showAllText.classList.add(this.showAllTextClass);
|
518
|
+
this.$showAllButton.appendChild(this.$showAllText);
|
519
|
+
this.$showAllButton.addEventListener('click', () => this.onShowOrHideAllToggle());
|
520
|
+
if ('onbeforematch' in document) {
|
521
|
+
document.addEventListener('beforematch', event => this.onBeforeMatch(event));
|
522
|
+
}
|
523
|
+
}
|
524
|
+
initSectionHeaders() {
|
525
|
+
this.$sections.forEach(($section, i) => {
|
526
|
+
const $header = $section.querySelector(`.${this.sectionHeaderClass}`);
|
527
|
+
if (!$header) {
|
528
|
+
throw new ElementError({
|
529
|
+
componentName: 'Accordion',
|
530
|
+
identifier: `Section headers (\`<div class="${this.sectionHeaderClass}">\`)`
|
531
|
+
});
|
532
|
+
}
|
533
|
+
this.constructHeaderMarkup($header, i);
|
534
|
+
this.setExpanded(this.isExpanded($section), $section);
|
535
|
+
$header.addEventListener('click', () => this.onSectionToggle($section));
|
536
|
+
this.setInitialState($section);
|
537
|
+
});
|
538
|
+
}
|
539
|
+
constructHeaderMarkup($header, index) {
|
540
|
+
const $span = $header.querySelector(`.${this.sectionButtonClass}`);
|
541
|
+
const $heading = $header.querySelector(`.${this.sectionHeadingClass}`);
|
542
|
+
const $summary = $header.querySelector(`.${this.sectionSummaryClass}`);
|
543
|
+
if (!$heading) {
|
544
|
+
throw new ElementError({
|
545
|
+
componentName: 'Accordion',
|
546
|
+
identifier: `Section heading (\`.${this.sectionHeadingClass}\`)`
|
547
|
+
});
|
548
|
+
}
|
549
|
+
if (!$span) {
|
550
|
+
throw new ElementError({
|
551
|
+
componentName: 'Accordion',
|
552
|
+
identifier: `Section button placeholder (\`<span class="${this.sectionButtonClass}">\`)`
|
553
|
+
});
|
554
|
+
}
|
555
|
+
const $button = document.createElement('button');
|
556
|
+
$button.setAttribute('type', 'button');
|
557
|
+
$button.setAttribute('aria-controls', `${this.$module.id}-content-${index + 1}`);
|
558
|
+
for (const attr of Array.from($span.attributes)) {
|
559
|
+
if (attr.nodeName !== 'id') {
|
560
|
+
$button.setAttribute(attr.nodeName, `${attr.nodeValue}`);
|
561
|
+
}
|
562
|
+
}
|
563
|
+
const $headingText = document.createElement('span');
|
564
|
+
$headingText.classList.add(this.sectionHeadingTextClass);
|
565
|
+
$headingText.id = $span.id;
|
566
|
+
const $headingTextFocus = document.createElement('span');
|
567
|
+
$headingTextFocus.classList.add(this.sectionHeadingTextFocusClass);
|
568
|
+
$headingText.appendChild($headingTextFocus);
|
569
|
+
$headingTextFocus.innerHTML = $span.innerHTML;
|
570
|
+
const $showHideToggle = document.createElement('span');
|
571
|
+
$showHideToggle.classList.add(this.sectionShowHideToggleClass);
|
572
|
+
$showHideToggle.setAttribute('data-nosnippet', '');
|
573
|
+
const $showHideToggleFocus = document.createElement('span');
|
574
|
+
$showHideToggleFocus.classList.add(this.sectionShowHideToggleFocusClass);
|
575
|
+
$showHideToggle.appendChild($showHideToggleFocus);
|
576
|
+
const $showHideText = document.createElement('span');
|
577
|
+
const $showHideIcon = document.createElement('span');
|
578
|
+
$showHideIcon.classList.add(this.upChevronIconClass);
|
579
|
+
$showHideToggleFocus.appendChild($showHideIcon);
|
580
|
+
$showHideText.classList.add(this.sectionShowHideTextClass);
|
581
|
+
$showHideToggleFocus.appendChild($showHideText);
|
582
|
+
$button.appendChild($headingText);
|
583
|
+
$button.appendChild(this.getButtonPunctuationEl());
|
584
|
+
if ($summary != null && $summary.parentNode) {
|
585
|
+
const $summarySpan = document.createElement('span');
|
586
|
+
const $summarySpanFocus = document.createElement('span');
|
587
|
+
$summarySpanFocus.classList.add(this.sectionSummaryFocusClass);
|
588
|
+
$summarySpan.appendChild($summarySpanFocus);
|
589
|
+
for (const attr of Array.from($summary.attributes)) {
|
590
|
+
$summarySpan.setAttribute(attr.nodeName, `${attr.nodeValue}`);
|
591
|
+
}
|
592
|
+
$summarySpanFocus.innerHTML = $summary.innerHTML;
|
593
|
+
$summary.parentNode.replaceChild($summarySpan, $summary);
|
594
|
+
$button.appendChild($summarySpan);
|
595
|
+
$button.appendChild(this.getButtonPunctuationEl());
|
596
|
+
}
|
597
|
+
$button.appendChild($showHideToggle);
|
598
|
+
$heading.removeChild($span);
|
599
|
+
$heading.appendChild($button);
|
600
|
+
}
|
601
|
+
onBeforeMatch(event) {
|
602
|
+
const $fragment = event.target;
|
603
|
+
if (!($fragment instanceof Element)) {
|
604
|
+
return;
|
605
|
+
}
|
606
|
+
const $section = $fragment.closest(`.${this.sectionClass}`);
|
607
|
+
if ($section) {
|
608
|
+
this.setExpanded(true, $section);
|
609
|
+
}
|
610
|
+
}
|
611
|
+
onSectionToggle($section) {
|
612
|
+
const expanded = this.isExpanded($section);
|
613
|
+
this.setExpanded(!expanded, $section);
|
614
|
+
this.storeState($section);
|
615
|
+
}
|
616
|
+
onShowOrHideAllToggle() {
|
617
|
+
const nowExpanded = !this.checkIfAllSectionsOpen();
|
618
|
+
this.$sections.forEach($section => {
|
619
|
+
this.setExpanded(nowExpanded, $section);
|
620
|
+
this.storeState($section);
|
621
|
+
});
|
622
|
+
this.updateShowAllButton(nowExpanded);
|
623
|
+
}
|
624
|
+
setExpanded(expanded, $section) {
|
625
|
+
const $showHideIcon = $section.querySelector(`.${this.upChevronIconClass}`);
|
626
|
+
const $showHideText = $section.querySelector(`.${this.sectionShowHideTextClass}`);
|
627
|
+
const $button = $section.querySelector(`.${this.sectionButtonClass}`);
|
628
|
+
const $content = $section.querySelector(`.${this.sectionContentClass}`);
|
629
|
+
if (!$content) {
|
630
|
+
throw new ElementError({
|
631
|
+
componentName: 'Accordion',
|
632
|
+
identifier: `Section content (\`<div class="${this.sectionContentClass}">\`)`
|
633
|
+
});
|
634
|
+
}
|
635
|
+
if (!$showHideIcon || !$showHideText || !$button) {
|
636
|
+
return;
|
637
|
+
}
|
638
|
+
const newButtonText = expanded ? this.i18n.t('hideSection') : this.i18n.t('showSection');
|
639
|
+
$showHideText.textContent = newButtonText;
|
640
|
+
$button.setAttribute('aria-expanded', `${expanded}`);
|
641
|
+
const ariaLabelParts = [];
|
642
|
+
const $headingText = $section.querySelector(`.${this.sectionHeadingTextClass}`);
|
643
|
+
if ($headingText) {
|
644
|
+
ariaLabelParts.push(`${$headingText.textContent}`.trim());
|
645
|
+
}
|
646
|
+
const $summary = $section.querySelector(`.${this.sectionSummaryClass}`);
|
647
|
+
if ($summary) {
|
648
|
+
ariaLabelParts.push(`${$summary.textContent}`.trim());
|
649
|
+
}
|
650
|
+
const ariaLabelMessage = expanded ? this.i18n.t('hideSectionAriaLabel') : this.i18n.t('showSectionAriaLabel');
|
651
|
+
ariaLabelParts.push(ariaLabelMessage);
|
652
|
+
$button.setAttribute('aria-label', ariaLabelParts.join(' , '));
|
653
|
+
if (expanded) {
|
654
|
+
$content.removeAttribute('hidden');
|
655
|
+
$section.classList.add(this.sectionExpandedClass);
|
656
|
+
$showHideIcon.classList.remove(this.downChevronIconClass);
|
657
|
+
} else {
|
658
|
+
$content.setAttribute('hidden', 'until-found');
|
659
|
+
$section.classList.remove(this.sectionExpandedClass);
|
660
|
+
$showHideIcon.classList.add(this.downChevronIconClass);
|
661
|
+
}
|
662
|
+
const areAllSectionsOpen = this.checkIfAllSectionsOpen();
|
663
|
+
this.updateShowAllButton(areAllSectionsOpen);
|
664
|
+
}
|
665
|
+
isExpanded($section) {
|
666
|
+
return $section.classList.contains(this.sectionExpandedClass);
|
667
|
+
}
|
668
|
+
checkIfAllSectionsOpen() {
|
669
|
+
const sectionsCount = this.$sections.length;
|
670
|
+
const expandedSectionCount = this.$module.querySelectorAll(`.${this.sectionExpandedClass}`).length;
|
671
|
+
const areAllSectionsOpen = sectionsCount === expandedSectionCount;
|
672
|
+
return areAllSectionsOpen;
|
673
|
+
}
|
674
|
+
updateShowAllButton(expanded) {
|
675
|
+
if (!this.$showAllButton || !this.$showAllText || !this.$showAllIcon) {
|
676
|
+
return;
|
677
|
+
}
|
678
|
+
this.$showAllButton.setAttribute('aria-expanded', expanded.toString());
|
679
|
+
this.$showAllText.textContent = expanded ? this.i18n.t('hideAllSections') : this.i18n.t('showAllSections');
|
680
|
+
this.$showAllIcon.classList.toggle(this.downChevronIconClass, !expanded);
|
681
|
+
}
|
682
|
+
storeState($section) {
|
683
|
+
if (this.browserSupportsSessionStorage && this.config.rememberExpanded) {
|
684
|
+
const $button = $section.querySelector(`.${this.sectionButtonClass}`);
|
685
|
+
if ($button) {
|
686
|
+
const contentId = $button.getAttribute('aria-controls');
|
687
|
+
const contentState = $button.getAttribute('aria-expanded');
|
688
|
+
if (contentId && contentState) {
|
689
|
+
window.sessionStorage.setItem(contentId, contentState);
|
690
|
+
}
|
691
|
+
}
|
692
|
+
}
|
693
|
+
}
|
694
|
+
setInitialState($section) {
|
695
|
+
if (this.browserSupportsSessionStorage && this.config.rememberExpanded) {
|
696
|
+
const $button = $section.querySelector(`.${this.sectionButtonClass}`);
|
697
|
+
if ($button) {
|
698
|
+
const contentId = $button.getAttribute('aria-controls');
|
699
|
+
const contentState = contentId ? window.sessionStorage.getItem(contentId) : null;
|
700
|
+
if (contentState !== null) {
|
701
|
+
this.setExpanded(contentState === 'true', $section);
|
702
|
+
}
|
703
|
+
}
|
704
|
+
}
|
705
|
+
}
|
706
|
+
getButtonPunctuationEl() {
|
707
|
+
const $punctuationEl = document.createElement('span');
|
708
|
+
$punctuationEl.classList.add('govuk-visually-hidden', this.sectionHeadingDividerClass);
|
709
|
+
$punctuationEl.innerHTML = ', ';
|
710
|
+
return $punctuationEl;
|
711
|
+
}
|
712
|
+
}
|
713
|
+
Accordion.moduleName = 'govuk-accordion';
|
714
|
+
Accordion.defaults = Object.freeze({
|
715
|
+
i18n: {
|
716
|
+
hideAllSections: 'Hide all sections',
|
717
|
+
hideSection: 'Hide',
|
718
|
+
hideSectionAriaLabel: 'Hide this section',
|
719
|
+
showAllSections: 'Show all sections',
|
720
|
+
showSection: 'Show',
|
721
|
+
showSectionAriaLabel: 'Show this section'
|
722
|
+
},
|
723
|
+
rememberExpanded: true
|
724
|
+
});
|
725
|
+
Accordion.schema = Object.freeze({
|
726
|
+
properties: {
|
727
|
+
i18n: {
|
728
|
+
type: 'object'
|
729
|
+
},
|
730
|
+
rememberExpanded: {
|
731
|
+
type: 'boolean'
|
732
|
+
}
|
733
|
+
}
|
734
|
+
});
|
735
|
+
const helper = {
|
736
|
+
/**
|
737
|
+
* Check for `window.sessionStorage`, and that it actually works.
|
738
|
+
*
|
739
|
+
* @returns {boolean} True if session storage is available
|
740
|
+
*/
|
741
|
+
checkForSessionStorage: function () {
|
742
|
+
const testString = 'this is the test string';
|
743
|
+
let result;
|
744
|
+
try {
|
745
|
+
window.sessionStorage.setItem(testString, testString);
|
746
|
+
result = window.sessionStorage.getItem(testString) === testString.toString();
|
747
|
+
window.sessionStorage.removeItem(testString);
|
748
|
+
return result;
|
749
|
+
} catch (exception) {
|
750
|
+
return false;
|
751
|
+
}
|
752
|
+
}
|
753
|
+
};
|
754
|
+
|
755
|
+
/**
|
756
|
+
* Accordion config
|
757
|
+
*
|
758
|
+
* @see {@link Accordion.defaults}
|
759
|
+
* @typedef {object} AccordionConfig
|
760
|
+
* @property {AccordionTranslations} [i18n=Accordion.defaults.i18n] - Accordion translations
|
761
|
+
* @property {boolean} [rememberExpanded] - Whether the expanded and collapsed
|
762
|
+
* state of each section is remembered and restored when navigating.
|
763
|
+
*/
|
764
|
+
|
765
|
+
/**
|
766
|
+
* Accordion translations
|
767
|
+
*
|
768
|
+
* @see {@link Accordion.defaults.i18n}
|
769
|
+
* @typedef {object} AccordionTranslations
|
770
|
+
*
|
771
|
+
* Messages used by the component for the labels of its buttons. This includes
|
772
|
+
* the visible text shown on screen, and text to help assistive technology users
|
773
|
+
* for the buttons toggling each section.
|
774
|
+
* @property {string} [hideAllSections] - The text content for the 'Hide all
|
775
|
+
* sections' button, used when at least one section is expanded.
|
776
|
+
* @property {string} [hideSection] - The text content for the 'Hide'
|
777
|
+
* button, used when a section is expanded.
|
778
|
+
* @property {string} [hideSectionAriaLabel] - The text content appended to the
|
779
|
+
* 'Hide' button's accessible name when a section is expanded.
|
780
|
+
* @property {string} [showAllSections] - The text content for the 'Show all
|
781
|
+
* sections' button, used when all sections are collapsed.
|
782
|
+
* @property {string} [showSection] - The text content for the 'Show'
|
783
|
+
* button, used when a section is collapsed.
|
784
|
+
* @property {string} [showSectionAriaLabel] - The text content appended to the
|
785
|
+
* 'Show' button's accessible name when a section is expanded.
|
786
|
+
*/
|
787
|
+
|
788
|
+
/**
|
789
|
+
* @typedef {import('../../common/index.mjs').Schema} Schema
|
790
|
+
*/
|
791
|
+
|
792
|
+
const DEBOUNCE_TIMEOUT_IN_SECONDS = 1;
|
793
|
+
|
794
|
+
/**
|
795
|
+
* JavaScript enhancements for the Button component
|
796
|
+
*
|
797
|
+
* @preserve
|
798
|
+
*/
|
799
|
+
class Button extends GOVUKFrontendComponent {
|
800
|
+
/**
|
801
|
+
* @param {Element | null} $module - HTML element to use for button
|
802
|
+
* @param {ButtonConfig} [config] - Button config
|
803
|
+
*/
|
804
|
+
constructor($module, config = {}) {
|
805
|
+
super();
|
806
|
+
this.$module = void 0;
|
807
|
+
this.config = void 0;
|
808
|
+
this.debounceFormSubmitTimer = null;
|
809
|
+
if (!($module instanceof HTMLElement)) {
|
810
|
+
throw new ElementError({
|
811
|
+
componentName: 'Button',
|
812
|
+
element: $module,
|
813
|
+
identifier: 'Root element (`$module`)'
|
814
|
+
});
|
815
|
+
}
|
816
|
+
this.$module = $module;
|
817
|
+
this.config = mergeConfigs(Button.defaults, config, normaliseDataset(Button, $module.dataset));
|
818
|
+
this.$module.addEventListener('keydown', event => this.handleKeyDown(event));
|
819
|
+
this.$module.addEventListener('click', event => this.debounce(event));
|
820
|
+
}
|
821
|
+
handleKeyDown(event) {
|
822
|
+
const $target = event.target;
|
823
|
+
if (event.key !== ' ') {
|
824
|
+
return;
|
825
|
+
}
|
826
|
+
if ($target instanceof HTMLElement && $target.getAttribute('role') === 'button') {
|
827
|
+
event.preventDefault();
|
828
|
+
$target.click();
|
829
|
+
}
|
830
|
+
}
|
831
|
+
debounce(event) {
|
832
|
+
if (!this.config.preventDoubleClick) {
|
833
|
+
return;
|
834
|
+
}
|
835
|
+
if (this.debounceFormSubmitTimer) {
|
836
|
+
event.preventDefault();
|
837
|
+
return false;
|
838
|
+
}
|
839
|
+
this.debounceFormSubmitTimer = window.setTimeout(() => {
|
840
|
+
this.debounceFormSubmitTimer = null;
|
841
|
+
}, DEBOUNCE_TIMEOUT_IN_SECONDS * 1000);
|
842
|
+
}
|
843
|
+
}
|
844
|
+
|
845
|
+
/**
|
846
|
+
* Button config
|
847
|
+
*
|
848
|
+
* @typedef {object} ButtonConfig
|
849
|
+
* @property {boolean} [preventDoubleClick=false] - Prevent accidental double
|
850
|
+
* clicks on submit buttons from submitting forms multiple times.
|
851
|
+
*/
|
852
|
+
|
853
|
+
/**
|
854
|
+
* @typedef {import('../../common/index.mjs').Schema} Schema
|
855
|
+
*/
|
856
|
+
Button.moduleName = 'govuk-button';
|
857
|
+
Button.defaults = Object.freeze({
|
858
|
+
preventDoubleClick: false
|
859
|
+
});
|
860
|
+
Button.schema = Object.freeze({
|
861
|
+
properties: {
|
862
|
+
preventDoubleClick: {
|
863
|
+
type: 'boolean'
|
864
|
+
}
|
865
|
+
}
|
866
|
+
});
|
867
|
+
|
868
|
+
function closestAttributeValue($element, attributeName) {
|
869
|
+
const $closestElementWithAttribute = $element.closest(`[${attributeName}]`);
|
870
|
+
return $closestElementWithAttribute ? $closestElementWithAttribute.getAttribute(attributeName) : null;
|
871
|
+
}
|
872
|
+
|
873
|
+
/**
|
874
|
+
* Character count component
|
875
|
+
*
|
876
|
+
* Tracks the number of characters or words in the `.govuk-js-character-count`
|
877
|
+
* `<textarea>` inside the element. Displays a message with the remaining number
|
878
|
+
* of characters/words available, or the number of characters/words in excess.
|
879
|
+
*
|
880
|
+
* You can configure the message to only appear after a certain percentage
|
881
|
+
* of the available characters/words has been entered.
|
882
|
+
*
|
883
|
+
* @preserve
|
884
|
+
*/
|
885
|
+
class CharacterCount extends GOVUKFrontendComponent {
|
886
|
+
/**
|
887
|
+
* @param {Element | null} $module - HTML element to use for character count
|
888
|
+
* @param {CharacterCountConfig} [config] - Character count config
|
889
|
+
*/
|
890
|
+
constructor($module, config = {}) {
|
891
|
+
var _ref, _this$config$maxwords;
|
892
|
+
super();
|
893
|
+
this.$module = void 0;
|
894
|
+
this.$textarea = void 0;
|
895
|
+
this.$visibleCountMessage = void 0;
|
896
|
+
this.$screenReaderCountMessage = void 0;
|
897
|
+
this.lastInputTimestamp = null;
|
898
|
+
this.lastInputValue = '';
|
899
|
+
this.valueChecker = null;
|
900
|
+
this.config = void 0;
|
901
|
+
this.i18n = void 0;
|
902
|
+
this.maxLength = void 0;
|
903
|
+
if (!($module instanceof HTMLElement)) {
|
904
|
+
throw new ElementError({
|
905
|
+
componentName: 'Character count',
|
906
|
+
element: $module,
|
907
|
+
identifier: 'Root element (`$module`)'
|
908
|
+
});
|
909
|
+
}
|
910
|
+
const $textarea = $module.querySelector('.govuk-js-character-count');
|
911
|
+
if (!($textarea instanceof HTMLTextAreaElement || $textarea instanceof HTMLInputElement)) {
|
912
|
+
throw new ElementError({
|
913
|
+
componentName: 'Character count',
|
914
|
+
element: $textarea,
|
915
|
+
expectedType: 'HTMLTextareaElement or HTMLInputElement',
|
916
|
+
identifier: 'Form field (`.govuk-js-character-count`)'
|
917
|
+
});
|
918
|
+
}
|
919
|
+
const datasetConfig = normaliseDataset(CharacterCount, $module.dataset);
|
920
|
+
let configOverrides = {};
|
921
|
+
if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {
|
922
|
+
configOverrides = {
|
923
|
+
maxlength: undefined,
|
924
|
+
maxwords: undefined
|
925
|
+
};
|
926
|
+
}
|
927
|
+
this.config = mergeConfigs(CharacterCount.defaults, config, configOverrides, datasetConfig);
|
928
|
+
const errors = validateConfig(CharacterCount.schema, this.config);
|
929
|
+
if (errors[0]) {
|
930
|
+
throw new ConfigError(`Character count: ${errors[0]}`);
|
931
|
+
}
|
932
|
+
this.i18n = new I18n(this.config.i18n, {
|
933
|
+
locale: closestAttributeValue($module, 'lang')
|
934
|
+
});
|
935
|
+
this.maxLength = (_ref = (_this$config$maxwords = this.config.maxwords) != null ? _this$config$maxwords : this.config.maxlength) != null ? _ref : Infinity;
|
936
|
+
this.$module = $module;
|
937
|
+
this.$textarea = $textarea;
|
938
|
+
const textareaDescriptionId = `${this.$textarea.id}-info`;
|
939
|
+
const $textareaDescription = document.getElementById(textareaDescriptionId);
|
940
|
+
if (!$textareaDescription) {
|
941
|
+
throw new ElementError({
|
942
|
+
componentName: 'Character count',
|
943
|
+
element: $textareaDescription,
|
944
|
+
identifier: `Count message (\`id="${textareaDescriptionId}"\`)`
|
945
|
+
});
|
946
|
+
}
|
947
|
+
if (`${$textareaDescription.textContent}`.match(/^\s*$/)) {
|
948
|
+
$textareaDescription.textContent = this.i18n.t('textareaDescription', {
|
949
|
+
count: this.maxLength
|
950
|
+
});
|
951
|
+
}
|
952
|
+
this.$textarea.insertAdjacentElement('afterend', $textareaDescription);
|
953
|
+
const $screenReaderCountMessage = document.createElement('div');
|
954
|
+
$screenReaderCountMessage.className = 'govuk-character-count__sr-status govuk-visually-hidden';
|
955
|
+
$screenReaderCountMessage.setAttribute('aria-live', 'polite');
|
956
|
+
this.$screenReaderCountMessage = $screenReaderCountMessage;
|
957
|
+
$textareaDescription.insertAdjacentElement('afterend', $screenReaderCountMessage);
|
958
|
+
const $visibleCountMessage = document.createElement('div');
|
959
|
+
$visibleCountMessage.className = $textareaDescription.className;
|
960
|
+
$visibleCountMessage.classList.add('govuk-character-count__status');
|
961
|
+
$visibleCountMessage.setAttribute('aria-hidden', 'true');
|
962
|
+
this.$visibleCountMessage = $visibleCountMessage;
|
963
|
+
$textareaDescription.insertAdjacentElement('afterend', $visibleCountMessage);
|
964
|
+
$textareaDescription.classList.add('govuk-visually-hidden');
|
965
|
+
this.$textarea.removeAttribute('maxlength');
|
966
|
+
this.bindChangeEvents();
|
967
|
+
window.addEventListener('pageshow', () => this.updateCountMessage());
|
968
|
+
this.updateCountMessage();
|
969
|
+
}
|
970
|
+
bindChangeEvents() {
|
971
|
+
this.$textarea.addEventListener('keyup', () => this.handleKeyUp());
|
972
|
+
this.$textarea.addEventListener('focus', () => this.handleFocus());
|
973
|
+
this.$textarea.addEventListener('blur', () => this.handleBlur());
|
974
|
+
}
|
975
|
+
handleKeyUp() {
|
976
|
+
this.updateVisibleCountMessage();
|
977
|
+
this.lastInputTimestamp = Date.now();
|
978
|
+
}
|
979
|
+
handleFocus() {
|
980
|
+
this.valueChecker = window.setInterval(() => {
|
981
|
+
if (!this.lastInputTimestamp || Date.now() - 500 >= this.lastInputTimestamp) {
|
982
|
+
this.updateIfValueChanged();
|
983
|
+
}
|
984
|
+
}, 1000);
|
985
|
+
}
|
986
|
+
handleBlur() {
|
987
|
+
if (this.valueChecker) {
|
988
|
+
window.clearInterval(this.valueChecker);
|
989
|
+
}
|
990
|
+
}
|
991
|
+
updateIfValueChanged() {
|
992
|
+
if (this.$textarea.value !== this.lastInputValue) {
|
993
|
+
this.lastInputValue = this.$textarea.value;
|
994
|
+
this.updateCountMessage();
|
995
|
+
}
|
996
|
+
}
|
997
|
+
updateCountMessage() {
|
998
|
+
this.updateVisibleCountMessage();
|
999
|
+
this.updateScreenReaderCountMessage();
|
1000
|
+
}
|
1001
|
+
updateVisibleCountMessage() {
|
1002
|
+
const remainingNumber = this.maxLength - this.count(this.$textarea.value);
|
1003
|
+
const isError = remainingNumber < 0;
|
1004
|
+
this.$visibleCountMessage.classList.toggle('govuk-character-count__message--disabled', !this.isOverThreshold());
|
1005
|
+
this.$textarea.classList.toggle('govuk-textarea--error', isError);
|
1006
|
+
this.$visibleCountMessage.classList.toggle('govuk-error-message', isError);
|
1007
|
+
this.$visibleCountMessage.classList.toggle('govuk-hint', !isError);
|
1008
|
+
this.$visibleCountMessage.textContent = this.getCountMessage();
|
1009
|
+
}
|
1010
|
+
updateScreenReaderCountMessage() {
|
1011
|
+
if (this.isOverThreshold()) {
|
1012
|
+
this.$screenReaderCountMessage.removeAttribute('aria-hidden');
|
1013
|
+
} else {
|
1014
|
+
this.$screenReaderCountMessage.setAttribute('aria-hidden', 'true');
|
1015
|
+
}
|
1016
|
+
this.$screenReaderCountMessage.textContent = this.getCountMessage();
|
1017
|
+
}
|
1018
|
+
count(text) {
|
1019
|
+
if (this.config.maxwords) {
|
1020
|
+
var _text$match;
|
1021
|
+
const tokens = (_text$match = text.match(/\S+/g)) != null ? _text$match : [];
|
1022
|
+
return tokens.length;
|
1023
|
+
}
|
1024
|
+
return text.length;
|
1025
|
+
}
|
1026
|
+
getCountMessage() {
|
1027
|
+
const remainingNumber = this.maxLength - this.count(this.$textarea.value);
|
1028
|
+
const countType = this.config.maxwords ? 'words' : 'characters';
|
1029
|
+
return this.formatCountMessage(remainingNumber, countType);
|
1030
|
+
}
|
1031
|
+
formatCountMessage(remainingNumber, countType) {
|
1032
|
+
if (remainingNumber === 0) {
|
1033
|
+
return this.i18n.t(`${countType}AtLimit`);
|
1034
|
+
}
|
1035
|
+
const translationKeySuffix = remainingNumber < 0 ? 'OverLimit' : 'UnderLimit';
|
1036
|
+
return this.i18n.t(`${countType}${translationKeySuffix}`, {
|
1037
|
+
count: Math.abs(remainingNumber)
|
1038
|
+
});
|
1039
|
+
}
|
1040
|
+
isOverThreshold() {
|
1041
|
+
if (!this.config.threshold) {
|
1042
|
+
return true;
|
1043
|
+
}
|
1044
|
+
const currentLength = this.count(this.$textarea.value);
|
1045
|
+
const maxLength = this.maxLength;
|
1046
|
+
const thresholdValue = maxLength * this.config.threshold / 100;
|
1047
|
+
return thresholdValue <= currentLength;
|
1048
|
+
}
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
/**
|
1052
|
+
* Character count config
|
1053
|
+
*
|
1054
|
+
* @see {@link CharacterCount.defaults}
|
1055
|
+
* @typedef {object} CharacterCountConfig
|
1056
|
+
* @property {number} [maxlength] - The maximum number of characters.
|
1057
|
+
* If maxwords is provided, the maxlength option will be ignored.
|
1058
|
+
* @property {number} [maxwords] - The maximum number of words. If maxwords is
|
1059
|
+
* provided, the maxlength option will be ignored.
|
1060
|
+
* @property {number} [threshold=0] - The percentage value of the limit at
|
1061
|
+
* which point the count message is displayed. If this attribute is set, the
|
1062
|
+
* count message will be hidden by default.
|
1063
|
+
* @property {CharacterCountTranslations} [i18n=CharacterCount.defaults.i18n] - Character count translations
|
1064
|
+
*/
|
1065
|
+
|
1066
|
+
/**
|
1067
|
+
* Character count translations
|
1068
|
+
*
|
1069
|
+
* @see {@link CharacterCount.defaults.i18n}
|
1070
|
+
* @typedef {object} CharacterCountTranslations
|
1071
|
+
*
|
1072
|
+
* Messages shown to users as they type. It provides feedback on how many words
|
1073
|
+
* or characters they have remaining or if they are over the limit. This also
|
1074
|
+
* includes a message used as an accessible description for the textarea.
|
1075
|
+
* @property {TranslationPluralForms} [charactersUnderLimit] - Message displayed
|
1076
|
+
* when the number of characters is under the configured maximum, `maxlength`.
|
1077
|
+
* This message is displayed visually and through assistive technologies. The
|
1078
|
+
* component will replace the `%{count}` placeholder with the number of
|
1079
|
+
* remaining characters. This is a [pluralised list of
|
1080
|
+
* messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).
|
1081
|
+
* @property {string} [charactersAtLimit] - Message displayed when the number of
|
1082
|
+
* characters reaches the configured maximum, `maxlength`. This message is
|
1083
|
+
* displayed visually and through assistive technologies.
|
1084
|
+
* @property {TranslationPluralForms} [charactersOverLimit] - Message displayed
|
1085
|
+
* when the number of characters is over the configured maximum, `maxlength`.
|
1086
|
+
* This message is displayed visually and through assistive technologies. The
|
1087
|
+
* component will replace the `%{count}` placeholder with the number of
|
1088
|
+
* remaining characters. This is a [pluralised list of
|
1089
|
+
* messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).
|
1090
|
+
* @property {TranslationPluralForms} [wordsUnderLimit] - Message displayed when
|
1091
|
+
* the number of words is under the configured maximum, `maxlength`. This
|
1092
|
+
* message is displayed visually and through assistive technologies. The
|
1093
|
+
* component will replace the `%{count}` placeholder with the number of
|
1094
|
+
* remaining words. This is a [pluralised list of
|
1095
|
+
* messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).
|
1096
|
+
* @property {string} [wordsAtLimit] - Message displayed when the number of
|
1097
|
+
* words reaches the configured maximum, `maxlength`. This message is
|
1098
|
+
* displayed visually and through assistive technologies.
|
1099
|
+
* @property {TranslationPluralForms} [wordsOverLimit] - Message displayed when
|
1100
|
+
* the number of words is over the configured maximum, `maxlength`. This
|
1101
|
+
* message is displayed visually and through assistive technologies. The
|
1102
|
+
* component will replace the `%{count}` placeholder with the number of
|
1103
|
+
* remaining words. This is a [pluralised list of
|
1104
|
+
* messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).
|
1105
|
+
* @property {TranslationPluralForms} [textareaDescription] - Message made
|
1106
|
+
* available to assistive technologies, if none is already present in the
|
1107
|
+
* HTML, to describe that the component accepts only a limited amount of
|
1108
|
+
* content. It is visible on the page when JavaScript is unavailable. The
|
1109
|
+
* component will replace the `%{count}` placeholder with the value of the
|
1110
|
+
* `maxlength` or `maxwords` parameter.
|
1111
|
+
*/
|
1112
|
+
|
1113
|
+
/**
|
1114
|
+
* @typedef {import('../../common/index.mjs').Schema} Schema
|
1115
|
+
* @typedef {import('../../i18n.mjs').TranslationPluralForms} TranslationPluralForms
|
1116
|
+
*/
|
1117
|
+
CharacterCount.moduleName = 'govuk-character-count';
|
1118
|
+
CharacterCount.defaults = Object.freeze({
|
1119
|
+
threshold: 0,
|
1120
|
+
i18n: {
|
1121
|
+
charactersUnderLimit: {
|
1122
|
+
one: 'You have %{count} character remaining',
|
1123
|
+
other: 'You have %{count} characters remaining'
|
1124
|
+
},
|
1125
|
+
charactersAtLimit: 'You have 0 characters remaining',
|
1126
|
+
charactersOverLimit: {
|
1127
|
+
one: 'You have %{count} character too many',
|
1128
|
+
other: 'You have %{count} characters too many'
|
1129
|
+
},
|
1130
|
+
wordsUnderLimit: {
|
1131
|
+
one: 'You have %{count} word remaining',
|
1132
|
+
other: 'You have %{count} words remaining'
|
1133
|
+
},
|
1134
|
+
wordsAtLimit: 'You have 0 words remaining',
|
1135
|
+
wordsOverLimit: {
|
1136
|
+
one: 'You have %{count} word too many',
|
1137
|
+
other: 'You have %{count} words too many'
|
1138
|
+
},
|
1139
|
+
textareaDescription: {
|
1140
|
+
other: ''
|
1141
|
+
}
|
1142
|
+
}
|
1143
|
+
});
|
1144
|
+
CharacterCount.schema = Object.freeze({
|
1145
|
+
properties: {
|
1146
|
+
i18n: {
|
1147
|
+
type: 'object'
|
1148
|
+
},
|
1149
|
+
maxwords: {
|
1150
|
+
type: 'number'
|
1151
|
+
},
|
1152
|
+
maxlength: {
|
1153
|
+
type: 'number'
|
1154
|
+
},
|
1155
|
+
threshold: {
|
1156
|
+
type: 'number'
|
1157
|
+
}
|
1158
|
+
},
|
1159
|
+
anyOf: [{
|
1160
|
+
required: ['maxwords'],
|
1161
|
+
errorMessage: 'Either "maxlength" or "maxwords" must be provided'
|
1162
|
+
}, {
|
1163
|
+
required: ['maxlength'],
|
1164
|
+
errorMessage: 'Either "maxlength" or "maxwords" must be provided'
|
1165
|
+
}]
|
1166
|
+
});
|
1167
|
+
|
1168
|
+
/**
|
1169
|
+
* Checkboxes component
|
1170
|
+
*
|
1171
|
+
* @preserve
|
1172
|
+
*/
|
1173
|
+
class Checkboxes extends GOVUKFrontendComponent {
|
1174
|
+
/**
|
1175
|
+
* Checkboxes can be associated with a 'conditionally revealed' content block
|
1176
|
+
* – for example, a checkbox for 'Phone' could reveal an additional form field
|
1177
|
+
* for the user to enter their phone number.
|
1178
|
+
*
|
1179
|
+
* These associations are made using a `data-aria-controls` attribute, which
|
1180
|
+
* is promoted to an aria-controls attribute during initialisation.
|
1181
|
+
*
|
1182
|
+
* We also need to restore the state of any conditional reveals on the page
|
1183
|
+
* (for example if the user has navigated back), and set up event handlers to
|
1184
|
+
* keep the reveal in sync with the checkbox state.
|
1185
|
+
*
|
1186
|
+
* @param {Element | null} $module - HTML element to use for checkboxes
|
1187
|
+
*/
|
1188
|
+
constructor($module) {
|
1189
|
+
super();
|
1190
|
+
this.$module = void 0;
|
1191
|
+
this.$inputs = void 0;
|
1192
|
+
if (!($module instanceof HTMLElement)) {
|
1193
|
+
throw new ElementError({
|
1194
|
+
componentName: 'Checkboxes',
|
1195
|
+
element: $module,
|
1196
|
+
identifier: 'Root element (`$module`)'
|
1197
|
+
});
|
1198
|
+
}
|
1199
|
+
const $inputs = $module.querySelectorAll('input[type="checkbox"]');
|
1200
|
+
if (!$inputs.length) {
|
1201
|
+
throw new ElementError({
|
1202
|
+
componentName: 'Checkboxes',
|
1203
|
+
identifier: 'Form inputs (`<input type="checkbox">`)'
|
1204
|
+
});
|
1205
|
+
}
|
1206
|
+
this.$module = $module;
|
1207
|
+
this.$inputs = $inputs;
|
1208
|
+
this.$inputs.forEach($input => {
|
1209
|
+
const targetId = $input.getAttribute('data-aria-controls');
|
1210
|
+
if (!targetId) {
|
1211
|
+
return;
|
1212
|
+
}
|
1213
|
+
if (!document.getElementById(targetId)) {
|
1214
|
+
throw new ElementError({
|
1215
|
+
componentName: 'Checkboxes',
|
1216
|
+
identifier: `Conditional reveal (\`id="${targetId}"\`)`
|
1217
|
+
});
|
1218
|
+
}
|
1219
|
+
$input.setAttribute('aria-controls', targetId);
|
1220
|
+
$input.removeAttribute('data-aria-controls');
|
1221
|
+
});
|
1222
|
+
window.addEventListener('pageshow', () => this.syncAllConditionalReveals());
|
1223
|
+
this.syncAllConditionalReveals();
|
1224
|
+
this.$module.addEventListener('click', event => this.handleClick(event));
|
1225
|
+
}
|
1226
|
+
syncAllConditionalReveals() {
|
1227
|
+
this.$inputs.forEach($input => this.syncConditionalRevealWithInputState($input));
|
1228
|
+
}
|
1229
|
+
syncConditionalRevealWithInputState($input) {
|
1230
|
+
const targetId = $input.getAttribute('aria-controls');
|
1231
|
+
if (!targetId) {
|
1232
|
+
return;
|
1233
|
+
}
|
1234
|
+
const $target = document.getElementById(targetId);
|
1235
|
+
if ($target != null && $target.classList.contains('govuk-checkboxes__conditional')) {
|
1236
|
+
const inputIsChecked = $input.checked;
|
1237
|
+
$input.setAttribute('aria-expanded', inputIsChecked.toString());
|
1238
|
+
$target.classList.toggle('govuk-checkboxes__conditional--hidden', !inputIsChecked);
|
1239
|
+
}
|
1240
|
+
}
|
1241
|
+
unCheckAllInputsExcept($input) {
|
1242
|
+
const allInputsWithSameName = document.querySelectorAll(`input[type="checkbox"][name="${$input.name}"]`);
|
1243
|
+
allInputsWithSameName.forEach($inputWithSameName => {
|
1244
|
+
const hasSameFormOwner = $input.form === $inputWithSameName.form;
|
1245
|
+
if (hasSameFormOwner && $inputWithSameName !== $input) {
|
1246
|
+
$inputWithSameName.checked = false;
|
1247
|
+
this.syncConditionalRevealWithInputState($inputWithSameName);
|
1248
|
+
}
|
1249
|
+
});
|
1250
|
+
}
|
1251
|
+
unCheckExclusiveInputs($input) {
|
1252
|
+
const allInputsWithSameNameAndExclusiveBehaviour = document.querySelectorAll(`input[data-behaviour="exclusive"][type="checkbox"][name="${$input.name}"]`);
|
1253
|
+
allInputsWithSameNameAndExclusiveBehaviour.forEach($exclusiveInput => {
|
1254
|
+
const hasSameFormOwner = $input.form === $exclusiveInput.form;
|
1255
|
+
if (hasSameFormOwner) {
|
1256
|
+
$exclusiveInput.checked = false;
|
1257
|
+
this.syncConditionalRevealWithInputState($exclusiveInput);
|
1258
|
+
}
|
1259
|
+
});
|
1260
|
+
}
|
1261
|
+
handleClick(event) {
|
1262
|
+
const $clickedInput = event.target;
|
1263
|
+
if (!($clickedInput instanceof HTMLInputElement) || $clickedInput.type !== 'checkbox') {
|
1264
|
+
return;
|
1265
|
+
}
|
1266
|
+
const hasAriaControls = $clickedInput.getAttribute('aria-controls');
|
1267
|
+
if (hasAriaControls) {
|
1268
|
+
this.syncConditionalRevealWithInputState($clickedInput);
|
1269
|
+
}
|
1270
|
+
if (!$clickedInput.checked) {
|
1271
|
+
return;
|
1272
|
+
}
|
1273
|
+
const hasBehaviourExclusive = $clickedInput.getAttribute('data-behaviour') === 'exclusive';
|
1274
|
+
if (hasBehaviourExclusive) {
|
1275
|
+
this.unCheckAllInputsExcept($clickedInput);
|
1276
|
+
} else {
|
1277
|
+
this.unCheckExclusiveInputs($clickedInput);
|
1278
|
+
}
|
1279
|
+
}
|
1280
|
+
}
|
1281
|
+
Checkboxes.moduleName = 'govuk-checkboxes';
|
1282
|
+
|
1283
|
+
/**
|
1284
|
+
* Error summary component
|
1285
|
+
*
|
1286
|
+
* Takes focus on initialisation for accessible announcement, unless disabled in
|
1287
|
+
* configuration.
|
1288
|
+
*
|
1289
|
+
* @preserve
|
1290
|
+
*/
|
1291
|
+
class ErrorSummary extends GOVUKFrontendComponent {
|
1292
|
+
/**
|
1293
|
+
* @param {Element | null} $module - HTML element to use for error summary
|
1294
|
+
* @param {ErrorSummaryConfig} [config] - Error summary config
|
1295
|
+
*/
|
1296
|
+
constructor($module, config = {}) {
|
1297
|
+
super();
|
1298
|
+
this.$module = void 0;
|
1299
|
+
this.config = void 0;
|
1300
|
+
if (!($module instanceof HTMLElement)) {
|
1301
|
+
throw new ElementError({
|
1302
|
+
componentName: 'Error summary',
|
1303
|
+
element: $module,
|
1304
|
+
identifier: 'Root element (`$module`)'
|
1305
|
+
});
|
1306
|
+
}
|
1307
|
+
this.$module = $module;
|
1308
|
+
this.config = mergeConfigs(ErrorSummary.defaults, config, normaliseDataset(ErrorSummary, $module.dataset));
|
1309
|
+
if (!this.config.disableAutoFocus) {
|
1310
|
+
setFocus(this.$module);
|
1311
|
+
}
|
1312
|
+
this.$module.addEventListener('click', event => this.handleClick(event));
|
1313
|
+
}
|
1314
|
+
handleClick(event) {
|
1315
|
+
const $target = event.target;
|
1316
|
+
if ($target && this.focusTarget($target)) {
|
1317
|
+
event.preventDefault();
|
1318
|
+
}
|
1319
|
+
}
|
1320
|
+
focusTarget($target) {
|
1321
|
+
if (!($target instanceof HTMLAnchorElement)) {
|
1322
|
+
return false;
|
1323
|
+
}
|
1324
|
+
const inputId = getFragmentFromUrl($target.href);
|
1325
|
+
if (!inputId) {
|
1326
|
+
return false;
|
1327
|
+
}
|
1328
|
+
const $input = document.getElementById(inputId);
|
1329
|
+
if (!$input) {
|
1330
|
+
return false;
|
1331
|
+
}
|
1332
|
+
const $legendOrLabel = this.getAssociatedLegendOrLabel($input);
|
1333
|
+
if (!$legendOrLabel) {
|
1334
|
+
return false;
|
1335
|
+
}
|
1336
|
+
$legendOrLabel.scrollIntoView();
|
1337
|
+
$input.focus({
|
1338
|
+
preventScroll: true
|
1339
|
+
});
|
1340
|
+
return true;
|
1341
|
+
}
|
1342
|
+
getAssociatedLegendOrLabel($input) {
|
1343
|
+
var _document$querySelect;
|
1344
|
+
const $fieldset = $input.closest('fieldset');
|
1345
|
+
if ($fieldset) {
|
1346
|
+
const $legends = $fieldset.getElementsByTagName('legend');
|
1347
|
+
if ($legends.length) {
|
1348
|
+
const $candidateLegend = $legends[0];
|
1349
|
+
if ($input instanceof HTMLInputElement && ($input.type === 'checkbox' || $input.type === 'radio')) {
|
1350
|
+
return $candidateLegend;
|
1351
|
+
}
|
1352
|
+
const legendTop = $candidateLegend.getBoundingClientRect().top;
|
1353
|
+
const inputRect = $input.getBoundingClientRect();
|
1354
|
+
if (inputRect.height && window.innerHeight) {
|
1355
|
+
const inputBottom = inputRect.top + inputRect.height;
|
1356
|
+
if (inputBottom - legendTop < window.innerHeight / 2) {
|
1357
|
+
return $candidateLegend;
|
1358
|
+
}
|
1359
|
+
}
|
1360
|
+
}
|
1361
|
+
}
|
1362
|
+
return (_document$querySelect = document.querySelector(`label[for='${$input.getAttribute('id')}']`)) != null ? _document$querySelect : $input.closest('label');
|
1363
|
+
}
|
1364
|
+
}
|
1365
|
+
|
1366
|
+
/**
|
1367
|
+
* Error summary config
|
1368
|
+
*
|
1369
|
+
* @typedef {object} ErrorSummaryConfig
|
1370
|
+
* @property {boolean} [disableAutoFocus=false] - If set to `true` the error
|
1371
|
+
* summary will not be focussed when the page loads.
|
1372
|
+
*/
|
1373
|
+
|
1374
|
+
/**
|
1375
|
+
* @typedef {import('../../common/index.mjs').Schema} Schema
|
1376
|
+
*/
|
1377
|
+
ErrorSummary.moduleName = 'govuk-error-summary';
|
1378
|
+
ErrorSummary.defaults = Object.freeze({
|
1379
|
+
disableAutoFocus: false
|
1380
|
+
});
|
1381
|
+
ErrorSummary.schema = Object.freeze({
|
1382
|
+
properties: {
|
1383
|
+
disableAutoFocus: {
|
1384
|
+
type: 'boolean'
|
1385
|
+
}
|
1386
|
+
}
|
1387
|
+
});
|
1388
|
+
|
1389
|
+
/**
|
1390
|
+
* Exit this page component
|
1391
|
+
*
|
1392
|
+
* @preserve
|
1393
|
+
*/
|
1394
|
+
class ExitThisPage extends GOVUKFrontendComponent {
|
1395
|
+
/**
|
1396
|
+
* @param {Element | null} $module - HTML element that wraps the Exit This Page button
|
1397
|
+
* @param {ExitThisPageConfig} [config] - Exit This Page config
|
1398
|
+
*/
|
1399
|
+
constructor($module, config = {}) {
|
1400
|
+
super();
|
1401
|
+
this.$module = void 0;
|
1402
|
+
this.config = void 0;
|
1403
|
+
this.i18n = void 0;
|
1404
|
+
this.$button = void 0;
|
1405
|
+
this.$skiplinkButton = null;
|
1406
|
+
this.$updateSpan = null;
|
1407
|
+
this.$indicatorContainer = null;
|
1408
|
+
this.$overlay = null;
|
1409
|
+
this.keypressCounter = 0;
|
1410
|
+
this.lastKeyWasModified = false;
|
1411
|
+
this.timeoutTime = 5000;
|
1412
|
+
this.keypressTimeoutId = null;
|
1413
|
+
this.timeoutMessageId = null;
|
1414
|
+
if (!($module instanceof HTMLElement)) {
|
1415
|
+
throw new ElementError({
|
1416
|
+
componentName: 'Exit this page',
|
1417
|
+
element: $module,
|
1418
|
+
identifier: 'Root element (`$module`)'
|
1419
|
+
});
|
1420
|
+
}
|
1421
|
+
const $button = $module.querySelector('.govuk-exit-this-page__button');
|
1422
|
+
if (!($button instanceof HTMLAnchorElement)) {
|
1423
|
+
throw new ElementError({
|
1424
|
+
componentName: 'Exit this page',
|
1425
|
+
element: $button,
|
1426
|
+
expectedType: 'HTMLAnchorElement',
|
1427
|
+
identifier: 'Button (`.govuk-exit-this-page__button`)'
|
1428
|
+
});
|
1429
|
+
}
|
1430
|
+
this.config = mergeConfigs(ExitThisPage.defaults, config, normaliseDataset(ExitThisPage, $module.dataset));
|
1431
|
+
this.i18n = new I18n(this.config.i18n);
|
1432
|
+
this.$module = $module;
|
1433
|
+
this.$button = $button;
|
1434
|
+
const $skiplinkButton = document.querySelector('.govuk-js-exit-this-page-skiplink');
|
1435
|
+
if ($skiplinkButton instanceof HTMLAnchorElement) {
|
1436
|
+
this.$skiplinkButton = $skiplinkButton;
|
1437
|
+
}
|
1438
|
+
this.buildIndicator();
|
1439
|
+
this.initUpdateSpan();
|
1440
|
+
this.initButtonClickHandler();
|
1441
|
+
if (!('govukFrontendExitThisPageKeypress' in document.body.dataset)) {
|
1442
|
+
document.addEventListener('keyup', this.handleKeypress.bind(this), true);
|
1443
|
+
document.body.dataset.govukFrontendExitThisPageKeypress = 'true';
|
1444
|
+
}
|
1445
|
+
window.addEventListener('pageshow', this.resetPage.bind(this));
|
1446
|
+
}
|
1447
|
+
initUpdateSpan() {
|
1448
|
+
this.$updateSpan = document.createElement('span');
|
1449
|
+
this.$updateSpan.setAttribute('role', 'status');
|
1450
|
+
this.$updateSpan.className = 'govuk-visually-hidden';
|
1451
|
+
this.$module.appendChild(this.$updateSpan);
|
1452
|
+
}
|
1453
|
+
initButtonClickHandler() {
|
1454
|
+
this.$button.addEventListener('click', this.handleClick.bind(this));
|
1455
|
+
if (this.$skiplinkButton) {
|
1456
|
+
this.$skiplinkButton.addEventListener('click', this.handleClick.bind(this));
|
1457
|
+
}
|
1458
|
+
}
|
1459
|
+
buildIndicator() {
|
1460
|
+
this.$indicatorContainer = document.createElement('div');
|
1461
|
+
this.$indicatorContainer.className = 'govuk-exit-this-page__indicator';
|
1462
|
+
this.$indicatorContainer.setAttribute('aria-hidden', 'true');
|
1463
|
+
for (let i = 0; i < 3; i++) {
|
1464
|
+
const $indicator = document.createElement('div');
|
1465
|
+
$indicator.className = 'govuk-exit-this-page__indicator-light';
|
1466
|
+
this.$indicatorContainer.appendChild($indicator);
|
1467
|
+
}
|
1468
|
+
this.$button.appendChild(this.$indicatorContainer);
|
1469
|
+
}
|
1470
|
+
updateIndicator() {
|
1471
|
+
if (!this.$indicatorContainer) {
|
1472
|
+
return;
|
1473
|
+
}
|
1474
|
+
this.$indicatorContainer.classList.toggle('govuk-exit-this-page__indicator--visible', this.keypressCounter > 0);
|
1475
|
+
const $indicators = this.$indicatorContainer.querySelectorAll('.govuk-exit-this-page__indicator-light');
|
1476
|
+
$indicators.forEach(($indicator, index) => {
|
1477
|
+
$indicator.classList.toggle('govuk-exit-this-page__indicator-light--on', index < this.keypressCounter);
|
1478
|
+
});
|
1479
|
+
}
|
1480
|
+
exitPage() {
|
1481
|
+
if (!this.$updateSpan) {
|
1482
|
+
return;
|
1483
|
+
}
|
1484
|
+
this.$updateSpan.textContent = '';
|
1485
|
+
document.body.classList.add('govuk-exit-this-page-hide-content');
|
1486
|
+
this.$overlay = document.createElement('div');
|
1487
|
+
this.$overlay.className = 'govuk-exit-this-page-overlay';
|
1488
|
+
this.$overlay.setAttribute('role', 'alert');
|
1489
|
+
document.body.appendChild(this.$overlay);
|
1490
|
+
this.$overlay.textContent = this.i18n.t('activated');
|
1491
|
+
window.location.href = this.$button.href;
|
1492
|
+
}
|
1493
|
+
handleClick(event) {
|
1494
|
+
event.preventDefault();
|
1495
|
+
this.exitPage();
|
1496
|
+
}
|
1497
|
+
handleKeypress(event) {
|
1498
|
+
if (!this.$updateSpan) {
|
1499
|
+
return;
|
1500
|
+
}
|
1501
|
+
if (event.key === 'Shift' && !this.lastKeyWasModified) {
|
1502
|
+
this.keypressCounter += 1;
|
1503
|
+
this.updateIndicator();
|
1504
|
+
if (this.timeoutMessageId) {
|
1505
|
+
window.clearTimeout(this.timeoutMessageId);
|
1506
|
+
this.timeoutMessageId = null;
|
1507
|
+
}
|
1508
|
+
if (this.keypressCounter >= 3) {
|
1509
|
+
this.keypressCounter = 0;
|
1510
|
+
if (this.keypressTimeoutId) {
|
1511
|
+
window.clearTimeout(this.keypressTimeoutId);
|
1512
|
+
this.keypressTimeoutId = null;
|
1513
|
+
}
|
1514
|
+
this.exitPage();
|
1515
|
+
} else {
|
1516
|
+
if (this.keypressCounter === 1) {
|
1517
|
+
this.$updateSpan.textContent = this.i18n.t('pressTwoMoreTimes');
|
1518
|
+
} else {
|
1519
|
+
this.$updateSpan.textContent = this.i18n.t('pressOneMoreTime');
|
1520
|
+
}
|
1521
|
+
}
|
1522
|
+
this.setKeypressTimer();
|
1523
|
+
} else if (this.keypressTimeoutId) {
|
1524
|
+
this.resetKeypressTimer();
|
1525
|
+
}
|
1526
|
+
this.lastKeyWasModified = event.shiftKey;
|
1527
|
+
}
|
1528
|
+
setKeypressTimer() {
|
1529
|
+
if (this.keypressTimeoutId) {
|
1530
|
+
window.clearTimeout(this.keypressTimeoutId);
|
1531
|
+
}
|
1532
|
+
this.keypressTimeoutId = window.setTimeout(this.resetKeypressTimer.bind(this), this.timeoutTime);
|
1533
|
+
}
|
1534
|
+
resetKeypressTimer() {
|
1535
|
+
if (!this.$updateSpan) {
|
1536
|
+
return;
|
1537
|
+
}
|
1538
|
+
if (this.keypressTimeoutId) {
|
1539
|
+
window.clearTimeout(this.keypressTimeoutId);
|
1540
|
+
this.keypressTimeoutId = null;
|
1541
|
+
}
|
1542
|
+
const $updateSpan = this.$updateSpan;
|
1543
|
+
this.keypressCounter = 0;
|
1544
|
+
$updateSpan.textContent = this.i18n.t('timedOut');
|
1545
|
+
this.timeoutMessageId = window.setTimeout(() => {
|
1546
|
+
$updateSpan.textContent = '';
|
1547
|
+
}, this.timeoutTime);
|
1548
|
+
this.updateIndicator();
|
1549
|
+
}
|
1550
|
+
resetPage() {
|
1551
|
+
document.body.classList.remove('govuk-exit-this-page-hide-content');
|
1552
|
+
if (this.$overlay) {
|
1553
|
+
this.$overlay.remove();
|
1554
|
+
this.$overlay = null;
|
1555
|
+
}
|
1556
|
+
if (this.$updateSpan) {
|
1557
|
+
this.$updateSpan.setAttribute('role', 'status');
|
1558
|
+
this.$updateSpan.textContent = '';
|
1559
|
+
}
|
1560
|
+
this.updateIndicator();
|
1561
|
+
if (this.keypressTimeoutId) {
|
1562
|
+
window.clearTimeout(this.keypressTimeoutId);
|
1563
|
+
}
|
1564
|
+
if (this.timeoutMessageId) {
|
1565
|
+
window.clearTimeout(this.timeoutMessageId);
|
1566
|
+
}
|
1567
|
+
}
|
1568
|
+
}
|
1569
|
+
|
1570
|
+
/**
|
1571
|
+
* Exit this Page config
|
1572
|
+
*
|
1573
|
+
* @see {@link ExitThisPage.defaults}
|
1574
|
+
* @typedef {object} ExitThisPageConfig
|
1575
|
+
* @property {ExitThisPageTranslations} [i18n=ExitThisPage.defaults.i18n] - Exit this page translations
|
1576
|
+
*/
|
1577
|
+
|
1578
|
+
/**
|
1579
|
+
* Exit this Page translations
|
1580
|
+
*
|
1581
|
+
* @see {@link ExitThisPage.defaults.i18n}
|
1582
|
+
* @typedef {object} ExitThisPageTranslations
|
1583
|
+
*
|
1584
|
+
* Messages used by the component programatically inserted text, including
|
1585
|
+
* overlay text and screen reader announcements.
|
1586
|
+
* @property {string} [activated] - Screen reader announcement for when EtP
|
1587
|
+
* keypress functionality has been successfully activated.
|
1588
|
+
* @property {string} [timedOut] - Screen reader announcement for when the EtP
|
1589
|
+
* keypress functionality has timed out.
|
1590
|
+
* @property {string} [pressTwoMoreTimes] - Screen reader announcement informing
|
1591
|
+
* the user they must press the activation key two more times.
|
1592
|
+
* @property {string} [pressOneMoreTime] - Screen reader announcement informing
|
1593
|
+
* the user they must press the activation key one more time.
|
1594
|
+
*/
|
1595
|
+
|
1596
|
+
/**
|
1597
|
+
* @typedef {import('../../common/index.mjs').Schema} Schema
|
1598
|
+
*/
|
1599
|
+
ExitThisPage.moduleName = 'govuk-exit-this-page';
|
1600
|
+
ExitThisPage.defaults = Object.freeze({
|
1601
|
+
i18n: {
|
1602
|
+
activated: 'Loading.',
|
1603
|
+
timedOut: 'Exit this page expired.',
|
1604
|
+
pressTwoMoreTimes: 'Shift, press 2 more times to exit.',
|
1605
|
+
pressOneMoreTime: 'Shift, press 1 more time to exit.'
|
1606
|
+
}
|
1607
|
+
});
|
1608
|
+
ExitThisPage.schema = Object.freeze({
|
1609
|
+
properties: {
|
1610
|
+
i18n: {
|
1611
|
+
type: 'object'
|
1612
|
+
}
|
1613
|
+
}
|
1614
|
+
});
|
1615
|
+
|
1616
|
+
/**
|
1617
|
+
* Header component
|
1618
|
+
*
|
1619
|
+
* @preserve
|
1620
|
+
*/
|
1621
|
+
class Header extends GOVUKFrontendComponent {
|
1622
|
+
/**
|
1623
|
+
* Apply a matchMedia for desktop which will trigger a state sync if the
|
1624
|
+
* browser viewport moves between states.
|
1625
|
+
*
|
1626
|
+
* @param {Element | null} $module - HTML element to use for header
|
1627
|
+
*/
|
1628
|
+
constructor($module) {
|
1629
|
+
super();
|
1630
|
+
this.$module = void 0;
|
1631
|
+
this.$menuButton = void 0;
|
1632
|
+
this.$menu = void 0;
|
1633
|
+
this.menuIsOpen = false;
|
1634
|
+
this.mql = null;
|
1635
|
+
if (!$module) {
|
1636
|
+
throw new ElementError({
|
1637
|
+
componentName: 'Header',
|
1638
|
+
element: $module,
|
1639
|
+
identifier: 'Root element (`$module`)'
|
1640
|
+
});
|
1641
|
+
}
|
1642
|
+
this.$module = $module;
|
1643
|
+
const $menuButton = $module.querySelector('.govuk-js-header-toggle');
|
1644
|
+
if (!$menuButton) {
|
1645
|
+
return this;
|
1646
|
+
}
|
1647
|
+
const menuId = $menuButton.getAttribute('aria-controls');
|
1648
|
+
if (!menuId) {
|
1649
|
+
throw new ElementError({
|
1650
|
+
componentName: 'Header',
|
1651
|
+
identifier: 'Navigation button (`<button class="govuk-js-header-toggle">`) attribute (`aria-controls`)'
|
1652
|
+
});
|
1653
|
+
}
|
1654
|
+
const $menu = document.getElementById(menuId);
|
1655
|
+
if (!$menu) {
|
1656
|
+
throw new ElementError({
|
1657
|
+
componentName: 'Header',
|
1658
|
+
element: $menu,
|
1659
|
+
identifier: `Navigation (\`<ul id="${menuId}">\`)`
|
1660
|
+
});
|
1661
|
+
}
|
1662
|
+
this.$menu = $menu;
|
1663
|
+
this.$menuButton = $menuButton;
|
1664
|
+
this.setupResponsiveChecks();
|
1665
|
+
this.$menuButton.addEventListener('click', () => this.handleMenuButtonClick());
|
1666
|
+
}
|
1667
|
+
setupResponsiveChecks() {
|
1668
|
+
const breakpoint = getBreakpoint('desktop');
|
1669
|
+
if (!breakpoint.value) {
|
1670
|
+
throw new ElementError({
|
1671
|
+
componentName: 'Header',
|
1672
|
+
identifier: `CSS custom property (\`${breakpoint.property}\`) on pseudo-class \`:root\``
|
1673
|
+
});
|
1674
|
+
}
|
1675
|
+
this.mql = window.matchMedia(`(min-width: ${breakpoint.value})`);
|
1676
|
+
if ('addEventListener' in this.mql) {
|
1677
|
+
this.mql.addEventListener('change', () => this.checkMode());
|
1678
|
+
} else {
|
1679
|
+
this.mql.addListener(() => this.checkMode());
|
1680
|
+
}
|
1681
|
+
this.checkMode();
|
1682
|
+
}
|
1683
|
+
checkMode() {
|
1684
|
+
if (!this.mql || !this.$menu || !this.$menuButton) {
|
1685
|
+
return;
|
1686
|
+
}
|
1687
|
+
if (this.mql.matches) {
|
1688
|
+
this.$menu.removeAttribute('hidden');
|
1689
|
+
this.$menuButton.setAttribute('hidden', '');
|
1690
|
+
} else {
|
1691
|
+
this.$menuButton.removeAttribute('hidden');
|
1692
|
+
this.$menuButton.setAttribute('aria-expanded', this.menuIsOpen.toString());
|
1693
|
+
if (this.menuIsOpen) {
|
1694
|
+
this.$menu.removeAttribute('hidden');
|
1695
|
+
} else {
|
1696
|
+
this.$menu.setAttribute('hidden', '');
|
1697
|
+
}
|
1698
|
+
}
|
1699
|
+
}
|
1700
|
+
handleMenuButtonClick() {
|
1701
|
+
this.menuIsOpen = !this.menuIsOpen;
|
1702
|
+
this.checkMode();
|
1703
|
+
}
|
1704
|
+
}
|
1705
|
+
Header.moduleName = 'govuk-header';
|
1706
|
+
|
1707
|
+
/**
|
1708
|
+
* Notification Banner component
|
1709
|
+
*
|
1710
|
+
* @preserve
|
1711
|
+
*/
|
1712
|
+
class NotificationBanner extends GOVUKFrontendComponent {
|
1713
|
+
/**
|
1714
|
+
* @param {Element | null} $module - HTML element to use for notification banner
|
1715
|
+
* @param {NotificationBannerConfig} [config] - Notification banner config
|
1716
|
+
*/
|
1717
|
+
constructor($module, config = {}) {
|
1718
|
+
super();
|
1719
|
+
this.$module = void 0;
|
1720
|
+
this.config = void 0;
|
1721
|
+
if (!($module instanceof HTMLElement)) {
|
1722
|
+
throw new ElementError({
|
1723
|
+
componentName: 'Notification banner',
|
1724
|
+
element: $module,
|
1725
|
+
identifier: 'Root element (`$module`)'
|
1726
|
+
});
|
1727
|
+
}
|
1728
|
+
this.$module = $module;
|
1729
|
+
this.config = mergeConfigs(NotificationBanner.defaults, config, normaliseDataset(NotificationBanner, $module.dataset));
|
1730
|
+
if (this.$module.getAttribute('role') === 'alert' && !this.config.disableAutoFocus) {
|
1731
|
+
setFocus(this.$module);
|
1732
|
+
}
|
1733
|
+
}
|
1734
|
+
}
|
1735
|
+
|
1736
|
+
/**
|
1737
|
+
* Notification banner config
|
1738
|
+
*
|
1739
|
+
* @typedef {object} NotificationBannerConfig
|
1740
|
+
* @property {boolean} [disableAutoFocus=false] - If set to `true` the
|
1741
|
+
* notification banner will not be focussed when the page loads. This only
|
1742
|
+
* applies if the component has a `role` of `alert` – in other cases the
|
1743
|
+
* component will not be focused on page load, regardless of this option.
|
1744
|
+
*/
|
1745
|
+
|
1746
|
+
/**
|
1747
|
+
* @typedef {import('../../common/index.mjs').Schema} Schema
|
1748
|
+
*/
|
1749
|
+
NotificationBanner.moduleName = 'govuk-notification-banner';
|
1750
|
+
NotificationBanner.defaults = Object.freeze({
|
1751
|
+
disableAutoFocus: false
|
1752
|
+
});
|
1753
|
+
NotificationBanner.schema = Object.freeze({
|
1754
|
+
properties: {
|
1755
|
+
disableAutoFocus: {
|
1756
|
+
type: 'boolean'
|
1757
|
+
}
|
1758
|
+
}
|
1759
|
+
});
|
1760
|
+
|
1761
|
+
/**
|
1762
|
+
* Password input component
|
1763
|
+
*
|
1764
|
+
* @preserve
|
1765
|
+
*/
|
1766
|
+
class PasswordInput extends GOVUKFrontendComponent {
|
1767
|
+
/**
|
1768
|
+
* @param {Element | null} $module - HTML element to use for password input
|
1769
|
+
* @param {PasswordInputConfig} [config] - Password input config
|
1770
|
+
*/
|
1771
|
+
constructor($module, config = {}) {
|
1772
|
+
super();
|
1773
|
+
this.$module = void 0;
|
1774
|
+
this.config = void 0;
|
1775
|
+
this.i18n = void 0;
|
1776
|
+
this.$input = void 0;
|
1777
|
+
this.$showHideButton = void 0;
|
1778
|
+
this.$screenReaderStatusMessage = void 0;
|
1779
|
+
if (!($module instanceof HTMLElement)) {
|
1780
|
+
throw new ElementError({
|
1781
|
+
componentName: 'Password input',
|
1782
|
+
element: $module,
|
1783
|
+
identifier: 'Root element (`$module`)'
|
1784
|
+
});
|
1785
|
+
}
|
1786
|
+
const $input = $module.querySelector('.govuk-js-password-input-input');
|
1787
|
+
if (!($input instanceof HTMLInputElement)) {
|
1788
|
+
throw new ElementError({
|
1789
|
+
componentName: 'Password input',
|
1790
|
+
element: $input,
|
1791
|
+
expectedType: 'HTMLInputElement',
|
1792
|
+
identifier: 'Form field (`.govuk-js-password-input-input`)'
|
1793
|
+
});
|
1794
|
+
}
|
1795
|
+
if ($input.type !== 'password') {
|
1796
|
+
throw new ElementError('Password input: Form field (`.govuk-js-password-input-input`) must be of type `password`.');
|
1797
|
+
}
|
1798
|
+
const $showHideButton = $module.querySelector('.govuk-js-password-input-toggle');
|
1799
|
+
if (!($showHideButton instanceof HTMLButtonElement)) {
|
1800
|
+
throw new ElementError({
|
1801
|
+
componentName: 'Password input',
|
1802
|
+
element: $showHideButton,
|
1803
|
+
expectedType: 'HTMLButtonElement',
|
1804
|
+
identifier: 'Button (`.govuk-js-password-input-toggle`)'
|
1805
|
+
});
|
1806
|
+
}
|
1807
|
+
if ($showHideButton.type !== 'button') {
|
1808
|
+
throw new ElementError('Password input: Button (`.govuk-js-password-input-toggle`) must be of type `button`.');
|
1809
|
+
}
|
1810
|
+
this.$module = $module;
|
1811
|
+
this.$input = $input;
|
1812
|
+
this.$showHideButton = $showHideButton;
|
1813
|
+
this.config = mergeConfigs(PasswordInput.defaults, config, normaliseDataset(PasswordInput, $module.dataset));
|
1814
|
+
this.i18n = new I18n(this.config.i18n, {
|
1815
|
+
locale: closestAttributeValue($module, 'lang')
|
1816
|
+
});
|
1817
|
+
this.$showHideButton.removeAttribute('hidden');
|
1818
|
+
const $screenReaderStatusMessage = document.createElement('div');
|
1819
|
+
$screenReaderStatusMessage.className = 'govuk-password-input__sr-status govuk-visually-hidden';
|
1820
|
+
$screenReaderStatusMessage.setAttribute('aria-live', 'polite');
|
1821
|
+
this.$screenReaderStatusMessage = $screenReaderStatusMessage;
|
1822
|
+
this.$input.insertAdjacentElement('afterend', $screenReaderStatusMessage);
|
1823
|
+
this.$showHideButton.addEventListener('click', this.toggle.bind(this));
|
1824
|
+
if (this.$input.form) {
|
1825
|
+
this.$input.form.addEventListener('submit', () => this.hide());
|
1826
|
+
}
|
1827
|
+
window.addEventListener('pageshow', event => {
|
1828
|
+
if (event.persisted && this.$input.type !== 'password') {
|
1829
|
+
this.hide();
|
1830
|
+
}
|
1831
|
+
});
|
1832
|
+
this.hide();
|
1833
|
+
}
|
1834
|
+
toggle(event) {
|
1835
|
+
event.preventDefault();
|
1836
|
+
if (this.$input.type === 'password') {
|
1837
|
+
this.show();
|
1838
|
+
return;
|
1839
|
+
}
|
1840
|
+
this.hide();
|
1841
|
+
}
|
1842
|
+
show() {
|
1843
|
+
this.setType('text');
|
1844
|
+
}
|
1845
|
+
hide() {
|
1846
|
+
this.setType('password');
|
1847
|
+
}
|
1848
|
+
setType(type) {
|
1849
|
+
if (type === this.$input.type) {
|
1850
|
+
return;
|
1851
|
+
}
|
1852
|
+
this.$input.setAttribute('type', type);
|
1853
|
+
const isHidden = type === 'password';
|
1854
|
+
const prefixButton = isHidden ? 'show' : 'hide';
|
1855
|
+
const prefixStatus = isHidden ? 'passwordHidden' : 'passwordShown';
|
1856
|
+
this.$showHideButton.innerText = this.i18n.t(`${prefixButton}Password`);
|
1857
|
+
this.$showHideButton.setAttribute('aria-label', this.i18n.t(`${prefixButton}PasswordAriaLabel`));
|
1858
|
+
this.$screenReaderStatusMessage.innerText = this.i18n.t(`${prefixStatus}Announcement`);
|
1859
|
+
}
|
1860
|
+
}
|
1861
|
+
|
1862
|
+
/**
|
1863
|
+
* Password input config
|
1864
|
+
*
|
1865
|
+
* @typedef {object} PasswordInputConfig
|
1866
|
+
* @property {PasswordInputTranslations} [i18n=PasswordInput.defaults.i18n] - Password input translations
|
1867
|
+
*/
|
1868
|
+
|
1869
|
+
/**
|
1870
|
+
* Password input translations
|
1871
|
+
*
|
1872
|
+
* @see {@link PasswordInput.defaults.i18n}
|
1873
|
+
* @typedef {object} PasswordInputTranslations
|
1874
|
+
*
|
1875
|
+
* Messages displayed to the user indicating the state of the show/hide toggle.
|
1876
|
+
* @property {string} [showPassword] - Visible text of the button when the
|
1877
|
+
* password is currently hidden. Plain text only.
|
1878
|
+
* @property {string} [hidePassword] - Visible text of the button when the
|
1879
|
+
* password is currently visible. Plain text only.
|
1880
|
+
* @property {string} [showPasswordAriaLabel] - aria-label of the button when
|
1881
|
+
* the password is currently hidden. Plain text only.
|
1882
|
+
* @property {string} [hidePasswordAriaLabel] - aria-label of the button when
|
1883
|
+
* the password is currently visible. Plain text only.
|
1884
|
+
* @property {string} [passwordShownAnnouncement] - Screen reader
|
1885
|
+
* announcement to make when the password has just become visible.
|
1886
|
+
* Plain text only.
|
1887
|
+
* @property {string} [passwordHiddenAnnouncement] - Screen reader
|
1888
|
+
* announcement to make when the password has just been hidden.
|
1889
|
+
* Plain text only.
|
1890
|
+
*/
|
1891
|
+
|
1892
|
+
/**
|
1893
|
+
* @typedef {import('../../common/index.mjs').Schema} Schema
|
1894
|
+
* @typedef {import('../../i18n.mjs').TranslationPluralForms} TranslationPluralForms
|
1895
|
+
*/
|
1896
|
+
PasswordInput.moduleName = 'govuk-password-input';
|
1897
|
+
PasswordInput.defaults = Object.freeze({
|
1898
|
+
i18n: {
|
1899
|
+
showPassword: 'Show',
|
1900
|
+
hidePassword: 'Hide',
|
1901
|
+
showPasswordAriaLabel: 'Show password',
|
1902
|
+
hidePasswordAriaLabel: 'Hide password',
|
1903
|
+
passwordShownAnnouncement: 'Your password is visible',
|
1904
|
+
passwordHiddenAnnouncement: 'Your password is hidden'
|
1905
|
+
}
|
1906
|
+
});
|
1907
|
+
PasswordInput.schema = Object.freeze({
|
1908
|
+
properties: {
|
1909
|
+
i18n: {
|
1910
|
+
type: 'object'
|
1911
|
+
}
|
1912
|
+
}
|
1913
|
+
});
|
1914
|
+
|
1915
|
+
/**
|
1916
|
+
* Radios component
|
1917
|
+
*
|
1918
|
+
* @preserve
|
1919
|
+
*/
|
1920
|
+
class Radios extends GOVUKFrontendComponent {
|
1921
|
+
/**
|
1922
|
+
* Radios can be associated with a 'conditionally revealed' content block –
|
1923
|
+
* for example, a radio for 'Phone' could reveal an additional form field for
|
1924
|
+
* the user to enter their phone number.
|
1925
|
+
*
|
1926
|
+
* These associations are made using a `data-aria-controls` attribute, which
|
1927
|
+
* is promoted to an aria-controls attribute during initialisation.
|
1928
|
+
*
|
1929
|
+
* We also need to restore the state of any conditional reveals on the page
|
1930
|
+
* (for example if the user has navigated back), and set up event handlers to
|
1931
|
+
* keep the reveal in sync with the radio state.
|
1932
|
+
*
|
1933
|
+
* @param {Element | null} $module - HTML element to use for radios
|
1934
|
+
*/
|
1935
|
+
constructor($module) {
|
1936
|
+
super();
|
1937
|
+
this.$module = void 0;
|
1938
|
+
this.$inputs = void 0;
|
1939
|
+
if (!($module instanceof HTMLElement)) {
|
1940
|
+
throw new ElementError({
|
1941
|
+
componentName: 'Radios',
|
1942
|
+
element: $module,
|
1943
|
+
identifier: 'Root element (`$module`)'
|
1944
|
+
});
|
1945
|
+
}
|
1946
|
+
const $inputs = $module.querySelectorAll('input[type="radio"]');
|
1947
|
+
if (!$inputs.length) {
|
1948
|
+
throw new ElementError({
|
1949
|
+
componentName: 'Radios',
|
1950
|
+
identifier: 'Form inputs (`<input type="radio">`)'
|
1951
|
+
});
|
1952
|
+
}
|
1953
|
+
this.$module = $module;
|
1954
|
+
this.$inputs = $inputs;
|
1955
|
+
this.$inputs.forEach($input => {
|
1956
|
+
const targetId = $input.getAttribute('data-aria-controls');
|
1957
|
+
if (!targetId) {
|
1958
|
+
return;
|
1959
|
+
}
|
1960
|
+
if (!document.getElementById(targetId)) {
|
1961
|
+
throw new ElementError({
|
1962
|
+
componentName: 'Radios',
|
1963
|
+
identifier: `Conditional reveal (\`id="${targetId}"\`)`
|
1964
|
+
});
|
1965
|
+
}
|
1966
|
+
$input.setAttribute('aria-controls', targetId);
|
1967
|
+
$input.removeAttribute('data-aria-controls');
|
1968
|
+
});
|
1969
|
+
window.addEventListener('pageshow', () => this.syncAllConditionalReveals());
|
1970
|
+
this.syncAllConditionalReveals();
|
1971
|
+
this.$module.addEventListener('click', event => this.handleClick(event));
|
1972
|
+
}
|
1973
|
+
syncAllConditionalReveals() {
|
1974
|
+
this.$inputs.forEach($input => this.syncConditionalRevealWithInputState($input));
|
1975
|
+
}
|
1976
|
+
syncConditionalRevealWithInputState($input) {
|
1977
|
+
const targetId = $input.getAttribute('aria-controls');
|
1978
|
+
if (!targetId) {
|
1979
|
+
return;
|
1980
|
+
}
|
1981
|
+
const $target = document.getElementById(targetId);
|
1982
|
+
if ($target != null && $target.classList.contains('govuk-radios__conditional')) {
|
1983
|
+
const inputIsChecked = $input.checked;
|
1984
|
+
$input.setAttribute('aria-expanded', inputIsChecked.toString());
|
1985
|
+
$target.classList.toggle('govuk-radios__conditional--hidden', !inputIsChecked);
|
1986
|
+
}
|
1987
|
+
}
|
1988
|
+
handleClick(event) {
|
1989
|
+
const $clickedInput = event.target;
|
1990
|
+
if (!($clickedInput instanceof HTMLInputElement) || $clickedInput.type !== 'radio') {
|
1991
|
+
return;
|
1992
|
+
}
|
1993
|
+
const $allInputs = document.querySelectorAll('input[type="radio"][aria-controls]');
|
1994
|
+
const $clickedInputForm = $clickedInput.form;
|
1995
|
+
const $clickedInputName = $clickedInput.name;
|
1996
|
+
$allInputs.forEach($input => {
|
1997
|
+
const hasSameFormOwner = $input.form === $clickedInputForm;
|
1998
|
+
const hasSameName = $input.name === $clickedInputName;
|
1999
|
+
if (hasSameName && hasSameFormOwner) {
|
2000
|
+
this.syncConditionalRevealWithInputState($input);
|
2001
|
+
}
|
2002
|
+
});
|
2003
|
+
}
|
2004
|
+
}
|
2005
|
+
Radios.moduleName = 'govuk-radios';
|
2006
|
+
|
2007
|
+
/**
|
2008
|
+
* Skip link component
|
2009
|
+
*
|
2010
|
+
* @preserve
|
2011
|
+
*/
|
2012
|
+
class SkipLink extends GOVUKFrontendComponent {
|
2013
|
+
/**
|
2014
|
+
* @param {Element | null} $module - HTML element to use for skip link
|
2015
|
+
* @throws {ElementError} when $module is not set or the wrong type
|
2016
|
+
* @throws {ElementError} when $module.hash does not contain a hash
|
2017
|
+
* @throws {ElementError} when the linked element is missing or the wrong type
|
2018
|
+
*/
|
2019
|
+
constructor($module) {
|
2020
|
+
var _this$$module$getAttr;
|
2021
|
+
super();
|
2022
|
+
this.$module = void 0;
|
2023
|
+
if (!($module instanceof HTMLAnchorElement)) {
|
2024
|
+
throw new ElementError({
|
2025
|
+
componentName: 'Skip link',
|
2026
|
+
element: $module,
|
2027
|
+
expectedType: 'HTMLAnchorElement',
|
2028
|
+
identifier: 'Root element (`$module`)'
|
2029
|
+
});
|
2030
|
+
}
|
2031
|
+
this.$module = $module;
|
2032
|
+
const hash = this.$module.hash;
|
2033
|
+
const href = (_this$$module$getAttr = this.$module.getAttribute('href')) != null ? _this$$module$getAttr : '';
|
2034
|
+
let url;
|
2035
|
+
try {
|
2036
|
+
url = new window.URL(this.$module.href);
|
2037
|
+
} catch (error) {
|
2038
|
+
throw new ElementError(`Skip link: Target link (\`href="${href}"\`) is invalid`);
|
2039
|
+
}
|
2040
|
+
if (url.origin !== window.location.origin || url.pathname !== window.location.pathname) {
|
2041
|
+
return;
|
2042
|
+
}
|
2043
|
+
const linkedElementId = getFragmentFromUrl(hash);
|
2044
|
+
if (!linkedElementId) {
|
2045
|
+
throw new ElementError(`Skip link: Target link (\`href="${href}"\`) has no hash fragment`);
|
2046
|
+
}
|
2047
|
+
const $linkedElement = document.getElementById(linkedElementId);
|
2048
|
+
if (!$linkedElement) {
|
2049
|
+
throw new ElementError({
|
2050
|
+
componentName: 'Skip link',
|
2051
|
+
element: $linkedElement,
|
2052
|
+
identifier: `Target content (\`id="${linkedElementId}"\`)`
|
2053
|
+
});
|
2054
|
+
}
|
2055
|
+
this.$module.addEventListener('click', () => setFocus($linkedElement, {
|
2056
|
+
onBeforeFocus() {
|
2057
|
+
$linkedElement.classList.add('govuk-skip-link-focused-element');
|
2058
|
+
},
|
2059
|
+
onBlur() {
|
2060
|
+
$linkedElement.classList.remove('govuk-skip-link-focused-element');
|
2061
|
+
}
|
2062
|
+
}));
|
2063
|
+
}
|
2064
|
+
}
|
2065
|
+
SkipLink.moduleName = 'govuk-skip-link';
|
2066
|
+
|
2067
|
+
/**
|
2068
|
+
* Tabs component
|
2069
|
+
*
|
2070
|
+
* @preserve
|
2071
|
+
*/
|
2072
|
+
class Tabs extends GOVUKFrontendComponent {
|
2073
|
+
/**
|
2074
|
+
* @param {Element | null} $module - HTML element to use for tabs
|
2075
|
+
*/
|
2076
|
+
constructor($module) {
|
2077
|
+
super();
|
2078
|
+
this.$module = void 0;
|
2079
|
+
this.$tabs = void 0;
|
2080
|
+
this.$tabList = void 0;
|
2081
|
+
this.$tabListItems = void 0;
|
2082
|
+
this.jsHiddenClass = 'govuk-tabs__panel--hidden';
|
2083
|
+
this.changingHash = false;
|
2084
|
+
this.boundTabClick = void 0;
|
2085
|
+
this.boundTabKeydown = void 0;
|
2086
|
+
this.boundOnHashChange = void 0;
|
2087
|
+
this.mql = null;
|
2088
|
+
if (!$module) {
|
2089
|
+
throw new ElementError({
|
2090
|
+
componentName: 'Tabs',
|
2091
|
+
element: $module,
|
2092
|
+
identifier: 'Root element (`$module`)'
|
2093
|
+
});
|
2094
|
+
}
|
2095
|
+
const $tabs = $module.querySelectorAll('a.govuk-tabs__tab');
|
2096
|
+
if (!$tabs.length) {
|
2097
|
+
throw new ElementError({
|
2098
|
+
componentName: 'Tabs',
|
2099
|
+
identifier: 'Links (`<a class="govuk-tabs__tab">`)'
|
2100
|
+
});
|
2101
|
+
}
|
2102
|
+
this.$module = $module;
|
2103
|
+
this.$tabs = $tabs;
|
2104
|
+
this.boundTabClick = this.onTabClick.bind(this);
|
2105
|
+
this.boundTabKeydown = this.onTabKeydown.bind(this);
|
2106
|
+
this.boundOnHashChange = this.onHashChange.bind(this);
|
2107
|
+
const $tabList = this.$module.querySelector('.govuk-tabs__list');
|
2108
|
+
const $tabListItems = this.$module.querySelectorAll('li.govuk-tabs__list-item');
|
2109
|
+
if (!$tabList) {
|
2110
|
+
throw new ElementError({
|
2111
|
+
componentName: 'Tabs',
|
2112
|
+
identifier: 'List (`<ul class="govuk-tabs__list">`)'
|
2113
|
+
});
|
2114
|
+
}
|
2115
|
+
if (!$tabListItems.length) {
|
2116
|
+
throw new ElementError({
|
2117
|
+
componentName: 'Tabs',
|
2118
|
+
identifier: 'List items (`<li class="govuk-tabs__list-item">`)'
|
2119
|
+
});
|
2120
|
+
}
|
2121
|
+
this.$tabList = $tabList;
|
2122
|
+
this.$tabListItems = $tabListItems;
|
2123
|
+
this.setupResponsiveChecks();
|
2124
|
+
}
|
2125
|
+
setupResponsiveChecks() {
|
2126
|
+
const breakpoint = getBreakpoint('tablet');
|
2127
|
+
if (!breakpoint.value) {
|
2128
|
+
throw new ElementError({
|
2129
|
+
componentName: 'Tabs',
|
2130
|
+
identifier: `CSS custom property (\`${breakpoint.property}\`) on pseudo-class \`:root\``
|
2131
|
+
});
|
2132
|
+
}
|
2133
|
+
this.mql = window.matchMedia(`(min-width: ${breakpoint.value})`);
|
2134
|
+
if ('addEventListener' in this.mql) {
|
2135
|
+
this.mql.addEventListener('change', () => this.checkMode());
|
2136
|
+
} else {
|
2137
|
+
this.mql.addListener(() => this.checkMode());
|
2138
|
+
}
|
2139
|
+
this.checkMode();
|
2140
|
+
}
|
2141
|
+
checkMode() {
|
2142
|
+
var _this$mql;
|
2143
|
+
if ((_this$mql = this.mql) != null && _this$mql.matches) {
|
2144
|
+
this.setup();
|
2145
|
+
} else {
|
2146
|
+
this.teardown();
|
2147
|
+
}
|
2148
|
+
}
|
2149
|
+
setup() {
|
2150
|
+
var _this$getTab;
|
2151
|
+
this.$tabList.setAttribute('role', 'tablist');
|
2152
|
+
this.$tabListItems.forEach($item => {
|
2153
|
+
$item.setAttribute('role', 'presentation');
|
2154
|
+
});
|
2155
|
+
this.$tabs.forEach($tab => {
|
2156
|
+
this.setAttributes($tab);
|
2157
|
+
$tab.addEventListener('click', this.boundTabClick, true);
|
2158
|
+
$tab.addEventListener('keydown', this.boundTabKeydown, true);
|
2159
|
+
this.hideTab($tab);
|
2160
|
+
});
|
2161
|
+
const $activeTab = (_this$getTab = this.getTab(window.location.hash)) != null ? _this$getTab : this.$tabs[0];
|
2162
|
+
this.showTab($activeTab);
|
2163
|
+
window.addEventListener('hashchange', this.boundOnHashChange, true);
|
2164
|
+
}
|
2165
|
+
teardown() {
|
2166
|
+
this.$tabList.removeAttribute('role');
|
2167
|
+
this.$tabListItems.forEach($item => {
|
2168
|
+
$item.removeAttribute('role');
|
2169
|
+
});
|
2170
|
+
this.$tabs.forEach($tab => {
|
2171
|
+
$tab.removeEventListener('click', this.boundTabClick, true);
|
2172
|
+
$tab.removeEventListener('keydown', this.boundTabKeydown, true);
|
2173
|
+
this.unsetAttributes($tab);
|
2174
|
+
});
|
2175
|
+
window.removeEventListener('hashchange', this.boundOnHashChange, true);
|
2176
|
+
}
|
2177
|
+
onHashChange() {
|
2178
|
+
const hash = window.location.hash;
|
2179
|
+
const $tabWithHash = this.getTab(hash);
|
2180
|
+
if (!$tabWithHash) {
|
2181
|
+
return;
|
2182
|
+
}
|
2183
|
+
if (this.changingHash) {
|
2184
|
+
this.changingHash = false;
|
2185
|
+
return;
|
2186
|
+
}
|
2187
|
+
const $previousTab = this.getCurrentTab();
|
2188
|
+
if (!$previousTab) {
|
2189
|
+
return;
|
2190
|
+
}
|
2191
|
+
this.hideTab($previousTab);
|
2192
|
+
this.showTab($tabWithHash);
|
2193
|
+
$tabWithHash.focus();
|
2194
|
+
}
|
2195
|
+
hideTab($tab) {
|
2196
|
+
this.unhighlightTab($tab);
|
2197
|
+
this.hidePanel($tab);
|
2198
|
+
}
|
2199
|
+
showTab($tab) {
|
2200
|
+
this.highlightTab($tab);
|
2201
|
+
this.showPanel($tab);
|
2202
|
+
}
|
2203
|
+
getTab(hash) {
|
2204
|
+
return this.$module.querySelector(`a.govuk-tabs__tab[href="${hash}"]`);
|
2205
|
+
}
|
2206
|
+
setAttributes($tab) {
|
2207
|
+
const panelId = getFragmentFromUrl($tab.href);
|
2208
|
+
if (!panelId) {
|
2209
|
+
return;
|
2210
|
+
}
|
2211
|
+
$tab.setAttribute('id', `tab_${panelId}`);
|
2212
|
+
$tab.setAttribute('role', 'tab');
|
2213
|
+
$tab.setAttribute('aria-controls', panelId);
|
2214
|
+
$tab.setAttribute('aria-selected', 'false');
|
2215
|
+
$tab.setAttribute('tabindex', '-1');
|
2216
|
+
const $panel = this.getPanel($tab);
|
2217
|
+
if (!$panel) {
|
2218
|
+
return;
|
2219
|
+
}
|
2220
|
+
$panel.setAttribute('role', 'tabpanel');
|
2221
|
+
$panel.setAttribute('aria-labelledby', $tab.id);
|
2222
|
+
$panel.classList.add(this.jsHiddenClass);
|
2223
|
+
}
|
2224
|
+
unsetAttributes($tab) {
|
2225
|
+
$tab.removeAttribute('id');
|
2226
|
+
$tab.removeAttribute('role');
|
2227
|
+
$tab.removeAttribute('aria-controls');
|
2228
|
+
$tab.removeAttribute('aria-selected');
|
2229
|
+
$tab.removeAttribute('tabindex');
|
2230
|
+
const $panel = this.getPanel($tab);
|
2231
|
+
if (!$panel) {
|
2232
|
+
return;
|
2233
|
+
}
|
2234
|
+
$panel.removeAttribute('role');
|
2235
|
+
$panel.removeAttribute('aria-labelledby');
|
2236
|
+
$panel.classList.remove(this.jsHiddenClass);
|
2237
|
+
}
|
2238
|
+
onTabClick(event) {
|
2239
|
+
const $currentTab = this.getCurrentTab();
|
2240
|
+
const $nextTab = event.currentTarget;
|
2241
|
+
if (!$currentTab || !($nextTab instanceof HTMLAnchorElement)) {
|
2242
|
+
return;
|
2243
|
+
}
|
2244
|
+
event.preventDefault();
|
2245
|
+
this.hideTab($currentTab);
|
2246
|
+
this.showTab($nextTab);
|
2247
|
+
this.createHistoryEntry($nextTab);
|
2248
|
+
}
|
2249
|
+
createHistoryEntry($tab) {
|
2250
|
+
const $panel = this.getPanel($tab);
|
2251
|
+
if (!$panel) {
|
2252
|
+
return;
|
2253
|
+
}
|
2254
|
+
const panelId = $panel.id;
|
2255
|
+
$panel.id = '';
|
2256
|
+
this.changingHash = true;
|
2257
|
+
window.location.hash = panelId;
|
2258
|
+
$panel.id = panelId;
|
2259
|
+
}
|
2260
|
+
onTabKeydown(event) {
|
2261
|
+
switch (event.key) {
|
2262
|
+
case 'ArrowLeft':
|
2263
|
+
case 'ArrowUp':
|
2264
|
+
case 'Left':
|
2265
|
+
case 'Up':
|
2266
|
+
this.activatePreviousTab();
|
2267
|
+
event.preventDefault();
|
2268
|
+
break;
|
2269
|
+
case 'ArrowRight':
|
2270
|
+
case 'ArrowDown':
|
2271
|
+
case 'Right':
|
2272
|
+
case 'Down':
|
2273
|
+
this.activateNextTab();
|
2274
|
+
event.preventDefault();
|
2275
|
+
break;
|
2276
|
+
}
|
2277
|
+
}
|
2278
|
+
activateNextTab() {
|
2279
|
+
const $currentTab = this.getCurrentTab();
|
2280
|
+
if (!($currentTab != null && $currentTab.parentElement)) {
|
2281
|
+
return;
|
2282
|
+
}
|
2283
|
+
const $nextTabListItem = $currentTab.parentElement.nextElementSibling;
|
2284
|
+
if (!$nextTabListItem) {
|
2285
|
+
return;
|
2286
|
+
}
|
2287
|
+
const $nextTab = $nextTabListItem.querySelector('a.govuk-tabs__tab');
|
2288
|
+
if (!$nextTab) {
|
2289
|
+
return;
|
2290
|
+
}
|
2291
|
+
this.hideTab($currentTab);
|
2292
|
+
this.showTab($nextTab);
|
2293
|
+
$nextTab.focus();
|
2294
|
+
this.createHistoryEntry($nextTab);
|
2295
|
+
}
|
2296
|
+
activatePreviousTab() {
|
2297
|
+
const $currentTab = this.getCurrentTab();
|
2298
|
+
if (!($currentTab != null && $currentTab.parentElement)) {
|
2299
|
+
return;
|
2300
|
+
}
|
2301
|
+
const $previousTabListItem = $currentTab.parentElement.previousElementSibling;
|
2302
|
+
if (!$previousTabListItem) {
|
2303
|
+
return;
|
2304
|
+
}
|
2305
|
+
const $previousTab = $previousTabListItem.querySelector('a.govuk-tabs__tab');
|
2306
|
+
if (!$previousTab) {
|
2307
|
+
return;
|
2308
|
+
}
|
2309
|
+
this.hideTab($currentTab);
|
2310
|
+
this.showTab($previousTab);
|
2311
|
+
$previousTab.focus();
|
2312
|
+
this.createHistoryEntry($previousTab);
|
2313
|
+
}
|
2314
|
+
getPanel($tab) {
|
2315
|
+
const panelId = getFragmentFromUrl($tab.href);
|
2316
|
+
if (!panelId) {
|
2317
|
+
return null;
|
2318
|
+
}
|
2319
|
+
return this.$module.querySelector(`#${panelId}`);
|
2320
|
+
}
|
2321
|
+
showPanel($tab) {
|
2322
|
+
const $panel = this.getPanel($tab);
|
2323
|
+
if (!$panel) {
|
2324
|
+
return;
|
2325
|
+
}
|
2326
|
+
$panel.classList.remove(this.jsHiddenClass);
|
2327
|
+
}
|
2328
|
+
hidePanel($tab) {
|
2329
|
+
const $panel = this.getPanel($tab);
|
2330
|
+
if (!$panel) {
|
2331
|
+
return;
|
2332
|
+
}
|
2333
|
+
$panel.classList.add(this.jsHiddenClass);
|
2334
|
+
}
|
2335
|
+
unhighlightTab($tab) {
|
2336
|
+
if (!$tab.parentElement) {
|
2337
|
+
return;
|
2338
|
+
}
|
2339
|
+
$tab.setAttribute('aria-selected', 'false');
|
2340
|
+
$tab.parentElement.classList.remove('govuk-tabs__list-item--selected');
|
2341
|
+
$tab.setAttribute('tabindex', '-1');
|
2342
|
+
}
|
2343
|
+
highlightTab($tab) {
|
2344
|
+
if (!$tab.parentElement) {
|
2345
|
+
return;
|
2346
|
+
}
|
2347
|
+
$tab.setAttribute('aria-selected', 'true');
|
2348
|
+
$tab.parentElement.classList.add('govuk-tabs__list-item--selected');
|
2349
|
+
$tab.setAttribute('tabindex', '0');
|
2350
|
+
}
|
2351
|
+
getCurrentTab() {
|
2352
|
+
return this.$module.querySelector('.govuk-tabs__list-item--selected a.govuk-tabs__tab');
|
2353
|
+
}
|
2354
|
+
}
|
2355
|
+
Tabs.moduleName = 'govuk-tabs';
|
2356
|
+
|
2357
|
+
/**
|
2358
|
+
* Initialise all components
|
2359
|
+
*
|
2360
|
+
* Use the `data-module` attributes to find, instantiate and init all of the
|
2361
|
+
* components provided as part of GOV.UK Frontend.
|
2362
|
+
*
|
2363
|
+
* @param {Config & { scope?: Element }} [config] - Config for all components (with optional scope)
|
2364
|
+
*/
|
2365
|
+
function initAll(config) {
|
2366
|
+
var _config$scope;
|
2367
|
+
config = typeof config !== 'undefined' ? config : {};
|
2368
|
+
if (!isSupported()) {
|
2369
|
+
console.log(new SupportError());
|
2370
|
+
return;
|
2371
|
+
}
|
2372
|
+
const components = [[Accordion, config.accordion], [Button, config.button], [CharacterCount, config.characterCount], [Checkboxes], [ErrorSummary, config.errorSummary], [ExitThisPage, config.exitThisPage], [Header], [NotificationBanner, config.notificationBanner], [PasswordInput, config.passwordInput], [Radios], [SkipLink], [Tabs]];
|
2373
|
+
const $scope = (_config$scope = config.scope) != null ? _config$scope : document;
|
2374
|
+
components.forEach(([Component, config]) => {
|
2375
|
+
createAll(Component, config, $scope);
|
2376
|
+
});
|
2377
|
+
}
|
2378
|
+
|
2379
|
+
/**
|
2380
|
+
* Create all instances of a specific component on the page
|
2381
|
+
*
|
2382
|
+
* Uses the `data-module` attribute to find all elements matching the specified
|
2383
|
+
* component on the page, creating instances of the component object for each
|
2384
|
+
* of them.
|
2385
|
+
*
|
2386
|
+
* Any component errors will be caught and logged to the console.
|
2387
|
+
*
|
2388
|
+
* @template {CompatibleClass} T
|
2389
|
+
* @param {T} Component - class of the component to create
|
2390
|
+
* @param {T["defaults"]} [config] - config for the component
|
2391
|
+
* @param {Element|Document} [$scope] - scope of the document to search within
|
2392
|
+
* @returns {Array<InstanceType<T>>} - array of instantiated components
|
2393
|
+
*/
|
2394
|
+
function createAll(Component, config, $scope = document) {
|
2395
|
+
const $elements = $scope.querySelectorAll(`[data-module="${Component.moduleName}"]`);
|
2396
|
+
return Array.from($elements).map($element => {
|
2397
|
+
try {
|
2398
|
+
return 'defaults' in Component && typeof config !== 'undefined' ? new Component($element, config) : new Component($element);
|
2399
|
+
} catch (error) {
|
2400
|
+
console.log(error);
|
2401
|
+
return null;
|
2402
|
+
}
|
2403
|
+
}).filter(Boolean);
|
2404
|
+
}
|
2405
|
+
/**
|
2406
|
+
* @typedef {{new (...args: any[]): any, defaults?: object, moduleName: string}} CompatibleClass
|
2407
|
+
*/
|
2408
|
+
/**
|
2409
|
+
* Config for all components via `initAll()`
|
2410
|
+
*
|
2411
|
+
* @typedef {object} Config
|
2412
|
+
* @property {AccordionConfig} [accordion] - Accordion config
|
2413
|
+
* @property {ButtonConfig} [button] - Button config
|
2414
|
+
* @property {CharacterCountConfig} [characterCount] - Character Count config
|
2415
|
+
* @property {ErrorSummaryConfig} [errorSummary] - Error Summary config
|
2416
|
+
* @property {ExitThisPageConfig} [exitThisPage] - Exit This Page config
|
2417
|
+
* @property {NotificationBannerConfig} [notificationBanner] - Notification Banner config
|
2418
|
+
* @property {PasswordInputConfig} [passwordInput] - Password input config
|
2419
|
+
*/
|
2420
|
+
/**
|
2421
|
+
* Config for individual components
|
2422
|
+
*
|
2423
|
+
* @typedef {import('./components/accordion/accordion.mjs').AccordionConfig} AccordionConfig
|
2424
|
+
* @typedef {import('./components/accordion/accordion.mjs').AccordionTranslations} AccordionTranslations
|
2425
|
+
* @typedef {import('./components/button/button.mjs').ButtonConfig} ButtonConfig
|
2426
|
+
* @typedef {import('./components/character-count/character-count.mjs').CharacterCountConfig} CharacterCountConfig
|
2427
|
+
* @typedef {import('./components/character-count/character-count.mjs').CharacterCountTranslations} CharacterCountTranslations
|
2428
|
+
* @typedef {import('./components/error-summary/error-summary.mjs').ErrorSummaryConfig} ErrorSummaryConfig
|
2429
|
+
* @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageConfig} ExitThisPageConfig
|
2430
|
+
* @typedef {import('./components/exit-this-page/exit-this-page.mjs').ExitThisPageTranslations} ExitThisPageTranslations
|
2431
|
+
* @typedef {import('./components/notification-banner/notification-banner.mjs').NotificationBannerConfig} NotificationBannerConfig
|
2432
|
+
* @typedef {import('./components/password-input/password-input.mjs').PasswordInputConfig} PasswordInputConfig
|
2433
|
+
*/
|
2434
|
+
/**
|
2435
|
+
* Component config keys, e.g. `accordion` and `characterCount`
|
2436
|
+
*
|
2437
|
+
* @typedef {keyof Config} ConfigKey
|
2438
|
+
*/
|
2439
|
+
|
2440
|
+
exports.Accordion = Accordion;
|
2441
|
+
exports.Button = Button;
|
2442
|
+
exports.CharacterCount = CharacterCount;
|
2443
|
+
exports.Checkboxes = Checkboxes;
|
2444
|
+
exports.ErrorSummary = ErrorSummary;
|
2445
|
+
exports.ExitThisPage = ExitThisPage;
|
2446
|
+
exports.Header = Header;
|
2447
|
+
exports.NotificationBanner = NotificationBanner;
|
2448
|
+
exports.PasswordInput = PasswordInput;
|
2449
|
+
exports.Radios = Radios;
|
2450
|
+
exports.SkipLink = SkipLink;
|
2451
|
+
exports.Tabs = Tabs;
|
2452
|
+
exports.createAll = createAll;
|
2453
|
+
exports.initAll = initAll;
|
2454
|
+
exports.version = version;
|
2455
|
+
|
2456
|
+
}));
|
2457
|
+
//# sourceMappingURL=all.bundle.js.map
|