govuk_publishing_components 17.21.0 → 18.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/all_components.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/radio.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +1 -1
- data/app/assets/stylesheets/component_guide/application.scss +5 -7
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +5 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +3 -15
- data/app/assets/stylesheets/govuk_publishing_components/components/_character-count.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +28 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/_date-input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-message.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +1 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_file-upload.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_hint.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +18 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_label.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +6 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +8 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +6 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +10 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +17 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +8 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +5 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_govuk-frontend-settings.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +4 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +1 -1
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +14 -12
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_button.html.erb +16 -2
- data/app/views/govuk_publishing_components/components/_character_count.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +5 -1
- data/app/views/govuk_publishing_components/components/_details.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_error_summary.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_tabs.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_textarea.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_title.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/button.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/contents_list.yml +12 -0
- data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/fieldset.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/label.yml +4 -1
- data/app/views/govuk_publishing_components/components/docs/table.yml +1 -0
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +2 -2
- data/config/initializers/assets.rb +3 -3
- data/config/locales/en.yml +0 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/README.md +4 -9
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +4 -5
- data/node_modules/govuk-frontend/{all-ie8.scss → govuk/all-ie8.scss} +0 -0
- data/node_modules/govuk-frontend/{all.js → govuk/all.js} +116 -63
- data/node_modules/govuk-frontend/{all.scss → govuk/all.scss} +0 -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/{assets → govuk/assets}/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon-152x152.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon-167x167.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon-180x180.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-apple-touch-icon.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-crest-2x.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-crest.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-logotype-crown.png +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-mask-icon.svg +0 -0
- data/node_modules/govuk-frontend/{assets → govuk/assets}/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/{common.js → govuk/common.js} +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/_accordion.scss +48 -28
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/accordion.js +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/macro-options.json +8 -2
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/accordion/template.njk +1 -3
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/_back-link.scss +17 -9
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/back-link/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/_breadcrumbs.scss +10 -11
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/breadcrumbs/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/button/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/button/_button.scss +76 -46
- data/node_modules/govuk-frontend/{components → govuk/components}/button/button.js +168 -17
- data/node_modules/govuk-frontend/{components → govuk/components}/button/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/button/macro.njk +0 -0
- data/node_modules/govuk-frontend/govuk/components/button/template.njk +60 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/_character-count.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/character-count.js +5 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/character-count/template.njk +2 -2
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/_checkboxes.scss +4 -6
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/checkboxes.js +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/checkboxes/template.njk +18 -5
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/_date-input.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/date-input/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/details/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/details/_details.scss +12 -13
- data/node_modules/govuk-frontend/{components → govuk/components}/details/details.js +3 -4
- data/node_modules/govuk-frontend/{components → govuk/components}/details/implementation.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/details/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/details/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/details/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/_error-message.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-message/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/_error-summary.scss +4 -17
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/error-summary.js +0 -10
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/error-summary/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/_fieldset.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/macro-options.json +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/fieldset/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/README.md +0 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +81 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/file-upload/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/_footer.scss +47 -16
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/macro-options.json +5 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/footer/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/header/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/header/_header.scss +34 -21
- data/node_modules/govuk-frontend/{components → govuk/components}/header/header.js +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/header/macro-options.json +2 -2
- data/node_modules/govuk-frontend/{components → govuk/components}/header/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/header/template.njk +6 -9
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/_hint.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/hint/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/input/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/input/_input.scss +24 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/input/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/input/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/input/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/_inset-text.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/inset-text/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/_label.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/label/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/_panel.scss +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/panel/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/_phase-banner.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/phase-banner/template.njk +5 -7
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/_radios.scss +7 -9
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/radios.js +24 -11
- data/node_modules/govuk-frontend/{components → govuk/components}/radios/template.njk +15 -5
- data/node_modules/govuk-frontend/{components → govuk/components}/select/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/select/_select.scss +23 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/select/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/select/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/select/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/_skip-link.scss +6 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/skip-link/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/_summary-list.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/macro-options.json +7 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/summary-list/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/table/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/table/_table.scss +1 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/table/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/table/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/table/template.njk +14 -14
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/README.md +0 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +142 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/tabs.js +59 -5
- data/node_modules/govuk-frontend/{components → govuk/components}/tabs/template.njk +4 -6
- data/node_modules/govuk-frontend/{components → govuk/components}/tag/README.md +0 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +44 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tag/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tag/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/tag/template.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/textarea/README.md +0 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +55 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/textarea/macro-options.json +6 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/textarea/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/textarea/template.njk +1 -1
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/README.md +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/_warning-text.scss +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/macro-options.json +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/macro.njk +0 -0
- data/node_modules/govuk-frontend/{components → govuk/components}/warning-text/template.njk +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_global-styles.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_links.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_lists.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_section-break.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_template.scss +0 -0
- data/node_modules/govuk-frontend/{core → govuk/core}/_typography.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_all.scss +1 -1
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_clearfix.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_colour.scss +23 -1
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_device-pixels.scss +0 -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 +60 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_links.scss +15 -1
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_media-queries.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_shape-arrow.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_spacing.scss +0 -0
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_typography.scss +23 -5
- data/node_modules/govuk-frontend/{helpers → govuk/helpers}/_visually-hidden.scss +4 -2
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_form-group.scss +0 -0
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_grid.scss +2 -2
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_main-wrapper.scss +15 -1
- data/node_modules/govuk-frontend/{objects → govuk/objects}/_width-container.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_display.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_spacing.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_typography.scss +0 -0
- data/node_modules/govuk-frontend/{overrides → govuk/overrides}/_width.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_assets.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_colours-applied.scss +9 -8
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_colours-organisations.scss +1 -1
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +101 -0
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +75 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_global-styles.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_ie8.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_measurements.scss +2 -2
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_media-queries.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_spacing.scss +0 -0
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_typography-font-families.scss +11 -1
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_typography-font.scss +27 -7
- data/node_modules/govuk-frontend/{settings → govuk/settings}/_typography-responsive.scss +9 -10
- data/node_modules/govuk-frontend/{template.njk → govuk/template.njk} +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_compatibility.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_exports.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_font-url.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_ie8.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_iff.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_image-url.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_px-to-em.scss +0 -0
- data/node_modules/govuk-frontend/{tools → govuk/tools}/_px-to-rem.scss +0 -0
- data/node_modules/govuk-frontend/{utilities → govuk/utilities}/_all.scss +0 -0
- data/node_modules/govuk-frontend/{utilities → govuk/utilities}/_clearfix.scss +0 -0
- data/node_modules/govuk-frontend/{utilities → govuk/utilities}/_visually-hidden.scss +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/_sass-mq.scss +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/DOMTokenList.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Document.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element/prototype/classList.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element/prototype/closest.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Element/prototype/matches.js +0 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +259 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +257 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Event.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Function/prototype/bind.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Object/defineProperty.js +0 -0
- data/node_modules/govuk-frontend/{vendor → govuk/vendor}/polyfills/Window.js +0 -0
- data/node_modules/govuk-frontend/package.json +21 -21
- data/node_modules/react-is/README.md +2 -12
- data/node_modules/react-is/build-info.json +5 -5
- data/node_modules/react-is/cjs/react-is.development.js +7 -2
- data/node_modules/react-is/cjs/react-is.production.min.js +6 -6
- data/node_modules/react-is/package.json +13 -13
- data/node_modules/react-is/umd/react-is.development.js +7 -2
- data/node_modules/react-is/umd/react-is.production.min.js +5 -5
- data/node_modules/type/CHANGELOG.md +62 -50
- data/node_modules/type/LICENSE +15 -0
- data/node_modules/type/README.md +19 -19
- data/node_modules/type/error/is.js +28 -7
- data/node_modules/type/package.json +36 -22
- data/node_modules/type/test/error/is.js +13 -5
- metadata +247 -344
- data/app/assets/javascripts/govuk_publishing_components/components/accessible-autocomplete.js +0 -79
- data/app/assets/stylesheets/govuk_publishing_components/components/_accessible-autocomplete.scss +0 -41
- data/app/views/govuk_publishing_components/components/_accessible_autocomplete.html.erb +0 -35
- data/app/views/govuk_publishing_components/components/docs/accessible_autocomplete.yml +0 -49
- data/node_modules/accessible-autocomplete/CHANGELOG.md +0 -269
- data/node_modules/accessible-autocomplete/CONTRIBUTING.md +0 -150
- data/node_modules/accessible-autocomplete/LICENSE.txt +0 -20
- data/node_modules/accessible-autocomplete/Procfile +0 -1
- data/node_modules/accessible-autocomplete/README.md +0 -416
- data/node_modules/accessible-autocomplete/accessibility-criteria.md +0 -42
- data/node_modules/accessible-autocomplete/app.json +0 -15
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css +0 -1
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +0 -2
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +0 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +0 -2
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +0 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +0 -2
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +0 -1
- data/node_modules/accessible-autocomplete/examples/form.html +0 -671
- data/node_modules/accessible-autocomplete/examples/index.html +0 -665
- data/node_modules/accessible-autocomplete/examples/multiselect.html +0 -134
- data/node_modules/accessible-autocomplete/examples/preact/index.html +0 -346
- data/node_modules/accessible-autocomplete/examples/react/index.html +0 -347
- data/node_modules/accessible-autocomplete/package-lock.json +0 -14491
- data/node_modules/accessible-autocomplete/package.json +0 -173
- data/node_modules/accessible-autocomplete/preact.js +0 -1
- data/node_modules/accessible-autocomplete/react.js +0 -1
- data/node_modules/accessible-autocomplete/scripts/check-staged.js +0 -14
- data/node_modules/accessible-autocomplete/src/autocomplete.css +0 -192
- data/node_modules/accessible-autocomplete/src/autocomplete.js +0 -618
- data/node_modules/accessible-autocomplete/src/dropdown-arrow-down.js +0 -11
- data/node_modules/accessible-autocomplete/src/status.js +0 -80
- data/node_modules/accessible-autocomplete/src/wrapper.js +0 -76
- data/node_modules/accessible-autocomplete/test/functional/dropdown-arrow-down.js +0 -44
- data/node_modules/accessible-autocomplete/test/functional/index.js +0 -485
- data/node_modules/accessible-autocomplete/test/functional/wrapper.js +0 -318
- data/node_modules/accessible-autocomplete/test/integration/index.js +0 -188
- data/node_modules/accessible-autocomplete/test/karma.config.js +0 -42
- data/node_modules/accessible-autocomplete/test/wdio.config.js +0 -80
- data/node_modules/accessible-autocomplete/webpack.config.babel.js +0 -193
- data/node_modules/govuk-frontend/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-fb2676462a-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-458f8ea81c-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
- data/node_modules/govuk-frontend/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-arrow-left.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-important.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-pointer-2x.png +0 -0
- data/node_modules/govuk-frontend/assets/images/icon-pointer.png +0 -0
- data/node_modules/govuk-frontend/components/button/template.njk +0 -35
- data/node_modules/govuk-frontend/components/file-upload/_file-upload.scss +0 -19
- data/node_modules/govuk-frontend/components/tabs/_tabs.scss +0 -130
- data/node_modules/govuk-frontend/components/tag/_tag.scss +0 -33
- data/node_modules/govuk-frontend/components/textarea/_textarea.scss +0 -32
- data/node_modules/govuk-frontend/helpers/_focusable.scss +0 -34
- data/node_modules/govuk-frontend/helpers/_font-faces.scss +0 -67
- data/node_modules/govuk-frontend/helpers/_grid.scss +0 -107
- data/node_modules/govuk-frontend/settings/_colours-palette.scss +0 -37
- data/node_modules/govuk-frontend/settings/_compatibility.scss +0 -51
- data/node_modules/preact/LICENSE +0 -21
- data/node_modules/preact/README.md +0 -592
- data/node_modules/preact/debug.js +0 -740
- data/node_modules/preact/debug.js.map +0 -1
- data/node_modules/preact/debug/dist/debug.js +0 -2
- data/node_modules/preact/debug/dist/debug.js.map +0 -1
- data/node_modules/preact/debug/dist/debug.mjs +0 -681
- data/node_modules/preact/debug/dist/debug.mjs.map +0 -1
- data/node_modules/preact/debug/dist/debug.module.js +0 -2
- data/node_modules/preact/debug/dist/debug.module.js.map +0 -1
- data/node_modules/preact/debug/dist/debug.umd.js +0 -2
- data/node_modules/preact/debug/dist/debug.umd.js.map +0 -1
- data/node_modules/preact/debug/index.js +0 -122
- data/node_modules/preact/devtools.js +0 -403
- data/node_modules/preact/devtools.js.map +0 -1
- data/node_modules/preact/devtools/devtools.js +0 -395
- data/node_modules/preact/devtools/index.js +0 -4
- data/node_modules/preact/dist/preact.d.ts +0 -1712
- data/node_modules/preact/dist/preact.dev.js +0 -727
- data/node_modules/preact/dist/preact.dev.js.map +0 -1
- data/node_modules/preact/dist/preact.js +0 -414
- data/node_modules/preact/dist/preact.js.flow +0 -25
- data/node_modules/preact/dist/preact.js.map +0 -1
- data/node_modules/preact/dist/preact.min.js +0 -2
- data/node_modules/preact/dist/preact.min.js.map +0 -1
- data/node_modules/preact/dist/preact.mjs +0 -724
- data/node_modules/preact/dist/preact.mjs.map +0 -1
- data/node_modules/preact/dist/preact.umd.js +0 -751
- data/node_modules/preact/dist/preact.umd.js.map +0 -1
- data/node_modules/preact/package.json +0 -226
- data/node_modules/preact/src/clone-element.js +0 -18
- data/node_modules/preact/src/component.js +0 -90
- data/node_modules/preact/src/constants.js +0 -17
- data/node_modules/preact/src/dom/index.js +0 -139
- data/node_modules/preact/src/h.js +0 -86
- data/node_modules/preact/src/options.js +0 -22
- data/node_modules/preact/src/preact.d.ts +0 -1712
- data/node_modules/preact/src/preact.js +0 -32
- data/node_modules/preact/src/preact.js.flow +0 -25
- data/node_modules/preact/src/render-queue.js +0 -27
- data/node_modules/preact/src/render.js +0 -22
- data/node_modules/preact/src/util.js +0 -30
- data/node_modules/preact/src/vdom/component-recycler.js +0 -48
- data/node_modules/preact/src/vdom/component.js +0 -296
- data/node_modules/preact/src/vdom/diff.js +0 -337
- data/node_modules/preact/src/vdom/index.js +0 -54
- data/node_modules/preact/src/vnode.js +0 -9
- data/node_modules/preact/typings.json +0 -5
@@ -1,318 +0,0 @@
|
|
1
|
-
/* global before, beforeEach, after, describe, expect, it */
|
2
|
-
import accessibleAutocomplete from '../../src/wrapper'
|
3
|
-
|
4
|
-
const DEFAULT_OPTIONS = {
|
5
|
-
'': 'Select',
|
6
|
-
fr: 'France',
|
7
|
-
de: 'Germany',
|
8
|
-
gb: 'United Kingdom of Great Britain & Northern Ireland'
|
9
|
-
}
|
10
|
-
|
11
|
-
const injectSelectToEnhanceIntoDOM = (element, settings) => {
|
12
|
-
settings = settings || {}
|
13
|
-
settings.options = settings.options || DEFAULT_OPTIONS
|
14
|
-
settings.id = settings.id !== undefined ? settings.id : 'location-picker-id'
|
15
|
-
settings.name = settings.name !== undefined ? settings.name : 'location-picker-name'
|
16
|
-
var $select = document.createElement('select')
|
17
|
-
if (settings.id) {
|
18
|
-
$select.id = settings.id
|
19
|
-
}
|
20
|
-
if (settings.name) {
|
21
|
-
$select.name = settings.name
|
22
|
-
}
|
23
|
-
if (settings.multiple) {
|
24
|
-
$select.multiple = settings.multiple
|
25
|
-
}
|
26
|
-
|
27
|
-
if (settings.multiple && settings.selected) {
|
28
|
-
Object.keys(settings.selected)
|
29
|
-
.map(optionKey => {
|
30
|
-
const option = document.createElement('option')
|
31
|
-
option.value = optionKey
|
32
|
-
option.text = settings.options[optionKey]
|
33
|
-
option.selected = settings.selected[optionKey]
|
34
|
-
return option
|
35
|
-
})
|
36
|
-
.forEach(option => $select.appendChild(option))
|
37
|
-
} else {
|
38
|
-
Object.keys(settings.options)
|
39
|
-
.map(optionKey => {
|
40
|
-
const option = document.createElement('option')
|
41
|
-
option.value = optionKey
|
42
|
-
option.text = settings.options[optionKey]
|
43
|
-
option.selected = (settings.selected === optionKey)
|
44
|
-
return option
|
45
|
-
})
|
46
|
-
.forEach(option => $select.appendChild(option))
|
47
|
-
}
|
48
|
-
|
49
|
-
element.appendChild($select)
|
50
|
-
|
51
|
-
return $select
|
52
|
-
}
|
53
|
-
|
54
|
-
describe('Wrapper', () => {
|
55
|
-
let scratch
|
56
|
-
before(() => {
|
57
|
-
scratch = document.createElement('div');
|
58
|
-
(document.body || document.documentElement).appendChild(scratch)
|
59
|
-
})
|
60
|
-
|
61
|
-
beforeEach(() => {
|
62
|
-
scratch.innerHTML = ''
|
63
|
-
})
|
64
|
-
|
65
|
-
after(() => {
|
66
|
-
scratch.parentNode.removeChild(scratch)
|
67
|
-
scratch = null
|
68
|
-
})
|
69
|
-
|
70
|
-
it('throws an error when called on nonexistent element', () => {
|
71
|
-
expect(
|
72
|
-
accessibleAutocomplete.bind(null, {
|
73
|
-
element: document.querySelector('#nothing-container'),
|
74
|
-
id: 'scratch',
|
75
|
-
source: () => {}
|
76
|
-
})
|
77
|
-
).to.throw('element is not defined')
|
78
|
-
})
|
79
|
-
|
80
|
-
it('throws an error when called without an id ', () => {
|
81
|
-
expect(
|
82
|
-
accessibleAutocomplete.bind(null, {
|
83
|
-
element: scratch,
|
84
|
-
source: () => {}
|
85
|
-
})
|
86
|
-
).to.throw('id is not defined')
|
87
|
-
})
|
88
|
-
|
89
|
-
it('throws an error when called without a source', () => {
|
90
|
-
expect(
|
91
|
-
accessibleAutocomplete.bind(null, {
|
92
|
-
element: scratch,
|
93
|
-
id: 'scratch'
|
94
|
-
})
|
95
|
-
).to.throw('source is not defined')
|
96
|
-
})
|
97
|
-
|
98
|
-
it('throws an error when called on nonexistent selectElement', () => {
|
99
|
-
expect(
|
100
|
-
accessibleAutocomplete.enhanceSelectElement.bind(null, {
|
101
|
-
selectElement: document.querySelector('#nothing')
|
102
|
-
})
|
103
|
-
).to.throw('selectElement is not defined')
|
104
|
-
})
|
105
|
-
|
106
|
-
it('can enhance a select element', () => {
|
107
|
-
const select = injectSelectToEnhanceIntoDOM(scratch)
|
108
|
-
const id = select.id
|
109
|
-
|
110
|
-
accessibleAutocomplete.enhanceSelectElement({
|
111
|
-
selectElement: select
|
112
|
-
})
|
113
|
-
|
114
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
115
|
-
expect(autocompleteInstances.length).to.equal(1)
|
116
|
-
|
117
|
-
const autocompleteInstance = autocompleteInstances[0]
|
118
|
-
|
119
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
120
|
-
expect(autocompleteInput.tagName.toLowerCase()).to.equal('input')
|
121
|
-
expect(autocompleteInput.id).to.equal(id)
|
122
|
-
})
|
123
|
-
|
124
|
-
it('can enhance a select multiple element', () => {
|
125
|
-
const select = injectSelectToEnhanceIntoDOM(scratch, { multiple: true })
|
126
|
-
const id = select.id
|
127
|
-
|
128
|
-
accessibleAutocomplete.enhanceSelectElement({
|
129
|
-
selectElement: select
|
130
|
-
})
|
131
|
-
|
132
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
133
|
-
expect(autocompleteInstances.length).to.equal(1)
|
134
|
-
|
135
|
-
const autocompleteInstance = autocompleteInstances[0]
|
136
|
-
|
137
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
138
|
-
const autocompleteList = autocompleteInstance.querySelector('.autocomplete__list')
|
139
|
-
expect(autocompleteInput.tagName.toLowerCase()).to.equal('input')
|
140
|
-
expect(autocompleteInput.id).to.equal(id)
|
141
|
-
expect(autocompleteList.tagName.toLowerCase()).to.equal('ul')
|
142
|
-
})
|
143
|
-
|
144
|
-
it('uses the defaultValue setting to populate the input field if no option is selected', () => {
|
145
|
-
const select = injectSelectToEnhanceIntoDOM(scratch, { selected: '' })
|
146
|
-
accessibleAutocomplete.enhanceSelectElement({
|
147
|
-
defaultValue: '',
|
148
|
-
selectElement: select
|
149
|
-
})
|
150
|
-
|
151
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
152
|
-
const autocompleteInstance = autocompleteInstances[0]
|
153
|
-
|
154
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
155
|
-
expect(autocompleteInput.value).to.equal('')
|
156
|
-
})
|
157
|
-
|
158
|
-
it('uses the option label as the default input element value if an option is selected', () => {
|
159
|
-
const select = injectSelectToEnhanceIntoDOM(scratch, { selected: 'de' })
|
160
|
-
accessibleAutocomplete.enhanceSelectElement({
|
161
|
-
defaultValue: '',
|
162
|
-
selectElement: select
|
163
|
-
})
|
164
|
-
|
165
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
166
|
-
const autocompleteInstance = autocompleteInstances[0]
|
167
|
-
|
168
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
169
|
-
expect(autocompleteInput.value).to.equal('Germany')
|
170
|
-
})
|
171
|
-
|
172
|
-
it('plays back the selected options when enhancing a select multiple', () => {
|
173
|
-
const select = injectSelectToEnhanceIntoDOM(scratch, { selected: { de: 'Germany', fr: 'France' }, multiple: true })
|
174
|
-
|
175
|
-
accessibleAutocomplete.enhanceSelectElement({
|
176
|
-
selectElement: select
|
177
|
-
})
|
178
|
-
|
179
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
180
|
-
const autocompleteInstance = autocompleteInstances[0]
|
181
|
-
|
182
|
-
const autocompleteSelectedItems = autocompleteInstance.querySelectorAll('.autocomplete__list li')
|
183
|
-
expect(autocompleteSelectedItems.length).to.equal(2)
|
184
|
-
expect(autocompleteSelectedItems[0].textContent).to.contain('Germany')
|
185
|
-
expect(autocompleteSelectedItems[1].textContent).to.contain('France')
|
186
|
-
})
|
187
|
-
|
188
|
-
it('gives the autocomplete element a blank name attribute by default', () => {
|
189
|
-
const select = injectSelectToEnhanceIntoDOM(scratch)
|
190
|
-
|
191
|
-
accessibleAutocomplete.enhanceSelectElement({
|
192
|
-
selectElement: select
|
193
|
-
})
|
194
|
-
|
195
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
196
|
-
|
197
|
-
const autocompleteInstance = autocompleteInstances[0]
|
198
|
-
|
199
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
200
|
-
expect(autocompleteInput.name).to.equal('')
|
201
|
-
})
|
202
|
-
|
203
|
-
it('can define a name for the autocomplete element', () => {
|
204
|
-
const select = injectSelectToEnhanceIntoDOM(scratch)
|
205
|
-
|
206
|
-
accessibleAutocomplete.enhanceSelectElement({
|
207
|
-
name: 'location-picker-autocomplete',
|
208
|
-
selectElement: select
|
209
|
-
})
|
210
|
-
|
211
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
212
|
-
|
213
|
-
const autocompleteInstance = autocompleteInstances[0]
|
214
|
-
|
215
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
216
|
-
expect(autocompleteInput.name).to.equal('location-picker-autocomplete')
|
217
|
-
})
|
218
|
-
|
219
|
-
it('does not include "null" options in autocomplete', (done) => {
|
220
|
-
const select = injectSelectToEnhanceIntoDOM(scratch)
|
221
|
-
|
222
|
-
accessibleAutocomplete.enhanceSelectElement({
|
223
|
-
selectElement: select
|
224
|
-
})
|
225
|
-
|
226
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
227
|
-
const autocompleteInstance = autocompleteInstances[0]
|
228
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
229
|
-
|
230
|
-
// Using setTimeouts here since changes in values take a while to reflect in lists
|
231
|
-
autocompleteInput.value = 'e'
|
232
|
-
setTimeout(() => {
|
233
|
-
const autocompleteOptions = autocompleteInstance.querySelectorAll('.autocomplete__option')
|
234
|
-
expect(autocompleteOptions.length).to.equal(3)
|
235
|
-
expect([].map.call(autocompleteOptions, o => o.textContent)).not.to.contain('Select')
|
236
|
-
done()
|
237
|
-
}, 250)
|
238
|
-
})
|
239
|
-
|
240
|
-
it('includes "null" options in autocomplete if `preserveNullOptions` flag is true', (done) => {
|
241
|
-
const select = injectSelectToEnhanceIntoDOM(scratch)
|
242
|
-
|
243
|
-
accessibleAutocomplete.enhanceSelectElement({
|
244
|
-
preserveNullOptions: true,
|
245
|
-
selectElement: select
|
246
|
-
})
|
247
|
-
|
248
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
249
|
-
const autocompleteInstance = autocompleteInstances[0]
|
250
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
251
|
-
|
252
|
-
// Using setTimeouts here since changes in values take a while to reflect in lists
|
253
|
-
autocompleteInput.value = 'e'
|
254
|
-
setTimeout(() => {
|
255
|
-
const autocompleteOptions = autocompleteInstance.querySelectorAll('.autocomplete__option')
|
256
|
-
expect(autocompleteOptions.length).to.equal(4)
|
257
|
-
expect([].map.call(autocompleteOptions, o => o.textContent)).to.contain('Select')
|
258
|
-
done()
|
259
|
-
}, 250)
|
260
|
-
})
|
261
|
-
|
262
|
-
it('has all options when typing', (done) => {
|
263
|
-
const select = injectSelectToEnhanceIntoDOM(scratch)
|
264
|
-
|
265
|
-
accessibleAutocomplete.enhanceSelectElement({
|
266
|
-
selectElement: select
|
267
|
-
})
|
268
|
-
|
269
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
270
|
-
const autocompleteInstance = autocompleteInstances[0]
|
271
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
272
|
-
const autocompleteOption = autocompleteInstance.querySelector('.autocomplete__option')
|
273
|
-
|
274
|
-
// Using setTimeouts here since changes in values take a while to reflect in lists
|
275
|
-
autocompleteInput.value = 'Fran'
|
276
|
-
setTimeout(() => {
|
277
|
-
expect(autocompleteOption.textContent).to.equal('France')
|
278
|
-
autocompleteInput.value = 'Ger'
|
279
|
-
setTimeout(() => {
|
280
|
-
expect(autocompleteOption.textContent).to.equal('Germany')
|
281
|
-
autocompleteInput.value = 'United'
|
282
|
-
setTimeout(() => {
|
283
|
-
const autocompleteHint = autocompleteInstance.querySelector('.autocomplete__hint')
|
284
|
-
expect(autocompleteOption.textContent).to.equal('United Kingdom of Great Britain & Northern Ireland')
|
285
|
-
expect(autocompleteHint.value).to.equal('United Kingdom of Great Britain & Northern Ireland')
|
286
|
-
done()
|
287
|
-
}, 250)
|
288
|
-
}, 250)
|
289
|
-
}, 250)
|
290
|
-
})
|
291
|
-
|
292
|
-
it('onConfirm updates original select', (done) => {
|
293
|
-
const select = injectSelectToEnhanceIntoDOM(scratch, { selected: 'de' })
|
294
|
-
|
295
|
-
accessibleAutocomplete.enhanceSelectElement({
|
296
|
-
selectElement: select
|
297
|
-
})
|
298
|
-
|
299
|
-
const autocompleteInstances = document.querySelectorAll('.autocomplete__wrapper')
|
300
|
-
const autocompleteInstance = autocompleteInstances[0]
|
301
|
-
const autocompleteInput = autocompleteInstance.querySelector('.autocomplete__input')
|
302
|
-
const autocompleteOption = autocompleteInstance.querySelector('.autocomplete__option')
|
303
|
-
|
304
|
-
// Check the initial value of the original selectElement
|
305
|
-
expect(select.value).to.equal('de')
|
306
|
-
// Using setTimeouts here since changes in values take a while to reflect in lists
|
307
|
-
autocompleteInput.value = 'United'
|
308
|
-
setTimeout(() => {
|
309
|
-
expect(autocompleteOption.textContent).to.equal('United Kingdom of Great Britain & Northern Ireland')
|
310
|
-
autocompleteOption.click()
|
311
|
-
expect(select.value).to.equal('gb')
|
312
|
-
setTimeout(() => {
|
313
|
-
expect(autocompleteInput.value).to.equal('United Kingdom of Great Britain & Northern Ireland')
|
314
|
-
done()
|
315
|
-
}, 250)
|
316
|
-
}, 250)
|
317
|
-
})
|
318
|
-
})
|
@@ -1,188 +0,0 @@
|
|
1
|
-
/* global afterEach, before, beforeEach, browser, describe, it */
|
2
|
-
const expect = require('chai').expect
|
3
|
-
const { browserName, version } = browser.desiredCapabilities
|
4
|
-
const isChrome = browserName === 'chrome'
|
5
|
-
const isFireFox = browserName === 'firefox'
|
6
|
-
const isIE = browserName === 'internet explorer'
|
7
|
-
// const isIE9 = isIE && version === '9'
|
8
|
-
// const isIE10 = isIE && version === '10'
|
9
|
-
// const isIE11 = isIE && version === '11.103'
|
10
|
-
|
11
|
-
const basicExample = () => {
|
12
|
-
describe('basic example', function () {
|
13
|
-
this.retries(3)
|
14
|
-
|
15
|
-
const input = 'input#autocomplete-default'
|
16
|
-
const menu = `${input} + ul`
|
17
|
-
const firstOption = `${menu} > li:first-child`
|
18
|
-
const secondOption = `${menu} > li:nth-child(2)`
|
19
|
-
|
20
|
-
beforeEach(() => {
|
21
|
-
browser.setValue(input, '') // Prevent autofilling, IE likes to do this.
|
22
|
-
})
|
23
|
-
|
24
|
-
it('should show the input', () => {
|
25
|
-
browser.waitForExist(input)
|
26
|
-
expect(browser.isVisible(input)).to.equal(true)
|
27
|
-
})
|
28
|
-
|
29
|
-
it('should allow focusing the input', () => {
|
30
|
-
browser.click(input)
|
31
|
-
expect(browser.hasFocus(input)).to.equal(true)
|
32
|
-
})
|
33
|
-
|
34
|
-
it('should display suggestions', () => {
|
35
|
-
browser.click(input)
|
36
|
-
browser.setValue(input, 'ita')
|
37
|
-
browser.waitForVisible(menu)
|
38
|
-
expect(browser.isVisible(menu)).to.equal(true)
|
39
|
-
})
|
40
|
-
|
41
|
-
describe('keyboard use', () => {
|
42
|
-
it('should allow typing', () => {
|
43
|
-
browser.click(input)
|
44
|
-
browser.addValue(input, 'ita')
|
45
|
-
expect(browser.getValue(input)).to.equal('ita')
|
46
|
-
})
|
47
|
-
|
48
|
-
it('should allow selecting an option', () => {
|
49
|
-
browser.click(input)
|
50
|
-
browser.setValue(input, 'ita')
|
51
|
-
browser.addValue(input, ['ArrowDown'])
|
52
|
-
expect(browser.hasFocus(input)).to.equal(false)
|
53
|
-
expect(browser.hasFocus(firstOption)).to.equal(true)
|
54
|
-
browser.addValue(firstOption, ['ArrowDown'])
|
55
|
-
expect(browser.isVisible(menu)).to.equal(true)
|
56
|
-
expect(browser.getValue(input)).to.equal('ita')
|
57
|
-
expect(browser.hasFocus(firstOption)).to.equal(false)
|
58
|
-
expect(browser.hasFocus(secondOption)).to.equal(true)
|
59
|
-
})
|
60
|
-
|
61
|
-
it('should allow confirming an option', () => {
|
62
|
-
browser.click(input)
|
63
|
-
browser.setValue(input, 'ita')
|
64
|
-
browser.addValue(input, ['ArrowDown', 'Enter'])
|
65
|
-
browser.waitUntil(() => browser.getValue(input) !== 'ita')
|
66
|
-
expect(browser.hasFocus(input)).to.equal(true)
|
67
|
-
expect(browser.getValue(input)).to.equal('Italy')
|
68
|
-
})
|
69
|
-
|
70
|
-
it('should redirect keypresses on an option to input', () => {
|
71
|
-
if (!isIE) {
|
72
|
-
browser.click(input)
|
73
|
-
browser.setValue(input, 'ita')
|
74
|
-
browser.addValue(input, ['ArrowDown'])
|
75
|
-
expect(browser.hasFocus(input)).to.equal(false)
|
76
|
-
expect(browser.hasFocus(firstOption)).to.equal(true)
|
77
|
-
browser.addValue(firstOption, ['l'])
|
78
|
-
expect(browser.hasFocus(input)).to.equal(true)
|
79
|
-
expect(browser.getValue(input)).to.equal('ital')
|
80
|
-
} else {
|
81
|
-
// FIXME: This feature does not work correctly on IE 9 to 11.
|
82
|
-
}
|
83
|
-
})
|
84
|
-
})
|
85
|
-
|
86
|
-
describe('mouse use', () => {
|
87
|
-
it('should allow confirming an option', () => {
|
88
|
-
browser.click(input)
|
89
|
-
browser.setValue(input, 'ita')
|
90
|
-
browser.click(firstOption)
|
91
|
-
expect(browser.hasFocus(input)).to.equal(true)
|
92
|
-
expect(browser.getValue(input)).to.equal('Italy')
|
93
|
-
})
|
94
|
-
})
|
95
|
-
})
|
96
|
-
}
|
97
|
-
|
98
|
-
const customTemplatesExample = () => {
|
99
|
-
describe('custom templates example', function () {
|
100
|
-
this.retries(3)
|
101
|
-
|
102
|
-
const input = 'input#autocomplete-customTemplates'
|
103
|
-
const menu = `${input} + ul`
|
104
|
-
const firstOption = `${menu} > li:first-child`
|
105
|
-
const firstOptionInnerElement = `${firstOption} > strong`
|
106
|
-
|
107
|
-
beforeEach(() => {
|
108
|
-
browser.setValue(input, '') // Prevent autofilling, IE likes to do this.
|
109
|
-
})
|
110
|
-
|
111
|
-
describe('mouse use', () => {
|
112
|
-
it('should allow confirming an option by clicking on child elements', () => {
|
113
|
-
browser.setValue(input, 'uni')
|
114
|
-
if (isChrome) {
|
115
|
-
const errorRegex = /Other element would receive the click/
|
116
|
-
expect(browser.click.bind(browser, firstOptionInnerElement)).to.throw(errorRegex)
|
117
|
-
expect(browser.hasFocus(input)).to.equal(true)
|
118
|
-
expect(browser.getValue(input)).to.equal('uni')
|
119
|
-
}
|
120
|
-
if (isFireFox) {
|
121
|
-
browser.click(firstOptionInnerElement)
|
122
|
-
expect(browser.hasFocus(input)).to.equal(true)
|
123
|
-
expect(browser.getValue(input)).to.equal('United Kingdom')
|
124
|
-
}
|
125
|
-
if (isIE) {
|
126
|
-
// FIXME: This feature works correctly on IE but testing it doesn't seem to work.
|
127
|
-
}
|
128
|
-
})
|
129
|
-
})
|
130
|
-
})
|
131
|
-
}
|
132
|
-
|
133
|
-
const takeScreenshotsIfFail = () => {
|
134
|
-
afterEach(function () {
|
135
|
-
const testFailed = this.currentTest.state === 'failed'
|
136
|
-
if (testFailed) {
|
137
|
-
const timestamp = +new Date()
|
138
|
-
const browserVariant = isIE ? `ie${version}` : browserName
|
139
|
-
const testTitle = this.currentTest.title.replace(/\W/g, '-')
|
140
|
-
const filename = `./screenshots/${timestamp}-${browserVariant}-${testTitle}.png`
|
141
|
-
browser.saveScreenshot(filename)
|
142
|
-
console.log(`Test failed, created: ${filename}`)
|
143
|
-
}
|
144
|
-
})
|
145
|
-
}
|
146
|
-
|
147
|
-
describe('Accessible Autocomplete', () => {
|
148
|
-
before(() => {
|
149
|
-
browser.url('/')
|
150
|
-
})
|
151
|
-
|
152
|
-
it('should have the right title', () => {
|
153
|
-
expect(browser.getTitle()).to.equal('Accessible Autocomplete examples')
|
154
|
-
})
|
155
|
-
|
156
|
-
basicExample()
|
157
|
-
customTemplatesExample()
|
158
|
-
|
159
|
-
takeScreenshotsIfFail()
|
160
|
-
})
|
161
|
-
|
162
|
-
describe('Accessible Autocomplete Preact', () => {
|
163
|
-
before(() => {
|
164
|
-
browser.url('/preact')
|
165
|
-
})
|
166
|
-
|
167
|
-
it('should have the right title', () => {
|
168
|
-
expect(browser.getTitle()).to.equal('Accessible Autocomplete Preact examples')
|
169
|
-
})
|
170
|
-
|
171
|
-
basicExample()
|
172
|
-
|
173
|
-
takeScreenshotsIfFail()
|
174
|
-
})
|
175
|
-
|
176
|
-
describe('Accessible Autocomplete React', () => {
|
177
|
-
before(() => {
|
178
|
-
browser.url('/react')
|
179
|
-
})
|
180
|
-
|
181
|
-
it('should have the right title', () => {
|
182
|
-
expect(browser.getTitle()).to.equal('Accessible Autocomplete React examples')
|
183
|
-
})
|
184
|
-
|
185
|
-
basicExample()
|
186
|
-
|
187
|
-
takeScreenshotsIfFail()
|
188
|
-
})
|