@webtides/element-library 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +384 -3
- package/README.md +61 -41
- package/all.js +28 -0
- package/catalog.d.ts +14 -0
- package/catalog.js +55 -27
- package/custom-elements.json +16604 -3420
- package/package.json +35 -28
- package/src/components/accordion/accordion.changelog.md +10 -0
- package/src/components/accordion/accordion.js +10 -7
- package/src/components/accordion/accordion.readme.md +2 -0
- package/src/components/accordion/accordion.style.js +8 -0
- package/src/components/amount-field/amount-field.changelog.md +23 -3
- package/src/components/amount-field/amount-field.js +53 -26
- package/src/components/amount-field/amount-field.readme.md +82 -20
- package/src/components/amount-field/amount-field.style.js +111 -47
- package/src/components/avatar/avatar.changelog.md +23 -0
- package/src/components/avatar/avatar.define.js +3 -0
- package/src/components/avatar/avatar.js +115 -0
- package/src/components/avatar/avatar.readme.md +132 -0
- package/src/components/avatar/avatar.style.js +67 -0
- package/src/components/badge/badge.changelog.md +23 -0
- package/src/components/badge/badge.define.js +3 -0
- package/src/components/badge/badge.js +59 -0
- package/src/components/badge/badge.readme.md +109 -0
- package/src/components/badge/badge.style.js +63 -0
- package/src/components/breadcrumb/breadcrumb.changelog.md +22 -0
- package/src/components/breadcrumb/breadcrumb.define.js +3 -0
- package/src/components/breadcrumb/breadcrumb.js +47 -0
- package/src/components/breadcrumb/breadcrumb.readme.md +108 -0
- package/src/components/breadcrumb/breadcrumb.style.js +20 -0
- package/src/components/breadcrumb-item/breadcrumb-item.changelog.md +23 -0
- package/src/components/breadcrumb-item/breadcrumb-item.define.js +3 -0
- package/src/components/breadcrumb-item/breadcrumb-item.js +82 -0
- package/src/components/breadcrumb-item/breadcrumb-item.readme.md +106 -0
- package/src/components/breadcrumb-item/breadcrumb-item.style.js +92 -0
- package/src/components/button/button.changelog.md +34 -1
- package/src/components/button/button.js +285 -29
- package/src/components/button/button.readme.md +130 -10
- package/src/components/button/button.style.js +99 -120
- package/src/components/button-group/button-group.changelog.md +24 -0
- package/src/components/button-group/button-group.define.js +3 -0
- package/src/components/button-group/button-group.js +53 -0
- package/src/components/button-group/button-group.readme.md +114 -0
- package/src/components/button-group/button-group.style.js +41 -0
- package/src/components/card/card.changelog.md +23 -0
- package/src/components/card/card.define.js +3 -0
- package/src/components/card/card.js +73 -0
- package/src/components/card/card.readme.md +136 -0
- package/src/components/card/card.style.js +99 -0
- package/src/components/carousel/carousel.changelog.md +20 -0
- package/src/components/carousel/carousel.js +89 -40
- package/src/components/carousel/carousel.readme.md +39 -6
- package/src/components/carousel/carousel.style.js +21 -77
- package/src/components/carousel/glide/components/ShadowAnchors.js +3 -1
- package/src/components/carousel/glide/components/ShadowClones.js +21 -24
- package/src/components/carousel/glide/components/ShadowGaps.js +2 -2
- package/src/components/carousel/glide/components/ShadowHtml.js +22 -3
- package/src/components/checkbox-field/checkbox-field.changelog.md +19 -0
- package/src/components/checkbox-field/checkbox-field.js +25 -10
- package/src/components/checkbox-field/checkbox-field.readme.md +17 -4
- package/src/components/checkbox-field/checkbox-field.style.js +15 -3
- package/src/components/checkbox-group-field/checkbox-group-field.changelog.md +25 -0
- package/src/components/checkbox-group-field/checkbox-group-field.define.js +3 -0
- package/src/components/checkbox-group-field/checkbox-group-field.js +217 -0
- package/src/components/checkbox-group-field/checkbox-group-field.readme.md +95 -0
- package/src/components/checkbox-group-field/checkbox-group-field.style.js +62 -0
- package/src/components/color-field/color-field.changelog.md +24 -0
- package/src/components/color-field/color-field.define.js +3 -0
- package/src/components/color-field/color-field.js +184 -0
- package/src/components/color-field/color-field.readme.md +95 -0
- package/src/components/color-field/color-field.style.js +39 -0
- package/src/components/combobox-field/combobox-field.changelog.md +23 -0
- package/src/components/combobox-field/combobox-field.define.js +3 -0
- package/src/components/combobox-field/combobox-field.js +97 -0
- package/src/components/combobox-field/combobox-field.readme.md +93 -0
- package/src/components/combobox-field/combobox-field.style.js +56 -0
- package/src/components/copy-button/copy-button.changelog.md +24 -0
- package/src/components/copy-button/copy-button.define.js +3 -0
- package/src/components/copy-button/copy-button.events.js +4 -0
- package/src/components/copy-button/copy-button.js +237 -0
- package/src/components/copy-button/copy-button.readme.md +134 -0
- package/src/components/copy-button/copy-button.style.js +109 -0
- package/src/components/date-field/date-field.changelog.md +24 -0
- package/src/components/date-field/date-field.define.js +3 -0
- package/src/components/date-field/date-field.js +119 -0
- package/src/components/date-field/date-field.readme.md +110 -0
- package/src/components/date-field/date-field.style.js +53 -0
- package/src/components/dialog/dialog.changelog.md +16 -1
- package/src/components/dialog/dialog.js +252 -57
- package/src/components/dialog/dialog.readme.md +36 -4
- package/src/components/dialog/dialog.style.js +9 -109
- package/src/components/divider/divider.changelog.md +23 -0
- package/src/components/divider/divider.define.js +3 -0
- package/src/components/divider/divider.js +48 -0
- package/src/components/divider/divider.readme.md +101 -0
- package/src/components/divider/divider.style.js +50 -0
- package/src/components/drawer/drawer.changelog.md +25 -0
- package/src/components/drawer/drawer.define.js +3 -0
- package/src/components/drawer/drawer.events.js +8 -0
- package/src/components/drawer/drawer.js +80 -0
- package/src/components/drawer/drawer.readme.md +194 -0
- package/src/components/drawer/drawer.style.js +83 -0
- package/src/components/dropdown/dropdown.js +9 -7
- package/src/components/empty-state/empty-state.changelog.md +22 -0
- package/src/components/empty-state/empty-state.define.js +3 -0
- package/src/components/empty-state/empty-state.js +55 -0
- package/src/components/empty-state/empty-state.readme.md +114 -0
- package/src/components/empty-state/empty-state.style.js +60 -0
- package/src/components/file-field/file-field.changelog.md +24 -0
- package/src/components/file-field/file-field.define.js +3 -0
- package/src/components/file-field/file-field.js +205 -0
- package/src/components/file-field/file-field.readme.md +103 -0
- package/src/components/file-field/file-field.style.js +28 -0
- package/src/components/form-field/form-field.changelog.md +25 -0
- package/src/components/form-field/form-field.js +212 -15
- package/src/components/form-field/form-field.readme.md +82 -18
- package/src/components/form-field/form-field.style.js +6 -24
- package/src/components/input-field/input-field.changelog.md +24 -0
- package/src/components/input-field/input-field.js +82 -6
- package/src/components/input-field/input-field.readme.md +34 -5
- package/src/components/input-field/input-field.style.js +32 -13
- package/src/components/notification/notification.changelog.md +21 -1
- package/src/components/notification/notification.js +80 -74
- package/src/components/notification/notification.readme.md +54 -13
- package/src/components/notification/notification.style.js +37 -22
- package/src/components/otp-field/otp-field.changelog.md +23 -0
- package/src/components/otp-field/otp-field.define.js +3 -0
- package/src/components/otp-field/otp-field.events.js +3 -0
- package/src/components/otp-field/otp-field.js +172 -0
- package/src/components/otp-field/otp-field.readme.md +111 -0
- package/src/components/otp-field/otp-field.style.js +53 -0
- package/src/components/pagination/pagination.changelog.md +30 -0
- package/src/components/pagination/pagination.define.js +3 -0
- package/src/components/pagination/pagination.events.js +3 -0
- package/src/components/pagination/pagination.js +282 -0
- package/src/components/pagination/pagination.readme.md +167 -0
- package/src/components/pagination/pagination.style.js +162 -0
- package/src/components/password-field/password-field.changelog.md +24 -0
- package/src/components/password-field/password-field.js +7 -1
- package/src/components/password-field/password-field.readme.md +15 -6
- package/src/components/password-field/password-field.style.js +36 -13
- package/src/components/popover/popover.changelog.md +24 -0
- package/src/components/popover/popover.define.js +3 -0
- package/src/components/popover/popover.events.js +4 -0
- package/src/components/popover/popover.js +255 -0
- package/src/components/popover/popover.readme.md +132 -0
- package/src/components/popover/popover.style.js +41 -0
- package/src/components/progress-bar/progress-bar.changelog.md +23 -0
- package/src/components/progress-bar/progress-bar.define.js +3 -0
- package/src/components/progress-bar/progress-bar.js +80 -0
- package/src/components/progress-bar/progress-bar.readme.md +110 -0
- package/src/components/progress-bar/progress-bar.style.js +93 -0
- package/src/components/progress-ring/progress-ring.changelog.md +23 -0
- package/src/components/progress-ring/progress-ring.define.js +3 -0
- package/src/components/progress-ring/progress-ring.js +83 -0
- package/src/components/progress-ring/progress-ring.readme.md +115 -0
- package/src/components/progress-ring/progress-ring.style.js +85 -0
- package/src/components/radio-field/radio-field.changelog.md +16 -0
- package/src/components/radio-field/radio-field.js +34 -11
- package/src/components/radio-field/radio-field.readme.md +13 -8
- package/src/components/radio-field/radio-field.style.js +17 -65
- package/src/components/range-field/range-field.changelog.md +24 -0
- package/src/components/range-field/range-field.define.js +3 -0
- package/src/components/range-field/range-field.js +167 -0
- package/src/components/range-field/range-field.readme.md +87 -0
- package/src/components/range-field/range-field.style.js +41 -0
- package/src/components/rating-field/rating-field.changelog.md +24 -0
- package/src/components/rating-field/rating-field.define.js +3 -0
- package/src/components/rating-field/rating-field.js +195 -0
- package/src/components/rating-field/rating-field.readme.md +82 -0
- package/src/components/rating-field/rating-field.style.js +79 -0
- package/src/components/select-field/select-field.changelog.md +17 -0
- package/src/components/select-field/select-field.js +100 -8
- package/src/components/select-field/select-field.readme.md +32 -6
- package/src/components/select-field/select-field.style.js +19 -9
- package/src/components/skeleton/skeleton.changelog.md +22 -0
- package/src/components/skeleton/skeleton.define.js +3 -0
- package/src/components/skeleton/skeleton.js +49 -0
- package/src/components/skeleton/skeleton.readme.md +115 -0
- package/src/components/skeleton/skeleton.style.js +79 -0
- package/src/components/slider/slider.changelog.md +15 -0
- package/src/components/slider/slider.js +37 -5
- package/src/components/slider/slider.readme.md +28 -6
- package/src/components/slider/slider.style.js +7 -71
- package/src/components/spinner/spinner.changelog.md +22 -0
- package/src/components/spinner/spinner.define.js +3 -0
- package/src/components/spinner/spinner.js +48 -0
- package/src/components/spinner/spinner.readme.md +98 -0
- package/src/components/spinner/spinner.style.js +44 -0
- package/src/components/switch-field/switch-field.changelog.md +16 -0
- package/src/components/switch-field/switch-field.js +17 -9
- package/src/components/switch-field/switch-field.readme.md +11 -4
- package/src/components/switch-field/switch-field.style.js +13 -13
- package/src/components/tab-group/tab-group.changelog.md +19 -0
- package/src/components/tab-group/tab-group.js +122 -10
- package/src/components/tab-group/tab-group.readme.md +25 -4
- package/src/components/tab-link/tab-link.changelog.md +16 -0
- package/src/components/tab-link/tab-link.js +51 -8
- package/src/components/tab-link/tab-link.readme.md +14 -8
- package/src/components/tab-link/tab-link.style.js +13 -0
- package/src/components/tab-panel/tab-panel.changelog.md +8 -2
- package/src/components/tab-panel/tab-panel.js +7 -3
- package/src/components/tab-panel/tab-panel.readme.md +7 -5
- package/src/components/tag/tag.changelog.md +24 -0
- package/src/components/tag/tag.define.js +3 -0
- package/src/components/tag/tag.events.js +3 -0
- package/src/components/tag/tag.js +116 -0
- package/src/components/tag/tag.readme.md +119 -0
- package/src/components/tag/tag.style.js +101 -0
- package/src/components/tag-field/tag-field.changelog.md +25 -0
- package/src/components/tag-field/tag-field.define.js +3 -0
- package/src/components/tag-field/tag-field.js +359 -0
- package/src/components/tag-field/tag-field.readme.md +113 -0
- package/src/components/tag-field/tag-field.style.js +62 -0
- package/src/components/textarea-field/textarea-field.changelog.md +28 -4
- package/src/components/textarea-field/textarea-field.js +68 -14
- package/src/components/textarea-field/textarea-field.readme.md +45 -9
- package/src/components/textarea-field/textarea-field.style.js +45 -2
- package/src/components/toast/toast.changelog.md +24 -0
- package/src/components/toast/toast.define.js +3 -0
- package/src/components/toast/toast.js +193 -0
- package/src/components/toast/toast.readme.md +189 -0
- package/src/components/toast/toast.style.js +74 -0
- package/src/components/tooltip/tooltip.changelog.md +24 -0
- package/src/components/tooltip/tooltip.define.js +3 -0
- package/src/components/tooltip/tooltip.events.js +4 -0
- package/src/components/tooltip/tooltip.js +377 -0
- package/src/components/tooltip/tooltip.readme.md +172 -0
- package/src/components/tooltip/tooltip.style.js +107 -0
- package/src/components/transition-classes/transition-classes.js +6 -6
- package/src/styles/appearance.style.js +42 -0
- package/src/styles/arrow.style.js +65 -0
- package/src/styles/choice-group.style.js +94 -0
- package/src/styles/form-control.style.js +79 -0
- package/src/styles/host.style.js +55 -0
- package/src/styles/layers.css +31 -0
- package/src/styles/modal.style.js +146 -0
- package/src/styles/native.css +275 -0
- package/src/styles/size.style.js +48 -0
- package/src/styles/slide-controls.style.js +225 -0
- package/src/styles/utilities.css +30 -0
- package/src/styles/variants.style.js +78 -0
- package/src/themes/default.css +86 -142
- package/src/themes/high-contrast.css +72 -129
- package/src/themes/sketchy.css +95 -175
- package/src/utils/floating.js +71 -0
- package/src/utils/focus.js +18 -0
- package/src/utils/progress.js +25 -0
- package/src/utils/slots.js +21 -0
- package/src/utils/text-entry-attributes.js +51 -0
- package/types/all.d.ts +54 -1
- package/types/index.d.ts +1 -0
- package/types/src/components/accordion/accordion.d.ts +6 -4
- package/types/src/components/accordion/accordion.events.d.ts +3 -3
- package/types/src/components/accordion-group/accordion-group.d.ts +4 -3
- package/types/src/components/amount-field/amount-field.d.ts +30 -16
- package/types/src/components/avatar/avatar.d.ts +57 -0
- package/types/src/components/avatar/avatar.define.d.ts +1 -0
- package/types/src/components/avatar/avatar.style.d.ts +2 -0
- package/types/src/components/badge/badge.d.ts +32 -0
- package/types/src/components/badge/badge.define.d.ts +1 -0
- package/types/src/components/badge/badge.style.d.ts +2 -0
- package/types/src/components/breadcrumb/breadcrumb.d.ts +27 -0
- package/types/src/components/breadcrumb/breadcrumb.define.d.ts +1 -0
- package/types/src/components/breadcrumb/breadcrumb.style.d.ts +2 -0
- package/types/src/components/breadcrumb-item/breadcrumb-item.d.ts +38 -0
- package/types/src/components/breadcrumb-item/breadcrumb-item.define.d.ts +1 -0
- package/types/src/components/breadcrumb-item/breadcrumb-item.style.d.ts +2 -0
- package/types/src/components/button/button.d.ts +129 -14
- package/types/src/components/button-group/button-group.d.ts +28 -0
- package/types/src/components/button-group/button-group.define.d.ts +1 -0
- package/types/src/components/button-group/button-group.style.d.ts +2 -0
- package/types/src/components/card/card.d.ts +40 -0
- package/types/src/components/card/card.define.d.ts +1 -0
- package/types/src/components/card/card.style.d.ts +2 -0
- package/types/src/components/carousel/carousel.d.ts +22 -8
- package/types/src/components/carousel/carousel.events.d.ts +3 -3
- package/types/src/components/carousel/glide/components/ShadowAnchors.d.ts +1 -1
- package/types/src/components/carousel/glide/components/ShadowClones.d.ts +8 -1
- package/types/src/components/carousel/glide/components/ShadowGaps.d.ts +1 -1
- package/types/src/components/carousel/glide/components/ShadowHtml.d.ts +1 -1
- package/types/src/components/carousel/glide/components/glide-html.d.ts +1 -1
- package/types/src/components/checkbox-field/checkbox-field.d.ts +22 -15
- package/types/src/components/checkbox-group-field/checkbox-group-field.d.ts +100 -0
- package/types/src/components/checkbox-group-field/checkbox-group-field.define.d.ts +1 -0
- package/types/src/components/checkbox-group-field/checkbox-group-field.style.d.ts +2 -0
- package/types/src/components/color-field/color-field.d.ts +102 -0
- package/types/src/components/color-field/color-field.define.d.ts +1 -0
- package/types/src/components/color-field/color-field.style.d.ts +2 -0
- package/types/src/components/combobox-field/combobox-field.d.ts +84 -0
- package/types/src/components/combobox-field/combobox-field.define.d.ts +1 -0
- package/types/src/components/combobox-field/combobox-field.style.d.ts +2 -0
- package/types/src/components/copy-button/copy-button.d.ts +93 -0
- package/types/src/components/copy-button/copy-button.define.d.ts +1 -0
- package/types/src/components/copy-button/copy-button.events.d.ts +5 -0
- package/types/src/components/copy-button/copy-button.style.d.ts +2 -0
- package/types/src/components/date-field/date-field.d.ts +102 -0
- package/types/src/components/date-field/date-field.define.d.ts +1 -0
- package/types/src/components/date-field/date-field.style.d.ts +2 -0
- package/types/src/components/dialog/dialog.d.ts +101 -19
- package/types/src/components/dialog/dialog.events.d.ts +8 -8
- package/types/src/components/divider/divider.d.ts +27 -0
- package/types/src/components/divider/divider.define.d.ts +1 -0
- package/types/src/components/divider/divider.style.d.ts +2 -0
- package/types/src/components/drawer/drawer.d.ts +70 -0
- package/types/src/components/drawer/drawer.define.d.ts +1 -0
- package/types/src/components/drawer/drawer.events.d.ts +9 -0
- package/types/src/components/drawer/drawer.style.d.ts +2 -0
- package/types/src/components/dropdown/dropdown.d.ts +5 -3
- package/types/src/components/empty-state/empty-state.d.ts +29 -0
- package/types/src/components/empty-state/empty-state.define.d.ts +1 -0
- package/types/src/components/empty-state/empty-state.style.d.ts +2 -0
- package/types/src/components/file-field/file-field.d.ts +115 -0
- package/types/src/components/file-field/file-field.define.d.ts +1 -0
- package/types/src/components/file-field/file-field.style.d.ts +2 -0
- package/types/src/components/form-field/form-field.d.ts +129 -14
- package/types/src/components/form-field/form-field.events.d.ts +4 -4
- package/types/src/components/input-field/input-field.d.ts +52 -5
- package/types/src/components/lazy-src/lazy-src.d.ts +7 -5
- package/types/src/components/lazy-src/lazy-src.events.d.ts +5 -5
- package/types/src/components/notification/notification.d.ts +18 -18
- package/types/src/components/notification/notification.events.d.ts +6 -6
- package/types/src/components/otp-field/otp-field.d.ts +130 -0
- package/types/src/components/otp-field/otp-field.define.d.ts +1 -0
- package/types/src/components/otp-field/otp-field.events.d.ts +4 -0
- package/types/src/components/otp-field/otp-field.style.d.ts +2 -0
- package/types/src/components/pagination/pagination.d.ts +117 -0
- package/types/src/components/pagination/pagination.define.d.ts +1 -0
- package/types/src/components/pagination/pagination.events.d.ts +4 -0
- package/types/src/components/pagination/pagination.style.d.ts +2 -0
- package/types/src/components/password-field/password-field.d.ts +29 -12
- package/types/src/components/popover/popover.d.ts +123 -0
- package/types/src/components/popover/popover.define.d.ts +1 -0
- package/types/src/components/popover/popover.events.d.ts +5 -0
- package/types/src/components/popover/popover.style.d.ts +2 -0
- package/types/src/components/progress-bar/progress-bar.d.ts +35 -0
- package/types/src/components/progress-bar/progress-bar.define.d.ts +1 -0
- package/types/src/components/progress-bar/progress-bar.style.d.ts +2 -0
- package/types/src/components/progress-ring/progress-ring.d.ts +40 -0
- package/types/src/components/progress-ring/progress-ring.define.d.ts +1 -0
- package/types/src/components/progress-ring/progress-ring.style.d.ts +2 -0
- package/types/src/components/radio-field/radio-field.d.ts +21 -9
- package/types/src/components/range-field/range-field.d.ts +94 -0
- package/types/src/components/range-field/range-field.define.d.ts +1 -0
- package/types/src/components/range-field/range-field.style.d.ts +2 -0
- package/types/src/components/rating-field/rating-field.d.ts +96 -0
- package/types/src/components/rating-field/rating-field.define.d.ts +1 -0
- package/types/src/components/rating-field/rating-field.style.d.ts +2 -0
- package/types/src/components/scroll-to/scroll-to.d.ts +3 -2
- package/types/src/components/scroll-to-top/scroll-to-top.d.ts +4 -2
- package/types/src/components/select-field/select-field.d.ts +55 -5
- package/types/src/components/skeleton/skeleton.d.ts +29 -0
- package/types/src/components/skeleton/skeleton.define.d.ts +1 -0
- package/types/src/components/skeleton/skeleton.style.d.ts +2 -0
- package/types/src/components/slider/slider.d.ts +14 -8
- package/types/src/components/slider/slider.events.d.ts +4 -4
- package/types/src/components/spinner/spinner.d.ts +28 -0
- package/types/src/components/spinner/spinner.define.d.ts +1 -0
- package/types/src/components/spinner/spinner.style.d.ts +2 -0
- package/types/src/components/sticky/sticky.d.ts +4 -2
- package/types/src/components/svg-use/svg-use.d.ts +4 -2
- package/types/src/components/switch-field/switch-field.d.ts +17 -15
- package/types/src/components/tab-group/tab-group.d.ts +44 -3
- package/types/src/components/tab-link/tab-link.d.ts +33 -10
- package/types/src/components/tab-panel/tab-panel.d.ts +8 -5
- package/types/src/components/tag/tag.d.ts +53 -0
- package/types/src/components/tag/tag.define.d.ts +1 -0
- package/types/src/components/tag/tag.events.d.ts +4 -0
- package/types/src/components/tag/tag.style.d.ts +2 -0
- package/types/src/components/tag-field/tag-field.d.ts +178 -0
- package/types/src/components/tag-field/tag-field.define.d.ts +1 -0
- package/types/src/components/tag-field/tag-field.style.d.ts +2 -0
- package/types/src/components/textarea-field/textarea-field.d.ts +44 -4
- package/types/src/components/toast/toast.d.ts +110 -0
- package/types/src/components/toast/toast.define.d.ts +1 -0
- package/types/src/components/toast/toast.style.d.ts +2 -0
- package/types/src/components/tooltip/tooltip.d.ts +161 -0
- package/types/src/components/tooltip/tooltip.define.d.ts +1 -0
- package/types/src/components/tooltip/tooltip.events.d.ts +5 -0
- package/types/src/components/tooltip/tooltip.style.d.ts +2 -0
- package/types/src/components/transition-classes/transition-classes.d.ts +9 -8
- package/types/src/styles/appearance.style.d.ts +18 -0
- package/types/src/styles/arrow.style.d.ts +15 -0
- package/types/src/styles/choice-group.style.d.ts +23 -0
- package/types/src/styles/form-control.style.d.ts +26 -0
- package/types/src/styles/host.style.d.ts +24 -0
- package/types/src/styles/modal.style.d.ts +20 -0
- package/types/src/styles/size.style.d.ts +20 -0
- package/types/src/styles/slide-controls.style.d.ts +20 -0
- package/types/src/styles/variants.style.d.ts +32 -0
- package/types/src/utils/body-scroll.d.ts +12 -2
- package/types/src/utils/floating.d.ts +36 -0
- package/types/src/utils/focus.d.ts +16 -0
- package/types/src/utils/progress.d.ts +19 -0
- package/types/src/utils/slots.d.ts +19 -0
- package/types/src/utils/text-entry-attributes.d.ts +18 -0
- package/types/src/utils/transitions.d.ts +2 -2
- package/web-types.json +6590 -1584
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { StyledElement } from '@webtides/element-js';
|
|
2
2
|
/**
|
|
3
|
-
* Content panel paired with an `<el-tab-link>` by `name
|
|
4
|
-
* parent `<el-tab-group>`, which toggles `display: block / none` based on the
|
|
5
|
-
* selection.
|
|
3
|
+
* Content panel paired with an `<el-tab-link>` by `name` (`role="tabpanel"`). Visibility is
|
|
4
|
+
* driven by the parent `<el-tab-group>`, which toggles `display: block / none` based on the
|
|
5
|
+
* active selection and labels the panel by its link (`aria-labelledby`).
|
|
6
6
|
*
|
|
7
7
|
* @element el-tab-panel
|
|
8
8
|
*
|
|
@@ -11,8 +11,11 @@ export function define(): void;
|
|
|
11
11
|
* @property {string | undefined} name - Identifier matched by a `<el-tab-link for="…">` to
|
|
12
12
|
* activate this panel.
|
|
13
13
|
*/
|
|
14
|
-
export default class TabPanel {
|
|
14
|
+
export default class TabPanel extends StyledElement {
|
|
15
|
+
constructor();
|
|
15
16
|
properties(): {
|
|
16
17
|
name: any;
|
|
17
18
|
};
|
|
19
|
+
connected(): void;
|
|
18
20
|
}
|
|
21
|
+
export declare function define(): void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
import Events from './tag.events.js';
|
|
3
|
+
/**
|
|
4
|
+
* A tag: a label for one of several things that belong to something, a keyword of an article or a
|
|
5
|
+
* filter that is set. With `removable` it has a button that asks to take it away. It speaks the
|
|
6
|
+
* library's shared vocabulary: a semantic `variant`, an `appearance` and a `size`.
|
|
7
|
+
*
|
|
8
|
+
* The tag does not remove itself. Its button fires `tag-remove`, and the page decides what that
|
|
9
|
+
* means: take the element out of a list, clear a filter.
|
|
10
|
+
*
|
|
11
|
+
* @element el-tag
|
|
12
|
+
*
|
|
13
|
+
* @fires {CustomEvent} tag-remove - Fired when the remove button is activated.
|
|
14
|
+
*
|
|
15
|
+
* @slot - The text of the tag.
|
|
16
|
+
*
|
|
17
|
+
* @csspart base - The surface of the tag: background, border, radius.
|
|
18
|
+
* @csspart content - The wrapper around the default slot. A text that is too long is cut off here.
|
|
19
|
+
* @csspart remove-button - The remove button, present only while `removable` is `true`.
|
|
20
|
+
*
|
|
21
|
+
* @property {'neutral'|'brand'|'success'|'warning'|'danger'} variant - Semantic variant, which
|
|
22
|
+
* picks the colours. Default `'neutral'`. Reflected to the `variant` attribute.
|
|
23
|
+
* @property {'filled'|'outlined'|'plain'} appearance - How the colours of the variant are painted:
|
|
24
|
+
* as a fill, as a border around a transparent tag, or as text only. Default `'filled'`.
|
|
25
|
+
* Reflected to the `appearance` attribute.
|
|
26
|
+
* @property {'small'|'medium'|'large'} size - Tag size. Default `'medium'`. Reflected to the
|
|
27
|
+
* `size` attribute.
|
|
28
|
+
* @property {boolean} pill - Fully rounded ends.
|
|
29
|
+
* @property {boolean} removable - Whether to render the remove button. Default `false`.
|
|
30
|
+
* @property {string} removeLabel - The word the remove button is named with, in front of the text
|
|
31
|
+
* of the tag: "Remove TypeScript". Default `'Remove'`.
|
|
32
|
+
*/
|
|
33
|
+
export default class Tag extends TemplateElement {
|
|
34
|
+
constructor();
|
|
35
|
+
properties(): {
|
|
36
|
+
variant: string;
|
|
37
|
+
appearance: string;
|
|
38
|
+
size: string;
|
|
39
|
+
pill: boolean;
|
|
40
|
+
removable: boolean;
|
|
41
|
+
removeLabel: string;
|
|
42
|
+
};
|
|
43
|
+
events(): {
|
|
44
|
+
'[data-remove]': {
|
|
45
|
+
click: () => any;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** @private */
|
|
49
|
+
private removeButtonTemplate;
|
|
50
|
+
template(): any;
|
|
51
|
+
}
|
|
52
|
+
export declare function define(): void;
|
|
53
|
+
export { Events };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import FormField from '../form-field/form-field.js';
|
|
2
|
+
/**
|
|
3
|
+
* A list of short texts the user writes: keywords, skills, recipients. A text input that turns
|
|
4
|
+
* what is entered into entries, each an `el-tag` with a remove button, and submits them under one
|
|
5
|
+
* name. Extends `FormField` and inherits its label / help / error / required surface.
|
|
6
|
+
*
|
|
7
|
+
* Enter adds the text of the input as an entry, and so does a comma, typed or pasted. Text that is
|
|
8
|
+
* still in the input when its form is submitted becomes an entry as well.
|
|
9
|
+
*
|
|
10
|
+
* @element el-tag-field
|
|
11
|
+
*
|
|
12
|
+
* @fires {CustomEvent<string[]>} input-change - Fired when the entries change. `detail` is the
|
|
13
|
+
* list of the entries. Bubbles.
|
|
14
|
+
*
|
|
15
|
+
* @cssstate touched - Set once the user has left the field, or the browser has refused a submit
|
|
16
|
+
* because of it. Inherits `valid` and `invalid` from `FormField`.
|
|
17
|
+
*
|
|
18
|
+
* @property {string[]} value - The entries, in the order they were added. As an attribute it is
|
|
19
|
+
* JSON: `value='["TypeScript", "Svelte"]'`.
|
|
20
|
+
* @property {boolean} required - Whether the list needs at least one entry.
|
|
21
|
+
* @property {'small'|'medium'|'large'} size - Size of the input and of the tags. Default
|
|
22
|
+
* `'medium'`. Reflected to the `size` attribute. On the input it shows once the control is
|
|
23
|
+
* decorated (`styles/native.css`).
|
|
24
|
+
* @property {string} placeholder - Placeholder text shown while the input is empty.
|
|
25
|
+
* @property {string} removeLabel - The word the remove button of an entry is named with, in front
|
|
26
|
+
* of the entry: "Remove TypeScript". Default `'Remove'`.
|
|
27
|
+
* @property {string} addedLabel - What a screen reader hears in front of an entry that was added:
|
|
28
|
+
* "Added TypeScript". Default `'Added'`.
|
|
29
|
+
* @property {string} removedLabel - What a screen reader hears in front of an entry that was
|
|
30
|
+
* removed: "Removed TypeScript". Default `'Removed'`.
|
|
31
|
+
* @property {string} status - What the field last told a screen reader. Set by the field.
|
|
32
|
+
*/
|
|
33
|
+
export default class TagField extends FormField {
|
|
34
|
+
status: string;
|
|
35
|
+
/**
|
|
36
|
+
* Where the field listens for the submit of its form, see `afterUpdate()`.
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
private _submitRoot;
|
|
40
|
+
constructor(options: any);
|
|
41
|
+
properties(): {
|
|
42
|
+
name: string;
|
|
43
|
+
required: boolean;
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
label: string;
|
|
46
|
+
labelScreenReaderOnly: boolean;
|
|
47
|
+
errorMessage: string;
|
|
48
|
+
helpMessage: string;
|
|
49
|
+
valid: boolean;
|
|
50
|
+
touched: boolean;
|
|
51
|
+
value: any[];
|
|
52
|
+
size: string;
|
|
53
|
+
placeholder: string;
|
|
54
|
+
removeLabel: string;
|
|
55
|
+
addedLabel: string;
|
|
56
|
+
removedLabel: string;
|
|
57
|
+
status: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* As an input field, a required field without an entry is not marked as not valid before the
|
|
61
|
+
* user has been in it: `styles/native.css` paints the border of such an input in the danger
|
|
62
|
+
* colour. An error the page renders the field with (`valid="false"`) shows from the start.
|
|
63
|
+
*/
|
|
64
|
+
connected(): void;
|
|
65
|
+
afterUpdate(): void;
|
|
66
|
+
disconnected(): void;
|
|
67
|
+
/**
|
|
68
|
+
* The form of the field is being submitted. Text that is still in the input becomes an entry:
|
|
69
|
+
* nothing that was typed is lost on the way to the submit button.
|
|
70
|
+
*
|
|
71
|
+
* Not earlier, when the user leaves the field. A new entry makes the field higher, and what is
|
|
72
|
+
* below it moves: the submit button would move away under the pointer that is pressing it, and
|
|
73
|
+
* the click would be lost.
|
|
74
|
+
*
|
|
75
|
+
* The form data is put together right after this event, and a listener of the page can read it
|
|
76
|
+
* in the same event. The hidden input of every entry has to be there by then, and element-js
|
|
77
|
+
* renders a frame after a change: so the field is rendered here and now, also for an entry that
|
|
78
|
+
* was added or removed a moment ago.
|
|
79
|
+
* @private
|
|
80
|
+
* @param {SubmitEvent} event
|
|
81
|
+
*/
|
|
82
|
+
private _onFormSubmit;
|
|
83
|
+
events(): {
|
|
84
|
+
'[ref=input]': {
|
|
85
|
+
keydown: (event: any) => void;
|
|
86
|
+
input: (event: any) => void;
|
|
87
|
+
focus: () => void;
|
|
88
|
+
invalid: (event: any) => void;
|
|
89
|
+
};
|
|
90
|
+
this: {
|
|
91
|
+
focusout: (event: any) => void;
|
|
92
|
+
'tag-remove': (event: any) => void;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
onFocus(): void;
|
|
96
|
+
onBlur(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Enter adds the text of the input and does not submit the form. In the empty input it is left
|
|
99
|
+
* to the browser, which submits the form, as in any text input.
|
|
100
|
+
* @private
|
|
101
|
+
* @param {KeyboardEvent} event
|
|
102
|
+
*/
|
|
103
|
+
private _onKeydown;
|
|
104
|
+
/**
|
|
105
|
+
* A comma ends an entry. What is pasted or dropped is a list of entries, all of it. A comma
|
|
106
|
+
* that is typed ends the entry in front of it, and what follows is the start of the next one.
|
|
107
|
+
* The input is read and not the key: an on-screen keyboard does not say which key it was.
|
|
108
|
+
*
|
|
109
|
+
* Text in the input counts for a required field, see `_computeValid()`.
|
|
110
|
+
* @private
|
|
111
|
+
* @param {InputEvent} event
|
|
112
|
+
*/
|
|
113
|
+
private _onInput;
|
|
114
|
+
/**
|
|
115
|
+
* The focus has left an element of the field. Once it has left the field, the field is touched.
|
|
116
|
+
* @private
|
|
117
|
+
* @param {FocusEvent} event
|
|
118
|
+
*/
|
|
119
|
+
private _onFocusOut;
|
|
120
|
+
/**
|
|
121
|
+
* The remove button of an entry was activated. The entry goes, and the focus with it: to the
|
|
122
|
+
* entry that takes its place, or to the input after the last one was removed.
|
|
123
|
+
* @private
|
|
124
|
+
* @param {Event} event
|
|
125
|
+
*/
|
|
126
|
+
private _onRemove;
|
|
127
|
+
/**
|
|
128
|
+
* Makes an entry of the text of the input, and empties the input.
|
|
129
|
+
* @private
|
|
130
|
+
* @returns {boolean} Whether there was an entry to add.
|
|
131
|
+
*/
|
|
132
|
+
private _addFromInput;
|
|
133
|
+
/**
|
|
134
|
+
* Adds entries to the list: trimmed, and neither an empty one nor one the list already has.
|
|
135
|
+
* @private
|
|
136
|
+
* @param {string[]} texts
|
|
137
|
+
* @returns {boolean} Whether there was an entry to add.
|
|
138
|
+
*/
|
|
139
|
+
private _add;
|
|
140
|
+
/**
|
|
141
|
+
* The entries as a list of texts. An attribute that is no JSON list gives a single text.
|
|
142
|
+
* @private
|
|
143
|
+
* @returns {string[]}
|
|
144
|
+
*/
|
|
145
|
+
private _values;
|
|
146
|
+
/**
|
|
147
|
+
* Whether the field currently passes validation: required means at least one entry. Text in
|
|
148
|
+
* the input counts as one: it becomes an entry when the form is submitted.
|
|
149
|
+
* @private
|
|
150
|
+
*/
|
|
151
|
+
private _computeValid;
|
|
152
|
+
/**
|
|
153
|
+
* A native input knows no "at least one entry": it is empty most of the time, with or without
|
|
154
|
+
* entries. So the input carries that for the field, as a validity of its own: the browser then
|
|
155
|
+
* refuses to submit the form, focuses the input and shows its bubble there, as it does for every
|
|
156
|
+
* other field that is required and empty.
|
|
157
|
+
*
|
|
158
|
+
* After every render, and at once when the list changes: the form can be submitted before the
|
|
159
|
+
* next render.
|
|
160
|
+
* @private
|
|
161
|
+
*/
|
|
162
|
+
private _syncControl;
|
|
163
|
+
/**
|
|
164
|
+
* The input, the entries, what a screen reader is told, and one hidden input for every entry:
|
|
165
|
+
* these are what the form submits, also before the script has run for a list the server
|
|
166
|
+
* rendered.
|
|
167
|
+
* @private
|
|
168
|
+
*/
|
|
169
|
+
private fieldTemplate;
|
|
170
|
+
/**
|
|
171
|
+
* The entries, as a list that has the name of the field. A field that is disabled has no
|
|
172
|
+
* remove buttons.
|
|
173
|
+
* @private
|
|
174
|
+
* @param {string[]} values
|
|
175
|
+
*/
|
|
176
|
+
private tagsTemplate;
|
|
177
|
+
}
|
|
178
|
+
export declare function define(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import FormField from '../form-field/form-field.js';
|
|
2
2
|
/**
|
|
3
3
|
* Native `<textarea>` wrapper with label, help text, validation feedback (visual
|
|
4
4
|
* checkmark / cross indicators) and ARIA wiring. Extends `FormField` and inherits its
|
|
@@ -12,11 +12,21 @@ export function define(): void;
|
|
|
12
12
|
* @property {string} placeholder - Placeholder text shown while the textarea is empty.
|
|
13
13
|
* @property {number} rows - Number of visible text rows. Forwarded to the underlying
|
|
14
14
|
* `<textarea>`'s `rows` attribute.
|
|
15
|
+
* @property {string | null} autocomplete - Passed on to the control as its `autocomplete`
|
|
16
|
+
* attribute (e.g. `'email'`, `'current-password'`, `'one-time-code'`). `null` (the default)
|
|
17
|
+
* leaves the attribute out. The same holds for the five properties below.
|
|
18
|
+
* @property {string | null} inputmode - Passed on as `inputmode`: the on-screen keyboard to show
|
|
19
|
+
* (e.g. `'numeric'`, `'email'`).
|
|
20
|
+
* @property {string | null} enterkeyhint - Passed on as `enterkeyhint`: the label of the enter key
|
|
21
|
+
* on an on-screen keyboard (e.g. `'next'`, `'send'`).
|
|
22
|
+
* @property {string | null} autocapitalize - Passed on as `autocapitalize` (e.g. `'none'`,
|
|
23
|
+
* `'sentences'`).
|
|
24
|
+
* @property {string | null} autocorrect - Passed on as `autocorrect` (`'on'` or `'off'`).
|
|
25
|
+
* @property {boolean | string | null} spellcheck - Passed on as `spellcheck` (`true` or `false`).
|
|
15
26
|
*/
|
|
16
27
|
export default class TextareaField extends FormField {
|
|
28
|
+
constructor(options: any);
|
|
17
29
|
properties(): {
|
|
18
|
-
placeholder: string;
|
|
19
|
-
rows: number;
|
|
20
30
|
name: string;
|
|
21
31
|
value: any;
|
|
22
32
|
required: boolean;
|
|
@@ -27,8 +37,38 @@ export default class TextareaField extends FormField {
|
|
|
27
37
|
helpMessage: string;
|
|
28
38
|
valid: boolean;
|
|
29
39
|
touched: boolean;
|
|
40
|
+
placeholder: string;
|
|
41
|
+
rows: number;
|
|
42
|
+
autocomplete: any;
|
|
43
|
+
inputmode: any;
|
|
44
|
+
enterkeyhint: any;
|
|
45
|
+
autocapitalize: any;
|
|
46
|
+
autocorrect: any;
|
|
47
|
+
spellcheck: any;
|
|
48
|
+
};
|
|
49
|
+
watch(): {
|
|
50
|
+
valid: () => void;
|
|
51
|
+
touched: () => void;
|
|
52
|
+
value: (value: any, oldValue: any) => void;
|
|
53
|
+
};
|
|
54
|
+
events(): {
|
|
55
|
+
'.is-invalid': {
|
|
56
|
+
focus: () => void;
|
|
57
|
+
};
|
|
58
|
+
'[data-clear-input]': {
|
|
59
|
+
click: () => void;
|
|
60
|
+
touchstart: () => void;
|
|
61
|
+
};
|
|
62
|
+
'[ref=input]': {
|
|
63
|
+
focus: () => void;
|
|
64
|
+
blur: () => void;
|
|
65
|
+
keyup: (event: any) => void;
|
|
66
|
+
change: () => void;
|
|
67
|
+
invalid: (event: any) => void;
|
|
68
|
+
input: () => void;
|
|
69
|
+
};
|
|
30
70
|
};
|
|
31
71
|
/** @private */
|
|
32
72
|
private fieldTemplate;
|
|
33
73
|
}
|
|
34
|
-
|
|
74
|
+
export declare function define(): void;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
/**
|
|
3
|
+
* The region of a page where toasts appear: short messages about something that has just
|
|
4
|
+
* happened, which come by themselves and leave by themselves. A toast is an `el-notification`;
|
|
5
|
+
* the region gives it its place at an edge of the viewport, puts several of them into a stack,
|
|
6
|
+
* and lets no more than `max` of them show at once. The rest wait for their turn.
|
|
7
|
+
*
|
|
8
|
+
* `toast()` shows a message, on the element or as the function of the same name that this module
|
|
9
|
+
* exports. The function uses the first `el-toast` of the page and adds one when there is none.
|
|
10
|
+
*
|
|
11
|
+
* While it has toasts the element is a native popover of the platform (`popover="manual"`), which
|
|
12
|
+
* owns the top layer: nothing of the page lies on top of a toast. Without toasts it is not shown.
|
|
13
|
+
*
|
|
14
|
+
* @element el-toast
|
|
15
|
+
*
|
|
16
|
+
* @slot - The toasts, `el-notification` elements. `toast()` puts them here.
|
|
17
|
+
*
|
|
18
|
+
* @csspart base - The stack of the toasts. It is the landmark with the name in `label`.
|
|
19
|
+
*
|
|
20
|
+
* @cssproperty --el-toast-inset - The distance of the stack from the edges of the viewport. Unset,
|
|
21
|
+
* it is `--el-space-4`.
|
|
22
|
+
*
|
|
23
|
+
* @property {'top-start'|'top'|'top-end'|'bottom-start'|'bottom'|'bottom-end'} placement - The
|
|
24
|
+
* edge of the viewport the toasts appear at, and with `-start` or `-end` the corner. Default
|
|
25
|
+
* `'top-end'`. Reflected to the `placement` attribute.
|
|
26
|
+
* @property {number} max - How many toasts show at once. The ones beyond that wait until a place
|
|
27
|
+
* is free. Default `Infinity`: no limit.
|
|
28
|
+
* @property {string} label - The name of the landmark. Default `'Notifications'`.
|
|
29
|
+
*/
|
|
30
|
+
export default class Toast extends TemplateElement {
|
|
31
|
+
/**
|
|
32
|
+
* The toasts that wait for a place, in the order they came.
|
|
33
|
+
* @private
|
|
34
|
+
* @type {HTMLElement[]}
|
|
35
|
+
*/
|
|
36
|
+
_waiting;
|
|
37
|
+
constructor();
|
|
38
|
+
properties(): {
|
|
39
|
+
placement: string;
|
|
40
|
+
max: number;
|
|
41
|
+
label: string;
|
|
42
|
+
};
|
|
43
|
+
connected(): void;
|
|
44
|
+
watch(): {
|
|
45
|
+
max: () => void;
|
|
46
|
+
};
|
|
47
|
+
events(): {
|
|
48
|
+
"[part~='base']": {
|
|
49
|
+
'notification-after-hide': (event: any) => void;
|
|
50
|
+
slotchange: () => void;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Shows a message as a toast. A text, or a node for a message with markup, becomes a
|
|
55
|
+
* notification that can be closed and leaves by itself after five seconds; the options change
|
|
56
|
+
* that. An `el-notification` is shown as it is, with the options on top.
|
|
57
|
+
*
|
|
58
|
+
* A toast beyond `max` waits and is shown when a place is free.
|
|
59
|
+
* @param {string | Node} message - The text, the content, or an `el-notification`.
|
|
60
|
+
* @param {object} [options]
|
|
61
|
+
* @param {'neutral'|'brand'|'success'|'warning'|'danger'} [options.variant] - The variant of
|
|
62
|
+
* the notification.
|
|
63
|
+
* @param {number} [options.duration] - How long the toast stays, in milliseconds. `Infinity`
|
|
64
|
+
* keeps it until it is closed.
|
|
65
|
+
* @param {boolean} [options.closable] - Whether the toast has a close button.
|
|
66
|
+
* @param {string} [options.closeLabel] - The accessible label of the close button.
|
|
67
|
+
* @returns {HTMLElement} The `el-notification`: `hide()` takes it away early, and it fires
|
|
68
|
+
* the events of a notification.
|
|
69
|
+
*/
|
|
70
|
+
toast(message: string | Node, options?: {
|
|
71
|
+
variant?: 'neutral' | 'brand' | 'success' | 'warning' | 'danger';
|
|
72
|
+
duration?: number;
|
|
73
|
+
closable?: boolean;
|
|
74
|
+
closeLabel?: string;
|
|
75
|
+
}): HTMLElement;
|
|
76
|
+
/**
|
|
77
|
+
* Shows the toasts that wait, as long as there is a place for them.
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
private _showNext;
|
|
81
|
+
/**
|
|
82
|
+
* Has the region in the top layer while it has toasts, and out of it without: an empty region
|
|
83
|
+
* is nothing to see and no landmark to stop at.
|
|
84
|
+
*
|
|
85
|
+
* The top layer is a stack: what is opened later lies above. A region that is shown already
|
|
86
|
+
* would have its next toast below a dialog that was opened in the meantime, so a new toast
|
|
87
|
+
* takes the region out and puts it in again, which is on top. Both happen before the browser
|
|
88
|
+
* paints.
|
|
89
|
+
* @private
|
|
90
|
+
* @param {object} [options]
|
|
91
|
+
* @param {boolean} [options.toFront] - Whether a region that is shown comes to the front.
|
|
92
|
+
*/
|
|
93
|
+
private _syncTopLayer;
|
|
94
|
+
/**
|
|
95
|
+
* A toast has left: it goes out of the page, and the next one that waits gets its place.
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
private _onAfterHide;
|
|
99
|
+
template(): any;
|
|
100
|
+
}
|
|
101
|
+
export declare function define(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Shows a message as a toast in the region of the page: the first `el-toast` of the document. A
|
|
104
|
+
* page without one gets one at the end of its body, with the defaults. For the arguments see
|
|
105
|
+
* `toast()` of the element.
|
|
106
|
+
* @param {string | Node} message
|
|
107
|
+
* @param {object} [options]
|
|
108
|
+
* @returns {HTMLElement} The `el-notification`.
|
|
109
|
+
*/
|
|
110
|
+
export declare function toast(message: string | Node, options?: object): HTMLElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { TemplateElement } from '@webtides/element-js';
|
|
2
|
+
import Events from './tooltip.events.js';
|
|
3
|
+
/**
|
|
4
|
+
* A short text that explains another element, its anchor. It appears next to the anchor while the
|
|
5
|
+
* pointer is over it or while it has the focus of the keyboard, and `Escape` closes it. The
|
|
6
|
+
* tooltip names its anchor by id with `for`, the way a `<label>` does, and is the description of
|
|
7
|
+
* that element for a screen reader (`aria-describedby`), open or not.
|
|
8
|
+
*
|
|
9
|
+
* The element is a native popover of the platform (`popover="manual"`), which owns the top layer:
|
|
10
|
+
* nothing clips the tooltip or lies on top of it. The component adds the opening and closing and
|
|
11
|
+
* the place: at the side of the anchor that `placement` names, on the other side when there is no
|
|
12
|
+
* room, and never outside the viewport.
|
|
13
|
+
*
|
|
14
|
+
* @element el-tooltip
|
|
15
|
+
*
|
|
16
|
+
* @fires {CustomEvent} tooltip-show - Fired when the tooltip has opened.
|
|
17
|
+
* @fires {CustomEvent} tooltip-hide - Fired when the tooltip has closed.
|
|
18
|
+
*
|
|
19
|
+
* @slot - The text of the tooltip.
|
|
20
|
+
*
|
|
21
|
+
* @csspart body - The surface of the tooltip: background, text colour, padding, radius.
|
|
22
|
+
* @csspart arrow - The arrow that points to the anchor, present only while `arrow` is `true`.
|
|
23
|
+
*
|
|
24
|
+
* @cssstate open - Set while the tooltip is shown. Style with `:host(:state(open))` or
|
|
25
|
+
* `el-tooltip:state(open)` from outside.
|
|
26
|
+
*
|
|
27
|
+
* @property {string} for - The id of the anchor: the element the tooltip explains and opens from.
|
|
28
|
+
* It is looked up in the document or the shadow root the tooltip is in.
|
|
29
|
+
* @property {boolean} open - Whether the tooltip is shown. Reflected to the `open` attribute.
|
|
30
|
+
* @property {'top'|'top-start'|'top-end'|'bottom'|'bottom-start'|'bottom-end'|'left'|'left-start'|'left-end'|'right'|'right-start'|'right-end'} placement -
|
|
31
|
+
* The side of the anchor the tooltip is placed at, and with `-start` or `-end` the edge of the
|
|
32
|
+
* anchor it is aligned with. Without room there, the tooltip goes to the opposite side. Default
|
|
33
|
+
* `'top'`.
|
|
34
|
+
* @property {number} distance - The gap between the anchor and the tooltip, or the tip of its
|
|
35
|
+
* arrow, in pixels. Default `8`.
|
|
36
|
+
* @property {number} showDelay - How long the pointer has to rest on the anchor before the tooltip
|
|
37
|
+
* opens, in milliseconds. Default `150`. The focus of the keyboard opens it at once.
|
|
38
|
+
* @property {number} hideDelay - How long the tooltip stays after the pointer has left, in
|
|
39
|
+
* milliseconds. Default `0`.
|
|
40
|
+
* @property {boolean} arrow - Whether the tooltip has an arrow that points to the anchor. Default
|
|
41
|
+
* `false`.
|
|
42
|
+
* @property {boolean} disabled - Takes the pointer and the focus out of it: the tooltip no longer
|
|
43
|
+
* opens or closes for them, only for a script and for `Escape`. A tooltip that is open when it
|
|
44
|
+
* becomes disabled closes. It stays the description of its anchor. Default `false`.
|
|
45
|
+
*/
|
|
46
|
+
export default class Tooltip extends TemplateElement {
|
|
47
|
+
/**
|
|
48
|
+
* Why the tooltip is wanted right now: the pointer is over the `anchor` or over the
|
|
49
|
+
* `tooltip`, or the anchor has the `focus` of the keyboard.
|
|
50
|
+
* @private
|
|
51
|
+
* @type {Set<'anchor' | 'tooltip' | 'focus'>}
|
|
52
|
+
*/
|
|
53
|
+
_reasons;
|
|
54
|
+
open: any;
|
|
55
|
+
id: string;
|
|
56
|
+
_anchor: any;
|
|
57
|
+
_anchorListeners: AbortController;
|
|
58
|
+
_timer: number;
|
|
59
|
+
_openListeners: AbortController;
|
|
60
|
+
_stopFollowing: () => void;
|
|
61
|
+
_gap: any;
|
|
62
|
+
constructor();
|
|
63
|
+
properties(): {
|
|
64
|
+
for: string;
|
|
65
|
+
open: boolean;
|
|
66
|
+
placement: string;
|
|
67
|
+
distance: number;
|
|
68
|
+
showDelay: number;
|
|
69
|
+
hideDelay: number;
|
|
70
|
+
arrow: boolean;
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
};
|
|
73
|
+
connected(): void;
|
|
74
|
+
disconnected(): void;
|
|
75
|
+
afterUpdate(): void;
|
|
76
|
+
watch(): {
|
|
77
|
+
open: (open: any) => void;
|
|
78
|
+
for: () => void;
|
|
79
|
+
disabled: (disabled: any) => void;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Opens the tooltip. A tooltip without an anchor in the page stays closed.
|
|
83
|
+
* @returns {void}
|
|
84
|
+
*/
|
|
85
|
+
show(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Closes the tooltip.
|
|
88
|
+
* @returns {void}
|
|
89
|
+
*/
|
|
90
|
+
hide(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Makes the element what a tooltip is to the platform: a popover that only a script opens and
|
|
93
|
+
* closes, with the role of a tooltip and an id by which its anchor can name it.
|
|
94
|
+
* @private
|
|
95
|
+
*/
|
|
96
|
+
private _prepare;
|
|
97
|
+
/**
|
|
98
|
+
* Looks the anchor up and binds the tooltip to it: the anchor is described by the tooltip, and
|
|
99
|
+
* the pointer and the focus on it open and close the tooltip. The pointer on the tooltip itself
|
|
100
|
+
* counts as well, so that it can be moved onto the text.
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
private _attach;
|
|
104
|
+
/** @private */
|
|
105
|
+
private _detach;
|
|
106
|
+
/**
|
|
107
|
+
* Adds the id of the tooltip to the `aria-describedby` of its anchor, or takes it away again.
|
|
108
|
+
* What else the anchor is described by stays.
|
|
109
|
+
* @private
|
|
110
|
+
* @param {Element} anchor
|
|
111
|
+
* @param {boolean} described
|
|
112
|
+
*/
|
|
113
|
+
private _describe;
|
|
114
|
+
/** @private */
|
|
115
|
+
private _onPointerEnter;
|
|
116
|
+
/** @private */
|
|
117
|
+
private _onPointerLeave;
|
|
118
|
+
/** @private */
|
|
119
|
+
private _onFocusIn;
|
|
120
|
+
/** @private */
|
|
121
|
+
private _onFocusOut;
|
|
122
|
+
/**
|
|
123
|
+
* The platform has opened or closed the popover, by `showPopover()` or `hidePopover()` on the
|
|
124
|
+
* element.
|
|
125
|
+
* @private
|
|
126
|
+
*/
|
|
127
|
+
private _onToggle;
|
|
128
|
+
/** @private */
|
|
129
|
+
private _onKeyDown;
|
|
130
|
+
/**
|
|
131
|
+
* Opens or closes the tooltip after a delay, by what is the case then. The decision is always
|
|
132
|
+
* taken in a task of its own, also without a delay: a pointer that goes from the anchor onto
|
|
133
|
+
* the tooltip leaves the one before it enters the other.
|
|
134
|
+
* @private
|
|
135
|
+
* @param {number} delay - In milliseconds.
|
|
136
|
+
*/
|
|
137
|
+
private _schedule;
|
|
138
|
+
/**
|
|
139
|
+
* Closes the tooltip now. It opens again when the pointer or the focus comes anew, not for the
|
|
140
|
+
* one that is still on the anchor.
|
|
141
|
+
* @private
|
|
142
|
+
*/
|
|
143
|
+
private _dismiss;
|
|
144
|
+
/** @private */
|
|
145
|
+
private _applyOpen;
|
|
146
|
+
/** @private */
|
|
147
|
+
private _applyClose;
|
|
148
|
+
/**
|
|
149
|
+
* Places the tooltip now, and again whenever the anchor moves: on scroll, on resize, when the
|
|
150
|
+
* anchor or the tooltip changes its size.
|
|
151
|
+
* @private
|
|
152
|
+
*/
|
|
153
|
+
private _startPositioning;
|
|
154
|
+
/** @private */
|
|
155
|
+
private _stopPositioning;
|
|
156
|
+
/** @private */
|
|
157
|
+
private _position;
|
|
158
|
+
template(): any;
|
|
159
|
+
}
|
|
160
|
+
export declare function define(): void;
|
|
161
|
+
export { Events };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { BaseElement } from '@webtides/element-js';
|
|
2
2
|
/**
|
|
3
3
|
* Applies transition classes to the host element across `enter` / `enter-start` /
|
|
4
4
|
* `enter-end` and `leave` / `leave-start` / `leave-end` stages, driven by the `show`
|
|
@@ -9,17 +9,17 @@ export function define(): void;
|
|
|
9
9
|
*
|
|
10
10
|
* @slot - Default slot for the element(s) being transitioned.
|
|
11
11
|
*
|
|
12
|
-
* @attr enter - Space-separated classes added throughout the enter transition.
|
|
13
|
-
* @attr enter-start - Classes applied at the start of the enter transition.
|
|
14
|
-
* @attr enter-end - Classes applied at the end of the enter transition.
|
|
15
|
-
* @attr leave - Space-separated classes added throughout the leave transition.
|
|
16
|
-
* @attr leave-start - Classes applied at the start of the leave transition.
|
|
17
|
-
* @attr leave-end - Classes applied at the end of the leave transition.
|
|
12
|
+
* @attr {string} enter - Space-separated classes added throughout the enter transition.
|
|
13
|
+
* @attr {string} enter-start - Classes applied at the start of the enter transition.
|
|
14
|
+
* @attr {string} enter-end - Classes applied at the end of the enter transition.
|
|
15
|
+
* @attr {string} leave - Space-separated classes added throughout the leave transition.
|
|
16
|
+
* @attr {string} leave-start - Classes applied at the start of the leave transition.
|
|
17
|
+
* @attr {string} leave-end - Classes applied at the end of the leave transition.
|
|
18
18
|
*
|
|
19
19
|
* @property {boolean} show - When `true` the host plays the enter transition; when `false`
|
|
20
20
|
* the leave transition.
|
|
21
21
|
*/
|
|
22
|
-
export default class TransitionClasses {
|
|
22
|
+
export default class TransitionClasses extends BaseElement {
|
|
23
23
|
/** @private */
|
|
24
24
|
private initialClasses;
|
|
25
25
|
properties(): {
|
|
@@ -50,3 +50,4 @@ export default class TransitionClasses {
|
|
|
50
50
|
/** @private */
|
|
51
51
|
private transition;
|
|
52
52
|
}
|
|
53
|
+
export declare function define(): void;
|