@sondor-technology/sondor-components 1.0.9 → 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 +11 -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.map +1 -1
- package/dist/components/cron-builder/cron-builder.js +13 -11
- 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.js +3 -3
- 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 -4
- package/dist/components/toggle-group/toggle-button.js.map +1 -1
- package/dist/components/toggle-group/toggle-group.js +4 -4
- 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 -2
- 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 +210 -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 +12 -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 +21 -18
- 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 +3 -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 -4
- package/src/components/toggle-group/toggle-group.ts +4 -4
- 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 -1
- package/src/styles/typography.css +1 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import {LitElement, html, css} from "lit";
|
|
2
|
+
import {customElement, property, state} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
|
+
import "../icon/icon.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A button that appears once the reader has scrolled down, and takes them back to the top. Focus
|
|
8
|
+
* moves to the top of the page too, so keyboard and screen reader users are not left behind.
|
|
9
|
+
*
|
|
10
|
+
* Events: `st-back-to-top` when pressed.
|
|
11
|
+
*/
|
|
12
|
+
@customElement("st-back-to-top")
|
|
13
|
+
export class StBackToTop extends LitElement {
|
|
14
|
+
/** How far (in pixels) the page must be scrolled before the button appears. */
|
|
15
|
+
@property({type: Number}) threshold = 400;
|
|
16
|
+
/** Accessible name and tooltip. */
|
|
17
|
+
@property({type: String}) label = "Back to top";
|
|
18
|
+
@property({type: String, reflect: true}) position: "right" | "left" = "right";
|
|
19
|
+
|
|
20
|
+
@state() private _visible = false;
|
|
21
|
+
private _frame = 0;
|
|
22
|
+
|
|
23
|
+
static styles = [
|
|
24
|
+
resetStyles,
|
|
25
|
+
css`
|
|
26
|
+
:host {
|
|
27
|
+
position: fixed;
|
|
28
|
+
bottom: var(--st-spacing-lg);
|
|
29
|
+
right: var(--st-spacing-lg);
|
|
30
|
+
z-index: var(--st-back-to-top-z, 90);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host([position="left"]) {
|
|
34
|
+
right: auto;
|
|
35
|
+
left: var(--st-spacing-lg);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
button {
|
|
39
|
+
display: grid;
|
|
40
|
+
place-items: center;
|
|
41
|
+
width: 3rem;
|
|
42
|
+
height: 3rem;
|
|
43
|
+
border: 1px solid var(--st-color-border);
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
background: var(--st-color-surface);
|
|
46
|
+
color: var(--st-color-text);
|
|
47
|
+
box-shadow: var(--st-shadow-md);
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
opacity: 0;
|
|
50
|
+
visibility: hidden;
|
|
51
|
+
transform: translateY(0.5rem);
|
|
52
|
+
transition:
|
|
53
|
+
opacity 0.2s ease,
|
|
54
|
+
transform 0.2s ease,
|
|
55
|
+
visibility 0.2s;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
button.visible {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
visibility: visible;
|
|
61
|
+
transform: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
button:hover {
|
|
65
|
+
background: var(--st-color-surface-hover);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
button:focus-visible {
|
|
69
|
+
outline: 2px solid var(--st-color-primary);
|
|
70
|
+
outline-offset: 2px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@media (prefers-reduced-motion: reduce) {
|
|
74
|
+
button {
|
|
75
|
+
transition: none;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@media print {
|
|
80
|
+
:host {
|
|
81
|
+
display: none;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
`,
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
connectedCallback() {
|
|
88
|
+
super.connectedCallback();
|
|
89
|
+
window.addEventListener("scroll", this._schedule, {passive: true});
|
|
90
|
+
this._schedule();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
disconnectedCallback() {
|
|
94
|
+
window.removeEventListener("scroll", this._schedule);
|
|
95
|
+
cancelAnimationFrame(this._frame);
|
|
96
|
+
super.disconnectedCallback();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private _schedule = () => {
|
|
100
|
+
cancelAnimationFrame(this._frame);
|
|
101
|
+
this._frame = requestAnimationFrame(() => {
|
|
102
|
+
this._visible = window.scrollY > this.threshold;
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
private _onClick() {
|
|
107
|
+
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
108
|
+
window.scrollTo({top: 0, behavior: reduce ? "auto" : "smooth"});
|
|
109
|
+
|
|
110
|
+
// Move focus to the start of the page without scrolling again.
|
|
111
|
+
const body = document.body;
|
|
112
|
+
if (!body.hasAttribute("tabindex")) {
|
|
113
|
+
body.setAttribute("tabindex", "-1");
|
|
114
|
+
body.addEventListener("blur", () => body.removeAttribute("tabindex"), {once: true});
|
|
115
|
+
}
|
|
116
|
+
body.focus({preventScroll: true});
|
|
117
|
+
|
|
118
|
+
this.dispatchEvent(new CustomEvent("st-back-to-top", {bubbles: true, composed: true}));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
render() {
|
|
122
|
+
return html`
|
|
123
|
+
<button
|
|
124
|
+
type="button"
|
|
125
|
+
class=${this._visible ? "visible" : ""}
|
|
126
|
+
aria-label=${this.label}
|
|
127
|
+
title=${this.label}
|
|
128
|
+
@click=${this._onClick}
|
|
129
|
+
>
|
|
130
|
+
<st-icon name="arrow-up" aria-hidden="true"></st-icon>
|
|
131
|
+
</button>
|
|
132
|
+
`;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
declare global {
|
|
137
|
+
interface HTMLElementTagNameMap {
|
|
138
|
+
"st-back-to-top": StBackToTop;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import {html, css, svg, nothing} from "lit";
|
|
2
|
+
import {customElement, property, state} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
|
+
import {StChartBase, type ChartSeries} from "../chart/chart-base.js";
|
|
5
|
+
import {chartColor, clamp, niceScale, stepIndex} from "../chart/chart.utils.js";
|
|
6
|
+
|
|
7
|
+
const MARGIN = {top: 12, right: 16, bottom: 28, left: 48};
|
|
8
|
+
const BAND_PADDING = 0.2;
|
|
9
|
+
|
|
10
|
+
export interface BarRef {
|
|
11
|
+
series: number;
|
|
12
|
+
index: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Grouped or stacked bar chart. Each bar is individually hoverable, focusable via the arrow
|
|
17
|
+
* keys, and selectable. Stacked mode assumes non-negative values per category for totals.
|
|
18
|
+
*/
|
|
19
|
+
@customElement("st-bar-chart")
|
|
20
|
+
export class StBarChart extends StChartBase {
|
|
21
|
+
@property({type: Array}) labels: string[] = [];
|
|
22
|
+
@property({type: Array}) series: ChartSeries[] = [];
|
|
23
|
+
@property({type: Boolean}) stacked = false;
|
|
24
|
+
@property({type: Number, attribute: "y-min"}) yMin?: number;
|
|
25
|
+
@property({type: Number, attribute: "y-max"}) yMax?: number;
|
|
26
|
+
/** The selected bar, e.g. `{ "series": 0, "index": 2 }`, or null. */
|
|
27
|
+
@property({type: Object}) selected: BarRef | null = null;
|
|
28
|
+
|
|
29
|
+
@state() private _active: BarRef | null = null;
|
|
30
|
+
@state() private _hidden = new Set<number>();
|
|
31
|
+
|
|
32
|
+
static styles = [
|
|
33
|
+
resetStyles,
|
|
34
|
+
StChartBase.baseStyles,
|
|
35
|
+
css`
|
|
36
|
+
.bar {
|
|
37
|
+
cursor: default;
|
|
38
|
+
}
|
|
39
|
+
:host([selectable]) .bar {
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
.bar.dim {
|
|
43
|
+
opacity: 0.45;
|
|
44
|
+
}
|
|
45
|
+
.bar.active {
|
|
46
|
+
stroke: var(--st-color-text);
|
|
47
|
+
stroke-width: 2;
|
|
48
|
+
}
|
|
49
|
+
.bar.chosen {
|
|
50
|
+
stroke: var(--st-color-text);
|
|
51
|
+
stroke-width: 2;
|
|
52
|
+
stroke-dasharray: 4 2;
|
|
53
|
+
}
|
|
54
|
+
`,
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
private get _visible() {
|
|
58
|
+
return this.series
|
|
59
|
+
.map((s, i) => ({s, i, color: chartColor(i, s.color)}))
|
|
60
|
+
.filter(({i}) => !this._hidden.has(i));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private get _count() {
|
|
64
|
+
return Math.max(this.labels.length, ...this.series.map((s) => s.data.length), 0);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private _label(index: number) {
|
|
68
|
+
return this.labels[index] ?? String(index + 1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Bars in keyboard order: category by category, visible series within each. */
|
|
72
|
+
private get _bars(): BarRef[] {
|
|
73
|
+
const bars: BarRef[] = [];
|
|
74
|
+
for (let index = 0; index < this._count; index++) {
|
|
75
|
+
for (const {s, i} of this._visible) {
|
|
76
|
+
if (s.data[index] != null) bars.push({series: i, index});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return bars;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private _layout() {
|
|
83
|
+
const innerW = Math.max(this._width - MARGIN.left - MARGIN.right, 1);
|
|
84
|
+
const innerH = Math.max(this.height - MARGIN.top - MARGIN.bottom, 1);
|
|
85
|
+
const n = this._count;
|
|
86
|
+
const visible = this._visible;
|
|
87
|
+
let lo = 0;
|
|
88
|
+
let hi = 0;
|
|
89
|
+
for (let index = 0; index < n; index++) {
|
|
90
|
+
let pos = 0;
|
|
91
|
+
let neg = 0;
|
|
92
|
+
for (const {s} of visible) {
|
|
93
|
+
const v = s.data[index];
|
|
94
|
+
if (v == null) continue;
|
|
95
|
+
if (this.stacked) (v >= 0 ? (pos += v) : (neg += v));
|
|
96
|
+
else {
|
|
97
|
+
pos = Math.max(pos, v);
|
|
98
|
+
neg = Math.min(neg, v);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
hi = Math.max(hi, pos);
|
|
102
|
+
lo = Math.min(lo, neg);
|
|
103
|
+
}
|
|
104
|
+
const scale = niceScale(this.yMin ?? lo, this.yMax ?? hi);
|
|
105
|
+
const y = (v: number) =>
|
|
106
|
+
MARGIN.top + innerH * (1 - (clamp(v, scale.min, scale.max) - scale.min) / (scale.max - scale.min));
|
|
107
|
+
const band = innerW / Math.max(n, 1);
|
|
108
|
+
const groupW = band * (1 - BAND_PADDING);
|
|
109
|
+
return {innerW, innerH, n, scale, y, band, groupW, visible};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private _barRect(ref: BarRef, layout = this._layout()) {
|
|
113
|
+
const {y, band, groupW, visible, scale} = layout;
|
|
114
|
+
const zero = y(clamp(0, scale.min, scale.max));
|
|
115
|
+
const value = this.series[ref.series].data[ref.index] as number;
|
|
116
|
+
const left = MARGIN.left + ref.index * band + (band - groupW) / 2;
|
|
117
|
+
let x = left;
|
|
118
|
+
let width = groupW;
|
|
119
|
+
let top: number;
|
|
120
|
+
let bottom: number;
|
|
121
|
+
if (this.stacked) {
|
|
122
|
+
let offset = 0;
|
|
123
|
+
for (const {s, i} of visible) {
|
|
124
|
+
if (i === ref.series) break;
|
|
125
|
+
const v = s.data[ref.index];
|
|
126
|
+
if (v != null && v >= 0 === value >= 0) offset += v;
|
|
127
|
+
}
|
|
128
|
+
top = y(offset + value);
|
|
129
|
+
bottom = y(offset);
|
|
130
|
+
} else {
|
|
131
|
+
width = groupW / Math.max(visible.length, 1);
|
|
132
|
+
x = left + visible.findIndex(({i}) => i === ref.series) * width;
|
|
133
|
+
top = y(value);
|
|
134
|
+
bottom = zero;
|
|
135
|
+
}
|
|
136
|
+
return {x, width, top: Math.min(top, bottom), height: Math.max(Math.abs(bottom - top), 1)};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private _same(a: BarRef | null, b: BarRef | null) {
|
|
140
|
+
return !!a && !!b && a.series === b.series && a.index === b.index;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
private _describe(ref: BarRef) {
|
|
144
|
+
const s = this.series[ref.series];
|
|
145
|
+
const value = s.data[ref.index] as number;
|
|
146
|
+
return {
|
|
147
|
+
index: ref.index,
|
|
148
|
+
label: this._label(ref.index),
|
|
149
|
+
series: s.name,
|
|
150
|
+
seriesIndex: ref.series,
|
|
151
|
+
value,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private _setActive(ref: BarRef | null) {
|
|
156
|
+
if (this._same(ref, this._active)) return;
|
|
157
|
+
this._active = ref;
|
|
158
|
+
if (!ref) {
|
|
159
|
+
this.hideTooltip();
|
|
160
|
+
this.emit("st-chart-leave", {});
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const layout = this._layout();
|
|
164
|
+
const rect = this._barRect(ref, layout);
|
|
165
|
+
const d = this._describe(ref);
|
|
166
|
+
const rows = [{label: d.series, value: this.fmt(d.value), color: chartColor(ref.series, this.series[ref.series].color)}];
|
|
167
|
+
if (this.stacked) {
|
|
168
|
+
const total = layout.visible.reduce((sum, {s}) => sum + (s.data[ref.index] ?? 0), 0);
|
|
169
|
+
rows.push({label: "Total", value: this.fmt(total), color: undefined as unknown as string});
|
|
170
|
+
}
|
|
171
|
+
this.showTooltip(
|
|
172
|
+
{x: rect.x + rect.width / 2, y: rect.top, title: d.label, rows},
|
|
173
|
+
`${d.label}, ${d.series}: ${this.fmt(d.value)}`,
|
|
174
|
+
);
|
|
175
|
+
this.emit("st-chart-hover", d);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
private _select(ref: BarRef) {
|
|
179
|
+
if (!this.selectable) return;
|
|
180
|
+
this.selected = this._same(this.selected, ref) ? null : {...ref};
|
|
181
|
+
this.emit("st-chart-select", {...this._describe(ref), selected: this.selected !== null});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
private _onKeydown(e: KeyboardEvent) {
|
|
185
|
+
if (e.key === "Escape") return this._setActive(null);
|
|
186
|
+
if ((e.key === "Enter" || e.key === " ") && this._active) {
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
return this._select(this._active);
|
|
189
|
+
}
|
|
190
|
+
const bars = this._bars;
|
|
191
|
+
const current = this._active ? bars.findIndex((b) => this._same(b, this._active)) : null;
|
|
192
|
+
const next = stepIndex(e.key, current === -1 ? null : current, bars.length);
|
|
193
|
+
if (next !== null) {
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
this._setActive(bars[next]);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
private _toggleSeries(index: number) {
|
|
200
|
+
const hidden = new Set(this._hidden);
|
|
201
|
+
if (hidden.has(index)) hidden.delete(index);
|
|
202
|
+
else hidden.add(index);
|
|
203
|
+
this._hidden = hidden;
|
|
204
|
+
this._active = null;
|
|
205
|
+
this.hideTooltip();
|
|
206
|
+
this.emit("st-chart-legend-toggle", {
|
|
207
|
+
name: this.series[index].name,
|
|
208
|
+
index,
|
|
209
|
+
hidden: hidden.has(index),
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private _renderPlot() {
|
|
214
|
+
const layout = this._layout();
|
|
215
|
+
const {innerW, innerH, scale, n, y, band} = layout;
|
|
216
|
+
const stride = Math.max(1, Math.ceil((n * 56) / innerW));
|
|
217
|
+
const emphasis = this._active ?? this.selected;
|
|
218
|
+
return svg`
|
|
219
|
+
<svg width=${this._width} height=${this.height} aria-hidden="true">
|
|
220
|
+
${scale.ticks.map(
|
|
221
|
+
(t) => svg`
|
|
222
|
+
<line class="grid" x1=${MARGIN.left} x2=${MARGIN.left + innerW} y1=${y(t)} y2=${y(t)}></line>
|
|
223
|
+
<text class="tick" x=${MARGIN.left - 8} y=${y(t)} text-anchor="end" dominant-baseline="middle">${this.fmtAxis(t)}</text>
|
|
224
|
+
`,
|
|
225
|
+
)}
|
|
226
|
+
${Array.from({length: n}, (_, i) =>
|
|
227
|
+
i % stride === 0
|
|
228
|
+
? svg`<text class="tick" x=${MARGIN.left + band * i + band / 2} y=${MARGIN.top + innerH + 18} text-anchor="middle">${this._label(i)}</text>`
|
|
229
|
+
: nothing,
|
|
230
|
+
)}
|
|
231
|
+
${this._bars.map((ref) => {
|
|
232
|
+
const r = this._barRect(ref, layout);
|
|
233
|
+
const color = chartColor(ref.series, this.series[ref.series].color);
|
|
234
|
+
const dim = emphasis && !this._same(emphasis, ref) ? "dim" : "";
|
|
235
|
+
return svg`
|
|
236
|
+
<rect
|
|
237
|
+
class="bar animate ${dim} ${this._same(this._active, ref) ? "active" : ""} ${this._same(this.selected, ref) ? "chosen" : ""}"
|
|
238
|
+
x=${r.x} y=${r.top} width=${r.width} height=${r.height} rx="2"
|
|
239
|
+
style="fill:${color}"
|
|
240
|
+
@pointerenter=${() => this._setActive(ref)}
|
|
241
|
+
@pointerleave=${() => this._setActive(null)}
|
|
242
|
+
@click=${() => this._select(ref)}
|
|
243
|
+
></rect>
|
|
244
|
+
`;
|
|
245
|
+
})}
|
|
246
|
+
</svg>
|
|
247
|
+
`;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
render() {
|
|
251
|
+
const n = this._count;
|
|
252
|
+
return html`
|
|
253
|
+
<div class="chart">
|
|
254
|
+
${this._width > 0
|
|
255
|
+
? html`
|
|
256
|
+
<div
|
|
257
|
+
class="plot"
|
|
258
|
+
tabindex="0"
|
|
259
|
+
role="group"
|
|
260
|
+
aria-roledescription="bar chart"
|
|
261
|
+
aria-label=${this.label || "Bar chart"}
|
|
262
|
+
@keydown=${this._onKeydown}
|
|
263
|
+
@focus=${() => !this._active && this._bars.length && this._setActive(this._bars[0])}
|
|
264
|
+
@blur=${() => this._setActive(null)}
|
|
265
|
+
>
|
|
266
|
+
${this._renderPlot()} ${this.renderTooltip()}
|
|
267
|
+
</div>
|
|
268
|
+
`
|
|
269
|
+
: nothing}
|
|
270
|
+
${this.renderLegend(
|
|
271
|
+
this.series.map((s, i) => ({
|
|
272
|
+
name: s.name,
|
|
273
|
+
color: chartColor(i, s.color),
|
|
274
|
+
hidden: this._hidden.has(i),
|
|
275
|
+
})),
|
|
276
|
+
(i) => this._toggleSeries(i),
|
|
277
|
+
)}
|
|
278
|
+
${this.renderLiveRegion()}
|
|
279
|
+
${this.renderDataTable(
|
|
280
|
+
["Category", ...this.series.map((s) => s.name)],
|
|
281
|
+
Array.from({length: n}, (_, i) => [
|
|
282
|
+
this._label(i),
|
|
283
|
+
...this.series.map((s) => (s.data[i] == null ? "–" : this.fmt(s.data[i] as number))),
|
|
284
|
+
]),
|
|
285
|
+
)}
|
|
286
|
+
</div>
|
|
287
|
+
`;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
declare global {
|
|
292
|
+
interface HTMLElementTagNameMap {
|
|
293
|
+
"st-bar-chart": StBarChart;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
@@ -26,7 +26,7 @@ export class StBreadcrumb extends LitElement {
|
|
|
26
26
|
display: flex;
|
|
27
27
|
align-items: center;
|
|
28
28
|
flex-wrap: wrap;
|
|
29
|
-
font-size: var(--st-font-size-sm
|
|
29
|
+
font-size: var(--st-font-size-sm);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
ol {
|
|
@@ -46,7 +46,7 @@ export class StBreadcrumb extends LitElement {
|
|
|
46
46
|
|
|
47
47
|
li:not(:last-child)::after {
|
|
48
48
|
content: "/";
|
|
49
|
-
margin: 0 var(--st-spacing-sm
|
|
49
|
+
margin: 0 var(--st-spacing-sm);
|
|
50
50
|
color: var(--st-color-border);
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -2,6 +2,7 @@ import {LitElement, html, css, nothing} from "lit";
|
|
|
2
2
|
import {customElement, property} from "lit/decorators.js";
|
|
3
3
|
import {resetStyles} from "../../styles/reset.js";
|
|
4
4
|
import {ButtonColor, ButtonSize, ButtonVariant} from "./button.constants.js";
|
|
5
|
+
export type {ButtonColor, ButtonSize, ButtonVariant};
|
|
5
6
|
|
|
6
7
|
@customElement("st-button")
|
|
7
8
|
export class StButton extends LitElement {
|
|
@@ -69,7 +70,7 @@ export class StButton extends LitElement {
|
|
|
69
70
|
--_bg: transparent;
|
|
70
71
|
}
|
|
71
72
|
:host([variant="outline"][color="default"]) {
|
|
72
|
-
--_border: var(--st-gray-500
|
|
73
|
+
--_border: var(--st-gray-500);
|
|
73
74
|
--_text: var(--st-color-text);
|
|
74
75
|
}
|
|
75
76
|
:host([variant="outline"][color="primary"]) {
|
|
@@ -167,26 +168,26 @@ export class StButton extends LitElement {
|
|
|
167
168
|
line-height: 1;
|
|
168
169
|
|
|
169
170
|
cursor: pointer;
|
|
170
|
-
font-weight: var(--st-font-weight-medium
|
|
171
|
+
font-weight: var(--st-font-weight-medium);
|
|
171
172
|
transition: all 0.2s ease;
|
|
172
173
|
text-decoration: none;
|
|
173
174
|
|
|
174
|
-
border-radius: var(--btn-radius-tl, var(--st-radius-md
|
|
175
|
-
var(--btn-radius-tr, var(--st-radius-md
|
|
176
|
-
var(--btn-radius-br, var(--st-radius-md
|
|
177
|
-
var(--btn-radius-bl, var(--st-radius-md
|
|
175
|
+
border-radius: var(--btn-radius-tl, var(--st-radius-md))
|
|
176
|
+
var(--btn-radius-tr, var(--st-radius-md))
|
|
177
|
+
var(--btn-radius-br, var(--st-radius-md))
|
|
178
|
+
var(--btn-radius-bl, var(--st-radius-md));
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
:host([active]) .btn {
|
|
181
182
|
filter: brightness(0.9);
|
|
182
|
-
box-shadow: inset
|
|
183
|
+
box-shadow: var(--st-shadow-inset);
|
|
183
184
|
background-color: var(--_bg); /* Retain base background */
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
.btn:focus-visible {
|
|
187
188
|
outline: none;
|
|
188
189
|
box-shadow:
|
|
189
|
-
0 0 0 2px var(--st-color-bg
|
|
190
|
+
0 0 0 2px var(--st-color-bg),
|
|
190
191
|
0 0 0 4px var(--st-color-primary);
|
|
191
192
|
z-index: 1;
|
|
192
193
|
}
|
|
@@ -23,14 +23,14 @@ export class StButtonGroup extends LitElement {
|
|
|
23
23
|
|
|
24
24
|
/* 2. Restore ONLY the left corners for the first button */
|
|
25
25
|
::slotted(st-button:first-child) {
|
|
26
|
-
--btn-radius-tl: var(--st-radius-md
|
|
27
|
-
--btn-radius-bl: var(--st-radius-md
|
|
26
|
+
--btn-radius-tl: var(--st-radius-md);
|
|
27
|
+
--btn-radius-bl: var(--st-radius-md);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/* 3. Restore ONLY the right corners for the last button */
|
|
31
31
|
::slotted(st-button:last-child) {
|
|
32
|
-
--btn-radius-tr: var(--st-radius-md
|
|
33
|
-
--btn-radius-br: var(--st-radius-md
|
|
32
|
+
--btn-radius-tr: var(--st-radius-md);
|
|
33
|
+
--btn-radius-br: var(--st-radius-md);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/* 4. Collapse borders by pulling adjacent buttons left */
|
|
@@ -31,6 +31,9 @@ const formatIsoLocal = (date: Date): string => {
|
|
|
31
31
|
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
/** Reads `.value` from a custom form element event target. */
|
|
35
|
+
const targetValue = <T = string>(e: Event) => (e.target as unknown as {value: T}).value;
|
|
36
|
+
|
|
34
37
|
@customElement("st-calendar")
|
|
35
38
|
export class StCalendar extends LitElement {
|
|
36
39
|
static formAssociated = true;
|
|
@@ -74,7 +77,7 @@ export class StCalendar extends LitElement {
|
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
:host([invalid]) {
|
|
77
|
-
border-color: var(--st-color-error
|
|
80
|
+
border-color: var(--st-color-error);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
.header {
|
|
@@ -117,7 +120,7 @@ export class StCalendar extends LitElement {
|
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
.nav-button:hover {
|
|
120
|
-
background-color: var(--st-color-surface-hover
|
|
123
|
+
background-color: var(--st-color-surface-hover);
|
|
121
124
|
color: var(--st-color-text);
|
|
122
125
|
}
|
|
123
126
|
|
|
@@ -164,7 +167,7 @@ export class StCalendar extends LitElement {
|
|
|
164
167
|
}
|
|
165
168
|
|
|
166
169
|
.day:hover:not(:disabled):not(.empty) {
|
|
167
|
-
background-color: var(--st-color-surface-hover
|
|
170
|
+
background-color: var(--st-color-surface-hover);
|
|
168
171
|
}
|
|
169
172
|
|
|
170
173
|
.day:focus-visible {
|
|
@@ -185,18 +188,18 @@ export class StCalendar extends LitElement {
|
|
|
185
188
|
|
|
186
189
|
.day[aria-current="date"] {
|
|
187
190
|
font-weight: var(--st-font-weight-bold);
|
|
188
|
-
color: var(--st-color-primary);
|
|
189
|
-
background-color: var(--st-color-primary-
|
|
191
|
+
color: var(--st-color-primary-text);
|
|
192
|
+
background-color: var(--st-color-primary-bg);
|
|
190
193
|
}
|
|
191
194
|
|
|
192
195
|
.day[aria-selected="true"] {
|
|
193
196
|
background-color: var(--st-color-primary);
|
|
194
|
-
color: var(--st-color-on-primary
|
|
197
|
+
color: var(--st-color-on-primary);
|
|
195
198
|
font-weight: var(--st-font-weight-bold);
|
|
196
199
|
}
|
|
197
200
|
|
|
198
201
|
.day[aria-selected="true"]:hover {
|
|
199
|
-
background-color: var(--st-color-primary-dark
|
|
202
|
+
background-color: var(--st-color-primary-dark);
|
|
200
203
|
}
|
|
201
204
|
`,
|
|
202
205
|
];
|
|
@@ -413,7 +416,7 @@ export class StCalendar extends LitElement {
|
|
|
413
416
|
.options=${monthOptions}
|
|
414
417
|
.value=${String(this._viewMonth)}
|
|
415
418
|
?disabled=${this.disabled}
|
|
416
|
-
@change=${(e:
|
|
419
|
+
@change=${(e: Event) => (this._viewMonth = Number(targetValue(e)))}
|
|
417
420
|
></st-select>
|
|
418
421
|
|
|
419
422
|
<st-select
|
|
@@ -422,7 +425,7 @@ export class StCalendar extends LitElement {
|
|
|
422
425
|
.options=${yearOptions}
|
|
423
426
|
.value=${String(this._viewYear)}
|
|
424
427
|
?disabled=${this.disabled}
|
|
425
|
-
@change=${(e:
|
|
428
|
+
@change=${(e: Event) => (this._viewYear = Number(targetValue(e)))}
|
|
426
429
|
></st-select>
|
|
427
430
|
</div>
|
|
428
431
|
|