@sondor-technology/sondor-components 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/accordion.constants.d.ts +5 -0
- package/dist/components/accordion/accordion.constants.d.ts.map +1 -0
- package/dist/components/accordion/accordion.constants.js +3 -0
- package/dist/components/accordion/accordion.constants.js.map +1 -0
- package/dist/components/accordion/accordion.d.ts +29 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.js +226 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/alert/alert.constants.d.ts +2 -0
- package/dist/components/alert/alert.constants.d.ts.map +1 -1
- package/dist/components/alert/alert.d.ts +50 -2
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +285 -16
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +20 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -0
- package/dist/components/avatar/avatar.js +100 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/back-to-top/back-to-top.d.ts +29 -0
- package/dist/components/back-to-top/back-to-top.d.ts.map +1 -0
- package/dist/components/back-to-top/back-to-top.js +149 -0
- package/dist/components/back-to-top/back-to-top.js.map +1 -0
- package/dist/components/bar-chart/bar-chart.d.ts +42 -0
- package/dist/components/bar-chart/bar-chart.d.ts.map +1 -0
- package/dist/components/bar-chart/bar-chart.js +298 -0
- package/dist/components/bar-chart/bar-chart.js.map +1 -0
- package/dist/components/breadcrumb/breadcrumb.js +2 -2
- package/dist/components/button/button.d.ts +1 -0
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +8 -8
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js +4 -4
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/calendar.js +21 -9
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/chart/chart-base.d.ts +59 -0
- package/dist/components/chart/chart-base.d.ts.map +1 -0
- package/dist/components/chart/chart-base.js +261 -0
- package/dist/components/chart/chart-base.js.map +1 -0
- package/dist/components/chart/chart.utils.d.ts +27 -0
- package/dist/components/chart/chart.utils.d.ts.map +1 -0
- package/dist/components/chart/chart.utils.js +117 -0
- package/dist/components/chart/chart.utils.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +5 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +34 -24
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/consent/consent.d.ts +63 -0
- package/dist/components/consent/consent.d.ts.map +1 -0
- package/dist/components/consent/consent.js +327 -0
- package/dist/components/consent/consent.js.map +1 -0
- package/dist/components/consent/consent.utils.d.ts +36 -0
- package/dist/components/consent/consent.utils.d.ts.map +1 -0
- package/dist/components/consent/consent.utils.js +82 -0
- package/dist/components/consent/consent.utils.js.map +1 -0
- package/dist/components/contact/contact.d.ts +22 -0
- package/dist/components/contact/contact.d.ts.map +1 -0
- package/dist/components/contact/contact.js +83 -0
- package/dist/components/contact/contact.js.map +1 -0
- package/dist/components/container/container.d.ts +20 -0
- package/dist/components/container/container.d.ts.map +1 -0
- package/dist/components/container/container.js +68 -0
- package/dist/components/container/container.js.map +1 -0
- package/dist/components/content-card/content-card.js +4 -4
- package/dist/components/context-menu/context-menu.d.ts +89 -0
- package/dist/components/context-menu/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu/context-menu.js +414 -0
- package/dist/components/context-menu/context-menu.js.map +1 -0
- package/dist/components/cron-builder/cron-builder.d.ts +5 -2
- package/dist/components/cron-builder/cron-builder.d.ts.map +1 -1
- package/dist/components/cron-builder/cron-builder.js +83 -15
- package/dist/components/cron-builder/cron-builder.js.map +1 -1
- package/dist/components/cta/cta.d.ts +20 -0
- package/dist/components/cta/cta.d.ts.map +1 -0
- package/dist/components/cta/cta.js +64 -0
- package/dist/components/cta/cta.js.map +1 -0
- package/dist/components/drawer/drawer.js +6 -6
- package/dist/components/faq/faq-item.d.ts +22 -0
- package/dist/components/faq/faq-item.d.ts.map +1 -0
- package/dist/components/faq/faq-item.js +117 -0
- package/dist/components/faq/faq-item.js.map +1 -0
- package/dist/components/faq/faq.d.ts +18 -0
- package/dist/components/faq/faq.d.ts.map +1 -0
- package/dist/components/faq/faq.js +38 -0
- package/dist/components/faq/faq.js.map +1 -0
- package/dist/components/feature-grid/feature-grid.d.ts +22 -0
- package/dist/components/feature-grid/feature-grid.d.ts.map +1 -0
- package/dist/components/feature-grid/feature-grid.js +55 -0
- package/dist/components/feature-grid/feature-grid.js.map +1 -0
- package/dist/components/feature-grid/feature.d.ts +18 -0
- package/dist/components/feature-grid/feature.d.ts.map +1 -0
- package/dist/components/feature-grid/feature.js +91 -0
- package/dist/components/feature-grid/feature.js.map +1 -0
- package/dist/components/field/field.js +2 -2
- package/dist/components/footer/footer.js +4 -4
- package/dist/components/form/form-reset.d.ts +7 -0
- package/dist/components/form/form-reset.d.ts.map +1 -0
- package/dist/components/form/form-reset.js +47 -0
- package/dist/components/form/form-reset.js.map +1 -0
- package/dist/components/form/form.d.ts +5 -0
- package/dist/components/form/form.d.ts.map +1 -1
- package/dist/components/form/form.js +17 -3
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/grid/grid.d.ts +5 -0
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +86 -4
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/heat-map/heat-map.d.ts +39 -0
- package/dist/components/heat-map/heat-map.d.ts.map +1 -0
- package/dist/components/heat-map/heat-map.js +306 -0
- package/dist/components/heat-map/heat-map.js.map +1 -0
- package/dist/components/hero/hero.d.ts +26 -0
- package/dist/components/hero/hero.d.ts.map +1 -0
- package/dist/components/hero/hero.js +132 -0
- package/dist/components/hero/hero.js.map +1 -0
- package/dist/components/icon/icon-paths.d.ts +84 -0
- package/dist/components/icon/icon-paths.d.ts.map +1 -1
- package/dist/components/icon/icon-paths.js +89 -0
- package/dist/components/icon/icon-paths.js.map +1 -1
- package/dist/components/icon/icon.d.ts +2 -0
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +10 -1
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/image/image.d.ts +31 -0
- package/dist/components/image/image.d.ts.map +1 -0
- package/dist/components/image/image.js +179 -0
- package/dist/components/image/image.js.map +1 -0
- package/dist/components/input/input.js +4 -4
- package/dist/components/lazy/lazy.d.ts +34 -0
- package/dist/components/lazy/lazy.d.ts.map +1 -0
- package/dist/components/lazy/lazy.js +104 -0
- package/dist/components/lazy/lazy.js.map +1 -0
- package/dist/components/line-chart/line-chart.d.ts +37 -0
- package/dist/components/line-chart/line-chart.d.ts.map +1 -0
- package/dist/components/line-chart/line-chart.js +271 -0
- package/dist/components/line-chart/line-chart.js.map +1 -0
- package/dist/components/list/list-item.d.ts +45 -0
- package/dist/components/list/list-item.d.ts.map +1 -0
- package/dist/components/list/list-item.js +263 -0
- package/dist/components/list/list-item.js.map +1 -0
- package/dist/components/list/list.d.ts +50 -0
- package/dist/components/list/list.d.ts.map +1 -0
- package/dist/components/list/list.js +161 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/logo-cloud/logo-cloud.d.ts +19 -0
- package/dist/components/logo-cloud/logo-cloud.d.ts.map +1 -0
- package/dist/components/logo-cloud/logo-cloud.js +66 -0
- package/dist/components/logo-cloud/logo-cloud.js.map +1 -0
- package/dist/components/modal/modal.d.ts +12 -0
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/modal/modal.js +40 -11
- package/dist/components/modal/modal.js.map +1 -1
- package/dist/components/page-layout/page-layout.js +8 -8
- package/dist/components/pagination/pagination.d.ts +15 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/pagination/pagination.js +126 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/pagination/pagination.utils.d.ts +3 -0
- package/dist/components/pagination/pagination.utils.d.ts.map +1 -0
- package/dist/components/pagination/pagination.utils.js +19 -0
- package/dist/components/pagination/pagination.utils.js.map +1 -0
- package/dist/components/pie-chart/pie-chart.d.ts +33 -0
- package/dist/components/pie-chart/pie-chart.d.ts.map +1 -0
- package/dist/components/pie-chart/pie-chart.js +233 -0
- package/dist/components/pie-chart/pie-chart.js.map +1 -0
- package/dist/components/pin-input/pin-input.js +4 -4
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +1 -3
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/post-list/post-card.d.ts +16 -0
- package/dist/components/post-list/post-card.d.ts.map +1 -0
- package/dist/components/post-list/post-card.js +22 -0
- package/dist/components/post-list/post-card.js.map +1 -0
- package/dist/components/post-list/post-list.d.ts +17 -0
- package/dist/components/post-list/post-list.d.ts.map +1 -0
- package/dist/components/post-list/post-list.js +23 -0
- package/dist/components/post-list/post-list.js.map +1 -0
- package/dist/components/pricing/pricing-tier.d.ts +23 -0
- package/dist/components/pricing/pricing-tier.d.ts.map +1 -0
- package/dist/components/pricing/pricing-tier.js +144 -0
- package/dist/components/pricing/pricing-tier.js.map +1 -0
- package/dist/components/pricing/pricing.d.ts +18 -0
- package/dist/components/pricing/pricing.d.ts.map +1 -0
- package/dist/components/pricing/pricing.js +38 -0
- package/dist/components/pricing/pricing.js.map +1 -0
- package/dist/components/progress/progress.d.ts +17 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/progress/progress.js +109 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/project-grid/project-card.d.ts +17 -0
- package/dist/components/project-grid/project-card.d.ts.map +1 -0
- package/dist/components/project-grid/project-card.js +23 -0
- package/dist/components/project-grid/project-card.js.map +1 -0
- package/dist/components/project-grid/project-grid.d.ts +17 -0
- package/dist/components/project-grid/project-grid.d.ts.map +1 -0
- package/dist/components/project-grid/project-grid.js +23 -0
- package/dist/components/project-grid/project-grid.js.map +1 -0
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/reveal/reveal.constants.d.ts +10 -0
- package/dist/components/reveal/reveal.constants.d.ts.map +1 -0
- package/dist/components/reveal/reveal.constants.js +11 -0
- package/dist/components/reveal/reveal.constants.js.map +1 -0
- package/dist/components/reveal/reveal.d.ts +64 -0
- package/dist/components/reveal/reveal.d.ts.map +1 -0
- package/dist/components/reveal/reveal.js +352 -0
- package/dist/components/reveal/reveal.js.map +1 -0
- package/dist/components/scroll-progress/scroll-progress.d.ts +32 -0
- package/dist/components/scroll-progress/scroll-progress.d.ts.map +1 -0
- package/dist/components/scroll-progress/scroll-progress.js +120 -0
- package/dist/components/scroll-progress/scroll-progress.js.map +1 -0
- package/dist/components/section/card-row.d.ts +30 -0
- package/dist/components/section/card-row.d.ts.map +1 -0
- package/dist/components/section/card-row.js +174 -0
- package/dist/components/section/card-row.js.map +1 -0
- package/dist/components/section/card.d.ts +27 -0
- package/dist/components/section/card.d.ts.map +1 -0
- package/dist/components/section/card.js +205 -0
- package/dist/components/section/card.js.map +1 -0
- package/dist/components/section/row-item.d.ts +22 -0
- package/dist/components/section/row-item.d.ts.map +1 -0
- package/dist/components/section/row-item.js +53 -0
- package/dist/components/section/row-item.js.map +1 -0
- package/dist/components/section/section.d.ts +70 -0
- package/dist/components/section/section.d.ts.map +1 -0
- package/dist/components/section/section.js +240 -0
- package/dist/components/section/section.js.map +1 -0
- package/dist/components/select/select.js +3 -3
- package/dist/components/series-nav/series-nav.d.ts +29 -0
- package/dist/components/series-nav/series-nav.d.ts.map +1 -0
- package/dist/components/series-nav/series-nav.js +178 -0
- package/dist/components/series-nav/series-nav.js.map +1 -0
- package/dist/components/site-header/site-header.d.ts +51 -0
- package/dist/components/site-header/site-header.d.ts.map +1 -0
- package/dist/components/site-header/site-header.js +296 -0
- package/dist/components/site-header/site-header.js.map +1 -0
- package/dist/components/skeleton/skeleton.js +7 -7
- package/dist/components/sparkline/sparkline.d.ts +19 -0
- package/dist/components/sparkline/sparkline.d.ts.map +1 -0
- package/dist/components/sparkline/sparkline.js +99 -0
- package/dist/components/sparkline/sparkline.js.map +1 -0
- package/dist/components/spinner/spinner.d.ts +13 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/spinner/spinner.js +65 -0
- package/dist/components/spinner/spinner.js.map +1 -0
- package/dist/components/split/split.d.ts +23 -0
- package/dist/components/split/split.d.ts.map +1 -0
- package/dist/components/split/split.js +104 -0
- package/dist/components/split/split.js.map +1 -0
- package/dist/components/stack/stack.d.ts +21 -0
- package/dist/components/stack/stack.d.ts.map +1 -0
- package/dist/components/stack/stack.js +102 -0
- package/dist/components/stack/stack.js.map +1 -0
- package/dist/components/stat-card/stat-card.d.ts +35 -0
- package/dist/components/stat-card/stat-card.d.ts.map +1 -0
- package/dist/components/stat-card/stat-card.js +199 -0
- package/dist/components/stat-card/stat-card.js.map +1 -0
- package/dist/components/stats/stat.d.ts +16 -0
- package/dist/components/stats/stat.d.ts.map +1 -0
- package/dist/components/stats/stat.js +51 -0
- package/dist/components/stats/stat.js.map +1 -0
- package/dist/components/stats/stats.d.ts +19 -0
- package/dist/components/stats/stats.d.ts.map +1 -0
- package/dist/components/stats/stats.js +45 -0
- package/dist/components/stats/stats.js.map +1 -0
- package/dist/components/switch/switch.js +2 -2
- package/dist/components/table/data-table.d.ts +115 -27
- package/dist/components/table/data-table.d.ts.map +1 -1
- package/dist/components/table/data-table.js +1012 -411
- package/dist/components/table/data-table.js.map +1 -1
- package/dist/components/table/data-table.utils.d.ts +81 -0
- package/dist/components/table/data-table.utils.d.ts.map +1 -0
- package/dist/components/table/data-table.utils.js +208 -0
- package/dist/components/table/data-table.utils.js.map +1 -0
- package/dist/components/table/table.d.ts +28 -0
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +161 -33
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/team/person.d.ts +19 -0
- package/dist/components/team/person.d.ts.map +1 -0
- package/dist/components/team/person.js +123 -0
- package/dist/components/team/person.js.map +1 -0
- package/dist/components/team/team.d.ts +18 -0
- package/dist/components/team/team.d.ts.map +1 -0
- package/dist/components/team/team.js +36 -0
- package/dist/components/team/team.js.map +1 -0
- package/dist/components/testimonials/testimonial.d.ts +18 -0
- package/dist/components/testimonials/testimonial.d.ts.map +1 -0
- package/dist/components/testimonials/testimonial.js +115 -0
- package/dist/components/testimonials/testimonial.js.map +1 -0
- package/dist/components/testimonials/testimonials.d.ts +18 -0
- package/dist/components/testimonials/testimonials.d.ts.map +1 -0
- package/dist/components/testimonials/testimonials.js +36 -0
- package/dist/components/testimonials/testimonials.js.map +1 -0
- package/dist/components/textarea/textarea.js +3 -3
- package/dist/components/theme-toggle/theme-toggle.js +1 -1
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/time-picker/time-picker.js +13 -3
- package/dist/components/time-picker/time-picker.js.map +1 -1
- package/dist/components/timeline/timeline-item.d.ts +18 -0
- package/dist/components/timeline/timeline-item.d.ts.map +1 -0
- package/dist/components/timeline/timeline-item.js +102 -0
- package/dist/components/timeline/timeline-item.js.map +1 -0
- package/dist/components/timeline/timeline.d.ts +18 -0
- package/dist/components/timeline/timeline.d.ts.map +1 -0
- package/dist/components/timeline/timeline.js +30 -0
- package/dist/components/timeline/timeline.js.map +1 -0
- package/dist/components/toast/toast.d.ts +33 -0
- package/dist/components/toast/toast.d.ts.map +1 -0
- package/dist/components/toast/toast.js +147 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/toggle-group/toggle-button.d.ts +2 -0
- package/dist/components/toggle-group/toggle-button.d.ts.map +1 -1
- package/dist/components/toggle-group/toggle-button.js +12 -5
- package/dist/components/toggle-group/toggle-button.js.map +1 -1
- package/dist/components/toggle-group/toggle-group.d.ts +6 -0
- package/dist/components/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group/toggle-group.js +141 -21
- package/dist/components/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +21 -21
- package/dist/components/vertical-nav/vertical-nav-group.js +3 -3
- package/dist/components/vertical-nav/vertical-nav-item.js +4 -4
- package/dist/components/video-embed/video-embed.d.ts +37 -0
- package/dist/components/video-embed/video-embed.d.ts.map +1 -0
- package/dist/components/video-embed/video-embed.js +183 -0
- package/dist/components/video-embed/video-embed.js.map +1 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/index.css +205 -1
- package/dist/styles/reset.d.ts.map +1 -1
- package/dist/styles/reset.js +5 -0
- package/dist/styles/reset.js.map +1 -1
- package/package.json +214 -7
- package/src/components/accordion/accordion.constants.ts +5 -0
- package/src/components/accordion/accordion.ts +209 -0
- package/src/components/alert/alert.constants.ts +3 -0
- package/src/components/alert/alert.ts +284 -17
- package/src/components/avatar/avatar.ts +84 -0
- package/src/components/back-to-top/back-to-top.ts +140 -0
- package/src/components/bar-chart/bar-chart.ts +295 -0
- package/src/components/breadcrumb/breadcrumb.ts +2 -2
- package/src/components/button/button.ts +9 -8
- package/src/components/button-group/button-group.ts +4 -4
- package/src/components/calendar/calendar.ts +26 -9
- package/src/components/chart/chart-base.ts +275 -0
- package/src/components/chart/chart.utils.ts +140 -0
- package/src/components/code-block/code-block.ts +35 -24
- package/src/components/consent/consent.ts +312 -0
- package/src/components/consent/consent.utils.ts +110 -0
- package/src/components/contact/contact.ts +83 -0
- package/src/components/container/container.ts +60 -0
- package/src/components/content-card/content-card.ts +4 -4
- package/src/components/context-menu/context-menu.ts +426 -0
- package/src/components/cron-builder/cron-builder.ts +102 -22
- package/src/components/cta/cta.ts +64 -0
- package/src/components/drawer/drawer.ts +6 -6
- package/src/components/faq/faq-item.ts +110 -0
- package/src/components/faq/faq.ts +40 -0
- package/src/components/feature-grid/feature-grid.ts +52 -0
- package/src/components/feature-grid/feature.ts +84 -0
- package/src/components/field/field.ts +2 -2
- package/src/components/footer/footer.ts +4 -4
- package/src/components/form/form-reset.ts +45 -0
- package/src/components/form/form.ts +17 -3
- package/src/components/grid/grid.ts +73 -4
- package/src/components/heat-map/heat-map.ts +292 -0
- package/src/components/hero/hero.ts +132 -0
- package/src/components/icon/icon-paths.ts +92 -1
- package/src/components/icon/icon.ts +8 -1
- package/src/components/image/image.ts +165 -0
- package/src/components/input/input.ts +4 -4
- package/src/components/lazy/lazy.ts +94 -0
- package/src/components/line-chart/line-chart.ts +271 -0
- package/src/components/list/list-item.ts +225 -0
- package/src/components/list/list.ts +157 -0
- package/src/components/logo-cloud/logo-cloud.ts +65 -0
- package/src/components/modal/modal.ts +37 -11
- package/src/components/page-layout/page-layout.ts +8 -8
- package/src/components/pagination/pagination.ts +120 -0
- package/src/components/pagination/pagination.utils.ts +14 -0
- package/src/components/pie-chart/pie-chart.ts +230 -0
- package/src/components/pin-input/pin-input.ts +4 -4
- package/src/components/popover/popover.ts +1 -3
- package/src/components/post-list/post-card.ts +18 -0
- package/src/components/post-list/post-list.ts +19 -0
- package/src/components/pricing/pricing-tier.ts +132 -0
- package/src/components/pricing/pricing.ts +39 -0
- package/src/components/progress/progress.ts +95 -0
- package/src/components/project-grid/project-card.ts +19 -0
- package/src/components/project-grid/project-grid.ts +19 -0
- package/src/components/radio/radio.ts +1 -1
- package/src/components/reveal/reveal.constants.ts +20 -0
- package/src/components/reveal/reveal.ts +344 -0
- package/src/components/scroll-progress/scroll-progress.ts +119 -0
- package/src/components/section/card-row.ts +152 -0
- package/src/components/section/card.ts +197 -0
- package/src/components/section/row-item.ts +38 -0
- package/src/components/section/section.ts +232 -0
- package/src/components/select/select.ts +3 -3
- package/src/components/series-nav/series-nav.ts +164 -0
- package/src/components/site-header/site-header.ts +276 -0
- package/src/components/skeleton/skeleton.ts +7 -7
- package/src/components/sparkline/sparkline.ts +83 -0
- package/src/components/spinner/spinner.ts +55 -0
- package/src/components/split/split.ts +106 -0
- package/src/components/stack/stack.ts +88 -0
- package/src/components/stat-card/stat-card.ts +179 -0
- package/src/components/stats/stat.ts +49 -0
- package/src/components/stats/stats.ts +47 -0
- package/src/components/switch/switch.ts +2 -2
- package/src/components/table/data-table.ts +1015 -425
- package/src/components/table/data-table.utils.ts +276 -0
- package/src/components/table/table.ts +168 -38
- package/src/components/team/person.ts +113 -0
- package/src/components/team/team.ts +37 -0
- package/src/components/testimonials/testimonial.ts +108 -0
- package/src/components/testimonials/testimonials.ts +37 -0
- package/src/components/textarea/textarea.ts +3 -3
- package/src/components/theme-toggle/theme-toggle.ts +1 -1
- package/src/components/time-picker/time-picker.ts +17 -3
- package/src/components/timeline/timeline-item.ts +100 -0
- package/src/components/timeline/timeline.ts +31 -0
- package/src/components/toast/toast.ts +153 -0
- package/src/components/toggle-group/toggle-button.ts +9 -5
- package/src/components/toggle-group/toggle-group.ts +158 -42
- package/src/components/tooltip/tooltip.ts +21 -21
- package/src/components/vertical-nav/vertical-nav-group.ts +3 -3
- package/src/components/vertical-nav/vertical-nav-item.ts +4 -4
- package/src/components/video-embed/video-embed.ts +162 -0
- package/src/index.ts +108 -0
- package/src/styles/globals.css +63 -0
- package/src/styles/index.css +3 -1
- package/src/styles/prose.css +154 -0
- package/src/styles/reset.ts +5 -0
- package/src/styles/theme.css +53 -0
- package/src/styles/typography.css +1 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import {LitElement, html, css, nothing, PropertyValues} from "lit";
|
|
2
|
+
import {customElement, property, state} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
|
+
import "../button/button.js";
|
|
5
|
+
import "../switch/switch.js";
|
|
6
|
+
import {
|
|
7
|
+
ConsentCategory,
|
|
8
|
+
ConsentChoices,
|
|
9
|
+
ConsentRecord,
|
|
10
|
+
DEFAULT_CATEGORIES,
|
|
11
|
+
DEFAULT_STORAGE_KEY,
|
|
12
|
+
choicesFor,
|
|
13
|
+
isRecordValid,
|
|
14
|
+
normaliseChoices,
|
|
15
|
+
readRecord,
|
|
16
|
+
writeRecord,
|
|
17
|
+
} from "./consent.utils.js";
|
|
18
|
+
|
|
19
|
+
export type ConsentSource = "accept-all" | "reject-all" | "custom";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A cookie and tracking consent banner. Visitors can accept all, reject all, or choose by
|
|
23
|
+
* category. Accept and reject are shown as equals, nothing is pre-selected, and the choice can be
|
|
24
|
+
* changed later from any element carrying a `data-consent-open` attribute (such as a footer link).
|
|
25
|
+
*
|
|
26
|
+
* It does not load or block scripts itself. Listen for the events, or call `getConsent()`, and
|
|
27
|
+
* only start analytics or marketing tools the visitor has allowed.
|
|
28
|
+
*
|
|
29
|
+
* Slots: default (the message shown on the banner).
|
|
30
|
+
* Events:
|
|
31
|
+
* - `st-consent-ready` `{choices}`: a valid saved choice was found on load.
|
|
32
|
+
* - `st-consent-change` `{choices, source}`: the visitor made a choice.
|
|
33
|
+
*/
|
|
34
|
+
@customElement("st-consent")
|
|
35
|
+
export class StConsent extends LitElement {
|
|
36
|
+
@property({type: Array}) categories: ConsentCategory[] = DEFAULT_CATEGORIES;
|
|
37
|
+
@property({type: String, attribute: "storage-key"}) storageKey = DEFAULT_STORAGE_KEY;
|
|
38
|
+
/** Change this when what you collect changes, to ask every visitor again. */
|
|
39
|
+
@property({type: String}) version = "1";
|
|
40
|
+
/** How long a choice is remembered, in days. */
|
|
41
|
+
@property({type: Number, attribute: "expires-days"}) expiresDays = 180;
|
|
42
|
+
@property({type: String}) heading = "Your privacy choices";
|
|
43
|
+
@property({type: String, attribute: "policy-href"}) policyHref = "";
|
|
44
|
+
@property({type: String, attribute: "policy-label"}) policyLabel = "Read our cookie policy";
|
|
45
|
+
@property({type: String, attribute: "accept-label"}) acceptLabel = "Accept all";
|
|
46
|
+
@property({type: String, attribute: "reject-label"}) rejectLabel = "Reject all";
|
|
47
|
+
@property({type: String, attribute: "customise-label"}) customiseLabel = "Customise";
|
|
48
|
+
@property({type: String, attribute: "save-label"}) saveLabel = "Save choices";
|
|
49
|
+
|
|
50
|
+
@state() private _open = false;
|
|
51
|
+
@state() private _view: "summary" | "preferences" = "summary";
|
|
52
|
+
@state() private _draft: ConsentChoices = {};
|
|
53
|
+
@state() private _record: ConsentRecord | null = null;
|
|
54
|
+
|
|
55
|
+
static styles = [
|
|
56
|
+
resetStyles,
|
|
57
|
+
css`
|
|
58
|
+
:host {
|
|
59
|
+
position: fixed;
|
|
60
|
+
inset: auto 0 0 0;
|
|
61
|
+
z-index: var(--st-consent-z, 1000);
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
padding: var(--st-spacing-md);
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.panel {
|
|
69
|
+
pointer-events: auto;
|
|
70
|
+
width: 100%;
|
|
71
|
+
max-width: 40rem;
|
|
72
|
+
max-height: calc(100dvh - 2 * var(--st-spacing-md));
|
|
73
|
+
overflow-y: auto;
|
|
74
|
+
padding: var(--st-spacing-lg);
|
|
75
|
+
border: 1px solid var(--st-color-border);
|
|
76
|
+
border-radius: var(--st-radius-lg);
|
|
77
|
+
background: var(--st-color-surface);
|
|
78
|
+
color: var(--st-color-text);
|
|
79
|
+
box-shadow: var(--st-shadow-xl);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
h2 {
|
|
83
|
+
margin: 0 0 var(--st-spacing-sm);
|
|
84
|
+
font-size: var(--st-font-size-lg);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
h2:focus {
|
|
88
|
+
outline: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.message {
|
|
92
|
+
margin: 0 0 var(--st-spacing-md);
|
|
93
|
+
color: var(--st-color-text-muted);
|
|
94
|
+
font-size: var(--st-font-size-sm);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.message a,
|
|
98
|
+
.policy {
|
|
99
|
+
color: var(--st-color-primary-text);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.actions {
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-wrap: wrap;
|
|
105
|
+
gap: var(--st-spacing-sm);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Accept and reject share one width so neither is easier to press. */
|
|
109
|
+
.actions .decision {
|
|
110
|
+
flex: 1 1 8rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.categories {
|
|
114
|
+
display: grid;
|
|
115
|
+
gap: var(--st-spacing-md);
|
|
116
|
+
margin: 0 0 var(--st-spacing-md);
|
|
117
|
+
padding: 0;
|
|
118
|
+
list-style: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.category {
|
|
122
|
+
padding-bottom: var(--st-spacing-md);
|
|
123
|
+
border-bottom: 1px solid var(--st-color-border);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.category p {
|
|
127
|
+
margin: var(--st-spacing-xs) 0 0;
|
|
128
|
+
color: var(--st-color-text-muted);
|
|
129
|
+
font-size: var(--st-font-size-sm);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.required {
|
|
133
|
+
color: var(--st-color-text-muted);
|
|
134
|
+
font-size: var(--st-font-size-sm);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[hidden] {
|
|
138
|
+
display: none !important;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@media print {
|
|
142
|
+
:host {
|
|
143
|
+
display: none;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
`,
|
|
147
|
+
];
|
|
148
|
+
|
|
149
|
+
/** The saved choices, or null until the visitor has chosen. */
|
|
150
|
+
get choices(): ConsentChoices | null {
|
|
151
|
+
return this._record?.choices ?? null;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Whether the visitor allowed a category. False until they choose. */
|
|
155
|
+
allows(id: string): boolean {
|
|
156
|
+
return this._record?.choices[id] === true;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
connectedCallback() {
|
|
160
|
+
super.connectedCallback();
|
|
161
|
+
document.addEventListener("click", this._onDocumentClick);
|
|
162
|
+
document.addEventListener("keydown", this._onKeydown);
|
|
163
|
+
this._load();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
disconnectedCallback() {
|
|
167
|
+
document.removeEventListener("click", this._onDocumentClick);
|
|
168
|
+
document.removeEventListener("keydown", this._onKeydown);
|
|
169
|
+
super.disconnectedCallback();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
protected willUpdate(changed: PropertyValues<this>) {
|
|
173
|
+
// Never leave the visitor with a stale choice when the categories or version change.
|
|
174
|
+
if (this.hasUpdated && (changed.has("categories") || changed.has("version"))) this._load();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Opens the preferences so the visitor can review or change their choice. */
|
|
178
|
+
open() {
|
|
179
|
+
this._draft = normaliseChoices(this.categories, this._record?.choices ?? {});
|
|
180
|
+
this._view = "preferences";
|
|
181
|
+
this._open = true;
|
|
182
|
+
void this.updateComplete.then(() => this.renderRoot.querySelector<HTMLElement>("h2")?.focus());
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
acceptAll() {
|
|
186
|
+
this._commit(choicesFor(this.categories, true), "accept-all");
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
rejectAll() {
|
|
190
|
+
this._commit(choicesFor(this.categories, false), "reject-all");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// ------------------------------------------------------------------ storage
|
|
194
|
+
|
|
195
|
+
private _load() {
|
|
196
|
+
const record = readRecord(this.storageKey);
|
|
197
|
+
if (isRecordValid(record, this.version, this.categories, this.expiresDays)) {
|
|
198
|
+
this._record = record;
|
|
199
|
+
this._open = false;
|
|
200
|
+
this.dispatchEvent(
|
|
201
|
+
new CustomEvent("st-consent-ready", {detail: {choices: record.choices}, bubbles: true, composed: true}),
|
|
202
|
+
);
|
|
203
|
+
} else {
|
|
204
|
+
this._record = null;
|
|
205
|
+
this._view = "summary";
|
|
206
|
+
this._open = true;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
private _commit(choices: ConsentChoices, source: ConsentSource) {
|
|
211
|
+
const normalised = normaliseChoices(this.categories, choices);
|
|
212
|
+
this._record = {version: this.version, savedAt: Date.now(), choices: normalised};
|
|
213
|
+
writeRecord(this._record, this.storageKey);
|
|
214
|
+
this._open = false;
|
|
215
|
+
this._view = "summary";
|
|
216
|
+
this.dispatchEvent(
|
|
217
|
+
new CustomEvent("st-consent-change", {detail: {choices: normalised, source}, bubbles: true, composed: true}),
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// ------------------------------------------------------------------- events
|
|
222
|
+
|
|
223
|
+
private _onDocumentClick = (e: MouseEvent) => {
|
|
224
|
+
const trigger = e.composedPath().find((el) => el instanceof Element && el.hasAttribute("data-consent-open"));
|
|
225
|
+
if (!trigger) return;
|
|
226
|
+
e.preventDefault();
|
|
227
|
+
this.open();
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
private _onKeydown = (e: KeyboardEvent) => {
|
|
231
|
+
// Escape only dismisses a reopened panel: a first-time visitor must still choose.
|
|
232
|
+
if (e.key === "Escape" && this._open && this._record) this._open = false;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
private _toggle(id: string, on: boolean) {
|
|
236
|
+
this._draft = {...this._draft, [id]: on};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// ------------------------------------------------------------------- render
|
|
240
|
+
|
|
241
|
+
private _renderSummary() {
|
|
242
|
+
return html`
|
|
243
|
+
<h2 id="consent-title" tabindex="-1">${this.heading}</h2>
|
|
244
|
+
<p class="message">
|
|
245
|
+
<slot>
|
|
246
|
+
We use cookies to make this site work and, with your permission, to understand how it is
|
|
247
|
+
used. You can accept everything, reject everything, or choose.
|
|
248
|
+
</slot>
|
|
249
|
+
${this.policyHref
|
|
250
|
+
? html` <a class="policy" href=${this.policyHref}>${this.policyLabel}</a>`
|
|
251
|
+
: nothing}
|
|
252
|
+
</p>
|
|
253
|
+
<div class="actions">
|
|
254
|
+
<st-button class="decision" block color="primary" @click=${this.acceptAll}>${this.acceptLabel}</st-button>
|
|
255
|
+
<st-button class="decision" block color="primary" @click=${this.rejectAll}>${this.rejectLabel}</st-button>
|
|
256
|
+
<st-button variant="secondary" @click=${() => this.open()}>${this.customiseLabel}</st-button>
|
|
257
|
+
</div>
|
|
258
|
+
`;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
private _renderPreferences() {
|
|
262
|
+
return html`
|
|
263
|
+
<h2 id="consent-title" tabindex="-1">${this.heading}</h2>
|
|
264
|
+
<ul class="categories">
|
|
265
|
+
${this.categories.map(
|
|
266
|
+
(category) => html`
|
|
267
|
+
<li class="category">
|
|
268
|
+
${category.required
|
|
269
|
+
? html`<strong>${category.label}</strong> <span class="required">Always on</span>`
|
|
270
|
+
: html`
|
|
271
|
+
<st-switch
|
|
272
|
+
.checked=${this._draft[category.id] === true}
|
|
273
|
+
@change=${(e: Event) => this._toggle(category.id, (e.target as HTMLInputElement).checked)}
|
|
274
|
+
>
|
|
275
|
+
${category.label}
|
|
276
|
+
</st-switch>
|
|
277
|
+
`}
|
|
278
|
+
${category.description ? html`<p>${category.description}</p>` : nothing}
|
|
279
|
+
</li>
|
|
280
|
+
`,
|
|
281
|
+
)}
|
|
282
|
+
</ul>
|
|
283
|
+
<div class="actions">
|
|
284
|
+
<st-button class="decision" block color="primary" @click=${() => this._commit(this._draft, "custom")}>
|
|
285
|
+
${this.saveLabel}
|
|
286
|
+
</st-button>
|
|
287
|
+
<st-button class="decision" block color="primary" @click=${this.acceptAll}>${this.acceptLabel}</st-button>
|
|
288
|
+
<st-button class="decision" block color="primary" @click=${this.rejectAll}>${this.rejectLabel}</st-button>
|
|
289
|
+
</div>
|
|
290
|
+
`;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
render() {
|
|
294
|
+
return html`
|
|
295
|
+
<div
|
|
296
|
+
class="panel"
|
|
297
|
+
role="dialog"
|
|
298
|
+
aria-modal="false"
|
|
299
|
+
aria-labelledby="consent-title"
|
|
300
|
+
?hidden=${!this._open}
|
|
301
|
+
>
|
|
302
|
+
${this._view === "preferences" ? this._renderPreferences() : this._renderSummary()}
|
|
303
|
+
</div>
|
|
304
|
+
`;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
declare global {
|
|
309
|
+
interface HTMLElementTagNameMap {
|
|
310
|
+
"st-consent": StConsent;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/** Cookie and storage consent: the record kept, and how it is read and written. */
|
|
2
|
+
|
|
3
|
+
export interface ConsentCategory {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Always on and not switchable, for things the site cannot work without. */
|
|
8
|
+
required?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type ConsentChoices = Record<string, boolean>;
|
|
12
|
+
|
|
13
|
+
export interface ConsentRecord {
|
|
14
|
+
/** Increase your `version` when what you collect changes, to ask everyone again. */
|
|
15
|
+
version: string;
|
|
16
|
+
/** Milliseconds since the epoch when the choice was made. */
|
|
17
|
+
savedAt: number;
|
|
18
|
+
choices: ConsentChoices;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const DEFAULT_STORAGE_KEY = "st-consent";
|
|
22
|
+
export const DEFAULT_CATEGORIES: ConsentCategory[] = [
|
|
23
|
+
{
|
|
24
|
+
id: "necessary",
|
|
25
|
+
label: "Necessary",
|
|
26
|
+
description: "Needed for the site to work. These cannot be switched off.",
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
{id: "analytics", label: "Analytics", description: "Help us understand how the site is used."},
|
|
30
|
+
{id: "marketing", label: "Marketing", description: "Used to show relevant content and measure campaigns."},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const DAY_MS = 86_400_000;
|
|
34
|
+
|
|
35
|
+
/** Every category set to the same answer; required categories are always on. */
|
|
36
|
+
export function choicesFor(categories: ConsentCategory[], value: boolean): ConsentChoices {
|
|
37
|
+
return Object.fromEntries(categories.map((c) => [c.id, c.required ? true : value]));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Keeps only known categories, forces required ones on, and treats anything missing as off. */
|
|
41
|
+
export function normaliseChoices(categories: ConsentCategory[], choices: ConsentChoices): ConsentChoices {
|
|
42
|
+
return Object.fromEntries(categories.map((c) => [c.id, c.required ? true : choices[c.id] === true]));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** True when a stored record is current: same version, not expired, covers every category. */
|
|
46
|
+
export function isRecordValid(
|
|
47
|
+
record: ConsentRecord | null,
|
|
48
|
+
version: string,
|
|
49
|
+
categories: ConsentCategory[],
|
|
50
|
+
expiresDays: number,
|
|
51
|
+
now = Date.now(),
|
|
52
|
+
): record is ConsentRecord {
|
|
53
|
+
if (!record || record.version !== version) return false;
|
|
54
|
+
if (now - record.savedAt > expiresDays * DAY_MS) return false;
|
|
55
|
+
return categories.every((c) => typeof record.choices?.[c.id] === "boolean");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function parseRecord(raw: string | null): ConsentRecord | null {
|
|
59
|
+
if (!raw) return null;
|
|
60
|
+
try {
|
|
61
|
+
const value = JSON.parse(raw);
|
|
62
|
+
if (
|
|
63
|
+
value &&
|
|
64
|
+
typeof value.version === "string" &&
|
|
65
|
+
typeof value.savedAt === "number" &&
|
|
66
|
+
value.choices &&
|
|
67
|
+
typeof value.choices === "object"
|
|
68
|
+
) {
|
|
69
|
+
return value as ConsentRecord;
|
|
70
|
+
}
|
|
71
|
+
} catch {
|
|
72
|
+
// Fall through: a corrupt record is the same as no record.
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function readRecord(key = DEFAULT_STORAGE_KEY): ConsentRecord | null {
|
|
78
|
+
try {
|
|
79
|
+
return parseRecord(window.localStorage.getItem(key));
|
|
80
|
+
} catch {
|
|
81
|
+
return null; // storage can be blocked
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function writeRecord(record: ConsentRecord, key = DEFAULT_STORAGE_KEY): boolean {
|
|
86
|
+
try {
|
|
87
|
+
window.localStorage.setItem(key, JSON.stringify(record));
|
|
88
|
+
return true;
|
|
89
|
+
} catch {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function clearRecord(key = DEFAULT_STORAGE_KEY) {
|
|
95
|
+
try {
|
|
96
|
+
window.localStorage.removeItem(key);
|
|
97
|
+
} catch {
|
|
98
|
+
// ignore
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The visitor's saved choices, or null if they have not chosen yet. Use it to decide whether to
|
|
104
|
+
* load an analytics script:
|
|
105
|
+
*
|
|
106
|
+
* if (getConsent()?.analytics) loadAnalytics();
|
|
107
|
+
*/
|
|
108
|
+
export function getConsent(key = DEFAULT_STORAGE_KEY): ConsentChoices | null {
|
|
109
|
+
return readRecord(key)?.choices ?? null;
|
|
110
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {html, css} from "lit";
|
|
2
|
+
import {customElement, property} from "lit/decorators.js";
|
|
3
|
+
import {StSection} from "../section/section.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A "get in touch" row: your contact details beside a form. The columns stack on narrow screens,
|
|
7
|
+
* details first. The row only lays things out: the form is yours, so it can post wherever you
|
|
8
|
+
* choose.
|
|
9
|
+
*
|
|
10
|
+
* Slots: `eyebrow`, `title`, `lead`, the default slot (addresses, email, opening hours) and
|
|
11
|
+
* `form` (usually an `st-form`).
|
|
12
|
+
*/
|
|
13
|
+
@customElement("st-contact")
|
|
14
|
+
export class StContact extends StSection {
|
|
15
|
+
/** Puts the form on the left on wide screens. */
|
|
16
|
+
@property({type: Boolean, reflect: true}) reverse = false;
|
|
17
|
+
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.align = "start";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static styles = [
|
|
24
|
+
...StSection.styles,
|
|
25
|
+
css`
|
|
26
|
+
.contact {
|
|
27
|
+
display: grid;
|
|
28
|
+
gap: var(--st-spacing-2xl);
|
|
29
|
+
align-items: start;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (min-width: 52rem) {
|
|
33
|
+
.contact {
|
|
34
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([reverse]) .form {
|
|
38
|
+
order: -1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.header {
|
|
43
|
+
margin-bottom: var(--st-spacing-lg);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.details {
|
|
47
|
+
color: var(--st-color-text-muted);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.details ::slotted(*) {
|
|
51
|
+
margin: 0 0 var(--st-spacing-md);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.form {
|
|
55
|
+
padding: var(--st-spacing-lg);
|
|
56
|
+
border: 1px solid var(--st-color-border);
|
|
57
|
+
border-radius: var(--st-radius-lg);
|
|
58
|
+
background: var(--st-row-card-bg, var(--st-color-surface));
|
|
59
|
+
}
|
|
60
|
+
`,
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
render() {
|
|
64
|
+
return this.frame(
|
|
65
|
+
html`
|
|
66
|
+
<div class="contact">
|
|
67
|
+
<div class="text">
|
|
68
|
+
${this.renderHeader()}
|
|
69
|
+
${this.animateIn(html`<div class="details"><slot @slotchange=${this._onItemsChange}></slot></div>`, 100)}
|
|
70
|
+
</div>
|
|
71
|
+
<div class="form">${this.animateIn(html`<slot name="form"></slot>`, 150)}</div>
|
|
72
|
+
</div>
|
|
73
|
+
`,
|
|
74
|
+
{header: false, animated: false},
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare global {
|
|
80
|
+
interface HTMLElementTagNameMap {
|
|
81
|
+
"st-contact": StContact;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {LitElement, html, css} from "lit";
|
|
2
|
+
import {customElement, property} from "lit/decorators.js";
|
|
3
|
+
import {resetStyles} from "../../styles/reset.js";
|
|
4
|
+
|
|
5
|
+
export const containerSizes = ["sm", "md", "lg", "xl", "full"] as const;
|
|
6
|
+
export type ContainerSize = (typeof containerSizes)[number];
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Centres content and limits its line length, with side padding that grows with the screen.
|
|
10
|
+
* Use `size` to pick the maximum width; `full` removes the limit. Set `flush` to drop the side
|
|
11
|
+
* padding (for example to let an image touch the screen edges).
|
|
12
|
+
*/
|
|
13
|
+
@customElement("st-container")
|
|
14
|
+
export class StContainer extends LitElement {
|
|
15
|
+
@property({type: String, reflect: true}) size: ContainerSize = "lg";
|
|
16
|
+
@property({type: Boolean, reflect: true}) flush = false;
|
|
17
|
+
|
|
18
|
+
static styles = [
|
|
19
|
+
resetStyles,
|
|
20
|
+
css`
|
|
21
|
+
:host {
|
|
22
|
+
display: block;
|
|
23
|
+
width: 100%;
|
|
24
|
+
max-width: var(--_max, var(--st-container-lg));
|
|
25
|
+
margin-inline: auto;
|
|
26
|
+
padding-inline: var(--st-gutter);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([flush]) {
|
|
30
|
+
padding-inline: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host([size="sm"]) {
|
|
34
|
+
--_max: var(--st-container-sm);
|
|
35
|
+
}
|
|
36
|
+
:host([size="md"]) {
|
|
37
|
+
--_max: var(--st-container-md);
|
|
38
|
+
}
|
|
39
|
+
:host([size="lg"]) {
|
|
40
|
+
--_max: var(--st-container-lg);
|
|
41
|
+
}
|
|
42
|
+
:host([size="xl"]) {
|
|
43
|
+
--_max: var(--st-container-xl);
|
|
44
|
+
}
|
|
45
|
+
:host([size="full"]) {
|
|
46
|
+
--_max: none;
|
|
47
|
+
}
|
|
48
|
+
`,
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
render() {
|
|
52
|
+
return html`<slot></slot>`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare global {
|
|
57
|
+
interface HTMLElementTagNameMap {
|
|
58
|
+
"st-container": StContainer;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -22,7 +22,7 @@ export class StContentCard extends LitElement {
|
|
|
22
22
|
height: 100%;
|
|
23
23
|
background-color: var(--st-color-surface);
|
|
24
24
|
border: 1px solid var(--st-color-border);
|
|
25
|
-
border-radius: var(--st-radius-md
|
|
25
|
+
border-radius: var(--st-radius-md);
|
|
26
26
|
overflow: hidden;
|
|
27
27
|
text-decoration: none;
|
|
28
28
|
color: inherit;
|
|
@@ -45,7 +45,7 @@ export class StContentCard extends LitElement {
|
|
|
45
45
|
Safari fix: WebKit ignores :host-context.
|
|
46
46
|
Set --st-card-shadow-hover in your global dark mode CSS instead!
|
|
47
47
|
*/
|
|
48
|
-
box-shadow: var(--st-card-shadow-hover,
|
|
48
|
+
box-shadow: var(--st-card-shadow-hover, var(--st-shadow-md));
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/* ==========================================================
|
|
@@ -76,8 +76,8 @@ export class StContentCard extends LitElement {
|
|
|
76
76
|
.content {
|
|
77
77
|
display: flex;
|
|
78
78
|
flex-direction: column;
|
|
79
|
-
padding: var(--st-spacing-md
|
|
80
|
-
gap: var(--st-spacing-sm
|
|
79
|
+
padding: var(--st-spacing-md);
|
|
80
|
+
gap: var(--st-spacing-sm);
|
|
81
81
|
flex: 1;
|
|
82
82
|
}
|
|
83
83
|
|