@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,275 @@
|
|
|
1
|
+
import {LitElement, html, css, nothing} from "lit";
|
|
2
|
+
import {property, state} from "lit/decorators.js";
|
|
3
|
+
import {formatCompact, formatValue} from "./chart.utils.js";
|
|
4
|
+
|
|
5
|
+
export interface ChartSeries {
|
|
6
|
+
name: string;
|
|
7
|
+
data: (number | null)[];
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface TooltipRow {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
color?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface TooltipState {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
title?: string;
|
|
21
|
+
rows: TooltipRow[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface LegendItem {
|
|
25
|
+
name: string;
|
|
26
|
+
color: string;
|
|
27
|
+
hidden: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Shared behavior for the dashboard charts: responsive width, tooltip, legend toggling,
|
|
32
|
+
* screen-reader announcements and a visually hidden data table fallback.
|
|
33
|
+
*
|
|
34
|
+
* Events (all bubble and are composed):
|
|
35
|
+
* - `st-chart-hover` fires when the pointer or keyboard focus moves to a datum.
|
|
36
|
+
* - `st-chart-leave` fires when the active datum is cleared.
|
|
37
|
+
* - `st-chart-select` fires when a datum is selected/deselected (requires `selectable`).
|
|
38
|
+
* - `st-chart-legend-toggle` fires when a legend entry is shown/hidden.
|
|
39
|
+
*/
|
|
40
|
+
export abstract class StChartBase extends LitElement {
|
|
41
|
+
@property({type: Number}) height = 300;
|
|
42
|
+
/** Accessible name describing the chart. */
|
|
43
|
+
@property({type: String}) label = "";
|
|
44
|
+
@property({type: Boolean, reflect: true}) selectable = false;
|
|
45
|
+
@property({type: Boolean, attribute: "hide-legend"}) hideLegend = false;
|
|
46
|
+
/** Formats values in tooltips and on axes. Defaults to locale-aware numbers. */
|
|
47
|
+
@property({attribute: false}) valueFormatter?: (value: number) => string;
|
|
48
|
+
|
|
49
|
+
@state() protected _width = 0;
|
|
50
|
+
@state() protected _tooltip: TooltipState | null = null;
|
|
51
|
+
@state() protected _announce = "";
|
|
52
|
+
|
|
53
|
+
private _resizeObserver?: ResizeObserver;
|
|
54
|
+
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
super.connectedCallback();
|
|
57
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
58
|
+
const width = Math.floor(entries[0].contentRect.width);
|
|
59
|
+
if (width !== this._width) this._width = width;
|
|
60
|
+
});
|
|
61
|
+
this._resizeObserver.observe(this);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
disconnectedCallback() {
|
|
65
|
+
super.disconnectedCallback();
|
|
66
|
+
this._resizeObserver?.disconnect();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
protected fmt(value: number) {
|
|
70
|
+
return this.valueFormatter ? this.valueFormatter(value) : formatValue(value);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
protected fmtAxis(value: number) {
|
|
74
|
+
return this.valueFormatter ? this.valueFormatter(value) : formatCompact(value);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
protected emit(name: string, detail: unknown) {
|
|
78
|
+
this.dispatchEvent(new CustomEvent(name, {detail, bubbles: true, composed: true}));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
protected showTooltip(tooltip: TooltipState, announcement: string) {
|
|
82
|
+
this._tooltip = {...tooltip, x: Math.min(Math.max(tooltip.x, 56), this._width - 56)};
|
|
83
|
+
this._announce = announcement;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
protected hideTooltip() {
|
|
87
|
+
this._tooltip = null;
|
|
88
|
+
this._announce = "";
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
protected renderTooltip() {
|
|
92
|
+
const t = this._tooltip;
|
|
93
|
+
if (!t) return nothing;
|
|
94
|
+
return html`
|
|
95
|
+
<div class="tooltip" aria-hidden="true" style="left:${t.x}px;top:${t.y}px">
|
|
96
|
+
${t.title ? html`<div class="tooltip-title">${t.title}</div>` : nothing}
|
|
97
|
+
${t.rows.map(
|
|
98
|
+
(r) => html`
|
|
99
|
+
<div class="tooltip-row">
|
|
100
|
+
${r.color
|
|
101
|
+
? html`<span class="swatch" style="background:${r.color}"></span>`
|
|
102
|
+
: nothing}
|
|
103
|
+
<span>${r.label}</span>
|
|
104
|
+
<span class="tooltip-value">${r.value}</span>
|
|
105
|
+
</div>
|
|
106
|
+
`,
|
|
107
|
+
)}
|
|
108
|
+
</div>
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
protected renderLegend(items: LegendItem[], onToggle: (index: number) => void) {
|
|
113
|
+
if (this.hideLegend || !items.length) return nothing;
|
|
114
|
+
return html`
|
|
115
|
+
<ul class="legend" aria-label="Legend">
|
|
116
|
+
${items.map(
|
|
117
|
+
(item, i) => html`
|
|
118
|
+
<li>
|
|
119
|
+
<button
|
|
120
|
+
type="button"
|
|
121
|
+
aria-pressed=${item.hidden ? "false" : "true"}
|
|
122
|
+
@click=${() => onToggle(i)}
|
|
123
|
+
>
|
|
124
|
+
<span class="swatch" style="background:${item.color}"></span>${item.name}
|
|
125
|
+
</button>
|
|
126
|
+
</li>
|
|
127
|
+
`,
|
|
128
|
+
)}
|
|
129
|
+
</ul>
|
|
130
|
+
`;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Visually hidden table so assistive technology can read every value. */
|
|
134
|
+
protected renderDataTable(headers: string[], rows: (string | number)[][]) {
|
|
135
|
+
return html`
|
|
136
|
+
<table class="sr-only">
|
|
137
|
+
<caption>
|
|
138
|
+
${this.label || "Chart data"}
|
|
139
|
+
</caption>
|
|
140
|
+
<thead>
|
|
141
|
+
<tr>
|
|
142
|
+
${headers.map((h) => html`<th scope="col">${h}</th>`)}
|
|
143
|
+
</tr>
|
|
144
|
+
</thead>
|
|
145
|
+
<tbody>
|
|
146
|
+
${rows.map(
|
|
147
|
+
(row) => html`
|
|
148
|
+
<tr>
|
|
149
|
+
${row.map((cell, i) =>
|
|
150
|
+
i === 0 ? html`<th scope="row">${cell}</th>` : html`<td>${cell}</td>`,
|
|
151
|
+
)}
|
|
152
|
+
</tr>
|
|
153
|
+
`,
|
|
154
|
+
)}
|
|
155
|
+
</tbody>
|
|
156
|
+
</table>
|
|
157
|
+
`;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
protected renderLiveRegion() {
|
|
161
|
+
return html`<div class="sr-only" aria-live="polite" aria-atomic="true">${this._announce}</div>`;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static baseStyles = css`
|
|
165
|
+
:host {
|
|
166
|
+
display: block;
|
|
167
|
+
width: 100%;
|
|
168
|
+
color: var(--st-color-text);
|
|
169
|
+
font-family: var(--st-font-family, inherit);
|
|
170
|
+
}
|
|
171
|
+
.chart {
|
|
172
|
+
position: relative;
|
|
173
|
+
}
|
|
174
|
+
.plot {
|
|
175
|
+
position: relative;
|
|
176
|
+
border-radius: var(--st-radius-sm);
|
|
177
|
+
outline: none;
|
|
178
|
+
}
|
|
179
|
+
.plot:focus-visible {
|
|
180
|
+
outline: 2px solid var(--st-color-primary);
|
|
181
|
+
outline-offset: 2px;
|
|
182
|
+
}
|
|
183
|
+
svg {
|
|
184
|
+
display: block;
|
|
185
|
+
overflow: visible;
|
|
186
|
+
}
|
|
187
|
+
.tick {
|
|
188
|
+
fill: var(--st-color-text-muted);
|
|
189
|
+
font-size: var(--st-font-size-xs);
|
|
190
|
+
}
|
|
191
|
+
.grid {
|
|
192
|
+
stroke: var(--st-color-border);
|
|
193
|
+
stroke-width: 1;
|
|
194
|
+
}
|
|
195
|
+
.axis-line {
|
|
196
|
+
stroke: var(--st-color-text-muted);
|
|
197
|
+
stroke-width: 1;
|
|
198
|
+
}
|
|
199
|
+
.tooltip {
|
|
200
|
+
position: absolute;
|
|
201
|
+
z-index: 2;
|
|
202
|
+
pointer-events: none;
|
|
203
|
+
transform: translate(-50%, calc(-100% - 0.5rem));
|
|
204
|
+
padding: var(--st-spacing-xs) var(--st-spacing-sm);
|
|
205
|
+
border: 1px solid var(--st-color-border);
|
|
206
|
+
border-radius: var(--st-radius-sm);
|
|
207
|
+
background: var(--st-color-surface);
|
|
208
|
+
box-shadow: var(--st-shadow-md);
|
|
209
|
+
font-size: var(--st-font-size-xs);
|
|
210
|
+
white-space: nowrap;
|
|
211
|
+
}
|
|
212
|
+
.tooltip-title {
|
|
213
|
+
margin-bottom: var(--st-spacing-xs);
|
|
214
|
+
font-weight: var(--st-font-weight-medium);
|
|
215
|
+
}
|
|
216
|
+
.tooltip-row {
|
|
217
|
+
display: flex;
|
|
218
|
+
align-items: center;
|
|
219
|
+
gap: var(--st-spacing-xs);
|
|
220
|
+
}
|
|
221
|
+
.tooltip-value {
|
|
222
|
+
margin-left: auto;
|
|
223
|
+
padding-left: var(--st-spacing-md);
|
|
224
|
+
font-weight: var(--st-font-weight-medium);
|
|
225
|
+
}
|
|
226
|
+
.swatch {
|
|
227
|
+
flex-shrink: 0;
|
|
228
|
+
width: 0.625rem;
|
|
229
|
+
height: 0.625rem;
|
|
230
|
+
border-radius: 2px;
|
|
231
|
+
}
|
|
232
|
+
.legend {
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-wrap: wrap;
|
|
235
|
+
gap: var(--st-spacing-xs) var(--st-spacing-md);
|
|
236
|
+
margin-top: var(--st-spacing-sm);
|
|
237
|
+
list-style: none;
|
|
238
|
+
}
|
|
239
|
+
.legend button {
|
|
240
|
+
display: inline-flex;
|
|
241
|
+
align-items: center;
|
|
242
|
+
gap: var(--st-spacing-xs);
|
|
243
|
+
padding: 2px var(--st-spacing-xs);
|
|
244
|
+
border: 0;
|
|
245
|
+
border-radius: var(--st-radius-sm);
|
|
246
|
+
background: none;
|
|
247
|
+
color: var(--st-color-text);
|
|
248
|
+
font: inherit;
|
|
249
|
+
font-size: var(--st-font-size-xs);
|
|
250
|
+
cursor: pointer;
|
|
251
|
+
}
|
|
252
|
+
.legend button[aria-pressed="false"] {
|
|
253
|
+
opacity: 0.55;
|
|
254
|
+
text-decoration: line-through;
|
|
255
|
+
}
|
|
256
|
+
.legend button:focus-visible {
|
|
257
|
+
outline: 2px solid var(--st-color-primary);
|
|
258
|
+
}
|
|
259
|
+
.sr-only {
|
|
260
|
+
position: absolute;
|
|
261
|
+
width: 1px;
|
|
262
|
+
height: 1px;
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
clip: rect(0 0 0 0);
|
|
265
|
+
white-space: nowrap;
|
|
266
|
+
}
|
|
267
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
268
|
+
.animate {
|
|
269
|
+
transition:
|
|
270
|
+
opacity 0.15s ease,
|
|
271
|
+
transform 0.15s ease;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
`;
|
|
275
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/** Pure helpers shared by the chart components (no DOM or Lit imports so they can be unit tested). */
|
|
2
|
+
|
|
3
|
+
export const CHART_PALETTE_SIZE = 8;
|
|
4
|
+
|
|
5
|
+
/** Resolves a series color: an explicit value wins, otherwise a theme palette token. */
|
|
6
|
+
export const chartColor = (index: number, custom?: string) =>
|
|
7
|
+
custom || `var(--st-chart-${(index % CHART_PALETTE_SIZE) + 1})`;
|
|
8
|
+
|
|
9
|
+
export const formatValue = (v: number) =>
|
|
10
|
+
new Intl.NumberFormat(undefined, {maximumFractionDigits: 2}).format(v);
|
|
11
|
+
|
|
12
|
+
export const formatCompact = (v: number) =>
|
|
13
|
+
new Intl.NumberFormat(undefined, {notation: "compact", maximumFractionDigits: 1}).format(v);
|
|
14
|
+
|
|
15
|
+
export const clamp = (v: number, min: number, max: number) => Math.min(Math.max(v, min), max);
|
|
16
|
+
|
|
17
|
+
/** Maps `v` from [min, max] to [0, 1]; a flat range maps to 0. */
|
|
18
|
+
export const normalize = (v: number, min: number, max: number) =>
|
|
19
|
+
max === min ? 0 : clamp((v - min) / (max - min), 0, 1);
|
|
20
|
+
|
|
21
|
+
function niceNumber(range: number, round: boolean) {
|
|
22
|
+
const exponent = Math.floor(Math.log10(range));
|
|
23
|
+
const fraction = range / 10 ** exponent;
|
|
24
|
+
let nice: number;
|
|
25
|
+
if (round) nice = fraction < 1.5 ? 1 : fraction < 3 ? 2 : fraction < 7 ? 5 : 10;
|
|
26
|
+
else nice = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;
|
|
27
|
+
return nice * 10 ** exponent;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface NiceScale {
|
|
31
|
+
min: number;
|
|
32
|
+
max: number;
|
|
33
|
+
ticks: number[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Computes a "nice" axis range and tick values that enclose [min, max]. */
|
|
37
|
+
export function niceScale(min: number, max: number, tickCount = 5): NiceScale {
|
|
38
|
+
if (!Number.isFinite(min) || !Number.isFinite(max)) return {min: 0, max: 1, ticks: [0, 1]};
|
|
39
|
+
if (min === max) {
|
|
40
|
+
if (min === 0) max = 1;
|
|
41
|
+
else {
|
|
42
|
+
const pad = Math.abs(min) * 0.1;
|
|
43
|
+
min -= pad;
|
|
44
|
+
max += pad;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const step = niceNumber(niceNumber(max - min, false) / (tickCount - 1), true);
|
|
48
|
+
const niceMin = Math.floor(min / step) * step;
|
|
49
|
+
const niceMax = Math.ceil(max / step) * step;
|
|
50
|
+
const ticks: number[] = [];
|
|
51
|
+
for (let v = niceMin; v <= niceMax + step / 2; v += step) {
|
|
52
|
+
ticks.push(Number(v.toFixed(10)));
|
|
53
|
+
}
|
|
54
|
+
return {min: ticks[0], max: ticks[ticks.length - 1], ticks};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Angle in radians measured clockwise from 12 o'clock. */
|
|
58
|
+
export function polar(cx: number, cy: number, r: number, angle: number): [number, number] {
|
|
59
|
+
const a = angle - Math.PI / 2;
|
|
60
|
+
return [cx + r * Math.cos(a), cy + r * Math.sin(a)];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** SVG path for a pie slice (inner = 0) or donut segment between two angles. */
|
|
64
|
+
export function arcPath(
|
|
65
|
+
cx: number,
|
|
66
|
+
cy: number,
|
|
67
|
+
r: number,
|
|
68
|
+
inner: number,
|
|
69
|
+
start: number,
|
|
70
|
+
end: number,
|
|
71
|
+
) {
|
|
72
|
+
const full = Math.PI * 2 - 0.001;
|
|
73
|
+
const sweepEnd = Math.min(end, start + full);
|
|
74
|
+
const large = sweepEnd - start > Math.PI ? 1 : 0;
|
|
75
|
+
const [x1, y1] = polar(cx, cy, r, start);
|
|
76
|
+
const [x2, y2] = polar(cx, cy, r, sweepEnd);
|
|
77
|
+
if (inner <= 0) return `M${cx} ${cy}L${x1} ${y1}A${r} ${r} 0 ${large} 1 ${x2} ${y2}Z`;
|
|
78
|
+
const [x3, y3] = polar(cx, cy, inner, sweepEnd);
|
|
79
|
+
const [x4, y4] = polar(cx, cy, inner, start);
|
|
80
|
+
return `M${x1} ${y1}A${r} ${r} 0 ${large} 1 ${x2} ${y2}L${x3} ${y3}A${inner} ${inner} 0 ${large} 0 ${x4} ${y4}Z`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Builds contiguous "M/L" path segments, breaking the line wherever a value is null. */
|
|
84
|
+
export function linePath(points: ([number, number] | null)[]) {
|
|
85
|
+
let d = "";
|
|
86
|
+
let pen = false;
|
|
87
|
+
for (const p of points) {
|
|
88
|
+
if (!p) {
|
|
89
|
+
pen = false;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
d += `${pen ? "L" : "M"}${p[0]} ${p[1]}`;
|
|
93
|
+
pen = true;
|
|
94
|
+
}
|
|
95
|
+
return d;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Closed area paths (one per contiguous segment) down to `baseline`. */
|
|
99
|
+
export function areaPaths(points: ([number, number] | null)[], baseline: number) {
|
|
100
|
+
const paths: string[] = [];
|
|
101
|
+
let segment: [number, number][] = [];
|
|
102
|
+
const flush = () => {
|
|
103
|
+
if (segment.length > 1) {
|
|
104
|
+
const first = segment[0];
|
|
105
|
+
const last = segment[segment.length - 1];
|
|
106
|
+
paths.push(
|
|
107
|
+
`M${first[0]} ${baseline}` +
|
|
108
|
+
segment.map((p) => `L${p[0]} ${p[1]}`).join("") +
|
|
109
|
+
`L${last[0]} ${baseline}Z`,
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
segment = [];
|
|
113
|
+
};
|
|
114
|
+
for (const p of points) {
|
|
115
|
+
if (p) segment.push(p);
|
|
116
|
+
else flush();
|
|
117
|
+
}
|
|
118
|
+
flush();
|
|
119
|
+
return paths;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Moves a roving index for arrow-key navigation, returning null when the key is not handled. */
|
|
123
|
+
export function stepIndex(key: string, current: number | null, length: number): number | null {
|
|
124
|
+
if (length <= 0) return null;
|
|
125
|
+
const at = current ?? -1;
|
|
126
|
+
switch (key) {
|
|
127
|
+
case "ArrowRight":
|
|
128
|
+
case "ArrowDown":
|
|
129
|
+
return Math.min(at + 1, length - 1);
|
|
130
|
+
case "ArrowLeft":
|
|
131
|
+
case "ArrowUp":
|
|
132
|
+
return Math.max(at - 1, 0);
|
|
133
|
+
case "Home":
|
|
134
|
+
return 0;
|
|
135
|
+
case "End":
|
|
136
|
+
return length - 1;
|
|
137
|
+
default:
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -37,7 +37,7 @@ export class StCodeBlock extends LitElement {
|
|
|
37
37
|
margin: var(--st-spacing-md) 0;
|
|
38
38
|
border-radius: 8px;
|
|
39
39
|
/* 1. Lock background to a deep dark surface */
|
|
40
|
-
background-color:
|
|
40
|
+
background-color: var(--st-code-bg);
|
|
41
41
|
border: 1px solid var(--st-color-border);
|
|
42
42
|
overflow: hidden;
|
|
43
43
|
}
|
|
@@ -47,8 +47,8 @@ export class StCodeBlock extends LitElement {
|
|
|
47
47
|
justify-content: space-between;
|
|
48
48
|
align-items: center;
|
|
49
49
|
/* 2. Lock header to a slightly darker shade */
|
|
50
|
-
background-color:
|
|
51
|
-
border-bottom: 1px solid
|
|
50
|
+
background-color: var(--st-code-header-bg);
|
|
51
|
+
border-bottom: 1px solid var(--st-code-border);
|
|
52
52
|
padding: 0 var(--st-spacing-md);
|
|
53
53
|
min-height: 2.5rem; /* 40px */
|
|
54
54
|
}
|
|
@@ -56,7 +56,7 @@ export class StCodeBlock extends LitElement {
|
|
|
56
56
|
/* Single language label */
|
|
57
57
|
.language-label {
|
|
58
58
|
font-size: var(--st-font-size-xs);
|
|
59
|
-
color:
|
|
59
|
+
color: var(--st-code-muted);
|
|
60
60
|
text-transform: uppercase;
|
|
61
61
|
letter-spacing: 0.05em;
|
|
62
62
|
font-weight: var(--st-font-weight-bold);
|
|
@@ -73,7 +73,7 @@ export class StCodeBlock extends LitElement {
|
|
|
73
73
|
background: transparent;
|
|
74
74
|
border: none;
|
|
75
75
|
border-bottom: 2px solid transparent;
|
|
76
|
-
color:
|
|
76
|
+
color: var(--st-code-muted);
|
|
77
77
|
font-size: var(--st-font-size-xs);
|
|
78
78
|
font-weight: var(--st-font-weight-medium);
|
|
79
79
|
padding: var(--st-spacing-xs) 0;
|
|
@@ -82,20 +82,20 @@ export class StCodeBlock extends LitElement {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.tab:hover {
|
|
85
|
-
color:
|
|
85
|
+
color: var(--st-code-text);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
.tab.active {
|
|
89
89
|
/* 3. Hardcode the active tab to a high-contrast blue instead of dynamic primary */
|
|
90
|
-
color:
|
|
91
|
-
border-bottom-color:
|
|
90
|
+
color: var(--st-code-accent);
|
|
91
|
+
border-bottom-color: var(--st-code-accent);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/* Copy Button */
|
|
95
95
|
.copy-button {
|
|
96
96
|
background: transparent;
|
|
97
97
|
border: 1px solid transparent;
|
|
98
|
-
color:
|
|
98
|
+
color: var(--st-code-muted);
|
|
99
99
|
cursor: pointer;
|
|
100
100
|
display: flex;
|
|
101
101
|
align-items: center;
|
|
@@ -108,8 +108,8 @@ export class StCodeBlock extends LitElement {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.copy-button:hover {
|
|
111
|
-
color:
|
|
112
|
-
background-color:
|
|
111
|
+
color: var(--st-code-text);
|
|
112
|
+
background-color: var(--st-code-hover);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
.copy-button svg {
|
|
@@ -123,7 +123,7 @@ export class StCodeBlock extends LitElement {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
.copy-button.copied {
|
|
126
|
-
color:
|
|
126
|
+
color: var(--st-code-success); /* High-contrast success green */
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
pre {
|
|
@@ -136,7 +136,7 @@ export class StCodeBlock extends LitElement {
|
|
|
136
136
|
font-size: 0.875rem;
|
|
137
137
|
line-height: 1.5;
|
|
138
138
|
/* 4. Ensure default text stays light */
|
|
139
|
-
color:
|
|
139
|
+
color: var(--st-code-text);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.raw-content {
|
|
@@ -150,11 +150,11 @@ export class StCodeBlock extends LitElement {
|
|
|
150
150
|
.token.prolog,
|
|
151
151
|
.token.doctype,
|
|
152
152
|
.token.cdata {
|
|
153
|
-
color:
|
|
153
|
+
color: var(--st-code-muted);
|
|
154
154
|
font-style: italic;
|
|
155
155
|
}
|
|
156
156
|
.token.punctuation {
|
|
157
|
-
color:
|
|
157
|
+
color: var(--st-code-muted);
|
|
158
158
|
}
|
|
159
159
|
.token.namespace {
|
|
160
160
|
opacity: 0.7;
|
|
@@ -166,7 +166,7 @@ export class StCodeBlock extends LitElement {
|
|
|
166
166
|
.token.constant,
|
|
167
167
|
.token.symbol,
|
|
168
168
|
.token.deleted {
|
|
169
|
-
color:
|
|
169
|
+
color: var(--st-code-accent);
|
|
170
170
|
}
|
|
171
171
|
.token.selector,
|
|
172
172
|
.token.attr-name,
|
|
@@ -174,33 +174,33 @@ export class StCodeBlock extends LitElement {
|
|
|
174
174
|
.token.char,
|
|
175
175
|
.token.builtin,
|
|
176
176
|
.token.inserted {
|
|
177
|
-
color:
|
|
177
|
+
color: var(--st-code-string);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
/* Replaced var(--st-color-text) with
|
|
180
|
+
/* Replaced var(--st-color-text) with var(--st-code-text) */
|
|
181
181
|
.token.operator,
|
|
182
182
|
.token.entity,
|
|
183
183
|
.token.url,
|
|
184
184
|
.language-css .token.string,
|
|
185
185
|
.style .token.string {
|
|
186
|
-
color:
|
|
186
|
+
color: var(--st-code-text);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
/* Replaced var(--st-color-primary) with
|
|
189
|
+
/* Replaced var(--st-color-primary) with var(--st-code-keyword) (High-contrast pink/red for keywords) */
|
|
190
190
|
.token.atrule,
|
|
191
191
|
.token.attr-value,
|
|
192
192
|
.token.keyword {
|
|
193
|
-
color:
|
|
193
|
+
color: var(--st-code-keyword);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
.token.function,
|
|
197
197
|
.token.class-name {
|
|
198
|
-
color:
|
|
198
|
+
color: var(--st-code-function);
|
|
199
199
|
}
|
|
200
200
|
.token.regex,
|
|
201
201
|
.token.important,
|
|
202
202
|
.token.variable {
|
|
203
|
-
color:
|
|
203
|
+
color: var(--st-code-number);
|
|
204
204
|
}
|
|
205
205
|
`,
|
|
206
206
|
];
|
|
@@ -218,7 +218,7 @@ export class StCodeBlock extends LitElement {
|
|
|
218
218
|
this._snippets = templates.map((template) => {
|
|
219
219
|
const lang = template.getAttribute("data-lang") || this.language;
|
|
220
220
|
const label = template.getAttribute("data-label") || lang; // Fallback to lang if no label provided
|
|
221
|
-
const rawCode = this._dedent(template
|
|
221
|
+
const rawCode = this._dedent(this._sourceOf(template));
|
|
222
222
|
|
|
223
223
|
const grammar = Prism.languages[lang] || Prism.languages.javascript;
|
|
224
224
|
const highlightedCode = Prism.highlight(rawCode, grammar, lang);
|
|
@@ -241,6 +241,17 @@ export class StCodeBlock extends LitElement {
|
|
|
241
241
|
this._activeIndex = 0;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
+
/**
|
|
245
|
+
* Plain-text templates (JavaScript, JSON, shell) are read as text so characters such as
|
|
246
|
+
* `=>`, `<` and `&` are not HTML-escaped. Templates holding markup are serialized as HTML.
|
|
247
|
+
*/
|
|
248
|
+
private _sourceOf(template: HTMLTemplateElement): string {
|
|
249
|
+
const nodes = Array.from(template.content.childNodes);
|
|
250
|
+
return nodes.every((n) => n.nodeType === Node.TEXT_NODE)
|
|
251
|
+
? (template.content.textContent ?? "")
|
|
252
|
+
: template.innerHTML;
|
|
253
|
+
}
|
|
254
|
+
|
|
244
255
|
private _dedent(text: string): string {
|
|
245
256
|
const lines = text.split("\n");
|
|
246
257
|
const minIndent = lines
|