@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
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { TemplateElement, defineElement, html, classMap } from '@webtides/element-js';
|
|
2
|
+
import style from './tag.style.js';
|
|
3
|
+
import Events from './tag.events.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A tag: a label for one of several things that belong to something, a keyword of an article or a
|
|
7
|
+
* filter that is set. With `removable` it has a button that asks to take it away. It speaks the
|
|
8
|
+
* library's shared vocabulary: a semantic `variant`, an `appearance` and a `size`.
|
|
9
|
+
*
|
|
10
|
+
* The tag does not remove itself. Its button fires `tag-remove`, and the page decides what that
|
|
11
|
+
* means: take the element out of a list, clear a filter.
|
|
12
|
+
*
|
|
13
|
+
* @element el-tag
|
|
14
|
+
*
|
|
15
|
+
* @fires {CustomEvent} tag-remove - Fired when the remove button is activated.
|
|
16
|
+
*
|
|
17
|
+
* @slot - The text of the tag.
|
|
18
|
+
*
|
|
19
|
+
* @csspart base - The surface of the tag: background, border, radius.
|
|
20
|
+
* @csspart content - The wrapper around the default slot. A text that is too long is cut off here.
|
|
21
|
+
* @csspart remove-button - The remove button, present only while `removable` is `true`.
|
|
22
|
+
*
|
|
23
|
+
* @property {'neutral'|'brand'|'success'|'warning'|'danger'} variant - Semantic variant, which
|
|
24
|
+
* picks the colours. Default `'neutral'`. Reflected to the `variant` attribute.
|
|
25
|
+
* @property {'filled'|'outlined'|'plain'} appearance - How the colours of the variant are painted:
|
|
26
|
+
* as a fill, as a border around a transparent tag, or as text only. Default `'filled'`.
|
|
27
|
+
* Reflected to the `appearance` attribute.
|
|
28
|
+
* @property {'small'|'medium'|'large'} size - Tag size. Default `'medium'`. Reflected to the
|
|
29
|
+
* `size` attribute.
|
|
30
|
+
* @property {boolean} pill - Fully rounded ends.
|
|
31
|
+
* @property {boolean} removable - Whether to render the remove button. Default `false`.
|
|
32
|
+
* @property {string} removeLabel - The word the remove button is named with, in front of the text
|
|
33
|
+
* of the tag: "Remove TypeScript". Default `'Remove'`.
|
|
34
|
+
*/
|
|
35
|
+
export default class Tag extends TemplateElement {
|
|
36
|
+
constructor() {
|
|
37
|
+
super({
|
|
38
|
+
styles: [style],
|
|
39
|
+
shadowRender: true,
|
|
40
|
+
// The shared style modules select the host by these attributes.
|
|
41
|
+
propertyOptions: {
|
|
42
|
+
variant: { reflect: true },
|
|
43
|
+
appearance: { reflect: true },
|
|
44
|
+
size: { reflect: true },
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
properties() {
|
|
50
|
+
return {
|
|
51
|
+
variant: 'neutral',
|
|
52
|
+
appearance: 'filled',
|
|
53
|
+
size: 'medium',
|
|
54
|
+
pill: false,
|
|
55
|
+
removable: false,
|
|
56
|
+
removeLabel: 'Remove',
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
events() {
|
|
61
|
+
return {
|
|
62
|
+
'[data-remove]': {
|
|
63
|
+
click: () => this.dispatch(Events.REMOVE),
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** @private */
|
|
69
|
+
removeButtonTemplate() {
|
|
70
|
+
// The button is named by its label and by the text of the tag: several tags in a row would
|
|
71
|
+
// otherwise have buttons that all sound the same.
|
|
72
|
+
return html`
|
|
73
|
+
<button
|
|
74
|
+
part="remove-button"
|
|
75
|
+
type="button"
|
|
76
|
+
class="remove-button"
|
|
77
|
+
aria-labelledby="remove-label content"
|
|
78
|
+
data-remove
|
|
79
|
+
>
|
|
80
|
+
<span id="remove-label" hidden>${this.removeLabel}</span>
|
|
81
|
+
<svg
|
|
82
|
+
viewBox="0 0 24 24"
|
|
83
|
+
fill="none"
|
|
84
|
+
stroke="currentColor"
|
|
85
|
+
stroke-width="2.5"
|
|
86
|
+
stroke-linecap="round"
|
|
87
|
+
stroke-linejoin="round"
|
|
88
|
+
aria-hidden="true"
|
|
89
|
+
>
|
|
90
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
91
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
92
|
+
</svg>
|
|
93
|
+
</button>
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
template() {
|
|
98
|
+
const classes = {
|
|
99
|
+
tag: true,
|
|
100
|
+
'tag--pill': !!this.pill,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return html`
|
|
104
|
+
<span part="base" class="${classMap(classes)}">
|
|
105
|
+
<span part="content" id="content" class="content"><slot></slot></span>
|
|
106
|
+
${this.removable ? this.removeButtonTemplate() : ''}
|
|
107
|
+
</span>
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function define() {
|
|
113
|
+
defineElement('el-tag', Tag);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export { Events };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Tag
|
|
2
|
+
|
|
3
|
+
`tag` is a label for one of several things that belong to something: a keyword of an article, a filter that is set, a recipient. With `removable` it has a button that asks to take it away. It speaks the library's shared vocabulary: a semantic `variant`, an `appearance` and a `size`.
|
|
4
|
+
|
|
5
|
+
Without a theme imported the tag has a muted surface and the text that goes with it, a light surface in a light colour scheme and a dark one in a dark scheme; import a theme to skin it.
|
|
6
|
+
|
|
7
|
+
## How to use
|
|
8
|
+
|
|
9
|
+
#### Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm i --save @webtides/element-library
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
#### Use
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import '@webtides/element-library/tag/define';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<el-tag>TypeScript</el-tag>
|
|
23
|
+
|
|
24
|
+
<!-- Coloured, outlined, as a pill -->
|
|
25
|
+
<el-tag variant="brand" appearance="outlined" pill="true">Design</el-tag>
|
|
26
|
+
|
|
27
|
+
<!-- With a remove button -->
|
|
28
|
+
<el-tag removable="true">Svelte</el-tag>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
// The tag does not remove itself: the page decides what removing means.
|
|
33
|
+
document.querySelector('.filters').addEventListener('tag-remove', (event) => {
|
|
34
|
+
event.target.remove();
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
> Boolean attributes are passed as strings (`removable="true"`), matching the rest of the library.
|
|
39
|
+
|
|
40
|
+
## API
|
|
41
|
+
|
|
42
|
+
#### Properties/Attributes
|
|
43
|
+
|
|
44
|
+
| Name | Type | Default | Description |
|
|
45
|
+
| --- | --- | --- | --- |
|
|
46
|
+
| `variant` | `string` | `'neutral'` | `neutral`, `brand`, `success`, `warning` or `danger`. Picks the colours. Reflected. |
|
|
47
|
+
| `appearance` | `string` | `'filled'` | `filled`, `outlined` or `plain`. How the colours of the variant are painted. Reflected. |
|
|
48
|
+
| `size` | `string` | `'medium'` | `small`, `medium` or `large`. Reflected. |
|
|
49
|
+
| `pill` | `boolean` | `false` | Fully rounded ends. |
|
|
50
|
+
| `removable` | `boolean` | `false` | Whether to render the remove button. |
|
|
51
|
+
| `remove-label` | `string` | `'Remove'` | The word the remove button is named with, in front of the text of the tag. |
|
|
52
|
+
|
|
53
|
+
#### Methods
|
|
54
|
+
|
|
55
|
+
_None._
|
|
56
|
+
|
|
57
|
+
#### Events
|
|
58
|
+
|
|
59
|
+
| Name | Description |
|
|
60
|
+
| ------------ | ----------------------------------------------------------------------- |
|
|
61
|
+
| `tag-remove` | The remove button was activated. Bubbles and crosses shadow boundaries. |
|
|
62
|
+
|
|
63
|
+
#### Slots
|
|
64
|
+
|
|
65
|
+
| Name | Description |
|
|
66
|
+
| ----------- | -------------------- |
|
|
67
|
+
| _(default)_ | The text of the tag. |
|
|
68
|
+
|
|
69
|
+
#### CSS Parts
|
|
70
|
+
|
|
71
|
+
| Name | Description |
|
|
72
|
+
| --------------- | ----------------------------------------------------------------- |
|
|
73
|
+
| `base` | The surface of the tag: background, border, radius. |
|
|
74
|
+
| `content` | The wrapper around the default slot. A text too long is cut here. |
|
|
75
|
+
| `remove-button` | The remove button (present only while `removable`). |
|
|
76
|
+
|
|
77
|
+
#### CSS Custom Properties
|
|
78
|
+
|
|
79
|
+
Reads the standard library design tokens: the colours of the variants, `--el-control-height`, `--el-space-*`, `--el-font-size-*`, `--el-font-family`, `--el-border-width`, `--el-radius-md`, `--el-radius-sm`, `--el-focus-ring-width` and `--el-touch-target`.
|
|
80
|
+
|
|
81
|
+
Each variant reads one colour: `--el-color-accent` (`brand`), `--el-color-success`, `--el-color-warning` and `--el-color-danger`. `neutral` reads the surface tokens: `--el-color-bg-muted` for the fill, `--el-color-border` for the border and `--el-color-fg` for the text. The text on a brand, success or danger fill is `--el-color-bg`; a warning fill carries dark text.
|
|
82
|
+
|
|
83
|
+
## Variant, appearance and size
|
|
84
|
+
|
|
85
|
+
The three properties are independent of each other, and every combination works.
|
|
86
|
+
|
|
87
|
+
| `appearance` | What is painted |
|
|
88
|
+
| --- | --- |
|
|
89
|
+
| `filled` | The fill of the variant, its border, and the text colour for that fill. |
|
|
90
|
+
| `outlined` | No fill. The border and the text have the colour of the variant; `neutral` has the border colour of the theme. |
|
|
91
|
+
| `plain` | No fill and no border, only the text in the colour of the variant. |
|
|
92
|
+
|
|
93
|
+
A tag is the small sibling of a control of the same size, so that it fits into a field: it is 0.7 times as high (28 px for `medium` with the default theme, 22.4 px for `small`, 35 px for `large`), has half the padding, and a font size one step down.
|
|
94
|
+
|
|
95
|
+
All three are reflected: the element writes them onto itself as attributes, the defaults included (`<el-tag variant="neutral" appearance="filled" size="medium">`), so that they can be selected from a stylesheet (`el-tag[variant='brand']`). A value the tag does not know is painted like the default.
|
|
96
|
+
|
|
97
|
+
A tag is never wider than the place it stands in. A text that does not fit is cut off with an ellipsis, and the remove button stays.
|
|
98
|
+
|
|
99
|
+
The `hidden` attribute hides the tag.
|
|
100
|
+
|
|
101
|
+
## Removing
|
|
102
|
+
|
|
103
|
+
The remove button fires `tag-remove` and does nothing else. The tag stays where it is until the page takes it away: out of a list, out of the state a framework renders the list from, or by clearing the filter it stands for. A tag that removed itself would leave such a state behind.
|
|
104
|
+
|
|
105
|
+
The event bubbles, so one listener on the list serves all of its tags; `event.target` is the tag.
|
|
106
|
+
|
|
107
|
+
## Accessibility
|
|
108
|
+
|
|
109
|
+
- A tag is text for assistive technology, read where it stands in the page. It has no role. For a list of tags, use a list: `<ul>` with one tag per `<li>`.
|
|
110
|
+
- The remove button is a native `<button>`: it is in the tab order and works with Enter and Space.
|
|
111
|
+
- Its name is the `remove-label` followed by the text of the tag: "Remove TypeScript". Several tags in a row would otherwise have buttons that all sound the same. Set `remove-label` to translate the word.
|
|
112
|
+
- The focus ring of the button has the text colour of the tag, which shows on every fill.
|
|
113
|
+
- On a touch screen (`@media (any-pointer: coarse)`) the remove button is at least `--el-touch-target` wide and high. The cross keeps its size and the tag grows with the button. Without that token, and on a fine pointer, the sizes stay as they are.
|
|
114
|
+
- A status must not be told by the colour alone: write it into the tag.
|
|
115
|
+
- After a tag is removed, the focus is gone with its button. Move it to a sensible place in the listener, the next tag or the field the tags belong to.
|
|
116
|
+
|
|
117
|
+
## Server-side rendering
|
|
118
|
+
|
|
119
|
+
The tag, and its remove button with its name, are part of the server-rendered markup (Declarative Shadow DOM). The button works once the JavaScript of the element has loaded.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import hostStyle from '../../styles/host.style.js';
|
|
2
|
+
import sizeStyle from '../../styles/size.style.js';
|
|
3
|
+
import variantsStyle from '../../styles/variants.style.js';
|
|
4
|
+
import appearanceStyle from '../../styles/appearance.style.js';
|
|
5
|
+
|
|
6
|
+
const css = String.raw;
|
|
7
|
+
|
|
8
|
+
const style = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
vertical-align: middle;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.tag {
|
|
16
|
+
/* The colours come from the variants and appearance modules, the size from the size
|
|
17
|
+
module. A tag is the small sibling of a control of the same size: 0.7 times its height,
|
|
18
|
+
half its padding, and a font size one step down, so that it fits into a field. */
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 0.25em;
|
|
22
|
+
max-width: 100%;
|
|
23
|
+
min-height: calc(var(--_el-size-height) * 0.7);
|
|
24
|
+
padding: 0 calc(var(--_el-size-padding-inline) * 0.5);
|
|
25
|
+
border: var(--el-border-width, 1px) solid transparent;
|
|
26
|
+
border-radius: var(--el-radius-md, 4px);
|
|
27
|
+
font-family: var(--el-font-family, inherit);
|
|
28
|
+
font-size: calc(var(--_el-size-font-size) * 0.875);
|
|
29
|
+
line-height: 1.2;
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.tag--pill {
|
|
34
|
+
border-radius: 999px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* A text that does not fit is cut off, the remove button stays. */
|
|
38
|
+
.content {
|
|
39
|
+
min-width: 0;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
text-overflow: ellipsis;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ── Remove button ────────────────────────────────────────────────────── */
|
|
45
|
+
|
|
46
|
+
.remove-button {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
flex: none;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
/* Half of the padding back: the cross has air of its own around it. */
|
|
52
|
+
margin-inline-end: calc(var(--_el-size-padding-inline) * -0.25);
|
|
53
|
+
padding: 0.125em;
|
|
54
|
+
border: none;
|
|
55
|
+
border-radius: var(--el-radius-sm, 2px);
|
|
56
|
+
background: transparent;
|
|
57
|
+
color: inherit;
|
|
58
|
+
font: inherit;
|
|
59
|
+
line-height: 0;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.tag--pill .remove-button {
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.remove-button svg {
|
|
68
|
+
width: 1em;
|
|
69
|
+
height: 1em;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* A tint of the text colour, which shows on every fill. Hover only where the pointer can
|
|
73
|
+
hover: a touch screen leaves :hover on the button that was tapped last. */
|
|
74
|
+
@media (hover: hover) {
|
|
75
|
+
.remove-button:hover {
|
|
76
|
+
background: color-mix(in srgb, currentColor 16%, transparent);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.remove-button:active {
|
|
81
|
+
background: color-mix(in srgb, currentColor 28%, transparent);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* The ring has the text colour of the tag, not the focus colour of the theme: that one is the
|
|
85
|
+
accent colour, which a brand tag has as its fill. */
|
|
86
|
+
.remove-button:focus-visible {
|
|
87
|
+
outline: var(--el-focus-ring-width, 2px) solid currentColor;
|
|
88
|
+
outline-offset: 1px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Touch screens: the remove button is at least --el-touch-target, the cross keeps its size
|
|
92
|
+
and the tag grows with the button. Without the token the sizes stay as they are. */
|
|
93
|
+
@media (any-pointer: coarse) {
|
|
94
|
+
.remove-button {
|
|
95
|
+
min-width: var(--el-touch-target, auto);
|
|
96
|
+
min-height: var(--el-touch-target, auto);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
export default [hostStyle(), sizeStyle(), variantsStyle(), appearanceStyle('.tag'), style].join('\n');
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this component live here. Versions refer to the parent `@webtides/element-library` release (see root [`CHANGELOG.md`](../../../CHANGELOG.md)); components no longer version independently.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
|
+
|
|
7
|
+
<!--
|
|
8
|
+
When your PR touches this component, add an entry under Unreleased and
|
|
9
|
+
mirror it (prefixed with the component name) in root CHANGELOG.md.
|
|
10
|
+
Uncomment headings as needed.
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
## Unreleased
|
|
14
|
+
|
|
15
|
+
## [0.3.0] - 2026-11-17
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Initial `el-tag-field`: a list of short texts the user writes. A text input that turns what is entered into entries, each an `el-tag` with a remove button, with the label, the help message, the error message and the layout of every field. ([#142](https://github.com/webtides/element-library/issues/142))
|
|
20
|
+
- Enter adds the text of the input as an entry, and so does a comma, typed or pasted: a pasted `a, b, c` is three entries. An entry is trimmed; an empty one and one the list already has are not added.
|
|
21
|
+
- `value` is the list of the entries, JSON as an attribute and an array from a script; `input-change` reports it. In a form every entry is submitted under the `name` by a hidden input, also before the script has run for a list the server rendered, and `form.reset()` brings back the rendered list.
|
|
22
|
+
- Text that is still in the input when the form is submitted becomes an entry with the submit. It does not when the user leaves the field: the field would grow, and the submit button below it would move away under the pointer.
|
|
23
|
+
- `required` means at least one entry, and text in the input counts as one. The browser refuses to submit the form without, with the error message of the field in its bubble.
|
|
24
|
+
- After a removal the focus is on the entry that took the place of the removed one, or on the input after the last one. A live region says what was added and what was removed; `removeLabel`, `addedLabel` and `removedLabel` are the words for it.
|
|
25
|
+
- With `styles/native.css` the input has the look and the three sizes of the input of `el-input-field`. `size` is the size of the tags as well. On a touch screen the input and every remove button are at least `--el-touch-target` high.
|