@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,164 @@
|
|
|
1
|
+
import {LitElement, html, css, nothing} from "lit";
|
|
2
|
+
import {customElement, property, state} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
|
+
|
|
5
|
+
interface Part {
|
|
6
|
+
href: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Navigation for a post that belongs to a series: where you are ("Part 2 of 5"), the full list of
|
|
12
|
+
* parts, and links to the previous and next part.
|
|
13
|
+
*
|
|
14
|
+
* List the parts in order as links, and mark the current one with `aria-current="page"`. The
|
|
15
|
+
* links stay in your markup, so search engines see the whole series from every part.
|
|
16
|
+
*
|
|
17
|
+
* Slots: `title` (the series name, a heading) and the default slot for the part links.
|
|
18
|
+
*/
|
|
19
|
+
@customElement("st-series-nav")
|
|
20
|
+
export class StSeriesNav extends LitElement {
|
|
21
|
+
/** Accessible name of the navigation. */
|
|
22
|
+
@property({type: String}) label = "Series";
|
|
23
|
+
/** Word shown before the part number. */
|
|
24
|
+
@property({type: String, attribute: "part-label"}) partLabel = "Part";
|
|
25
|
+
@property({type: String, attribute: "previous-label"}) previousLabel = "Previous";
|
|
26
|
+
@property({type: String, attribute: "next-label"}) nextLabel = "Next";
|
|
27
|
+
|
|
28
|
+
@state() private _parts: Part[] = [];
|
|
29
|
+
@state() private _current = -1;
|
|
30
|
+
|
|
31
|
+
static styles = [
|
|
32
|
+
resetStyles,
|
|
33
|
+
css`
|
|
34
|
+
:host {
|
|
35
|
+
display: block;
|
|
36
|
+
padding: var(--st-spacing-lg);
|
|
37
|
+
border: 1px solid var(--st-color-border);
|
|
38
|
+
border-left: 4px solid var(--st-color-primary);
|
|
39
|
+
border-radius: var(--st-radius-md);
|
|
40
|
+
background: var(--st-color-surface);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.progress {
|
|
44
|
+
margin: 0 0 var(--st-spacing-xs);
|
|
45
|
+
color: var(--st-color-primary-text);
|
|
46
|
+
font-size: var(--st-font-size-sm);
|
|
47
|
+
font-weight: var(--st-font-weight-bold);
|
|
48
|
+
letter-spacing: 0.06em;
|
|
49
|
+
text-transform: uppercase;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
::slotted([slot="title"]) {
|
|
53
|
+
margin: 0 0 var(--st-spacing-md) !important;
|
|
54
|
+
font-size: var(--st-font-size-lg) !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.parts {
|
|
58
|
+
display: grid;
|
|
59
|
+
gap: var(--st-spacing-xs);
|
|
60
|
+
counter-reset: part;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.parts ::slotted(a) {
|
|
64
|
+
counter-increment: part;
|
|
65
|
+
color: var(--st-color-text-muted);
|
|
66
|
+
text-decoration: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.parts ::slotted(a)::before {
|
|
70
|
+
content: counter(part) ". ";
|
|
71
|
+
color: var(--st-color-text-muted);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.parts ::slotted(a:hover) {
|
|
75
|
+
color: var(--st-color-text);
|
|
76
|
+
text-decoration: underline;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.parts ::slotted(a[aria-current="page"]) {
|
|
80
|
+
color: var(--st-color-text);
|
|
81
|
+
font-weight: var(--st-font-weight-bold);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.pager {
|
|
85
|
+
display: flex;
|
|
86
|
+
justify-content: space-between;
|
|
87
|
+
gap: var(--st-spacing-md);
|
|
88
|
+
margin-top: var(--st-spacing-md);
|
|
89
|
+
padding-top: var(--st-spacing-md);
|
|
90
|
+
border-top: 1px solid var(--st-color-border);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pager a {
|
|
94
|
+
display: grid;
|
|
95
|
+
color: var(--st-color-primary-text);
|
|
96
|
+
font-weight: var(--st-font-weight-medium);
|
|
97
|
+
text-decoration: none;
|
|
98
|
+
gap: var(--st-spacing-xs);
|
|
99
|
+
max-width: 48%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.pager .next {
|
|
103
|
+
margin-left: auto;
|
|
104
|
+
text-align: end;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.pager a:hover {
|
|
108
|
+
text-decoration: underline;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.pager a:focus-visible {
|
|
112
|
+
outline: 2px solid var(--st-color-primary);
|
|
113
|
+
outline-offset: 2px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.pager small {
|
|
117
|
+
color: var(--st-color-text-muted);
|
|
118
|
+
font-weight: var(--st-font-weight-regular, 400);
|
|
119
|
+
}
|
|
120
|
+
`,
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
private _onSlotChange = (e: Event) => {
|
|
124
|
+
const links = (e.target as HTMLSlotElement)
|
|
125
|
+
.assignedElements({flatten: true})
|
|
126
|
+
.filter((el): el is HTMLAnchorElement => el instanceof HTMLAnchorElement);
|
|
127
|
+
this._parts = links.map((a) => ({href: a.getAttribute("href") ?? "", label: a.textContent?.trim() ?? ""}));
|
|
128
|
+
this._current = links.findIndex((a) => a.getAttribute("aria-current") === "page");
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
render() {
|
|
132
|
+
const total = this._parts.length;
|
|
133
|
+
const previous = this._current > 0 ? this._parts[this._current - 1] : undefined;
|
|
134
|
+
const next = this._current >= 0 && this._current < total - 1 ? this._parts[this._current + 1] : undefined;
|
|
135
|
+
|
|
136
|
+
return html`
|
|
137
|
+
<nav aria-label=${this.label}>
|
|
138
|
+
${this._current >= 0
|
|
139
|
+
? html`<p class="progress">${this.partLabel} ${this._current + 1} / ${total}</p>`
|
|
140
|
+
: nothing}
|
|
141
|
+
<slot name="title"></slot>
|
|
142
|
+
<div class="parts"><slot @slotchange=${this._onSlotChange}></slot></div>
|
|
143
|
+
${previous || next
|
|
144
|
+
? html`
|
|
145
|
+
<div class="pager">
|
|
146
|
+
${previous
|
|
147
|
+
? html`<a class="previous" href=${previous.href} rel="prev"><small>${this.previousLabel}</small>${previous.label}</a>`
|
|
148
|
+
: nothing}
|
|
149
|
+
${next
|
|
150
|
+
? html`<a class="next" href=${next.href} rel="next"><small>${this.nextLabel}</small>${next.label}</a>`
|
|
151
|
+
: nothing}
|
|
152
|
+
</div>
|
|
153
|
+
`
|
|
154
|
+
: nothing}
|
|
155
|
+
</nav>
|
|
156
|
+
`;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare global {
|
|
161
|
+
interface HTMLElementTagNameMap {
|
|
162
|
+
"st-series-nav": StSeriesNav;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import {LitElement, html, css, PropertyValues} 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
|
+
* The top of a site: a logo, navigation links and a place for actions such as a theme toggle or a
|
|
8
|
+
* call-to-action button. On wide screens the links sit in a row. On narrow screens they fold into
|
|
9
|
+
* a menu opened by a button; the links stay in the page either way, so search engines see them.
|
|
10
|
+
*
|
|
11
|
+
* Slots:
|
|
12
|
+
* - `logo`: your brand, usually a link to the home page.
|
|
13
|
+
* - default: the navigation links. Mark the current page with `aria-current="page"`.
|
|
14
|
+
* - `actions`: controls on the right (theme toggle, buttons).
|
|
15
|
+
*
|
|
16
|
+
* A "Skip to content" link is included for keyboard users. When `sticky`, the header publishes
|
|
17
|
+
* its height as `--st-site-header-height`, which sections use so anchor links are not hidden
|
|
18
|
+
* behind it.
|
|
19
|
+
*/
|
|
20
|
+
@customElement("st-site-header")
|
|
21
|
+
export class StSiteHeader extends LitElement {
|
|
22
|
+
/** Keeps the header at the top of the screen while scrolling. */
|
|
23
|
+
@property({type: Boolean, reflect: true}) sticky = false;
|
|
24
|
+
/** Screen width (in pixels) below which the links fold into a menu. */
|
|
25
|
+
@property({type: Number}) breakpoint = 768;
|
|
26
|
+
@property({type: String, attribute: "menu-label"}) menuLabel = "Menu";
|
|
27
|
+
@property({type: String, attribute: "nav-label"}) navLabel = "Main";
|
|
28
|
+
/** Where the skip link goes. Give your main content this id. */
|
|
29
|
+
@property({type: String, attribute: "skip-to"}) skipTo = "#main";
|
|
30
|
+
@property({type: String, attribute: "skip-label"}) skipLabel = "Skip to content";
|
|
31
|
+
|
|
32
|
+
@state() private _menuOpen = false;
|
|
33
|
+
@state() private _compact = false;
|
|
34
|
+
|
|
35
|
+
private _media?: MediaQueryList;
|
|
36
|
+
private _resize?: ResizeObserver;
|
|
37
|
+
|
|
38
|
+
static styles = [
|
|
39
|
+
resetStyles,
|
|
40
|
+
css`
|
|
41
|
+
:host {
|
|
42
|
+
display: block;
|
|
43
|
+
background: var(--st-color-bg);
|
|
44
|
+
border-bottom: 1px solid var(--st-color-border);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([sticky]) {
|
|
48
|
+
position: sticky;
|
|
49
|
+
top: 0;
|
|
50
|
+
z-index: var(--st-site-header-z, 50);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.skip {
|
|
54
|
+
position: absolute;
|
|
55
|
+
left: var(--st-spacing-md);
|
|
56
|
+
top: 0;
|
|
57
|
+
z-index: 1;
|
|
58
|
+
padding: var(--st-spacing-sm) var(--st-spacing-md);
|
|
59
|
+
border-radius: 0 0 var(--st-radius-md) var(--st-radius-md);
|
|
60
|
+
background: var(--st-color-primary);
|
|
61
|
+
color: var(--st-color-on-primary);
|
|
62
|
+
transform: translateY(-120%);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.skip:focus {
|
|
66
|
+
transform: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.bar {
|
|
70
|
+
position: relative;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: var(--st-spacing-lg);
|
|
74
|
+
max-width: var(--st-container-lg);
|
|
75
|
+
min-height: var(--st-site-header-min-height, 4rem);
|
|
76
|
+
margin-inline: auto;
|
|
77
|
+
padding-inline: var(--st-gutter);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.logo {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
font-weight: var(--st-font-weight-bold);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
nav {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex: 1;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: var(--st-spacing-lg);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
::slotted(a) {
|
|
95
|
+
color: var(--st-color-text-muted);
|
|
96
|
+
font-weight: var(--st-font-weight-medium);
|
|
97
|
+
text-decoration: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
::slotted(a:hover),
|
|
101
|
+
::slotted(a[aria-current="page"]) {
|
|
102
|
+
color: var(--st-color-text);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
::slotted(a[aria-current="page"]) {
|
|
106
|
+
text-decoration: underline;
|
|
107
|
+
text-decoration-color: var(--st-color-primary);
|
|
108
|
+
text-decoration-thickness: 2px;
|
|
109
|
+
text-underline-offset: 0.5em;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.actions {
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
gap: var(--st-spacing-sm);
|
|
116
|
+
margin-left: auto;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.toggle {
|
|
120
|
+
display: none;
|
|
121
|
+
padding: var(--st-spacing-sm);
|
|
122
|
+
border: 0;
|
|
123
|
+
border-radius: var(--st-radius-md);
|
|
124
|
+
background: none;
|
|
125
|
+
color: inherit;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.toggle:hover {
|
|
130
|
+
background: var(--st-color-surface-hover);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.toggle:focus-visible {
|
|
134
|
+
outline: 2px solid var(--st-color-primary);
|
|
135
|
+
outline-offset: 2px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Narrow screens: the links fold into a panel under the bar. */
|
|
139
|
+
:host([data-compact]) .toggle {
|
|
140
|
+
display: inline-flex;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host([data-compact]) nav {
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: 100%;
|
|
146
|
+
left: 0;
|
|
147
|
+
right: 0;
|
|
148
|
+
flex-direction: column;
|
|
149
|
+
align-items: stretch;
|
|
150
|
+
gap: var(--st-spacing-xs);
|
|
151
|
+
padding: var(--st-spacing-md) var(--st-gutter);
|
|
152
|
+
border-bottom: 1px solid var(--st-color-border);
|
|
153
|
+
background: var(--st-color-bg);
|
|
154
|
+
box-shadow: var(--st-shadow-lg);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:host([data-compact]) nav:not(.open) {
|
|
158
|
+
display: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:host([data-compact]) ::slotted(a) {
|
|
162
|
+
padding: var(--st-spacing-sm) 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@media print {
|
|
166
|
+
:host {
|
|
167
|
+
position: static;
|
|
168
|
+
}
|
|
169
|
+
.toggle,
|
|
170
|
+
.actions {
|
|
171
|
+
display: none;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
`,
|
|
175
|
+
];
|
|
176
|
+
|
|
177
|
+
connectedCallback() {
|
|
178
|
+
super.connectedCallback();
|
|
179
|
+
this._media = window.matchMedia(`(max-width: ${this.breakpoint - 1}px)`);
|
|
180
|
+
this._media.addEventListener("change", this._onBreakpoint);
|
|
181
|
+
this._applyCompact(this._media.matches);
|
|
182
|
+
document.addEventListener("keydown", this._onKeydown);
|
|
183
|
+
document.addEventListener("pointerdown", this._onOutside);
|
|
184
|
+
|
|
185
|
+
this._resize = new ResizeObserver(() => this._publishHeight());
|
|
186
|
+
this._resize.observe(this);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
disconnectedCallback() {
|
|
190
|
+
this._media?.removeEventListener("change", this._onBreakpoint);
|
|
191
|
+
document.removeEventListener("keydown", this._onKeydown);
|
|
192
|
+
document.removeEventListener("pointerdown", this._onOutside);
|
|
193
|
+
this._resize?.disconnect();
|
|
194
|
+
if (this.sticky) document.documentElement.style.removeProperty("--st-site-header-height");
|
|
195
|
+
super.disconnectedCallback();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
protected updated(changed: PropertyValues<this>) {
|
|
199
|
+
if (changed.has("breakpoint") && this._media) {
|
|
200
|
+
this._media.removeEventListener("change", this._onBreakpoint);
|
|
201
|
+
this._media = window.matchMedia(`(max-width: ${this.breakpoint - 1}px)`);
|
|
202
|
+
this._media.addEventListener("change", this._onBreakpoint);
|
|
203
|
+
this._applyCompact(this._media.matches);
|
|
204
|
+
}
|
|
205
|
+
if (changed.has("sticky")) this._publishHeight();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** Closes the menu. */
|
|
209
|
+
close() {
|
|
210
|
+
this._menuOpen = false;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private _publishHeight() {
|
|
214
|
+
const root = document.documentElement.style;
|
|
215
|
+
if (this.sticky) root.setProperty("--st-site-header-height", `${this.offsetHeight}px`);
|
|
216
|
+
else root.removeProperty("--st-site-header-height");
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
private _applyCompact(compact: boolean) {
|
|
220
|
+
this._compact = compact;
|
|
221
|
+
this.toggleAttribute("data-compact", compact);
|
|
222
|
+
if (!compact) this._menuOpen = false;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
private _onBreakpoint = (e: MediaQueryListEvent) => this._applyCompact(e.matches);
|
|
226
|
+
|
|
227
|
+
private _onKeydown = (e: KeyboardEvent) => {
|
|
228
|
+
if (e.key === "Escape" && this._menuOpen) {
|
|
229
|
+
this._menuOpen = false;
|
|
230
|
+
this.renderRoot.querySelector<HTMLElement>(".toggle")?.focus();
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
private _onOutside = (e: PointerEvent) => {
|
|
235
|
+
if (this._menuOpen && !e.composedPath().includes(this)) this._menuOpen = false;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/** Choosing a link closes the menu. */
|
|
239
|
+
private _onNavClick = (e: MouseEvent) => {
|
|
240
|
+
if (e.composedPath().some((el) => el instanceof HTMLAnchorElement)) this._menuOpen = false;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
render() {
|
|
244
|
+
return html`
|
|
245
|
+
<a class="skip" href=${this.skipTo}>${this.skipLabel}</a>
|
|
246
|
+
<header class="bar">
|
|
247
|
+
<div class="logo"><slot name="logo"></slot></div>
|
|
248
|
+
<nav
|
|
249
|
+
id="site-nav"
|
|
250
|
+
class=${this._menuOpen ? "open" : ""}
|
|
251
|
+
aria-label=${this.navLabel}
|
|
252
|
+
@click=${this._onNavClick}
|
|
253
|
+
>
|
|
254
|
+
<slot></slot>
|
|
255
|
+
</nav>
|
|
256
|
+
<div class="actions"><slot name="actions"></slot></div>
|
|
257
|
+
<button
|
|
258
|
+
class="toggle"
|
|
259
|
+
type="button"
|
|
260
|
+
aria-controls="site-nav"
|
|
261
|
+
aria-expanded=${this._menuOpen ? "true" : "false"}
|
|
262
|
+
aria-label=${this.menuLabel}
|
|
263
|
+
@click=${() => (this._menuOpen = !this._menuOpen)}
|
|
264
|
+
>
|
|
265
|
+
<st-icon name=${this._menuOpen ? "x" : "menu"} aria-hidden="true"></st-icon>
|
|
266
|
+
</button>
|
|
267
|
+
</header>
|
|
268
|
+
`;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
declare global {
|
|
273
|
+
interface HTMLElementTagNameMap {
|
|
274
|
+
"st-site-header": StSiteHeader;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
@@ -48,7 +48,7 @@ export class StSkeleton extends LitElement {
|
|
|
48
48
|
width: var(--_width);
|
|
49
49
|
height: var(--_height);
|
|
50
50
|
|
|
51
|
-
--st-skeleton-radius: var(--st-radius-sm
|
|
51
|
+
--st-skeleton-radius: var(--st-radius-sm);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
:host([variant="text"]) {
|
|
@@ -72,9 +72,9 @@ export class StSkeleton extends LitElement {
|
|
|
72
72
|
|
|
73
73
|
background: linear-gradient(
|
|
74
74
|
90deg,
|
|
75
|
-
var(--st-color-surface-muted
|
|
76
|
-
var(--st-color-border
|
|
77
|
-
var(--st-color-surface-muted
|
|
75
|
+
var(--st-color-surface-muted) 25%,
|
|
76
|
+
var(--st-color-border) 37%,
|
|
77
|
+
var(--st-color-surface-muted) 63%
|
|
78
78
|
);
|
|
79
79
|
background-size: 400% 100%;
|
|
80
80
|
border-radius: var(--st-skeleton-radius);
|
|
@@ -92,19 +92,19 @@ export class StSkeleton extends LitElement {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
:host([animation="pulse"]) .skeleton {
|
|
95
|
-
background: var(--st-color-surface-muted
|
|
95
|
+
background: var(--st-color-surface-muted);
|
|
96
96
|
animation: st-pulse 1.5s ease-in-out infinite;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
:host([animation="none"]) .skeleton {
|
|
100
|
-
background: var(--st-color-surface-muted
|
|
100
|
+
background: var(--st-color-surface-muted);
|
|
101
101
|
animation: none;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
@media (prefers-reduced-motion: reduce) {
|
|
105
105
|
.skeleton {
|
|
106
106
|
animation: none !important;
|
|
107
|
-
background: var(--st-color-surface-muted
|
|
107
|
+
background: var(--st-color-surface-muted) !important;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {LitElement, html, css, svg, nothing} from "lit";
|
|
2
|
+
import {customElement, property} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
|
+
import {areaPaths, chartColor, linePath, normalize} from "../chart/chart.utils.js";
|
|
5
|
+
|
|
6
|
+
const VIEW_WIDTH = 100;
|
|
7
|
+
const PAD = 2;
|
|
8
|
+
|
|
9
|
+
/** Tiny axis-less trend line for use inside cards, tables and stat blocks. */
|
|
10
|
+
@customElement("st-sparkline")
|
|
11
|
+
export class StSparkline extends LitElement {
|
|
12
|
+
@property({type: Array}) data: number[] = [];
|
|
13
|
+
/** Any CSS color; defaults to the first chart palette color. */
|
|
14
|
+
@property({type: String}) color = "";
|
|
15
|
+
@property({type: Number}) height = 32;
|
|
16
|
+
@property({type: Boolean}) area = false;
|
|
17
|
+
/** Accessible description, e.g. "Revenue trend, last 7 days". */
|
|
18
|
+
@property({type: String}) label = "Trend";
|
|
19
|
+
|
|
20
|
+
static styles = [
|
|
21
|
+
resetStyles,
|
|
22
|
+
css`
|
|
23
|
+
:host {
|
|
24
|
+
display: block;
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
svg {
|
|
28
|
+
display: block;
|
|
29
|
+
width: 100%;
|
|
30
|
+
overflow: visible;
|
|
31
|
+
}
|
|
32
|
+
.line {
|
|
33
|
+
fill: none;
|
|
34
|
+
stroke-width: 2;
|
|
35
|
+
stroke-linecap: round;
|
|
36
|
+
stroke-linejoin: round;
|
|
37
|
+
vector-effect: non-scaling-stroke;
|
|
38
|
+
}
|
|
39
|
+
.area {
|
|
40
|
+
opacity: 0.15;
|
|
41
|
+
}
|
|
42
|
+
`,
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
render() {
|
|
46
|
+
const n = this.data.length;
|
|
47
|
+
if (n < 2) return nothing;
|
|
48
|
+
const lo = Math.min(...this.data);
|
|
49
|
+
const hi = Math.max(...this.data);
|
|
50
|
+
const h = this.height;
|
|
51
|
+
const points = this.data.map(
|
|
52
|
+
(v, i) =>
|
|
53
|
+
[
|
|
54
|
+
(i / (n - 1)) * VIEW_WIDTH,
|
|
55
|
+
h - PAD - normalize(v, lo, hi) * (h - PAD * 2),
|
|
56
|
+
] as [number, number],
|
|
57
|
+
);
|
|
58
|
+
const color = chartColor(0, this.color);
|
|
59
|
+
const first = this.data[0];
|
|
60
|
+
const last = this.data[n - 1];
|
|
61
|
+
const summary = `${this.label}: from ${first} to ${last}`;
|
|
62
|
+
return html`
|
|
63
|
+
<svg
|
|
64
|
+
viewBox="0 0 ${VIEW_WIDTH} ${h}"
|
|
65
|
+
height=${h}
|
|
66
|
+
preserveAspectRatio="none"
|
|
67
|
+
role="img"
|
|
68
|
+
aria-label=${summary}
|
|
69
|
+
>
|
|
70
|
+
${this.area
|
|
71
|
+
? areaPaths(points, h).map((d) => svg`<path class="area" d=${d} style="fill:${color}"></path>`)
|
|
72
|
+
: nothing}
|
|
73
|
+
<path class="line" d=${linePath(points)} style="stroke:${color}"></path>
|
|
74
|
+
</svg>
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare global {
|
|
80
|
+
interface HTMLElementTagNameMap {
|
|
81
|
+
"st-sparkline": StSparkline;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {LitElement, html, css} from "lit";
|
|
2
|
+
import {customElement, property} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
|
+
|
|
5
|
+
@customElement("st-spinner")
|
|
6
|
+
export class StSpinner extends LitElement {
|
|
7
|
+
@property({type: String, reflect: true}) size: "sm" | "md" | "lg" = "md";
|
|
8
|
+
@property({type: String}) label = "Loading";
|
|
9
|
+
|
|
10
|
+
static styles = [
|
|
11
|
+
resetStyles,
|
|
12
|
+
css`
|
|
13
|
+
:host {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
--_size: 1.5rem;
|
|
16
|
+
color: var(--st-color-primary);
|
|
17
|
+
}
|
|
18
|
+
:host([size="sm"]) {
|
|
19
|
+
--_size: 1rem;
|
|
20
|
+
}
|
|
21
|
+
:host([size="lg"]) {
|
|
22
|
+
--_size: 2.5rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ring {
|
|
26
|
+
width: var(--_size);
|
|
27
|
+
height: var(--_size);
|
|
28
|
+
border: 0.15rem solid var(--st-color-border);
|
|
29
|
+
border-top-color: currentColor;
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
animation: spin 0.8s linear infinite;
|
|
32
|
+
}
|
|
33
|
+
@keyframes spin {
|
|
34
|
+
to {
|
|
35
|
+
transform: rotate(360deg);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
@media (prefers-reduced-motion: reduce) {
|
|
39
|
+
.ring {
|
|
40
|
+
animation-duration: 2.4s;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`,
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
render() {
|
|
47
|
+
return html`<div class="ring" role="status" aria-label=${this.label}></div>`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare global {
|
|
52
|
+
interface HTMLElementTagNameMap {
|
|
53
|
+
"st-spinner": StSpinner;
|
|
54
|
+
}
|
|
55
|
+
}
|