@sondor-technology/sondor-components 1.0.8 → 1.0.10
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/dist/components/accordion/accordion.constants.d.ts +5 -0
- package/dist/components/accordion/accordion.constants.d.ts.map +1 -0
- package/dist/components/accordion/accordion.constants.js +3 -0
- package/dist/components/accordion/accordion.constants.js.map +1 -0
- package/dist/components/accordion/accordion.d.ts +29 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.js +226 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/alert/alert.constants.d.ts +2 -0
- package/dist/components/alert/alert.constants.d.ts.map +1 -1
- package/dist/components/alert/alert.d.ts +50 -2
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +285 -16
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +20 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.js +100 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/back-to-top/back-to-top.d.ts +29 -0
- package/dist/components/back-to-top/back-to-top.d.ts.map +1 -0
- package/dist/components/back-to-top/back-to-top.js +149 -0
- package/dist/components/back-to-top/back-to-top.js.map +1 -0
- package/dist/components/bar-chart/bar-chart.d.ts +42 -0
- package/dist/components/bar-chart/bar-chart.d.ts.map +1 -0
- package/dist/components/bar-chart/bar-chart.js +298 -0
- package/dist/components/bar-chart/bar-chart.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.js +2 -2
- package/dist/components/button/button.d.ts +1 -0
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +8 -8
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js +4 -4
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/calendar.js +21 -9
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/chart/chart-base.d.ts +59 -0
- package/dist/components/chart/chart-base.d.ts.map +1 -0
- package/dist/components/chart/chart-base.js +261 -0
- package/dist/components/chart/chart-base.js.map +1 -0
- package/dist/components/chart/chart.utils.d.ts +27 -0
- package/dist/components/chart/chart.utils.d.ts.map +1 -0
- package/dist/components/chart/chart.utils.js +117 -0
- package/dist/components/chart/chart.utils.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +5 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +34 -24
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/consent/consent.d.ts +63 -0
- package/dist/components/consent/consent.d.ts.map +1 -0
- package/dist/components/consent/consent.js +327 -0
- package/dist/components/consent/consent.js.map +1 -0
- package/dist/components/consent/consent.utils.d.ts +36 -0
- package/dist/components/consent/consent.utils.d.ts.map +1 -0
- package/dist/components/consent/consent.utils.js +82 -0
- package/dist/components/consent/consent.utils.js.map +1 -0
- package/dist/components/contact/contact.d.ts +22 -0
- package/dist/components/contact/contact.d.ts.map +1 -0
- package/dist/components/contact/contact.js +83 -0
- package/dist/components/contact/contact.js.map +1 -0
- package/dist/components/container/container.d.ts +20 -0
- package/dist/components/container/container.d.ts.map +1 -0
- package/dist/components/container/container.js +68 -0
- package/dist/components/container/container.js.map +1 -0
- package/dist/components/content-card/content-card.js +4 -4
- package/dist/components/context-menu/context-menu.d.ts +89 -0
- package/dist/components/context-menu/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu/context-menu.js +414 -0
- package/dist/components/context-menu/context-menu.js.map +1 -0
- package/dist/components/cron-builder/cron-builder.d.ts +5 -2
- package/dist/components/cron-builder/cron-builder.d.ts.map +1 -1
- package/dist/components/cron-builder/cron-builder.js +83 -15
- package/dist/components/cron-builder/cron-builder.js.map +1 -1
- package/dist/components/cta/cta.d.ts +20 -0
- package/dist/components/cta/cta.d.ts.map +1 -0
- package/dist/components/cta/cta.js +64 -0
- package/dist/components/cta/cta.js.map +1 -0
- package/dist/components/drawer/drawer.js +6 -6
- package/dist/components/faq/faq-item.d.ts +22 -0
- package/dist/components/faq/faq-item.d.ts.map +1 -0
- package/dist/components/faq/faq-item.js +117 -0
- package/dist/components/faq/faq-item.js.map +1 -0
- package/dist/components/faq/faq.d.ts +18 -0
- package/dist/components/faq/faq.d.ts.map +1 -0
- package/dist/components/faq/faq.js +38 -0
- package/dist/components/faq/faq.js.map +1 -0
- package/dist/components/feature-grid/feature-grid.d.ts +22 -0
- package/dist/components/feature-grid/feature-grid.d.ts.map +1 -0
- package/dist/components/feature-grid/feature-grid.js +55 -0
- package/dist/components/feature-grid/feature-grid.js.map +1 -0
- package/dist/components/feature-grid/feature.d.ts +18 -0
- package/dist/components/feature-grid/feature.d.ts.map +1 -0
- package/dist/components/feature-grid/feature.js +91 -0
- package/dist/components/feature-grid/feature.js.map +1 -0
- package/dist/components/field/field.js +2 -2
- package/dist/components/footer/footer.js +4 -4
- package/dist/components/form/form-reset.d.ts +7 -0
- package/dist/components/form/form-reset.d.ts.map +1 -0
- package/dist/components/form/form-reset.js +47 -0
- package/dist/components/form/form-reset.js.map +1 -0
- package/dist/components/form/form.d.ts +5 -0
- package/dist/components/form/form.d.ts.map +1 -1
- package/dist/components/form/form.js +17 -3
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/grid/grid.d.ts +5 -0
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +86 -4
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/heat-map/heat-map.d.ts +39 -0
- package/dist/components/heat-map/heat-map.d.ts.map +1 -0
- package/dist/components/heat-map/heat-map.js +306 -0
- package/dist/components/heat-map/heat-map.js.map +1 -0
- package/dist/components/hero/hero.d.ts +26 -0
- package/dist/components/hero/hero.d.ts.map +1 -0
- package/dist/components/hero/hero.js +132 -0
- package/dist/components/hero/hero.js.map +1 -0
- package/dist/components/icon/icon-paths.d.ts +84 -0
- package/dist/components/icon/icon-paths.d.ts.map +1 -1
- package/dist/components/icon/icon-paths.js +89 -0
- package/dist/components/icon/icon-paths.js.map +1 -1
- package/dist/components/icon/icon.d.ts +2 -0
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +10 -1
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/image/image.d.ts +31 -0
- package/dist/components/image/image.d.ts.map +1 -0
- package/dist/components/image/image.js +179 -0
- package/dist/components/image/image.js.map +1 -0
- package/dist/components/input/input.js +4 -4
- package/dist/components/lazy/lazy.d.ts +34 -0
- package/dist/components/lazy/lazy.d.ts.map +1 -0
- package/dist/components/lazy/lazy.js +104 -0
- package/dist/components/lazy/lazy.js.map +1 -0
- package/dist/components/line-chart/line-chart.d.ts +37 -0
- package/dist/components/line-chart/line-chart.d.ts.map +1 -0
- package/dist/components/line-chart/line-chart.js +271 -0
- package/dist/components/line-chart/line-chart.js.map +1 -0
- package/dist/components/list/list-item.d.ts +45 -0
- package/dist/components/list/list-item.d.ts.map +1 -0
- package/dist/components/list/list-item.js +263 -0
- package/dist/components/list/list-item.js.map +1 -0
- package/dist/components/list/list.d.ts +50 -0
- package/dist/components/list/list.d.ts.map +1 -0
- package/dist/components/list/list.js +161 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/logo-cloud/logo-cloud.d.ts +19 -0
- package/dist/components/logo-cloud/logo-cloud.d.ts.map +1 -0
- package/dist/components/logo-cloud/logo-cloud.js +66 -0
- package/dist/components/logo-cloud/logo-cloud.js.map +1 -0
- package/dist/components/modal/modal.d.ts +12 -0
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/modal/modal.js +40 -11
- package/dist/components/modal/modal.js.map +1 -1
- package/dist/components/page-layout/page-layout.js +8 -8
- package/dist/components/pagination/pagination.d.ts +15 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/pagination/pagination.js +126 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/pagination/pagination.utils.d.ts +3 -0
- package/dist/components/pagination/pagination.utils.d.ts.map +1 -0
- package/dist/components/pagination/pagination.utils.js +19 -0
- package/dist/components/pagination/pagination.utils.js.map +1 -0
- package/dist/components/pie-chart/pie-chart.d.ts +33 -0
- package/dist/components/pie-chart/pie-chart.d.ts.map +1 -0
- package/dist/components/pie-chart/pie-chart.js +233 -0
- package/dist/components/pie-chart/pie-chart.js.map +1 -0
- package/dist/components/pin-input/pin-input.js +4 -4
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +1 -3
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/post-list/post-card.d.ts +16 -0
- package/dist/components/post-list/post-card.d.ts.map +1 -0
- package/dist/components/post-list/post-card.js +22 -0
- package/dist/components/post-list/post-card.js.map +1 -0
- package/dist/components/post-list/post-list.d.ts +17 -0
- package/dist/components/post-list/post-list.d.ts.map +1 -0
- package/dist/components/post-list/post-list.js +23 -0
- package/dist/components/post-list/post-list.js.map +1 -0
- package/dist/components/pricing/pricing-tier.d.ts +23 -0
- package/dist/components/pricing/pricing-tier.d.ts.map +1 -0
- package/dist/components/pricing/pricing-tier.js +144 -0
- package/dist/components/pricing/pricing-tier.js.map +1 -0
- package/dist/components/pricing/pricing.d.ts +18 -0
- package/dist/components/pricing/pricing.d.ts.map +1 -0
- package/dist/components/pricing/pricing.js +38 -0
- package/dist/components/pricing/pricing.js.map +1 -0
- package/dist/components/progress/progress.d.ts +17 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/progress/progress.js +109 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/project-grid/project-card.d.ts +17 -0
- package/dist/components/project-grid/project-card.d.ts.map +1 -0
- package/dist/components/project-grid/project-card.js +23 -0
- package/dist/components/project-grid/project-card.js.map +1 -0
- package/dist/components/project-grid/project-grid.d.ts +17 -0
- package/dist/components/project-grid/project-grid.d.ts.map +1 -0
- package/dist/components/project-grid/project-grid.js +23 -0
- package/dist/components/project-grid/project-grid.js.map +1 -0
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/reveal/reveal.constants.d.ts +10 -0
- package/dist/components/reveal/reveal.constants.d.ts.map +1 -0
- package/dist/components/reveal/reveal.constants.js +11 -0
- package/dist/components/reveal/reveal.constants.js.map +1 -0
- package/dist/components/reveal/reveal.d.ts +64 -0
- package/dist/components/reveal/reveal.d.ts.map +1 -0
- package/dist/components/reveal/reveal.js +352 -0
- package/dist/components/reveal/reveal.js.map +1 -0
- package/dist/components/scroll-progress/scroll-progress.d.ts +32 -0
- package/dist/components/scroll-progress/scroll-progress.d.ts.map +1 -0
- package/dist/components/scroll-progress/scroll-progress.js +120 -0
- package/dist/components/scroll-progress/scroll-progress.js.map +1 -0
- package/dist/components/section/card-row.d.ts +30 -0
- package/dist/components/section/card-row.d.ts.map +1 -0
- package/dist/components/section/card-row.js +174 -0
- package/dist/components/section/card-row.js.map +1 -0
- package/dist/components/section/card.d.ts +27 -0
- package/dist/components/section/card.d.ts.map +1 -0
- package/dist/components/section/card.js +205 -0
- package/dist/components/section/card.js.map +1 -0
- package/dist/components/section/row-item.d.ts +22 -0
- package/dist/components/section/row-item.d.ts.map +1 -0
- package/dist/components/section/row-item.js +53 -0
- package/dist/components/section/row-item.js.map +1 -0
- package/dist/components/section/section.d.ts +70 -0
- package/dist/components/section/section.d.ts.map +1 -0
- package/dist/components/section/section.js +240 -0
- package/dist/components/section/section.js.map +1 -0
- package/dist/components/select/select.js +3 -3
- package/dist/components/series-nav/series-nav.d.ts +29 -0
- package/dist/components/series-nav/series-nav.d.ts.map +1 -0
- package/dist/components/series-nav/series-nav.js +178 -0
- package/dist/components/series-nav/series-nav.js.map +1 -0
- package/dist/components/site-header/site-header.d.ts +51 -0
- package/dist/components/site-header/site-header.d.ts.map +1 -0
- package/dist/components/site-header/site-header.js +296 -0
- package/dist/components/site-header/site-header.js.map +1 -0
- package/dist/components/skeleton/skeleton.js +7 -7
- package/dist/components/sparkline/sparkline.d.ts +19 -0
- package/dist/components/sparkline/sparkline.d.ts.map +1 -0
- package/dist/components/sparkline/sparkline.js +99 -0
- package/dist/components/sparkline/sparkline.js.map +1 -0
- package/dist/components/spinner/spinner.d.ts +13 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/spinner/spinner.js +65 -0
- package/dist/components/spinner/spinner.js.map +1 -0
- package/dist/components/split/split.d.ts +23 -0
- package/dist/components/split/split.d.ts.map +1 -0
- package/dist/components/split/split.js +104 -0
- package/dist/components/split/split.js.map +1 -0
- package/dist/components/stack/stack.d.ts +21 -0
- package/dist/components/stack/stack.d.ts.map +1 -0
- package/dist/components/stack/stack.js +102 -0
- package/dist/components/stack/stack.js.map +1 -0
- package/dist/components/stat-card/stat-card.d.ts +35 -0
- package/dist/components/stat-card/stat-card.d.ts.map +1 -0
- package/dist/components/stat-card/stat-card.js +199 -0
- package/dist/components/stat-card/stat-card.js.map +1 -0
- package/dist/components/stats/stat.d.ts +16 -0
- package/dist/components/stats/stat.d.ts.map +1 -0
- package/dist/components/stats/stat.js +51 -0
- package/dist/components/stats/stat.js.map +1 -0
- package/dist/components/stats/stats.d.ts +19 -0
- package/dist/components/stats/stats.d.ts.map +1 -0
- package/dist/components/stats/stats.js +45 -0
- package/dist/components/stats/stats.js.map +1 -0
- package/dist/components/switch/switch.js +2 -2
- package/dist/components/table/data-table.d.ts +115 -27
- package/dist/components/table/data-table.d.ts.map +1 -1
- package/dist/components/table/data-table.js +1012 -411
- package/dist/components/table/data-table.js.map +1 -1
- package/dist/components/table/data-table.utils.d.ts +81 -0
- package/dist/components/table/data-table.utils.d.ts.map +1 -0
- package/dist/components/table/data-table.utils.js +208 -0
- package/dist/components/table/data-table.utils.js.map +1 -0
- package/dist/components/table/table.d.ts +28 -0
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +161 -33
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/team/person.d.ts +19 -0
- package/dist/components/team/person.d.ts.map +1 -0
- package/dist/components/team/person.js +123 -0
- package/dist/components/team/person.js.map +1 -0
- package/dist/components/team/team.d.ts +18 -0
- package/dist/components/team/team.d.ts.map +1 -0
- package/dist/components/team/team.js +36 -0
- package/dist/components/team/team.js.map +1 -0
- package/dist/components/testimonials/testimonial.d.ts +18 -0
- package/dist/components/testimonials/testimonial.d.ts.map +1 -0
- package/dist/components/testimonials/testimonial.js +115 -0
- package/dist/components/testimonials/testimonial.js.map +1 -0
- package/dist/components/testimonials/testimonials.d.ts +18 -0
- package/dist/components/testimonials/testimonials.d.ts.map +1 -0
- package/dist/components/testimonials/testimonials.js +36 -0
- package/dist/components/testimonials/testimonials.js.map +1 -0
- package/dist/components/textarea/textarea.js +3 -3
- package/dist/components/theme-toggle/theme-toggle.js +1 -1
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/time-picker/time-picker.js +13 -3
- package/dist/components/time-picker/time-picker.js.map +1 -1
- package/dist/components/timeline/timeline-item.d.ts +18 -0
- package/dist/components/timeline/timeline-item.d.ts.map +1 -0
- package/dist/components/timeline/timeline-item.js +102 -0
- package/dist/components/timeline/timeline-item.js.map +1 -0
- package/dist/components/timeline/timeline.d.ts +18 -0
- package/dist/components/timeline/timeline.d.ts.map +1 -0
- package/dist/components/timeline/timeline.js +30 -0
- package/dist/components/timeline/timeline.js.map +1 -0
- package/dist/components/toast/toast.d.ts +33 -0
- package/dist/components/toast/toast.d.ts.map +1 -0
- package/dist/components/toast/toast.js +147 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/toggle-group/toggle-button.d.ts +2 -0
- package/dist/components/toggle-group/toggle-button.d.ts.map +1 -1
- package/dist/components/toggle-group/toggle-button.js +12 -5
- package/dist/components/toggle-group/toggle-button.js.map +1 -1
- package/dist/components/toggle-group/toggle-group.d.ts +6 -0
- package/dist/components/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group/toggle-group.js +141 -21
- package/dist/components/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +21 -21
- package/dist/components/vertical-nav/vertical-nav-group.js +3 -3
- package/dist/components/vertical-nav/vertical-nav-item.js +4 -4
- package/dist/components/video-embed/video-embed.d.ts +37 -0
- package/dist/components/video-embed/video-embed.d.ts.map +1 -0
- package/dist/components/video-embed/video-embed.js +183 -0
- package/dist/components/video-embed/video-embed.js.map +1 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/index.css +205 -1
- package/dist/styles/reset.d.ts.map +1 -1
- package/dist/styles/reset.js +5 -0
- package/dist/styles/reset.js.map +1 -1
- package/package.json +214 -7
- package/src/components/accordion/accordion.constants.ts +5 -0
- package/src/components/accordion/accordion.ts +209 -0
- package/src/components/alert/alert.constants.ts +3 -0
- package/src/components/alert/alert.ts +284 -17
- package/src/components/avatar/avatar.ts +84 -0
- package/src/components/back-to-top/back-to-top.ts +140 -0
- package/src/components/bar-chart/bar-chart.ts +295 -0
- package/src/components/breadcrumb/breadcrumb.ts +2 -2
- package/src/components/button/button.ts +9 -8
- package/src/components/button-group/button-group.ts +4 -4
- package/src/components/calendar/calendar.ts +26 -9
- package/src/components/chart/chart-base.ts +275 -0
- package/src/components/chart/chart.utils.ts +140 -0
- package/src/components/code-block/code-block.ts +35 -24
- package/src/components/consent/consent.ts +312 -0
- package/src/components/consent/consent.utils.ts +110 -0
- package/src/components/contact/contact.ts +83 -0
- package/src/components/container/container.ts +60 -0
- package/src/components/content-card/content-card.ts +4 -4
- package/src/components/context-menu/context-menu.ts +426 -0
- package/src/components/cron-builder/cron-builder.ts +102 -22
- package/src/components/cta/cta.ts +64 -0
- package/src/components/drawer/drawer.ts +6 -6
- package/src/components/faq/faq-item.ts +110 -0
- package/src/components/faq/faq.ts +40 -0
- package/src/components/feature-grid/feature-grid.ts +52 -0
- package/src/components/feature-grid/feature.ts +84 -0
- package/src/components/field/field.ts +2 -2
- package/src/components/footer/footer.ts +4 -4
- package/src/components/form/form-reset.ts +45 -0
- package/src/components/form/form.ts +17 -3
- package/src/components/grid/grid.ts +73 -4
- package/src/components/heat-map/heat-map.ts +292 -0
- package/src/components/hero/hero.ts +132 -0
- package/src/components/icon/icon-paths.ts +92 -1
- package/src/components/icon/icon.ts +8 -1
- package/src/components/image/image.ts +165 -0
- package/src/components/input/input.ts +4 -4
- package/src/components/lazy/lazy.ts +94 -0
- package/src/components/line-chart/line-chart.ts +271 -0
- package/src/components/list/list-item.ts +225 -0
- package/src/components/list/list.ts +157 -0
- package/src/components/logo-cloud/logo-cloud.ts +65 -0
- package/src/components/modal/modal.ts +37 -11
- package/src/components/page-layout/page-layout.ts +8 -8
- package/src/components/pagination/pagination.ts +120 -0
- package/src/components/pagination/pagination.utils.ts +14 -0
- package/src/components/pie-chart/pie-chart.ts +230 -0
- package/src/components/pin-input/pin-input.ts +4 -4
- package/src/components/popover/popover.ts +1 -3
- package/src/components/post-list/post-card.ts +18 -0
- package/src/components/post-list/post-list.ts +19 -0
- package/src/components/pricing/pricing-tier.ts +132 -0
- package/src/components/pricing/pricing.ts +39 -0
- package/src/components/progress/progress.ts +95 -0
- package/src/components/project-grid/project-card.ts +19 -0
- package/src/components/project-grid/project-grid.ts +19 -0
- package/src/components/radio/radio.ts +1 -1
- package/src/components/reveal/reveal.constants.ts +20 -0
- package/src/components/reveal/reveal.ts +344 -0
- package/src/components/scroll-progress/scroll-progress.ts +119 -0
- package/src/components/section/card-row.ts +152 -0
- package/src/components/section/card.ts +197 -0
- package/src/components/section/row-item.ts +38 -0
- package/src/components/section/section.ts +232 -0
- package/src/components/select/select.ts +3 -3
- package/src/components/series-nav/series-nav.ts +164 -0
- package/src/components/site-header/site-header.ts +276 -0
- package/src/components/skeleton/skeleton.ts +7 -7
- package/src/components/sparkline/sparkline.ts +83 -0
- package/src/components/spinner/spinner.ts +55 -0
- package/src/components/split/split.ts +106 -0
- package/src/components/stack/stack.ts +88 -0
- package/src/components/stat-card/stat-card.ts +179 -0
- package/src/components/stats/stat.ts +49 -0
- package/src/components/stats/stats.ts +47 -0
- package/src/components/switch/switch.ts +2 -2
- package/src/components/table/data-table.ts +1015 -425
- package/src/components/table/data-table.utils.ts +276 -0
- package/src/components/table/table.ts +168 -38
- package/src/components/team/person.ts +113 -0
- package/src/components/team/team.ts +37 -0
- package/src/components/testimonials/testimonial.ts +108 -0
- package/src/components/testimonials/testimonials.ts +37 -0
- package/src/components/textarea/textarea.ts +3 -3
- package/src/components/theme-toggle/theme-toggle.ts +1 -1
- package/src/components/time-picker/time-picker.ts +17 -3
- package/src/components/timeline/timeline-item.ts +100 -0
- package/src/components/timeline/timeline.ts +31 -0
- package/src/components/toast/toast.ts +153 -0
- package/src/components/toggle-group/toggle-button.ts +9 -5
- package/src/components/toggle-group/toggle-group.ts +158 -42
- package/src/components/tooltip/tooltip.ts +21 -21
- package/src/components/vertical-nav/vertical-nav-group.ts +3 -3
- package/src/components/vertical-nav/vertical-nav-item.ts +4 -4
- package/src/components/video-embed/video-embed.ts +162 -0
- package/src/index.ts +108 -0
- package/src/styles/globals.css +63 -0
- package/src/styles/index.css +3 -1
- package/src/styles/prose.css +154 -0
- package/src/styles/reset.ts +5 -0
- package/src/styles/theme.css +53 -0
- package/src/styles/typography.css +1 -0
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import "./toggle-button.js";
|
|
1
|
+
import {LitElement, html, css, PropertyValues} from "lit";
|
|
2
|
+
import {customElement, property, queryAssignedElements, state, query} from "lit/decorators.js";
|
|
3
|
+
import {ifDefined} from "lit/directives/if-defined.js";
|
|
4
|
+
import {classMap} from "lit/directives/class-map.js";
|
|
5
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
6
|
+
import type {StToggleButton} from "./toggle-button.js";
|
|
7
|
+
import "./toggle-button.js";
|
|
7
8
|
|
|
8
9
|
@customElement("st-toggle-group")
|
|
9
10
|
export class StToggleGroup extends LitElement {
|
|
10
11
|
static formAssociated = true;
|
|
11
12
|
private _internals: ElementInternals;
|
|
13
|
+
private _resizeObserver!: ResizeObserver;
|
|
12
14
|
|
|
13
|
-
@
|
|
15
|
+
@query(".group-container") private _container!: HTMLElement;
|
|
16
|
+
|
|
17
|
+
@queryAssignedElements({selector: "st-toggle-button"})
|
|
14
18
|
private _buttons!: StToggleButton[];
|
|
15
19
|
|
|
16
|
-
@property({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@property({
|
|
20
|
-
|
|
21
|
-
@property({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
@property({ attribute: "aria-label" }) ariaLabel = "";
|
|
20
|
+
@property({type: String, reflect: true}) name = "";
|
|
21
|
+
@property({type: String}) value = "";
|
|
22
|
+
@property({type: Boolean}) multiple = false;
|
|
23
|
+
@property({type: Boolean, reflect: true}) disabled = false;
|
|
24
|
+
@property({type: Boolean, reflect: true}) required = false;
|
|
25
|
+
@property({attribute: "aria-label"}) ariaLabel = "";
|
|
26
|
+
|
|
27
|
+
// 🚀 NEW: State properties for dynamic shadows
|
|
28
|
+
@state() private _canScrollLeft = false;
|
|
29
|
+
@state() private _canScrollRight = false;
|
|
27
30
|
|
|
28
31
|
private _defaultValue = "";
|
|
29
32
|
|
|
@@ -38,47 +41,146 @@ export class StToggleGroup extends LitElement {
|
|
|
38
41
|
css`
|
|
39
42
|
:host {
|
|
40
43
|
display: inline-flex;
|
|
44
|
+
max-width: 100%;
|
|
45
|
+
min-width: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.scroll-wrapper {
|
|
49
|
+
position: relative;
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
max-width: 100%;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* 🚀 FIX: Widened to 40px, boosted z-index to 10, and darkened the opacity */
|
|
56
|
+
.scroll-wrapper::before,
|
|
57
|
+
.scroll-wrapper::after {
|
|
58
|
+
content: "";
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: 0;
|
|
61
|
+
bottom: 0;
|
|
62
|
+
width: 40px;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
z-index: 10;
|
|
65
|
+
opacity: 0;
|
|
66
|
+
transition: opacity 0.3s ease;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.scroll-wrapper::before {
|
|
70
|
+
left: 0;
|
|
71
|
+
background: linear-gradient(
|
|
72
|
+
to right,
|
|
73
|
+
var(--st-color-scroll-shadow) 0%,
|
|
74
|
+
transparent 100%
|
|
75
|
+
);
|
|
76
|
+
border-top-left-radius: var(--st-radius-md);
|
|
77
|
+
border-bottom-left-radius: var(--st-radius-md);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.scroll-wrapper::after {
|
|
81
|
+
right: 0;
|
|
82
|
+
background: linear-gradient(
|
|
83
|
+
to left,
|
|
84
|
+
var(--st-color-scroll-shadow) 0%,
|
|
85
|
+
transparent 100%
|
|
86
|
+
);
|
|
87
|
+
border-top-right-radius: var(--st-radius-md);
|
|
88
|
+
border-bottom-right-radius: var(--st-radius-md);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.scroll-wrapper.can-scroll-left::before {
|
|
92
|
+
opacity: 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.scroll-wrapper.can-scroll-right::after {
|
|
96
|
+
opacity: 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* 🚀 FIX: Dialed up to 0.5 for dark mode */
|
|
100
|
+
:host([data-theme="dark"]) .scroll-wrapper::before {
|
|
101
|
+
background: linear-gradient(to right, var(--st-color-overlay) 0%, transparent 100%);
|
|
102
|
+
}
|
|
103
|
+
:host([data-theme="dark"]) .scroll-wrapper::after {
|
|
104
|
+
background: linear-gradient(to left, var(--st-color-overlay) 0%, transparent 100%);
|
|
41
105
|
}
|
|
42
106
|
|
|
43
107
|
.group-container {
|
|
44
108
|
display: inline-flex;
|
|
109
|
+
max-width: 100%;
|
|
110
|
+
min-width: 0;
|
|
45
111
|
background-color: var(--st-color-border);
|
|
46
|
-
/* 🚀 FIX: This 1px gap perfectly acts as the inner border between children */
|
|
47
112
|
gap: 1px;
|
|
48
113
|
border: 1px solid var(--st-color-border);
|
|
49
114
|
border-radius: var(--st-radius-md);
|
|
50
|
-
|
|
115
|
+
|
|
116
|
+
overflow-x: auto;
|
|
117
|
+
overflow-y: hidden;
|
|
118
|
+
-webkit-overflow-scrolling: touch;
|
|
119
|
+
scrollbar-width: none;
|
|
120
|
+
-ms-overflow-style: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.group-container::-webkit-scrollbar {
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
::slotted(*) {
|
|
128
|
+
flex-shrink: 0;
|
|
51
129
|
}
|
|
52
130
|
|
|
53
131
|
:host([disabled]) .group-container {
|
|
54
132
|
opacity: 0.5;
|
|
55
133
|
pointer-events: none;
|
|
56
134
|
}
|
|
57
|
-
|
|
135
|
+
`,
|
|
58
136
|
];
|
|
59
137
|
|
|
60
138
|
override firstUpdated(changedProperties: PropertyValues) {
|
|
61
139
|
super.firstUpdated(changedProperties);
|
|
62
140
|
this._defaultValue = this.value;
|
|
141
|
+
|
|
142
|
+
// 🚀 NEW: Observe the container. If the user rotates their phone,
|
|
143
|
+
// we need to recalculate if shadows are still needed.
|
|
144
|
+
this._resizeObserver = new ResizeObserver(() => this._checkScroll());
|
|
145
|
+
if (this._container) {
|
|
146
|
+
this._resizeObserver.observe(this._container);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
override disconnectedCallback() {
|
|
151
|
+
super.disconnectedCallback();
|
|
152
|
+
if (this._resizeObserver) {
|
|
153
|
+
this._resizeObserver.disconnect();
|
|
154
|
+
}
|
|
63
155
|
}
|
|
64
156
|
|
|
65
157
|
override updated(changedProperties: PropertyValues) {
|
|
66
158
|
super.updated(changedProperties);
|
|
67
|
-
|
|
159
|
+
|
|
68
160
|
if (changedProperties.has("value")) {
|
|
69
161
|
this._internals.setFormValue(this.value || null);
|
|
70
162
|
this._syncButtons();
|
|
71
163
|
this._syncValidity();
|
|
72
164
|
}
|
|
73
|
-
|
|
165
|
+
|
|
74
166
|
if (changedProperties.has("disabled")) {
|
|
75
|
-
this._buttons.forEach(btn => btn.disabled = this.disabled);
|
|
167
|
+
this._buttons.forEach((btn) => (btn.disabled = this.disabled));
|
|
76
168
|
}
|
|
77
169
|
}
|
|
78
170
|
|
|
171
|
+
// 🚀 NEW: Mathematically determine if we are at the edges of the scroll box
|
|
172
|
+
private _checkScroll = () => {
|
|
173
|
+
if (!this._container) return;
|
|
174
|
+
const {scrollLeft, scrollWidth, clientWidth} = this._container;
|
|
175
|
+
|
|
176
|
+
// Use a 1px buffer to prevent fractional pixel rounding errors on high-DPI screens
|
|
177
|
+
this._canScrollLeft = scrollLeft > 1;
|
|
178
|
+
this._canScrollRight = Math.ceil(scrollLeft + clientWidth) < scrollWidth - 1;
|
|
179
|
+
};
|
|
180
|
+
|
|
79
181
|
private _syncButtons() {
|
|
80
182
|
const values = this.multiple && this.value ? this.value.split(",") : [this.value];
|
|
81
|
-
this._buttons.forEach(btn => {
|
|
183
|
+
this._buttons.forEach((btn) => {
|
|
82
184
|
btn.selected = values.includes(btn.value);
|
|
83
185
|
});
|
|
84
186
|
}
|
|
@@ -86,30 +188,31 @@ export class StToggleGroup extends LitElement {
|
|
|
86
188
|
private _handleSlotChange() {
|
|
87
189
|
this._syncButtons();
|
|
88
190
|
if (this.disabled) {
|
|
89
|
-
this._buttons.forEach(btn => btn.disabled = true);
|
|
191
|
+
this._buttons.forEach((btn) => (btn.disabled = true));
|
|
90
192
|
}
|
|
193
|
+
// Calculate shadows after slots render
|
|
194
|
+
setTimeout(() => this._checkScroll(), 50);
|
|
91
195
|
}
|
|
92
196
|
|
|
93
|
-
private _handleToggle(e: CustomEvent<{
|
|
197
|
+
private _handleToggle(e: CustomEvent<{value: string}>) {
|
|
94
198
|
e.stopPropagation();
|
|
95
199
|
const toggledValue = e.detail.value;
|
|
96
200
|
|
|
97
201
|
if (this.multiple) {
|
|
98
202
|
let values = this.value ? this.value.split(",") : [];
|
|
99
203
|
if (values.includes(toggledValue)) {
|
|
100
|
-
values = values.filter(v => v !== toggledValue);
|
|
204
|
+
values = values.filter((v) => v !== toggledValue);
|
|
101
205
|
} else {
|
|
102
|
-
values.push(toggledValue);
|
|
206
|
+
values.push(toggledValue);
|
|
103
207
|
}
|
|
104
208
|
this.value = values.join(",");
|
|
105
209
|
} else {
|
|
106
|
-
// Single select behavior (radio button style: clicking active doesn't deselect)
|
|
107
210
|
if (this.value !== toggledValue) {
|
|
108
211
|
this.value = toggledValue;
|
|
109
212
|
}
|
|
110
213
|
}
|
|
111
214
|
|
|
112
|
-
this.dispatchEvent(new Event("change", {
|
|
215
|
+
this.dispatchEvent(new Event("change", {bubbles: true, composed: true}));
|
|
113
216
|
}
|
|
114
217
|
|
|
115
218
|
formResetCallback() {
|
|
@@ -118,24 +221,37 @@ export class StToggleGroup extends LitElement {
|
|
|
118
221
|
|
|
119
222
|
private _syncValidity() {
|
|
120
223
|
if (this.required && !this.value) {
|
|
121
|
-
this._internals.setValidity({
|
|
224
|
+
this._internals.setValidity({valueMissing: true}, "Please select an option.");
|
|
122
225
|
} else {
|
|
123
226
|
this._internals.setValidity({});
|
|
124
227
|
}
|
|
125
228
|
}
|
|
126
229
|
|
|
127
|
-
public checkValidity() {
|
|
128
|
-
|
|
230
|
+
public checkValidity() {
|
|
231
|
+
return this._internals.checkValidity();
|
|
232
|
+
}
|
|
233
|
+
public reportValidity() {
|
|
234
|
+
return this._internals.reportValidity();
|
|
235
|
+
}
|
|
129
236
|
|
|
130
237
|
render() {
|
|
238
|
+
const wrapperClasses = classMap({
|
|
239
|
+
"scroll-wrapper": true,
|
|
240
|
+
"can-scroll-left": this._canScrollLeft,
|
|
241
|
+
"can-scroll-right": this._canScrollRight,
|
|
242
|
+
});
|
|
243
|
+
|
|
131
244
|
return html`
|
|
132
|
-
<div
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
245
|
+
<div class=${wrapperClasses}>
|
|
246
|
+
<div
|
|
247
|
+
class="group-container"
|
|
248
|
+
role="group"
|
|
249
|
+
aria-label=${ifDefined(this.ariaLabel || undefined)}
|
|
250
|
+
aria-required=${this.required ? "true" : "false"}
|
|
251
|
+
@scroll=${this._checkScroll}
|
|
252
|
+
>
|
|
253
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
254
|
+
</div>
|
|
139
255
|
</div>
|
|
140
256
|
`;
|
|
141
257
|
}
|
|
@@ -145,4 +261,4 @@ declare global {
|
|
|
145
261
|
interface HTMLElementTagNameMap {
|
|
146
262
|
"st-toggle-group": StToggleGroup;
|
|
147
263
|
}
|
|
148
|
-
}
|
|
264
|
+
}
|
|
@@ -54,7 +54,7 @@ export class StTooltip extends LitElement {
|
|
|
54
54
|
opacity 0.2s ease,
|
|
55
55
|
transform 0.2s ease,
|
|
56
56
|
visibility 0.2s;
|
|
57
|
-
box-shadow:
|
|
57
|
+
box-shadow: var(--st-shadow-md);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.tooltip-popup::before {
|
|
@@ -78,44 +78,44 @@ export class StTooltip extends LitElement {
|
|
|
78
78
|
========================================== */
|
|
79
79
|
|
|
80
80
|
.variant-info {
|
|
81
|
-
background: var(--st-color-info
|
|
82
|
-
border-color: var(--st-color-info
|
|
83
|
-
color: var(--st-color-on-info
|
|
81
|
+
background: var(--st-color-info);
|
|
82
|
+
border-color: var(--st-color-info);
|
|
83
|
+
color: var(--st-color-on-info);
|
|
84
84
|
}
|
|
85
85
|
.variant-info::before {
|
|
86
|
-
background: var(--st-color-info
|
|
87
|
-
border-color: var(--st-color-info
|
|
86
|
+
background: var(--st-color-info);
|
|
87
|
+
border-color: var(--st-color-info);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
.variant-success {
|
|
91
|
-
background: var(--st-color-success
|
|
92
|
-
border-color: var(--st-color-success
|
|
93
|
-
color: var(--st-color-on-success
|
|
91
|
+
background: var(--st-color-success);
|
|
92
|
+
border-color: var(--st-color-success);
|
|
93
|
+
color: var(--st-color-on-success);
|
|
94
94
|
}
|
|
95
95
|
.variant-success::before {
|
|
96
|
-
background: var(--st-color-success
|
|
97
|
-
border-color: var(--st-color-success
|
|
96
|
+
background: var(--st-color-success);
|
|
97
|
+
border-color: var(--st-color-success);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.variant-warning {
|
|
101
|
-
background: var(--st-color-warning
|
|
102
|
-
border-color: var(--st-color-warning
|
|
101
|
+
background: var(--st-color-warning);
|
|
102
|
+
border-color: var(--st-color-warning);
|
|
103
103
|
/* Warning usually needs dark text for contrast */
|
|
104
|
-
color: var(--st-color-on-warning
|
|
104
|
+
color: var(--st-color-on-warning);
|
|
105
105
|
}
|
|
106
106
|
.variant-warning::before {
|
|
107
|
-
background: var(--st-color-warning
|
|
108
|
-
border-color: var(--st-color-warning
|
|
107
|
+
background: var(--st-color-warning);
|
|
108
|
+
border-color: var(--st-color-warning);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
.variant-danger {
|
|
112
|
-
background: var(--st-color-danger
|
|
113
|
-
border-color: var(--st-color-danger
|
|
114
|
-
color: var(--st-color-on-danger
|
|
112
|
+
background: var(--st-color-danger);
|
|
113
|
+
border-color: var(--st-color-danger);
|
|
114
|
+
color: var(--st-color-on-danger);
|
|
115
115
|
}
|
|
116
116
|
.variant-danger::before {
|
|
117
|
-
background: var(--st-color-danger
|
|
118
|
-
border-color: var(--st-color-danger
|
|
117
|
+
background: var(--st-color-danger);
|
|
118
|
+
border-color: var(--st-color-danger);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/* ==========================================
|
|
@@ -22,13 +22,13 @@ export class StNavGroup extends LitElement {
|
|
|
22
22
|
button {
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
|
-
gap: var(--st-spacing-sm
|
|
25
|
+
gap: var(--st-spacing-sm);
|
|
26
26
|
width: 100%;
|
|
27
27
|
box-sizing: border-box;
|
|
28
28
|
background: transparent;
|
|
29
29
|
border: none;
|
|
30
30
|
padding: var(--st-spacing-sm) var(--st-spacing-xl);
|
|
31
|
-
padding-left: calc(var(--st-spacing-xl
|
|
31
|
+
padding-left: calc(var(--st-spacing-xl) + (var(--nav-depth, 0) * 16px));
|
|
32
32
|
color: var(--st-color-text);
|
|
33
33
|
font-size: var(--st-font-size-sm);
|
|
34
34
|
font-weight: var(--st-font-weight-semibold);
|
|
@@ -39,7 +39,7 @@ export class StNavGroup extends LitElement {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
button:hover {
|
|
42
|
-
background-color: var(--st-color-surface-hover
|
|
42
|
+
background-color: var(--st-color-surface-hover);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
button:focus-visible {
|
|
@@ -19,11 +19,11 @@ export class StNavItem extends LitElement {
|
|
|
19
19
|
a {
|
|
20
20
|
display: flex;
|
|
21
21
|
align-items: center;
|
|
22
|
-
gap: var(--st-spacing-sm
|
|
22
|
+
gap: var(--st-spacing-sm);
|
|
23
23
|
width: 100%;
|
|
24
24
|
box-sizing: border-box;
|
|
25
25
|
padding: 8px var(--st-spacing-xl);
|
|
26
|
-
padding-left: calc(var(--st-spacing-xl
|
|
26
|
+
padding-left: calc(var(--st-spacing-xl) + (var(--nav-depth, 0) * 16px));
|
|
27
27
|
color: var(--st-color-text-muted);
|
|
28
28
|
font-size: var(--st-font-size-sm);
|
|
29
29
|
text-decoration: none;
|
|
@@ -37,7 +37,7 @@ export class StNavItem extends LitElement {
|
|
|
37
37
|
|
|
38
38
|
a:hover {
|
|
39
39
|
color: var(--st-color-text);
|
|
40
|
-
background-color: var(--st-color-surface-hover
|
|
40
|
+
background-color: var(--st-color-surface-hover);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
a:focus-visible {
|
|
@@ -56,7 +56,7 @@ export class StNavItem extends LitElement {
|
|
|
56
56
|
color: var(--st-color-primary);
|
|
57
57
|
border-left-color: var(--st-color-primary);
|
|
58
58
|
font-weight: var(--st-font-weight-bold);
|
|
59
|
-
background-color: var(--st-color-primary-light
|
|
59
|
+
background-color: var(--st-color-primary-light);
|
|
60
60
|
}
|
|
61
61
|
`,
|
|
62
62
|
];
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import {LitElement, html, css, PropertyValues} from "lit";
|
|
2
|
+
import {customElement, property} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
|
+
|
|
5
|
+
const ID_PATTERN = /^[\w-]+$/;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Shows a poster and a play button, and only loads the video player (an iframe, which is heavy
|
|
9
|
+
* and sets third-party cookies) once someone presses play. Pages stay fast and visitors are not
|
|
10
|
+
* tracked before they choose to watch.
|
|
11
|
+
*
|
|
12
|
+
* Give it a `youtube` or `vimeo` id, or an `https` embed address in `src`. Slot your own poster
|
|
13
|
+
* as `<img slot="poster" alt="">`: no third-party request is made until play is pressed.
|
|
14
|
+
*
|
|
15
|
+
* Events: `st-play` (bubbles, composed) when the player is loaded.
|
|
16
|
+
*/
|
|
17
|
+
@customElement("st-video-embed")
|
|
18
|
+
export class StVideoEmbed extends LitElement {
|
|
19
|
+
/** A YouTube video id. Uses the privacy-enhanced youtube-nocookie.com player. */
|
|
20
|
+
@property({type: String}) youtube = "";
|
|
21
|
+
/** A Vimeo video id. Asks Vimeo not to track the viewer. */
|
|
22
|
+
@property({type: String}) vimeo = "";
|
|
23
|
+
/** Any other player, as an https embed address. */
|
|
24
|
+
@property({type: String}) src = "";
|
|
25
|
+
/** Name of the video. Used for the play button and the player's accessible title. */
|
|
26
|
+
@property({type: String}) label = "Video";
|
|
27
|
+
@property({type: String}) ratio = "16/9";
|
|
28
|
+
/** True once the player has been loaded. Setting it to true loads the player. */
|
|
29
|
+
@property({type: Boolean, reflect: true}) playing = false;
|
|
30
|
+
|
|
31
|
+
static styles = [
|
|
32
|
+
resetStyles,
|
|
33
|
+
css`
|
|
34
|
+
:host {
|
|
35
|
+
display: block;
|
|
36
|
+
position: relative;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
aspect-ratio: var(--_ratio, 16 / 9);
|
|
39
|
+
background: var(--st-color-surface-muted);
|
|
40
|
+
border-radius: var(--st-image-radius, var(--st-radius-md));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.facade {
|
|
44
|
+
position: relative;
|
|
45
|
+
display: grid;
|
|
46
|
+
place-items: center;
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100%;
|
|
49
|
+
padding: 0;
|
|
50
|
+
border: 0;
|
|
51
|
+
background: none;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
::slotted([slot="poster"]) {
|
|
56
|
+
position: absolute;
|
|
57
|
+
inset: 0;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
object-fit: cover;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.play {
|
|
64
|
+
position: relative;
|
|
65
|
+
display: grid;
|
|
66
|
+
place-items: center;
|
|
67
|
+
width: 4.5rem;
|
|
68
|
+
height: 4.5rem;
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
background: var(--st-color-primary);
|
|
71
|
+
color: var(--st-color-on-primary);
|
|
72
|
+
box-shadow: var(--st-shadow-lg);
|
|
73
|
+
transition: transform 0.2s ease;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.play svg {
|
|
77
|
+
width: 1.75rem;
|
|
78
|
+
height: 1.75rem;
|
|
79
|
+
margin-left: 0.2rem;
|
|
80
|
+
fill: currentColor;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.facade:hover .play {
|
|
84
|
+
transform: scale(1.08);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.facade:focus-visible {
|
|
88
|
+
outline: 3px solid var(--st-color-primary);
|
|
89
|
+
outline-offset: -3px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
iframe {
|
|
93
|
+
width: 100%;
|
|
94
|
+
height: 100%;
|
|
95
|
+
border: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (prefers-reduced-motion: reduce) {
|
|
99
|
+
.play {
|
|
100
|
+
transition: none;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
`,
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
/** The player address, or an empty string when nothing valid was given. */
|
|
107
|
+
private get _playerUrl(): string {
|
|
108
|
+
if (this.youtube && ID_PATTERN.test(this.youtube)) {
|
|
109
|
+
return `https://www.youtube-nocookie.com/embed/${this.youtube}?autoplay=1&rel=0`;
|
|
110
|
+
}
|
|
111
|
+
if (this.vimeo && ID_PATTERN.test(this.vimeo)) {
|
|
112
|
+
return `https://player.vimeo.com/video/${this.vimeo}?autoplay=1&dnt=1`;
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
const url = new URL(this.src); // no base: relative addresses must be rejected
|
|
116
|
+
return this.src && url.protocol === "https:" ? url.href : "";
|
|
117
|
+
} catch {
|
|
118
|
+
return "";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Loads the player. */
|
|
123
|
+
play() {
|
|
124
|
+
if (!this._playerUrl || this.playing) return;
|
|
125
|
+
this.playing = true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
protected updated(changed: PropertyValues<this>) {
|
|
129
|
+
if (this.ratio) this.style.setProperty("--_ratio", this.ratio);
|
|
130
|
+
if (changed.has("playing") && changed.get("playing") === false && this.playing) {
|
|
131
|
+
this.dispatchEvent(new CustomEvent("st-play", {bubbles: true, composed: true}));
|
|
132
|
+
this.renderRoot.querySelector("iframe")?.focus();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
render() {
|
|
137
|
+
const url = this._playerUrl;
|
|
138
|
+
if (this.playing && url) {
|
|
139
|
+
return html`<iframe
|
|
140
|
+
src=${url}
|
|
141
|
+
title=${this.label}
|
|
142
|
+
allow="autoplay; encrypted-media; picture-in-picture; fullscreen"
|
|
143
|
+
allowfullscreen
|
|
144
|
+
referrerpolicy="strict-origin-when-cross-origin"
|
|
145
|
+
></iframe>`;
|
|
146
|
+
}
|
|
147
|
+
return html`
|
|
148
|
+
<button class="facade" type="button" ?disabled=${!url} aria-label=${`Play video: ${this.label}`} @click=${this.play}>
|
|
149
|
+
<slot name="poster"></slot>
|
|
150
|
+
<span class="play" aria-hidden="true">
|
|
151
|
+
<svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"></path></svg>
|
|
152
|
+
</span>
|
|
153
|
+
</button>
|
|
154
|
+
`;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare global {
|
|
159
|
+
interface HTMLElementTagNameMap {
|
|
160
|
+
"st-video-embed": StVideoEmbed;
|
|
161
|
+
}
|
|
162
|
+
}
|