@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 @@
|
|
|
1
|
+
{"version":3,"file":"project-grid.d.ts","sourceRoot":"","sources":["../../../src/components/project-grid/project-grid.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,qBACa,aAAc,SAAQ,SAAS;CAAG;AAE/C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement } from "lit/decorators.js";
|
|
8
|
+
import { StCardRow } from "../section/card-row.js";
|
|
9
|
+
import "./project-card.js";
|
|
10
|
+
/**
|
|
11
|
+
* A portfolio row: your projects as `st-project-card` items in a grid, optionally filtered by
|
|
12
|
+
* topic (`filterable`).
|
|
13
|
+
*
|
|
14
|
+
* Slots: `eyebrow`, `title`, `lead` and the default slot for the `st-project-card` items.
|
|
15
|
+
* Events: `st-filter` `{tag, count}` when a topic is chosen.
|
|
16
|
+
*/
|
|
17
|
+
let StProjectGrid = class StProjectGrid extends StCardRow {
|
|
18
|
+
};
|
|
19
|
+
StProjectGrid = __decorate([
|
|
20
|
+
customElement("st-project-grid")
|
|
21
|
+
], StProjectGrid);
|
|
22
|
+
export { StProjectGrid };
|
|
23
|
+
//# sourceMappingURL=project-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-grid.js","sourceRoot":"","sources":["../../../src/components/project-grid/project-grid.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,SAAS;CAAG,CAAA;AAAlC,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAAqB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const revealEffects: readonly ["fade", "slide-up", "slide-down", "slide-left", "slide-right", "zoom", "blur", "none"];
|
|
2
|
+
/**
|
|
3
|
+
* How content appears. The slide effects name the direction the content travels as it arrives:
|
|
4
|
+
* `slide-up` rises from below, `slide-down` drops in from above, `slide-left` moves leftwards
|
|
5
|
+
* from the right, `slide-right` moves rightwards from the left. `none` turns the animation off.
|
|
6
|
+
*/
|
|
7
|
+
export type RevealEffect = (typeof revealEffects)[number];
|
|
8
|
+
/** Lifecycle of a reveal. Absent until the element is armed, so unarmed content is always visible. */
|
|
9
|
+
export type RevealState = "pending" | "in" | "out";
|
|
10
|
+
//# sourceMappingURL=reveal.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reveal.constants.d.ts","sourceRoot":"","sources":["../../../src/components/reveal/reveal.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,YACxB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,MAAM,EACN,MAAM,EACN,MAAM,CACE,CAAC;AAEX;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,sGAAsG;AACtG,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reveal.constants.js","sourceRoot":"","sources":["../../../src/components/reveal/reveal.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,MAAM;IACN,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,MAAM;IACN,MAAM;IACN,MAAM;CACE,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
|
+
import type { RevealEffect, RevealState } from "./reveal.constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* Animates its content into view as it is scrolled to, and optionally back out as it leaves.
|
|
5
|
+
*
|
|
6
|
+
* The content always stays in the DOM, so search engines, screen readers and find-in-page see
|
|
7
|
+
* all of it. Content is only visually hidden once the element is armed in the browser, and only
|
|
8
|
+
* when it starts below the fold. Without JavaScript, with reduced motion, or with
|
|
9
|
+
* `<html data-reveal="off">`, everything is simply visible.
|
|
10
|
+
*
|
|
11
|
+
* Set `stagger` (milliseconds) to animate the direct children one after another instead of the
|
|
12
|
+
* element as a whole.
|
|
13
|
+
*
|
|
14
|
+
* Events: `st-reveal-in` and `st-reveal-out` (bubbles, composed) when the state changes.
|
|
15
|
+
*/
|
|
16
|
+
export declare class StReveal extends LitElement {
|
|
17
|
+
effect: RevealEffect;
|
|
18
|
+
/** Length of the animation in milliseconds. */
|
|
19
|
+
duration: number;
|
|
20
|
+
/** Wait before the animation starts, in milliseconds. */
|
|
21
|
+
delay: number;
|
|
22
|
+
/** How far slide effects travel (any CSS length). */
|
|
23
|
+
distance: string;
|
|
24
|
+
/** Any CSS timing function. Defaults to a gentle ease-out. */
|
|
25
|
+
easing: string;
|
|
26
|
+
/** Percentage of the viewport height the element must travel into view before it reveals. */
|
|
27
|
+
offset: number;
|
|
28
|
+
/** Milliseconds between each child when animating children in sequence (0 animates as one). */
|
|
29
|
+
stagger: number;
|
|
30
|
+
/** Animate out as the content leaves the viewport, and back in when it returns. */
|
|
31
|
+
out: boolean;
|
|
32
|
+
private _state?;
|
|
33
|
+
private _armFrame;
|
|
34
|
+
private _observed?;
|
|
35
|
+
static styles: import("lit").CSSResult[];
|
|
36
|
+
/** Current phase, or undefined while the content is simply visible (never armed). */
|
|
37
|
+
get state(): RevealState | undefined;
|
|
38
|
+
connectedCallback(): void;
|
|
39
|
+
disconnectedCallback(): void;
|
|
40
|
+
/** Hides the content again and plays the entry animation, for demos and previews. */
|
|
41
|
+
replay(): void;
|
|
42
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
43
|
+
private _arm;
|
|
44
|
+
/** Whether the content starts below the visible part of the screen. */
|
|
45
|
+
private _startsBelowFold;
|
|
46
|
+
private _disarm;
|
|
47
|
+
/** Moves to the hidden state without animating there (the hide itself must never be seen). */
|
|
48
|
+
private _hideInstantly;
|
|
49
|
+
/** @internal Called by the shared observer. */
|
|
50
|
+
handleIntersection(entry: IntersectionObserverEntry): void;
|
|
51
|
+
private _unobserve;
|
|
52
|
+
private _setState;
|
|
53
|
+
private _isInViewport;
|
|
54
|
+
/** Keyboard users must never land on invisible content. */
|
|
55
|
+
private _onFocusIn;
|
|
56
|
+
private _onSlotChange;
|
|
57
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
58
|
+
}
|
|
59
|
+
declare global {
|
|
60
|
+
interface HTMLElementTagNameMap {
|
|
61
|
+
"st-reveal": StReveal;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=reveal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reveal.d.ts","sourceRoot":"","sources":["../../../src/components/reveal/reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,EAAC,MAAM,KAAK,CAAC;AAG1D,OAAO,KAAK,EAAC,YAAY,EAAE,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAgDrE;;;;;;;;;;;;GAYG;AACH,qBACa,QAAS,SAAQ,UAAU;IACG,MAAM,EAAE,YAAY,CAAc;IAC3E,+CAA+C;IACrB,QAAQ,SAAO;IACzC,yDAAyD;IAC/B,KAAK,SAAK;IACpC,qDAAqD;IAC3B,QAAQ,SAAU;IAC5C,8DAA8D;IACpC,MAAM,SAAM;IACtC,6FAA6F;IACnE,MAAM,SAAM;IACtC,+FAA+F;IACrE,OAAO,SAAK;IACtC,mFAAmF;IACxD,GAAG,UAAS;IAEvC,OAAO,CAAC,MAAM,CAAC,CAAc;IAC7B,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,SAAS,CAAC,CAAuB;IAEzC,MAAM,CAAC,MAAM,4BA8FX;IAEF,qFAAqF;IACrF,IAAI,KAAK,IAAI,WAAW,GAAG,SAAS,CAEnC;IAED,iBAAiB,SAIhB;IAED,oBAAoB,SAInB;IAED,qFAAqF;IACrF,MAAM,SASL;IAED,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,QAgB9C;IAID,OAAO,CAAC,IAAI;IAsBZ,uEAAuE;IACvE,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,OAAO;IASf,8FAA8F;IAC9F,OAAO,CAAC,cAAc;IAWtB,+CAA+C;IAC/C,kBAAkB,CAAC,KAAK,EAAE,yBAAyB,QASlD;IAED,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,aAAa;IAKrB,2DAA2D;IAC3D,OAAO,CAAC,UAAU,CAEhB;IAEF,OAAO,CAAC,aAAa;IAMrB,MAAM,yCAEL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import { resetStyles } from "../../styles/reset.js";
|
|
10
|
+
/** One observer per offset, shared by every reveal on the page. */
|
|
11
|
+
const observers = new Map();
|
|
12
|
+
const instances = new WeakMap();
|
|
13
|
+
function observerFor(offset) {
|
|
14
|
+
let observer = observers.get(offset);
|
|
15
|
+
if (!observer) {
|
|
16
|
+
// Shrinking the bottom of the viewport makes content reveal once it has travelled `offset`%
|
|
17
|
+
// into view, and works for elements taller than the screen (a ratio threshold would not).
|
|
18
|
+
observer = new IntersectionObserver((entries) => entries.forEach((entry) => instances.get(entry.target)?.handleIntersection(entry)), { rootMargin: `0px 0px -${offset}% 0px` });
|
|
19
|
+
observers.set(offset, observer);
|
|
20
|
+
}
|
|
21
|
+
return observer;
|
|
22
|
+
}
|
|
23
|
+
/** False for people who prefer reduced motion and when a page opts out with `data-reveal="off"`. */
|
|
24
|
+
function canAnimate() {
|
|
25
|
+
if (typeof IntersectionObserver === "undefined")
|
|
26
|
+
return false;
|
|
27
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches)
|
|
28
|
+
return false;
|
|
29
|
+
return document.documentElement.dataset.reveal !== "off";
|
|
30
|
+
}
|
|
31
|
+
/** The hidden look. Used for the host itself, or for each child when `stagger` is set. */
|
|
32
|
+
const hidden = css `
|
|
33
|
+
opacity: 0;
|
|
34
|
+
transform: translate3d(var(--_tx), var(--_ty), 0) scale(var(--_scale));
|
|
35
|
+
filter: blur(var(--_blur));
|
|
36
|
+
will-change: opacity, transform;
|
|
37
|
+
`;
|
|
38
|
+
const shown = css `
|
|
39
|
+
opacity: 1;
|
|
40
|
+
transform: none;
|
|
41
|
+
filter: none;
|
|
42
|
+
`;
|
|
43
|
+
const transitions = css `
|
|
44
|
+
transition:
|
|
45
|
+
opacity var(--_duration) var(--_ease),
|
|
46
|
+
transform var(--_duration) var(--_ease),
|
|
47
|
+
filter var(--_duration) var(--_ease);
|
|
48
|
+
`;
|
|
49
|
+
/**
|
|
50
|
+
* Animates its content into view as it is scrolled to, and optionally back out as it leaves.
|
|
51
|
+
*
|
|
52
|
+
* The content always stays in the DOM, so search engines, screen readers and find-in-page see
|
|
53
|
+
* all of it. Content is only visually hidden once the element is armed in the browser, and only
|
|
54
|
+
* when it starts below the fold. Without JavaScript, with reduced motion, or with
|
|
55
|
+
* `<html data-reveal="off">`, everything is simply visible.
|
|
56
|
+
*
|
|
57
|
+
* Set `stagger` (milliseconds) to animate the direct children one after another instead of the
|
|
58
|
+
* element as a whole.
|
|
59
|
+
*
|
|
60
|
+
* Events: `st-reveal-in` and `st-reveal-out` (bubbles, composed) when the state changes.
|
|
61
|
+
*/
|
|
62
|
+
let StReveal = class StReveal extends LitElement {
|
|
63
|
+
constructor() {
|
|
64
|
+
super(...arguments);
|
|
65
|
+
this.effect = "slide-up";
|
|
66
|
+
/** Length of the animation in milliseconds. */
|
|
67
|
+
this.duration = 600;
|
|
68
|
+
/** Wait before the animation starts, in milliseconds. */
|
|
69
|
+
this.delay = 0;
|
|
70
|
+
/** How far slide effects travel (any CSS length). */
|
|
71
|
+
this.distance = "2rem";
|
|
72
|
+
/** Any CSS timing function. Defaults to a gentle ease-out. */
|
|
73
|
+
this.easing = "";
|
|
74
|
+
/** Percentage of the viewport height the element must travel into view before it reveals. */
|
|
75
|
+
this.offset = 10;
|
|
76
|
+
/** Milliseconds between each child when animating children in sequence (0 animates as one). */
|
|
77
|
+
this.stagger = 0;
|
|
78
|
+
/** Animate out as the content leaves the viewport, and back in when it returns. */
|
|
79
|
+
this.out = false;
|
|
80
|
+
this._armFrame = 0;
|
|
81
|
+
/** Keyboard users must never land on invisible content. */
|
|
82
|
+
this._onFocusIn = () => {
|
|
83
|
+
if (this._state === "pending" || this._state === "out")
|
|
84
|
+
this._setState("in");
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Current phase, or undefined while the content is simply visible (never armed). */
|
|
88
|
+
get state() {
|
|
89
|
+
return this._state;
|
|
90
|
+
}
|
|
91
|
+
connectedCallback() {
|
|
92
|
+
super.connectedCallback();
|
|
93
|
+
this.addEventListener("focusin", this._onFocusIn);
|
|
94
|
+
this._arm();
|
|
95
|
+
}
|
|
96
|
+
disconnectedCallback() {
|
|
97
|
+
this.removeEventListener("focusin", this._onFocusIn);
|
|
98
|
+
this._disarm();
|
|
99
|
+
super.disconnectedCallback();
|
|
100
|
+
}
|
|
101
|
+
/** Hides the content again and plays the entry animation, for demos and previews. */
|
|
102
|
+
replay() {
|
|
103
|
+
if (this.effect === "none" || !canAnimate())
|
|
104
|
+
return;
|
|
105
|
+
if (!this._observed)
|
|
106
|
+
this._arm();
|
|
107
|
+
this._hideInstantly();
|
|
108
|
+
requestAnimationFrame(() => {
|
|
109
|
+
requestAnimationFrame(() => {
|
|
110
|
+
if (this._isInViewport())
|
|
111
|
+
this._setState("in");
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
updated(changed) {
|
|
116
|
+
this.style.setProperty("--_duration", `${this.duration}ms`);
|
|
117
|
+
this.style.setProperty("--_delay", `${this.delay}ms`);
|
|
118
|
+
this.style.setProperty("--_stagger", `${this.stagger}ms`);
|
|
119
|
+
this.style.setProperty("--_distance", this.distance);
|
|
120
|
+
if (this.easing)
|
|
121
|
+
this.style.setProperty("--_ease", this.easing);
|
|
122
|
+
else
|
|
123
|
+
this.style.removeProperty("--_ease");
|
|
124
|
+
// Only a genuine change re-arms: on the first update every property is "changed".
|
|
125
|
+
const retune = ["effect", "offset", "out", "stagger"].some((key) => changed.has(key) && changed.get(key) !== undefined);
|
|
126
|
+
if (retune) {
|
|
127
|
+
this._disarm();
|
|
128
|
+
this._arm();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// ------------------------------------------------------------------ arming
|
|
132
|
+
_arm(allowRetry = true) {
|
|
133
|
+
if (this._observed || this.effect === "none" || !canAnimate())
|
|
134
|
+
return;
|
|
135
|
+
// Content that has just been added may not have a box yet. Give it one frame to get laid out
|
|
136
|
+
// before judging where it is, so content already on screen is never made to fade in.
|
|
137
|
+
if (allowRetry && this.getClientRects().length === 0) {
|
|
138
|
+
cancelAnimationFrame(this._armFrame);
|
|
139
|
+
this._armFrame = requestAnimationFrame(() => this._arm(false));
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
this.toggleAttribute("data-staggered", this.stagger > 0);
|
|
143
|
+
const belowFold = this._startsBelowFold();
|
|
144
|
+
// Content already on screen, or already scrolled past, is shown straight away.
|
|
145
|
+
if (belowFold)
|
|
146
|
+
this._hideInstantly();
|
|
147
|
+
else
|
|
148
|
+
this._setState("in", false);
|
|
149
|
+
this._observed = observerFor(this.offset);
|
|
150
|
+
instances.set(this, this);
|
|
151
|
+
this._observed.observe(this);
|
|
152
|
+
}
|
|
153
|
+
/** Whether the content starts below the visible part of the screen. */
|
|
154
|
+
_startsBelowFold() {
|
|
155
|
+
const limit = window.innerHeight * (1 - this.offset / 100);
|
|
156
|
+
if (this.getClientRects().length > 0)
|
|
157
|
+
return this.getBoundingClientRect().top > limit;
|
|
158
|
+
// Not displayed. Inside a row that skips off-screen work (content-visibility) the nearest
|
|
159
|
+
// displayed ancestor says where we are; inside something hidden we have no position, so we
|
|
160
|
+
// wait and reveal as soon as we are shown on screen.
|
|
161
|
+
let node = this.parentElement ?? this.getRootNode().host ?? null;
|
|
162
|
+
while (node && node.getClientRects().length === 0) {
|
|
163
|
+
node = node.parentElement ?? node.getRootNode().host ?? null;
|
|
164
|
+
}
|
|
165
|
+
if (node && getComputedStyle(node).contentVisibility === "auto") {
|
|
166
|
+
return node.getBoundingClientRect().top > limit;
|
|
167
|
+
}
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
_disarm() {
|
|
171
|
+
cancelAnimationFrame(this._armFrame);
|
|
172
|
+
this._observed?.unobserve(this);
|
|
173
|
+
this._observed = undefined;
|
|
174
|
+
this._state = undefined;
|
|
175
|
+
this.removeAttribute("data-reveal");
|
|
176
|
+
this.removeAttribute("data-exit");
|
|
177
|
+
}
|
|
178
|
+
/** Moves to the hidden state without animating there (the hide itself must never be seen). */
|
|
179
|
+
_hideInstantly() {
|
|
180
|
+
this.toggleAttribute("data-instant", true);
|
|
181
|
+
this._setState("pending", false);
|
|
182
|
+
void this.offsetWidth; // flush the hidden style while transitions are off
|
|
183
|
+
// Wait for the settings (distance, duration...) to be applied so they too skip the transition.
|
|
184
|
+
void this.updateComplete.then(() => {
|
|
185
|
+
void this.offsetWidth;
|
|
186
|
+
requestAnimationFrame(() => this.removeAttribute("data-instant"));
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/** @internal Called by the shared observer. */
|
|
190
|
+
handleIntersection(entry) {
|
|
191
|
+
if (entry.isIntersecting) {
|
|
192
|
+
if (this._state !== "in")
|
|
193
|
+
this._setState("in");
|
|
194
|
+
if (!this.out)
|
|
195
|
+
this._unobserve();
|
|
196
|
+
}
|
|
197
|
+
else if (this.out && this._state === "in") {
|
|
198
|
+
const rect = entry.boundingClientRect;
|
|
199
|
+
this.setAttribute("data-exit", rect.top + rect.height / 2 < window.innerHeight / 2 ? "top" : "bottom");
|
|
200
|
+
this._setState("out");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
_unobserve() {
|
|
204
|
+
this._observed?.unobserve(this);
|
|
205
|
+
this._observed = undefined;
|
|
206
|
+
}
|
|
207
|
+
_setState(state, announce = true) {
|
|
208
|
+
if (this._state === state)
|
|
209
|
+
return;
|
|
210
|
+
this._state = state;
|
|
211
|
+
this.setAttribute("data-reveal", state);
|
|
212
|
+
if (announce && state !== "pending") {
|
|
213
|
+
this.dispatchEvent(new CustomEvent(`st-reveal-${state}`, { bubbles: true, composed: true }));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
_isInViewport() {
|
|
217
|
+
const rect = this.getBoundingClientRect();
|
|
218
|
+
return rect.bottom > 0 && rect.top < window.innerHeight * (1 - this.offset / 100);
|
|
219
|
+
}
|
|
220
|
+
_onSlotChange(e) {
|
|
221
|
+
e.target
|
|
222
|
+
.assignedElements()
|
|
223
|
+
.forEach((child, i) => child.style.setProperty("--st-reveal-i", String(i)));
|
|
224
|
+
}
|
|
225
|
+
render() {
|
|
226
|
+
return html `<slot @slotchange=${this._onSlotChange}></slot>`;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
StReveal.styles = [
|
|
230
|
+
resetStyles,
|
|
231
|
+
css `
|
|
232
|
+
:host {
|
|
233
|
+
display: block;
|
|
234
|
+
--_distance: 2rem;
|
|
235
|
+
--_duration: var(--st-duration-reveal, 600ms);
|
|
236
|
+
--_delay: 0ms;
|
|
237
|
+
--_ease: var(--st-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
|
|
238
|
+
--_stagger: 0ms;
|
|
239
|
+
--_tx: 0;
|
|
240
|
+
--_ty: var(--_distance);
|
|
241
|
+
--_scale: 1;
|
|
242
|
+
--_blur: 0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
:host([effect="fade"]) {
|
|
246
|
+
--_ty: 0;
|
|
247
|
+
}
|
|
248
|
+
:host([effect="slide-up"]) {
|
|
249
|
+
--_ty: var(--_distance);
|
|
250
|
+
}
|
|
251
|
+
:host([effect="slide-down"]) {
|
|
252
|
+
--_ty: calc(var(--_distance) * -1);
|
|
253
|
+
}
|
|
254
|
+
:host([effect="slide-left"]) {
|
|
255
|
+
--_tx: var(--_distance);
|
|
256
|
+
--_ty: 0;
|
|
257
|
+
}
|
|
258
|
+
:host([effect="slide-right"]) {
|
|
259
|
+
--_tx: calc(var(--_distance) * -1);
|
|
260
|
+
--_ty: 0;
|
|
261
|
+
}
|
|
262
|
+
:host([effect="zoom"]) {
|
|
263
|
+
--_ty: 0;
|
|
264
|
+
--_scale: 0.92;
|
|
265
|
+
}
|
|
266
|
+
:host([effect="blur"]) {
|
|
267
|
+
--_ty: 0;
|
|
268
|
+
--_blur: 0.75rem;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* Vertical slides keep travelling the way the content left the screen. */
|
|
272
|
+
:host([data-reveal="out"][data-exit="top"][effect="slide-up"]),
|
|
273
|
+
:host([data-reveal="out"][data-exit="top"][effect="slide-down"]) {
|
|
274
|
+
--_ty: calc(var(--_distance) * -1);
|
|
275
|
+
}
|
|
276
|
+
:host([data-reveal="out"][data-exit="bottom"][effect="slide-up"]),
|
|
277
|
+
:host([data-reveal="out"][data-exit="bottom"][effect="slide-down"]) {
|
|
278
|
+
--_ty: var(--_distance);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/* Whole element */
|
|
282
|
+
:host([data-reveal]:not([data-staggered])) {
|
|
283
|
+
${transitions}
|
|
284
|
+
transition-delay: var(--_delay);
|
|
285
|
+
}
|
|
286
|
+
:host([data-reveal="pending"]:not([data-staggered])),
|
|
287
|
+
:host([data-reveal="out"]:not([data-staggered])) {
|
|
288
|
+
${hidden}
|
|
289
|
+
}
|
|
290
|
+
:host([data-reveal="in"]:not([data-staggered])) {
|
|
291
|
+
${shown}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/* Children in sequence */
|
|
295
|
+
:host([data-staggered][data-reveal]) ::slotted(*) {
|
|
296
|
+
${transitions}
|
|
297
|
+
transition-delay: calc(var(--_delay) + var(--st-reveal-i, 0) * var(--_stagger));
|
|
298
|
+
}
|
|
299
|
+
:host([data-staggered][data-reveal="pending"]) ::slotted(*),
|
|
300
|
+
:host([data-staggered][data-reveal="out"]) ::slotted(*) {
|
|
301
|
+
${hidden}
|
|
302
|
+
}
|
|
303
|
+
:host([data-staggered][data-reveal="in"]) ::slotted(*) {
|
|
304
|
+
${shown}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/* Replay jumps back to the hidden state without animating there. */
|
|
308
|
+
:host([data-instant]),
|
|
309
|
+
:host([data-instant]) ::slotted(*) {
|
|
310
|
+
transition: none !important;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
@media (prefers-reduced-motion: reduce), print {
|
|
314
|
+
:host,
|
|
315
|
+
:host ::slotted(*) {
|
|
316
|
+
opacity: 1 !important;
|
|
317
|
+
transform: none !important;
|
|
318
|
+
filter: none !important;
|
|
319
|
+
transition: none !important;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
`,
|
|
323
|
+
];
|
|
324
|
+
__decorate([
|
|
325
|
+
property({ type: String, reflect: true })
|
|
326
|
+
], StReveal.prototype, "effect", void 0);
|
|
327
|
+
__decorate([
|
|
328
|
+
property({ type: Number })
|
|
329
|
+
], StReveal.prototype, "duration", void 0);
|
|
330
|
+
__decorate([
|
|
331
|
+
property({ type: Number })
|
|
332
|
+
], StReveal.prototype, "delay", void 0);
|
|
333
|
+
__decorate([
|
|
334
|
+
property({ type: String })
|
|
335
|
+
], StReveal.prototype, "distance", void 0);
|
|
336
|
+
__decorate([
|
|
337
|
+
property({ type: String })
|
|
338
|
+
], StReveal.prototype, "easing", void 0);
|
|
339
|
+
__decorate([
|
|
340
|
+
property({ type: Number })
|
|
341
|
+
], StReveal.prototype, "offset", void 0);
|
|
342
|
+
__decorate([
|
|
343
|
+
property({ type: Number })
|
|
344
|
+
], StReveal.prototype, "stagger", void 0);
|
|
345
|
+
__decorate([
|
|
346
|
+
property({ type: Boolean })
|
|
347
|
+
], StReveal.prototype, "out", void 0);
|
|
348
|
+
StReveal = __decorate([
|
|
349
|
+
customElement("st-reveal")
|
|
350
|
+
], StReveal);
|
|
351
|
+
export { StReveal };
|
|
352
|
+
//# sourceMappingURL=reveal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reveal.js","sourceRoot":"","sources":["../../../src/components/reveal/reveal.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,GAAG,EAAiB,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAGlD,mEAAmE;AACnE,MAAM,SAAS,GAAG,IAAI,GAAG,EAAgC,CAAC;AAC1D,MAAM,SAAS,GAAG,IAAI,OAAO,EAAqB,CAAC;AAEnD,SAAS,WAAW,CAAC,MAAc;IACjC,IAAI,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,4FAA4F;QAC5F,0FAA0F;QAC1F,QAAQ,GAAG,IAAI,oBAAoB,CACjC,CAAC,OAAO,EAAE,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C,CAAC,CAAC,CAAC,CAAC;IACjG,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA,qBAAqB,IAAI,CAAC,aAAa,UAAU,CAAC;IAC/D,CAAC;CACF,CAAA;AA3PQ,eAAM,GAAG;IACd,WAAW;IACX,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoDG,WAAW;;;;;UAKX,MAAM;;;UAGN,KAAK;;;;;UAKL,WAAW;;;;;UAKX,MAAM;;;UAGN,KAAK;;;;;;;;;;;;;;;;;;KAkBV;CACF,AA9FY,CA8FX;AAlHuC;IAAxC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;wCAAmC;AAEjD;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CAAgB;AAEf;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCAAW;AAEV;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CAAmB;AAElB;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;wCAAa;AAEZ;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;wCAAa;AAEZ;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;yCAAa;AAEX;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;qCAAa;AAf5B,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAgRpB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* A thin bar showing how far down the page (or an article) the reader has scrolled.
|
|
4
|
+
*
|
|
5
|
+
* By default it tracks the whole page and sticks to the top of the screen. Point `target` at an
|
|
6
|
+
* element (such as the article) to measure progress through just that element. The bar is
|
|
7
|
+
* decorative and hidden from screen readers.
|
|
8
|
+
*
|
|
9
|
+
* Events: `st-scroll-progress` with `detail.progress` (0 to 1), only when the value changes.
|
|
10
|
+
*/
|
|
11
|
+
export declare class StScrollProgress extends LitElement {
|
|
12
|
+
/** CSS selector of the element to measure. Empty tracks the whole page. */
|
|
13
|
+
target: string;
|
|
14
|
+
position: "top" | "bottom";
|
|
15
|
+
private _progress;
|
|
16
|
+
private _frame;
|
|
17
|
+
static styles: import("lit").CSSResult[];
|
|
18
|
+
/** Progress through the page or target, from 0 to 1. */
|
|
19
|
+
get progress(): number;
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
disconnectedCallback(): void;
|
|
22
|
+
protected updated(): void;
|
|
23
|
+
private _schedule;
|
|
24
|
+
private _measure;
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface HTMLElementTagNameMap {
|
|
29
|
+
"st-scroll-progress": StScrollProgress;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=scroll-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-progress.d.ts","sourceRoot":"","sources":["../../../src/components/scroll-progress/scroll-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAI1C;;;;;;;;GAQG;AACH,qBACa,gBAAiB,SAAQ,UAAU;IAC9C,2EAA2E;IACjD,MAAM,SAAM;IACG,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAS;IAE5E,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,MAAM,CAAK;IAEnB,MAAM,CAAC,MAAM,4BAiCX;IAEF,wDAAwD;IACxD,IAAI,QAAQ,WAEX;IAED,iBAAiB,SAKhB;IAED,oBAAoB,SAKnB;IAED,SAAS,CAAC,OAAO,SAEhB;IAED,OAAO,CAAC,SAAS,CAGf;IAEF,OAAO,CAAC,QAAQ;IAwBhB,MAAM,yCAEL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import { resetStyles } from "../../styles/reset.js";
|
|
10
|
+
/**
|
|
11
|
+
* A thin bar showing how far down the page (or an article) the reader has scrolled.
|
|
12
|
+
*
|
|
13
|
+
* By default it tracks the whole page and sticks to the top of the screen. Point `target` at an
|
|
14
|
+
* element (such as the article) to measure progress through just that element. The bar is
|
|
15
|
+
* decorative and hidden from screen readers.
|
|
16
|
+
*
|
|
17
|
+
* Events: `st-scroll-progress` with `detail.progress` (0 to 1), only when the value changes.
|
|
18
|
+
*/
|
|
19
|
+
let StScrollProgress = class StScrollProgress extends LitElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
/** CSS selector of the element to measure. Empty tracks the whole page. */
|
|
23
|
+
this.target = "";
|
|
24
|
+
this.position = "top";
|
|
25
|
+
this._progress = 0;
|
|
26
|
+
this._frame = 0;
|
|
27
|
+
this._schedule = () => {
|
|
28
|
+
cancelAnimationFrame(this._frame);
|
|
29
|
+
this._frame = requestAnimationFrame(() => this._measure());
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Progress through the page or target, from 0 to 1. */
|
|
33
|
+
get progress() {
|
|
34
|
+
return this._progress;
|
|
35
|
+
}
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
super.connectedCallback();
|
|
38
|
+
window.addEventListener("scroll", this._schedule, { passive: true });
|
|
39
|
+
window.addEventListener("resize", this._schedule, { passive: true });
|
|
40
|
+
this._schedule();
|
|
41
|
+
}
|
|
42
|
+
disconnectedCallback() {
|
|
43
|
+
window.removeEventListener("scroll", this._schedule);
|
|
44
|
+
window.removeEventListener("resize", this._schedule);
|
|
45
|
+
cancelAnimationFrame(this._frame);
|
|
46
|
+
super.disconnectedCallback();
|
|
47
|
+
}
|
|
48
|
+
updated() {
|
|
49
|
+
this._schedule();
|
|
50
|
+
}
|
|
51
|
+
_measure() {
|
|
52
|
+
const element = this.target ? document.querySelector(this.target) : null;
|
|
53
|
+
let progress;
|
|
54
|
+
if (element) {
|
|
55
|
+
// Read: how much of the element has scrolled past the top of the screen.
|
|
56
|
+
const rect = element.getBoundingClientRect();
|
|
57
|
+
const scrollable = rect.height - window.innerHeight;
|
|
58
|
+
progress = scrollable > 0 ? -rect.top / scrollable : rect.top < 0 ? 1 : 0;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
const root = document.documentElement;
|
|
62
|
+
const scrollable = root.scrollHeight - window.innerHeight;
|
|
63
|
+
progress = scrollable > 0 ? window.scrollY / scrollable : 0;
|
|
64
|
+
}
|
|
65
|
+
progress = Math.min(1, Math.max(0, progress));
|
|
66
|
+
if (progress === this._progress)
|
|
67
|
+
return;
|
|
68
|
+
this._progress = progress;
|
|
69
|
+
this.style.setProperty("--_progress", String(progress));
|
|
70
|
+
this.dispatchEvent(new CustomEvent("st-scroll-progress", { detail: { progress }, bubbles: true, composed: true }));
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
return html `<div class="bar" aria-hidden="true"></div>`;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
StScrollProgress.styles = [
|
|
77
|
+
resetStyles,
|
|
78
|
+
css `
|
|
79
|
+
:host {
|
|
80
|
+
position: fixed;
|
|
81
|
+
left: 0;
|
|
82
|
+
right: 0;
|
|
83
|
+
top: 0;
|
|
84
|
+
z-index: var(--st-scroll-progress-z, 100);
|
|
85
|
+
height: var(--st-scroll-progress-height, 0.25rem);
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([position="bottom"]) {
|
|
90
|
+
top: auto;
|
|
91
|
+
bottom: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.bar {
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
background: var(--st-scroll-progress-color, var(--st-color-primary));
|
|
98
|
+
transform: scaleX(var(--_progress, 0));
|
|
99
|
+
transform-origin: left;
|
|
100
|
+
transition: transform 0.1s linear;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (prefers-reduced-motion: reduce) {
|
|
104
|
+
.bar {
|
|
105
|
+
transition: none;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`,
|
|
109
|
+
];
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ type: String })
|
|
112
|
+
], StScrollProgress.prototype, "target", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: String, reflect: true })
|
|
115
|
+
], StScrollProgress.prototype, "position", void 0);
|
|
116
|
+
StScrollProgress = __decorate([
|
|
117
|
+
customElement("st-scroll-progress")
|
|
118
|
+
], StScrollProgress);
|
|
119
|
+
export { StScrollProgress };
|
|
120
|
+
//# sourceMappingURL=scroll-progress.js.map
|