@repobit/dex-system-design 3.0.0 → 3.0.2
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 +14 -0
- package/dist/src/_bundled/oxc-project_runtime/helpers/esm/decorate.js +1 -0
- package/dist/src/components/accordion/accordion-bg.css.js +1 -288
- package/dist/src/components/accordion/accordion-bg.css.js.map +1 -1
- package/dist/src/components/accordion/accordion-bg.d.ts +5 -5
- package/dist/src/components/accordion/accordion-bg.js +15 -210
- package/dist/src/components/accordion/accordion-bg.js.map +1 -1
- package/dist/src/components/accordion/accordion-keyboard.js +1 -89
- package/dist/src/components/accordion/accordion-keyboard.js.map +1 -1
- package/dist/src/components/accordion/accordion-panel.js +1 -22
- package/dist/src/components/accordion/accordion-panel.js.map +1 -1
- package/dist/src/components/accordion/accordion.css.js +1 -380
- package/dist/src/components/accordion/accordion.css.js.map +1 -1
- package/dist/src/components/accordion/accordion.d.ts +7 -7
- package/dist/src/components/accordion/accordion.js +16 -138
- package/dist/src/components/accordion/accordion.js.map +1 -1
- package/dist/src/components/agent-endpoints/agent-endpoints.css.js +1 -88
- package/dist/src/components/agent-endpoints/agent-endpoints.css.js.map +1 -1
- package/dist/src/components/agent-endpoints/agent-endpoints.d.ts +4 -4
- package/dist/src/components/agent-endpoints/agent-endpoints.js +17 -76
- package/dist/src/components/agent-endpoints/agent-endpoints.js.map +1 -1
- package/dist/src/components/alert/alert.css.js +1 -217
- package/dist/src/components/alert/alert.css.js.map +1 -1
- package/dist/src/components/alert/alert.d.ts +4 -4
- package/dist/src/components/alert/alert.js +6 -110
- package/dist/src/components/alert/alert.js.map +1 -1
- package/dist/src/components/anchor/anchor-nav.css.js +1 -546
- package/dist/src/components/anchor/anchor-nav.css.js.map +1 -1
- package/dist/src/components/anchor/anchor-nav.d.ts +4 -4
- package/dist/src/components/anchor/anchor-nav.js +23 -567
- package/dist/src/components/anchor/anchor-nav.js.map +1 -1
- package/dist/src/components/annotation/annotation.css.js +1 -64
- package/dist/src/components/annotation/annotation.css.js.map +1 -1
- package/dist/src/components/annotation/annotation.d.ts +2 -2
- package/dist/src/components/annotation/annotation.js +7 -72
- package/dist/src/components/annotation/annotation.js.map +1 -1
- package/dist/src/components/audience-card/audience-card.css.js +1 -122
- package/dist/src/components/audience-card/audience-card.css.js.map +1 -1
- package/dist/src/components/audience-card/audience-card.d.ts +2 -2
- package/dist/src/components/audience-card/audience-card.js +8 -83
- package/dist/src/components/audience-card/audience-card.js.map +1 -1
- package/dist/src/components/avatar/avatar.css.js +1 -65
- package/dist/src/components/avatar/avatar.css.js.map +1 -1
- package/dist/src/components/avatar/avatar.d.ts +3 -3
- package/dist/src/components/avatar/avatar.js +6 -76
- package/dist/src/components/avatar/avatar.js.map +1 -1
- package/dist/src/components/awards/awards-flex.css.js +1 -273
- package/dist/src/components/awards/awards-flex.css.js.map +1 -1
- package/dist/src/components/awards/awards-flex.d.ts +12 -12
- package/dist/src/components/awards/awards-flex.js +33 -264
- package/dist/src/components/awards/awards-flex.js.map +1 -1
- package/dist/src/components/awards/awards-spotlight.css.js +1 -161
- package/dist/src/components/awards/awards-spotlight.css.js.map +1 -1
- package/dist/src/components/awards/awards-spotlight.d.ts +4 -4
- package/dist/src/components/awards/awards-spotlight.js +24 -140
- package/dist/src/components/awards/awards-spotlight.js.map +1 -1
- package/dist/src/components/awards/awards.css.js +1 -401
- package/dist/src/components/awards/awards.css.js.map +1 -1
- package/dist/src/components/awards/awards.d.ts +13 -13
- package/dist/src/components/awards/awards.js +26 -179
- package/dist/src/components/awards/awards.js.map +1 -1
- package/dist/src/components/awards/scroll-slides.js +1 -131
- package/dist/src/components/awards/scroll-slides.js.map +1 -1
- package/dist/src/components/back/back.css.js +1 -91
- package/dist/src/components/back/back.css.js.map +1 -1
- package/dist/src/components/back/back.d.ts +1 -1
- package/dist/src/components/back/back.js +8 -71
- package/dist/src/components/back/back.js.map +1 -1
- package/dist/src/components/badge/badge.css.js +1 -204
- package/dist/src/components/badge/badge.css.js.map +1 -1
- package/dist/src/components/badge/badge.d.ts +4 -4
- package/dist/src/components/badge/badge.js +2 -117
- package/dist/src/components/badge/badge.js.map +1 -1
- package/dist/src/components/bento-grid/bento-grid.css.js +16 -150
- package/dist/src/components/bento-grid/bento-grid.css.js.map +1 -1
- package/dist/src/components/bento-grid/bento-grid.d.ts +3 -3
- package/dist/src/components/bento-grid/bento-grid.js +10 -189
- package/dist/src/components/bento-grid/bento-grid.js.map +1 -1
- package/dist/src/components/bento-grid/bento-item.css.js +1 -338
- package/dist/src/components/bento-grid/bento-item.css.js.map +1 -1
- package/dist/src/components/bento-grid/bento-item.d.ts +3 -3
- package/dist/src/components/bento-grid/bento-item.js +10 -94
- package/dist/src/components/bento-grid/bento-item.js.map +1 -1
- package/dist/src/components/blockquote/blockquote.css.js +1 -54
- package/dist/src/components/blockquote/blockquote.css.js.map +1 -1
- package/dist/src/components/blockquote/blockquote.d.ts +2 -2
- package/dist/src/components/blockquote/blockquote.js +1 -44
- package/dist/src/components/blockquote/blockquote.js.map +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.css.js +1 -168
- package/dist/src/components/breadcrumb/breadcrumb.css.js.map +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.d.ts +5 -5
- package/dist/src/components/breadcrumb/breadcrumb.js +9 -166
- package/dist/src/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/src/components/button/button.css.js +1 -843
- package/dist/src/components/button/button.css.js.map +1 -1
- package/dist/src/components/button/button.d.ts +5 -5
- package/dist/src/components/button/button.js +18 -420
- package/dist/src/components/button/button.js.map +1 -1
- package/dist/src/components/caption/caption.css.js +1 -29
- package/dist/src/components/caption/caption.css.js.map +1 -1
- package/dist/src/components/caption/caption.d.ts +3 -3
- package/dist/src/components/caption/caption.js +2 -36
- package/dist/src/components/caption/caption.js.map +1 -1
- package/dist/src/components/card-features/card-features.css.js +1 -120
- package/dist/src/components/card-features/card-features.css.js.map +1 -1
- package/dist/src/components/card-features/card-features.d.ts +3 -3
- package/dist/src/components/card-features/card-features.js +12 -145
- package/dist/src/components/card-features/card-features.js.map +1 -1
- package/dist/src/components/cards/card.css.js +1 -369
- package/dist/src/components/cards/card.css.js.map +1 -1
- package/dist/src/components/cards/card.d.ts +3 -3
- package/dist/src/components/cards/card.js +21 -312
- package/dist/src/components/cards/card.js.map +1 -1
- package/dist/src/components/carousel/carousel.css.js +1 -261
- package/dist/src/components/carousel/carousel.css.js.map +1 -1
- package/dist/src/components/carousel/carousel.d.ts +5 -5
- package/dist/src/components/carousel/carousel.js +13 -297
- package/dist/src/components/carousel/carousel.js.map +1 -1
- package/dist/src/components/checkbox/checkbox.css.js +1 -173
- package/dist/src/components/checkbox/checkbox.css.js.map +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +2 -2
- package/dist/src/components/checkbox/checkbox.js +5 -138
- package/dist/src/components/checkbox/checkbox.js.map +1 -1
- package/dist/src/components/code/code.css.js +1 -73
- package/dist/src/components/code/code.css.js.map +1 -1
- package/dist/src/components/code/code.d.ts +2 -2
- package/dist/src/components/code/code.js +4 -87
- package/dist/src/components/code/code.js.map +1 -1
- package/dist/src/components/compare/compare.css.js +1 -478
- package/dist/src/components/compare/compare.css.js.map +1 -1
- package/dist/src/components/compare/compare.d.ts +5 -5
- package/dist/src/components/compare/compare.js +23 -476
- package/dist/src/components/compare/compare.js.map +1 -1
- package/dist/src/components/comparison-panel/comparison-panel.css.js +1 -141
- package/dist/src/components/comparison-panel/comparison-panel.css.js.map +1 -1
- package/dist/src/components/comparison-panel/comparison-panel.d.ts +2 -2
- package/dist/src/components/comparison-panel/comparison-panel.js +18 -86
- package/dist/src/components/comparison-panel/comparison-panel.js.map +1 -1
- package/dist/src/components/compatibility-table/compatibility-table.css.js +1 -391
- package/dist/src/components/compatibility-table/compatibility-table.css.js.map +1 -1
- package/dist/src/components/compatibility-table/compatibility-table.d.ts +2 -2
- package/dist/src/components/compatibility-table/compatibility-table.js +26 -136
- package/dist/src/components/compatibility-table/compatibility-table.js.map +1 -1
- package/dist/src/components/cta-banner/cta-banner.css.js +1 -97
- package/dist/src/components/cta-banner/cta-banner.css.js.map +1 -1
- package/dist/src/components/cta-banner/cta-banner.d.ts +2 -2
- package/dist/src/components/cta-banner/cta-banner.js +8 -51
- package/dist/src/components/cta-banner/cta-banner.js.map +1 -1
- package/dist/src/components/display/display.css.js +1 -95
- package/dist/src/components/display/display.css.js.map +1 -1
- package/dist/src/components/display/display.d.ts +2 -2
- package/dist/src/components/display/display.js +3 -84
- package/dist/src/components/display/display.js.map +1 -1
- package/dist/src/components/divider/divider-horizontal.d.ts +2 -2
- package/dist/src/components/divider/divider-horizontal.js +4 -63
- package/dist/src/components/divider/divider-horizontal.js.map +1 -1
- package/dist/src/components/divider/divider-vertical.d.ts +2 -2
- package/dist/src/components/divider/divider-vertical.js +6 -61
- package/dist/src/components/divider/divider-vertical.js.map +1 -1
- package/dist/src/components/divider/divider.css.js +1 -20
- package/dist/src/components/divider/divider.css.js.map +1 -1
- package/dist/src/components/dropdown/dropdown.css.js +1 -121
- package/dist/src/components/dropdown/dropdown.css.js.map +1 -1
- package/dist/src/components/dropdown/dropdown.d.ts +5 -5
- package/dist/src/components/dropdown/dropdown.js +17 -283
- package/dist/src/components/dropdown/dropdown.js.map +1 -1
- package/dist/src/components/features/features.css.js +1 -123
- package/dist/src/components/features/features.css.js.map +1 -1
- package/dist/src/components/features/features.d.ts +5 -5
- package/dist/src/components/features/features.js +11 -71
- package/dist/src/components/features/features.js.map +1 -1
- package/dist/src/components/features-tab/features-tab.css.js +1 -100
- package/dist/src/components/features-tab/features-tab.css.js.map +1 -1
- package/dist/src/components/features-tab/features-tab.d.ts +5 -5
- package/dist/src/components/features-tab/features-tab.js +9 -70
- package/dist/src/components/features-tab/features-tab.js.map +1 -1
- package/dist/src/components/fieldset/fieldset.css.js +1 -28
- package/dist/src/components/fieldset/fieldset.css.js.map +1 -1
- package/dist/src/components/fieldset/fieldset.d.ts +2 -2
- package/dist/src/components/fieldset/fieldset.js +3 -31
- package/dist/src/components/fieldset/fieldset.js.map +1 -1
- package/dist/src/components/footer/footer-images.js +5 -27
- package/dist/src/components/footer/footer-images.js.map +1 -1
- package/dist/src/components/footer/footer-links-group.css.js +1 -33
- package/dist/src/components/footer/footer-links-group.css.js.map +1 -1
- package/dist/src/components/footer/footer-links-group.d.ts +3 -3
- package/dist/src/components/footer/footer-links-group.js +3 -32
- package/dist/src/components/footer/footer-links-group.js.map +1 -1
- package/dist/src/components/footer/footer-locale.js +1 -45
- package/dist/src/components/footer/footer-locale.js.map +1 -1
- package/dist/src/components/footer/footer-lp.d.ts +7 -7
- package/dist/src/components/footer/footer-lp.js +8 -121
- package/dist/src/components/footer/footer-lp.js.map +1 -1
- package/dist/src/components/footer/footer-nav-menu.css.js +1 -61
- package/dist/src/components/footer/footer-nav-menu.css.js.map +1 -1
- package/dist/src/components/footer/footer-nav-menu.d.ts +3 -3
- package/dist/src/components/footer/footer-nav-menu.js +3 -47
- package/dist/src/components/footer/footer-nav-menu.js.map +1 -1
- package/dist/src/components/footer/footer.css.js +1 -664
- package/dist/src/components/footer/footer.css.js.map +1 -1
- package/dist/src/components/footer/footer.d.ts +13 -13
- package/dist/src/components/footer/footer.js +20 -305
- package/dist/src/components/footer/footer.js.map +1 -1
- package/dist/src/components/footer/localeMap.js +1 -1
- package/dist/src/components/footer/localeMap.js.map +1 -1
- package/dist/src/components/grid/grid.css.js +1 -78
- package/dist/src/components/grid/grid.css.js.map +1 -1
- package/dist/src/components/grid/grid.d.ts +2 -2
- package/dist/src/components/grid/grid.js +9 -126
- package/dist/src/components/grid/grid.js.map +1 -1
- package/dist/src/components/header/header-code.css.js +1 -369
- package/dist/src/components/header/header-code.css.js.map +1 -1
- package/dist/src/components/header/header-code.d.ts +4 -4
- package/dist/src/components/header/header-code.js +15 -163
- package/dist/src/components/header/header-code.js.map +1 -1
- package/dist/src/components/header/header.css.js +1 -757
- package/dist/src/components/header/header.css.js.map +1 -1
- package/dist/src/components/header/header.d.ts +7 -7
- package/dist/src/components/header/header.js +4 -212
- package/dist/src/components/header/header.js.map +1 -1
- package/dist/src/components/heading/heading.css.js +1 -89
- package/dist/src/components/heading/heading.css.js.map +1 -1
- package/dist/src/components/heading/heading.d.ts +2 -2
- package/dist/src/components/heading/heading.js +1 -108
- package/dist/src/components/heading/heading.js.map +1 -1
- package/dist/src/components/help-text/help-text.css.js +1 -19
- package/dist/src/components/help-text/help-text.css.js.map +1 -1
- package/dist/src/components/help-text/help-text.d.ts +2 -2
- package/dist/src/components/help-text/help-text.js +3 -31
- package/dist/src/components/help-text/help-text.js.map +1 -1
- package/dist/src/components/hero/hero.css.js +1 -362
- package/dist/src/components/hero/hero.css.js.map +1 -1
- package/dist/src/components/hero/hero.d.ts +3 -3
- package/dist/src/components/hero/hero.js +12 -164
- package/dist/src/components/hero/hero.js.map +1 -1
- package/dist/src/components/highlight/highlight.css.js +1 -175
- package/dist/src/components/highlight/highlight.css.js.map +1 -1
- package/dist/src/components/highlight/highlight.d.ts +3 -3
- package/dist/src/components/highlight/highlight.js +4 -115
- package/dist/src/components/highlight/highlight.js.map +1 -1
- package/dist/src/components/icons/analysis-icon.d.ts +1 -1
- package/dist/src/components/icons/analysis-icon.js +2 -20
- package/dist/src/components/icons/analysis-icon.js.map +1 -1
- package/dist/src/components/icons/arrow-down-icon.d.ts +1 -1
- package/dist/src/components/icons/arrow-down-icon.js +2 -20
- package/dist/src/components/icons/arrow-down-icon.js.map +1 -1
- package/dist/src/components/icons/arrow-icon.d.ts +1 -1
- package/dist/src/components/icons/arrow-icon.js +2 -48
- package/dist/src/components/icons/arrow-icon.js.map +1 -1
- package/dist/src/components/icons/arrow-right-icon.d.ts +1 -1
- package/dist/src/components/icons/arrow-right-icon.js +2 -45
- package/dist/src/components/icons/arrow-right-icon.js.map +1 -1
- package/dist/src/components/icons/arrow-up-icon.d.ts +1 -1
- package/dist/src/components/icons/arrow-up-icon.js +2 -33
- package/dist/src/components/icons/arrow-up-icon.js.map +1 -1
- package/dist/src/components/icons/av-comparatives-icon.js +2 -31
- package/dist/src/components/icons/av-comparatives-icon.js.map +1 -1
- package/dist/src/components/icons/bd-ai-icon.js +2 -31
- package/dist/src/components/icons/bd-ai-icon.js.map +1 -1
- package/dist/src/components/icons/best-brands-icon.js +2 -31
- package/dist/src/components/icons/best-brands-icon.js.map +1 -1
- package/dist/src/components/icons/brand-signature-icon.d.ts +1 -1
- package/dist/src/components/icons/brand-signature-icon.js +2 -46
- package/dist/src/components/icons/brand-signature-icon.js.map +1 -1
- package/dist/src/components/icons/check-icon.d.ts +1 -1
- package/dist/src/components/icons/check-icon.js +2 -31
- package/dist/src/components/icons/check-icon.js.map +1 -1
- package/dist/src/components/icons/circle-info-icon.d.ts +1 -1
- package/dist/src/components/icons/circle-info-icon.js +2 -35
- package/dist/src/components/icons/circle-info-icon.js.map +1 -1
- package/dist/src/components/icons/close-icon.d.ts +1 -1
- package/dist/src/components/icons/close-icon.js +2 -20
- package/dist/src/components/icons/close-icon.js.map +1 -1
- package/dist/src/components/icons/enterprise-icon.d.ts +1 -1
- package/dist/src/components/icons/enterprise-icon.js +2 -22
- package/dist/src/components/icons/enterprise-icon.js.map +1 -1
- package/dist/src/components/icons/family-icon.d.ts +1 -1
- package/dist/src/components/icons/family-icon.js +2 -20
- package/dist/src/components/icons/family-icon.js.map +1 -1
- package/dist/src/components/icons/globe-icon.d.ts +1 -1
- package/dist/src/components/icons/globe-icon.js +2 -20
- package/dist/src/components/icons/globe-icon.js.map +1 -1
- package/dist/src/components/icons/guide-icon.d.ts +1 -1
- package/dist/src/components/icons/guide-icon.js +2 -20
- package/dist/src/components/icons/guide-icon.js.map +1 -1
- package/dist/src/components/icons/home-icon.d.ts +1 -1
- package/dist/src/components/icons/home-icon.js +2 -22
- package/dist/src/components/icons/home-icon.js.map +1 -1
- package/dist/src/components/icons/icon-element.js +1 -162
- package/dist/src/components/icons/icon-element.js.map +1 -1
- package/dist/src/components/icons/icons.d.ts +23 -23
- package/dist/src/components/icons/icons.js +1 -42
- package/dist/src/components/icons/individual-icon.d.ts +1 -1
- package/dist/src/components/icons/individual-icon.js +2 -20
- package/dist/src/components/icons/individual-icon.js.map +1 -1
- package/dist/src/components/icons/laurel-icon.d.ts +1 -1
- package/dist/src/components/icons/laurel-icon.js +2 -24
- package/dist/src/components/icons/laurel-icon.js.map +1 -1
- package/dist/src/components/icons/machine-learning-icon.d.ts +1 -1
- package/dist/src/components/icons/machine-learning-icon.js +2 -20
- package/dist/src/components/icons/machine-learning-icon.js.map +1 -1
- package/dist/src/components/icons/marks.d.ts +9 -9
- package/dist/src/components/icons/marks.js +1 -41
- package/dist/src/components/icons/minus-icon.d.ts +1 -1
- package/dist/src/components/icons/minus-icon.js +2 -19
- package/dist/src/components/icons/minus-icon.js.map +1 -1
- package/dist/src/components/icons/missing-icon.d.ts +1 -1
- package/dist/src/components/icons/missing-icon.js +3 -53
- package/dist/src/components/icons/missing-icon.js.map +1 -1
- package/dist/src/components/icons/pause-icon.d.ts +1 -1
- package/dist/src/components/icons/pause-icon.js +2 -22
- package/dist/src/components/icons/pause-icon.js.map +1 -1
- package/dist/src/components/icons/pc-mag-2024-icon.js +2 -31
- package/dist/src/components/icons/pc-mag-2024-icon.js.map +1 -1
- package/dist/src/components/icons/pc-mag-business-icon.js +2 -31
- package/dist/src/components/icons/pc-mag-business-icon.js.map +1 -1
- package/dist/src/components/icons/pc-mag-icon.js +2 -31
- package/dist/src/components/icons/pc-mag-icon.js.map +1 -1
- package/dist/src/components/icons/pc-mag-readers-icon.js +2 -30
- package/dist/src/components/icons/pc-mag-readers-icon.js.map +1 -1
- package/dist/src/components/icons/play-icon.d.ts +1 -1
- package/dist/src/components/icons/play-icon.js +2 -22
- package/dist/src/components/icons/play-icon.js.map +1 -1
- package/dist/src/components/icons/plus-icon.d.ts +1 -1
- package/dist/src/components/icons/plus-icon.js +2 -19
- package/dist/src/components/icons/plus-icon.js.map +1 -1
- package/dist/src/components/icons/quote-icon.d.ts +1 -1
- package/dist/src/components/icons/quote-icon.js +2 -30
- package/dist/src/components/icons/quote-icon.js.map +1 -1
- package/dist/src/components/icons/small-business-icon.d.ts +1 -1
- package/dist/src/components/icons/small-business-icon.js +2 -22
- package/dist/src/components/icons/small-business-icon.js.map +1 -1
- package/dist/src/components/icons/top-product-icon.js +2 -31
- package/dist/src/components/icons/top-product-icon.js.map +1 -1
- package/dist/src/components/image/image.css.js +1 -106
- package/dist/src/components/image/image.css.js.map +1 -1
- package/dist/src/components/image/image.d.ts +2 -2
- package/dist/src/components/image/image.js +10 -115
- package/dist/src/components/image/image.js.map +1 -1
- package/dist/src/components/input/input-clipboard.css.js +1 -93
- package/dist/src/components/input/input-clipboard.css.js.map +1 -1
- package/dist/src/components/input/input-clipboard.d.ts +5 -5
- package/dist/src/components/input/input-clipboard.js +20 -257
- package/dist/src/components/input/input-clipboard.js.map +1 -1
- package/dist/src/components/input/input.css.js +1 -9
- package/dist/src/components/input/input.css.js.map +1 -1
- package/dist/src/components/input/input.d.ts +4 -4
- package/dist/src/components/input/input.js +19 -202
- package/dist/src/components/input/input.js.map +1 -1
- package/dist/src/components/install-options/install-options.css.js +1 -308
- package/dist/src/components/install-options/install-options.css.js.map +1 -1
- package/dist/src/components/install-options/install-options.d.ts +4 -4
- package/dist/src/components/install-options/install-options.js +28 -159
- package/dist/src/components/install-options/install-options.js.map +1 -1
- package/dist/src/components/label/label.css.js +1 -33
- package/dist/src/components/label/label.css.js.map +1 -1
- package/dist/src/components/label/label.d.ts +3 -3
- package/dist/src/components/label/label.js +3 -135
- package/dist/src/components/label/label.js.map +1 -1
- package/dist/src/components/light-carousel/light-carousel.css.js +1 -270
- package/dist/src/components/light-carousel/light-carousel.css.js.map +1 -1
- package/dist/src/components/light-carousel/light-carousel.d.ts +3 -3
- package/dist/src/components/light-carousel/light-carousel.js +16 -181
- package/dist/src/components/light-carousel/light-carousel.js.map +1 -1
- package/dist/src/components/link/link.css.js +1 -288
- package/dist/src/components/link/link.css.js.map +1 -1
- package/dist/src/components/link/link.d.ts +3 -3
- package/dist/src/components/link/link.js +6 -233
- package/dist/src/components/link/link.js.map +1 -1
- package/dist/src/components/list/list-item/list-item.css.js +1 -167
- 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 +3 -3
- package/dist/src/components/list/list-item/list-item.js +3 -122
- package/dist/src/components/list/list-item/list-item.js.map +1 -1
- package/dist/src/components/list/list.css.js +1 -180
- package/dist/src/components/list/list.css.js.map +1 -1
- package/dist/src/components/list/list.d.ts +1 -1
- package/dist/src/components/list/list.js +5 -82
- package/dist/src/components/list/list.js.map +1 -1
- package/dist/src/components/logo-marquee/logo-marquee.css.js +1 -93
- package/dist/src/components/logo-marquee/logo-marquee.css.js.map +1 -1
- package/dist/src/components/logo-marquee/logo-marquee.d.ts +4 -3
- package/dist/src/components/logo-marquee/logo-marquee.js +6 -136
- package/dist/src/components/logo-marquee/logo-marquee.js.map +1 -1
- package/dist/src/components/modal/modal.css.js +1 -203
- package/dist/src/components/modal/modal.css.js.map +1 -1
- package/dist/src/components/modal/modal.d.ts +3 -3
- package/dist/src/components/modal/modal.js +3 -131
- package/dist/src/components/modal/modal.js.map +1 -1
- package/dist/src/components/motion-art/motion-art.d.ts +1 -1
- package/dist/src/components/motion-art/motion-art.js +1 -114
- package/dist/src/components/motion-art/motion-art.js.map +1 -1
- package/dist/src/components/overview/overview.css.js +1 -125
- package/dist/src/components/overview/overview.css.js.map +1 -1
- package/dist/src/components/overview/overview.d.ts +2 -2
- package/dist/src/components/overview/overview.js +9 -50
- package/dist/src/components/overview/overview.js.map +1 -1
- package/dist/src/components/page-switcher/page-switcher.css.js +1 -174
- package/dist/src/components/page-switcher/page-switcher.css.js.map +1 -1
- package/dist/src/components/page-switcher/page-switcher.d.ts +2 -2
- package/dist/src/components/page-switcher/page-switcher.js +6 -62
- package/dist/src/components/page-switcher/page-switcher.js.map +1 -1
- package/dist/src/components/pagination-dots/pagination-dots.css.js +1 -160
- package/dist/src/components/pagination-dots/pagination-dots.css.js.map +1 -1
- package/dist/src/components/pagination-dots/pagination-dots.d.ts +2 -2
- package/dist/src/components/pagination-dots/pagination-dots.js +10 -210
- package/dist/src/components/pagination-dots/pagination-dots.js.map +1 -1
- package/dist/src/components/paragraph/paragraph.css.js +1 -101
- package/dist/src/components/paragraph/paragraph.css.js.map +1 -1
- package/dist/src/components/paragraph/paragraph.d.ts +2 -2
- package/dist/src/components/paragraph/paragraph.js +3 -119
- package/dist/src/components/paragraph/paragraph.js.map +1 -1
- package/dist/src/components/partner-banner/partner-banner.css.js +1 -245
- package/dist/src/components/partner-banner/partner-banner.css.js.map +1 -1
- package/dist/src/components/partner-banner/partner-banner.d.ts +1 -1
- package/dist/src/components/partner-banner/partner-banner.js +6 -81
- package/dist/src/components/partner-banner/partner-banner.js.map +1 -1
- package/dist/src/components/picture/picture.css.js +1 -208
- package/dist/src/components/picture/picture.css.js.map +1 -1
- package/dist/src/components/picture/picture.d.ts +2 -2
- package/dist/src/components/picture/picture.js +14 -186
- package/dist/src/components/picture/picture.js.map +1 -1
- package/dist/src/components/post-card/post-card.css.js +1 -149
- package/dist/src/components/post-card/post-card.css.js.map +1 -1
- package/dist/src/components/post-card/post-card.d.ts +2 -2
- package/dist/src/components/post-card/post-card.js +5 -97
- package/dist/src/components/post-card/post-card.js.map +1 -1
- package/dist/src/components/pricing-cards/adopt-styles.js +1 -18
- package/dist/src/components/pricing-cards/adopt-styles.js.map +1 -1
- package/dist/src/components/pricing-cards/new-pricing-card.d.ts +2 -2
- package/dist/src/components/pricing-cards/new-pricing-card.js +4 -49
- package/dist/src/components/pricing-cards/new-pricing-card.js.map +1 -1
- package/dist/src/components/pricing-cards/new-pricing.css.js +1 -74
- package/dist/src/components/pricing-cards/new-pricing.css.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-actions.css.js +1 -11
- package/dist/src/components/pricing-cards/pricing-card-actions.css.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-actions.d.ts +2 -2
- package/dist/src/components/pricing-cards/pricing-card-actions.js +2 -59
- package/dist/src/components/pricing-cards/pricing-card-actions.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-container.css.js +1 -41
- package/dist/src/components/pricing-cards/pricing-card-container.css.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-container.d.ts +1 -1
- package/dist/src/components/pricing-cards/pricing-card-container.js +2 -40
- package/dist/src/components/pricing-cards/pricing-card-container.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-header.css.js +1 -82
- package/dist/src/components/pricing-cards/pricing-card-header.css.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-header.d.ts +5 -5
- package/dist/src/components/pricing-cards/pricing-card-header.js +7 -70
- package/dist/src/components/pricing-cards/pricing-card-header.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-pricing.css.js +1 -92
- package/dist/src/components/pricing-cards/pricing-card-pricing.css.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-pricing.d.ts +6 -6
- package/dist/src/components/pricing-cards/pricing-card-pricing.js +7 -87
- package/dist/src/components/pricing-cards/pricing-card-pricing.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-show-more.css.js +1 -29
- package/dist/src/components/pricing-cards/pricing-card-show-more.css.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card-show-more.d.ts +4 -4
- package/dist/src/components/pricing-cards/pricing-card-show-more.js +5 -41
- package/dist/src/components/pricing-cards/pricing-card-show-more.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card.css.js +1 -660
- package/dist/src/components/pricing-cards/pricing-card.css.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-card.d.ts +7 -7
- package/dist/src/components/pricing-cards/pricing-card.js +53 -639
- package/dist/src/components/pricing-cards/pricing-card.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-feature-item.css.js +1 -34
- package/dist/src/components/pricing-cards/pricing-feature-item.css.js.map +1 -1
- package/dist/src/components/pricing-cards/pricing-feature-item.d.ts +2 -2
- package/dist/src/components/pricing-cards/pricing-feature-item.js +2 -22
- package/dist/src/components/pricing-cards/pricing-feature-item.js.map +1 -1
- package/dist/src/components/process-steps/process-steps.css.js +1 -106
- package/dist/src/components/process-steps/process-steps.css.js.map +1 -1
- package/dist/src/components/process-steps/process-steps.d.ts +5 -5
- package/dist/src/components/process-steps/process-steps.js +10 -78
- package/dist/src/components/process-steps/process-steps.js.map +1 -1
- package/dist/src/components/progress/progress.css.js +1 -123
- package/dist/src/components/progress/progress.css.js.map +1 -1
- package/dist/src/components/progress/progress.d.ts +2 -2
- package/dist/src/components/progress/progress.js +6 -72
- package/dist/src/components/progress/progress.js.map +1 -1
- package/dist/src/components/quick-answer/quick-answer.css.js +1 -130
- package/dist/src/components/quick-answer/quick-answer.css.js.map +1 -1
- package/dist/src/components/quick-answer/quick-answer.d.ts +2 -2
- package/dist/src/components/quick-answer/quick-answer.js +9 -49
- package/dist/src/components/quick-answer/quick-answer.js.map +1 -1
- package/dist/src/components/radio/radio-group.css.js +1 -41
- package/dist/src/components/radio/radio-group.css.js.map +1 -1
- package/dist/src/components/radio/radio-group.d.ts +1 -1
- package/dist/src/components/radio/radio-group.js +5 -92
- package/dist/src/components/radio/radio-group.js.map +1 -1
- package/dist/src/components/radio/radio.css.js +1 -193
- package/dist/src/components/radio/radio.css.js.map +1 -1
- package/dist/src/components/radio/radio.d.ts +4 -4
- package/dist/src/components/radio/radio.js +6 -263
- package/dist/src/components/radio/radio.js.map +1 -1
- package/dist/src/components/radio/toggle-radio.d.ts +2 -2
- package/dist/src/components/radio/toggle-radio.js +3 -39
- package/dist/src/components/radio/toggle-radio.js.map +1 -1
- package/dist/src/components/review/review-grid.css.js +1 -46
- package/dist/src/components/review/review-grid.css.js.map +1 -1
- package/dist/src/components/review/review-grid.d.ts +2 -2
- package/dist/src/components/review/review-grid.js +4 -49
- package/dist/src/components/review/review-grid.js.map +1 -1
- package/dist/src/components/review/review.css.js +1 -54
- package/dist/src/components/review/review.css.js.map +1 -1
- package/dist/src/components/review/review.d.ts +2 -2
- package/dist/src/components/review/review.js +2 -59
- package/dist/src/components/review/review.js.map +1 -1
- package/dist/src/components/section/section.css.js +1 -37
- package/dist/src/components/section/section.css.js.map +1 -1
- package/dist/src/components/section/section.d.ts +1 -1
- package/dist/src/components/section/section.js +1 -50
- package/dist/src/components/section/section.js.map +1 -1
- package/dist/src/components/section-header/section-header.css.js +1 -99
- package/dist/src/components/section-header/section-header.css.js.map +1 -1
- package/dist/src/components/section-header/section-header.d.ts +2 -2
- package/dist/src/components/section-header/section-header.js +4 -85
- package/dist/src/components/section-header/section-header.js.map +1 -1
- package/dist/src/components/shared/announcer.d.ts +1 -1
- package/dist/src/components/shared/announcer.js +1 -34
- package/dist/src/components/shared/announcer.js.map +1 -1
- package/dist/src/components/shared/controller.media-query.d.ts +1 -1
- package/dist/src/components/shared/controller.media-query.js +1 -57
- package/dist/src/components/shared/controller.media-query.js.map +1 -1
- package/dist/src/components/shared/define-element.js +1 -16
- package/dist/src/components/shared/define-element.js.map +1 -1
- package/dist/src/components/shared/ensemble.css.js +1 -101
- package/dist/src/components/shared/ensemble.css.js.map +1 -1
- package/dist/src/components/shared/events.js +0 -13
- package/dist/src/components/shared/fill-width.css.js +2 -27
- package/dist/src/components/shared/fill-width.css.js.map +1 -1
- package/dist/src/components/shared/form-control.d.ts +1 -1
- package/dist/src/components/shared/form-control.js +1 -198
- package/dist/src/components/shared/form-control.js.map +1 -1
- package/dist/src/components/shared/form-field.css.js +1 -258
- package/dist/src/components/shared/form-field.css.js.map +1 -1
- package/dist/src/components/shared/prop-vocabulary.js +1 -49
- package/dist/src/components/shared/prop-vocabulary.js.map +1 -1
- package/dist/src/components/shared/token-scales.js +1 -351
- package/dist/src/components/shared/token-scales.js.map +1 -1
- package/dist/src/components/skeleton/skeleton.css.js +1 -32
- package/dist/src/components/skeleton/skeleton.css.js.map +1 -1
- package/dist/src/components/skeleton/skeleton.d.ts +2 -2
- package/dist/src/components/skeleton/skeleton.js +4 -36
- package/dist/src/components/skeleton/skeleton.js.map +1 -1
- package/dist/src/components/spinner/spinner.css.js +1 -87
- package/dist/src/components/spinner/spinner.css.js.map +1 -1
- package/dist/src/components/spinner/spinner.d.ts +3 -3
- package/dist/src/components/spinner/spinner.js +3 -69
- package/dist/src/components/spinner/spinner.js.map +1 -1
- package/dist/src/components/spotlight-section/spotlight-section.css.js +1 -105
- package/dist/src/components/spotlight-section/spotlight-section.css.js.map +1 -1
- package/dist/src/components/spotlight-section/spotlight-section.d.ts +2 -2
- package/dist/src/components/spotlight-section/spotlight-section.js +11 -72
- package/dist/src/components/spotlight-section/spotlight-section.js.map +1 -1
- package/dist/src/components/stat/stat-highlight.js +6 -82
- package/dist/src/components/stat/stat-highlight.js.map +1 -1
- package/dist/src/components/stat/stat-tile.js +5 -52
- package/dist/src/components/stat/stat-tile.js.map +1 -1
- package/dist/src/components/stat/stat.css.js +1 -145
- package/dist/src/components/stat/stat.css.js.map +1 -1
- package/dist/src/components/stat/stat.d.ts +2 -2
- package/dist/src/components/stat/stat.js +1 -3
- package/dist/src/components/switch/switch.css.js +1 -175
- package/dist/src/components/switch/switch.css.js.map +1 -1
- package/dist/src/components/switch/switch.d.ts +4 -4
- package/dist/src/components/switch/switch.js +4 -99
- package/dist/src/components/switch/switch.js.map +1 -1
- package/dist/src/components/tab-list/tab-list.css.js +1 -289
- package/dist/src/components/tab-list/tab-list.css.js.map +1 -1
- package/dist/src/components/tab-list/tab-list.d.ts +1 -1
- package/dist/src/components/tab-list/tab-list.js +13 -191
- package/dist/src/components/tab-list/tab-list.js.map +1 -1
- package/dist/src/components/tabs/tabs.css.js +1 -77
- package/dist/src/components/tabs/tabs.css.js.map +1 -1
- package/dist/src/components/tabs/tabs.d.ts +6 -6
- package/dist/src/components/tabs/tabs.js +8 -220
- package/dist/src/components/tabs/tabs.js.map +1 -1
- package/dist/src/components/tag/tag.css.js +1 -52
- package/dist/src/components/tag/tag.css.js.map +1 -1
- package/dist/src/components/tag/tag.d.ts +2 -2
- package/dist/src/components/tag/tag.js +2 -37
- package/dist/src/components/tag/tag.js.map +1 -1
- package/dist/src/components/terminal/terminal-cursor.js +1 -65
- package/dist/src/components/terminal/terminal-cursor.js.map +1 -1
- package/dist/src/components/terminal/terminal-message.css.js +1 -409
- package/dist/src/components/terminal/terminal-message.css.js.map +1 -1
- package/dist/src/components/terminal/terminal-message.d.ts +5 -5
- package/dist/src/components/terminal/terminal-message.js +28 -183
- package/dist/src/components/terminal/terminal-message.js.map +1 -1
- package/dist/src/components/termsOfUse/terms.css.js +1 -55
- package/dist/src/components/termsOfUse/terms.css.js.map +1 -1
- package/dist/src/components/termsOfUse/terms.d.ts +5 -5
- package/dist/src/components/termsOfUse/terms.js +9 -82
- package/dist/src/components/termsOfUse/terms.js.map +1 -1
- package/dist/src/components/textarea/textarea.css.js +1 -49
- package/dist/src/components/textarea/textarea.css.js.map +1 -1
- package/dist/src/components/textarea/textarea.d.ts +5 -5
- package/dist/src/components/textarea/textarea.js +15 -160
- package/dist/src/components/textarea/textarea.js.map +1 -1
- package/dist/src/components/tooltip/tooltip.css.js +1 -96
- package/dist/src/components/tooltip/tooltip.css.js.map +1 -1
- package/dist/src/components/tooltip/tooltip.d.ts +2 -2
- package/dist/src/components/tooltip/tooltip.js +5 -285
- package/dist/src/components/tooltip/tooltip.js.map +1 -1
- package/dist/src/components/trust-panel/trust-panel.css.js +1 -228
- package/dist/src/components/trust-panel/trust-panel.css.js.map +1 -1
- package/dist/src/components/trust-panel/trust-panel.d.ts +4 -4
- package/dist/src/components/trust-panel/trust-panel.js +25 -104
- package/dist/src/components/trust-panel/trust-panel.js.map +1 -1
- package/dist/src/components/video/video.css.js +1 -20
- package/dist/src/components/video/video.css.js.map +1 -1
- package/dist/src/components/video/video.d.ts +2 -2
- package/dist/src/components/video/video.js +5 -88
- package/dist/src/components/video/video.js.map +1 -1
- package/dist/src/components/video-player/video-player.css.js +1 -167
- package/dist/src/components/video-player/video-player.css.js.map +1 -1
- package/dist/src/components/video-player/video-player.d.ts +2 -2
- package/dist/src/components/video-player/video-player.js +15 -150
- package/dist/src/components/video-player/video-player.js.map +1 -1
- package/dist/src/components/visually-hidden/visually-hidden.css.js +1 -22
- package/dist/src/components/visually-hidden/visually-hidden.css.js.map +1 -1
- package/dist/src/components/visually-hidden/visually-hidden.d.ts +2 -2
- package/dist/src/components/visually-hidden/visually-hidden.js +2 -22
- package/dist/src/components/visually-hidden/visually-hidden.js.map +1 -1
- package/dist/src/tokens/brand-layer.js +8 -162
- package/dist/src/tokens/brand-layer.js.map +1 -1
- package/dist/src/tokens/dark-derivation.js +1 -325
- package/dist/src/tokens/dark-derivation.js.map +1 -1
- package/dist/src/tokens/dark-findings.d.ts +1 -1
- package/dist/src/tokens/dark-findings.js +1 -204
- package/dist/src/tokens/dark-findings.js.map +1 -1
- package/dist/src/tokens/fonts.css +1 -166
- package/dist/src/tokens/layout.css +1 -61
- package/dist/src/tokens/story-chrome.js +27 -221
- package/dist/src/tokens/story-chrome.js.map +1 -1
- package/dist/src/tokens/themes/bitdefender.js +1 -30
- package/dist/src/tokens/themes/bitdefender.js.map +1 -1
- package/dist/src/tokens/themes/contract.js +1 -7
- package/dist/src/tokens/themes/contract.js.map +1 -1
- package/dist/src/tokens/themes/index.js +1 -39
- package/dist/src/tokens/themes/index.js.map +1 -1
- package/dist/src/tokens/token-map.js +1 -236
- package/dist/src/tokens/token-map.js.map +1 -1
- package/dist/src/tokens/token-purposes.js +1 -259
- package/dist/src/tokens/token-purposes.js.map +1 -1
- package/dist/src/tokens/tokens.css +1 -1809
- package/dist/src/tokens/tokens.js +1 -1865
- package/dist/src/tokens/tokens.js.map +1 -1
- package/dist/src/tokens/type-ceiling-words.js +1 -293
- package/dist/src/tokens/type-ceiling-words.js.map +1 -1
- package/package.json +14 -3
- package/schemas/component-manifest.json +1 -1
- package/dist/src/components/icons/icons.js.map +0 -1
- package/dist/src/components/icons/marks.js.map +0 -1
- package/dist/src/components/shared/events.js.map +0 -1
- package/dist/src/components/stat/stat.js.map +0 -1
|
@@ -1,216 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, html, nothing } from "lit";
|
|
8
|
-
import { property, state } from "lit/decorators.js";
|
|
9
|
-
import { defineElement } from "../shared/define-element.js";
|
|
10
|
-
import { MediaQueryController, REDUCED_MOTION } from "../shared/controller.media-query.js";
|
|
11
|
-
import "../shared/events.js";
|
|
12
|
-
// Installs the design tokens into document scope; see src/tokens/tokens.ts
|
|
13
|
-
import "../../tokens/tokens.js";
|
|
14
|
-
import paginationDotsCSS from "./pagination-dots.css.js";
|
|
15
|
-
/**
|
|
16
|
-
* Which of a run of slides is showing, and a way to go to another: the
|
|
17
|
-
* package's one set of slide dots. Drawn in the foundation Figma file as
|
|
18
|
-
* Pagination dot and Pagination dots.
|
|
19
|
-
*
|
|
20
|
-
* bd-awards-flex and bd-carousel-section each used to draw their own -- a dot
|
|
21
|
-
* row that claimed to be a tablist, and a pair of <img role="button"> arrows --
|
|
22
|
-
* and the two had drifted apart on contrast, semantics and names. The carousel
|
|
23
|
-
* that owns the slides stays the owner of the slides: it sets current, and
|
|
24
|
-
* listens for bd-change.
|
|
25
|
-
*
|
|
26
|
-
* SEMANTICS. A group of buttons, the current one marked aria-current. Not a
|
|
27
|
-
* tablist: a tab needs a tabpanel it controls, and this atom does not own or
|
|
28
|
-
* know the panels. Each button is named for what it does ("Go to slide 2"),
|
|
29
|
-
* and the group for what it moves through. Both names are attributes, so a
|
|
30
|
-
* page in another language can say them.
|
|
31
|
-
*
|
|
32
|
-
* TARGET SIZE. A dot is 8px and the design spaces them 8px apart. Clickable at
|
|
33
|
-
* that size they fail WCAG 2.5.8, so each button is a 24px target with the dot
|
|
34
|
-
* drawn inside it. The dots end up 16px apart instead of 8; the part you can
|
|
35
|
-
* hit grows and the dots do not.
|
|
36
|
-
*
|
|
37
|
-
* AUTOPLAY. With autoplay set, the atom advances itself every delay ms and the
|
|
38
|
-
* current pill fills as the time runs: the progress IS the clock, so the fill
|
|
39
|
-
* and the change of slide cannot drift apart. That is why the timer lives here
|
|
40
|
-
* and not in the carousel. Every advance fires bd-change, exactly as a click.
|
|
41
|
-
*
|
|
42
|
-
* Stopping it. WCAG 2.2.2 wants a way to stop anything that moves on its own,
|
|
43
|
-
* and there is no pause button, so the dots are the mechanism: picking one
|
|
44
|
-
* stops autoplay for good (paused), because a visitor who chose a slide has
|
|
45
|
-
* said which one they want to read. The clock also holds -- transiently --
|
|
46
|
-
* while the pointer or focus is on the dots, or while the owner sets held for
|
|
47
|
-
* its own slides. Under prefers-reduced-motion it never starts.
|
|
48
|
-
*
|
|
49
|
-
* count below 2 renders nothing: one page has nothing to move to.
|
|
50
|
-
*/
|
|
51
|
-
const MIN_DELAY = 1000;
|
|
52
|
-
let BdPaginationDots = class BdPaginationDots extends LitElement {
|
|
53
|
-
static { this.styles = [paginationDotsCSS]; }
|
|
54
|
-
constructor() {
|
|
55
|
-
super();
|
|
56
|
-
this.count = 0;
|
|
57
|
-
// 1-based, like the names the buttons announce
|
|
58
|
-
this.current = 1;
|
|
59
|
-
this.label = "Slides";
|
|
60
|
-
this.itemLabel = "Go to slide";
|
|
61
|
-
this.autoplay = false;
|
|
62
|
-
this.delay = 4000;
|
|
63
|
-
this.paused = false;
|
|
64
|
-
this.held = false;
|
|
65
|
-
this._selfHeld = false;
|
|
66
|
-
this._progress = null;
|
|
67
|
-
this._announced = undefined;
|
|
68
|
-
// Watched rather than read once, so turning the setting on mid-visit stops it.
|
|
69
|
-
new MediaQueryController(this, REDUCED_MOTION, reduced => { if (reduced)
|
|
70
|
-
this.paused = true; });
|
|
71
|
-
}
|
|
72
|
-
disconnectedCallback() {
|
|
73
|
-
super.disconnectedCallback();
|
|
74
|
-
this._stopProgress();
|
|
75
|
-
}
|
|
76
|
-
/** count is a whole number of dots, and current always names one of them. */
|
|
77
|
-
willUpdate(changed) {
|
|
78
|
-
if (!changed.has("count") && !changed.has("current"))
|
|
79
|
-
return;
|
|
80
|
-
const count = Math.max(0, Math.floor(Number(this.count) || 0));
|
|
81
|
-
if (count !== this.count)
|
|
82
|
-
this.count = count;
|
|
83
|
-
const current = Math.min(Math.max(1, Math.floor(Number(this.current) || 1)), Math.max(1, count));
|
|
84
|
-
if (current !== this.current)
|
|
85
|
-
this.current = current;
|
|
86
|
-
}
|
|
87
|
-
updated(changed) {
|
|
88
|
-
// A new slide, a new clock or autoplay switched: the fill starts again.
|
|
89
|
-
if (["count", "current", "autoplay", "delay"].some(k => changed.has(k)))
|
|
90
|
-
this._startProgress();
|
|
91
|
-
this._syncProgress();
|
|
92
|
-
this._announcePlayState();
|
|
93
|
-
}
|
|
94
|
-
get _running() {
|
|
95
|
-
return this.autoplay && this.count > 1;
|
|
96
|
-
}
|
|
97
|
-
get _moving() {
|
|
98
|
-
return this._running && !this.paused && !this.held && !this._selfHeld;
|
|
99
|
-
}
|
|
100
|
-
/* One Web Animation per slide, on the current pill's fill. Its finish is the
|
|
101
|
-
advance; pausing it is pausing the clock, and the fill holds where it
|
|
102
|
-
stopped rather than snapping back. */
|
|
103
|
-
_startProgress() {
|
|
104
|
-
this._stopProgress();
|
|
105
|
-
if (!this._running)
|
|
106
|
-
return;
|
|
107
|
-
const fill = this.renderRoot.querySelector('.dot[aria-current="true"] .fill');
|
|
108
|
-
if (!fill?.animate)
|
|
109
|
-
return;
|
|
110
|
-
const delay = Math.max(MIN_DELAY, Number(this.delay) || 0);
|
|
111
|
-
const progress = fill.animate([{ transform: "scaleX(0)" }, { transform: "scaleX(1)" }], { duration: delay, easing: "linear", fill: "forwards" });
|
|
112
|
-
this._progress = progress;
|
|
113
|
-
progress.finished.then(() => {
|
|
114
|
-
if (this._progress !== progress)
|
|
115
|
-
return;
|
|
116
|
-
this._select(this.current >= this.count ? 1 : this.current + 1);
|
|
117
|
-
}, () => { });
|
|
118
|
-
}
|
|
119
|
-
_stopProgress() {
|
|
120
|
-
const progress = this._progress;
|
|
121
|
-
this._progress = null;
|
|
122
|
-
progress?.cancel();
|
|
123
|
-
}
|
|
124
|
-
_syncProgress() {
|
|
125
|
-
const progress = this._progress;
|
|
126
|
-
if (!progress)
|
|
127
|
-
return;
|
|
128
|
-
if (this._moving && progress.playState === "paused")
|
|
129
|
-
progress.play();
|
|
130
|
-
else if (!this._moving && progress.playState === "running")
|
|
131
|
-
progress.pause();
|
|
132
|
-
}
|
|
133
|
-
/* bd-toggle whenever the slides start or stop moving, for whatever reason.
|
|
134
|
-
An owner needs it for its live region -- slides that change on their own
|
|
135
|
-
must not be announced, and slides that change because the visitor asked
|
|
136
|
-
must be -- and only this atom knows about the holds it places itself.
|
|
137
|
-
Fired once on first render too, so the owner starts in step. */
|
|
138
|
-
_announcePlayState() {
|
|
139
|
-
const state = `${this.paused}|${this._moving}`;
|
|
140
|
-
if (state === this._announced)
|
|
141
|
-
return;
|
|
142
|
-
this._announced = state;
|
|
143
|
-
this.dispatchEvent(new CustomEvent("bd-toggle", {
|
|
144
|
-
detail: { paused: this.paused, moving: this._moving },
|
|
145
|
-
bubbles: true,
|
|
146
|
-
composed: true
|
|
147
|
-
}));
|
|
148
|
-
}
|
|
149
|
-
_select(n) {
|
|
150
|
-
if (n === this.current)
|
|
151
|
-
return;
|
|
152
|
-
this.current = n;
|
|
153
|
-
this.dispatchEvent(new CustomEvent("bd-change", {
|
|
154
|
-
detail: { current: n },
|
|
155
|
-
bubbles: true,
|
|
156
|
-
composed: true
|
|
157
|
-
}));
|
|
158
|
-
}
|
|
159
|
-
// The visitor's pick: it moves, and it stops autoplay for good.
|
|
160
|
-
_pick(n) {
|
|
161
|
-
if (this._running)
|
|
162
|
-
this.paused = true;
|
|
163
|
-
this._select(n);
|
|
164
|
-
}
|
|
165
|
-
render() {
|
|
166
|
-
if (this.count < 2)
|
|
167
|
-
return nothing;
|
|
168
|
-
const pages = Array.from({ length: this.count }, (_, i) => i + 1);
|
|
169
|
-
return html `<div
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{MediaQueryController as n,REDUCED_MOTION as r}from"../shared/controller.media-query.js";import i from"./pagination-dots.css.js";import{LitElement as a,html as o,nothing as s}from"lit";import{property as c,state as l}from"lit/decorators.js";var u=1e3,d=class extends a{static{this.styles=[i]}constructor(){super(),this.count=0,this.current=1,this.label=`Slides`,this.itemLabel=`Go to slide`,this.autoplay=!1,this.delay=4e3,this.paused=!1,this.held=!1,this._selfHeld=!1,this._progress=null,this._announced=void 0,new n(this,r,e=>{e&&(this.paused=!0)})}disconnectedCallback(){super.disconnectedCallback(),this._stopProgress()}willUpdate(e){if(!e.has(`count`)&&!e.has(`current`))return;let t=Math.max(0,Math.floor(Number(this.count)||0));t!==this.count&&(this.count=t);let n=Math.min(Math.max(1,Math.floor(Number(this.current)||1)),Math.max(1,t));n!==this.current&&(this.current=n)}updated(e){[`count`,`current`,`autoplay`,`delay`].some(t=>e.has(t))&&this._startProgress(),this._syncProgress(),this._announcePlayState()}get _running(){return this.autoplay&&this.count>1}get _moving(){return this._running&&!this.paused&&!this.held&&!this._selfHeld}_startProgress(){if(this._stopProgress(),!this._running)return;let e=this.renderRoot.querySelector(`.dot[aria-current="true"] .fill`);if(!e?.animate)return;let t=Math.max(u,Number(this.delay)||0),n=e.animate([{transform:`scaleX(0)`},{transform:`scaleX(1)`}],{duration:t,easing:`linear`,fill:`forwards`});this._progress=n,n.finished.then(()=>{this._progress===n&&this._select(this.current>=this.count?1:this.current+1)},()=>{})}_stopProgress(){let e=this._progress;this._progress=null,e?.cancel()}_syncProgress(){let e=this._progress;e&&(this._moving&&e.playState===`paused`?e.play():!this._moving&&e.playState===`running`&&e.pause())}_announcePlayState(){let e=`${this.paused}|${this._moving}`;e!==this._announced&&(this._announced=e,this.dispatchEvent(new CustomEvent(`bd-toggle`,{detail:{paused:this.paused,moving:this._moving},bubbles:!0,composed:!0})))}_select(e){e!==this.current&&(this.current=e,this.dispatchEvent(new CustomEvent(`bd-change`,{detail:{current:e},bubbles:!0,composed:!0})))}_pick(e){this._running&&(this.paused=!0),this._select(e)}render(){if(this.count<2)return s;let e=Array.from({length:this.count},(e,t)=>t+1);return o`<div
|
|
170
2
|
class="dots"
|
|
171
3
|
role="group"
|
|
172
4
|
aria-label="${this.label}"
|
|
173
|
-
@pointerenter=${()
|
|
174
|
-
@pointerleave=${()
|
|
175
|
-
@focusin=${()
|
|
176
|
-
@focusout=${
|
|
177
|
-
>${
|
|
5
|
+
@pointerenter=${()=>{this._selfHeld=!0}}
|
|
6
|
+
@pointerleave=${()=>{this._selfHeld=this.renderRoot.contains(this.renderRoot.activeElement)}}
|
|
7
|
+
@focusin=${()=>{this._selfHeld=!0}}
|
|
8
|
+
@focusout=${e=>{this._selfHeld=this.renderRoot.contains(e.relatedTarget)||this.matches(`:hover`)}}
|
|
9
|
+
>${e.map(e=>o`<button
|
|
178
10
|
type="button"
|
|
179
11
|
class="dot"
|
|
180
|
-
aria-label="${this.itemLabel} ${
|
|
181
|
-
aria-current="${
|
|
182
|
-
@click=${()
|
|
183
|
-
><span class="mark"><span class="fill"></span></span></button>`)}</div
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
__decorate([
|
|
187
|
-
property({ type: Number })
|
|
188
|
-
], BdPaginationDots.prototype, "count", void 0);
|
|
189
|
-
__decorate([
|
|
190
|
-
property({ type: Number, reflect: true })
|
|
191
|
-
], BdPaginationDots.prototype, "current", void 0);
|
|
192
|
-
__decorate([
|
|
193
|
-
property({ type: String })
|
|
194
|
-
], BdPaginationDots.prototype, "label", void 0);
|
|
195
|
-
__decorate([
|
|
196
|
-
property({ type: String, attribute: "item-label" })
|
|
197
|
-
], BdPaginationDots.prototype, "itemLabel", void 0);
|
|
198
|
-
__decorate([
|
|
199
|
-
property({ type: Boolean, reflect: true })
|
|
200
|
-
], BdPaginationDots.prototype, "autoplay", void 0);
|
|
201
|
-
__decorate([
|
|
202
|
-
property({ type: Number })
|
|
203
|
-
], BdPaginationDots.prototype, "delay", void 0);
|
|
204
|
-
__decorate([
|
|
205
|
-
property({ type: Boolean, reflect: true })
|
|
206
|
-
], BdPaginationDots.prototype, "paused", void 0);
|
|
207
|
-
__decorate([
|
|
208
|
-
property({ type: Boolean })
|
|
209
|
-
], BdPaginationDots.prototype, "held", void 0);
|
|
210
|
-
__decorate([
|
|
211
|
-
state()
|
|
212
|
-
], BdPaginationDots.prototype, "_selfHeld", void 0);
|
|
213
|
-
BdPaginationDots = __decorate([
|
|
214
|
-
defineElement("bd-pagination-dots")
|
|
215
|
-
], BdPaginationDots);
|
|
12
|
+
aria-label="${this.itemLabel} ${e}"
|
|
13
|
+
aria-current="${e===this.current?`true`:s}"
|
|
14
|
+
@click=${()=>this._pick(e)}
|
|
15
|
+
><span class="mark"><span class="fill"></span></span></button>`)}</div>`}};t([c({type:Number})],d.prototype,`count`,void 0),t([c({type:Number,reflect:!0})],d.prototype,`current`,void 0),t([c({type:String})],d.prototype,`label`,void 0),t([c({type:String,attribute:`item-label`})],d.prototype,`itemLabel`,void 0),t([c({type:Boolean,reflect:!0})],d.prototype,`autoplay`,void 0),t([c({type:Number})],d.prototype,`delay`,void 0),t([c({type:Boolean,reflect:!0})],d.prototype,`paused`,void 0),t([c({type:Boolean})],d.prototype,`held`,void 0),t([l()],d.prototype,`_selfHeld`,void 0),d=t([e(`bd-pagination-dots`)],d);
|
|
216
16
|
//# sourceMappingURL=pagination-dots.js.map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I,EAAE,MAAM,EAAE,CAAC;+CACjB;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAC9B;AAEZ;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACV;AAEjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;mDAC1B;AAE1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAC1B;AAEjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACd;AAEb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAC5B;AAEf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACf;AAEb;IADC,KAAK,EAAE;mDACU;AArBd,gBAAgB;IADrB,aAAa,CAAC,oBAAoB,CAAC;GAC9B,gBAAgB,CAmJrB","sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"../shared/define-element.ts\";\nimport { MediaQueryController, REDUCED_MOTION } from \"../shared/controller.media-query.ts\";\nimport \"../shared/events.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"../../tokens/tokens.ts\";\nimport paginationDotsCSS from \"./pagination-dots.css.ts\";\n\n/**\n * Which of a run of slides is showing, and a way to go to another: the\n * package's one set of slide dots. Drawn in the foundation Figma file as\n * Pagination dot and Pagination dots.\n *\n * bd-awards-flex and bd-carousel-section each used to draw their own -- a dot\n * row that claimed to be a tablist, and a pair of <img role=\"button\"> arrows --\n * and the two had drifted apart on contrast, semantics and names. The carousel\n * that owns the slides stays the owner of the slides: it sets current, and\n * listens for bd-change.\n *\n * SEMANTICS. A group of buttons, the current one marked aria-current. Not a\n * tablist: a tab needs a tabpanel it controls, and this atom does not own or\n * know the panels. Each button is named for what it does (\"Go to slide 2\"),\n * and the group for what it moves through. Both names are attributes, so a\n * page in another language can say them.\n *\n * TARGET SIZE. A dot is 8px and the design spaces them 8px apart. Clickable at\n * that size they fail WCAG 2.5.8, so each button is a 24px target with the dot\n * drawn inside it. The dots end up 16px apart instead of 8; the part you can\n * hit grows and the dots do not.\n *\n * AUTOPLAY. With autoplay set, the atom advances itself every delay ms and the\n * current pill fills as the time runs: the progress IS the clock, so the fill\n * and the change of slide cannot drift apart. That is why the timer lives here\n * and not in the carousel. Every advance fires bd-change, exactly as a click.\n *\n * Stopping it. WCAG 2.2.2 wants a way to stop anything that moves on its own,\n * and there is no pause button, so the dots are the mechanism: picking one\n * stops autoplay for good (paused), because a visitor who chose a slide has\n * said which one they want to read. The clock also holds -- transiently --\n * while the pointer or focus is on the dots, or while the owner sets held for\n * its own slides. Under prefers-reduced-motion it never starts.\n *\n * count below 2 renders nothing: one page has nothing to move to.\n */\nconst MIN_DELAY = 1000;\n\n@defineElement(\"bd-pagination-dots\")\nclass BdPaginationDots extends LitElement {\n static styles = [paginationDotsCSS];\n\n @property({ type: Number })\n count = 0;\n // 1-based, like the names the buttons announce\n @property({ type: Number, reflect: true })\n current = 1;\n @property({ type: String })\n label = \"Slides\";\n @property({ type: String, attribute: \"item-label\" })\n itemLabel = \"Go to slide\";\n @property({ type: Boolean, reflect: true })\n autoplay = false;\n @property({ type: Number })\n delay = 4000;\n @property({ type: Boolean, reflect: true })\n paused = false;\n @property({ type: Boolean })\n held = false;\n @state()\n _selfHeld = false;\n\n _progress : Animation | null;\n _announced: string | undefined;\n\n constructor() {\n super();\n this._progress = null;\n this._announced = undefined;\n // Watched rather than read once, so turning the setting on mid-visit stops it.\n new MediaQueryController(this, REDUCED_MOTION, reduced => { if (reduced) this.paused = true; });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._stopProgress();\n }\n\n /** count is a whole number of dots, and current always names one of them. */\n willUpdate(changed: PropertyValues<this>) {\n if (!changed.has(\"count\") && !changed.has(\"current\")) return;\n const count = Math.max(0, Math.floor(Number(this.count) || 0));\n if (count !== this.count) this.count = count;\n const current = Math.min(Math.max(1, Math.floor(Number(this.current) || 1)), Math.max(1, count));\n if (current !== this.current) this.current = current;\n }\n\n updated(changed: PropertyValues<this>) {\n // A new slide, a new clock or autoplay switched: the fill starts again.\n if (([\"count\", \"current\", \"autoplay\", \"delay\"] as const).some(k => changed.has(k))) this._startProgress();\n this._syncProgress();\n this._announcePlayState();\n }\n\n get _running() {\n return this.autoplay && this.count > 1;\n }\n\n get _moving() {\n return this._running && !this.paused && !this.held && !this._selfHeld;\n }\n\n /* One Web Animation per slide, on the current pill's fill. Its finish is the\n advance; pausing it is pausing the clock, and the fill holds where it\n stopped rather than snapping back. */\n _startProgress() {\n this._stopProgress();\n if (!this._running) return;\n const fill = this.renderRoot.querySelector('.dot[aria-current=\"true\"] .fill');\n if (!fill?.animate) return;\n const delay = Math.max(MIN_DELAY, Number(this.delay) || 0);\n const progress = fill.animate(\n [{ transform: \"scaleX(0)\" }, { transform: \"scaleX(1)\" }],\n { duration: delay, easing: \"linear\", fill: \"forwards\" }\n );\n this._progress = progress;\n progress.finished.then(() => {\n if (this._progress !== progress) return;\n this._select(this.current >= this.count ? 1 : this.current + 1);\n }, () => {});\n }\n\n _stopProgress() {\n const progress = this._progress;\n this._progress = null;\n progress?.cancel();\n }\n\n _syncProgress() {\n const progress = this._progress;\n if (!progress) return;\n if (this._moving && progress.playState === \"paused\") progress.play();\n else if (!this._moving && progress.playState === \"running\") progress.pause();\n }\n\n /* bd-toggle whenever the slides start or stop moving, for whatever reason.\n An owner needs it for its live region -- slides that change on their own\n must not be announced, and slides that change because the visitor asked\n must be -- and only this atom knows about the holds it places itself.\n Fired once on first render too, so the owner starts in step. */\n _announcePlayState() {\n const state = `${this.paused}|${this._moving}`;\n if (state === this._announced) return;\n this._announced = state;\n this.dispatchEvent(new CustomEvent(\"bd-toggle\", {\n detail : { paused: this.paused, moving: this._moving },\n bubbles : true,\n composed: true\n }));\n }\n\n _select(n: number) {\n if (n === this.current) return;\n this.current = n;\n this.dispatchEvent(new CustomEvent(\"bd-change\", {\n detail : { current: n },\n bubbles : true,\n composed: true\n }));\n }\n\n // The visitor's pick: it moves, and it stops autoplay for good.\n _pick(n: number) {\n if (this._running) this.paused = true;\n this._select(n);\n }\n\n render() {\n if (this.count < 2) return nothing;\n const pages = Array.from({ length: this.count }, (_, i) => i + 1);\n return html`<div\n class=\"dots\"\n role=\"group\"\n aria-label=\"${this.label}\"\n @pointerenter=${() => { this._selfHeld = true; }}\n @pointerleave=${() => { this._selfHeld = this.renderRoot.contains((this.renderRoot as ShadowRoot).activeElement); }}\n @focusin=${() => { this._selfHeld = true; }}\n @focusout=${(e: FocusEvent) => { this._selfHeld = this.renderRoot.contains(e.relatedTarget as Node | null) || this.matches(\":hover\"); }}\n >${pages.map(n => html`<button\n type=\"button\"\n class=\"dot\"\n aria-label=\"${this.itemLabel} ${n}\"\n aria-current=\"${n === this.current ? \"true\" : nothing}\"\n @click=${() => this._pick(n)}\n ><span class=\"mark\"><span class=\"fill\"></span></span></button>`)}</div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-pagination-dots\": BdPaginationDots;\n }\n interface HTMLElementEventMap {\n \"bd-toggle\": CustomEvent<{ paused: boolean; moving: boolean }>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pagination-dots.js","names":["paginationDotsCSS","_decorate","__decorate","pagination_dots_css_default","MIN_DELAY","BdPaginationDots","LitElement","MediaQueryController","REDUCED_MOTION","reduced","changed","count","current","k","fill","delay","progress","state","n","nothing","pages","i","property","defineElement"],"sources":["../../../../src/components/pagination-dots/pagination-dots.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { MediaQueryController, REDUCED_MOTION } from \"#shared/controller.media-query.ts\";\nimport \"#shared/events.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport paginationDotsCSS from \"./pagination-dots.css.ts\";\n\n/**\n * Which of a run of slides is showing, and a way to go to another: the\n * package's one set of slide dots. Drawn in the foundation Figma file as\n * Pagination dot and Pagination dots.\n *\n * bd-awards-flex and bd-carousel-section each used to draw their own -- a dot\n * row that claimed to be a tablist, and a pair of <img role=\"button\"> arrows --\n * and the two had drifted apart on contrast, semantics and names. The carousel\n * that owns the slides stays the owner of the slides: it sets current, and\n * listens for bd-change.\n *\n * SEMANTICS. A group of buttons, the current one marked aria-current. Not a\n * tablist: a tab needs a tabpanel it controls, and this atom does not own or\n * know the panels. Each button is named for what it does (\"Go to slide 2\"),\n * and the group for what it moves through. Both names are attributes, so a\n * page in another language can say them.\n *\n * TARGET SIZE. A dot is 8px and the design spaces them 8px apart. Clickable at\n * that size they fail WCAG 2.5.8, so each button is a 24px target with the dot\n * drawn inside it. The dots end up 16px apart instead of 8; the part you can\n * hit grows and the dots do not.\n *\n * AUTOPLAY. With autoplay set, the atom advances itself every delay ms and the\n * current pill fills as the time runs: the progress IS the clock, so the fill\n * and the change of slide cannot drift apart. That is why the timer lives here\n * and not in the carousel. Every advance fires bd-change, exactly as a click.\n *\n * Stopping it. WCAG 2.2.2 wants a way to stop anything that moves on its own,\n * and there is no pause button, so the dots are the mechanism: picking one\n * stops autoplay for good (paused), because a visitor who chose a slide has\n * said which one they want to read. The clock also holds -- transiently --\n * while the pointer or focus is on the dots, or while the owner sets held for\n * its own slides. Under prefers-reduced-motion it never starts.\n *\n * count below 2 renders nothing: one page has nothing to move to.\n */\nconst MIN_DELAY = 1000;\n\n@defineElement(\"bd-pagination-dots\")\nclass BdPaginationDots extends LitElement {\n static styles = [paginationDotsCSS];\n\n @property({ type: Number })\n count = 0;\n // 1-based, like the names the buttons announce\n @property({ type: Number, reflect: true })\n current = 1;\n @property({ type: String })\n label = \"Slides\";\n @property({ type: String, attribute: \"item-label\" })\n itemLabel = \"Go to slide\";\n @property({ type: Boolean, reflect: true })\n autoplay = false;\n @property({ type: Number })\n delay = 4000;\n @property({ type: Boolean, reflect: true })\n paused = false;\n @property({ type: Boolean })\n held = false;\n @state()\n _selfHeld = false;\n\n _progress : Animation | null;\n _announced: string | undefined;\n\n constructor() {\n super();\n this._progress = null;\n this._announced = undefined;\n // Watched rather than read once, so turning the setting on mid-visit stops it.\n new MediaQueryController(this, REDUCED_MOTION, reduced => { if (reduced) this.paused = true; });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._stopProgress();\n }\n\n /** count is a whole number of dots, and current always names one of them. */\n willUpdate(changed: PropertyValues<this>) {\n if (!changed.has(\"count\") && !changed.has(\"current\")) return;\n const count = Math.max(0, Math.floor(Number(this.count) || 0));\n if (count !== this.count) this.count = count;\n const current = Math.min(Math.max(1, Math.floor(Number(this.current) || 1)), Math.max(1, count));\n if (current !== this.current) this.current = current;\n }\n\n updated(changed: PropertyValues<this>) {\n // A new slide, a new clock or autoplay switched: the fill starts again.\n if (([\"count\", \"current\", \"autoplay\", \"delay\"] as const).some(k => changed.has(k))) this._startProgress();\n this._syncProgress();\n this._announcePlayState();\n }\n\n get _running() {\n return this.autoplay && this.count > 1;\n }\n\n get _moving() {\n return this._running && !this.paused && !this.held && !this._selfHeld;\n }\n\n /* One Web Animation per slide, on the current pill's fill. Its finish is the\n advance; pausing it is pausing the clock, and the fill holds where it\n stopped rather than snapping back. */\n _startProgress() {\n this._stopProgress();\n if (!this._running) return;\n const fill = this.renderRoot.querySelector('.dot[aria-current=\"true\"] .fill');\n if (!fill?.animate) return;\n const delay = Math.max(MIN_DELAY, Number(this.delay) || 0);\n const progress = fill.animate(\n [{ transform: \"scaleX(0)\" }, { transform: \"scaleX(1)\" }],\n { duration: delay, easing: \"linear\", fill: \"forwards\" }\n );\n this._progress = progress;\n progress.finished.then(() => {\n if (this._progress !== progress) return;\n this._select(this.current >= this.count ? 1 : this.current + 1);\n }, () => {});\n }\n\n _stopProgress() {\n const progress = this._progress;\n this._progress = null;\n progress?.cancel();\n }\n\n _syncProgress() {\n const progress = this._progress;\n if (!progress) return;\n if (this._moving && progress.playState === \"paused\") progress.play();\n else if (!this._moving && progress.playState === \"running\") progress.pause();\n }\n\n /* bd-toggle whenever the slides start or stop moving, for whatever reason.\n An owner needs it for its live region -- slides that change on their own\n must not be announced, and slides that change because the visitor asked\n must be -- and only this atom knows about the holds it places itself.\n Fired once on first render too, so the owner starts in step. */\n _announcePlayState() {\n const state = `${this.paused}|${this._moving}`;\n if (state === this._announced) return;\n this._announced = state;\n this.dispatchEvent(new CustomEvent(\"bd-toggle\", {\n detail : { paused: this.paused, moving: this._moving },\n bubbles : true,\n composed: true\n }));\n }\n\n _select(n: number) {\n if (n === this.current) return;\n this.current = n;\n this.dispatchEvent(new CustomEvent(\"bd-change\", {\n detail : { current: n },\n bubbles : true,\n composed: true\n }));\n }\n\n // The visitor's pick: it moves, and it stops autoplay for good.\n _pick(n: number) {\n if (this._running) this.paused = true;\n this._select(n);\n }\n\n render() {\n if (this.count < 2) return nothing;\n const pages = Array.from({ length: this.count }, (_, i) => i + 1);\n return html`<div\n class=\"dots\"\n role=\"group\"\n aria-label=\"${this.label}\"\n @pointerenter=${() => { this._selfHeld = true; }}\n @pointerleave=${() => { this._selfHeld = this.renderRoot.contains((this.renderRoot as ShadowRoot).activeElement); }}\n @focusin=${() => { this._selfHeld = true; }}\n @focusout=${(e: FocusEvent) => { this._selfHeld = this.renderRoot.contains(e.relatedTarget as Node | null) || this.matches(\":hover\"); }}\n >${pages.map(n => html`<button\n type=\"button\"\n class=\"dot\"\n aria-label=\"${this.itemLabel} ${n}\"\n aria-current=\"${n === this.current ? \"true\" : nothing}\"\n @click=${() => this._pick(n)}\n ><span class=\"mark\"><span class=\"fill\"></span></span></button>`)}</div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-pagination-dots\": BdPaginationDots;\n }\n interface HTMLElementEventMap {\n \"bd-toggle\": CustomEvent<{ paused: boolean; moving: boolean }>;\n }\n}\n"],"mappings":"A,4ZA6CA,IAAMI,EAAY,IAGZC,EADN,cAC+BC,CAAW,C,OACxB,KAAA,OAAA,CAACN,CAAiB,C,CAyBlC,aAAc,CACZ,MAAM,EAvBA,KAAA,MAAA,EAGE,KAAA,QAAA,EAEF,KAAA,MAAA,SAEI,KAAA,UAAA,cAED,KAAA,SAAA,GAEH,KAAA,MAAA,IAEC,KAAA,OAAA,GAEF,KAAA,KAAA,GAEK,KAAA,UAAA,GAOV,KAAK,UAAY,KACjB,KAAK,WAAa,IAAA,GAElB,IAAIO,EAAqB,KAAMC,EAAgB,GAAW,CAAMC,IAAS,KAAK,OAAS,GAAM,CAAC,CAChG,CAEA,sBAAuB,CACrB,MAAM,qBAAqB,EAC3B,KAAK,cAAc,CACrB,CAGA,WAAW,EAA+B,CACxC,GAAI,CAACC,EAAQ,IAAI,OAAO,GAAK,CAACA,EAAQ,IAAI,SAAS,EAAG,OACtD,IAAMC,EAAQ,KAAK,IAAI,EAAG,KAAK,MAAM,OAAO,KAAK,KAAK,GAAK,CAAC,CAAC,EACzDA,IAAU,KAAK,QAAO,KAAK,MAAQA,GACvC,IAAMC,EAAU,KAAK,IAAI,KAAK,IAAI,EAAG,KAAK,MAAM,OAAO,KAAK,OAAO,GAAK,CAAC,CAAC,EAAG,KAAK,IAAI,EAAGD,CAAK,CAAC,EAC3FC,IAAY,KAAK,UAAS,KAAK,QAAUA,EAC/C,CAEA,QAAQ,EAA+B,CAEhC,CAAC,QAAS,UAAW,WAAY,OAAO,CAAC,CAAW,KAAK,GAAKF,EAAQ,IAAIG,CAAC,CAAC,GAAG,KAAK,eAAe,EACxG,KAAK,cAAc,EACnB,KAAK,mBAAmB,CAC1B,CAEA,IAAI,UAAW,CACb,OAAO,KAAK,UAAY,KAAK,MAAQ,CACvC,CAE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,EAAA,CAAAqB,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAjB,EAAA,UAAA,QAAA,IAAA,EAAA,EAEzBJ,EAAA,CAAAqB,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAAjB,EAAA,UAAA,SAAA,IAAA,EAAA,EAEzCJ,EAAA,CAAAqB,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAAAjB,EAAA,UAAA,OAAA,IAAA,EAAA,EAE1BJ,EAAA,CAAAgB,EAAM,CAAA,EAAAZ,EAAA,UAAA,YAAA,IAAA,EAAA,EArBR,EAAAJ,EAAA,CAAAsB,EAAc,oBAAoB,CAAA,EAAAlB,CAAA"}
|
|
@@ -1,102 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { below } from "../shared/token-scales.js";
|
|
3
|
-
export default css `
|
|
4
|
-
/* --color-text-primary, not --color-neutral-1000. Body copy was set in pure
|
|
5
|
-
black while bd-display used neutral-900 and bd-li neutral-700, so a
|
|
6
|
-
heading, its paragraph and its list rendered in three different inks. The
|
|
7
|
-
line below the font-family used to carry the intended value as
|
|
8
|
-
a // prefix, which CSS does not treat as a comment — the parser dropped
|
|
9
|
-
it, and the pure black above won by default. */
|
|
10
|
-
:host {
|
|
11
|
-
display: block;
|
|
12
|
-
color: var(--bd-paragraph-color, var(--color-text-primary));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
p {
|
|
16
|
-
all: unset;
|
|
17
|
-
display: block;
|
|
18
|
-
font-family: var(--typography-body-regular-fontFamily);
|
|
19
|
-
/* The flow margin between consecutive paragraphs, and the switch to turn
|
|
20
|
-
it off: --bd-paragraph-margin-bottom: 0 on the host or any ancestor.
|
|
21
|
-
It inherits into this shadow root, which the margin itself never did --
|
|
22
|
-
the <p> is unreachable from outside, so a paragraph that ends a card or
|
|
23
|
-
a column carried 16px nobody could remove, and the header cancelled it
|
|
24
|
-
three times with a negative margin.
|
|
25
|
-
|
|
26
|
-
It was a no-op until 0.26.0: it read --spacing-md, which no longer
|
|
27
|
-
existed, so every page built on 0.25 was laid out with zero here. The
|
|
28
|
-
rename to --spacing-16 made it live, which is how the step cards on
|
|
29
|
-
security-for-creators gained 16px under each description. */
|
|
30
|
-
margin-bottom: var(--bd-paragraph-margin-bottom, var(--spacing-16));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* === Font Size Variants === */
|
|
34
|
-
:host([variant="large"]) p {
|
|
35
|
-
font-size: var(--typography-body-large-fontSize);
|
|
36
|
-
font-weight: var(--typography-body-large-fontWeight);
|
|
37
|
-
line-height: var(--typography-body-large-lineHeight);
|
|
38
|
-
letter-spacing: var(--typography-body-large-letterSpacing);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
:host([variant="regular"]) p {
|
|
42
|
-
font-size: var(--typography-body-regular-fontSize);
|
|
43
|
-
font-weight: var(--typography-body-regular-fontWeight);
|
|
44
|
-
line-height: var(--typography-body-regular-lineHeight);
|
|
45
|
-
letter-spacing: var(--typography-body-regular-letterSpacing);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
:host([variant="small"]) p {
|
|
49
|
-
font-size: var(--typography-body-small-fontSize);
|
|
50
|
-
font-weight: var(--typography-body-small-fontWeight);
|
|
51
|
-
line-height: var(--typography-body-small-lineHeight);
|
|
52
|
-
letter-spacing: var(--typography-body-small-letterSpacing);
|
|
53
|
-
}
|
|
54
|
-
:host([variant="xsmall"]) p {
|
|
55
|
-
font-size: var(--typography-body-xsmall-fontSize);
|
|
56
|
-
font-weight: var(--typography-body-small-fontWeight);
|
|
57
|
-
line-height: var(--typography-body-small-lineHeight);
|
|
58
|
-
letter-spacing: var(--typography-body-small-letterSpacing);
|
|
59
|
-
}
|
|
60
|
-
:host([variant="lead"]) p {
|
|
61
|
-
font-size: var(--typography-body-lead-fontSize);
|
|
62
|
-
font-weight: var(--typography-body-lead-fontWeight);
|
|
63
|
-
line-height: var(--typography-body-lead-lineHeight);
|
|
64
|
-
letter-spacing: var(--typography-body-lead-letterSpacing);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* The eyebrow: a short label above a section title. It takes the
|
|
68
|
-
label-large role -- the role whose job is a short label rather than
|
|
69
|
-
running text -- which is 16px at 1.5 like body-regular and Medium 500
|
|
70
|
-
where body-regular is 400. Brand ink is part of the pattern: all five
|
|
71
|
-
eyebrows in the package and every one on the homepage are text-brand.
|
|
72
|
-
A color attribute still wins, for an eyebrow on a dark band. */
|
|
73
|
-
:host([variant="eyebrow"]) p {
|
|
74
|
-
font-size: var(--typography-label-large-fontSize);
|
|
75
|
-
font-weight: var(--typography-label-large-fontWeight);
|
|
76
|
-
line-height: var(--typography-label-large-lineHeight);
|
|
77
|
-
letter-spacing: var(--typography-label-large-letterSpacing);
|
|
78
|
-
font-family: var(--typography-label-large-fontFamily);
|
|
79
|
-
color: var(--color-text-brand);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/* Below lg the eyebrow steps down to label-default: 14px, the same Medium
|
|
83
|
-
500 at 1.5. The homepage draws it 14 on the 390 and 768 frames and 16 on
|
|
84
|
-
desktop, so the step sits at lg, which is also where every fluid role in
|
|
85
|
-
the system stops growing. A step between two declared roles rather than a
|
|
86
|
-
fluid size, because the label family has no fluid role, and one for a
|
|
87
|
-
single variant would be a new token where two existing roles already
|
|
88
|
-
answer both ends exactly. */
|
|
89
|
-
@media ${unsafeCSS(below("lg"))} {
|
|
90
|
-
:host([variant="eyebrow"]) p {
|
|
91
|
-
font-size: var(--typography-label-default-fontSize);
|
|
92
|
-
font-weight: var(--typography-label-default-fontWeight);
|
|
93
|
-
line-height: var(--typography-label-default-lineHeight);
|
|
94
|
-
letter-spacing: var(--typography-label-default-letterSpacing);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
`;
|
|
1
|
+
import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{color:var(--bd-paragraph-color,var(--color-text-primary));display:block}p{all:unset;font-family:var(--typography-body-regular-fontFamily);margin-bottom:var(--bd-paragraph-margin-bottom,var(--spacing-16));display:block}:host([variant=large]) p{font-size:var(--typography-body-large-fontSize);font-weight:var(--typography-body-large-fontWeight);line-height:var(--typography-body-large-lineHeight);letter-spacing:var(--typography-body-large-letterSpacing)}:host([variant=regular]) p{font-size:var(--typography-body-regular-fontSize);font-weight:var(--typography-body-regular-fontWeight);line-height:var(--typography-body-regular-lineHeight);letter-spacing:var(--typography-body-regular-letterSpacing)}:host([variant=small]) p{font-size:var(--typography-body-small-fontSize);font-weight:var(--typography-body-small-fontWeight);line-height:var(--typography-body-small-lineHeight);letter-spacing:var(--typography-body-small-letterSpacing)}:host([variant=xsmall]) p{font-size:var(--typography-body-xsmall-fontSize);font-weight:var(--typography-body-small-fontWeight);line-height:var(--typography-body-small-lineHeight);letter-spacing:var(--typography-body-small-letterSpacing)}:host([variant=lead]) p{font-size:var(--typography-body-lead-fontSize);font-weight:var(--typography-body-lead-fontWeight);line-height:var(--typography-body-lead-lineHeight);letter-spacing:var(--typography-body-lead-letterSpacing)}:host([variant=eyebrow]) p{font-size:var(--typography-label-large-fontSize);font-weight:var(--typography-label-large-fontWeight);line-height:var(--typography-label-large-lineHeight);letter-spacing:var(--typography-label-large-letterSpacing);font-family:var(--typography-label-large-fontFamily);color:var(--color-text-brand)}@media (width<992px){:host([variant=eyebrow]) p{font-size:var(--typography-label-default-fontSize);font-weight:var(--typography-label-default-fontWeight);line-height:var(--typography-label-default-lineHeight);letter-spacing:var(--typography-label-default-letterSpacing)}}`;export{t as default};
|
|
102
2
|
//# sourceMappingURL=paragraph.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.css.js","
|
|
1
|
+
{"version":3,"file":"paragraph.css.js","names":["paragraph_css_default"],"sources":["../../../../src/components/paragraph/paragraph.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { below } from \"#shared/token-scales.ts\";\n\nexport default css`\n /* --color-text-primary, not --color-neutral-1000. Body copy was set in pure\n black while bd-display used neutral-900 and bd-li neutral-700, so a\n heading, its paragraph and its list rendered in three different inks. The\n line below the font-family used to carry the intended value as\n a // prefix, which CSS does not treat as a comment — the parser dropped\n it, and the pure black above won by default. */\n :host {\n display: block;\n color: var(--bd-paragraph-color, var(--color-text-primary));\n }\n\n p {\n all: unset;\n display: block;\n font-family: var(--typography-body-regular-fontFamily);\n /* The flow margin between consecutive paragraphs, and the switch to turn\n it off: --bd-paragraph-margin-bottom: 0 on the host or any ancestor.\n It inherits into this shadow root, which the margin itself never did --\n the <p> is unreachable from outside, so a paragraph that ends a card or\n a column carried 16px nobody could remove, and the header cancelled it\n three times with a negative margin.\n\n It was a no-op until 0.26.0: it read --spacing-md, which no longer\n existed, so every page built on 0.25 was laid out with zero here. The\n rename to --spacing-16 made it live, which is how the step cards on\n security-for-creators gained 16px under each description. */\n margin-bottom: var(--bd-paragraph-margin-bottom, var(--spacing-16));\n }\n\n /* === Font Size Variants === */\n :host([variant=\"large\"]) p {\n font-size: var(--typography-body-large-fontSize);\n font-weight: var(--typography-body-large-fontWeight);\n line-height: var(--typography-body-large-lineHeight);\n letter-spacing: var(--typography-body-large-letterSpacing);\n }\n\n :host([variant=\"regular\"]) p {\n font-size: var(--typography-body-regular-fontSize);\n font-weight: var(--typography-body-regular-fontWeight);\n line-height: var(--typography-body-regular-lineHeight);\n letter-spacing: var(--typography-body-regular-letterSpacing);\n }\n\n :host([variant=\"small\"]) p {\n font-size: var(--typography-body-small-fontSize);\n font-weight: var(--typography-body-small-fontWeight);\n line-height: var(--typography-body-small-lineHeight);\n letter-spacing: var(--typography-body-small-letterSpacing);\n }\n :host([variant=\"xsmall\"]) p {\n font-size: var(--typography-body-xsmall-fontSize);\n font-weight: var(--typography-body-small-fontWeight);\n line-height: var(--typography-body-small-lineHeight);\n letter-spacing: var(--typography-body-small-letterSpacing);\n }\n :host([variant=\"lead\"]) p {\n font-size: var(--typography-body-lead-fontSize);\n font-weight: var(--typography-body-lead-fontWeight);\n line-height: var(--typography-body-lead-lineHeight);\n letter-spacing: var(--typography-body-lead-letterSpacing);\n }\n\n /* The eyebrow: a short label above a section title. It takes the\n label-large role -- the role whose job is a short label rather than\n running text -- which is 16px at 1.5 like body-regular and Medium 500\n where body-regular is 400. Brand ink is part of the pattern: all five\n eyebrows in the package and every one on the homepage are text-brand.\n A color attribute still wins, for an eyebrow on a dark band. */\n :host([variant=\"eyebrow\"]) p {\n font-size: var(--typography-label-large-fontSize);\n font-weight: var(--typography-label-large-fontWeight);\n line-height: var(--typography-label-large-lineHeight);\n letter-spacing: var(--typography-label-large-letterSpacing);\n font-family: var(--typography-label-large-fontFamily);\n color: var(--color-text-brand);\n }\n\n /* Below lg the eyebrow steps down to label-default: 14px, the same Medium\n 500 at 1.5. The homepage draws it 14 on the 390 and 768 frames and 16 on\n desktop, so the step sits at lg, which is also where every fluid role in\n the system stops growing. A step between two declared roles rather than a\n fluid size, because the label family has no fluid role, and one for a\n single variant would be a new token where two existing roles already\n answer both ends exactly. */\n @media ${unsafeCSS(below(\"lg\"))} {\n :host([variant=\"eyebrow\"]) p {\n font-size: var(--typography-label-default-fontSize);\n font-weight: var(--typography-label-default-fontWeight);\n line-height: var(--typography-label-default-lineHeight);\n letter-spacing: var(--typography-label-default-letterSpacing);\n }\n }\n\n\n \n\n`;"],"mappings":"A,4DAGA,IAAAA,EAAe,CAAG,o9D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
-
import "../../tokens/tokens.
|
|
3
|
-
import { type SpacingStep, type FontFamilyStep, type FontWeightStep, type FontSizeStep, type LetterSpacingStep, type ColorRole } from "../shared/token-scales.
|
|
2
|
+
import "../../tokens/tokens.js";
|
|
3
|
+
import { type SpacingStep, type FontFamilyStep, type FontWeightStep, type FontSizeStep, type LetterSpacingStep, type ColorRole } from "../shared/token-scales.js";
|
|
4
4
|
/**
|
|
5
5
|
* The five body roles the stylesheet carries, and the eyebrow.
|
|
6
6
|
*
|
|
@@ -1,122 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, html } from "lit";
|
|
8
|
-
import { property } from "lit/decorators.js";
|
|
9
|
-
import { defineElement } from "../shared/define-element.js";
|
|
10
|
-
import { isOneOf } from "../shared/prop-vocabulary.js";
|
|
11
|
-
// Installs the design tokens into document scope; see src/tokens/tokens.ts
|
|
12
|
-
import "../../tokens/tokens.js";
|
|
13
|
-
import { spacing, spacingShorthand, fontFamily, fontWeight, fontSize, letterSpacing, color } from "../shared/token-scales.js";
|
|
14
|
-
import paragraphCSS from "./paragraph.css.js";
|
|
15
|
-
/**
|
|
16
|
-
* The five body roles the stylesheet carries, and the eyebrow.
|
|
17
|
-
*
|
|
18
|
-
* eyebrow is the short brand-ink label above a section title. It reads the
|
|
19
|
-
* label-large role -- 16px, Medium 500, 1.5 -- from lg up, and label-default
|
|
20
|
-
* (14px, the same weight and leading) below lg, rather than a role of its
|
|
21
|
-
* own, so it adds no token. It exists because five components drew the pattern
|
|
22
|
-
* and disagreed on weight: bento-grid and header-code at the body role's 400,
|
|
23
|
-
* trust-panel twice and agent-endpoints at a semibold 600 passed through
|
|
24
|
-
* font-weight, and the homepage design at 500. The phase-1 eyebrow
|
|
25
|
-
* investigation found no role was needed while every eyebrow resolved
|
|
26
|
-
* through body-regular; once three of them reached past it for a weight, one
|
|
27
|
-
* spelling became the thing that keeps them together.
|
|
28
|
-
*/
|
|
29
|
-
const VARIANTS = ["xsmall", "small", "regular", "large", "lead", "eyebrow"];
|
|
30
|
-
let BdP = class BdP extends LitElement {
|
|
31
|
-
constructor() {
|
|
32
|
-
super(...arguments);
|
|
33
|
-
this.variant = "regular";
|
|
34
|
-
/** @deprecated pass `variant`. */
|
|
35
|
-
this.kind = "";
|
|
36
|
-
this.padding = "";
|
|
37
|
-
this.paddingBottom = "";
|
|
38
|
-
this.paddingTop = "";
|
|
39
|
-
this.fontFamily = "";
|
|
40
|
-
this.fontWeight = "";
|
|
41
|
-
this.fontSize = "";
|
|
42
|
-
this.letterSpacing = "";
|
|
43
|
-
/* A semantic role, the same closed set bd-h and bd-display take. Without
|
|
44
|
-
it a paragraph's ink could only come from the composing component's
|
|
45
|
-
CSS, so a page could not say an eyebrow is brand-blue or a lead on a
|
|
46
|
-
brand band is white. */
|
|
47
|
-
this.color = "";
|
|
48
|
-
}
|
|
49
|
-
willUpdate(changed) {
|
|
50
|
-
if (changed.has("kind") && this.kind)
|
|
51
|
-
this.variant = this.kind;
|
|
52
|
-
if (changed.has("variant") || changed.has("kind")) {
|
|
53
|
-
if (!isOneOf(VARIANTS, this.variant))
|
|
54
|
-
this.variant = "regular";
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
// Step names, resolved to token references by shared/token-scales.ts. The
|
|
59
|
-
// three spacing props took raw CSS lengths before, which is the one thing
|
|
60
|
-
// the foundation rule forbids.
|
|
61
|
-
//
|
|
62
|
-
// fontFamily and fontWeight were declared here and in the manifest and
|
|
63
|
-
// then never applied — every value passed to them was silently dropped,
|
|
64
|
-
// so bd-terminal-message asked four paragraphs for mono and got sans.
|
|
65
|
-
// They resolve through the same closed sets as everything else, so
|
|
66
|
-
// font-family takes "sans" or "mono" rather than a CSS font stack.
|
|
67
|
-
//
|
|
68
|
-
// fontSize, letterSpacing and color arrived from main as raw CSS; they take
|
|
69
|
-
// a font-size step, a letter-spacing step and a COLOR_ROLES name.
|
|
70
|
-
const styles = [
|
|
71
|
-
["padding", spacingShorthand(this.padding)],
|
|
72
|
-
["padding-bottom", spacing(this.paddingBottom)],
|
|
73
|
-
["padding-top", spacing(this.paddingTop)],
|
|
74
|
-
["font-family", fontFamily(this.fontFamily)],
|
|
75
|
-
["font-weight", fontWeight(this.fontWeight)],
|
|
76
|
-
["font-size", fontSize(this.fontSize)],
|
|
77
|
-
["letter-spacing", letterSpacing(this.letterSpacing)],
|
|
78
|
-
["color", color(this.color)]
|
|
79
|
-
].filter(([, v]) => v).map(([prop, v]) => `${prop}: ${v};`);
|
|
80
|
-
return html `
|
|
81
|
-
<p class="bd-paragraph" style="${styles.join(' ')}">
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{color as t,fontFamily as n,fontSize as r,fontWeight as i,letterSpacing as a,spacing as o,spacingShorthand as s}from"../shared/token-scales.js";import c from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{isOneOf as l}from"../shared/prop-vocabulary.js";import u from"./paragraph.css.js";import{LitElement as d,html as f}from"lit";import{property as p}from"lit/decorators.js";var m=[`xsmall`,`small`,`regular`,`large`,`lead`,`eyebrow`],h=class extends d{constructor(...e){super(...e),this.variant=`regular`,this.kind=``,this.padding=``,this.paddingBottom=``,this.paddingTop=``,this.fontFamily=``,this.fontWeight=``,this.fontSize=``,this.letterSpacing=``,this.color=``}willUpdate(e){e.has(`kind`)&&this.kind&&(this.variant=this.kind),(e.has(`variant`)||e.has(`kind`))&&(l(m,this.variant)||(this.variant=`regular`))}render(){let e=[[`padding`,s(this.padding)],[`padding-bottom`,o(this.paddingBottom)],[`padding-top`,o(this.paddingTop)],[`font-family`,n(this.fontFamily)],[`font-weight`,i(this.fontWeight)],[`font-size`,r(this.fontSize)],[`letter-spacing`,a(this.letterSpacing)],[`color`,t(this.color)]].filter(([,e])=>e).map(([e,t])=>`${e}: ${t};`);return f`
|
|
2
|
+
<p class="bd-paragraph" style="${e.join(` `)}">
|
|
82
3
|
<slot></slot>
|
|
83
4
|
</p>
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
static { this.styles = [paragraphCSS]; }
|
|
87
|
-
};
|
|
88
|
-
__decorate([
|
|
89
|
-
property({ type: String, reflect: true })
|
|
90
|
-
], BdP.prototype, "variant", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
property({ type: String })
|
|
93
|
-
], BdP.prototype, "kind", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
property({ type: String })
|
|
96
|
-
], BdP.prototype, "padding", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
property({ type: String })
|
|
99
|
-
], BdP.prototype, "paddingBottom", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
property({ type: String })
|
|
102
|
-
], BdP.prototype, "paddingTop", void 0);
|
|
103
|
-
__decorate([
|
|
104
|
-
property({ type: String, attribute: "font-family" })
|
|
105
|
-
], BdP.prototype, "fontFamily", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
property({ type: String, attribute: "font-weight" })
|
|
108
|
-
], BdP.prototype, "fontWeight", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
property({ type: String, attribute: "font-size" })
|
|
111
|
-
], BdP.prototype, "fontSize", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
property({ type: String, attribute: "letter-spacing" })
|
|
114
|
-
], BdP.prototype, "letterSpacing", void 0);
|
|
115
|
-
__decorate([
|
|
116
|
-
property({ type: String })
|
|
117
|
-
], BdP.prototype, "color", void 0);
|
|
118
|
-
BdP = __decorate([
|
|
119
|
-
defineElement("bd-p")
|
|
120
|
-
], BdP);
|
|
121
|
-
export { BdP };
|
|
5
|
+
`}static{this.styles=[u]}};c([p({type:String,reflect:!0})],h.prototype,`variant`,void 0),c([p({type:String})],h.prototype,`kind`,void 0),c([p({type:String})],h.prototype,`padding`,void 0),c([p({type:String})],h.prototype,`paddingBottom`,void 0),c([p({type:String})],h.prototype,`paddingTop`,void 0),c([p({type:String,attribute:`font-family`})],h.prototype,`fontFamily`,void 0),c([p({type:String,attribute:`font-weight`})],h.prototype,`fontWeight`,void 0),c([p({type:String,attribute:`font-size`})],h.prototype,`fontSize`,void 0),c([p({type:String,attribute:`letter-spacing`})],h.prototype,`letterSpacing`,void 0),c([p({type:String})],h.prototype,`color`,void 0),h=c([e(`bd-p`)],h);export{h as BdP};
|
|
122
6
|
//# sourceMappingURL=paragraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.js","
|
|
1
|
+
{"version":3,"file":"paragraph.js","names":["paragraphCSS","_decorate","__decorate","paragraph_css_default","VARIANTS","BdP","LitElement","_args","changed","isOneOf","styles","spacingShorthand","spacing","fontFamily","fontWeight","fontSize","letterSpacing","color","v","prop","property","defineElement"],"sources":["../../../../src/components/paragraph/paragraph.ts"],"sourcesContent":["import { LitElement, html, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { isOneOf } from \"#shared/prop-vocabulary.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport {\n spacing, spacingShorthand, fontFamily, fontWeight, fontSize, letterSpacing, color,\n type SpacingStep, type FontFamilyStep, type FontWeightStep, type FontSizeStep,\n type LetterSpacingStep, type ColorRole\n} from \"#shared/token-scales.ts\";\nimport paragraphCSS from \"./paragraph.css.ts\";\n\n/**\n * The five body roles the stylesheet carries, and the eyebrow.\n *\n * eyebrow is the short brand-ink label above a section title. It reads the\n * label-large role -- 16px, Medium 500, 1.5 -- from lg up, and label-default\n * (14px, the same weight and leading) below lg, rather than a role of its\n * own, so it adds no token. It exists because five components drew the pattern\n * and disagreed on weight: bento-grid and header-code at the body role's 400,\n * trust-panel twice and agent-endpoints at a semibold 600 passed through\n * font-weight, and the homepage design at 500. The phase-1 eyebrow\n * investigation found no role was needed while every eyebrow resolved\n * through body-regular; once three of them reached past it for a weight, one\n * spelling became the thing that keeps them together.\n */\nconst VARIANTS = [\"xsmall\", \"small\", \"regular\", \"large\", \"lead\", \"eyebrow\"] as const;\ntype Variant = typeof VARIANTS[number];\n\n@defineElement(\"bd-p\")\nexport class BdP extends LitElement {\n @property({ type: String, reflect: true })\n variant: Variant = \"regular\";\n /** @deprecated pass `variant`. */\n @property({ type: String })\n kind: Variant | \"\" = \"\";\n @property({ type: String })\n padding = \"\";\n @property({ type: String })\n paddingBottom: SpacingStep | \"\" = \"\";\n @property({ type: String })\n paddingTop: SpacingStep | \"\" = \"\";\n @property({ type: String, attribute: \"font-family\" })\n fontFamily: FontFamilyStep | \"\" = \"\";\n @property({ type: String, attribute: \"font-weight\" })\n fontWeight: FontWeightStep | \"\" = \"\";\n @property({ type: String, attribute: \"font-size\" })\n fontSize: FontSizeStep | \"\" = \"\";\n @property({ type: String, attribute: \"letter-spacing\" })\n letterSpacing: LetterSpacingStep | \"\" = \"\";\n /* A semantic role, the same closed set bd-h and bd-display take. Without\n it a paragraph's ink could only come from the composing component's\n CSS, so a page could not say an eyebrow is brand-blue or a lead on a\n brand band is white. */\n @property({ type: String })\n color: ColorRole | \"\" = \"\";\n\n willUpdate(changed: PropertyValues<this>) {\n if (changed.has(\"kind\") && this.kind) this.variant = this.kind;\n if (changed.has(\"variant\") || changed.has(\"kind\")) {\n if (!isOneOf(VARIANTS, this.variant)) this.variant = \"regular\";\n }\n }\n\n render() {\n // Step names, resolved to token references by shared/token-scales.ts. The\n // three spacing props took raw CSS lengths before, which is the one thing\n // the foundation rule forbids.\n //\n // fontFamily and fontWeight were declared here and in the manifest and\n // then never applied — every value passed to them was silently dropped,\n // so bd-terminal-message asked four paragraphs for mono and got sans.\n // They resolve through the same closed sets as everything else, so\n // font-family takes \"sans\" or \"mono\" rather than a CSS font stack.\n //\n // fontSize, letterSpacing and color arrived from main as raw CSS; they take\n // a font-size step, a letter-spacing step and a COLOR_ROLES name.\n const styles = [\n [\"padding\", spacingShorthand(this.padding)],\n [\"padding-bottom\", spacing(this.paddingBottom)],\n [\"padding-top\", spacing(this.paddingTop)],\n [\"font-family\", fontFamily(this.fontFamily)],\n [\"font-weight\", fontWeight(this.fontWeight)],\n [\"font-size\", fontSize(this.fontSize)],\n [\"letter-spacing\", letterSpacing(this.letterSpacing)],\n [\"color\", color(this.color)]\n ].filter(([, v]) => v).map(([prop, v]) => `${prop}: ${v};`);\n\n return html`\n <p class=\"bd-paragraph\" style=\"${styles.join(' ')}\">\n <slot></slot>\n </p>\n `;\n }\n\n static styles = [paragraphCSS];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-p\": BdP;\n }\n}"],"mappings":"A,4eA2BA,IAAMI,EAAW,CAAC,SAAU,QAAS,UAAW,QAAS,OAAQ,SAAS,EAI7DC,EAAN,cAAkBC,CAAW,C,8BAEf,KAAA,QAAA,UAGE,KAAA,KAAA,GAEX,KAAA,QAAA,GAEwB,KAAA,cAAA,GAEH,KAAA,WAAA,GAEG,KAAA,WAAA,GAEA,KAAA,WAAA,GAEJ,KAAA,SAAA,GAEU,KAAA,cAAA,GAMhB,KAAA,MAAA,E,CAExB,WAAW,EAA+B,CACpCE,EAAQ,IAAI,MAAM,GAAK,KAAK,OAAM,KAAK,QAAU,KAAK,OACtDA,EAAQ,IAAI,SAAS,GAAKA,EAAQ,IAAI,MAAM,KACzCC,EAAQL,EAAU,KAAK,OAAO,IAAG,KAAK,QAAU,WAEzD,CAEA,QAAS,CAaP,IAAMM,EAAS,CACb,CAAC,UAAkBC,EAAiB,KAAK,OAAO,CAAC,EACjD,CAAC,iBAAkBC,EAAQ,KAAK,aAAa,CAAC,EAC9C,CAAC,cAAkBA,EAAQ,KAAK,UAAU,CAAC,EAC3C,CAAC,cAAkBC,EAAW,KAAK,UAAU,CAAC,EAC9C,CAAC,cAAkBC,EAAW,KAAK,UAAU,CAAC,EAC9C,CAAC,YAAkBC,EAAS,KAAK,QAAQ,CAAC,EAC1C,CAAC,iBAAkBC,EAAc,KAAK,aAAa,CAAC,EACpD,CAAC,QAAkBC,EAAM,KAAK,KAAK,CAAC,CACtC,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