@repobit/dex-system-design 3.0.1 → 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 +7 -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 +3 -3
- package/dist/src/components/logo-marquee/logo-marquee.js +6 -147
- 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,37 +1,6 @@
|
|
|
1
|
-
|
|
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 } from "lit";
|
|
8
|
-
import { property, state } from "lit/decorators.js";
|
|
9
|
-
import { defineElement } from "../shared/define-element.js";
|
|
10
|
-
// Installs the design tokens into document scope; see src/tokens/tokens.ts
|
|
11
|
-
import "../../tokens/tokens.js";
|
|
12
|
-
import carouselCSS from "../carousel/carousel.css.js";
|
|
13
|
-
import "../heading/heading.js";
|
|
14
|
-
import "../icons/plus-icon.js";
|
|
15
|
-
import "../modal/modal.js";
|
|
16
|
-
import "../pagination-dots/pagination-dots.js";
|
|
17
|
-
let CarouselItem = class CarouselItem extends LitElement {
|
|
18
|
-
_openModal() {
|
|
19
|
-
this.dispatchEvent(new CustomEvent("open-modal", {
|
|
20
|
-
detail: {
|
|
21
|
-
title: this.title,
|
|
22
|
-
modalText: this.modalText,
|
|
23
|
-
icon: this.icon
|
|
24
|
-
},
|
|
25
|
-
bubbles: true,
|
|
26
|
-
composed: true
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
render() {
|
|
30
|
-
return html `
|
|
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"../heading/heading.js";import"../icons/plus-icon.js";import"../pagination-dots/pagination-dots.js";import n from"./carousel.css.js";import"../modal/modal.js";import{LitElement as r,html as i}from"lit";import{property as a,state as o}from"lit/decorators.js";var s=class extends r{_openModal(){this.dispatchEvent(new CustomEvent(`open-modal`,{detail:{title:this.title,modalText:this.modalText,icon:this.icon},bubbles:!0,composed:!0}))}render(){return i`
|
|
31
2
|
<div class="bd-box">
|
|
32
|
-
${this.icon
|
|
33
|
-
? html `<img src="${this.icon}" alt="" class="bd-carousel-icon" />`
|
|
34
|
-
: ""}
|
|
3
|
+
${this.icon?i`<img src="${this.icon}" alt="" class="bd-carousel-icon" />`:``}
|
|
35
4
|
<div class="bd-content">
|
|
36
5
|
<slot></slot>
|
|
37
6
|
</div>
|
|
@@ -44,245 +13,13 @@ let CarouselItem = class CarouselItem extends LitElement {
|
|
|
44
13
|
<bd-plus-icon size="md"></bd-plus-icon>
|
|
45
14
|
</button>
|
|
46
15
|
</div>
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
static { this.styles = [carouselCSS]; }
|
|
50
|
-
};
|
|
51
|
-
__decorate([
|
|
52
|
-
property({ type: String })
|
|
53
|
-
], CarouselItem.prototype, "icon", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
property({ type: String })
|
|
56
|
-
], CarouselItem.prototype, "title", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
property({ type: String })
|
|
59
|
-
], CarouselItem.prototype, "modalText", void 0);
|
|
60
|
-
CarouselItem = __decorate([
|
|
61
|
-
defineElement("bd-carousel-item")
|
|
62
|
-
], CarouselItem);
|
|
63
|
-
export { CarouselItem };
|
|
64
|
-
let CustomCarousel = class CustomCarousel extends LitElement {
|
|
65
|
-
constructor() {
|
|
66
|
-
super();
|
|
67
|
-
this.title = "";
|
|
68
|
-
this.headingLevel = 2;
|
|
69
|
-
this.selectedItem = null;
|
|
70
|
-
// scroll stops, 1-based, read from the track; see _measure
|
|
71
|
-
this._pages = 1;
|
|
72
|
-
this._page = 1;
|
|
73
|
-
this._seeking = 0;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* The heading element this section renders. Level is the document-outline
|
|
77
|
-
* question and belongs to whoever composes the page; the type scale is this
|
|
78
|
-
* component's own and does not move with it. Defaults to h2, because a
|
|
79
|
-
* reusable section cannot know it is the only thing on the page, and two of
|
|
80
|
-
* these used to put two h1s on one.
|
|
81
|
-
*/
|
|
82
|
-
get _headingTag() {
|
|
83
|
-
const n = Number(this.headingLevel);
|
|
84
|
-
return Number.isInteger(n) && n >= 1 && n <= 6 ? `h${n}` : "h2";
|
|
85
|
-
}
|
|
86
|
-
/* bd-h already builds the dynamic tag, and it keeps the two questions apart
|
|
87
|
-
the way this component needs: as= is the outline level the page composes,
|
|
88
|
-
visual-level= is the type role, which is ours. Building the element here
|
|
89
|
-
meant re-implementing bd-h and then hand-writing the type on top of it --
|
|
90
|
-
and the hand-written type carried no line-height and no margin, so the
|
|
91
|
-
title rendered with the browser's own h2 margins. */
|
|
92
|
-
_renderTitle(className) {
|
|
93
|
-
return html `<bd-h as=${this._headingTag} visual-level="h3" class=${className}
|
|
16
|
+
`}static{this.styles=[n]}};t([a({type:String})],s.prototype,`icon`,void 0),t([a({type:String})],s.prototype,`title`,void 0),t([a({type:String})],s.prototype,`modalText`,void 0),s=t([e(`bd-carousel-item`)],s);var c=class extends r{constructor(){super(),this.title=``,this.headingLevel=2,this.selectedItem=null,this._pages=1,this._page=1,this._seeking=0}get _headingTag(){let e=Number(this.headingLevel);return Number.isInteger(e)&&e>=1&&e<=6?`h${e}`:`h2`}_renderTitle(e){return i`<bd-h as=${this._headingTag} visual-level="h3" class=${e}
|
|
94
17
|
>${this.title}</bd-h
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
firstUpdated() {
|
|
98
|
-
this.track = this.shadowRoot.querySelector(".bd-carousel-track");
|
|
99
|
-
this.slotElement = this.shadowRoot.querySelector("slot");
|
|
100
|
-
this.track.addEventListener("scroll", () => this._measure(), { passive: true });
|
|
101
|
-
this.track.addEventListener("scrollend", () => { this._seeking = 0; this._measure(); });
|
|
102
|
-
// a visitor taking hold of the track ends any scroll a control started
|
|
103
|
-
for (const type of ["pointerdown", "touchstart", "wheel", "keydown"]) {
|
|
104
|
-
this.track.addEventListener(type, () => { this._seeking = 0; }, { passive: true });
|
|
105
|
-
}
|
|
106
|
-
this.slotElement.addEventListener("slotchange", () => {
|
|
107
|
-
this.waitForImagesToLoad().then(() => this._measure());
|
|
108
|
-
});
|
|
109
|
-
this._resizeObserver = new ResizeObserver(() => this._measure());
|
|
110
|
-
this._resizeObserver.observe(this.track);
|
|
111
|
-
this.waitForImagesToLoad().then(() => this._measure());
|
|
112
|
-
this.addEventListener("open-modal", (e) => {
|
|
113
|
-
this.openModal(e.detail);
|
|
114
|
-
});
|
|
115
|
-
this._enableMouseDrag(this.track);
|
|
116
|
-
}
|
|
117
|
-
disconnectedCallback() {
|
|
118
|
-
super.disconnectedCallback();
|
|
119
|
-
this._resizeObserver?.disconnect();
|
|
120
|
-
}
|
|
121
|
-
waitForImagesToLoad() {
|
|
122
|
-
const assignedElements = this.slotElement.assignedElements({
|
|
123
|
-
flatten: true
|
|
124
|
-
});
|
|
125
|
-
const images = assignedElements
|
|
126
|
-
.map((el) => el.shadowRoot?.querySelector("img"))
|
|
127
|
-
.filter((img) => img != null);
|
|
128
|
-
const promises = images.map((img) => new Promise((resolve) => {
|
|
129
|
-
if (img.complete)
|
|
130
|
-
resolve();
|
|
131
|
-
else {
|
|
132
|
-
img.addEventListener("load", resolve, { once: true });
|
|
133
|
-
img.addEventListener("error", resolve, { once: true });
|
|
134
|
-
}
|
|
135
|
-
}));
|
|
136
|
-
return Promise.all(promises);
|
|
137
|
-
}
|
|
138
|
-
/* The distance from one item to the next: an item's width and the gap. A
|
|
139
|
-
scroll stop is one of these, and the controls count stops, not items --
|
|
140
|
-
the last stop is wherever the track ends, which is short of a full step
|
|
141
|
-
when the items do not divide the width evenly. */
|
|
142
|
-
_step() {
|
|
143
|
-
const first = this.slotElement?.assignedElements({ flatten: true })[0];
|
|
144
|
-
if (!first)
|
|
145
|
-
return 0;
|
|
146
|
-
const gap = parseFloat(getComputedStyle(this.track).columnGap) || 0;
|
|
147
|
-
return first.offsetWidth + gap;
|
|
148
|
-
}
|
|
149
|
-
/* How many stops the track has and which one it is at, from where it has
|
|
150
|
-
scrolled to -- by a control, a drag, a wheel or a keyboard. While a
|
|
151
|
-
control's smooth scroll is on its way, the dot it asked for stays current
|
|
152
|
-
rather than stepping through every stop it passes. */
|
|
153
|
-
_measure() {
|
|
154
|
-
if (!this.track)
|
|
155
|
-
return;
|
|
156
|
-
const max = this.track.scrollWidth - this.track.clientWidth;
|
|
157
|
-
const step = this._step();
|
|
158
|
-
if (max <= 1 || step <= 0) {
|
|
159
|
-
this._pages = 1;
|
|
160
|
-
this._page = 1;
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
this._pages = Math.ceil((max - 1) / step) + 1;
|
|
164
|
-
const left = this._travelled;
|
|
165
|
-
const page = left >= max - 1 ? this._pages : Math.min(this._pages, Math.round(left / step) + 1);
|
|
166
|
-
if (this._seeking && page !== this._seeking)
|
|
167
|
-
return;
|
|
168
|
-
this._seeking = 0;
|
|
169
|
-
this._page = page;
|
|
170
|
-
}
|
|
171
|
-
/* Where stop n sits, as a distance from the track's start: a whole step per
|
|
172
|
-
stop, and the last at the track's end. */
|
|
173
|
-
_stop(n) {
|
|
174
|
-
const max = this.track.scrollWidth - this.track.clientWidth;
|
|
175
|
-
return Math.min((n - 1) * this._step(), max);
|
|
176
|
-
}
|
|
177
|
-
/* How far the track has scrolled from its start. On a right-to-left page
|
|
178
|
-
the start is the right edge and scrollLeft runs from 0 down to minus the
|
|
179
|
-
overflow, so the distance is its size and a position written back takes
|
|
180
|
-
its sign; read as a plain number, every stop past the first sat at a
|
|
181
|
-
scrollLeft the track can never reach, and scrolling to one clamped to the
|
|
182
|
-
start. */
|
|
183
|
-
get _travelled() {
|
|
184
|
-
return Math.abs(this.track.scrollLeft);
|
|
185
|
-
}
|
|
186
|
-
_scrollToStop(n) {
|
|
187
|
-
const sign = getComputedStyle(this.track).direction === "rtl" ? -1 : 1;
|
|
188
|
-
this.track.scrollTo({ left: sign * this._stop(n) });
|
|
189
|
-
}
|
|
190
|
-
/* Smooth or instant is the track's scroll-behavior, which follows
|
|
191
|
-
prefers-reduced-motion; see carousel.css.ts. */
|
|
192
|
-
_goToPage(n) {
|
|
193
|
-
this._seeking = n;
|
|
194
|
-
this._page = n;
|
|
195
|
-
this._scrollToStop(n);
|
|
196
|
-
}
|
|
197
|
-
openModal(item) {
|
|
198
|
-
this.selectedItem = item;
|
|
199
|
-
this._shownItem = item;
|
|
200
|
-
}
|
|
201
|
-
closeModal() {
|
|
202
|
-
this.selectedItem = null;
|
|
203
|
-
}
|
|
204
|
-
/* Mouse drag, the one way of moving the track the browser does not give it:
|
|
205
|
-
wheel, trackpad, touch, pen and the keyboard all scroll it natively. The
|
|
206
|
-
docs promise click-and-drag, so it stays, as a thin layer over the
|
|
207
|
-
scroller -- a mouse press only, one pixel of track per pixel of pointer
|
|
208
|
-
(it was 1.5), and no snapping while the button is down, or every write to
|
|
209
|
-
scrollLeft would land on a stop. On release it settles on the nearest one.
|
|
210
|
-
|
|
211
|
-
This used to be mousedown and touchmove handlers writing scrollLeft over
|
|
212
|
-
a track that was overflow: hidden, which left the wheel, the trackpad and
|
|
213
|
-
the keyboard with nothing to move, and drove touch by script. */
|
|
214
|
-
_enableMouseDrag(track) {
|
|
215
|
-
let press = null;
|
|
216
|
-
let swallowClick = false;
|
|
217
|
-
track.addEventListener("pointerdown", (e) => {
|
|
218
|
-
if (e.pointerType !== "mouse" || e.button !== 0)
|
|
219
|
-
return;
|
|
220
|
-
press = { id: e.pointerId, x: e.clientX, left: track.scrollLeft, dragging: false };
|
|
221
|
-
});
|
|
222
|
-
track.addEventListener("pointermove", (e) => {
|
|
223
|
-
if (press?.id !== e.pointerId)
|
|
224
|
-
return;
|
|
225
|
-
// the button came up off the track before the press became a drag
|
|
226
|
-
if (!(e.buttons & 1)) {
|
|
227
|
-
press = null;
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
const dx = e.clientX - press.x;
|
|
231
|
-
if (!press.dragging) {
|
|
232
|
-
// a few pixels of travel first, so a click on + stays a click
|
|
233
|
-
if (Math.abs(dx) < 4)
|
|
234
|
-
return;
|
|
235
|
-
press.dragging = true;
|
|
236
|
-
track.setPointerCapture(e.pointerId);
|
|
237
|
-
track.classList.add("dragging");
|
|
238
|
-
}
|
|
239
|
-
track.scrollLeft = press.left - dx;
|
|
240
|
-
});
|
|
241
|
-
const release = () => {
|
|
242
|
-
const dragged = press?.dragging;
|
|
243
|
-
press = null;
|
|
244
|
-
if (!dragged)
|
|
245
|
-
return;
|
|
246
|
-
track.classList.remove("dragging");
|
|
247
|
-
this._settle();
|
|
248
|
-
// the click a drag ends with is not a click on the + or link under it;
|
|
249
|
-
// it comes in the same task as the pointerup, if it comes at all
|
|
250
|
-
swallowClick = true;
|
|
251
|
-
setTimeout(() => { swallowClick = false; });
|
|
252
|
-
};
|
|
253
|
-
for (const type of ["pointerup", "pointercancel", "lostpointercapture"]) {
|
|
254
|
-
track.addEventListener(type, release);
|
|
255
|
-
}
|
|
256
|
-
track.addEventListener("click", (e) => {
|
|
257
|
-
if (!swallowClick)
|
|
258
|
-
return;
|
|
259
|
-
e.preventDefault();
|
|
260
|
-
e.stopPropagation();
|
|
261
|
-
}, { capture: true });
|
|
262
|
-
// a press is for moving the track, not for selecting copy or dragging an icon out
|
|
263
|
-
for (const type of ["selectstart", "dragstart"]) {
|
|
264
|
-
track.addEventListener(type, (e) => { if (press)
|
|
265
|
-
e.preventDefault(); });
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
/* Where a drag leaves the track, the snap would take it: the nearest stop. */
|
|
269
|
-
_settle() {
|
|
270
|
-
const left = this._travelled;
|
|
271
|
-
let nearest = 1;
|
|
272
|
-
for (let n = 2; n <= this._pages; n++) {
|
|
273
|
-
if (Math.abs(this._stop(n) - left) < Math.abs(this._stop(nearest) - left))
|
|
274
|
-
nearest = n;
|
|
275
|
-
}
|
|
276
|
-
this._scrollToStop(nearest);
|
|
277
|
-
}
|
|
278
|
-
render() {
|
|
279
|
-
return html `
|
|
18
|
+
>`}firstUpdated(){this.track=this.shadowRoot.querySelector(`.bd-carousel-track`),this.slotElement=this.shadowRoot.querySelector(`slot`),this.track.addEventListener(`scroll`,()=>this._measure(),{passive:!0}),this.track.addEventListener(`scrollend`,()=>{this._seeking=0,this._measure()});for(let e of[`pointerdown`,`touchstart`,`wheel`,`keydown`])this.track.addEventListener(e,()=>{this._seeking=0},{passive:!0});this.slotElement.addEventListener(`slotchange`,()=>{this.waitForImagesToLoad().then(()=>this._measure())}),this._resizeObserver=new ResizeObserver(()=>this._measure()),this._resizeObserver.observe(this.track),this.waitForImagesToLoad().then(()=>this._measure()),this.addEventListener(`open-modal`,e=>{this.openModal(e.detail)}),this._enableMouseDrag(this.track)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect()}waitForImagesToLoad(){let e=this.slotElement.assignedElements({flatten:!0}).map(e=>e.shadowRoot?.querySelector(`img`)).filter(e=>e!=null).map(e=>new Promise(t=>{e.complete?t():(e.addEventListener(`load`,t,{once:!0}),e.addEventListener(`error`,t,{once:!0}))}));return Promise.all(e)}_step(){let e=this.slotElement?.assignedElements({flatten:!0})[0];if(!e)return 0;let t=parseFloat(getComputedStyle(this.track).columnGap)||0;return e.offsetWidth+t}_measure(){if(!this.track)return;let e=this.track.scrollWidth-this.track.clientWidth,t=this._step();if(e<=1||t<=0){this._pages=1,this._page=1;return}this._pages=Math.ceil((e-1)/t)+1;let n=this._travelled,r=n>=e-1?this._pages:Math.min(this._pages,Math.round(n/t)+1);this._seeking&&r!==this._seeking||(this._seeking=0,this._page=r)}_stop(e){let t=this.track.scrollWidth-this.track.clientWidth;return Math.min((e-1)*this._step(),t)}get _travelled(){return Math.abs(this.track.scrollLeft)}_scrollToStop(e){let t=getComputedStyle(this.track).direction===`rtl`?-1:1;this.track.scrollTo({left:t*this._stop(e)})}_goToPage(e){this._seeking=e,this._page=e,this._scrollToStop(e)}openModal(e){this.selectedItem=e,this._shownItem=e}closeModal(){this.selectedItem=null}_enableMouseDrag(e){let t=null,n=!1;e.addEventListener(`pointerdown`,n=>{n.pointerType===`mouse`&&n.button===0&&(t={id:n.pointerId,x:n.clientX,left:e.scrollLeft,dragging:!1})}),e.addEventListener(`pointermove`,n=>{if(t?.id!==n.pointerId)return;if(!(n.buttons&1)){t=null;return}let r=n.clientX-t.x;if(!t.dragging){if(Math.abs(r)<4)return;t.dragging=!0,e.setPointerCapture(n.pointerId),e.classList.add(`dragging`)}e.scrollLeft=t.left-r});let r=()=>{let r=t?.dragging;t=null,r&&(e.classList.remove(`dragging`),this._settle(),n=!0,setTimeout(()=>{n=!1}))};for(let t of[`pointerup`,`pointercancel`,`lostpointercapture`])e.addEventListener(t,r);e.addEventListener(`click`,e=>{n&&(e.preventDefault(),e.stopPropagation())},{capture:!0});for(let n of[`selectstart`,`dragstart`])e.addEventListener(n,e=>{t&&e.preventDefault()})}_settle(){let e=this._travelled,t=1;for(let n=2;n<=this._pages;n++)Math.abs(this._stop(n)-e)<Math.abs(this._stop(t)-e)&&(t=n);this._scrollToStop(t)}render(){return i`
|
|
280
19
|
<div class="bd-carousel">
|
|
281
|
-
${this.title
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
</div>`
|
|
285
|
-
: ""}
|
|
20
|
+
${this.title?i`<div class="bd-header-carousel">
|
|
21
|
+
${this._renderTitle(`bd-section-title`)}
|
|
22
|
+
</div>`:``}
|
|
286
23
|
|
|
287
24
|
<div class="bd-carousel-track">
|
|
288
25
|
<slot></slot>
|
|
@@ -291,9 +28,9 @@ let CustomCarousel = class CustomCarousel extends LitElement {
|
|
|
291
28
|
<bd-pagination-dots
|
|
292
29
|
count=${this._pages}
|
|
293
30
|
current=${this._page}
|
|
294
|
-
label=${this.title
|
|
31
|
+
label=${this.title||`Slides`}
|
|
295
32
|
item-label="Go to item"
|
|
296
|
-
@bd-change=${
|
|
33
|
+
@bd-change=${e=>this._goToPage(e.detail.current)}
|
|
297
34
|
></bd-pagination-dots>
|
|
298
35
|
</div>
|
|
299
36
|
</div>
|
|
@@ -304,31 +41,10 @@ let CustomCarousel = class CustomCarousel extends LitElement {
|
|
|
304
41
|
while it closes. -->
|
|
305
42
|
<bd-modal
|
|
306
43
|
.open="${!!this.selectedItem}"
|
|
307
|
-
.title="${this._shownItem?.title
|
|
308
|
-
.modalText="${this._shownItem?.modalText
|
|
309
|
-
.icon="${this._shownItem?.icon
|
|
44
|
+
.title="${this._shownItem?.title??``}"
|
|
45
|
+
.modalText="${this._shownItem?.modalText??``}"
|
|
46
|
+
.icon="${this._shownItem?.icon??``}"
|
|
310
47
|
@close-modal="${this.closeModal}"
|
|
311
48
|
></bd-modal>
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
static { this.styles = [carouselCSS]; }
|
|
315
|
-
};
|
|
316
|
-
__decorate([
|
|
317
|
-
property({ type: String })
|
|
318
|
-
], CustomCarousel.prototype, "title", void 0);
|
|
319
|
-
__decorate([
|
|
320
|
-
property({ type: Number, attribute: "heading-level" })
|
|
321
|
-
], CustomCarousel.prototype, "headingLevel", void 0);
|
|
322
|
-
__decorate([
|
|
323
|
-
property({ type: Object })
|
|
324
|
-
], CustomCarousel.prototype, "selectedItem", void 0);
|
|
325
|
-
__decorate([
|
|
326
|
-
state()
|
|
327
|
-
], CustomCarousel.prototype, "_pages", void 0);
|
|
328
|
-
__decorate([
|
|
329
|
-
state()
|
|
330
|
-
], CustomCarousel.prototype, "_page", void 0);
|
|
331
|
-
CustomCarousel = __decorate([
|
|
332
|
-
defineElement("bd-carousel-section")
|
|
333
|
-
], CustomCarousel);
|
|
49
|
+
`}static{this.styles=[n]}};t([a({type:String})],c.prototype,`title`,void 0),t([a({type:Number,attribute:`heading-level`})],c.prototype,`headingLevel`,void 0),t([a({type:Object})],c.prototype,`selectedItem`,void 0),t([o()],c.prototype,`_pages`,void 0),t([o()],c.prototype,`_page`,void 0),c=t([e(`bd-carousel-section`)],c);export{s as CarouselItem};
|
|
334
50
|
//# sourceMappingURL=carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../../src/components/carousel/carousel.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,2EAA2E;AAC3E,OAAO,wBAAwB,CAAC;AAChC,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uCAAuC,CAAC;AASxC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAQ1C,UAAU;QACR,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,YAAY,EAAE;YAC5B,MAAM,EAAE;gBACN,KAAK,EAAM,IAAI,CAAC,KAAK;gBACrB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,IAAI,EAAO,IAAI,CAAC,IAAI;aACrB;YACD,OAAO,EAAG,IAAI;YACd,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,IAAI;YACT,CAAC,CAAC,IAAI,CAAA,aAAa,IAAI,CAAC,IAAI,sCAAsC;YAClE,CAAC,CAAC,EAAE;;;;;;;uCAOyB,IAAI,CAAC,KAAK;oBAC7B,IAAI,CAAC,UAAU;;;;;KAK9B,CAAC;IACJ,CAAC;aAEM,WAAM,GAAG,CAAC,WAAW,CAAC,AAAhB,CAAiB;;AAz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CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,KAAK;YACV,CAAC,CAAC,IAAI,CAAA;gBACA,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC;mBAClC;YACT,CAAC,CAAC,EAAE;;;;;;;oBAOM,IAAI,CAAC,MAAM;sBACT,IAAI,CAAC,KAAK;oBACZ,IAAI,CAAC,KAAK,IAAI,QAAQ;;yBAEjB,CAAC,CAAmC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;iBAUjF,CAAC,CAAC,IAAI,CAAC,YAAY;kBAClB,IAAI,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE;sBACxB,IAAI,CAAC,UAAU,EAAE,SAAS,IAAI,EAAE;iBACrC,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,EAAE;wBACpB,IAAI,CAAC,UAAU;;KAElC,CAAC;IACJ,CAAC;aAEM,WAAM,GAAG,CAAC,WAAW,CAAC,AAAhB,CAAiB;;AApR9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAChB;AAEX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;oDACtC;AAEjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACW;AAGtC;IADC,KAAK,EAAE;8CACG;AAEX;IADC,KAAK,EAAE;6CACE;AAXN,cAAc;IADnB,aAAa,CAAC,qBAAqB,CAAC;GAC/B,cAAc,CAuRnB","sourcesContent":["import { LitElement, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"../shared/define-element.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"../../tokens/tokens.ts\";\nimport carouselCSS from \"../carousel/carousel.css.ts\";\nimport \"../heading/heading.ts\";\nimport \"../icons/plus-icon.ts\";\nimport \"../modal/modal.ts\";\nimport \"../pagination-dots/pagination-dots.ts\";\n\ninterface ModalItem {\n title? : string;\n modalText?: string;\n icon? : string;\n}\n\n@defineElement(\"bd-carousel-item\")\nexport class CarouselItem extends LitElement {\n @property({ type: String })\n icon?: string;\n @property({ type: String })\n title!: string;\n @property({ type: String })\n modalText?: string;\n\n _openModal() {\n this.dispatchEvent(\n new CustomEvent(\"open-modal\", {\n detail: {\n title : this.title,\n modalText: this.modalText,\n icon : this.icon\n },\n bubbles : true,\n composed: true\n })\n );\n }\n\n render() {\n return html`\n <div class=\"bd-box\">\n ${this.icon\n ? html`<img src=\"${this.icon}\" alt=\"\" class=\"bd-carousel-icon\" />`\n : \"\"}\n <div class=\"bd-content\">\n <slot></slot>\n </div>\n <button\n type=\"button\"\n class=\"bd-plus-button\"\n aria-label=\"Open modal for ${this.title}\"\n @click=\"${this._openModal}\"\n >\n <bd-plus-icon size=\"md\"></bd-plus-icon>\n </button>\n </div>\n `;\n }\n\n static styles = [carouselCSS];\n}\n\n@defineElement(\"bd-carousel-section\")\nclass CustomCarousel extends LitElement {\n @property({ type: String })\n title = \"\";\n @property({ type: Number, attribute: \"heading-level\" })\n headingLevel = 2;\n @property({ type: Object })\n selectedItem: ModalItem | null = null;\n // scroll stops, 1-based, read from the track; see _measure\n @state()\n _pages = 1;\n @state()\n _page = 1;\n\n _seeking : number;\n _shownItem? : ModalItem;\n track! : HTMLElement;\n slotElement! : HTMLSlotElement;\n _resizeObserver?: ResizeObserver;\n\n constructor() {\n super();\n this._seeking = 0;\n }\n\n /**\n * The heading element this section renders. Level is the document-outline\n * question and belongs to whoever composes the page; the type scale is this\n * component's own and does not move with it. Defaults to h2, because a\n * reusable section cannot know it is the only thing on the page, and two of\n * these used to put two h1s on one.\n */\n get _headingTag() {\n const n = Number(this.headingLevel);\n return Number.isInteger(n) && n >= 1 && n <= 6 ? `h${n}` : \"h2\";\n }\n\n /* bd-h already builds the dynamic tag, and it keeps the two questions apart\n the way this component needs: as= is the outline level the page composes,\n visual-level= is the type role, which is ours. Building the element here\n meant re-implementing bd-h and then hand-writing the type on top of it --\n and the hand-written type carried no line-height and no margin, so the\n title rendered with the browser's own h2 margins. */\n _renderTitle(className: string) {\n return html`<bd-h as=${this._headingTag} visual-level=\"h3\" class=${className}\n >${this.title}</bd-h\n >`;\n }\n\n firstUpdated() {\n this.track = this.shadowRoot!.querySelector<HTMLElement>(\".bd-carousel-track\")!;\n this.slotElement = this.shadowRoot!.querySelector(\"slot\")!;\n\n this.track.addEventListener(\"scroll\", () => this._measure(), { passive: true });\n this.track.addEventListener(\"scrollend\", () => { this._seeking = 0; this._measure(); });\n // a visitor taking hold of the track ends any scroll a control started\n for (const type of [\"pointerdown\", \"touchstart\", \"wheel\", \"keydown\"]) {\n this.track.addEventListener(type, () => { this._seeking = 0; }, { passive: true });\n }\n\n this.slotElement.addEventListener(\"slotchange\", () => {\n this.waitForImagesToLoad().then(() => this._measure());\n });\n\n this._resizeObserver = new ResizeObserver(() => this._measure());\n this._resizeObserver.observe(this.track);\n\n this.waitForImagesToLoad().then(() => this._measure());\n\n this.addEventListener(\"open-modal\", (e) => {\n this.openModal(e.detail);\n });\n this._enableMouseDrag(this.track);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._resizeObserver?.disconnect();\n }\n\n waitForImagesToLoad() {\n const assignedElements = this.slotElement.assignedElements({\n flatten: true\n });\n const images = assignedElements\n .map((el) => el.shadowRoot?.querySelector(\"img\"))\n .filter((img) => img != null);\n const promises = images.map(\n (img) =>\n new Promise<Event | void>((resolve) => {\n if (img.complete) resolve();\n else {\n img.addEventListener(\"load\", resolve, { once: true });\n img.addEventListener(\"error\", resolve, { once: true });\n }\n })\n );\n return Promise.all(promises);\n }\n\n /* The distance from one item to the next: an item's width and the gap. A\n scroll stop is one of these, and the controls count stops, not items --\n the last stop is wherever the track ends, which is short of a full step\n when the items do not divide the width evenly. */\n _step() {\n const first = this.slotElement?.assignedElements({ flatten: true })[0];\n if (!first) return 0;\n const gap = parseFloat(getComputedStyle(this.track).columnGap) || 0;\n return (first as HTMLElement).offsetWidth + gap;\n }\n\n /* How many stops the track has and which one it is at, from where it has\n scrolled to -- by a control, a drag, a wheel or a keyboard. While a\n control's smooth scroll is on its way, the dot it asked for stays current\n rather than stepping through every stop it passes. */\n _measure() {\n if (!this.track) return;\n const max = this.track.scrollWidth - this.track.clientWidth;\n const step = this._step();\n if (max <= 1 || step <= 0) {\n this._pages = 1;\n this._page = 1;\n return;\n }\n this._pages = Math.ceil((max - 1) / step) + 1;\n const left = this._travelled;\n const page = left >= max - 1 ? this._pages : Math.min(this._pages, Math.round(left / step) + 1);\n if (this._seeking && page !== this._seeking) return;\n this._seeking = 0;\n this._page = page;\n }\n\n /* Where stop n sits, as a distance from the track's start: a whole step per\n stop, and the last at the track's end. */\n _stop(n: number) {\n const max = this.track.scrollWidth - this.track.clientWidth;\n return Math.min((n - 1) * this._step(), max);\n }\n\n /* How far the track has scrolled from its start. On a right-to-left page\n the start is the right edge and scrollLeft runs from 0 down to minus the\n overflow, so the distance is its size and a position written back takes\n its sign; read as a plain number, every stop past the first sat at a\n scrollLeft the track can never reach, and scrolling to one clamped to the\n start. */\n get _travelled() {\n return Math.abs(this.track.scrollLeft);\n }\n\n _scrollToStop(n: number) {\n const sign = getComputedStyle(this.track).direction === \"rtl\" ? -1 : 1;\n this.track.scrollTo({ left: sign * this._stop(n) });\n }\n\n /* Smooth or instant is the track's scroll-behavior, which follows\n prefers-reduced-motion; see carousel.css.ts. */\n _goToPage(n: number) {\n this._seeking = n;\n this._page = n;\n this._scrollToStop(n);\n }\n\n openModal(item: ModalItem) {\n this.selectedItem = item;\n this._shownItem = item;\n }\n\n closeModal() {\n this.selectedItem = null;\n }\n\n /* Mouse drag, the one way of moving the track the browser does not give it:\n wheel, trackpad, touch, pen and the keyboard all scroll it natively. The\n docs promise click-and-drag, so it stays, as a thin layer over the\n scroller -- a mouse press only, one pixel of track per pixel of pointer\n (it was 1.5), and no snapping while the button is down, or every write to\n scrollLeft would land on a stop. On release it settles on the nearest one.\n\n This used to be mousedown and touchmove handlers writing scrollLeft over\n a track that was overflow: hidden, which left the wheel, the trackpad and\n the keyboard with nothing to move, and drove touch by script. */\n _enableMouseDrag(track: HTMLElement) {\n let press: { id: number; x: number; left: number; dragging: boolean } | null = null;\n let swallowClick = false;\n\n track.addEventListener(\"pointerdown\", (e) => {\n if (e.pointerType !== \"mouse\" || e.button !== 0) return;\n press = { id: e.pointerId, x: e.clientX, left: track.scrollLeft, dragging: false };\n });\n\n track.addEventListener(\"pointermove\", (e) => {\n if (press?.id !== e.pointerId) return;\n // the button came up off the track before the press became a drag\n if (!(e.buttons & 1)) { press = null; return; }\n const dx = e.clientX - press.x;\n if (!press.dragging) {\n // a few pixels of travel first, so a click on + stays a click\n if (Math.abs(dx) < 4) return;\n press.dragging = true;\n track.setPointerCapture(e.pointerId);\n track.classList.add(\"dragging\");\n }\n track.scrollLeft = press.left - dx;\n });\n\n const release = () => {\n const dragged = press?.dragging;\n press = null;\n if (!dragged) return;\n track.classList.remove(\"dragging\");\n this._settle();\n // the click a drag ends with is not a click on the + or link under it;\n // it comes in the same task as the pointerup, if it comes at all\n swallowClick = true;\n setTimeout(() => { swallowClick = false; });\n };\n for (const type of [\"pointerup\", \"pointercancel\", \"lostpointercapture\"]) {\n track.addEventListener(type, release);\n }\n\n track.addEventListener(\"click\", (e) => {\n if (!swallowClick) return;\n e.preventDefault();\n e.stopPropagation();\n }, { capture: true });\n\n // a press is for moving the track, not for selecting copy or dragging an icon out\n for (const type of [\"selectstart\", \"dragstart\"]) {\n track.addEventListener(type, (e) => { if (press) e.preventDefault(); });\n }\n }\n\n /* Where a drag leaves the track, the snap would take it: the nearest stop. */\n _settle() {\n const left = this._travelled;\n let nearest = 1;\n for (let n = 2; n <= this._pages; n++) {\n if (Math.abs(this._stop(n) - left) < Math.abs(this._stop(nearest) - left)) nearest = n;\n }\n this._scrollToStop(nearest);\n }\n\n render() {\n return html`\n <div class=\"bd-carousel\">\n ${this.title\n ? html`<div class=\"bd-header-carousel\">\n ${this._renderTitle(\"bd-section-title\")}\n </div>`\n : \"\"}\n\n <div class=\"bd-carousel-track\">\n <slot></slot>\n </div>\n <div class=\"bd-carousel-controls\">\n <bd-pagination-dots\n count=${this._pages}\n current=${this._page}\n label=${this.title || \"Slides\"}\n item-label=\"Go to item\"\n @bd-change=${(e: CustomEvent<{ current: number }>) => this._goToPage(e.detail.current)}\n ></bd-pagination-dots>\n </div>\n </div>\n\n <!-- Always rendered, and closed through open: a dialog closed is what\n hands focus back to the + that opened it, and one removed while\n open drops it on the page instead. It keeps the last item's copy\n while it closes. -->\n <bd-modal\n .open=\"${!!this.selectedItem}\"\n .title=\"${this._shownItem?.title ?? \"\"}\"\n .modalText=\"${this._shownItem?.modalText ?? \"\"}\"\n .icon=\"${this._shownItem?.icon ?? \"\"}\"\n @close-modal=\"${this.closeModal}\"\n ></bd-modal>\n `;\n }\n\n static styles = [carouselCSS];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-carousel-item\" : CarouselItem;\n \"bd-carousel-section\": CustomCarousel;\n }\n interface HTMLElementEventMap {\n \"open-modal\": CustomEvent<ModalItem>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"carousel.js","names":["carouselCSS","_decorate","__decorate","carousel_css_default","CarouselItem","LitElement","property","defineElement","CustomCarousel","n","className","type","promises","el","img","resolve","first","gap","max","step","left","page","sign","item","press","swallowClick","track","e","dx","release","dragged","nearest","state"],"sources":["../../../../src/components/carousel/carousel.ts"],"sourcesContent":["import { LitElement, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport carouselCSS from \"#components/carousel/carousel.css.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/icons/plus-icon.ts\";\nimport \"#components/modal/modal.ts\";\nimport \"#components/pagination-dots/pagination-dots.ts\";\n\ninterface ModalItem {\n title? : string;\n modalText?: string;\n icon? : string;\n}\n\n@defineElement(\"bd-carousel-item\")\nexport class CarouselItem extends LitElement {\n @property({ type: String })\n icon?: string;\n @property({ type: String })\n title!: string;\n @property({ type: String })\n modalText?: string;\n\n _openModal() {\n this.dispatchEvent(\n new CustomEvent(\"open-modal\", {\n detail: {\n title : this.title,\n modalText: this.modalText,\n icon : this.icon\n },\n bubbles : true,\n composed: true\n })\n );\n }\n\n render() {\n return html`\n <div class=\"bd-box\">\n ${this.icon\n ? html`<img src=\"${this.icon}\" alt=\"\" class=\"bd-carousel-icon\" />`\n : \"\"}\n <div class=\"bd-content\">\n <slot></slot>\n </div>\n <button\n type=\"button\"\n class=\"bd-plus-button\"\n aria-label=\"Open modal for ${this.title}\"\n @click=\"${this._openModal}\"\n >\n <bd-plus-icon size=\"md\"></bd-plus-icon>\n </button>\n </div>\n `;\n }\n\n static styles = [carouselCSS];\n}\n\n@defineElement(\"bd-carousel-section\")\nclass CustomCarousel extends LitElement {\n @property({ type: String })\n title = \"\";\n @property({ type: Number, attribute: \"heading-level\" })\n headingLevel = 2;\n @property({ type: Object })\n selectedItem: ModalItem | null = null;\n // scroll stops, 1-based, read from the track; see _measure\n @state()\n _pages = 1;\n @state()\n _page = 1;\n\n _seeking : number;\n _shownItem? : ModalItem;\n track! : HTMLElement;\n slotElement! : HTMLSlotElement;\n _resizeObserver?: ResizeObserver;\n\n constructor() {\n super();\n this._seeking = 0;\n }\n\n /**\n * The heading element this section renders. Level is the document-outline\n * question and belongs to whoever composes the page; the type scale is this\n * component's own and does not move with it. Defaults to h2, because a\n * reusable section cannot know it is the only thing on the page, and two of\n * these used to put two h1s on one.\n */\n get _headingTag() {\n const n = Number(this.headingLevel);\n return Number.isInteger(n) && n >= 1 && n <= 6 ? `h${n}` : \"h2\";\n }\n\n /* bd-h already builds the dynamic tag, and it keeps the two questions apart\n the way this component needs: as= is the outline level the page composes,\n visual-level= is the type role, which is ours. Building the element here\n meant re-implementing bd-h and then hand-writing the type on top of it --\n and the hand-written type carried no line-height and no margin, so the\n title rendered with the browser's own h2 margins. */\n _renderTitle(className: string) {\n return html`<bd-h as=${this._headingTag} visual-level=\"h3\" class=${className}\n >${this.title}</bd-h\n >`;\n }\n\n firstUpdated() {\n this.track = this.shadowRoot!.querySelector<HTMLElement>(\".bd-carousel-track\")!;\n this.slotElement = this.shadowRoot!.querySelector(\"slot\")!;\n\n this.track.addEventListener(\"scroll\", () => this._measure(), { passive: true });\n this.track.addEventListener(\"scrollend\", () => { this._seeking = 0; this._measure(); });\n // a visitor taking hold of the track ends any scroll a control started\n for (const type of [\"pointerdown\", \"touchstart\", \"wheel\", \"keydown\"]) {\n this.track.addEventListener(type, () => { this._seeking = 0; }, { passive: true });\n }\n\n this.slotElement.addEventListener(\"slotchange\", () => {\n this.waitForImagesToLoad().then(() => this._measure());\n });\n\n this._resizeObserver = new ResizeObserver(() => this._measure());\n this._resizeObserver.observe(this.track);\n\n this.waitForImagesToLoad().then(() => this._measure());\n\n this.addEventListener(\"open-modal\", (e) => {\n this.openModal(e.detail);\n });\n this._enableMouseDrag(this.track);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._resizeObserver?.disconnect();\n }\n\n waitForImagesToLoad() {\n const assignedElements = this.slotElement.assignedElements({\n flatten: true\n });\n const images = assignedElements\n .map((el) => el.shadowRoot?.querySelector(\"img\"))\n .filter((img) => img != null);\n const promises = images.map(\n (img) =>\n new Promise<Event | void>((resolve) => {\n if (img.complete) resolve();\n else {\n img.addEventListener(\"load\", resolve, { once: true });\n img.addEventListener(\"error\", resolve, { once: true });\n }\n })\n );\n return Promise.all(promises);\n }\n\n /* The distance from one item to the next: an item's width and the gap. A\n scroll stop is one of these, and the controls count stops, not items --\n the last stop is wherever the track ends, which is short of a full step\n when the items do not divide the width evenly. */\n _step() {\n const first = this.slotElement?.assignedElements({ flatten: true })[0];\n if (!first) return 0;\n const gap = parseFloat(getComputedStyle(this.track).columnGap) || 0;\n return (first as HTMLElement).offsetWidth + gap;\n }\n\n /* How many stops the track has and which one it is at, from where it has\n scrolled to -- by a control, a drag, a wheel or a keyboard. While a\n control's smooth scroll is on its way, the dot it asked for stays current\n rather than stepping through every stop it passes. */\n _measure() {\n if (!this.track) return;\n const max = this.track.scrollWidth - this.track.clientWidth;\n const step = this._step();\n if (max <= 1 || step <= 0) {\n this._pages = 1;\n this._page = 1;\n return;\n }\n this._pages = Math.ceil((max - 1) / step) + 1;\n const left = this._travelled;\n const page = left >= max - 1 ? this._pages : Math.min(this._pages, Math.round(left / step) + 1);\n if (this._seeking && page !== this._seeking) return;\n this._seeking = 0;\n this._page = page;\n }\n\n /* Where stop n sits, as a distance from the track's start: a whole step per\n stop, and the last at the track's end. */\n _stop(n: number) {\n const max = this.track.scrollWidth - this.track.clientWidth;\n return Math.min((n - 1) * this._step(), max);\n }\n\n /* How far the track has scrolled from its start. On a right-to-left page\n the start is the right edge and scrollLeft runs from 0 down to minus the\n overflow, so the distance is its size and a position written back takes\n its sign; read as a plain number, every stop past the first sat at a\n scrollLeft the track can never reach, and scrolling to one clamped to the\n start. */\n get _travelled() {\n return Math.abs(this.track.scrollLeft);\n }\n\n _scrollToStop(n: number) {\n const sign = getComputedStyle(this.track).direction === \"rtl\" ? -1 : 1;\n this.track.scrollTo({ left: sign * this._stop(n) });\n }\n\n /* Smooth or instant is the track's scroll-behavior, which follows\n prefers-reduced-motion; see carousel.css.ts. */\n _goToPage(n: number) {\n this._seeking = n;\n this._page = n;\n this._scrollToStop(n);\n }\n\n openModal(item: ModalItem) {\n this.selectedItem = item;\n this._shownItem = item;\n }\n\n closeModal() {\n this.selectedItem = null;\n }\n\n /* Mouse drag, the one way of moving the track the browser does not give it:\n wheel, trackpad, touch, pen and the keyboard all scroll it natively. The\n docs promise click-and-drag, so it stays, as a thin layer over the\n scroller -- a mouse press only, one pixel of track per pixel of pointer\n (it was 1.5), and no snapping while the button is down, or every write to\n scrollLeft would land on a stop. On release it settles on the nearest one.\n\n This used to be mousedown and touchmove handlers writing scrollLeft over\n a track that was overflow: hidden, which left the wheel, the trackpad and\n the keyboard with nothing to move, and drove touch by script. */\n _enableMouseDrag(track: HTMLElement) {\n let press: { id: number; x: number; left: number; dragging: boolean } | null = null;\n let swallowClick = false;\n\n track.addEventListener(\"pointerdown\", (e) => {\n if (e.pointerType !== \"mouse\" || e.button !== 0) return;\n press = { id: e.pointerId, x: e.clientX, left: track.scrollLeft, dragging: false };\n });\n\n track.addEventListener(\"pointermove\", (e) => {\n if (press?.id !== e.pointerId) return;\n // the button came up off the track before the press became a drag\n if (!(e.buttons & 1)) { press = null; return; }\n const dx = e.clientX - press.x;\n if (!press.dragging) {\n // a few pixels of travel first, so a click on + stays a click\n if (Math.abs(dx) < 4) return;\n press.dragging = true;\n track.setPointerCapture(e.pointerId);\n track.classList.add(\"dragging\");\n }\n track.scrollLeft = press.left - dx;\n });\n\n const release = () => {\n const dragged = press?.dragging;\n press = null;\n if (!dragged) return;\n track.classList.remove(\"dragging\");\n this._settle();\n // the click a drag ends with is not a click on the + or link under it;\n // it comes in the same task as the pointerup, if it comes at all\n swallowClick = true;\n setTimeout(() => { swallowClick = false; });\n };\n for (const type of [\"pointerup\", \"pointercancel\", \"lostpointercapture\"]) {\n track.addEventListener(type, release);\n }\n\n track.addEventListener(\"click\", (e) => {\n if (!swallowClick) return;\n e.preventDefault();\n e.stopPropagation();\n }, { capture: true });\n\n // a press is for moving the track, not for selecting copy or dragging an icon out\n for (const type of [\"selectstart\", \"dragstart\"]) {\n track.addEventListener(type, (e) => { if (press) e.preventDefault(); });\n }\n }\n\n /* Where a drag leaves the track, the snap would take it: the nearest stop. */\n _settle() {\n const left = this._travelled;\n let nearest = 1;\n for (let n = 2; n <= this._pages; n++) {\n if (Math.abs(this._stop(n) - left) < Math.abs(this._stop(nearest) - left)) nearest = n;\n }\n this._scrollToStop(nearest);\n }\n\n render() {\n return html`\n <div class=\"bd-carousel\">\n ${this.title\n ? html`<div class=\"bd-header-carousel\">\n ${this._renderTitle(\"bd-section-title\")}\n </div>`\n : \"\"}\n\n <div class=\"bd-carousel-track\">\n <slot></slot>\n </div>\n <div class=\"bd-carousel-controls\">\n <bd-pagination-dots\n count=${this._pages}\n current=${this._page}\n label=${this.title || \"Slides\"}\n item-label=\"Go to item\"\n @bd-change=${(e: CustomEvent<{ current: number }>) => this._goToPage(e.detail.current)}\n ></bd-pagination-dots>\n </div>\n </div>\n\n <!-- Always rendered, and closed through open: a dialog closed is what\n hands focus back to the + that opened it, and one removed while\n open drops it on the page instead. It keeps the last item's copy\n while it closes. -->\n <bd-modal\n .open=\"${!!this.selectedItem}\"\n .title=\"${this._shownItem?.title ?? \"\"}\"\n .modalText=\"${this._shownItem?.modalText ?? \"\"}\"\n .icon=\"${this._shownItem?.icon ?? \"\"}\"\n @close-modal=\"${this.closeModal}\"\n ></bd-modal>\n `;\n }\n\n static styles = [carouselCSS];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-carousel-item\" : CarouselItem;\n \"bd-carousel-section\": CustomCarousel;\n }\n interface HTMLElementEventMap {\n \"open-modal\": CustomEvent<ModalItem>;\n }\n}\n"],"mappings":"A,6aAkBO,IAAMI,EAAN,cAA2BC,CAAW,CAQ3C,YAAa,CACX,KAAK,cACH,IAAI,YAAY,aAAc,CAC5B,OAAQ,CACN,MAAW,KAAK,MAChB,UAAW,KAAK,UAChB,KAAW,KAAK,IAClB,EACA,QAAU,GACV,SAAU,EACZ,CAAC,CACH,CACF,CAEA,QAAS,CACP,MAAO,EAAI;;UAEL,KAAK,KACH,CAAI,aAAa,KAAK,KAAK,sCAC3B,GAAG;;;;;;;uCAOwB,KAAK,MAAM;oBAC9B,KAAK,WAAW;;;;;KAMlC,C,OAEgB,KAAA,OAAA,CAACL,CAAW,C,CAC9B,EA3CGC,EAAA,CAAAK,EAAS,CAAE,KAAM,MAAO,CAAC,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Q,GAAG;wBACrB,KAAK,WAAW;;KAGtC,C,OAEgB,KAAA,OAAA,CAAC/B,CAAW,C,CAC9B,EAtRGC,EAAA,CAAAK,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAE,EAAA,UAAA,QAAA,IAAA,EAAA,EAEzBP,EAAA,CAAAK,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,CAAA,EAAAE,EAAA,UAAA,eAAA,IAAA,EAAA,EAErDP,EAAA,CAAAK,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAE,EAAA,UAAA,eAAA,IAAA,EAAA,EAGzBP,EAAA,CAAA+B,EAAM,CAAA,EAAAxB,EAAA,UAAA,SAAA,IAAA,EAAA,EAENP,EAAA,CAAA+B,EAAM,CAAA,EAAAxB,EAAA,UAAA,QAAA,IAAA,EAAA,EAXR,EAAAP,EAAA,CAAAM,EAAc,qBAAqB,CAAA,EAAAC,CAAA,E"}
|
|
@@ -1,174 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* Styled entirely from src/tokens/tokens.ts — see CLAUDE.md, "The foundation
|
|
4
|
-
* rule". Measurements were matched to the ds-checkbox design by finding the
|
|
5
|
-
* token that already carries each value.
|
|
6
|
-
*
|
|
7
|
-
* The whole row is the control, not just the box. That makes clicking the
|
|
8
|
-
* label work (it did nothing before) and gives the target the 24px minimum
|
|
9
|
-
* WCAG 2.5.8 asks for, which a 20px box alone cannot reach.
|
|
10
|
-
*/
|
|
11
|
-
export default css `
|
|
12
|
-
:host {
|
|
13
|
-
display: inline-block;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.bd-checkbox {
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
gap: var(--spacing-8);
|
|
20
|
-
/* padding rather than a min-height: a min-height adds its slack only
|
|
21
|
-
above and below, which left the focus ring 2px from the content at the
|
|
22
|
-
sides and 4px at the top and bottom. Padding insets all four edges
|
|
23
|
-
equally, and still carries the row past the 24px WCAG 2.5.8 asks for. */
|
|
24
|
-
padding: var(--spacing-2);
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
font-family: var(--typography-fontFamily-sans);
|
|
27
|
-
/* body-small: sm / normal / 1.5, which is what this already rendered on all
|
|
28
|
-
three axes. Only the axes this rule declares are adopted -- the role also
|
|
29
|
-
carries a family and a tracking, and importing those would change text
|
|
30
|
-
the rule never spoke for. */
|
|
31
|
-
font-size: var(--typography-body-small-fontSize);
|
|
32
|
-
line-height: var(--typography-body-small-lineHeight);
|
|
33
|
-
color: var(--color-text-primary);
|
|
34
|
-
vertical-align: middle;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* The native checkbox is the control and stays in the accessibility tree;
|
|
38
|
-
the box below draws it. The clip idiom bd-switch uses. */
|
|
39
|
-
input {
|
|
40
|
-
position: absolute;
|
|
41
|
-
/* no token: 1px is the clip idiom's own measure, not a border -- as in
|
|
42
|
-
switch.css.ts, with the -1px below. */
|
|
43
|
-
width: 1px;
|
|
44
|
-
height: 1px;
|
|
45
|
-
margin: -1px;
|
|
46
|
-
overflow: hidden;
|
|
47
|
-
clip-path: inset(50%);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* On the row rather than the box, so the ring and the target are the same
|
|
51
|
-
shape, as on bd-radio and bd-switch. */
|
|
52
|
-
.bd-checkbox:has(input:focus-visible) {
|
|
53
|
-
/* the one focus ring — see Foundations/Focus. A two-colour ring whose
|
|
54
|
-
white inner band keeps it visible on a coloured or dark surface, which a
|
|
55
|
-
single-colour outline cannot do. */
|
|
56
|
-
/* forced-colors mode does not paint box-shadow, so the ring
|
|
57
|
-
vanishes there; it does paint an outline, in a system colour. This one
|
|
58
|
-
is transparent everywhere else, and the offset lands it on the ring's
|
|
59
|
-
outer band. */
|
|
60
|
-
outline: var(--border-width-2) solid transparent;
|
|
61
|
-
outline-offset: var(--focus-outline-offset);
|
|
62
|
-
box-shadow: var(--focus-outline-primary);
|
|
63
|
-
border-radius: var(--focus-outline-radius);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* ---- the box ---------------------------------------------------------- */
|
|
67
|
-
.box {
|
|
68
|
-
flex: none;
|
|
69
|
-
width: var(--dimension-20);
|
|
70
|
-
height: var(--dimension-20);
|
|
71
|
-
box-sizing: border-box;
|
|
72
|
-
border: var(--border-width-2) solid var(--color-action-primary);
|
|
73
|
-
border-radius: var(--shape-radius-sm);
|
|
74
|
-
background: var(--color-surface-default);
|
|
75
|
-
display: inline-flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
/* the mark is drawn in currentColor, so one declaration moves both. It is
|
|
79
|
-
ink on an action fill, not "the page colour" -- the two are both white
|
|
80
|
-
here, and only one of them stays white in a dark theme. The fill is the
|
|
81
|
-
brand's, so the ink is the brand's: a light partner brand takes dark
|
|
82
|
-
ink here, which white on its fill could not carry */
|
|
83
|
-
color: var(--color-brand-on-fill);
|
|
84
|
-
transition: background-color var(--transition-duration-normal) var(--transition-easing-smooth),
|
|
85
|
-
border-color var(--transition-duration-normal) var(--transition-easing-smooth);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.bd-checkbox:hover .box {
|
|
89
|
-
border-color: var(--color-action-primary-hover);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* ---- checked and indeterminate: the box fills, the mark is white ------ */
|
|
93
|
-
:host([checked]) .box,
|
|
94
|
-
:host([indeterminate]) .box {
|
|
95
|
-
background: var(--color-action-primary);
|
|
96
|
-
border-color: var(--color-action-primary);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
:host([checked]) .bd-checkbox:hover .box,
|
|
100
|
-
:host([indeterminate]) .bd-checkbox:hover .box {
|
|
101
|
-
background: var(--color-action-primary-hover);
|
|
102
|
-
border-color: var(--color-action-primary-hover);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.mark {
|
|
106
|
-
width: var(--dimension-12);
|
|
107
|
-
height: var(--dimension-12);
|
|
108
|
-
display: block;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.mark path {
|
|
112
|
-
fill: none;
|
|
113
|
-
stroke: currentColor;
|
|
114
|
-
stroke-width: var(--border-width-2);
|
|
115
|
-
/* flat ends and a mitred vertex: the tick and the dash read as sharp,
|
|
116
|
-
matching the square corners of the box rather than softening them */
|
|
117
|
-
stroke-linecap: butt;
|
|
118
|
-
stroke-linejoin: miter;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/* ---- disabled --------------------------------------------------------
|
|
122
|
-
:disabled rather than [disabled], so a <fieldset disabled> around the box
|
|
123
|
-
greys it too: a form-associated element matches :disabled for both.
|
|
124
|
-
|
|
125
|
-
Grey throughout, and the label greys too rather than the whole row
|
|
126
|
-
dropping to an opacity, which is what the design specifies. Exempt from
|
|
127
|
-
contrast under WCAG 1.4.3.
|
|
128
|
-
|
|
129
|
-
The disabled edge is --color-border-disabled, the role named for the
|
|
130
|
-
state it expresses. It was --color-border-subtle, a hierarchy role, and
|
|
131
|
-
the family carried two answers: five controls drew neutral-200 for a
|
|
132
|
-
disabled edge and four drew neutral-300, so a disabled checkbox and a
|
|
133
|
-
disabled text field did not agree on what one looks like. The state role
|
|
134
|
-
wins because the state is what the colour means, and because neutral-300
|
|
135
|
-
measures 2.27:1 against the page where neutral-200 measures 1.66. A
|
|
136
|
-
disabled control is exempt under 1.4.11, so this is perceptibility rather
|
|
137
|
-
than conformance -- but it moves the right way, and it stays subordinate
|
|
138
|
-
to every enabled edge.
|
|
139
|
-
|
|
140
|
-
The fills below still draw neutral-200. A fill is not an edge, and whether
|
|
141
|
-
a disabled checked box should darken along with its border is a separate
|
|
142
|
-
question that has not been put yet. */
|
|
143
|
-
:host(:disabled) .bd-checkbox {
|
|
144
|
-
cursor: not-allowed;
|
|
145
|
-
color: var(--color-text-subtle);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
:host(:disabled) .box {
|
|
149
|
-
border-color: var(--color-border-disabled);
|
|
150
|
-
background: var(--color-surface-default);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
:host(:disabled[checked]) .box,
|
|
154
|
-
:host(:disabled[indeterminate]) .box {
|
|
155
|
-
background: var(--color-border-subtle);
|
|
156
|
-
border-color: var(--color-border-disabled);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
:host(:disabled) .bd-checkbox:hover .box {
|
|
160
|
-
border-color: var(--color-border-disabled);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
:host(:disabled[checked]) .bd-checkbox:hover .box,
|
|
164
|
-
:host(:disabled[indeterminate]) .bd-checkbox:hover .box {
|
|
165
|
-
background: var(--color-border-subtle);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
@media (prefers-reduced-motion: reduce) {
|
|
169
|
-
.box {
|
|
170
|
-
transition: none;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
`;
|
|
1
|
+
import{css as e}from"lit";var t=e`:host{display:inline-block}.bd-checkbox{align-items:center;gap:var(--spacing-8);padding:var(--spacing-2);cursor:pointer;font-family:var(--typography-fontFamily-sans);font-size:var(--typography-body-small-fontSize);line-height:var(--typography-body-small-lineHeight);color:var(--color-text-primary);vertical-align:middle;display:inline-flex}input{clip-path:inset(50%);width:1px;height:1px;margin:-1px;position:absolute;overflow:hidden}.bd-checkbox:has(input:focus-visible){outline:var(--border-width-2) solid transparent;outline-offset:var(--focus-outline-offset);box-shadow:var(--focus-outline-primary);border-radius:var(--focus-outline-radius)}.box{width:var(--dimension-20);height:var(--dimension-20);box-sizing:border-box;border:var(--border-width-2) solid var(--color-action-primary);border-radius:var(--shape-radius-sm);background:var(--color-surface-default);color:var(--color-brand-on-fill);transition:background-color var(--transition-duration-normal) var(--transition-easing-smooth), border-color var(--transition-duration-normal) var(--transition-easing-smooth);flex:none;justify-content:center;align-items:center;display:inline-flex}.bd-checkbox:hover .box{border-color:var(--color-action-primary-hover)}:host([checked]) .box,:host([indeterminate]) .box{background:var(--color-action-primary);border-color:var(--color-action-primary)}:host([checked]) .bd-checkbox:hover .box,:host([indeterminate]) .bd-checkbox:hover .box{background:var(--color-action-primary-hover);border-color:var(--color-action-primary-hover)}.mark{width:var(--dimension-12);height:var(--dimension-12);display:block}.mark path{fill:none;stroke:currentColor;stroke-width:var(--border-width-2);stroke-linecap:butt;stroke-linejoin:miter}:host(:disabled) .bd-checkbox{cursor:not-allowed;color:var(--color-text-subtle)}:host(:disabled) .box{border-color:var(--color-border-disabled);background:var(--color-surface-default)}:host(:disabled[checked]) .box,:host(:disabled[indeterminate]) .box{background:var(--color-border-subtle);border-color:var(--color-border-disabled)}:host(:disabled) .bd-checkbox:hover .box{border-color:var(--color-border-disabled)}:host(:disabled[checked]) .bd-checkbox:hover .box,:host(:disabled[indeterminate]) .bd-checkbox:hover .box{background:var(--color-border-subtle)}@media (prefers-reduced-motion:reduce){.box{transition:none}}`;export{t as default};
|
|
174
2
|
//# sourceMappingURL=checkbox.css.js.map
|