defra_ruby_template 3.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +20 -0
- data/README.md +71 -0
- data/Rakefile +50 -0
- data/app/views/layouts/defra_ruby_template.html.erb +83 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/defra_ruby_template.gemspec +24 -0
- data/lib/defra_ruby_template.rb +23 -0
- data/lib/defra_ruby_template/version.rb +3 -0
- data/node_modules/govuk-frontend/README.md +91 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +14 -0
- data/node_modules/govuk-frontend/govuk/_base.scss +3 -0
- data/node_modules/govuk-frontend/govuk/all-ie8.scss +6 -0
- data/node_modules/govuk-frontend/govuk/all.js +2616 -0
- data/node_modules/govuk-frontend/govuk/all.scss +9 -0
- data/node_modules/govuk-frontend/govuk/assets/fonts/bold-affa96571d-v2.woff +0 -0
- data/node_modules/govuk-frontend/govuk/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
- data/node_modules/govuk-frontend/govuk/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
- data/node_modules/govuk-frontend/govuk/assets/fonts/light-f591b13f7d-v2.woff +0 -0
- 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 +7 -0
- data/node_modules/govuk-frontend/govuk/assets/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/govuk/common.js +39 -0
- data/node_modules/govuk-frontend/govuk/components/_all.scss +33 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +197 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +1011 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +250 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +76 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +27 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +99 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +62 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +32 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/template.njk +2 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +138 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +193 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +52 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +24 -0
- data/node_modules/govuk-frontend/govuk/components/button/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/button/_button.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +288 -0
- data/node_modules/govuk-frontend/govuk/components/button/button.js +724 -0
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +318 -0
- data/node_modules/govuk-frontend/govuk/components/button/macro-options.json +74 -0
- data/node_modules/govuk-frontend/govuk/components/button/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/button/template.njk +60 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +25 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1194 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +240 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +111 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/template.njk +37 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +320 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +1192 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +1189 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +161 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +119 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +443 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +73 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +549 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +117 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/template.njk +97 -0
- data/node_modules/govuk-frontend/govuk/components/details/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/details/_details.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +87 -0
- data/node_modules/govuk-frontend/govuk/components/details/details.js +828 -0
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +103 -0
- data/node_modules/govuk-frontend/govuk/components/details/implementation.md +43 -0
- data/node_modules/govuk-frontend/govuk/components/details/macro-options.json +50 -0
- data/node_modules/govuk-frontend/govuk/components/details/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/details/template.njk +10 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +11 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +77 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +38 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/template.njk +6 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +43 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +853 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +242 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/macro-options.json +70 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/template.njk +25 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +103 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +70 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +22 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +49 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +198 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/macro-options.json +73 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/template.njk +44 -0
- data/node_modules/govuk-frontend/govuk/components/footer/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_footer.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +241 -0
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +501 -0
- data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +118 -0
- data/node_modules/govuk-frontend/govuk/components/footer/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/footer/template.njk +87 -0
- data/node_modules/govuk-frontend/govuk/components/header/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/header/_header.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +331 -0
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +378 -0
- data/node_modules/govuk-frontend/govuk/components/header/header.js +1066 -0
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +106 -0
- data/node_modules/govuk-frontend/govuk/components/header/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +79 -0
- data/node_modules/govuk-frontend/govuk/components/hint/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/hint/_hint.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +44 -0
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +59 -0
- data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +32 -0
- data/node_modules/govuk-frontend/govuk/components/hint/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/hint/template.njk +4 -0
- data/node_modules/govuk-frontend/govuk/components/input/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +191 -0
- data/node_modules/govuk-frontend/govuk/components/input/_input.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +628 -0
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +167 -0
- data/node_modules/govuk-frontend/govuk/components/input/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/input/template.njk +65 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +58 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/macro-options.json +32 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/template.njk +4 -0
- data/node_modules/govuk-frontend/govuk/components/label/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/label/_index.scss +41 -0
- data/node_modules/govuk-frontend/govuk/components/label/_label.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +84 -0
- data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +38 -0
- data/node_modules/govuk-frontend/govuk/components/label/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/label/template.njk +15 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/_index.scss +89 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +212 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +68 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +61 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +47 -0
- data/node_modules/govuk-frontend/govuk/components/panel/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +44 -0
- data/node_modules/govuk-frontend/govuk/components/panel/_panel.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +91 -0
- data/node_modules/govuk-frontend/govuk/components/panel/macro-options.json +44 -0
- data/node_modules/govuk-frontend/govuk/components/panel/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/panel/template.njk +13 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +76 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/macro-options.json +33 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/template.njk +15 -0
- data/node_modules/govuk-frontend/govuk/components/radios/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +342 -0
- data/node_modules/govuk-frontend/govuk/components/radios/_radios.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +1183 -0
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +143 -0
- data/node_modules/govuk-frontend/govuk/components/radios/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/radios/radios.js +1148 -0
- data/node_modules/govuk-frontend/govuk/components/radios/template.njk +116 -0
- data/node_modules/govuk-frontend/govuk/components/select/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +49 -0
- data/node_modules/govuk-frontend/govuk/components/select/_select.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +327 -0
- data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +105 -0
- data/node_modules/govuk-frontend/govuk/components/select/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/select/template.njk +51 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +36 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +84 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/macro-options.json +32 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/template.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +145 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +1084 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +113 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/template.njk +47 -0
- data/node_modules/govuk-frontend/govuk/components/table/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +71 -0
- data/node_modules/govuk-frontend/govuk/components/table/_table.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +538 -0
- data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +132 -0
- data/node_modules/govuk-frontend/govuk/components/table/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/table/template.njk +45 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +130 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +286 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +84 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +1347 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/template.njk +32 -0
- data/node_modules/govuk-frontend/govuk/components/tag/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +86 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +131 -0
- data/node_modules/govuk-frontend/govuk/components/tag/macro-options.json +26 -0
- data/node_modules/govuk-frontend/govuk/components/tag/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/tag/template.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +47 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +250 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/macro-options.json +91 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/template.njk +45 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +66 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +73 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/macro-options.json +32 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/template.njk +9 -0
- data/node_modules/govuk-frontend/govuk/core/_all.scss +6 -0
- data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +25 -0
- data/node_modules/govuk-frontend/govuk/core/_links.scss +41 -0
- data/node_modules/govuk-frontend/govuk/core/_lists.scss +72 -0
- data/node_modules/govuk-frontend/govuk/core/_section-break.scss +62 -0
- data/node_modules/govuk-frontend/govuk/core/_template.scss +36 -0
- data/node_modules/govuk-frontend/govuk/core/_typography.scss +192 -0
- data/node_modules/govuk-frontend/govuk/helpers/_all.scss +12 -0
- data/node_modules/govuk-frontend/govuk/helpers/_clearfix.scss +15 -0
- data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +95 -0
- data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +37 -0
- data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +28 -0
- data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +41 -0
- data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +61 -0
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +427 -0
- data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +91 -0
- data/node_modules/govuk-frontend/govuk/helpers/_shape-arrow.scss +80 -0
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +153 -0
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +207 -0
- data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +84 -0
- data/node_modules/govuk-frontend/govuk/objects/_all.scss +5 -0
- data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +101 -0
- data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +23 -0
- data/node_modules/govuk-frontend/govuk/objects/_grid.scss +24 -0
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +68 -0
- data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +88 -0
- data/node_modules/govuk-frontend/govuk/overrides/_all.scss +4 -0
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +30 -0
- data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +64 -0
- data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +27 -0
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +52 -0
- data/node_modules/govuk-frontend/govuk/settings/_all.scss +23 -0
- data/node_modules/govuk-frontend/govuk/settings/_assets.scss +82 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +155 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +139 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +108 -0
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +74 -0
- data/node_modules/govuk-frontend/govuk/settings/_global-styles.scss +13 -0
- data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +18 -0
- data/node_modules/govuk-frontend/govuk/settings/_links.scss +62 -0
- data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +105 -0
- data/node_modules/govuk-frontend/govuk/settings/_media-queries.scss +23 -0
- data/node_modules/govuk-frontend/govuk/settings/_spacing.scss +80 -0
- data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +32 -0
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +89 -0
- data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +183 -0
- data/node_modules/govuk-frontend/govuk/template.njk +60 -0
- data/node_modules/govuk-frontend/govuk/tools/_all.scss +8 -0
- data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +36 -0
- data/node_modules/govuk-frontend/govuk/tools/_exports.scss +33 -0
- data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +25 -0
- data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +51 -0
- data/node_modules/govuk-frontend/govuk/tools/_iff.scss +17 -0
- data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +25 -0
- data/node_modules/govuk-frontend/govuk/tools/_px-to-em.scss +20 -0
- data/node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss +20 -0
- data/node_modules/govuk-frontend/govuk/utilities/_all.scss +2 -0
- data/node_modules/govuk-frontend/govuk/utilities/_clearfix.scss +5 -0
- data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +9 -0
- data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +347 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js +272 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js +34 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js +147 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js +589 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js +54 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js +31 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +254 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +254 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js +504 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js +252 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js +94 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js +28 -0
- data/node_modules/govuk-frontend/package.json +56 -0
- data/package-lock.json +13 -0
- data/package.json +29 -0
- data/vendor/assets/fonts/bold-affa96571d-v2.woff +0 -0
- data/vendor/assets/fonts/bold-b542beb274-v2.woff2 +0 -0
- data/vendor/assets/fonts/light-94a07e06a1-v2.woff2 +0 -0
- data/vendor/assets/fonts/light-f591b13f7d-v2.woff +0 -0
- data/vendor/assets/images/favicon.ico +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon-180x180.png +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon.png +0 -0
- data/vendor/assets/images/govuk-crest-2x.png +0 -0
- data/vendor/assets/images/govuk-crest.png +0 -0
- data/vendor/assets/images/govuk-logotype-crown.png +0 -0
- data/vendor/assets/images/govuk-mask-icon.svg +7 -0
- data/vendor/assets/images/govuk-opengraph-image.png +0 -0
- data/vendor/assets/javascripts/defra_ruby_template.js +2616 -0
- data/vendor/assets/stylesheets/_base.scss +3 -0
- data/vendor/assets/stylesheets/all-ie8.scss +6 -0
- data/vendor/assets/stylesheets/all.scss +9 -0
- data/vendor/assets/stylesheets/components/_all.scss +33 -0
- data/vendor/assets/stylesheets/components/accordion/_accordion.scss +2 -0
- data/vendor/assets/stylesheets/components/accordion/_index.scss +197 -0
- data/vendor/assets/stylesheets/components/back-link/_back-link.scss +2 -0
- data/vendor/assets/stylesheets/components/back-link/_index.scss +99 -0
- data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +2 -0
- data/vendor/assets/stylesheets/components/breadcrumbs/_index.scss +138 -0
- data/vendor/assets/stylesheets/components/button/_button.scss +2 -0
- data/vendor/assets/stylesheets/components/button/_index.scss +288 -0
- data/vendor/assets/stylesheets/components/character-count/_character-count.scss +2 -0
- data/vendor/assets/stylesheets/components/character-count/_index.scss +25 -0
- data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +2 -0
- data/vendor/assets/stylesheets/components/checkboxes/_index.scss +320 -0
- data/vendor/assets/stylesheets/components/cookie-banner/_cookie-banner.scss +2 -0
- data/vendor/assets/stylesheets/components/cookie-banner/_index.scss +51 -0
- data/vendor/assets/stylesheets/components/date-input/_date-input.scss +2 -0
- data/vendor/assets/stylesheets/components/date-input/_index.scss +26 -0
- data/vendor/assets/stylesheets/components/details/_details.scss +2 -0
- data/vendor/assets/stylesheets/components/details/_index.scss +87 -0
- data/vendor/assets/stylesheets/components/error-message/_error-message.scss +2 -0
- data/vendor/assets/stylesheets/components/error-message/_index.scss +11 -0
- data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +2 -0
- data/vendor/assets/stylesheets/components/error-summary/_index.scss +43 -0
- data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +2 -0
- data/vendor/assets/stylesheets/components/fieldset/_index.scss +64 -0
- data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +2 -0
- data/vendor/assets/stylesheets/components/file-upload/_index.scss +49 -0
- data/vendor/assets/stylesheets/components/footer/_footer.scss +2 -0
- data/vendor/assets/stylesheets/components/footer/_index.scss +241 -0
- data/vendor/assets/stylesheets/components/header/_header.scss +2 -0
- data/vendor/assets/stylesheets/components/header/_index.scss +331 -0
- data/vendor/assets/stylesheets/components/hint/_hint.scss +2 -0
- data/vendor/assets/stylesheets/components/hint/_index.scss +44 -0
- data/vendor/assets/stylesheets/components/input/_index.scss +191 -0
- data/vendor/assets/stylesheets/components/input/_input.scss +2 -0
- data/vendor/assets/stylesheets/components/inset-text/_index.scss +24 -0
- data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +2 -0
- data/vendor/assets/stylesheets/components/label/_index.scss +41 -0
- data/vendor/assets/stylesheets/components/label/_label.scss +2 -0
- data/vendor/assets/stylesheets/components/notification-banner/_index.scss +89 -0
- data/vendor/assets/stylesheets/components/notification-banner/_notification-banner.scss +2 -0
- data/vendor/assets/stylesheets/components/panel/_index.scss +44 -0
- data/vendor/assets/stylesheets/components/panel/_panel.scss +2 -0
- data/vendor/assets/stylesheets/components/phase-banner/_index.scss +27 -0
- data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +2 -0
- data/vendor/assets/stylesheets/components/radios/_index.scss +342 -0
- data/vendor/assets/stylesheets/components/radios/_radios.scss +2 -0
- data/vendor/assets/stylesheets/components/select/_index.scss +49 -0
- data/vendor/assets/stylesheets/components/select/_select.scss +2 -0
- data/vendor/assets/stylesheets/components/skip-link/_index.scss +36 -0
- data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +2 -0
- data/vendor/assets/stylesheets/components/summary-list/_index.scss +145 -0
- data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +2 -0
- data/vendor/assets/stylesheets/components/table/_index.scss +71 -0
- data/vendor/assets/stylesheets/components/table/_table.scss +2 -0
- data/vendor/assets/stylesheets/components/tabs/_index.scss +130 -0
- data/vendor/assets/stylesheets/components/tabs/_tabs.scss +2 -0
- data/vendor/assets/stylesheets/components/tag/_index.scss +86 -0
- data/vendor/assets/stylesheets/components/tag/_tag.scss +2 -0
- data/vendor/assets/stylesheets/components/textarea/_index.scss +47 -0
- data/vendor/assets/stylesheets/components/textarea/_textarea.scss +2 -0
- data/vendor/assets/stylesheets/components/warning-text/_index.scss +66 -0
- data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +2 -0
- data/vendor/assets/stylesheets/core/_all.scss +6 -0
- data/vendor/assets/stylesheets/core/_global-styles.scss +25 -0
- data/vendor/assets/stylesheets/core/_links.scss +41 -0
- data/vendor/assets/stylesheets/core/_lists.scss +72 -0
- data/vendor/assets/stylesheets/core/_section-break.scss +62 -0
- data/vendor/assets/stylesheets/core/_template.scss +36 -0
- data/vendor/assets/stylesheets/core/_typography.scss +192 -0
- data/vendor/assets/stylesheets/defra_ruby_template.scss +16 -0
- data/vendor/assets/stylesheets/helpers/_all.scss +12 -0
- data/vendor/assets/stylesheets/helpers/_clearfix.scss +15 -0
- data/vendor/assets/stylesheets/helpers/_colour.scss +95 -0
- data/vendor/assets/stylesheets/helpers/_device-pixels.scss +37 -0
- data/vendor/assets/stylesheets/helpers/_focused.scss +28 -0
- data/vendor/assets/stylesheets/helpers/_font-faces.scss +41 -0
- data/vendor/assets/stylesheets/helpers/_grid.scss +61 -0
- data/vendor/assets/stylesheets/helpers/_links.scss +427 -0
- data/vendor/assets/stylesheets/helpers/_media-queries.scss +91 -0
- data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +80 -0
- data/vendor/assets/stylesheets/helpers/_spacing.scss +153 -0
- data/vendor/assets/stylesheets/helpers/_typography.scss +207 -0
- data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +84 -0
- data/vendor/assets/stylesheets/objects/_all.scss +5 -0
- data/vendor/assets/stylesheets/objects/_button-group.scss +101 -0
- data/vendor/assets/stylesheets/objects/_form-group.scss +23 -0
- data/vendor/assets/stylesheets/objects/_grid.scss +24 -0
- data/vendor/assets/stylesheets/objects/_main-wrapper.scss +68 -0
- data/vendor/assets/stylesheets/objects/_width-container.scss +88 -0
- data/vendor/assets/stylesheets/overrides/_all.scss +4 -0
- data/vendor/assets/stylesheets/overrides/_display.scss +30 -0
- data/vendor/assets/stylesheets/overrides/_spacing.scss +64 -0
- data/vendor/assets/stylesheets/overrides/_typography.scss +27 -0
- data/vendor/assets/stylesheets/overrides/_width.scss +52 -0
- data/vendor/assets/stylesheets/settings/_all.scss +23 -0
- data/vendor/assets/stylesheets/settings/_assets.scss +82 -0
- data/vendor/assets/stylesheets/settings/_colours-applied.scss +155 -0
- data/vendor/assets/stylesheets/settings/_colours-organisations.scss +139 -0
- data/vendor/assets/stylesheets/settings/_colours-palette.scss +108 -0
- data/vendor/assets/stylesheets/settings/_compatibility.scss +74 -0
- data/vendor/assets/stylesheets/settings/_global-styles.scss +13 -0
- data/vendor/assets/stylesheets/settings/_ie8.scss +18 -0
- data/vendor/assets/stylesheets/settings/_links.scss +62 -0
- data/vendor/assets/stylesheets/settings/_measurements.scss +105 -0
- data/vendor/assets/stylesheets/settings/_media-queries.scss +23 -0
- data/vendor/assets/stylesheets/settings/_spacing.scss +80 -0
- data/vendor/assets/stylesheets/settings/_typography-font-families.scss +32 -0
- data/vendor/assets/stylesheets/settings/_typography-font.scss +89 -0
- data/vendor/assets/stylesheets/settings/_typography-responsive.scss +183 -0
- data/vendor/assets/stylesheets/tools/_all.scss +8 -0
- data/vendor/assets/stylesheets/tools/_compatibility.scss +36 -0
- data/vendor/assets/stylesheets/tools/_exports.scss +33 -0
- data/vendor/assets/stylesheets/tools/_font-url.scss +25 -0
- data/vendor/assets/stylesheets/tools/_ie8.scss +51 -0
- data/vendor/assets/stylesheets/tools/_iff.scss +17 -0
- data/vendor/assets/stylesheets/tools/_image-url.scss +25 -0
- data/vendor/assets/stylesheets/tools/_px-to-em.scss +20 -0
- data/vendor/assets/stylesheets/tools/_px-to-rem.scss +20 -0
- data/vendor/assets/stylesheets/utilities/_all.scss +2 -0
- data/vendor/assets/stylesheets/utilities/_clearfix.scss +5 -0
- data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +9 -0
- data/vendor/assets/stylesheets/vendor/_sass-mq.scss +347 -0
- metadata +520 -0
@@ -0,0 +1,272 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
|
3
|
+
typeof define === 'function' && define.amd ? define('GOVUKFrontend', factory) :
|
4
|
+
(factory());
|
5
|
+
}(this, (function () { 'use strict';
|
6
|
+
|
7
|
+
(function(undefined) {
|
8
|
+
|
9
|
+
// Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-service/master/packages/polyfill-library/polyfills/DOMTokenList/detect.js
|
10
|
+
var detect = (
|
11
|
+
'DOMTokenList' in this && (function (x) {
|
12
|
+
return 'classList' in x ? !x.classList.toggle('x', false) && !x.className : true;
|
13
|
+
})(document.createElement('x'))
|
14
|
+
);
|
15
|
+
|
16
|
+
if (detect) return
|
17
|
+
|
18
|
+
// Polyfill from https://raw.githubusercontent.com/Financial-Times/polyfill-service/master/packages/polyfill-library/polyfills/DOMTokenList/polyfill.js
|
19
|
+
(function (global) {
|
20
|
+
var nativeImpl = "DOMTokenList" in global && global.DOMTokenList;
|
21
|
+
|
22
|
+
if (
|
23
|
+
!nativeImpl ||
|
24
|
+
(
|
25
|
+
!!document.createElementNS &&
|
26
|
+
!!document.createElementNS('http://www.w3.org/2000/svg', 'svg') &&
|
27
|
+
!(document.createElementNS("http://www.w3.org/2000/svg", "svg").classList instanceof DOMTokenList)
|
28
|
+
)
|
29
|
+
) {
|
30
|
+
global.DOMTokenList = (function() { // eslint-disable-line no-unused-vars
|
31
|
+
var dpSupport = true;
|
32
|
+
var defineGetter = function (object, name, fn, configurable) {
|
33
|
+
if (Object.defineProperty)
|
34
|
+
Object.defineProperty(object, name, {
|
35
|
+
configurable: false === dpSupport ? true : !!configurable,
|
36
|
+
get: fn
|
37
|
+
});
|
38
|
+
|
39
|
+
else object.__defineGetter__(name, fn);
|
40
|
+
};
|
41
|
+
|
42
|
+
/** Ensure the browser allows Object.defineProperty to be used on native JavaScript objects. */
|
43
|
+
try {
|
44
|
+
defineGetter({}, "support");
|
45
|
+
}
|
46
|
+
catch (e) {
|
47
|
+
dpSupport = false;
|
48
|
+
}
|
49
|
+
|
50
|
+
|
51
|
+
var _DOMTokenList = function (el, prop) {
|
52
|
+
var that = this;
|
53
|
+
var tokens = [];
|
54
|
+
var tokenMap = {};
|
55
|
+
var length = 0;
|
56
|
+
var maxLength = 0;
|
57
|
+
var addIndexGetter = function (i) {
|
58
|
+
defineGetter(that, i, function () {
|
59
|
+
preop();
|
60
|
+
return tokens[i];
|
61
|
+
}, false);
|
62
|
+
|
63
|
+
};
|
64
|
+
var reindex = function () {
|
65
|
+
|
66
|
+
/** Define getter functions for array-like access to the tokenList's contents. */
|
67
|
+
if (length >= maxLength)
|
68
|
+
for (; maxLength < length; ++maxLength) {
|
69
|
+
addIndexGetter(maxLength);
|
70
|
+
}
|
71
|
+
};
|
72
|
+
|
73
|
+
/** Helper function called at the start of each class method. Internal use only. */
|
74
|
+
var preop = function () {
|
75
|
+
var error;
|
76
|
+
var i;
|
77
|
+
var args = arguments;
|
78
|
+
var rSpace = /\s+/;
|
79
|
+
|
80
|
+
/** Validate the token/s passed to an instance method, if any. */
|
81
|
+
if (args.length)
|
82
|
+
for (i = 0; i < args.length; ++i)
|
83
|
+
if (rSpace.test(args[i])) {
|
84
|
+
error = new SyntaxError('String "' + args[i] + '" ' + "contains" + ' an invalid character');
|
85
|
+
error.code = 5;
|
86
|
+
error.name = "InvalidCharacterError";
|
87
|
+
throw error;
|
88
|
+
}
|
89
|
+
|
90
|
+
|
91
|
+
/** Split the new value apart by whitespace*/
|
92
|
+
if (typeof el[prop] === "object") {
|
93
|
+
tokens = ("" + el[prop].baseVal).replace(/^\s+|\s+$/g, "").split(rSpace);
|
94
|
+
} else {
|
95
|
+
tokens = ("" + el[prop]).replace(/^\s+|\s+$/g, "").split(rSpace);
|
96
|
+
}
|
97
|
+
|
98
|
+
/** Avoid treating blank strings as single-item token lists */
|
99
|
+
if ("" === tokens[0]) tokens = [];
|
100
|
+
|
101
|
+
/** Repopulate the internal token lists */
|
102
|
+
tokenMap = {};
|
103
|
+
for (i = 0; i < tokens.length; ++i)
|
104
|
+
tokenMap[tokens[i]] = true;
|
105
|
+
length = tokens.length;
|
106
|
+
reindex();
|
107
|
+
};
|
108
|
+
|
109
|
+
/** Populate our internal token list if the targeted attribute of the subject element isn't empty. */
|
110
|
+
preop();
|
111
|
+
|
112
|
+
/** Return the number of tokens in the underlying string. Read-only. */
|
113
|
+
defineGetter(that, "length", function () {
|
114
|
+
preop();
|
115
|
+
return length;
|
116
|
+
});
|
117
|
+
|
118
|
+
/** Override the default toString/toLocaleString methods to return a space-delimited list of tokens when typecast. */
|
119
|
+
that.toLocaleString =
|
120
|
+
that.toString = function () {
|
121
|
+
preop();
|
122
|
+
return tokens.join(" ");
|
123
|
+
};
|
124
|
+
|
125
|
+
that.item = function (idx) {
|
126
|
+
preop();
|
127
|
+
return tokens[idx];
|
128
|
+
};
|
129
|
+
|
130
|
+
that.contains = function (token) {
|
131
|
+
preop();
|
132
|
+
return !!tokenMap[token];
|
133
|
+
};
|
134
|
+
|
135
|
+
that.add = function () {
|
136
|
+
preop.apply(that, args = arguments);
|
137
|
+
|
138
|
+
for (var args, token, i = 0, l = args.length; i < l; ++i) {
|
139
|
+
token = args[i];
|
140
|
+
if (!tokenMap[token]) {
|
141
|
+
tokens.push(token);
|
142
|
+
tokenMap[token] = true;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
/** Update the targeted attribute of the attached element if the token list's changed. */
|
147
|
+
if (length !== tokens.length) {
|
148
|
+
length = tokens.length >>> 0;
|
149
|
+
if (typeof el[prop] === "object") {
|
150
|
+
el[prop].baseVal = tokens.join(" ");
|
151
|
+
} else {
|
152
|
+
el[prop] = tokens.join(" ");
|
153
|
+
}
|
154
|
+
reindex();
|
155
|
+
}
|
156
|
+
};
|
157
|
+
|
158
|
+
that.remove = function () {
|
159
|
+
preop.apply(that, args = arguments);
|
160
|
+
|
161
|
+
/** Build a hash of token names to compare against when recollecting our token list. */
|
162
|
+
for (var args, ignore = {}, i = 0, t = []; i < args.length; ++i) {
|
163
|
+
ignore[args[i]] = true;
|
164
|
+
delete tokenMap[args[i]];
|
165
|
+
}
|
166
|
+
|
167
|
+
/** Run through our tokens list and reassign only those that aren't defined in the hash declared above. */
|
168
|
+
for (i = 0; i < tokens.length; ++i)
|
169
|
+
if (!ignore[tokens[i]]) t.push(tokens[i]);
|
170
|
+
|
171
|
+
tokens = t;
|
172
|
+
length = t.length >>> 0;
|
173
|
+
|
174
|
+
/** Update the targeted attribute of the attached element. */
|
175
|
+
if (typeof el[prop] === "object") {
|
176
|
+
el[prop].baseVal = tokens.join(" ");
|
177
|
+
} else {
|
178
|
+
el[prop] = tokens.join(" ");
|
179
|
+
}
|
180
|
+
reindex();
|
181
|
+
};
|
182
|
+
|
183
|
+
that.toggle = function (token, force) {
|
184
|
+
preop.apply(that, [token]);
|
185
|
+
|
186
|
+
/** Token state's being forced. */
|
187
|
+
if (undefined !== force) {
|
188
|
+
if (force) {
|
189
|
+
that.add(token);
|
190
|
+
return true;
|
191
|
+
} else {
|
192
|
+
that.remove(token);
|
193
|
+
return false;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
/** Token already exists in tokenList. Remove it, and return FALSE. */
|
198
|
+
if (tokenMap[token]) {
|
199
|
+
that.remove(token);
|
200
|
+
return false;
|
201
|
+
}
|
202
|
+
|
203
|
+
/** Otherwise, add the token and return TRUE. */
|
204
|
+
that.add(token);
|
205
|
+
return true;
|
206
|
+
};
|
207
|
+
|
208
|
+
return that;
|
209
|
+
};
|
210
|
+
|
211
|
+
return _DOMTokenList;
|
212
|
+
}());
|
213
|
+
}
|
214
|
+
|
215
|
+
// Add second argument to native DOMTokenList.toggle() if necessary
|
216
|
+
(function () {
|
217
|
+
var e = document.createElement('span');
|
218
|
+
if (!('classList' in e)) return;
|
219
|
+
e.classList.toggle('x', false);
|
220
|
+
if (!e.classList.contains('x')) return;
|
221
|
+
e.classList.constructor.prototype.toggle = function toggle(token /*, force*/) {
|
222
|
+
var force = arguments[1];
|
223
|
+
if (force === undefined) {
|
224
|
+
var add = !this.contains(token);
|
225
|
+
this[add ? 'add' : 'remove'](token);
|
226
|
+
return add;
|
227
|
+
}
|
228
|
+
force = !!force;
|
229
|
+
this[force ? 'add' : 'remove'](token);
|
230
|
+
return force;
|
231
|
+
};
|
232
|
+
}());
|
233
|
+
|
234
|
+
// Add multiple arguments to native DOMTokenList.add() if necessary
|
235
|
+
(function () {
|
236
|
+
var e = document.createElement('span');
|
237
|
+
if (!('classList' in e)) return;
|
238
|
+
e.classList.add('a', 'b');
|
239
|
+
if (e.classList.contains('b')) return;
|
240
|
+
var native = e.classList.constructor.prototype.add;
|
241
|
+
e.classList.constructor.prototype.add = function () {
|
242
|
+
var args = arguments;
|
243
|
+
var l = arguments.length;
|
244
|
+
for (var i = 0; i < l; i++) {
|
245
|
+
native.call(this, args[i]);
|
246
|
+
}
|
247
|
+
};
|
248
|
+
}());
|
249
|
+
|
250
|
+
// Add multiple arguments to native DOMTokenList.remove() if necessary
|
251
|
+
(function () {
|
252
|
+
var e = document.createElement('span');
|
253
|
+
if (!('classList' in e)) return;
|
254
|
+
e.classList.add('a');
|
255
|
+
e.classList.add('b');
|
256
|
+
e.classList.remove('a', 'b');
|
257
|
+
if (!e.classList.contains('b')) return;
|
258
|
+
var native = e.classList.constructor.prototype.remove;
|
259
|
+
e.classList.constructor.prototype.remove = function () {
|
260
|
+
var args = arguments;
|
261
|
+
var l = arguments.length;
|
262
|
+
for (var i = 0; i < l; i++) {
|
263
|
+
native.call(this, args[i]);
|
264
|
+
}
|
265
|
+
};
|
266
|
+
}());
|
267
|
+
|
268
|
+
}(this));
|
269
|
+
|
270
|
+
}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
271
|
+
|
272
|
+
})));
|
@@ -0,0 +1,34 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
|
3
|
+
typeof define === 'function' && define.amd ? define('GOVUKFrontend', factory) :
|
4
|
+
(factory());
|
5
|
+
}(this, (function () { 'use strict';
|
6
|
+
|
7
|
+
(function(undefined) {
|
8
|
+
|
9
|
+
// Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Document/detect.js
|
10
|
+
var detect = ("Document" in this);
|
11
|
+
|
12
|
+
if (detect) return
|
13
|
+
|
14
|
+
// Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Document&flags=always
|
15
|
+
if ((typeof WorkerGlobalScope === "undefined") && (typeof importScripts !== "function")) {
|
16
|
+
|
17
|
+
if (this.HTMLDocument) { // IE8
|
18
|
+
|
19
|
+
// HTMLDocument is an extension of Document. If the browser has HTMLDocument but not Document, the former will suffice as an alias for the latter.
|
20
|
+
this.Document = this.HTMLDocument;
|
21
|
+
|
22
|
+
} else {
|
23
|
+
|
24
|
+
// Create an empty function to act as the missing constructor for the document object, attach the document object as its prototype. The function needs to be anonymous else it is hoisted and causes the feature detect to prematurely pass, preventing the assignments below being made.
|
25
|
+
this.Document = this.HTMLDocument = document.constructor = (new Function('return function Document() {}')());
|
26
|
+
this.Document.prototype = document;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
|
31
|
+
})
|
32
|
+
.call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
33
|
+
|
34
|
+
})));
|
@@ -0,0 +1,147 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
|
3
|
+
typeof define === 'function' && define.amd ? define('GOVUKFrontend', factory) :
|
4
|
+
(factory());
|
5
|
+
}(this, (function () { 'use strict';
|
6
|
+
|
7
|
+
(function(undefined) {
|
8
|
+
|
9
|
+
// Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Document/detect.js
|
10
|
+
var detect = ("Document" in this);
|
11
|
+
|
12
|
+
if (detect) return
|
13
|
+
|
14
|
+
// Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Document&flags=always
|
15
|
+
if ((typeof WorkerGlobalScope === "undefined") && (typeof importScripts !== "function")) {
|
16
|
+
|
17
|
+
if (this.HTMLDocument) { // IE8
|
18
|
+
|
19
|
+
// HTMLDocument is an extension of Document. If the browser has HTMLDocument but not Document, the former will suffice as an alias for the latter.
|
20
|
+
this.Document = this.HTMLDocument;
|
21
|
+
|
22
|
+
} else {
|
23
|
+
|
24
|
+
// Create an empty function to act as the missing constructor for the document object, attach the document object as its prototype. The function needs to be anonymous else it is hoisted and causes the feature detect to prematurely pass, preventing the assignments below being made.
|
25
|
+
this.Document = this.HTMLDocument = document.constructor = (new Function('return function Document() {}')());
|
26
|
+
this.Document.prototype = document;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
|
31
|
+
})
|
32
|
+
.call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
33
|
+
|
34
|
+
(function(undefined) {
|
35
|
+
|
36
|
+
// Detection from https://github.com/Financial-Times/polyfill-service/blob/master/packages/polyfill-library/polyfills/Element/detect.js
|
37
|
+
var detect = ('Element' in this && 'HTMLElement' in this);
|
38
|
+
|
39
|
+
if (detect) return
|
40
|
+
|
41
|
+
// Polyfill from https://cdn.polyfill.io/v2/polyfill.js?features=Element&flags=always
|
42
|
+
(function () {
|
43
|
+
|
44
|
+
// IE8
|
45
|
+
if (window.Element && !window.HTMLElement) {
|
46
|
+
window.HTMLElement = window.Element;
|
47
|
+
return;
|
48
|
+
}
|
49
|
+
|
50
|
+
// create Element constructor
|
51
|
+
window.Element = window.HTMLElement = new Function('return function Element() {}')();
|
52
|
+
|
53
|
+
// generate sandboxed iframe
|
54
|
+
var vbody = document.appendChild(document.createElement('body'));
|
55
|
+
var frame = vbody.appendChild(document.createElement('iframe'));
|
56
|
+
|
57
|
+
// use sandboxed iframe to replicate Element functionality
|
58
|
+
var frameDocument = frame.contentWindow.document;
|
59
|
+
var prototype = Element.prototype = frameDocument.appendChild(frameDocument.createElement('*'));
|
60
|
+
var cache = {};
|
61
|
+
|
62
|
+
// polyfill Element.prototype on an element
|
63
|
+
var shiv = function (element, deep) {
|
64
|
+
var
|
65
|
+
childNodes = element.childNodes || [],
|
66
|
+
index = -1,
|
67
|
+
key, value, childNode;
|
68
|
+
|
69
|
+
if (element.nodeType === 1 && element.constructor !== Element) {
|
70
|
+
element.constructor = Element;
|
71
|
+
|
72
|
+
for (key in cache) {
|
73
|
+
value = cache[key];
|
74
|
+
element[key] = value;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
while (childNode = deep && childNodes[++index]) {
|
79
|
+
shiv(childNode, deep);
|
80
|
+
}
|
81
|
+
|
82
|
+
return element;
|
83
|
+
};
|
84
|
+
|
85
|
+
var elements = document.getElementsByTagName('*');
|
86
|
+
var nativeCreateElement = document.createElement;
|
87
|
+
var interval;
|
88
|
+
var loopLimit = 100;
|
89
|
+
|
90
|
+
prototype.attachEvent('onpropertychange', function (event) {
|
91
|
+
var
|
92
|
+
propertyName = event.propertyName,
|
93
|
+
nonValue = !cache.hasOwnProperty(propertyName),
|
94
|
+
newValue = prototype[propertyName],
|
95
|
+
oldValue = cache[propertyName],
|
96
|
+
index = -1,
|
97
|
+
element;
|
98
|
+
|
99
|
+
while (element = elements[++index]) {
|
100
|
+
if (element.nodeType === 1) {
|
101
|
+
if (nonValue || element[propertyName] === oldValue) {
|
102
|
+
element[propertyName] = newValue;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
cache[propertyName] = newValue;
|
108
|
+
});
|
109
|
+
|
110
|
+
prototype.constructor = Element;
|
111
|
+
|
112
|
+
if (!prototype.hasAttribute) {
|
113
|
+
// <Element>.hasAttribute
|
114
|
+
prototype.hasAttribute = function hasAttribute(name) {
|
115
|
+
return this.getAttribute(name) !== null;
|
116
|
+
};
|
117
|
+
}
|
118
|
+
|
119
|
+
// Apply Element prototype to the pre-existing DOM as soon as the body element appears.
|
120
|
+
function bodyCheck() {
|
121
|
+
if (!(loopLimit--)) clearTimeout(interval);
|
122
|
+
if (document.body && !document.body.prototype && /(complete|interactive)/.test(document.readyState)) {
|
123
|
+
shiv(document, true);
|
124
|
+
if (interval && document.body.prototype) clearTimeout(interval);
|
125
|
+
return (!!document.body.prototype);
|
126
|
+
}
|
127
|
+
return false;
|
128
|
+
}
|
129
|
+
if (!bodyCheck()) {
|
130
|
+
document.onreadystatechange = bodyCheck;
|
131
|
+
interval = setInterval(bodyCheck, 25);
|
132
|
+
}
|
133
|
+
|
134
|
+
// Apply to any new elements created after load
|
135
|
+
document.createElement = function createElement(nodeName) {
|
136
|
+
var element = nativeCreateElement(String(nodeName).toLowerCase());
|
137
|
+
return shiv(element);
|
138
|
+
};
|
139
|
+
|
140
|
+
// remove sandboxed iframe
|
141
|
+
document.removeChild(vbody);
|
142
|
+
}());
|
143
|
+
|
144
|
+
})
|
145
|
+
.call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
146
|
+
|
147
|
+
})));
|