@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,225 @@
|
|
|
1
|
+
import {LitElement, html, css, nothing} from "lit";
|
|
2
|
+
import {customElement, property, state} from "lit/decorators.js";
|
|
3
|
+
import {ifDefined} from "lit/directives/if-defined.js";
|
|
4
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
5
|
+
import "../icon/icon.js";
|
|
6
|
+
import "../avatar/avatar.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A row inside `st-list`. It becomes a link when `href` is set, a button when `interactive`
|
|
10
|
+
* is set, and plain content otherwise.
|
|
11
|
+
*
|
|
12
|
+
* Slots: `leading` (icon, avatar, image), default (replaces heading/description), `meta`
|
|
13
|
+
* (right aligned details) and `actions` (buttons that stay clickable independently).
|
|
14
|
+
*
|
|
15
|
+
* Events: `st-item-click` (detail: `{ value, href }`) for links and interactive rows.
|
|
16
|
+
*/
|
|
17
|
+
@customElement("st-list-item")
|
|
18
|
+
export class StListItem extends LitElement {
|
|
19
|
+
@property({type: String}) heading = "";
|
|
20
|
+
@property({type: String}) description = "";
|
|
21
|
+
/** Short right-aligned detail such as a date or status. */
|
|
22
|
+
@property({type: String}) meta = "";
|
|
23
|
+
/** Leading icon name. */
|
|
24
|
+
@property({type: String}) icon = "";
|
|
25
|
+
/** Leading avatar; shows initials derived from this name. */
|
|
26
|
+
@property({type: String}) avatar = "";
|
|
27
|
+
@property({type: String}) href?: string;
|
|
28
|
+
@property({type: String}) target: "_blank" | "_self" = "_self";
|
|
29
|
+
/** Renders the row as a button that emits `st-item-click`. */
|
|
30
|
+
@property({type: Boolean, reflect: true}) interactive = false;
|
|
31
|
+
/** Marks the row as the current item. */
|
|
32
|
+
@property({type: Boolean, reflect: true}) selected = false;
|
|
33
|
+
@property({type: Boolean, reflect: true}) disabled = false;
|
|
34
|
+
/** Identifier echoed back in `st-item-click`. */
|
|
35
|
+
@property({type: String}) value = "";
|
|
36
|
+
|
|
37
|
+
@state() private _hasLeadingSlot = false;
|
|
38
|
+
@state() private _hasActionsSlot = false;
|
|
39
|
+
|
|
40
|
+
static styles = [
|
|
41
|
+
resetStyles,
|
|
42
|
+
css`
|
|
43
|
+
:host {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: var(--st-spacing-sm);
|
|
47
|
+
border-bottom: 1px solid var(--st-list-divider, var(--st-color-border));
|
|
48
|
+
color: var(--st-color-text);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host(:last-child) {
|
|
52
|
+
border-bottom: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.main {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex: 1;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: var(--st-spacing-md);
|
|
61
|
+
padding: var(--st-list-item-padding-y, var(--st-spacing-md)) var(--st-spacing-md);
|
|
62
|
+
border: 0;
|
|
63
|
+
background: none;
|
|
64
|
+
color: inherit;
|
|
65
|
+
font: inherit;
|
|
66
|
+
text-align: left;
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
a.main,
|
|
71
|
+
button.main {
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
a.main:hover,
|
|
76
|
+
button.main:hover {
|
|
77
|
+
background-color: var(--st-color-surface-hover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.main:focus-visible {
|
|
81
|
+
outline: 2px solid var(--st-color-primary);
|
|
82
|
+
outline-offset: -2px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([selected]) .main {
|
|
86
|
+
background-color: var(--st-color-primary-bg);
|
|
87
|
+
box-shadow: inset 3px 0 0 var(--st-color-primary);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([disabled]) .main {
|
|
91
|
+
opacity: 0.5;
|
|
92
|
+
cursor: not-allowed;
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[hidden] {
|
|
97
|
+
display: none !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.leading {
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
color: var(--st-color-text-muted);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.body {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex: 1;
|
|
109
|
+
min-width: 0;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
gap: 2px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.heading {
|
|
115
|
+
font-weight: var(--st-font-weight-medium);
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
text-overflow: ellipsis;
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.description {
|
|
122
|
+
color: var(--st-color-text-muted);
|
|
123
|
+
font-size: var(--st-font-size-sm);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.meta {
|
|
127
|
+
flex-shrink: 0;
|
|
128
|
+
color: var(--st-color-text-muted);
|
|
129
|
+
font-size: var(--st-font-size-sm);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.actions {
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-shrink: 0;
|
|
135
|
+
align-items: center;
|
|
136
|
+
gap: var(--st-spacing-xs);
|
|
137
|
+
padding-right: var(--st-spacing-md);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
`,
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
connectedCallback() {
|
|
144
|
+
super.connectedCallback();
|
|
145
|
+
if (!this.hasAttribute("role")) this.setAttribute("role", "listitem");
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
private _onSlotChange(e: Event, name: "leading" | "actions") {
|
|
149
|
+
const has = (e.target as HTMLSlotElement).assignedNodes().length > 0;
|
|
150
|
+
if (name === "leading") this._hasLeadingSlot = has;
|
|
151
|
+
else this._hasActionsSlot = has;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
private _emitClick() {
|
|
155
|
+
if (this.disabled) return;
|
|
156
|
+
this.dispatchEvent(
|
|
157
|
+
new CustomEvent("st-item-click", {
|
|
158
|
+
detail: {value: this.value, href: this.href},
|
|
159
|
+
bubbles: true,
|
|
160
|
+
composed: true,
|
|
161
|
+
}),
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private _renderContent() {
|
|
166
|
+
return html`
|
|
167
|
+
<span class="leading" ?hidden=${!this._hasLeadingSlot && !this.avatar && !this.icon}>
|
|
168
|
+
<slot name="leading" @slotchange=${(e: Event) => this._onSlotChange(e, "leading")}>
|
|
169
|
+
${this.avatar
|
|
170
|
+
? html`<st-avatar name=${this.avatar} size="sm"></st-avatar>`
|
|
171
|
+
: this.icon
|
|
172
|
+
? html`<st-icon name=${this.icon} aria-hidden="true"></st-icon>`
|
|
173
|
+
: nothing}
|
|
174
|
+
</slot>
|
|
175
|
+
</span>
|
|
176
|
+
<span class="body">
|
|
177
|
+
<slot>
|
|
178
|
+
<span class="heading">${this.heading}</span>
|
|
179
|
+
${this.description
|
|
180
|
+
? html`<span class="description">${this.description}</span>`
|
|
181
|
+
: nothing}
|
|
182
|
+
</slot>
|
|
183
|
+
</span>
|
|
184
|
+
<span class="meta"><slot name="meta">${this.meta}</slot></span>
|
|
185
|
+
`;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
render() {
|
|
189
|
+
const current = this.selected ? "true" : undefined;
|
|
190
|
+
const main = this.href
|
|
191
|
+
? html`<a
|
|
192
|
+
class="main"
|
|
193
|
+
href=${this.href}
|
|
194
|
+
target=${this.target}
|
|
195
|
+
rel=${ifDefined(this.target === "_blank" ? "noopener noreferrer" : undefined)}
|
|
196
|
+
aria-current=${ifDefined(current)}
|
|
197
|
+
aria-disabled=${ifDefined(this.disabled ? "true" : undefined)}
|
|
198
|
+
tabindex=${ifDefined(this.disabled ? "-1" : undefined)}
|
|
199
|
+
@click=${this._emitClick}
|
|
200
|
+
>${this._renderContent()}</a
|
|
201
|
+
>`
|
|
202
|
+
: this.interactive
|
|
203
|
+
? html`<button
|
|
204
|
+
class="main"
|
|
205
|
+
type="button"
|
|
206
|
+
aria-current=${ifDefined(current)}
|
|
207
|
+
?disabled=${this.disabled}
|
|
208
|
+
@click=${this._emitClick}
|
|
209
|
+
>
|
|
210
|
+
${this._renderContent()}
|
|
211
|
+
</button>`
|
|
212
|
+
: html`<div class="main" aria-current=${ifDefined(current)}>${this._renderContent()}</div>`;
|
|
213
|
+
|
|
214
|
+
return html`${main}
|
|
215
|
+
<div class="actions" ?hidden=${!this._hasActionsSlot}>
|
|
216
|
+
<slot name="actions" @slotchange=${(e: Event) => this._onSlotChange(e, "actions")}></slot>
|
|
217
|
+
</div>`;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare global {
|
|
222
|
+
interface HTMLElementTagNameMap {
|
|
223
|
+
"st-list-item": StListItem;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {LitElement, html, css, nothing, isServer} from "lit";
|
|
2
|
+
import {customElement, property} from "lit/decorators.js";
|
|
3
|
+
import {ifDefined} from "lit/directives/if-defined.js";
|
|
4
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
5
|
+
import "./list-item.js";
|
|
6
|
+
import "../skeleton/skeleton.js";
|
|
7
|
+
|
|
8
|
+
export interface ListItemData {
|
|
9
|
+
heading: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
meta?: string;
|
|
12
|
+
icon?: string;
|
|
13
|
+
avatar?: string;
|
|
14
|
+
href?: string;
|
|
15
|
+
value?: string;
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Overrides `clickable-items` for this row. */
|
|
19
|
+
interactive?: boolean;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SKELETON_ITEMS = 3;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Vertical listing of rows with a heading, description, meta and optional leading visual.
|
|
27
|
+
* Give it `items` for data-driven lists, or slot your own `st-list-item` elements.
|
|
28
|
+
*
|
|
29
|
+
* Events: `st-item-click` (detail: `{ item, index, value, href }`; `item` and `index` are
|
|
30
|
+
* only present for rows created from `items`).
|
|
31
|
+
*/
|
|
32
|
+
@customElement("st-list")
|
|
33
|
+
export class StList extends LitElement {
|
|
34
|
+
@property({type: Array}) items: ListItemData[] = [];
|
|
35
|
+
/** Accessible name for the list. */
|
|
36
|
+
@property({type: String}) label = "";
|
|
37
|
+
@property({type: Boolean, reflect: true}) dense = false;
|
|
38
|
+
/** Draws an outer border with rounded corners. */
|
|
39
|
+
@property({type: Boolean, reflect: true}) bordered = false;
|
|
40
|
+
@property({type: Boolean, reflect: true, attribute: "no-dividers"}) noDividers = false;
|
|
41
|
+
/** Rows from `items` without an `href` become buttons that emit `st-item-click`. */
|
|
42
|
+
@property({type: Boolean, attribute: "clickable-items"}) clickableItems = false;
|
|
43
|
+
@property({type: Boolean, reflect: true}) loading = false;
|
|
44
|
+
@property({type: String, attribute: "empty-text"}) emptyText = "Nothing to show.";
|
|
45
|
+
|
|
46
|
+
static styles = [
|
|
47
|
+
resetStyles,
|
|
48
|
+
css`
|
|
49
|
+
:host {
|
|
50
|
+
display: block;
|
|
51
|
+
--st-list-divider: var(--st-color-border);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([dense]) {
|
|
55
|
+
--st-list-item-padding-y: var(--st-spacing-xs);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([no-dividers]) {
|
|
59
|
+
--st-list-divider: transparent;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([bordered]) {
|
|
63
|
+
border: 1px solid var(--st-color-border);
|
|
64
|
+
border-radius: var(--st-radius-md);
|
|
65
|
+
background-color: var(--st-color-surface);
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.empty {
|
|
70
|
+
padding: var(--st-spacing-xl);
|
|
71
|
+
text-align: center;
|
|
72
|
+
font-style: italic;
|
|
73
|
+
color: var(--st-color-text-muted);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.skeleton-row {
|
|
77
|
+
padding: var(--st-spacing-md);
|
|
78
|
+
}
|
|
79
|
+
`,
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
connectedCallback() {
|
|
83
|
+
super.connectedCallback();
|
|
84
|
+
if (!this.hasAttribute("role")) this.setAttribute("role", "list");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
updated() {
|
|
88
|
+
if (this.label) this.setAttribute("aria-label", this.label);
|
|
89
|
+
else this.removeAttribute("aria-label");
|
|
90
|
+
this.setAttribute("aria-busy", this.loading ? "true" : "false");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private _onItemClick(e: CustomEvent<{value: string; href?: string}>, item: ListItemData, index: number) {
|
|
94
|
+
// Re-emit with the source data so consumers don't have to map values back to rows.
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
this.dispatchEvent(
|
|
97
|
+
new CustomEvent("st-item-click", {
|
|
98
|
+
detail: {item, index, value: e.detail.value, href: e.detail.href},
|
|
99
|
+
bubbles: true,
|
|
100
|
+
composed: true,
|
|
101
|
+
}),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private _renderItems() {
|
|
106
|
+
if (this.loading) {
|
|
107
|
+
return Array.from(
|
|
108
|
+
{length: SKELETON_ITEMS},
|
|
109
|
+
() => html`
|
|
110
|
+
<div role="listitem" class="skeleton-row">
|
|
111
|
+
<st-skeleton variant="text" width="50%"></st-skeleton>
|
|
112
|
+
<st-skeleton variant="text" width="80%"></st-skeleton>
|
|
113
|
+
</div>
|
|
114
|
+
`,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
return this.items.map(
|
|
118
|
+
(item, index) => html`
|
|
119
|
+
<st-list-item
|
|
120
|
+
heading=${item.heading}
|
|
121
|
+
description=${ifDefined(item.description)}
|
|
122
|
+
meta=${ifDefined(item.meta)}
|
|
123
|
+
icon=${ifDefined(item.icon)}
|
|
124
|
+
avatar=${ifDefined(item.avatar)}
|
|
125
|
+
href=${ifDefined(item.href)}
|
|
126
|
+
value=${item.value ?? String(index)}
|
|
127
|
+
?selected=${item.selected}
|
|
128
|
+
?disabled=${item.disabled}
|
|
129
|
+
?interactive=${item.interactive ?? (this.clickableItems && !item.href)}
|
|
130
|
+
@st-item-click=${(e: CustomEvent) => this._onItemClick(e, item, index)}
|
|
131
|
+
></st-list-item>
|
|
132
|
+
`,
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
render() {
|
|
137
|
+
const showEmpty = !this.loading && this.items.length === 0;
|
|
138
|
+
return html`
|
|
139
|
+
${this._renderItems()}
|
|
140
|
+
<slot @slotchange=${() => this.requestUpdate()}></slot>
|
|
141
|
+
${showEmpty && !this._hasSlotted()
|
|
142
|
+
? html`<div class="empty" role="listitem">${this.emptyText}</div>`
|
|
143
|
+
: nothing}
|
|
144
|
+
`;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
private _hasSlotted() {
|
|
148
|
+
if (isServer) return true; // slotted items cannot be inspected while server rendering
|
|
149
|
+
return this.querySelector("st-list-item") !== null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
declare global {
|
|
154
|
+
interface HTMLElementTagNameMap {
|
|
155
|
+
"st-list": StList;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {html, css} from "lit";
|
|
2
|
+
import {customElement} from "lit/decorators.js";
|
|
3
|
+
import {StSection} from "../section/section.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A row of logos (customers, partners, technologies). Slot images, inline svgs or links wrapping
|
|
7
|
+
* them; each is sized to the same height and softened until hovered.
|
|
8
|
+
*
|
|
9
|
+
* Slots: `eyebrow`, `title`, `lead` and the default slot for the logos. Give every logo
|
|
10
|
+
* meaningful `alt` text.
|
|
11
|
+
*/
|
|
12
|
+
@customElement("st-logo-cloud")
|
|
13
|
+
export class StLogoCloud extends StSection {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.space = "sm";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static styles = [
|
|
20
|
+
...StSection.styles,
|
|
21
|
+
css`
|
|
22
|
+
.logos {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
gap: var(--st-spacing-xl) var(--st-spacing-2xl);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.logos ::slotted(*) {
|
|
31
|
+
width: auto;
|
|
32
|
+
max-width: 9rem;
|
|
33
|
+
height: var(--st-logo-cloud-height, 2.25rem);
|
|
34
|
+
object-fit: contain;
|
|
35
|
+
opacity: 0.7;
|
|
36
|
+
filter: grayscale(1);
|
|
37
|
+
transition:
|
|
38
|
+
opacity 0.2s ease,
|
|
39
|
+
filter 0.2s ease;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.logos ::slotted(*:hover),
|
|
43
|
+
.logos ::slotted(*:focus-visible) {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
filter: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (prefers-reduced-motion: reduce) {
|
|
49
|
+
.logos ::slotted(*) {
|
|
50
|
+
transition: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`,
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
render() {
|
|
57
|
+
return this.frame(html`<div class="logos"><slot></slot></div>`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare global {
|
|
62
|
+
interface HTMLElementTagNameMap {
|
|
63
|
+
"st-logo-cloud": StLogoCloud;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {LitElement, html, css, PropertyValues, nothing} from "lit";
|
|
2
2
|
import {customElement, property, query} from "lit/decorators.js";
|
|
3
3
|
import {resetStyles} from "../../styles/reset.js";
|
|
4
|
+
import {resetFormState} from "../form/form-reset.js";
|
|
5
|
+
|
|
6
|
+
/** Longest we wait for the close animation before closing anyway. */
|
|
7
|
+
const CLOSE_FALLBACK_MS = 400;
|
|
4
8
|
|
|
5
9
|
@customElement("st-modal")
|
|
6
10
|
export class StModal extends LitElement {
|
|
@@ -8,6 +12,12 @@ export class StModal extends LitElement {
|
|
|
8
12
|
@property({type: String}) heading = "";
|
|
9
13
|
@property({type: String}) size: "sm" | "md" | "lg" | "xl" | "xxl" = "md";
|
|
10
14
|
@property({type: Boolean}) static = false;
|
|
15
|
+
/**
|
|
16
|
+
* By default closing the modal resets what is inside it: forms and fields go back to their
|
|
17
|
+
* starting values, errors clear and multi-step forms return to step one, so it opens fresh next
|
|
18
|
+
* time. Set this to keep what was entered between openings.
|
|
19
|
+
*/
|
|
20
|
+
@property({type: Boolean, attribute: "preserve-state"}) preserveState = false;
|
|
11
21
|
|
|
12
22
|
@query("dialog") private dialogEl!: HTMLDialogElement;
|
|
13
23
|
|
|
@@ -23,16 +33,14 @@ export class StModal extends LitElement {
|
|
|
23
33
|
dialog {
|
|
24
34
|
padding: 0;
|
|
25
35
|
border: 1px solid var(--st-color-border);
|
|
26
|
-
border-radius: var(--st-radius-lg
|
|
36
|
+
border-radius: var(--st-radius-lg);
|
|
27
37
|
background-color: var(--st-color-surface);
|
|
28
38
|
color: var(--st-color-text);
|
|
29
39
|
|
|
30
40
|
width: calc(100% - 2rem);
|
|
31
41
|
margin: auto;
|
|
32
42
|
|
|
33
|
-
box-shadow:
|
|
34
|
-
0 20px 25px -5px rgb(0 0 0 / 0.1),
|
|
35
|
-
0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
43
|
+
box-shadow: var(--st-shadow-xl);
|
|
36
44
|
font-family: var(--st-font-family, inherit);
|
|
37
45
|
}
|
|
38
46
|
|
|
@@ -53,7 +61,7 @@ export class StModal extends LitElement {
|
|
|
53
61
|
}
|
|
54
62
|
|
|
55
63
|
dialog::backdrop {
|
|
56
|
-
background-color:
|
|
64
|
+
background-color: var(--st-color-overlay);
|
|
57
65
|
backdrop-filter: blur(2px);
|
|
58
66
|
}
|
|
59
67
|
|
|
@@ -139,12 +147,12 @@ export class StModal extends LitElement {
|
|
|
139
147
|
|
|
140
148
|
.close-btn:hover {
|
|
141
149
|
color: var(--st-color-text);
|
|
142
|
-
background-color: var(--st-color-surface-muted
|
|
150
|
+
background-color: var(--st-color-surface-muted);
|
|
143
151
|
}
|
|
144
152
|
|
|
145
153
|
.modal-body {
|
|
146
154
|
padding: var(--st-spacing-lg);
|
|
147
|
-
font-size: var(--st-font-size-sm
|
|
155
|
+
font-size: var(--st-font-size-sm);
|
|
148
156
|
line-height: 1.5;
|
|
149
157
|
}
|
|
150
158
|
|
|
@@ -155,7 +163,7 @@ export class StModal extends LitElement {
|
|
|
155
163
|
gap: var(--st-spacing-sm);
|
|
156
164
|
padding: var(--st-spacing-md) var(--st-spacing-lg);
|
|
157
165
|
border-top: 1px solid var(--st-color-border);
|
|
158
|
-
background-color: var(--st-color-surface-muted
|
|
166
|
+
background-color: var(--st-color-surface-muted);
|
|
159
167
|
}
|
|
160
168
|
`,
|
|
161
169
|
];
|
|
@@ -182,16 +190,34 @@ export class StModal extends LitElement {
|
|
|
182
190
|
this.isClosing = true;
|
|
183
191
|
this.dialogEl.classList.add("closing");
|
|
184
192
|
|
|
185
|
-
|
|
193
|
+
let finished = false;
|
|
194
|
+
const finish = () => {
|
|
195
|
+
if (finished) return;
|
|
196
|
+
finished = true;
|
|
197
|
+
window.clearTimeout(fallback);
|
|
186
198
|
this.dialogEl.classList.remove("closing");
|
|
187
199
|
this.isClosing = false;
|
|
188
200
|
if (!this.open) {
|
|
189
201
|
this.dialogEl.close();
|
|
202
|
+
// Reset once it has faded out, so nothing visibly changes as it closes.
|
|
203
|
+
if (!this.preserveState) this.reset();
|
|
190
204
|
}
|
|
191
205
|
};
|
|
192
206
|
|
|
193
|
-
//
|
|
194
|
-
|
|
207
|
+
// The animation ending finishes the close; the timer covers it never firing (reduced motion).
|
|
208
|
+
const fallback = window.setTimeout(finish, CLOSE_FALLBACK_MS);
|
|
209
|
+
this.dialogEl.addEventListener("animationend", finish, {once: true});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Returns the content to its starting state: forms and fields are reset, errors cleared and the
|
|
214
|
+
* body scrolled back to the top. Happens automatically on close unless `preserve-state` is set.
|
|
215
|
+
* Fires `st-reset` afterwards so your own state (in a framework, say) can be cleared too.
|
|
216
|
+
*/
|
|
217
|
+
reset() {
|
|
218
|
+
resetFormState(this);
|
|
219
|
+
this.renderRoot.querySelector(".modal-body")?.scrollTo({top: 0});
|
|
220
|
+
this.dispatchEvent(new CustomEvent("st-reset", {bubbles: true, composed: true}));
|
|
195
221
|
}
|
|
196
222
|
|
|
197
223
|
private handleClose() {
|
|
@@ -152,9 +152,9 @@ export class StPageLayout extends LitElement {
|
|
|
152
152
|
:host {
|
|
153
153
|
display: block;
|
|
154
154
|
box-sizing: border-box;
|
|
155
|
-
--layout-bg-color: var(--st-color-bg
|
|
156
|
-
--layout-surface-color: var(--st-color-surface
|
|
157
|
-
--layout-border-color: var(--st-color-border
|
|
155
|
+
--layout-bg-color: var(--st-color-bg);
|
|
156
|
+
--layout-surface-color: var(--st-color-surface);
|
|
157
|
+
--layout-border-color: var(--st-color-border);
|
|
158
158
|
--layout-sidebar-width: 16rem;
|
|
159
159
|
--layout-right-sidebar-width: 16rem;
|
|
160
160
|
--layout-main-max-width: none;
|
|
@@ -176,7 +176,7 @@ export class StPageLayout extends LitElement {
|
|
|
176
176
|
justify-content: center;
|
|
177
177
|
background: transparent;
|
|
178
178
|
border: 1px solid var(--layout-border-color);
|
|
179
|
-
border-radius: var(--st-radius-sm
|
|
179
|
+
border-radius: var(--st-radius-sm);
|
|
180
180
|
width: 2.25rem;
|
|
181
181
|
height: 2.25rem;
|
|
182
182
|
cursor: pointer;
|
|
@@ -210,7 +210,7 @@ export class StPageLayout extends LitElement {
|
|
|
210
210
|
left: 0;
|
|
211
211
|
width: 100vw;
|
|
212
212
|
height: 100vh;
|
|
213
|
-
background-color:
|
|
213
|
+
background-color: var(--st-color-overlay);
|
|
214
214
|
backdrop-filter: blur(2px);
|
|
215
215
|
z-index: 1000;
|
|
216
216
|
display: none;
|
|
@@ -255,12 +255,12 @@ export class StPageLayout extends LitElement {
|
|
|
255
255
|
display: flex;
|
|
256
256
|
align-items: center;
|
|
257
257
|
justify-content: center;
|
|
258
|
-
border-radius: var(--st-radius-sm
|
|
258
|
+
border-radius: var(--st-radius-sm);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
.mobile-close-btn:hover {
|
|
262
262
|
color: var(--st-color-text);
|
|
263
|
-
background-color: var(--st-color-surface-muted
|
|
263
|
+
background-color: var(--st-color-surface-muted);
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
.mobile-close-btn svg {
|
|
@@ -537,7 +537,7 @@ export class StPageLayout extends LitElement {
|
|
|
537
537
|
height: 100vh;
|
|
538
538
|
background: var(--layout-bg-color);
|
|
539
539
|
z-index: 1001;
|
|
540
|
-
box-shadow:
|
|
540
|
+
box-shadow: var(--st-shadow-drawer);
|
|
541
541
|
transform: translateX(-100%);
|
|
542
542
|
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
543
543
|
display: flex !important;
|