govuk_tech_docs 3.4.5 → 4.0.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/.github/workflows/publish.yaml +8 -4
- data/.github/workflows/test.yaml +11 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +22 -1
- data/example/.ruby-version +1 -1
- data/example/source/javascripts/govuk_frontend.js +1 -0
- data/govuk_tech_docs.gemspec +17 -11
- data/lib/assets/javascripts/_modules/page-expiry.js +2 -2
- data/lib/assets/javascripts/_modules/table-of-contents.js +48 -2
- data/lib/assets/javascripts/govuk_frontend_all.js +3 -0
- data/lib/assets/javascripts/govuk_tech_docs.js +0 -2
- data/lib/assets/stylesheets/_govuk_tech_docs.scss +4 -10
- data/lib/assets/stylesheets/modules/_page-review.scss +0 -2
- data/lib/assets/stylesheets/modules/_search.scss +0 -4
- data/lib/govuk_tech_docs/meta_tags.rb +1 -1
- data/lib/govuk_tech_docs/redirects.rb +1 -1
- data/lib/govuk_tech_docs/table_of_contents/heading_tree_builder.rb +1 -1
- data/lib/govuk_tech_docs/table_of_contents/helpers.rb +2 -2
- data/lib/govuk_tech_docs/tech_docs_html_renderer.rb +6 -2
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/govuk_tech_docs.rb +20 -3
- data/lib/source/layouts/_header.erb +8 -12
- data/lib/source/layouts/_page_review.erb +1 -1
- data/lib/source/layouts/_search.erb +2 -2
- data/lib/source/layouts/core.erb +8 -2
- data/lib/source/stylesheets/manifest.css +1 -1
- data/node_modules/govuk-frontend/dist/govuk/_base.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +2554 -0
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +2529 -0
- data/node_modules/govuk-frontend/dist/govuk/all.mjs +18 -0
- data/node_modules/govuk-frontend/dist/govuk/all.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-crest.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-mask.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs +7 -0
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +4 -0
- data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +159 -0
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-dataset.mjs +18 -0
- data/node_modules/govuk-frontend/dist/govuk/common/normalise-string.mjs +31 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +10 -0
- data/node_modules/govuk-frontend/{govuk/components/_all.scss → dist/govuk/components/_index.scss} +8 -3
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/accordion/_index.scss +55 -77
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +785 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +777 -0
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +349 -0
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/back-link/_index.scss +12 -36
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/breadcrumbs/_index.scss +11 -36
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/button/_index.scss +30 -103
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +318 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +310 -0
- data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +73 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/character-count/_index.scss +8 -6
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +761 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +753 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +295 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/checkboxes/_index.scss +108 -132
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +268 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +260 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs +111 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/cookie-banner/_index.scss +19 -15
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/date-input/_index.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +139 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/error-message/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/error-summary/_index.scss +19 -6
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +378 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +370 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +103 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/exit-this-page/_index.scss +5 -10
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +662 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +654 -0
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +226 -0
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/fieldset/_index.scss +20 -15
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/file-upload/_index.scss +11 -15
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/footer/_index.scss +25 -68
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/header/_index.scss +84 -79
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +252 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +244 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +88 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/hint/_hint.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/hint/_index.scss +3 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/input/_index.scss +24 -49
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/input/_input.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/inset-text/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/label/_index.scss +12 -7
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/label/_label.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/notification-banner/_index.scss +11 -7
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +320 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +312 -0
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +51 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/pagination/_index.scss +36 -55
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +58 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/panel/_panel.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +57 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +594 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +586 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +154 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/phase-banner/_index.scss +10 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/radios/_index.scss +92 -113
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +245 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +237 -0
- data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs +88 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/select/_index.scss +9 -16
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +168 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +249 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +241 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +85 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/skip-link/_index.scss +10 -5
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +244 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +236 -0
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +58 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/summary-list/_index.scss +22 -20
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/table/_index.scss +21 -17
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/table/_table.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/tabs/_index.scss +13 -9
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/tabs/_tabs.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +453 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +445 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +283 -0
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +97 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/tag/_tag.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +79 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/textarea/_index.scss +6 -10
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +4 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/components/warning-text/_index.scss +13 -13
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +10 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/core/_global-styles.scss +2 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +12 -0
- data/node_modules/govuk-frontend/{govuk/core/_all.scss → dist/govuk/core/_index.scss} +3 -1
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/core/_links.scss +8 -1
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/core/_lists.scss +2 -1
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/core/_section-break.scss +2 -7
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/core/_typography.scss +8 -5
- data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +57 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs +60 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +10 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/helpers/_clearfix.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +127 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/helpers/_device-pixels.scss +4 -3
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/helpers/_focused.scss +22 -6
- data/node_modules/govuk-frontend/dist/govuk/helpers/_font-faces.scss +41 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/helpers/_grid.scss +3 -1
- data/node_modules/govuk-frontend/{govuk/helpers/_all.scss → dist/govuk/helpers/_index.scss} +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/helpers/_links.scss +38 -76
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/helpers/_media-queries.scss +3 -12
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/helpers/_shape-arrow.scss +3 -1
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/helpers/_spacing.scss +12 -10
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +288 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/helpers/_visually-hidden.scss +39 -50
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +195 -0
- data/node_modules/govuk-frontend/dist/govuk/index.scss +11 -0
- data/node_modules/govuk-frontend/dist/govuk/init.mjs +162 -0
- data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +10 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/objects/_button-group.scss +7 -12
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/objects/_form-group.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/objects/_grid.scss +4 -2
- data/node_modules/govuk-frontend/{govuk/objects/_all.scss → dist/govuk/objects/_index.scss} +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/objects/_main-wrapper.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/objects/_template.scss +2 -1
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/objects/_width-container.scss +2 -9
- data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +9 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/overrides/_display.scss +2 -0
- data/node_modules/govuk-frontend/{govuk/overrides/_all.scss → dist/govuk/overrides/_index.scss} +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/overrides/_spacing.scss +3 -19
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/overrides/_text-align.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +42 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/overrides/_width.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +10 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/settings/_assets.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/settings/_colours-applied.scss +9 -7
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +378 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +37 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/settings/_global-styles.scss +2 -0
- data/node_modules/govuk-frontend/{govuk/settings/_all.scss → dist/govuk/settings/_index.scss} +2 -3
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/settings/_links.scss +3 -20
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/settings/_measurements.scss +18 -6
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/settings/_media-queries.scss +5 -3
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/settings/_spacing.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss +52 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +322 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/settings/_warnings.scss +33 -8
- data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +10 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/tools/_exports.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/tools/_font-url.scss +3 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/tools/_image-url.scss +3 -0
- data/node_modules/govuk-frontend/{govuk/tools/_all.scss → dist/govuk/tools/_index.scss} +2 -2
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/tools/_px-to-em.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/tools/_px-to-rem.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +10 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/utilities/_clearfix.scss +2 -0
- data/node_modules/govuk-frontend/{govuk/utilities/_all.scss → dist/govuk/utilities/_index.scss} +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/utilities/_visually-hidden.scss +2 -0
- data/node_modules/govuk-frontend/{govuk → dist/govuk}/vendor/_sass-mq.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.js +15 -0
- data/node_modules/govuk-frontend/{govuk-prototype-kit → dist/govuk-prototype-kit}/init.scss +3 -2
- data/package-lock.json +37 -37
- data/package.json +6 -1
- metadata +316 -206
- data/node_modules/govuk-frontend/govuk/_base.scss +0 -3
- data/node_modules/govuk-frontend/govuk/all-ie8.scss +0 -14
- data/node_modules/govuk-frontend/govuk/all.js +0 -5172
- data/node_modules/govuk-frontend/govuk/all.scss +0 -9
- data/node_modules/govuk-frontend/govuk/assets/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-180x180.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-crest-2x.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-crest.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-logotype-crown.png +0 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-mask-icon.svg +0 -7
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js +0 -75
- data/node_modules/govuk-frontend/govuk/common/govuk-frontend-version.js +0 -17
- data/node_modules/govuk-frontend/govuk/common/index.js +0 -192
- data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js +0 -386
- data/node_modules/govuk-frontend/govuk/common.js +0 -194
- data/node_modules/govuk-frontend/govuk/components/accordion/_accordion.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +0 -2386
- data/node_modules/govuk-frontend/govuk/components/back-link/_back-link.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/button/_button.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/button/button.js +0 -1027
- data/node_modules/govuk-frontend/govuk/components/character-count/_character-count.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +0 -2281
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +0 -1277
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/date-input/_date-input.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/details/_details.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +0 -88
- data/node_modules/govuk-frontend/govuk/components/details/details.js +0 -873
- data/node_modules/govuk-frontend/govuk/components/error-message/_error-message.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/error-summary/_error-summary.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +0 -1189
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/_exit-this-page.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/exit-this-page.js +0 -2120
- data/node_modules/govuk-frontend/govuk/components/fieldset/_fieldset.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/footer/_footer.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/header/_header.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/header/header.js +0 -794
- data/node_modules/govuk-frontend/govuk/components/inset-text/_inset-text.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +0 -843
- data/node_modules/govuk-frontend/govuk/components/pagination/_pagination.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +0 -56
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/radios/_radios.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/radios/radios.js +0 -1222
- data/node_modules/govuk-frontend/govuk/components/select/_select.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/skip-link/_skip-link.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +0 -1145
- data/node_modules/govuk-frontend/govuk/components/summary-list/_summary-list.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +0 -1621
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -81
- data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/warning-text/_warning-text.scss +0 -2
- data/node_modules/govuk-frontend/govuk/core/_govuk-frontend-version.scss +0 -5
- data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +0 -98
- data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +0 -41
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +0 -214
- data/node_modules/govuk-frontend/govuk/i18n.js +0 -397
- data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +0 -21
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +0 -146
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +0 -120
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +0 -100
- data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +0 -34
- data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +0 -32
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +0 -112
- data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +0 -195
- data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +0 -50
- data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +0 -87
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js +0 -274
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js +0 -23
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js +0 -36
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js +0 -597
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js +0 -58
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js +0 -307
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js +0 -33
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +0 -261
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +0 -261
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js +0 -151
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js +0 -512
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js +0 -256
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js +0 -96
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js +0 -23
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js +0 -30
- data/node_modules/govuk-frontend/govuk-prototype-kit/init.js +0 -8
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/fonts/bold-affa96571d-v2.woff +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
- /data/node_modules/govuk-frontend/{govuk → dist/govuk}/assets/fonts/light-f591b13f7d-v2.woff +0 -0
- /data/{lib/source → node_modules/govuk-frontend/dist/govuk/assets/images}/favicon.ico +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@include govuk-exports("govuk/core/typography") {
|
|
2
|
-
|
|
3
2
|
// Headings
|
|
4
3
|
|
|
5
4
|
%govuk-heading-xl {
|
|
@@ -129,14 +128,16 @@
|
|
|
129
128
|
@extend %govuk-body-s;
|
|
130
129
|
}
|
|
131
130
|
|
|
131
|
+
// @deprecated
|
|
132
132
|
%govuk-body-xs {
|
|
133
133
|
@include govuk-text-colour;
|
|
134
|
-
@include govuk-font($size:
|
|
134
|
+
@include govuk-font($size: _14);
|
|
135
135
|
|
|
136
136
|
margin-top: 0;
|
|
137
137
|
@include govuk-responsive-margin(4, "bottom");
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
// @deprecated
|
|
140
141
|
.govuk-body-xs {
|
|
141
142
|
@extend %govuk-body-xs;
|
|
142
143
|
}
|
|
@@ -157,7 +158,7 @@
|
|
|
157
158
|
// Contextual adjustments
|
|
158
159
|
// Add top padding to headings that appear directly after paragraphs.
|
|
159
160
|
|
|
160
|
-
%govuk-body-l
|
|
161
|
+
%govuk-body-l + %govuk-heading-l {
|
|
161
162
|
padding-top: govuk-spacing(1);
|
|
162
163
|
|
|
163
164
|
@include govuk-media-query($from: tablet) {
|
|
@@ -165,8 +166,8 @@
|
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
%govuk-body-m
|
|
169
|
-
%govuk-body-s
|
|
169
|
+
%govuk-body-m + %govuk-heading-l,
|
|
170
|
+
%govuk-body-s + %govuk-heading-l,
|
|
170
171
|
%govuk-list + %govuk-heading-l {
|
|
171
172
|
@include govuk-responsive-padding(4, "top");
|
|
172
173
|
}
|
|
@@ -184,3 +185,5 @@
|
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
}
|
|
188
|
+
|
|
189
|
+
/*# sourceMappingURL=_typography.scss.map */
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { formatErrorMessage } from '../common/index.mjs';
|
|
2
|
+
|
|
3
|
+
class GOVUKFrontendError extends Error {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
this.name = 'GOVUKFrontendError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
class SupportError extends GOVUKFrontendError {
|
|
10
|
+
/**
|
|
11
|
+
* Checks if GOV.UK Frontend is supported on this page
|
|
12
|
+
*
|
|
13
|
+
* @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support
|
|
14
|
+
*/
|
|
15
|
+
constructor($scope = document.body) {
|
|
16
|
+
const supportMessage = 'noModule' in HTMLScriptElement.prototype ? 'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet' : 'GOV.UK Frontend is not supported in this browser';
|
|
17
|
+
super($scope ? supportMessage : 'GOV.UK Frontend initialised without `<script type="module">`');
|
|
18
|
+
this.name = 'SupportError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
class ConfigError extends GOVUKFrontendError {
|
|
22
|
+
constructor(...args) {
|
|
23
|
+
super(...args);
|
|
24
|
+
this.name = 'ConfigError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
class ElementError extends GOVUKFrontendError {
|
|
28
|
+
constructor(messageOrOptions) {
|
|
29
|
+
let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';
|
|
30
|
+
if (typeof messageOrOptions === 'object') {
|
|
31
|
+
const {
|
|
32
|
+
component,
|
|
33
|
+
identifier,
|
|
34
|
+
element,
|
|
35
|
+
expectedType
|
|
36
|
+
} = messageOrOptions;
|
|
37
|
+
message = identifier;
|
|
38
|
+
message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';
|
|
39
|
+
message = formatErrorMessage(component, message);
|
|
40
|
+
}
|
|
41
|
+
super(message);
|
|
42
|
+
this.name = 'ElementError';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
class InitError extends GOVUKFrontendError {
|
|
46
|
+
constructor(componentOrMessage) {
|
|
47
|
+
const message = typeof componentOrMessage === 'string' ? componentOrMessage : formatErrorMessage(componentOrMessage, `Root element (\`$root\`) already initialised`);
|
|
48
|
+
super(message);
|
|
49
|
+
this.name = 'InitError';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @typedef {import('../common/index.mjs').ComponentWithModuleName} ComponentWithModuleName
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
export { ConfigError, ElementError, GOVUKFrontendError, InitError, SupportError };
|
|
57
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { isInitialised, isSupported } from './common/index.mjs';
|
|
2
|
+
import { InitError, ElementError, SupportError } from './errors/index.mjs';
|
|
3
|
+
|
|
4
|
+
class GOVUKFrontendComponent {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the root element of the component
|
|
7
|
+
*
|
|
8
|
+
* @protected
|
|
9
|
+
* @returns {RootElementType} - the root element of component
|
|
10
|
+
*/
|
|
11
|
+
get $root() {
|
|
12
|
+
return this._$root;
|
|
13
|
+
}
|
|
14
|
+
constructor($root) {
|
|
15
|
+
this._$root = void 0;
|
|
16
|
+
const childConstructor = this.constructor;
|
|
17
|
+
if (typeof childConstructor.moduleName !== 'string') {
|
|
18
|
+
throw new InitError(`\`moduleName\` not defined in component`);
|
|
19
|
+
}
|
|
20
|
+
if (!($root instanceof childConstructor.elementType)) {
|
|
21
|
+
throw new ElementError({
|
|
22
|
+
element: $root,
|
|
23
|
+
component: childConstructor,
|
|
24
|
+
identifier: 'Root element (`$root`)',
|
|
25
|
+
expectedType: childConstructor.elementType.name
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
this._$root = $root;
|
|
29
|
+
}
|
|
30
|
+
childConstructor.checkSupport();
|
|
31
|
+
this.checkInitialised();
|
|
32
|
+
const moduleName = childConstructor.moduleName;
|
|
33
|
+
this.$root.setAttribute(`data-${moduleName}-init`, '');
|
|
34
|
+
}
|
|
35
|
+
checkInitialised() {
|
|
36
|
+
const constructor = this.constructor;
|
|
37
|
+
const moduleName = constructor.moduleName;
|
|
38
|
+
if (moduleName && isInitialised(this.$root, moduleName)) {
|
|
39
|
+
throw new InitError(constructor);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static checkSupport() {
|
|
43
|
+
if (!isSupported()) {
|
|
44
|
+
throw new SupportError();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @typedef ChildClass
|
|
51
|
+
* @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @typedef {typeof GOVUKFrontendComponent & ChildClass} ChildClassConstructor
|
|
56
|
+
*/
|
|
57
|
+
GOVUKFrontendComponent.elementType = HTMLElement;
|
|
58
|
+
|
|
59
|
+
export { GOVUKFrontendComponent };
|
|
60
|
+
//# sourceMappingURL=govuk-frontend-component.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const version="5.7.1";function normaliseString(t,e){const s=t?t.trim():"";let n,i=null==e?void 0:e.type;switch(i||(["true","false"].includes(s)&&(i="boolean"),s.length>0&&isFinite(Number(s))&&(i="number")),i){case"boolean":n="true"===s;break;case"number":n=Number(s);break;default:n=t}return n}function mergeConfigs(...t){const e={};for(const s of t)for(const t of Object.keys(s)){const n=e[t],i=s[t];isObject(n)&&isObject(i)?e[t]=mergeConfigs(n,i):e[t]=i}return e}function extractConfigByNamespace(Component,t,e){const s=Component.schema.properties[e];if("object"!==(null==s?void 0:s.type))return;const n={[e]:{}};for(const[i,o]of Object.entries(t)){let t=n;const s=i.split(".");for(const[n,r]of s.entries())"object"==typeof t&&(n<s.length-1?(isObject(t[r])||(t[r]={}),t=t[r]):i!==e&&(t[r]=normaliseString(o)))}return n[e]}function getFragmentFromUrl(t){if(t.includes("#"))return t.split("#").pop()}function getBreakpoint(t){const e=`--govuk-frontend-breakpoint-${t}`;return{property:e,value:window.getComputedStyle(document.documentElement).getPropertyValue(e)||void 0}}function setFocus(t,e={}){var s;const n=t.getAttribute("tabindex");function onBlur(){var s;null==(s=e.onBlur)||s.call(t),n||t.removeAttribute("tabindex")}n||t.setAttribute("tabindex","-1"),t.addEventListener("focus",(function(){t.addEventListener("blur",onBlur,{once:!0})}),{once:!0}),null==(s=e.onBeforeFocus)||s.call(t),t.focus()}function isSupported(t=document.body){return!!t&&t.classList.contains("govuk-frontend-supported")}function isObject(t){return!!t&&"object"==typeof t&&!function(t){return Array.isArray(t)}(t)}function formatErrorMessage(Component,t){return`${Component.moduleName}: ${t}`}function normaliseDataset(Component,t){const e={};for(const[s,n]of Object.entries(Component.schema.properties))s in t&&(e[s]=normaliseString(t[s],n)),"object"===(null==n?void 0:n.type)&&(e[s]=extractConfigByNamespace(Component,t,s));return e}class GOVUKFrontendError extends Error{constructor(...t){super(...t),this.name="GOVUKFrontendError"}}class SupportError extends GOVUKFrontendError{constructor(t=document.body){const e="noModule"in HTMLScriptElement.prototype?'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet':"GOV.UK Frontend is not supported in this browser";super(t?e:'GOV.UK Frontend initialised without `<script type="module">`'),this.name="SupportError"}}class ConfigError extends GOVUKFrontendError{constructor(...t){super(...t),this.name="ConfigError"}}class ElementError extends GOVUKFrontendError{constructor(t){let e="string"==typeof t?t:"";if("object"==typeof t){const{component:s,identifier:n,element:i,expectedType:o}=t;e=n,e+=i?` is not of type ${null!=o?o:"HTMLElement"}`:" not found",e=formatErrorMessage(s,e)}super(e),this.name="ElementError"}}class InitError extends GOVUKFrontendError{constructor(t){super("string"==typeof t?t:formatErrorMessage(t,"Root element (`$root`) already initialised")),this.name="InitError"}}class GOVUKFrontendComponent{get $root(){return this._$root}constructor(t){this._$root=void 0;const e=this.constructor;if("string"!=typeof e.moduleName)throw new InitError("`moduleName` not defined in component");if(!(t instanceof e.elementType))throw new ElementError({element:t,component:e,identifier:"Root element (`$root`)",expectedType:e.elementType.name});this._$root=t,e.checkSupport(),this.checkInitialised();const s=e.moduleName;this.$root.setAttribute(`data-${s}-init`,"")}checkInitialised(){const t=this.constructor,e=t.moduleName;if(e&&function(t,e){return t instanceof HTMLElement&&t.hasAttribute(`data-${e}-init`)}(this.$root,e))throw new InitError(t)}static checkSupport(){if(!isSupported())throw new SupportError}}GOVUKFrontendComponent.elementType=HTMLElement;class I18n{constructor(t={},e={}){var s;this.translations=void 0,this.locale=void 0,this.translations=t,this.locale=null!=(s=e.locale)?s:document.documentElement.lang||"en"}t(t,e){if(!t)throw new Error("i18n: lookup key missing");let s=this.translations[t];if("number"==typeof(null==e?void 0:e.count)&&"object"==typeof s){const n=s[this.getPluralSuffix(t,e.count)];n&&(s=n)}if("string"==typeof s){if(s.match(/%{(.\S+)}/)){if(!e)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(s,e)}return s}return t}replacePlaceholders(t,e){const s=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return t.replace(/%{(.\S+)}/g,(function(t,n){if(Object.prototype.hasOwnProperty.call(e,n)){const t=e[n];return!1===t||"number"!=typeof t&&"string"!=typeof t?"":"number"==typeof t?s?s.format(t):`${t}`:t}throw new Error(`i18n: no data found to replace ${t} placeholder in string`)}))}hasIntlPluralRulesSupport(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)}getPluralSuffix(t,e){if(e=Number(e),!isFinite(e))return"other";const s=this.translations[t],n=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(e):this.selectPluralFormUsingFallbackRules(e);if("object"==typeof s){if(n in s)return n;if("other"in s)return console.warn(`i18n: Missing plural form ".${n}" for "${this.locale}" locale. Falling back to ".other".`),"other"}throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`)}selectPluralFormUsingFallbackRules(t){t=Math.abs(Math.floor(t));const e=this.getPluralRulesForLocale();return e?I18n.pluralRules[e](t):"other"}getPluralRulesForLocale(){const t=this.locale.split("-")[0];for(const e in I18n.pluralRulesMap){const s=I18n.pluralRulesMap[e];if(s.includes(this.locale)||s.includes(t))return e}}}I18n.pluralRulesMap={arabic:["ar"],chinese:["my","zh","id","ja","jv","ko","ms","th","vi"],french:["hy","bn","fr","gu","hi","fa","pa","zu"],german:["af","sq","az","eu","bg","ca","da","nl","en","et","fi","ka","de","el","hu","lb","no","so","sw","sv","ta","te","tr","ur"],irish:["ga"],russian:["ru","uk"],scottish:["gd"],spanish:["pt-PT","it","es"],welsh:["cy"]},I18n.pluralRules={arabic:t=>0===t?"zero":1===t?"one":2===t?"two":t%100>=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other",chinese:()=>"other",french:t=>0===t||1===t?"one":"other",german:t=>1===t?"one":"other",irish:t=>1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other",russian(t){const e=t%100,s=e%10;return 1===s&&11!==e?"one":s>=2&&s<=4&&!(e>=12&&e<=14)?"few":0===s||s>=5&&s<=9||e>=11&&e<=14?"many":"other"},scottish:t=>1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other",spanish:t=>1===t?"one":t%1e6==0&&0!==t?"many":"other",welsh:t=>0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"};class Accordion extends GOVUKFrontendComponent{constructor(t,e={}){super(t),this.config=void 0,this.i18n=void 0,this.controlsClass="govuk-accordion__controls",this.showAllClass="govuk-accordion__show-all",this.showAllTextClass="govuk-accordion__show-all-text",this.sectionClass="govuk-accordion__section",this.sectionExpandedClass="govuk-accordion__section--expanded",this.sectionButtonClass="govuk-accordion__section-button",this.sectionHeaderClass="govuk-accordion__section-header",this.sectionHeadingClass="govuk-accordion__section-heading",this.sectionHeadingDividerClass="govuk-accordion__section-heading-divider",this.sectionHeadingTextClass="govuk-accordion__section-heading-text",this.sectionHeadingTextFocusClass="govuk-accordion__section-heading-text-focus",this.sectionShowHideToggleClass="govuk-accordion__section-toggle",this.sectionShowHideToggleFocusClass="govuk-accordion__section-toggle-focus",this.sectionShowHideTextClass="govuk-accordion__section-toggle-text",this.upChevronIconClass="govuk-accordion-nav__chevron",this.downChevronIconClass="govuk-accordion-nav__chevron--down",this.sectionSummaryClass="govuk-accordion__section-summary",this.sectionSummaryFocusClass="govuk-accordion__section-summary-focus",this.sectionContentClass="govuk-accordion__section-content",this.$sections=void 0,this.$showAllButton=null,this.$showAllIcon=null,this.$showAllText=null,this.config=mergeConfigs(Accordion.defaults,e,normaliseDataset(Accordion,this.$root.dataset)),this.i18n=new I18n(this.config.i18n);const s=this.$root.querySelectorAll(`.${this.sectionClass}`);if(!s.length)throw new ElementError({component:Accordion,identifier:`Sections (\`<div class="${this.sectionClass}">\`)`});this.$sections=s,this.initControls(),this.initSectionHeaders(),this.updateShowAllButton(this.areAllSectionsOpen())}initControls(){this.$showAllButton=document.createElement("button"),this.$showAllButton.setAttribute("type","button"),this.$showAllButton.setAttribute("class",this.showAllClass),this.$showAllButton.setAttribute("aria-expanded","false"),this.$showAllIcon=document.createElement("span"),this.$showAllIcon.classList.add(this.upChevronIconClass),this.$showAllButton.appendChild(this.$showAllIcon);const t=document.createElement("div");t.setAttribute("class",this.controlsClass),t.appendChild(this.$showAllButton),this.$root.insertBefore(t,this.$root.firstChild),this.$showAllText=document.createElement("span"),this.$showAllText.classList.add(this.showAllTextClass),this.$showAllButton.appendChild(this.$showAllText),this.$showAllButton.addEventListener("click",(()=>this.onShowOrHideAllToggle())),"onbeforematch"in document&&document.addEventListener("beforematch",(t=>this.onBeforeMatch(t)))}initSectionHeaders(){this.$sections.forEach(((t,e)=>{const s=t.querySelector(`.${this.sectionHeaderClass}`);if(!s)throw new ElementError({component:Accordion,identifier:`Section headers (\`<div class="${this.sectionHeaderClass}">\`)`});this.constructHeaderMarkup(s,e),this.setExpanded(this.isExpanded(t),t),s.addEventListener("click",(()=>this.onSectionToggle(t))),this.setInitialState(t)}))}constructHeaderMarkup(t,e){const s=t.querySelector(`.${this.sectionButtonClass}`),n=t.querySelector(`.${this.sectionHeadingClass}`),i=t.querySelector(`.${this.sectionSummaryClass}`);if(!n)throw new ElementError({component:Accordion,identifier:`Section heading (\`.${this.sectionHeadingClass}\`)`});if(!s)throw new ElementError({component:Accordion,identifier:`Section button placeholder (\`<span class="${this.sectionButtonClass}">\`)`});const o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("aria-controls",`${this.$root.id}-content-${e+1}`);for(const d of Array.from(s.attributes))"id"!==d.name&&o.setAttribute(d.name,d.value);const r=document.createElement("span");r.classList.add(this.sectionHeadingTextClass),r.id=s.id;const a=document.createElement("span");a.classList.add(this.sectionHeadingTextFocusClass),r.appendChild(a),Array.from(s.childNodes).forEach((t=>a.appendChild(t)));const c=document.createElement("span");c.classList.add(this.sectionShowHideToggleClass),c.setAttribute("data-nosnippet","");const l=document.createElement("span");l.classList.add(this.sectionShowHideToggleFocusClass),c.appendChild(l);const h=document.createElement("span"),u=document.createElement("span");if(u.classList.add(this.upChevronIconClass),l.appendChild(u),h.classList.add(this.sectionShowHideTextClass),l.appendChild(h),o.appendChild(r),o.appendChild(this.getButtonPunctuationEl()),i){const t=document.createElement("span"),e=document.createElement("span");e.classList.add(this.sectionSummaryFocusClass),t.appendChild(e);for(const s of Array.from(i.attributes))t.setAttribute(s.name,s.value);Array.from(i.childNodes).forEach((t=>e.appendChild(t))),i.remove(),o.appendChild(t),o.appendChild(this.getButtonPunctuationEl())}o.appendChild(c),n.removeChild(s),n.appendChild(o)}onBeforeMatch(t){const e=t.target;if(!(e instanceof Element))return;const s=e.closest(`.${this.sectionClass}`);s&&this.setExpanded(!0,s)}onSectionToggle(t){const e=!this.isExpanded(t);this.setExpanded(e,t),this.storeState(t,e)}onShowOrHideAllToggle(){const t=!this.areAllSectionsOpen();this.$sections.forEach((e=>{this.setExpanded(t,e),this.storeState(e,t)})),this.updateShowAllButton(t)}setExpanded(t,e){const s=e.querySelector(`.${this.upChevronIconClass}`),n=e.querySelector(`.${this.sectionShowHideTextClass}`),i=e.querySelector(`.${this.sectionButtonClass}`),o=e.querySelector(`.${this.sectionContentClass}`);if(!o)throw new ElementError({component:Accordion,identifier:`Section content (\`<div class="${this.sectionContentClass}">\`)`});if(!s||!n||!i)return;const r=t?this.i18n.t("hideSection"):this.i18n.t("showSection");n.textContent=r,i.setAttribute("aria-expanded",`${t}`);const a=[],c=e.querySelector(`.${this.sectionHeadingTextClass}`);c&&a.push(`${c.textContent}`.trim());const l=e.querySelector(`.${this.sectionSummaryClass}`);l&&a.push(`${l.textContent}`.trim());const h=t?this.i18n.t("hideSectionAriaLabel"):this.i18n.t("showSectionAriaLabel");a.push(h),i.setAttribute("aria-label",a.join(" , ")),t?(o.removeAttribute("hidden"),e.classList.add(this.sectionExpandedClass),s.classList.remove(this.downChevronIconClass)):(o.setAttribute("hidden","until-found"),e.classList.remove(this.sectionExpandedClass),s.classList.add(this.downChevronIconClass)),this.updateShowAllButton(this.areAllSectionsOpen())}isExpanded(t){return t.classList.contains(this.sectionExpandedClass)}areAllSectionsOpen(){return Array.from(this.$sections).every((t=>this.isExpanded(t)))}updateShowAllButton(t){this.$showAllButton&&this.$showAllText&&this.$showAllIcon&&(this.$showAllButton.setAttribute("aria-expanded",t.toString()),this.$showAllText.textContent=t?this.i18n.t("hideAllSections"):this.i18n.t("showAllSections"),this.$showAllIcon.classList.toggle(this.downChevronIconClass,!t))}getIdentifier(t){const e=t.querySelector(`.${this.sectionButtonClass}`);return null==e?void 0:e.getAttribute("aria-controls")}storeState(t,e){if(!this.config.rememberExpanded)return;const s=this.getIdentifier(t);if(s)try{window.sessionStorage.setItem(s,e.toString())}catch(n){}}setInitialState(t){if(!this.config.rememberExpanded)return;const e=this.getIdentifier(t);if(e)try{const s=window.sessionStorage.getItem(e);null!==s&&this.setExpanded("true"===s,t)}catch(s){}}getButtonPunctuationEl(){const t=document.createElement("span");return t.classList.add("govuk-visually-hidden",this.sectionHeadingDividerClass),t.textContent=", ",t}}Accordion.moduleName="govuk-accordion",Accordion.defaults=Object.freeze({i18n:{hideAllSections:"Hide all sections",hideSection:"Hide",hideSectionAriaLabel:"Hide this section",showAllSections:"Show all sections",showSection:"Show",showSectionAriaLabel:"Show this section"},rememberExpanded:!0}),Accordion.schema=Object.freeze({properties:{i18n:{type:"object"},rememberExpanded:{type:"boolean"}}});class Button extends GOVUKFrontendComponent{constructor(t,e={}){super(t),this.config=void 0,this.debounceFormSubmitTimer=null,this.config=mergeConfigs(Button.defaults,e,normaliseDataset(Button,this.$root.dataset)),this.$root.addEventListener("keydown",(t=>this.handleKeyDown(t))),this.$root.addEventListener("click",(t=>this.debounce(t)))}handleKeyDown(t){const e=t.target;" "===t.key&&e instanceof HTMLElement&&"button"===e.getAttribute("role")&&(t.preventDefault(),e.click())}debounce(t){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(t.preventDefault(),!1):void(this.debounceFormSubmitTimer=window.setTimeout((()=>{this.debounceFormSubmitTimer=null}),1e3))}}function closestAttributeValue(t,e){const s=t.closest(`[${e}]`);return s?s.getAttribute(e):null}Button.moduleName="govuk-button",Button.defaults=Object.freeze({preventDoubleClick:!1}),Button.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class CharacterCount extends GOVUKFrontendComponent{constructor(t,e={}){var s,n;super(t),this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.config=void 0,this.i18n=void 0,this.maxLength=void 0;const i=this.$root.querySelector(".govuk-js-character-count");if(!(i instanceof HTMLTextAreaElement||i instanceof HTMLInputElement))throw new ElementError({component:CharacterCount,element:i,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const o=normaliseDataset(CharacterCount,this.$root.dataset);let r={};("maxwords"in o||"maxlength"in o)&&(r={maxlength:void 0,maxwords:void 0}),this.config=mergeConfigs(CharacterCount.defaults,e,r,o);const a=function(t,e){const s=[];for(const[n,i]of Object.entries(t)){const t=[];if(Array.isArray(i)){for(const{required:s,errorMessage:n}of i)s.every((t=>!!e[t]))||t.push(n);"anyOf"!==n||i.length-t.length>=1||s.push(...t)}}return s}(CharacterCount.schema,this.config);if(a[0])throw new ConfigError(formatErrorMessage(CharacterCount,a[0]));this.i18n=new I18n(this.config.i18n,{locale:closestAttributeValue(this.$root,"lang")}),this.maxLength=null!=(s=null!=(n=this.config.maxwords)?n:this.config.maxlength)?s:1/0,this.$textarea=i;const c=`${this.$textarea.id}-info`,l=document.getElementById(c);if(!l)throw new ElementError({component:CharacterCount,element:l,identifier:`Count message (\`id="${c}"\`)`});`${l.textContent}`.match(/^\s*$/)&&(l.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",l);const h=document.createElement("div");h.className="govuk-character-count__sr-status govuk-visually-hidden",h.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=h,l.insertAdjacentElement("afterend",h);const u=document.createElement("div");u.className=l.className,u.classList.add("govuk-character-count__status"),u.setAttribute("aria-hidden","true"),this.$visibleCountMessage=u,l.insertAdjacentElement("afterend",u),l.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",(()=>this.updateCountMessage())),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",(()=>this.handleKeyUp())),this.$textarea.addEventListener("focus",(()=>this.handleFocus())),this.$textarea.addEventListener("blur",(()=>this.handleBlur()))}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval((()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}),1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const t=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$textarea.classList.toggle("govuk-textarea--error",t),this.$visibleCountMessage.classList.toggle("govuk-error-message",t),this.$visibleCountMessage.classList.toggle("govuk-hint",!t),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(t){if(this.config.maxwords){var e;return(null!=(e=t.match(/\S+/g))?e:[]).length}return t.length}getCountMessage(){const t=this.maxLength-this.count(this.$textarea.value),e=this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)}formatCountMessage(t,e){if(0===t)return this.i18n.t(`${e}AtLimit`);const s=t<0?"OverLimit":"UnderLimit";return this.i18n.t(`${e}${s}`,{count:Math.abs(t)})}isOverThreshold(){if(!this.config.threshold)return!0;const t=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=t}}CharacterCount.moduleName="govuk-character-count",CharacterCount.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),CharacterCount.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});class Checkboxes extends GOVUKFrontendComponent{constructor(t){super(t),this.$inputs=void 0;const e=this.$root.querySelectorAll('input[type="checkbox"]');if(!e.length)throw new ElementError({component:Checkboxes,identifier:'Form inputs (`<input type="checkbox">`)'});this.$inputs=e,this.$inputs.forEach((t=>{const e=t.getAttribute("data-aria-controls");if(e){if(!document.getElementById(e))throw new ElementError({component:Checkboxes,identifier:`Conditional reveal (\`id="${e}"\`)`});t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls")}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$root.addEventListener("click",(t=>this.handleClick(t)))}syncAllConditionalReveals(){this.$inputs.forEach((t=>this.syncConditionalRevealWithInputState(t)))}syncConditionalRevealWithInputState(t){const e=t.getAttribute("aria-controls");if(!e)return;const s=document.getElementById(e);if(null!=s&&s.classList.contains("govuk-checkboxes__conditional")){const e=t.checked;t.setAttribute("aria-expanded",e.toString()),s.classList.toggle("govuk-checkboxes__conditional--hidden",!e)}}unCheckAllInputsExcept(t){document.querySelectorAll(`input[type="checkbox"][name="${t.name}"]`).forEach((e=>{t.form===e.form&&e!==t&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}))}unCheckExclusiveInputs(t){document.querySelectorAll(`input[data-behaviour="exclusive"][type="checkbox"][name="${t.name}"]`).forEach((e=>{t.form===e.form&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}))}handleClick(t){const e=t.target;if(!(e instanceof HTMLInputElement)||"checkbox"!==e.type)return;if(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),!e.checked)return;"exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)}}Checkboxes.moduleName="govuk-checkboxes";class ErrorSummary extends GOVUKFrontendComponent{constructor(t,e={}){super(t),this.config=void 0,this.config=mergeConfigs(ErrorSummary.defaults,e,normaliseDataset(ErrorSummary,this.$root.dataset)),this.config.disableAutoFocus||setFocus(this.$root),this.$root.addEventListener("click",(t=>this.handleClick(t)))}handleClick(t){const e=t.target;e&&this.focusTarget(e)&&t.preventDefault()}focusTarget(t){if(!(t instanceof HTMLAnchorElement))return!1;const e=getFragmentFromUrl(t.href);if(!e)return!1;const s=document.getElementById(e);if(!s)return!1;const n=this.getAssociatedLegendOrLabel(s);return!!n&&(n.scrollIntoView(),s.focus({preventScroll:!0}),!0)}getAssociatedLegendOrLabel(t){var e;const s=t.closest("fieldset");if(s){const e=s.getElementsByTagName("legend");if(e.length){const s=e[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return s;const n=s.getBoundingClientRect().top,i=t.getBoundingClientRect();if(i.height&&window.innerHeight){if(i.top+i.height-n<window.innerHeight/2)return s}}}return null!=(e=document.querySelector(`label[for='${t.getAttribute("id")}']`))?e:t.closest("label")}}ErrorSummary.moduleName="govuk-error-summary",ErrorSummary.defaults=Object.freeze({disableAutoFocus:!1}),ErrorSummary.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class ExitThisPage extends GOVUKFrontendComponent{constructor(t,e={}){super(t),this.config=void 0,this.i18n=void 0,this.$button=void 0,this.$skiplinkButton=null,this.$updateSpan=null,this.$indicatorContainer=null,this.$overlay=null,this.keypressCounter=0,this.lastKeyWasModified=!1,this.timeoutTime=5e3,this.keypressTimeoutId=null,this.timeoutMessageId=null;const s=this.$root.querySelector(".govuk-exit-this-page__button");if(!(s instanceof HTMLAnchorElement))throw new ElementError({component:ExitThisPage,element:s,expectedType:"HTMLAnchorElement",identifier:"Button (`.govuk-exit-this-page__button`)"});this.config=mergeConfigs(ExitThisPage.defaults,e,normaliseDataset(ExitThisPage,this.$root.dataset)),this.i18n=new I18n(this.config.i18n),this.$button=s;const n=document.querySelector(".govuk-js-exit-this-page-skiplink");n instanceof HTMLAnchorElement&&(this.$skiplinkButton=n),this.buildIndicator(),this.initUpdateSpan(),this.initButtonClickHandler(),"govukFrontendExitThisPageKeypress"in document.body.dataset||(document.addEventListener("keyup",this.handleKeypress.bind(this),!0),document.body.dataset.govukFrontendExitThisPageKeypress="true"),window.addEventListener("pageshow",this.resetPage.bind(this))}initUpdateSpan(){this.$updateSpan=document.createElement("span"),this.$updateSpan.setAttribute("role","status"),this.$updateSpan.className="govuk-visually-hidden",this.$root.appendChild(this.$updateSpan)}initButtonClickHandler(){this.$button.addEventListener("click",this.handleClick.bind(this)),this.$skiplinkButton&&this.$skiplinkButton.addEventListener("click",this.handleClick.bind(this))}buildIndicator(){this.$indicatorContainer=document.createElement("div"),this.$indicatorContainer.className="govuk-exit-this-page__indicator",this.$indicatorContainer.setAttribute("aria-hidden","true");for(let t=0;t<3;t++){const t=document.createElement("div");t.className="govuk-exit-this-page__indicator-light",this.$indicatorContainer.appendChild(t)}this.$button.appendChild(this.$indicatorContainer)}updateIndicator(){if(!this.$indicatorContainer)return;this.$indicatorContainer.classList.toggle("govuk-exit-this-page__indicator--visible",this.keypressCounter>0);this.$indicatorContainer.querySelectorAll(".govuk-exit-this-page__indicator-light").forEach(((t,e)=>{t.classList.toggle("govuk-exit-this-page__indicator-light--on",e<this.keypressCounter)}))}exitPage(){this.$updateSpan&&(this.$updateSpan.textContent="",document.body.classList.add("govuk-exit-this-page-hide-content"),this.$overlay=document.createElement("div"),this.$overlay.className="govuk-exit-this-page-overlay",this.$overlay.setAttribute("role","alert"),document.body.appendChild(this.$overlay),this.$overlay.textContent=this.i18n.t("activated"),window.location.href=this.$button.href)}handleClick(t){t.preventDefault(),this.exitPage()}handleKeypress(t){this.$updateSpan&&("Shift"!==t.key||this.lastKeyWasModified?this.keypressTimeoutId&&this.resetKeypressTimer():(this.keypressCounter+=1,this.updateIndicator(),this.timeoutMessageId&&(window.clearTimeout(this.timeoutMessageId),this.timeoutMessageId=null),this.keypressCounter>=3?(this.keypressCounter=0,this.keypressTimeoutId&&(window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null),this.exitPage()):1===this.keypressCounter?this.$updateSpan.textContent=this.i18n.t("pressTwoMoreTimes"):this.$updateSpan.textContent=this.i18n.t("pressOneMoreTime"),this.setKeypressTimer()),this.lastKeyWasModified=t.shiftKey)}setKeypressTimer(){this.keypressTimeoutId&&window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=window.setTimeout(this.resetKeypressTimer.bind(this),this.timeoutTime)}resetKeypressTimer(){if(!this.$updateSpan)return;this.keypressTimeoutId&&(window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null);const t=this.$updateSpan;this.keypressCounter=0,t.textContent=this.i18n.t("timedOut"),this.timeoutMessageId=window.setTimeout((()=>{t.textContent=""}),this.timeoutTime),this.updateIndicator()}resetPage(){document.body.classList.remove("govuk-exit-this-page-hide-content"),this.$overlay&&(this.$overlay.remove(),this.$overlay=null),this.$updateSpan&&(this.$updateSpan.setAttribute("role","status"),this.$updateSpan.textContent=""),this.updateIndicator(),this.keypressTimeoutId&&window.clearTimeout(this.keypressTimeoutId),this.timeoutMessageId&&window.clearTimeout(this.timeoutMessageId)}}ExitThisPage.moduleName="govuk-exit-this-page",ExitThisPage.defaults=Object.freeze({i18n:{activated:"Loading.",timedOut:"Exit this page expired.",pressTwoMoreTimes:"Shift, press 2 more times to exit.",pressOneMoreTime:"Shift, press 1 more time to exit."}}),ExitThisPage.schema=Object.freeze({properties:{i18n:{type:"object"}}});class Header extends GOVUKFrontendComponent{constructor(t){super(t),this.$menuButton=void 0,this.$menu=void 0,this.menuIsOpen=!1,this.mql=null;const e=this.$root.querySelector(".govuk-js-header-toggle");if(!e)return this;const s=e.getAttribute("aria-controls");if(!s)throw new ElementError({component:Header,identifier:'Navigation button (`<button class="govuk-js-header-toggle">`) attribute (`aria-controls`)'});const n=document.getElementById(s);if(!n)throw new ElementError({component:Header,element:n,identifier:`Navigation (\`<ul id="${s}">\`)`});this.$menu=n,this.$menuButton=e,this.setupResponsiveChecks(),this.$menuButton.addEventListener("click",(()=>this.handleMenuButtonClick()))}setupResponsiveChecks(){const t=getBreakpoint("desktop");if(!t.value)throw new ElementError({component:Header,identifier:`CSS custom property (\`${t.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${t.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.checkMode())):this.mql.addListener((()=>this.checkMode())),this.checkMode()}checkMode(){this.mql&&this.$menu&&this.$menuButton&&(this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden","")))}handleMenuButtonClick(){this.menuIsOpen=!this.menuIsOpen,this.checkMode()}}Header.moduleName="govuk-header";class NotificationBanner extends GOVUKFrontendComponent{constructor(t,e={}){super(t),this.config=void 0,this.config=mergeConfigs(NotificationBanner.defaults,e,normaliseDataset(NotificationBanner,this.$root.dataset)),"alert"!==this.$root.getAttribute("role")||this.config.disableAutoFocus||setFocus(this.$root)}}NotificationBanner.moduleName="govuk-notification-banner",NotificationBanner.defaults=Object.freeze({disableAutoFocus:!1}),NotificationBanner.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class PasswordInput extends GOVUKFrontendComponent{constructor(t,e={}){super(t),this.config=void 0,this.i18n=void 0,this.$input=void 0,this.$showHideButton=void 0,this.$screenReaderStatusMessage=void 0;const s=this.$root.querySelector(".govuk-js-password-input-input");if(!(s instanceof HTMLInputElement))throw new ElementError({component:PasswordInput,element:s,expectedType:"HTMLInputElement",identifier:"Form field (`.govuk-js-password-input-input`)"});if("password"!==s.type)throw new ElementError("Password input: Form field (`.govuk-js-password-input-input`) must be of type `password`.");const n=this.$root.querySelector(".govuk-js-password-input-toggle");if(!(n instanceof HTMLButtonElement))throw new ElementError({component:PasswordInput,element:n,expectedType:"HTMLButtonElement",identifier:"Button (`.govuk-js-password-input-toggle`)"});if("button"!==n.type)throw new ElementError("Password input: Button (`.govuk-js-password-input-toggle`) must be of type `button`.");this.$input=s,this.$showHideButton=n,this.config=mergeConfigs(PasswordInput.defaults,e,normaliseDataset(PasswordInput,this.$root.dataset)),this.i18n=new I18n(this.config.i18n,{locale:closestAttributeValue(this.$root,"lang")}),this.$showHideButton.removeAttribute("hidden");const i=document.createElement("div");i.className="govuk-password-input__sr-status govuk-visually-hidden",i.setAttribute("aria-live","polite"),this.$screenReaderStatusMessage=i,this.$input.insertAdjacentElement("afterend",i),this.$showHideButton.addEventListener("click",this.toggle.bind(this)),this.$input.form&&this.$input.form.addEventListener("submit",(()=>this.hide())),window.addEventListener("pageshow",(t=>{t.persisted&&"password"!==this.$input.type&&this.hide()})),this.hide()}toggle(t){t.preventDefault(),"password"!==this.$input.type?this.hide():this.show()}show(){this.setType("text")}hide(){this.setType("password")}setType(t){if(t===this.$input.type)return;this.$input.setAttribute("type",t);const e="password"===t,s=e?"show":"hide",n=e?"passwordHidden":"passwordShown";this.$showHideButton.innerText=this.i18n.t(`${s}Password`),this.$showHideButton.setAttribute("aria-label",this.i18n.t(`${s}PasswordAriaLabel`)),this.$screenReaderStatusMessage.innerText=this.i18n.t(`${n}Announcement`)}}PasswordInput.moduleName="govuk-password-input",PasswordInput.defaults=Object.freeze({i18n:{showPassword:"Show",hidePassword:"Hide",showPasswordAriaLabel:"Show password",hidePasswordAriaLabel:"Hide password",passwordShownAnnouncement:"Your password is visible",passwordHiddenAnnouncement:"Your password is hidden"}}),PasswordInput.schema=Object.freeze({properties:{i18n:{type:"object"}}});class Radios extends GOVUKFrontendComponent{constructor(t){super(t),this.$inputs=void 0;const e=this.$root.querySelectorAll('input[type="radio"]');if(!e.length)throw new ElementError({component:Radios,identifier:'Form inputs (`<input type="radio">`)'});this.$inputs=e,this.$inputs.forEach((t=>{const e=t.getAttribute("data-aria-controls");if(e){if(!document.getElementById(e))throw new ElementError({component:Radios,identifier:`Conditional reveal (\`id="${e}"\`)`});t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls")}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$root.addEventListener("click",(t=>this.handleClick(t)))}syncAllConditionalReveals(){this.$inputs.forEach((t=>this.syncConditionalRevealWithInputState(t)))}syncConditionalRevealWithInputState(t){const e=t.getAttribute("aria-controls");if(!e)return;const s=document.getElementById(e);if(null!=s&&s.classList.contains("govuk-radios__conditional")){const e=t.checked;t.setAttribute("aria-expanded",e.toString()),s.classList.toggle("govuk-radios__conditional--hidden",!e)}}handleClick(t){const e=t.target;if(!(e instanceof HTMLInputElement)||"radio"!==e.type)return;const s=document.querySelectorAll('input[type="radio"][aria-controls]'),n=e.form,i=e.name;s.forEach((t=>{const e=t.form===n;t.name===i&&e&&this.syncConditionalRevealWithInputState(t)}))}}Radios.moduleName="govuk-radios";class ServiceNavigation extends GOVUKFrontendComponent{constructor(t){super(t),this.$menuButton=void 0,this.$menu=void 0,this.menuIsOpen=!1,this.mql=null;const e=this.$root.querySelector(".govuk-js-service-navigation-toggle");if(!e)return this;const s=e.getAttribute("aria-controls");if(!s)throw new ElementError({component:ServiceNavigation,identifier:'Navigation button (`<button class="govuk-js-service-navigation-toggle">`) attribute (`aria-controls`)'});const n=document.getElementById(s);if(!n)throw new ElementError({component:ServiceNavigation,element:n,identifier:`Navigation (\`<ul id="${s}">\`)`});this.$menu=n,this.$menuButton=e,this.setupResponsiveChecks(),this.$menuButton.addEventListener("click",(()=>this.handleMenuButtonClick()))}setupResponsiveChecks(){const t=getBreakpoint("tablet");if(!t.value)throw new ElementError({component:ServiceNavigation,identifier:`CSS custom property (\`${t.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${t.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.checkMode())):this.mql.addListener((()=>this.checkMode())),this.checkMode()}checkMode(){this.mql&&this.$menu&&this.$menuButton&&(this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden","")))}handleMenuButtonClick(){this.menuIsOpen=!this.menuIsOpen,this.checkMode()}}ServiceNavigation.moduleName="govuk-service-navigation";class SkipLink extends GOVUKFrontendComponent{constructor(t){var e;super(t);const s=this.$root.hash,n=null!=(e=this.$root.getAttribute("href"))?e:"";let i;try{i=new window.URL(this.$root.href)}catch(a){throw new ElementError(`Skip link: Target link (\`href="${n}"\`) is invalid`)}if(i.origin!==window.location.origin||i.pathname!==window.location.pathname)return;const o=getFragmentFromUrl(s);if(!o)throw new ElementError(`Skip link: Target link (\`href="${n}"\`) has no hash fragment`);const r=document.getElementById(o);if(!r)throw new ElementError({component:SkipLink,element:r,identifier:`Target content (\`id="${o}"\`)`});this.$root.addEventListener("click",(()=>setFocus(r,{onBeforeFocus(){r.classList.add("govuk-skip-link-focused-element")},onBlur(){r.classList.remove("govuk-skip-link-focused-element")}})))}}SkipLink.elementType=HTMLAnchorElement,SkipLink.moduleName="govuk-skip-link";class Tabs extends GOVUKFrontendComponent{constructor(t){super(t),this.$tabs=void 0,this.$tabList=void 0,this.$tabListItems=void 0,this.jsHiddenClass="govuk-tabs__panel--hidden",this.changingHash=!1,this.boundTabClick=void 0,this.boundTabKeydown=void 0,this.boundOnHashChange=void 0,this.mql=null;const e=this.$root.querySelectorAll("a.govuk-tabs__tab");if(!e.length)throw new ElementError({component:Tabs,identifier:'Links (`<a class="govuk-tabs__tab">`)'});this.$tabs=e,this.boundTabClick=this.onTabClick.bind(this),this.boundTabKeydown=this.onTabKeydown.bind(this),this.boundOnHashChange=this.onHashChange.bind(this);const s=this.$root.querySelector(".govuk-tabs__list"),n=this.$root.querySelectorAll("li.govuk-tabs__list-item");if(!s)throw new ElementError({component:Tabs,identifier:'List (`<ul class="govuk-tabs__list">`)'});if(!n.length)throw new ElementError({component:Tabs,identifier:'List items (`<li class="govuk-tabs__list-item">`)'});this.$tabList=s,this.$tabListItems=n,this.setupResponsiveChecks()}setupResponsiveChecks(){const t=getBreakpoint("tablet");if(!t.value)throw new ElementError({component:Tabs,identifier:`CSS custom property (\`${t.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${t.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.checkMode())):this.mql.addListener((()=>this.checkMode())),this.checkMode()}checkMode(){var t;null!=(t=this.mql)&&t.matches?this.setup():this.teardown()}setup(){var t;this.$tabList.setAttribute("role","tablist"),this.$tabListItems.forEach((t=>{t.setAttribute("role","presentation")})),this.$tabs.forEach((t=>{this.setAttributes(t),t.addEventListener("click",this.boundTabClick,!0),t.addEventListener("keydown",this.boundTabKeydown,!0),this.hideTab(t)}));const e=null!=(t=this.getTab(window.location.hash))?t:this.$tabs[0];this.showTab(e),window.addEventListener("hashchange",this.boundOnHashChange,!0)}teardown(){this.$tabList.removeAttribute("role"),this.$tabListItems.forEach((t=>{t.removeAttribute("role")})),this.$tabs.forEach((t=>{t.removeEventListener("click",this.boundTabClick,!0),t.removeEventListener("keydown",this.boundTabKeydown,!0),this.unsetAttributes(t)})),window.removeEventListener("hashchange",this.boundOnHashChange,!0)}onHashChange(){const t=window.location.hash,e=this.getTab(t);if(!e)return;if(this.changingHash)return void(this.changingHash=!1);const s=this.getCurrentTab();s&&(this.hideTab(s),this.showTab(e),e.focus())}hideTab(t){this.unhighlightTab(t),this.hidePanel(t)}showTab(t){this.highlightTab(t),this.showPanel(t)}getTab(t){return this.$root.querySelector(`a.govuk-tabs__tab[href="${t}"]`)}setAttributes(t){const e=getFragmentFromUrl(t.href);if(!e)return;t.setAttribute("id",`tab_${e}`),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");const s=this.getPanel(t);s&&(s.setAttribute("role","tabpanel"),s.setAttribute("aria-labelledby",t.id),s.classList.add(this.jsHiddenClass))}unsetAttributes(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");const e=this.getPanel(t);e&&(e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass))}onTabClick(t){const e=this.getCurrentTab(),s=t.currentTarget;e&&s instanceof HTMLAnchorElement&&(t.preventDefault(),this.hideTab(e),this.showTab(s),this.createHistoryEntry(s))}createHistoryEntry(t){const e=this.getPanel(t);if(!e)return;const s=e.id;e.id="",this.changingHash=!0,window.location.hash=s,e.id=s}onTabKeydown(t){switch(t.key){case"ArrowLeft":case"Left":this.activatePreviousTab(),t.preventDefault();break;case"ArrowRight":case"Right":this.activateNextTab(),t.preventDefault()}}activateNextTab(){const t=this.getCurrentTab();if(null==t||!t.parentElement)return;const e=t.parentElement.nextElementSibling;if(!e)return;const s=e.querySelector("a.govuk-tabs__tab");s&&(this.hideTab(t),this.showTab(s),s.focus(),this.createHistoryEntry(s))}activatePreviousTab(){const t=this.getCurrentTab();if(null==t||!t.parentElement)return;const e=t.parentElement.previousElementSibling;if(!e)return;const s=e.querySelector("a.govuk-tabs__tab");s&&(this.hideTab(t),this.showTab(s),s.focus(),this.createHistoryEntry(s))}getPanel(t){const e=getFragmentFromUrl(t.href);return e?this.$root.querySelector(`#${e}`):null}showPanel(t){const e=this.getPanel(t);e&&e.classList.remove(this.jsHiddenClass)}hidePanel(t){const e=this.getPanel(t);e&&e.classList.add(this.jsHiddenClass)}unhighlightTab(t){t.parentElement&&(t.setAttribute("aria-selected","false"),t.parentElement.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1"))}highlightTab(t){t.parentElement&&(t.setAttribute("aria-selected","true"),t.parentElement.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0"))}getCurrentTab(){return this.$root.querySelector(".govuk-tabs__list-item--selected a.govuk-tabs__tab")}}function initAll(t){var e;if(t=void 0!==t?t:{},!isSupported())return void(t.onError?t.onError(new SupportError,{config:t}):console.log(new SupportError));const s=[[Accordion,t.accordion],[Button,t.button],[CharacterCount,t.characterCount],[Checkboxes],[ErrorSummary,t.errorSummary],[ExitThisPage,t.exitThisPage],[Header],[NotificationBanner,t.notificationBanner],[PasswordInput,t.passwordInput],[Radios],[ServiceNavigation],[SkipLink],[Tabs]],n={scope:null!=(e=t.scope)?e:document,onError:t.onError};s.forEach((([Component,t])=>{createAll(Component,t,n)}))}function createAll(Component,t,e){let s,n=document;var i;"object"==typeof e&&(n=null!=(i=e.scope)?i:n,s=e.onError);"function"==typeof e&&(s=e),e instanceof HTMLElement&&(n=e);const o=n.querySelectorAll(`[data-module="${Component.moduleName}"]`);return isSupported()?Array.from(o).map((e=>{try{return void 0!==t?new Component(e,t):new Component(e)}catch(n){return s?s(n,{element:e,component:Component,config:t}):console.log(n),null}})).filter(Boolean):(s?s(new SupportError,{component:Component,config:t}):console.log(new SupportError),[])}Tabs.moduleName="govuk-tabs";export{Accordion,Button,CharacterCount,Checkboxes,GOVUKFrontendComponent as Component,ErrorSummary,ExitThisPage,Header,NotificationBanner,PasswordInput,Radios,ServiceNavigation,SkipLink,Tabs,createAll,initAll,isSupported,version};//# sourceMappingURL=govuk-frontend.min.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@import "../settings/warnings";
|
|
2
|
+
@import "index";
|
|
3
|
+
|
|
4
|
+
@include _warning(
|
|
5
|
+
"import-using-all",
|
|
6
|
+
"Importing using 'govuk/helpers/all' is deprecated. Update your import statement to import 'govuk/helpers/index'.",
|
|
7
|
+
$silence-further-warnings: false
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
/*# sourceMappingURL=_all.scss.map */
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
@import "../settings/colours-palette";
|
|
2
|
+
@import "../settings/colours-organisations";
|
|
3
|
+
@import "../settings/warnings";
|
|
4
|
+
|
|
5
|
+
////
|
|
6
|
+
/// @group helpers/colour
|
|
7
|
+
////
|
|
8
|
+
|
|
9
|
+
/// Get colour
|
|
10
|
+
///
|
|
11
|
+
/// @param {String | Colour} $colour - Name of colour from the colour palette
|
|
12
|
+
/// (`$govuk-colours`)
|
|
13
|
+
/// @param {String | Colour | Boolean} $legacy [false] - Deprecated.
|
|
14
|
+
/// The `$legacy` parameter is deprecated and is non-operational, as the
|
|
15
|
+
/// legacy colour palette has been removed. The parameter will be removed in
|
|
16
|
+
/// the next major version.
|
|
17
|
+
/// @return {Colour} Representation of named colour
|
|
18
|
+
///
|
|
19
|
+
/// @throw if `$colour` is not a colour from the colour palette
|
|
20
|
+
/// @access public
|
|
21
|
+
|
|
22
|
+
@function govuk-colour($colour, $legacy: false) {
|
|
23
|
+
// Output a warning if $legacy is set to anything.
|
|
24
|
+
@if $legacy and _should-warn("legacy-colour-param") {
|
|
25
|
+
@warn _warning-text("legacy-colour-param", "The `$legacy` parameter of " +
|
|
26
|
+
"`govuk-colour` is deprecated and is non-operational. It will be " +
|
|
27
|
+
"removed in the next major version.");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@if type-of($colour) == "color" {
|
|
31
|
+
// stylelint-disable-next-line scss/function-quote-no-quoted-strings-inside
|
|
32
|
+
$colour: quote("#{$colour}");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@if not map-has-key($govuk-colours, $colour) {
|
|
36
|
+
@error "Unknown colour `#{$colour}`";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@return map-get($govuk-colours, $colour);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/// Get the colour for a government organisation
|
|
43
|
+
///
|
|
44
|
+
/// @param {String} $organisation - Organisation name, lowercase, hyphenated
|
|
45
|
+
/// @param {Boolean} $websafe - Deprecated. Use $contrast-safe instead.
|
|
46
|
+
/// @param {Boolean} $contrast-safe [true] - By default a version of the colour
|
|
47
|
+
/// will be returned which has a minimum 4.5:1 contrast ratio when used with
|
|
48
|
+
/// white, as per the WCAG 2.1 Level AA guidelines. If you want to use the
|
|
49
|
+
/// non-contrast safe version you can set this to `false` but your should
|
|
50
|
+
/// ensure that you still meets contrast requirements for accessibility -
|
|
51
|
+
/// for example, do not use the non-contrast safe version for text.
|
|
52
|
+
///
|
|
53
|
+
/// @return {Colour} Representation of colour for organisation
|
|
54
|
+
/// @throw if `$organisation` is not a known organisation
|
|
55
|
+
/// @access public
|
|
56
|
+
|
|
57
|
+
@function govuk-organisation-colour($organisation, $websafe: null, $contrast-safe: true) {
|
|
58
|
+
// Check if the $organisation exists in the aliases map. If so, change the
|
|
59
|
+
// value of $organisation to the aliased value.
|
|
60
|
+
@if map-has-key($_govuk_colours-organisations-aliases, $organisation) {
|
|
61
|
+
$organisation: map-get($_govuk_colours-organisations-aliases, $organisation);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Check to see if the organisation exists
|
|
65
|
+
@if not map-has-key($govuk-colours-organisations, $organisation) {
|
|
66
|
+
@error "Unknown organisation `#{$organisation}`";
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Output a warning if $websafe is set.
|
|
70
|
+
@if $websafe and not index($govuk-suppressed-warnings, "organisation-colour-websafe-param") {
|
|
71
|
+
@warn _warning-text("organisation-colour-websafe-param",
|
|
72
|
+
"The `$websafe` parameter of `govuk-organisation-colour` has been " +
|
|
73
|
+
"renamed to `$contrast-safe`. The old parameter name will be removed in " +
|
|
74
|
+
"the next major version."
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
$org-colour: map-get($govuk-colours-organisations, $organisation);
|
|
79
|
+
|
|
80
|
+
@if map-has-key($org-colour, deprecation-message) and not index($govuk-suppressed-warnings, "organisation-colours") {
|
|
81
|
+
@warn _warning-text(
|
|
82
|
+
"organisation-colours",
|
|
83
|
+
map-get($org-colour, deprecation-message)
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// If the $websafe parameter is being used (it has been explicitly set as true
|
|
88
|
+
// or false), assume the user hasn't updated to use $contrast-safe yet and map
|
|
89
|
+
// the old parameter's value onto the new parameter.
|
|
90
|
+
@if type-of($websafe) != "null" {
|
|
91
|
+
$contrast-safe: $websafe;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Determine the contrast-safe key to use depending on whether it's the new
|
|
95
|
+
// palette or the legacy palette
|
|
96
|
+
$safe-key: if($govuk-new-organisation-colours, "contrast-safe", "colour-websafe");
|
|
97
|
+
|
|
98
|
+
@if $contrast-safe and map-has-key($org-colour, $safe-key) {
|
|
99
|
+
@return map-get($org-colour, $safe-key);
|
|
100
|
+
} @else {
|
|
101
|
+
@return map-get($org-colour, colour);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/// Make a colour darker by mixing it with black
|
|
106
|
+
///
|
|
107
|
+
/// @param {Colour} $colour - colour to shade
|
|
108
|
+
/// @param {Number} $percentage - percentage of black to mix with $colour
|
|
109
|
+
/// @return {Colour}
|
|
110
|
+
/// @access public
|
|
111
|
+
|
|
112
|
+
@function govuk-shade($colour, $percentage) {
|
|
113
|
+
@return mix(#000000, $colour, $percentage);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/// Make a colour lighter by mixing it with white
|
|
117
|
+
///
|
|
118
|
+
/// @param {Colour} $colour - colour to tint
|
|
119
|
+
/// @param {Number} $percentage - percentage of white to mix with $colour
|
|
120
|
+
/// @return {Colour}
|
|
121
|
+
/// @access public
|
|
122
|
+
|
|
123
|
+
@function govuk-tint($colour, $percentage) {
|
|
124
|
+
@return mix(govuk-colour("white"), $colour, $percentage);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/*# sourceMappingURL=_colour.scss.map */
|
|
@@ -28,10 +28,11 @@
|
|
|
28
28
|
/// @access public
|
|
29
29
|
|
|
30
30
|
@mixin govuk-device-pixel-ratio($ratio: 2) {
|
|
31
|
-
// stylelint-disable indentation
|
|
32
31
|
@media only screen and (-webkit-min-device-pixel-ratio: $ratio),
|
|
33
32
|
only screen and (min-resolution: #{($ratio * 96)}dpi),
|
|
34
33
|
only screen and (min-resolution: #{$ratio}dppx) {
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
@content;
|
|
35
|
+
}
|
|
37
36
|
}
|
|
37
|
+
|
|
38
|
+
/*# sourceMappingURL=_device-pixels.scss.map */
|
|
@@ -14,14 +14,12 @@
|
|
|
14
14
|
// backgrounds and box-shadows disappear, so we need to ensure there's a
|
|
15
15
|
// transparent outline which will be set to a visible colour.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
// user-agent outlines
|
|
19
|
-
@include _govuk-not-ie8 {
|
|
20
|
-
outline: $govuk-focus-width solid transparent;
|
|
21
|
-
}
|
|
17
|
+
outline: $govuk-focus-width solid transparent;
|
|
22
18
|
color: $govuk-focus-text-colour;
|
|
23
19
|
background-color: $govuk-focus-colour;
|
|
24
|
-
box-shadow:
|
|
20
|
+
box-shadow:
|
|
21
|
+
0 -2px $govuk-focus-colour,
|
|
22
|
+
0 4px $govuk-focus-text-colour;
|
|
25
23
|
// When link is focussed, hide the default underline since the
|
|
26
24
|
// box shadow adds the "underline"
|
|
27
25
|
text-decoration: none;
|
|
@@ -31,3 +29,21 @@
|
|
|
31
29
|
-webkit-box-decoration-break: clone;
|
|
32
30
|
box-decoration-break: clone;
|
|
33
31
|
}
|
|
32
|
+
|
|
33
|
+
/// Focused box
|
|
34
|
+
///
|
|
35
|
+
/// Provides an outline to clearly indicate when the target element is focused.
|
|
36
|
+
/// Unlike govuk-focused-text, which only draws an underline below the element,
|
|
37
|
+
/// govuk-focused-box draws an outline around all sides of the element.
|
|
38
|
+
/// Best used for non-text content contained within links.
|
|
39
|
+
///
|
|
40
|
+
/// @access public
|
|
41
|
+
|
|
42
|
+
@mixin govuk-focused-box {
|
|
43
|
+
outline: $govuk-focus-width solid transparent;
|
|
44
|
+
box-shadow:
|
|
45
|
+
0 0 0 4px $govuk-focus-colour,
|
|
46
|
+
0 0 0 8px $govuk-focus-text-colour;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/*# sourceMappingURL=_focused.scss.map */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group helpers
|
|
3
|
+
////
|
|
4
|
+
|
|
5
|
+
@import "../tools/exports";
|
|
6
|
+
|
|
7
|
+
/// Font Face - GDS Transport
|
|
8
|
+
///
|
|
9
|
+
/// Outputs the font-face declaration for GDS Transport at the root of the CSS document
|
|
10
|
+
/// the first time it is called.
|
|
11
|
+
///
|
|
12
|
+
/// @access private
|
|
13
|
+
|
|
14
|
+
@mixin _govuk-font-face-gds-transport {
|
|
15
|
+
@include govuk-exports("govuk/helpers/font-faces") {
|
|
16
|
+
@at-root {
|
|
17
|
+
/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */ /* stylelint-disable-line scss/comment-no-loud */
|
|
18
|
+
@font-face {
|
|
19
|
+
font-family: "GDS Transport";
|
|
20
|
+
font-style: normal;
|
|
21
|
+
font-weight: normal;
|
|
22
|
+
src:
|
|
23
|
+
govuk-font-url("light-94a07e06a1-v2.woff2") format("woff2"),
|
|
24
|
+
govuk-font-url("light-f591b13f7d-v2.woff") format("woff");
|
|
25
|
+
font-display: fallback;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@font-face {
|
|
29
|
+
font-family: "GDS Transport";
|
|
30
|
+
font-style: normal;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
src:
|
|
33
|
+
govuk-font-url("bold-b542beb274-v2.woff2") format("woff2"),
|
|
34
|
+
govuk-font-url("bold-affa96571d-v2.woff") format("woff");
|
|
35
|
+
font-display: fallback;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/*# sourceMappingURL=_font-faces.scss.map */
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
/// }
|
|
38
38
|
///
|
|
39
39
|
/// @example scss - Customising the breakpoint where width percentage is applied
|
|
40
|
-
/// .govuk-grid-column-one-half-
|
|
40
|
+
/// .govuk-grid-column-one-half-from-desktop {
|
|
41
41
|
/// @include govuk-grid-column(one-half, $at: desktop);
|
|
42
42
|
/// }
|
|
43
43
|
///
|
|
@@ -59,3 +59,5 @@
|
|
|
59
59
|
float: $float;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
|
|
63
|
+
/*# sourceMappingURL=_grid.scss.map */
|