content_block_tools 0.17.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/blocks/_contact.scss +13 -0
- data/app/assets/stylesheets/content_block_tools.scss +24 -0
- data/lib/content_block_tools/engine.rb +16 -0
- data/lib/content_block_tools/presenters/block_presenters/contact/address_presenter.rb +1 -7
- data/lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb +10 -16
- data/lib/content_block_tools/presenters/block_presenters/contact/contact_link_presenter.rb +6 -4
- data/lib/content_block_tools/presenters/block_presenters/contact/email_address_presenter.rb +10 -4
- data/lib/content_block_tools/presenters/block_presenters/contact/telephone_presenter.rb +9 -26
- data/lib/content_block_tools/presenters/contact_presenter.rb +6 -10
- data/lib/content_block_tools/version.rb +1 -1
- data/lib/content_block_tools.rb +2 -8
- data/node_modules/govuk-frontend/README.md +92 -0
- 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 +2847 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +2820 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.mjs +20 -0
- data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.scss +9 -0
- data/node_modules/govuk-frontend/dist/govuk/all.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/fonts/bold-affa96571d-v2.woff +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/fonts/light-f591b13f7d-v2.woff +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-crest.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-mask.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/manifest.json +39 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +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/configuration.mjs +169 -0
- data/node_modules/govuk-frontend/dist/govuk/common/configuration.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 +76 -0
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/component.mjs +60 -0
- data/node_modules/govuk-frontend/dist/govuk/component.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 +40 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/README.md +15 -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 +370 -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 +830 -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 +822 -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 +346 -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 +377 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/macro-options.json +142 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/macro.njk +3 -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-long-content-and-description.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/template.njk +67 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/README.md +15 -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 +86 -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/macro.njk +3 -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.njk +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/README.md +15 -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 +258 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/macro-options.json +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/template-default.html +16 -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-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/README.md +15 -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 +363 -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 +355 -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 +70 -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 +368 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +81 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/macro.njk +3 -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.html +1 -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-secondary.html +3 -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.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/README.md +15 -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 +44 -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 +806 -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 +798 -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 +299 -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 +463 -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/macro.njk +3 -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-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-and-error.html +15 -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-word-count.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template.njk +121 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/README.md +15 -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 +311 -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 +248 -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 +240 -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 +111 -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 +1339 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro-options.json +229 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +27 -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-divider-and-none.html +34 -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-conditional-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +44 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hint.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +27 -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 +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template.njk +122 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/README.md +15 -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 +59 -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 +543 -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/macro.njk +3 -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-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/README.md +15 -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 +672 -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/macro.njk +3 -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 +36 -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-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-items.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/README.md +15 -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 +139 -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 +133 -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/macro.njk +3 -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/README.md +15 -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 +113 -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/macro.njk +3 -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/README.md +15 -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 +56 -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 +423 -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 +415 -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 +101 -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 +326 -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/macro.njk +3 -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 +707 -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 +699 -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 +223 -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 +62 -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.njk +25 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/README.md +15 -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 +69 -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 +260 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/macro-options.json +70 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/macro.njk +3 -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/README.md +15 -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 +218 -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/file-upload.bundle.js +744 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +736 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +257 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +378 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +174 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro.njk +3 -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-enhanced-with-error-message-and-hint.html +16 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html +10 -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.njk +90 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/README.md +15 -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 +194 -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 +712 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +170 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/macro.njk +3 -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-navigation.html +96 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +107 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/README.md +15 -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 +548 -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 +602 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +233 -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 +225 -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 +89 -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 +131 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-default.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html +48 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html +59 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-full-width-border.html +29 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html +119 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-navigation.html +59 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +30 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html +62 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +66 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/README.md +15 -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 +77 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/macro-options.json +32 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/macro.njk +3 -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/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +168 -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 +830 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +245 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/macro.njk +3 -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-error-and-hint.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/template-with-error-message.html +9 -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-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-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 +133 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/README.md +15 -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 +76 -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/macro.njk +3 -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/README.md +15 -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 +210 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/label/macro.njk +3 -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/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +93 -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 +260 -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/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +365 -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 +357 -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 +49 -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-default.html +12 -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 +21 -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 +228 -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 +393 -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-link-and-item-text.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.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/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +58 -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 +118 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/macro-options.json +50 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/macro.njk +3 -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 +57 -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 +215 -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 +638 -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 +630 -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 +150 -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.njk +93 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +36 -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 +97 -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/macro.njk +3 -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/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +328 -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 +1334 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/macro-options.json +211 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +225 -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 +217 -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 +88 -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 +21 -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-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-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-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.html +39 -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-hint.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-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/README.md +15 -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 +550 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/macro-options.json +163 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/macro.njk +3 -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.njk +68 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +254 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +651 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro-options.json +144 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +229 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +221 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +85 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-default.html +57 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-inverse.html +63 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item-and-collapsenavigationonmobile-set-to-true.html +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item.html +35 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-collapsenavigationonmobile-set-to-false.html +60 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-html-navigation-items.html +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-large-navigation.html +153 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-long-service-name.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-a-current-item.html +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-non-link-navigation-items.html +49 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-link.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name-and-navigation.html +63 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name.html +18 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +106 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +52 -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 +113 -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/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +224 -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 +216 -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 +58 -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/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +269 -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 +1528 -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/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-extreme.html +106 -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-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-with-actions.html +58 -0
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template.njk +94 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/README.md +15 -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 +651 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/macro-options.json +132 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/macro.njk +3 -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-with-head-and-caption.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template-with-head.html +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/table/template.njk +57 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/README.md +15 -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 +333 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/macro-options.json +84 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +433 -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 +425 -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 +283 -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/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +97 -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 +161 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/macro-options.json +26 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/macro.njk +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 +79 -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 +529 -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-with-all-possible-colours.html +143 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-empty-values.html +27 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-hint-text-and-additional-states.html +77 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-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/README.md +15 -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 +316 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +143 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro.njk +3 -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-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.njk +56 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +66 -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 +101 -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/macro.njk +3 -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 +15 -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 +57 -0
- data/node_modules/govuk-frontend/dist/govuk/errors/index.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 +167 -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 +59 -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 +288 -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 +88 -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 +166 -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/macros/logo.njk +78 -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 +57 -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 +42 -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 +195 -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 +382 -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 +36 -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 +317 -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 +69 -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 +8 -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/tools/_rebrand.scss +65 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.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/functions.js +25 -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 +179 -0
- data/node_modules/govuk-frontend/package.json +92 -0
- metadata +852 -17
- data/.github/dependabot.yml +0 -10
- data/.github/pull_request_template.md +0 -1
- data/.github/workflows/actionlint.yml +0 -12
- data/.github/workflows/autorelease.yml +0 -12
- data/.github/workflows/ci.yml +0 -55
- data/.gitignore +0 -19
- data/.rspec +0 -3
- data/.rubocop.yml +0 -3
- data/.ruby-version +0 -1
- data/CHANGELOG.md +0 -163
- data/Gemfile +0 -7
- data/LICENSE.txt +0 -19
- data/Rakefile +0 -10
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/content_block_tools.gemspec +0 -35
@@ -0,0 +1,830 @@
|
|
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 = global.GOVUKFrontend || {}));
|
5
|
+
})(this, (function (exports) { 'use strict';
|
6
|
+
|
7
|
+
function isInitialised($root, moduleName) {
|
8
|
+
return $root instanceof HTMLElement && $root.hasAttribute(`data-${moduleName}-init`);
|
9
|
+
}
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Checks if GOV.UK Frontend is supported on this page
|
13
|
+
*
|
14
|
+
* Some browsers will load and run our JavaScript but GOV.UK Frontend
|
15
|
+
* won't be supported.
|
16
|
+
*
|
17
|
+
* @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support
|
18
|
+
* @returns {boolean} Whether GOV.UK Frontend is supported on this page
|
19
|
+
*/
|
20
|
+
function isSupported($scope = document.body) {
|
21
|
+
if (!$scope) {
|
22
|
+
return false;
|
23
|
+
}
|
24
|
+
return $scope.classList.contains('govuk-frontend-supported');
|
25
|
+
}
|
26
|
+
function isArray(option) {
|
27
|
+
return Array.isArray(option);
|
28
|
+
}
|
29
|
+
function isObject(option) {
|
30
|
+
return !!option && typeof option === 'object' && !isArray(option);
|
31
|
+
}
|
32
|
+
function formatErrorMessage(Component, message) {
|
33
|
+
return `${Component.moduleName}: ${message}`;
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* @typedef ComponentWithModuleName
|
37
|
+
* @property {string} moduleName - Name of the component
|
38
|
+
*/
|
39
|
+
/**
|
40
|
+
* @import { ObjectNested } from './configuration.mjs'
|
41
|
+
*/
|
42
|
+
|
43
|
+
class GOVUKFrontendError extends Error {
|
44
|
+
constructor(...args) {
|
45
|
+
super(...args);
|
46
|
+
this.name = 'GOVUKFrontendError';
|
47
|
+
}
|
48
|
+
}
|
49
|
+
class SupportError extends GOVUKFrontendError {
|
50
|
+
/**
|
51
|
+
* Checks if GOV.UK Frontend is supported on this page
|
52
|
+
*
|
53
|
+
* @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support
|
54
|
+
*/
|
55
|
+
constructor($scope = document.body) {
|
56
|
+
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';
|
57
|
+
super($scope ? supportMessage : 'GOV.UK Frontend initialised without `<script type="module">`');
|
58
|
+
this.name = 'SupportError';
|
59
|
+
}
|
60
|
+
}
|
61
|
+
class ConfigError extends GOVUKFrontendError {
|
62
|
+
constructor(...args) {
|
63
|
+
super(...args);
|
64
|
+
this.name = 'ConfigError';
|
65
|
+
}
|
66
|
+
}
|
67
|
+
class ElementError extends GOVUKFrontendError {
|
68
|
+
constructor(messageOrOptions) {
|
69
|
+
let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';
|
70
|
+
if (typeof messageOrOptions === 'object') {
|
71
|
+
const {
|
72
|
+
component,
|
73
|
+
identifier,
|
74
|
+
element,
|
75
|
+
expectedType
|
76
|
+
} = messageOrOptions;
|
77
|
+
message = identifier;
|
78
|
+
message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';
|
79
|
+
message = formatErrorMessage(component, message);
|
80
|
+
}
|
81
|
+
super(message);
|
82
|
+
this.name = 'ElementError';
|
83
|
+
}
|
84
|
+
}
|
85
|
+
class InitError extends GOVUKFrontendError {
|
86
|
+
constructor(componentOrMessage) {
|
87
|
+
const message = typeof componentOrMessage === 'string' ? componentOrMessage : formatErrorMessage(componentOrMessage, `Root element (\`$root\`) already initialised`);
|
88
|
+
super(message);
|
89
|
+
this.name = 'InitError';
|
90
|
+
}
|
91
|
+
}
|
92
|
+
/**
|
93
|
+
* @import { ComponentWithModuleName } from '../common/index.mjs'
|
94
|
+
*/
|
95
|
+
|
96
|
+
class Component {
|
97
|
+
/**
|
98
|
+
* Returns the root element of the component
|
99
|
+
*
|
100
|
+
* @protected
|
101
|
+
* @returns {RootElementType} - the root element of component
|
102
|
+
*/
|
103
|
+
get $root() {
|
104
|
+
return this._$root;
|
105
|
+
}
|
106
|
+
constructor($root) {
|
107
|
+
this._$root = void 0;
|
108
|
+
const childConstructor = this.constructor;
|
109
|
+
if (typeof childConstructor.moduleName !== 'string') {
|
110
|
+
throw new InitError(`\`moduleName\` not defined in component`);
|
111
|
+
}
|
112
|
+
if (!($root instanceof childConstructor.elementType)) {
|
113
|
+
throw new ElementError({
|
114
|
+
element: $root,
|
115
|
+
component: childConstructor,
|
116
|
+
identifier: 'Root element (`$root`)',
|
117
|
+
expectedType: childConstructor.elementType.name
|
118
|
+
});
|
119
|
+
} else {
|
120
|
+
this._$root = $root;
|
121
|
+
}
|
122
|
+
childConstructor.checkSupport();
|
123
|
+
this.checkInitialised();
|
124
|
+
const moduleName = childConstructor.moduleName;
|
125
|
+
this.$root.setAttribute(`data-${moduleName}-init`, '');
|
126
|
+
}
|
127
|
+
checkInitialised() {
|
128
|
+
const constructor = this.constructor;
|
129
|
+
const moduleName = constructor.moduleName;
|
130
|
+
if (moduleName && isInitialised(this.$root, moduleName)) {
|
131
|
+
throw new InitError(constructor);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
static checkSupport() {
|
135
|
+
if (!isSupported()) {
|
136
|
+
throw new SupportError();
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
/**
|
142
|
+
* @typedef ChildClass
|
143
|
+
* @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component
|
144
|
+
*/
|
145
|
+
|
146
|
+
/**
|
147
|
+
* @typedef {typeof Component & ChildClass} ChildClassConstructor
|
148
|
+
*/
|
149
|
+
Component.elementType = HTMLElement;
|
150
|
+
|
151
|
+
const configOverride = Symbol.for('configOverride');
|
152
|
+
class ConfigurableComponent extends Component {
|
153
|
+
[configOverride](param) {
|
154
|
+
return {};
|
155
|
+
}
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Returns the root element of the component
|
159
|
+
*
|
160
|
+
* @protected
|
161
|
+
* @returns {ConfigurationType} - the root element of component
|
162
|
+
*/
|
163
|
+
get config() {
|
164
|
+
return this._config;
|
165
|
+
}
|
166
|
+
constructor($root, config) {
|
167
|
+
super($root);
|
168
|
+
this._config = void 0;
|
169
|
+
const childConstructor = this.constructor;
|
170
|
+
if (!isObject(childConstructor.defaults)) {
|
171
|
+
throw new ConfigError(formatErrorMessage(childConstructor, 'Config passed as parameter into constructor but no defaults defined'));
|
172
|
+
}
|
173
|
+
const datasetConfig = normaliseDataset(childConstructor, this._$root.dataset);
|
174
|
+
this._config = mergeConfigs(childConstructor.defaults, config != null ? config : {}, this[configOverride](datasetConfig), datasetConfig);
|
175
|
+
}
|
176
|
+
}
|
177
|
+
function normaliseString(value, property) {
|
178
|
+
const trimmedValue = value ? value.trim() : '';
|
179
|
+
let output;
|
180
|
+
let outputType = property == null ? void 0 : property.type;
|
181
|
+
if (!outputType) {
|
182
|
+
if (['true', 'false'].includes(trimmedValue)) {
|
183
|
+
outputType = 'boolean';
|
184
|
+
}
|
185
|
+
if (trimmedValue.length > 0 && isFinite(Number(trimmedValue))) {
|
186
|
+
outputType = 'number';
|
187
|
+
}
|
188
|
+
}
|
189
|
+
switch (outputType) {
|
190
|
+
case 'boolean':
|
191
|
+
output = trimmedValue === 'true';
|
192
|
+
break;
|
193
|
+
case 'number':
|
194
|
+
output = Number(trimmedValue);
|
195
|
+
break;
|
196
|
+
default:
|
197
|
+
output = value;
|
198
|
+
}
|
199
|
+
return output;
|
200
|
+
}
|
201
|
+
function normaliseDataset(Component, dataset) {
|
202
|
+
if (!isObject(Component.schema)) {
|
203
|
+
throw new ConfigError(formatErrorMessage(Component, 'Config passed as parameter into constructor but no schema defined'));
|
204
|
+
}
|
205
|
+
const out = {};
|
206
|
+
const entries = Object.entries(Component.schema.properties);
|
207
|
+
for (const entry of entries) {
|
208
|
+
const [namespace, property] = entry;
|
209
|
+
const field = namespace.toString();
|
210
|
+
if (field in dataset) {
|
211
|
+
out[field] = normaliseString(dataset[field], property);
|
212
|
+
}
|
213
|
+
if ((property == null ? void 0 : property.type) === 'object') {
|
214
|
+
out[field] = extractConfigByNamespace(Component.schema, dataset, namespace);
|
215
|
+
}
|
216
|
+
}
|
217
|
+
return out;
|
218
|
+
}
|
219
|
+
function mergeConfigs(...configObjects) {
|
220
|
+
const formattedConfigObject = {};
|
221
|
+
for (const configObject of configObjects) {
|
222
|
+
for (const key of Object.keys(configObject)) {
|
223
|
+
const option = formattedConfigObject[key];
|
224
|
+
const override = configObject[key];
|
225
|
+
if (isObject(option) && isObject(override)) {
|
226
|
+
formattedConfigObject[key] = mergeConfigs(option, override);
|
227
|
+
} else {
|
228
|
+
formattedConfigObject[key] = override;
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}
|
232
|
+
return formattedConfigObject;
|
233
|
+
}
|
234
|
+
function extractConfigByNamespace(schema, dataset, namespace) {
|
235
|
+
const property = schema.properties[namespace];
|
236
|
+
if ((property == null ? void 0 : property.type) !== 'object') {
|
237
|
+
return;
|
238
|
+
}
|
239
|
+
const newObject = {
|
240
|
+
[namespace]: {}
|
241
|
+
};
|
242
|
+
for (const [key, value] of Object.entries(dataset)) {
|
243
|
+
let current = newObject;
|
244
|
+
const keyParts = key.split('.');
|
245
|
+
for (const [index, name] of keyParts.entries()) {
|
246
|
+
if (isObject(current)) {
|
247
|
+
if (index < keyParts.length - 1) {
|
248
|
+
if (!isObject(current[name])) {
|
249
|
+
current[name] = {};
|
250
|
+
}
|
251
|
+
current = current[name];
|
252
|
+
} else if (key !== namespace) {
|
253
|
+
current[name] = normaliseString(value);
|
254
|
+
}
|
255
|
+
}
|
256
|
+
}
|
257
|
+
}
|
258
|
+
return newObject[namespace];
|
259
|
+
}
|
260
|
+
/**
|
261
|
+
* Schema for component config
|
262
|
+
*
|
263
|
+
* @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType
|
264
|
+
* @typedef {object} Schema
|
265
|
+
* @property {Record<keyof ConfigurationType, SchemaProperty | undefined>} properties - Schema properties
|
266
|
+
* @property {SchemaCondition<ConfigurationType>[]} [anyOf] - List of schema conditions
|
267
|
+
*/
|
268
|
+
/**
|
269
|
+
* Schema property for component config
|
270
|
+
*
|
271
|
+
* @typedef {object} SchemaProperty
|
272
|
+
* @property {'string' | 'boolean' | 'number' | 'object'} type - Property type
|
273
|
+
*/
|
274
|
+
/**
|
275
|
+
* Schema condition for component config
|
276
|
+
*
|
277
|
+
* @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType
|
278
|
+
* @typedef {object} SchemaCondition
|
279
|
+
* @property {(keyof ConfigurationType)[]} required - List of required config fields
|
280
|
+
* @property {string} errorMessage - Error message when required config fields not provided
|
281
|
+
*/
|
282
|
+
/**
|
283
|
+
* @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]
|
284
|
+
* @typedef ChildClass
|
285
|
+
* @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component
|
286
|
+
* @property {Schema<ConfigurationType>} [schema] - The schema of the component configuration
|
287
|
+
* @property {ConfigurationType} [defaults] - The default values of the configuration of the component
|
288
|
+
*/
|
289
|
+
/**
|
290
|
+
* @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]
|
291
|
+
* @typedef {typeof Component & ChildClass<ConfigurationType>} ChildClassConstructor<ConfigurationType>
|
292
|
+
*/
|
293
|
+
|
294
|
+
class I18n {
|
295
|
+
constructor(translations = {}, config = {}) {
|
296
|
+
var _config$locale;
|
297
|
+
this.translations = void 0;
|
298
|
+
this.locale = void 0;
|
299
|
+
this.translations = translations;
|
300
|
+
this.locale = (_config$locale = config.locale) != null ? _config$locale : document.documentElement.lang || 'en';
|
301
|
+
}
|
302
|
+
t(lookupKey, options) {
|
303
|
+
if (!lookupKey) {
|
304
|
+
throw new Error('i18n: lookup key missing');
|
305
|
+
}
|
306
|
+
let translation = this.translations[lookupKey];
|
307
|
+
if (typeof (options == null ? void 0 : options.count) === 'number' && typeof translation === 'object') {
|
308
|
+
const translationPluralForm = translation[this.getPluralSuffix(lookupKey, options.count)];
|
309
|
+
if (translationPluralForm) {
|
310
|
+
translation = translationPluralForm;
|
311
|
+
}
|
312
|
+
}
|
313
|
+
if (typeof translation === 'string') {
|
314
|
+
if (translation.match(/%{(.\S+)}/)) {
|
315
|
+
if (!options) {
|
316
|
+
throw new Error('i18n: cannot replace placeholders in string if no option data provided');
|
317
|
+
}
|
318
|
+
return this.replacePlaceholders(translation, options);
|
319
|
+
}
|
320
|
+
return translation;
|
321
|
+
}
|
322
|
+
return lookupKey;
|
323
|
+
}
|
324
|
+
replacePlaceholders(translationString, options) {
|
325
|
+
const formatter = Intl.NumberFormat.supportedLocalesOf(this.locale).length ? new Intl.NumberFormat(this.locale) : undefined;
|
326
|
+
return translationString.replace(/%{(.\S+)}/g, function (placeholderWithBraces, placeholderKey) {
|
327
|
+
if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {
|
328
|
+
const placeholderValue = options[placeholderKey];
|
329
|
+
if (placeholderValue === false || typeof placeholderValue !== 'number' && typeof placeholderValue !== 'string') {
|
330
|
+
return '';
|
331
|
+
}
|
332
|
+
if (typeof placeholderValue === 'number') {
|
333
|
+
return formatter ? formatter.format(placeholderValue) : `${placeholderValue}`;
|
334
|
+
}
|
335
|
+
return placeholderValue;
|
336
|
+
}
|
337
|
+
throw new Error(`i18n: no data found to replace ${placeholderWithBraces} placeholder in string`);
|
338
|
+
});
|
339
|
+
}
|
340
|
+
hasIntlPluralRulesSupport() {
|
341
|
+
return Boolean('PluralRules' in window.Intl && Intl.PluralRules.supportedLocalesOf(this.locale).length);
|
342
|
+
}
|
343
|
+
getPluralSuffix(lookupKey, count) {
|
344
|
+
count = Number(count);
|
345
|
+
if (!isFinite(count)) {
|
346
|
+
return 'other';
|
347
|
+
}
|
348
|
+
const translation = this.translations[lookupKey];
|
349
|
+
const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);
|
350
|
+
if (typeof translation === 'object') {
|
351
|
+
if (preferredForm in translation) {
|
352
|
+
return preferredForm;
|
353
|
+
} else if ('other' in translation) {
|
354
|
+
console.warn(`i18n: Missing plural form ".${preferredForm}" for "${this.locale}" locale. Falling back to ".other".`);
|
355
|
+
return 'other';
|
356
|
+
}
|
357
|
+
}
|
358
|
+
throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
|
359
|
+
}
|
360
|
+
selectPluralFormUsingFallbackRules(count) {
|
361
|
+
count = Math.abs(Math.floor(count));
|
362
|
+
const ruleset = this.getPluralRulesForLocale();
|
363
|
+
if (ruleset) {
|
364
|
+
return I18n.pluralRules[ruleset](count);
|
365
|
+
}
|
366
|
+
return 'other';
|
367
|
+
}
|
368
|
+
getPluralRulesForLocale() {
|
369
|
+
const localeShort = this.locale.split('-')[0];
|
370
|
+
for (const pluralRule in I18n.pluralRulesMap) {
|
371
|
+
const languages = I18n.pluralRulesMap[pluralRule];
|
372
|
+
if (languages.includes(this.locale) || languages.includes(localeShort)) {
|
373
|
+
return pluralRule;
|
374
|
+
}
|
375
|
+
}
|
376
|
+
}
|
377
|
+
}
|
378
|
+
I18n.pluralRulesMap = {
|
379
|
+
arabic: ['ar'],
|
380
|
+
chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
|
381
|
+
french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
|
382
|
+
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'],
|
383
|
+
irish: ['ga'],
|
384
|
+
russian: ['ru', 'uk'],
|
385
|
+
scottish: ['gd'],
|
386
|
+
spanish: ['pt-PT', 'it', 'es'],
|
387
|
+
welsh: ['cy']
|
388
|
+
};
|
389
|
+
I18n.pluralRules = {
|
390
|
+
arabic(n) {
|
391
|
+
if (n === 0) {
|
392
|
+
return 'zero';
|
393
|
+
}
|
394
|
+
if (n === 1) {
|
395
|
+
return 'one';
|
396
|
+
}
|
397
|
+
if (n === 2) {
|
398
|
+
return 'two';
|
399
|
+
}
|
400
|
+
if (n % 100 >= 3 && n % 100 <= 10) {
|
401
|
+
return 'few';
|
402
|
+
}
|
403
|
+
if (n % 100 >= 11 && n % 100 <= 99) {
|
404
|
+
return 'many';
|
405
|
+
}
|
406
|
+
return 'other';
|
407
|
+
},
|
408
|
+
chinese() {
|
409
|
+
return 'other';
|
410
|
+
},
|
411
|
+
french(n) {
|
412
|
+
return n === 0 || n === 1 ? 'one' : 'other';
|
413
|
+
},
|
414
|
+
german(n) {
|
415
|
+
return n === 1 ? 'one' : 'other';
|
416
|
+
},
|
417
|
+
irish(n) {
|
418
|
+
if (n === 1) {
|
419
|
+
return 'one';
|
420
|
+
}
|
421
|
+
if (n === 2) {
|
422
|
+
return 'two';
|
423
|
+
}
|
424
|
+
if (n >= 3 && n <= 6) {
|
425
|
+
return 'few';
|
426
|
+
}
|
427
|
+
if (n >= 7 && n <= 10) {
|
428
|
+
return 'many';
|
429
|
+
}
|
430
|
+
return 'other';
|
431
|
+
},
|
432
|
+
russian(n) {
|
433
|
+
const lastTwo = n % 100;
|
434
|
+
const last = lastTwo % 10;
|
435
|
+
if (last === 1 && lastTwo !== 11) {
|
436
|
+
return 'one';
|
437
|
+
}
|
438
|
+
if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {
|
439
|
+
return 'few';
|
440
|
+
}
|
441
|
+
if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {
|
442
|
+
return 'many';
|
443
|
+
}
|
444
|
+
return 'other';
|
445
|
+
},
|
446
|
+
scottish(n) {
|
447
|
+
if (n === 1 || n === 11) {
|
448
|
+
return 'one';
|
449
|
+
}
|
450
|
+
if (n === 2 || n === 12) {
|
451
|
+
return 'two';
|
452
|
+
}
|
453
|
+
if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {
|
454
|
+
return 'few';
|
455
|
+
}
|
456
|
+
return 'other';
|
457
|
+
},
|
458
|
+
spanish(n) {
|
459
|
+
if (n === 1) {
|
460
|
+
return 'one';
|
461
|
+
}
|
462
|
+
if (n % 1000000 === 0 && n !== 0) {
|
463
|
+
return 'many';
|
464
|
+
}
|
465
|
+
return 'other';
|
466
|
+
},
|
467
|
+
welsh(n) {
|
468
|
+
if (n === 0) {
|
469
|
+
return 'zero';
|
470
|
+
}
|
471
|
+
if (n === 1) {
|
472
|
+
return 'one';
|
473
|
+
}
|
474
|
+
if (n === 2) {
|
475
|
+
return 'two';
|
476
|
+
}
|
477
|
+
if (n === 3) {
|
478
|
+
return 'few';
|
479
|
+
}
|
480
|
+
if (n === 6) {
|
481
|
+
return 'many';
|
482
|
+
}
|
483
|
+
return 'other';
|
484
|
+
}
|
485
|
+
};
|
486
|
+
|
487
|
+
/**
|
488
|
+
* Accordion component
|
489
|
+
*
|
490
|
+
* This allows a collection of sections to be collapsed by default, showing only
|
491
|
+
* their headers. Sections can be expanded or collapsed individually by clicking
|
492
|
+
* their headers. A "Show all sections" button is also added to the top of the
|
493
|
+
* accordion, which switches to "Hide all sections" when all the sections are
|
494
|
+
* expanded.
|
495
|
+
*
|
496
|
+
* The state of each section is saved to the DOM via the `aria-expanded`
|
497
|
+
* attribute, which also provides accessibility.
|
498
|
+
*
|
499
|
+
* @preserve
|
500
|
+
* @augments ConfigurableComponent<AccordionConfig>
|
501
|
+
*/
|
502
|
+
class Accordion extends ConfigurableComponent {
|
503
|
+
/**
|
504
|
+
* @param {Element | null} $root - HTML element to use for accordion
|
505
|
+
* @param {AccordionConfig} [config] - Accordion config
|
506
|
+
*/
|
507
|
+
constructor($root, config = {}) {
|
508
|
+
super($root, config);
|
509
|
+
this.i18n = void 0;
|
510
|
+
this.controlsClass = 'govuk-accordion__controls';
|
511
|
+
this.showAllClass = 'govuk-accordion__show-all';
|
512
|
+
this.showAllTextClass = 'govuk-accordion__show-all-text';
|
513
|
+
this.sectionClass = 'govuk-accordion__section';
|
514
|
+
this.sectionExpandedClass = 'govuk-accordion__section--expanded';
|
515
|
+
this.sectionButtonClass = 'govuk-accordion__section-button';
|
516
|
+
this.sectionHeaderClass = 'govuk-accordion__section-header';
|
517
|
+
this.sectionHeadingClass = 'govuk-accordion__section-heading';
|
518
|
+
this.sectionHeadingDividerClass = 'govuk-accordion__section-heading-divider';
|
519
|
+
this.sectionHeadingTextClass = 'govuk-accordion__section-heading-text';
|
520
|
+
this.sectionHeadingTextFocusClass = 'govuk-accordion__section-heading-text-focus';
|
521
|
+
this.sectionShowHideToggleClass = 'govuk-accordion__section-toggle';
|
522
|
+
this.sectionShowHideToggleFocusClass = 'govuk-accordion__section-toggle-focus';
|
523
|
+
this.sectionShowHideTextClass = 'govuk-accordion__section-toggle-text';
|
524
|
+
this.upChevronIconClass = 'govuk-accordion-nav__chevron';
|
525
|
+
this.downChevronIconClass = 'govuk-accordion-nav__chevron--down';
|
526
|
+
this.sectionSummaryClass = 'govuk-accordion__section-summary';
|
527
|
+
this.sectionSummaryFocusClass = 'govuk-accordion__section-summary-focus';
|
528
|
+
this.sectionContentClass = 'govuk-accordion__section-content';
|
529
|
+
this.$sections = void 0;
|
530
|
+
this.$showAllButton = null;
|
531
|
+
this.$showAllIcon = null;
|
532
|
+
this.$showAllText = null;
|
533
|
+
this.i18n = new I18n(this.config.i18n);
|
534
|
+
const $sections = this.$root.querySelectorAll(`.${this.sectionClass}`);
|
535
|
+
if (!$sections.length) {
|
536
|
+
throw new ElementError({
|
537
|
+
component: Accordion,
|
538
|
+
identifier: `Sections (\`<div class="${this.sectionClass}">\`)`
|
539
|
+
});
|
540
|
+
}
|
541
|
+
this.$sections = $sections;
|
542
|
+
this.initControls();
|
543
|
+
this.initSectionHeaders();
|
544
|
+
this.updateShowAllButton(this.areAllSectionsOpen());
|
545
|
+
}
|
546
|
+
initControls() {
|
547
|
+
this.$showAllButton = document.createElement('button');
|
548
|
+
this.$showAllButton.setAttribute('type', 'button');
|
549
|
+
this.$showAllButton.setAttribute('class', this.showAllClass);
|
550
|
+
this.$showAllButton.setAttribute('aria-expanded', 'false');
|
551
|
+
this.$showAllIcon = document.createElement('span');
|
552
|
+
this.$showAllIcon.classList.add(this.upChevronIconClass);
|
553
|
+
this.$showAllButton.appendChild(this.$showAllIcon);
|
554
|
+
const $accordionControls = document.createElement('div');
|
555
|
+
$accordionControls.setAttribute('class', this.controlsClass);
|
556
|
+
$accordionControls.appendChild(this.$showAllButton);
|
557
|
+
this.$root.insertBefore($accordionControls, this.$root.firstChild);
|
558
|
+
this.$showAllText = document.createElement('span');
|
559
|
+
this.$showAllText.classList.add(this.showAllTextClass);
|
560
|
+
this.$showAllButton.appendChild(this.$showAllText);
|
561
|
+
this.$showAllButton.addEventListener('click', () => this.onShowOrHideAllToggle());
|
562
|
+
if ('onbeforematch' in document) {
|
563
|
+
document.addEventListener('beforematch', event => this.onBeforeMatch(event));
|
564
|
+
}
|
565
|
+
}
|
566
|
+
initSectionHeaders() {
|
567
|
+
this.$sections.forEach(($section, i) => {
|
568
|
+
const $header = $section.querySelector(`.${this.sectionHeaderClass}`);
|
569
|
+
if (!$header) {
|
570
|
+
throw new ElementError({
|
571
|
+
component: Accordion,
|
572
|
+
identifier: `Section headers (\`<div class="${this.sectionHeaderClass}">\`)`
|
573
|
+
});
|
574
|
+
}
|
575
|
+
this.constructHeaderMarkup($header, i);
|
576
|
+
this.setExpanded(this.isExpanded($section), $section);
|
577
|
+
$header.addEventListener('click', () => this.onSectionToggle($section));
|
578
|
+
this.setInitialState($section);
|
579
|
+
});
|
580
|
+
}
|
581
|
+
constructHeaderMarkup($header, index) {
|
582
|
+
const $span = $header.querySelector(`.${this.sectionButtonClass}`);
|
583
|
+
const $heading = $header.querySelector(`.${this.sectionHeadingClass}`);
|
584
|
+
const $summary = $header.querySelector(`.${this.sectionSummaryClass}`);
|
585
|
+
if (!$heading) {
|
586
|
+
throw new ElementError({
|
587
|
+
component: Accordion,
|
588
|
+
identifier: `Section heading (\`.${this.sectionHeadingClass}\`)`
|
589
|
+
});
|
590
|
+
}
|
591
|
+
if (!$span) {
|
592
|
+
throw new ElementError({
|
593
|
+
component: Accordion,
|
594
|
+
identifier: `Section button placeholder (\`<span class="${this.sectionButtonClass}">\`)`
|
595
|
+
});
|
596
|
+
}
|
597
|
+
const $button = document.createElement('button');
|
598
|
+
$button.setAttribute('type', 'button');
|
599
|
+
$button.setAttribute('aria-controls', `${this.$root.id}-content-${index + 1}`);
|
600
|
+
for (const attr of Array.from($span.attributes)) {
|
601
|
+
if (attr.name !== 'id') {
|
602
|
+
$button.setAttribute(attr.name, attr.value);
|
603
|
+
}
|
604
|
+
}
|
605
|
+
const $headingText = document.createElement('span');
|
606
|
+
$headingText.classList.add(this.sectionHeadingTextClass);
|
607
|
+
$headingText.id = $span.id;
|
608
|
+
const $headingTextFocus = document.createElement('span');
|
609
|
+
$headingTextFocus.classList.add(this.sectionHeadingTextFocusClass);
|
610
|
+
$headingText.appendChild($headingTextFocus);
|
611
|
+
Array.from($span.childNodes).forEach($child => $headingTextFocus.appendChild($child));
|
612
|
+
const $showHideToggle = document.createElement('span');
|
613
|
+
$showHideToggle.classList.add(this.sectionShowHideToggleClass);
|
614
|
+
$showHideToggle.setAttribute('data-nosnippet', '');
|
615
|
+
const $showHideToggleFocus = document.createElement('span');
|
616
|
+
$showHideToggleFocus.classList.add(this.sectionShowHideToggleFocusClass);
|
617
|
+
$showHideToggle.appendChild($showHideToggleFocus);
|
618
|
+
const $showHideText = document.createElement('span');
|
619
|
+
const $showHideIcon = document.createElement('span');
|
620
|
+
$showHideIcon.classList.add(this.upChevronIconClass);
|
621
|
+
$showHideToggleFocus.appendChild($showHideIcon);
|
622
|
+
$showHideText.classList.add(this.sectionShowHideTextClass);
|
623
|
+
$showHideToggleFocus.appendChild($showHideText);
|
624
|
+
$button.appendChild($headingText);
|
625
|
+
$button.appendChild(this.getButtonPunctuationEl());
|
626
|
+
if ($summary) {
|
627
|
+
const $summarySpan = document.createElement('span');
|
628
|
+
const $summarySpanFocus = document.createElement('span');
|
629
|
+
$summarySpanFocus.classList.add(this.sectionSummaryFocusClass);
|
630
|
+
$summarySpan.appendChild($summarySpanFocus);
|
631
|
+
for (const attr of Array.from($summary.attributes)) {
|
632
|
+
$summarySpan.setAttribute(attr.name, attr.value);
|
633
|
+
}
|
634
|
+
Array.from($summary.childNodes).forEach($child => $summarySpanFocus.appendChild($child));
|
635
|
+
$summary.remove();
|
636
|
+
$button.appendChild($summarySpan);
|
637
|
+
$button.appendChild(this.getButtonPunctuationEl());
|
638
|
+
}
|
639
|
+
$button.appendChild($showHideToggle);
|
640
|
+
$heading.removeChild($span);
|
641
|
+
$heading.appendChild($button);
|
642
|
+
}
|
643
|
+
onBeforeMatch(event) {
|
644
|
+
const $fragment = event.target;
|
645
|
+
if (!($fragment instanceof Element)) {
|
646
|
+
return;
|
647
|
+
}
|
648
|
+
const $section = $fragment.closest(`.${this.sectionClass}`);
|
649
|
+
if ($section) {
|
650
|
+
this.setExpanded(true, $section);
|
651
|
+
}
|
652
|
+
}
|
653
|
+
onSectionToggle($section) {
|
654
|
+
const nowExpanded = !this.isExpanded($section);
|
655
|
+
this.setExpanded(nowExpanded, $section);
|
656
|
+
this.storeState($section, nowExpanded);
|
657
|
+
}
|
658
|
+
onShowOrHideAllToggle() {
|
659
|
+
const nowExpanded = !this.areAllSectionsOpen();
|
660
|
+
this.$sections.forEach($section => {
|
661
|
+
this.setExpanded(nowExpanded, $section);
|
662
|
+
this.storeState($section, nowExpanded);
|
663
|
+
});
|
664
|
+
this.updateShowAllButton(nowExpanded);
|
665
|
+
}
|
666
|
+
setExpanded(expanded, $section) {
|
667
|
+
const $showHideIcon = $section.querySelector(`.${this.upChevronIconClass}`);
|
668
|
+
const $showHideText = $section.querySelector(`.${this.sectionShowHideTextClass}`);
|
669
|
+
const $button = $section.querySelector(`.${this.sectionButtonClass}`);
|
670
|
+
const $content = $section.querySelector(`.${this.sectionContentClass}`);
|
671
|
+
if (!$content) {
|
672
|
+
throw new ElementError({
|
673
|
+
component: Accordion,
|
674
|
+
identifier: `Section content (\`<div class="${this.sectionContentClass}">\`)`
|
675
|
+
});
|
676
|
+
}
|
677
|
+
if (!$showHideIcon || !$showHideText || !$button) {
|
678
|
+
return;
|
679
|
+
}
|
680
|
+
const newButtonText = expanded ? this.i18n.t('hideSection') : this.i18n.t('showSection');
|
681
|
+
$showHideText.textContent = newButtonText;
|
682
|
+
$button.setAttribute('aria-expanded', `${expanded}`);
|
683
|
+
const ariaLabelParts = [];
|
684
|
+
const $headingText = $section.querySelector(`.${this.sectionHeadingTextClass}`);
|
685
|
+
if ($headingText) {
|
686
|
+
ariaLabelParts.push(`${$headingText.textContent}`.trim());
|
687
|
+
}
|
688
|
+
const $summary = $section.querySelector(`.${this.sectionSummaryClass}`);
|
689
|
+
if ($summary) {
|
690
|
+
ariaLabelParts.push(`${$summary.textContent}`.trim());
|
691
|
+
}
|
692
|
+
const ariaLabelMessage = expanded ? this.i18n.t('hideSectionAriaLabel') : this.i18n.t('showSectionAriaLabel');
|
693
|
+
ariaLabelParts.push(ariaLabelMessage);
|
694
|
+
$button.setAttribute('aria-label', ariaLabelParts.join(' , '));
|
695
|
+
if (expanded) {
|
696
|
+
$content.removeAttribute('hidden');
|
697
|
+
$section.classList.add(this.sectionExpandedClass);
|
698
|
+
$showHideIcon.classList.remove(this.downChevronIconClass);
|
699
|
+
} else {
|
700
|
+
$content.setAttribute('hidden', 'until-found');
|
701
|
+
$section.classList.remove(this.sectionExpandedClass);
|
702
|
+
$showHideIcon.classList.add(this.downChevronIconClass);
|
703
|
+
}
|
704
|
+
this.updateShowAllButton(this.areAllSectionsOpen());
|
705
|
+
}
|
706
|
+
isExpanded($section) {
|
707
|
+
return $section.classList.contains(this.sectionExpandedClass);
|
708
|
+
}
|
709
|
+
areAllSectionsOpen() {
|
710
|
+
return Array.from(this.$sections).every($section => this.isExpanded($section));
|
711
|
+
}
|
712
|
+
updateShowAllButton(expanded) {
|
713
|
+
if (!this.$showAllButton || !this.$showAllText || !this.$showAllIcon) {
|
714
|
+
return;
|
715
|
+
}
|
716
|
+
this.$showAllButton.setAttribute('aria-expanded', expanded.toString());
|
717
|
+
this.$showAllText.textContent = expanded ? this.i18n.t('hideAllSections') : this.i18n.t('showAllSections');
|
718
|
+
this.$showAllIcon.classList.toggle(this.downChevronIconClass, !expanded);
|
719
|
+
}
|
720
|
+
|
721
|
+
/**
|
722
|
+
* Get the identifier for a section
|
723
|
+
*
|
724
|
+
* We need a unique way of identifying each content in the Accordion.
|
725
|
+
* Since an `#id` should be unique and an `id` is required for `aria-`
|
726
|
+
* attributes `id` can be safely used.
|
727
|
+
*
|
728
|
+
* @param {Element} $section - Section element
|
729
|
+
* @returns {string | undefined | null} Identifier for section
|
730
|
+
*/
|
731
|
+
getIdentifier($section) {
|
732
|
+
const $button = $section.querySelector(`.${this.sectionButtonClass}`);
|
733
|
+
return $button == null ? void 0 : $button.getAttribute('aria-controls');
|
734
|
+
}
|
735
|
+
storeState($section, isExpanded) {
|
736
|
+
if (!this.config.rememberExpanded) {
|
737
|
+
return;
|
738
|
+
}
|
739
|
+
const id = this.getIdentifier($section);
|
740
|
+
if (id) {
|
741
|
+
try {
|
742
|
+
window.sessionStorage.setItem(id, isExpanded.toString());
|
743
|
+
} catch (exception) {}
|
744
|
+
}
|
745
|
+
}
|
746
|
+
setInitialState($section) {
|
747
|
+
if (!this.config.rememberExpanded) {
|
748
|
+
return;
|
749
|
+
}
|
750
|
+
const id = this.getIdentifier($section);
|
751
|
+
if (id) {
|
752
|
+
try {
|
753
|
+
const state = window.sessionStorage.getItem(id);
|
754
|
+
if (state !== null) {
|
755
|
+
this.setExpanded(state === 'true', $section);
|
756
|
+
}
|
757
|
+
} catch (exception) {}
|
758
|
+
}
|
759
|
+
}
|
760
|
+
getButtonPunctuationEl() {
|
761
|
+
const $punctuationEl = document.createElement('span');
|
762
|
+
$punctuationEl.classList.add('govuk-visually-hidden', this.sectionHeadingDividerClass);
|
763
|
+
$punctuationEl.textContent = ', ';
|
764
|
+
return $punctuationEl;
|
765
|
+
}
|
766
|
+
}
|
767
|
+
|
768
|
+
/**
|
769
|
+
* Accordion config
|
770
|
+
*
|
771
|
+
* @see {@link Accordion.defaults}
|
772
|
+
* @typedef {object} AccordionConfig
|
773
|
+
* @property {AccordionTranslations} [i18n=Accordion.defaults.i18n] - Accordion translations
|
774
|
+
* @property {boolean} [rememberExpanded] - Whether the expanded and collapsed
|
775
|
+
* state of each section is remembered and restored when navigating.
|
776
|
+
*/
|
777
|
+
|
778
|
+
/**
|
779
|
+
* Accordion translations
|
780
|
+
*
|
781
|
+
* @see {@link Accordion.defaults.i18n}
|
782
|
+
* @typedef {object} AccordionTranslations
|
783
|
+
*
|
784
|
+
* Messages used by the component for the labels of its buttons. This includes
|
785
|
+
* the visible text shown on screen, and text to help assistive technology users
|
786
|
+
* for the buttons toggling each section.
|
787
|
+
* @property {string} [hideAllSections] - The text content for the 'Hide all
|
788
|
+
* sections' button, used when at least one section is expanded.
|
789
|
+
* @property {string} [hideSection] - The text content for the 'Hide'
|
790
|
+
* button, used when a section is expanded.
|
791
|
+
* @property {string} [hideSectionAriaLabel] - The text content appended to the
|
792
|
+
* 'Hide' button's accessible name when a section is expanded.
|
793
|
+
* @property {string} [showAllSections] - The text content for the 'Show all
|
794
|
+
* sections' button, used when all sections are collapsed.
|
795
|
+
* @property {string} [showSection] - The text content for the 'Show'
|
796
|
+
* button, used when a section is collapsed.
|
797
|
+
* @property {string} [showSectionAriaLabel] - The text content appended to the
|
798
|
+
* 'Show' button's accessible name when a section is expanded.
|
799
|
+
*/
|
800
|
+
|
801
|
+
/**
|
802
|
+
* @import { Schema } from '../../common/configuration.mjs'
|
803
|
+
*/
|
804
|
+
Accordion.moduleName = 'govuk-accordion';
|
805
|
+
Accordion.defaults = Object.freeze({
|
806
|
+
i18n: {
|
807
|
+
hideAllSections: 'Hide all sections',
|
808
|
+
hideSection: 'Hide',
|
809
|
+
hideSectionAriaLabel: 'Hide this section',
|
810
|
+
showAllSections: 'Show all sections',
|
811
|
+
showSection: 'Show',
|
812
|
+
showSectionAriaLabel: 'Show this section'
|
813
|
+
},
|
814
|
+
rememberExpanded: true
|
815
|
+
});
|
816
|
+
Accordion.schema = Object.freeze({
|
817
|
+
properties: {
|
818
|
+
i18n: {
|
819
|
+
type: 'object'
|
820
|
+
},
|
821
|
+
rememberExpanded: {
|
822
|
+
type: 'boolean'
|
823
|
+
}
|
824
|
+
}
|
825
|
+
});
|
826
|
+
|
827
|
+
exports.Accordion = Accordion;
|
828
|
+
|
829
|
+
}));
|
830
|
+
//# sourceMappingURL=accordion.bundle.js.map
|