govuk_tech_docs 3.4.5 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/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,397 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
3
|
-
typeof define === 'function' && define.amd ? define('GOVUKFrontend', ['exports'], factory) :
|
4
|
-
(factory((global.GOVUKFrontend = {})));
|
5
|
-
}(this, (function (exports) { 'use strict';
|
6
|
-
|
7
|
-
/**
|
8
|
-
* Internal support for selecting messages to render, with placeholder
|
9
|
-
* interpolation and locale-aware number formatting and pluralisation
|
10
|
-
*
|
11
|
-
* @class
|
12
|
-
* @private
|
13
|
-
* @param {Object<string, unknown>} translations - Key-value pairs of the translation strings to use.
|
14
|
-
* @param {object} [config] - Configuration options for the function.
|
15
|
-
* @param {string} [config.locale] - An overriding locale for the PluralRules functionality.
|
16
|
-
*/
|
17
|
-
function I18n (translations, config) {
|
18
|
-
// Make list of translations available throughout function
|
19
|
-
this.translations = translations || {};
|
20
|
-
|
21
|
-
// The locale to use for PluralRules and NumberFormat
|
22
|
-
this.locale = (config && config.locale) || document.documentElement.lang || 'en';
|
23
|
-
}
|
24
|
-
|
25
|
-
/**
|
26
|
-
* The most used function - takes the key for a given piece of UI text and
|
27
|
-
* returns the appropriate string.
|
28
|
-
*
|
29
|
-
* @param {string} lookupKey - The lookup key of the string to use.
|
30
|
-
* @param {Object<string, unknown>} [options] - Any options passed with the translation string, e.g: for string interpolation.
|
31
|
-
* @returns {string} The appropriate translation string.
|
32
|
-
* @throws {Error} Lookup key required
|
33
|
-
* @throws {Error} Options required for `${}` placeholders
|
34
|
-
*/
|
35
|
-
I18n.prototype.t = function (lookupKey, options) {
|
36
|
-
if (!lookupKey) {
|
37
|
-
// Print a console error if no lookup key has been provided
|
38
|
-
throw new Error('i18n: lookup key missing')
|
39
|
-
}
|
40
|
-
|
41
|
-
// If the `count` option is set, determine which plural suffix is needed and
|
42
|
-
// change the lookupKey to match. We check to see if it's numeric instead of
|
43
|
-
// falsy, as this could legitimately be 0.
|
44
|
-
if (options && typeof options.count === 'number') {
|
45
|
-
// Get the plural suffix
|
46
|
-
lookupKey = lookupKey + '.' + this.getPluralSuffix(lookupKey, options.count);
|
47
|
-
}
|
48
|
-
|
49
|
-
// Fetch the translation string for that lookup key
|
50
|
-
var translationString = this.translations[lookupKey];
|
51
|
-
|
52
|
-
if (typeof translationString === 'string') {
|
53
|
-
// Check for ${} placeholders in the translation string
|
54
|
-
if (translationString.match(/%{(.\S+)}/)) {
|
55
|
-
if (!options) {
|
56
|
-
throw new Error('i18n: cannot replace placeholders in string if no option data provided')
|
57
|
-
}
|
58
|
-
|
59
|
-
return this.replacePlaceholders(translationString, options)
|
60
|
-
} else {
|
61
|
-
return translationString
|
62
|
-
}
|
63
|
-
} else {
|
64
|
-
// If the key wasn't found in our translations object,
|
65
|
-
// return the lookup key itself as the fallback
|
66
|
-
return lookupKey
|
67
|
-
}
|
68
|
-
};
|
69
|
-
|
70
|
-
/**
|
71
|
-
* Takes a translation string with placeholders, and replaces the placeholders
|
72
|
-
* with the provided data
|
73
|
-
*
|
74
|
-
* @param {string} translationString - The translation string
|
75
|
-
* @param {Object<string, unknown>} options - Any options passed with the translation string, e.g: for string interpolation.
|
76
|
-
* @returns {string} The translation string to output, with ${} placeholders replaced
|
77
|
-
*/
|
78
|
-
I18n.prototype.replacePlaceholders = function (translationString, options) {
|
79
|
-
/** @type {Intl.NumberFormat | undefined} */
|
80
|
-
var formatter;
|
81
|
-
|
82
|
-
if (this.hasIntlNumberFormatSupport()) {
|
83
|
-
formatter = new Intl.NumberFormat(this.locale);
|
84
|
-
}
|
85
|
-
|
86
|
-
return translationString.replace(
|
87
|
-
/%{(.\S+)}/g,
|
88
|
-
|
89
|
-
/**
|
90
|
-
* Replace translation string placeholders
|
91
|
-
*
|
92
|
-
* @param {string} placeholderWithBraces - Placeholder with braces
|
93
|
-
* @param {string} placeholderKey - Placeholder key
|
94
|
-
* @returns {string} Placeholder value
|
95
|
-
*/
|
96
|
-
function (placeholderWithBraces, placeholderKey) {
|
97
|
-
if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {
|
98
|
-
var placeholderValue = options[placeholderKey];
|
99
|
-
|
100
|
-
// If a user has passed `false` as the value for the placeholder
|
101
|
-
// treat it as though the value should not be displayed
|
102
|
-
if (placeholderValue === false || (
|
103
|
-
typeof placeholderValue !== 'number' &&
|
104
|
-
typeof placeholderValue !== 'string')
|
105
|
-
) {
|
106
|
-
return ''
|
107
|
-
}
|
108
|
-
|
109
|
-
// If the placeholder's value is a number, localise the number formatting
|
110
|
-
if (typeof placeholderValue === 'number') {
|
111
|
-
return formatter ? formatter.format(placeholderValue) : placeholderValue.toString()
|
112
|
-
}
|
113
|
-
|
114
|
-
return placeholderValue
|
115
|
-
} else {
|
116
|
-
throw new Error('i18n: no data found to replace ' + placeholderWithBraces + ' placeholder in string')
|
117
|
-
}
|
118
|
-
})
|
119
|
-
};
|
120
|
-
|
121
|
-
/**
|
122
|
-
* Check to see if the browser supports Intl and Intl.PluralRules.
|
123
|
-
*
|
124
|
-
* It requires all conditions to be met in order to be supported:
|
125
|
-
* - The browser supports the Intl class (true in IE11)
|
126
|
-
* - The implementation of Intl supports PluralRules (NOT true in IE11)
|
127
|
-
* - The browser/OS has plural rules for the current locale (browser dependent)
|
128
|
-
*
|
129
|
-
* @returns {boolean} Returns true if all conditions are met. Returns false otherwise.
|
130
|
-
*/
|
131
|
-
I18n.prototype.hasIntlPluralRulesSupport = function () {
|
132
|
-
return Boolean(window.Intl && ('PluralRules' in window.Intl && Intl.PluralRules.supportedLocalesOf(this.locale).length))
|
133
|
-
};
|
134
|
-
|
135
|
-
/**
|
136
|
-
* Check to see if the browser supports Intl and Intl.NumberFormat.
|
137
|
-
*
|
138
|
-
* It requires all conditions to be met in order to be supported:
|
139
|
-
* - The browser supports the Intl class (true in IE11)
|
140
|
-
* - The implementation of Intl supports NumberFormat (also true in IE11)
|
141
|
-
* - The browser/OS has number formatting rules for the current locale (browser dependent)
|
142
|
-
*
|
143
|
-
* @returns {boolean} Returns true if all conditions are met. Returns false otherwise.
|
144
|
-
*/
|
145
|
-
I18n.prototype.hasIntlNumberFormatSupport = function () {
|
146
|
-
return Boolean(window.Intl && ('NumberFormat' in window.Intl && Intl.NumberFormat.supportedLocalesOf(this.locale).length))
|
147
|
-
};
|
148
|
-
|
149
|
-
/**
|
150
|
-
* Get the appropriate suffix for the plural form.
|
151
|
-
*
|
152
|
-
* Uses Intl.PluralRules (or our own fallback implementation) to get the
|
153
|
-
* 'preferred' form to use for the given count.
|
154
|
-
*
|
155
|
-
* Checks that a translation has been provided for that plural form – if it
|
156
|
-
* hasn't, it'll fall back to the 'other' plural form (unless that doesn't exist
|
157
|
-
* either, in which case an error will be thrown)
|
158
|
-
*
|
159
|
-
* @param {string} lookupKey - The lookup key of the string to use.
|
160
|
-
* @param {number} count - Number used to determine which pluralisation to use.
|
161
|
-
* @returns {PluralRule} The suffix associated with the correct pluralisation for this locale.
|
162
|
-
* @throws {Error} Plural form `.other` required when preferred plural form is missing
|
163
|
-
*/
|
164
|
-
I18n.prototype.getPluralSuffix = function (lookupKey, count) {
|
165
|
-
// Validate that the number is actually a number.
|
166
|
-
//
|
167
|
-
// Number(count) will turn anything that can't be converted to a Number type
|
168
|
-
// into 'NaN'. isFinite filters out NaN, as it isn't a finite number.
|
169
|
-
count = Number(count);
|
170
|
-
if (!isFinite(count)) { return 'other' }
|
171
|
-
|
172
|
-
var preferredForm;
|
173
|
-
|
174
|
-
// Check to verify that all the requirements for Intl.PluralRules are met.
|
175
|
-
// If so, we can use that instead of our custom implementation. Otherwise,
|
176
|
-
// use the hardcoded fallback.
|
177
|
-
if (this.hasIntlPluralRulesSupport()) {
|
178
|
-
preferredForm = new Intl.PluralRules(this.locale).select(count);
|
179
|
-
} else {
|
180
|
-
preferredForm = this.selectPluralFormUsingFallbackRules(count);
|
181
|
-
}
|
182
|
-
|
183
|
-
// Use the correct plural form if provided
|
184
|
-
if (lookupKey + '.' + preferredForm in this.translations) {
|
185
|
-
return preferredForm
|
186
|
-
// Fall back to `other` if the plural form is missing, but log a warning
|
187
|
-
// to the console
|
188
|
-
} else if (lookupKey + '.other' in this.translations) {
|
189
|
-
if (console && 'warn' in console) {
|
190
|
-
console.warn('i18n: Missing plural form ".' + preferredForm + '" for "' +
|
191
|
-
this.locale + '" locale. Falling back to ".other".');
|
192
|
-
}
|
193
|
-
|
194
|
-
return 'other'
|
195
|
-
// If the required `other` plural form is missing, all we can do is error
|
196
|
-
} else {
|
197
|
-
throw new Error(
|
198
|
-
'i18n: Plural form ".other" is required for "' + this.locale + '" locale'
|
199
|
-
)
|
200
|
-
}
|
201
|
-
};
|
202
|
-
|
203
|
-
/**
|
204
|
-
* Get the plural form using our fallback implementation
|
205
|
-
*
|
206
|
-
* This is split out into a separate function to make it easier to test the
|
207
|
-
* fallback behaviour in an environment where Intl.PluralRules exists.
|
208
|
-
*
|
209
|
-
* @param {number} count - Number used to determine which pluralisation to use.
|
210
|
-
* @returns {PluralRule} The pluralisation form for count in this locale.
|
211
|
-
*/
|
212
|
-
I18n.prototype.selectPluralFormUsingFallbackRules = function (count) {
|
213
|
-
// Currently our custom code can only handle positive integers, so let's
|
214
|
-
// make sure our number is one of those.
|
215
|
-
count = Math.abs(Math.floor(count));
|
216
|
-
|
217
|
-
var ruleset = this.getPluralRulesForLocale();
|
218
|
-
|
219
|
-
if (ruleset) {
|
220
|
-
return I18n.pluralRules[ruleset](count)
|
221
|
-
}
|
222
|
-
|
223
|
-
return 'other'
|
224
|
-
};
|
225
|
-
|
226
|
-
/**
|
227
|
-
* Work out which pluralisation rules to use for the current locale
|
228
|
-
*
|
229
|
-
* The locale may include a regional indicator (such as en-GB), but we don't
|
230
|
-
* usually care about this part, as pluralisation rules are usually the same
|
231
|
-
* regardless of region. There are exceptions, however, (e.g. Portuguese) so
|
232
|
-
* this searches by both the full and shortened locale codes, just to be sure.
|
233
|
-
*
|
234
|
-
* @returns {string | undefined} The name of the pluralisation rule to use (a key for one
|
235
|
-
* of the functions in this.pluralRules)
|
236
|
-
*/
|
237
|
-
I18n.prototype.getPluralRulesForLocale = function () {
|
238
|
-
var locale = this.locale;
|
239
|
-
var localeShort = locale.split('-')[0];
|
240
|
-
|
241
|
-
// Look through the plural rules map to find which `pluralRule` is
|
242
|
-
// appropriate for our current `locale`.
|
243
|
-
for (var pluralRule in I18n.pluralRulesMap) {
|
244
|
-
if (Object.prototype.hasOwnProperty.call(I18n.pluralRulesMap, pluralRule)) {
|
245
|
-
var languages = I18n.pluralRulesMap[pluralRule];
|
246
|
-
for (var i = 0; i < languages.length; i++) {
|
247
|
-
if (languages[i] === locale || languages[i] === localeShort) {
|
248
|
-
return pluralRule
|
249
|
-
}
|
250
|
-
}
|
251
|
-
}
|
252
|
-
}
|
253
|
-
};
|
254
|
-
|
255
|
-
/**
|
256
|
-
* Map of plural rules to languages where those rules apply.
|
257
|
-
*
|
258
|
-
* Note: These groups are named for the most dominant or recognisable language
|
259
|
-
* that uses each system. The groupings do not imply that the languages are
|
260
|
-
* related to one another. Many languages have evolved the same systems
|
261
|
-
* independently of one another.
|
262
|
-
*
|
263
|
-
* Code to support more languages can be found in the i18n spike:
|
264
|
-
* {@link https://github.com/alphagov/govuk-frontend/blob/spike-i18n-support/src/govuk/i18n.mjs}
|
265
|
-
*
|
266
|
-
* Languages currently supported:
|
267
|
-
*
|
268
|
-
* Arabic: Arabic (ar)
|
269
|
-
* Chinese: Burmese (my), Chinese (zh), Indonesian (id), Japanese (ja),
|
270
|
-
* Javanese (jv), Korean (ko), Malay (ms), Thai (th), Vietnamese (vi)
|
271
|
-
* French: Armenian (hy), Bangla (bn), French (fr), Gujarati (gu), Hindi (hi),
|
272
|
-
* Persian Farsi (fa), Punjabi (pa), Zulu (zu)
|
273
|
-
* German: Afrikaans (af), Albanian (sq), Azerbaijani (az), Basque (eu),
|
274
|
-
* Bulgarian (bg), Catalan (ca), Danish (da), Dutch (nl), English (en),
|
275
|
-
* Estonian (et), Finnish (fi), Georgian (ka), German (de), Greek (el),
|
276
|
-
* Hungarian (hu), Luxembourgish (lb), Norwegian (no), Somali (so),
|
277
|
-
* Swahili (sw), Swedish (sv), Tamil (ta), Telugu (te), Turkish (tr),
|
278
|
-
* Urdu (ur)
|
279
|
-
* Irish: Irish Gaelic (ga)
|
280
|
-
* Russian: Russian (ru), Ukrainian (uk)
|
281
|
-
* Scottish: Scottish Gaelic (gd)
|
282
|
-
* Spanish: European Portuguese (pt-PT), Italian (it), Spanish (es)
|
283
|
-
* Welsh: Welsh (cy)
|
284
|
-
*
|
285
|
-
* @type {Object<string, string[]>}
|
286
|
-
*/
|
287
|
-
I18n.pluralRulesMap = {
|
288
|
-
arabic: ['ar'],
|
289
|
-
chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
|
290
|
-
french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
|
291
|
-
german: [
|
292
|
-
'af', 'sq', 'az', 'eu', 'bg', 'ca', 'da', 'nl', 'en', 'et', 'fi', 'ka',
|
293
|
-
'de', 'el', 'hu', 'lb', 'no', 'so', 'sw', 'sv', 'ta', 'te', 'tr', 'ur'
|
294
|
-
],
|
295
|
-
irish: ['ga'],
|
296
|
-
russian: ['ru', 'uk'],
|
297
|
-
scottish: ['gd'],
|
298
|
-
spanish: ['pt-PT', 'it', 'es'],
|
299
|
-
welsh: ['cy']
|
300
|
-
};
|
301
|
-
|
302
|
-
/**
|
303
|
-
* Different pluralisation rule sets
|
304
|
-
*
|
305
|
-
* Returns the appropriate suffix for the plural form associated with `n`.
|
306
|
-
* Possible suffixes: 'zero', 'one', 'two', 'few', 'many', 'other' (the actual
|
307
|
-
* meaning of each differs per locale). 'other' should always exist, even in
|
308
|
-
* languages without plurals, such as Chinese.
|
309
|
-
* {@link https://cldr.unicode.org/index/cldr-spec/plural-rules}
|
310
|
-
*
|
311
|
-
* The count must be a positive integer. Negative numbers and decimals aren't accounted for
|
312
|
-
*
|
313
|
-
* @type {Object<string, function(number): PluralRule>}
|
314
|
-
*/
|
315
|
-
I18n.pluralRules = {
|
316
|
-
/* eslint-disable jsdoc/require-jsdoc */
|
317
|
-
arabic: function (n) {
|
318
|
-
if (n === 0) { return 'zero' }
|
319
|
-
if (n === 1) { return 'one' }
|
320
|
-
if (n === 2) { return 'two' }
|
321
|
-
if (n % 100 >= 3 && n % 100 <= 10) { return 'few' }
|
322
|
-
if (n % 100 >= 11 && n % 100 <= 99) { return 'many' }
|
323
|
-
return 'other'
|
324
|
-
},
|
325
|
-
chinese: function () {
|
326
|
-
return 'other'
|
327
|
-
},
|
328
|
-
french: function (n) {
|
329
|
-
return n === 0 || n === 1 ? 'one' : 'other'
|
330
|
-
},
|
331
|
-
german: function (n) {
|
332
|
-
return n === 1 ? 'one' : 'other'
|
333
|
-
},
|
334
|
-
irish: function (n) {
|
335
|
-
if (n === 1) { return 'one' }
|
336
|
-
if (n === 2) { return 'two' }
|
337
|
-
if (n >= 3 && n <= 6) { return 'few' }
|
338
|
-
if (n >= 7 && n <= 10) { return 'many' }
|
339
|
-
return 'other'
|
340
|
-
},
|
341
|
-
russian: function (n) {
|
342
|
-
var lastTwo = n % 100;
|
343
|
-
var last = lastTwo % 10;
|
344
|
-
if (last === 1 && lastTwo !== 11) { return 'one' }
|
345
|
-
if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) { return 'few' }
|
346
|
-
if (last === 0 || (last >= 5 && last <= 9) || (lastTwo >= 11 && lastTwo <= 14)) { return 'many' }
|
347
|
-
// Note: The 'other' suffix is only used by decimal numbers in Russian.
|
348
|
-
// We don't anticipate it being used, but it's here for consistency.
|
349
|
-
return 'other'
|
350
|
-
},
|
351
|
-
scottish: function (n) {
|
352
|
-
if (n === 1 || n === 11) { return 'one' }
|
353
|
-
if (n === 2 || n === 12) { return 'two' }
|
354
|
-
if ((n >= 3 && n <= 10) || (n >= 13 && n <= 19)) { return 'few' }
|
355
|
-
return 'other'
|
356
|
-
},
|
357
|
-
spanish: function (n) {
|
358
|
-
if (n === 1) { return 'one' }
|
359
|
-
if (n % 1000000 === 0 && n !== 0) { return 'many' }
|
360
|
-
return 'other'
|
361
|
-
},
|
362
|
-
welsh: function (n) {
|
363
|
-
if (n === 0) { return 'zero' }
|
364
|
-
if (n === 1) { return 'one' }
|
365
|
-
if (n === 2) { return 'two' }
|
366
|
-
if (n === 3) { return 'few' }
|
367
|
-
if (n === 6) { return 'many' }
|
368
|
-
return 'other'
|
369
|
-
}
|
370
|
-
/* eslint-enable jsdoc/require-jsdoc */
|
371
|
-
};
|
372
|
-
|
373
|
-
/**
|
374
|
-
* Plural rule category mnemonic tags
|
375
|
-
*
|
376
|
-
* @typedef {'zero' | 'one' | 'two' | 'few' | 'many' | 'other'} PluralRule
|
377
|
-
*/
|
378
|
-
|
379
|
-
/**
|
380
|
-
* Translated message by plural rule they correspond to.
|
381
|
-
*
|
382
|
-
* Allows to group pluralised messages under a single key when passing
|
383
|
-
* translations to a component's constructor
|
384
|
-
*
|
385
|
-
* @typedef {object} TranslationPluralForms
|
386
|
-
* @property {string} [other] - General plural form
|
387
|
-
* @property {string} [zero] - Plural form used with 0
|
388
|
-
* @property {string} [one] - Plural form used with 1
|
389
|
-
* @property {string} [two] - Plural form used with 2
|
390
|
-
* @property {string} [few] - Plural form used for a few
|
391
|
-
* @property {string} [many] - Plural form used for many
|
392
|
-
*/
|
393
|
-
|
394
|
-
exports.I18n = I18n;
|
395
|
-
|
396
|
-
})));
|
397
|
-
//# sourceMappingURL=i18n.js.map
|
@@ -1,21 +0,0 @@
|
|
1
|
-
@include govuk-exports("govuk/overrides/typography") {
|
2
|
-
// Font size and line height
|
3
|
-
|
4
|
-
// Generate typography override classes for each responsive font map in the
|
5
|
-
// typography scale eg .govuk-\!-font-size-80
|
6
|
-
@each $size in map-keys($govuk-typography-scale) {
|
7
|
-
.govuk-\!-font-size-#{$size} {
|
8
|
-
@include govuk-typography-responsive($size, $important: true);
|
9
|
-
}
|
10
|
-
}
|
11
|
-
|
12
|
-
// Weights
|
13
|
-
|
14
|
-
.govuk-\!-font-weight-regular {
|
15
|
-
@include govuk-typography-weight-regular($important: true);
|
16
|
-
}
|
17
|
-
|
18
|
-
.govuk-\!-font-weight-bold {
|
19
|
-
@include govuk-typography-weight-bold($important: true);
|
20
|
-
}
|
21
|
-
}
|
@@ -1,146 +0,0 @@
|
|
1
|
-
////
|
2
|
-
/// @group settings/colours
|
3
|
-
////
|
4
|
-
|
5
|
-
/// Organisation colours
|
6
|
-
///
|
7
|
-
/// @type Map
|
8
|
-
///
|
9
|
-
/// @prop $organisation.colour - Colour for the given `$organisation`
|
10
|
-
/// @prop $organisation.colour-websafe - Websafe colour for the given
|
11
|
-
/// `$organisation`. We use `websafe` to mean strong enough contrast against
|
12
|
-
/// white to be used for copy and meet the AAA (large text) and AA (smaller
|
13
|
-
/// copy) WCAG guidelines.
|
14
|
-
///
|
15
|
-
/// @access public
|
16
|
-
|
17
|
-
$govuk-colours-organisations: (
|
18
|
-
"attorney-generals-office": (
|
19
|
-
colour: #9f1888,
|
20
|
-
colour-websafe: #a03a88
|
21
|
-
),
|
22
|
-
"cabinet-office": (
|
23
|
-
colour: #005abb,
|
24
|
-
colour-websafe: #347da4
|
25
|
-
),
|
26
|
-
"civil-service": (
|
27
|
-
colour: #af292e
|
28
|
-
),
|
29
|
-
"department-for-business-innovation-skills": (
|
30
|
-
colour: #003479,
|
31
|
-
colour-websafe: #347da4
|
32
|
-
),
|
33
|
-
"department-for-communities-and-local-government": (
|
34
|
-
colour: #009999,
|
35
|
-
colour-websafe: #37836e
|
36
|
-
),
|
37
|
-
"department-for-culture-media-sport": (
|
38
|
-
colour: #d40072,
|
39
|
-
colour-websafe: #a03155
|
40
|
-
),
|
41
|
-
"department-for-education": (
|
42
|
-
colour: #003a69,
|
43
|
-
colour-websafe: #347ca9
|
44
|
-
),
|
45
|
-
"department-for-environment-food-rural-affairs": (
|
46
|
-
colour: #00a33b,
|
47
|
-
colour-websafe: #008938
|
48
|
-
),
|
49
|
-
"department-for-international-development": (
|
50
|
-
colour: #002878,
|
51
|
-
colour-websafe: #405e9a
|
52
|
-
),
|
53
|
-
"department-for-international-trade": (
|
54
|
-
colour: #cf102d,
|
55
|
-
colour-websafe: #005ea5
|
56
|
-
),
|
57
|
-
"department-for-business-and-trade": (
|
58
|
-
colour: #cf102d,
|
59
|
-
colour-websafe: #005ea5
|
60
|
-
),
|
61
|
-
"department-for-levelling-up-housing-and-communities": (
|
62
|
-
colour: #012169,
|
63
|
-
),
|
64
|
-
"department-for-transport": (
|
65
|
-
colour: #006c56,
|
66
|
-
colour-websafe: #398373
|
67
|
-
),
|
68
|
-
"department-for-work-pensions": (
|
69
|
-
colour: #00beb7,
|
70
|
-
colour-websafe: #37807b
|
71
|
-
),
|
72
|
-
"department-of-energy-climate-change": (
|
73
|
-
colour: #009ddb,
|
74
|
-
colour-websafe: #2b7cac
|
75
|
-
),
|
76
|
-
"department-of-health": (
|
77
|
-
colour: #00ad93,
|
78
|
-
colour-websafe: #39836e
|
79
|
-
),
|
80
|
-
"foreign-commonwealth-development-office": (
|
81
|
-
colour: #012169
|
82
|
-
),
|
83
|
-
"foreign-commonwealth-office": (
|
84
|
-
colour: #003e74,
|
85
|
-
colour-websafe: #406e97
|
86
|
-
),
|
87
|
-
"government-equalities-office": (
|
88
|
-
colour: #9325b2
|
89
|
-
),
|
90
|
-
"hm-government": (
|
91
|
-
colour: #0076c0,
|
92
|
-
colour-websafe: #347da4
|
93
|
-
),
|
94
|
-
"hm-revenue-customs": (
|
95
|
-
colour: #009390,
|
96
|
-
colour-websafe: #008670
|
97
|
-
),
|
98
|
-
"hm-treasury": (
|
99
|
-
colour: #af292e,
|
100
|
-
colour-websafe: #832322
|
101
|
-
),
|
102
|
-
"home-office": (
|
103
|
-
colour: #9325b2,
|
104
|
-
colour-websafe: #9440b2
|
105
|
-
),
|
106
|
-
"ministry-of-defence": (
|
107
|
-
colour: #4d2942,
|
108
|
-
colour-websafe: #5a5c92
|
109
|
-
),
|
110
|
-
"ministry-of-justice": (
|
111
|
-
colour: #231f20,
|
112
|
-
colour-websafe: #5a5c92
|
113
|
-
),
|
114
|
-
"northern-ireland-office": (
|
115
|
-
colour: #002663,
|
116
|
-
colour-websafe: #3e598c
|
117
|
-
),
|
118
|
-
"office-of-the-advocate-general-for-scotland": (
|
119
|
-
colour: #002663,
|
120
|
-
colour-websafe: #005ea5
|
121
|
-
),
|
122
|
-
"office-of-the-leader-of-the-house-of-commons": (
|
123
|
-
colour: #317023,
|
124
|
-
colour-websafe: #005f8f
|
125
|
-
),
|
126
|
-
"office-of-the-leader-of-the-house-of-lords": (
|
127
|
-
colour: #9c132e,
|
128
|
-
colour-websafe: #c2395d
|
129
|
-
),
|
130
|
-
"scotland-office": (
|
131
|
-
colour: #002663,
|
132
|
-
colour-websafe: #405c8a
|
133
|
-
),
|
134
|
-
"uk-export-finance": (
|
135
|
-
colour: #005747,
|
136
|
-
colour-websafe: #005ea5
|
137
|
-
),
|
138
|
-
"uk-trade-investment": (
|
139
|
-
colour: #c80651,
|
140
|
-
colour-websafe: #005ea5
|
141
|
-
),
|
142
|
-
"wales-office": (
|
143
|
-
colour: #a33038,
|
144
|
-
colour-websafe: #7a242a
|
145
|
-
)
|
146
|
-
) !default;
|
@@ -1,120 +0,0 @@
|
|
1
|
-
@import "compatibility";
|
2
|
-
|
3
|
-
// stylelint-disable value-list-max-empty-lines -- allow empty lines in lists
|
4
|
-
// in this file to allow grouping
|
5
|
-
|
6
|
-
////
|
7
|
-
/// @group settings/colours
|
8
|
-
////
|
9
|
-
|
10
|
-
/// Use 'legacy' colour palette
|
11
|
-
///
|
12
|
-
/// Whether or not to use the colour palette from GOV.UK Elements / Frontend
|
13
|
-
/// Toolkit, for teams that are migrating to GOV.UK Frontend and may be using
|
14
|
-
/// components from both places in a single application.
|
15
|
-
///
|
16
|
-
/// @type Boolean
|
17
|
-
/// @access public
|
18
|
-
/// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
|
19
|
-
/// suite of tools and settings
|
20
|
-
|
21
|
-
$govuk-use-legacy-palette: if(
|
22
|
-
(
|
23
|
-
$govuk-compatibility-govukfrontendtoolkit or
|
24
|
-
$govuk-compatibility-govuktemplate or
|
25
|
-
$govuk-compatibility-govukelements
|
26
|
-
),
|
27
|
-
true,
|
28
|
-
false
|
29
|
-
) !default;
|
30
|
-
|
31
|
-
// Only show the deprecation warning if user is setting $govuk-use-legacy-palette
|
32
|
-
// manually instead of automatically via compatibility variables
|
33
|
-
@if $govuk-use-legacy-palette == true and
|
34
|
-
$govuk-compatibility-govukfrontendtoolkit == false and
|
35
|
-
$govuk-compatibility-govuktemplate == false and
|
36
|
-
$govuk-compatibility-govukelements == false {
|
37
|
-
@include _warning(legacy-palette, "$govuk-use-legacy-palette is deprecated. " +
|
38
|
-
"Only the modern colour palette will be supported from v5.0.");
|
39
|
-
}
|
40
|
-
|
41
|
-
/// Modern colour palette
|
42
|
-
///
|
43
|
-
/// This exists only because you cannot easily set a !default variable
|
44
|
-
/// conditionally (thanks to the way scope works in Sass) so we set
|
45
|
-
/// `$govuk-colour-palette` using the `if` function.
|
46
|
-
///
|
47
|
-
/// @access private
|
48
|
-
|
49
|
-
$_govuk-colour-palette-modern: (
|
50
|
-
"red": #d4351c,
|
51
|
-
"yellow": #ffdd00,
|
52
|
-
"green": #00703c,
|
53
|
-
"blue": #1d70b8,
|
54
|
-
"dark-blue": #003078,
|
55
|
-
"light-blue": #5694ca,
|
56
|
-
"purple": #4c2c92,
|
57
|
-
|
58
|
-
"black": #0b0c0c,
|
59
|
-
"dark-grey": #505a5f,
|
60
|
-
"mid-grey": #b1b4b6,
|
61
|
-
"light-grey": #f3f2f1,
|
62
|
-
"white": #ffffff,
|
63
|
-
|
64
|
-
"light-purple": #6f72af,
|
65
|
-
"bright-purple": #912b88,
|
66
|
-
"pink": #d53880,
|
67
|
-
"light-pink": #f499be,
|
68
|
-
"orange": #f47738,
|
69
|
-
"brown": #b58840,
|
70
|
-
"light-green": #85994b,
|
71
|
-
"turquoise": #28a197
|
72
|
-
);
|
73
|
-
|
74
|
-
/// Legacy colour palette
|
75
|
-
///
|
76
|
-
/// This exists only because you cannot easily set a !default variable
|
77
|
-
/// conditionally (thanks to the way scope works in Sass) so we set
|
78
|
-
/// `$govuk-colour-palette` using the `if` function.
|
79
|
-
///
|
80
|
-
/// @access private
|
81
|
-
|
82
|
-
$_govuk-colour-palette-legacy: (
|
83
|
-
"purple": #2e358b,
|
84
|
-
"light-purple": #6f72af,
|
85
|
-
"bright-purple": #912b88,
|
86
|
-
"pink": #d53880,
|
87
|
-
"light-pink": #f499be,
|
88
|
-
"red": #b10e1e,
|
89
|
-
"bright-red": #df3034,
|
90
|
-
"orange": #f47738,
|
91
|
-
"brown": #b58840,
|
92
|
-
"yellow": #ffbf47,
|
93
|
-
"light-green": #85994b,
|
94
|
-
"green": #006435,
|
95
|
-
"turquoise": #28a197,
|
96
|
-
"light-blue": #2b8cc4,
|
97
|
-
"blue": #005ea5,
|
98
|
-
|
99
|
-
"black": #0b0c0c,
|
100
|
-
"grey-1": #6f777b,
|
101
|
-
"grey-2": #bfc1c3,
|
102
|
-
"grey-3": #dee0e2,
|
103
|
-
"grey-4": #f8f8f8,
|
104
|
-
"white": #ffffff
|
105
|
-
);
|
106
|
-
|
107
|
-
/// Colour palette
|
108
|
-
///
|
109
|
-
/// @type Map
|
110
|
-
///
|
111
|
-
/// @prop $colour - Representation for the given $colour, where $colour is the
|
112
|
-
/// friendly name for the colour (e.g. "red": #ff0000);
|
113
|
-
///
|
114
|
-
/// @access public
|
115
|
-
|
116
|
-
$govuk-colours: if(
|
117
|
-
$govuk-use-legacy-palette,
|
118
|
-
$_govuk-colour-palette-legacy,
|
119
|
-
$_govuk-colour-palette-modern
|
120
|
-
) !default;
|