govuk_tech_docs 6.6.0.rc.local.tested → 6.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -4
- data/Rakefile +3 -3
- data/govuk_tech_docs.gemspec +82 -24
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/tasks/lint.rake +24 -30
- data/node_modules/.bin/nunjucks-precompile +1 -0
- data/node_modules/.package-lock.json +62 -0
- data/{documentation → node_modules/a-sync-waterfall}/LICENSE +8 -8
- data/node_modules/a-sync-waterfall/README.md +95 -0
- data/node_modules/a-sync-waterfall/index.js +83 -0
- data/node_modules/a-sync-waterfall/package.json +21 -0
- data/node_modules/a-sync-waterfall/test.js +77 -0
- data/node_modules/asap/CHANGES.md +70 -0
- data/node_modules/asap/LICENSE.md +21 -0
- data/node_modules/asap/README.md +237 -0
- data/node_modules/asap/asap.js +65 -0
- data/node_modules/asap/browser-asap.js +66 -0
- data/node_modules/asap/browser-raw.js +223 -0
- data/node_modules/asap/package.json +58 -0
- data/node_modules/asap/raw.js +101 -0
- data/node_modules/commander/CHANGELOG.md +385 -0
- data/node_modules/commander/LICENSE +22 -0
- data/node_modules/commander/Readme.md +737 -0
- data/node_modules/commander/index.js +1756 -0
- data/node_modules/commander/package.json +48 -0
- data/node_modules/commander/typings/index.d.ts +386 -0
- data/node_modules/govuk-frontend/README.md +92 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -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.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/common/create-element.mjs.map +1 -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.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/component.mjs.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.bundle.js.map +1 -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.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/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/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.bundle.js.map +1 -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.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +496 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +74 -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-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-default-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-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-inverse-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-inverse-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-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-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-secondary-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-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-active-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-disabled.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-focus-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-warning-hover-state.html +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/template-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.bundle.js.map +1 -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.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +630 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +206 -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-count-type-characters-and-error-message.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters-and-threshold.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters-and-value.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-characters.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-length.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words-and-error-message.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words-and-threshold.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words-and-value.html +9 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/template-with-count-type-words.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-maxwords.html +9 -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.njk +128 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/README.md +15 -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.map +1 -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 +1344 -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/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/fixtures.json +1314 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/macro-options.json +213 -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-using-items.html +28 -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-using-items.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-month-and-year.html +28 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-message-and-hint-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-message-and-hint.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-day-input-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-day-input.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-month-input-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-month-input.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-year-input-using-items.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-error-on-year-input.html +39 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-classes.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-items-and-classes.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only-using-items.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-errors-only.html +33 -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-with-translations.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values-and-name-prefix.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values-name-prefix-and-custom-names.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template-with-values.html +36 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/template.njk +161 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/README.md +15 -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/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.bundle.js.map +1 -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.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.bundle.js.map +1 -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.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/feedback/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/fixtures.json +95 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/macro-options.json +50 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/template-default.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/template-silly-example.html +19 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/template.njk +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/README.md +15 -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.bundle.js.map +1 -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.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +416 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +179 -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-custom-wrapper-classes-and-attributes.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-multiple-files.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-with-error-message-and-hint.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html +11 -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/fixtures.json +773 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +164 -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 +59 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +233 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +167 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +63 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +54 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +97 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +97 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +105 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +117 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-no-content-licence.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-custom-meta.html +41 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-meta-links.html +80 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +104 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/fixtures.json +90 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/macro-options.json +38 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-default.html +11 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-full-width.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-with-image-logo.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template-with-text-and-image-logo.html +20 -0
- data/node_modules/govuk-frontend/dist/govuk/components/generic-header/template.njk +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +73 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +32 -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 +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +34 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +23 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/README.md +15 -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/fixtures.json +832 -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/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/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/language-navigation/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/fixtures.json +482 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/macro-options.json +88 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/macro.njk +3 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-default.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-inverse.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-language-description.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-large-amount-of-multiple-languages.html +99 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-mixed-text-directions.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-multiple-languages.html +24 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template-with-translated-navigation-label.html +12 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/template.njk +33 -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/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.map +1 -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.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/fixtures.json +415 -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 +87 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/README.md +15 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/fixtures.json +353 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/macro-options.json +108 -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-interruption-with-content-with-long-line-length.html +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption-with-headings-content-and-lists.html +23 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template-interruption.html +14 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/template.njk +56 -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.map +1 -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.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/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/fixtures.json +1339 -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.map +1 -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.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/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/fixtures.json +777 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/macro-options.json +164 -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.map +1 -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.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-with-language-navigation.html +72 -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-inline-end-slot.html +33 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-language-navigation.html +62 -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-right-aligned-language-navigation.html +62 -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 +111 -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/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.map +1 -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.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/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/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/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.map +1 -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.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/fixtures.json +149 -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-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/fixtures.json +563 -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-forced-hover-state.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-all-possible-colours.html +131 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-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/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/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/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.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/macros/attributes.njk +110 -0
- data/node_modules/govuk-frontend/dist/govuk/macros/i18n.njk +21 -0
- data/node_modules/govuk-frontend/dist/govuk/macros/logo.njk +56 -0
- data/node_modules/govuk-frontend/dist/govuk/template.njk +107 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +188 -0
- data/node_modules/govuk-frontend/package.json +99 -0
- data/node_modules/nunjucks/LICENSE +26 -0
- data/node_modules/nunjucks/README.md +58 -0
- data/node_modules/nunjucks/bin/precompile +58 -0
- data/node_modules/nunjucks/bin/precompile.cmd +5 -0
- data/node_modules/nunjucks/browser/nunjucks-slim.js +3709 -0
- data/node_modules/nunjucks/browser/nunjucks-slim.js.map +1 -0
- data/node_modules/nunjucks/browser/nunjucks-slim.min.js +3 -0
- data/node_modules/nunjucks/browser/nunjucks-slim.min.js.map +1 -0
- data/node_modules/nunjucks/browser/nunjucks.js +7021 -0
- data/node_modules/nunjucks/browser/nunjucks.js.map +1 -0
- data/node_modules/nunjucks/browser/nunjucks.min.js +3 -0
- data/node_modules/nunjucks/browser/nunjucks.min.js.map +1 -0
- data/node_modules/nunjucks/index.js +82 -0
- data/node_modules/nunjucks/package.json +112 -0
- data/node_modules/nunjucks/src/compiler.js +1027 -0
- data/node_modules/nunjucks/src/environment.js +548 -0
- data/node_modules/nunjucks/src/express-app.js +23 -0
- data/node_modules/nunjucks/src/filters.js +546 -0
- data/node_modules/nunjucks/src/globals.js +65 -0
- data/node_modules/nunjucks/src/jinja-compat.js +293 -0
- data/node_modules/nunjucks/src/lexer.js +474 -0
- data/node_modules/nunjucks/src/lib.js +325 -0
- data/node_modules/nunjucks/src/loader.js +21 -0
- data/node_modules/nunjucks/src/loaders.js +5 -0
- data/node_modules/nunjucks/src/node-loaders.js +139 -0
- data/node_modules/nunjucks/src/nodes.js +350 -0
- data/node_modules/nunjucks/src/object.js +100 -0
- data/node_modules/nunjucks/src/parser.js +1028 -0
- data/node_modules/nunjucks/src/precompile-global.js +17 -0
- data/node_modules/nunjucks/src/precompile.js +108 -0
- data/node_modules/nunjucks/src/precompiled-loader.js +31 -0
- data/node_modules/nunjucks/src/runtime.js +333 -0
- data/node_modules/nunjucks/src/tests.js +265 -0
- data/node_modules/nunjucks/src/transformer.js +166 -0
- data/node_modules/nunjucks/src/web-loaders.js +94 -0
- metadata +609 -67
- data/.github/ISSUE_TEMPLATE/bug.yaml +0 -69
- data/.github/ISSUE_TEMPLATE/config.yaml +0 -6
- data/.github/ISSUE_TEMPLATE/documentation.yaml +0 -29
- data/.github/ISSUE_TEMPLATE/enhancement.yaml +0 -25
- data/.github/dependabot.yml +0 -67
- data/.github/pull_request_template.md +0 -28
- data/.github/workflows/build-middleman-artifact.yaml +0 -41
- data/.github/workflows/check-documentation-updates.yaml +0 -33
- data/.github/workflows/check-gem-version.yaml +0 -36
- data/.github/workflows/npm-vulnerability-scanner.yaml +0 -55
- data/.github/workflows/pipeline.yaml +0 -58
- data/.github/workflows/publish-gem.yaml +0 -52
- data/.github/workflows/publish-github-pages.yaml +0 -38
- data/.github/workflows/ruby-vulnerability-scanner.yaml +0 -44
- data/.github/workflows/test.yaml +0 -48
- data/documentation/.nvmrc +0 -1
- data/documentation/Gemfile +0 -11
- data/documentation/README.md +0 -30
- data/documentation/Staticfile +0 -4
- data/documentation/config/tech-docs.yml +0 -56
- data/documentation/config.rb +0 -21
- data/documentation/source/accessibility/index.html.md.erb +0 -64
- data/documentation/source/configure_project/frontmatter/index.html.md.erb +0 -206
- data/documentation/source/configure_project/global_configuration/index.html.md.erb +0 -386
- data/documentation/source/configure_project/index.html.md.erb +0 -17
- data/documentation/source/configure_project/page_expiry_and_review/index.html.md.erb +0 -93
- data/documentation/source/configure_project/structure_docs/index.html.md.erb +0 -117
- data/documentation/source/create_project/build/index.html.md.erb +0 -20
- data/documentation/source/create_project/create_new_project/index.html.md.erb +0 -23
- data/documentation/source/create_project/get_started/index.html.md.erb +0 -58
- data/documentation/source/create_project/index.html.md.erb +0 -17
- data/documentation/source/create_project/preview/index.html.md.erb +0 -26
- data/documentation/source/images/Basic multipage.svg +0 -1
- data/documentation/source/images/Basic_multipage.svg +0 -1
- data/documentation/source/images/Nested multipage.svg +0 -1
- data/documentation/source/images/Nested_multipage.svg +0 -1
- data/documentation/source/images/Single_page.svg +0 -1
- data/documentation/source/images/core-layout-without-sidebar.png +0 -0
- data/documentation/source/images/core-layout.png +0 -0
- data/documentation/source/images/daniel-the-manual-spaniel-screenshot.svg +0 -1
- data/documentation/source/images/expired-page.png +0 -0
- data/documentation/source/images/last-reviewed-only.png +0 -0
- data/documentation/source/images/last-reviewed-only.svg +0 -1
- data/documentation/source/images/layout-layout.png +0 -0
- data/documentation/source/images/multipage.svg +0 -3
- data/documentation/source/images/not-expired-page.png +0 -0
- data/documentation/source/index.html.md.erb +0 -19
- data/documentation/source/javascripts/application.js +0 -1
- data/documentation/source/maintain_project/index.html.md.erb +0 -18
- data/documentation/source/maintain_project/redirects/index.html.md.erb +0 -22
- data/documentation/source/maintain_project/review_content/index.html.md.erb +0 -45
- data/documentation/source/maintain_project/use_latest_template/index.html.md.erb +0 -34
- data/documentation/source/partials/_links.erb +0 -81
- data/documentation/source/publish_project/deploy/index.html.md.erb +0 -44
- data/documentation/source/publish_project/index.html.md.erb +0 -15
- data/documentation/source/publish_project/version/index.html.md.erb +0 -12
- data/documentation/source/stylesheets/print.css.scss +0 -3
- data/documentation/source/stylesheets/screen-old-ie.css.scss +0 -4
- data/documentation/source/stylesheets/screen.css.scss +0 -1
- data/documentation/source/support/index.html.md.erb +0 -46
- data/documentation/source/write_docs/add_openapi_spec/index.html.md.erb +0 -48
- data/documentation/source/write_docs/content/index.html.md.erb +0 -144
- data/documentation/source/write_docs/index.html.md.erb +0 -15
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{% from "../../macros/attributes.njk" import govukAttributes %}
|
|
2
|
+
|
|
3
|
+
{%- set menuButtonText = params.menuButtonText | default("Menu", true) -%}
|
|
4
|
+
{%- set navigationId = params.navigationId | default("navigation", true) %}
|
|
5
|
+
|
|
6
|
+
{%- set endSlotHtml = params.slots.end if params.slots.end is string else params.slots.end.html %}
|
|
7
|
+
{%- set endSlotInline = params.slots.end is mapping and params.slots.end.align == 'inline' %}
|
|
8
|
+
|
|
9
|
+
{%- set commonAttributes %}
|
|
10
|
+
class="govuk-service-navigation {%- if params.classes %} {{ params.classes }}{% endif %}"
|
|
11
|
+
data-module="govuk-service-navigation"
|
|
12
|
+
{{- govukAttributes(params.attributes) }}
|
|
13
|
+
{% endset -%}
|
|
14
|
+
|
|
15
|
+
{%- set innerContent %}
|
|
16
|
+
<div class="govuk-width-container
|
|
17
|
+
{%- if endSlotInline %} govuk-service-navigation__inlining-container{% endif -%}
|
|
18
|
+
">
|
|
19
|
+
|
|
20
|
+
{# Slot: start #}
|
|
21
|
+
{%- if params.slots.start %}{{ params.slots.start | safe }}{% endif -%}
|
|
22
|
+
|
|
23
|
+
<div class="govuk-service-navigation__container">
|
|
24
|
+
{# Service name #}
|
|
25
|
+
{% if params.serviceName %}
|
|
26
|
+
<span class="govuk-service-navigation__service-name">
|
|
27
|
+
{% if params.serviceUrl %}
|
|
28
|
+
<a href="{{ params.serviceUrl }}" class="govuk-service-navigation__link">
|
|
29
|
+
{{ params.serviceName }}
|
|
30
|
+
</a>
|
|
31
|
+
{% else %}
|
|
32
|
+
<span class="govuk-service-navigation__text">
|
|
33
|
+
{{- params.serviceName -}}
|
|
34
|
+
</span>
|
|
35
|
+
{% endif %}
|
|
36
|
+
</span>
|
|
37
|
+
{% endif %}
|
|
38
|
+
|
|
39
|
+
{# Navigation #}
|
|
40
|
+
{% set navigationItems = params.navigation | default([]) | select("truthy") %}
|
|
41
|
+
{% set collapseNavigationOnMobile = params.collapseNavigationOnMobile | default(navigationItems.length > 1) %}
|
|
42
|
+
{% if navigationItems | length or params.slots.navigationStart or params.slots.navigationEnd %}
|
|
43
|
+
<nav aria-label="{{ params.navigationLabel | default(menuButtonText, true) }}" class="govuk-service-navigation__wrapper {%- if params.navigationClasses %} {{ params.navigationClasses }}{% endif %}">
|
|
44
|
+
{% if collapseNavigationOnMobile %}
|
|
45
|
+
<button type="button" class="govuk-service-navigation__toggle govuk-js-service-navigation-toggle" aria-controls="{{ navigationId }}" {%- if params.menuButtonLabel and params.menuButtonLabel != menuButtonText %} aria-label="{{ params.menuButtonLabel }}"{% endif %} hidden aria-hidden="true">
|
|
46
|
+
{{ menuButtonText }}
|
|
47
|
+
</button>
|
|
48
|
+
{% endif %}
|
|
49
|
+
|
|
50
|
+
<ul class="govuk-service-navigation__list" id="{{ navigationId }}" >
|
|
51
|
+
|
|
52
|
+
{# Slot: navigationStart #}
|
|
53
|
+
{%- if params.slots.navigationStart %}{{ params.slots.navigationStart | safe }}{% endif -%}
|
|
54
|
+
|
|
55
|
+
{% for item in navigationItems %}
|
|
56
|
+
{% set linkInnerContent %}
|
|
57
|
+
{# We wrap active links in strong tags so that users who
|
|
58
|
+
override colours or styles will still have some indicator of
|
|
59
|
+
the current nav item. #}
|
|
60
|
+
{% if item.active or item.current %}
|
|
61
|
+
<strong class="govuk-service-navigation__active-fallback">{{- item.html | safe if item.html else item.text -}}</strong>
|
|
62
|
+
{% else %}
|
|
63
|
+
{{- item.html | safe if item.html else item.text -}}
|
|
64
|
+
{% endif %}
|
|
65
|
+
{% endset %}
|
|
66
|
+
|
|
67
|
+
{#
|
|
68
|
+
If item.current, add active style and set aria-current="page"
|
|
69
|
+
Elseif item.active, add active style and set aria-current="true"
|
|
70
|
+
#}
|
|
71
|
+
<li class="govuk-service-navigation__item {%- if item.active or item.current %} govuk-service-navigation__item--active{% endif %}">
|
|
72
|
+
{% if item.href %}
|
|
73
|
+
<a class="govuk-service-navigation__link" href="{{ item.href }}"
|
|
74
|
+
{%- if item.active or item.current %} aria-current="{{ 'page' if item.current else 'true' }}"{% endif %}
|
|
75
|
+
{{- govukAttributes(item.attributes) -}}>
|
|
76
|
+
{{ linkInnerContent | safe }}
|
|
77
|
+
</a>
|
|
78
|
+
{% elif item.html or item.text %}
|
|
79
|
+
<span class="govuk-service-navigation__text"
|
|
80
|
+
{%- if item.active or item.current %} aria-current="{{ 'page' if item.current else 'true' }}"{% endif %}>
|
|
81
|
+
{{ linkInnerContent | safe }}
|
|
82
|
+
</span>
|
|
83
|
+
{% endif %}
|
|
84
|
+
</li>
|
|
85
|
+
{% endfor %}
|
|
86
|
+
|
|
87
|
+
{# Slot: navigationEnd #}
|
|
88
|
+
{%- if params.slots.navigationEnd %}{{ params.slots.navigationEnd | safe }}{% endif -%}
|
|
89
|
+
</ul>
|
|
90
|
+
</nav>
|
|
91
|
+
{% endif %}
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
{# Slot: end #}
|
|
95
|
+
{%- if endSlotHtml %}{{ endSlotHtml | safe }}{% endif -%}
|
|
96
|
+
|
|
97
|
+
</div>
|
|
98
|
+
{% endset -%}
|
|
99
|
+
|
|
100
|
+
{# If a service name is included, we use a <section> element with an
|
|
101
|
+
aria-label to create a containing landmark region. Otherwise, the <nav> in
|
|
102
|
+
the innerContent can do the job just fine by itself. #}
|
|
103
|
+
{% if params.serviceName or params.slots.start or endSlotHtml %}
|
|
104
|
+
<section aria-label="{{ params.ariaLabel | default("Service information") }}" {{ commonAttributes | safe }}>
|
|
105
|
+
{{ innerContent | safe }}
|
|
106
|
+
</section>
|
|
107
|
+
{% else %}
|
|
108
|
+
<div {{ commonAttributes | safe }}>
|
|
109
|
+
{{ innerContent | safe }}
|
|
110
|
+
</div>
|
|
111
|
+
{% endif %}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Skip link
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
|
|
6
|
+
|
|
7
|
+
## Guidance and Examples
|
|
8
|
+
|
|
9
|
+
Find out when to use the skip link component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/skip-link).
|
|
10
|
+
|
|
11
|
+
## Component options
|
|
12
|
+
|
|
13
|
+
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
|
|
14
|
+
|
|
15
|
+
See [options table](https://design-system.service.gov.uk/components/skip-link/#options-skip-link-example) for details.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"component": "skip-link",
|
|
3
|
+
"fixtures": [
|
|
4
|
+
{
|
|
5
|
+
"name": "default",
|
|
6
|
+
"options": {
|
|
7
|
+
"text": "Skip to main content",
|
|
8
|
+
"href": "#test-target-element"
|
|
9
|
+
},
|
|
10
|
+
"hidden": false,
|
|
11
|
+
"description": "",
|
|
12
|
+
"pageTemplateOptions": {},
|
|
13
|
+
"screenshot": false,
|
|
14
|
+
"html": "<a href=\"#test-target-element\" class=\"govuk-skip-link\" data-module=\"govuk-skip-link\">Skip to main content</a>"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "with focus",
|
|
18
|
+
"options": {
|
|
19
|
+
"classes": ":focus",
|
|
20
|
+
"text": "Skip to main content",
|
|
21
|
+
"href": "#test-target-element"
|
|
22
|
+
},
|
|
23
|
+
"hidden": false,
|
|
24
|
+
"description": "Simulate triggering the :focus CSS pseudo-class, not available in the production build.",
|
|
25
|
+
"pageTemplateOptions": {},
|
|
26
|
+
"screenshot": true,
|
|
27
|
+
"html": "<a href=\"#test-target-element\" class=\"govuk-skip-link :focus\" data-module=\"govuk-skip-link\">Skip to main content</a>"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "no href",
|
|
31
|
+
"options": {
|
|
32
|
+
"text": "Skip to main content"
|
|
33
|
+
},
|
|
34
|
+
"hidden": true,
|
|
35
|
+
"description": "",
|
|
36
|
+
"pageTemplateOptions": {},
|
|
37
|
+
"screenshot": false,
|
|
38
|
+
"html": "<a href=\"#content\" class=\"govuk-skip-link\" data-module=\"govuk-skip-link\">Skip to main content</a>"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "custom href",
|
|
42
|
+
"options": {
|
|
43
|
+
"text": "Skip to custom content",
|
|
44
|
+
"href": "#custom"
|
|
45
|
+
},
|
|
46
|
+
"hidden": true,
|
|
47
|
+
"description": "",
|
|
48
|
+
"pageTemplateOptions": {},
|
|
49
|
+
"screenshot": false,
|
|
50
|
+
"html": "<a href=\"#custom\" class=\"govuk-skip-link\" data-module=\"govuk-skip-link\">Skip to custom content</a>"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "custom text",
|
|
54
|
+
"options": {
|
|
55
|
+
"text": "skip"
|
|
56
|
+
},
|
|
57
|
+
"hidden": true,
|
|
58
|
+
"description": "",
|
|
59
|
+
"pageTemplateOptions": {},
|
|
60
|
+
"screenshot": false,
|
|
61
|
+
"html": "<a href=\"#content\" class=\"govuk-skip-link\" data-module=\"govuk-skip-link\">skip</a>"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "html as text",
|
|
65
|
+
"options": {
|
|
66
|
+
"text": "<p>skip</p>"
|
|
67
|
+
},
|
|
68
|
+
"hidden": true,
|
|
69
|
+
"description": "",
|
|
70
|
+
"pageTemplateOptions": {},
|
|
71
|
+
"screenshot": false,
|
|
72
|
+
"html": "<a href=\"#content\" class=\"govuk-skip-link\" data-module=\"govuk-skip-link\"><p>skip</p></a>"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "html",
|
|
76
|
+
"options": {
|
|
77
|
+
"html": "<p>skip</p>"
|
|
78
|
+
},
|
|
79
|
+
"hidden": true,
|
|
80
|
+
"description": "",
|
|
81
|
+
"pageTemplateOptions": {},
|
|
82
|
+
"screenshot": false,
|
|
83
|
+
"html": "<a href=\"#content\" class=\"govuk-skip-link\" data-module=\"govuk-skip-link\"><p>skip</p></a>"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "classes",
|
|
87
|
+
"options": {
|
|
88
|
+
"text": "Skip link",
|
|
89
|
+
"classes": "app-skip-link--custom-class"
|
|
90
|
+
},
|
|
91
|
+
"hidden": true,
|
|
92
|
+
"description": "",
|
|
93
|
+
"pageTemplateOptions": {},
|
|
94
|
+
"screenshot": false,
|
|
95
|
+
"html": "<a href=\"#content\" class=\"govuk-skip-link app-skip-link--custom-class\" data-module=\"govuk-skip-link\">Skip link</a>"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "attributes",
|
|
99
|
+
"options": {
|
|
100
|
+
"text": "Skip link",
|
|
101
|
+
"attributes": {
|
|
102
|
+
"data-test": "attribute",
|
|
103
|
+
"aria-label": "Skip to content"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"hidden": true,
|
|
107
|
+
"description": "",
|
|
108
|
+
"pageTemplateOptions": {},
|
|
109
|
+
"screenshot": false,
|
|
110
|
+
"html": "<a href=\"#content\" class=\"govuk-skip-link\" data-test=\"attribute\" aria-label=\"Skip to content\" data-module=\"govuk-skip-link\">Skip link</a>"
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "text",
|
|
4
|
+
"type": "string",
|
|
5
|
+
"required": true,
|
|
6
|
+
"description": "If `html` is set, this is not required. Text to use within the skip link component. If `html` is provided, the `text` option will be ignored."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "html",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "If `text` is set, this is not required. HTML to use within the skip link component. If `html` is provided, the `text` option will be ignored."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "href",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"required": false,
|
|
18
|
+
"description": "The value of the skip link’s `href` attribute. Defaults to `\"#content\"` if you do not provide a value."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "classes",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": false,
|
|
24
|
+
"description": "Classes to add to the skip link."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "attributes",
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": false,
|
|
30
|
+
"description": "HTML attributes (for example data attributes) to add to the skip link."
|
|
31
|
+
}
|
|
32
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-link.bundle.js","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/component.mjs","../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @template {Partial<Record<keyof ObjectType, unknown>>} ObjectType\n * @param {unknown | ObjectType} option - Option to check\n * @returns {option is ObjectType} Whether the option is an object\n */\nexport function isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Check for valid scope\n *\n * @internal\n * @template {Element | Document} ScopeType\n * @param {unknown | ScopeType} $scope - Scope of the document to search within\n * @returns {$scope is ScopeType} Whether the scope can be queried\n */\nexport function isScope($scope) {\n return !!$scope && ($scope instanceof Element || $scope instanceof Document)\n}\n\n/**\n * Format error message\n *\n * @internal\n * @param {ComponentWithModuleName} Component - Component that threw the error\n * @param {string} message - Error message\n * @returns {string} - Formatted error message\n */\nexport function formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`\n}\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\n/* eslint-enable jsdoc/valid-types */\n","import { formatErrorMessage, isObject, isScope } from '../common/index.mjs'\n\n/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @virtual\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {Element | Document | null | string} [scopeOrMessage] - HTML element `<body>` checked for browser support or support error message\n */\n constructor(scopeOrMessage = document.body) {\n let supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n if (!isScope(scopeOrMessage)) {\n supportMessage =\n 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n }\n\n super(typeof scopeOrMessage === 'string' ? scopeOrMessage : supportMessage)\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (isObject(messageOrOptions)) {\n const { component, identifier, element, expectedType } = messageOrOptions\n\n message = identifier\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n\n // Prepend with module name (optional)\n if (component) {\n message = formatErrorMessage(component, message)\n }\n }\n\n super(message)\n }\n}\n\n/**\n * Indicates that a component is already initialised\n */\nexport class InitError extends GOVUKFrontendError {\n name = 'InitError'\n\n /**\n * @internal\n * @param {ComponentWithModuleName | string} componentOrMessage - name of the component module\n */\n constructor(componentOrMessage) {\n const message =\n typeof componentOrMessage === 'string'\n ? componentOrMessage\n : formatErrorMessage(\n componentOrMessage,\n `Root element (\\`$root\\`) already initialised`\n )\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {Element | Document | null} [element] - The element in error (optional)\n * @property {ComponentWithModuleName} [component] - Component throwing the error (optional)\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {string} [expectedType] - The type that was expected for the identifier (optional)\n */\n\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n","/* eslint-disable es-x/no-global-this */\n\nimport { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\nconst _self =\n typeof globalThis !== 'undefined'\n ? globalThis // Modern browsers, Node.js\n : self // Old browsers, web workers\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class Component {\n /**\n * @type {typeof Element}\n */\n static elementType = _self.HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\n","/* eslint-disable es-x/no-global-this */\n\nimport { setFocus } from '../../common/index.mjs'\nimport { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\nconst _self =\n typeof globalThis !== 'undefined'\n ? globalThis // Modern browsers, Node.js\n : self // Old browsers, web workers\n\n/**\n * Skip link component\n *\n * @preserve\n * @augments Component<HTMLAnchorElement>\n */\nexport class SkipLink extends Component {\n static elementType = _self.HTMLAnchorElement\n\n /**\n * @param {Element | null} $root - HTML element to use for skip link\n * @throws {ElementError} when $root is not set or the wrong type\n * @throws {ElementError} when $root.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($root) {\n super($root)\n\n const hash = this.$root.hash\n const href = this.$root.getAttribute('href') ?? ''\n\n // Return early for external URLs or links to other pages\n if (\n this.$root.origin !== window.location.origin ||\n this.$root.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = hash.replace('#', '')\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n component: SkipLink,\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$root.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["setFocus","$element","options","_options$onBeforeFocu","isFocusable","getAttribute","setAttribute","onFocus","addEventListener","onBlur","once","_options$onBlur","call","removeAttribute","onBeforeFocus","focus","isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","document","body","classList","contains","isArray","option","Array","isObject","isScope","Element","Document","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","name","SupportError","scopeOrMessage","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","_self","globalThis","self","_$root","childConstructor","elementType","checkSupport","checkInitialised","SkipLink","_this$$root$getAttrib","hash","href","origin","window","location","pathname","linkedElementId","replace","$linkedElement","getElementById","add","remove","HTMLAnchorElement"],"mappings":";;;;;;EA0CO,SAASA,QAAQA,CAACC,QAAQ,EAAEC,OAAO,GAAG,EAAE,EAAE;EAAA,EAAA,IAAAC,qBAAA;EAC/C,EAAA,MAAMC,WAAW,GAAGH,QAAQ,CAACI,YAAY,CAAC,UAAU,CAAC;IAErD,IAAI,CAACD,WAAW,EAAE;EAChBH,IAAAA,QAAQ,CAACK,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC;EACzC,EAAA;IAKA,SAASC,OAAOA,GAAG;EACjBN,IAAAA,QAAQ,CAACO,gBAAgB,CAAC,MAAM,EAAEC,MAAM,EAAE;EAAEC,MAAAA,IAAI,EAAE;EAAK,KAAC,CAAC;EAC3D,EAAA;IAKA,SAASD,MAAMA,GAAG;EAAA,IAAA,IAAAE,eAAA;MAChB,CAAAA,eAAA,GAAAT,OAAO,CAACO,MAAM,KAAA,IAAA,IAAdE,eAAA,CAAgBC,IAAI,CAACX,QAAQ,CAAC;MAE9B,IAAI,CAACG,WAAW,EAAE;EAChBH,MAAAA,QAAQ,CAACY,eAAe,CAAC,UAAU,CAAC;EACtC,IAAA;EACF,EAAA;EAGAZ,EAAAA,QAAQ,CAACO,gBAAgB,CAAC,OAAO,EAAED,OAAO,EAAE;EAAEG,IAAAA,IAAI,EAAE;EAAK,GAAC,CAAC;IAG3D,CAAAP,qBAAA,GAAAD,OAAO,CAACY,aAAa,KAAA,IAAA,IAArBX,qBAAA,CAAuBS,IAAI,CAACX,QAAQ,CAAC;IACrCA,QAAQ,CAACc,KAAK,EAAE;EAClB;EAUO,SAASC,aAAaA,CAACC,KAAK,EAAEC,UAAU,EAAE;IAC/C,OACED,KAAK,Y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M,IAAIxB,YAAY,CACpB,CAAA,gCAAA,EAAmCmB,IAAI,2BACzC,CAAC;EACH,IAAA;EAEA,IAAA,MAAMO,cAAc,GAAGlD,QAAQ,CAACmD,cAAc,CAACH,eAAe,CAAC;MAG/D,IAAI,CAACE,cAAc,EAAE;QACnB,MAAM,IAAI1B,YAAY,CAAC;EACrBE,QAAAA,SAAS,EAAEc,QAAQ;EACnBZ,QAAAA,OAAO,EAAEsB,cAAc;UACvBvB,UAAU,EAAE,yBAAyBqB,eAAe,CAAA,IAAA;EACtD,OAAC,CAAC;EACJ,IAAA;MAQA,IAAI,CAACtD,KAAK,CAACT,gBAAgB,CAAC,OAAO,EAAE,MACnCR,QAAQ,CAACyE,cAAc,EAAE;EACvB3D,MAAAA,aAAaA,GAAG;EACd2D,QAAAA,cAAc,CAAChD,SAAS,CAACkD,GAAG,CAAC,iCAAiC,CAAC;QACjE,CAAC;EACDlE,MAAAA,MAAMA,GAAG;EACPgE,QAAAA,cAAc,CAAChD,SAAS,CAACmD,MAAM,CAAC,iCAAiC,CAAC;EACpE,MAAA;EACF,KAAC,CACH,CAAC;EACH,EAAA;EAMF;EAjEab,QAAQ,CACZH,WAAW,GAAGL,KAAK,CAACsB,iBAAiB;EADjCd,QAAQ,CAgEZ7C,UAAU,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-link.bundle.mjs","sources":["../../../../src/govuk/common/index.mjs","../../../../src/govuk/errors/index.mjs","../../../../src/govuk/component.mjs","../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["/**\n * Common helpers which do not require polyfill.\n *\n * IMPORTANT: If a helper require a polyfill, please isolate it in its own module\n * so that the polyfill can be properly tree-shaken and does not burden\n * the components that do not need that helper\n */\n\n/**\n * Get GOV.UK Frontend breakpoint value from CSS custom property\n *\n * @private\n * @param {string} name - Breakpoint name\n * @returns {{ property: string, value?: string }} Breakpoint object\n */\nexport function getBreakpoint(name) {\n const property = `--govuk-breakpoint-${name}`\n\n // Get value from `<html>` with breakpoints on CSS :root\n const value = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(property)\n\n return {\n property,\n value: value || undefined\n }\n}\n\n/**\n * Move focus to element\n *\n * Sets tabindex to -1 to make the element programmatically focusable,\n * but removes it on blur as the element doesn't need to be focused again.\n *\n * @private\n * @template {HTMLElement} FocusElement\n * @param {FocusElement} $element - HTML element\n * @param {object} [options] - Handler options\n * @param {function(this: FocusElement): void} [options.onBeforeFocus] - Callback before focus\n * @param {function(this: FocusElement): void} [options.onBlur] - Callback on blur\n */\nexport function setFocus($element, options = {}) {\n const isFocusable = $element.getAttribute('tabindex')\n\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1')\n }\n\n /**\n * Handle element focus\n */\n function onFocus() {\n $element.addEventListener('blur', onBlur, { once: true })\n }\n\n /**\n * Handle element blur\n */\n function onBlur() {\n options.onBlur?.call($element)\n\n if (!isFocusable) {\n $element.removeAttribute('tabindex')\n }\n }\n\n // Add listener to reset element on blur, after focus\n $element.addEventListener('focus', onFocus, { once: true })\n\n // Focus element\n options.onBeforeFocus?.call($element)\n $element.focus()\n}\n\n/**\n * Checks if component is already initialised\n *\n * @internal\n * @param {Element} $root - HTML element to be checked\n * @param {string} moduleName - name of component module\n * @returns {boolean} Whether component is already initialised\n */\nexport function isInitialised($root, moduleName) {\n return (\n $root instanceof HTMLElement &&\n $root.hasAttribute(`data-${moduleName}-init`)\n )\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nexport function isSupported($scope = document.body) {\n if (!$scope) {\n return false\n }\n\n return $scope.classList.contains('govuk-frontend-supported')\n}\n\n/**\n * Check for an array\n *\n * @internal\n * @param {unknown} option - Option to check\n * @returns {boolean} Whether the option is an array\n */\nfunction isArray(option) {\n return Array.isArray(option)\n}\n\n/**\n * Check for an object\n *\n * @internal\n * @template {Partial<Record<keyof ObjectType, unknown>>} ObjectType\n * @param {unknown | ObjectType} option - Option to check\n * @returns {option is ObjectType} Whether the option is an object\n */\nexport function isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option)\n}\n\n/**\n * Check for valid scope\n *\n * @internal\n * @template {Element | Document} ScopeType\n * @param {unknown | ScopeType} $scope - Scope of the document to search within\n * @returns {$scope is ScopeType} Whether the scope can be queried\n */\nexport function isScope($scope) {\n return !!$scope && ($scope instanceof Element || $scope instanceof Document)\n}\n\n/**\n * Format error message\n *\n * @internal\n * @param {ComponentWithModuleName} Component - Component that threw the error\n * @param {string} message - Error message\n * @returns {string} - Formatted error message\n */\nexport function formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`\n}\n\n/* eslint-disable jsdoc/valid-types --\n * `{new(...args: any[] ): object}` is not recognised as valid\n * https://github.com/gajus/eslint-plugin-jsdoc/issues/145#issuecomment-1308722878\n * https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131\n **/\n\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\n/* eslint-enable jsdoc/valid-types */\n","import { formatErrorMessage, isObject, isScope } from '../common/index.mjs'\n\n/**\n * GOV.UK Frontend error\n *\n * A base class for `Error`s thrown by GOV.UK Frontend.\n *\n * It is meant to be extended into specific types of errors\n * to be thrown by our code.\n *\n * @example\n * ```js\n * class MissingRootError extends GOVUKFrontendError {\n * // Setting an explicit name is important as extending the class will not\n * // set a new `name` on the subclass. The `name` property is important\n * // to ensure intelligible error names even if the class name gets\n * // mangled by a minifier\n * name = \"MissingRootError\"\n * }\n * ```\n * @virtual\n */\nexport class GOVUKFrontendError extends Error {\n name = 'GOVUKFrontendError'\n}\n\n/**\n * Indicates that GOV.UK Frontend is not supported\n */\nexport class SupportError extends GOVUKFrontendError {\n name = 'SupportError'\n\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {Element | Document | null | string} [scopeOrMessage] - HTML element `<body>` checked for browser support or support error message\n */\n constructor(scopeOrMessage = document.body) {\n let supportMessage =\n 'noModule' in HTMLScriptElement.prototype\n ? 'GOV.UK Frontend initialised without `<body class=\"govuk-frontend-supported\">` from template `<script>` snippet'\n : 'GOV.UK Frontend is not supported in this browser'\n\n if (!isScope(scopeOrMessage)) {\n supportMessage =\n 'GOV.UK Frontend initialised without `<script type=\"module\">`'\n }\n\n super(typeof scopeOrMessage === 'string' ? scopeOrMessage : supportMessage)\n }\n}\n\n/**\n * Indicates that a component has received an illegal configuration\n */\nexport class ConfigError extends GOVUKFrontendError {\n name = 'ConfigError'\n}\n\n/**\n * Indicates an issue with an element (possibly `null` or `undefined`)\n */\nexport class ElementError extends GOVUKFrontendError {\n name = 'ElementError'\n\n /**\n * @internal\n * @overload\n * @param {string} message - Element error message\n */\n\n /**\n * @internal\n * @overload\n * @param {ElementErrorOptions} options - Element error options\n */\n\n /**\n * @internal\n * @param {string | ElementErrorOptions} messageOrOptions - Element error message or options\n */\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : ''\n\n // Build message from options\n if (isObject(messageOrOptions)) {\n const { component, identifier, element, expectedType } = messageOrOptions\n\n message = identifier\n\n // Append reason\n message += element\n ? ` is not of type ${expectedType ?? 'HTMLElement'}`\n : ' not found'\n\n // Prepend with module name (optional)\n if (component) {\n message = formatErrorMessage(component, message)\n }\n }\n\n super(message)\n }\n}\n\n/**\n * Indicates that a component is already initialised\n */\nexport class InitError extends GOVUKFrontendError {\n name = 'InitError'\n\n /**\n * @internal\n * @param {ComponentWithModuleName | string} componentOrMessage - name of the component module\n */\n constructor(componentOrMessage) {\n const message =\n typeof componentOrMessage === 'string'\n ? componentOrMessage\n : formatErrorMessage(\n componentOrMessage,\n `Root element (\\`$root\\`) already initialised`\n )\n\n super(message)\n }\n}\n\n/**\n * Element error options\n *\n * @internal\n * @typedef {object} ElementErrorOptions\n * @property {Element | Document | null} [element] - The element in error (optional)\n * @property {ComponentWithModuleName} [component] - Component throwing the error (optional)\n * @property {string} identifier - An identifier that'll let the user understand which element has an error. This is whatever makes the most sense\n * @property {string} [expectedType] - The type that was expected for the identifier (optional)\n */\n\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n","/* eslint-disable es-x/no-global-this */\n\nimport { isInitialised, isSupported } from './common/index.mjs'\nimport { ElementError, InitError, SupportError } from './errors/index.mjs'\n\nconst _self =\n typeof globalThis !== 'undefined'\n ? globalThis // Modern browsers, Node.js\n : self // Old browsers, web workers\n\n/**\n * Base Component class\n *\n * Centralises the behaviours shared by our components\n *\n * @virtual\n * @template {Element} [RootElementType=HTMLElement]\n */\nexport class Component {\n /**\n * @type {typeof Element}\n */\n static elementType = _self.HTMLElement\n\n // allows Typescript user to work around the lack of types\n // in GOVUKFrontend package, Typescript is not aware of $root\n // in components that extend GOVUKFrontendComponent\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root\n }\n\n /**\n * @protected\n * @type {RootElementType}\n */\n _$root\n\n /**\n * Constructs a new component, validating that GOV.UK Frontend is supported\n *\n * @internal\n * @param {Element | null} [$root] - HTML element to use for component\n */\n constructor($root) {\n const childConstructor = /** @type {ChildClassConstructor} */ (\n this.constructor\n )\n\n // TypeScript does not enforce that inheriting classes will define a `moduleName`\n // (even if we add a `@virtual` `static moduleName` property to this class).\n // While we trust users to do this correctly, we do a little check to provide them\n // a helpful error message.\n //\n // After this, we'll be sure that `childConstructor` has a `moduleName`\n // as expected of the `ChildClassConstructor` we've cast `this.constructor` to.\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`)\n }\n\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n })\n } else {\n this._$root = /** @type {RootElementType} */ ($root)\n }\n\n childConstructor.checkSupport()\n\n this.checkInitialised()\n\n const moduleName = childConstructor.moduleName\n\n this.$root.setAttribute(`data-${moduleName}-init`, '')\n }\n\n /**\n * Validates whether component is already initialised\n *\n * @private\n * @throws {InitError} when component is already initialised\n */\n checkInitialised() {\n const constructor = /** @type {ChildClassConstructor} */ (this.constructor)\n const moduleName = constructor.moduleName\n\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor)\n }\n }\n\n /**\n * Validates whether components are supported\n *\n * @throws {SupportError} when the components are not supported\n */\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError()\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\n","/* eslint-disable es-x/no-global-this */\n\nimport { setFocus } from '../../common/index.mjs'\nimport { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\nconst _self =\n typeof globalThis !== 'undefined'\n ? globalThis // Modern browsers, Node.js\n : self // Old browsers, web workers\n\n/**\n * Skip link component\n *\n * @preserve\n * @augments Component<HTMLAnchorElement>\n */\nexport class SkipLink extends Component {\n static elementType = _self.HTMLAnchorElement\n\n /**\n * @param {Element | null} $root - HTML element to use for skip link\n * @throws {ElementError} when $root is not set or the wrong type\n * @throws {ElementError} when $root.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($root) {\n super($root)\n\n const hash = this.$root.hash\n const href = this.$root.getAttribute('href') ?? ''\n\n // Return early for external URLs or links to other pages\n if (\n this.$root.origin !== window.location.origin ||\n this.$root.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = hash.replace('#', '')\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n component: SkipLink,\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$root.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["setFocus","$element","options","_options$onBeforeFocu","isFocusable","getAttribute","setAttribute","onFocus","addEventListener","onBlur","once","_options$onBlur","call","removeAttribute","onBeforeFocus","focus","isInitialised","$root","moduleName","HTMLElement","hasAttribute","isSupported","$scope","document","body","classList","contains","isArray","option","Array","isObject","isScope","Element","Document","formatErrorMessage","Component","message","GOVUKFrontendError","Error","constructor","args","name","SupportError","scopeOrMessage","supportMessage","HTMLScriptElement","prototype","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","_self","globalThis","self","_$root","childConstructor","elementType","checkSupport","checkInitialised","SkipLink","_this$$root$getAttrib","hash","href","origin","window","location","pathname","linkedElementId","replace","$linkedElement","getElementById","add","remove","HTMLAnchorElement"],"mappings":"AA0CO,SAASA,QAAQA,CAACC,QAAQ,EAAEC,OAAO,GAAG,EAAE,EAAE;AAAA,EAAA,IAAAC,qBAAA;AAC/C,EAAA,MAAMC,WAAW,GAAGH,QAAQ,CAACI,YAAY,CAAC,UAAU,CAAC;EAErD,IAAI,CAACD,WAAW,EAAE;AAChBH,IAAAA,QAAQ,CAACK,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC;AACzC,EAAA;EAKA,SAASC,OAAOA,GAAG;AACjBN,IAAAA,QAAQ,CAACO,gBAAgB,CAAC,MAAM,EAAEC,MAAM,EAAE;AA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AACPgE,QAAAA,cAAc,CAAChD,SAAS,CAACmD,MAAM,CAAC,iCAAiC,CAAC;AACpE,MAAA;AACF,KAAC,CACH,CAAC;AACH,EAAA;AAMF;AAjEab,QAAQ,CACZH,WAAW,GAAGL,KAAK,CAACsB,iBAAiB;AADjCd,QAAQ,CAgEZ7C,UAAU,GAAG,iBAAiB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-link.mjs","sources":["../../../../src/govuk/components/skip-link/skip-link.mjs"],"sourcesContent":["/* eslint-disable es-x/no-global-this */\n\nimport { setFocus } from '../../common/index.mjs'\nimport { Component } from '../../component.mjs'\nimport { ElementError } from '../../errors/index.mjs'\n\nconst _self =\n typeof globalThis !== 'undefined'\n ? globalThis // Modern browsers, Node.js\n : self // Old browsers, web workers\n\n/**\n * Skip link component\n *\n * @preserve\n * @augments Component<HTMLAnchorElement>\n */\nexport class SkipLink extends Component {\n static elementType = _self.HTMLAnchorElement\n\n /**\n * @param {Element | null} $root - HTML element to use for skip link\n * @throws {ElementError} when $root is not set or the wrong type\n * @throws {ElementError} when $root.hash does not contain a hash\n * @throws {ElementError} when the linked element is missing or the wrong type\n */\n constructor($root) {\n super($root)\n\n const hash = this.$root.hash\n const href = this.$root.getAttribute('href') ?? ''\n\n // Return early for external URLs or links to other pages\n if (\n this.$root.origin !== window.location.origin ||\n this.$root.pathname !== window.location.pathname\n ) {\n return\n }\n\n const linkedElementId = hash.replace('#', '')\n\n // Check link path matching current page\n if (!linkedElementId) {\n throw new ElementError(\n `Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`\n )\n }\n\n const $linkedElement = document.getElementById(linkedElementId)\n\n // Check for link target element\n if (!$linkedElement) {\n throw new ElementError({\n component: SkipLink,\n element: $linkedElement,\n identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n })\n }\n\n /**\n * Focus the linked element on click\n *\n * Adds a helper CSS class to hide native focus styles,\n * but removes it on blur to restore native focus styles\n */\n this.$root.addEventListener('click', () =>\n setFocus($linkedElement, {\n onBeforeFocus() {\n $linkedElement.classList.add('govuk-skip-link-focused-element')\n },\n onBlur() {\n $linkedElement.classList.remove('govuk-skip-link-focused-element')\n }\n })\n )\n }\n\n /**\n * Name for the component used when initialising using data-module attributes.\n */\n static moduleName = 'govuk-skip-link'\n}\n"],"names":["_self","globalThis","self","SkipLink","Component","constructor","$root","_this$$root$getAttrib","hash","href","getAttribute","origin","window","location","pathname","linkedElementId","replace","ElementError","$linkedElement","document","getElementById","component","element","identifier","addEventListener","setFocus","onBeforeFocus","classList","add","onBlur","remove","elementType","HTMLAnchorElement","moduleName"],"mappings":";;;;AAMA,MAAMA,KAAK,GACT,OAAOC,UAAU,KAAK,WAAW,GAC7BA,UAAU,GACVC,IAAI;AAEV;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,QAAQ,SAASC,SAAS,CAAC;AAGtC;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,KAAK,EAAE;AAAA,IAAA,IAAAC,qBAAA;IACjB,KAAK,CAACD,KAAK,CAAC;AAEZ,IAAA,MAAME,IAAI,GAAG,IAAI,CAACF,KAAK,CAACE,IAAI;AAC5B,IAAA,MAAMC,IAAI,GAAA,CAAAF,qBAAA,GAAG,IAAI,CAACD,KAAK,CAACI,YAAY,CAAC,MAAM,CAAC,KAAA,IAAA,GAAAH,qBAAA,GAAI,EAAE;IAGlD,IACE,IAAI,CAACD,KAAK,CAACK,MAAM,KAAKC,MAAM,CAACC,QAAQ,CAACF,MAAM,IAC5C,IAAI,CAACL,KAAK,CAACQ,QAAQ,KAAKF,MAAM,CAACC,QAAQ,CAACC,QAAQ,EAChD;AACA,MAAA;AACF,IAAA;IAEA,MAAMC,eAAe,GAAGP,IAAI,CAACQ,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;IAG7C,IAAI,CAACD,eAAe,EAAE;AACpB,MAAA,MAAM,IAAIE,YAAY,CACpB,CAAA,gCAAA,EAAmCR,IAAI,2BACzC,CAAC;AACH,IAAA;AAEA,IAAA,MAAMS,cAAc,GAAGC,QAAQ,CAACC,cAAc,CAACL,eAAe,CAAC;IAG/D,IAAI,CAACG,cAAc,EAAE;MACnB,MAAM,IAAID,YAAY,CAAC;AACrBI,QAAAA,SAAS,EAAElB,QAAQ;AACnBmB,QAAAA,OAAO,EAAEJ,cAAc;QACvBK,UAAU,EAAE,yBAAyBR,eAAe,CAAA,IAAA;AACtD,OAAC,CAAC;AACJ,IAAA;IAQA,IAAI,CAACT,KAAK,CAACkB,gBAAgB,CAAC,OAAO,EAAE,MACnCC,QAAQ,CAACP,cAAc,EAAE;AACvBQ,MAAAA,aAAaA,GAAG;AACdR,QAAAA,cAAc,CAACS,SAAS,CAACC,GAAG,CAAC,iCAAiC,CAAC;MACjE,CAAC;AACDC,MAAAA,MAAMA,GAAG;AACPX,QAAAA,cAAc,CAACS,SAAS,CAACG,MAAM,CAAC,iCAAiC,CAAC;AACpE,MAAA;AACF,KAAC,CACH,CAAC;AACH,EAAA;AAMF;AAjEa3B,QAAQ,CACZ4B,WAAW,GAAG/B,KAAK,CAACgC,iBAAiB;AADjC7B,QAAQ,CAgEZ8B,UAAU,GAAG,iBAAiB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<a href="#test-target-element" class="govuk-skip-link" data-module="govuk-skip-link">Skip to main content</a>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<a href="#test-target-element" class="govuk-skip-link :focus" data-module="govuk-skip-link">Skip to main content</a>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{% from "../../macros/attributes.njk" import govukAttributes -%}
|
|
2
|
+
|
|
3
|
+
<a href="{{ params.href | default("#content", true) }}" class="govuk-skip-link {%- if params.classes %} {{ params.classes }}{% endif %}"
|
|
4
|
+
{{- govukAttributes(params.attributes) }} data-module="govuk-skip-link">
|
|
5
|
+
{{- params.html | safe if params.html else params.text -}}
|
|
6
|
+
</a>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Summary list
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
|
|
6
|
+
|
|
7
|
+
## Guidance and Examples
|
|
8
|
+
|
|
9
|
+
Find out when to use the summary list component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/summary-list).
|
|
10
|
+
|
|
11
|
+
## Component options
|
|
12
|
+
|
|
13
|
+
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
|
|
14
|
+
|
|
15
|
+
See [options table](https://design-system.service.gov.uk/components/summary-list/#options-summary-list-example) for details.
|