@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,276 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, html, nothing } from "lit";
|
|
8
|
-
import { property } 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 radioCSS from "./radio.css.js";
|
|
13
|
-
import { FormControl, omitEmpty } from "../shared/form-control.js";
|
|
14
|
-
// bd-toggle-radio has its own module, and this one still registers it, as it
|
|
15
|
-
// always has
|
|
16
|
-
import "./toggle-radio.js";
|
|
17
|
-
const NEXT_KEYS = ["ArrowDown", "ArrowRight"];
|
|
18
|
-
const PREV_KEYS = ["ArrowUp", "ArrowLeft"];
|
|
19
|
-
/* A group's radios, in document order; a group nested inside keeps its own.
|
|
20
|
-
Read off the DOM rather than asked of the group, because radios upgrade
|
|
21
|
-
first -- radio-group.ts imports this module -- and a group that is not
|
|
22
|
-
upgraded yet has no methods to ask. */
|
|
23
|
-
export const radiosOf = (group) => [...group.querySelectorAll("bd-radio")]
|
|
24
|
-
.filter(radio => radio.closest("bd-radio-group") === group);
|
|
25
|
-
/* Same-name radios in `scope` that no bd-radio-group has claimed and that
|
|
26
|
-
belong to `form` -- a native group is the radios with one name AND one form
|
|
27
|
-
owner, so two forms that each ask for a "plan" hold two groups: a choice in
|
|
28
|
-
one neither clears the other nor answers its `required`. A radio not yet
|
|
29
|
-
upgraded has no form to compare; it joins when it upgrades. */
|
|
30
|
-
const byName = (scope, name, form) => [...scope.querySelectorAll(`bd-radio[name="${CSS.escape(name)}"]`)]
|
|
31
|
-
.filter(radio => !radio._owner && (radio.form ?? null) === form);
|
|
32
|
-
/**
|
|
33
|
-
* A single radio. Selecting one clears the others in its group, and the arrow
|
|
34
|
-
* keys move between them.
|
|
35
|
-
*
|
|
36
|
-
* Each radio is a native <input type="radio"> in its own shadow root, and that
|
|
37
|
-
* is exactly what the browser cannot group: a native group is the radios
|
|
38
|
-
* sharing a name in one tree, and every shadow root is a tree of its own. So
|
|
39
|
-
* the group is still worked out here -- exclusivity, the arrow keys, the one
|
|
40
|
-
* tab stop, the position in the set -- over a bd-radio-group's radios, or,
|
|
41
|
-
* without one, the same-name radios in this root, as it always was. The
|
|
42
|
-
* group element is what adds role="radiogroup" and its label; see
|
|
43
|
-
* radio-group.ts.
|
|
44
|
-
*/
|
|
45
|
-
let BdRadio = class BdRadio extends FormControl(LitElement) {
|
|
46
|
-
constructor() {
|
|
47
|
-
super(...arguments);
|
|
48
|
-
/* Reflected because the group is found by it: _group selects same-name
|
|
49
|
-
radios by attribute, so a name set as a property -- radio.name = "plan",
|
|
50
|
-
which is what a framework binding does -- left the radio in no group at
|
|
51
|
-
all, with no exclusivity, no arrow keys and its own tab stop. A form
|
|
52
|
-
reads it off the attribute too. */
|
|
53
|
-
this.name = "";
|
|
54
|
-
this.value = "";
|
|
55
|
-
// checked was left undefined, which rendered aria-checked="" — not a valid
|
|
56
|
-
// value, so an unselected radio announced no state at all
|
|
57
|
-
this.checked = false;
|
|
58
|
-
this.disabled = false;
|
|
59
|
-
this.required = false;
|
|
60
|
-
this.label = "";
|
|
61
|
-
}
|
|
62
|
-
static { this.styles = [radioCSS]; }
|
|
63
|
-
get _control() {
|
|
64
|
-
return this.renderRoot?.querySelector?.("input");
|
|
65
|
-
}
|
|
66
|
-
/** The bd-radio-group this radio belongs to, if any. */
|
|
67
|
-
get _owner() {
|
|
68
|
-
return this.closest("bd-radio-group");
|
|
69
|
-
}
|
|
70
|
-
/** The radios this one excludes, itself included, in document order. */
|
|
71
|
-
get _group() {
|
|
72
|
-
const owner = this._owner;
|
|
73
|
-
if (owner)
|
|
74
|
-
return radiosOf(owner);
|
|
75
|
-
if (!this.name)
|
|
76
|
-
return [this];
|
|
77
|
-
/* The tree the radio is in: a document, a shadow root, or -- taken off
|
|
78
|
-
the page -- the fragment or the detached element it went with. It used
|
|
79
|
-
to fall back to the live document there, so a detached radio checked
|
|
80
|
-
from script cleared every same-name radio on the page. */
|
|
81
|
-
const root = this.getRootNode();
|
|
82
|
-
return root === this ? [this] : byName(root, this.name, this.form);
|
|
83
|
-
}
|
|
84
|
-
get _isDisabled() {
|
|
85
|
-
return this.disabled || this._formDisabled;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* One tab stop per group, as the radiogroup pattern requires: the selected
|
|
89
|
-
* radio, or the first enabled one when nothing is selected yet.
|
|
90
|
-
*/
|
|
91
|
-
_tabbable(group) {
|
|
92
|
-
if (this._isDisabled)
|
|
93
|
-
return false;
|
|
94
|
-
if (group.some(r => r.checked))
|
|
95
|
-
return this.checked;
|
|
96
|
-
return group.find(r => !r._isDisabled) === this;
|
|
97
|
-
}
|
|
98
|
-
/* `required` on any radio, or on the group element, requires the group:
|
|
99
|
-
one of them has to be selected. */
|
|
100
|
-
_missing(group) {
|
|
101
|
-
const required = this._owner?.required || group.some(r => r.required);
|
|
102
|
-
return required && !group.some(r => r.checked);
|
|
103
|
-
}
|
|
104
|
-
/* The tab stop, the validity and the position in the set are group
|
|
105
|
-
decisions, but each radio renders only when its own properties change.
|
|
106
|
-
So when one radio's state flips, or one joins or leaves, the rest are told
|
|
107
|
-
to re-render: clicking radio 3 in a group with nothing selected used to
|
|
108
|
-
leave radio 1 at tabindex 0 beside it -- two tab stops in one group. The
|
|
109
|
-
peers' own properties do not change, so this does not cascade. */
|
|
110
|
-
_refreshPeers(group) {
|
|
111
|
-
for (const radio of group) {
|
|
112
|
-
if (radio !== this)
|
|
113
|
-
radio.requestUpdate?.();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
/** The defining behaviour of a radio: the rest of the group lets go. */
|
|
117
|
-
_exclusive(group = this._group) {
|
|
118
|
-
for (const radio of group) {
|
|
119
|
-
if (radio !== this && radio.checked)
|
|
120
|
-
radio.checked = false;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
connectedCallback() {
|
|
124
|
-
super.connectedCallback();
|
|
125
|
-
// what reset returns to, as in bd-checkbox: checked reflects, so the
|
|
126
|
-
// attribute cannot hold the default
|
|
127
|
-
this._defaults ??= { checked: this.checked };
|
|
128
|
-
const owner = this._owner;
|
|
129
|
-
if (owner?.name)
|
|
130
|
-
this.name = owner.name;
|
|
131
|
-
this._refreshPeers(this._group);
|
|
132
|
-
}
|
|
133
|
-
disconnectedCallback() {
|
|
134
|
-
super.disconnectedCallback();
|
|
135
|
-
// detached, this radio can no longer find its group, so it tells the one
|
|
136
|
-
// it was last rendered in
|
|
137
|
-
this._refreshPeers(this._peers ?? []);
|
|
138
|
-
}
|
|
139
|
-
willUpdate(changed) {
|
|
140
|
-
/* The group, read once an update. The tab stop, the validity, the
|
|
141
|
-
position in the set and the peers to tell all ask it, and each read is
|
|
142
|
-
a scan of the whole root: it was read four times a render, on every
|
|
143
|
-
radio a change re-renders. */
|
|
144
|
-
this._groupNow = this._group;
|
|
145
|
-
/* A radio checked from script clears the rest, as a native one does. Not
|
|
146
|
-
on its first render: what a page wrote is taken as written, so a page
|
|
147
|
-
that renders one name in several places -- pricing cards, each with its
|
|
148
|
-
own "billing" pair -- loads every pair as it always did. */
|
|
149
|
-
if (changed.has("checked") && this.checked && this.hasUpdated)
|
|
150
|
-
this._exclusive(this._groupNow);
|
|
151
|
-
}
|
|
152
|
-
updated(changed) {
|
|
153
|
-
const group = this._groupNow;
|
|
154
|
-
// _formDisabled is protected, so PropertyValues<this> does not list it as a key
|
|
155
|
-
if (["checked", "disabled", "name", "required", "_formDisabled"].some(p => changed.has(p))) {
|
|
156
|
-
// a radio renamed out of a group leaves its old peers to re-decide too
|
|
157
|
-
this._refreshPeers(new Set([...(this._peers ?? []), ...group]));
|
|
158
|
-
}
|
|
159
|
-
this._peers = group;
|
|
160
|
-
this._internals.setFormValue(this.checked ? this.value || "on" : null, String(this.checked));
|
|
161
|
-
// the inner radio carries `required` only while the group is missing a
|
|
162
|
-
// choice, so it is invalid exactly when the group is -- see render()
|
|
163
|
-
this._mirrorValidity(this._control);
|
|
164
|
-
}
|
|
165
|
-
formResetCallback() {
|
|
166
|
-
super.formResetCallback();
|
|
167
|
-
// never connected, it has no default yet and keeps what it holds, as in
|
|
168
|
-
// bd-checkbox
|
|
169
|
-
if (!this._defaults)
|
|
170
|
-
return;
|
|
171
|
-
this.checked = this._defaults.checked;
|
|
172
|
-
}
|
|
173
|
-
formStateRestoreCallback(state) {
|
|
174
|
-
this.checked = state === "true";
|
|
175
|
-
}
|
|
176
|
-
// a native radio is selected when its label is clicked, or on el.click()
|
|
177
|
-
_activate() {
|
|
178
|
-
this._control?.click();
|
|
179
|
-
}
|
|
180
|
-
/* A native radio fires change only when it becomes checked. The rest of the
|
|
181
|
-
group lets go before the event, so a handler reading the group sees one
|
|
182
|
-
selection, not two. */
|
|
183
|
-
_onChange() {
|
|
184
|
-
this._exclusive();
|
|
185
|
-
this.checked = true;
|
|
186
|
-
this.dispatchEvent(new CustomEvent("change", {
|
|
187
|
-
detail: { name: this.name, value: this.value },
|
|
188
|
-
bubbles: true,
|
|
189
|
-
composed: true
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
/** Move to the next or previous enabled radio, focus it, and select it. */
|
|
193
|
-
_move(step) {
|
|
194
|
-
const enabled = this._group.filter(r => !r._isDisabled);
|
|
195
|
-
if (enabled.length < 2)
|
|
196
|
-
return;
|
|
197
|
-
const from = enabled.indexOf(this);
|
|
198
|
-
const next = enabled[(from + step + enabled.length) % enabled.length];
|
|
199
|
-
next._control.focus();
|
|
200
|
-
// a click, as the browser sends one when the arrow keys select a radio:
|
|
201
|
-
// it checks the radio and fires input and change on the way
|
|
202
|
-
next._control.click();
|
|
203
|
-
}
|
|
204
|
-
/* The arrow keys are the group's, and the browser's own group here is this
|
|
205
|
-
one radio, so they are handled here. Space is the native radio's own, and
|
|
206
|
-
Enter submits the form, as it does from a native radio (see
|
|
207
|
-
shared/form-control.ts). */
|
|
208
|
-
_onKeydown(e) {
|
|
209
|
-
if (e.key === "Enter") {
|
|
210
|
-
e.preventDefault();
|
|
211
|
-
this._submitImplicitly();
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
let step = NEXT_KEYS.includes(e.key) ? 1 : PREV_KEYS.includes(e.key) ? -1 : 0;
|
|
215
|
-
if (!step)
|
|
216
|
-
return;
|
|
217
|
-
// left and right swap on a right-to-left page, as a native group's do
|
|
218
|
-
if (e.key.endsWith("Left") || e.key.endsWith("Right"))
|
|
219
|
-
step *= this.matches(":dir(rtl)") ? -1 : 1;
|
|
220
|
-
e.preventDefault();
|
|
221
|
-
this._move(step);
|
|
222
|
-
}
|
|
223
|
-
render() {
|
|
224
|
-
const group = this._groupNow;
|
|
225
|
-
/* The inner radio is required while the group has no choice, and only
|
|
226
|
-
then. It supplies the browser's own message for an empty required
|
|
227
|
-
group; marked required for good, an unselected radio beside the
|
|
228
|
-
selected one would be invalid on its own and could be announced so.
|
|
229
|
-
It needs a name for that: a radio without one is in no group, and the
|
|
230
|
-
browser never finds it missing. Any name does -- it is the only radio
|
|
231
|
-
in this root, and the host is what a form reads.
|
|
232
|
-
|
|
233
|
-
Its position in the set is stated, because the browser counts each
|
|
234
|
-
shadow root's radios alone and would announce every radio as 1 of 1. */
|
|
235
|
-
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{FormControl as n,omitEmpty as r}from"../shared/form-control.js";import i from"./radio.css.js";import"./toggle-radio.js";import{LitElement as a,html as o,nothing as s}from"lit";import{property as c}from"lit/decorators.js";var l=[`ArrowDown`,`ArrowRight`],u=[`ArrowUp`,`ArrowLeft`],d=e=>[...e.querySelectorAll(`bd-radio`)].filter(t=>t.closest(`bd-radio-group`)===e),f=(e,t,n)=>[...e.querySelectorAll(`bd-radio[name="${CSS.escape(t)}"]`)].filter(e=>!e._owner&&(e.form??null)===n),p=class extends n(a){constructor(...e){super(...e),this.name=``,this.value=``,this.checked=!1,this.disabled=!1,this.required=!1,this.label=``}static{this.styles=[i]}get _control(){return this.renderRoot?.querySelector?.(`input`)}get _owner(){return this.closest(`bd-radio-group`)}get _group(){let e=this._owner;if(e)return d(e);if(!this.name)return[this];let t=this.getRootNode();return t===this?[this]:f(t,this.name,this.form)}get _isDisabled(){return this.disabled||this._formDisabled}_tabbable(e){return this._isDisabled?!1:e.some(e=>e.checked)?this.checked:e.find(e=>!e._isDisabled)===this}_missing(e){return(this._owner?.required||e.some(e=>e.required))&&!e.some(e=>e.checked)}_refreshPeers(e){for(let t of e)t!==this&&t.requestUpdate?.()}_exclusive(e=this._group){for(let t of e)t!==this&&t.checked&&(t.checked=!1)}connectedCallback(){super.connectedCallback(),this._defaults??={checked:this.checked};let e=this._owner;e?.name&&(this.name=e.name),this._refreshPeers(this._group)}disconnectedCallback(){super.disconnectedCallback(),this._refreshPeers(this._peers??[])}willUpdate(e){this._groupNow=this._group,e.has(`checked`)&&this.checked&&this.hasUpdated&&this._exclusive(this._groupNow)}updated(e){let t=this._groupNow;[`checked`,`disabled`,`name`,`required`,`_formDisabled`].some(t=>e.has(t))&&this._refreshPeers(/* @__PURE__ */ new Set([...this._peers??[],...t])),this._peers=t,this._internals.setFormValue(this.checked?this.value||`on`:null,String(this.checked)),this._mirrorValidity(this._control)}formResetCallback(){super.formResetCallback(),this._defaults&&(this.checked=this._defaults.checked)}formStateRestoreCallback(e){this.checked=e===`true`}_activate(){this._control?.click()}_onChange(){this._exclusive(),this.checked=!0,this.dispatchEvent(new CustomEvent(`change`,{detail:{name:this.name,value:this.value},bubbles:!0,composed:!0}))}_move(e){let t=this._group.filter(e=>!e._isDisabled);if(t.length<2)return;let n=t[(t.indexOf(this)+e+t.length)%t.length];n._control.focus(),n._control.click()}_onKeydown(e){if(e.key===`Enter`){e.preventDefault(),this._submitImplicitly();return}let t=l.includes(e.key)?1:u.includes(e.key)?-1:0;t&&((e.key.endsWith(`Left`)||e.key.endsWith(`Right`))&&(t*=this.matches(`:dir(rtl)`)?-1:1),e.preventDefault(),this._move(t))}render(){let e=this._groupNow;return o`
|
|
236
2
|
<label class="bd-radio">
|
|
237
3
|
<input
|
|
238
4
|
type="radio"
|
|
239
5
|
name="choice"
|
|
240
6
|
.checked=${this.checked}
|
|
241
7
|
?disabled=${this._isDisabled}
|
|
242
|
-
?required=${this._missing(
|
|
243
|
-
tabindex=${this._tabbable(
|
|
244
|
-
aria-posinset=${
|
|
245
|
-
aria-setsize=${
|
|
8
|
+
?required=${this._missing(e)}
|
|
9
|
+
tabindex=${this._tabbable(e)?0:-1}
|
|
10
|
+
aria-posinset=${e.length>1?e.indexOf(this)+1:s}
|
|
11
|
+
aria-setsize=${e.length>1?e.length:s}
|
|
246
12
|
@change=${this._onChange}
|
|
247
13
|
@keydown=${this._onKeydown}
|
|
248
14
|
/>
|
|
249
15
|
<span class="box" part="box"><span class="dot"></span></span>
|
|
250
16
|
<span class="label" part="label"><slot>${this.label}</slot></span>
|
|
251
17
|
</label>
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
__decorate([
|
|
256
|
-
property({ type: String, reflect: true, converter: omitEmpty })
|
|
257
|
-
], BdRadio.prototype, "name", void 0);
|
|
258
|
-
__decorate([
|
|
259
|
-
property({ type: String })
|
|
260
|
-
], BdRadio.prototype, "value", void 0);
|
|
261
|
-
__decorate([
|
|
262
|
-
property({ type: Boolean, reflect: true })
|
|
263
|
-
], BdRadio.prototype, "checked", void 0);
|
|
264
|
-
__decorate([
|
|
265
|
-
property({ type: Boolean, reflect: true })
|
|
266
|
-
], BdRadio.prototype, "disabled", void 0);
|
|
267
|
-
__decorate([
|
|
268
|
-
property({ type: Boolean })
|
|
269
|
-
], BdRadio.prototype, "required", void 0);
|
|
270
|
-
__decorate([
|
|
271
|
-
property({ type: String })
|
|
272
|
-
], BdRadio.prototype, "label", void 0);
|
|
273
|
-
BdRadio = __decorate([
|
|
274
|
-
defineElement("bd-radio")
|
|
275
|
-
], BdRadio);
|
|
18
|
+
`}};t([c({type:String,reflect:!0,converter:r})],p.prototype,`name`,void 0),t([c({type:String})],p.prototype,`value`,void 0),t([c({type:Boolean,reflect:!0})],p.prototype,`checked`,void 0),t([c({type:Boolean,reflect:!0})],p.prototype,`disabled`,void 0),t([c({type:Boolean})],p.prototype,`required`,void 0),t([c({type:String})],p.prototype,`label`,void 0),p=t([e(`bd-radio`)],p);export{d as radiosOf};
|
|
276
19
|
//# sourceMappingURL=radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,2EAA2E;AAC3E,OAAO,wBAAwB,CAAC;AAChC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACnE,6EAA6E;AAC7E,aAAa;AACb,OAAO,mBAAmB,CAAC;AAE3B,MAAM,SAAS,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAC9C,MAAM,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AE,IAAI,EAAE,CAAC;wCAC3B;AAEhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAC1B;AAEjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACX;AAEjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCAChB;AArBP,OAAO;IADZ,aAAa,CAAC,UAAU,CAAC;GACpB,OAAO,CAoOZ","sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"../shared/define-element.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"../../tokens/tokens.ts\";\nimport radioCSS from \"./radio.css.ts\";\nimport { FormControl, omitEmpty } from \"../shared/form-control.ts\";\n// bd-toggle-radio has its own module, and this one still registers it, as it\n// always has\nimport \"./toggle-radio.ts\";\n\nconst NEXT_KEYS = [\"ArrowDown\", \"ArrowRight\"];\nconst PREV_KEYS = [\"ArrowUp\", \"ArrowLeft\"];\n\n/* A group's radios, in document order; a group nested inside keeps its own.\n Read off the DOM rather than asked of the group, because radios upgrade\n first -- radio-group.ts imports this module -- and a group that is not\n upgraded yet has no methods to ask. */\nexport const radiosOf = (group: Element) => [...group.querySelectorAll(\"bd-radio\")]\n .filter(radio => radio.closest(\"bd-radio-group\") === group);\n\n/* Same-name radios in `scope` that no bd-radio-group has claimed and that\n belong to `form` -- a native group is the radios with one name AND one form\n owner, so two forms that each ask for a \"plan\" hold two groups: a choice in\n one neither clears the other nor answers its `required`. A radio not yet\n upgraded has no form to compare; it joins when it upgrades. */\nconst byName = (scope: ParentNode, name: string, form: HTMLFormElement | null) => [...scope.querySelectorAll<BdRadio>(`bd-radio[name=\"${CSS.escape(name)}\"]`)]\n .filter(radio => !radio._owner && (radio.form ?? null) === form);\n\n/**\n * A single radio. Selecting one clears the others in its group, and the arrow\n * keys move between them.\n *\n * Each radio is a native <input type=\"radio\"> in its own shadow root, and that\n * is exactly what the browser cannot group: a native group is the radios\n * sharing a name in one tree, and every shadow root is a tree of its own. So\n * the group is still worked out here -- exclusivity, the arrow keys, the one\n * tab stop, the position in the set -- over a bd-radio-group's radios, or,\n * without one, the same-name radios in this root, as it always was. The\n * group element is what adds role=\"radiogroup\" and its label; see\n * radio-group.ts.\n */\n@defineElement(\"bd-radio\")\nclass BdRadio extends FormControl(LitElement) {\n static styles = [radioCSS];\n\n /* Reflected because the group is found by it: _group selects same-name\n radios by attribute, so a name set as a property -- radio.name = \"plan\",\n which is what a framework binding does -- left the radio in no group at\n all, with no exclusivity, no arrow keys and its own tab stop. A form\n reads it off the attribute too. */\n @property({ type: String, reflect: true, converter: omitEmpty })\n name = \"\";\n @property({ type: String })\n value = \"\";\n // checked was left undefined, which rendered aria-checked=\"\" — not a valid\n // value, so an unselected radio announced no state at all\n @property({ type: Boolean, reflect: true })\n checked = false;\n @property({ type: Boolean, reflect: true })\n disabled = false;\n @property({ type: Boolean })\n required = false;\n @property({ type: String })\n label = \"\";\n\n _defaults?: { checked: boolean };\n _groupNow!: BdRadio[];\n _peers? : BdRadio[];\n\n protected get _control(): HTMLInputElement | null {\n return this.renderRoot?.querySelector?.(\"input\");\n }\n\n /** The bd-radio-group this radio belongs to, if any. */\n get _owner() {\n return this.closest(\"bd-radio-group\");\n }\n\n /** The radios this one excludes, itself included, in document order. */\n get _group() {\n const owner = this._owner;\n if (owner) return radiosOf(owner);\n if (!this.name) return [this];\n /* The tree the radio is in: a document, a shadow root, or -- taken off\n the page -- the fragment or the detached element it went with. It used\n to fall back to the live document there, so a detached radio checked\n from script cleared every same-name radio on the page. */\n const root = this.getRootNode();\n return root === this ? [this] : byName(root as ParentNode, this.name, this.form);\n }\n\n get _isDisabled() {\n return this.disabled || this._formDisabled;\n }\n\n /**\n * One tab stop per group, as the radiogroup pattern requires: the selected\n * radio, or the first enabled one when nothing is selected yet.\n */\n _tabbable(group: BdRadio[]) {\n if (this._isDisabled) return false;\n if (group.some(r => r.checked)) return this.checked;\n return group.find(r => !r._isDisabled) === this;\n }\n\n /* `required` on any radio, or on the group element, requires the group:\n one of them has to be selected. */\n _missing(group: BdRadio[]) {\n const required = this._owner?.required || group.some(r => r.required);\n return required && !group.some(r => r.checked);\n }\n\n /* The tab stop, the validity and the position in the set are group\n decisions, but each radio renders only when its own properties change.\n So when one radio's state flips, or one joins or leaves, the rest are told\n to re-render: clicking radio 3 in a group with nothing selected used to\n leave radio 1 at tabindex 0 beside it -- two tab stops in one group. The\n peers' own properties do not change, so this does not cascade. */\n _refreshPeers(group: Iterable<BdRadio>) {\n for (const radio of group) {\n if (radio !== this) radio.requestUpdate?.();\n }\n }\n\n /** The defining behaviour of a radio: the rest of the group lets go. */\n _exclusive(group = this._group) {\n for (const radio of group) {\n if (radio !== this && radio.checked) radio.checked = false;\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n // what reset returns to, as in bd-checkbox: checked reflects, so the\n // attribute cannot hold the default\n this._defaults ??= { checked: this.checked };\n const owner = this._owner;\n if (owner?.name) this.name = owner.name;\n this._refreshPeers(this._group);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n // detached, this radio can no longer find its group, so it tells the one\n // it was last rendered in\n this._refreshPeers(this._peers ?? []);\n }\n\n willUpdate(changed: PropertyValues<this>) {\n /* The group, read once an update. The tab stop, the validity, the\n position in the set and the peers to tell all ask it, and each read is\n a scan of the whole root: it was read four times a render, on every\n radio a change re-renders. */\n this._groupNow = this._group;\n /* A radio checked from script clears the rest, as a native one does. Not\n on its first render: what a page wrote is taken as written, so a page\n that renders one name in several places -- pricing cards, each with its\n own \"billing\" pair -- loads every pair as it always did. */\n if (changed.has(\"checked\") && this.checked && this.hasUpdated) this._exclusive(this._groupNow);\n }\n\n updated(changed: PropertyValues<this>) {\n const group = this._groupNow;\n // _formDisabled is protected, so PropertyValues<this> does not list it as a key\n if ([\"checked\", \"disabled\", \"name\", \"required\", \"_formDisabled\"].some(p => (changed as Map<PropertyKey, unknown>).has(p))) {\n // a radio renamed out of a group leaves its old peers to re-decide too\n this._refreshPeers(new Set([...(this._peers ?? []), ...group]));\n }\n this._peers = group;\n\n this._internals.setFormValue(this.checked ? this.value || \"on\" : null, String(this.checked));\n // the inner radio carries `required` only while the group is missing a\n // choice, so it is invalid exactly when the group is -- see render()\n this._mirrorValidity(this._control);\n }\n\n formResetCallback() {\n super.formResetCallback();\n // never connected, it has no default yet and keeps what it holds, as in\n // bd-checkbox\n if (!this._defaults) return;\n this.checked = this._defaults.checked;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.checked = state === \"true\";\n }\n\n // a native radio is selected when its label is clicked, or on el.click()\n protected _activate() {\n this._control?.click();\n }\n\n /* A native radio fires change only when it becomes checked. The rest of the\n group lets go before the event, so a handler reading the group sees one\n selection, not two. */\n _onChange() {\n this._exclusive();\n this.checked = true;\n\n this.dispatchEvent(\n new CustomEvent(\"change\", {\n detail : { name: this.name, value: this.value },\n bubbles : true,\n composed: true\n })\n );\n }\n\n /** Move to the next or previous enabled radio, focus it, and select it. */\n _move(step: number) {\n const enabled = this._group.filter(r => !r._isDisabled);\n if (enabled.length < 2) return;\n const from = enabled.indexOf(this);\n const next = enabled[(from + step + enabled.length) % enabled.length];\n next._control!.focus();\n // a click, as the browser sends one when the arrow keys select a radio:\n // it checks the radio and fires input and change on the way\n next._control!.click();\n }\n\n /* The arrow keys are the group's, and the browser's own group here is this\n one radio, so they are handled here. Space is the native radio's own, and\n Enter submits the form, as it does from a native radio (see\n shared/form-control.ts). */\n _onKeydown(e: KeyboardEvent) {\n if (e.key === \"Enter\") {\n e.preventDefault();\n this._submitImplicitly();\n return;\n }\n let step = NEXT_KEYS.includes(e.key) ? 1 : PREV_KEYS.includes(e.key) ? -1 : 0;\n if (!step) return;\n // left and right swap on a right-to-left page, as a native group's do\n if (e.key.endsWith(\"Left\") || e.key.endsWith(\"Right\")) step *= this.matches(\":dir(rtl)\") ? -1 : 1;\n e.preventDefault();\n this._move(step);\n }\n\n render() {\n const group = this._groupNow;\n /* The inner radio is required while the group has no choice, and only\n then. It supplies the browser's own message for an empty required\n group; marked required for good, an unselected radio beside the\n selected one would be invalid on its own and could be announced so.\n It needs a name for that: a radio without one is in no group, and the\n browser never finds it missing. Any name does -- it is the only radio\n in this root, and the host is what a form reads.\n\n Its position in the set is stated, because the browser counts each\n shadow root's radios alone and would announce every radio as 1 of 1. */\n return html`\n <label class=\"bd-radio\">\n <input\n type=\"radio\"\n name=\"choice\"\n .checked=${this.checked}\n ?disabled=${this._isDisabled}\n ?required=${this._missing(group)}\n tabindex=${this._tabbable(group) ? 0 : -1}\n aria-posinset=${group.length > 1 ? group.indexOf(this) + 1 : nothing}\n aria-setsize=${group.length > 1 ? group.length : nothing}\n @change=${this._onChange}\n @keydown=${this._onKeydown}\n />\n <span class=\"box\" part=\"box\"><span class=\"dot\"></span></span>\n <span class=\"label\" part=\"label\"><slot>${this.label}</slot></span>\n </label>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-radio\": BdRadio;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"radio.js","names":["radioCSS","_decorate","__decorate","radio_css_default","NEXT_KEYS","PREV_KEYS","radiosOf","group","radio","byName","scope","name","form","BdRadio","FormControl","LitElement","_args","owner","root","r","changed","p","state","enabled","next","step","nothing","property","omitEmpty","defineElement"],"sources":["../../../../src/components/radio/radio.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport radioCSS from \"./radio.css.ts\";\nimport { FormControl, omitEmpty } from \"#shared/form-control.ts\";\n// bd-toggle-radio has its own module, and this one still registers it, as it\n// always has\nimport \"./toggle-radio.ts\";\n\nconst NEXT_KEYS = [\"ArrowDown\", \"ArrowRight\"];\nconst PREV_KEYS = [\"ArrowUp\", \"ArrowLeft\"];\n\n/* A group's radios, in document order; a group nested inside keeps its own.\n Read off the DOM rather than asked of the group, because radios upgrade\n first -- radio-group.ts imports this module -- and a group that is not\n upgraded yet has no methods to ask. */\nexport const radiosOf = (group: Element) => [...group.querySelectorAll(\"bd-radio\")]\n .filter(radio => radio.closest(\"bd-radio-group\") === group);\n\n/* Same-name radios in `scope` that no bd-radio-group has claimed and that\n belong to `form` -- a native group is the radios with one name AND one form\n owner, so two forms that each ask for a \"plan\" hold two groups: a choice in\n one neither clears the other nor answers its `required`. A radio not yet\n upgraded has no form to compare; it joins when it upgrades. */\nconst byName = (scope: ParentNode, name: string, form: HTMLFormElement | null) => [...scope.querySelectorAll<BdRadio>(`bd-radio[name=\"${CSS.escape(name)}\"]`)]\n .filter(radio => !radio._owner && (radio.form ?? null) === form);\n\n/**\n * A single radio. Selecting one clears the others in its group, and the arrow\n * keys move between them.\n *\n * Each radio is a native <input type=\"radio\"> in its own shadow root, and that\n * is exactly what the browser cannot group: a native group is the radios\n * sharing a name in one tree, and every shadow root is a tree of its own. So\n * the group is still worked out here -- exclusivity, the arrow keys, the one\n * tab stop, the position in the set -- over a bd-radio-group's radios, or,\n * without one, the same-name radios in this root, as it always was. The\n * group element is what adds role=\"radiogroup\" and its label; see\n * radio-group.ts.\n */\n@defineElement(\"bd-radio\")\nclass BdRadio extends FormControl(LitElement) {\n static styles = [radioCSS];\n\n /* Reflected because the group is found by it: _group selects same-name\n radios by attribute, so a name set as a property -- radio.name = \"plan\",\n which is what a framework binding does -- left the radio in no group at\n all, with no exclusivity, no arrow keys and its own tab stop. A form\n reads it off the attribute too. */\n @property({ type: String, reflect: true, converter: omitEmpty })\n name = \"\";\n @property({ type: String })\n value = \"\";\n // checked was left undefined, which rendered aria-checked=\"\" — not a valid\n // value, so an unselected radio announced no state at all\n @property({ type: Boolean, reflect: true })\n checked = false;\n @property({ type: Boolean, reflect: true })\n disabled = false;\n @property({ type: Boolean })\n required = false;\n @property({ type: String })\n label = \"\";\n\n _defaults?: { checked: boolean };\n _groupNow!: BdRadio[];\n _peers? : BdRadio[];\n\n protected get _control(): HTMLInputElement | null {\n return this.renderRoot?.querySelector?.(\"input\");\n }\n\n /** The bd-radio-group this radio belongs to, if any. */\n get _owner() {\n return this.closest(\"bd-radio-group\");\n }\n\n /** The radios this one excludes, itself included, in document order. */\n get _group() {\n const owner = this._owner;\n if (owner) return radiosOf(owner);\n if (!this.name) return [this];\n /* The tree the radio is in: a document, a shadow root, or -- taken off\n the page -- the fragment or the detached element it went with. It used\n to fall back to the live document there, so a detached radio checked\n from script cleared every same-name radio on the page. */\n const root = this.getRootNode();\n return root === this ? [this] : byName(root as ParentNode, this.name, this.form);\n }\n\n get _isDisabled() {\n return this.disabled || this._formDisabled;\n }\n\n /**\n * One tab stop per group, as the radiogroup pattern requires: the selected\n * radio, or the first enabled one when nothing is selected yet.\n */\n _tabbable(group: BdRadio[]) {\n if (this._isDisabled) return false;\n if (group.some(r => r.checked)) return this.checked;\n return group.find(r => !r._isDisabled) === this;\n }\n\n /* `required` on any radio, or on the group element, requires the group:\n one of them has to be selected. */\n _missing(group: BdRadio[]) {\n const required = this._owner?.required || group.some(r => r.required);\n return required && !group.some(r => r.checked);\n }\n\n /* The tab stop, the validity and the position in the set are group\n decisions, but each radio renders only when its own properties change.\n So when one radio's state flips, or one joins or leaves, the rest are told\n to re-render: clicking radio 3 in a group with nothing selected used to\n leave radio 1 at tabindex 0 beside it -- two tab stops in one group. The\n peers' own properties do not change, so this does not cascade. */\n _refreshPeers(group: Iterable<BdRadio>) {\n for (const radio of group) {\n if (radio !== this) radio.requestUpdate?.();\n }\n }\n\n /** The defining behaviour of a radio: the rest of the group lets go. */\n _exclusive(group = this._group) {\n for (const radio of group) {\n if (radio !== this && radio.checked) radio.checked = false;\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n // what reset returns to, as in bd-checkbox: checked reflects, so the\n // attribute cannot hold the default\n this._defaults ??= { checked: this.checked };\n const owner = this._owner;\n if (owner?.name) this.name = owner.name;\n this._refreshPeers(this._group);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n // detached, this radio can no longer find its group, so it tells the one\n // it was last rendered in\n this._refreshPeers(this._peers ?? []);\n }\n\n willUpdate(changed: PropertyValues<this>) {\n /* The group, read once an update. The tab stop, the validity, the\n position in the set and the peers to tell all ask it, and each read is\n a scan of the whole root: it was read four times a render, on every\n radio a change re-renders. */\n this._groupNow = this._group;\n /* A radio checked from script clears the rest, as a native one does. Not\n on its first render: what a page wrote is taken as written, so a page\n that renders one name in several places -- pricing cards, each with its\n own \"billing\" pair -- loads every pair as it always did. */\n if (changed.has(\"checked\") && this.checked && this.hasUpdated) this._exclusive(this._groupNow);\n }\n\n updated(changed: PropertyValues<this>) {\n const group = this._groupNow;\n // _formDisabled is protected, so PropertyValues<this> does not list it as a key\n if ([\"checked\", \"disabled\", \"name\", \"required\", \"_formDisabled\"].some(p => (changed as Map<PropertyKey, unknown>).has(p))) {\n // a radio renamed out of a group leaves its old peers to re-decide too\n this._refreshPeers(new Set([...(this._peers ?? []), ...group]));\n }\n this._peers = group;\n\n this._internals.setFormValue(this.checked ? this.value || \"on\" : null, String(this.checked));\n // the inner radio carries `required` only while the group is missing a\n // choice, so it is invalid exactly when the group is -- see render()\n this._mirrorValidity(this._control);\n }\n\n formResetCallback() {\n super.formResetCallback();\n // never connected, it has no default yet and keeps what it holds, as in\n // bd-checkbox\n if (!this._defaults) return;\n this.checked = this._defaults.checked;\n }\n\n formStateRestoreCallback(state: string | File | FormData | null) {\n this.checked = state === \"true\";\n }\n\n // a native radio is selected when its label is clicked, or on el.click()\n protected _activate() {\n this._control?.click();\n }\n\n /* A native radio fires change only when it becomes checked. The rest of the\n group lets go before the event, so a handler reading the group sees one\n selection, not two. */\n _onChange() {\n this._exclusive();\n this.checked = true;\n\n this.dispatchEvent(\n new CustomEvent(\"change\", {\n detail : { name: this.name, value: this.value },\n bubbles : true,\n composed: true\n })\n );\n }\n\n /** Move to the next or previous enabled radio, focus it, and select it. */\n _move(step: number) {\n const enabled = this._group.filter(r => !r._isDisabled);\n if (enabled.length < 2) return;\n const from = enabled.indexOf(this);\n const next = enabled[(from + step + enabled.length) % enabled.length];\n next._control!.focus();\n // a click, as the browser sends one when the arrow keys select a radio:\n // it checks the radio and fires input and change on the way\n next._control!.click();\n }\n\n /* The arrow keys are the group's, and the browser's own group here is this\n one radio, so they are handled here. Space is the native radio's own, and\n Enter submits the form, as it does from a native radio (see\n shared/form-control.ts). */\n _onKeydown(e: KeyboardEvent) {\n if (e.key === \"Enter\") {\n e.preventDefault();\n this._submitImplicitly();\n return;\n }\n let step = NEXT_KEYS.includes(e.key) ? 1 : PREV_KEYS.includes(e.key) ? -1 : 0;\n if (!step) return;\n // left and right swap on a right-to-left page, as a native group's do\n if (e.key.endsWith(\"Left\") || e.key.endsWith(\"Right\")) step *= this.matches(\":dir(rtl)\") ? -1 : 1;\n e.preventDefault();\n this._move(step);\n }\n\n render() {\n const group = this._groupNow;\n /* The inner radio is required while the group has no choice, and only\n then. It supplies the browser's own message for an empty required\n group; marked required for good, an unselected radio beside the\n selected one would be invalid on its own and could be announced so.\n It needs a name for that: a radio without one is in no group, and the\n browser never finds it missing. Any name does -- it is the only radio\n in this root, and the host is what a form reads.\n\n Its position in the set is stated, because the browser counts each\n shadow root's radios alone and would announce every radio as 1 of 1. */\n return html`\n <label class=\"bd-radio\">\n <input\n type=\"radio\"\n name=\"choice\"\n .checked=${this.checked}\n ?disabled=${this._isDisabled}\n ?required=${this._missing(group)}\n tabindex=${this._tabbable(group) ? 0 : -1}\n aria-posinset=${group.length > 1 ? group.indexOf(this) + 1 : nothing}\n aria-setsize=${group.length > 1 ? group.length : nothing}\n @change=${this._onChange}\n @keydown=${this._onKeydown}\n />\n <span class=\"box\" part=\"box\"><span class=\"dot\"></span></span>\n <span class=\"label\" part=\"label\"><slot>${this.label}</slot></span>\n </label>\n `;\n }\n}\n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A0B,EAAS,CAAE,KAAM,OAAQ,QAAS,GAAM,UAAWC,CAAU,CAAC,CAAA,EAAAf,EAAA,UAAA,OAAA,IAAA,EAAA,EAE9DZ,EAAA,CAAA0B,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAd,EAAA,UAAA,QAAA,IAAA,EAAA,EAIzBZ,EAAA,CAAA0B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAAd,EAAA,UAAA,UAAA,IAAA,EAAA,EAEzCZ,EAAA,CAAA0B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,CAAA,EAAAd,EAAA,UAAA,WAAA,IAAA,EAAA,EAEzCZ,EAAA,CAAA0B,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAAAd,EAAA,UAAA,WAAA,IAAA,EAAA,EAE1BZ,EAAA,CAAA0B,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAd,EAAA,UAAA,QAAA,IAAA,EAAA,EArB3B,EAAAZ,EAAA,CAAA4B,EAAc,UAAU,CAAA,EAAAhB,CAAA,E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../tokens/tokens.
|
|
2
|
-
import { BdCheckbox } from "../checkbox/checkbox.
|
|
1
|
+
import "../../tokens/tokens.js";
|
|
2
|
+
import { BdCheckbox } from "../checkbox/checkbox.js";
|
|
3
3
|
/**
|
|
4
4
|
* Toggles independently despite looking like a radio, which is why it is a
|
|
5
5
|
* checkbox underneath. It duplicates bd-checkbox with a circular skin, and a
|
|
@@ -1,40 +1,9 @@
|
|
|
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 { html } from "lit";
|
|
8
|
-
import { defineElement } from "../shared/define-element.js";
|
|
9
|
-
// Installs the design tokens into document scope; see src/tokens/tokens.ts
|
|
10
|
-
import "../../tokens/tokens.js";
|
|
11
|
-
import radioCSS from "./radio.css.js";
|
|
12
|
-
import { BdCheckbox } from "../checkbox/checkbox.js";
|
|
13
|
-
/**
|
|
14
|
-
* Toggles independently despite looking like a radio, which is why it is a
|
|
15
|
-
* checkbox underneath. It duplicates bd-checkbox with a circular skin, and a
|
|
16
|
-
* round control that does not behave exclusively misleads people — it should
|
|
17
|
-
* be retired in favour of bd-checkbox. Kept working here because it is a
|
|
18
|
-
* published element with stories against it.
|
|
19
|
-
*
|
|
20
|
-
* It was a <div role="checkbox"> with its own tabindex and its own Space and
|
|
21
|
-
* Enter handling. It is bd-checkbox now, drawn as a circle: the same native
|
|
22
|
-
* checkbox underneath, so the browser supplies the role, the checked and
|
|
23
|
-
* disabled states, Space and the disabled tab order, and everything a form
|
|
24
|
-
* does with it -- submit, reset, required, <fieldset disabled>, Enter
|
|
25
|
-
* submitting rather than toggling -- is bd-checkbox's, written once
|
|
26
|
-
* (shared/form-control.ts). Only the drawing is its own: the circle, and no
|
|
27
|
-
* indeterminate mark.
|
|
28
|
-
*/
|
|
29
|
-
let BdToggleRadio = class BdToggleRadio extends BdCheckbox {
|
|
30
|
-
static { this.styles = [radioCSS]; }
|
|
31
|
-
render() {
|
|
32
|
-
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{BdCheckbox as n}from"../checkbox/checkbox.js";import r from"./radio.css.js";import{html as i}from"lit";var a=class extends n{static{this.styles=[r]}render(){return i`
|
|
33
2
|
<label class="bd-radio">
|
|
34
3
|
<input
|
|
35
4
|
type="checkbox"
|
|
36
5
|
.checked=${this.checked}
|
|
37
|
-
?disabled=${this.disabled
|
|
6
|
+
?disabled=${this.disabled||this._formDisabled}
|
|
38
7
|
?required=${this.required}
|
|
39
8
|
@change=${this._onChange}
|
|
40
9
|
@keydown=${this._onKeydown}
|
|
@@ -42,10 +11,5 @@ let BdToggleRadio = class BdToggleRadio extends BdCheckbox {
|
|
|
42
11
|
<span class="box" part="box"><span class="dot"></span></span>
|
|
43
12
|
<span class="label" part="label"><slot>${this.label}</slot></span>
|
|
44
13
|
</label>
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
BdToggleRadio = __decorate([
|
|
49
|
-
defineElement("bd-toggle-radio")
|
|
50
|
-
], BdToggleRadio);
|
|
14
|
+
`}};a=t([e(`bd-toggle-radio`)],a);
|
|
51
15
|
//# sourceMappingURL=toggle-radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-radio.js","
|
|
1
|
+
{"version":3,"file":"toggle-radio.js","names":["radioCSS","_decorate","__decorate","radio_css_default","BdToggleRadio","BdCheckbox","defineElement"],"sources":["../../../../src/components/radio/toggle-radio.ts"],"sourcesContent":["import { html } from \"lit\";\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 radioCSS from \"./radio.css.ts\";\nimport { BdCheckbox } from \"#components/checkbox/checkbox.ts\";\n\n/**\n * Toggles independently despite looking like a radio, which is why it is a\n * checkbox underneath. It duplicates bd-checkbox with a circular skin, and a\n * round control that does not behave exclusively misleads people — it should\n * be retired in favour of bd-checkbox. Kept working here because it is a\n * published element with stories against it.\n *\n * It was a <div role=\"checkbox\"> with its own tabindex and its own Space and\n * Enter handling. It is bd-checkbox now, drawn as a circle: the same native\n * checkbox underneath, so the browser supplies the role, the checked and\n * disabled states, Space and the disabled tab order, and everything a form\n * does with it -- submit, reset, required, <fieldset disabled>, Enter\n * submitting rather than toggling -- is bd-checkbox's, written once\n * (shared/form-control.ts). Only the drawing is its own: the circle, and no\n * indeterminate mark.\n */\n@defineElement(\"bd-toggle-radio\")\nclass BdToggleRadio extends BdCheckbox {\n static styles = [radioCSS];\n\n render() {\n return html`\n <label class=\"bd-radio\">\n <input\n type=\"checkbox\"\n .checked=${this.checked}\n ?disabled=${this.disabled || this._formDisabled}\n ?required=${this.required}\n @change=${this._onChange}\n @keydown=${this._onKeydown}\n />\n <span class=\"box\" part=\"box\"><span class=\"dot\"></span></span>\n <span class=\"label\" part=\"label\"><slot>${this.label}</slot></span>\n </label>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-toggle-radio\": BdToggleRadio;\n }\n}\n"],"mappings":"A,mRAuBA,IACMI,EADN,cAC4BC,CAAW,C,OACrB,KAAA,OAAA,CAACL,CAAQ,C,CAEzB,QAAS,CACP,MAAO,EAAI;;;;qBAIM,KAAK,QAAQ;sBACZ,KAAK,UAAY,KAAK,cAAc;sBACpC,KAAK,SAAS;oBAChB,KAAK,UAAU;qBACd,KAAK,WAAW;;;iDAGY,KAAK,MAAM;;KAG1D,CACF,EApBC,EAAAC,EAAA,CAAAK,EAAc,iBAAiB,CAAA,EAAAF,CAAA"}
|
|
@@ -1,47 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { below } from "../shared/token-scales.js";
|
|
3
|
-
export default css `
|
|
4
|
-
:host {
|
|
5
|
-
display: block;
|
|
6
|
-
width: 100%;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
/* The grid's own width decides when its cards stack, not the screen's:
|
|
9
|
-
across the page the two are the same, in a narrower column the cards
|
|
10
|
-
stack with it. */
|
|
11
|
-
container-type: inline-size;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.bd-reviewgrid-title {
|
|
15
|
-
text-align: center;
|
|
16
|
-
margin: 0 0 var(--spacing-32);
|
|
17
|
-
color: var(--color-text-primary);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.bd-reviewgrid-grid {
|
|
21
|
-
display: grid;
|
|
22
|
-
grid-template-columns: repeat(var(--bd-review-columns, 3), 1fr);
|
|
23
|
-
gap: var(--spacing-24);
|
|
24
|
-
width: 100%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.bd-reviewgrid-grid--single {
|
|
28
|
-
max-width: var(--bd-review-single-max-width, 560px);
|
|
29
|
-
margin-inline: auto;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
::slotted(bd-review) {
|
|
33
|
-
min-width: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* below lg, as install-options: three cards stack across 900-991 too. */
|
|
37
|
-
@container ${unsafeCSS(below('lg'))} {
|
|
38
|
-
.bd-reviewgrid-grid {
|
|
39
|
-
grid-template-columns: 1fr;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.bd-reviewgrid-grid--single {
|
|
43
|
-
max-width: 100%;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
1
|
+
import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{box-sizing:border-box;width:100%;display:block;container-type:inline-size}.bd-reviewgrid-title{text-align:center;margin:0 0 var(--spacing-32);color:var(--color-text-primary)}.bd-reviewgrid-grid{grid-template-columns:repeat(var(--bd-review-columns,3), 1fr);gap:var(--spacing-24);width:100%;display:grid}.bd-reviewgrid-grid--single{max-width:var(--bd-review-single-max-width,560px);margin-inline:auto}::slotted(bd-review){min-width:0}@container (width<992px){.bd-reviewgrid-grid{grid-template-columns:1fr}.bd-reviewgrid-grid--single{max-width:100%}}`;export{t as default};
|
|
47
2
|
//# sourceMappingURL=review-grid.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-grid.css.js","
|
|
1
|
+
{"version":3,"file":"review-grid.css.js","names":["review_grid_css_default"],"sources":["../../../../src/components/review/review-grid.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { below } from \"#shared/token-scales.ts\";\n\nexport default css`\n :host {\n display: block;\n width: 100%;\n box-sizing: border-box;\n /* The grid's own width decides when its cards stack, not the screen's:\n across the page the two are the same, in a narrower column the cards\n stack with it. */\n container-type: inline-size;\n }\n\n .bd-reviewgrid-title {\n text-align: center;\n margin: 0 0 var(--spacing-32);\n color: var(--color-text-primary);\n }\n\n .bd-reviewgrid-grid {\n display: grid;\n grid-template-columns: repeat(var(--bd-review-columns, 3), 1fr);\n gap: var(--spacing-24);\n width: 100%;\n }\n\n .bd-reviewgrid-grid--single {\n max-width: var(--bd-review-single-max-width, 560px);\n margin-inline: auto;\n }\n\n ::slotted(bd-review) {\n min-width: 0;\n }\n\n /* below lg, as install-options: three cards stack across 900-991 too. */\n @container ${unsafeCSS(below('lg'))} {\n .bd-reviewgrid-grid {\n grid-template-columns: 1fr;\n }\n\n .bd-reviewgrid-grid--single {\n max-width: 100%;\n }\n }\n`;"],"mappings":"A,4DAGA,IAAAA,EAAe,CAAG,4iB"}
|
|
@@ -1,59 +1,14 @@
|
|
|
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, nothing } from "lit";
|
|
8
|
-
import { property, state } from "lit/decorators.js";
|
|
9
|
-
import { defineElement } from "../shared/define-element.js";
|
|
10
|
-
import { tokens } from "../../tokens/tokens.js";
|
|
11
|
-
import "../heading/heading.js";
|
|
12
|
-
import reviewGridCSS from "./review-grid.css.js";
|
|
13
|
-
import { ensembleCSS } from "../shared/ensemble.css.js";
|
|
14
|
-
import "./review.js";
|
|
15
|
-
let BdReviewGrid = class BdReviewGrid extends LitElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.title = "";
|
|
19
|
-
this._columns = 3;
|
|
20
|
-
}
|
|
21
|
-
static { this.styles = [tokens, ensembleCSS, reviewGridCSS]; }
|
|
22
|
-
get _items() {
|
|
23
|
-
return [...this.children].filter((el) => el.tagName === "BD-REVIEW");
|
|
24
|
-
}
|
|
25
|
-
/* The grid is a list (role="list" below), and each bd-review in it says it
|
|
26
|
-
is one of its items itself (review.ts). */
|
|
27
|
-
_onSlotChange() {
|
|
28
|
-
const count = this._items.length;
|
|
29
|
-
this._columns = count <= 0 ? 1 : Math.min(count, 3);
|
|
30
|
-
}
|
|
31
|
-
render() {
|
|
32
|
-
const singleCard = this._columns === 1;
|
|
33
|
-
return html `
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import{tokens as t}from"../../tokens/tokens.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../heading/heading.js";import{ensembleCSS as r}from"../shared/ensemble.css.js";import i from"./review-grid.css.js";import"./review.js";import{LitElement as a,html as o,nothing as s}from"lit";import{property as c,state as l}from"lit/decorators.js";var u=class extends a{constructor(...e){super(...e),this.title=``,this._columns=3}static{this.styles=[t,r,i]}get _items(){return[...this.children].filter(e=>e.tagName===`BD-REVIEW`)}_onSlotChange(){let e=this._items.length;this._columns=e<=0?1:Math.min(e,3)}render(){let e=this._columns===1;return o`
|
|
34
2
|
<div class="bd-ensemble">
|
|
35
|
-
${this.title
|
|
36
|
-
? html `<bd-h as="h2" class="bd-reviewgrid-title"><slot name="title">${this.title}</slot></bd-h>`
|
|
37
|
-
: nothing}
|
|
3
|
+
${this.title?o`<bd-h as="h2" class="bd-reviewgrid-title"><slot name="title">${this.title}</slot></bd-h>`:s}
|
|
38
4
|
|
|
39
5
|
<div
|
|
40
|
-
class="bd-reviewgrid-grid ${
|
|
6
|
+
class="bd-reviewgrid-grid ${e?`bd-reviewgrid-grid--single`:``}"
|
|
41
7
|
style="--bd-review-columns: ${this._columns};"
|
|
42
8
|
role="list"
|
|
43
9
|
>
|
|
44
10
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
45
11
|
</div>
|
|
46
12
|
</div>
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
__decorate([
|
|
51
|
-
property({ type: String })
|
|
52
|
-
], BdReviewGrid.prototype, "title", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
state()
|
|
55
|
-
], BdReviewGrid.prototype, "_columns", void 0);
|
|
56
|
-
BdReviewGrid = __decorate([
|
|
57
|
-
defineElement("bd-review-grid")
|
|
58
|
-
], BdReviewGrid);
|
|
13
|
+
`}};n([c({type:String})],u.prototype,`title`,void 0),n([l()],u.prototype,`_columns`,void 0),u=n([e(`bd-review-grid`)],u);
|
|
59
14
|
//# sourceMappingURL=review-grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-grid.js","
|
|
1
|
+
{"version":3,"file":"review-grid.js","names":["reviewGridCSS","_decorate","__decorate","review_grid_css_default","BdReviewGrid","LitElement","_args","tokens","ensembleCSS","el","count","singleCard","nothing","property","state","defineElement"],"sources":["../../../../src/components/review/review-grid.ts"],"sourcesContent":["import { LitElement, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { tokens } from \"#tokens/tokens.ts\";\nimport \"#components/heading/heading.ts\";\nimport reviewGridCSS from \"./review-grid.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport \"./review.ts\";\n\n\n@defineElement(\"bd-review-grid\")\nclass BdReviewGrid extends LitElement {\n static styles = [tokens, ensembleCSS, reviewGridCSS];\n\n @property({ type: String })\n title = \"\";\n @state()\n _columns = 3;\n\n get _items() {\n return [...this.children].filter((el) => el.tagName === \"BD-REVIEW\");\n }\n\n /* The grid is a list (role=\"list\" below), and each bd-review in it says it\n is one of its items itself (review.ts). */\n _onSlotChange() {\n const count = this._items.length;\n this._columns = count <= 0 ? 1 : Math.min(count, 3);\n }\n\n render() {\n const singleCard = this._columns === 1;\n\n return html`\n <div class=\"bd-ensemble\">\n ${this.title\n ? html`<bd-h as=\"h2\" class=\"bd-reviewgrid-title\"><slot name=\"title\">${this.title}</slot></bd-h>`\n : nothing}\n\n <div\n class=\"bd-reviewgrid-grid ${singleCard ? \"bd-reviewgrid-grid--single\" : \"\"}\"\n style=\"--bd-review-columns: ${this._columns};\"\n role=\"list\"\n >\n <slot @slotchange=${this._onSlotChange}></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-review-grid\": BdReviewGrid;\n }\n}"],"mappings":"A,obAUA,IACMI,EADN,cAC2BC,CAAW,C,8BAI5B,KAAA,MAAA,GAEG,KAAA,SAAA,C,QALK,KAAA,OAAA,CAACE,EAAQC,EAAaR,CAAa,C,CAOnD,IAAI,QAAS,CACX,MAAO,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,OAAQ,GAAOS,EAAG,UAAY,WAAW,CACrE,CAIA,eAAgB,CACd,IAAMC,EAAQ,KAAK,OAAO,OAC1B,KAAK,SAAWA,GAAS,EAAI,EAAI,KAAK,IAAIA,EAAO,CAAC,CACpD,CAEA,QAAS,CACP,IAAMC,EAAa,KAAK,WAAa,EAErC,MAAO,EAAI;;UAEL,KAAK,MACH,CAAI,gEAAgE,KAAK,MAAM,gBAC/EC,EAAQ;;;sCAGkBD,EAAa,6BAA+B,GAAG;wCAC7C,KAAK,SAAS;;;8BAGxB,KAAK,cAAc;;;KAI/C,CACF,EAnCGV,EAAA,CAAAY,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAT,EAAA,UAAA,QAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAa,EAAM,CAAA,EAAAV,EAAA,UAAA,WAAA,IAAA,EAAA,EANR,EAAAH,EAAA,CAAAc,EAAc,gBAAgB,CAAA,EAAAX,CAAA"}
|