@repobit/dex-system-design 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/src/_bundled/oxc-project_runtime/helpers/esm/decorate.js +1 -0
- package/dist/src/components/accordion/accordion-bg.css.js +1 -288
- package/dist/src/components/accordion/accordion-bg.css.js.map +1 -1
- package/dist/src/components/accordion/accordion-bg.d.ts +5 -5
- package/dist/src/components/accordion/accordion-bg.js +15 -210
- package/dist/src/components/accordion/accordion-bg.js.map +1 -1
- package/dist/src/components/accordion/accordion-keyboard.js +1 -89
- package/dist/src/components/accordion/accordion-keyboard.js.map +1 -1
- package/dist/src/components/accordion/accordion-panel.js +1 -22
- package/dist/src/components/accordion/accordion-panel.js.map +1 -1
- package/dist/src/components/accordion/accordion.css.js +1 -380
- package/dist/src/components/accordion/accordion.css.js.map +1 -1
- package/dist/src/components/accordion/accordion.d.ts +7 -7
- package/dist/src/components/accordion/accordion.js +16 -138
- package/dist/src/components/accordion/accordion.js.map +1 -1
- package/dist/src/components/agent-endpoints/agent-endpoints.css.js +1 -88
- package/dist/src/components/agent-endpoints/agent-endpoints.css.js.map +1 -1
- package/dist/src/components/agent-endpoints/agent-endpoints.d.ts +4 -4
- package/dist/src/components/agent-endpoints/agent-endpoints.js +17 -76
- package/dist/src/components/agent-endpoints/agent-endpoints.js.map +1 -1
- package/dist/src/components/alert/alert.css.js +1 -217
- package/dist/src/components/alert/alert.css.js.map +1 -1
- package/dist/src/components/alert/alert.d.ts +4 -4
- package/dist/src/components/alert/alert.js +6 -110
- package/dist/src/components/alert/alert.js.map +1 -1
- package/dist/src/components/anchor/anchor-nav.css.js +1 -546
- package/dist/src/components/anchor/anchor-nav.css.js.map +1 -1
- package/dist/src/components/anchor/anchor-nav.d.ts +4 -4
- package/dist/src/components/anchor/anchor-nav.js +23 -567
- package/dist/src/components/anchor/anchor-nav.js.map +1 -1
- package/dist/src/components/annotation/annotation.css.js +1 -64
- package/dist/src/components/annotation/annotation.css.js.map +1 -1
- package/dist/src/components/annotation/annotation.d.ts +2 -2
- package/dist/src/components/annotation/annotation.js +7 -72
- package/dist/src/components/annotation/annotation.js.map +1 -1
- package/dist/src/components/audience-card/audience-card.css.js +1 -122
- package/dist/src/components/audience-card/audience-card.css.js.map +1 -1
- package/dist/src/components/audience-card/audience-card.d.ts +2 -2
- package/dist/src/components/audience-card/audience-card.js +8 -83
- package/dist/src/components/audience-card/audience-card.js.map +1 -1
- package/dist/src/components/avatar/avatar.css.js +1 -65
- package/dist/src/components/avatar/avatar.css.js.map +1 -1
- package/dist/src/components/avatar/avatar.d.ts +3 -3
- package/dist/src/components/avatar/avatar.js +6 -76
- package/dist/src/components/avatar/avatar.js.map +1 -1
- package/dist/src/components/awards/awards-flex.css.js +1 -273
- package/dist/src/components/awards/awards-flex.css.js.map +1 -1
- package/dist/src/components/awards/awards-flex.d.ts +12 -12
- package/dist/src/components/awards/awards-flex.js +33 -264
- package/dist/src/components/awards/awards-flex.js.map +1 -1
- package/dist/src/components/awards/awards-spotlight.css.js +1 -161
- package/dist/src/components/awards/awards-spotlight.css.js.map +1 -1
- package/dist/src/components/awards/awards-spotlight.d.ts +4 -4
- package/dist/src/components/awards/awards-spotlight.js +24 -140
- package/dist/src/components/awards/awards-spotlight.js.map +1 -1
- package/dist/src/components/awards/awards.css.js +1 -401
- package/dist/src/components/awards/awards.css.js.map +1 -1
- package/dist/src/components/awards/awards.d.ts +13 -13
- package/dist/src/components/awards/awards.js +26 -179
- package/dist/src/components/awards/awards.js.map +1 -1
- package/dist/src/components/awards/scroll-slides.js +1 -131
- package/dist/src/components/awards/scroll-slides.js.map +1 -1
- package/dist/src/components/back/back.css.js +1 -91
- package/dist/src/components/back/back.css.js.map +1 -1
- package/dist/src/components/back/back.d.ts +1 -1
- package/dist/src/components/back/back.js +8 -71
- package/dist/src/components/back/back.js.map +1 -1
- package/dist/src/components/badge/badge.css.js +1 -204
- package/dist/src/components/badge/badge.css.js.map +1 -1
- package/dist/src/components/badge/badge.d.ts +4 -4
- package/dist/src/components/badge/badge.js +2 -117
- package/dist/src/components/badge/badge.js.map +1 -1
- package/dist/src/components/bento-grid/bento-grid.css.js +16 -150
- package/dist/src/components/bento-grid/bento-grid.css.js.map +1 -1
- package/dist/src/components/bento-grid/bento-grid.d.ts +3 -3
- package/dist/src/components/bento-grid/bento-grid.js +10 -189
- package/dist/src/components/bento-grid/bento-grid.js.map +1 -1
- package/dist/src/components/bento-grid/bento-item.css.js +1 -338
- package/dist/src/components/bento-grid/bento-item.css.js.map +1 -1
- package/dist/src/components/bento-grid/bento-item.d.ts +3 -3
- package/dist/src/components/bento-grid/bento-item.js +10 -94
- package/dist/src/components/bento-grid/bento-item.js.map +1 -1
- package/dist/src/components/blockquote/blockquote.css.js +1 -54
- package/dist/src/components/blockquote/blockquote.css.js.map +1 -1
- package/dist/src/components/blockquote/blockquote.d.ts +2 -2
- package/dist/src/components/blockquote/blockquote.js +1 -44
- package/dist/src/components/blockquote/blockquote.js.map +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.css.js +1 -168
- package/dist/src/components/breadcrumb/breadcrumb.css.js.map +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.d.ts +5 -5
- package/dist/src/components/breadcrumb/breadcrumb.js +9 -166
- package/dist/src/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/src/components/button/button.css.js +1 -843
- package/dist/src/components/button/button.css.js.map +1 -1
- package/dist/src/components/button/button.d.ts +5 -5
- package/dist/src/components/button/button.js +18 -420
- package/dist/src/components/button/button.js.map +1 -1
- package/dist/src/components/caption/caption.css.js +1 -29
- package/dist/src/components/caption/caption.css.js.map +1 -1
- package/dist/src/components/caption/caption.d.ts +3 -3
- package/dist/src/components/caption/caption.js +2 -36
- package/dist/src/components/caption/caption.js.map +1 -1
- package/dist/src/components/card-features/card-features.css.js +1 -120
- package/dist/src/components/card-features/card-features.css.js.map +1 -1
- package/dist/src/components/card-features/card-features.d.ts +3 -3
- package/dist/src/components/card-features/card-features.js +12 -145
- package/dist/src/components/card-features/card-features.js.map +1 -1
- package/dist/src/components/cards/card.css.js +1 -369
- package/dist/src/components/cards/card.css.js.map +1 -1
- package/dist/src/components/cards/card.d.ts +3 -3
- package/dist/src/components/cards/card.js +21 -312
- package/dist/src/components/cards/card.js.map +1 -1
- package/dist/src/components/carousel/carousel.css.js +1 -261
- package/dist/src/components/carousel/carousel.css.js.map +1 -1
- package/dist/src/components/carousel/carousel.d.ts +5 -5
- package/dist/src/components/carousel/carousel.js +13 -297
- package/dist/src/components/carousel/carousel.js.map +1 -1
- package/dist/src/components/checkbox/checkbox.css.js +1 -173
- package/dist/src/components/checkbox/checkbox.css.js.map +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +2 -2
- package/dist/src/components/checkbox/checkbox.js +5 -138
- package/dist/src/components/checkbox/checkbox.js.map +1 -1
- package/dist/src/components/code/code.css.js +1 -73
- package/dist/src/components/code/code.css.js.map +1 -1
- package/dist/src/components/code/code.d.ts +2 -2
- package/dist/src/components/code/code.js +4 -87
- package/dist/src/components/code/code.js.map +1 -1
- package/dist/src/components/compare/compare.css.js +1 -478
- package/dist/src/components/compare/compare.css.js.map +1 -1
- package/dist/src/components/compare/compare.d.ts +5 -5
- package/dist/src/components/compare/compare.js +23 -476
- package/dist/src/components/compare/compare.js.map +1 -1
- package/dist/src/components/comparison-panel/comparison-panel.css.js +1 -141
- package/dist/src/components/comparison-panel/comparison-panel.css.js.map +1 -1
- package/dist/src/components/comparison-panel/comparison-panel.d.ts +2 -2
- package/dist/src/components/comparison-panel/comparison-panel.js +18 -86
- package/dist/src/components/comparison-panel/comparison-panel.js.map +1 -1
- package/dist/src/components/compatibility-table/compatibility-table.css.js +1 -391
- package/dist/src/components/compatibility-table/compatibility-table.css.js.map +1 -1
- package/dist/src/components/compatibility-table/compatibility-table.d.ts +2 -2
- package/dist/src/components/compatibility-table/compatibility-table.js +26 -136
- package/dist/src/components/compatibility-table/compatibility-table.js.map +1 -1
- package/dist/src/components/cta-banner/cta-banner.css.js +1 -97
- package/dist/src/components/cta-banner/cta-banner.css.js.map +1 -1
- package/dist/src/components/cta-banner/cta-banner.d.ts +2 -2
- package/dist/src/components/cta-banner/cta-banner.js +8 -51
- package/dist/src/components/cta-banner/cta-banner.js.map +1 -1
- package/dist/src/components/display/display.css.js +1 -95
- package/dist/src/components/display/display.css.js.map +1 -1
- package/dist/src/components/display/display.d.ts +2 -2
- package/dist/src/components/display/display.js +3 -84
- package/dist/src/components/display/display.js.map +1 -1
- package/dist/src/components/divider/divider-horizontal.d.ts +2 -2
- package/dist/src/components/divider/divider-horizontal.js +4 -63
- package/dist/src/components/divider/divider-horizontal.js.map +1 -1
- package/dist/src/components/divider/divider-vertical.d.ts +2 -2
- package/dist/src/components/divider/divider-vertical.js +6 -61
- package/dist/src/components/divider/divider-vertical.js.map +1 -1
- package/dist/src/components/divider/divider.css.js +1 -20
- package/dist/src/components/divider/divider.css.js.map +1 -1
- package/dist/src/components/dropdown/dropdown.css.js +1 -121
- package/dist/src/components/dropdown/dropdown.css.js.map +1 -1
- package/dist/src/components/dropdown/dropdown.d.ts +5 -5
- package/dist/src/components/dropdown/dropdown.js +17 -283
- package/dist/src/components/dropdown/dropdown.js.map +1 -1
- package/dist/src/components/features/features.css.js +1 -123
- package/dist/src/components/features/features.css.js.map +1 -1
- package/dist/src/components/features/features.d.ts +5 -5
- package/dist/src/components/features/features.js +11 -71
- package/dist/src/components/features/features.js.map +1 -1
- package/dist/src/components/features-tab/features-tab.css.js +1 -100
- package/dist/src/components/features-tab/features-tab.css.js.map +1 -1
- package/dist/src/components/features-tab/features-tab.d.ts +5 -5
- package/dist/src/components/features-tab/features-tab.js +9 -70
- package/dist/src/components/features-tab/features-tab.js.map +1 -1
- package/dist/src/components/fieldset/fieldset.css.js +1 -28
- package/dist/src/components/fieldset/fieldset.css.js.map +1 -1
- package/dist/src/components/fieldset/fieldset.d.ts +2 -2
- package/dist/src/components/fieldset/fieldset.js +3 -31
- package/dist/src/components/fieldset/fieldset.js.map +1 -1
- package/dist/src/components/footer/footer-images.js +5 -27
- package/dist/src/components/footer/footer-images.js.map +1 -1
- package/dist/src/components/footer/footer-links-group.css.js +1 -33
- package/dist/src/components/footer/footer-links-group.css.js.map +1 -1
- package/dist/src/components/footer/footer-links-group.d.ts +3 -3
- package/dist/src/components/footer/footer-links-group.js +3 -32
- package/dist/src/components/footer/footer-links-group.js.map +1 -1
- package/dist/src/components/footer/footer-locale.js +1 -45
- package/dist/src/components/footer/footer-locale.js.map +1 -1
- package/dist/src/components/footer/footer-lp.d.ts +7 -7
- package/dist/src/components/footer/footer-lp.js +8 -121
- package/dist/src/components/footer/footer-lp.js.map +1 -1
- package/dist/src/components/footer/footer-nav-menu.css.js +1 -61
- package/dist/src/components/footer/footer-nav-menu.css.js.map +1 -1
- package/dist/src/components/footer/footer-nav-menu.d.ts +3 -3
- package/dist/src/components/footer/footer-nav-menu.js +3 -47
- package/dist/src/components/footer/footer-nav-menu.js.map +1 -1
- package/dist/src/components/footer/footer.css.js +1 -664
- package/dist/src/components/footer/footer.css.js.map +1 -1
- package/dist/src/components/footer/footer.d.ts +13 -13
- package/dist/src/components/footer/footer.js +20 -305
- package/dist/src/components/footer/footer.js.map +1 -1
- package/dist/src/components/footer/localeMap.js +1 -1
- package/dist/src/components/footer/localeMap.js.map +1 -1
- package/dist/src/components/grid/grid.css.js +1 -78
- package/dist/src/components/grid/grid.css.js.map +1 -1
- package/dist/src/components/grid/grid.d.ts +2 -2
- package/dist/src/components/grid/grid.js +9 -126
- package/dist/src/components/grid/grid.js.map +1 -1
- package/dist/src/components/header/header-code.css.js +1 -369
- package/dist/src/components/header/header-code.css.js.map +1 -1
- package/dist/src/components/header/header-code.d.ts +4 -4
- package/dist/src/components/header/header-code.js +15 -163
- package/dist/src/components/header/header-code.js.map +1 -1
- package/dist/src/components/header/header.css.js +1 -757
- package/dist/src/components/header/header.css.js.map +1 -1
- package/dist/src/components/header/header.d.ts +7 -7
- package/dist/src/components/header/header.js +4 -212
- package/dist/src/components/header/header.js.map +1 -1
- package/dist/src/components/heading/heading.css.js +1 -89
- package/dist/src/components/heading/heading.css.js.map +1 -1
- package/dist/src/components/heading/heading.d.ts +2 -2
- package/dist/src/components/heading/heading.js +1 -108
- package/dist/src/components/heading/heading.js.map +1 -1
- package/dist/src/components/help-text/help-text.css.js +1 -19
- package/dist/src/components/help-text/help-text.css.js.map +1 -1
- package/dist/src/components/help-text/help-text.d.ts +2 -2
- package/dist/src/components/help-text/help-text.js +3 -31
- package/dist/src/components/help-text/help-text.js.map +1 -1
- package/dist/src/components/hero/hero.css.js +1 -362
- package/dist/src/components/hero/hero.css.js.map +1 -1
- package/dist/src/components/hero/hero.d.ts +3 -3
- package/dist/src/components/hero/hero.js +12 -164
- package/dist/src/components/hero/hero.js.map +1 -1
- package/dist/src/components/highlight/highlight.css.js +1 -175
- package/dist/src/components/highlight/highlight.css.js.map +1 -1
- package/dist/src/components/highlight/highlight.d.ts +3 -3
- package/dist/src/components/highlight/highlight.js +4 -115
- package/dist/src/components/highlight/highlight.js.map +1 -1
- package/dist/src/components/icons/analysis-icon.d.ts +1 -1
- package/dist/src/components/icons/analysis-icon.js +2 -20
- package/dist/src/components/icons/analysis-icon.js.map +1 -1
- package/dist/src/components/icons/arrow-down-icon.d.ts +1 -1
- package/dist/src/components/icons/arrow-down-icon.js +2 -20
- package/dist/src/components/icons/arrow-down-icon.js.map +1 -1
- package/dist/src/components/icons/arrow-icon.d.ts +1 -1
- package/dist/src/components/icons/arrow-icon.js +2 -48
- package/dist/src/components/icons/arrow-icon.js.map +1 -1
- package/dist/src/components/icons/arrow-right-icon.d.ts +1 -1
- package/dist/src/components/icons/arrow-right-icon.js +2 -45
- package/dist/src/components/icons/arrow-right-icon.js.map +1 -1
- package/dist/src/components/icons/arrow-up-icon.d.ts +1 -1
- package/dist/src/components/icons/arrow-up-icon.js +2 -33
- package/dist/src/components/icons/arrow-up-icon.js.map +1 -1
- package/dist/src/components/icons/av-comparatives-icon.js +2 -31
- package/dist/src/components/icons/av-comparatives-icon.js.map +1 -1
- package/dist/src/components/icons/bd-ai-icon.js +2 -31
- package/dist/src/components/icons/bd-ai-icon.js.map +1 -1
- package/dist/src/components/icons/best-brands-icon.js +2 -31
- package/dist/src/components/icons/best-brands-icon.js.map +1 -1
- package/dist/src/components/icons/brand-signature-icon.d.ts +1 -1
- package/dist/src/components/icons/brand-signature-icon.js +2 -46
- package/dist/src/components/icons/brand-signature-icon.js.map +1 -1
- package/dist/src/components/icons/check-icon.d.ts +1 -1
- package/dist/src/components/icons/check-icon.js +2 -31
- package/dist/src/components/icons/check-icon.js.map +1 -1
- package/dist/src/components/icons/circle-info-icon.d.ts +1 -1
- package/dist/src/components/icons/circle-info-icon.js +2 -35
- package/dist/src/components/icons/circle-info-icon.js.map +1 -1
- package/dist/src/components/icons/close-icon.d.ts +1 -1
- package/dist/src/components/icons/close-icon.js +2 -20
- package/dist/src/components/icons/close-icon.js.map +1 -1
- package/dist/src/components/icons/enterprise-icon.d.ts +1 -1
- package/dist/src/components/icons/enterprise-icon.js +2 -22
- package/dist/src/components/icons/enterprise-icon.js.map +1 -1
- package/dist/src/components/icons/family-icon.d.ts +1 -1
- package/dist/src/components/icons/family-icon.js +2 -20
- package/dist/src/components/icons/family-icon.js.map +1 -1
- package/dist/src/components/icons/globe-icon.d.ts +1 -1
- package/dist/src/components/icons/globe-icon.js +2 -20
- package/dist/src/components/icons/globe-icon.js.map +1 -1
- package/dist/src/components/icons/guide-icon.d.ts +1 -1
- package/dist/src/components/icons/guide-icon.js +2 -20
- package/dist/src/components/icons/guide-icon.js.map +1 -1
- package/dist/src/components/icons/home-icon.d.ts +1 -1
- package/dist/src/components/icons/home-icon.js +2 -22
- package/dist/src/components/icons/home-icon.js.map +1 -1
- package/dist/src/components/icons/icon-element.js +1 -162
- package/dist/src/components/icons/icon-element.js.map +1 -1
- package/dist/src/components/icons/icons.d.ts +23 -23
- package/dist/src/components/icons/icons.js +1 -42
- package/dist/src/components/icons/individual-icon.d.ts +1 -1
- package/dist/src/components/icons/individual-icon.js +2 -20
- package/dist/src/components/icons/individual-icon.js.map +1 -1
- package/dist/src/components/icons/laurel-icon.d.ts +1 -1
- package/dist/src/components/icons/laurel-icon.js +2 -24
- package/dist/src/components/icons/laurel-icon.js.map +1 -1
- package/dist/src/components/icons/machine-learning-icon.d.ts +1 -1
- package/dist/src/components/icons/machine-learning-icon.js +2 -20
- package/dist/src/components/icons/machine-learning-icon.js.map +1 -1
- package/dist/src/components/icons/marks.d.ts +9 -9
- package/dist/src/components/icons/marks.js +1 -41
- package/dist/src/components/icons/minus-icon.d.ts +1 -1
- package/dist/src/components/icons/minus-icon.js +2 -19
- package/dist/src/components/icons/minus-icon.js.map +1 -1
- package/dist/src/components/icons/missing-icon.d.ts +1 -1
- package/dist/src/components/icons/missing-icon.js +3 -53
- package/dist/src/components/icons/missing-icon.js.map +1 -1
- package/dist/src/components/icons/pause-icon.d.ts +1 -1
- package/dist/src/components/icons/pause-icon.js +2 -22
- package/dist/src/components/icons/pause-icon.js.map +1 -1
- package/dist/src/components/icons/pc-mag-2024-icon.js +2 -31
- package/dist/src/components/icons/pc-mag-2024-icon.js.map +1 -1
- package/dist/src/components/icons/pc-mag-business-icon.js +2 -31
- package/dist/src/components/icons/pc-mag-business-icon.js.map +1 -1
- package/dist/src/components/icons/pc-mag-icon.js +2 -31
- package/dist/src/components/icons/pc-mag-icon.js.map +1 -1
- package/dist/src/components/icons/pc-mag-readers-icon.js +2 -30
- package/dist/src/components/icons/pc-mag-readers-icon.js.map +1 -1
- package/dist/src/components/icons/play-icon.d.ts +1 -1
- package/dist/src/components/icons/play-icon.js +2 -22
- package/dist/src/components/icons/play-icon.js.map +1 -1
- package/dist/src/components/icons/plus-icon.d.ts +1 -1
- package/dist/src/components/icons/plus-icon.js +2 -19
- package/dist/src/components/icons/plus-icon.js.map +1 -1
- package/dist/src/components/icons/quote-icon.d.ts +1 -1
- package/dist/src/components/icons/quote-icon.js +2 -30
- package/dist/src/components/icons/quote-icon.js.map +1 -1
- package/dist/src/components/icons/small-business-icon.d.ts +1 -1
- package/dist/src/components/icons/small-business-icon.js +2 -22
- package/dist/src/components/icons/small-business-icon.js.map +1 -1
- package/dist/src/components/icons/top-product-icon.js +2 -31
- package/dist/src/components/icons/top-product-icon.js.map +1 -1
- package/dist/src/components/image/image.css.js +1 -106
- package/dist/src/components/image/image.css.js.map +1 -1
- package/dist/src/components/image/image.d.ts +2 -2
- package/dist/src/components/image/image.js +10 -115
- package/dist/src/components/image/image.js.map +1 -1
- package/dist/src/components/input/input-clipboard.css.js +1 -93
- package/dist/src/components/input/input-clipboard.css.js.map +1 -1
- package/dist/src/components/input/input-clipboard.d.ts +5 -5
- package/dist/src/components/input/input-clipboard.js +20 -257
- package/dist/src/components/input/input-clipboard.js.map +1 -1
- package/dist/src/components/input/input.css.js +1 -9
- package/dist/src/components/input/input.css.js.map +1 -1
- package/dist/src/components/input/input.d.ts +4 -4
- package/dist/src/components/input/input.js +19 -202
- package/dist/src/components/input/input.js.map +1 -1
- package/dist/src/components/install-options/install-options.css.js +1 -308
- package/dist/src/components/install-options/install-options.css.js.map +1 -1
- package/dist/src/components/install-options/install-options.d.ts +4 -4
- package/dist/src/components/install-options/install-options.js +28 -159
- package/dist/src/components/install-options/install-options.js.map +1 -1
- package/dist/src/components/label/label.css.js +1 -33
- package/dist/src/components/label/label.css.js.map +1 -1
- package/dist/src/components/label/label.d.ts +3 -3
- package/dist/src/components/label/label.js +3 -135
- package/dist/src/components/label/label.js.map +1 -1
- package/dist/src/components/light-carousel/light-carousel.css.js +1 -270
- package/dist/src/components/light-carousel/light-carousel.css.js.map +1 -1
- package/dist/src/components/light-carousel/light-carousel.d.ts +3 -3
- package/dist/src/components/light-carousel/light-carousel.js +16 -181
- package/dist/src/components/light-carousel/light-carousel.js.map +1 -1
- package/dist/src/components/link/link.css.js +1 -288
- package/dist/src/components/link/link.css.js.map +1 -1
- package/dist/src/components/link/link.d.ts +3 -3
- package/dist/src/components/link/link.js +6 -233
- package/dist/src/components/link/link.js.map +1 -1
- package/dist/src/components/list/list-item/list-item.css.js +1 -167
- package/dist/src/components/list/list-item/list-item.css.js.map +1 -1
- package/dist/src/components/list/list-item/list-item.d.ts +3 -3
- package/dist/src/components/list/list-item/list-item.js +3 -122
- package/dist/src/components/list/list-item/list-item.js.map +1 -1
- package/dist/src/components/list/list.css.js +1 -180
- package/dist/src/components/list/list.css.js.map +1 -1
- package/dist/src/components/list/list.d.ts +1 -1
- package/dist/src/components/list/list.js +5 -82
- package/dist/src/components/list/list.js.map +1 -1
- package/dist/src/components/logo-marquee/logo-marquee.css.js +1 -93
- package/dist/src/components/logo-marquee/logo-marquee.css.js.map +1 -1
- package/dist/src/components/logo-marquee/logo-marquee.d.ts +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 +16 -5
- 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,162 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
the column below is a container, so a grid in a narrow column stacks however
|
|
5
|
-
wide the screen is. Below sm the cards stack; from sm the pairs share a row
|
|
6
|
-
and an equal grid takes two; from md an equal grid takes its full count.
|
|
7
|
-
|
|
8
|
-
A count also has to leave every card min-card-width wide, so its step is the
|
|
9
|
-
wider of its breakpoint and that many cards plus their gaps. CSS cannot read
|
|
10
|
-
the attribute, so the step is computed: once here for the defaults, and by
|
|
11
|
-
bento-grid.ts into a sheet of its own for a grid that changes one. Nothing
|
|
12
|
-
measures the grid -- the browser does, against these queries. */
|
|
13
|
-
export const TOTAL_UNITS = 24; // fine-grained tracks the weighted pairs span
|
|
14
|
-
/* The gap between the cards, as the length it is. The track's gap is a
|
|
15
|
-
--spacing-* step, which is rem and grows with the reader's text; the steps
|
|
16
|
-
used to add it as 16, 20 or 24px, so at a larger root size a count met
|
|
17
|
-
before its cards had room -- three at 260 met at 828px, where a 200% root's
|
|
18
|
-
48px gaps left each card 244. The widest step, the md gap, is counted at
|
|
19
|
-
every count: no step lands below md with more than two cards, and for two
|
|
20
|
-
the sm breakpoint is the larger term either way, so no default moves. */
|
|
21
|
-
/* no token: a container query cannot read a custom property, so the step is
|
|
22
|
-
restated as its rem -- --spacing-24 */
|
|
23
|
-
const GAP = "1.5rem";
|
|
24
|
-
/* When `count` cards fit: the breakpoint, and room for that many cards of
|
|
25
|
-
min-card-width with the gaps between them. */
|
|
26
|
-
const stepFor = (count, minCardWidth, breakpoint) => `(width >= ${BREAKPOINTS[breakpoint]}px) and (width >= calc(${count * minCardWidth}px + ${count - 1} * ${GAP}))`;
|
|
27
|
-
export const BENTO_DEFAULTS = { maxColumns: 2, equalColumns: 3, minCardWidth: 260 };
|
|
28
|
-
/* Every rule restates the one-column start, so a sheet adopted after this one
|
|
29
|
-
replaces the defaults at every width rather than adding to them. */
|
|
30
|
-
export const bentoColumnRules = ({ maxColumns, equalColumns, minCardWidth }) => {
|
|
31
|
-
const weighted = `:host(:not([variant="equal"]))`;
|
|
32
|
-
const equal = `:host([variant="equal"])`;
|
|
33
|
-
let rules = `
|
|
34
|
-
${weighted} .bd-bentogrid-track,
|
|
35
|
-
${equal} .bd-bentogrid-track {
|
|
1
|
+
import{BREAKPOINTS as e}from"../shared/token-scales.js";import{css as t}from"lit";var n=24,r=`1.5rem`,i=(t,n,i)=>`(width >= ${e[i]}px) and (width >= calc(${t*n}px + ${t-1} * ${r}))`,a={maxColumns:2,equalColumns:3,minCardWidth:260},o=({maxColumns:e,equalColumns:t,minCardWidth:n})=>{let r=`:host(:not([variant="equal"]))`,a=`:host([variant="equal"])`,o=`
|
|
2
|
+
${r} .bd-bentogrid-track,
|
|
3
|
+
${a} .bd-bentogrid-track {
|
|
36
4
|
grid-template-columns: minmax(0, 1fr);
|
|
37
5
|
}
|
|
38
6
|
|
|
39
|
-
${
|
|
40
|
-
${
|
|
7
|
+
${r} ::slotted(bd-bento-item),
|
|
8
|
+
${a} ::slotted(bd-bento-item) {
|
|
41
9
|
grid-column: auto;
|
|
42
10
|
}
|
|
43
|
-
`;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
${weighted} .bd-bentogrid-track {
|
|
48
|
-
grid-template-columns: repeat(${TOTAL_UNITS}, minmax(0, 1fr));
|
|
11
|
+
`;e>=2&&(o+=`
|
|
12
|
+
@container bento ${i(2,n,`sm`)} {
|
|
13
|
+
${r} .bd-bentogrid-track {
|
|
14
|
+
grid-template-columns: repeat(24, minmax(0, 1fr));
|
|
49
15
|
}
|
|
50
16
|
|
|
51
|
-
${
|
|
52
|
-
grid-column: span var(--bd-bento-span,
|
|
17
|
+
${r} ::slotted(bd-bento-item) {
|
|
18
|
+
grid-column: span var(--bd-bento-span, 24);
|
|
53
19
|
}
|
|
54
20
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@container bento ${stepFor(count, minCardWidth, count === 2 ? "sm" : "md")} {
|
|
60
|
-
${equal} .bd-bentogrid-track {
|
|
61
|
-
grid-template-columns: repeat(${count}, minmax(0, 1fr));
|
|
21
|
+
`);for(let e=2;e<=t;e+=1)o+=`
|
|
22
|
+
@container bento ${i(e,n,e===2?`sm`:`md`)} {
|
|
23
|
+
${a} .bd-bentogrid-track {
|
|
24
|
+
grid-template-columns: repeat(${e}, minmax(0, 1fr));
|
|
62
25
|
}
|
|
63
26
|
}
|
|
64
|
-
`;
|
|
65
|
-
}
|
|
66
|
-
return rules;
|
|
67
|
-
};
|
|
68
|
-
export default css `
|
|
69
|
-
:host {
|
|
70
|
-
display: block;
|
|
71
|
-
width: 100%;
|
|
72
|
-
box-sizing: border-box;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.bd-ensemble {
|
|
76
|
-
container: bento / inline-size;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* === BACKGROUND VARIANT — section-level tint on the column (header +
|
|
80
|
-
track), not per-card, so the panel lands on the page edges every other
|
|
81
|
-
section uses. === */
|
|
82
|
-
:host([background="tint"]) .bd-ensemble {
|
|
83
|
-
background-color: var(--status-brand-surface);
|
|
84
|
-
border-radius: var(--shape-radius-2xl);
|
|
85
|
-
padding-block: var(--spacing-40);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* === HEADER (eyebrow / title / description) === */
|
|
89
|
-
.bd-bentogrid-header {
|
|
90
|
-
display: flex;
|
|
91
|
-
flex-direction: column;
|
|
92
|
-
align-items: flex-start;
|
|
93
|
-
gap: var(--spacing-8);
|
|
94
|
-
margin-bottom: var(--spacing-48);
|
|
95
|
-
max-width: 70ch;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.bd-bentogrid-eyebrow {
|
|
99
|
-
display: block;
|
|
100
|
-
margin: 0;
|
|
101
|
-
/* The brand text role, not the brand primitive. This is a visible change and
|
|
102
|
-
not a refactor: the role is blue-600, so the eyebrow darkens and its
|
|
103
|
-
contrast on white goes 4.53:1 -> 6.18:1. blue-500 is the step CLAUDE.md
|
|
104
|
-
says is not for text, and no text role exists at blue-500's value -- the
|
|
105
|
-
roles sitting there are surface, border, action and indicator. */
|
|
106
|
-
color: var(--color-text-brand);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.bd-bentogrid-title {
|
|
110
|
-
display: block;
|
|
111
|
-
margin: 0;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.bd-bentogrid-description {
|
|
115
|
-
display: block;
|
|
116
|
-
margin: 0;
|
|
117
|
-
color: var(--color-text-muted);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/* === GRID === */
|
|
121
|
-
.bd-bentogrid-track {
|
|
122
|
-
display: grid;
|
|
123
|
-
/* The steps name the scale rather than repeating its values: --spacing-24
|
|
124
|
-
IS 24px at the default root size, but in rem, so it grows when the reader
|
|
125
|
-
enlarges their text and 24px does not. */
|
|
126
|
-
gap: var(--bd-bento-gap, var(--spacing-16));
|
|
127
|
-
/* auto, or 1fr when bento-grid.ts finds a set of brand cards: every row
|
|
128
|
-
then takes the tallest row's height, so a full-row card matches the
|
|
129
|
-
pair above it rather than the lines its wider copy column wraps to */
|
|
130
|
-
grid-auto-rows: var(--bd-bento-row-height, auto);
|
|
131
|
-
width: 100%;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@container bento ${unsafeCSS(above("sm"))} {
|
|
135
|
-
.bd-bentogrid-track {
|
|
136
|
-
gap: var(--bd-bento-gap, var(--spacing-20));
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
@container bento ${unsafeCSS(above("md"))} {
|
|
141
|
-
.bd-bentogrid-track {
|
|
142
|
-
gap: var(--bd-bento-gap, var(--spacing-24));
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/* One column until a pair has room, and a stacked grid is a single track:
|
|
147
|
-
24 units carry 23 gaps, whose own minimum -- 368px at the small gap -- is
|
|
148
|
-
wider than a phone. The equal grid used to keep them there and ran 25px
|
|
149
|
-
past a 375px screen. */
|
|
150
|
-
${unsafeCSS(bentoColumnRules(BENTO_DEFAULTS))}
|
|
151
|
-
|
|
152
|
-
::slotted(bd-bento-item) {
|
|
153
|
-
min-width: 0;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/* A featured item takes the whole row, paired or not. Paired, its span is
|
|
157
|
-
already the row's (bento-grid.ts); the equal grid has no spans to set. */
|
|
158
|
-
:host([variant="equal"]) ::slotted(bd-bento-item[priority="featured"]) {
|
|
159
|
-
grid-column: 1 / -1;
|
|
160
|
-
}
|
|
161
|
-
`;
|
|
27
|
+
`;return o},s=t`:host{box-sizing:border-box;width:100%;display:block}.bd-ensemble{container:bento/inline-size}:host([background=tint]) .bd-ensemble{background-color:var(--status-brand-surface);border-radius:var(--shape-radius-2xl);padding-block:var(--spacing-40)}.bd-bentogrid-header{align-items:flex-start;gap:var(--spacing-8);margin-bottom:var(--spacing-48);flex-direction:column;max-width:70ch;display:flex}.bd-bentogrid-eyebrow{color:var(--color-text-brand);margin:0;display:block}.bd-bentogrid-title{margin:0;display:block}.bd-bentogrid-description{color:var(--color-text-muted);margin:0;display:block}.bd-bentogrid-track{gap:var(--bd-bento-gap,var(--spacing-16));grid-auto-rows:var(--bd-bento-row-height,auto);width:100%;display:grid}@container bento (width>=576px){.bd-bentogrid-track{gap:var(--bd-bento-gap,var(--spacing-20))}}@container bento (width>=768px){.bd-bentogrid-track{gap:var(--bd-bento-gap,var(--spacing-24))}}:host(:not([variant=equal])) .bd-bentogrid-track,:host([variant=equal]) .bd-bentogrid-track{grid-template-columns:minmax(0,1fr)}:host(:not([variant=equal])) ::slotted(bd-bento-item),:host([variant=equal]) ::slotted(bd-bento-item){grid-column:auto}@container bento (width>=576px) and (width>=calc(520px + 1.5rem)){:host(:not([variant=equal])) .bd-bentogrid-track{grid-template-columns:repeat(24,minmax(0,1fr))}:host(:not([variant=equal])) ::slotted(bd-bento-item){grid-column:span var(--bd-bento-span,24)}:host([variant=equal]) .bd-bentogrid-track{grid-template-columns:repeat(2,minmax(0,1fr))}}@container bento (width>=768px) and (width>=calc(780px + 3rem)){:host([variant=equal]) .bd-bentogrid-track{grid-template-columns:repeat(3,minmax(0,1fr))}}::slotted(bd-bento-item){min-width:0}:host([variant=equal]) ::slotted(bd-bento-item[priority=featured]){grid-column:1/-1}`;export{a as BENTO_DEFAULTS,n as TOTAL_UNITS,o as bentoColumnRules,s as default};
|
|
162
28
|
//# sourceMappingURL=bento-grid.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bento-grid.css.js","
|
|
1
|
+
{"version":3,"file":"bento-grid.css.js","names":["TOTAL_UNITS","GAP","stepFor","BREAKPOINTS","breakpoint","count","minCardWidth","BENTO_DEFAULTS","bentoColumnRules","weighted","equal","rules","maxColumns","equalColumns","bento_grid_css_default"],"sources":["../../../../src/components/bento-grid/bento-grid.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { above, BREAKPOINTS, type Breakpoint } from \"#shared/token-scales.ts\";\n\n/* The columns follow the width the cards are laid out in, not the viewport's:\n the column below is a container, so a grid in a narrow column stacks however\n wide the screen is. Below sm the cards stack; from sm the pairs share a row\n and an equal grid takes two; from md an equal grid takes its full count.\n\n A count also has to leave every card min-card-width wide, so its step is the\n wider of its breakpoint and that many cards plus their gaps. CSS cannot read\n the attribute, so the step is computed: once here for the defaults, and by\n bento-grid.ts into a sheet of its own for a grid that changes one. Nothing\n measures the grid -- the browser does, against these queries. */\nexport const TOTAL_UNITS = 24; // fine-grained tracks the weighted pairs span\n\n/* The gap between the cards, as the length it is. The track's gap is a\n --spacing-* step, which is rem and grows with the reader's text; the steps\n used to add it as 16, 20 or 24px, so at a larger root size a count met\n before its cards had room -- three at 260 met at 828px, where a 200% root's\n 48px gaps left each card 244. The widest step, the md gap, is counted at\n every count: no step lands below md with more than two cards, and for two\n the sm breakpoint is the larger term either way, so no default moves. */\n/* no token: a container query cannot read a custom property, so the step is\n restated as its rem -- --spacing-24 */\nconst GAP = \"1.5rem\";\n\n/* When `count` cards fit: the breakpoint, and room for that many cards of\n min-card-width with the gaps between them. */\nconst stepFor = (count: number, minCardWidth: number, breakpoint: Breakpoint) =>\n `(width >= ${BREAKPOINTS[breakpoint]}px) and (width >= calc(${count * minCardWidth}px + ${count - 1} * ${GAP}))`;\n\nexport interface BentoColumnOptions {\n maxColumns : number;\n equalColumns: number;\n minCardWidth: number;\n}\n\nexport const BENTO_DEFAULTS: BentoColumnOptions = { maxColumns: 2, equalColumns: 3, minCardWidth: 260 };\n\n/* Every rule restates the one-column start, so a sheet adopted after this one\n replaces the defaults at every width rather than adding to them. */\nexport const bentoColumnRules = ({ maxColumns, equalColumns, minCardWidth }: BentoColumnOptions) => {\n const weighted = `:host(:not([variant=\"equal\"]))`;\n const equal = `:host([variant=\"equal\"])`;\n let rules = `\n ${weighted} .bd-bentogrid-track,\n ${equal} .bd-bentogrid-track {\n grid-template-columns: minmax(0, 1fr);\n }\n\n ${weighted} ::slotted(bd-bento-item),\n ${equal} ::slotted(bd-bento-item) {\n grid-column: auto;\n }\n `;\n\n if (maxColumns >= 2) {\n rules += `\n @container bento ${stepFor(2, minCardWidth, \"sm\")} {\n ${weighted} .bd-bentogrid-track {\n grid-template-columns: repeat(${TOTAL_UNITS}, minmax(0, 1fr));\n }\n\n ${weighted} ::slotted(bd-bento-item) {\n grid-column: span var(--bd-bento-span, ${TOTAL_UNITS});\n }\n }\n `;\n }\n\n for (let count = 2; count <= equalColumns; count += 1) {\n rules += `\n @container bento ${stepFor(count, minCardWidth, count === 2 ? \"sm\" : \"md\")} {\n ${equal} .bd-bentogrid-track {\n grid-template-columns: repeat(${count}, minmax(0, 1fr));\n }\n }\n `;\n }\n\n return rules;\n};\n\nexport default css`\n :host {\n display: block;\n width: 100%;\n box-sizing: border-box;\n }\n\n .bd-ensemble {\n container: bento / inline-size;\n }\n\n /* === BACKGROUND VARIANT — section-level tint on the column (header +\n track), not per-card, so the panel lands on the page edges every other\n section uses. === */\n :host([background=\"tint\"]) .bd-ensemble {\n background-color: var(--status-brand-surface);\n border-radius: var(--shape-radius-2xl);\n padding-block: var(--spacing-40);\n }\n\n /* === HEADER (eyebrow / title / description) === */\n .bd-bentogrid-header {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--spacing-8);\n margin-bottom: var(--spacing-48);\n max-width: 70ch;\n }\n\n .bd-bentogrid-eyebrow {\n display: block;\n margin: 0;\n /* The brand text role, not the brand primitive. This is a visible change and\n not a refactor: the role is blue-600, so the eyebrow darkens and its\n contrast on white goes 4.53:1 -> 6.18:1. blue-500 is the step CLAUDE.md\n says is not for text, and no text role exists at blue-500's value -- the\n roles sitting there are surface, border, action and indicator. */\n color: var(--color-text-brand);\n }\n\n .bd-bentogrid-title {\n display: block;\n margin: 0;\n }\n\n .bd-bentogrid-description {\n display: block;\n margin: 0;\n color: var(--color-text-muted);\n }\n\n /* === GRID === */\n .bd-bentogrid-track {\n display: grid;\n /* The steps name the scale rather than repeating its values: --spacing-24\n IS 24px at the default root size, but in rem, so it grows when the reader\n enlarges their text and 24px does not. */\n gap: var(--bd-bento-gap, var(--spacing-16));\n /* auto, or 1fr when bento-grid.ts finds a set of brand cards: every row\n then takes the tallest row's height, so a full-row card matches the\n pair above it rather than the lines its wider copy column wraps to */\n grid-auto-rows: var(--bd-bento-row-height, auto);\n width: 100%;\n }\n\n @container bento ${unsafeCSS(above(\"sm\"))} {\n .bd-bentogrid-track {\n gap: var(--bd-bento-gap, var(--spacing-20));\n }\n }\n\n @container bento ${unsafeCSS(above(\"md\"))} {\n .bd-bentogrid-track {\n gap: var(--bd-bento-gap, var(--spacing-24));\n }\n }\n\n /* One column until a pair has room, and a stacked grid is a single track:\n 24 units carry 23 gaps, whose own minimum -- 368px at the small gap -- is\n wider than a phone. The equal grid used to keep them there and ran 25px\n past a 375px screen. */\n ${unsafeCSS(bentoColumnRules(BENTO_DEFAULTS))}\n\n ::slotted(bd-bento-item) {\n min-width: 0;\n }\n\n /* A featured item takes the whole row, paired or not. Paired, its span is\n already the row's (bento-grid.ts); the equal grid has no spans to set. */\n :host([variant=\"equal\"]) ::slotted(bd-bento-item[priority=\"featured\"]) {\n grid-column: 1 / -1;\n }\n`;"],"mappings":"A,kFAaA,IAAaA,EAAc,GAWrBC,EAAM,SAINC,GAAW,EAAe,EAAsB,IACpD,aAAaC,EAAYC,GAAY,yBAAyBC,EAAQC,EAAa,OAAOD,EAAQ,EAAE,KAAKJ,EAAI,IAQlGM,EAAqC,CAAE,WAAY,EAAG,aAAc,EAAG,aAAc,GAAI,EAIzFC,GAAoB,CAAE,aAAY,eAAc,kBAAuC,CAClG,IAAMC,EAAW,iCACXC,EAAQ,2BACVC,EAAQ;MACRF,EAAS;MACTC,EAAM;;;;MAIND,EAAS;MACTC,EAAM;;;IAKNE,GAAc,IAChB,GAAS;yBACYV,EAAQ,EAAGI,EAAc,IAAI,EAAE;UAC9CG,EAAS;;;;UAITA,EAAS;;;;OAOjB,IAAK,IAAIJ,EAAQ,EAAGA,GAASQ,EAAc,GAAS,EAClD,GAAS;yBACYX,EAAQG,EAAOC,EAAcD,IAAU,EAAI,KAAO,IAAI,EAAE;UACvEK,EAAM;0CAC0BL,EAAM;;;MAM9C,OAAOM,CACT,EAEAG,EAAe,CAAG,0vD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
-
import "../heading/heading.
|
|
3
|
-
import "../paragraph/paragraph.
|
|
4
|
-
import "./bento-item.
|
|
2
|
+
import "../heading/heading.js";
|
|
3
|
+
import "../paragraph/paragraph.js";
|
|
4
|
+
import "./bento-item.js";
|
|
5
5
|
type Variant = "weighted" | "equal";
|
|
6
6
|
type Background = "none" | "tint";
|
|
7
7
|
declare class BentoGrid extends LitElement {
|
|
@@ -1,209 +1,30 @@
|
|
|
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
|
-
import { tokens } from "../../tokens/tokens.js";
|
|
11
|
-
import "../heading/heading.js";
|
|
12
|
-
import "../paragraph/paragraph.js";
|
|
13
|
-
import bentoGridCSS, { BENTO_DEFAULTS, TOTAL_UNITS, bentoColumnRules } from "./bento-grid.css.js";
|
|
14
|
-
import { ensembleCSS } from "../shared/ensemble.css.js";
|
|
15
|
-
import "./bento-item.js";
|
|
16
|
-
/* One sheet per set of numbers, shared by every grid that asks for it. */
|
|
17
|
-
const columnSheets = new Map();
|
|
18
|
-
const columnSheetFor = (options) => {
|
|
19
|
-
const key = JSON.stringify(options);
|
|
20
|
-
if (!columnSheets.has(key)) {
|
|
21
|
-
const sheet = new CSSStyleSheet();
|
|
22
|
-
sheet.replaceSync(bentoColumnRules(options));
|
|
23
|
-
columnSheets.set(key, sheet);
|
|
24
|
-
}
|
|
25
|
-
return columnSheets.get(key);
|
|
26
|
-
};
|
|
27
|
-
let BentoGrid = class BentoGrid extends LitElement {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments);
|
|
30
|
-
this.eyebrow = "";
|
|
31
|
-
this.title = "";
|
|
32
|
-
this.description = "";
|
|
33
|
-
this.maxColumns = 2;
|
|
34
|
-
this.minCardWidth = 260;
|
|
35
|
-
// Fixed wide/narrow ratio applied to every pair, e.g. 0.7 = 70/30.
|
|
36
|
-
// Only used when variant="weighted" (the default).
|
|
37
|
-
this.wideShare = 0.7;
|
|
38
|
-
// "weighted" (default) — pairs of cards alternate wide/narrow, per
|
|
39
|
-
// _applyWeights below. "equal" — every card gets the same width, laid
|
|
40
|
-
// out in a plain N-column grid (see equalColumns) with no pairing.
|
|
41
|
-
this.variant = "weighted";
|
|
42
|
-
// Column count for variant="equal" once the grid is md wide; min(2, this)
|
|
43
|
-
// from sm, and 1 below -- the grid's own width, not the viewport's, the
|
|
44
|
-
// same steps as the weighted pairs. Ignored when variant="weighted".
|
|
45
|
-
this.equalColumns = 3;
|
|
46
|
-
// "none" (default, transparent) | "tint" (light blue wash behind the
|
|
47
|
-
// whole grid, including header text) — a section-level background, not
|
|
48
|
-
// per-card (bd-bento-item already has its own `tone="tint"` for that).
|
|
49
|
-
this.background = "none";
|
|
50
|
-
}
|
|
51
|
-
static { this.styles = [tokens, ensembleCSS, bentoGridCSS]; }
|
|
52
|
-
updated(changed) {
|
|
53
|
-
if (changed.has("wideShare"))
|
|
54
|
-
this._applyWeights();
|
|
55
|
-
if (["maxColumns", "equalColumns", "minCardWidth"].some((name) => changed.has(name))) {
|
|
56
|
-
this._adoptColumnRules();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
get _items() {
|
|
60
|
-
return [...this.children].filter((el) => el.tagName === "BD-BENTO-ITEM");
|
|
61
|
-
}
|
|
62
|
-
// Assigns each item a `grid-column: span N` out of TOTAL_UNITS invisible
|
|
63
|
-
// grid columns, instead of a flex-basis percentage. CSS Grid subtracts
|
|
64
|
-
// `gap` from the available track space BEFORE distributing column widths,
|
|
65
|
-
// so two items whose spans sum to TOTAL_UNITS always fit on the same row
|
|
66
|
-
// with the gap properly accounted for.
|
|
67
|
-
//
|
|
68
|
-
// Rows are formed by walking items in DOM order and consuming exactly 2
|
|
69
|
-
// "slots" per row UNLESS an item is priority="featured", in which case it
|
|
70
|
-
// consumes the whole row by itself (span = TOTAL_UNITS) and does not pair
|
|
71
|
-
// with anything.
|
|
72
|
-
//
|
|
73
|
-
// Within a pair, the wide/narrow side follows a repeating 3-pair cycle,
|
|
74
|
-
// NOT content length: pair 0 (rows 1-2) is wide-then-narrow, pairs 1 and 2
|
|
75
|
-
// (rows 3-4, 5-6) are narrow-then-wide, then the cycle repeats.
|
|
76
|
-
_applyWeights() {
|
|
77
|
-
const items = this._items;
|
|
78
|
-
let i = 0;
|
|
79
|
-
let pairIndex = 0; // counts pairs only (featured/solo rows don't affect the pattern)
|
|
80
|
-
const wideSpan = Math.round(this.wideShare * TOTAL_UNITS);
|
|
81
|
-
const narrowSpan = TOTAL_UNITS - wideSpan;
|
|
82
|
-
while (i < items.length) {
|
|
83
|
-
const current = items[i];
|
|
84
|
-
if (current.getAttribute("priority") === "featured") {
|
|
85
|
-
current.style.setProperty("--bd-bento-span", String(TOTAL_UNITS));
|
|
86
|
-
i += 1;
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
const next = items[i + 1];
|
|
90
|
-
const nextIsFeatured = next && next.getAttribute("priority") === "featured";
|
|
91
|
-
if (!next || nextIsFeatured) {
|
|
92
|
-
// odd one out (last item, or blocked by a featured item next) — full width
|
|
93
|
-
current.style.setProperty("--bd-bento-span", String(TOTAL_UNITS));
|
|
94
|
-
i += 1;
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
const firstIsWide = pairIndex % 3 === 0;
|
|
98
|
-
current.style.setProperty("--bd-bento-span", String(firstIsWide ? wideSpan : narrowSpan));
|
|
99
|
-
next.style.setProperty("--bd-bento-span", String(firstIsWide ? narrowSpan : wideSpan));
|
|
100
|
-
i += 2;
|
|
101
|
-
pairIndex += 1;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
/* Brand cards are drawn as one set of equal bands: the full-row card is
|
|
105
|
-
the pair's height, not shorter for having a wider copy column, and
|
|
106
|
-
stacked cards match whatever their copy runs to. Only when every card is
|
|
107
|
-
brand-toned -- the default cards are content-sized tiles, and evening
|
|
108
|
-
those out would pad the short ones with empty space. */
|
|
109
|
-
get _isBrandSet() {
|
|
110
|
-
const items = this._items;
|
|
111
|
-
return items.length > 1 && items.every((el) => el.getAttribute("tone") === "brand");
|
|
112
|
-
}
|
|
113
|
-
_applyRowHeight() {
|
|
114
|
-
if (this._isBrandSet)
|
|
115
|
-
this.style.setProperty("--bd-bento-row-height", "1fr");
|
|
116
|
-
else
|
|
117
|
-
this.style.removeProperty("--bd-bento-row-height");
|
|
118
|
-
}
|
|
119
|
-
/* The column steps for the default numbers are in bento-grid.css.ts. A
|
|
120
|
-
grid that changes one adopts the same rules computed from its own, after
|
|
121
|
-
the defaults, and drops them again when it changes back. */
|
|
122
|
-
_adoptColumnRules() {
|
|
123
|
-
const options = {
|
|
124
|
-
maxColumns: Math.min(2, this.maxColumns),
|
|
125
|
-
equalColumns: Math.max(1, this.equalColumns),
|
|
126
|
-
minCardWidth: this.minCardWidth
|
|
127
|
-
};
|
|
128
|
-
const isDefault = Object.keys(options).every((name) => options[name] === BENTO_DEFAULTS[name]);
|
|
129
|
-
const root = this.renderRoot;
|
|
130
|
-
const sheets = root.adoptedStyleSheets.filter((sheet) => ![...columnSheets.values()].includes(sheet));
|
|
131
|
-
root.adoptedStyleSheets = isDefault ? sheets : [...sheets, columnSheetFor(options)];
|
|
132
|
-
}
|
|
133
|
-
/* Spans and row heights follow the cards and their order, never the width,
|
|
134
|
-
so they are set when the cards change. */
|
|
135
|
-
_onSlotChange() {
|
|
136
|
-
this._applyRowHeight();
|
|
137
|
-
this._applyWeights();
|
|
138
|
-
}
|
|
139
|
-
render() {
|
|
140
|
-
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"../paragraph/paragraph.js";import{ensembleCSS as r}from"../shared/ensemble.css.js";import i,{BENTO_DEFAULTS as a,bentoColumnRules as o}from"./bento-grid.css.js";import"./bento-item.js";import{LitElement as s,html as c,nothing as l}from"lit";import{property as u}from"lit/decorators.js";var d=/* @__PURE__ */ new Map,f=e=>{let t=JSON.stringify(e);if(!d.has(t)){let n=new CSSStyleSheet;n.replaceSync(o(e)),d.set(t,n)}return d.get(t)},p=class extends s{constructor(...e){super(...e),this.eyebrow=``,this.title=``,this.description=``,this.maxColumns=2,this.minCardWidth=260,this.wideShare=.7,this.variant=`weighted`,this.equalColumns=3,this.background=`none`}static{this.styles=[t,r,i]}updated(e){e.has(`wideShare`)&&this._applyWeights(),[`maxColumns`,`equalColumns`,`minCardWidth`].some(t=>e.has(t))&&this._adoptColumnRules()}get _items(){return[...this.children].filter(e=>e.tagName===`BD-BENTO-ITEM`)}_applyWeights(){let e=this._items,t=0,n=0,r=Math.round(this.wideShare*24),i=24-r;for(;t<e.length;){let a=e[t];if(a.getAttribute(`priority`)===`featured`){a.style.setProperty(`--bd-bento-span`,`24`),t+=1;continue}let o=e[t+1],s=o&&o.getAttribute(`priority`)===`featured`;if(!o||s){a.style.setProperty(`--bd-bento-span`,`24`),t+=1;continue}let c=n%3==0;a.style.setProperty(`--bd-bento-span`,String(c?r:i)),o.style.setProperty(`--bd-bento-span`,String(c?i:r)),t+=2,n+=1}}get _isBrandSet(){let e=this._items;return e.length>1&&e.every(e=>e.getAttribute(`tone`)===`brand`)}_applyRowHeight(){this._isBrandSet?this.style.setProperty(`--bd-bento-row-height`,`1fr`):this.style.removeProperty(`--bd-bento-row-height`)}_adoptColumnRules(){let e={maxColumns:Math.min(2,this.maxColumns),equalColumns:Math.max(1,this.equalColumns),minCardWidth:this.minCardWidth},t=Object.keys(e).every(t=>e[t]===a[t]),n=this.renderRoot,r=n.adoptedStyleSheets.filter(e=>![...d.values()].includes(e));n.adoptedStyleSheets=t?r:[...r,f(e)]}_onSlotChange(){this._applyRowHeight(),this._applyWeights()}render(){return c`
|
|
141
2
|
<div class="bd-ensemble">
|
|
142
|
-
${this.eyebrow
|
|
143
|
-
? html `
|
|
3
|
+
${this.eyebrow||this.title||this.description?c`
|
|
144
4
|
<div class="bd-bentogrid-header">
|
|
145
|
-
${this.eyebrow
|
|
146
|
-
? html `
|
|
5
|
+
${this.eyebrow?c`
|
|
147
6
|
<bd-p variant="eyebrow" class="bd-bentogrid-eyebrow">
|
|
148
7
|
<slot name="eyebrow">${this.eyebrow}</slot>
|
|
149
8
|
</bd-p>
|
|
150
|
-
|
|
151
|
-
: nothing}
|
|
9
|
+
`:l}
|
|
152
10
|
|
|
153
|
-
${this.title
|
|
154
|
-
? html `
|
|
11
|
+
${this.title?c`
|
|
155
12
|
<bd-h as="h2" class="bd-bentogrid-title">
|
|
156
13
|
<slot name="title">${this.title}</slot>
|
|
157
14
|
</bd-h>
|
|
158
|
-
|
|
159
|
-
: nothing}
|
|
15
|
+
`:l}
|
|
160
16
|
|
|
161
|
-
${this.description
|
|
162
|
-
? html `
|
|
17
|
+
${this.description?c`
|
|
163
18
|
<bd-p variant="regular" class="bd-bentogrid-description">
|
|
164
19
|
<slot name="description">${this.description}</slot>
|
|
165
20
|
</bd-p>
|
|
166
|
-
|
|
167
|
-
: nothing}
|
|
21
|
+
`:l}
|
|
168
22
|
</div>
|
|
169
|
-
|
|
170
|
-
: nothing}
|
|
23
|
+
`:l}
|
|
171
24
|
|
|
172
25
|
<div class="bd-bentogrid-track" role="list">
|
|
173
26
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
174
27
|
</div>
|
|
175
28
|
</div>
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
__decorate([
|
|
180
|
-
property({ type: String })
|
|
181
|
-
], BentoGrid.prototype, "eyebrow", void 0);
|
|
182
|
-
__decorate([
|
|
183
|
-
property({ type: String })
|
|
184
|
-
], BentoGrid.prototype, "title", void 0);
|
|
185
|
-
__decorate([
|
|
186
|
-
property({ type: String })
|
|
187
|
-
], BentoGrid.prototype, "description", void 0);
|
|
188
|
-
__decorate([
|
|
189
|
-
property({ type: Number, attribute: "max-columns" })
|
|
190
|
-
], BentoGrid.prototype, "maxColumns", void 0);
|
|
191
|
-
__decorate([
|
|
192
|
-
property({ type: Number, attribute: "min-card-width" })
|
|
193
|
-
], BentoGrid.prototype, "minCardWidth", void 0);
|
|
194
|
-
__decorate([
|
|
195
|
-
property({ type: Number, attribute: "wide-share" })
|
|
196
|
-
], BentoGrid.prototype, "wideShare", void 0);
|
|
197
|
-
__decorate([
|
|
198
|
-
property({ type: String, reflect: true })
|
|
199
|
-
], BentoGrid.prototype, "variant", void 0);
|
|
200
|
-
__decorate([
|
|
201
|
-
property({ type: Number, attribute: "equal-columns" })
|
|
202
|
-
], BentoGrid.prototype, "equalColumns", void 0);
|
|
203
|
-
__decorate([
|
|
204
|
-
property({ type: String, reflect: true })
|
|
205
|
-
], BentoGrid.prototype, "background", void 0);
|
|
206
|
-
BentoGrid = __decorate([
|
|
207
|
-
defineElement("bd-bento-grid")
|
|
208
|
-
], BentoGrid);
|
|
29
|
+
`}};n([u({type:String})],p.prototype,`eyebrow`,void 0),n([u({type:String})],p.prototype,`title`,void 0),n([u({type:String})],p.prototype,`description`,void 0),n([u({type:Number,attribute:`max-columns`})],p.prototype,`maxColumns`,void 0),n([u({type:Number,attribute:`min-card-width`})],p.prototype,`minCardWidth`,void 0),n([u({type:Number,attribute:`wide-share`})],p.prototype,`wideShare`,void 0),n([u({type:String,reflect:!0})],p.prototype,`variant`,void 0),n([u({type:Number,attribute:`equal-columns`})],p.prototype,`equalColumns`,void 0),n([u({type:String,reflect:!0})],p.prototype,`background`,void 0),p=n([e(`bd-bento-grid`)],p);
|
|
209
30
|
//# sourceMappingURL=bento-grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bento-grid.js","sourceRoot":"","sources":["../../../../src/components/bento-grid/bento-grid.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EA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C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;+CACtC;AAKjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACV;AA/B5B,SAAS;IADd,aAAa,CAAC,eAAe,CAAC;GACzB,SAAS,CA2Kd","sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"../shared/define-element.ts\";\nimport { tokens } from \"../../tokens/tokens.ts\";\nimport \"../heading/heading.ts\";\nimport \"../paragraph/paragraph.ts\";\nimport bentoGridCSS, { BENTO_DEFAULTS, TOTAL_UNITS, bentoColumnRules, type BentoColumnOptions } from \"./bento-grid.css.ts\";\nimport { ensembleCSS } from \"../shared/ensemble.css.ts\";\nimport \"./bento-item.ts\";\n\n/* One sheet per set of numbers, shared by every grid that asks for it. */\nconst columnSheets = new Map<string, CSSStyleSheet>();\nconst columnSheetFor = (options: BentoColumnOptions) => {\n const key = JSON.stringify(options);\n if (!columnSheets.has(key)) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(bentoColumnRules(options));\n columnSheets.set(key, sheet);\n }\n return columnSheets.get(key)!;\n};\n\ntype Variant = \"weighted\" | \"equal\";\ntype Background = \"none\" | \"tint\";\n\n@defineElement(\"bd-bento-grid\")\nclass BentoGrid extends LitElement {\n static styles = [tokens, ensembleCSS, bentoGridCSS];\n\n @property({ type: String })\n eyebrow = \"\";\n @property({ type: String })\n title = \"\";\n @property({ type: String })\n description = \"\";\n @property({ type: Number, attribute: \"max-columns\" })\n maxColumns = 2;\n @property({ type: Number, attribute: \"min-card-width\" })\n minCardWidth = 260;\n // Fixed wide/narrow ratio applied to every pair, e.g. 0.7 = 70/30.\n // Only used when variant=\"weighted\" (the default).\n @property({ type: Number, attribute: \"wide-share\" })\n wideShare = 0.7;\n // \"weighted\" (default) — pairs of cards alternate wide/narrow, per\n // _applyWeights below. \"equal\" — every card gets the same width, laid\n // out in a plain N-column grid (see equalColumns) with no pairing.\n @property({ type: String, reflect: true })\n variant: Variant = \"weighted\";\n // Column count for variant=\"equal\" once the grid is md wide; min(2, this)\n // from sm, and 1 below -- the grid's own width, not the viewport's, the\n // same steps as the weighted pairs. Ignored when variant=\"weighted\".\n @property({ type: Number, attribute: \"equal-columns\" })\n equalColumns = 3;\n // \"none\" (default, transparent) | \"tint\" (light blue wash behind the\n // whole grid, including header text) — a section-level background, not\n // per-card (bd-bento-item already has its own `tone=\"tint\"` for that).\n @property({ type: String, reflect: true })\n background: Background = \"none\";\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"wideShare\")) this._applyWeights();\n if (([\"maxColumns\", \"equalColumns\", \"minCardWidth\"] as const).some((name) => changed.has(name))) {\n this._adoptColumnRules();\n }\n }\n\n get _items() {\n return [...this.children].filter((el): el is HTMLElement => el.tagName === \"BD-BENTO-ITEM\");\n }\n\n // Assigns each item a `grid-column: span N` out of TOTAL_UNITS invisible\n // grid columns, instead of a flex-basis percentage. CSS Grid subtracts\n // `gap` from the available track space BEFORE distributing column widths,\n // so two items whose spans sum to TOTAL_UNITS always fit on the same row\n // with the gap properly accounted for.\n //\n // Rows are formed by walking items in DOM order and consuming exactly 2\n // \"slots\" per row UNLESS an item is priority=\"featured\", in which case it\n // consumes the whole row by itself (span = TOTAL_UNITS) and does not pair\n // with anything.\n //\n // Within a pair, the wide/narrow side follows a repeating 3-pair cycle,\n // NOT content length: pair 0 (rows 1-2) is wide-then-narrow, pairs 1 and 2\n // (rows 3-4, 5-6) are narrow-then-wide, then the cycle repeats.\n _applyWeights() {\n const items = this._items;\n let i = 0;\n let pairIndex = 0; // counts pairs only (featured/solo rows don't affect the pattern)\n\n const wideSpan = Math.round(this.wideShare * TOTAL_UNITS);\n const narrowSpan = TOTAL_UNITS - wideSpan;\n\n while (i < items.length) {\n const current = items[i];\n\n if (current.getAttribute(\"priority\") === \"featured\") {\n current.style.setProperty(\"--bd-bento-span\", String(TOTAL_UNITS));\n i += 1;\n continue;\n }\n\n const next = items[i + 1];\n const nextIsFeatured = next && next.getAttribute(\"priority\") === \"featured\";\n\n if (!next || nextIsFeatured) {\n // odd one out (last item, or blocked by a featured item next) — full width\n current.style.setProperty(\"--bd-bento-span\", String(TOTAL_UNITS));\n i += 1;\n continue;\n }\n\n const firstIsWide = pairIndex % 3 === 0;\n\n current.style.setProperty(\"--bd-bento-span\", String(firstIsWide ? wideSpan : narrowSpan));\n next.style.setProperty(\"--bd-bento-span\", String(firstIsWide ? narrowSpan : wideSpan));\n\n i += 2;\n pairIndex += 1;\n }\n }\n\n /* Brand cards are drawn as one set of equal bands: the full-row card is\n the pair's height, not shorter for having a wider copy column, and\n stacked cards match whatever their copy runs to. Only when every card is\n brand-toned -- the default cards are content-sized tiles, and evening\n those out would pad the short ones with empty space. */\n get _isBrandSet() {\n const items = this._items;\n return items.length > 1 && items.every((el) => el.getAttribute(\"tone\") === \"brand\");\n }\n\n _applyRowHeight() {\n if (this._isBrandSet) this.style.setProperty(\"--bd-bento-row-height\", \"1fr\");\n else this.style.removeProperty(\"--bd-bento-row-height\");\n }\n\n /* The column steps for the default numbers are in bento-grid.css.ts. A\n grid that changes one adopts the same rules computed from its own, after\n the defaults, and drops them again when it changes back. */\n _adoptColumnRules() {\n const options: BentoColumnOptions = {\n maxColumns : Math.min(2, this.maxColumns),\n equalColumns: Math.max(1, this.equalColumns),\n minCardWidth: this.minCardWidth\n };\n const isDefault = (Object.keys(options) as (keyof BentoColumnOptions)[]).every((name) => options[name] === BENTO_DEFAULTS[name]);\n const root = this.renderRoot as ShadowRoot;\n const sheets = root.adoptedStyleSheets.filter((sheet) => ![...columnSheets.values()].includes(sheet));\n root.adoptedStyleSheets = isDefault ? sheets : [...sheets, columnSheetFor(options)];\n }\n\n /* Spans and row heights follow the cards and their order, never the width,\n so they are set when the cards change. */\n _onSlotChange() {\n this._applyRowHeight();\n this._applyWeights();\n }\n\n render() {\n return html`\n <div class=\"bd-ensemble\">\n ${this.eyebrow || this.title || this.description\n ? html`\n <div class=\"bd-bentogrid-header\">\n ${this.eyebrow\n ? html`\n <bd-p variant=\"eyebrow\" class=\"bd-bentogrid-eyebrow\">\n <slot name=\"eyebrow\">${this.eyebrow}</slot>\n </bd-p>\n `\n : nothing}\n\n ${this.title\n ? html`\n <bd-h as=\"h2\" class=\"bd-bentogrid-title\">\n <slot name=\"title\">${this.title}</slot>\n </bd-h>\n `\n : nothing}\n\n ${this.description\n ? html`\n <bd-p variant=\"regular\" class=\"bd-bentogrid-description\">\n <slot name=\"description\">${this.description}</slot>\n </bd-p>\n `\n : nothing}\n </div>\n `\n : nothing}\n\n <div class=\"bd-bentogrid-track\" role=\"list\">\n <slot @slotchange=${this._onSlotChange}></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-bento-grid\": BentoGrid;\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"bento-grid.js","names":["bentoGridCSS","_decorate","__decorate","bento_grid_css_default","columnSheets","columnSheetFor","key","options","sheet","bentoColumnRules","BentoGrid","LitElement","_args","tokens","ensembleCSS","changed","name","el","items","i","pairIndex","wideSpan","narrowSpan","current","next","nextIsFeatured","firstIsWide","isDefault","BENTO_DEFAULTS","root","sheets","nothing","property","defineElement"],"sources":["../../../../src/components/bento-grid/bento-grid.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { tokens } from \"#tokens/tokens.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/paragraph/paragraph.ts\";\nimport bentoGridCSS, { BENTO_DEFAULTS, TOTAL_UNITS, bentoColumnRules, type BentoColumnOptions } from \"./bento-grid.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport \"./bento-item.ts\";\n\n/* One sheet per set of numbers, shared by every grid that asks for it. */\nconst columnSheets = new Map<string, CSSStyleSheet>();\nconst columnSheetFor = (options: BentoColumnOptions) => {\n const key = JSON.stringify(options);\n if (!columnSheets.has(key)) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(bentoColumnRules(options));\n columnSheets.set(key, sheet);\n }\n return columnSheets.get(key)!;\n};\n\ntype Variant = \"weighted\" | \"equal\";\ntype Background = \"none\" | \"tint\";\n\n@defineElement(\"bd-bento-grid\")\nclass BentoGrid extends LitElement {\n static styles = [tokens, ensembleCSS, bentoGridCSS];\n\n @property({ type: String })\n eyebrow = \"\";\n @property({ type: String })\n title = \"\";\n @property({ type: String })\n description = \"\";\n @property({ type: Number, attribute: \"max-columns\" })\n maxColumns = 2;\n @property({ type: Number, attribute: \"min-card-width\" })\n minCardWidth = 260;\n // Fixed wide/narrow ratio applied to every pair, e.g. 0.7 = 70/30.\n // Only used when variant=\"weighted\" (the default).\n @property({ type: Number, attribute: \"wide-share\" })\n wideShare = 0.7;\n // \"weighted\" (default) — pairs of cards alternate wide/narrow, per\n // _applyWeights below. \"equal\" — every card gets the same width, laid\n // out in a plain N-column grid (see equalColumns) with no pairing.\n @property({ type: String, reflect: true })\n variant: Variant = \"weighted\";\n // Column count for variant=\"equal\" once the grid is md wide; min(2, this)\n // from sm, and 1 below -- the grid's own width, not the viewport's, the\n // same steps as the weighted pairs. Ignored when variant=\"weighted\".\n @property({ type: Number, attribute: \"equal-columns\" })\n equalColumns = 3;\n // \"none\" (default, transparent) | \"tint\" (light blue wash behind the\n // whole grid, including header text) — a section-level background, not\n // per-card (bd-bento-item already has its own `tone=\"tint\"` for that).\n @property({ type: String, reflect: true })\n background: Background = \"none\";\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"wideShare\")) this._applyWeights();\n if (([\"maxColumns\", \"equalColumns\", \"minCardWidth\"] as const).some((name) => changed.has(name))) {\n this._adoptColumnRules();\n }\n }\n\n get _items() {\n return [...this.children].filter((el): el is HTMLElement => el.tagName === \"BD-BENTO-ITEM\");\n }\n\n // Assigns each item a `grid-column: span N` out of TOTAL_UNITS invisible\n // grid columns, instead of a flex-basis percentage. CSS Grid subtracts\n // `gap` from the available track space BEFORE distributing column widths,\n // so two items whose spans sum to TOTAL_UNITS always fit on the same row\n // with the gap properly accounted for.\n //\n // Rows are formed by walking items in DOM order and consuming exactly 2\n // \"slots\" per row UNLESS an item is priority=\"featured\", in which case it\n // consumes the whole row by itself (span = TOTAL_UNITS) and does not pair\n // with anything.\n //\n // Within a pair, the wide/narrow side follows a repeating 3-pair cycle,\n // NOT content length: pair 0 (rows 1-2) is wide-then-narrow, pairs 1 and 2\n // (rows 3-4, 5-6) are narrow-then-wide, then the cycle repeats.\n _applyWeights() {\n const items = this._items;\n let i = 0;\n let pairIndex = 0; // counts pairs only (featured/solo rows don't affect the pattern)\n\n const wideSpan = Math.round(this.wideShare * TOTAL_UNITS);\n const narrowSpan = TOTAL_UNITS - wideSpan;\n\n while (i < items.length) {\n const current = items[i];\n\n if (current.getAttribute(\"priority\") === \"featured\") {\n current.style.setProperty(\"--bd-bento-span\", String(TOTAL_UNITS));\n i += 1;\n continue;\n }\n\n const next = items[i + 1];\n const nextIsFeatured = next && next.getAttribute(\"priority\") === \"featured\";\n\n if (!next || nextIsFeatured) {\n // odd one out (last item, or blocked by a featured item next) — full width\n current.style.setProperty(\"--bd-bento-span\", String(TOTAL_UNITS));\n i += 1;\n continue;\n }\n\n const firstIsWide = pairIndex % 3 === 0;\n\n current.style.setProperty(\"--bd-bento-span\", String(firstIsWide ? wideSpan : narrowSpan));\n next.style.setProperty(\"--bd-bento-span\", String(firstIsWide ? narrowSpan : wideSpan));\n\n i += 2;\n pairIndex += 1;\n }\n }\n\n /* Brand cards are drawn as one set of equal bands: the full-row card is\n the pair's height, not shorter for having a wider copy column, and\n stacked cards match whatever their copy runs to. Only when every card is\n brand-toned -- the default cards are content-sized tiles, and evening\n those out would pad the short ones with empty space. */\n get _isBrandSet() {\n const items = this._items;\n return items.length > 1 && items.every((el) => el.getAttribute(\"tone\") === \"brand\");\n }\n\n _applyRowHeight() {\n if (this._isBrandSet) this.style.setProperty(\"--bd-bento-row-height\", \"1fr\");\n else this.style.removeProperty(\"--bd-bento-row-height\");\n }\n\n /* The column steps for the default numbers are in bento-grid.css.ts. A\n grid that changes one adopts the same rules computed from its own, after\n the defaults, and drops them again when it changes back. */\n _adoptColumnRules() {\n const options: BentoColumnOptions = {\n maxColumns : Math.min(2, this.maxColumns),\n equalColumns: Math.max(1, this.equalColumns),\n minCardWidth: this.minCardWidth\n };\n const isDefault = (Object.keys(options) as (keyof BentoColumnOptions)[]).every((name) => options[name] === BENTO_DEFAULTS[name]);\n const root = this.renderRoot as ShadowRoot;\n const sheets = root.adoptedStyleSheets.filter((sheet) => ![...columnSheets.values()].includes(sheet));\n root.adoptedStyleSheets = isDefault ? sheets : [...sheets, columnSheetFor(options)];\n }\n\n /* Spans and row heights follow the cards and their order, never the width,\n so they are set when the cards change. */\n _onSlotChange() {\n this._applyRowHeight();\n this._applyWeights();\n }\n\n render() {\n return html`\n <div class=\"bd-ensemble\">\n ${this.eyebrow || this.title || this.description\n ? html`\n <div class=\"bd-bentogrid-header\">\n ${this.eyebrow\n ? html`\n <bd-p variant=\"eyebrow\" class=\"bd-bentogrid-eyebrow\">\n <slot name=\"eyebrow\">${this.eyebrow}</slot>\n </bd-p>\n `\n : nothing}\n\n ${this.title\n ? html`\n <bd-h as=\"h2\" class=\"bd-bentogrid-title\">\n <slot name=\"title\">${this.title}</slot>\n </bd-h>\n `\n : nothing}\n\n ${this.description\n ? html`\n <bd-p variant=\"regular\" class=\"bd-bentogrid-description\">\n <slot name=\"description\">${this.description}</slot>\n </bd-p>\n `\n : nothing}\n </div>\n `\n : nothing}\n\n <div class=\"bd-bentogrid-track\" role=\"list\">\n <slot @slotchange=${this._onSlotChange}></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-bento-grid\": BentoGrid;\n }\n}"],"mappings":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