@noctuatech/uswds 1.5.4 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/lib/accordion/accordion.element.test.ts +12 -12
- package/src/lib/alert/alert.element.test.ts +2 -2
- package/src/lib/alert/alert.element.ts +1 -1
- package/src/lib/breadcrumbs/breadcrumbs.element.test.ts +2 -2
- package/src/lib/button/button.element.test.ts +2 -2
- package/src/lib/button-group/button-group.element.test.ts +2 -2
- package/src/lib/card/card.element.test.ts +2 -2
- package/src/lib/checkbox/checkbox.element.test.ts +10 -5
- package/src/lib/collection/collection-item/collection-item.element.test.ts +2 -2
- package/src/lib/collection/collection.element.test.ts +2 -2
- package/src/lib/combo-box/combo-box.element.test.ts +12 -12
- package/src/lib/config/config.element.test.ts +2 -2
- package/src/lib/description/description.element.test.ts +2 -2
- package/src/lib/file-input/file-input-preview/file-input-preview.element.test.ts +10 -6
- package/src/lib/file-input/file-input.element.test.ts +19 -19
- package/src/lib/file-input/file-input.element.ts +3 -3
- package/src/lib/file-input/filename.ts +3 -3
- package/src/lib/in-page-nav/in-page-nav.element.test.ts +2 -2
- package/src/lib/input/input.element.test.ts +8 -8
- package/src/lib/input-mask/input-mask.element.test.ts +5 -5
- package/src/lib/modal/modal-close/modal-close.element.test.ts +2 -2
- package/src/lib/modal/modal-heading/modal-heading.element.test.ts +2 -2
- package/src/lib/modal/modal.element.test.ts +3 -3
- package/src/lib/pagination/pagination.element.test.ts +2 -2
- package/src/lib/process-list/process-list.element.test.ts +2 -2
- package/src/lib/radio/radio-option/radio-option.element.test.ts +3 -3
- package/src/lib/radio/radio.element.test.ts +9 -9
- package/src/lib/range-slider/range-slider.element.test.ts +4 -4
- package/src/lib/search/search.element.test.ts +6 -6
- package/src/lib/select/select.element.test.ts +11 -9
- package/src/lib/services/icon.service.ts +1 -1
- package/src/lib/side-nav/side-nav.element.test.ts +5 -5
- package/src/lib/step-indicator/step-indicator.element.test.ts +2 -2
- package/src/lib/summary-box/summary-box.element.test.ts +2 -2
- package/src/lib/tag/tag.element.test.ts +2 -2
- package/src/lib/textarea/textarea.element.test.ts +7 -5
- package/target/lib/accordion/accordion.element.d.ts +1 -0
- package/target/lib/accordion/accordion.element.d.ts.map +1 -0
- package/target/lib/accordion/accordion.element.js +34 -1
- package/target/lib/accordion/accordion.element.js.map +1 -1
- package/target/lib/accordion/accordion.element.test.d.ts +1 -0
- package/target/lib/accordion/accordion.element.test.d.ts.map +1 -0
- package/target/lib/accordion/accordion.element.test.js +6 -6
- package/target/lib/accordion/accordion.element.test.js.map +1 -1
- package/target/lib/accordion/accordion.stories.d.ts +1 -0
- package/target/lib/accordion/accordion.stories.d.ts.map +1 -0
- package/target/lib/accordion/events.d.ts +1 -0
- package/target/lib/accordion/events.d.ts.map +1 -0
- package/target/lib/alert/alert-types.d.ts +1 -0
- package/target/lib/alert/alert-types.d.ts.map +1 -0
- package/target/lib/alert/alert.element.d.ts +2 -1
- package/target/lib/alert/alert.element.d.ts.map +1 -0
- package/target/lib/alert/alert.element.js +35 -1
- package/target/lib/alert/alert.element.js.map +1 -1
- package/target/lib/alert/alert.element.test.d.ts +1 -0
- package/target/lib/alert/alert.element.test.d.ts.map +1 -0
- package/target/lib/alert/alert.element.test.js +2 -2
- package/target/lib/alert/alert.element.test.js.map +1 -1
- package/target/lib/alert/alert.stories.d.ts +1 -0
- package/target/lib/alert/alert.stories.d.ts.map +1 -0
- package/target/lib/breadcrumbs/breadcrumb/breadcrumb.element.d.ts +1 -0
- package/target/lib/breadcrumbs/breadcrumb/breadcrumb.element.d.ts.map +1 -0
- package/target/lib/breadcrumbs/breadcrumb/breadcrumb.element.js +34 -1
- package/target/lib/breadcrumbs/breadcrumb/breadcrumb.element.js.map +1 -1
- package/target/lib/breadcrumbs/breadcrumbs.element.d.ts +1 -0
- package/target/lib/breadcrumbs/breadcrumbs.element.d.ts.map +1 -0
- package/target/lib/breadcrumbs/breadcrumbs.element.js +34 -1
- package/target/lib/breadcrumbs/breadcrumbs.element.js.map +1 -1
- package/target/lib/breadcrumbs/breadcrumbs.element.test.d.ts +1 -0
- package/target/lib/breadcrumbs/breadcrumbs.element.test.d.ts.map +1 -0
- package/target/lib/breadcrumbs/breadcrumbs.element.test.js +2 -2
- package/target/lib/breadcrumbs/breadcrumbs.element.test.js.map +1 -1
- package/target/lib/breadcrumbs/breadcrumbs.stories.d.ts +1 -0
- package/target/lib/breadcrumbs/breadcrumbs.stories.d.ts.map +1 -0
- package/target/lib/button/button.element.d.ts +1 -0
- package/target/lib/button/button.element.d.ts.map +1 -0
- package/target/lib/button/button.element.js +34 -1
- package/target/lib/button/button.element.js.map +1 -1
- package/target/lib/button/button.element.test.d.ts +1 -0
- package/target/lib/button/button.element.test.d.ts.map +1 -0
- package/target/lib/button/button.element.test.js +2 -2
- package/target/lib/button/button.element.test.js.map +1 -1
- package/target/lib/button/button.stories.d.ts +1 -0
- package/target/lib/button/button.stories.d.ts.map +1 -0
- package/target/lib/button-group/button-group.element.d.ts +1 -0
- package/target/lib/button-group/button-group.element.d.ts.map +1 -0
- package/target/lib/button-group/button-group.element.js +34 -1
- package/target/lib/button-group/button-group.element.js.map +1 -1
- package/target/lib/button-group/button-group.element.test.d.ts +1 -0
- package/target/lib/button-group/button-group.element.test.d.ts.map +1 -0
- package/target/lib/button-group/button-group.element.test.js +2 -2
- package/target/lib/button-group/button-group.element.test.js.map +1 -1
- package/target/lib/button-group/button-group.stories.d.ts +1 -0
- package/target/lib/button-group/button-group.stories.d.ts.map +1 -0
- package/target/lib/card/card-body/card-body.element.d.ts +1 -0
- package/target/lib/card/card-body/card-body.element.d.ts.map +1 -0
- package/target/lib/card/card-body/card-body.element.js +34 -1
- package/target/lib/card/card-body/card-body.element.js.map +1 -1
- package/target/lib/card/card-footer/card-footer.element.d.ts +1 -0
- package/target/lib/card/card-footer/card-footer.element.d.ts.map +1 -0
- package/target/lib/card/card-footer/card-footer.element.js +34 -1
- package/target/lib/card/card-footer/card-footer.element.js.map +1 -1
- package/target/lib/card/card-group/card-group.element.d.ts +1 -0
- package/target/lib/card/card-group/card-group.element.d.ts.map +1 -0
- package/target/lib/card/card-group/card-group.element.js +34 -1
- package/target/lib/card/card-group/card-group.element.js.map +1 -1
- package/target/lib/card/card-header/card-header.element.d.ts +1 -0
- package/target/lib/card/card-header/card-header.element.d.ts.map +1 -0
- package/target/lib/card/card-header/card-header.element.js +34 -1
- package/target/lib/card/card-header/card-header.element.js.map +1 -1
- package/target/lib/card/card-media/card-media.element.d.ts +1 -0
- package/target/lib/card/card-media/card-media.element.d.ts.map +1 -0
- package/target/lib/card/card-media/card-media.element.js +34 -1
- package/target/lib/card/card-media/card-media.element.js.map +1 -1
- package/target/lib/card/card.element.d.ts +1 -0
- package/target/lib/card/card.element.d.ts.map +1 -0
- package/target/lib/card/card.element.js +34 -1
- package/target/lib/card/card.element.js.map +1 -1
- package/target/lib/card/card.element.test.d.ts +1 -0
- package/target/lib/card/card.element.test.d.ts.map +1 -0
- package/target/lib/card/card.element.test.js +2 -2
- package/target/lib/card/card.element.test.js.map +1 -1
- package/target/lib/card/card.stories.d.ts +1 -0
- package/target/lib/card/card.stories.d.ts.map +1 -0
- package/target/lib/checkbox/checkbox-group/checkbox-group.element.d.ts +1 -0
- package/target/lib/checkbox/checkbox-group/checkbox-group.element.d.ts.map +1 -0
- package/target/lib/checkbox/checkbox-group/checkbox-group.element.js +34 -1
- package/target/lib/checkbox/checkbox-group/checkbox-group.element.js.map +1 -1
- package/target/lib/checkbox/checkbox.element.d.ts +1 -0
- package/target/lib/checkbox/checkbox.element.d.ts.map +1 -0
- package/target/lib/checkbox/checkbox.element.js +34 -1
- package/target/lib/checkbox/checkbox.element.js.map +1 -1
- package/target/lib/checkbox/checkbox.element.test.d.ts +1 -0
- package/target/lib/checkbox/checkbox.element.test.d.ts.map +1 -0
- package/target/lib/checkbox/checkbox.element.test.js +8 -5
- package/target/lib/checkbox/checkbox.element.test.js.map +1 -1
- package/target/lib/checkbox/checkbox.stories.d.ts +1 -0
- package/target/lib/checkbox/checkbox.stories.d.ts.map +1 -0
- package/target/lib/collection/collection-item/collection-item.element.d.ts +1 -0
- package/target/lib/collection/collection-item/collection-item.element.d.ts.map +1 -0
- package/target/lib/collection/collection-item/collection-item.element.js +34 -1
- package/target/lib/collection/collection-item/collection-item.element.js.map +1 -1
- package/target/lib/collection/collection-item/collection-item.element.test.d.ts +1 -0
- package/target/lib/collection/collection-item/collection-item.element.test.d.ts.map +1 -0
- package/target/lib/collection/collection-item/collection-item.element.test.js +2 -2
- package/target/lib/collection/collection-item/collection-item.element.test.js.map +1 -1
- package/target/lib/collection/collection.element.d.ts +1 -0
- package/target/lib/collection/collection.element.d.ts.map +1 -0
- package/target/lib/collection/collection.element.js +34 -1
- package/target/lib/collection/collection.element.js.map +1 -1
- package/target/lib/collection/collection.element.test.d.ts +1 -0
- package/target/lib/collection/collection.element.test.d.ts.map +1 -0
- package/target/lib/collection/collection.element.test.js +2 -2
- package/target/lib/collection/collection.element.test.js.map +1 -1
- package/target/lib/collection/collection.stories.d.ts +1 -0
- package/target/lib/collection/collection.stories.d.ts.map +1 -0
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.d.ts +1 -0
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.d.ts.map +1 -0
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.js +34 -1
- package/target/lib/combo-box/combo-box-option/combo-box-option.element.js.map +1 -1
- package/target/lib/combo-box/combo-box.element.d.ts +1 -0
- package/target/lib/combo-box/combo-box.element.d.ts.map +1 -0
- package/target/lib/combo-box/combo-box.element.js +34 -1
- package/target/lib/combo-box/combo-box.element.js.map +1 -1
- package/target/lib/combo-box/combo-box.element.test.d.ts +1 -0
- package/target/lib/combo-box/combo-box.element.test.d.ts.map +1 -0
- package/target/lib/combo-box/combo-box.element.test.js +7 -7
- package/target/lib/combo-box/combo-box.element.test.js.map +1 -1
- package/target/lib/combo-box/combo-box.stories.d.ts +1 -0
- package/target/lib/combo-box/combo-box.stories.d.ts.map +1 -0
- package/target/lib/combo-box/context.d.ts +1 -0
- package/target/lib/combo-box/context.d.ts.map +1 -0
- package/target/lib/config/config.element.d.ts +1 -0
- package/target/lib/config/config.element.d.ts.map +1 -0
- package/target/lib/config/config.element.js +34 -1
- package/target/lib/config/config.element.js.map +1 -1
- package/target/lib/config/config.element.test.d.ts +1 -0
- package/target/lib/config/config.element.test.d.ts.map +1 -0
- package/target/lib/config/config.element.test.js +2 -2
- package/target/lib/config/config.element.test.js.map +1 -1
- package/target/lib/define.d.ts +1 -0
- package/target/lib/define.d.ts.map +1 -0
- package/target/lib/description/description.element.d.ts +1 -0
- package/target/lib/description/description.element.d.ts.map +1 -0
- package/target/lib/description/description.element.js +34 -1
- package/target/lib/description/description.element.js.map +1 -1
- package/target/lib/description/description.element.test.d.ts +1 -0
- package/target/lib/description/description.element.test.d.ts.map +1 -0
- package/target/lib/description/description.element.test.js +2 -2
- package/target/lib/description/description.element.test.js.map +1 -1
- package/target/lib/file-input/file-input-preview/file-input-preview.element.d.ts +1 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.element.d.ts.map +1 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js +34 -1
- package/target/lib/file-input/file-input-preview/file-input-preview.element.js.map +1 -1
- package/target/lib/file-input/file-input-preview/file-input-preview.element.test.d.ts +1 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.element.test.d.ts.map +1 -0
- package/target/lib/file-input/file-input-preview/file-input-preview.element.test.js +8 -6
- package/target/lib/file-input/file-input-preview/file-input-preview.element.test.js.map +1 -1
- package/target/lib/file-input/file-input.element.d.ts +2 -1
- package/target/lib/file-input/file-input.element.d.ts.map +1 -0
- package/target/lib/file-input/file-input.element.js +36 -3
- package/target/lib/file-input/file-input.element.js.map +1 -1
- package/target/lib/file-input/file-input.element.test.d.ts +1 -0
- package/target/lib/file-input/file-input.element.test.d.ts.map +1 -0
- package/target/lib/file-input/file-input.element.test.js +10 -10
- package/target/lib/file-input/file-input.element.test.js.map +1 -1
- package/target/lib/file-input/file-input.stories.d.ts +1 -0
- package/target/lib/file-input/file-input.stories.d.ts.map +1 -0
- package/target/lib/file-input/filename.d.ts +1 -0
- package/target/lib/file-input/filename.d.ts.map +1 -0
- package/target/lib/file-input/filename.js.map +1 -1
- package/target/lib/file-input/filename.test.d.ts +1 -0
- package/target/lib/file-input/filename.test.d.ts.map +1 -0
- package/target/lib/icon/icon-types.d.ts +1 -0
- package/target/lib/icon/icon-types.d.ts.map +1 -0
- package/target/lib/icon/icon.element.d.ts +1 -0
- package/target/lib/icon/icon.element.d.ts.map +1 -0
- package/target/lib/icon/icon.element.js +34 -1
- package/target/lib/icon/icon.element.js.map +1 -1
- package/target/lib/icon/icon.stories.d.ts +1 -0
- package/target/lib/icon/icon.stories.d.ts.map +1 -0
- package/target/lib/in-page-nav/in-page-nav-item/in-page-nav-item.element.d.ts +1 -0
- package/target/lib/in-page-nav/in-page-nav-item/in-page-nav-item.element.d.ts.map +1 -0
- package/target/lib/in-page-nav/in-page-nav-item/in-page-nav-item.element.js +34 -1
- package/target/lib/in-page-nav/in-page-nav-item/in-page-nav-item.element.js.map +1 -1
- package/target/lib/in-page-nav/in-page-nav.element.d.ts +1 -0
- package/target/lib/in-page-nav/in-page-nav.element.d.ts.map +1 -0
- package/target/lib/in-page-nav/in-page-nav.element.js +34 -1
- package/target/lib/in-page-nav/in-page-nav.element.js.map +1 -1
- package/target/lib/in-page-nav/in-page-nav.element.test.d.ts +1 -0
- package/target/lib/in-page-nav/in-page-nav.element.test.d.ts.map +1 -0
- package/target/lib/in-page-nav/in-page-nav.element.test.js +2 -2
- package/target/lib/in-page-nav/in-page-nav.element.test.js.map +1 -1
- package/target/lib/in-page-nav/in-page-nav.stories.d.ts +1 -0
- package/target/lib/in-page-nav/in-page-nav.stories.d.ts.map +1 -0
- package/target/lib/input/input.element.d.ts +1 -0
- package/target/lib/input/input.element.d.ts.map +1 -0
- package/target/lib/input/input.element.js +34 -1
- package/target/lib/input/input.element.js.map +1 -1
- package/target/lib/input/input.element.test.d.ts +1 -0
- package/target/lib/input/input.element.test.d.ts.map +1 -0
- package/target/lib/input/input.element.test.js +8 -6
- package/target/lib/input/input.element.test.js.map +1 -1
- package/target/lib/input/input.stories.d.ts +1 -0
- package/target/lib/input/input.stories.d.ts.map +1 -0
- package/target/lib/input-mask/format.d.ts +1 -0
- package/target/lib/input-mask/format.d.ts.map +1 -0
- package/target/lib/input-mask/input-mask.element.d.ts +1 -0
- package/target/lib/input-mask/input-mask.element.d.ts.map +1 -0
- package/target/lib/input-mask/input-mask.element.js +34 -1
- package/target/lib/input-mask/input-mask.element.js.map +1 -1
- package/target/lib/input-mask/input-mask.element.test.d.ts +1 -0
- package/target/lib/input-mask/input-mask.element.test.d.ts.map +1 -0
- package/target/lib/input-mask/input-mask.element.test.js +5 -5
- package/target/lib/input-mask/input-mask.element.test.js.map +1 -1
- package/target/lib/input-mask/input-mask.stories.d.ts +1 -0
- package/target/lib/input-mask/input-mask.stories.d.ts.map +1 -0
- package/target/lib/input-mask/maskable.element.d.ts +1 -0
- package/target/lib/input-mask/maskable.element.d.ts.map +1 -0
- package/target/lib/link/link.element.d.ts +1 -0
- package/target/lib/link/link.element.d.ts.map +1 -0
- package/target/lib/link/link.element.js +35 -2
- package/target/lib/link/link.element.js.map +1 -1
- package/target/lib/link/link.stories.d.ts +1 -0
- package/target/lib/link/link.stories.d.ts.map +1 -0
- package/target/lib/modal/modal-close/modal-close.element.d.ts +1 -0
- package/target/lib/modal/modal-close/modal-close.element.d.ts.map +1 -0
- package/target/lib/modal/modal-close/modal-close.element.js +34 -1
- package/target/lib/modal/modal-close/modal-close.element.js.map +1 -1
- package/target/lib/modal/modal-close/modal-close.element.test.d.ts +1 -0
- package/target/lib/modal/modal-close/modal-close.element.test.d.ts.map +1 -0
- package/target/lib/modal/modal-close/modal-close.element.test.js +2 -2
- package/target/lib/modal/modal-close/modal-close.element.test.js.map +1 -1
- package/target/lib/modal/modal-heading/modal-heading.element.d.ts +1 -0
- package/target/lib/modal/modal-heading/modal-heading.element.d.ts.map +1 -0
- package/target/lib/modal/modal-heading/modal-heading.element.js +34 -1
- package/target/lib/modal/modal-heading/modal-heading.element.js.map +1 -1
- package/target/lib/modal/modal-heading/modal-heading.element.test.d.ts +1 -0
- package/target/lib/modal/modal-heading/modal-heading.element.test.d.ts.map +1 -0
- package/target/lib/modal/modal-heading/modal-heading.element.test.js +2 -2
- package/target/lib/modal/modal-heading/modal-heading.element.test.js.map +1 -1
- package/target/lib/modal/modal.element.d.ts +1 -0
- package/target/lib/modal/modal.element.d.ts.map +1 -0
- package/target/lib/modal/modal.element.js +34 -1
- package/target/lib/modal/modal.element.js.map +1 -1
- package/target/lib/modal/modal.element.test.d.ts +1 -0
- package/target/lib/modal/modal.element.test.d.ts.map +1 -0
- package/target/lib/modal/modal.element.test.js +3 -3
- package/target/lib/modal/modal.element.test.js.map +1 -1
- package/target/lib/modal/modal.stories.d.ts +1 -0
- package/target/lib/modal/modal.stories.d.ts.map +1 -0
- package/target/lib/pagination/pagination-item/pagination-item.element.d.ts +1 -0
- package/target/lib/pagination/pagination-item/pagination-item.element.d.ts.map +1 -0
- package/target/lib/pagination/pagination-item/pagination-item.element.js +34 -1
- package/target/lib/pagination/pagination-item/pagination-item.element.js.map +1 -1
- package/target/lib/pagination/pagination-no/pagination-no.element.d.ts +1 -0
- package/target/lib/pagination/pagination-no/pagination-no.element.d.ts.map +1 -0
- package/target/lib/pagination/pagination-no/pagination-no.element.js +34 -1
- package/target/lib/pagination/pagination-no/pagination-no.element.js.map +1 -1
- package/target/lib/pagination/pagination.element.d.ts +1 -0
- package/target/lib/pagination/pagination.element.d.ts.map +1 -0
- package/target/lib/pagination/pagination.element.js +34 -1
- package/target/lib/pagination/pagination.element.js.map +1 -1
- package/target/lib/pagination/pagination.element.test.d.ts +1 -0
- package/target/lib/pagination/pagination.element.test.d.ts.map +1 -0
- package/target/lib/pagination/pagination.element.test.js +2 -2
- package/target/lib/pagination/pagination.element.test.js.map +1 -1
- package/target/lib/pagination/pagination.stories.d.ts +1 -0
- package/target/lib/pagination/pagination.stories.d.ts.map +1 -0
- package/target/lib/process-list/process-list-item/process-list-item.element.d.ts +1 -0
- package/target/lib/process-list/process-list-item/process-list-item.element.d.ts.map +1 -0
- package/target/lib/process-list/process-list-item/process-list-item.element.js +34 -1
- package/target/lib/process-list/process-list-item/process-list-item.element.js.map +1 -1
- package/target/lib/process-list/process-list.element.d.ts +1 -0
- package/target/lib/process-list/process-list.element.d.ts.map +1 -0
- package/target/lib/process-list/process-list.element.js +34 -1
- package/target/lib/process-list/process-list.element.js.map +1 -1
- package/target/lib/process-list/process-list.element.test.d.ts +1 -0
- package/target/lib/process-list/process-list.element.test.d.ts.map +1 -0
- package/target/lib/process-list/process-list.element.test.js +2 -2
- package/target/lib/process-list/process-list.element.test.js.map +1 -1
- package/target/lib/process-list/process-list.stories.d.ts +1 -0
- package/target/lib/process-list/process-list.stories.d.ts.map +1 -0
- package/target/lib/radio/context.d.ts +1 -0
- package/target/lib/radio/context.d.ts.map +1 -0
- package/target/lib/radio/radio-option/radio-option.element.d.ts +1 -0
- package/target/lib/radio/radio-option/radio-option.element.d.ts.map +1 -0
- package/target/lib/radio/radio-option/radio-option.element.js +34 -1
- package/target/lib/radio/radio-option/radio-option.element.js.map +1 -1
- package/target/lib/radio/radio-option/radio-option.element.test.d.ts +1 -0
- package/target/lib/radio/radio-option/radio-option.element.test.d.ts.map +1 -0
- package/target/lib/radio/radio-option/radio-option.element.test.js +2 -2
- package/target/lib/radio/radio-option/radio-option.element.test.js.map +1 -1
- package/target/lib/radio/radio.element.d.ts +1 -0
- package/target/lib/radio/radio.element.d.ts.map +1 -0
- package/target/lib/radio/radio.element.js +34 -1
- package/target/lib/radio/radio.element.js.map +1 -1
- package/target/lib/radio/radio.element.test.d.ts +1 -0
- package/target/lib/radio/radio.element.test.d.ts.map +1 -0
- package/target/lib/radio/radio.element.test.js +6 -6
- package/target/lib/radio/radio.element.test.js.map +1 -1
- package/target/lib/radio/radio.stories.d.ts +1 -0
- package/target/lib/radio/radio.stories.d.ts.map +1 -0
- package/target/lib/range-slider/range-slider.element.d.ts +1 -0
- package/target/lib/range-slider/range-slider.element.d.ts.map +1 -0
- package/target/lib/range-slider/range-slider.element.js +34 -1
- package/target/lib/range-slider/range-slider.element.js.map +1 -1
- package/target/lib/range-slider/range-slider.element.test.d.ts +1 -0
- package/target/lib/range-slider/range-slider.element.test.d.ts.map +1 -0
- package/target/lib/range-slider/range-slider.element.test.js +5 -4
- package/target/lib/range-slider/range-slider.element.test.js.map +1 -1
- package/target/lib/range-slider/range-slider.stories.d.ts +1 -0
- package/target/lib/range-slider/range-slider.stories.d.ts.map +1 -0
- package/target/lib/search/search.element.d.ts +1 -0
- package/target/lib/search/search.element.d.ts.map +1 -0
- package/target/lib/search/search.element.js +34 -1
- package/target/lib/search/search.element.js.map +1 -1
- package/target/lib/search/search.element.test.d.ts +1 -0
- package/target/lib/search/search.element.test.d.ts.map +1 -0
- package/target/lib/search/search.element.test.js +6 -6
- package/target/lib/search/search.element.test.js.map +1 -1
- package/target/lib/search/search.event.d.ts +1 -0
- package/target/lib/search/search.event.d.ts.map +1 -0
- package/target/lib/search/search.stories.d.ts +1 -0
- package/target/lib/search/search.stories.d.ts.map +1 -0
- package/target/lib/select/context.d.ts +1 -0
- package/target/lib/select/context.d.ts.map +1 -0
- package/target/lib/select/select-option/select-option.element.d.ts +1 -0
- package/target/lib/select/select-option/select-option.element.d.ts.map +1 -0
- package/target/lib/select/select-option/select-option.element.js +34 -1
- package/target/lib/select/select-option/select-option.element.js.map +1 -1
- package/target/lib/select/select.element.d.ts +1 -0
- package/target/lib/select/select.element.d.ts.map +1 -0
- package/target/lib/select/select.element.js +34 -1
- package/target/lib/select/select.element.js.map +1 -1
- package/target/lib/select/select.element.test.d.ts +1 -0
- package/target/lib/select/select.element.test.d.ts.map +1 -0
- package/target/lib/select/select.element.test.js +10 -8
- package/target/lib/select/select.element.test.js.map +1 -1
- package/target/lib/select/select.stories.d.ts +1 -0
- package/target/lib/select/select.stories.d.ts.map +1 -0
- package/target/lib/services/http.service.d.ts +1 -0
- package/target/lib/services/http.service.d.ts.map +1 -0
- package/target/lib/services/http.service.js +34 -1
- package/target/lib/services/http.service.js.map +1 -1
- package/target/lib/services/icon.service.d.ts +2 -1
- package/target/lib/services/icon.service.d.ts.map +1 -0
- package/target/lib/services/icon.service.element.test.d.ts +1 -0
- package/target/lib/services/icon.service.element.test.d.ts.map +1 -0
- package/target/lib/services/icon.service.js +35 -1
- package/target/lib/services/icon.service.js.map +1 -1
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.d.ts +1 -0
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.d.ts.map +1 -0
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.js +34 -1
- package/target/lib/side-nav/side-nav-item/side-nav-item.element.js.map +1 -1
- package/target/lib/side-nav/side-nav.element.d.ts +1 -0
- package/target/lib/side-nav/side-nav.element.d.ts.map +1 -0
- package/target/lib/side-nav/side-nav.element.js +34 -1
- package/target/lib/side-nav/side-nav.element.js.map +1 -1
- package/target/lib/side-nav/side-nav.element.test.d.ts +1 -0
- package/target/lib/side-nav/side-nav.element.test.d.ts.map +1 -0
- package/target/lib/side-nav/side-nav.element.test.js +3 -3
- package/target/lib/side-nav/side-nav.element.test.js.map +1 -1
- package/target/lib/side-nav/side-nav.stories.d.ts +1 -0
- package/target/lib/side-nav/side-nav.stories.d.ts.map +1 -0
- package/target/lib/step-indicator/step/step.element.d.ts +1 -0
- package/target/lib/step-indicator/step/step.element.d.ts.map +1 -0
- package/target/lib/step-indicator/step/step.element.js +34 -1
- package/target/lib/step-indicator/step/step.element.js.map +1 -1
- package/target/lib/step-indicator/step-indicator.element.d.ts +1 -0
- package/target/lib/step-indicator/step-indicator.element.d.ts.map +1 -0
- package/target/lib/step-indicator/step-indicator.element.js +34 -1
- package/target/lib/step-indicator/step-indicator.element.js.map +1 -1
- package/target/lib/step-indicator/step-indicator.element.test.d.ts +1 -0
- package/target/lib/step-indicator/step-indicator.element.test.d.ts.map +1 -0
- package/target/lib/step-indicator/step-indicator.element.test.js +2 -2
- package/target/lib/step-indicator/step-indicator.element.test.js.map +1 -1
- package/target/lib/step-indicator/step-indicator.stories.d.ts +1 -0
- package/target/lib/step-indicator/step-indicator.stories.d.ts.map +1 -0
- package/target/lib/summary-box/summary-box.element.d.ts +1 -0
- package/target/lib/summary-box/summary-box.element.d.ts.map +1 -0
- package/target/lib/summary-box/summary-box.element.js +34 -1
- package/target/lib/summary-box/summary-box.element.js.map +1 -1
- package/target/lib/summary-box/summary-box.element.test.d.ts +1 -0
- package/target/lib/summary-box/summary-box.element.test.d.ts.map +1 -0
- package/target/lib/summary-box/summary-box.element.test.js +2 -2
- package/target/lib/summary-box/summary-box.element.test.js.map +1 -1
- package/target/lib/summary-box/summary-box.stories.d.ts +1 -0
- package/target/lib/summary-box/summary-box.stories.d.ts.map +1 -0
- package/target/lib/tag/tag.element.d.ts +1 -0
- package/target/lib/tag/tag.element.d.ts.map +1 -0
- package/target/lib/tag/tag.element.js +34 -1
- package/target/lib/tag/tag.element.js.map +1 -1
- package/target/lib/tag/tag.element.test.d.ts +1 -0
- package/target/lib/tag/tag.element.test.d.ts.map +1 -0
- package/target/lib/tag/tag.element.test.js +2 -2
- package/target/lib/tag/tag.element.test.js.map +1 -1
- package/target/lib/tag/tag.stories.d.ts +1 -0
- package/target/lib/tag/tag.stories.d.ts.map +1 -0
- package/target/lib/templating.d.ts +1 -0
- package/target/lib/templating.d.ts.map +1 -0
- package/target/lib/textarea/textarea.element.d.ts +1 -0
- package/target/lib/textarea/textarea.element.d.ts.map +1 -0
- package/target/lib/textarea/textarea.element.js +34 -1
- package/target/lib/textarea/textarea.element.js.map +1 -1
- package/target/lib/textarea/textarea.element.test.d.ts +1 -0
- package/target/lib/textarea/textarea.element.test.d.ts.map +1 -0
- package/target/lib/textarea/textarea.element.test.js +6 -5
- package/target/lib/textarea/textarea.element.test.js.map +1 -1
- package/target/lib/textarea/textarea.stories.d.ts +1 -0
- package/target/lib/textarea/textarea.stories.d.ts.map +1 -0
- package/target/lib.d.ts +1 -0
- package/target/lib.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noctuatech/uswds",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"packages/**"
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"plop": "^4.0.1",
|
|
133
133
|
"prettier": "^3.5.3",
|
|
134
134
|
"storybook": "^10.2.1",
|
|
135
|
-
"typescript": "^
|
|
135
|
+
"typescript": "^6.0.0",
|
|
136
136
|
"wireit": "^0.14.9"
|
|
137
137
|
},
|
|
138
138
|
"lint-staged": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './accordion.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
import { screen } from '@testing-library/dom';
|
|
5
5
|
import { userEvent } from '@testing-library/user-event';
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ import type { USAAccordionElement } from './accordion.element.js';
|
|
|
8
8
|
|
|
9
9
|
describe('usa-accordion', () => {
|
|
10
10
|
it('should be accessible', async () => {
|
|
11
|
-
const accordion =
|
|
11
|
+
const accordion = fixtureSync<USAAccordionElement>(html`
|
|
12
12
|
<usa-accordion id="first" name="ammendment">
|
|
13
13
|
<h4 slot="heading">First Ammendment</h4>
|
|
14
14
|
|
|
@@ -24,7 +24,7 @@ describe('usa-accordion', () => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
it('should toggle the open state when clicked', async () => {
|
|
27
|
-
const accordion =
|
|
27
|
+
const accordion = fixtureSync<USAAccordionElement>(html`
|
|
28
28
|
<usa-accordion id="first" name="ammendment">
|
|
29
29
|
<h4 slot="heading">First Ammendment</h4>
|
|
30
30
|
|
|
@@ -45,7 +45,7 @@ describe('usa-accordion', () => {
|
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
it('should toggle the open state when clicked', async () => {
|
|
48
|
-
const accordion =
|
|
48
|
+
const accordion = fixtureSync<USAAccordionElement>(html`
|
|
49
49
|
<usa-accordion id="first" name="ammendment">
|
|
50
50
|
<h4 slot="heading">First Ammendment</h4>
|
|
51
51
|
|
|
@@ -68,7 +68,7 @@ describe('usa-accordion', () => {
|
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
it('should only allow a single accordion in a group to be open', async () => {
|
|
71
|
-
const el =
|
|
71
|
+
const el = fixtureSync(html`
|
|
72
72
|
<section>
|
|
73
73
|
<usa-accordion name="ammendment">
|
|
74
74
|
<h4 slot="heading">First Ammendment</h4>
|
|
@@ -90,21 +90,21 @@ describe('usa-accordion', () => {
|
|
|
90
90
|
const headings = el.querySelectorAll('h4');
|
|
91
91
|
const content = Array.from(el.querySelectorAll<HTMLDivElement>('.content'));
|
|
92
92
|
|
|
93
|
-
await userEvent.click(headings[0]);
|
|
93
|
+
await userEvent.click(headings[0]!);
|
|
94
94
|
|
|
95
95
|
assert.deepEqual(
|
|
96
96
|
content.map((el) => el.checkVisibility()),
|
|
97
97
|
[true, false, false],
|
|
98
98
|
);
|
|
99
99
|
|
|
100
|
-
await userEvent.click(headings[1]);
|
|
100
|
+
await userEvent.click(headings[1]!);
|
|
101
101
|
|
|
102
102
|
assert.deepEqual(
|
|
103
103
|
content.map((el) => el.checkVisibility()),
|
|
104
104
|
[false, true, false],
|
|
105
105
|
);
|
|
106
106
|
|
|
107
|
-
await userEvent.click(headings[2]);
|
|
107
|
+
await userEvent.click(headings[2]!);
|
|
108
108
|
|
|
109
109
|
assert.deepEqual(
|
|
110
110
|
content.map((el) => el.checkVisibility()),
|
|
@@ -113,7 +113,7 @@ describe('usa-accordion', () => {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
it('should not close accordion not in the same group', async () => {
|
|
116
|
-
const el =
|
|
116
|
+
const el = fixtureSync(html`
|
|
117
117
|
<section>
|
|
118
118
|
<usa-accordion name="ammendment">
|
|
119
119
|
<h4 slot="heading">First Ammendment</h4>
|
|
@@ -135,21 +135,21 @@ describe('usa-accordion', () => {
|
|
|
135
135
|
const headings = el.querySelectorAll('h4');
|
|
136
136
|
const content = Array.from(el.querySelectorAll<HTMLDivElement>('.content'));
|
|
137
137
|
|
|
138
|
-
await userEvent.click(headings[0]);
|
|
138
|
+
await userEvent.click(headings[0]!);
|
|
139
139
|
|
|
140
140
|
assert.deepEqual(
|
|
141
141
|
content.map((el) => el.checkVisibility()),
|
|
142
142
|
[true, false, false],
|
|
143
143
|
);
|
|
144
144
|
|
|
145
|
-
await userEvent.click(headings[1]);
|
|
145
|
+
await userEvent.click(headings[1]!);
|
|
146
146
|
|
|
147
147
|
assert.deepEqual(
|
|
148
148
|
content.map((el) => el.checkVisibility()),
|
|
149
149
|
[false, true, false],
|
|
150
150
|
);
|
|
151
151
|
|
|
152
|
-
await userEvent.click(headings[2]);
|
|
152
|
+
await userEvent.click(headings[2]!);
|
|
153
153
|
|
|
154
154
|
assert.deepEqual(
|
|
155
155
|
content.map((el) => el.checkVisibility()),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import './alert.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
|
|
5
5
|
import { USA_ALERT_TYPES } from './alert-types.js';
|
|
6
6
|
|
|
7
7
|
describe('usa-alert', () => {
|
|
8
8
|
for (const alert of USA_ALERT_TYPES) {
|
|
9
9
|
it(`should be accessible: ${alert}`, async () => {
|
|
10
|
-
const form =
|
|
10
|
+
const form = fixtureSync(html`
|
|
11
11
|
<usa-alert type=${alert}>
|
|
12
12
|
<h3 slot="heading">Status</h3>
|
|
13
13
|
|
|
@@ -3,7 +3,7 @@ import { observe } from '@joist/observable';
|
|
|
3
3
|
import { bind } from '@joist/templating';
|
|
4
4
|
|
|
5
5
|
import { type USAAlertType, USA_ALERT_CONFIG } from './alert-types.js';
|
|
6
|
-
import { USAIcon } from '../icon/icon-types.js';
|
|
6
|
+
import { type USAIcon } from '../icon/icon-types.js';
|
|
7
7
|
|
|
8
8
|
declare global {
|
|
9
9
|
interface HTMLElementTagNameMap {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import './breadcrumbs.element.js';
|
|
2
2
|
import './breadcrumb/breadcrumb.element.js';
|
|
3
3
|
|
|
4
|
-
import { assert,
|
|
4
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
5
5
|
|
|
6
6
|
import type { USABreadcrumbsElement } from './breadcrumbs.element.js';
|
|
7
7
|
|
|
8
8
|
describe('usa-breadcrumbs', () => {
|
|
9
9
|
it('should be accessible', async () => {
|
|
10
|
-
const breadcrumbs =
|
|
10
|
+
const breadcrumbs = fixtureSync<USABreadcrumbsElement>(html`
|
|
11
11
|
<usa-breadcrumbs>
|
|
12
12
|
<usa-breadcrumb href="/">Home</usa-breadcrumb>
|
|
13
13
|
<usa-breadcrumb href="/">Federal Contracting</usa-breadcrumb>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import './button.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
|
|
5
5
|
import { BUTTON_VARIANTS, type USAButtonElement } from './button.element.js';
|
|
6
6
|
|
|
7
7
|
describe('usa-button', () => {
|
|
8
8
|
for (const variant of BUTTON_VARIANTS) {
|
|
9
9
|
it('should be accessible', async () => {
|
|
10
|
-
const button =
|
|
10
|
+
const button = fixtureSync<USAButtonElement>(html` <usa-button variant=${variant}>Hello World</usa-button> `);
|
|
11
11
|
|
|
12
12
|
return assert.isAccessible(button);
|
|
13
13
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './button-group.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
|
|
5
5
|
import type { USAButtonGroupElement } from './button-group.element.js';
|
|
6
6
|
|
|
7
7
|
describe('usa-button-group', () => {
|
|
8
8
|
it('should be accessible', async () => {
|
|
9
|
-
const buttonGroup =
|
|
9
|
+
const buttonGroup = fixtureSync<USAButtonGroupElement>(html` <usa-button-group>Hello World</usa-button-group> `);
|
|
10
10
|
|
|
11
11
|
return assert.isAccessible(buttonGroup);
|
|
12
12
|
});
|
|
@@ -5,13 +5,13 @@ import './card-group/card-group.element.js';
|
|
|
5
5
|
import './card-header/card-header.element.js';
|
|
6
6
|
import './card-media/card-media.element.js';
|
|
7
7
|
|
|
8
|
-
import { assert,
|
|
8
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
9
9
|
|
|
10
10
|
import type { USACardElement } from './card.element.js';
|
|
11
11
|
|
|
12
12
|
describe('usa-card', () => {
|
|
13
13
|
it('should be accessible', async () => {
|
|
14
|
-
const card =
|
|
14
|
+
const card = fixtureSync<USACardElement>(html`
|
|
15
15
|
<usa-card-group>
|
|
16
16
|
<usa-card>
|
|
17
17
|
<usa-card-media>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './checkbox.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
|
|
5
5
|
describe('usa-checkbox', () => {
|
|
6
6
|
it('should be accessible', async () => {
|
|
7
|
-
const form =
|
|
7
|
+
const form = fixtureSync<HTMLFormElement>(html`
|
|
8
8
|
<usa-checkbox name="fname" value="Foo">Hello World</usa-checkbox>
|
|
9
9
|
`);
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ describe('usa-checkbox', () => {
|
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
it('should submit form with default values', async () => {
|
|
15
|
-
const form =
|
|
15
|
+
const form = fixtureSync<HTMLFormElement>(html`
|
|
16
16
|
<form>
|
|
17
17
|
<usa-checkbox name="enabled" value="test" checked> Hello World </usa-checkbox>
|
|
18
18
|
|
|
@@ -20,13 +20,15 @@ describe('usa-checkbox', () => {
|
|
|
20
20
|
</form>
|
|
21
21
|
`);
|
|
22
22
|
|
|
23
|
+
await Promise.resolve();
|
|
24
|
+
|
|
23
25
|
const value = new FormData(form);
|
|
24
26
|
|
|
25
27
|
assert.equal(value.get('enabled'), 'test');
|
|
26
28
|
});
|
|
27
29
|
|
|
28
30
|
it('should update form value as input value changed', async () => {
|
|
29
|
-
const form =
|
|
31
|
+
const form = fixtureSync<HTMLFormElement>(html`
|
|
30
32
|
<form>
|
|
31
33
|
<usa-checkbox name="enabled" value="test">Hello World</usa-checkbox>
|
|
32
34
|
|
|
@@ -49,7 +51,7 @@ describe('usa-checkbox', () => {
|
|
|
49
51
|
});
|
|
50
52
|
|
|
51
53
|
it('should not submit when not valid', async () => {
|
|
52
|
-
const form =
|
|
54
|
+
const form = fixtureSync<HTMLFormElement>(html`
|
|
53
55
|
<form>
|
|
54
56
|
<usa-checkbox name="enabled" value="test" required> Hello World </usa-checkbox>
|
|
55
57
|
|
|
@@ -57,6 +59,9 @@ describe('usa-checkbox', () => {
|
|
|
57
59
|
</form>
|
|
58
60
|
`);
|
|
59
61
|
|
|
62
|
+
await Promise.resolve();
|
|
63
|
+
await Promise.resolve();
|
|
64
|
+
|
|
60
65
|
assert.equal(form.checkValidity(), false);
|
|
61
66
|
});
|
|
62
67
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './collection-item.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
|
|
5
5
|
import type { USACollectionItemElement } from './collection-item.element.js';
|
|
6
6
|
|
|
7
7
|
describe('usa-collection-item', () => {
|
|
8
8
|
it('should be accessible', async () => {
|
|
9
|
-
const collectionItem =
|
|
9
|
+
const collectionItem = fixtureSync<USACollectionItemElement>(html`
|
|
10
10
|
<usa-collection-item>Hello World</usa-collection-item>
|
|
11
11
|
`);
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './collection.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
|
|
5
5
|
import type { USACollectionElement } from './collection.element.js';
|
|
6
6
|
|
|
7
7
|
describe('usa-collection', () => {
|
|
8
8
|
it('should be accessible', async () => {
|
|
9
|
-
const collection =
|
|
9
|
+
const collection = fixtureSync<USACollectionElement>(html` <usa-collection>Hello World</usa-collection> `);
|
|
10
10
|
|
|
11
11
|
return assert.isAccessible(collection);
|
|
12
12
|
});
|
|
@@ -2,7 +2,7 @@ import './combo-box.element.js';
|
|
|
2
2
|
import './combo-box-option/combo-box-option.element.js';
|
|
3
3
|
import '../input/input.element.js';
|
|
4
4
|
|
|
5
|
-
import { assert,
|
|
5
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
6
6
|
|
|
7
7
|
import type { USAComboBoxElement } from './combo-box.element.js';
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ describe('usa-combo-box', () => {
|
|
|
11
11
|
let input: HTMLInputElement;
|
|
12
12
|
|
|
13
13
|
beforeEach(async () => {
|
|
14
|
-
autocomplete =
|
|
14
|
+
autocomplete = fixtureSync<USAComboBoxElement>(html`
|
|
15
15
|
<usa-combo-box name="search" placeholder="Select a fruit">
|
|
16
16
|
<span slot="label">Fruits</span>
|
|
17
17
|
|
|
@@ -32,8 +32,8 @@ describe('usa-combo-box', () => {
|
|
|
32
32
|
const suggestions = autocomplete.listItems();
|
|
33
33
|
|
|
34
34
|
assert.equal(suggestions.length, 2);
|
|
35
|
-
assert.equal(suggestions[0]
|
|
36
|
-
assert.equal(suggestions[1]
|
|
35
|
+
assert.equal(suggestions[0]!.dataset.value, 'Banana');
|
|
36
|
+
assert.equal(suggestions[1]!.dataset.value, 'Blueberry');
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
it('should show all suggestions when input is empty', async () => {
|
|
@@ -50,8 +50,8 @@ describe('usa-combo-box', () => {
|
|
|
50
50
|
|
|
51
51
|
const suggestions = autocomplete.listItems();
|
|
52
52
|
assert.equal(suggestions.length, 2);
|
|
53
|
-
assert.equal(suggestions[0]
|
|
54
|
-
assert.equal(suggestions[1]
|
|
53
|
+
assert.equal(suggestions[0]!.dataset.value, 'Banana');
|
|
54
|
+
assert.equal(suggestions[1]!.dataset.value, 'Blueberry');
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
it('should navigate suggestions with arrow keys', async () => {
|
|
@@ -113,7 +113,7 @@ describe('usa-combo-box', () => {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
it('should submit form with default values', async () => {
|
|
116
|
-
const form =
|
|
116
|
+
const form = fixtureSync<HTMLFormElement>(html`
|
|
117
117
|
<form>
|
|
118
118
|
<usa-combo-box name="search" value="Apple" placeholder="Select a fruit">
|
|
119
119
|
<span slot="label">Fruits</span>
|
|
@@ -133,7 +133,7 @@ describe('usa-combo-box', () => {
|
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
it('should update form value when an option is selected', async () => {
|
|
136
|
-
const form =
|
|
136
|
+
const form = fixtureSync<HTMLFormElement>(html`
|
|
137
137
|
<form>
|
|
138
138
|
<usa-combo-box name="search" placeholder="Select a fruit">
|
|
139
139
|
<span slot="label">Fruits</span>
|
|
@@ -167,17 +167,17 @@ describe('usa-combo-box', () => {
|
|
|
167
167
|
// Select the first suggestion
|
|
168
168
|
const suggestions = comboBox.listItems();
|
|
169
169
|
|
|
170
|
-
suggestions[0]
|
|
170
|
+
suggestions[0]!
|
|
171
171
|
.querySelector('slot')
|
|
172
172
|
?.assignedElements()[0]
|
|
173
|
-
|
|
173
|
+
?.dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
|
174
174
|
|
|
175
175
|
const value = new FormData(form);
|
|
176
176
|
assert.equal(value.get('search'), 'Banana');
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
it('should not submit when required and no value is selected', async () => {
|
|
180
|
-
const form =
|
|
180
|
+
const form = fixtureSync<HTMLFormElement>(html`
|
|
181
181
|
<form>
|
|
182
182
|
<usa-combo-box name="search" required placeholder="Select a fruit">
|
|
183
183
|
<span slot="label">Fruits</span>
|
|
@@ -196,7 +196,7 @@ describe('usa-combo-box', () => {
|
|
|
196
196
|
});
|
|
197
197
|
|
|
198
198
|
it('should not show suggestions when disabled', async () => {
|
|
199
|
-
const disabledComboBox =
|
|
199
|
+
const disabledComboBox = fixtureSync<USAComboBoxElement>(html`
|
|
200
200
|
<usa-combo-box name="search" disabled placeholder="Select a fruit">
|
|
201
201
|
<span slot="label">Fruits</span>
|
|
202
202
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './config.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
|
|
5
5
|
import type { USAConfigElement } from './config.element.js';
|
|
6
6
|
|
|
7
7
|
describe('usa-config', () => {
|
|
8
8
|
it('should be accessible', async () => {
|
|
9
|
-
const config =
|
|
9
|
+
const config = fixtureSync<USAConfigElement>(html` <usa-config>Hello World</usa-config> `);
|
|
10
10
|
|
|
11
11
|
return assert.isAccessible(config);
|
|
12
12
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './description.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
|
|
5
5
|
import type { USADescriptionElement } from './description.element.js';
|
|
6
6
|
|
|
7
7
|
describe('usa-description', () => {
|
|
8
8
|
it('should be accessible', async () => {
|
|
9
|
-
const description =
|
|
9
|
+
const description = fixtureSync<USADescriptionElement>(html` <usa-description>Hello World</usa-description> `);
|
|
10
10
|
|
|
11
11
|
return assert.isAccessible(description);
|
|
12
12
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import './file-input-preview.element.js';
|
|
2
2
|
import '../../link/link.element.js';
|
|
3
3
|
|
|
4
|
-
import { assert,
|
|
4
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
5
5
|
|
|
6
6
|
import type { USAFileInputPreviewElement } from './file-input-preview.element.js';
|
|
7
7
|
|
|
8
8
|
describe('usa-file-input-preview', () => {
|
|
9
9
|
it('should be accessible with no files', async () => {
|
|
10
|
-
const fileInputPreview =
|
|
10
|
+
const fileInputPreview = fixtureSync<USAFileInputPreviewElement>(html`
|
|
11
11
|
<usa-file-input-preview> Selected file <usa-link>Change file</usa-link> </usa-file-input-preview>
|
|
12
12
|
`);
|
|
13
13
|
|
|
@@ -19,7 +19,7 @@ describe('usa-file-input-preview', () => {
|
|
|
19
19
|
data.items.add(new File([], 'image1.jpg'));
|
|
20
20
|
data.items.add(new File([], 'image2.jpg'));
|
|
21
21
|
|
|
22
|
-
const fileInputPreview =
|
|
22
|
+
const fileInputPreview = fixtureSync<USAFileInputPreviewElement>(html`
|
|
23
23
|
<usa-file-input-preview .files=${data.files}>
|
|
24
24
|
Selected file <usa-link>Change file</usa-link>
|
|
25
25
|
</usa-file-input-preview>
|
|
@@ -33,12 +33,14 @@ describe('usa-file-input-preview', () => {
|
|
|
33
33
|
data.items.add(new File([], 'image1.jpg'));
|
|
34
34
|
data.items.add(new File([], 'image2.jpg'));
|
|
35
35
|
|
|
36
|
-
const { shadowRoot } =
|
|
36
|
+
const { shadowRoot } = fixtureSync<USAFileInputPreviewElement>(html`
|
|
37
37
|
<usa-file-input-preview .files=${data.files}>
|
|
38
38
|
Selected file <usa-link>Change file</usa-link>
|
|
39
39
|
</usa-file-input-preview>
|
|
40
40
|
`);
|
|
41
41
|
|
|
42
|
+
await Promise.resolve();
|
|
43
|
+
|
|
42
44
|
const previewItems = Array.from(shadowRoot?.querySelectorAll('.preview-item') ?? []).map((item) =>
|
|
43
45
|
item.textContent?.trim(),
|
|
44
46
|
);
|
|
@@ -51,7 +53,7 @@ describe('usa-file-input-preview', () => {
|
|
|
51
53
|
data.items.add(new File([], 'image1.jpg'));
|
|
52
54
|
data.items.add(new File([], 'image2.jpg'));
|
|
53
55
|
|
|
54
|
-
const fileInputPreview =
|
|
56
|
+
const fileInputPreview = fixtureSync<USAFileInputPreviewElement>(html`
|
|
55
57
|
<usa-file-input-preview .files=${data.files}>
|
|
56
58
|
Selected file <usa-link>Change file</usa-link>
|
|
57
59
|
</usa-file-input-preview>
|
|
@@ -77,12 +79,14 @@ describe('usa-file-input-preview', () => {
|
|
|
77
79
|
data.items.add(new File(['Image1'], 'image1.jpg', { type: 'image/jpg' }));
|
|
78
80
|
data.items.add(new File(['Image2'], 'image2.jpg', { type: 'image/jpg' }));
|
|
79
81
|
|
|
80
|
-
const { shadowRoot } =
|
|
82
|
+
const { shadowRoot } = fixtureSync<USAFileInputPreviewElement>(html`
|
|
81
83
|
<usa-file-input-preview .files=${data.files}>
|
|
82
84
|
Selected file <usa-link>Change file</usa-link>
|
|
83
85
|
</usa-file-input-preview>
|
|
84
86
|
`);
|
|
85
87
|
|
|
88
|
+
await Promise.resolve();
|
|
89
|
+
|
|
86
90
|
const [first, second] = Array.from(shadowRoot?.querySelectorAll<HTMLImageElement>('.preview-item img') ?? []).map(
|
|
87
91
|
(item) => item.src.substring(29),
|
|
88
92
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './file-input.element.js';
|
|
2
2
|
|
|
3
|
-
import { assert,
|
|
3
|
+
import { assert, fixtureSync, html } from '@open-wc/testing';
|
|
4
4
|
import { DOMInjector } from '@joist/di';
|
|
5
5
|
|
|
6
6
|
import type { USAFileInputElement } from './file-input.element.js';
|
|
@@ -8,7 +8,7 @@ import { HttpService } from '../services/http.service.js';
|
|
|
8
8
|
|
|
9
9
|
describe('usa-file-input', () => {
|
|
10
10
|
it('should be accessible', async () => {
|
|
11
|
-
const fileInput =
|
|
11
|
+
const fileInput = fixtureSync<USAFileInputElement>(html` <usa-file-input>Hello World</usa-file-input> `);
|
|
12
12
|
|
|
13
13
|
return assert.isAccessible(fileInput);
|
|
14
14
|
});
|
|
@@ -18,7 +18,7 @@ describe('usa-file-input', () => {
|
|
|
18
18
|
data.items.add(new File([], 'first.txt'));
|
|
19
19
|
data.items.add(new File([], 'second.txt'));
|
|
20
20
|
|
|
21
|
-
const form =
|
|
21
|
+
const form = fixtureSync<HTMLFormElement>(html`
|
|
22
22
|
<form>
|
|
23
23
|
<usa-file-input name="upload" .files=${data.files}>
|
|
24
24
|
Input accepts a single file
|
|
@@ -44,7 +44,7 @@ describe('usa-file-input', () => {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
it('should show file preview after drag and drop', async () => {
|
|
47
|
-
const fileInput =
|
|
47
|
+
const fileInput = fixtureSync<USAFileInputElement>(html`
|
|
48
48
|
<usa-file-input> Input accepts a single file </usa-file-input>
|
|
49
49
|
`);
|
|
50
50
|
|
|
@@ -69,11 +69,11 @@ describe('usa-file-input', () => {
|
|
|
69
69
|
|
|
70
70
|
// Verify that filesVisible is true and files are set
|
|
71
71
|
assert.equal(fileInput.files?.length, 1);
|
|
72
|
-
assert.equal(fileInput.files?.[0]
|
|
72
|
+
assert.equal(fileInput.files?.[0]!.name, 'test.txt');
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
it('should fire input event when a file is dragged and dropped', async () => {
|
|
76
|
-
const fileInput =
|
|
76
|
+
const fileInput = fixtureSync<USAFileInputElement>(html`
|
|
77
77
|
<usa-file-input> Input accepts a single file </usa-file-input>
|
|
78
78
|
`);
|
|
79
79
|
|
|
@@ -107,7 +107,7 @@ describe('usa-file-input', () => {
|
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
it('should filter dropped files based on accept MIME type', async () => {
|
|
110
|
-
const fileInput =
|
|
110
|
+
const fileInput = fixtureSync<USAFileInputElement>(html`
|
|
111
111
|
<usa-file-input accept="image/*"> Input accepts only images </usa-file-input>
|
|
112
112
|
`);
|
|
113
113
|
|
|
@@ -134,12 +134,12 @@ describe('usa-file-input', () => {
|
|
|
134
134
|
|
|
135
135
|
// Verify that only image files were accepted
|
|
136
136
|
assert.equal(fileInput.files?.length, 2);
|
|
137
|
-
assert.equal(fileInput.files?.[0]
|
|
138
|
-
assert.equal(fileInput.files?.[1]
|
|
137
|
+
assert.equal(fileInput.files?.[0]!.name, 'image.png');
|
|
138
|
+
assert.equal(fileInput.files?.[1]!.name, 'photo.jpg');
|
|
139
139
|
});
|
|
140
140
|
|
|
141
141
|
it('should filter dropped files based on accept file extension', async () => {
|
|
142
|
-
const fileInput =
|
|
142
|
+
const fileInput = fixtureSync<USAFileInputElement>(html`
|
|
143
143
|
<usa-file-input accept=".txt,.pdf"> Input accepts text and PDF files </usa-file-input>
|
|
144
144
|
`);
|
|
145
145
|
|
|
@@ -166,12 +166,12 @@ describe('usa-file-input', () => {
|
|
|
166
166
|
|
|
167
167
|
// Verify that only .txt and .pdf files were accepted
|
|
168
168
|
assert.equal(fileInput.files?.length, 2);
|
|
169
|
-
assert.equal(fileInput.files?.[0]
|
|
170
|
-
assert.equal(fileInput.files?.[1]
|
|
169
|
+
assert.equal(fileInput.files?.[0]!.name, 'document.txt');
|
|
170
|
+
assert.equal(fileInput.files?.[1]!.name, 'report.pdf');
|
|
171
171
|
});
|
|
172
172
|
|
|
173
173
|
it('should accept all dropped files when accept property is not set', async () => {
|
|
174
|
-
const fileInput =
|
|
174
|
+
const fileInput = fixtureSync<USAFileInputElement>(html`
|
|
175
175
|
<usa-file-input> Input accepts all files </usa-file-input>
|
|
176
176
|
`);
|
|
177
177
|
|
|
@@ -204,7 +204,7 @@ describe('usa-file-input', () => {
|
|
|
204
204
|
const initialData = new DataTransfer();
|
|
205
205
|
initialData.items.add(new File([], 'existing.txt'));
|
|
206
206
|
|
|
207
|
-
const fileInput =
|
|
207
|
+
const fileInput = fixtureSync<USAFileInputElement>(html`
|
|
208
208
|
<usa-file-input .files=${initialData.files}> Input accepts files </usa-file-input>
|
|
209
209
|
`);
|
|
210
210
|
|
|
@@ -214,7 +214,7 @@ describe('usa-file-input', () => {
|
|
|
214
214
|
|
|
215
215
|
// Verify initial files are set
|
|
216
216
|
assert.equal(fileInput.files?.length, 1);
|
|
217
|
-
assert.equal(fileInput.files?.[0]
|
|
217
|
+
assert.equal(fileInput.files?.[0]!.name, 'existing.txt');
|
|
218
218
|
|
|
219
219
|
// Trigger input event with 0 files
|
|
220
220
|
nativeInput.files = new DataTransfer().files;
|
|
@@ -231,7 +231,7 @@ describe('usa-file-input', () => {
|
|
|
231
231
|
|
|
232
232
|
// Verify that existing files were not cleared
|
|
233
233
|
assert.equal(fileInput.files?.length, 1);
|
|
234
|
-
assert.equal(fileInput.files?.[0]
|
|
234
|
+
assert.equal(fileInput.files?.[0]!.name, 'existing.txt');
|
|
235
235
|
});
|
|
236
236
|
|
|
237
237
|
it('should load file from url and set files', async () => {
|
|
@@ -257,7 +257,7 @@ describe('usa-file-input', () => {
|
|
|
257
257
|
|
|
258
258
|
root.attach(document.body);
|
|
259
259
|
|
|
260
|
-
const fileInput =
|
|
260
|
+
const fileInput = fixtureSync<USAFileInputElement>(html`<usa-file-input></usa-file-input>`);
|
|
261
261
|
|
|
262
262
|
fileInput.url = 'https://example.com/path/to/test-file.txt';
|
|
263
263
|
|
|
@@ -266,8 +266,8 @@ describe('usa-file-input', () => {
|
|
|
266
266
|
'input',
|
|
267
267
|
() => {
|
|
268
268
|
assert.equal(fileInput.files?.length, 1);
|
|
269
|
-
assert.equal(fileInput.files?.[0]
|
|
270
|
-
assert.equal(fileInput.files?.[0]
|
|
269
|
+
assert.equal(fileInput.files?.[0]!.name, 'test-file.txt');
|
|
270
|
+
assert.equal(fileInput.files?.[0]!.type, 'text/plain');
|
|
271
271
|
|
|
272
272
|
root.detach();
|
|
273
273
|
|
|
@@ -2,7 +2,7 @@ import '../templating.js';
|
|
|
2
2
|
|
|
3
3
|
import { inject, injectable } from '@joist/di';
|
|
4
4
|
import { attr, css, element, html, listen, query } from '@joist/element';
|
|
5
|
-
import { Changes, effect } from '@joist/observable';
|
|
5
|
+
import { type Changes, effect } from '@joist/observable';
|
|
6
6
|
import { bind } from '@joist/templating';
|
|
7
7
|
|
|
8
8
|
import { HttpService } from '../services/http.service.js';
|
|
@@ -123,7 +123,7 @@ declare global {
|
|
|
123
123
|
<template>
|
|
124
124
|
<usa-bind props="files">
|
|
125
125
|
<usa-file-input-preview part="preview" exportparts="heading, item">
|
|
126
|
-
Selected file <span class="link">Change file</span>
|
|
126
|
+
Selected file <span class="link" part="change-file-btn">Change file</span>
|
|
127
127
|
</usa-file-input-preview>
|
|
128
128
|
</usa-bind>
|
|
129
129
|
</template>
|
|
@@ -313,7 +313,7 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
313
313
|
|
|
314
314
|
this.files = dataTransfer.files;
|
|
315
315
|
|
|
316
|
-
this.dispatchEvent(new Event('input'));
|
|
316
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
317
317
|
|
|
318
318
|
return void 0;
|
|
319
319
|
}
|