@webtides/element-library 0.1.2 → 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 +390 -3
- package/README.md +61 -41
- package/all.js +28 -0
- package/catalog.d.ts +14 -0
- package/catalog.js +63 -0
- package/custom-elements.json +16604 -3420
- package/package.json +37 -25
- 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,114 @@
|
|
|
1
|
+
# Button Group
|
|
2
|
+
|
|
3
|
+
`button-group` joins a row of [`el-button`](../button/button.readme.md) into one control: the actions of a toolbar, a button with a second one for more options, the steps back and forward. The buttons touch, only the outer corners of the row are rounded, and a line divides two neighbours.
|
|
4
|
+
|
|
5
|
+
To assistive technology it is a group with a name. Every button stays a button of its own.
|
|
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/button-group/define';
|
|
19
|
+
import '@webtides/element-library/button/define';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<el-button-group label="Text alignment">
|
|
24
|
+
<el-button>Left</el-button>
|
|
25
|
+
<el-button>Centre</el-button>
|
|
26
|
+
<el-button>Right</el-button>
|
|
27
|
+
</el-button-group>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## API
|
|
31
|
+
|
|
32
|
+
#### Properties/Attributes
|
|
33
|
+
|
|
34
|
+
| Name | Type | Default | Description |
|
|
35
|
+
| ------- | -------- | ------- | --------------------------------------------------------------- |
|
|
36
|
+
| `label` | `string` | `''` | The accessible name of the group. Unset, the group has no name. |
|
|
37
|
+
|
|
38
|
+
#### Methods
|
|
39
|
+
|
|
40
|
+
_None._
|
|
41
|
+
|
|
42
|
+
#### Events
|
|
43
|
+
|
|
44
|
+
_None._
|
|
45
|
+
|
|
46
|
+
#### Slots
|
|
47
|
+
|
|
48
|
+
| Name | Description |
|
|
49
|
+
| --------- | ------------------------------------------------------------------------- |
|
|
50
|
+
| (default) | The buttons: `el-button` elements, or elements that hold one (see below). |
|
|
51
|
+
|
|
52
|
+
#### CSS Parts
|
|
53
|
+
|
|
54
|
+
| Name | Description |
|
|
55
|
+
| ------ | --------------------------------------------------- |
|
|
56
|
+
| `base` | The row. It carries `role="group"` and the `label`. |
|
|
57
|
+
|
|
58
|
+
#### CSS Custom Properties
|
|
59
|
+
|
|
60
|
+
_None._ The group takes the radius and the border width from the tokens of the theme, through its buttons.
|
|
61
|
+
|
|
62
|
+
## What the group does
|
|
63
|
+
|
|
64
|
+
- The buttons stand in one row and touch. A button lies on the border of the one in front of it, so two neighbours share one line.
|
|
65
|
+
- The corners that face a neighbour are square. The outer corners of the row keep the radius of the buttons, the one of the theme or the one of a `pill`. In a text that runs from right to left the row is mirrored.
|
|
66
|
+
- Two filled buttons are divided by a line: the border at the start of the second one, in a quarter of its text colour on its fill. That shows between two fills of one colour. Outlined buttons share their border, plain buttons have none.
|
|
67
|
+
- The button that has the focus lies over its neighbours, so its focus ring is not covered.
|
|
68
|
+
|
|
69
|
+
The group does this with its stylesheet alone. It runs no script on its buttons and writes nothing onto them: a button that is added, moved or taken away is joined at once, and a server-rendered group does not change when the elements take over.
|
|
70
|
+
|
|
71
|
+
## What the buttons bring
|
|
72
|
+
|
|
73
|
+
`variant`, `appearance`, `size`, `pill` and `disabled` stay with every button. The group does not pass anything on. Give every button of a group the same `size`; a mix of appearances works, a mix of sizes does not line up.
|
|
74
|
+
|
|
75
|
+
The group does not keep a selection either. For buttons of which one is on, set `aria-pressed` on every button and change it, and the appearance of the button that is on, when one is pressed:
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<el-button-group label="Text alignment">
|
|
79
|
+
<el-button appearance="outlined" aria-pressed="false">Left</el-button>
|
|
80
|
+
<el-button variant="brand" aria-pressed="true">Centre</el-button>
|
|
81
|
+
<el-button appearance="outlined" aria-pressed="false">Right</el-button>
|
|
82
|
+
</el-button-group>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## A button inside of another element
|
|
86
|
+
|
|
87
|
+
What decides whether a side is joined is the place of the element that is slotted into the group. A button inside of that element is joined as the element is. That is how a button with more options is built, with an `el-popover` as the last element of the group:
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<el-button-group label="Save">
|
|
91
|
+
<el-button variant="brand">Save</el-button>
|
|
92
|
+
<el-popover placement="bottom-end">
|
|
93
|
+
<el-button slot="anchor" variant="brand" caret="true" aria-label="More ways to save"></el-button>
|
|
94
|
+
<el-button appearance="plain">Save as a copy</el-button>
|
|
95
|
+
</el-popover>
|
|
96
|
+
</el-button-group>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The panel of the popover is not part of the row: a button in it has all of its corners.
|
|
100
|
+
|
|
101
|
+
Every element in the group counts as a place in the row, whether it shows or not. An `el-tooltip` for a button of the group belongs after the group, not into it: as the last element of the group it would take the rounded end from the last button.
|
|
102
|
+
|
|
103
|
+
The `hidden` attribute hides the group.
|
|
104
|
+
|
|
105
|
+
## Accessibility
|
|
106
|
+
|
|
107
|
+
- The row is a group (`role="group"`), named by `label`. A screen reader announces the name when its user moves into the group: "Text alignment, group". Without a `label` the group has no name, and most screen readers pass over it; the buttons are announced as before.
|
|
108
|
+
- Every button stays a tab stop of its own, in the order of the row. The group adds no keys.
|
|
109
|
+
- A button that shows an icon only needs a name of its own (`aria-label` on the `el-button`), in a group as anywhere else.
|
|
110
|
+
- When colours are forced (the contrast themes of Windows) every button has its full border, in the colour of the system.
|
|
111
|
+
|
|
112
|
+
## Server-side rendering
|
|
113
|
+
|
|
114
|
+
The group, its role and its name are part of the server-rendered markup (Declarative Shadow DOM), and the row is joined by the stylesheets of the group and the buttons. Nothing changes when the elements take over.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import hostStyle from '../../styles/host.style.js';
|
|
2
|
+
|
|
3
|
+
const css = String.raw;
|
|
4
|
+
|
|
5
|
+
const style = css`
|
|
6
|
+
:host {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.button-group {
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* The group tells what is slotted into it which of its sides has a neighbour, with properties
|
|
16
|
+
that el-button reads. They are internal (--_el-), and they inherit: a button inside of a
|
|
17
|
+
slotted element, the anchor of a popover, is joined as that element is. */
|
|
18
|
+
|
|
19
|
+
/* With a neighbour in front: square corners at the start, and the border at the start lies on
|
|
20
|
+
the border at the end of that neighbour, so the two share one line. For a filled button
|
|
21
|
+
that line is a quarter of its text colour on its fill, which shows between two fills of
|
|
22
|
+
one colour. currentColor is taken where the button paints the line, not here. */
|
|
23
|
+
::slotted(:not(:first-child)) {
|
|
24
|
+
--_el-group-radius-start: 0px;
|
|
25
|
+
--_el-group-divider: color-mix(in srgb, currentColor 25%, transparent);
|
|
26
|
+
margin-inline-start: calc(-1 * var(--el-border-width, 1px));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* With a neighbour behind: square corners at the end. */
|
|
30
|
+
::slotted(:not(:last-child)) {
|
|
31
|
+
--_el-group-radius-end: 0px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* The button with the focus lies over its neighbours, which would cover a part of its focus
|
|
35
|
+
ring otherwise. */
|
|
36
|
+
::slotted(:focus-within) {
|
|
37
|
+
z-index: 1;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
export default [hostStyle(), style].join('\n');
|
|
@@ -0,0 +1,23 @@
|
|
|
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-card`: a surface that groups what belongs together, a form, a section of settings, an entry of a list. Pure presentation, without a role and without behaviour. ([#76](https://github.com/webtides/element-library/issues/76), [#81](https://github.com/webtides/element-library/issues/81))
|
|
20
|
+
- Four regions, each of them a slot: `media` at the top, then `header`, the body and `footer`. A region that nothing is slotted into takes no space, on the server as in the browser, and comes and goes with its element.
|
|
21
|
+
- `appearance` (`outlined`, `filled`, `plain`), reflected to an attribute of the same name. `outlined`, the default, is a surface in `--el-color-bg` with a border and the shadow `--el-shadow-md`; `filled` has the muted fill; `plain` paints nothing.
|
|
22
|
+
- `--el-card-padding` for the padding of the header, the body and the footer. Unset, it is `--el-space-4`. The parts `base`, `media`, `header`, `body` and `footer` reach one region alone.
|
|
23
|
+
- A card fills the height its container gives it: cards that a grid stretches are equally high, and their footers are in one line.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { TemplateElement, defineElement, html } from '@webtides/element-js';
|
|
2
|
+
import { hasSlotted } from '../../utils/slots.js';
|
|
3
|
+
import style from './card.style.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A card: a surface that groups what belongs together, a form, a section of settings, an entry of
|
|
7
|
+
* a list. It has four regions, each of them a slot: `media` at the top, then `header`, the body and
|
|
8
|
+
* `footer`. A region that nothing is slotted into takes no space. Pure presentation, without a role
|
|
9
|
+
* and without behaviour.
|
|
10
|
+
*
|
|
11
|
+
* @element el-card
|
|
12
|
+
*
|
|
13
|
+
* @slot - The body of the card.
|
|
14
|
+
* @slot media - An image or a video at the top of the card, from edge to edge.
|
|
15
|
+
* @slot header - The title of the card, and what stands beside it, an action for example.
|
|
16
|
+
* @slot footer - What closes the card: actions, a note.
|
|
17
|
+
*
|
|
18
|
+
* @csspart base - The surface of the card: background, border, radius, shadow.
|
|
19
|
+
* @csspart media - The region of the `media` slot.
|
|
20
|
+
* @csspart header - The region of the `header` slot.
|
|
21
|
+
* @csspart body - The region of the default slot.
|
|
22
|
+
* @csspart footer - The region of the `footer` slot.
|
|
23
|
+
*
|
|
24
|
+
* @cssproperty --el-card-padding - The padding of the header, the body and the footer. Unset, it
|
|
25
|
+
* is `--el-space-4`, and `1rem` without a theme.
|
|
26
|
+
*
|
|
27
|
+
* @property {'outlined'|'filled'|'plain'} appearance - How the surface is painted: with the
|
|
28
|
+
* background of the page and a border, with a muted fill and a border, or not at all. Default
|
|
29
|
+
* `'outlined'`. Reflected to the `appearance` attribute.
|
|
30
|
+
*/
|
|
31
|
+
export default class Card extends TemplateElement {
|
|
32
|
+
constructor() {
|
|
33
|
+
super({
|
|
34
|
+
styles: [style],
|
|
35
|
+
shadowRender: true,
|
|
36
|
+
// The stylesheet selects the host by this attribute.
|
|
37
|
+
propertyOptions: {
|
|
38
|
+
appearance: { reflect: true },
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
properties() {
|
|
44
|
+
return {
|
|
45
|
+
appearance: 'outlined',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
events() {
|
|
50
|
+
return {
|
|
51
|
+
// A template element does not render again when a child comes, goes or changes its
|
|
52
|
+
// `slot` attribute. The slot tells of all three, and the event bubbles to the base.
|
|
53
|
+
"[part~='base']": {
|
|
54
|
+
slotchange: () => this.requestUpdate(),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
template() {
|
|
60
|
+
return html`
|
|
61
|
+
<div part="base" class="card">
|
|
62
|
+
<div part="media" ?hidden="${!hasSlotted(this, 'media')}"><slot name="media"></slot></div>
|
|
63
|
+
<div part="header" ?hidden="${!hasSlotted(this, 'header')}"><slot name="header"></slot></div>
|
|
64
|
+
<div part="body"><slot></slot></div>
|
|
65
|
+
<div part="footer" ?hidden="${!hasSlotted(this, 'footer')}"><slot name="footer"></slot></div>
|
|
66
|
+
</div>
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function define() {
|
|
72
|
+
defineElement('el-card', Card);
|
|
73
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
`card` is a surface that groups what belongs together: a form, a section of settings, an entry of a list. It has four regions, each of them a slot: `media` at the top, then `header`, the body and `footer`. A region that nothing is slotted into takes no space. It is pure presentation, without a role and without behaviour.
|
|
4
|
+
|
|
5
|
+
Without a theme imported the card paints nothing and is its regions and their padding; 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/card/define';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<el-card>
|
|
23
|
+
<h3 slot="header">Profile</h3>
|
|
24
|
+
<p>What belongs together.</p>
|
|
25
|
+
<el-button slot="footer">Save</el-button>
|
|
26
|
+
</el-card>
|
|
27
|
+
|
|
28
|
+
<!-- With an image at the top -->
|
|
29
|
+
<el-card>
|
|
30
|
+
<img slot="media" alt="Hills at sunrise" src="hills.jpg" width="600" height="400" />
|
|
31
|
+
<h3 slot="header">Lake house</h3>
|
|
32
|
+
<p>Two rooms, a boat and a view of the water.</p>
|
|
33
|
+
</el-card>
|
|
34
|
+
|
|
35
|
+
<!-- A muted fill, or no surface at all -->
|
|
36
|
+
<el-card appearance="filled">…</el-card>
|
|
37
|
+
<el-card appearance="plain">…</el-card>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## API
|
|
41
|
+
|
|
42
|
+
#### Properties/Attributes
|
|
43
|
+
|
|
44
|
+
| Name | Type | Default | Description |
|
|
45
|
+
| ------------ | -------- | ------------ | ----------------------------------------------------------------------- |
|
|
46
|
+
| `appearance` | `string` | `'outlined'` | `outlined`, `filled` or `plain`. How the surface is painted. Reflected. |
|
|
47
|
+
|
|
48
|
+
#### Methods
|
|
49
|
+
|
|
50
|
+
_None._
|
|
51
|
+
|
|
52
|
+
#### Events
|
|
53
|
+
|
|
54
|
+
_None._
|
|
55
|
+
|
|
56
|
+
#### Slots
|
|
57
|
+
|
|
58
|
+
| Name | Description |
|
|
59
|
+
| ----------- | ------------------------------------------------------------------------ |
|
|
60
|
+
| _(default)_ | The body of the card. |
|
|
61
|
+
| `media` | An image or a video at the top of the card, from edge to edge. |
|
|
62
|
+
| `header` | The title of the card, and what stands beside it, an action for example. |
|
|
63
|
+
| `footer` | What closes the card: actions, a note. |
|
|
64
|
+
|
|
65
|
+
#### CSS Parts
|
|
66
|
+
|
|
67
|
+
| Name | Description |
|
|
68
|
+
| -------- | ------------------------------------------------------------ |
|
|
69
|
+
| `base` | The surface of the card: background, border, radius, shadow. |
|
|
70
|
+
| `media` | The region of the `media` slot. |
|
|
71
|
+
| `header` | The region of the `header` slot. |
|
|
72
|
+
| `body` | The region of the default slot. |
|
|
73
|
+
| `footer` | The region of the `footer` slot. |
|
|
74
|
+
|
|
75
|
+
#### CSS Custom Properties
|
|
76
|
+
|
|
77
|
+
| Name | Description |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| `--el-card-padding` | The padding of the header, the body and the footer. Unset, it is `--el-space-4`, and `1rem` without a theme. |
|
|
80
|
+
|
|
81
|
+
Reads the standard library design tokens: `--el-color-bg`, `--el-color-bg-muted`, `--el-color-fg`, `--el-color-border`, `--el-border-width`, `--el-radius-lg`, `--el-shadow-md`, `--el-space-2` and `--el-space-4`.
|
|
82
|
+
|
|
83
|
+
## Regions
|
|
84
|
+
|
|
85
|
+
The regions are below each other in a fixed order, whatever the order of the children: `media`, `header`, the body, `footer`. The body is always there. Each of the other three is there when an element with its `slot` is a child of the card, and comes and goes with that element.
|
|
86
|
+
|
|
87
|
+
- **`header`** places what is slotted into it in a row and pushes it apart: a title at the start, an action at the end. Its text is semibold. The card cannot know the level of its heading in the page, so the heading is yours: `<h3 slot="header">`.
|
|
88
|
+
- **`footer`** lines what is slotted into it up from the start, with a gap, and wraps.
|
|
89
|
+
- **`media`** has no padding. An image or a video in it is as wide as the card and keeps its proportions; give an image its `width` and `height`, so the card has its height before the image has loaded. The region is round where the card is.
|
|
90
|
+
- The header and the footer take the margins of the browser off a heading or a paragraph that is slotted into them. The body is left alone: what is in it is content of the page.
|
|
91
|
+
|
|
92
|
+
There is one padding around the regions and one between them. `--el-card-padding` sets it for the header, the body and the footer at once; for one region alone, use its part:
|
|
93
|
+
|
|
94
|
+
```css
|
|
95
|
+
/* A list or a table that reaches from edge to edge, under a header that keeps its padding */
|
|
96
|
+
el-card.flush::part(body) {
|
|
97
|
+
padding: 0;
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Appearance
|
|
102
|
+
|
|
103
|
+
| `appearance` | What is painted |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `outlined` | A surface in the background of the page (`--el-color-bg`), with a border and a shadow. The default. |
|
|
106
|
+
| `filled` | The same with a muted fill (`--el-color-bg-muted`). |
|
|
107
|
+
| `plain` | Nothing: no background, no border, no shadow. The regions and their padding stay, and the text has the colour of where the card stands. |
|
|
108
|
+
|
|
109
|
+
The property is reflected: the element writes it onto itself as an attribute, the default included (`<el-card appearance="outlined">`), so that it can be selected from a stylesheet. A value the card does not know is painted like the default.
|
|
110
|
+
|
|
111
|
+
The shadow is `--el-shadow-md` of the theme. For a card without one: `el-card::part(base) { box-shadow: none; }`.
|
|
112
|
+
|
|
113
|
+
There is no `variant` and no `size`. A card holds content of any kind, and the colour of a variant would be the colour of all of it; for a message with a variant there is `el-notification`.
|
|
114
|
+
|
|
115
|
+
## In a grid
|
|
116
|
+
|
|
117
|
+
A card fills the height its container gives it. Cards that a grid or a flex row stretches are equally high, and their footers are in one line, because the body takes the height that is left.
|
|
118
|
+
|
|
119
|
+
The card cuts nothing off: the list of a select, a tooltip or a focus ring may reach out of it.
|
|
120
|
+
|
|
121
|
+
The `hidden` attribute hides the card.
|
|
122
|
+
|
|
123
|
+
## Accessibility
|
|
124
|
+
|
|
125
|
+
- A card is a container without a role. Its content is read where it stands in the page.
|
|
126
|
+
- Give a card a heading, at the level that fits the page. A screen reader user moves from heading to heading, so the heading is how a card is found.
|
|
127
|
+
- For a card that should be announced as a group, set the role and the name on the element: `<el-card role="group" aria-labelledby="profile-title">`, with that `id` on the heading.
|
|
128
|
+
- An image in `media` needs an `alt`, an empty one when it only decorates.
|
|
129
|
+
- A card is not a control. For a card that leads somewhere, put a link into it, into the heading for example, and do not wrap the card in a link: everything in it would be the name of that link.
|
|
130
|
+
- Whether the text can be read depends on the colours of the theme: `--el-color-fg` needs a contrast of 4.5 : 1 to `--el-color-bg` and to `--el-color-bg-muted`.
|
|
131
|
+
|
|
132
|
+
## Server-side rendering
|
|
133
|
+
|
|
134
|
+
The card is fully part of the server-rendered markup (Declarative Shadow DOM) and looks the same before and after its JavaScript has loaded. Which regions are left out is read from the children of the element, on the server as in the browser, so nothing moves when the element takes over.
|
|
135
|
+
|
|
136
|
+
One limit follows from that: a `<slot>` of another component that is passed on into a region (`<slot name="title" slot="header">`) counts as content, also while nothing is slotted into it.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import hostStyle from '../../styles/host.style.js';
|
|
2
|
+
|
|
3
|
+
const css = String.raw;
|
|
4
|
+
|
|
5
|
+
const style = css`
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* The surface. It is headless without a theme: every token falls back to a value that paints
|
|
12
|
+
* nothing, so an unthemed card is its regions and their padding.
|
|
13
|
+
*/
|
|
14
|
+
.card {
|
|
15
|
+
--_el-card-padding: var(--el-card-padding, var(--el-space-4, 1rem));
|
|
16
|
+
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
/* A card that its container stretches, in a grid of cards for example, fills that height. */
|
|
20
|
+
height: 100%;
|
|
21
|
+
background: var(--el-color-bg, transparent);
|
|
22
|
+
color: var(--el-color-fg, inherit);
|
|
23
|
+
border: var(--el-border-width, 0) solid var(--el-color-border, transparent);
|
|
24
|
+
border-radius: var(--el-radius-lg, 0);
|
|
25
|
+
box-shadow: var(--el-shadow-md, none);
|
|
26
|
+
/* No overflow here: what a card holds may reach out of it, the list of a select or a focus
|
|
27
|
+
ring for example. The media region clips itself to the corners instead. */
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([appearance='filled']) .card {
|
|
31
|
+
background: var(--el-color-bg-muted, transparent);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([appearance='plain']) .card {
|
|
35
|
+
background: transparent;
|
|
36
|
+
color: inherit;
|
|
37
|
+
/* No border at all, not a transparent one: forced colours would paint that. */
|
|
38
|
+
border: none;
|
|
39
|
+
box-shadow: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ── Regions ──────────────────────────────────────────────────────────── */
|
|
43
|
+
|
|
44
|
+
/* From edge to edge, and round where the card is. The two corners are the card's own,
|
|
45
|
+
inherited: a theme may give the radius eight values, and those cannot be calculated with.
|
|
46
|
+
Inside of the border that is a little rounder than the border itself, by less than its
|
|
47
|
+
width. */
|
|
48
|
+
[part~='media'] {
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
border-top-left-radius: inherit;
|
|
51
|
+
border-top-right-radius: inherit;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* An image or a video is as wide as the card and keeps its proportions. A rule of the page
|
|
55
|
+
for the element wins over this one. */
|
|
56
|
+
::slotted([slot='media']) {
|
|
57
|
+
display: block;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
[part~='header'] {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
gap: var(--el-space-2, 0.5rem);
|
|
67
|
+
padding: var(--_el-card-padding);
|
|
68
|
+
font-weight: var(--el-font-weight-semibold, 600);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[part~='body'] {
|
|
72
|
+
/* Takes the height that is left, so the footer of a stretched card is at its bottom. */
|
|
73
|
+
flex: 1 1 auto;
|
|
74
|
+
padding: var(--_el-card-padding);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* One padding between two regions, not two: the region above keeps its own. */
|
|
78
|
+
[part~='header']:not([hidden]) + [part~='body'] {
|
|
79
|
+
padding-top: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[part~='footer'] {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-wrap: wrap;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: var(--el-space-2, 0.5rem);
|
|
87
|
+
padding: var(--_el-card-padding);
|
|
88
|
+
padding-top: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* The header and the footer place what is slotted into them, with the gap. The margins the
|
|
92
|
+
browser gives a heading or a paragraph would come on top of that. */
|
|
93
|
+
::slotted([slot='header']),
|
|
94
|
+
::slotted([slot='footer']) {
|
|
95
|
+
margin: 0;
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
export default [hostStyle(), style].join('\n');
|
|
@@ -12,6 +12,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
|
12
12
|
|
|
13
13
|
## Unreleased
|
|
14
14
|
|
|
15
|
+
## [0.3.0] - 2026-11-17
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- `dot-label` (`dotLabel`): the accessible label of a bullet, followed by the number of its slide. Default `'Go to slide'`, which names the bullets "Go to slide 1", "Go to slide 2" and so on. It is the property the dots of `el-slider` have. ([#163](https://github.com/webtides/element-library/issues/163))
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- BREAKING: the arrows and the bullets have the look and the place of the ones of `el-slider`, and read the tokens of the theme. The theme of Glide is gone: white controls that lay on the slides and showed on a dark picture only, in every theme of the library. The bullets are in a row under the slides and no longer on them, so the carousel is higher by that row (24 px). A bullet is a ring of 10 px in `--el-color-fg-muted`, and the one of the slide that shows a disc in `--el-color-accent` (they were 13 px and white). An arrow is a square of `--el-control-height` with the surface, the text colour, the border and the radius of the tokens, `--el-space-2` in from the sides (was `2em`), in the middle of the height of the slides. Left empty, an arrow shows an arrow head (it showed nothing). The keyboard focus of an arrow shows, as a ring inside of it (the stylesheet took the outline away). An arrow that Glide marks as leading nowhere keeps its surface and its sign fades (the whole arrow faded to a third). Without a theme an arrow has the surface and the text colour of the browser for the colour scheme, and the bullets the text colour of the page. On a page that runs from right to left the arrow back is at the right. The parts keep their names. A rule of the page for `::part(arrow)`, `::part(dot)` or `::part(selected-dot)` now meets another look: a bullet is drawn with its border, so `border-color` colours it and `background` does not. A page that wants the bullets on the slides again lays them there with one rule, see the readme. ([#162](https://github.com/webtides/element-library/issues/162))
|
|
24
|
+
- On a touch screen (`@media (any-pointer: coarse)`) the arrows are at least `--el-touch-target` wide and high (28 × 22 px before). The bullets keep their size: each gets a hit area of `--el-touch-target` around its dot, and the bullets move apart by as much, so that the areas do not overlap. The row of bullets wraps when it gets wider than the carousel. Unchanged on a fine pointer and without the token.
|
|
25
|
+
- The copies of the slides that Glide needs for looping are kept in the shadow root. The children of the element stay what the page wrote: before, four slides became eight children as soon as the carousel started, and a framework that hydrated a server-rendered carousel with slides from a loop found nodes it had not rendered (Svelte 5: `hydration_mismatch`, the page was built again). A rule of the page's style sheets still styles a copy when it selects the slide by a class; a selector that needs an ancestor outside the carousel (`el-carousel > div`, `.gallery .slide`) no longer reaches the copies. See "Looping, and server-rendered slides" in the readme. ([#96](https://github.com/webtides/element-library/issues/96))
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- The bullets are buttons. The Tab key reaches them, Enter and Space go to the slide of the one that has the focus, and its focus shows as a ring around it. Each has an accessible name (see `dot-label`), and `aria-pressed` marks the one of the slide that shows. They were `div` elements that took a click and nothing else: a user of the keyboard had the two arrows only, and a screen reader did not announce them. ([#163](https://github.com/webtides/element-library/issues/163))
|
|
30
|
+
- The arrow buttons have an accessible name when their slots are empty: "Previous slide" and "Next slide", for screen readers only. What is put into the `arrow-left` and `arrow-right` slots replaces that name, as it named the button before. An arrow with an empty slot was a button without a name (axe `button-name`). ([#94](https://github.com/webtides/element-library/issues/94))
|
|
31
|
+
- Going on from the last slide shows the first slide coming in. It showed a copy of the second one, which then jumped to the first: the copies after the last slide were in the wrong order. ([#96](https://github.com/webtides/element-library/issues/96))
|
|
32
|
+
- `api.update()` keeps the slides. After an update Glide took the `<slot>` for its only slide, so the carousel had one empty slide. ([#96](https://github.com/webtides/element-library/issues/96))
|
|
33
|
+
- What a page puts into the `arrow-left` or `arrow-right` slot no longer gets the margins of a slide gap. ([#96](https://github.com/webtides/element-library/issues/96))
|
|
34
|
+
|
|
15
35
|
## [0.1.1] - 2026-06-04
|
|
16
36
|
|
|
17
37
|
### Fixed
|