@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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from "lit";
|
|
2
|
+
type SlotHost = ReactiveControllerHost & HTMLElement & {
|
|
3
|
+
readonly renderRoot?: HTMLElement | DocumentFragment;
|
|
4
|
+
readonly hasUpdated: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* What the page put into a component's slots, followed for as long as the
|
|
8
|
+
* component is connected.
|
|
9
|
+
*
|
|
10
|
+
* Every component that hid an empty wrapper spelled the same steps by hand: a
|
|
11
|
+
* @state flag, a slotchange handler on one slot, assignedNodes({ flatten:
|
|
12
|
+
* true }) and the same "an element or non-blank text" test. The first render
|
|
13
|
+
* was always wrong -- the flag starts false and slotchange only arrives after
|
|
14
|
+
* the render that needed it, so slotted content took a second render to show
|
|
15
|
+
* -- and bd-section-header read its own fallback as content once the page
|
|
16
|
+
* took its lead away, because flattening an empty slot returns the fallback.
|
|
17
|
+
* This is those steps once, as MediaQueryController is for a media query.
|
|
18
|
+
*
|
|
19
|
+
* _slots = new SlotController(this, { slots: ['lead'] });
|
|
20
|
+
* render() { return html`<div class="lead" ?hidden=${!this._slots.has('lead')}><slot name="lead"></slot></div>`; }
|
|
21
|
+
*
|
|
22
|
+
* `''` is the default slot. Before the first render it answers from the
|
|
23
|
+
* host's own children -- `:scope > [slot=name]`, or for the default slot the
|
|
24
|
+
* unslotted elements and non-blank text -- so the first render is already
|
|
25
|
+
* right. After it, the rendered slot answers, flattened through any slot an
|
|
26
|
+
* enclosing component forwarded into it, and a slotchange anywhere in the
|
|
27
|
+
* render root re-reads every slot it follows and updates the host when an
|
|
28
|
+
* answer moved.
|
|
29
|
+
*
|
|
30
|
+
* A slot listed in `text` is followed into its words as well: an edit inside
|
|
31
|
+
* the assigned nodes updates the host, so a component that copies the slotted
|
|
32
|
+
* text into an accessible name -- one aria-labelledby cannot reach, such as
|
|
33
|
+
* ElementInternals -- follows the page's edit. text() reads any slot when
|
|
34
|
+
* asked; only a `text` slot re-renders its host when the words change.
|
|
35
|
+
*
|
|
36
|
+
* It never writes to the host. A component writing its own host's attributes
|
|
37
|
+
* is one of three recorded exceptions (CLAUDE.md, Brands), and slot content is
|
|
38
|
+
* not a fourth: the component reads it in render() and draws its own tree.
|
|
39
|
+
*/
|
|
40
|
+
export declare class SlotController<S extends string = string> implements ReactiveController {
|
|
41
|
+
private readonly _host;
|
|
42
|
+
private readonly _slots;
|
|
43
|
+
private readonly _text;
|
|
44
|
+
private _edits?;
|
|
45
|
+
private _seen;
|
|
46
|
+
private readonly _onSlotChange;
|
|
47
|
+
constructor(host: SlotHost, { slots, text }: {
|
|
48
|
+
slots: readonly S[];
|
|
49
|
+
text?: readonly S[];
|
|
50
|
+
});
|
|
51
|
+
/** Whether the slot holds content: an element, or text that is not blank. */
|
|
52
|
+
has(name: S): boolean;
|
|
53
|
+
/** The elements assigned to the slot, flattened through forwarded slots. */
|
|
54
|
+
elements<E extends Element = Element>(name: S): E[];
|
|
55
|
+
/** The slot's assigned text, flattened and whitespace-normalised. Its own fallback is not read. */
|
|
56
|
+
text(name: S): string;
|
|
57
|
+
hostConnected(): void;
|
|
58
|
+
hostUpdate(): void;
|
|
59
|
+
hostDisconnected(): void;
|
|
60
|
+
private _nodes;
|
|
61
|
+
private _read;
|
|
62
|
+
private _check;
|
|
63
|
+
private _watch;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{flatText as e}from"./flat-text.js";var t={characterData:!0,childList:!0,subtree:!0},n=e=>e.nodeType===Node.ELEMENT_NODE,r=e=>n(e)||e.nodeType===Node.TEXT_NODE&&e.data.trim()!==``;function i(e){return n(e)?e.slot:e.nodeType===Node.TEXT_NODE?``:null}var a=e=>e.flatMap(e=>e instanceof HTMLSlotElement&&e.getRootNode()instanceof ShadowRoot?e.assignedNodes({flatten:!0}):[e]),o=(e,t)=>!!t&&e.has===t.has&&e.text===t.text&&e.elements.length===t.elements.length&&e.elements.every((e,n)=>e===t.elements[n]),s=class{constructor(e,{slots:t,text:n=[]}){this._seen=/* @__PURE__ */ new Map,this._onSlotChange=()=>{this._watch(),this._check()},this._host=e,this._text=new Set(n),this._slots=[.../* @__PURE__ */ new Set([...t,...n])],e.addController(this)}has(e){return this._nodes(e).some(r)}elements(e){return this._nodes(e).filter(n)}text(t){return e(...this._nodes(t))}hostConnected(){this._host.renderRoot.addEventListener(`slotchange`,this._onSlotChange),this._watch(),this._host.hasUpdated&&this._check()}hostUpdate(){this._seen=this._read()}hostDisconnected(){this._host.renderRoot.removeEventListener(`slotchange`,this._onSlotChange),this._edits?.disconnect()}_nodes(e){let t=[...this._host.renderRoot?.querySelectorAll(`slot`)??[]].find(t=>t.name===e);return a(t?t.assignedNodes():[...this._host.childNodes].filter(t=>i(t)===e))}_read(){return new Map(this._slots.map(t=>{let i=this._nodes(t);return[t,{has:i.some(r),elements:i.filter(n),text:this._text.has(t)?e(...i):``}]}))}_check(){let e=this._read();this._slots.some(t=>!o(e.get(t),this._seen.get(t)))&&this._host.requestUpdate()}_watch(){if(this._text.size){this._edits??=new MutationObserver(()=>this._check()),this._edits.disconnect();for(let e of this._text)for(let n of this._nodes(e))this._edits.observe(n,t)}}};export{s as SlotController};
|
|
2
|
+
//# sourceMappingURL=controller.slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.slot.js","names":["EDITS","isElement","node","isContent","slotOf","flatten","nodes","sameAnswer","b","a","el","i","SlotController","host","text","slots","name","flatText","slot","s","now"],"sources":["../../../../src/components/shared/controller.slot.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport { flatText } from './flat-text.ts';\n\n/* Lit creates the render root in connectedCallback, before any controller\n hears hostConnected, so it is only missing on a host never connected. */\ntype SlotHost = ReactiveControllerHost & HTMLElement & {\n readonly renderRoot?: HTMLElement | DocumentFragment;\n readonly hasUpdated : boolean;\n};\n\n/* What one render read from one slot. */\ninterface Answer {\n has : boolean;\n elements: Element[];\n text : string;\n}\n\n/* A text edit inside a slotted node: a word changed, a <span> was added. */\nconst EDITS: MutationObserverInit = { characterData: true, childList: true, subtree: true };\n\nconst isElement = (node: Node): node is Element => node.nodeType === Node.ELEMENT_NODE;\n\n/* Content is an element or words. Whitespace between the tags a page wrote is\n neither, and neither is a comment -- Lit leaves its part markers among the\n children of every element it renders into. */\nconst isContent = (node: Node) => isElement(node)\n || (node.nodeType === Node.TEXT_NODE && (node as Text).data.trim() !== '');\n\n/* The slot a light-DOM child goes to. Only elements and text are slottable,\n and text always goes to the default slot. */\nfunction slotOf(node: Node) {\n if (isElement(node)) return node.slot;\n return node.nodeType === Node.TEXT_NODE ? '' : null;\n}\n\n/* A <slot> a component forwards -- <slot name=\"x\" slot=\"y\"> inside its own\n shadow root, assigned to a child component's slot y -- stands for what it\n shows: its own assigned nodes, or its fallback when it has none, which is\n what assignedNodes({ flatten: true }) returns. A slot outside a shadow root\n is an ordinary element. */\nconst flatten = (nodes: Node[]) => nodes.flatMap(node =>\n (node instanceof HTMLSlotElement && node.getRootNode() instanceof ShadowRoot\n ? node.assignedNodes({ flatten: true })\n : [node]));\n\nconst sameAnswer = (a: Answer, b: Answer | undefined) => !!b\n && a.has === b.has\n && a.text === b.text\n && a.elements.length === b.elements.length\n && a.elements.every((el, i) => el === b.elements[i]);\n\n/**\n * What the page put into a component's slots, followed for as long as the\n * component is connected.\n *\n * Every component that hid an empty wrapper spelled the same steps by hand: a\n * @state flag, a slotchange handler on one slot, assignedNodes({ flatten:\n * true }) and the same \"an element or non-blank text\" test. The first render\n * was always wrong -- the flag starts false and slotchange only arrives after\n * the render that needed it, so slotted content took a second render to show\n * -- and bd-section-header read its own fallback as content once the page\n * took its lead away, because flattening an empty slot returns the fallback.\n * This is those steps once, as MediaQueryController is for a media query.\n *\n * _slots = new SlotController(this, { slots: ['lead'] });\n * render() { return html`<div class=\"lead\" ?hidden=${!this._slots.has('lead')}><slot name=\"lead\"></slot></div>`; }\n *\n * `''` is the default slot. Before the first render it answers from the\n * host's own children -- `:scope > [slot=name]`, or for the default slot the\n * unslotted elements and non-blank text -- so the first render is already\n * right. After it, the rendered slot answers, flattened through any slot an\n * enclosing component forwarded into it, and a slotchange anywhere in the\n * render root re-reads every slot it follows and updates the host when an\n * answer moved.\n *\n * A slot listed in `text` is followed into its words as well: an edit inside\n * the assigned nodes updates the host, so a component that copies the slotted\n * text into an accessible name -- one aria-labelledby cannot reach, such as\n * ElementInternals -- follows the page's edit. text() reads any slot when\n * asked; only a `text` slot re-renders its host when the words change.\n *\n * It never writes to the host. A component writing its own host's attributes\n * is one of three recorded exceptions (CLAUDE.md, Brands), and slot content is\n * not a fourth: the component reads it in render() and draws its own tree.\n */\nexport class SlotController<S extends string = string> implements ReactiveController {\n private readonly _host : SlotHost;\n private readonly _slots: readonly S[];\n private readonly _text : ReadonlySet<S>;\n private _edits? : MutationObserver;\n /* What the last render read. A slotchange or an edit is compared with it,\n because the question each one asks is whether that render is out of\n date. */\n private _seen = new Map<S, Answer>();\n private readonly _onSlotChange = () => {\n this._watch();\n this._check();\n };\n\n constructor(host: SlotHost, { slots, text = [] }: { slots: readonly S[]; text?: readonly S[] }) {\n this._host = host;\n this._text = new Set(text);\n // a `text` slot is followed whether or not it is also listed in `slots`\n this._slots = [...new Set([...slots, ...text])];\n host.addController(this);\n }\n\n /** Whether the slot holds content: an element, or text that is not blank. */\n has(name: S) {\n return this._nodes(name).some(isContent);\n }\n\n /** The elements assigned to the slot, flattened through forwarded slots. */\n elements<E extends Element = Element>(name: S): E[] {\n return this._nodes(name).filter(isElement) as E[];\n }\n\n /** The slot's assigned text, flattened and whitespace-normalised. Its own fallback is not read. */\n text(name: S) {\n return flatText(...this._nodes(name));\n }\n\n hostConnected() {\n this._host.renderRoot!.addEventListener('slotchange', this._onSlotChange);\n this._watch();\n /* A reconnect finds the slots rendered, and what is assigned to them may\n have changed while the host was out, when nothing was listening. */\n if (this._host.hasUpdated) this._check();\n }\n\n /* Runs after willUpdate and before render, so it records what this render\n reads. */\n hostUpdate() {\n this._seen = this._read();\n }\n\n hostDisconnected() {\n this._host.renderRoot!.removeEventListener('slotchange', this._onSlotChange);\n this._edits?.disconnect();\n }\n\n /* The nodes assigned to a slot, flattened. Not the slot's own fallback: an\n empty slot whose fallback is the component's attribute copy -- the\n section header's lead -- has nothing from the page in it. */\n private _nodes(name: string): Node[] {\n const slot = [...this._host.renderRoot?.querySelectorAll('slot') ?? []].find(s => s.name === name);\n const assigned = slot\n ? slot.assignedNodes()\n : [...this._host.childNodes].filter(node => slotOf(node) === name);\n return flatten(assigned);\n }\n\n private _read() {\n return new Map(this._slots.map(name => {\n const nodes = this._nodes(name);\n return [name, {\n has : nodes.some(isContent),\n elements: nodes.filter(isElement),\n text : this._text.has(name) ? flatText(...nodes) : ''\n }];\n }));\n }\n\n private _check() {\n const now = this._read();\n if (this._slots.some(name => !sameAnswer(now.get(name)!, this._seen.get(name)))) this._host.requestUpdate();\n }\n\n /* Observes the nodes now assigned to each `text` slot. A slotchange calls\n it again, because which nodes those are is what a slotchange changes. */\n private _watch() {\n if (!this._text.size) return;\n this._edits ??= new MutationObserver(() => this._check());\n this._edits.disconnect();\n for (const name of this._text) {\n for (const node of this._nodes(name)) this._edits.observe(node, EDITS);\n }\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,34 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The events several elements send, declared once.
|
|
3
3
|
*
|
|
4
4
|
* Every other bd-* event is declared beside the one element that dispatches
|
|
5
|
-
* it.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* it. These four are the show/hide vocabulary N8 gives every element that
|
|
6
|
+
* opens and closes -- the tooltip today, the dialog and the accordion item as
|
|
7
|
+
* their phases land -- so no single sender owns them, and declaring them in
|
|
8
|
+
* each would be one declaration per sender of the same name.
|
|
9
|
+
*
|
|
10
|
+
* bd-show and bd-hide report that the element is opening or closing;
|
|
11
|
+
* bd-after-show and bd-after-hide that it has finished, once any transition
|
|
12
|
+
* has run (at once under prefers-reduced-motion). None carries a detail.
|
|
13
|
+
*
|
|
14
|
+
* 3.x declared bd-change and bd-input here, the generic "the value changed"
|
|
15
|
+
* pair. v4 form controls send the native `input` and `change`, whose target
|
|
16
|
+
* carries the value, and bd-pagination-dots sends bd-slide-change, so neither
|
|
17
|
+
* has a sender left.
|
|
9
18
|
*
|
|
10
19
|
* A sender imports this module for its side effect, which is what puts these
|
|
11
20
|
* declarations in front of a consumer who imports that element.
|
|
12
21
|
*/
|
|
13
|
-
/** What a text field or a dropdown says about its value. */
|
|
14
|
-
export interface BdFieldDetail {
|
|
15
|
-
value: string;
|
|
16
|
-
name: string;
|
|
17
|
-
}
|
|
18
22
|
declare global {
|
|
19
23
|
interface HTMLElementEventMap {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
'bd-change': CustomEvent<BdFieldDetail | boolean | {
|
|
26
|
-
current: number;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* bd-custom-input, the clipboard field and bd-custom-dropdown:
|
|
30
|
-
* `{ value, name }`. bd-textarea: the value itself.
|
|
31
|
-
*/
|
|
32
|
-
'bd-input': CustomEvent<BdFieldDetail | string>;
|
|
24
|
+
'bd-show': CustomEvent<null>;
|
|
25
|
+
'bd-hide': CustomEvent<null>;
|
|
26
|
+
'bd-after-show': CustomEvent<null>;
|
|
27
|
+
'bd-after-hide': CustomEvent<null>;
|
|
33
28
|
}
|
|
34
29
|
}
|
|
30
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill-width.css.js","names":["KEYWORDS","hostFillsWidth","unsafeCSS","keyword"],"sources":["../../../../src/components/shared/fill-width.css.ts"],"sourcesContent":["import { unsafeCSS } from \"lit\";\n\n/**\n * The width a size container's host takes: all of its column, less its own\n * margins.\n *\n * An element with `container-type: inline-size` contributes nothing to its\n * own intrinsic width, so where its parent sizes it to its content -- a flex\n * row, a grid placing items at start -- it measures 0. These hosts used to\n * answer that with `width: 100%`, which fills the containing block and\n * ignores the host's margins: a page writing `margin-inline: 24px` on one got\n * a box 48px wider than its column, scrolling the page sideways on a phone.\n *\n * `stretch` is the width a block takes by default -- the containing block\n * less the margins -- asked for explicitly, so it holds in a flex row or a\n * grid cell too. It is
|
|
1
|
+
{"version":3,"file":"fill-width.css.js","names":["KEYWORDS","hostFillsWidth","unsafeCSS","keyword"],"sources":["../../../../src/components/shared/fill-width.css.ts"],"sourcesContent":["import { unsafeCSS } from \"lit\";\n\n/**\n * The width a size container's host takes: all of its column, less its own\n * margins.\n *\n * An element with `container-type: inline-size` contributes nothing to its\n * own intrinsic width, so where its parent sizes it to its content -- a flex\n * row, a grid placing items at start -- it measures 0. These hosts used to\n * answer that with `width: 100%`, which fills the containing block and\n * ignores the host's margins: a page writing `margin-inline: 24px` on one got\n * a box 48px wider than its column, scrolling the page sideways on a phone.\n *\n * `stretch` is the width a block takes by default -- the containing block\n * less the margins -- asked for explicitly, so it holds in a flex row or a\n * grid cell too. It is Limited availability, short of the Newly available\n * target, so it is behind @supports with 100% before it, and its prefixed\n * spellings come first, Gecko's and then WebKit's, so the standard one wins\n * where more than one is read (CLAUDE.md, Browser support).\n *\n * :host { display: block; container-type: inline-size; }\n * ${hostFillsWidth()}\n */\nconst KEYWORDS = [\"-moz-available\", \"-webkit-fill-available\", \"stretch\"];\n\nexport const hostFillsWidth = () => unsafeCSS([\n \":host { width: 100%; }\",\n ...KEYWORDS.map(keyword => `@supports (width: ${keyword}) { :host { width: ${keyword}; } }`)\n].join(\"\\n\"));\n"],"mappings":"A,gCAuBA,IAAMA,EAAW,CAAC,iBAAkB,yBAA0B,SAAS,EAE1DC,MAAuBC,EAAU,CAC5C,yBACA,GAAGF,EAAS,IAAI,GAAW,qBAAqBG,EAAQ,qBAAqBA,EAAQ,MAAM,CAC7F,CAAC,CAAC,KAAK;CAAI,CAAC,E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words a node reads as in the flat tree, whitespace collapsed and
|
|
3
|
+
* trimmed: a <slot> through what it shows, anything else through its
|
|
4
|
+
* light-DOM children. Shadow roots are not entered, because a component's
|
|
5
|
+
* own chrome -- an icon, a fallback label -- is not the page's copy.
|
|
6
|
+
*
|
|
7
|
+
* Several nodes read as one run, so the space between a text node and the
|
|
8
|
+
* element after it survives: flatText(...slot.assignedNodes()).
|
|
9
|
+
*
|
|
10
|
+
* This is the text a component copies into a name the platform cannot
|
|
11
|
+
* reference across a shadow boundary (ElementInternals, a control inside a
|
|
12
|
+
* nested atom). Where aria-labelledby can reach, point it at the slot's
|
|
13
|
+
* wrapper instead and let accname read the flat tree itself.
|
|
14
|
+
*/
|
|
15
|
+
export declare function flatText(...nodes: Node[]): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=/* @__PURE__ */ new Set([`script`,`style`,`template`]);function t(e){let t=e.assignedNodes({flatten:!0});return t.length?t:[...e.childNodes]}function n(r){return r.nodeType===Node.TEXT_NODE?r.data:r.nodeType!==Node.ELEMENT_NODE||e.has(r.localName)?``:(r instanceof HTMLSlotElement?t(r):[...r.childNodes]).map(n).join(``)}function r(...e){return e.map(n).join(``).replace(/\s+/g,` `).trim()}export{r as flatText};
|
|
2
|
+
//# sourceMappingURL=flat-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat-text.js","names":["SILENT","shown","assigned","slot","gather","node","flatText","nodes"],"sources":["../../../../src/components/shared/flat-text.ts"],"sourcesContent":["/* Elements whose children never render as words: a <style> slotted inside a\n label would otherwise put its rules into the name a component copies. A\n template's children are its content fragment, so it reads as nothing anyway;\n listing it says so. */\nconst SILENT = new Set(['script', 'style', 'template']);\n\n/**\n * What a <slot> shows: its flattened assigned nodes, or, with none, its own\n * children. assignedNodes({ flatten: true }) already returns the fallback of a\n * slot in a shadow root; a slot outside one is assigned nothing and renders\n * its children, so those are its text too.\n */\nfunction shown(slot: HTMLSlotElement): Node[] {\n const assigned = slot.assignedNodes({ flatten: true });\n return assigned.length ? assigned : [...slot.childNodes];\n}\n\nfunction gather(node: Node): string {\n if (node.nodeType === Node.TEXT_NODE) return (node as Text).data;\n if (node.nodeType !== Node.ELEMENT_NODE || SILENT.has((node as Element).localName)) return '';\n const children = node instanceof HTMLSlotElement ? shown(node) : [...node.childNodes];\n return children.map(gather).join('');\n}\n\n/**\n * The words a node reads as in the flat tree, whitespace collapsed and\n * trimmed: a <slot> through what it shows, anything else through its\n * light-DOM children. Shadow roots are not entered, because a component's\n * own chrome -- an icon, a fallback label -- is not the page's copy.\n *\n * Several nodes read as one run, so the space between a text node and the\n * element after it survives: flatText(...slot.assignedNodes()).\n *\n * This is the text a component copies into a name the platform cannot\n * reference across a shadow boundary (ElementInternals, a control inside a\n * nested atom). Where aria-labelledby can reach, point it at the slot's\n * wrapper instead and let accname read the flat tree itself.\n */\nexport function flatText(...nodes: Node[]): string {\n return nodes.map(gather).join('')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n"],"mappings":"AAIA,IAAMA,kBAAS,IAAI,IAAI,CAAC,SAAU,QAAS,UAAU,CAAC,EAQtD,SAASC,EAAM,EAA+B,CAC5C,IAAMC,EAAWC,EAAK,cAAc,CAAE,QAAS,EAAK,CAAC,EACrD,OAAOD,EAAS,OAASA,EAAW,CAAC,GAAGC,EAAK,UAAU,CACzD,CAEA,SAASC,EAAO,EAAoB,CAIlC,OAHIC,EAAK,WAAa,KAAK,UAAmBA,EAAc,KACxDA,EAAK,WAAa,KAAK,cAAgBL,EAAO,IAAKK,EAAiB,SAAS,EAAU,IAC1EA,aAAgB,gBAAkBJ,EAAMI,CAAI,EAAI,CAAC,GAAGA,EAAK,UAAU,EAAA,CACpE,IAAID,CAAM,CAAC,CAAC,KAAK,EAAE,CACrC,CAgBA,SAAgBE,EAAS,GAAGC,EAAuB,CACjD,OAAOA,EAAM,IAAIH,CAAM,CAAC,CAAC,KAAK,EAAE,CAAC,CAC9B,QAAQ,OAAQ,GAAG,CAAC,CACpB,KAAK,CACV,C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { nothing, type ComplexAttributeConverter, type LitElement, type TemplateResult } from "lit";
|
|
2
2
|
/**
|
|
3
3
|
* What makes a bd-* control take part in a <form>.
|
|
4
4
|
*
|
|
@@ -38,6 +38,7 @@ export declare class FormControlInterface {
|
|
|
38
38
|
checkValidity(): boolean;
|
|
39
39
|
reportValidity(): boolean;
|
|
40
40
|
protected _submitImplicitly(): void;
|
|
41
|
+
protected _relayChange(): void;
|
|
41
42
|
formDisabledCallback(disabled: boolean): void;
|
|
42
43
|
formResetCallback(): void;
|
|
43
44
|
protected _mirrorValidity(control: NativeControl | null | undefined): void;
|
|
@@ -46,16 +47,18 @@ export declare class ValueControlInterface {
|
|
|
46
47
|
protected _resets: number;
|
|
47
48
|
value: string;
|
|
48
49
|
protected _sync(): void;
|
|
50
|
+
protected _defaultValue(): string;
|
|
49
51
|
formStateRestoreCallback(state: string | File | FormData | null): void;
|
|
50
52
|
protected _onFieldKeydown(e: KeyboardEvent): void;
|
|
51
53
|
}
|
|
52
54
|
export declare const FormControl: <T extends Constructor<LitElement>>(Base: T) => Constructor<FormControlInterface> & T;
|
|
53
55
|
/**
|
|
54
56
|
* What a control holding a typed or chosen value adds to FormControl --
|
|
55
|
-
* bd-
|
|
57
|
+
* bd-input, bd-textarea and bd-select.
|
|
56
58
|
*
|
|
57
59
|
* The `value` property is the current value and the value ATTRIBUTE is the
|
|
58
|
-
* default a reset returns to, as on a native field
|
|
60
|
+
* default a reset returns to, as on a native field (bd-select also takes a
|
|
61
|
+
* `selected` option; see _defaultValue there). A reset also rebuilds the
|
|
59
62
|
* native control -- the subclass keys it on `_resets` -- because it has to
|
|
60
63
|
* forget that the reader touched it (:user-invalid), and only the form it
|
|
61
64
|
* belongs to could tell it that; the control in here has none.
|
|
@@ -63,4 +66,33 @@ export declare const FormControl: <T extends Constructor<LitElement>>(Base: T) =
|
|
|
63
66
|
* class BdField extends ValueControl(LitElement) { ... }
|
|
64
67
|
*/
|
|
65
68
|
export declare const ValueControl: <T extends Constructor<LitElement>>(Base: T) => Constructor<ValueControlInterface> & Constructor<FormControlInterface> & T;
|
|
69
|
+
/** The id of the native control a field renders, which its <label for> names. */
|
|
70
|
+
export declare const CONTROL_ID = "control";
|
|
71
|
+
/** The id of the box around the hint slot, which aria-describedby names. */
|
|
72
|
+
export declare const HINT_ID = "hint";
|
|
73
|
+
/** The slots every field renders. */
|
|
74
|
+
export declare const FIELD_SLOTS: readonly ["label", "hint"];
|
|
75
|
+
/** What a field asks of the SlotController that follows its slots. */
|
|
76
|
+
interface Slots {
|
|
77
|
+
has(name: string): boolean;
|
|
78
|
+
}
|
|
79
|
+
/** The size step a field's label class is named for. */
|
|
80
|
+
type FieldSize = 'sm' | 'md' | 'lg';
|
|
81
|
+
/** The field's label: its label slot, inside a <label for> the native control. */
|
|
82
|
+
export declare function fieldLabel(slots: Slots, { size, required }: {
|
|
83
|
+
size: FieldSize;
|
|
84
|
+
required: boolean;
|
|
85
|
+
}, slot: TemplateResult): TemplateResult<1>;
|
|
86
|
+
/** The field's hint: its hint slot, in the box the control is described by. */
|
|
87
|
+
export declare function fieldHint(slots: Slots, tone: 'default' | 'error' | 'success', slot: TemplateResult): TemplateResult<1>;
|
|
88
|
+
/** The control's aria-describedby: the hint, while there is one. */
|
|
89
|
+
export declare const describedBy: (slots: Slots) => "hint" | typeof nothing;
|
|
90
|
+
/**
|
|
91
|
+
* The aria-label a field gives its native control: '' while the label slot
|
|
92
|
+
* holds something, else `label` (the field's `aria-label` attribute), else
|
|
93
|
+
* the words of the `<label for>`s pointing at the field.
|
|
94
|
+
*
|
|
95
|
+
* aria-label=${fieldName(this._slots, this.fieldLabel, this._internals.labels) || nothing}
|
|
96
|
+
*/
|
|
97
|
+
export declare function fieldName(slots: Slots, label: string, labels: NodeList | null | undefined): string;
|
|
66
98
|
export {};
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import e from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{
|
|
1
|
+
import e from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{html as t,nothing as n}from"lit";import{state as r}from"lit/decorators.js";var i={toAttribute:e=>e||null},a=/* @__PURE__ */ new Set([`text`,`search`,`url`,`tel`,`email`,`password`,`date`,`month`,`week`,`time`,`datetime-local`,`number`]),o=t=>{class n extends t{static{this.formAssociated=!0}constructor(...e){super(...e),this._formDisabled=!1,this._attempted=!1,this._internals=this.attachInternals(),this.addEventListener(`invalid`,()=>{this._attempted=!0}),this.addEventListener(`click`,e=>{e.composedPath()[0]===this&&this._fromOutside(e)&&(e.stopImmediatePropagation(),this._activate())})}_fromOutside(e){if(!e.isTrusted)return!0;let t=this.getBoundingClientRect();return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}get _control(){return null}_activate(){this._control?.focus()}get form(){return this._internals.form}get labels(){return this._internals.labels}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}_submitImplicitly(){let e=this.form;if(!e)return;let t=[...e.elements],n=t.find(e=>e.type===`submit`||e.type===`image`);n?n.matches(`:disabled`)||n.click():t.filter(e=>a.has(e.type)).length<=1&&e.requestSubmit()}_relayChange(){this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))}formDisabledCallback(e){this._formDisabled=e}formResetCallback(){this._attempted=!1}_mirrorValidity(e){!e?.willValidate||e.validity.valid?this._internals.setValidity({}):this._internals.setValidity(e.validity,e.validationMessage,e)}}return e([r()],n.prototype,`_formDisabled`,void 0),e([r()],n.prototype,`_attempted`,void 0),n},s=t=>{class n extends o(t){constructor(...e){super(...e),this._resets=0}_sync(){this._internals.setFormValue(this.value),this._mirrorValidity(this._control)}_defaultValue(){return this.getAttribute(`value`)??``}formResetCallback(){super.formResetCallback(),this.value=this._defaultValue(),this._resets++}formStateRestoreCallback(e){this.value=e}_onFieldKeydown(e){e.key===`Enter`&&!e.isComposing&&this._submitImplicitly()}}return e([r()],n.prototype,`_resets`,void 0),n},c=`control`,l=`hint`,u=[`label`,`hint`];function d(e,{size:r,required:i},a){return t`<label
|
|
2
|
+
for=${c}
|
|
3
|
+
part="label"
|
|
4
|
+
class="form-label label-${r}"
|
|
5
|
+
?hidden=${!e.has(`label`)}
|
|
6
|
+
>${a}${i?t`<span class="form-label__required" aria-hidden="true">*</span>`:n}</label>`}function f(e,n,r){return t`<div
|
|
7
|
+
id=${l}
|
|
8
|
+
part="hint"
|
|
9
|
+
class="form-help-text form-help-text--${n}"
|
|
10
|
+
?hidden=${!e.has(`hint`)}
|
|
11
|
+
>${r}</div>`}var p=e=>e.has(`hint`)?l:n;function m(e,t,n){return e.has(`label`)?``:t||[...n??[]].map(e=>e.textContent.trim()).filter(Boolean).join(` `)}export{c as CONTROL_ID,u as FIELD_SLOTS,o as FormControl,l as HINT_ID,s as ValueControl,p as describedBy,f as fieldHint,d as fieldLabel,m as fieldName,i as omitEmpty};
|
|
2
12
|
//# sourceMappingURL=form-control.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.js","names":["__decorate","omitEmpty","value","BLOCKS_IMPLICIT_SUBMISSION","FormControl","FormControlElement","Base","args","r","form","elements","button","el","disabled","control","state","ValueControl","ValueControlElement","_args"],"sources":["../../../../src/components/shared/form-control.ts"],"sourcesContent":["import type { ComplexAttributeConverter, LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\n\n/**\n * What makes a bd-* control take part in a <form>.\n *\n * Every control in this package renders its native element inside a shadow\n * root, and a native control there has no form owner: the <form> around the\n * element could not see it. A form submitted none of them, reset none of them\n * and let a required one through empty. Form-associated custom elements are\n * the platform's answer -- Baseline Widely available since 2023 -- so the\n * host joins the form itself through ElementInternals, the way the guide in\n * .claude/skills/modern-web-guidance/guides/html/form-associated-custom-elements.md\n * lays out, with no hidden input.\n *\n * This is the part every control shares: the opt-in, the internals, the\n * read-only surface a native control has (form, validity, checkValidity...),\n * and the two states a control cannot see from inside its shadow root -- a\n * <fieldset disabled> around it, and a submit that failed. What a control\n * submits, when it is valid and what reset puts back are its own.\n *\n * class BdThing extends FormControl(LitElement) { ... }\n */\n\n/* For `name`, which reflects: FACE submits under the host's name ATTRIBUTE, so\n a name set as a property -- what every framework binding does -- has to\n reach it. An empty name submits nothing either way, so it is left off the\n element rather than written as name=\"\" on every control on the page. */\nexport const omitEmpty: ComplexAttributeConverter<string> = { toAttribute: value => value || null };\n\n/* The input types that block implicit submission (HTML, \"implicit\n submission\"): a form with no submit button submits on Enter only while it\n has at most one field of these. A text field here says which type it is\n through its own `type`, so it is counted the same way. */\nconst BLOCKS_IMPLICIT_SUBMISSION = new Set<string | undefined>([\n 'text', 'search', 'url', 'tel', 'email', 'password', 'date', 'month', 'week', 'time',\n 'datetime-local', 'number'\n]);\n\n// Lit's mixin pattern: the class a mixin returns is typed by the declared\n// interfaces below, so its members reach the elements built on it without the\n// anonymous class itself leaking into the published declarations.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Constructor<T = object> = new (...args: any[]) => T;\n\n/** The native element a control renders and stands in for. */\ntype NativeControl = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLButtonElement;\n\n/* The members a control's own code reaches are protected: they are how the\n elements built on the mixin talk to it, not part of what a page may call. */\nexport declare class FormControlInterface {\n protected _internals : ElementInternals;\n protected _formDisabled: boolean;\n protected _attempted : boolean;\n protected _fromOutside(e: MouseEvent): boolean;\n protected get _control(): NativeControl | null;\n protected _activate(): void;\n get form(): HTMLFormElement | null;\n get labels(): NodeList;\n get validity(): ValidityState;\n get validationMessage(): string;\n get willValidate(): boolean;\n checkValidity(): boolean;\n reportValidity(): boolean;\n protected _submitImplicitly(): void;\n formDisabledCallback(disabled: boolean): void;\n formResetCallback(): void;\n protected _mirrorValidity(control: NativeControl | null | undefined): void;\n}\n\nexport declare class ValueControlInterface {\n protected _resets: number;\n value : string;\n protected _sync(): void;\n formStateRestoreCallback(state: string | File | FormData | null): void;\n protected _onFieldKeydown(e: KeyboardEvent): void;\n}\n\nexport const FormControl = <T extends Constructor<LitElement>>(Base: T) => {\n class FormControlElement extends Base {\n static formAssociated = true;\n\n /* Disabled as the form sees it: the control's own `disabled`, or a\n <fieldset disabled> it sits in. The platform reports both through\n formDisabledCallback. It is kept here and never written to the host's\n attribute, or a fieldset re-enabled later could not re-enable it. */\n @state() protected _formDisabled = false;\n /* A submit has been tried and found this control invalid. A native\n control turns :user-invalid then, but the native element in here has\n no form owner, so it never learns of the attempt; the `invalid` event\n the form fires at the host is how it hears. checkValidity() fires the\n same event, so a silent check counts too. Reset clears it. */\n @state() protected _attempted = false;\n protected _internals: ElementInternals;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- a mixin constructor must take any[]\n constructor(...args: any[]) {\n super(...args);\n this._internals = this.attachInternals();\n this.addEventListener('invalid', () => { this._attempted = true; });\n /* An outside activation is passed on to the native control, whose own\n click then reaches this element like any other. This one stops here, so\n a click listener on the element hears one click, not two -- one\n el.click() is one click on a native control. Registered in the\n constructor, it runs before any listener the page adds. */\n this.addEventListener('click', e => {\n if (e.composedPath()[0] !== this || !this._fromOutside(e)) return;\n e.stopImmediatePropagation();\n this._activate();\n });\n }\n\n /* A click on the host itself, not on anything inside it, is one of three\n things. A <label for> pointing at this element sends one carrying the\n label's position, and el.click() an untrusted one: the two ways a native\n control is activated from outside, and both activate this one. The third\n is a real click inside the host's own box but on nothing in it -- the\n slack beside a short label when a column stretches the host -- and that\n did nothing before and still does not, or a wide row would toggle from\n across the page. */\n protected _fromOutside(e: MouseEvent) {\n if (!e.isTrusted) return true;\n const r = this.getBoundingClientRect();\n return e.clientX < r.left || e.clientX > r.right || e.clientY < r.top || e.clientY > r.bottom;\n }\n\n /** The native element inside; each control says which. */\n protected get _control(): NativeControl | null {\n return null;\n }\n\n /** What an outside activation does: a field takes focus, a checkable control overrides this to toggle. */\n protected _activate() {\n this._control?.focus();\n }\n\n get form() { return this._internals.form; }\n get labels() { return this._internals.labels; }\n get validity() { return this._internals.validity; }\n get validationMessage() { return this._internals.validationMessage; }\n get willValidate() { return this._internals.willValidate; }\n checkValidity() { return this._internals.checkValidity(); }\n reportValidity() { return this._internals.reportValidity(); }\n\n /* Enter in a native text field, checkbox, radio or switch submits its\n form -- implicit submission: the form's default button is clicked, or,\n with none, the form is submitted, unless more than one of its fields\n blocks that (BLOCKS_IMPLICIT_SUBMISSION above). Enter never toggles;\n Space does. The native control in here has no form, so the host does it.\n The default button is the form's first submit button, and a bd-button\n with type=\"submit\" is one: it is in form.elements and its type says so.\n A disabled default button means no submission, as natively. */\n protected _submitImplicitly() {\n const form = this.form;\n if (!form) return;\n const elements = [...form.elements] as Array<HTMLElement & { type?: string }>;\n const button = elements.find(el => el.type === 'submit' || el.type === 'image');\n if (button) {\n if (!button.matches(':disabled')) button.click();\n return;\n }\n const blocking = elements.filter(el => BLOCKS_IMPLICIT_SUBMISSION.has(el.type)).length;\n if (blocking <= 1) form.requestSubmit();\n }\n\n formDisabledCallback(disabled: boolean) {\n this._formDisabled = disabled;\n }\n\n formResetCallback() {\n this._attempted = false;\n }\n\n /* The native control already knows whether it is valid, and says so in the\n browser's own words and language, so the host repeats it rather than\n re-deriving it. The control is the anchor: reportValidity() and a failed\n submit focus it and point the message at it. A disabled control is out\n of validation altogether, and says so with an empty message that\n setValidity() would refuse; the host is disabled with it. */\n protected _mirrorValidity(control: NativeControl | null | undefined) {\n if (!control?.willValidate || control.validity.valid) {\n this._internals.setValidity({});\n } else {\n this._internals.setValidity(control.validity, control.validationMessage, control);\n }\n }\n }\n return FormControlElement as unknown as Constructor<FormControlInterface> & T;\n};\n\n/**\n * What a control holding a typed or chosen value adds to FormControl --\n * bd-custom-input, the clipboard field, bd-textarea, bd-custom-dropdown.\n *\n * The `value` property is the current value and the value ATTRIBUTE is the\n * default a reset returns to, as on a native field. A reset also rebuilds the\n * native control -- the subclass keys it on `_resets` -- because it has to\n * forget that the reader touched it (:user-invalid), and only the form it\n * belongs to could tell it that; the control in here has none.\n *\n * class BdField extends ValueControl(LitElement) { ... }\n */\nexport const ValueControl = <T extends Constructor<LitElement>>(Base: T) => {\n class ValueControlElement extends FormControl(Base) {\n @state() protected _resets = 0;\n declare value: string;\n\n /* What a form sees: the value, and whether the native control finds it\n valid -- required, type, and anything else it checks -- in its own\n words. Called after every update, and before a field's own events, so a\n handler asking the form gets the answer for what was just typed. */\n protected _sync() {\n this._internals.setFormValue(this.value);\n this._mirrorValidity(this._control);\n }\n\n formResetCallback() {\n super.formResetCallback();\n this.value = this.getAttribute('value') ?? '';\n this._resets++;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = state as string;\n }\n\n /* Enter in a one-line field submits its form, as from a native <input>.\n Not mid-composition: there Enter commits the IME's candidate. */\n protected _onFieldKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter' && !e.isComposing) this._submitImplicitly();\n }\n }\n return ValueControlElement as unknown as Constructor<ValueControlInterface> & Constructor<FormControlInterface> & T;\n};\n"],"mappings":"A,oHA4BA,IAAaC,EAA+C,CAAE,YAAa,GAASC,GAAS,IAAK,EAM5FC,kBAA6B,IAAI,IAAwB,CAC7D,OAAQ,SAAU,MAAO,MAAO,QAAS,WAAY,OAAQ,QAAS,OAAQ,OAC9E,iBAAkB,QACpB,CAAC,EAyCYC,EAAkD,GAAY,CACzE,MAAMC,UAA2BC,CAAK,C,OACZ,KAAA,eAAA,E,CAgBxB,YAAY,GAAGC,EAAa,CAC1B,MAAM,GAAGA,CAAI,EAXoB,KAAA,cAAA,GAMH,KAAA,WAAA,GAM9B,KAAK,WAAa,KAAK,gBAAgB,EACvC,KAAK,iBAAiB,cAAiB,CAAE,KAAK,WAAa,EAAM,CAAC,EAMlE,KAAK,iBAAiB,QAAS,GAAK,CAC9B,EAAE,aAAa,CAAC,CAAC,KAAO,MAAS,KAAK,aAAa,CAAC,IACxD,EAAE,yBAAyB,EAC3B,KAAK,UAAU,EACjB,CAAC,CACH,CAUA,aAAuB,EAAe,CACpC,GAAI,CAAC,EAAE,UAAW,MAAO,GACzB,IAAMC,EAAI,KAAK,sBAAsB,EACrC,OAAO,EAAE,QAAUA,EAAE,MAAQ,EAAE,QAAUA,EAAE,OAAS,EAAE,QAAUA,EAAE,KAAO,EAAE,QAAUA,EAAE,MACzF,CAGA,IAAc,UAAiC,CAC7C,OAAO,IACT,CAGA,WAAsB,CACpB,KAAK,UAAU,MAAM,CACvB,CAEA,IAAI,MAAO,CAAE,OAAO,KAAK,WAAW,IAAM,CAC1C,IAAI,QAAS,CAAE,OAAO,KAAK,WAAW,MAAQ,CAC9C,IAAI,UAAW,CAAE,OAAO,KAAK,WAAW,QAAU,CAClD,IAAI,mBAAoB,CAAE,OAAO,KAAK,WAAW,iBAAmB,CACpE,IAAI,cAAe,CAAE,OAAO,KAAK,WAAW,YAAc,CAC1D,eAAgB,CAAE,OAAO,KAAK,WAAW,cAAc,CAAG,CAC1D,gBAAiB,CAAE,OAAO,KAAK,WAAW,eAAe,CAAG,CAU5D,mBAA8B,CAC5B,IAAMC,EAAO,KAAK,KAClB,GAAI,CAACA,EAAM,OACX,IAAMC,EAAW,CAAC,GAAGD,EAAK,QAAQ,EAC5BE,EAASD,EAAS,KAAK,GAAME,EAAG,OAAS,UAAYA,EAAG,OAAS,OAAO,EAC1ED,EACGA,EAAO,QAAQ,WAAW,GAAGA,EAAO,MAAM,EAGhCD,EAAS,OAAO,GAAMP,EAA2B,IAAIS,EAAG,IAAI,CAAC,CAAC,CAAC,QAChE,GAAGH,EAAK,cAAc,CACxC,CAEA,qBAAqB,EAAmB,CACtC,KAAK,cAAgBI,CACvB,CAEA,mBAAoB,CAClB,KAAK,WAAa,EACpB,CAQA,gBAA0B,EAA2C,CAC/D,CAACC,GAAS,cAAgBA,EAAQ,SAAS,MAC7C,KAAK,WAAW,YAAY,CAAC,CAAC,EAE9B,KAAK,WAAW,YAAYA,EAAQ,SAAUA,EAAQ,kBAAmBA,CAAO,CAEpF,CACF,CACA,OArGGd,EAAA,CAAAe,EAAM,CAAA,EAAAV,EAAA,UAAA,gBAAA,IAAA,EAAA,EAMNL,EAAA,CAAAe,EAAM,CAAA,EAAAV,EAAA,UAAA,aAAA,IAAA,EAAA,EA+FFA,CACT,EAcaW,EAAmD,GAAY,CAC1E,MAAMC,UAA4Bb,EAAYE,CAAI,CAAC,AAAC,C,8BACrB,KAAA,QAAA,C,CAO7B,OAAkB,CAChB,KAAK,WAAW,aAAa,KAAK,KAAK,EACvC,KAAK,gBAAgB,KAAK,QAAQ,CACpC,CAEA,mBAAoB,CAClB,MAAM,kBAAkB,EACxB,KAAK,MAAQ,KAAK,aAAa,OAAO,GAAK,GAC3C,KAAK,SACP,CAEA,yBAAyB,EAAwC,CAC/D,KAAK,MAAQS,CACf,CAIA,gBAA0B,EAAkB,CACtC,EAAE,MAAQ,SAAW,CAAC,EAAE,aAAa,KAAK,kBAAkB,CAClE,CACF,CACA,OA5BGf,EAAA,CAAAe,EAAM,CAAA,EAAAE,EAAA,UAAA,UAAA,IAAA,EAAA,EA4BFA,CACT,E"}
|
|
1
|
+
{"version":3,"file":"form-control.js","names":["__decorate","omitEmpty","value","BLOCKS_IMPLICIT_SUBMISSION","FormControl","FormControlElement","Base","args","r","form","elements","button","el","disabled","control","state","ValueControl","ValueControlElement","_args","CONTROL_ID","HINT_ID","FIELD_SLOTS","fieldLabel","size","slots","slot","required","nothing","fieldHint","tone","describedBy","fieldName","label","labels","l"],"sources":["../../../../src/components/shared/form-control.ts"],"sourcesContent":["import { html, nothing, type ComplexAttributeConverter, type LitElement, type TemplateResult } from 'lit';\nimport { state } from 'lit/decorators.js';\n\n/**\n * What makes a bd-* control take part in a <form>.\n *\n * Every control in this package renders its native element inside a shadow\n * root, and a native control there has no form owner: the <form> around the\n * element could not see it. A form submitted none of them, reset none of them\n * and let a required one through empty. Form-associated custom elements are\n * the platform's answer -- Baseline Widely available since 2023 -- so the\n * host joins the form itself through ElementInternals, the way the guide in\n * .claude/skills/modern-web-guidance/guides/html/form-associated-custom-elements.md\n * lays out, with no hidden input.\n *\n * This is the part every control shares: the opt-in, the internals, the\n * read-only surface a native control has (form, validity, checkValidity...),\n * and the two states a control cannot see from inside its shadow root -- a\n * <fieldset disabled> around it, and a submit that failed. What a control\n * submits, when it is valid and what reset puts back are its own.\n *\n * class BdThing extends FormControl(LitElement) { ... }\n */\n\n/* For `name`, which reflects: FACE submits under the host's name ATTRIBUTE, so\n a name set as a property -- what every framework binding does -- has to\n reach it. An empty name submits nothing either way, so it is left off the\n element rather than written as name=\"\" on every control on the page. */\nexport const omitEmpty: ComplexAttributeConverter<string> = { toAttribute: value => value || null };\n\n/* The input types that block implicit submission (HTML, \"implicit\n submission\"): a form with no submit button submits on Enter only while it\n has at most one field of these. A text field here says which type it is\n through its own `type`, so it is counted the same way. */\nconst BLOCKS_IMPLICIT_SUBMISSION = new Set<string | undefined>([\n 'text', 'search', 'url', 'tel', 'email', 'password', 'date', 'month', 'week', 'time',\n 'datetime-local', 'number'\n]);\n\n// Lit's mixin pattern: the class a mixin returns is typed by the declared\n// interfaces below, so its members reach the elements built on it without the\n// anonymous class itself leaking into the published declarations.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Constructor<T = object> = new (...args: any[]) => T;\n\n/** The native element a control renders and stands in for. */\ntype NativeControl = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLButtonElement;\n\n/* The members a control's own code reaches are protected: they are how the\n elements built on the mixin talk to it, not part of what a page may call. */\nexport declare class FormControlInterface {\n protected _internals : ElementInternals;\n protected _formDisabled: boolean;\n protected _attempted : boolean;\n protected _fromOutside(e: MouseEvent): boolean;\n protected get _control(): NativeControl | null;\n protected _activate(): void;\n get form(): HTMLFormElement | null;\n get labels(): NodeList;\n get validity(): ValidityState;\n get validationMessage(): string;\n get willValidate(): boolean;\n checkValidity(): boolean;\n reportValidity(): boolean;\n protected _submitImplicitly(): void;\n protected _relayChange(): void;\n formDisabledCallback(disabled: boolean): void;\n formResetCallback(): void;\n protected _mirrorValidity(control: NativeControl | null | undefined): void;\n}\n\nexport declare class ValueControlInterface {\n protected _resets: number;\n value : string;\n protected _sync(): void;\n protected _defaultValue(): string;\n formStateRestoreCallback(state: string | File | FormData | null): void;\n protected _onFieldKeydown(e: KeyboardEvent): void;\n}\n\nexport const FormControl = <T extends Constructor<LitElement>>(Base: T) => {\n class FormControlElement extends Base {\n static formAssociated = true;\n\n /* Disabled as the form sees it: the control's own `disabled`, or a\n <fieldset disabled> it sits in. The platform reports both through\n formDisabledCallback. It is kept here and never written to the host's\n attribute, or a fieldset re-enabled later could not re-enable it. */\n @state() protected _formDisabled = false;\n /* A submit has been tried and found this control invalid. A native\n control turns :user-invalid then, but the native element in here has\n no form owner, so it never learns of the attempt; the `invalid` event\n the form fires at the host is how it hears. checkValidity() fires the\n same event, so a silent check counts too. Reset clears it. */\n @state() protected _attempted = false;\n protected _internals: ElementInternals;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- a mixin constructor must take any[]\n constructor(...args: any[]) {\n super(...args);\n this._internals = this.attachInternals();\n this.addEventListener('invalid', () => { this._attempted = true; });\n /* An outside activation is passed on to the native control, whose own\n click then reaches this element like any other. This one stops here, so\n a click listener on the element hears one click, not two -- one\n el.click() is one click on a native control. Registered in the\n constructor, it runs before any listener the page adds. */\n this.addEventListener('click', e => {\n if (e.composedPath()[0] !== this || !this._fromOutside(e)) return;\n e.stopImmediatePropagation();\n this._activate();\n });\n }\n\n /* A click on the host itself, not on anything inside it, is one of three\n things. A <label for> pointing at this element sends one carrying the\n label's position, and el.click() an untrusted one: the two ways a native\n control is activated from outside, and both activate this one. The third\n is a real click inside the host's own box but on nothing in it -- the\n slack beside a short label when a column stretches the host -- and that\n did nothing before and still does not, or a wide row would toggle from\n across the page. */\n protected _fromOutside(e: MouseEvent) {\n if (!e.isTrusted) return true;\n const r = this.getBoundingClientRect();\n return e.clientX < r.left || e.clientX > r.right || e.clientY < r.top || e.clientY > r.bottom;\n }\n\n /** The native element inside; each control says which. */\n protected get _control(): NativeControl | null {\n return null;\n }\n\n /** What an outside activation does: a field takes focus, a checkable control overrides this to toggle. */\n protected _activate() {\n this._control?.focus();\n }\n\n get form() { return this._internals.form; }\n get labels() { return this._internals.labels; }\n get validity() { return this._internals.validity; }\n get validationMessage() { return this._internals.validationMessage; }\n get willValidate() { return this._internals.willValidate; }\n checkValidity() { return this._internals.checkValidity(); }\n reportValidity() { return this._internals.reportValidity(); }\n\n /* Enter in a native text field, checkbox, radio or switch submits its\n form -- implicit submission: the form's default button is clicked, or,\n with none, the form is submitted, unless more than one of its fields\n blocks that (BLOCKS_IMPLICIT_SUBMISSION above). Enter never toggles;\n Space does. The native control in here has no form, so the host does it.\n The default button is the form's first submit button, and a bd-button\n with type=\"submit\" is one: it is in form.elements and its type says so.\n A disabled default button means no submission, as natively. */\n protected _submitImplicitly() {\n const form = this.form;\n if (!form) return;\n const elements = [...form.elements] as Array<HTMLElement & { type?: string }>;\n const button = elements.find(el => el.type === 'submit' || el.type === 'image');\n if (button) {\n if (!button.matches(':disabled')) button.click();\n return;\n }\n const blocking = elements.filter(el => BLOCKS_IMPLICIT_SUBMISSION.has(el.type)).length;\n if (blocking <= 1) form.requestSubmit();\n }\n\n /* THE NATIVE EVENTS, AND WHICH ONE HAS TO BE SENT AGAIN.\n A control sends what its native control sends -- `input` as the value\n moves, `change` when it is committed -- with no detail: a listener reads\n event.target.value, or .checked, off the element, as it would off an\n <input>. (3.x sent bd-input and bd-change with a detail; v4 drops both,\n N8 in docs/adr/0004-web-awesome-naming.md.)\n\n The two do not leave the shadow root alike. `input` is composed, so the\n native one already reaches the page, retargeted to this element, and is\n not sent again: a second would make one keystroke two events. `change`\n is not composed and stops at the shadow root, so the element sends its\n own, once, after its state has followed the native control's. Composed,\n as `input` is, so a form handler above an enclosing component's shadow\n root hears both. */\n protected _relayChange() {\n this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));\n }\n\n formDisabledCallback(disabled: boolean) {\n this._formDisabled = disabled;\n }\n\n formResetCallback() {\n this._attempted = false;\n }\n\n /* The native control already knows whether it is valid, and says so in the\n browser's own words and language, so the host repeats it rather than\n re-deriving it. The control is the anchor: reportValidity() and a failed\n submit focus it and point the message at it. A disabled control is out\n of validation altogether, and says so with an empty message that\n setValidity() would refuse; the host is disabled with it. */\n protected _mirrorValidity(control: NativeControl | null | undefined) {\n if (!control?.willValidate || control.validity.valid) {\n this._internals.setValidity({});\n } else {\n this._internals.setValidity(control.validity, control.validationMessage, control);\n }\n }\n }\n return FormControlElement as unknown as Constructor<FormControlInterface> & T;\n};\n\n/**\n * What a control holding a typed or chosen value adds to FormControl --\n * bd-input, bd-textarea and bd-select.\n *\n * The `value` property is the current value and the value ATTRIBUTE is the\n * default a reset returns to, as on a native field (bd-select also takes a\n * `selected` option; see _defaultValue there). A reset also rebuilds the\n * native control -- the subclass keys it on `_resets` -- because it has to\n * forget that the reader touched it (:user-invalid), and only the form it\n * belongs to could tell it that; the control in here has none.\n *\n * class BdField extends ValueControl(LitElement) { ... }\n */\nexport const ValueControl = <T extends Constructor<LitElement>>(Base: T) => {\n class ValueControlElement extends FormControl(Base) {\n @state() protected _resets = 0;\n declare value: string;\n\n /* What a form sees: the value, and whether the native control finds it\n valid -- required, type, and anything else it checks -- in its own\n words. Called after every update, and before a field's own events, so a\n handler asking the form gets the answer for what was just typed. */\n protected _sync() {\n this._internals.setFormValue(this.value);\n this._mirrorValidity(this._control);\n }\n\n /** What a reset returns to: the value attribute, as on a native field. */\n protected _defaultValue() {\n return this.getAttribute('value') ?? '';\n }\n\n formResetCallback() {\n super.formResetCallback();\n this.value = this._defaultValue();\n this._resets++;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.value = state as string;\n }\n\n /* Enter in a one-line field submits its form, as from a native <input>.\n Not mid-composition: there Enter commits the IME's candidate. */\n protected _onFieldKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter' && !e.isComposing) this._submitImplicitly();\n }\n }\n return ValueControlElement as unknown as Constructor<ValueControlInterface> & Constructor<FormControlInterface> & T;\n};\n\n/* ---------- the field's label and hint ----------\n bd-input, bd-select and bd-textarea draw one field: a label, the control\n and a hint under it. The copy is the page's, in two slots (contract rule 4,\n docs/adr/0003-copy-in-light-dom.md):\n\n <bd-input name=\"email\" type=\"email\" required>\n <span slot=\"label\">Email</span>\n <span slot=\"hint\">Where we send the licence.</span>\n </bd-input>\n\n Each slot is always rendered, and its wrapper hidden while it is empty, so\n an unlabelled field draws no label box and no gap.\n\n The names reach the control inside without copying any text. The label\n slot sits in the <label for> of the native control, and the hint slot in\n the box its aria-describedby names: both references stay inside this\n shadow root, and name computation reads the flattened tree, so the slotted\n words are the control's name and description. The description is only\n pointed at while the hint holds something -- an empty one would describe\n the field as nothing. ids are scoped to the shadow root, so fixed ones are\n safe.\n\n The wrappers are drawn here, once; each field writes its own <slot> into\n them, so the slots a component renders stay in its render, where\n check:manifest reads them:\n\n ${fieldLabel(this._slots, { size, required }, html`<slot name=\"label\"></slot>`)} */\n\n/** The id of the native control a field renders, which its <label for> names. */\nexport const CONTROL_ID = 'control';\n/** The id of the box around the hint slot, which aria-describedby names. */\nexport const HINT_ID = 'hint';\n/** The slots every field renders. */\nexport const FIELD_SLOTS = ['label', 'hint'] as const;\n\n/** What a field asks of the SlotController that follows its slots. */\ninterface Slots { has(name: string): boolean }\n\n/** The size step a field's label class is named for. */\ntype FieldSize = 'sm' | 'md' | 'lg';\n\n/** The field's label: its label slot, inside a <label for> the native control. */\nexport function fieldLabel(slots: Slots, { size, required }: { size: FieldSize; required: boolean }, slot: TemplateResult) {\n return html`<label\n for=${CONTROL_ID}\n part=\"label\"\n class=\"form-label label-${size}\"\n ?hidden=${!slots.has('label')}\n >${slot}${required\n ? html`<span class=\"form-label__required\" aria-hidden=\"true\">*</span>`\n : nothing}</label>`;\n}\n\n/** The field's hint: its hint slot, in the box the control is described by. */\nexport function fieldHint(slots: Slots, tone: 'default' | 'error' | 'success', slot: TemplateResult) {\n return html`<div\n id=${HINT_ID}\n part=\"hint\"\n class=\"form-help-text form-help-text--${tone}\"\n ?hidden=${!slots.has('hint')}\n >${slot}</div>`;\n}\n\n/** The control's aria-describedby: the hint, while there is one. */\nexport const describedBy = (slots: Slots) => (slots.has('hint') ? HINT_ID : nothing);\n\n/* A field with no visible label still needs a name, and the two ways a page\n gives one without drawing it reach the host, not the native control a\n screen reader focuses: aria-label on the host names nothing there, and a\n <label for> outside the shadow root cannot name the control inside it --\n FACE hands the host its labels, nothing more. So the field passes either\n on, as the control's own aria-label. The label slot wins: while it holds\n something, the <label for> above already names the control, and a second\n source for the name could only disagree with the words on the screen. */\n\n/**\n * The aria-label a field gives its native control: '' while the label slot\n * holds something, else `label` (the field's `aria-label` attribute), else\n * the words of the `<label for>`s pointing at the field.\n *\n * aria-label=${fieldName(this._slots, this.fieldLabel, this._internals.labels) || nothing}\n */\nexport function fieldName(slots: Slots, label: string, labels: NodeList | null | undefined) {\n if (slots.has('label')) return '';\n if (label) return label;\n return [...(labels ?? [])].map(l => l.textContent!.trim()).filter(Boolean)\n .join(' ');\n}\n"],"mappings":"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"}
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
* The shared chrome for a form field: its label, the control itself, its three
|
|
3
3
|
* sizes, its states and its help text.
|
|
4
4
|
*
|
|
5
|
-
* bd-
|
|
6
|
-
*
|
|
5
|
+
* bd-input, bd-select and bd-textarea are one field with three kinds of
|
|
6
|
+
* control in the middle. bd-input and bd-select, with the clipboard field
|
|
7
|
+
* 3.x had, used to be three
|
|
7
8
|
* stylesheets of about 160 lines each, roughly 130 of them identical, and they
|
|
8
9
|
* had drifted: the select set its labels and help text at line-height normal
|
|
9
10
|
* where the other two used tight, and its `md` size declared 8px of vertical
|
|
10
11
|
* padding while the height formula on the line below assumed 12. Every fix had
|
|
11
12
|
* to be applied three times and demonstrably had not been.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
* bd-toggle-radio. A component imports this first and then its own sheet:
|
|
14
|
+
* A component imports this first and then its own sheet:
|
|
15
15
|
*
|
|
16
|
-
* static styles = [formFieldCSS,
|
|
16
|
+
* static styles = [formFieldCSS, selectCSS];
|
|
17
17
|
*
|
|
18
18
|
* Values come from the --form-input-* and --form-label-* component tokens
|
|
19
19
|
* rather than from the palette, which is what bd-textarea was already doing
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{css as e}from"lit";var t=e`:host{display:block}.input-container{flex-direction:column;display:flex}.form-label{font-family:var(--form-label-default-fontFamily);color:var(--form-label-default-color);letter-spacing:var(--form-label-default-letterSpacing);display:block}.label-sm{font-size:var(--form-label-small-fontSize);font-weight:var(--form-label-small-fontWeight);line-height:var(--form-label-small-lineHeight);letter-spacing:var(--form-label-small-letterSpacing);margin-bottom:var(--form-label-small-marginBottom)}.label-md{font-size:var(--form-label-default-fontSize);font-weight:var(--form-label-default-fontWeight);line-height:var(--form-label-default-lineHeight);margin-bottom:var(--form-label-default-marginBottom)}.label-lg{font-size:var(--form-label-large-fontSize);font-weight:var(--form-label-large-fontWeight);line-height:var(--form-label-large-lineHeight);margin-bottom:var(--form-label-large-marginBottom)}.form-label__required{color:var(--form-label-required-color);margin-inline-start:var(--form-label-required-marginLeft)}.form-input-bd{box-sizing:border-box;width:100%;font-family:var(--form-input-default-fontFamily);line-height:var(--typography-lineHeight-tight);border:var(--form-input-default-borderWidth) solid var(--form-input-default-borderColor);background-color:var(--form-input-default-backgroundColor);color:var(--form-input-default-color);transition:border-color var(--transition-duration-slow) var(--transition-easing-smooth), background-color var(--transition-duration-slow) var(--transition-easing-smooth), box-shadow var(--transition-duration-slow) var(--transition-easing-smooth);outline:none}.form-input-bd:focus-visible{border-color:var(--form-input-focus-borderColor);box-shadow:var(--focus-outline-primary);outline:var(--border-width-2) solid transparent;outline-offset:var(--focus-outline-offset)}.input-sm{padding:var(--form-input-small-padding);font-size:var(--form-input-small-fontSize);height:var(--form-input-small-height);border-radius:var(--form-input-small-borderRadius)}.input-md{padding:var(--form-input-medium-padding);font-size:var(--form-input-medium-fontSize);height:var(--form-input-medium-height);border-radius:var(--form-input-medium-borderRadius)}.input-lg{padding:var(--form-input-large-padding);font-size:var(--form-input-large-fontSize);height:var(--form-input-large-height);border-radius:var(--form-input-large-borderRadius)}.input-sm:not(textarea){padding-block:calc(var(--spacing-8) - var(--form-input-default-borderWidth))}.input-md:not(textarea){padding-block:calc(var(--spacing-12) - var(--form-input-default-borderWidth))}.input-lg:not(textarea){padding-block:calc(var(--spacing-16) - var(--form-input-default-borderWidth))}::placeholder{color:var(--color-text-subtle);opacity:1}.form-input--error::placeholder,.form-input-bd:where(:user-invalid)::placeholder,.form-input--attempted:where(:invalid)::placeholder,.form-input--success::placeholder{color:var(--color-text-muted)}.form-input--error,.form-input-bd:where(:user-invalid),.form-input--attempted:where(:invalid){background-color:var(--form-input-error-backgroundColor);border-color:var(--form-input-error-borderColor)}.form-input--success{background-color:var(--form-input-success-backgroundColor);border-color:var(--form-input-success-borderColor)}.form-input--disabled{background-color:var(--form-input-disabled-backgroundColor);border-color:var(--form-input-disabled-borderColor);color:var(--form-input-disabled-color);cursor:not-allowed}.form-help-text{font-family:var(--form-help-text-default-fontFamily);font-size:var(--form-help-text-default-fontSize);font-weight:var(--form-help-text-default-fontWeight);line-height:var(--form-help-text-default-lineHeight);letter-spacing:var(--form-help-text-default-letterSpacing);margin-top:var(--form-help-text-default-marginTop)}.form-help-text--default{color:var(--form-help-text-default-color)}.form-help-text--error,.input-container:has(.form-input--attempted:invalid) .form-help-text--default{color:var(--form-help-text-error-color)}.input-container:has(.form-input-bd:user-invalid) .form-help-text--default{color:var(--form-help-text-error-color)}.form-help-text--success{color:var(--form-help-text-success-color)}@media (prefers-reduced-motion:reduce){.form-input-bd{transition:none}}`;export{t as default,t as formFieldCSS};
|
|
1
|
+
import{css as e}from"lit";var t=e`:host{display:block}.input-container{flex-direction:column;display:flex}.form-label[hidden],.form-help-text[hidden]{display:none}.form-label{font-family:var(--form-label-default-fontFamily);color:var(--form-label-default-color);letter-spacing:var(--form-label-default-letterSpacing);display:block}.label-sm{font-size:var(--form-label-small-fontSize);font-weight:var(--form-label-small-fontWeight);line-height:var(--form-label-small-lineHeight);letter-spacing:var(--form-label-small-letterSpacing);margin-bottom:var(--form-label-small-marginBottom)}.label-md{font-size:var(--form-label-default-fontSize);font-weight:var(--form-label-default-fontWeight);line-height:var(--form-label-default-lineHeight);margin-bottom:var(--form-label-default-marginBottom)}.label-lg{font-size:var(--form-label-large-fontSize);font-weight:var(--form-label-large-fontWeight);line-height:var(--form-label-large-lineHeight);margin-bottom:var(--form-label-large-marginBottom)}.form-label__required{color:var(--form-label-required-color);margin-inline-start:var(--form-label-required-marginLeft)}.form-input-bd{box-sizing:border-box;width:100%;font-family:var(--form-input-default-fontFamily);line-height:var(--typography-lineHeight-tight);border:var(--form-input-default-borderWidth) solid var(--form-input-default-borderColor);background-color:var(--form-input-default-backgroundColor);color:var(--form-input-default-color);transition:border-color var(--transition-duration-slow) var(--transition-easing-smooth), background-color var(--transition-duration-slow) var(--transition-easing-smooth), box-shadow var(--transition-duration-slow) var(--transition-easing-smooth);outline:none}.form-input-bd:focus-visible{border-color:var(--form-input-focus-borderColor);box-shadow:var(--focus-outline-primary);outline:var(--border-width-2) solid transparent;outline-offset:var(--focus-outline-offset)}.input-sm{padding:var(--form-input-small-padding);font-size:var(--form-input-small-fontSize);height:var(--form-input-small-height);border-radius:var(--form-input-small-borderRadius)}.input-md{padding:var(--form-input-medium-padding);font-size:var(--form-input-medium-fontSize);height:var(--form-input-medium-height);border-radius:var(--form-input-medium-borderRadius)}.input-lg{padding:var(--form-input-large-padding);font-size:var(--form-input-large-fontSize);height:var(--form-input-large-height);border-radius:var(--form-input-large-borderRadius)}.input-sm:not(textarea){padding-block:calc(var(--spacing-8) - var(--form-input-default-borderWidth))}.input-md:not(textarea){padding-block:calc(var(--spacing-12) - var(--form-input-default-borderWidth))}.input-lg:not(textarea){padding-block:calc(var(--spacing-16) - var(--form-input-default-borderWidth))}::placeholder{color:var(--color-text-subtle);opacity:1}.form-input--error::placeholder,.form-input-bd:where(:user-invalid)::placeholder,.form-input--attempted:where(:invalid)::placeholder,.form-input--success::placeholder{color:var(--color-text-muted)}.form-input--error,.form-input-bd:where(:user-invalid),.form-input--attempted:where(:invalid){background-color:var(--form-input-error-backgroundColor);border-color:var(--form-input-error-borderColor)}.form-input--success{background-color:var(--form-input-success-backgroundColor);border-color:var(--form-input-success-borderColor)}.form-input--disabled{background-color:var(--form-input-disabled-backgroundColor);border-color:var(--form-input-disabled-borderColor);color:var(--form-input-disabled-color);cursor:not-allowed}.form-help-text{font-family:var(--form-help-text-default-fontFamily);font-size:var(--form-help-text-default-fontSize);font-weight:var(--form-help-text-default-fontWeight);line-height:var(--form-help-text-default-lineHeight);letter-spacing:var(--form-help-text-default-letterSpacing);margin-top:var(--form-help-text-default-marginTop)}.form-help-text--default{color:var(--form-help-text-default-color)}.form-help-text--error,.input-container:has(.form-input--attempted:invalid) .form-help-text--default{color:var(--form-help-text-error-color)}.input-container:has(.form-input-bd:user-invalid) .form-help-text--default{color:var(--form-help-text-error-color)}.form-help-text--success{color:var(--form-help-text-success-color)}@media (prefers-reduced-motion:reduce){.form-input-bd{transition:none}}`;export{t as default,t as formFieldCSS};
|
|
2
2
|
//# sourceMappingURL=form-field.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.css.js","names":["formFieldCSS"],"sources":["../../../../src/components/shared/form-field.css.ts"],"sourcesContent":["import { css } from \"lit\";\n\n/**\n * The shared chrome for a form field: its label, the control itself, its three\n * sizes, its states and its help text.\n *\n * bd-custom-input, bd-custom-dropdown and bd-custom-input-clipboard are one\n * field with three kinds of control in the middle. They used to be three\n * stylesheets of about 160 lines each, roughly 130 of them identical, and they\n * had drifted: the select set its labels and help text at line-height normal\n * where the other two used tight, and its `md` size declared 8px of vertical\n * padding while the height formula on the line below assumed 12. Every fix had\n * to be applied three times and demonstrably had not been.\n *\n * This is the same arrangement radio.css.ts already uses across bd-radio and\n * bd-toggle-radio. A component imports this first and then its own sheet:\n *\n * static styles = [formFieldCSS, dropdownCSS];\n *\n * Values come from the --form-input-* and --form-label-* component tokens\n * rather than from the palette, which is what bd-textarea was already doing\n * and what lets a single token change reach all four controls.\n */\nexport const formFieldCSS = css`\n /* No width. This used to be 90%, an arbitrary fraction that made every field\n narrower than whatever contained it and left the last tenth unexplained.\n A field is display:block and fills its container; deciding how wide that\n container is belongs to the page. */\n :host {\n display: block;\n }\n\n .input-container {\n display: flex;\n flex-direction: column;\n }\n\n /* ---- label ------------------------------------------------------------\n Driven by --form-label-*, the same tokens bd-label reads, so the field's\n built-in label and the standalone atom render identically. They did not\n before: these rules hardcoded bold where the token says medium, which is\n 200 units apart on the same line of the same form. */\n .form-label {\n display: block;\n font-family: var(--form-label-default-fontFamily);\n color: var(--form-label-default-color);\n letter-spacing: var(--form-label-default-letterSpacing);\n }\n\n .label-sm {\n font-size: var(--form-label-small-fontSize);\n font-weight: var(--form-label-small-fontWeight);\n line-height: var(--form-label-small-lineHeight);\n letter-spacing: var(--form-label-small-letterSpacing);\n margin-bottom: var(--form-label-small-marginBottom);\n }\n\n .label-md {\n font-size: var(--form-label-default-fontSize);\n font-weight: var(--form-label-default-fontWeight);\n line-height: var(--form-label-default-lineHeight);\n margin-bottom: var(--form-label-default-marginBottom);\n }\n\n .label-lg {\n font-size: var(--form-label-large-fontSize);\n font-weight: var(--form-label-large-fontWeight);\n line-height: var(--form-label-large-lineHeight);\n margin-bottom: var(--form-label-large-marginBottom);\n }\n\n .form-label__required {\n color: var(--form-label-required-color);\n margin-inline-start: var(--form-label-required-marginLeft);\n }\n\n /* ---- the control ------------------------------------------------------\n line-height is tight here and only here. The height below is derived from\n padding, type step and line-height, and bd-button derives its own from the\n same three, which is what keeps a field and a button of the same size the\n same height. At normal (1.5) the line box also stood taller than the\n content box the fixed height leaves, and the select clipped the descenders\n of its own option text. */\n .form-input-bd {\n width: 100%;\n box-sizing: border-box;\n font-family: var(--form-input-default-fontFamily);\n /* no role: tight is load-bearing here rather than chosen -- the comment\n above this rule has the argument. The height is DERIVED from padding,\n type step and this leading, so a role's leading would change the\n control's height; and an <input> renders one line, so CLAUDE.md's\n \"anything that can wrap needs at least tight\" floor is met and its\n concern does not arise. Overridden for the textarea, which does wrap:\n see textarea.css.ts. */\n line-height: var(--typography-lineHeight-tight);\n border: var(--form-input-default-borderWidth) solid var(--form-input-default-borderColor);\n background-color: var(--form-input-default-backgroundColor);\n color: var(--form-input-default-color);\n outline: none;\n transition: border-color var(--transition-duration-slow) var(--transition-easing-smooth),\n background-color var(--transition-duration-slow) var(--transition-easing-smooth),\n box-shadow var(--transition-duration-slow) var(--transition-easing-smooth);\n }\n\n /* :focus-visible, not :focus. On a text field the two agree — a browser\n shows the indicator for a pointer click there too, because typing is\n expected — but the select is a control you click and walk away from, and\n it was drawing the full ring on every mouse press where bd-button drew\n nothing. There is no .focused class any more: a field's focused prop now\n moves real focus, so :focus-visible is the only thing that draws this. */\n .form-input-bd:focus-visible {\n border-color: var(--form-input-focus-borderColor);\n box-shadow: var(--focus-outline-primary);\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 }\n\n /* ---- sizes ------------------------------------------------------------\n Four reads of the size's own token, no arithmetic. The height calc used to\n live here in triplicate; it lives in --form-input-*-height now, where the\n value it produces is also the value the package publishes. */\n .input-sm {\n padding: var(--form-input-small-padding);\n font-size: var(--form-input-small-fontSize);\n height: var(--form-input-small-height);\n border-radius: var(--form-input-small-borderRadius);\n }\n\n .input-md {\n padding: var(--form-input-medium-padding);\n font-size: var(--form-input-medium-fontSize);\n height: var(--form-input-medium-height);\n border-radius: var(--form-input-medium-borderRadius);\n }\n\n .input-lg {\n padding: var(--form-input-large-padding);\n font-size: var(--form-input-large-fontSize);\n height: var(--form-input-large-height);\n border-radius: var(--form-input-large-borderRadius);\n }\n\n /* The text's own room. --form-input-*-height is padding plus the line box,\n and the box is border-box, so the 1px border on each edge came out of the\n content: the line box stood 2px taller than the space left for it. An\n input centres its line and paints into the padding, so it never showed;\n a select does neither -- it clips at the content box -- and at md the\n descenders of \"Italy gjpqy ș ț\" lost their bottoms. Taking the border out\n of the block padding instead gives the line all of its box and leaves\n every height where it was, on its button. The textarea is left out: its\n height comes from its rows, so this would only make it 2px shorter. */\n .input-sm:not(textarea) {\n padding-block: calc(var(--spacing-8) - var(--form-input-default-borderWidth));\n }\n\n .input-md:not(textarea) {\n padding-block: calc(var(--spacing-12) - var(--form-input-default-borderWidth));\n }\n\n .input-lg:not(textarea) {\n padding-block: calc(var(--spacing-16) - var(--form-input-default-borderWidth));\n }\n\n ::placeholder {\n color: var(--color-text-subtle);\n opacity: 1;\n }\n\n /* On a tinted field the placeholder takes the next step up. text-subtle on\n the error tint measured 4.22:1 and on the success tint 4.43 -- under 4.5,\n and an empty required field in error is exactly when the placeholder is\n showing. text-muted gives 5.95 and 6.25. The plain field keeps\n text-subtle (4.81). */\n .form-input--error::placeholder,\n .form-input-bd:where(:user-invalid)::placeholder,\n .form-input--attempted:where(:invalid)::placeholder,\n .form-input--success::placeholder {\n color: var(--color-text-muted);\n }\n\n /* ---- states -----------------------------------------------------------\n Error is what the browser finds, not only a flag. A control that fails\n its own constraints -- required and empty, an email that is not one --\n shows it once the reader has finished with it (:user-invalid: changed,\n then left) or once a submit has been tried (--attempted, which the host\n sets on the form's invalid event: the control in here has no form owner,\n so :user-invalid never hears of the submit). Before either, an empty\n required field is not yet an error, which is the point of :user-invalid.\n\n The invalid prop still forces the state, for what only the page\n knows -- a server's answer. :where() holds all three at one class's\n weight, so the focus border above still wins while the reader is\n correcting the field, as it always has for the prop. */\n .form-input--error,\n .form-input-bd:where(:user-invalid),\n .form-input--attempted:where(:invalid) {\n background-color: var(--form-input-error-backgroundColor);\n border-color: var(--form-input-error-borderColor);\n }\n\n .form-input--success {\n background-color: var(--form-input-success-backgroundColor);\n border-color: var(--form-input-success-borderColor);\n }\n\n .form-input--disabled {\n background-color: var(--form-input-disabled-backgroundColor);\n border-color: var(--form-input-disabled-borderColor);\n color: var(--form-input-disabled-color);\n cursor: not-allowed;\n }\n\n /* ---- help text --------------------------------------------------------\n The same roles bd-help-text renders, so a field's built-in message and the\n standalone atom agree on colour and measure. */\n .form-help-text {\n font-family: var(--form-help-text-default-fontFamily);\n font-size: var(--form-help-text-default-fontSize);\n font-weight: var(--form-help-text-default-fontWeight);\n line-height: var(--form-help-text-default-lineHeight);\n letter-spacing: var(--form-help-text-default-letterSpacing);\n margin-top: var(--form-help-text-default-marginTop);\n }\n\n .form-help-text--default {\n color: var(--form-help-text-default-color);\n }\n\n .form-help-text--error {\n color: var(--form-help-text-error-color);\n }\n\n /* Rules of their own: :has() is not forgiving, so a browser that does not\n know :user-invalid drops the whole rule it sits in -- in a list with the\n class above, it took the invalid prop's help-text colour with it, and\n beside the attempted case it would take that too. */\n .input-container:has(.form-input--attempted:invalid) .form-help-text--default {\n color: var(--form-help-text-error-color);\n }\n\n .input-container:has(.form-input-bd:user-invalid) .form-help-text--default {\n color: var(--form-help-text-error-color);\n }\n\n .form-help-text--success {\n color: var(--form-help-text-success-color);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .form-input-bd {\n transition: none;\n }\n }\n`;\n\nexport default formFieldCSS;\n"],"mappings":"A,0BAuBA,IAAaA,EAAe,CAAG,gpI"}
|
|
1
|
+
{"version":3,"file":"form-field.css.js","names":["formFieldCSS"],"sources":["../../../../src/components/shared/form-field.css.ts"],"sourcesContent":["import { css } from \"lit\";\n\n/**\n * The shared chrome for a form field: its label, the control itself, its three\n * sizes, its states and its help text.\n *\n * bd-input, bd-select and bd-textarea are one field with three kinds of\n * control in the middle. bd-input and bd-select, with the clipboard field\n * 3.x had, used to be three\n * stylesheets of about 160 lines each, roughly 130 of them identical, and they\n * had drifted: the select set its labels and help text at line-height normal\n * where the other two used tight, and its `md` size declared 8px of vertical\n * padding while the height formula on the line below assumed 12. Every fix had\n * to be applied three times and demonstrably had not been.\n *\n * A component imports this first and then its own sheet:\n *\n * static styles = [formFieldCSS, selectCSS];\n *\n * Values come from the --form-input-* and --form-label-* component tokens\n * rather than from the palette, which is what bd-textarea was already doing\n * and what lets a single token change reach all four controls.\n */\nexport const formFieldCSS = css`\n /* No width. This used to be 90%, an arbitrary fraction that made every field\n narrower than whatever contained it and left the last tenth unexplained.\n A field is display:block and fills its container; deciding how wide that\n container is belongs to the page. */\n :host {\n display: block;\n }\n\n .input-container {\n display: flex;\n flex-direction: column;\n }\n\n /* The label and the hint are wrappers around the page's slots, hidden while\n their slot is empty (form-control.ts). The label sets display: block\n below, which outranks the hidden attribute's own display: none, so it is\n said again here at a weight that wins. */\n .form-label[hidden],\n .form-help-text[hidden] {\n display: none;\n }\n\n /* ---- label ------------------------------------------------------------\n Driven by --form-label-*, the same tokens bd-label reads, so the field's\n built-in label and the standalone atom render identically. They did not\n before: these rules hardcoded bold where the token says medium, which is\n 200 units apart on the same line of the same form. */\n .form-label {\n display: block;\n font-family: var(--form-label-default-fontFamily);\n color: var(--form-label-default-color);\n letter-spacing: var(--form-label-default-letterSpacing);\n }\n\n .label-sm {\n font-size: var(--form-label-small-fontSize);\n font-weight: var(--form-label-small-fontWeight);\n line-height: var(--form-label-small-lineHeight);\n letter-spacing: var(--form-label-small-letterSpacing);\n margin-bottom: var(--form-label-small-marginBottom);\n }\n\n .label-md {\n font-size: var(--form-label-default-fontSize);\n font-weight: var(--form-label-default-fontWeight);\n line-height: var(--form-label-default-lineHeight);\n margin-bottom: var(--form-label-default-marginBottom);\n }\n\n .label-lg {\n font-size: var(--form-label-large-fontSize);\n font-weight: var(--form-label-large-fontWeight);\n line-height: var(--form-label-large-lineHeight);\n margin-bottom: var(--form-label-large-marginBottom);\n }\n\n .form-label__required {\n color: var(--form-label-required-color);\n margin-inline-start: var(--form-label-required-marginLeft);\n }\n\n /* ---- the control ------------------------------------------------------\n line-height is tight here and only here. The height below is derived from\n padding, type step and line-height, and bd-button derives its own from the\n same three, which is what keeps a field and a button of the same size the\n same height. At normal (1.5) the line box also stood taller than the\n content box the fixed height leaves, and the select clipped the descenders\n of its own option text. */\n .form-input-bd {\n width: 100%;\n box-sizing: border-box;\n font-family: var(--form-input-default-fontFamily);\n /* no role: tight is load-bearing here rather than chosen -- the comment\n above this rule has the argument. The height is DERIVED from padding,\n type step and this leading, so a role's leading would change the\n control's height; and an <input> renders one line, so CLAUDE.md's\n \"anything that can wrap needs at least tight\" floor is met and its\n concern does not arise. Overridden for the textarea, which does wrap:\n see textarea.css.ts. */\n line-height: var(--typography-lineHeight-tight);\n border: var(--form-input-default-borderWidth) solid var(--form-input-default-borderColor);\n background-color: var(--form-input-default-backgroundColor);\n color: var(--form-input-default-color);\n outline: none;\n transition: border-color var(--transition-duration-slow) var(--transition-easing-smooth),\n background-color var(--transition-duration-slow) var(--transition-easing-smooth),\n box-shadow var(--transition-duration-slow) var(--transition-easing-smooth);\n }\n\n /* :focus-visible, not :focus. On a text field the two agree — a browser\n shows the indicator for a pointer click there too, because typing is\n expected — but the select is a control you click and walk away from, and\n it was drawing the full ring on every mouse press where bd-button drew\n nothing. There is no .focused class any more: a field's focused prop now\n moves real focus, so :focus-visible is the only thing that draws this. */\n .form-input-bd:focus-visible {\n border-color: var(--form-input-focus-borderColor);\n box-shadow: var(--focus-outline-primary);\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 }\n\n /* ---- sizes ------------------------------------------------------------\n Four reads of the size's own token, no arithmetic. The height calc used to\n live here in triplicate; it lives in --form-input-*-height now, where the\n value it produces is also the value the package publishes. */\n .input-sm {\n padding: var(--form-input-small-padding);\n font-size: var(--form-input-small-fontSize);\n height: var(--form-input-small-height);\n border-radius: var(--form-input-small-borderRadius);\n }\n\n .input-md {\n padding: var(--form-input-medium-padding);\n font-size: var(--form-input-medium-fontSize);\n height: var(--form-input-medium-height);\n border-radius: var(--form-input-medium-borderRadius);\n }\n\n .input-lg {\n padding: var(--form-input-large-padding);\n font-size: var(--form-input-large-fontSize);\n height: var(--form-input-large-height);\n border-radius: var(--form-input-large-borderRadius);\n }\n\n /* The text's own room. --form-input-*-height is padding plus the line box,\n and the box is border-box, so the 1px border on each edge came out of the\n content: the line box stood 2px taller than the space left for it. An\n input centres its line and paints into the padding, so it never showed;\n a select does neither -- it clips at the content box -- and at md the\n descenders of \"Italy gjpqy ș ț\" lost their bottoms. Taking the border out\n of the block padding instead gives the line all of its box and leaves\n every height where it was, on its button. The textarea is left out: its\n height comes from its rows, so this would only make it 2px shorter. */\n .input-sm:not(textarea) {\n padding-block: calc(var(--spacing-8) - var(--form-input-default-borderWidth));\n }\n\n .input-md:not(textarea) {\n padding-block: calc(var(--spacing-12) - var(--form-input-default-borderWidth));\n }\n\n .input-lg:not(textarea) {\n padding-block: calc(var(--spacing-16) - var(--form-input-default-borderWidth));\n }\n\n ::placeholder {\n color: var(--color-text-subtle);\n opacity: 1;\n }\n\n /* On a tinted field the placeholder takes the next step up. text-subtle on\n the error tint measured 4.22:1 and on the success tint 4.43 -- under 4.5,\n and an empty required field in error is exactly when the placeholder is\n showing. text-muted gives 5.95 and 6.25. The plain field keeps\n text-subtle (4.81). */\n .form-input--error::placeholder,\n .form-input-bd:where(:user-invalid)::placeholder,\n .form-input--attempted:where(:invalid)::placeholder,\n .form-input--success::placeholder {\n color: var(--color-text-muted);\n }\n\n /* ---- states -----------------------------------------------------------\n Error is what the browser finds, not only a flag. A control that fails\n its own constraints -- required and empty, an email that is not one --\n shows it once the reader has finished with it (:user-invalid: changed,\n then left) or once a submit has been tried (--attempted, which the host\n sets on the form's invalid event: the control in here has no form owner,\n so :user-invalid never hears of the submit). Before either, an empty\n required field is not yet an error, which is the point of :user-invalid.\n\n The invalid prop still forces the state, for what only the page\n knows -- a server's answer. :where() holds all three at one class's\n weight, so the focus border above still wins while the reader is\n correcting the field, as it always has for the prop. */\n .form-input--error,\n .form-input-bd:where(:user-invalid),\n .form-input--attempted:where(:invalid) {\n background-color: var(--form-input-error-backgroundColor);\n border-color: var(--form-input-error-borderColor);\n }\n\n .form-input--success {\n background-color: var(--form-input-success-backgroundColor);\n border-color: var(--form-input-success-borderColor);\n }\n\n .form-input--disabled {\n background-color: var(--form-input-disabled-backgroundColor);\n border-color: var(--form-input-disabled-borderColor);\n color: var(--form-input-disabled-color);\n cursor: not-allowed;\n }\n\n /* ---- help text --------------------------------------------------------\n The same roles bd-hint renders, so a field's built-in message and the\n standalone atom agree on colour and measure. */\n .form-help-text {\n font-family: var(--form-help-text-default-fontFamily);\n font-size: var(--form-help-text-default-fontSize);\n font-weight: var(--form-help-text-default-fontWeight);\n line-height: var(--form-help-text-default-lineHeight);\n letter-spacing: var(--form-help-text-default-letterSpacing);\n margin-top: var(--form-help-text-default-marginTop);\n }\n\n .form-help-text--default {\n color: var(--form-help-text-default-color);\n }\n\n .form-help-text--error {\n color: var(--form-help-text-error-color);\n }\n\n /* Rules of their own: :has() is not forgiving, so a browser that does not\n know :user-invalid drops the whole rule it sits in -- in a list with the\n class above, it took the invalid prop's help-text colour with it, and\n beside the attempted case it would take that too. */\n .input-container:has(.form-input--attempted:invalid) .form-help-text--default {\n color: var(--form-help-text-error-color);\n }\n\n .input-container:has(.form-input-bd:user-invalid) .form-help-text--default {\n color: var(--form-help-text-error-color);\n }\n\n .form-help-text--success {\n color: var(--form-help-text-success-color);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .form-input-bd {\n transition: none;\n }\n }\n`;\n\nexport default formFieldCSS;\n"],"mappings":"A,0BAuBA,IAAaA,EAAe,CAAG,ysI"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds everything under `root` still: media paused and kept from
|
|
3
|
+
* autoplaying, `paused` components paused, embeds unloaded. Resolves once
|
|
4
|
+
* what the components under it rendered has been reached as well.
|
|
5
|
+
*/
|
|
6
|
+
export declare function hold(root: Element): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Lets `root` go: every element under it that hold() changed is put back as
|
|
9
|
+
* the page wrote it, except under a root inside it that is still held. A
|
|
10
|
+
* root inside another held root is let go with that one.
|
|
11
|
+
*/
|
|
12
|
+
export declare function release(root: Element): void;
|
|
13
|
+
/** Whether `root` is held. */
|
|
14
|
+
export declare const isHeld: (root: Element) => boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=`about:blank`,t=/* @__PURE__ */ new WeakMap,n=/* @__PURE__ */ new WeakSet,r=/* @__PURE__ */ new WeakMap,i=e=>e.localName.includes(`-`)&&`paused`in e,a=e=>e.parentElement??e.parentNode?.host??null;function*o(e,t=()=>!1){yield e;for(let n of e.shadowRoot?[e,e.shadowRoot]:[e])for(let e of n.children)t(e)||(yield*o(e,t))}function s(n){let r=t.get(n);if(n instanceof HTMLMediaElement)r?n.autoplay&&(r.autoplay=!0):t.set(n,{autoplay:n.autoplay}),n.autoplay=!1,n.pause();else if(n instanceof HTMLIFrameElement){let i=n.getAttribute(`src`),a=n.getAttribute(`srcdoc`);r?(i!==e&&(r.src=i),a!==null&&(r.srcdoc=a)):t.set(n,{src:i,srcdoc:a}),n.removeAttribute(`srcdoc`),i!==e&&n.setAttribute(`src`,e)}else i(n)&&(r||t.set(n,{paused:n.paused}),n.paused=!0)}function c(e){let n=t.get(e);n&&(t.delete(e),e instanceof HTMLMediaElement?(e.autoplay=n.autoplay??!1,n.autoplay&&e.play().catch(()=>{})):e instanceof HTMLIFrameElement?(n.srcdoc!=null&&e.setAttribute(`srcdoc`,n.srcdoc),n.src==null?e.removeAttribute(`src`):e.setAttribute(`src`,n.src)):i(e)&&(e.paused=n.paused??!1))}var l=e=>!!e.isUpdatePending;function u(e,t){let i=r.get(e)??/* @__PURE__ */ new Set;r.set(e,i);let a=new WeakRef(e);for(let e of t){let t=e.localName,o=!!customElements.get(t);i.has(t)||!e.matches(`:not(:defined)`)||o&&!e.isConnected||(i.add(t),customElements.whenDefined(t).then(()=>{let e=a.deref();e&&(o||r.get(e)?.delete(t),n.has(e)&&f(e))}))}}function d(e){for(let t=a(e);t;t=a(t))if(n.has(t))return!0;return!1}async function f(e){n.add(e);for(let t=0;t<3;t++){if(!n.has(e))return;let t=[...o(e)];t.forEach(s),u(e,t);let r=t.filter(l);if(!r.length)return;await Promise.all(r.map(e=>e.updateComplete.catch(()=>{})))}}function p(e){if(n.has(e)&&(n.delete(e),!d(e)))for(let t of o(e,e=>n.has(e)))c(t)}var m=e=>n.has(e);export{f as hold,m as isHeld,p as release};
|
|
2
|
+
//# sourceMappingURL=hold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hold.js","names":["BLANK","records","roots","waiting","pausable","el","composedParent","composedTree","scope","child","skip","holdOne","was","src","srcdoc","releaseOne","updating","awaitDefinitions","tags","root","ref","all","tag","defined","held","hold","inHeld","round","pending","release","isHeld"],"sources":["../../../../src/components/shared/hold.ts"],"sourcesContent":["import type { ReactiveElement } from 'lit';\n\n/**\n * Holding a part of the page still while it is out of sight, and letting it\n * go when it comes back.\n *\n * hold(panel); // its media paused, its `paused` components paused, its embeds unloaded\n * release(panel); // each put back as the page wrote it\n *\n * Hidden is not stopped. A panel a tab group keeps laid out but not shown --\n * so the group holds the tallest panel's height -- still plays the video in\n * it from the moment the page opens, and an intro that waits to be on screen\n * runs where nobody sees it and is over by the time the tab is opened. So a\n * hidden panel is held:\n *\n * - a <video> or <audio> is paused and kept from autoplaying;\n * - every component that moves on its own -- this package spells that\n * `paused`: bd-hero, bd-logo-marquee, bd-motion-art, bd-pagination-dots --\n * is paused;\n * - an embed (<iframe>) is unloaded instead: it is a page from another\n * origin, which no script here can pause, so a bd-video-player whose\n * YouTube URL asks for autoplay played in a tab nobody had opened. A\n * frame's box is its own CSS, not its document's, so the height holds\n * without it. Images stay: their size is their file's.\n *\n * release() puts back what hold() changed and nothing else. An unloaded frame\n * gets its own src (or srcdoc) again, so it loads afresh; a medium the page\n * wrote with `autoplay` gets it back and plays, as it would have on a page\n * that opened on it; one without stays paused, whoever started it before; a\n * component the page had paused itself stays paused. Nothing autoplays that\n * the page did not ask to.\n *\n * Both walk the composed tree -- the light DOM and every open shadow root\n * under it -- because the media a component renders are in its shadow root.\n * Components render after they upgrade, so what they render is reached a\n * round later: hold() goes round again while anything it found has an update\n * pending, up to three rounds, and stops early once the root is released.\n * Calling hold() again on a held root holds what arrived since; what was held\n * already keeps the state it was first held from, so release() restores the\n * page's, not the hold's.\n *\n * A component that is not defined yet has no `paused` and has rendered\n * nothing, and its definition arriving is no mutation anyone hears: the\n * loader defines each tag when its module lands, often after the panel it\n * sits in was held. So hold() waits for the definition of every undefined\n * custom element it passes, and holds the root again once it arrives, which\n * reaches the upgraded component and, a round later, what it renders.\n *\n * Held roots nest -- a tab group in a tab group's panel. A release reaches no\n * further than the next root still held, and a root released inside a root\n * that is still held is let go only when the outer one is.\n */\n\n/* What one element was before hold() changed it. */\ninterface Record {\n autoplay?: boolean;\n src? : string | null;\n srcdoc? : string | null;\n paused? : boolean;\n}\n\nconst BLANK = 'about:blank';\nconst records = new WeakMap<Element, Record>();\nconst roots = new WeakSet<Element>();\n/* The tags each held root waits to see defined, so holding it again -- a tab\n group does on every change inside a held panel -- does not wait twice. */\nconst waiting = new WeakMap<Element, Set<string>>();\n\ntype Pausable = Element & { paused: boolean };\nconst pausable = (el: Element): el is Pausable => el.localName.includes('-') && 'paused' in el;\n\n/* The element after `el` in the composed tree going up: its parent, or the\n host of the shadow root it is in. */\nconst composedParent = (el: Element): Element | null => el.parentElement\n ?? ((el.parentNode as ShadowRoot | null)?.host ?? null);\n\n/** `el`, everything under it and everything in the open shadow roots below, skipping the subtrees `skip` says no to. */\nfunction* composedTree(el: Element, skip: (el: Element) => boolean = () => false): Generator<Element> {\n yield el;\n for (const scope of el.shadowRoot ? [el, el.shadowRoot] : [el]) {\n for (const child of scope.children) {\n if (!skip(child)) yield* composedTree(child, skip);\n }\n }\n}\n\nfunction holdOne(el: Element) {\n const was = records.get(el);\n if (el instanceof HTMLMediaElement) {\n // a page that sets autoplay while the element is held is asking for it once it shows\n if (!was) records.set(el, { autoplay: el.autoplay });\n else if (el.autoplay) was.autoplay = true;\n el.autoplay = false;\n el.pause();\n } else if (el instanceof HTMLIFrameElement) {\n const src = el.getAttribute('src');\n const srcdoc = el.getAttribute('srcdoc');\n // a src or srcdoc the page wrote while it was held is the one it comes back to\n if (!was) records.set(el, { src, srcdoc });\n else {\n if (src !== BLANK) was.src = src;\n if (srcdoc !== null) was.srcdoc = srcdoc;\n }\n // srcdoc outranks src, so it goes first\n el.removeAttribute('srcdoc');\n if (src !== BLANK) el.setAttribute('src', BLANK);\n } else if (pausable(el)) {\n if (!was) records.set(el, { paused: el.paused });\n el.paused = true;\n }\n}\n\nfunction releaseOne(el: Element) {\n const was = records.get(el);\n if (!was) return;\n records.delete(el);\n if (el instanceof HTMLMediaElement) {\n el.autoplay = was.autoplay ?? false;\n // a play() the browser refuses -- an unmuted autoplay -- is the page's to handle\n if (was.autoplay) el.play().catch(() => {});\n } else if (el instanceof HTMLIFrameElement) {\n if (was.srcdoc != null) el.setAttribute('srcdoc', was.srcdoc);\n if (was.src == null) el.removeAttribute('src');\n else el.setAttribute('src', was.src);\n } else if (pausable(el)) {\n el.paused = was.paused ?? false;\n }\n}\n\nconst updating = (el: Element): el is ReactiveElement => Boolean((el as Partial<ReactiveElement>).isUpdatePending);\n\n/* Holds `root` again once each custom element under it that is not defined\n yet is. The root is reached through a WeakRef: a tag that is never defined\n leaves its promise pending for good, and it must not keep a panel the page\n has dropped alive with it. */\nfunction awaitDefinitions(root: Element, all: Element[]) {\n const tags = waiting.get(root) ?? new Set<string>();\n waiting.set(root, tags);\n const ref = new WeakRef(root);\n for (const el of all) {\n const tag = el.localName;\n /* An element of a tag already defined that is still undefined is either\n about to upgrade or never will. In the page it is about to: innerHTML\n inserts a tree whole, and a tab group holds its hidden panel from its\n own connectedCallback, before the elements after it in tree order have\n upgraded, so the wait -- which resolves at once -- holds it a round\n later. Out of the page it never will, since a detached element is not\n upgraded, so it is not waited on: waiting would resolve at once and\n hold again, for ever -- a tab panel removed before the store's\n elements were defined did that. A defined tag is waited on once per\n root, for the same reason: an element whose upgrade failed stays\n undefined in the page. */\n const defined = Boolean(customElements.get(tag));\n if (tags.has(tag) || !el.matches(':not(:defined)') || (defined && !el.isConnected)) continue;\n tags.add(tag);\n void customElements.whenDefined(tag).then(() => {\n const held = ref.deref();\n if (!held) return;\n if (!defined) waiting.get(held)?.delete(tag);\n if (roots.has(held)) void hold(held);\n });\n }\n}\n\n/** Whether `root` is inside another root that is still held. */\nfunction inHeld(root: Element) {\n for (let el = composedParent(root); el; el = composedParent(el)) if (roots.has(el)) return true;\n return false;\n}\n\n/**\n * Holds everything under `root` still: media paused and kept from\n * autoplaying, `paused` components paused, embeds unloaded. Resolves once\n * what the components under it rendered has been reached as well.\n */\nexport async function hold(root: Element): Promise<void> {\n roots.add(root);\n for (let round = 0; round < 3; round++) {\n if (!roots.has(root)) return;\n const all = [...composedTree(root)];\n all.forEach(holdOne);\n awaitDefinitions(root, all);\n const pending = all.filter(updating);\n if (!pending.length) return;\n await Promise.all(pending.map(el => el.updateComplete.catch(() => {})));\n }\n}\n\n/**\n * Lets `root` go: every element under it that hold() changed is put back as\n * the page wrote it, except under a root inside it that is still held. A\n * root inside another held root is let go with that one.\n */\nexport function release(root: Element): void {\n if (!roots.has(root)) return;\n roots.delete(root);\n if (inHeld(root)) return;\n for (const el of composedTree(root, child => roots.has(child))) releaseOne(el);\n}\n\n/** Whether `root` is held. */\nexport const isHeld = (root: Element): boolean => roots.has(root);\n"],"mappings":"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"}
|