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
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';
|
|
2
|
+
import { mergeConfigs } from '../../common/index.mjs';
|
|
3
|
+
import { normaliseDataset } from '../../common/normalise-dataset.mjs';
|
|
4
|
+
import { ElementError } from '../../errors/index.mjs';
|
|
5
|
+
import { GOVUKFrontendComponent } from '../../govuk-frontend-component.mjs';
|
|
6
|
+
import { I18n } from '../../i18n.mjs';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Password input component
|
|
10
|
+
*
|
|
11
|
+
* @preserve
|
|
12
|
+
*/
|
|
13
|
+
class PasswordInput extends GOVUKFrontendComponent {
|
|
14
|
+
/**
|
|
15
|
+
* @param {Element | null} $root - HTML element to use for password input
|
|
16
|
+
* @param {PasswordInputConfig} [config] - Password input config
|
|
17
|
+
*/
|
|
18
|
+
constructor($root, config = {}) {
|
|
19
|
+
super($root);
|
|
20
|
+
this.config = void 0;
|
|
21
|
+
this.i18n = void 0;
|
|
22
|
+
this.$input = void 0;
|
|
23
|
+
this.$showHideButton = void 0;
|
|
24
|
+
this.$screenReaderStatusMessage = void 0;
|
|
25
|
+
const $input = this.$root.querySelector('.govuk-js-password-input-input');
|
|
26
|
+
if (!($input instanceof HTMLInputElement)) {
|
|
27
|
+
throw new ElementError({
|
|
28
|
+
component: PasswordInput,
|
|
29
|
+
element: $input,
|
|
30
|
+
expectedType: 'HTMLInputElement',
|
|
31
|
+
identifier: 'Form field (`.govuk-js-password-input-input`)'
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if ($input.type !== 'password') {
|
|
35
|
+
throw new ElementError('Password input: Form field (`.govuk-js-password-input-input`) must be of type `password`.');
|
|
36
|
+
}
|
|
37
|
+
const $showHideButton = this.$root.querySelector('.govuk-js-password-input-toggle');
|
|
38
|
+
if (!($showHideButton instanceof HTMLButtonElement)) {
|
|
39
|
+
throw new ElementError({
|
|
40
|
+
component: PasswordInput,
|
|
41
|
+
element: $showHideButton,
|
|
42
|
+
expectedType: 'HTMLButtonElement',
|
|
43
|
+
identifier: 'Button (`.govuk-js-password-input-toggle`)'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if ($showHideButton.type !== 'button') {
|
|
47
|
+
throw new ElementError('Password input: Button (`.govuk-js-password-input-toggle`) must be of type `button`.');
|
|
48
|
+
}
|
|
49
|
+
this.$input = $input;
|
|
50
|
+
this.$showHideButton = $showHideButton;
|
|
51
|
+
this.config = mergeConfigs(PasswordInput.defaults, config, normaliseDataset(PasswordInput, this.$root.dataset));
|
|
52
|
+
this.i18n = new I18n(this.config.i18n, {
|
|
53
|
+
locale: closestAttributeValue(this.$root, 'lang')
|
|
54
|
+
});
|
|
55
|
+
this.$showHideButton.removeAttribute('hidden');
|
|
56
|
+
const $screenReaderStatusMessage = document.createElement('div');
|
|
57
|
+
$screenReaderStatusMessage.className = 'govuk-password-input__sr-status govuk-visually-hidden';
|
|
58
|
+
$screenReaderStatusMessage.setAttribute('aria-live', 'polite');
|
|
59
|
+
this.$screenReaderStatusMessage = $screenReaderStatusMessage;
|
|
60
|
+
this.$input.insertAdjacentElement('afterend', $screenReaderStatusMessage);
|
|
61
|
+
this.$showHideButton.addEventListener('click', this.toggle.bind(this));
|
|
62
|
+
if (this.$input.form) {
|
|
63
|
+
this.$input.form.addEventListener('submit', () => this.hide());
|
|
64
|
+
}
|
|
65
|
+
window.addEventListener('pageshow', event => {
|
|
66
|
+
if (event.persisted && this.$input.type !== 'password') {
|
|
67
|
+
this.hide();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
this.hide();
|
|
71
|
+
}
|
|
72
|
+
toggle(event) {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
if (this.$input.type === 'password') {
|
|
75
|
+
this.show();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.hide();
|
|
79
|
+
}
|
|
80
|
+
show() {
|
|
81
|
+
this.setType('text');
|
|
82
|
+
}
|
|
83
|
+
hide() {
|
|
84
|
+
this.setType('password');
|
|
85
|
+
}
|
|
86
|
+
setType(type) {
|
|
87
|
+
if (type === this.$input.type) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.$input.setAttribute('type', type);
|
|
91
|
+
const isHidden = type === 'password';
|
|
92
|
+
const prefixButton = isHidden ? 'show' : 'hide';
|
|
93
|
+
const prefixStatus = isHidden ? 'passwordHidden' : 'passwordShown';
|
|
94
|
+
this.$showHideButton.innerText = this.i18n.t(`${prefixButton}Password`);
|
|
95
|
+
this.$showHideButton.setAttribute('aria-label', this.i18n.t(`${prefixButton}PasswordAriaLabel`));
|
|
96
|
+
this.$screenReaderStatusMessage.innerText = this.i18n.t(`${prefixStatus}Announcement`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Password input config
|
|
102
|
+
*
|
|
103
|
+
* @typedef {object} PasswordInputConfig
|
|
104
|
+
* @property {PasswordInputTranslations} [i18n=PasswordInput.defaults.i18n] - Password input translations
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Password input translations
|
|
109
|
+
*
|
|
110
|
+
* @see {@link PasswordInput.defaults.i18n}
|
|
111
|
+
* @typedef {object} PasswordInputTranslations
|
|
112
|
+
*
|
|
113
|
+
* Messages displayed to the user indicating the state of the show/hide toggle.
|
|
114
|
+
* @property {string} [showPassword] - Visible text of the button when the
|
|
115
|
+
* password is currently hidden. Plain text only.
|
|
116
|
+
* @property {string} [hidePassword] - Visible text of the button when the
|
|
117
|
+
* password is currently visible. Plain text only.
|
|
118
|
+
* @property {string} [showPasswordAriaLabel] - aria-label of the button when
|
|
119
|
+
* the password is currently hidden. Plain text only.
|
|
120
|
+
* @property {string} [hidePasswordAriaLabel] - aria-label of the button when
|
|
121
|
+
* the password is currently visible. Plain text only.
|
|
122
|
+
* @property {string} [passwordShownAnnouncement] - Screen reader
|
|
123
|
+
* announcement to make when the password has just become visible.
|
|
124
|
+
* Plain text only.
|
|
125
|
+
* @property {string} [passwordHiddenAnnouncement] - Screen reader
|
|
126
|
+
* announcement to make when the password has just been hidden.
|
|
127
|
+
* Plain text only.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @typedef {import('../../common/index.mjs').Schema} Schema
|
|
132
|
+
* @typedef {import('../../i18n.mjs').TranslationPluralForms} TranslationPluralForms
|
|
133
|
+
*/
|
|
134
|
+
PasswordInput.moduleName = 'govuk-password-input';
|
|
135
|
+
PasswordInput.defaults = Object.freeze({
|
|
136
|
+
i18n: {
|
|
137
|
+
showPassword: 'Show',
|
|
138
|
+
hidePassword: 'Hide',
|
|
139
|
+
showPasswordAriaLabel: 'Show password',
|
|
140
|
+
hidePasswordAriaLabel: 'Hide password',
|
|
141
|
+
passwordShownAnnouncement: 'Your password is visible',
|
|
142
|
+
passwordHiddenAnnouncement: 'Your password is hidden'
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
PasswordInput.schema = Object.freeze({
|
|
146
|
+
properties: {
|
|
147
|
+
i18n: {
|
|
148
|
+
type: 'object'
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
export { PasswordInput };
|
|
154
|
+
//# sourceMappingURL=password-input.mjs.map
|
|
@@ -17,7 +17,14 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.govuk-phase-banner__content__tag {
|
|
20
|
-
|
|
20
|
+
@include govuk-font-size($size: 16);
|
|
21
|
+
margin-right: govuk-spacing(if($govuk-new-typography-scale, 3, 2));
|
|
22
|
+
|
|
23
|
+
@if $govuk-new-typography-scale {
|
|
24
|
+
@include govuk-media-query($from: tablet) {
|
|
25
|
+
margin-right: govuk-spacing(2);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
.govuk-phase-banner__text {
|
|
@@ -25,3 +32,5 @@
|
|
|
25
32
|
vertical-align: middle;
|
|
26
33
|
}
|
|
27
34
|
}
|
|
35
|
+
|
|
36
|
+
/*# sourceMappingURL=_index.scss.map */
|
|
@@ -4,27 +4,21 @@
|
|
|
4
4
|
@import "../label/index";
|
|
5
5
|
|
|
6
6
|
@include govuk-exports("govuk/component/radios") {
|
|
7
|
-
|
|
8
|
-
$govuk-touch-target-size: 44px;
|
|
7
|
+
$govuk-touch-target-gutter: 4px;
|
|
9
8
|
$govuk-radios-size: 40px;
|
|
9
|
+
$govuk-touch-target-size: ($govuk-radios-size + $govuk-touch-target-gutter);
|
|
10
10
|
$govuk-small-radios-size: 24px;
|
|
11
11
|
$govuk-radios-label-padding-left-right: govuk-spacing(3);
|
|
12
|
-
// When the default focus width is used on a curved edge it looks visually
|
|
13
|
-
// So for the circular radios we bump the default to make it look
|
|
12
|
+
// When the default focus width is used on a curved edge it looks visually
|
|
13
|
+
// smaller. So for the circular radios we bump the default to make it look
|
|
14
|
+
// visually consistent.
|
|
14
15
|
$govuk-radios-focus-width: $govuk-focus-width + 1px;
|
|
15
16
|
|
|
16
17
|
.govuk-radios__item {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
display: block;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
20
|
position: relative;
|
|
21
|
-
|
|
22
|
-
min-height: $govuk-radios-size;
|
|
23
|
-
|
|
24
21
|
margin-bottom: govuk-spacing(2);
|
|
25
|
-
padding-left: $govuk-radios-size;
|
|
26
|
-
|
|
27
|
-
clear: left;
|
|
28
22
|
}
|
|
29
23
|
|
|
30
24
|
.govuk-radios__item:last-child,
|
|
@@ -33,60 +27,40 @@
|
|
|
33
27
|
}
|
|
34
28
|
|
|
35
29
|
.govuk-radios__input {
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
// Allow the input to sit above the label, enabling its proper detection
|
|
31
|
+
// when exploring by touch or using automation tools like Selenium
|
|
32
|
+
z-index: 1;
|
|
33
|
+
width: $govuk-touch-target-size;
|
|
34
|
+
height: $govuk-touch-target-size;
|
|
35
|
+
margin: 0;
|
|
36
|
+
opacity: 0;
|
|
38
37
|
cursor: pointer;
|
|
39
|
-
|
|
40
|
-
// IE8 doesn’t support pseudo-elements, so we don’t want to hide native
|
|
41
|
-
// elements there.
|
|
42
|
-
@include _govuk-not-ie8 {
|
|
43
|
-
position: absolute;
|
|
44
|
-
|
|
45
|
-
z-index: 1;
|
|
46
|
-
top: $input-offset * -1;
|
|
47
|
-
left: $input-offset * -1;
|
|
48
|
-
|
|
49
|
-
width: $govuk-touch-target-size;
|
|
50
|
-
height: $govuk-touch-target-size;
|
|
51
|
-
margin: 0;
|
|
52
|
-
|
|
53
|
-
opacity: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@include _govuk-if-ie8 {
|
|
57
|
-
margin-top: 10px;
|
|
58
|
-
margin-right: $govuk-radios-size / -2;
|
|
59
|
-
margin-left: $govuk-radios-size / -2;
|
|
60
|
-
float: left;
|
|
61
|
-
|
|
62
|
-
// add focus outline to input
|
|
63
|
-
&:focus {
|
|
64
|
-
outline: $govuk-focus-width solid $govuk-focus-colour;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
38
|
}
|
|
68
39
|
|
|
69
40
|
.govuk-radios__label {
|
|
70
|
-
|
|
41
|
+
align-self: center;
|
|
42
|
+
|
|
43
|
+
// Ensure that the width of the label is never more than the width of the
|
|
44
|
+
// container minus the input width minus the padding on either side of
|
|
45
|
+
// the label. This prevents the label from going onto the next line due to
|
|
46
|
+
// __item using flex-wrap because we want hints on a separate line
|
|
47
|
+
max-width: calc(100% - #{($govuk-radios-label-padding-left-right + $govuk-touch-target-size + govuk-spacing(3))});
|
|
71
48
|
margin-bottom: 0;
|
|
72
|
-
padding:
|
|
49
|
+
padding: (govuk-spacing(1) + $govuk-border-width-form-element) govuk-spacing(3);
|
|
73
50
|
cursor: pointer;
|
|
74
51
|
// remove 300ms pause on mobile
|
|
75
|
-
|
|
76
|
-
touch-action: manipulation;
|
|
52
|
+
touch-action: manipulation;
|
|
77
53
|
}
|
|
78
54
|
|
|
79
55
|
// ( ) Radio ring
|
|
80
|
-
.govuk-radios__label
|
|
56
|
+
.govuk-radios__label::before {
|
|
81
57
|
content: "";
|
|
82
58
|
box-sizing: border-box;
|
|
83
59
|
position: absolute;
|
|
84
|
-
top:
|
|
85
|
-
left:
|
|
86
|
-
|
|
60
|
+
top: ($govuk-touch-target-gutter / 2);
|
|
61
|
+
left: ($govuk-touch-target-gutter / 2);
|
|
87
62
|
width: $govuk-radios-size;
|
|
88
63
|
height: $govuk-radios-size;
|
|
89
|
-
|
|
90
64
|
border: $govuk-border-width-form-element solid currentcolor;
|
|
91
65
|
border-radius: 50%;
|
|
92
66
|
background: transparent;
|
|
@@ -96,17 +70,20 @@
|
|
|
96
70
|
//
|
|
97
71
|
// We create the 'button' entirely out of 'border' so that they remain
|
|
98
72
|
// 'filled' even when colours are overridden in the browser.
|
|
99
|
-
.govuk-radios__label
|
|
100
|
-
|
|
73
|
+
.govuk-radios__label::after {
|
|
74
|
+
$radio-button-size: govuk-spacing(2);
|
|
101
75
|
|
|
76
|
+
content: "";
|
|
102
77
|
position: absolute;
|
|
103
|
-
top: govuk-spacing(2);
|
|
104
|
-
left: govuk-spacing(2);
|
|
105
78
|
|
|
79
|
+
// Positioned by getting half the touch target, so we have the centre of the
|
|
80
|
+
// input, and then moving back by the button's border width, thus positioning
|
|
81
|
+
// the centre of the button in the centre of the input.
|
|
82
|
+
top: (($govuk-touch-target-size / 2) - $radio-button-size);
|
|
83
|
+
left: (($govuk-touch-target-size / 2) - $radio-button-size);
|
|
106
84
|
width: 0;
|
|
107
85
|
height: 0;
|
|
108
|
-
|
|
109
|
-
border: govuk-spacing(2) solid currentcolor;
|
|
86
|
+
border: $radio-button-size solid currentcolor;
|
|
110
87
|
border-radius: 50%;
|
|
111
88
|
opacity: 0;
|
|
112
89
|
background: currentcolor;
|
|
@@ -114,12 +91,21 @@
|
|
|
114
91
|
|
|
115
92
|
.govuk-radios__hint {
|
|
116
93
|
display: block;
|
|
94
|
+
width: 100%;
|
|
95
|
+
margin-top: govuk-spacing(-1);
|
|
117
96
|
padding-right: $govuk-radios-label-padding-left-right;
|
|
118
|
-
padding-left: $govuk-radios-label-padding-left-right;
|
|
97
|
+
padding-left: ($govuk-radios-label-padding-left-right + $govuk-touch-target-size);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// This is to bypass govuk-hint's specificity on hints following labels having
|
|
101
|
+
// a margin bottom of 10px (govuk-spacing(2)). Because radios are flexbox,
|
|
102
|
+
// the margin doesn't collapse so we have to do this manually.
|
|
103
|
+
.govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl) + .govuk-radios__hint {
|
|
104
|
+
margin-bottom: 0;
|
|
119
105
|
}
|
|
120
106
|
|
|
121
107
|
// Focused state
|
|
122
|
-
.govuk-radios__input:focus + .govuk-radios__label
|
|
108
|
+
.govuk-radios__input:focus + .govuk-radios__label::before {
|
|
123
109
|
border-width: 4px;
|
|
124
110
|
|
|
125
111
|
// When colours are overridden, the yellow box-shadow becomes invisible
|
|
@@ -139,7 +125,7 @@
|
|
|
139
125
|
}
|
|
140
126
|
|
|
141
127
|
// Selected state
|
|
142
|
-
.govuk-radios__input:checked + .govuk-radios__label
|
|
128
|
+
.govuk-radios__input:checked + .govuk-radios__label::after {
|
|
143
129
|
opacity: 1;
|
|
144
130
|
}
|
|
145
131
|
|
|
@@ -151,7 +137,7 @@
|
|
|
151
137
|
|
|
152
138
|
.govuk-radios__input:disabled + .govuk-radios__label,
|
|
153
139
|
.govuk-radios__input:disabled ~ .govuk-hint {
|
|
154
|
-
opacity: .5;
|
|
140
|
+
opacity: 0.5;
|
|
155
141
|
}
|
|
156
142
|
|
|
157
143
|
// =========================================================
|
|
@@ -159,13 +145,13 @@
|
|
|
159
145
|
// =========================================================
|
|
160
146
|
|
|
161
147
|
.govuk-radios--inline {
|
|
162
|
-
@include govuk-media-query
|
|
163
|
-
|
|
148
|
+
@include govuk-media-query($from: tablet) {
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-wrap: wrap;
|
|
151
|
+
align-items: flex-start;
|
|
164
152
|
|
|
165
153
|
.govuk-radios__item {
|
|
166
154
|
margin-right: govuk-spacing(4);
|
|
167
|
-
float: left;
|
|
168
|
-
clear: none;
|
|
169
155
|
}
|
|
170
156
|
}
|
|
171
157
|
}
|
|
@@ -175,9 +161,9 @@
|
|
|
175
161
|
// =========================================================
|
|
176
162
|
|
|
177
163
|
.govuk-radios__divider {
|
|
178
|
-
$govuk-divider-size: $govuk-radios-size !default;
|
|
179
164
|
@include govuk-font($size: 19);
|
|
180
165
|
@include govuk-text-colour;
|
|
166
|
+
$govuk-divider-size: $govuk-radios-size !default;
|
|
181
167
|
width: $govuk-divider-size;
|
|
182
168
|
margin-bottom: govuk-spacing(2);
|
|
183
169
|
text-align: center;
|
|
@@ -188,10 +174,11 @@
|
|
|
188
174
|
// =========================================================
|
|
189
175
|
|
|
190
176
|
// The narrow border is used in the conditional reveals because the border has
|
|
191
|
-
// to be an even number in order to be centred under the 40px checkbox
|
|
177
|
+
// to be an even number in order to be centred under the 40px checkbox radio.
|
|
192
178
|
$conditional-border-width: $govuk-border-width-narrow;
|
|
193
|
-
// Calculate the amount of padding needed to keep the border centered against
|
|
194
|
-
|
|
179
|
+
// Calculate the amount of padding needed to keep the border centered against
|
|
180
|
+
// the radios.
|
|
181
|
+
$conditional-border-padding: ($govuk-touch-target-size / 2) - ($conditional-border-width / 2);
|
|
195
182
|
// Move the border centered with the radios
|
|
196
183
|
$conditional-margin-left: $conditional-border-padding;
|
|
197
184
|
// Move the contents of the conditional inline with the label
|
|
@@ -203,7 +190,7 @@
|
|
|
203
190
|
padding-left: $conditional-padding-left;
|
|
204
191
|
border-left: $conditional-border-width solid $govuk-border-colour;
|
|
205
192
|
|
|
206
|
-
.
|
|
193
|
+
.govuk-frontend-supported &--hidden {
|
|
207
194
|
display: none;
|
|
208
195
|
}
|
|
209
196
|
|
|
@@ -217,16 +204,10 @@
|
|
|
217
204
|
// =========================================================
|
|
218
205
|
|
|
219
206
|
.govuk-radios--small {
|
|
220
|
-
|
|
221
207
|
$input-offset: ($govuk-touch-target-size - $govuk-small-radios-size) / 2;
|
|
222
|
-
$label-offset: $govuk-touch-target-size - $input-offset;
|
|
223
208
|
|
|
224
209
|
.govuk-radios__item {
|
|
225
|
-
@include govuk-clearfix;
|
|
226
|
-
min-height: 0;
|
|
227
210
|
margin-bottom: 0;
|
|
228
|
-
padding-left: $label-offset;
|
|
229
|
-
float: left;
|
|
230
211
|
}
|
|
231
212
|
|
|
232
213
|
// Shift the touch target into the left margin so that the visible edge of
|
|
@@ -239,36 +220,23 @@
|
|
|
239
220
|
// ▲┆└─ Radio pseudo element, aligned with margin
|
|
240
221
|
// └─── Touch target (invisible input), shifted into the margin
|
|
241
222
|
.govuk-radios__input {
|
|
242
|
-
|
|
243
|
-
left: $input-offset * -1;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
@include _govuk-if-ie8 {
|
|
247
|
-
margin-left: $govuk-small-radios-size * -1;
|
|
248
|
-
}
|
|
223
|
+
margin-left: $input-offset * -1;
|
|
249
224
|
}
|
|
250
225
|
|
|
251
|
-
// Adjust the size and position of the label.
|
|
252
|
-
//
|
|
253
|
-
// Unlike larger radios, we also have to float the label in order to
|
|
254
|
-
// 'shrink' it, preventing the hover state from kicking in across the full
|
|
255
|
-
// width of the parent element.
|
|
256
226
|
.govuk-radios__label {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
@include govuk-media-query($from: tablet) {
|
|
262
|
-
padding: 11px govuk-spacing(3) 10px 1px;
|
|
263
|
-
}
|
|
227
|
+
// Create a tiny space between the small radio hover state so that it
|
|
228
|
+
// doesn't clash with the label
|
|
229
|
+
padding-left: 1px;
|
|
264
230
|
}
|
|
265
231
|
|
|
266
232
|
// ( ) Radio ring
|
|
267
233
|
//
|
|
268
234
|
// Reduce the size of the control [1], vertically centering it within the
|
|
269
235
|
// touch target [2]
|
|
270
|
-
|
|
271
|
-
|
|
236
|
+
// Left here is 0 because we've shifted the input into the left margin
|
|
237
|
+
.govuk-radios__label::before {
|
|
238
|
+
top: $input-offset; // 2
|
|
239
|
+
left: 0;
|
|
272
240
|
width: $govuk-small-radios-size; // 1
|
|
273
241
|
height: $govuk-small-radios-size; // 1
|
|
274
242
|
}
|
|
@@ -276,10 +244,13 @@
|
|
|
276
244
|
// • Radio button
|
|
277
245
|
//
|
|
278
246
|
// Reduce the size of the 'button' and center it within the ring
|
|
279
|
-
.govuk-radios__label
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
border
|
|
247
|
+
.govuk-radios__label::after {
|
|
248
|
+
$radio-button-size: govuk-spacing(1);
|
|
249
|
+
|
|
250
|
+
// The same calculation as normal radio buttons but reduce the border width
|
|
251
|
+
top: (($govuk-touch-target-size / 2) - $radio-button-size);
|
|
252
|
+
left: ((($govuk-touch-target-size / 2) - $radio-button-size) - $input-offset);
|
|
253
|
+
border-width: $radio-button-size;
|
|
283
254
|
}
|
|
284
255
|
|
|
285
256
|
// Fix position of hint with small radios
|
|
@@ -291,17 +262,14 @@
|
|
|
291
262
|
// (If you do use them, they won't look completely broken... but seriously,
|
|
292
263
|
// don't use them)
|
|
293
264
|
.govuk-radios__hint {
|
|
294
|
-
padding:
|
|
295
|
-
clear: both;
|
|
296
|
-
pointer-events: none;
|
|
265
|
+
padding-left: ($govuk-small-radios-size + $input-offset);
|
|
297
266
|
}
|
|
298
267
|
|
|
299
268
|
// Align conditional reveals with small radios
|
|
300
269
|
.govuk-radios__conditional {
|
|
301
270
|
$margin-left: ($govuk-small-radios-size / 2) - ($conditional-border-width / 2);
|
|
302
271
|
margin-left: $margin-left;
|
|
303
|
-
padding-left: $
|
|
304
|
-
clear: both;
|
|
272
|
+
padding-left: ($govuk-touch-target-size - $input-offset) - ($margin-left + $conditional-border-width);
|
|
305
273
|
}
|
|
306
274
|
|
|
307
275
|
.govuk-radios__divider {
|
|
@@ -315,7 +283,11 @@
|
|
|
315
283
|
// is so much larger than their visible size, and so we need to provide
|
|
316
284
|
// feedback to the user as to which radio they will select when their
|
|
317
285
|
// cursor is outside of the visible area.
|
|
318
|
-
.govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label
|
|
286
|
+
.govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label::before {
|
|
287
|
+
// Forced colours modes tend to ignore box-shadow.
|
|
288
|
+
// Apply an outline for those modes to use instead.
|
|
289
|
+
outline: $govuk-radios-focus-width dashed transparent;
|
|
290
|
+
outline-offset: 1px;
|
|
319
291
|
box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;
|
|
320
292
|
}
|
|
321
293
|
|
|
@@ -324,10 +296,15 @@
|
|
|
324
296
|
//
|
|
325
297
|
// We use two box shadows, one that restores the original focus state [1]
|
|
326
298
|
// and another that then applies the hover state [2].
|
|
327
|
-
.govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label
|
|
299
|
+
.govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label::before {
|
|
300
|
+
// Set different HCM colour when we have both hover/focus applied at once
|
|
301
|
+
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
|
|
302
|
+
outline-color: Highlight;
|
|
303
|
+
}
|
|
304
|
+
// prettier-ignore
|
|
328
305
|
box-shadow:
|
|
329
|
-
0 0 0 $govuk-radios-focus-width $govuk-focus-colour
|
|
330
|
-
0 0 0 $govuk-hover-width
|
|
306
|
+
0 0 0 $govuk-radios-focus-width $govuk-focus-colour // 1,
|
|
307
|
+
0 0 0 $govuk-hover-width $govuk-hover-colour; // 2
|
|
331
308
|
}
|
|
332
309
|
|
|
333
310
|
// For devices that explicitly don't support hover, don't provide a hover
|
|
@@ -337,13 +314,15 @@
|
|
|
337
314
|
// state in browsers that don't support `@media (hover)` (like Internet
|
|
338
315
|
// Explorer) – so we have to 'undo' the hover state instead.
|
|
339
316
|
@media (hover: none), (pointer: coarse) {
|
|
340
|
-
.govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label
|
|
317
|
+
.govuk-radios__item:hover .govuk-radios__input:not(:disabled) + .govuk-radios__label::before {
|
|
341
318
|
box-shadow: initial;
|
|
342
319
|
}
|
|
343
320
|
|
|
344
|
-
.govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label
|
|
321
|
+
.govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label::before {
|
|
345
322
|
box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;
|
|
346
323
|
}
|
|
347
324
|
}
|
|
348
325
|
}
|
|
349
326
|
}
|
|
327
|
+
|
|
328
|
+
/*# sourceMappingURL=_index.scss.map */
|