@repobit/dex-system-design 3.1.2 → 4.1.0
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/CHANGELOG.md +1075 -0
- package/README.md +31 -6
- package/dist/src/assets/fonts/IBMPlexSansCondensed-Bold.woff2 +0 -0
- package/dist/src/assets/fonts/IBMPlexSansCondensed-BoldItalic.woff2 +0 -0
- package/dist/src/assets/fonts/IBMPlexSansCondensed-Italic.woff2 +0 -0
- package/dist/src/assets/fonts/IBMPlexSansCondensed-Medium.woff2 +0 -0
- package/dist/src/assets/fonts/IBMPlexSansCondensed-MediumItalic.woff2 +0 -0
- package/dist/src/assets/fonts/IBMPlexSansCondensed-Regular.woff2 +0 -0
- package/dist/src/assets/fonts/IBMPlexSansCondensed-SemiBold.woff2 +0 -0
- package/dist/src/assets/fonts/IBMPlexSansCondensed-SemiBoldItalic.woff2 +0 -0
- package/dist/src/components/abstract/abstract.css.d.ts +7 -0
- package/dist/src/components/abstract/abstract.css.js +2 -0
- package/dist/src/components/abstract/abstract.css.js.map +1 -0
- package/dist/src/components/abstract/abstract.d.ts +31 -0
- package/dist/src/components/abstract/abstract.js +2 -0
- package/dist/src/components/abstract/abstract.js.map +1 -0
- package/dist/src/components/accordion/accordion-item.d.ts +93 -0
- package/dist/src/components/accordion/accordion-item.js +25 -0
- package/dist/src/components/accordion/accordion-item.js.map +1 -0
- package/dist/src/components/accordion/accordion-keyboard.d.ts +5 -5
- package/dist/src/components/accordion/accordion-keyboard.js +1 -1
- package/dist/src/components/accordion/accordion-keyboard.js.map +1 -1
- package/dist/src/components/accordion/accordion.css.d.ts +2 -2
- package/dist/src/components/accordion/accordion.css.js +1 -1
- package/dist/src/components/accordion/accordion.css.js.map +1 -1
- package/dist/src/components/accordion/accordion.d.ts +66 -31
- package/dist/src/components/accordion/accordion.js +8 -66
- package/dist/src/components/accordion/accordion.js.map +1 -1
- package/dist/src/components/agent-endpoints/agent-endpoints-pills.css.js +2 -0
- package/dist/src/components/agent-endpoints/agent-endpoints-pills.css.js.map +1 -0
- package/dist/src/components/agent-endpoints/agent-endpoints.css.js +1 -1
- package/dist/src/components/agent-endpoints/agent-endpoints.css.js.map +1 -1
- package/dist/src/components/agent-endpoints/agent-endpoints.d.ts +38 -21
- package/dist/src/components/agent-endpoints/agent-endpoints.js +22 -41
- package/dist/src/components/agent-endpoints/agent-endpoints.js.map +1 -1
- package/dist/src/components/anchor-nav/anchor-nav-item.css.d.ts +1 -0
- package/dist/src/components/anchor-nav/anchor-nav-item.css.js +2 -0
- package/dist/src/components/anchor-nav/anchor-nav-item.css.js.map +1 -0
- package/dist/src/components/anchor-nav/anchor-nav-item.d.ts +38 -0
- package/dist/src/components/anchor-nav/anchor-nav-item.js +2 -0
- package/dist/src/components/anchor-nav/anchor-nav-item.js.map +1 -0
- package/dist/src/components/anchor-nav/anchor-nav.css.js +2 -0
- package/dist/src/components/anchor-nav/anchor-nav.css.js.map +1 -0
- package/dist/src/components/{anchor → anchor-nav}/anchor-nav.d.ts +41 -23
- package/dist/src/components/anchor-nav/anchor-nav.js +43 -0
- package/dist/src/components/anchor-nav/anchor-nav.js.map +1 -0
- package/dist/src/components/annotation/annotation.css.js +1 -1
- package/dist/src/components/annotation/annotation.css.js.map +1 -1
- package/dist/src/components/annotation/annotation.js +2 -2
- package/dist/src/components/annotation/annotation.js.map +1 -1
- package/dist/src/components/article/article.css.d.ts +30 -0
- package/dist/src/components/article/article.css.js +2 -0
- package/dist/src/components/article/article.css.js.map +1 -0
- package/dist/src/components/article/article.d.ts +135 -0
- package/dist/src/components/article/article.js +39 -0
- package/dist/src/components/article/article.js.map +1 -0
- package/dist/src/components/audience-card/audience-card.css.js +1 -1
- package/dist/src/components/audience-card/audience-card.css.js.map +1 -1
- package/dist/src/components/audience-card/audience-card.d.ts +30 -15
- package/dist/src/components/audience-card/audience-card.js +9 -11
- package/dist/src/components/audience-card/audience-card.js.map +1 -1
- package/dist/src/components/authors/authors.css.d.ts +7 -0
- package/dist/src/components/authors/authors.css.js +2 -0
- package/dist/src/components/authors/authors.css.js.map +1 -0
- package/dist/src/components/authors/authors.d.ts +29 -0
- package/dist/src/components/authors/authors.js +7 -0
- package/dist/src/components/authors/authors.js.map +1 -0
- package/dist/src/components/avatar/avatar.js +6 -6
- package/dist/src/components/avatar/avatar.js.map +1 -1
- package/dist/src/components/awards/award-marks.css.js +2 -0
- package/dist/src/components/awards/award-marks.css.js.map +1 -0
- package/dist/src/components/awards/award.css.js +2 -0
- package/dist/src/components/awards/award.css.js.map +1 -0
- package/dist/src/components/awards/award.d.ts +65 -0
- package/dist/src/components/awards/award.js +11 -0
- package/dist/src/components/awards/award.js.map +1 -0
- package/dist/src/components/awards/awards.css.d.ts +2 -1
- package/dist/src/components/awards/awards.css.js +1 -1
- package/dist/src/components/awards/awards.css.js.map +1 -1
- package/dist/src/components/awards/awards.d.ts +123 -71
- package/dist/src/components/awards/awards.js +46 -57
- package/dist/src/components/awards/awards.js.map +1 -1
- package/dist/src/components/awards/scroll-slides.d.ts +9 -8
- package/dist/src/components/awards/scroll-slides.js.map +1 -1
- package/dist/src/components/back/back.d.ts +12 -7
- package/dist/src/components/back/back.js +6 -6
- package/dist/src/components/back/back.js.map +1 -1
- package/dist/src/components/badge/badge.css.js +1 -1
- package/dist/src/components/badge/badge.css.js.map +1 -1
- package/dist/src/components/badge/badge.d.ts +11 -11
- package/dist/src/components/badge/badge.js +2 -2
- package/dist/src/components/badge/badge.js.map +1 -1
- package/dist/src/components/bar-chart/bar-chart.css.js +2 -0
- package/dist/src/components/bar-chart/bar-chart.css.js.map +1 -0
- package/dist/src/components/bar-chart/bar-chart.d.ts +147 -0
- package/dist/src/components/bar-chart/bar-chart.js +42 -0
- package/dist/src/components/bar-chart/bar-chart.js.map +1 -0
- package/dist/src/components/bento-grid/bento-grid.css.js +2 -2
- package/dist/src/components/bento-grid/bento-grid.css.js.map +1 -1
- package/dist/src/components/bento-grid/bento-grid.d.ts +21 -9
- package/dist/src/components/bento-grid/bento-grid.js +10 -26
- package/dist/src/components/bento-grid/bento-grid.js.map +1 -1
- package/dist/src/components/bento-grid/bento-item.css.js +1 -1
- package/dist/src/components/bento-grid/bento-item.css.js.map +1 -1
- package/dist/src/components/bento-grid/bento-item.d.ts +34 -13
- package/dist/src/components/bento-grid/bento-item.js +9 -26
- package/dist/src/components/bento-grid/bento-item.js.map +1 -1
- package/dist/src/components/blockquote/blockquote.css.js +1 -1
- package/dist/src/components/blockquote/blockquote.css.js.map +1 -1
- package/dist/src/components/blockquote/blockquote.d.ts +27 -2
- package/dist/src/components/blockquote/blockquote.js +1 -1
- package/dist/src/components/blockquote/blockquote.js.map +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.d.ts +5 -4
- package/dist/src/components/breadcrumb/breadcrumb.js +5 -5
- package/dist/src/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/src/components/button/button.css.js +1 -1
- package/dist/src/components/button/button.css.js.map +1 -1
- package/dist/src/components/button/button.d.ts +87 -96
- package/dist/src/components/button/button.js +20 -33
- package/dist/src/components/button/button.js.map +1 -1
- package/dist/src/components/{alert/alert.css.d.ts → callout/callout.css.d.ts} +9 -9
- package/dist/src/components/callout/callout.css.js +2 -0
- package/dist/src/components/callout/callout.css.js.map +1 -0
- package/dist/src/components/callout/callout.d.ts +56 -0
- package/dist/src/components/callout/callout.js +28 -0
- package/dist/src/components/callout/callout.js.map +1 -0
- package/dist/src/components/caption/caption.js +2 -2
- package/dist/src/components/caption/caption.js.map +1 -1
- package/dist/src/components/card/card-grid.css.js +2 -0
- package/dist/src/components/card/card-grid.css.js.map +1 -0
- package/dist/src/components/card/card-grid.d.ts +63 -0
- package/dist/src/components/card/card-grid.js +10 -0
- package/dist/src/components/card/card-grid.js.map +1 -0
- package/dist/src/components/card/card.css.js +2 -0
- package/dist/src/components/card/card.css.js.map +1 -0
- package/dist/src/components/card/card.d.ts +86 -0
- package/dist/src/components/card/card.js +15 -0
- package/dist/src/components/card/card.js.map +1 -0
- package/dist/src/components/carousel/carousel.css.js +1 -1
- package/dist/src/components/carousel/carousel.css.js.map +1 -1
- package/dist/src/components/carousel/carousel.d.ts +64 -37
- package/dist/src/components/carousel/carousel.js +24 -32
- package/dist/src/components/carousel/carousel.js.map +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +15 -1
- package/dist/src/components/checkbox/checkbox.js +6 -5
- package/dist/src/components/checkbox/checkbox.js.map +1 -1
- package/dist/src/components/code/code.css.d.ts +15 -0
- package/dist/src/components/code/code.css.js +1 -1
- package/dist/src/components/code/code.css.js.map +1 -1
- package/dist/src/components/code/code.d.ts +100 -4
- package/dist/src/components/code/code.js +17 -3
- package/dist/src/components/code/code.js.map +1 -1
- package/dist/src/components/code/prism-page.d.ts +2 -0
- package/dist/src/components/code/prism-page.js +2 -0
- package/dist/src/components/code/prism-page.js.map +1 -0
- package/dist/src/components/code/prism.d.ts +10 -0
- package/dist/src/components/code/prism.js +2 -0
- package/dist/src/components/code/prism.js.map +1 -0
- package/dist/src/components/comparison-panel/comparison-panel.css.js +1 -1
- package/dist/src/components/comparison-panel/comparison-panel.css.js.map +1 -1
- package/dist/src/components/comparison-panel/comparison-panel.d.ts +36 -15
- package/dist/src/components/comparison-panel/comparison-panel.js +25 -46
- package/dist/src/components/comparison-panel/comparison-panel.js.map +1 -1
- package/dist/src/components/compatibility-table/compatibility-table.css.d.ts +25 -0
- package/dist/src/components/compatibility-table/compatibility-table.css.js +1 -1
- package/dist/src/components/compatibility-table/compatibility-table.css.js.map +1 -1
- package/dist/src/components/compatibility-table/compatibility-table.d.ts +66 -42
- package/dist/src/components/compatibility-table/compatibility-table.js +5 -64
- package/dist/src/components/compatibility-table/compatibility-table.js.map +1 -1
- package/dist/src/components/cta-banner/cta-banner.css.js +1 -1
- package/dist/src/components/cta-banner/cta-banner.css.js.map +1 -1
- package/dist/src/components/cta-banner/cta-banner.d.ts +17 -8
- package/dist/src/components/cta-banner/cta-banner.js +8 -28
- package/dist/src/components/cta-banner/cta-banner.js.map +1 -1
- package/dist/src/components/dialog/dialog.css.js +2 -0
- package/dist/src/components/dialog/dialog.css.js.map +1 -0
- package/dist/src/components/dialog/dialog.d.ts +76 -0
- package/dist/src/components/dialog/dialog.js +32 -0
- package/dist/src/components/dialog/dialog.js.map +1 -0
- package/dist/src/components/display/display.css.js +1 -1
- package/dist/src/components/display/display.css.js.map +1 -1
- package/dist/src/components/display/display.d.ts +30 -6
- package/dist/src/components/display/display.js +7 -5
- package/dist/src/components/display/display.js.map +1 -1
- package/dist/src/components/divider/divider.css.d.ts +2 -2
- package/dist/src/components/divider/divider.css.js +1 -1
- package/dist/src/components/divider/divider.css.js.map +1 -1
- package/dist/src/components/divider/divider.d.ts +36 -0
- package/dist/src/components/divider/divider.js +21 -0
- package/dist/src/components/divider/divider.js.map +1 -0
- package/dist/src/components/fact/fact.css.d.ts +1 -0
- package/dist/src/components/fact/fact.css.js +2 -0
- package/dist/src/components/fact/fact.css.js.map +1 -0
- package/dist/src/components/fact/fact.d.ts +37 -0
- package/dist/src/components/fact/fact.js +2 -0
- package/dist/src/components/fact/fact.js.map +1 -0
- package/dist/src/components/feature-columns/feature-columns.css.d.ts +2 -0
- package/dist/src/components/feature-columns/feature-columns.css.js +2 -0
- package/dist/src/components/feature-columns/feature-columns.css.js.map +1 -0
- package/dist/src/components/feature-columns/feature-columns.d.ts +61 -0
- package/dist/src/components/feature-columns/feature-columns.js +11 -0
- package/dist/src/components/feature-columns/feature-columns.js.map +1 -0
- package/dist/src/components/features-tab/features-tab.css.js +1 -1
- package/dist/src/components/features-tab/features-tab.css.js.map +1 -1
- package/dist/src/components/features-tab/features-tab.d.ts +21 -6
- package/dist/src/components/features-tab/features-tab.js +9 -21
- package/dist/src/components/features-tab/features-tab.js.map +1 -1
- package/dist/src/components/fieldset/fieldset.d.ts +16 -1
- package/dist/src/components/fieldset/fieldset.js +3 -3
- package/dist/src/components/fieldset/fieldset.js.map +1 -1
- package/dist/src/components/footer/footer-group.css.js +2 -0
- package/dist/src/components/footer/footer-group.css.js.map +1 -0
- package/dist/src/components/footer/footer-group.d.ts +28 -0
- package/dist/src/components/footer/footer-group.js +5 -0
- package/dist/src/components/footer/footer-group.js.map +1 -0
- package/dist/src/components/footer/footer-locale.js +1 -1
- package/dist/src/components/footer/footer-locale.js.map +1 -1
- package/dist/src/components/footer/footer-nav.css.js +2 -0
- package/dist/src/components/footer/footer-nav.css.js.map +1 -0
- package/dist/src/components/footer/{footer-nav-menu.d.ts → footer-nav.d.ts} +2 -1
- package/dist/src/components/footer/footer-nav.js +6 -0
- package/dist/src/components/footer/footer-nav.js.map +1 -0
- package/dist/src/components/footer/footer.css.js +1 -1
- package/dist/src/components/footer/footer.css.js.map +1 -1
- package/dist/src/components/footer/footer.d.ts +38 -10
- package/dist/src/components/footer/footer.js +71 -93
- package/dist/src/components/footer/footer.js.map +1 -1
- package/dist/src/components/grid/grid.js +7 -7
- package/dist/src/components/h/h.css.js +2 -0
- package/dist/src/components/h/h.css.js.map +1 -0
- package/dist/src/components/{heading/heading.d.ts → h/h.d.ts} +14 -0
- package/dist/src/components/h/h.js +7 -0
- package/dist/src/components/h/h.js.map +1 -0
- package/dist/src/components/hero/hero.css.js +1 -1
- package/dist/src/components/hero/hero.css.js.map +1 -1
- package/dist/src/components/hero/hero.d.ts +42 -24
- package/dist/src/components/hero/hero.js +15 -19
- package/dist/src/components/hero/hero.js.map +1 -1
- package/dist/src/components/highlight/highlight.css.js +1 -1
- package/dist/src/components/highlight/highlight.css.js.map +1 -1
- package/dist/src/components/highlight/highlight.d.ts +21 -12
- package/dist/src/components/highlight/highlight.js +1 -4
- package/dist/src/components/highlight/highlight.js.map +1 -1
- package/dist/src/components/hint/hint.css.d.ts +3 -0
- package/dist/src/components/{help-text/help-text.css.js → hint/hint.css.js} +2 -2
- package/dist/src/components/hint/hint.css.js.map +1 -0
- package/dist/src/components/hint/hint.d.ts +33 -0
- package/dist/src/components/hint/hint.js +4 -0
- package/dist/src/components/hint/hint.js.map +1 -0
- package/dist/src/components/icons/analysis.d.ts +1 -0
- package/dist/src/components/icons/analysis.js +6 -0
- package/dist/src/components/icons/analysis.js.map +1 -0
- package/dist/src/components/icons/arrow-down.d.ts +1 -0
- package/dist/src/components/icons/arrow-down.js +6 -0
- package/dist/src/components/icons/arrow-down.js.map +1 -0
- package/dist/src/components/icons/arrow-right.d.ts +1 -0
- package/dist/src/components/icons/arrow-right.js +6 -0
- package/dist/src/components/icons/arrow-right.js.map +1 -0
- package/dist/src/components/icons/arrow-up.d.ts +1 -0
- package/dist/src/components/icons/arrow-up.js +6 -0
- package/dist/src/components/icons/arrow-up.js.map +1 -0
- package/dist/src/components/icons/arrow.d.ts +1 -0
- package/dist/src/components/icons/arrow.js +6 -0
- package/dist/src/components/icons/arrow.js.map +1 -0
- package/dist/src/components/icons/brand-signature.d.ts +1 -0
- package/dist/src/components/icons/brand-signature.js +6 -0
- package/dist/src/components/icons/brand-signature.js.map +1 -0
- package/dist/src/components/icons/check.d.ts +1 -0
- package/dist/src/components/icons/check.js +6 -0
- package/dist/src/components/icons/check.js.map +1 -0
- package/dist/src/components/icons/circle-info.d.ts +1 -0
- package/dist/src/components/icons/circle-info.js +8 -0
- package/dist/src/components/icons/circle-info.js.map +1 -0
- package/dist/src/components/icons/clipboard.d.ts +1 -0
- package/dist/src/components/icons/clipboard.js +7 -0
- package/dist/src/components/icons/clipboard.js.map +1 -0
- package/dist/src/components/icons/close.d.ts +1 -0
- package/dist/src/components/icons/close.js +6 -0
- package/dist/src/components/icons/close.js.map +1 -0
- package/dist/src/components/icons/enterprise.d.ts +1 -0
- package/dist/src/components/icons/enterprise.js +6 -0
- package/dist/src/components/icons/enterprise.js.map +1 -0
- package/dist/src/components/icons/envelope.d.ts +1 -0
- package/dist/src/components/icons/envelope.js +7 -0
- package/dist/src/components/icons/envelope.js.map +1 -0
- package/dist/src/components/icons/family.d.ts +1 -0
- package/dist/src/components/icons/family.js +8 -0
- package/dist/src/components/icons/family.js.map +1 -0
- package/dist/src/components/icons/globe.d.ts +1 -0
- package/dist/src/components/icons/globe.js +6 -0
- package/dist/src/components/icons/globe.js.map +1 -0
- package/dist/src/components/icons/guide.d.ts +1 -0
- package/dist/src/components/icons/guide.js +6 -0
- package/dist/src/components/icons/guide.js.map +1 -0
- package/dist/src/components/icons/home.d.ts +1 -0
- package/dist/src/components/icons/home.js +6 -0
- package/dist/src/components/icons/home.js.map +1 -0
- package/dist/src/components/icons/icon.d.ts +60 -0
- package/dist/src/components/icons/icon.js +2 -0
- package/dist/src/components/icons/icon.js.map +1 -0
- package/dist/src/components/icons/icons.d.ts +43 -36
- package/dist/src/components/icons/icons.js +1 -1
- package/dist/src/components/icons/individual.d.ts +1 -0
- package/dist/src/components/icons/individual.js +6 -0
- package/dist/src/components/icons/individual.js.map +1 -0
- package/dist/src/components/icons/laurel.d.ts +1 -0
- package/dist/src/components/icons/laurel.js +13 -0
- package/dist/src/components/icons/laurel.js.map +1 -0
- package/dist/src/components/icons/machine-learning.d.ts +1 -0
- package/dist/src/components/icons/machine-learning.js +6 -0
- package/dist/src/components/icons/machine-learning.js.map +1 -0
- package/dist/src/components/icons/mark.d.ts +66 -0
- package/dist/src/components/icons/mark.js +2 -0
- package/dist/src/components/icons/mark.js.map +1 -0
- package/dist/src/components/icons/marks/ai.d.ts +1 -0
- package/dist/src/components/icons/marks/ai.js +6 -0
- package/dist/src/components/icons/marks/ai.js.map +1 -0
- package/dist/src/components/icons/marks/av-comparatives.d.ts +1 -0
- package/dist/src/components/icons/marks/av-comparatives.js +12 -0
- package/dist/src/components/icons/marks/av-comparatives.js.map +1 -0
- package/dist/src/components/icons/marks/best-brands.d.ts +1 -0
- package/dist/src/components/icons/marks/best-brands.js +12 -0
- package/dist/src/components/icons/marks/best-brands.js.map +1 -0
- package/dist/src/components/icons/marks/pc-mag-2024.d.ts +1 -0
- package/dist/src/components/icons/marks/pc-mag-2024.js +11 -0
- package/dist/src/components/icons/marks/pc-mag-2024.js.map +1 -0
- package/dist/src/components/icons/marks/pc-mag-business.d.ts +1 -0
- package/dist/src/components/icons/marks/pc-mag-business.js +11 -0
- package/dist/src/components/icons/marks/pc-mag-business.js.map +1 -0
- package/dist/src/components/icons/marks/pc-mag-readers.d.ts +1 -0
- package/dist/src/components/icons/marks/pc-mag-readers.js +11 -0
- package/dist/src/components/icons/marks/pc-mag-readers.js.map +1 -0
- package/dist/src/components/icons/marks/pc-mag.d.ts +1 -0
- package/dist/src/components/icons/marks/pc-mag.js +11 -0
- package/dist/src/components/icons/marks/pc-mag.js.map +1 -0
- package/dist/src/components/icons/marks/top-product.d.ts +1 -0
- package/dist/src/components/icons/marks/top-product.js +11 -0
- package/dist/src/components/icons/marks/top-product.js.map +1 -0
- package/dist/src/components/icons/marks.d.ts +29 -28
- package/dist/src/components/icons/marks.js +1 -1
- package/dist/src/components/icons/minus.d.ts +1 -0
- package/dist/src/components/icons/minus.js +6 -0
- package/dist/src/components/icons/minus.js.map +1 -0
- package/dist/src/components/icons/pause.d.ts +1 -0
- package/dist/src/components/icons/pause.js +7 -0
- package/dist/src/components/icons/pause.js.map +1 -0
- package/dist/src/components/icons/play.d.ts +1 -0
- package/dist/src/components/icons/play.js +6 -0
- package/dist/src/components/icons/play.js.map +1 -0
- package/dist/src/components/icons/plus.d.ts +1 -0
- package/dist/src/components/icons/plus.js +6 -0
- package/dist/src/components/icons/plus.js.map +1 -0
- package/dist/src/components/icons/quote.d.ts +1 -0
- package/dist/src/components/icons/quote.js +6 -0
- package/dist/src/components/icons/quote.js.map +1 -0
- package/dist/src/components/icons/registry.d.ts +122 -0
- package/dist/src/components/icons/registry.js +4 -0
- package/dist/src/components/icons/registry.js.map +1 -0
- package/dist/src/components/icons/small-business.d.ts +1 -0
- package/dist/src/components/icons/small-business.js +6 -0
- package/dist/src/components/icons/small-business.js.map +1 -0
- package/dist/src/components/{image/image.css.js → img/img.css.js} +1 -1
- package/dist/src/components/img/img.css.js.map +1 -0
- package/dist/src/components/{image/image.d.ts → img/img.d.ts} +2 -2
- package/dist/src/components/img/img.js +17 -0
- package/dist/src/components/img/img.js.map +1 -0
- package/dist/src/components/input/input.css.d.ts +7 -5
- package/dist/src/components/input/input.css.js +1 -1
- package/dist/src/components/input/input.css.js.map +1 -1
- package/dist/src/components/input/input.d.ts +34 -12
- package/dist/src/components/input/input.js +30 -29
- package/dist/src/components/input/input.js.map +1 -1
- package/dist/src/components/install-options/install-option.css.js +2 -0
- package/dist/src/components/install-options/install-option.css.js.map +1 -0
- package/dist/src/components/install-options/install-option.d.ts +57 -0
- package/dist/src/components/install-options/install-option.js +29 -0
- package/dist/src/components/install-options/install-option.js.map +1 -0
- package/dist/src/components/install-options/install-options.css.js +1 -1
- package/dist/src/components/install-options/install-options.css.js.map +1 -1
- package/dist/src/components/install-options/install-options.d.ts +42 -31
- package/dist/src/components/install-options/install-options.js +42 -85
- package/dist/src/components/install-options/install-options.js.map +1 -1
- package/dist/src/components/key-takeaways/key-takeaways.css.d.ts +9 -0
- package/dist/src/components/key-takeaways/key-takeaways.css.js +2 -0
- package/dist/src/components/key-takeaways/key-takeaways.css.js.map +1 -0
- package/dist/src/components/key-takeaways/key-takeaways.d.ts +35 -0
- package/dist/src/components/key-takeaways/key-takeaways.js +10 -0
- package/dist/src/components/key-takeaways/key-takeaways.js.map +1 -0
- package/dist/src/components/label/label.js +3 -3
- package/dist/src/components/label/label.js.map +1 -1
- package/dist/src/components/link/link.css.js +1 -1
- package/dist/src/components/link/link.css.js.map +1 -1
- package/dist/src/components/link/link.d.ts +25 -16
- package/dist/src/components/link/link.js +3 -3
- package/dist/src/components/link/link.js.map +1 -1
- package/dist/src/components/list/list-item/list-item.css.js +1 -1
- package/dist/src/components/list/list-item/list-item.css.js.map +1 -1
- package/dist/src/components/list/list-item/list-item.d.ts +9 -7
- package/dist/src/components/list/list-item/list-item.js +3 -3
- package/dist/src/components/list/list-item/list-item.js.map +1 -1
- package/dist/src/components/list/list.d.ts +3 -2
- package/dist/src/components/list/list.js +2 -2
- package/dist/src/components/list/list.js.map +1 -1
- package/dist/src/components/logo-marquee/logo-marquee.css.js +1 -1
- package/dist/src/components/logo-marquee/logo-marquee.css.js.map +1 -1
- package/dist/src/components/logo-marquee/logo-marquee.d.ts +16 -2
- package/dist/src/components/logo-marquee/logo-marquee.js +10 -12
- package/dist/src/components/logo-marquee/logo-marquee.js.map +1 -1
- package/dist/src/components/meta/meta.css.d.ts +8 -0
- package/dist/src/components/meta/meta.css.js +2 -0
- package/dist/src/components/meta/meta.css.js.map +1 -0
- package/dist/src/components/meta/meta.d.ts +37 -0
- package/dist/src/components/meta/meta.js +2 -0
- package/dist/src/components/meta/meta.js.map +1 -0
- package/dist/src/components/motion-art/motion-art.d.ts +39 -2
- package/dist/src/components/motion-art/motion-art.js +1 -1
- package/dist/src/components/motion-art/motion-art.js.map +1 -1
- package/dist/src/components/newsletter-signup/newsletter-signup.css.js +2 -0
- package/dist/src/components/newsletter-signup/newsletter-signup.css.js.map +1 -0
- package/dist/src/components/newsletter-signup/newsletter-signup.d.ts +97 -0
- package/dist/src/components/newsletter-signup/newsletter-signup.js +37 -0
- package/dist/src/components/newsletter-signup/newsletter-signup.js.map +1 -0
- package/dist/src/components/overview/overview.css.js +1 -1
- package/dist/src/components/overview/overview.css.js.map +1 -1
- package/dist/src/components/overview/overview.d.ts +23 -12
- package/dist/src/components/overview/overview.js +9 -24
- package/dist/src/components/overview/overview.js.map +1 -1
- package/dist/src/components/p/p.css.js +2 -0
- package/dist/src/components/p/p.css.js.map +1 -0
- package/dist/src/components/{paragraph/paragraph.d.ts → p/p.d.ts} +3 -5
- package/dist/src/components/p/p.js +6 -0
- package/dist/src/components/p/p.js.map +1 -0
- package/dist/src/components/page-switcher/page-switcher.css.js +1 -1
- package/dist/src/components/page-switcher/page-switcher.css.js.map +1 -1
- package/dist/src/components/page-switcher/page-switcher.d.ts +28 -28
- package/dist/src/components/page-switcher/page-switcher.js +5 -13
- package/dist/src/components/page-switcher/page-switcher.js.map +1 -1
- package/dist/src/components/pagination-dots/pagination-dots.css.js +1 -1
- package/dist/src/components/pagination-dots/pagination-dots.css.js.map +1 -1
- package/dist/src/components/pagination-dots/pagination-dots.d.ts +4 -2
- package/dist/src/components/pagination-dots/pagination-dots.js +1 -1
- package/dist/src/components/pagination-dots/pagination-dots.js.map +1 -1
- package/dist/src/components/partner-banner/partner-banner.css.js +1 -1
- package/dist/src/components/partner-banner/partner-banner.css.js.map +1 -1
- package/dist/src/components/partner-banner/partner-banner.d.ts +44 -21
- package/dist/src/components/partner-banner/partner-banner.js +11 -11
- package/dist/src/components/partner-banner/partner-banner.js.map +1 -1
- package/dist/src/components/paste-button/paste-button.css.d.ts +10 -0
- package/dist/src/components/paste-button/paste-button.css.js +2 -0
- package/dist/src/components/paste-button/paste-button.css.js.map +1 -0
- package/dist/src/components/paste-button/paste-button.d.ts +68 -0
- package/dist/src/components/paste-button/paste-button.js +17 -0
- package/dist/src/components/paste-button/paste-button.js.map +1 -0
- package/dist/src/components/picture/picture.js +3 -3
- package/dist/src/components/picture/picture.js.map +1 -1
- package/dist/src/components/post-card/post-card.css.js +1 -1
- package/dist/src/components/post-card/post-card.css.js.map +1 -1
- package/dist/src/components/post-card/post-card.d.ts +65 -24
- package/dist/src/components/post-card/post-card.js +13 -9
- package/dist/src/components/post-card/post-card.js.map +1 -1
- package/dist/src/components/pricing-card/pricing-card.css.js +2 -0
- package/dist/src/components/pricing-card/pricing-card.css.js.map +1 -0
- package/dist/src/components/pricing-card/pricing-card.d.ts +80 -0
- package/dist/src/components/pricing-card/pricing-card.js +16 -0
- package/dist/src/components/pricing-card/pricing-card.js.map +1 -0
- package/dist/src/components/pricing-card/pricing-feature-group.css.js +2 -0
- package/dist/src/components/pricing-card/pricing-feature-group.css.js.map +1 -0
- package/dist/src/components/pricing-card/pricing-feature-group.d.ts +50 -0
- package/dist/src/components/pricing-card/pricing-feature-group.js +7 -0
- package/dist/src/components/pricing-card/pricing-feature-group.js.map +1 -0
- package/dist/src/components/pricing-card/pricing-feature.css.js +2 -0
- package/dist/src/components/pricing-card/pricing-feature.css.js.map +1 -0
- package/dist/src/components/pricing-card/pricing-feature.d.ts +64 -0
- package/dist/src/components/pricing-card/pricing-feature.js +19 -0
- package/dist/src/components/pricing-card/pricing-feature.js.map +1 -0
- package/dist/src/components/pricing-card/pricing-group.css.d.ts +3 -0
- package/dist/src/components/pricing-card/pricing-group.css.js +2 -0
- package/dist/src/components/pricing-card/pricing-group.css.js.map +1 -0
- package/dist/src/components/pricing-card/pricing-group.d.ts +48 -0
- package/dist/src/components/pricing-card/pricing-group.js +6 -0
- package/dist/src/components/pricing-card/pricing-group.js.map +1 -0
- package/dist/src/components/pricing-card/pricing-price.css.js +2 -0
- package/dist/src/components/pricing-card/pricing-price.css.js.map +1 -0
- package/dist/src/components/pricing-card/pricing-price.d.ts +56 -0
- package/dist/src/components/pricing-card/pricing-price.js +11 -0
- package/dist/src/components/pricing-card/pricing-price.js.map +1 -0
- package/dist/src/components/process-steps/process-step.css.js +2 -0
- package/dist/src/components/process-steps/process-step.css.js.map +1 -0
- package/dist/src/components/process-steps/process-step.d.ts +31 -0
- package/dist/src/components/process-steps/process-step.js +6 -0
- package/dist/src/components/process-steps/process-step.js.map +1 -0
- package/dist/src/components/process-steps/process-steps.css.js +1 -1
- package/dist/src/components/process-steps/process-steps.css.js.map +1 -1
- package/dist/src/components/process-steps/process-steps.d.ts +36 -19
- package/dist/src/components/process-steps/process-steps.js +5 -26
- package/dist/src/components/process-steps/process-steps.js.map +1 -1
- package/dist/src/components/product-hero/product-hero.css.js +2 -0
- package/dist/src/components/product-hero/product-hero.css.js.map +1 -0
- package/dist/src/components/product-hero/product-hero.d.ts +71 -0
- package/dist/src/components/product-hero/product-hero.js +123 -0
- package/dist/src/components/product-hero/product-hero.js.map +1 -0
- package/dist/src/components/product-upsell/product-upsell.css.js +2 -0
- package/dist/src/components/product-upsell/product-upsell.css.js.map +1 -0
- package/dist/src/components/product-upsell/product-upsell.d.ts +49 -0
- package/dist/src/components/product-upsell/product-upsell.js +14 -0
- package/dist/src/components/product-upsell/product-upsell.js.map +1 -0
- package/dist/src/components/progress-bar/progress-bar.css.d.ts +3 -0
- package/dist/src/components/progress-bar/progress-bar.css.js +2 -0
- package/dist/src/components/progress-bar/progress-bar.css.js.map +1 -0
- package/dist/src/components/progress-bar/progress-bar.d.ts +27 -0
- package/dist/src/components/progress-bar/progress-bar.js +15 -0
- package/dist/src/components/progress-bar/progress-bar.js.map +1 -0
- package/dist/src/components/quick-answer/quick-answer.css.js +1 -1
- package/dist/src/components/quick-answer/quick-answer.css.js.map +1 -1
- package/dist/src/components/quick-answer/quick-answer.d.ts +25 -12
- package/dist/src/components/quick-answer/quick-answer.js +13 -29
- package/dist/src/components/quick-answer/quick-answer.js.map +1 -1
- package/dist/src/components/radio/radio-group.css.js +1 -1
- package/dist/src/components/radio/radio-group.css.js.map +1 -1
- package/dist/src/components/radio/radio-group.d.ts +9 -5
- package/dist/src/components/radio/radio-group.js +5 -5
- package/dist/src/components/radio/radio-group.js.map +1 -1
- package/dist/src/components/radio/radio.css.d.ts +2 -1
- package/dist/src/components/radio/radio.css.js.map +1 -1
- package/dist/src/components/radio/radio.d.ts +8 -2
- package/dist/src/components/radio/radio.js +6 -5
- package/dist/src/components/radio/radio.js.map +1 -1
- package/dist/src/components/related-articles/related-articles.css.js +2 -0
- package/dist/src/components/related-articles/related-articles.css.js.map +1 -0
- package/dist/src/components/related-articles/related-articles.d.ts +52 -0
- package/dist/src/components/related-articles/related-articles.js +9 -0
- package/dist/src/components/related-articles/related-articles.js.map +1 -0
- package/dist/src/components/report-promo/report-promo.css.js +2 -0
- package/dist/src/components/report-promo/report-promo.css.js.map +1 -0
- package/dist/src/components/report-promo/report-promo.d.ts +70 -0
- package/dist/src/components/report-promo/report-promo.js +19 -0
- package/dist/src/components/report-promo/report-promo.js.map +1 -0
- package/dist/src/components/review/review-grid.css.js +1 -1
- package/dist/src/components/review/review-grid.css.js.map +1 -1
- package/dist/src/components/review/review-grid.d.ts +27 -6
- package/dist/src/components/review/review-grid.js +7 -7
- package/dist/src/components/review/review-grid.js.map +1 -1
- package/dist/src/components/review/review.css.js +1 -1
- package/dist/src/components/review/review.css.js.map +1 -1
- package/dist/src/components/review/review.d.ts +24 -17
- package/dist/src/components/review/review.js +7 -11
- package/dist/src/components/review/review.js.map +1 -1
- package/dist/src/components/section/section.css.js +1 -1
- package/dist/src/components/section/section.css.js.map +1 -1
- package/dist/src/components/section/section.d.ts +8 -6
- package/dist/src/components/section/section.js +1 -1
- package/dist/src/components/section/section.js.map +1 -1
- package/dist/src/components/section-header/section-header.css.js +1 -1
- package/dist/src/components/section-header/section-header.css.js.map +1 -1
- package/dist/src/components/section-header/section-header.d.ts +22 -23
- package/dist/src/components/section-header/section-header.js +6 -8
- package/dist/src/components/section-header/section-header.js.map +1 -1
- package/dist/src/components/select/select-option.d.ts +29 -0
- package/dist/src/components/select/select-option.js +2 -0
- package/dist/src/components/select/select-option.js.map +1 -0
- package/dist/src/components/{dropdown/dropdown.css.js → select/select.css.js} +1 -1
- package/dist/src/components/select/select.css.js.map +1 -0
- package/dist/src/components/select/select.d.ts +85 -0
- package/dist/src/components/select/select.js +36 -0
- package/dist/src/components/select/select.js.map +1 -0
- package/dist/src/components/shared/adopt-styles.d.ts +53 -0
- package/dist/src/components/shared/adopt-styles.js +2 -0
- package/dist/src/components/shared/adopt-styles.js.map +1 -0
- package/dist/src/components/shared/controller.slot.d.ts +65 -0
- package/dist/src/components/shared/controller.slot.js +2 -0
- package/dist/src/components/shared/controller.slot.js.map +1 -0
- package/dist/src/components/shared/events.d.ts +19 -23
- package/dist/src/components/shared/fill-width.css.js.map +1 -1
- package/dist/src/components/shared/flat-text.d.ts +15 -0
- package/dist/src/components/shared/flat-text.js +2 -0
- package/dist/src/components/shared/flat-text.js.map +1 -0
- package/dist/src/components/shared/form-control.d.ts +35 -3
- package/dist/src/components/shared/form-control.js +11 -1
- package/dist/src/components/shared/form-control.js.map +1 -1
- package/dist/src/components/shared/form-field.css.d.ts +5 -5
- package/dist/src/components/shared/form-field.css.js +1 -1
- package/dist/src/components/shared/form-field.css.js.map +1 -1
- package/dist/src/components/shared/hold.d.ts +14 -0
- package/dist/src/components/shared/hold.js +2 -0
- package/dist/src/components/shared/hold.js.map +1 -0
- package/dist/src/components/shared/prop-vocabulary.d.ts +81 -20
- package/dist/src/components/shared/prop-vocabulary.js +1 -1
- package/dist/src/components/shared/prop-vocabulary.js.map +1 -1
- package/dist/src/components/shared/tablist.d.ts +31 -0
- package/dist/src/components/shared/tablist.js +2 -0
- package/dist/src/components/shared/tablist.js.map +1 -0
- package/dist/src/components/shared/token-scales.d.ts +30 -4
- package/dist/src/components/shared/token-scales.js +1 -1
- package/dist/src/components/shared/token-scales.js.map +1 -1
- package/dist/src/components/spinner/spinner.css.js.map +1 -1
- package/dist/src/components/spinner/spinner.js +2 -2
- package/dist/src/components/spinner/spinner.js.map +1 -1
- package/dist/src/components/spotlight/spotlight.css.js +2 -0
- package/dist/src/components/spotlight/spotlight.css.js.map +1 -0
- package/dist/src/components/spotlight/spotlight.d.ts +31 -0
- package/dist/src/components/spotlight/spotlight.js +18 -0
- package/dist/src/components/spotlight/spotlight.js.map +1 -0
- package/dist/src/components/stat/stat-highlight.d.ts +1 -1
- package/dist/src/components/stat/stat.css.d.ts +1 -1
- package/dist/src/components/stat/stat.css.js +1 -1
- package/dist/src/components/stat/stat.css.js.map +1 -1
- package/dist/src/components/stat/stat.d.ts +41 -1
- package/dist/src/components/stat/stat.js +12 -1
- package/dist/src/components/stat/stat.js.map +1 -0
- package/dist/src/components/switch/switch.css.js +1 -1
- package/dist/src/components/switch/switch.css.js.map +1 -1
- package/dist/src/components/switch/switch.d.ts +10 -2
- package/dist/src/components/switch/switch.js +5 -4
- package/dist/src/components/switch/switch.js.map +1 -1
- package/dist/src/components/tab-group/tab-group.css.js +2 -0
- package/dist/src/components/tab-group/tab-group.css.js.map +1 -0
- package/dist/src/components/tab-group/tab-group.d.ts +172 -0
- package/dist/src/components/tab-group/tab-group.js +16 -0
- package/dist/src/components/tab-group/tab-group.js.map +1 -0
- package/dist/src/components/tab-group/tab-panel.d.ts +30 -0
- package/dist/src/components/tab-group/tab-panel.js +2 -0
- package/dist/src/components/tab-group/tab-panel.js.map +1 -0
- package/dist/src/components/tab-group/tab.css.js +2 -0
- package/dist/src/components/tab-group/tab.css.js.map +1 -0
- package/dist/src/components/tab-group/tab.d.ts +53 -0
- package/dist/src/components/tab-group/tab.js +2 -0
- package/dist/src/components/tab-group/tab.js.map +1 -0
- package/dist/src/components/table-of-contents/reading-line.d.ts +24 -0
- package/dist/src/components/table-of-contents/reading-line.js +2 -0
- package/dist/src/components/table-of-contents/reading-line.js.map +1 -0
- package/dist/src/components/table-of-contents/table-of-contents-item.css.d.ts +7 -0
- package/dist/src/components/table-of-contents/table-of-contents-item.css.js +2 -0
- package/dist/src/components/table-of-contents/table-of-contents-item.css.js.map +1 -0
- package/dist/src/components/table-of-contents/table-of-contents-item.d.ts +40 -0
- package/dist/src/components/table-of-contents/table-of-contents-item.js +2 -0
- package/dist/src/components/table-of-contents/table-of-contents-item.js.map +1 -0
- package/dist/src/components/table-of-contents/table-of-contents.css.d.ts +10 -0
- package/dist/src/components/table-of-contents/table-of-contents.css.js +2 -0
- package/dist/src/components/table-of-contents/table-of-contents.css.js.map +1 -0
- package/dist/src/components/table-of-contents/table-of-contents.d.ts +116 -0
- package/dist/src/components/table-of-contents/table-of-contents.js +24 -0
- package/dist/src/components/table-of-contents/table-of-contents.js.map +1 -0
- package/dist/src/components/tag/tag.css.js +1 -1
- package/dist/src/components/tag/tag.css.js.map +1 -1
- package/dist/src/components/tag/tag.d.ts +31 -4
- package/dist/src/components/tag/tag.js +1 -3
- package/dist/src/components/tag/tag.js.map +1 -1
- package/dist/src/components/terminal/terminal-cursor.d.ts +2 -3
- package/dist/src/components/terminal/terminal-cursor.js +1 -1
- package/dist/src/components/terminal/terminal-cursor.js.map +1 -1
- package/dist/src/components/terminal/terminal-line.css.d.ts +2 -0
- package/dist/src/components/terminal/terminal-line.css.js +2 -0
- package/dist/src/components/terminal/terminal-line.css.js.map +1 -0
- package/dist/src/components/terminal/terminal-line.d.ts +42 -0
- package/dist/src/components/terminal/terminal-line.js +8 -0
- package/dist/src/components/terminal/terminal-line.js.map +1 -0
- package/dist/src/components/terminal/terminal.css.d.ts +2 -0
- package/dist/src/components/terminal/terminal.css.js +2 -0
- package/dist/src/components/terminal/terminal.css.js.map +1 -0
- package/dist/src/components/terminal/terminal.d.ts +52 -0
- package/dist/src/components/terminal/terminal.js +19 -0
- package/dist/src/components/terminal/terminal.js.map +1 -0
- package/dist/src/components/terminal-hero/terminal-hero.css.d.ts +2 -0
- package/dist/src/components/terminal-hero/terminal-hero.css.js +2 -0
- package/dist/src/components/terminal-hero/terminal-hero.css.js.map +1 -0
- package/dist/src/components/terminal-hero/terminal-hero.d.ts +62 -0
- package/dist/src/components/terminal-hero/terminal-hero.js +48 -0
- package/dist/src/components/terminal-hero/terminal-hero.js.map +1 -0
- package/dist/src/components/terms/terms.css.d.ts +2 -0
- package/dist/src/components/terms/terms.css.js +2 -0
- package/dist/src/components/terms/terms.css.js.map +1 -0
- package/dist/src/components/terms/terms.d.ts +42 -0
- package/dist/src/components/terms/terms.js +9 -0
- package/dist/src/components/terms/terms.js.map +1 -0
- package/dist/src/components/textarea/textarea.css.d.ts +2 -2
- package/dist/src/components/textarea/textarea.css.js.map +1 -1
- package/dist/src/components/textarea/textarea.d.ts +15 -6
- package/dist/src/components/textarea/textarea.js +13 -17
- package/dist/src/components/textarea/textarea.js.map +1 -1
- package/dist/src/components/tooltip/tooltip.d.ts +25 -4
- package/dist/src/components/tooltip/tooltip.js +5 -8
- package/dist/src/components/tooltip/tooltip.js.map +1 -1
- package/dist/src/components/trust-panel/trust-card.css.d.ts +2 -0
- package/dist/src/components/trust-panel/trust-card.css.js +2 -0
- package/dist/src/components/trust-panel/trust-card.css.js.map +1 -0
- package/dist/src/components/trust-panel/trust-card.d.ts +31 -0
- package/dist/src/components/trust-panel/trust-card.js +10 -0
- package/dist/src/components/trust-panel/trust-card.js.map +1 -0
- package/dist/src/components/trust-panel/trust-panel.css.js +1 -1
- package/dist/src/components/trust-panel/trust-panel.css.js.map +1 -1
- package/dist/src/components/trust-panel/trust-panel.d.ts +28 -25
- package/dist/src/components/trust-panel/trust-panel.js +10 -57
- package/dist/src/components/trust-panel/trust-panel.js.map +1 -1
- package/dist/src/components/video/video.js +1 -1
- package/dist/src/components/video/video.js.map +1 -1
- package/dist/src/components/video-player/video-player.d.ts +25 -3
- package/dist/src/components/video-player/video-player.js +7 -7
- package/dist/src/components/video-player/video-player.js.map +1 -1
- package/dist/src/loader/create-loader.d.ts +13 -2
- package/dist/src/loader/create-loader.js +1 -1
- package/dist/src/loader/create-loader.js.map +1 -1
- package/dist/src/loader/loader.d.ts +7 -4
- package/dist/src/loader/loader.js.map +1 -1
- package/dist/src/loader/registry.js +1 -1
- package/dist/src/loader/registry.js.map +1 -1
- package/dist/src/tokens/fonts.css +1 -1
- package/dist/src/tokens/layout.css +1 -1
- package/dist/src/tokens/scheme-layer.d.ts +55 -0
- package/dist/src/tokens/scheme-layer.js +5 -0
- package/dist/src/tokens/scheme-layer.js.map +1 -0
- package/dist/src/tokens/themes/dark.d.ts +64 -0
- package/dist/src/tokens/themes/dark.js +2 -0
- package/dist/src/tokens/themes/dark.js.map +1 -0
- package/dist/src/tokens/tokens.css +1 -1
- package/dist/src/tokens/tokens.d.ts +4 -25
- package/dist/src/tokens/tokens.js +1 -1
- package/dist/src/tokens/tokens.js.map +1 -1
- package/dist/src/vendor/prism/LICENSE +21 -0
- package/dist/src/vendor/prism/README.md +65 -0
- package/dist/src/vendor/prism/prism.d.ts +7 -0
- package/dist/src/vendor/prism/prism.js +13 -0
- package/package.json +163 -105
- package/schemas/README.md +55 -1
- package/schemas/component-manifest.json +4110 -2766
- package/schemas/figma-component-map.json +3247 -0
- package/schemas/manifest-omissions.json +1 -26
- package/schemas/page-schema.json +28 -1
- package/dist/src/components/accordion/accordion-bg.css.js +0 -2
- package/dist/src/components/accordion/accordion-bg.css.js.map +0 -1
- package/dist/src/components/accordion/accordion-bg.d.ts +0 -52
- package/dist/src/components/accordion/accordion-bg.js +0 -76
- package/dist/src/components/accordion/accordion-bg.js.map +0 -1
- package/dist/src/components/alert/alert.css.js +0 -2
- package/dist/src/components/alert/alert.css.js.map +0 -1
- package/dist/src/components/alert/alert.d.ts +0 -55
- package/dist/src/components/alert/alert.js +0 -28
- package/dist/src/components/alert/alert.js.map +0 -1
- package/dist/src/components/anchor/anchor-nav.css.js +0 -2
- package/dist/src/components/anchor/anchor-nav.css.js.map +0 -1
- package/dist/src/components/anchor/anchor-nav.js +0 -67
- package/dist/src/components/anchor/anchor-nav.js.map +0 -1
- package/dist/src/components/awards/awards-flex.css.d.ts +0 -1
- package/dist/src/components/awards/awards-flex.css.js +0 -2
- package/dist/src/components/awards/awards-flex.css.js.map +0 -1
- package/dist/src/components/awards/awards-flex.d.ts +0 -65
- package/dist/src/components/awards/awards-flex.js +0 -68
- package/dist/src/components/awards/awards-flex.js.map +0 -1
- package/dist/src/components/awards/awards-spotlight.css.d.ts +0 -1
- package/dist/src/components/awards/awards-spotlight.css.js +0 -2
- package/dist/src/components/awards/awards-spotlight.css.js.map +0 -1
- package/dist/src/components/awards/awards-spotlight.d.ts +0 -60
- package/dist/src/components/awards/awards-spotlight.js +0 -51
- package/dist/src/components/awards/awards-spotlight.js.map +0 -1
- package/dist/src/components/card-features/card-features.css.js +0 -2
- package/dist/src/components/card-features/card-features.css.js.map +0 -1
- package/dist/src/components/card-features/card-features.d.ts +0 -43
- package/dist/src/components/card-features/card-features.js +0 -37
- package/dist/src/components/card-features/card-features.js.map +0 -1
- package/dist/src/components/cards/card.css.js +0 -2
- package/dist/src/components/cards/card.css.js.map +0 -1
- package/dist/src/components/cards/card.d.ts +0 -61
- package/dist/src/components/cards/card.js +0 -54
- package/dist/src/components/cards/card.js.map +0 -1
- package/dist/src/components/compare/compare.css.js +0 -2
- package/dist/src/components/compare/compare.css.js.map +0 -1
- package/dist/src/components/compare/compare.d.ts +0 -79
- package/dist/src/components/compare/compare.js +0 -122
- package/dist/src/components/compare/compare.js.map +0 -1
- package/dist/src/components/divider/divider-horizontal.d.ts +0 -15
- package/dist/src/components/divider/divider-horizontal.js +0 -11
- package/dist/src/components/divider/divider-horizontal.js.map +0 -1
- package/dist/src/components/divider/divider-vertical.d.ts +0 -16
- package/dist/src/components/divider/divider-vertical.js +0 -12
- package/dist/src/components/divider/divider-vertical.js.map +0 -1
- package/dist/src/components/dropdown/dropdown.css.js.map +0 -1
- package/dist/src/components/dropdown/dropdown.d.ts +0 -49
- package/dist/src/components/dropdown/dropdown.js +0 -36
- package/dist/src/components/dropdown/dropdown.js.map +0 -1
- package/dist/src/components/features/features.css.js +0 -2
- package/dist/src/components/features/features.css.js.map +0 -1
- package/dist/src/components/features/features.d.ts +0 -21
- package/dist/src/components/features/features.js +0 -28
- package/dist/src/components/features/features.js.map +0 -1
- package/dist/src/components/footer/footer-images.d.ts +0 -3
- package/dist/src/components/footer/footer-images.js +0 -9
- package/dist/src/components/footer/footer-images.js.map +0 -1
- package/dist/src/components/footer/footer-links-group.css.js +0 -2
- package/dist/src/components/footer/footer-links-group.css.js.map +0 -1
- package/dist/src/components/footer/footer-links-group.d.ts +0 -13
- package/dist/src/components/footer/footer-links-group.js +0 -5
- package/dist/src/components/footer/footer-links-group.js.map +0 -1
- package/dist/src/components/footer/footer-lp.d.ts +0 -26
- package/dist/src/components/footer/footer-lp.js +0 -45
- package/dist/src/components/footer/footer-lp.js.map +0 -1
- package/dist/src/components/footer/footer-nav-menu.css.js +0 -2
- package/dist/src/components/footer/footer-nav-menu.css.js.map +0 -1
- package/dist/src/components/footer/footer-nav-menu.js +0 -6
- package/dist/src/components/footer/footer-nav-menu.js.map +0 -1
- package/dist/src/components/header/header-code.css.js +0 -2
- package/dist/src/components/header/header-code.css.js.map +0 -1
- package/dist/src/components/header/header-code.d.ts +0 -50
- package/dist/src/components/header/header-code.js +0 -80
- package/dist/src/components/header/header-code.js.map +0 -1
- package/dist/src/components/header/header.css.js +0 -2
- package/dist/src/components/header/header.css.js.map +0 -1
- package/dist/src/components/header/header.d.ts +0 -32
- package/dist/src/components/header/header.js +0 -165
- package/dist/src/components/header/header.js.map +0 -1
- package/dist/src/components/heading/heading.css.js +0 -2
- package/dist/src/components/heading/heading.css.js.map +0 -1
- package/dist/src/components/heading/heading.js +0 -6
- package/dist/src/components/heading/heading.js.map +0 -1
- package/dist/src/components/help-text/help-text.css.d.ts +0 -3
- package/dist/src/components/help-text/help-text.css.js.map +0 -1
- package/dist/src/components/help-text/help-text.d.ts +0 -14
- package/dist/src/components/help-text/help-text.js +0 -4
- package/dist/src/components/help-text/help-text.js.map +0 -1
- package/dist/src/components/icons/analysis-icon.d.ts +0 -11
- package/dist/src/components/icons/analysis-icon.js +0 -6
- package/dist/src/components/icons/analysis-icon.js.map +0 -1
- package/dist/src/components/icons/arrow-down-icon.d.ts +0 -11
- package/dist/src/components/icons/arrow-down-icon.js +0 -6
- package/dist/src/components/icons/arrow-down-icon.js.map +0 -1
- package/dist/src/components/icons/arrow-icon.d.ts +0 -37
- package/dist/src/components/icons/arrow-icon.js +0 -6
- package/dist/src/components/icons/arrow-icon.js.map +0 -1
- package/dist/src/components/icons/arrow-right-icon.d.ts +0 -34
- package/dist/src/components/icons/arrow-right-icon.js +0 -6
- package/dist/src/components/icons/arrow-right-icon.js.map +0 -1
- package/dist/src/components/icons/arrow-up-icon.d.ts +0 -24
- package/dist/src/components/icons/arrow-up-icon.js +0 -6
- package/dist/src/components/icons/arrow-up-icon.js.map +0 -1
- package/dist/src/components/icons/av-comparatives-icon.d.ts +0 -13
- package/dist/src/components/icons/av-comparatives-icon.js +0 -13
- package/dist/src/components/icons/av-comparatives-icon.js.map +0 -1
- package/dist/src/components/icons/bd-ai-icon.d.ts +0 -13
- package/dist/src/components/icons/bd-ai-icon.js +0 -6
- package/dist/src/components/icons/bd-ai-icon.js.map +0 -1
- package/dist/src/components/icons/best-brands-icon.d.ts +0 -13
- package/dist/src/components/icons/best-brands-icon.js +0 -15
- package/dist/src/components/icons/best-brands-icon.js.map +0 -1
- package/dist/src/components/icons/brand-signature-icon.d.ts +0 -37
- package/dist/src/components/icons/brand-signature-icon.js +0 -6
- package/dist/src/components/icons/brand-signature-icon.js.map +0 -1
- package/dist/src/components/icons/check-icon.d.ts +0 -22
- package/dist/src/components/icons/check-icon.js +0 -6
- package/dist/src/components/icons/check-icon.js.map +0 -1
- package/dist/src/components/icons/circle-info-icon.d.ts +0 -26
- package/dist/src/components/icons/circle-info-icon.js +0 -8
- package/dist/src/components/icons/circle-info-icon.js.map +0 -1
- package/dist/src/components/icons/close-icon.d.ts +0 -11
- package/dist/src/components/icons/close-icon.js +0 -6
- package/dist/src/components/icons/close-icon.js.map +0 -1
- package/dist/src/components/icons/enterprise-icon.d.ts +0 -11
- package/dist/src/components/icons/enterprise-icon.js +0 -6
- package/dist/src/components/icons/enterprise-icon.js.map +0 -1
- package/dist/src/components/icons/family-icon.d.ts +0 -11
- package/dist/src/components/icons/family-icon.js +0 -8
- package/dist/src/components/icons/family-icon.js.map +0 -1
- package/dist/src/components/icons/globe-icon.d.ts +0 -11
- package/dist/src/components/icons/globe-icon.js +0 -6
- package/dist/src/components/icons/globe-icon.js.map +0 -1
- package/dist/src/components/icons/guide-icon.d.ts +0 -11
- package/dist/src/components/icons/guide-icon.js +0 -6
- package/dist/src/components/icons/guide-icon.js.map +0 -1
- package/dist/src/components/icons/home-icon.d.ts +0 -11
- package/dist/src/components/icons/home-icon.js +0 -6
- package/dist/src/components/icons/home-icon.js.map +0 -1
- package/dist/src/components/icons/icon-element.d.ts +0 -58
- package/dist/src/components/icons/icon-element.js +0 -2
- package/dist/src/components/icons/icon-element.js.map +0 -1
- package/dist/src/components/icons/individual-icon.d.ts +0 -11
- package/dist/src/components/icons/individual-icon.js +0 -6
- package/dist/src/components/icons/individual-icon.js.map +0 -1
- package/dist/src/components/icons/laurel-icon.d.ts +0 -11
- package/dist/src/components/icons/laurel-icon.js +0 -14
- package/dist/src/components/icons/laurel-icon.js.map +0 -1
- package/dist/src/components/icons/machine-learning-icon.d.ts +0 -11
- package/dist/src/components/icons/machine-learning-icon.js +0 -6
- package/dist/src/components/icons/machine-learning-icon.js.map +0 -1
- package/dist/src/components/icons/minus-icon.d.ts +0 -11
- package/dist/src/components/icons/minus-icon.js +0 -7
- package/dist/src/components/icons/minus-icon.js.map +0 -1
- package/dist/src/components/icons/missing-icon.d.ts +0 -41
- package/dist/src/components/icons/missing-icon.js +0 -8
- package/dist/src/components/icons/missing-icon.js.map +0 -1
- package/dist/src/components/icons/pause-icon.d.ts +0 -11
- package/dist/src/components/icons/pause-icon.js +0 -7
- package/dist/src/components/icons/pause-icon.js.map +0 -1
- package/dist/src/components/icons/pc-mag-2024-icon.d.ts +0 -13
- package/dist/src/components/icons/pc-mag-2024-icon.js +0 -14
- package/dist/src/components/icons/pc-mag-2024-icon.js.map +0 -1
- package/dist/src/components/icons/pc-mag-business-icon.d.ts +0 -13
- package/dist/src/components/icons/pc-mag-business-icon.js +0 -14
- package/dist/src/components/icons/pc-mag-business-icon.js.map +0 -1
- package/dist/src/components/icons/pc-mag-icon.d.ts +0 -13
- package/dist/src/components/icons/pc-mag-icon.js +0 -14
- package/dist/src/components/icons/pc-mag-icon.js.map +0 -1
- package/dist/src/components/icons/pc-mag-readers-icon.d.ts +0 -13
- package/dist/src/components/icons/pc-mag-readers-icon.js +0 -14
- package/dist/src/components/icons/pc-mag-readers-icon.js.map +0 -1
- package/dist/src/components/icons/play-icon.d.ts +0 -11
- package/dist/src/components/icons/play-icon.js +0 -6
- package/dist/src/components/icons/play-icon.js.map +0 -1
- package/dist/src/components/icons/plus-icon.d.ts +0 -11
- package/dist/src/components/icons/plus-icon.js +0 -6
- package/dist/src/components/icons/plus-icon.js.map +0 -1
- package/dist/src/components/icons/quote-icon.d.ts +0 -20
- package/dist/src/components/icons/quote-icon.js +0 -6
- package/dist/src/components/icons/quote-icon.js.map +0 -1
- package/dist/src/components/icons/small-business-icon.d.ts +0 -11
- package/dist/src/components/icons/small-business-icon.js +0 -6
- package/dist/src/components/icons/small-business-icon.js.map +0 -1
- package/dist/src/components/icons/top-product-icon.d.ts +0 -13
- package/dist/src/components/icons/top-product-icon.js +0 -14
- package/dist/src/components/icons/top-product-icon.js.map +0 -1
- package/dist/src/components/image/image.css.js.map +0 -1
- package/dist/src/components/image/image.js +0 -17
- package/dist/src/components/image/image.js.map +0 -1
- package/dist/src/components/input/input-clipboard.css.d.ts +0 -9
- package/dist/src/components/input/input-clipboard.css.js +0 -2
- package/dist/src/components/input/input-clipboard.css.js.map +0 -1
- package/dist/src/components/input/input-clipboard.d.ts +0 -52
- package/dist/src/components/input/input-clipboard.js +0 -62
- package/dist/src/components/input/input-clipboard.js.map +0 -1
- package/dist/src/components/light-carousel/light-carousel.css.js +0 -2
- package/dist/src/components/light-carousel/light-carousel.css.js.map +0 -1
- package/dist/src/components/light-carousel/light-carousel.d.ts +0 -74
- package/dist/src/components/light-carousel/light-carousel.js +0 -34
- package/dist/src/components/light-carousel/light-carousel.js.map +0 -1
- package/dist/src/components/modal/modal.css.js +0 -2
- package/dist/src/components/modal/modal.css.js.map +0 -1
- package/dist/src/components/modal/modal.d.ts +0 -52
- package/dist/src/components/modal/modal.js +0 -17
- package/dist/src/components/modal/modal.js.map +0 -1
- package/dist/src/components/paragraph/paragraph.css.js +0 -2
- package/dist/src/components/paragraph/paragraph.css.js.map +0 -1
- package/dist/src/components/paragraph/paragraph.js +0 -6
- package/dist/src/components/paragraph/paragraph.js.map +0 -1
- package/dist/src/components/pricing-cards/adopt-styles.d.ts +0 -10
- package/dist/src/components/pricing-cards/adopt-styles.js +0 -2
- package/dist/src/components/pricing-cards/adopt-styles.js.map +0 -1
- package/dist/src/components/pricing-cards/new-pricing-card.d.ts +0 -18
- package/dist/src/components/pricing-cards/new-pricing-card.js +0 -12
- package/dist/src/components/pricing-cards/new-pricing-card.js.map +0 -1
- package/dist/src/components/pricing-cards/new-pricing.css.js +0 -2
- package/dist/src/components/pricing-cards/new-pricing.css.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-actions.css.js +0 -2
- package/dist/src/components/pricing-cards/pricing-card-actions.css.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-actions.d.ts +0 -19
- package/dist/src/components/pricing-cards/pricing-card-actions.js +0 -25
- package/dist/src/components/pricing-cards/pricing-card-actions.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-container.css.js +0 -2
- package/dist/src/components/pricing-cards/pricing-card-container.css.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-container.d.ts +0 -14
- package/dist/src/components/pricing-cards/pricing-card-container.js +0 -6
- package/dist/src/components/pricing-cards/pricing-card-container.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-header.css.js +0 -2
- package/dist/src/components/pricing-cards/pricing-card-header.css.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-header.d.ts +0 -22
- package/dist/src/components/pricing-cards/pricing-card-header.js +0 -18
- package/dist/src/components/pricing-cards/pricing-card-header.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-pricing.css.js +0 -2
- package/dist/src/components/pricing-cards/pricing-card-pricing.css.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-pricing.d.ts +0 -39
- package/dist/src/components/pricing-cards/pricing-card-pricing.js +0 -49
- package/dist/src/components/pricing-cards/pricing-card-pricing.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-show-more.css.js +0 -2
- package/dist/src/components/pricing-cards/pricing-card-show-more.css.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card-show-more.d.ts +0 -16
- package/dist/src/components/pricing-cards/pricing-card-show-more.js +0 -12
- package/dist/src/components/pricing-cards/pricing-card-show-more.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card.css.js +0 -2
- package/dist/src/components/pricing-cards/pricing-card.css.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-card.d.ts +0 -155
- package/dist/src/components/pricing-cards/pricing-card.js +0 -258
- package/dist/src/components/pricing-cards/pricing-card.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-feature-item.css.js +0 -2
- package/dist/src/components/pricing-cards/pricing-feature-item.css.js.map +0 -1
- package/dist/src/components/pricing-cards/pricing-feature-item.d.ts +0 -13
- package/dist/src/components/pricing-cards/pricing-feature-item.js +0 -5
- package/dist/src/components/pricing-cards/pricing-feature-item.js.map +0 -1
- package/dist/src/components/progress/progress.css.d.ts +0 -3
- package/dist/src/components/progress/progress.css.js +0 -2
- package/dist/src/components/progress/progress.css.js.map +0 -1
- package/dist/src/components/progress/progress.d.ts +0 -19
- package/dist/src/components/progress/progress.js +0 -11
- package/dist/src/components/progress/progress.js.map +0 -1
- package/dist/src/components/radio/toggle-radio.d.ts +0 -28
- package/dist/src/components/radio/toggle-radio.js +0 -15
- package/dist/src/components/radio/toggle-radio.js.map +0 -1
- package/dist/src/components/spotlight-section/spotlight-section.css.js +0 -2
- package/dist/src/components/spotlight-section/spotlight-section.css.js.map +0 -1
- package/dist/src/components/spotlight-section/spotlight-section.d.ts +0 -22
- package/dist/src/components/spotlight-section/spotlight-section.js +0 -46
- package/dist/src/components/spotlight-section/spotlight-section.js.map +0 -1
- package/dist/src/components/stat/stat-tile.d.ts +0 -24
- package/dist/src/components/stat/stat-tile.js +0 -7
- package/dist/src/components/stat/stat-tile.js.map +0 -1
- package/dist/src/components/tab-list/tab-list.css.d.ts +0 -16
- package/dist/src/components/tab-list/tab-list.css.js +0 -2
- package/dist/src/components/tab-list/tab-list.css.js.map +0 -1
- package/dist/src/components/tab-list/tab-list.d.ts +0 -99
- package/dist/src/components/tab-list/tab-list.js +0 -25
- package/dist/src/components/tab-list/tab-list.js.map +0 -1
- package/dist/src/components/tabs/tabs.css.js +0 -2
- package/dist/src/components/tabs/tabs.css.js.map +0 -1
- package/dist/src/components/tabs/tabs.d.ts +0 -69
- package/dist/src/components/tabs/tabs.js +0 -29
- package/dist/src/components/tabs/tabs.js.map +0 -1
- package/dist/src/components/terminal/terminal-message.css.js +0 -2
- package/dist/src/components/terminal/terminal-message.css.js.map +0 -1
- package/dist/src/components/terminal/terminal-message.d.ts +0 -44
- package/dist/src/components/terminal/terminal-message.js +0 -68
- package/dist/src/components/terminal/terminal-message.js.map +0 -1
- package/dist/src/components/termsOfUse/terms.css.js +0 -2
- package/dist/src/components/termsOfUse/terms.css.js.map +0 -1
- package/dist/src/components/termsOfUse/terms.d.ts +0 -22
- package/dist/src/components/termsOfUse/terms.js +0 -78
- package/dist/src/components/termsOfUse/terms.js.map +0 -1
- /package/dist/src/components/{accordion/accordion-bg.css.d.ts → agent-endpoints/agent-endpoints-pills.css.d.ts} +0 -0
- /package/dist/src/components/{anchor → anchor-nav}/anchor-nav.css.d.ts +0 -0
- /package/dist/src/components/{card-features/card-features.css.d.ts → awards/award-marks.css.d.ts} +0 -0
- /package/dist/src/components/{cards/card.css.d.ts → awards/award.css.d.ts} +0 -0
- /package/dist/src/components/{compare/compare.css.d.ts → bar-chart/bar-chart.css.d.ts} +0 -0
- /package/dist/src/components/{features/features.css.d.ts → card/card-grid.css.d.ts} +0 -0
- /package/dist/src/components/{footer/footer-links-group.css.d.ts → card/card.css.d.ts} +0 -0
- /package/dist/src/components/{footer/footer-nav-menu.css.d.ts → dialog/dialog.css.d.ts} +0 -0
- /package/dist/src/components/{header/header-code.css.d.ts → footer/footer-group.css.d.ts} +0 -0
- /package/dist/src/components/{header/header.css.d.ts → footer/footer-nav.css.d.ts} +0 -0
- /package/dist/src/components/{heading/heading.css.d.ts → h/h.css.d.ts} +0 -0
- /package/dist/src/components/{image/image.css.d.ts → img/img.css.d.ts} +0 -0
- /package/dist/src/components/{light-carousel/light-carousel.css.d.ts → install-options/install-option.css.d.ts} +0 -0
- /package/dist/src/components/{modal/modal.css.d.ts → newsletter-signup/newsletter-signup.css.d.ts} +0 -0
- /package/dist/src/components/{paragraph/paragraph.css.d.ts → p/p.css.d.ts} +0 -0
- /package/dist/src/components/{pricing-cards → pricing-card}/pricing-card.css.d.ts +0 -0
- /package/dist/src/components/{pricing-cards/new-pricing.css.d.ts → pricing-card/pricing-feature-group.css.d.ts} +0 -0
- /package/dist/src/components/{pricing-cards/pricing-card-actions.css.d.ts → pricing-card/pricing-feature.css.d.ts} +0 -0
- /package/dist/src/components/{pricing-cards/pricing-card-container.css.d.ts → pricing-card/pricing-price.css.d.ts} +0 -0
- /package/dist/src/components/{pricing-cards/pricing-card-header.css.d.ts → process-steps/process-step.css.d.ts} +0 -0
- /package/dist/src/components/{pricing-cards/pricing-card-pricing.css.d.ts → product-hero/product-hero.css.d.ts} +0 -0
- /package/dist/src/components/{pricing-cards/pricing-card-show-more.css.d.ts → product-upsell/product-upsell.css.d.ts} +0 -0
- /package/dist/src/components/{pricing-cards/pricing-feature-item.css.d.ts → related-articles/related-articles.css.d.ts} +0 -0
- /package/dist/src/components/{spotlight-section/spotlight-section.css.d.ts → report-promo/report-promo.css.d.ts} +0 -0
- /package/dist/src/components/{dropdown/dropdown.css.d.ts → select/select.css.d.ts} +0 -0
- /package/dist/src/components/{tabs/tabs.css.d.ts → spotlight/spotlight.css.d.ts} +0 -0
- /package/dist/src/components/{terminal/terminal-message.css.d.ts → tab-group/tab-group.css.d.ts} +0 -0
- /package/dist/src/components/{termsOfUse/terms.css.d.ts → tab-group/tab.css.d.ts} +0 -0
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../p/p.js";import{ObserverController as n}from"../shared/controller.observer.js";import{SlotController as r}from"../shared/controller.slot.js";import"../h/h.js";import"../icons/plus.js";import"../img/img.js";import"../pagination-dots/pagination-dots.js";import i from"./carousel.css.js";import"../dialog/dialog.js";import{LitElement as a,html as o,nothing as s}from"lit";import{property as c,state as l}from"lit/decorators.js";var u=class extends a{constructor(...e){super(...e),this.closeLabel=``,this._slots=new r(this,{slots:[`icon`,`detail`],text:[`detail-title`]})}static{this.styles=[i]}get _dialog(){return this.renderRoot?.querySelector(`bd-dialog`)??null}_open(e){e.currentTarget.focus(),this._dialog.open=!0}render(){let e=e=>this._slots.has(e),t=this._slots.text(`detail-title`);return o`
|
|
2
2
|
<div class="bd-box">
|
|
3
|
-
|
|
4
|
-
<div class="bd-content">
|
|
5
|
-
<slot></slot>
|
|
6
|
-
</div>
|
|
3
|
+
<div class="bd-carousel-icon" ?hidden=${!e(`icon`)}><slot name="icon"></slot></div>
|
|
4
|
+
<div class="bd-content"><slot></slot></div>
|
|
7
5
|
<button
|
|
8
6
|
type="button"
|
|
9
7
|
class="bd-plus-button"
|
|
10
|
-
aria-
|
|
11
|
-
|
|
8
|
+
aria-haspopup="dialog"
|
|
9
|
+
aria-label=${t||s}
|
|
10
|
+
?hidden=${!e(`detail-title`)&&!e(`detail`)}
|
|
11
|
+
@click=${this._open}
|
|
12
12
|
>
|
|
13
|
-
<bd-
|
|
13
|
+
<bd-icon name="plus" size="md"></bd-icon>
|
|
14
14
|
</button>
|
|
15
15
|
</div>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
<bd-dialog close-label=${this.closeLabel||s}>
|
|
17
|
+
<slot name="detail-title" slot="title"></slot>
|
|
18
|
+
<slot name="detail"></slot>
|
|
19
|
+
</bd-dialog>
|
|
20
|
+
`}};t([c({type:String,attribute:`close-label`})],u.prototype,`closeLabel`,void 0),u=t([e(`bd-carousel-item`)],u);var d=class extends a{static{this.styles=[i]}constructor(){super(),this.label=``,this.itemLabel=``,this._pages=1,this._page=1,this._slots=new r(this,{slots:[],text:[`title`]}),this._trackSize=new n(this,()=>new ResizeObserver(()=>this._measure()),e=>e.observe(this.renderRoot.querySelector(`.bd-carousel-track`))),this._seeking=0}firstUpdated(){this.track=this.shadowRoot.querySelector(`.bd-carousel-track`),this.slotElement=this.shadowRoot.querySelector(`slot:not([name])`),this.track.addEventListener(`scroll`,()=>this._measure(),{passive:!0}),this.track.addEventListener(`scrollend`,()=>{this._seeking=0,this._measure()});for(let e of[`pointerdown`,`touchstart`,`wheel`,`keydown`])this.track.addEventListener(e,()=>{this._seeking=0},{passive:!0});this.slotElement.addEventListener(`slotchange`,()=>{this.waitForImagesToLoad().then(()=>this._measure())}),this.waitForImagesToLoad().then(()=>this._measure()),this._enableMouseDrag(this.track)}waitForImagesToLoad(){let e=this.slotElement.assignedElements({flatten:!0}).flatMap(e=>[...e.querySelectorAll(`img`),...[...e.querySelectorAll(`bd-img`)].map(e=>e.shadowRoot?.querySelector(`img`))]).filter(e=>e!=null).map(e=>new Promise(t=>{e.complete?t():(e.addEventListener(`load`,t,{once:!0}),e.addEventListener(`error`,t,{once:!0}))}));return Promise.all(e)}_step(){let e=this.slotElement?.assignedElements({flatten:!0})[0];if(!e)return 0;let t=parseFloat(getComputedStyle(this.track).columnGap)||0;return e.offsetWidth+t}_measure(){if(!this.track)return;let e=this.track.scrollWidth-this.track.clientWidth,t=this._step();if(e<=1||t<=0){this._pages=1,this._page=1;return}this._pages=Math.ceil((e-1)/t)+1;let n=this._travelled,r=n>=e-1?this._pages:Math.min(this._pages,Math.round(n/t)+1);this._seeking&&r!==this._seeking||(this._seeking=0,this._page=r)}_stop(e){let t=this.track.scrollWidth-this.track.clientWidth;return Math.min((e-1)*this._step(),t)}get _travelled(){return Math.abs(this.track.scrollLeft)}_scrollToStop(e){let t=getComputedStyle(this.track).direction===`rtl`?-1:1;this.track.scrollTo({left:t*this._stop(e)})}_goToPage(e){this._seeking=e,this._page=e,this._scrollToStop(e)}_enableMouseDrag(e){let t=null,n=!1;e.addEventListener(`pointerdown`,n=>{n.pointerType===`mouse`&&n.button===0&&(n.composedPath().some(e=>e.localName===`bd-dialog`)||(t={id:n.pointerId,x:n.clientX,left:e.scrollLeft,dragging:!1}))}),e.addEventListener(`pointermove`,n=>{if(t?.id!==n.pointerId)return;if(!(n.buttons&1)){t=null;return}let r=n.clientX-t.x;if(!t.dragging){if(Math.abs(r)<4)return;t.dragging=!0,e.setPointerCapture(n.pointerId),e.classList.add(`dragging`)}e.scrollLeft=t.left-r});let r=()=>{let r=t?.dragging;t=null,r&&(e.classList.remove(`dragging`),this._settle(),n=!0,setTimeout(()=>{n=!1}))};for(let t of[`pointerup`,`pointercancel`,`lostpointercapture`])e.addEventListener(t,r);e.addEventListener(`click`,e=>{n&&(e.preventDefault(),e.stopPropagation())},{capture:!0});for(let n of[`selectstart`,`dragstart`])e.addEventListener(n,e=>{t&&e.preventDefault()})}_settle(){let e=this._travelled,t=1;for(let n=2;n<=this._pages;n++)Math.abs(this._stop(n)-e)<Math.abs(this._stop(t)-e)&&(t=n);this._scrollToStop(t)}render(){let e=this._slots.has(`title`),t=this._slots.text(`title`)||this.label;return o`
|
|
21
|
+
<section
|
|
22
|
+
class="bd-carousel"
|
|
23
|
+
aria-labelledby=${e?`title`:s}
|
|
24
|
+
aria-label=${!e&&this.label?this.label:s}
|
|
25
|
+
>
|
|
26
|
+
<div class="bd-header-carousel" id="title" ?hidden=${!e}><slot name="title"></slot></div>
|
|
23
27
|
|
|
24
28
|
<div class="bd-carousel-track">
|
|
25
29
|
<slot></slot>
|
|
@@ -28,23 +32,11 @@ import{defineElement as e}from"../shared/define-element.js";import"../../tokens/
|
|
|
28
32
|
<bd-pagination-dots
|
|
29
33
|
count=${this._pages}
|
|
30
34
|
current=${this._page}
|
|
31
|
-
label=${
|
|
32
|
-
item-label
|
|
33
|
-
@bd-change=${e=>this._goToPage(e.detail.current)}
|
|
35
|
+
label=${t||s}
|
|
36
|
+
item-label=${this.itemLabel||s}
|
|
37
|
+
@bd-slide-change=${e=>this._goToPage(e.detail.current)}
|
|
34
38
|
></bd-pagination-dots>
|
|
35
39
|
</div>
|
|
36
|
-
</
|
|
37
|
-
|
|
38
|
-
<!-- Always rendered, and closed through open: a dialog closed is what
|
|
39
|
-
hands focus back to the + that opened it, and one removed while
|
|
40
|
-
open drops it on the page instead. It keeps the last item's copy
|
|
41
|
-
while it closes. -->
|
|
42
|
-
<bd-modal
|
|
43
|
-
.open="${!!this.selectedItem}"
|
|
44
|
-
.title="${this._shownItem?.title??``}"
|
|
45
|
-
.modalText="${this._shownItem?.modalText??``}"
|
|
46
|
-
.icon="${this._shownItem?.icon??``}"
|
|
47
|
-
@close-modal="${this.closeModal}"
|
|
48
|
-
></bd-modal>
|
|
49
|
-
`}static{this.styles=[r]}};t([o({type:String})],l.prototype,`title`,void 0),t([o({type:Number,attribute:`heading-level`})],l.prototype,`headingLevel`,void 0),t([o({type:Object})],l.prototype,`selectedItem`,void 0),t([s()],l.prototype,`_pages`,void 0),t([s()],l.prototype,`_page`,void 0),l=t([e(`bd-carousel-section`)],l);export{c as CarouselItem};
|
|
40
|
+
</section>
|
|
41
|
+
`}};t([c({type:String})],d.prototype,`label`,void 0),t([c({type:String,attribute:`item-label`})],d.prototype,`itemLabel`,void 0),t([l()],d.prototype,`_pages`,void 0),t([l()],d.prototype,`_page`,void 0),d=t([e(`bd-carousel`)],d);export{d as BdCarousel,u as BdCarouselItem};
|
|
50
42
|
//# sourceMappingURL=carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","names":["carouselCSS","_decorate","__decorate","carousel_css_default","CarouselItem","LitElement","property","defineElement","CustomCarousel","ObserverController","observer","n","className","type","promises","el","img","resolve","first","gap","max","step","left","page","sign","item","press","swallowClick","track","e","dx","release","dragged","nearest","state"],"sources":["../../../../src/components/carousel/carousel.ts"],"sourcesContent":["import { LitElement, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { ObserverController } from \"#shared/controller.observer.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport carouselCSS from \"#components/carousel/carousel.css.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/icons/plus-icon.ts\";\nimport \"#components/modal/modal.ts\";\nimport \"#components/pagination-dots/pagination-dots.ts\";\n\ninterface ModalItem {\n title? : string;\n modalText?: string;\n icon? : string;\n}\n\n@defineElement(\"bd-carousel-item\")\nexport class CarouselItem extends LitElement {\n @property({ type: String })\n icon?: string;\n @property({ type: String })\n title!: string;\n @property({ type: String })\n modalText?: string;\n\n _openModal() {\n this.dispatchEvent(\n new CustomEvent(\"open-modal\", {\n detail: {\n title : this.title,\n modalText: this.modalText,\n icon : this.icon\n },\n bubbles : true,\n composed: true\n })\n );\n }\n\n render() {\n return html`\n <div class=\"bd-box\">\n ${this.icon\n ? html`<img src=\"${this.icon}\" alt=\"\" class=\"bd-carousel-icon\" />`\n : \"\"}\n <div class=\"bd-content\">\n <slot></slot>\n </div>\n <button\n type=\"button\"\n class=\"bd-plus-button\"\n aria-label=\"Open modal for ${this.title}\"\n @click=\"${this._openModal}\"\n >\n <bd-plus-icon size=\"md\"></bd-plus-icon>\n </button>\n </div>\n `;\n }\n\n static styles = [carouselCSS];\n}\n\n@defineElement(\"bd-carousel-section\")\nclass CustomCarousel extends LitElement {\n @property({ type: String })\n title = \"\";\n @property({ type: Number, attribute: \"heading-level\" })\n headingLevel = 2;\n @property({ type: Object })\n selectedItem: ModalItem | null = null;\n // scroll stops, 1-based, read from the track; see _measure\n @state()\n _pages = 1;\n @state()\n _page = 1;\n\n _seeking : number;\n _shownItem? : ModalItem;\n track! : HTMLElement;\n slotElement!: HTMLSlotElement;\n\n /* The track's size decides how many stops it has. Observed for as long as\n the section is connected -- it used to start in firstUpdated and stop on\n disconnect, so a carousel moved in the page never counted again. */\n _trackSize = new ObserverController(this,\n () => new ResizeObserver(() => this._measure()),\n observer => observer.observe(this.renderRoot.querySelector(\".bd-carousel-track\")!));\n\n constructor() {\n super();\n this._seeking = 0;\n }\n\n /**\n * The heading element this section renders. Level is the document-outline\n * question and belongs to whoever composes the page; the type scale is this\n * component's own and does not move with it. Defaults to h2, because a\n * reusable section cannot know it is the only thing on the page, and two of\n * these used to put two h1s on one.\n */\n get _headingTag() {\n const n = Number(this.headingLevel);\n return Number.isInteger(n) && n >= 1 && n <= 6 ? `h${n}` : \"h2\";\n }\n\n /* bd-h already builds the dynamic tag, and it keeps the two questions apart\n the way this component needs: as= is the outline level the page composes,\n visual-level= is the type role, which is ours. Building the element here\n meant re-implementing bd-h and then hand-writing the type on top of it --\n and the hand-written type carried no line-height and no margin, so the\n title rendered with the browser's own h2 margins. */\n _renderTitle(className: string) {\n return html`<bd-h as=${this._headingTag} visual-level=\"h3\" class=${className}\n >${this.title}</bd-h\n >`;\n }\n\n firstUpdated() {\n this.track = this.shadowRoot!.querySelector<HTMLElement>(\".bd-carousel-track\")!;\n this.slotElement = this.shadowRoot!.querySelector(\"slot\")!;\n\n this.track.addEventListener(\"scroll\", () => this._measure(), { passive: true });\n this.track.addEventListener(\"scrollend\", () => { this._seeking = 0; this._measure(); });\n // a visitor taking hold of the track ends any scroll a control started\n for (const type of [\"pointerdown\", \"touchstart\", \"wheel\", \"keydown\"]) {\n this.track.addEventListener(type, () => { this._seeking = 0; }, { passive: true });\n }\n\n this.slotElement.addEventListener(\"slotchange\", () => {\n this.waitForImagesToLoad().then(() => this._measure());\n });\n\n this.waitForImagesToLoad().then(() => this._measure());\n\n this.addEventListener(\"open-modal\", (e) => {\n this.openModal(e.detail);\n });\n this._enableMouseDrag(this.track);\n }\n\n waitForImagesToLoad() {\n const assignedElements = this.slotElement.assignedElements({\n flatten: true\n });\n const images = assignedElements\n .map((el) => el.shadowRoot?.querySelector(\"img\"))\n .filter((img) => img != null);\n const promises = images.map(\n (img) =>\n new Promise<Event | void>((resolve) => {\n if (img.complete) resolve();\n else {\n img.addEventListener(\"load\", resolve, { once: true });\n img.addEventListener(\"error\", resolve, { once: true });\n }\n })\n );\n return Promise.all(promises);\n }\n\n /* The distance from one item to the next: an item's width and the gap. A\n scroll stop is one of these, and the controls count stops, not items --\n the last stop is wherever the track ends, which is short of a full step\n when the items do not divide the width evenly. */\n _step() {\n const first = this.slotElement?.assignedElements({ flatten: true })[0];\n if (!first) return 0;\n const gap = parseFloat(getComputedStyle(this.track).columnGap) || 0;\n return (first as HTMLElement).offsetWidth + gap;\n }\n\n /* How many stops the track has and which one it is at, from where it has\n scrolled to -- by a control, a drag, a wheel or a keyboard. While a\n control's smooth scroll is on its way, the dot it asked for stays current\n rather than stepping through every stop it passes. */\n _measure() {\n if (!this.track) return;\n const max = this.track.scrollWidth - this.track.clientWidth;\n const step = this._step();\n if (max <= 1 || step <= 0) {\n this._pages = 1;\n this._page = 1;\n return;\n }\n this._pages = Math.ceil((max - 1) / step) + 1;\n const left = this._travelled;\n const page = left >= max - 1 ? this._pages : Math.min(this._pages, Math.round(left / step) + 1);\n if (this._seeking && page !== this._seeking) return;\n this._seeking = 0;\n this._page = page;\n }\n\n /* Where stop n sits, as a distance from the track's start: a whole step per\n stop, and the last at the track's end. */\n _stop(n: number) {\n const max = this.track.scrollWidth - this.track.clientWidth;\n return Math.min((n - 1) * this._step(), max);\n }\n\n /* How far the track has scrolled from its start. On a right-to-left page\n the start is the right edge and scrollLeft runs from 0 down to minus the\n overflow, so the distance is its size and a position written back takes\n its sign; read as a plain number, every stop past the first sat at a\n scrollLeft the track can never reach, and scrolling to one clamped to the\n start. */\n get _travelled() {\n return Math.abs(this.track.scrollLeft);\n }\n\n _scrollToStop(n: number) {\n const sign = getComputedStyle(this.track).direction === \"rtl\" ? -1 : 1;\n this.track.scrollTo({ left: sign * this._stop(n) });\n }\n\n /* Smooth or instant is the track's scroll-behavior, which follows\n prefers-reduced-motion; see carousel.css.ts. */\n _goToPage(n: number) {\n this._seeking = n;\n this._page = n;\n this._scrollToStop(n);\n }\n\n openModal(item: ModalItem) {\n this.selectedItem = item;\n this._shownItem = item;\n }\n\n closeModal() {\n this.selectedItem = null;\n }\n\n /* Mouse drag, the one way of moving the track the browser does not give it:\n wheel, trackpad, touch, pen and the keyboard all scroll it natively. The\n docs promise click-and-drag, so it stays, as a thin layer over the\n scroller -- a mouse press only, one pixel of track per pixel of pointer\n (it was 1.5), and no snapping while the button is down, or every write to\n scrollLeft would land on a stop. On release it settles on the nearest one.\n\n This used to be mousedown and touchmove handlers writing scrollLeft over\n a track that was overflow: hidden, which left the wheel, the trackpad and\n the keyboard with nothing to move, and drove touch by script. */\n _enableMouseDrag(track: HTMLElement) {\n let press: { id: number; x: number; left: number; dragging: boolean } | null = null;\n let swallowClick = false;\n\n track.addEventListener(\"pointerdown\", (e) => {\n if (e.pointerType !== \"mouse\" || e.button !== 0) return;\n press = { id: e.pointerId, x: e.clientX, left: track.scrollLeft, dragging: false };\n });\n\n track.addEventListener(\"pointermove\", (e) => {\n if (press?.id !== e.pointerId) return;\n // the button came up off the track before the press became a drag\n if (!(e.buttons & 1)) { press = null; return; }\n const dx = e.clientX - press.x;\n if (!press.dragging) {\n // a few pixels of travel first, so a click on + stays a click\n if (Math.abs(dx) < 4) return;\n press.dragging = true;\n track.setPointerCapture(e.pointerId);\n track.classList.add(\"dragging\");\n }\n track.scrollLeft = press.left - dx;\n });\n\n const release = () => {\n const dragged = press?.dragging;\n press = null;\n if (!dragged) return;\n track.classList.remove(\"dragging\");\n this._settle();\n // the click a drag ends with is not a click on the + or link under it;\n // it comes in the same task as the pointerup, if it comes at all\n swallowClick = true;\n setTimeout(() => { swallowClick = false; });\n };\n for (const type of [\"pointerup\", \"pointercancel\", \"lostpointercapture\"]) {\n track.addEventListener(type, release);\n }\n\n track.addEventListener(\"click\", (e) => {\n if (!swallowClick) return;\n e.preventDefault();\n e.stopPropagation();\n }, { capture: true });\n\n // a press is for moving the track, not for selecting copy or dragging an icon out\n for (const type of [\"selectstart\", \"dragstart\"]) {\n track.addEventListener(type, (e) => { if (press) e.preventDefault(); });\n }\n }\n\n /* Where a drag leaves the track, the snap would take it: the nearest stop. */\n _settle() {\n const left = this._travelled;\n let nearest = 1;\n for (let n = 2; n <= this._pages; n++) {\n if (Math.abs(this._stop(n) - left) < Math.abs(this._stop(nearest) - left)) nearest = n;\n }\n this._scrollToStop(nearest);\n }\n\n render() {\n return html`\n <div class=\"bd-carousel\">\n ${this.title\n ? html`<div class=\"bd-header-carousel\">\n ${this._renderTitle(\"bd-section-title\")}\n </div>`\n : \"\"}\n\n <div class=\"bd-carousel-track\">\n <slot></slot>\n </div>\n <div class=\"bd-carousel-controls\">\n <bd-pagination-dots\n count=${this._pages}\n current=${this._page}\n label=${this.title || \"Slides\"}\n item-label=\"Go to item\"\n @bd-change=${(e: CustomEvent<{ current: number }>) => this._goToPage(e.detail.current)}\n ></bd-pagination-dots>\n </div>\n </div>\n\n <!-- Always rendered, and closed through open: a dialog closed is what\n hands focus back to the + that opened it, and one removed while\n open drops it on the page instead. It keeps the last item's copy\n while it closes. -->\n <bd-modal\n .open=\"${!!this.selectedItem}\"\n .title=\"${this._shownItem?.title ?? \"\"}\"\n .modalText=\"${this._shownItem?.modalText ?? \"\"}\"\n .icon=\"${this._shownItem?.icon ?? \"\"}\"\n @close-modal=\"${this.closeModal}\"\n ></bd-modal>\n `;\n }\n\n static styles = [carouselCSS];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-carousel-item\" : CarouselItem;\n \"bd-carousel-section\": CustomCarousel;\n }\n interface HTMLElementEventMap {\n \"open-modal\": CustomEvent<ModalItem>;\n }\n}\n"],"mappings":"A,mfAmBO,IAAMI,EAAN,cAA2BC,CAAW,CAQ3C,YAAa,CACX,KAAK,cACH,IAAI,YAAY,aAAc,CAC5B,OAAQ,CACN,MAAW,KAAK,MAChB,UAAW,KAAK,UAChB,KAAW,KAAK,IAClB,EACA,QAAU,GACV,SAAU,EACZ,CAAC,CACH,CACF,CAEA,QAAS,CACP,MAAO,EAAI;;UAEL,KA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EjB,GAAwC,KAAK,UAAU,EAAE,OAAO,OAAO,EAAE;;;;;;;;;;iBAUlF,CAAC,CAAC,KAAK,aAAa;kBACnB,KAAK,YAAY,OAAS,GAAG;sBACzB,KAAK,YAAY,WAAa,GAAG;iBACtC,KAAK,YAAY,MAAQ,GAAG;wBACrB,KAAK,WAAW;;KAGtC,C,OAEgB,KAAA,OAAA,CAACjC,CAAW,C,CAC9B,EApRGC,EAAA,CAAAK,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAE,EAAA,UAAA,QAAA,IAAA,EAAA,EAEzBP,EAAA,CAAAK,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,CAAA,EAAAE,EAAA,UAAA,eAAA,IAAA,EAAA,EAErDP,EAAA,CAAAK,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAE,EAAA,UAAA,eAAA,IAAA,EAAA,EAGzBP,EAAA,CAAAiC,EAAM,CAAA,EAAA1B,EAAA,UAAA,SAAA,IAAA,EAAA,EAENP,EAAA,CAAAiC,EAAM,CAAA,EAAA1B,EAAA,UAAA,QAAA,IAAA,EAAA,EAXR,EAAAP,EAAA,CAAAM,EAAc,qBAAqB,CAAA,EAAAC,CAAA,E"}
|
|
1
|
+
{"version":3,"file":"carousel.js","names":["carouselCSS","_decorate","__decorate","carousel_css_default","BdCarouselItem","LitElement","_args","SlotController","has","name","nothing","property","defineElement","BdCarousel","ObserverController","observer","type","promises","el","img","resolve","first","gap","max","step","left","page","n","sign","press","swallowClick","track","e","node","dx","release","dragged","nearest","titled","state"],"sources":["../../../../src/components/carousel/carousel.ts"],"sourcesContent":["import { LitElement, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { SlotController } from \"#shared/controller.slot.ts\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { ObserverController } from \"#shared/controller.observer.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport carouselCSS from \"#components/carousel/carousel.css.ts\";\nimport \"#components/dialog/dialog.ts\";\nimport \"#components/icons/plus.ts\";\nimport \"#components/pagination-dots/pagination-dots.ts\";\n/* The atoms the page writes into the carousel's and its items' slots. Neither\n renders them, but 3.x's module registered bd-h, and a page importing only\n this module still gets what it writes. */\nimport \"#components/h/h.ts\";\nimport \"#components/img/img.ts\";\nimport \"#components/p/p.ts\";\n\ntype ItemPart = \"icon\" | \"detail-title\" | \"detail\";\n\n/**\n * One card of a bd-carousel: an icon, the card's body, and a \"+\" button that\n * opens the item's own dialog with more about it.\n *\n * <bd-carousel-item close-label=\"Close\">\n * <bd-img slot=\"icon\" src=\"/icons/vpn.png\" alt=\"\"></bd-img>\n * <bd-p>Unlimited encrypted VPN traffic</bd-p>\n * <bd-h slot=\"detail-title\" as=\"h2\">VPN Protection</bd-h>\n * <bd-p slot=\"detail\">Our VPN encrypts your internet traffic.</bd-p>\n * </bd-carousel-item>\n *\n * EACH ITEM OWNS ITS DIALOG. The item renders a bd-dialog and forwards its\n * two detail slots into it: `detail-title` becomes the dialog's title and\n * `detail` its body, so the page's words are written once and shown where\n * they are read. 3.x sent open-modal up to the section, which copied the\n * item's title and text attributes into the one bd-modal it kept for every\n * item. The dialog closes itself (Esc, the backdrop, its close button,\n * `data-dialog=\"close\"`), and the platform hands focus back to the \"+\" that\n * opened it. `close-label` names the dialog's close button.\n *\n * The \"+\" says it opens a dialog (aria-haspopup=\"dialog\") and is named by the\n * detail title's words, copied with SlotController.text(): the title is in\n * the closed dialog, a hidden subtree an id reference would have to reach\n * through two shadow roots, and the copy follows the page's edits. It is\n * drawn only while there is a detail to open -- 3.x drew it on every card and\n * opened an empty modal from one with none.\n */\n@defineElement(\"bd-carousel-item\")\nexport class BdCarouselItem extends LitElement {\n static styles = [carouselCSS];\n\n /** The accessible name of the item's dialog's close button, passed to its bd-dialog. No default. */\n @property({ type: String, attribute: \"close-label\" })\n closeLabel = \"\";\n\n /* The card's body in the default slot is always drawn, so it is not followed. */\n _slots = new SlotController(this, { slots: [\"icon\", \"detail\"], text: [\"detail-title\"] });\n\n get _dialog() {\n return this.renderRoot?.querySelector(\"bd-dialog\") ?? null;\n }\n\n /* The button is focused first, so it is the element the dialog hands focus\n back to on close in every browser: Safari does not focus a button it was\n clicked on, and the dialog would return focus to the page instead. */\n _open(e: Event) {\n (e.currentTarget as HTMLButtonElement).focus();\n this._dialog!.open = true;\n }\n\n render() {\n const has = (name: ItemPart) => this._slots.has(name);\n const name = this._slots.text(\"detail-title\");\n return html`\n <div class=\"bd-box\">\n <div class=\"bd-carousel-icon\" ?hidden=${!has(\"icon\")}><slot name=\"icon\"></slot></div>\n <div class=\"bd-content\"><slot></slot></div>\n <button\n type=\"button\"\n class=\"bd-plus-button\"\n aria-haspopup=\"dialog\"\n aria-label=${name || nothing}\n ?hidden=${!has(\"detail-title\") && !has(\"detail\")}\n @click=${this._open}\n >\n <bd-icon name=\"plus\" size=\"md\"></bd-icon>\n </button>\n </div>\n <bd-dialog close-label=${this.closeLabel || nothing}>\n <slot name=\"detail-title\" slot=\"title\"></slot>\n <slot name=\"detail\"></slot>\n </bd-dialog>\n `;\n }\n}\n\n/**\n * A scrollable, draggable track of bd-carousel-item cards under a title, with\n * the package's slide dots under it.\n *\n * <bd-carousel item-label=\"Go to item\">\n * <bd-h slot=\"title\" as=\"h2\">Security Features</bd-h>\n * <bd-carousel-item>…</bd-carousel-item>\n * </bd-carousel>\n *\n * The carousel draws its title at the component-section role (heading-h3),\n * whatever level the page picks. It is a region named by that title, through\n * aria-labelledby on the box around the title slot; without a title, `label`\n * names it. The dots' group takes the same name, and `item-label` starts each\n * dot's -- 3.x hard-coded \"Go to item\".\n */\n@defineElement(\"bd-carousel\")\nexport class BdCarousel extends LitElement {\n static styles = [carouselCSS];\n\n /** The accessible name of the region while there is no title; with a title, the title names it. No default. */\n @property({ type: String })\n label = \"\";\n\n /** The accessible name each pagination dot starts with, passed to bd-pagination-dots. No default. */\n @property({ type: String, attribute: \"item-label\" })\n itemLabel = \"\";\n\n // scroll stops, 1-based, read from the track; see _measure\n @state()\n _pages = 1;\n @state()\n _page = 1;\n\n _seeking : number;\n track! : HTMLElement;\n slotElement!: HTMLSlotElement;\n\n /* The title, and its words for the names. The items are the track's own\n slotchange's to count (firstUpdated), so they are not followed here. */\n _slots = new SlotController(this, { slots: [], text: [\"title\"] });\n\n /* The track's size decides how many stops it has. Observed for as long as\n the carousel is connected -- it used to start in firstUpdated and stop on\n disconnect, so a carousel moved in the page never counted again. */\n _trackSize = new ObserverController(this,\n () => new ResizeObserver(() => this._measure()),\n observer => observer.observe(this.renderRoot.querySelector(\".bd-carousel-track\")!));\n\n constructor() {\n super();\n this._seeking = 0;\n }\n\n firstUpdated() {\n this.track = this.shadowRoot!.querySelector<HTMLElement>(\".bd-carousel-track\")!;\n this.slotElement = this.shadowRoot!.querySelector(\"slot:not([name])\")!;\n\n this.track.addEventListener(\"scroll\", () => this._measure(), { passive: true });\n this.track.addEventListener(\"scrollend\", () => { this._seeking = 0; this._measure(); });\n // a visitor taking hold of the track ends any scroll a control started\n for (const type of [\"pointerdown\", \"touchstart\", \"wheel\", \"keydown\"]) {\n this.track.addEventListener(type, () => { this._seeking = 0; }, { passive: true });\n }\n\n this.slotElement.addEventListener(\"slotchange\", () => {\n this.waitForImagesToLoad().then(() => this._measure());\n });\n\n this.waitForImagesToLoad().then(() => this._measure());\n\n this._enableMouseDrag(this.track);\n }\n\n /* The items' images, which are the page's now: an <img> it wrote, or the\n one inside a bd-img. */\n waitForImagesToLoad() {\n const assignedElements = this.slotElement.assignedElements({\n flatten: true\n });\n const images = assignedElements.flatMap((el) => [\n ...el.querySelectorAll(\"img\"),\n ...[...el.querySelectorAll(\"bd-img\")].map((img) => img.shadowRoot?.querySelector(\"img\"))\n ]).filter((img) => img != null);\n const promises = images.map(\n (img) =>\n new Promise<Event | void>((resolve) => {\n if (img.complete) resolve();\n else {\n img.addEventListener(\"load\", resolve, { once: true });\n img.addEventListener(\"error\", resolve, { once: true });\n }\n })\n );\n return Promise.all(promises);\n }\n\n /* The distance from one item to the next: an item's width and the gap. A\n scroll stop is one of these, and the controls count stops, not items --\n the last stop is wherever the track ends, which is short of a full step\n when the items do not divide the width evenly. */\n _step() {\n const first = this.slotElement?.assignedElements({ flatten: true })[0];\n if (!first) return 0;\n const gap = parseFloat(getComputedStyle(this.track).columnGap) || 0;\n return (first as HTMLElement).offsetWidth + gap;\n }\n\n /* How many stops the track has and which one it is at, from where it has\n scrolled to -- by a control, a drag, a wheel or a keyboard. While a\n control's smooth scroll is on its way, the dot it asked for stays current\n rather than stepping through every stop it passes. */\n _measure() {\n if (!this.track) return;\n const max = this.track.scrollWidth - this.track.clientWidth;\n const step = this._step();\n if (max <= 1 || step <= 0) {\n this._pages = 1;\n this._page = 1;\n return;\n }\n this._pages = Math.ceil((max - 1) / step) + 1;\n const left = this._travelled;\n const page = left >= max - 1 ? this._pages : Math.min(this._pages, Math.round(left / step) + 1);\n if (this._seeking && page !== this._seeking) return;\n this._seeking = 0;\n this._page = page;\n }\n\n /* Where stop n sits, as a distance from the track's start: a whole step per\n stop, and the last at the track's end. */\n _stop(n: number) {\n const max = this.track.scrollWidth - this.track.clientWidth;\n return Math.min((n - 1) * this._step(), max);\n }\n\n /* How far the track has scrolled from its start. On a right-to-left page\n the start is the right edge and scrollLeft runs from 0 down to minus the\n overflow, so the distance is its size and a position written back takes\n its sign; read as a plain number, every stop past the first sat at a\n scrollLeft the track can never reach, and scrolling to one clamped to the\n start. */\n get _travelled() {\n return Math.abs(this.track.scrollLeft);\n }\n\n _scrollToStop(n: number) {\n const sign = getComputedStyle(this.track).direction === \"rtl\" ? -1 : 1;\n this.track.scrollTo({ left: sign * this._stop(n) });\n }\n\n /* Smooth or instant is the track's scroll-behavior, which follows\n prefers-reduced-motion; see carousel.css.ts. */\n _goToPage(n: number) {\n this._seeking = n;\n this._page = n;\n this._scrollToStop(n);\n }\n\n /* Mouse drag, the one way of moving the track the browser does not give it:\n wheel, trackpad, touch, pen and the keyboard all scroll it natively. The\n docs promise click-and-drag, so it stays, as a thin layer over the\n scroller -- a mouse press only, one pixel of track per pixel of pointer\n (it was 1.5), and no snapping while the button is down, or every write to\n scrollLeft would land on a stop. On release it settles on the nearest one.\n\n This used to be mousedown and touchmove handlers writing scrollLeft over\n a track that was overflow: hidden, which left the wheel, the trackpad and\n the keyboard with nothing to move, and drove touch by script.\n\n A press inside an item's open dialog is not on the track. The dialog is\n in the top layer, drawn over the page, but in the flat tree it is still\n inside its item and so inside the track, and its pointer events pass\n through here on their way to the page: without this, selecting the\n dialog's text dragged the cards behind it. */\n _enableMouseDrag(track: HTMLElement) {\n let press: { id: number; x: number; left: number; dragging: boolean } | null = null;\n let swallowClick = false;\n\n track.addEventListener(\"pointerdown\", (e) => {\n if (e.pointerType !== \"mouse\" || e.button !== 0) return;\n if (e.composedPath().some((node) => (node as Element).localName === \"bd-dialog\")) return;\n press = { id: e.pointerId, x: e.clientX, left: track.scrollLeft, dragging: false };\n });\n\n track.addEventListener(\"pointermove\", (e) => {\n if (press?.id !== e.pointerId) return;\n // the button came up off the track before the press became a drag\n if (!(e.buttons & 1)) { press = null; return; }\n const dx = e.clientX - press.x;\n if (!press.dragging) {\n // a few pixels of travel first, so a click on + stays a click\n if (Math.abs(dx) < 4) return;\n press.dragging = true;\n track.setPointerCapture(e.pointerId);\n track.classList.add(\"dragging\");\n }\n track.scrollLeft = press.left - dx;\n });\n\n const release = () => {\n const dragged = press?.dragging;\n press = null;\n if (!dragged) return;\n track.classList.remove(\"dragging\");\n this._settle();\n // the click a drag ends with is not a click on the + or link under it;\n // it comes in the same task as the pointerup, if it comes at all\n swallowClick = true;\n setTimeout(() => { swallowClick = false; });\n };\n for (const type of [\"pointerup\", \"pointercancel\", \"lostpointercapture\"]) {\n track.addEventListener(type, release);\n }\n\n track.addEventListener(\"click\", (e) => {\n if (!swallowClick) return;\n e.preventDefault();\n e.stopPropagation();\n }, { capture: true });\n\n // a press is for moving the track, not for selecting copy or dragging an icon out\n for (const type of [\"selectstart\", \"dragstart\"]) {\n track.addEventListener(type, (e) => { if (press) e.preventDefault(); });\n }\n }\n\n /* Where a drag leaves the track, the snap would take it: the nearest stop. */\n _settle() {\n const left = this._travelled;\n let nearest = 1;\n for (let n = 2; n <= this._pages; n++) {\n if (Math.abs(this._stop(n) - left) < Math.abs(this._stop(nearest) - left)) nearest = n;\n }\n this._scrollToStop(nearest);\n }\n\n render() {\n /* The title's words: what the region is named by, and the dots' group\n with it, which a reference from inside bd-pagination-dots cannot reach. */\n const titled = this._slots.has(\"title\");\n const name = this._slots.text(\"title\") || this.label;\n return html`\n <section\n class=\"bd-carousel\"\n aria-labelledby=${titled ? \"title\" : nothing}\n aria-label=${!titled && this.label ? this.label : nothing}\n >\n <div class=\"bd-header-carousel\" id=\"title\" ?hidden=${!titled}><slot name=\"title\"></slot></div>\n\n <div class=\"bd-carousel-track\">\n <slot></slot>\n </div>\n <div class=\"bd-carousel-controls\">\n <bd-pagination-dots\n count=${this._pages}\n current=${this._page}\n label=${name || nothing}\n item-label=${this.itemLabel || nothing}\n @bd-slide-change=${(e: CustomEvent<{ current: number }>) => this._goToPage(e.detail.current)}\n ></bd-pagination-dots>\n </div>\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-carousel-item\": BdCarouselItem;\n \"bd-carousel\" : BdCarousel;\n }\n}\n"],"mappings":"A,ulBAgDO,IAAMI,EAAN,cAA6BC,CAAW,C,8BAKhC,KAAA,WAAA,GAGJ,KAAA,OAAA,IAAIE,EAAe,KAAM,CAAE,MAAO,CAAC,OAAQ,QAAQ,EAAG,KAAM,CAAC,cAAc,CAAE,CAAC,C,QAPvE,KAAA,OAAA,CAACP,CAAW,C,CAS5B,IAAI,SAAU,CACZ,OAAO,KAAK,YAAY,cAAc,WAAW,GAAK,IACxD,CAKA,MAAM,EAAU,CACd,EAAG,cAAoC,MAAM,EAC7C,KAAK,QAAS,KAAO,EACvB,CAEA,QAAS,CACP,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;yBACX,KAAK,WAAaA,EAAQ;+BACnB,GAAwC,KAAK,UAAU,EAAE,OAAO,OAAO,EAAE;;;;KAKvG,CACF,EApPGT,EAAA,CAAAU,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAE,EAAA,UAAA,QAAA,IAAA,EAAA,EAIzBZ,EAAA,CAAAU,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,CAAC,CAAA,EAAAE,EAAA,UAAA,YAAA,IAAA,EAAA,EAIlDZ,EAAA,CAAAsC,EAAM,CAAA,EAAA1B,EAAA,UAAA,SAAA,IAAA,EAAA,EAENZ,EAAA,CAAAsC,EAAM,CAAA,EAAA1B,EAAA,UAAA,QAAA,IAAA,EAAA,EAfR,EAAAZ,EAAA,CAAAW,EAAc,aAAa,CAAA,EAAAC,CAAA,E"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import "../../tokens/tokens.js";
|
|
3
|
+
import { SlotController } from "../shared/controller.slot.js";
|
|
3
4
|
declare const BdCheckbox_base: (new (...args: any[]) => import("../shared/form-control.js").FormControlInterface) & typeof LitElement;
|
|
5
|
+
/**
|
|
6
|
+
* A three-state checkbox: unchecked, checked and indeterminate.
|
|
7
|
+
*
|
|
8
|
+
* <bd-checkbox name="terms" value="yes" required>
|
|
9
|
+
* <span slot="label">I accept the <bd-link href="/terms">terms</bd-link></span>
|
|
10
|
+
* </bd-checkbox>
|
|
11
|
+
*
|
|
12
|
+
* The label is the page's, in the `label` slot, inside the <label> that wraps
|
|
13
|
+
* the native checkbox, so the slotted words are the checkbox's name.
|
|
14
|
+
*/
|
|
4
15
|
export declare class BdCheckbox extends BdCheckbox_base {
|
|
5
16
|
static styles: import("lit").CSSResult[];
|
|
6
17
|
name: string;
|
|
@@ -9,17 +20,20 @@ export declare class BdCheckbox extends BdCheckbox_base {
|
|
|
9
20
|
indeterminate: boolean;
|
|
10
21
|
disabled: boolean;
|
|
11
22
|
required: boolean;
|
|
12
|
-
label: string;
|
|
13
23
|
_defaults?: {
|
|
14
24
|
checked: boolean;
|
|
15
25
|
indeterminate: boolean;
|
|
16
26
|
};
|
|
27
|
+
protected _slots: SlotController<"label">;
|
|
17
28
|
connectedCallback(): void;
|
|
18
29
|
protected get _control(): HTMLInputElement | null;
|
|
19
30
|
protected _activate(): void;
|
|
20
31
|
updated(): void;
|
|
21
32
|
formResetCallback(): void;
|
|
22
33
|
formStateRestoreCallback(state: string | File | FormData | null): void;
|
|
34
|
+
_onInput(e: Event & {
|
|
35
|
+
target: HTMLInputElement;
|
|
36
|
+
}): void;
|
|
23
37
|
_onChange(e: Event & {
|
|
24
38
|
target: HTMLInputElement;
|
|
25
39
|
}): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{FormControl as
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{SlotController as n}from"../shared/controller.slot.js";import{FormControl as r,omitEmpty as i}from"../shared/form-control.js";import a from"./checkbox.css.js";import{LitElement as o,html as s}from"lit";import{property as c}from"lit/decorators.js";var l=class extends r(o){constructor(...e){super(...e),this.name=``,this.value=``,this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.required=!1,this._slots=new n(this,{slots:[`label`]})}static{this.styles=[a]}connectedCallback(){super.connectedCallback(),this._defaults??={checked:this.checked,indeterminate:this.indeterminate}}get _control(){return this.renderRoot?.querySelector?.(`input`)}_activate(){this._control?.click()}updated(){this._internals.setFormValue(this.checked?this.value||`on`:null,String(this.checked)),this._mirrorValidity(this._control)}formResetCallback(){super.formResetCallback(),this._defaults&&(this.checked=this._defaults.checked,this.indeterminate=this._defaults.indeterminate)}formStateRestoreCallback(e){this.checked=e===`true`}_onInput(e){this.indeterminate&&(e.target.checked=!0),this.indeterminate=!1,this.checked=e.target.checked}_onChange(e){this.checked=e.target.checked,this._relayChange()}_onKeydown(e){e.key===`Enter`&&(e.preventDefault(),this._submitImplicitly())}_renderMark(){return this.indeterminate?s`<svg class="mark" viewBox="0 0 12 12" aria-hidden="true" focusable="false">
|
|
2
2
|
<path d="M2.5 6H9.5" />
|
|
3
|
-
</svg>`:this.checked?
|
|
3
|
+
</svg>`:this.checked?s`<svg class="mark" viewBox="0 0 12 12" aria-hidden="true" focusable="false">
|
|
4
4
|
<path d="M2.5 6.5L4.75 8.75L9.5 3.5" />
|
|
5
|
-
</svg>`:``}render(){return
|
|
5
|
+
</svg>`:``}render(){return s`
|
|
6
6
|
<label class="bd-checkbox">
|
|
7
7
|
<input
|
|
8
8
|
type="checkbox"
|
|
@@ -10,11 +10,12 @@ import{defineElement as e}from"../shared/define-element.js";import"../../tokens/
|
|
|
10
10
|
.indeterminate=${this.indeterminate}
|
|
11
11
|
?disabled=${this.disabled||this._formDisabled}
|
|
12
12
|
?required=${this.required}
|
|
13
|
+
@input=${this._onInput}
|
|
13
14
|
@change=${this._onChange}
|
|
14
15
|
@keydown=${this._onKeydown}
|
|
15
16
|
/>
|
|
16
17
|
<span class="box" part="box">${this._renderMark()}</span>
|
|
17
|
-
<span class="label" part="label"
|
|
18
|
+
<span class="label" part="label" ?hidden=${!this._slots.has(`label`)}><slot name="label"></slot></span>
|
|
18
19
|
</label>
|
|
19
|
-
`}};t([
|
|
20
|
+
`}};t([c({type:String,reflect:!0,converter:i})],l.prototype,`name`,void 0),t([c({type:String})],l.prototype,`value`,void 0),t([c({type:Boolean,reflect:!0})],l.prototype,`checked`,void 0),t([c({type:Boolean,reflect:!0})],l.prototype,`indeterminate`,void 0),t([c({type:Boolean,reflect:!0})],l.prototype,`disabled`,void 0),t([c({type:Boolean})],l.prototype,`required`,void 0),l=t([e(`bd-checkbox`)],l);export{l as BdCheckbox};
|
|
20
21
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":["checkboxCSS","_decorate","__decorate","checkbox_css_default","BdCheckbox","FormControl","LitElement","_args","state","property","omitEmpty","defineElement"],"sources":["../../../../src/components/checkbox/checkbox.ts"],"sourcesContent":["import { LitElement, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\n// the extension matters: \"./checkbox.css\" only resolved because Vite appends\n// .js for us, and failed outright under native ESM\nimport checkboxCSS from \"./checkbox.css.ts\";\nimport { FormControl, omitEmpty } from \"#shared/form-control.ts\";\n\n@defineElement(\"bd-checkbox\")\nexport class BdCheckbox extends FormControl(LitElement) {\n static styles = [checkboxCSS];\n\n /* reflected, because a form reads the name off the element: see\n shared/form-control.ts */\n @property({ type: String, reflect: true, converter: omitEmpty })\n name = \"\";\n @property({ type: String })\n value = \"\";\n // checked was left undefined, which rendered aria-checked=\"\" — an invalid\n // value, so an unchecked box announced no state at all\n @property({ type: Boolean, reflect: true })\n checked = false;\n @property({ type: Boolean, reflect: true })\n indeterminate = false;\n @property({ type: Boolean, reflect: true })\n disabled = false;\n @property({ type: Boolean })\n required = false;\n
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["checkboxCSS","_decorate","__decorate","checkbox_css_default","BdCheckbox","FormControl","LitElement","_args","SlotController","state","property","omitEmpty","defineElement"],"sources":["../../../../src/components/checkbox/checkbox.ts"],"sourcesContent":["import { LitElement, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\n// the extension matters: \"./checkbox.css\" only resolved because Vite appends\n// .js for us, and failed outright under native ESM\nimport checkboxCSS from \"./checkbox.css.ts\";\nimport { FormControl, omitEmpty } from \"#shared/form-control.ts\";\nimport { SlotController } from \"#shared/controller.slot.ts\";\n\n/**\n * A three-state checkbox: unchecked, checked and indeterminate.\n *\n * <bd-checkbox name=\"terms\" value=\"yes\" required>\n * <span slot=\"label\">I accept the <bd-link href=\"/terms\">terms</bd-link></span>\n * </bd-checkbox>\n *\n * The label is the page's, in the `label` slot, inside the <label> that wraps\n * the native checkbox, so the slotted words are the checkbox's name.\n */\n@defineElement(\"bd-checkbox\")\nexport class BdCheckbox extends FormControl(LitElement) {\n static styles = [checkboxCSS];\n\n /* reflected, because a form reads the name off the element: see\n shared/form-control.ts */\n @property({ type: String, reflect: true, converter: omitEmpty })\n name = \"\";\n @property({ type: String })\n value = \"\";\n // checked was left undefined, which rendered aria-checked=\"\" — an invalid\n // value, so an unchecked box announced no state at all\n @property({ type: Boolean, reflect: true })\n checked = false;\n @property({ type: Boolean, reflect: true })\n indeterminate = false;\n @property({ type: Boolean, reflect: true })\n disabled = false;\n @property({ type: Boolean })\n required = false;\n\n _defaults?: { checked: boolean; indeterminate: boolean };\n protected _slots = new SlotController(this, { slots: [\"label\"] });\n\n connectedCallback() {\n super.connectedCallback();\n /* What reset returns to: the state the box joined the page in. A native\n checkbox keeps its default in the checked attribute, but this one's\n checked reflects, so the attribute follows every click and cannot. */\n this._defaults ??= { checked: this.checked, indeterminate: this.indeterminate };\n }\n\n protected get _control(): HTMLInputElement | null {\n return this.renderRoot?.querySelector?.(\"input\");\n }\n\n // a native checkbox toggles when its label is clicked, or on el.click()\n protected _activate() {\n this._control?.click();\n }\n\n updated() {\n // with no value it submits \"on\", as a native checkbox does\n this._internals.setFormValue(this.checked ? this.value || \"on\" : null, String(this.checked));\n this._mirrorValidity(this._control);\n }\n\n formResetCallback() {\n super.formResetCallback();\n /* A reset can reach a box that was never connected -- one in a <form>\n built in script -- and that box has taken no default yet, so it keeps\n what it holds. */\n if (!this._defaults) return;\n this.checked = this._defaults.checked;\n this.indeterminate = this._defaults.indeterminate;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.checked = state === \"true\";\n }\n\n /* A toggle fires the native input, then change. input leaves the shadow\n root by itself, retargeted to this element, and this listener runs on the\n native box before any of the page's, so checked follows the box here and\n a listener reads event.target.checked as it now is. change stops at the\n shadow root and is sent once from here (shared/form-control.ts). */\n _onInput(e: Event & { target: HTMLInputElement }) {\n /* Clicking an indeterminate box resolves it to checked. A native one\n toggles whatever it held underneath, so a box that was indeterminate\n and checked would clear; this one always resolved to checked, and\n still does. */\n if (this.indeterminate) e.target.checked = true;\n this.indeterminate = false;\n this.checked = e.target.checked;\n }\n\n _onChange(e: Event & { target: HTMLInputElement }) {\n this.checked = e.target.checked;\n this._relayChange();\n }\n\n /* Space is the native input's own, and the only key that toggles. Enter\n submits the form, as it does on a native checkbox -- it used to toggle\n here, which no native checkbox does, so a reader pressing Enter to send\n a form changed their answer instead. See shared/form-control.ts. */\n _onKeydown(e: KeyboardEvent) {\n if (e.key !== \"Enter\") return;\n e.preventDefault();\n this._submitImplicitly();\n }\n\n _renderMark() {\n if (this.indeterminate) {\n return html`<svg class=\"mark\" viewBox=\"0 0 12 12\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M2.5 6H9.5\" />\n </svg>`;\n }\n if (this.checked) {\n return html`<svg class=\"mark\" viewBox=\"0 0 12 12\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M2.5 6.5L4.75 8.75L9.5 3.5\" />\n </svg>`;\n }\n return \"\";\n }\n\n render() {\n // The row is the control, so the label is part of it rather than\n // decoration beside it: clicking the label toggles, and the target clears\n // the 24px WCAG 2.5.8 asks for, which the 20px box alone cannot. It used\n // to be a <div role=\"checkbox\"> with its keys written by hand; it is a\n // native checkbox now, drawn over by the box, so the browser supplies the\n // role, the states, Space and the disabled tab order.\n return html`\n <label class=\"bd-checkbox\">\n <input\n type=\"checkbox\"\n .checked=${this.checked}\n .indeterminate=${this.indeterminate}\n ?disabled=${this.disabled || this._formDisabled}\n ?required=${this.required}\n @input=${this._onInput}\n @change=${this._onChange}\n @keydown=${this._onKeydown}\n />\n <span class=\"box\" part=\"box\">${this._renderMark()}</span>\n <span class=\"label\" part=\"label\" ?hidden=${!this._slots.has(\"label\")}><slot name=\"label\"></slot></span>\n </label>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-checkbox\": BdCheckbox;\n }\n}\n"],"mappings":"A,maAsBO,IAAMI,EAAN,cAAyBC,EAAYC,CAAU,CAAC,AAAC,C,8BAM/C,KAAA,KAAA,GAEC,KAAA,MAAA,GAIE,KAAA,QAAA,GAEM,KAAA,cAAA,GAEL,KAAA,SAAA,GAEA,KAAA,SAAA,GAGQ,KAAA,OAAA,IAAIE,EAAe,KAAM,CAAE,MAAO,CAAC,OAAO,CAAE,CAAC,C,QApBhD,KAAA,OAAA,CAACR,CAAW,C,CAsB5B,mBAAoB,CAClB,MAAM,kBAAkB,EAIxB,KAAK,YAAc,CAAE,QAAS,KAAK,QAAS,cAAe,KAAK,aAAc,CAChF,CAEA,IAAc,UAAoC,CAChD,OAAO,KAAK,YAAY,gBAAgB,OAAO,CACjD,CAGA,WAAsB,CACpB,KAAK,UAAU,MAAM,CACvB,CAEA,SAAU,CAER,KAAK,WAAW,aAAa,KAAK,QAAU,KAAK,OAAS,KAAO,KAAM,OAAO,KAAK,OAAO,CAAC,EAC3F,KAAK,gBAAgB,KAAK,QAAQ,CACpC,CAEA,mBAAoB,CAClB,MAAM,kBAAkB,EAInB,KAAK,YACV,KAAK,QAAU,KAAK,UAAU,QAC9B,KAAK,cAAgB,KAAK,UAAU,cACtC,CAEA,yBAAyB,EAAwC,CAC/D,KAAK,QAAUS,IAAU,MAC3B,CAOA,SAAS,EAAyC,CAK5C,KAAK,gBAAe,EAAE,OAAO,QAAU,IAC3C,KAAK,cAAgB,GACrB,KAAK,QAAU,EAAE,OAAO,OAC1B,CAEA,UAAU,EAAyC,CACjD,KAAK,QAAU,EAAE,OAAO,QACxB,KAAK,aAAa,CACpB,CAMA,WAAW,EAAkB,CACvB,EAAE,MAAQ,UACd,EAAE,eAAe,EACjB,KAAK,kBAAkB,EACzB,CAEA,aAAc,CAWZ,OAVI,KAAK,cACA,CAAI;;cAIT,KAAK,QACA,CAAI;;cAIN,EACT,CAEA,QAAS,CAOP,MAAO,EAAI;;;;qBAIM,KAAK,QAAQ;2BACP,KAAK,cAAc;sBACxB,KAAK,UAAY,KAAK,cAAc;sBACpC,KAAK,SAAS;mBACjB,KAAK,SAAS;oBACb,KAAK,UAAU;qBACd,KAAK,WAAW;;uCAEE,KAAK,YAAY,EAAE;mDACP,CAAC,KAAK,OAAO,IAAI,OAAO,EAAE;;KAG3E,CACF,EA3HGR,EAAA,CAAAS,EAAS,CAAE,KAAM,OAAQ,QAAS,GAAM,UAAWC,CAAU,CAAC,CAAA,EAAAP,EAAA,UAAA,OAAA,IAAA,EAAA,EAE9DH,EAAA,CAAAS,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAN,EAAA,UAAA,QAAA,IAAA,EAAA,EAIzBH,EAAA,CAAAS,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAAN,EAAA,UAAA,UAAA,IAAA,EAAA,EAEzCH,EAAA,CAAAS,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAAN,EAAA,UAAA,gBAAA,IAAA,EAAA,EAEzCH,EAAA,CAAAS,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAAN,EAAA,UAAA,WAAA,IAAA,EAAA,EAEzCH,EAAA,CAAAS,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAAAN,EAAA,UAAA,WAAA,IAAA,EAAA,EAlB5B,EAAAH,EAAA,CAAAW,EAAc,aAAa,CAAA,EAAAR,CAAA,E"}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
/** Styled entirely from design tokens — see npm run lint:tokens. */
|
|
2
2
|
export declare const codeCSS: import("lit").CSSResult;
|
|
3
|
+
/**
|
|
4
|
+
* The page's own <pre><code>, and the tokens Prism writes into it.
|
|
5
|
+
*
|
|
6
|
+
* The code is the page's, highlighted where it is, so the <pre>, the <code>
|
|
7
|
+
* and every token <span> are light DOM: no rule in the block's shadow root
|
|
8
|
+
* reaches past the slotted <pre>. bd-code adopts this sheet into the tree it
|
|
9
|
+
* sits in (shared/adopt-styles.ts), and every rule keeps to a block by naming
|
|
10
|
+
* its tag. In :where(), so a page's own rule for its code wins.
|
|
11
|
+
*
|
|
12
|
+
* The box is the block's own <pre>'s, in codeCSS above. The token colours
|
|
13
|
+
* are the shipped blog's monochrome Prism theme (prism.css in www-blog-csg's
|
|
14
|
+
* blocks/csg/code): every token one ink, the code's own, with bold and
|
|
15
|
+
* italic the only marks, and the selection the pressed ground.
|
|
16
|
+
*/
|
|
17
|
+
export declare const pageCodeCSS: import("lit").CSSResult;
|
|
3
18
|
export default codeCSS;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{css as e}from"lit";var t=e`:host{display:inline}:host(:not([block])) code{font-family:var(--typography-code-inline-fontFamily);font-size:var(--typography-code-inline-fontSize);font-weight:var(--typography-code-inline-fontWeight);line-height:var(--typography-code-inline-lineHeight);letter-spacing:var(--typography-code-inline-letterSpacing);color:var(--color-text-primary);background:var(--color-surface-subtle);padding:0 var(--spacing-4);border-radius:var(--shape-radius-sm);overflow-wrap:break-word}:host([block]){display:block}:host([block]) pre{font-family:var(--typography-code-block-fontFamily);font-size:var(--typography-code-block-fontSize);font-weight:var(--typography-code-block-fontWeight);line-height:var(--typography-code-block-lineHeight);letter-spacing:var(--typography-code-block-letterSpacing);color:var(--
|
|
1
|
+
import{css as e}from"lit";var t=e`:host{display:inline}:host(:not([block])) code{font-family:var(--typography-code-inline-fontFamily);font-size:var(--typography-code-inline-fontSize);font-weight:var(--typography-code-inline-fontWeight);line-height:var(--typography-code-inline-lineHeight);letter-spacing:var(--typography-code-inline-letterSpacing);color:var(--color-text-primary);background:var(--color-surface-subtle);padding:0 var(--spacing-4);border-radius:var(--shape-radius-sm);overflow-wrap:break-word}:host([block]){display:block}figure{margin:0}.code{position:relative}:host([block]) pre{padding:var(--spacing-16);border:var(--border-width-1) solid var(--color-border-container);border-radius:var(--shape-radius-2xl);background:var(--color-surface-container);color:var(--color-text-primary);font-family:var(--typography-code-block-fontFamily);font-size:var(--typography-code-block-fontSize);font-weight:var(--typography-code-block-fontWeight);line-height:var(--typography-code-block-lineHeight);letter-spacing:var(--typography-code-block-letterSpacing);text-align:start;white-space:pre-wrap;overflow-wrap:anywhere;tab-size:4;margin:0;overflow-x:auto}:host([block]) code{font:inherit;letter-spacing:inherit;color:inherit;background:0 0;padding:0}:host([block]) pre:focus-visible{outline:var(--border-width-2) solid transparent;outline-offset:var(--focus-outline-offset);box-shadow:var(--focus-outline-primary)}.copy{top:var(--spacing-8);min-block-size:var(--dimension-32);padding:var(--spacing-4) var(--spacing-8);border:var(--border-width-1) solid var(--color-border-subtle);border-radius:var(--shape-radius-lg);background:var(--color-surface-default);color:var(--color-text-brand);font-family:var(--typography-label-default-fontFamily);font-size:var(--typography-label-default-fontSize);font-weight:var(--typography-label-default-fontWeight);line-height:var(--typography-label-default-lineHeight);letter-spacing:var(--typography-label-default-letterSpacing);cursor:pointer;opacity:0;transition:opacity var(--transition-duration-fast) var(--transition-easing-smooth);align-items:center;display:inline-flex;position:absolute;inset-inline-end:var(--spacing-8)}.copy[hidden]{display:none}:host(:hover) .copy,.code:focus-within .copy,.copy[data-copied]{opacity:1}.copy:focus-visible{outline:var(--focus-outline-traditional);outline-offset:var(--focus-outline-offset)}@media (hover:none){.copy{opacity:1}}@media (prefers-reduced-motion:reduce){.copy{transition:none}}.caption{margin-top:var(--spacing-8);padding-top:var(--spacing-12);text-align:center;display:block}.caption[hidden]{display:none}.status{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;margin:-1px;position:absolute;overflow:hidden}`,n=e`:where(bd-code[block])>pre{padding:var(--spacing-16);border:var(--border-width-1) solid var(--color-border-container);border-radius:var(--shape-radius-2xl);background:var(--color-surface-container);color:var(--color-text-primary);font-family:var(--typography-code-block-fontFamily);font-size:var(--typography-code-block-fontSize);font-weight:var(--typography-code-block-fontWeight);line-height:var(--typography-code-block-lineHeight);letter-spacing:var(--typography-code-block-letterSpacing);text-align:start;text-shadow:none;white-space:pre-wrap;overflow-wrap:anywhere;word-spacing:normal;word-break:normal;hyphens:none;tab-size:4;margin:0}:where(bd-code[block])>pre>code{font:inherit;letter-spacing:inherit;color:inherit;background:0 0;padding:0}:where(bd-code[block])>pre ::selection{background:var(--color-surface-pressed)}:where(bd-code[block])>pre>code .token{color:inherit}:where(bd-code[block])>pre>code :is(.token.entity,.token.operator,.token.url),:where(bd-code[block])>pre>code.language-css .token.string,:where(bd-code[block])>pre>code .style .token.string{background:0 0}:where(bd-code[block])>pre>code .token.entity{cursor:help}:where(bd-code[block])>pre>code :is(.token.bold,.token.important){font-weight:var(--typography-fontWeight-bold)}:where(bd-code[block])>pre>code .token.italic{font-style:italic}`;export{t as codeCSS,t as default,n as pageCodeCSS};
|
|
2
2
|
//# sourceMappingURL=code.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.css.js","names":["codeCSS"],"sources":["../../../../src/components/code/code.css.ts"],"sourcesContent":["import { css } from 'lit';\n\n/** Styled entirely from design tokens — see npm run lint:tokens. */\nexport const codeCSS = css`\n :host { display: inline; }\n\n /* Scoped to the inline case: block mode nests a <code> inside the <pre>,\n and an unscoped code selector would give it the inline chrome too. */\n :host(:not([block])) code {\n font-family: var(--typography-code-inline-fontFamily);\n font-size: var(--typography-code-inline-fontSize);\n font-weight: var(--typography-code-inline-fontWeight);\n line-height: var(--typography-code-inline-lineHeight);\n letter-spacing: var(--typography-code-inline-letterSpacing);\n /* an explicit colour, not an inherited one: the background is fixed, so\n inheriting a light foreground from a dark section put white on\n neutral-50 at 1.12:1 */\n color: var(--color-text-primary);\n background: var(--color-surface-subtle);\n padding: 0 var(--spacing-4);\n border-radius: var(--shape-radius-sm);\n /* a token name is one long unbreakable word, so let it break rather than\n overflow a narrow column */\n overflow-wrap: break-word;\n }\n\n :host([block]) { display: block; }\n\n :host([block]) pre {\n margin: 0;\n font-family: var(--typography-code-block-fontFamily);\n font-size: var(--typography-code-block-fontSize);\n font-weight: var(--typography-code-block-fontWeight);\n line-height: var(--typography-code-block-lineHeight);\n letter-spacing: var(--typography-code-block-letterSpacing);\n
|
|
1
|
+
{"version":3,"file":"code.css.js","names":["codeCSS","pageCodeCSS"],"sources":["../../../../src/components/code/code.css.ts"],"sourcesContent":["import { css } from 'lit';\n\n/** Styled entirely from design tokens — see npm run lint:tokens. */\nexport const codeCSS = css`\n :host { display: inline; }\n\n /* Scoped to the inline case: block mode nests a <code> inside the <pre>,\n and an unscoped code selector would give it the inline chrome too. */\n :host(:not([block])) code {\n font-family: var(--typography-code-inline-fontFamily);\n font-size: var(--typography-code-inline-fontSize);\n font-weight: var(--typography-code-inline-fontWeight);\n line-height: var(--typography-code-inline-lineHeight);\n letter-spacing: var(--typography-code-inline-letterSpacing);\n /* an explicit colour, not an inherited one: the background is fixed, so\n inheriting a light foreground from a dark section put white on\n neutral-50 at 1.12:1 */\n color: var(--color-text-primary);\n background: var(--color-surface-subtle);\n padding: 0 var(--spacing-4);\n border-radius: var(--shape-radius-sm);\n /* a token name is one long unbreakable word, so let it break rather than\n overflow a narrow column */\n overflow-wrap: break-word;\n }\n\n :host([block]) { display: block; }\n\n figure {\n margin: 0;\n }\n\n /* What the copy button is pinned to: the <pre>'s box, whichever <pre>. */\n .code {\n position: relative;\n }\n\n /* The block's own <pre>, when the page gives the code as text. The page's\n own <pre> draws the same box from pageCodeCSS below, keep the two alike.\n The csg blog's code block (Figma csg_blog 300:519): a hairline edge, the\n card's corner, a 16 inset, mono 14 at the code-block role, and the code\n wraps. The ground is --color-surface-container, one step off the page as\n Figma's light grey wash is: not inline code's --color-surface-subtle,\n which in dark is the edge's own neutral-850 and would swallow it. */\n :host([block]) pre {\n margin: 0;\n padding: var(--spacing-16);\n border: var(--border-width-1) solid var(--color-border-container);\n border-radius: var(--shape-radius-2xl);\n background: var(--color-surface-container);\n color: var(--color-text-primary);\n font-family: var(--typography-code-block-fontFamily);\n font-size: var(--typography-code-block-fontSize);\n font-weight: var(--typography-code-block-fontWeight);\n line-height: var(--typography-code-block-lineHeight);\n letter-spacing: var(--typography-code-block-letterSpacing);\n text-align: start;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n tab-size: 4;\n /* Wrapped, nothing in words is wider than the box; something the page\n slots that is (an image, an inline-block) scrolls, and then the <pre>\n is a tab stop (code.ts). */\n overflow-x: auto;\n }\n\n /* the nested <code> carries the semantics only; the <pre> does the styling */\n :host([block]) code {\n font: inherit;\n letter-spacing: inherit;\n color: inherit;\n background: none;\n padding: 0;\n }\n\n /* the block is focusable so it can be scrolled from the keyboard, so it\n needs a visible focus indicator of its own */\n :host([block]) pre:focus-visible {\n /* the one focus ring — see Foundations/Focus. A two-colour ring whose\n white inner band keeps it visible on a coloured or dark surface, which a\n single-colour outline cannot do. */\n /* forced-colors mode does not paint box-shadow, so the ring\n vanishes there; it does paint an outline, in a system colour. This one\n is transparent everywhere else, and the offset lands it on the ring's\n outer band. */\n outline: var(--border-width-2) solid transparent;\n outline-offset: var(--focus-outline-offset);\n box-shadow: var(--focus-outline-primary);\n }\n\n /* The copy button, pinned to the code's top-right corner outside the\n <pre>: the shipped blog's .code-copy, a subtle edge and the brand's text\n ink on the page's ground. */\n .copy {\n position: absolute;\n top: var(--spacing-8);\n inset-inline-end: var(--spacing-8);\n display: inline-flex;\n align-items: center;\n min-block-size: var(--dimension-32);\n padding: var(--spacing-4) var(--spacing-8);\n border: var(--border-width-1) solid var(--color-border-subtle);\n border-radius: var(--shape-radius-lg);\n background: var(--color-surface-default);\n color: var(--color-text-brand);\n font-family: var(--typography-label-default-fontFamily);\n font-size: var(--typography-label-default-fontSize);\n font-weight: var(--typography-label-default-fontWeight);\n line-height: var(--typography-label-default-lineHeight);\n letter-spacing: var(--typography-label-default-letterSpacing);\n cursor: pointer;\n opacity: 0;\n transition: opacity var(--transition-duration-fast) var(--transition-easing-smooth);\n }\n\n .copy[hidden] {\n display: none;\n }\n\n /* The shipped blog's reveal: on hover and focus, and while it says the\n copy worked. */\n :host(:hover) .copy,\n .code:focus-within .copy,\n .copy[data-copied] {\n opacity: 1;\n }\n\n .copy:focus-visible {\n outline: var(--focus-outline-traditional);\n outline-offset: var(--focus-outline-offset);\n }\n\n /* No hover to reveal it: always shown. */\n @media (hover: none) {\n .copy {\n opacity: 1;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .copy {\n transition: none;\n }\n }\n\n /* The line under the block, centred, as the shipped blog's caption is. */\n .caption {\n display: block;\n margin-top: var(--spacing-8);\n padding-top: var(--spacing-12);\n text-align: center;\n }\n\n /* bd-caption's own :host sets display; this outer rule wins. */\n .caption[hidden] {\n display: none;\n }\n\n /* The live region the copied words are said through. Out of view, in the\n accessibility tree. */\n .status {\n position: absolute;\n /* no token: 1px is the clip idiom's own measure, not a border -- the same\n sanctioned literal as visually-hidden.css.ts. */\n width: 1px;\n height: 1px;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n`;\n\n/**\n * The page's own <pre><code>, and the tokens Prism writes into it.\n *\n * The code is the page's, highlighted where it is, so the <pre>, the <code>\n * and every token <span> are light DOM: no rule in the block's shadow root\n * reaches past the slotted <pre>. bd-code adopts this sheet into the tree it\n * sits in (shared/adopt-styles.ts), and every rule keeps to a block by naming\n * its tag. In :where(), so a page's own rule for its code wins.\n *\n * The box is the block's own <pre>'s, in codeCSS above. The token colours\n * are the shipped blog's monochrome Prism theme (prism.css in www-blog-csg's\n * blocks/csg/code): every token one ink, the code's own, with bold and\n * italic the only marks, and the selection the pressed ground.\n */\nexport const pageCodeCSS = css`\n :where(bd-code[block]) > pre {\n margin: 0;\n padding: var(--spacing-16);\n border: var(--border-width-1) solid var(--color-border-container);\n border-radius: var(--shape-radius-2xl);\n background: var(--color-surface-container);\n color: var(--color-text-primary);\n font-family: var(--typography-code-block-fontFamily);\n font-size: var(--typography-code-block-fontSize);\n font-weight: var(--typography-code-block-fontWeight);\n line-height: var(--typography-code-block-lineHeight);\n letter-spacing: var(--typography-code-block-letterSpacing);\n text-align: start;\n text-shadow: none;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n word-spacing: normal;\n word-break: normal;\n hyphens: none;\n tab-size: 4;\n }\n\n :where(bd-code[block]) > pre > code {\n font: inherit;\n letter-spacing: inherit;\n color: inherit;\n background: none;\n padding: 0;\n }\n\n :where(bd-code[block]) > pre ::selection {\n background: var(--color-surface-pressed);\n }\n\n /* One ink for every token: the code's. */\n :where(bd-code[block]) > pre > code .token {\n color: inherit;\n }\n\n :where(bd-code[block]) > pre > code :is(.token.entity, .token.operator, .token.url),\n :where(bd-code[block]) > pre > code.language-css .token.string,\n :where(bd-code[block]) > pre > code .style .token.string {\n background: none;\n }\n\n :where(bd-code[block]) > pre > code .token.entity {\n cursor: help;\n }\n\n :where(bd-code[block]) > pre > code :is(.token.bold, .token.important) {\n /* no role: the monochrome theme's one mark of weight, on a token inside\n the code-block role's text; no role names emphasis within code */\n font-weight: var(--typography-fontWeight-bold);\n }\n\n :where(bd-code[block]) > pre > code .token.italic {\n font-style: italic;\n }\n`;\n\nexport default codeCSS;\n"],"mappings":"A,0BAGA,IAAaA,EAAU,CAAG,2nFAwLbC,EAAc,CAAG,0yC"}
|
|
@@ -1,17 +1,113 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
1
|
+
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
+
import { Announcer } from "../shared/announcer.js";
|
|
3
|
+
import { ObserverController } from "../shared/controller.observer.js";
|
|
4
|
+
import { SlotController } from "../shared/controller.slot.js";
|
|
2
5
|
import "../../tokens/tokens.js";
|
|
6
|
+
import "../caption/caption.js";
|
|
7
|
+
/**
|
|
8
|
+
* Code, inline in prose or as a block.
|
|
9
|
+
*
|
|
10
|
+
* INLINE (no `block`) is the page's words in a `<code>` with a tinted
|
|
11
|
+
* ground. It never loads Prism.
|
|
12
|
+
*
|
|
13
|
+
* A BLOCK takes its code one of two ways, and draws both the same box:
|
|
14
|
+
*
|
|
15
|
+
* <bd-code block language="javascript">
|
|
16
|
+
* <pre><code>const a = 1;</code></pre>
|
|
17
|
+
* <span slot="copy">Copy code</span>
|
|
18
|
+
* <span slot="copied">Copied</span>
|
|
19
|
+
* <span slot="caption">What the snippet does</span>
|
|
20
|
+
* </bd-code>
|
|
21
|
+
*
|
|
22
|
+
* <bd-code block label="Button styles">.button { … }</bd-code>
|
|
23
|
+
*
|
|
24
|
+
* THE PAGE'S OWN <pre><code> is the v4 markup, the shipped blog's code block
|
|
25
|
+
* (www-blog-csg blocks/csg/code) and the v4 blog's bd-blog-code-block: the page
|
|
26
|
+
* writes the code, its `<`, `>` and `&` escaped, as any HTML page writes code.
|
|
27
|
+
* Nothing of it is copied into the shadow root. With a `language` the block
|
|
28
|
+
* highlights the <code> where it is, with the vendored Prism it imports the
|
|
29
|
+
* first time a block needs it (prism.ts): it writes `language-<language>` on
|
|
30
|
+
* the <code> in place of any language class it had, and Prism replaces the
|
|
31
|
+
* code's children with its token <span>s and sets the same class on the <pre>.
|
|
32
|
+
* A language the bundle has no grammar for leaves the code as the page
|
|
33
|
+
* wrote it, its markup included, under the `language-<language>` Prism would
|
|
34
|
+
* write; none is written `language-none` without loading Prism. The <pre>, the
|
|
35
|
+
* <code> and the tokens are light DOM, which no rule in the shadow root
|
|
36
|
+
* reaches past the slotted <pre>, so their styles are a sheet adopted into
|
|
37
|
+
* the tree the block sits in (shared/adopt-styles.ts, `pageCodeCSS`).
|
|
38
|
+
*
|
|
39
|
+
* It highlights again when the page changes the code, the <pre> or the
|
|
40
|
+
* `language`, and only then: the caption's or the button's words changing
|
|
41
|
+
* re-tokenises nothing. Its own highlighting is a change too, so after highlighting it
|
|
42
|
+
* takes the records that change queued off the observer, which is what keeps
|
|
43
|
+
* it from highlighting for ever. A Lit page binds the code as the <code>'s
|
|
44
|
+
* `.textContent`, not as a child part, which Prism's tokens take the place of.
|
|
45
|
+
*
|
|
46
|
+
* The code wraps, so the page's <pre> has nothing to scroll and is no tab
|
|
47
|
+
* stop: the `tabindex` Prism writes on a <pre> that has none is taken back
|
|
48
|
+
* straight after. The page's own rules win over this sheet, though, and one
|
|
49
|
+
* that makes its <pre> scroll -- a Prism theme's `white-space: pre` and
|
|
50
|
+
* `overflow: auto` -- makes it a tab stop while there is something to
|
|
51
|
+
* scroll, as the block's own <pre> is. A `tabindex` the page wrote stays,
|
|
52
|
+
* and so does naming its <pre>, which is the page's to do: `label` names
|
|
53
|
+
* only the block's own <pre>.
|
|
54
|
+
*
|
|
55
|
+
* WORDS GIVEN AS TEXT are drawn in the block's own `<pre><code>`, as before
|
|
56
|
+
* the page could write one: plain, since Prism would have to rewrite them
|
|
57
|
+
* where they are, and a slot's text is the page's. This <pre> is a
|
|
58
|
+
* `role="group"` named by `label` ("Code" without one) -- a group rather than
|
|
59
|
+
* a region, which is a landmark, and a page of code samples would fill the
|
|
60
|
+
* landmark list -- and a tab stop only while something in it is wider than
|
|
61
|
+
* its box, so a reader can scroll it from the keyboard.
|
|
62
|
+
*
|
|
63
|
+
* THE COPY BUTTON copies the code's text as written. It is the block's own,
|
|
64
|
+
* pinned to the code's top-right corner outside the <pre>, so its words are
|
|
65
|
+
* never part of what is copied; it shows on hover and focus, and always
|
|
66
|
+
* where there is no hover. Its words are the page's, as bd-install-option's
|
|
67
|
+
* are: `copy` names it, and after a copy it shows `copied` for 1.5s and
|
|
68
|
+
* ignores presses meanwhile (it is not disabled, which would throw keyboard
|
|
69
|
+
* focus to the top of the page). The block's own live region, in the page
|
|
70
|
+
* before it speaks, says the `copied` words (shared/announcer.ts), since a
|
|
71
|
+
* screen reader does not reliably read a focused button's new name. Without
|
|
72
|
+
* `copy` words there is no button: it would have no name. Without `copied`
|
|
73
|
+
* words it keeps its `copy` words after a copy and says nothing.
|
|
74
|
+
*
|
|
75
|
+
* `caption` is a line under the block, drawn by bd-caption.
|
|
76
|
+
*/
|
|
3
77
|
export declare class BdCode extends LitElement {
|
|
4
78
|
static styles: import("lit").CSSResult[];
|
|
5
79
|
block: boolean;
|
|
6
80
|
label: string;
|
|
81
|
+
/** Prism language id (javascript, bash, python, …) for the page's own <pre><code>; none leaves the code plain */
|
|
82
|
+
language: string;
|
|
83
|
+
private _copied;
|
|
84
|
+
_slots: SlotController<"caption" | "copy" | "copied">;
|
|
85
|
+
_announcer: Announcer;
|
|
86
|
+
private _busy;
|
|
87
|
+
private _reset;
|
|
88
|
+
private _highlighting?;
|
|
89
|
+
private _drewPage;
|
|
90
|
+
private _tokenised;
|
|
91
|
+
private _tabStops;
|
|
92
|
+
_edits: ObserverController<MutationObserver>;
|
|
7
93
|
_scrollable?: boolean;
|
|
8
94
|
_resize?: ResizeObserver;
|
|
9
|
-
_observed?:
|
|
10
|
-
|
|
95
|
+
_observed?: Element | null;
|
|
96
|
+
get _pagePre(): Element | null;
|
|
11
97
|
_measure(): void;
|
|
12
|
-
|
|
98
|
+
private _measurePage;
|
|
13
99
|
connectedCallback(): void;
|
|
14
100
|
disconnectedCallback(): void;
|
|
101
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
102
|
+
private _watchSize;
|
|
103
|
+
updated(changed: PropertyValues<this>): void;
|
|
104
|
+
getUpdateComplete(): Promise<boolean>;
|
|
105
|
+
private _edited;
|
|
106
|
+
private _plain;
|
|
107
|
+
/** Highlights the page's `<pre><code>` in place, with the block's `language`. */
|
|
108
|
+
highlight(): void;
|
|
109
|
+
private _text;
|
|
110
|
+
private _copy;
|
|
15
111
|
render(): import("lit-html").TemplateResult<1>;
|
|
16
112
|
}
|
|
17
113
|
declare global {
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{
|
|
2
|
-
tabindex="${this._scrollable?`0`:
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{ObserverController as n}from"../shared/controller.observer.js";import{SlotController as r}from"../shared/controller.slot.js";import{adoptStyles as i}from"../shared/adopt-styles.js";import"../caption/caption.js";import{Announcer as a}from"../shared/announcer.js";import{codeCSS as o,pageCodeCSS as s}from"./code.css.js";import{LitElement as c,html as l,nothing as u}from"lit";import{property as d,state as f}from"lit/decorators.js";var p={childList:!0,subtree:!0,characterData:!0},m=/(?:^|\s)lang(?:uage)?-[\w-]+(?=\s|$)/gi,h=1500,g,_,v=()=>g??=import(`./prism.js`).then(e=>_=e.Prism,e=>{throw g=void 0,e});function y(e,t){e.className=e.className.replace(m,` `).trim(),e.classList.add(`language-${t}`)}var b=e=>typeof e==`string`&&/^[\w-]+$/.test(e)?e:`none`,x=(e,t)=>(t?.contains(e.target)??!1)||[...e.addedNodes,...e.removedNodes].some(e=>e.nodeName===`PRE`),S=class extends c{constructor(...e){super(...e),this.block=!1,this.label=``,this.language=``,this._copied=!1,this._slots=new r(this,{slots:[`caption`,`copy`,`copied`]}),this._announcer=new a(this),this._busy=!1,this._reset=0,this._drewPage=!1,this._tokenised=/* @__PURE__ */ new WeakSet,this._tabStops=/* @__PURE__ */ new WeakSet,this._edits=new n(this,()=>new MutationObserver(e=>this._edited(e)),e=>{e.observe(this,p),this.highlight(),this._watchSize()})}static{this.styles=[o]}get _pagePre(){return this.block?this.querySelector(`:scope > pre`):null}_measure(){let e=this.shadowRoot?.querySelector(`pre`),t=!!e&&e.scrollWidth>e.clientWidth;t!==this._scrollable&&(this._scrollable=t,this.requestUpdate()),this._measurePage()}_measurePage(){let e=this._pagePre;if(!e||e.hasAttribute(`tabindex`)&&!this._tabStops.has(e))return;let t=getComputedStyle(e).overflowX,n=(t===`auto`||t===`scroll`)&&e.scrollWidth>e.clientWidth;n&&!this._tabStops.has(e)?(e.setAttribute(`tabindex`,`0`),this._tabStops.add(e)):!n&&this._tabStops.has(e)&&(e.removeAttribute(`tabindex`),this._tabStops.delete(e))}connectedCallback(){super.connectedCallback(),this.block&&i(this,`bd-code`,s)}disconnectedCallback(){super.disconnectedCallback(),this._resize?.disconnect(),this._observed=null,clearTimeout(this._reset),this._copied=!1,this._busy=!1}willUpdate(e){e.has(`block`)&&this.block&&this.isConnected&&i(this,`bd-code`,s)}_watchSize(){let e=this._pagePre??this.shadowRoot?.querySelector(`pre`)??null;e!==this._observed&&(this._resize?.disconnect(),this._observed=e,e&&(this._resize??=new ResizeObserver(()=>this._measure())).observe(e)),this._measure()}updated(e){this._watchSize();let t=t=>e.has(t)&&e.get(t)!==void 0;(t(`language`)||t(`block`))&&this.highlight()}async getUpdateComplete(){let e=await super.getUpdateComplete();return await this._highlighting,e}_edited(e){!!this._pagePre!==this._drewPage&&this.requestUpdate();let t=this._pagePre;e.some(e=>x(e,t))&&this.highlight(),this._watchSize()}_plain(e,t){this._tokenised.has(e)&&e.replaceChildren(e.textContent??``),this._tokenised.delete(e),y(e,t),y(e.parentElement,t)}highlight(){let e=this._pagePre?.querySelector(`:scope > code`);if(e){let t=b(this.language),n=e.parentElement;if(t===`none`)this._plain(e,`none`);else if(_&&typeof _.languages[t]!=`object`)this._plain(e,t);else if(_){let r=n.hasAttribute(`tabindex`);y(e,t),_.highlightElement(e),this._tokenised.add(e),r||n.removeAttribute(`tabindex`),this._measurePage()}else this._highlighting??=v().then(()=>{this._highlighting=void 0,this.highlight()},()=>{this._highlighting=void 0})}this._edits.observer?.takeRecords()}_text(){let e=this._pagePre;return e?(e.querySelector(`:scope > code`)??e).textContent??``:(this.renderRoot.querySelector(`pre slot:not([name])`)?.assignedNodes({flatten:!0})??[]).map(e=>e.textContent).join(``)}async _copy(){let e=this._text();if(!e||this._busy)return;this._busy=!0;try{await navigator.clipboard.writeText(e)}catch{this._busy=!1;return}this._copied=!0;let t=this._slots.text(`copied`);t&&this._announcer.say(t),clearTimeout(this._reset),this._reset=setTimeout(()=>{this._copied=!1,this._busy=!1},h)}render(){if(this._drewPage=!!this._pagePre,!this.block)return l`<code><slot></slot></code>`;let e=this._copied&&this._slots.has(`copied`),t=this._drewPage?l`<slot></slot>`:l`<pre
|
|
2
|
+
tabindex="${this._scrollable?`0`:u}"
|
|
3
3
|
role="group"
|
|
4
4
|
aria-label="${this.label||`Code`}"
|
|
5
|
-
><code><slot></slot></code></pre
|
|
5
|
+
><code><slot></slot></code></pre>`;return l`
|
|
6
|
+
<figure part="figure">
|
|
7
|
+
<div class="code">
|
|
8
|
+
${t}
|
|
9
|
+
<button type="button" class="copy" part="copy" ?hidden=${!this._slots.has(`copy`)}
|
|
10
|
+
?data-copied=${e} @click=${this._copy}
|
|
11
|
+
><span ?hidden=${e}><slot name="copy"></slot></span
|
|
12
|
+
><span ?hidden=${!e}><slot name="copied"></slot></span></button>
|
|
13
|
+
</div>
|
|
14
|
+
<bd-caption class="caption" part="caption" ?hidden=${!this._slots.has(`caption`)}
|
|
15
|
+
><slot name="caption"></slot
|
|
16
|
+
></bd-caption>
|
|
17
|
+
</figure>
|
|
18
|
+
<span class="status" role="status">${this._announcer.status}</span>
|
|
19
|
+
`}};t([d({type:Boolean,attribute:`block`,reflect:!0})],S.prototype,`block`,void 0),t([d({type:String,attribute:`label`})],S.prototype,`label`,void 0),t([d({type:String,attribute:`language`})],S.prototype,`language`,void 0),t([f()],S.prototype,`_copied`,void 0),S=t([e(`bd-code`)],S);export{S as BdCode};
|
|
6
20
|
//# sourceMappingURL=code.js.map
|