@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,352 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* The closed sets a component prop may draw from, and the only place that
|
|
3
|
-
* turns a prop value into CSS.
|
|
4
|
-
*
|
|
5
|
-
* See CLAUDE.md, "The foundation rule". Every prop-facing function here
|
|
6
|
-
* returns either a token reference or the empty string, so a literal cannot
|
|
7
|
-
* come out of a component prop no matter what a caller passes. An
|
|
8
|
-
* unrecognised value is dropped and the component keeps its own styling.
|
|
9
|
-
*
|
|
10
|
-
* The breakpoint helpers at the foot of this file are the one exception, and
|
|
11
|
-
* they throw rather than returning empty. The reason is who calls them: every
|
|
12
|
-
* scale above is fed a value a *consumer* passed as an attribute, where
|
|
13
|
-
* dropping a bad value degrades gracefully. A breakpoint name is written by
|
|
14
|
-
* the component author inside a stylesheet, and an empty string there yields
|
|
15
|
-
* `@media { ... }` — a malformed query the browser discards silently, taking
|
|
16
|
-
* the whole block with it. A typo has to fail loudly at the point it is made.
|
|
17
|
-
*/
|
|
18
|
-
export const SPACING_STEPS = [
|
|
19
|
-
'0', '1', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24',
|
|
20
|
-
'28', '32', '36', '40', '44', '48', '52', '56', '64', '80', '96', '112', '128'
|
|
21
|
-
];
|
|
22
|
-
export const FONT_SIZE_STEPS = [
|
|
23
|
-
'xxs', 'xs', 'sm', 'base', 'lg', 'xl',
|
|
24
|
-
'2xl', '3xl', '4xl', '5xl', '6xl', '7xl', '8xl', '9xl'
|
|
25
|
-
];
|
|
26
|
-
export const FONT_WEIGHT_STEPS = ['light', 'normal', 'medium', 'semibold', 'bold'];
|
|
27
|
-
/** The two faces the system ships. There is no third, and no escape hatch. */
|
|
28
|
-
export const FONT_FAMILY_STEPS = ['sans', 'mono'];
|
|
29
|
-
export const LETTER_SPACING_STEPS = ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest'];
|
|
30
|
-
/**
|
|
31
|
-
* The t-shirt vocabulary bd-grid's gap and padding props take, mapped onto the
|
|
32
|
-
* live pixel scale. It used to be a second CSS scale, --space-*, which existed
|
|
33
|
-
* mainly so the component could build a token name from a prop — thirteen
|
|
34
|
-
* tokens duplicating --spacing-* under other names. A prop vocabulary belongs
|
|
35
|
-
* here, with the other closed sets, rather than in the token file.
|
|
36
|
-
*/
|
|
37
|
-
export const SPACE_STEPS = {
|
|
38
|
-
none: '0', '4xs': '2', '3xs': '4', '2xs': '8', xs: '12', sm: '16',
|
|
39
|
-
md: '24', lg: '32', xl: '40', '2xl': '48', '3xl': '64', '4xl': '96', '5xl': '128'
|
|
40
|
-
};
|
|
41
|
-
/** Icon sizes. The scale stops at 3xl (64px); there is no step above it. */
|
|
42
|
-
export const ICON_SIZE_STEPS = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'];
|
|
43
|
-
export const RADIUS_STEPS = ['none', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', 'full'];
|
|
44
|
-
/**
|
|
45
|
-
* Semantic colour roles a component's `color` prop may name.
|
|
46
|
-
*
|
|
47
|
-
* These resolve through the --color-text-* roles rather than reaching past
|
|
48
|
-
* them into the palette, which is what the semantic colour block in
|
|
49
|
-
* src/tokens/tokens.ts says they should do. Spelled as palette steps, this
|
|
50
|
-
* map was the reason a page could retint --color-text-muted and watch every
|
|
51
|
-
* bd-h with color="muted" ignore it: the values matched, so nothing looked
|
|
52
|
-
* wrong until someone tried to change one.
|
|
53
|
-
*
|
|
54
|
-
* The prop vocabulary and the token vocabulary are deliberately not the same
|
|
55
|
-
* words. `strong` and `primary` read better on a component than
|
|
56
|
-
* `text-primary` and `text-brand` do, and renaming the prop would break
|
|
57
|
-
* consumers' markup for no gain. The mapping is the seam, and it lives here.
|
|
58
|
-
*
|
|
59
|
-
* Every role clears 4.5:1 on white, which is what the docstring here always
|
|
60
|
-
* claimed and what `subtle` did not do: it named neutral-400, which measures
|
|
61
|
-
* 3.23:1 and fails 1.4.3 for text. It now resolves to --color-text-subtle
|
|
62
|
-
* (neutral-500, 4.67:1). Nothing in this repository passed color="subtle",
|
|
63
|
-
* so the fix costs nothing today — note that neutral-400 is the step the
|
|
64
|
-
* token layer calls `disabled`, and disabled text is exempt under 1.4.3,
|
|
65
|
-
* which is presumably how the two got crossed.
|
|
66
|
-
*/
|
|
67
|
-
export const COLOR_ROLES = {
|
|
68
|
-
primary: '--color-text-brand',
|
|
69
|
-
strong: '--color-text-primary',
|
|
70
|
-
muted: '--color-text-muted',
|
|
71
|
-
subtle: '--color-text-subtle',
|
|
72
|
-
inverse: '--color-text-inverse',
|
|
73
|
-
/* Ink on a brand fill. `inverse` is for a dark neutral band; on a brand band
|
|
74
|
-
the ink is the brand's, because a partner whose brand is light takes dark
|
|
75
|
-
ink there, and white -- inverse -- would not read on it. Same pixel as
|
|
76
|
-
inverse under Bitdefender. */
|
|
77
|
-
'on-brand': '--color-brand-on-fill',
|
|
78
|
-
success: '--color-text-success',
|
|
79
|
-
warning: '--color-text-warning',
|
|
80
|
-
error: '--color-text-error'
|
|
81
|
-
};
|
|
82
|
-
export const COLOR_ROLE_NAMES = Object.keys(COLOR_ROLES);
|
|
83
|
-
/**
|
|
84
|
-
* The hairline vocabulary.
|
|
85
|
-
*
|
|
86
|
-
* A divider is a border, and until now the only colour prop it had resolved
|
|
87
|
-
* through COLOR_ROLES above -- the *ink* vocabulary. That is the category
|
|
88
|
-
* error CLAUDE.md names ("Never use a token from the wrong category"), and
|
|
89
|
-
* this file already carried a milder version of it: bd-divider-horizontal's
|
|
90
|
-
* constructor records that its default used to say `subtle`, a text role that
|
|
91
|
-
* matched the right value by coincidence.
|
|
92
|
-
*
|
|
93
|
-
* The cost was not theoretical. bd-quick-answer needs a hairline in
|
|
94
|
-
* --status-brand-border, because its rule sits on a brand tint and a neutral
|
|
95
|
-
* line reads as dirt there. No text role expresses that, so the component drew
|
|
96
|
-
* its own `border-top` instead of composing the atom -- which is exactly the
|
|
97
|
-
* "dividers are not borders" confusion the same document warns about, arrived
|
|
98
|
-
* at from the other direction: the divider could not say what the component
|
|
99
|
-
* meant, so the component stopped using the divider.
|
|
100
|
-
*
|
|
101
|
-
* `brand-subtle` is the one entry that reaches outside the --color-border-*
|
|
102
|
-
* family, and it is here because it has a consumer today. The rest of the
|
|
103
|
-
* status hairlines are deliberately absent until one does.
|
|
104
|
-
*
|
|
105
|
-
* `inverse` is deliberately NOT here. It would resolve to
|
|
106
|
-
* --color-border-container-inverse, which is white at 12%, where the text
|
|
107
|
-
* role it resolves to today is solid white -- and each divider then multiplies
|
|
108
|
-
* that by its own `opacity` prop (0.25 by default on the horizontal, 1.00 on
|
|
109
|
-
* the vertical). The dividers that pass color="inverse" would drop from solid
|
|
110
|
-
* white to 12%, or from 25% to 3%, and effectively vanish. It keeps falling
|
|
111
|
-
* through to the legacy text role below, and that is recorded rather than
|
|
112
|
-
* fixed: whether a hairline on a dark surface should be a 12% border role at
|
|
113
|
-
* full opacity, or a solid one dimmed by the prop, is a real design question
|
|
114
|
-
* and not this change's to answer.
|
|
115
|
-
*/
|
|
116
|
-
export const BORDER_ROLES = {
|
|
117
|
-
default: '--color-border-default',
|
|
118
|
-
subtle: '--color-border-subtle',
|
|
119
|
-
strong: '--color-border-strong',
|
|
120
|
-
container: '--color-border-container',
|
|
121
|
-
brand: '--color-border-brand',
|
|
122
|
-
disabled: '--color-border-disabled',
|
|
123
|
-
'brand-subtle': '--status-brand-border'
|
|
124
|
-
};
|
|
125
|
-
export const BORDER_ROLE_NAMES = Object.keys(BORDER_ROLES);
|
|
126
|
-
const onScale = (steps, prefix) => (value) => steps.includes(String(value)) ? `var(${prefix}${value})` : '';
|
|
127
|
-
export const spacing = onScale(SPACING_STEPS, '--spacing-');
|
|
128
|
-
export const fontSize = onScale(FONT_SIZE_STEPS, '--typography-fontSize-');
|
|
129
|
-
export const fontWeight = onScale(FONT_WEIGHT_STEPS, '--typography-fontWeight-');
|
|
130
|
-
export const fontFamily = onScale(FONT_FAMILY_STEPS, '--typography-fontFamily-');
|
|
131
|
-
export const letterSpacing = onScale(LETTER_SPACING_STEPS, '--typography-letterSpacing-');
|
|
132
|
-
/* none and full are corners a brand must not move -- square on purpose, and a
|
|
133
|
-
circle -- so they stay on the scale; every other step reads the shape ramp a
|
|
134
|
-
theme restates. Nothing calls this today; a caller that does gets partner
|
|
135
|
-
corners for free. */
|
|
136
|
-
const radiusStep = onScale(RADIUS_STEPS, '--radius-');
|
|
137
|
-
export const radius = (step) => (['none', 'full'].includes(String(step)) ? radiusStep(step) : onScale(RADIUS_STEPS, '--shape-radius-')(step));
|
|
138
|
-
/* The border-width steps. A px spelling of a step -- "2px" -- is read as the
|
|
139
|
-
step, because that is what callers wrote before there was a scale here. */
|
|
140
|
-
export const BORDER_WIDTH_STEPS = ['0', '1', '2', '3', '4', '8'];
|
|
141
|
-
export const borderWidth = (value) => {
|
|
142
|
-
const step = String(value ?? '').replace(/px$/, '');
|
|
143
|
-
return BORDER_WIDTH_STEPS.includes(step) ? `var(--border-width-${step})` : '';
|
|
144
|
-
};
|
|
145
|
-
/* Not a scale: a fraction. An opacity given as a prop is kept only when it is
|
|
146
|
-
a number from 0 to 1, so a stray string never reaches an inline style. */
|
|
147
|
-
export const opacity = (value) => {
|
|
148
|
-
if (value === '' || value == null)
|
|
149
|
-
return '';
|
|
150
|
-
const n = Number(value);
|
|
151
|
-
return Number.isFinite(n) && n >= 0 && n <= 1 ? String(n) : '';
|
|
152
|
-
};
|
|
153
|
-
export const space = (name) => (Object.hasOwn(SPACE_STEPS, name) ? `var(--spacing-${SPACE_STEPS[name]})` : '');
|
|
154
|
-
/** --icon-*-size wraps its step, so it needs a suffix onScale cannot express. */
|
|
155
|
-
export const iconSize = (value) => (ICON_SIZE_STEPS.includes(String(value)) ? `var(--icon-${value}-size)` : '');
|
|
156
|
-
export const color = (role) => Object.hasOwn(COLOR_ROLES, role) ? `var(${COLOR_ROLES[role]})` : '';
|
|
157
|
-
/**
|
|
158
|
-
* A hairline's colour: border roles first, then the ink vocabulary as legacy.
|
|
159
|
-
*
|
|
160
|
-
* Border-first is the point -- `subtle` on a divider means
|
|
161
|
-
* --color-border-subtle, not --color-text-subtle. The fallback exists so the
|
|
162
|
-
* names already in use keep working (`inverse`, and `strong`, which resolves
|
|
163
|
-
* to neutral-900 either way), and it is a migration path, not a second
|
|
164
|
-
* vocabulary: a new divider should be spelled with a border role.
|
|
165
|
-
*/
|
|
166
|
-
export const borderColor = (role) => (Object.hasOwn(BORDER_ROLES, role)
|
|
167
|
-
? `var(${BORDER_ROLES[role]})`
|
|
168
|
-
: color(role));
|
|
169
|
-
/**
|
|
170
|
-
* A one-to-four-value spacing shorthand written as steps, e.g. "10 0" gives
|
|
171
|
-
* `var(--spacing-10) var(--spacing-0)`. All parts must be on the scale, or
|
|
172
|
-
* the whole value is dropped — a half-valid shorthand is worse than none.
|
|
173
|
-
*/
|
|
174
|
-
export const spacingShorthand = (value) => {
|
|
175
|
-
const parts = String(value ?? '').trim()
|
|
176
|
-
.split(/\s+/)
|
|
177
|
-
.filter(Boolean);
|
|
178
|
-
if (parts.length < 1 || parts.length > 4)
|
|
179
|
-
return '';
|
|
180
|
-
const refs = parts.map(spacing);
|
|
181
|
-
return refs.every(Boolean) ? refs.join(' ') : '';
|
|
182
|
-
};
|
|
183
|
-
/* ================================================================
|
|
184
|
-
BREAKPOINTS
|
|
185
|
-
================================================================
|
|
186
|
-
The seven viewport widths, and the only place a media condition is built
|
|
187
|
-
from them.
|
|
188
|
-
|
|
189
|
-
This lives in JS rather than in the token file because a media condition
|
|
190
|
-
cannot read a custom property — `@media (max-width: var(--breakpoint-md))`
|
|
191
|
-
is not valid CSS — so the seven values have to be interpolated into the
|
|
192
|
-
stylesheet at author time. `--breakpoint-*` in src/tokens/tokens.ts stays
|
|
193
|
-
the published record of the scale; this is how a component consumes it.
|
|
194
|
-
|
|
195
|
-
`above` and `below` return a media *condition*, not a whole `@media` rule,
|
|
196
|
-
so they compose:
|
|
197
|
-
|
|
198
|
-
@media ${below('md')} { ... }
|
|
199
|
-
@media ${above('sm')} and ${below('lg')} { ... }
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
WHY THE HELPER OWNS THE COMPLEMENT.
|
|
204
|
-
|
|
205
|
-
A breakpoint is one number, but it has two sides, and writing the second
|
|
206
|
-
one by hand is how the boundary drifts. `min-width: 768px` and
|
|
207
|
-
`max-width: 768px` are both true at exactly 768px, so a component that
|
|
208
|
-
spelled its mobile rule the obvious way applied both its mobile and its
|
|
209
|
-
desktop styling at that one width: pricing-card.css.ts had
|
|
210
|
-
`@media (max-width: 768px)` at one rule and
|
|
211
|
-
`@media (min-width: 768px) and (max-width: 1024px)` at another, and
|
|
212
|
-
thirteen more files used the same `max-width: 768px` form.
|
|
213
|
-
|
|
214
|
-
The complement is derived here so that number is never typed. Do not write
|
|
215
|
-
767px, 991px or 1199px anywhere; write `below('md')`, `below('lg')`,
|
|
216
|
-
`below('xl')`.
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
WHY RANGE SYNTAX, AND NO EPSILON.
|
|
221
|
-
|
|
222
|
-
`(width >= 768px)` and `(width < 768px)` are exact complements: every
|
|
223
|
-
width, fractional ones included, matches one of them and never both. A
|
|
224
|
-
viewport is not always a whole number of pixels -- browser zoom, some
|
|
225
|
-
Android densities and fractional device-pixel-ratios all produce widths
|
|
226
|
-
like 767.5px -- and the min-/max- spelling could not say "narrower than"
|
|
227
|
-
without choosing a number below the breakpoint. `max-width: 767px` left
|
|
228
|
-
every width between 767 and 768 matched by neither side, and the
|
|
229
|
-
`max-width: 767.98px` this helper emitted until 2026-10-28 shrank that band
|
|
230
|
-
to a fiftieth of a pixel rather than closing it. The range form has no
|
|
231
|
-
number to choose.
|
|
232
|
-
|
|
233
|
-
Media query range syntax is Baseline Widely available (since 2023-03), so
|
|
234
|
-
it is used as is. The same conditions are valid in @container, where they
|
|
235
|
-
ask the container's width instead of the viewport's:
|
|
236
|
-
|
|
237
|
-
@container ${below('sm')} { ... } */
|
|
238
|
-
export const BREAKPOINTS = {
|
|
239
|
-
xs: 0,
|
|
240
|
-
sm: 576,
|
|
241
|
-
md: 768,
|
|
242
|
-
lg: 992,
|
|
243
|
-
xl: 1200,
|
|
244
|
-
xxl: 1400,
|
|
245
|
-
/* Not a grid-progression step: the site's menu and footer widen here, and
|
|
246
|
-
the page column has to widen with them. See --grid-container-max-xxxl. */
|
|
247
|
-
xxxl: 1600
|
|
248
|
-
};
|
|
249
|
-
export const BREAKPOINT_NAMES = Object.keys(BREAKPOINTS);
|
|
250
|
-
/** Throws rather than returning empty — see the note in the file header. */
|
|
251
|
-
const step = (name) => {
|
|
252
|
-
if (!Object.hasOwn(BREAKPOINTS, name)) {
|
|
253
|
-
throw new Error(`Unknown breakpoint: ${name}. Expected one of ${BREAKPOINT_NAMES.join(', ')}.`);
|
|
254
|
-
}
|
|
255
|
-
return BREAKPOINTS[name];
|
|
256
|
-
};
|
|
257
|
-
/**
|
|
258
|
-
* "This breakpoint and wider."
|
|
259
|
-
*
|
|
260
|
-
* above('md') → (width >= 768px)
|
|
261
|
-
*
|
|
262
|
-
* `above('xs')` is `(width >= 0px)`, which is always true. That is a
|
|
263
|
-
* harmless no-op rather than an error, because it is the honest answer for
|
|
264
|
-
* the bottom of the scale — but a rule that needs no condition should have
|
|
265
|
-
* no media query.
|
|
266
|
-
*/
|
|
267
|
-
export const above = (name) => `(width >= ${step(name)}px)`;
|
|
268
|
-
/**
|
|
269
|
-
* "Narrower than this breakpoint" — the exact complement of `above`.
|
|
270
|
-
*
|
|
271
|
-
* below('md') → (width < 768px)
|
|
272
|
-
*
|
|
273
|
-
* `below('xs')` throws: xs is 0, and no viewport is narrower than that, so
|
|
274
|
-
* the query could only ever be dead CSS.
|
|
275
|
-
*/
|
|
276
|
-
export const below = (name) => {
|
|
277
|
-
const value = step(name);
|
|
278
|
-
if (value === 0) {
|
|
279
|
-
throw new Error(`below('${name}') has no meaning: no viewport is narrower than ${value}px. Did you mean above('${name}')?`);
|
|
280
|
-
}
|
|
281
|
-
return `(width < ${value}px)`;
|
|
282
|
-
};
|
|
283
|
-
/**
|
|
284
|
-
* The JS side of `below`, for the viewport logic CSS genuinely cannot express
|
|
285
|
-
* — choosing which markup to render rather than how to style it.
|
|
286
|
-
*
|
|
287
|
-
* matchesBelow('md') → true when the viewport is narrower than md
|
|
288
|
-
*
|
|
289
|
-
* It reads the same scale as the stylesheet, so the two cannot disagree. That
|
|
290
|
-
* is the failure this replaces: bd-footer switched at 767 in CSS and at 767
|
|
291
|
-
* in JS while bd-footer-lp, sharing the same stylesheet, switched at 768.
|
|
292
|
-
*
|
|
293
|
-
* Prefer CSS. Reach for this only when the component's *behaviour* changes,
|
|
294
|
-
* and re-read it on `resize` — the value is a snapshot, not a subscription.
|
|
295
|
-
*
|
|
296
|
-
* Outside a browser (SSR, a bare Node import) there is no viewport to be
|
|
297
|
-
* narrower than, so this reports false. The name is still validated first, so
|
|
298
|
-
* a typo throws in every environment rather than only in the browser.
|
|
299
|
-
*/
|
|
300
|
-
export const matchesBelow = (name) => {
|
|
301
|
-
const condition = below(name);
|
|
302
|
-
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
|
|
303
|
-
return false;
|
|
304
|
-
return window.matchMedia(condition).matches;
|
|
305
|
-
};
|
|
306
|
-
/* ================================================================
|
|
307
|
-
ROLE STEPS
|
|
308
|
-
================================================================
|
|
309
|
-
bd-h and bd-p size their text from the role their level or variant names
|
|
310
|
-
-- `.bd-heading.h4` reads --typography-heading-h4-*, `variant="small"`
|
|
311
|
-
reads --typography-body-small-* -- and offer no other hook. A component
|
|
312
|
-
whose type steps down at a width used to re-render with another level or
|
|
313
|
-
variant, decided once from the screen at render time and stale after any
|
|
314
|
-
resize, and moving the document outline with it.
|
|
315
|
-
|
|
316
|
-
readAs() keeps the level and the variant and steps the size in CSS: inside
|
|
317
|
-
a query, it points the role the element names at another one, on that
|
|
318
|
-
element only.
|
|
319
|
-
|
|
320
|
-
@container ${below('md')} {
|
|
321
|
-
.card-title { ${readAs('heading-h4', 'heading-h5')} }
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
The declarations land on an element inside the component's own shadow
|
|
325
|
-
root, where no page style can reach or override them -- not on :host,
|
|
326
|
-
where a re-declared token would shadow the page's. A role name is written
|
|
327
|
-
by the component author, so an unknown one throws, as below() does. */
|
|
328
|
-
const ROLE_AXES = {
|
|
329
|
-
'heading-h1': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],
|
|
330
|
-
'heading-h2': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],
|
|
331
|
-
'heading-h3': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],
|
|
332
|
-
'heading-h4': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],
|
|
333
|
-
'heading-h5': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],
|
|
334
|
-
'heading-h6': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],
|
|
335
|
-
/* bd-p's variant rules read four axes; the family is the paragraph's own. */
|
|
336
|
-
'body-large': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing'],
|
|
337
|
-
'body-regular': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing'],
|
|
338
|
-
'body-small': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing']
|
|
339
|
-
};
|
|
340
|
-
/** "Text set in role `from` reads as role `to` here." Declarations, for inside a rule. */
|
|
341
|
-
export const readAs = (from, to) => {
|
|
342
|
-
for (const role of [from, to]) {
|
|
343
|
-
if (!Object.hasOwn(ROLE_AXES, role)) {
|
|
344
|
-
throw new Error(`Unknown type role: ${role}. Expected one of ${Object.keys(ROLE_AXES).join(', ')}.`);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
if (from.split('-')[0] !== to.split('-')[0]) {
|
|
348
|
-
throw new Error(`readAs('${from}', '${to}'): a heading role reads as a heading, a body role as a body role.`);
|
|
349
|
-
}
|
|
350
|
-
return ROLE_AXES[from].map(axis => `--typography-${from}-${axis}: var(--typography-${to}-${axis});`).join(' ');
|
|
351
|
-
};
|
|
1
|
+
var e=/* @__PURE__ */ `0.1.2.4.6.8.10.12.14.16.18.20.22.24.28.32.36.40.44.48.52.56.64.80.96.112.128`.split(`.`),t=[`xxs`,`xs`,`sm`,`base`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`7xl`,`8xl`,`9xl`],n=[`light`,`normal`,`medium`,`semibold`,`bold`],r=[`sans`,`mono`],i=[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`],a={none:`0`,"4xs":`2`,"3xs":`4`,"2xs":`8`,xs:`12`,sm:`16`,md:`24`,lg:`32`,xl:`40`,"2xl":`48`,"3xl":`64`,"4xl":`96`,"5xl":`128`},o=[`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`],s=[`none`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`full`],c={primary:`--color-text-brand`,strong:`--color-text-primary`,muted:`--color-text-muted`,subtle:`--color-text-subtle`,inverse:`--color-text-inverse`,"on-brand":`--color-brand-on-fill`,success:`--color-text-success`,warning:`--color-text-warning`,error:`--color-text-error`},l=Object.keys(c),u={default:`--color-border-default`,subtle:`--color-border-subtle`,strong:`--color-border-strong`,container:`--color-border-container`,brand:`--color-border-brand`,disabled:`--color-border-disabled`,"brand-subtle":`--status-brand-border`},d=Object.keys(u),f=(e,t)=>n=>e.includes(String(n))?`var(${t}${n})`:``,p=f(e,`--spacing-`),m=f(t,`--typography-fontSize-`),h=f(n,`--typography-fontWeight-`),g=f(r,`--typography-fontFamily-`),_=f(i,`--typography-letterSpacing-`),v=f(s,`--radius-`),y=e=>[`none`,`full`].includes(String(e))?v(e):f(s,`--shape-radius-`)(e),b=[`0`,`1`,`2`,`3`,`4`,`8`],x=e=>{let t=String(e??``).replace(/px$/,``);return b.includes(t)?`var(--border-width-${t})`:``},S=e=>{if(e===``||e==null)return``;let t=Number(e);return Number.isFinite(t)&&t>=0&&t<=1?String(t):``},C=e=>Object.hasOwn(a,e)?`var(--spacing-${a[e]})`:``,w=e=>o.includes(String(e))?`var(--icon-${e}-size)`:``,T=e=>Object.hasOwn(c,e)?`var(${c[e]})`:``,E=e=>Object.hasOwn(u,e)?`var(${u[e]})`:T(e),D=e=>{let t=String(e??``).trim().split(/\s+/).filter(Boolean);if(t.length<1||t.length>4)return``;let n=t.map(p);return n.every(Boolean)?n.join(` `):``},O={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600},k=Object.keys(O),A=e=>{if(!Object.hasOwn(O,e))throw Error(`Unknown breakpoint: ${e}. Expected one of ${k.join(`, `)}.`);return O[e]},j=e=>`(width >= ${A(e)}px)`,M=e=>{let t=A(e);if(t===0)throw Error(`below('${e}') has no meaning: no viewport is narrower than ${t}px. Did you mean above('${e}')?`);return`(width < ${t}px)`},N=e=>{let t=M(e);return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(t).matches},P={"heading-h1":[`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`,`fontFamily`],"heading-h2":[`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`,`fontFamily`],"heading-h3":[`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`,`fontFamily`],"heading-h4":[`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`,`fontFamily`],"heading-h5":[`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`,`fontFamily`],"heading-h6":[`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`,`fontFamily`],"body-large":[`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`],"body-regular":[`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`],"body-small":[`fontSize`,`fontWeight`,`lineHeight`,`letterSpacing`]},F=(e,t)=>{for(let n of[e,t])if(!Object.hasOwn(P,n))throw Error(`Unknown type role: ${n}. Expected one of ${Object.keys(P).join(`, `)}.`);if(e.split(`-`)[0]!==t.split(`-`)[0])throw Error(`readAs('${e}', '${t}'): a heading role reads as a heading, a body role as a body role.`);return P[e].map(n=>`--typography-${e}-${n}: var(--typography-${t}-${n});`).join(` `)};export{u as BORDER_ROLES,d as BORDER_ROLE_NAMES,b as BORDER_WIDTH_STEPS,O as BREAKPOINTS,k as BREAKPOINT_NAMES,c as COLOR_ROLES,l as COLOR_ROLE_NAMES,r as FONT_FAMILY_STEPS,t as FONT_SIZE_STEPS,n as FONT_WEIGHT_STEPS,o as ICON_SIZE_STEPS,i as LETTER_SPACING_STEPS,s as RADIUS_STEPS,a as SPACE_STEPS,e as SPACING_STEPS,j as above,M as below,E as borderColor,x as borderWidth,T as color,g as fontFamily,m as fontSize,h as fontWeight,w as iconSize,_ as letterSpacing,N as matchesBelow,S as opacity,y as radius,F as readAs,C as space,p as spacing,D as spacingShorthand};
|
|
352
2
|
//# sourceMappingURL=token-scales.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-scales.js","sourceRoot":"","sources":["../../../../src/components/shared/token-scales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC5E,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK;CACtE,CAAC;AAGX,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE,IAAI,EAAE,IAAI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AAC;IACzE,cAAc,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC;IACzE,YAAY,EAAI,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC;CACjE,CAAC;AAGX,0FAA0F;AAC1F,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAc,EAAE,EAAY,EAAU,EAAE;IAC7D,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,qBAAqB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvG,CAAC;IACH,CAAC;IACD,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,WAAW,IAAI,OAAO,EAAE,oEAAoE,CAAC,CAAC;IAChH,CAAC;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,IAAI,IAAI,IAAI,sBAAsB,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjH,CAAC,CAAC","sourcesContent":["/**\n * The closed sets a component prop may draw from, and the only place that\n * turns a prop value into CSS.\n *\n * See CLAUDE.md, \"The foundation rule\". Every prop-facing function here\n * returns either a token reference or the empty string, so a literal cannot\n * come out of a component prop no matter what a caller passes. An\n * unrecognised value is dropped and the component keeps its own styling.\n *\n * The breakpoint helpers at the foot of this file are the one exception, and\n * they throw rather than returning empty. The reason is who calls them: every\n * scale above is fed a value a *consumer* passed as an attribute, where\n * dropping a bad value degrades gracefully. A breakpoint name is written by\n * the component author inside a stylesheet, and an empty string there yields\n * `@media { ... }` — a malformed query the browser discards silently, taking\n * the whole block with it. A typo has to fail loudly at the point it is made.\n */\n\nexport const SPACING_STEPS = [\n '0', '1', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24',\n '28', '32', '36', '40', '44', '48', '52', '56', '64', '80', '96', '112', '128'\n] as const;\nexport type SpacingStep = typeof SPACING_STEPS[number];\n\nexport const FONT_SIZE_STEPS = [\n 'xxs', 'xs', 'sm', 'base', 'lg', 'xl',\n '2xl', '3xl', '4xl', '5xl', '6xl', '7xl', '8xl', '9xl'\n] as const;\nexport type FontSizeStep = typeof FONT_SIZE_STEPS[number];\n\nexport const FONT_WEIGHT_STEPS = ['light', 'normal', 'medium', 'semibold', 'bold'] as const;\nexport type FontWeightStep = typeof FONT_WEIGHT_STEPS[number];\n\n/** The two faces the system ships. There is no third, and no escape hatch. */\nexport const FONT_FAMILY_STEPS = ['sans', 'mono'] as const;\nexport type FontFamilyStep = typeof FONT_FAMILY_STEPS[number];\n\nexport const LETTER_SPACING_STEPS = ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest'] as const;\nexport type LetterSpacingStep = typeof LETTER_SPACING_STEPS[number];\n\n/**\n * The t-shirt vocabulary bd-grid's gap and padding props take, mapped onto the\n * live pixel scale. It used to be a second CSS scale, --space-*, which existed\n * mainly so the component could build a token name from a prop — thirteen\n * tokens duplicating --spacing-* under other names. A prop vocabulary belongs\n * here, with the other closed sets, rather than in the token file.\n */\nexport const SPACE_STEPS = {\n none : '0', '4xs': '2', '3xs': '4', '2xs': '8', xs : '12', sm : '16',\n md : '24', lg : '32', xl : '40', '2xl': '48', '3xl': '64', '4xl': '96', '5xl': '128'\n} as const;\nexport type SpaceName = keyof typeof SPACE_STEPS;\n\n/** Icon sizes. The scale stops at 3xl (64px); there is no step above it. */\nexport const ICON_SIZE_STEPS = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'] as const;\nexport type IconSize = typeof ICON_SIZE_STEPS[number];\n\nexport const RADIUS_STEPS = ['none', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', 'full'] as const;\nexport type RadiusStep = typeof RADIUS_STEPS[number];\n\n/**\n * Semantic colour roles a component's `color` prop may name.\n *\n * These resolve through the --color-text-* roles rather than reaching past\n * them into the palette, which is what the semantic colour block in\n * src/tokens/tokens.ts says they should do. Spelled as palette steps, this\n * map was the reason a page could retint --color-text-muted and watch every\n * bd-h with color=\"muted\" ignore it: the values matched, so nothing looked\n * wrong until someone tried to change one.\n *\n * The prop vocabulary and the token vocabulary are deliberately not the same\n * words. `strong` and `primary` read better on a component than\n * `text-primary` and `text-brand` do, and renaming the prop would break\n * consumers' markup for no gain. The mapping is the seam, and it lives here.\n *\n * Every role clears 4.5:1 on white, which is what the docstring here always\n * claimed and what `subtle` did not do: it named neutral-400, which measures\n * 3.23:1 and fails 1.4.3 for text. It now resolves to --color-text-subtle\n * (neutral-500, 4.67:1). Nothing in this repository passed color=\"subtle\",\n * so the fix costs nothing today — note that neutral-400 is the step the\n * token layer calls `disabled`, and disabled text is exempt under 1.4.3,\n * which is presumably how the two got crossed.\n */\nexport const COLOR_ROLES = {\n primary : '--color-text-brand',\n strong : '--color-text-primary',\n muted : '--color-text-muted',\n subtle : '--color-text-subtle',\n inverse : '--color-text-inverse',\n /* Ink on a brand fill. `inverse` is for a dark neutral band; on a brand band\n the ink is the brand's, because a partner whose brand is light takes dark\n ink there, and white -- inverse -- would not read on it. Same pixel as\n inverse under Bitdefender. */\n 'on-brand': '--color-brand-on-fill',\n success : '--color-text-success',\n warning : '--color-text-warning',\n error : '--color-text-error'\n} as const;\nexport type ColorRole = keyof typeof COLOR_ROLES;\n\nexport const COLOR_ROLE_NAMES = Object.keys(COLOR_ROLES) as ColorRole[];\n\n/**\n * The hairline vocabulary.\n *\n * A divider is a border, and until now the only colour prop it had resolved\n * through COLOR_ROLES above -- the *ink* vocabulary. That is the category\n * error CLAUDE.md names (\"Never use a token from the wrong category\"), and\n * this file already carried a milder version of it: bd-divider-horizontal's\n * constructor records that its default used to say `subtle`, a text role that\n * matched the right value by coincidence.\n *\n * The cost was not theoretical. bd-quick-answer needs a hairline in\n * --status-brand-border, because its rule sits on a brand tint and a neutral\n * line reads as dirt there. No text role expresses that, so the component drew\n * its own `border-top` instead of composing the atom -- which is exactly the\n * \"dividers are not borders\" confusion the same document warns about, arrived\n * at from the other direction: the divider could not say what the component\n * meant, so the component stopped using the divider.\n *\n * `brand-subtle` is the one entry that reaches outside the --color-border-*\n * family, and it is here because it has a consumer today. The rest of the\n * status hairlines are deliberately absent until one does.\n *\n * `inverse` is deliberately NOT here. It would resolve to\n * --color-border-container-inverse, which is white at 12%, where the text\n * role it resolves to today is solid white -- and each divider then multiplies\n * that by its own `opacity` prop (0.25 by default on the horizontal, 1.00 on\n * the vertical). The dividers that pass color=\"inverse\" would drop from solid\n * white to 12%, or from 25% to 3%, and effectively vanish. It keeps falling\n * through to the legacy text role below, and that is recorded rather than\n * fixed: whether a hairline on a dark surface should be a 12% border role at\n * full opacity, or a solid one dimmed by the prop, is a real design question\n * and not this change's to answer.\n */\nexport const BORDER_ROLES = {\n default : '--color-border-default',\n subtle : '--color-border-subtle',\n strong : '--color-border-strong',\n container : '--color-border-container',\n brand : '--color-border-brand',\n disabled : '--color-border-disabled',\n 'brand-subtle': '--status-brand-border'\n} as const;\nexport type BorderRole = keyof typeof BORDER_ROLES;\n\nexport const BORDER_ROLE_NAMES = Object.keys(BORDER_ROLES) as BorderRole[];\n\nconst onScale = (steps: readonly string[], prefix: string) => (value: unknown): string =>\n steps.includes(String(value)) ? `var(${prefix}${value})` : '';\n\nexport const spacing = onScale(SPACING_STEPS, '--spacing-');\nexport const fontSize = onScale(FONT_SIZE_STEPS, '--typography-fontSize-');\nexport const fontWeight = onScale(FONT_WEIGHT_STEPS, '--typography-fontWeight-');\nexport const fontFamily = onScale(FONT_FAMILY_STEPS, '--typography-fontFamily-');\nexport const letterSpacing = onScale(LETTER_SPACING_STEPS, '--typography-letterSpacing-');\n/* none and full are corners a brand must not move -- square on purpose, and a\n circle -- so they stay on the scale; every other step reads the shape ramp a\n theme restates. Nothing calls this today; a caller that does gets partner\n corners for free. */\nconst radiusStep = onScale(RADIUS_STEPS, '--radius-');\nexport const radius = (step: unknown): string => (['none', 'full'].includes(String(step)) ? radiusStep(step) : onScale(RADIUS_STEPS, '--shape-radius-')(step));\n\n/* The border-width steps. A px spelling of a step -- \"2px\" -- is read as the\n step, because that is what callers wrote before there was a scale here. */\nexport const BORDER_WIDTH_STEPS = ['0', '1', '2', '3', '4', '8'] as const;\nexport type BorderWidthStep = typeof BORDER_WIDTH_STEPS[number];\nexport const borderWidth = (value: unknown): string => {\n const step = String(value ?? '').replace(/px$/, '');\n return (BORDER_WIDTH_STEPS as readonly string[]).includes(step) ? `var(--border-width-${step})` : '';\n};\n\n/* Not a scale: a fraction. An opacity given as a prop is kept only when it is\n a number from 0 to 1, so a stray string never reaches an inline style. */\nexport const opacity = (value: unknown): string => {\n if (value === '' || value == null) return '';\n const n = Number(value);\n return Number.isFinite(n) && n >= 0 && n <= 1 ? String(n) : '';\n};\n\nexport const space = (name: unknown): string =>\n (Object.hasOwn(SPACE_STEPS, name as PropertyKey) ? `var(--spacing-${SPACE_STEPS[name as SpaceName]})` : '');\n\n/** --icon-*-size wraps its step, so it needs a suffix onScale cannot express. */\nexport const iconSize = (value: unknown): string =>\n ((ICON_SIZE_STEPS as readonly string[]).includes(String(value)) ? `var(--icon-${value}-size)` : '');\n\nexport const color = (role: unknown): string =>\n Object.hasOwn(COLOR_ROLES, role as PropertyKey) ? `var(${COLOR_ROLES[role as ColorRole]})` : '';\n\n/**\n * A hairline's colour: border roles first, then the ink vocabulary as legacy.\n *\n * Border-first is the point -- `subtle` on a divider means\n * --color-border-subtle, not --color-text-subtle. The fallback exists so the\n * names already in use keep working (`inverse`, and `strong`, which resolves\n * to neutral-900 either way), and it is a migration path, not a second\n * vocabulary: a new divider should be spelled with a border role.\n */\nexport const borderColor = (role: unknown): string =>\n (Object.hasOwn(BORDER_ROLES, role as PropertyKey)\n ? `var(${BORDER_ROLES[role as BorderRole]})`\n : color(role));\n\n/**\n * A one-to-four-value spacing shorthand written as steps, e.g. \"10 0\" gives\n * `var(--spacing-10) var(--spacing-0)`. All parts must be on the scale, or\n * the whole value is dropped — a half-valid shorthand is worse than none.\n */\nexport const spacingShorthand = (value: unknown): string => {\n const parts = String(value ?? '').trim()\n .split(/\\s+/)\n .filter(Boolean);\n if (parts.length < 1 || parts.length > 4) return '';\n const refs = parts.map(spacing);\n return refs.every(Boolean) ? refs.join(' ') : '';\n};\n\n/* ================================================================\n BREAKPOINTS\n ================================================================\n The seven viewport widths, and the only place a media condition is built\n from them.\n\n This lives in JS rather than in the token file because a media condition\n cannot read a custom property — `@media (max-width: var(--breakpoint-md))`\n is not valid CSS — so the seven values have to be interpolated into the\n stylesheet at author time. `--breakpoint-*` in src/tokens/tokens.ts stays\n the published record of the scale; this is how a component consumes it.\n\n `above` and `below` return a media *condition*, not a whole `@media` rule,\n so they compose:\n\n @media ${below('md')} { ... }\n @media ${above('sm')} and ${below('lg')} { ... }\n\n ---\n\n WHY THE HELPER OWNS THE COMPLEMENT.\n\n A breakpoint is one number, but it has two sides, and writing the second\n one by hand is how the boundary drifts. `min-width: 768px` and\n `max-width: 768px` are both true at exactly 768px, so a component that\n spelled its mobile rule the obvious way applied both its mobile and its\n desktop styling at that one width: pricing-card.css.ts had\n `@media (max-width: 768px)` at one rule and\n `@media (min-width: 768px) and (max-width: 1024px)` at another, and\n thirteen more files used the same `max-width: 768px` form.\n\n The complement is derived here so that number is never typed. Do not write\n 767px, 991px or 1199px anywhere; write `below('md')`, `below('lg')`,\n `below('xl')`.\n\n ---\n\n WHY RANGE SYNTAX, AND NO EPSILON.\n\n `(width >= 768px)` and `(width < 768px)` are exact complements: every\n width, fractional ones included, matches one of them and never both. A\n viewport is not always a whole number of pixels -- browser zoom, some\n Android densities and fractional device-pixel-ratios all produce widths\n like 767.5px -- and the min-/max- spelling could not say \"narrower than\"\n without choosing a number below the breakpoint. `max-width: 767px` left\n every width between 767 and 768 matched by neither side, and the\n `max-width: 767.98px` this helper emitted until 2026-10-28 shrank that band\n to a fiftieth of a pixel rather than closing it. The range form has no\n number to choose.\n\n Media query range syntax is Baseline Widely available (since 2023-03), so\n it is used as is. The same conditions are valid in @container, where they\n ask the container's width instead of the viewport's:\n\n @container ${below('sm')} { ... } */\n\nexport const BREAKPOINTS = {\n xs : 0,\n sm : 576,\n md : 768,\n lg : 992,\n xl : 1200,\n xxl : 1400,\n /* Not a grid-progression step: the site's menu and footer widen here, and\n the page column has to widen with them. See --grid-container-max-xxxl. */\n xxxl: 1600\n} as const;\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\nexport const BREAKPOINT_NAMES = Object.keys(BREAKPOINTS) as Breakpoint[];\n\n/** Throws rather than returning empty — see the note in the file header. */\nconst step = (name: Breakpoint): number => {\n if (!Object.hasOwn(BREAKPOINTS, name)) {\n throw new Error(`Unknown breakpoint: ${name}. Expected one of ${BREAKPOINT_NAMES.join(', ')}.`);\n }\n return BREAKPOINTS[name];\n};\n\n/**\n * \"This breakpoint and wider.\"\n *\n * above('md') → (width >= 768px)\n *\n * `above('xs')` is `(width >= 0px)`, which is always true. That is a\n * harmless no-op rather than an error, because it is the honest answer for\n * the bottom of the scale — but a rule that needs no condition should have\n * no media query.\n */\nexport const above = (name: Breakpoint): string => `(width >= ${step(name)}px)`;\n\n/**\n * \"Narrower than this breakpoint\" — the exact complement of `above`.\n *\n * below('md') → (width < 768px)\n *\n * `below('xs')` throws: xs is 0, and no viewport is narrower than that, so\n * the query could only ever be dead CSS.\n */\nexport const below = (name: Breakpoint): string => {\n const value = step(name);\n if (value === 0) {\n throw new Error(`below('${name}') has no meaning: no viewport is narrower than ${value}px. Did you mean above('${name}')?`);\n }\n return `(width < ${value}px)`;\n};\n\n/**\n * The JS side of `below`, for the viewport logic CSS genuinely cannot express\n * — choosing which markup to render rather than how to style it.\n *\n * matchesBelow('md') → true when the viewport is narrower than md\n *\n * It reads the same scale as the stylesheet, so the two cannot disagree. That\n * is the failure this replaces: bd-footer switched at 767 in CSS and at 767\n * in JS while bd-footer-lp, sharing the same stylesheet, switched at 768.\n *\n * Prefer CSS. Reach for this only when the component's *behaviour* changes,\n * and re-read it on `resize` — the value is a snapshot, not a subscription.\n *\n * Outside a browser (SSR, a bare Node import) there is no viewport to be\n * narrower than, so this reports false. The name is still validated first, so\n * a typo throws in every environment rather than only in the browser.\n */\nexport const matchesBelow = (name: Breakpoint): boolean => {\n const condition = below(name);\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\n return window.matchMedia(condition).matches;\n};\n\n/* ================================================================\n ROLE STEPS\n ================================================================\n bd-h and bd-p size their text from the role their level or variant names\n -- `.bd-heading.h4` reads --typography-heading-h4-*, `variant=\"small\"`\n reads --typography-body-small-* -- and offer no other hook. A component\n whose type steps down at a width used to re-render with another level or\n variant, decided once from the screen at render time and stale after any\n resize, and moving the document outline with it.\n\n readAs() keeps the level and the variant and steps the size in CSS: inside\n a query, it points the role the element names at another one, on that\n element only.\n\n @container ${below('md')} {\n .card-title { ${readAs('heading-h4', 'heading-h5')} }\n }\n\n The declarations land on an element inside the component's own shadow\n root, where no page style can reach or override them -- not on :host,\n where a re-declared token would shadow the page's. A role name is written\n by the component author, so an unknown one throws, as below() does. */\n\nconst ROLE_AXES = {\n 'heading-h1' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h2' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h3' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h4' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h5' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h6' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n /* bd-p's variant rules read four axes; the family is the paragraph's own. */\n 'body-large' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing'],\n 'body-regular': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing'],\n 'body-small' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing']\n} as const;\nexport type TypeRole = keyof typeof ROLE_AXES;\n\n/** \"Text set in role `from` reads as role `to` here.\" Declarations, for inside a rule. */\nexport const readAs = (from: TypeRole, to: TypeRole): string => {\n for (const role of [from, to]) {\n if (!Object.hasOwn(ROLE_AXES, role)) {\n throw new Error(`Unknown type role: ${role}. Expected one of ${Object.keys(ROLE_AXES).join(', ')}.`);\n }\n }\n if (from.split('-')[0] !== to.split('-')[0]) {\n throw new Error(`readAs('${from}', '${to}'): a heading role reads as a heading, a body role as a body role.`);\n }\n return ROLE_AXES[from].map(axis => `--typography-${from}-${axis}: var(--typography-${to}-${axis});`).join(' ');\n};\n"]}
|
|
1
|
+
{"version":3,"file":"token-scales.js","names":["SPACING_STEPS","FONT_SIZE_STEPS","FONT_WEIGHT_STEPS","FONT_FAMILY_STEPS","LETTER_SPACING_STEPS","SPACE_STEPS","ICON_SIZE_STEPS","RADIUS_STEPS","COLOR_ROLES","COLOR_ROLE_NAMES","BORDER_ROLES","BORDER_ROLE_NAMES","onScale","steps","value","prefix","spacing","fontSize","fontWeight","fontFamily","letterSpacing","radiusStep","radius","step","BORDER_WIDTH_STEPS","borderWidth","opacity","n","space","name","iconSize","color","role","borderColor","spacingShorthand","parts","refs","BREAKPOINTS","BREAKPOINT_NAMES","above","below","matchesBelow","condition","ROLE_AXES","readAs","from","to","axis"],"sources":["../../../../src/components/shared/token-scales.ts"],"sourcesContent":["/**\n * The closed sets a component prop may draw from, and the only place that\n * turns a prop value into CSS.\n *\n * See CLAUDE.md, \"The foundation rule\". Every prop-facing function here\n * returns either a token reference or the empty string, so a literal cannot\n * come out of a component prop no matter what a caller passes. An\n * unrecognised value is dropped and the component keeps its own styling.\n *\n * The breakpoint helpers at the foot of this file are the one exception, and\n * they throw rather than returning empty. The reason is who calls them: every\n * scale above is fed a value a *consumer* passed as an attribute, where\n * dropping a bad value degrades gracefully. A breakpoint name is written by\n * the component author inside a stylesheet, and an empty string there yields\n * `@media { ... }` — a malformed query the browser discards silently, taking\n * the whole block with it. A typo has to fail loudly at the point it is made.\n */\n\nexport const SPACING_STEPS = [\n '0', '1', '2', '4', '6', '8', '10', '12', '14', '16', '18', '20', '22', '24',\n '28', '32', '36', '40', '44', '48', '52', '56', '64', '80', '96', '112', '128'\n] as const;\nexport type SpacingStep = typeof SPACING_STEPS[number];\n\nexport const FONT_SIZE_STEPS = [\n 'xxs', 'xs', 'sm', 'base', 'lg', 'xl',\n '2xl', '3xl', '4xl', '5xl', '6xl', '7xl', '8xl', '9xl'\n] as const;\nexport type FontSizeStep = typeof FONT_SIZE_STEPS[number];\n\nexport const FONT_WEIGHT_STEPS = ['light', 'normal', 'medium', 'semibold', 'bold'] as const;\nexport type FontWeightStep = typeof FONT_WEIGHT_STEPS[number];\n\n/** The two faces the system ships. There is no third, and no escape hatch. */\nexport const FONT_FAMILY_STEPS = ['sans', 'mono'] as const;\nexport type FontFamilyStep = typeof FONT_FAMILY_STEPS[number];\n\nexport const LETTER_SPACING_STEPS = ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest'] as const;\nexport type LetterSpacingStep = typeof LETTER_SPACING_STEPS[number];\n\n/**\n * The t-shirt vocabulary bd-grid's gap and padding props take, mapped onto the\n * live pixel scale. It used to be a second CSS scale, --space-*, which existed\n * mainly so the component could build a token name from a prop — thirteen\n * tokens duplicating --spacing-* under other names. A prop vocabulary belongs\n * here, with the other closed sets, rather than in the token file.\n */\nexport const SPACE_STEPS = {\n none : '0', '4xs': '2', '3xs': '4', '2xs': '8', xs : '12', sm : '16',\n md : '24', lg : '32', xl : '40', '2xl': '48', '3xl': '64', '4xl': '96', '5xl': '128'\n} as const;\nexport type SpaceName = keyof typeof SPACE_STEPS;\n\n/** Icon sizes. The scale stops at 3xl (64px); there is no step above it. */\nexport const ICON_SIZE_STEPS = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'] as const;\nexport type IconSize = typeof ICON_SIZE_STEPS[number];\n\nexport const RADIUS_STEPS = ['none', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', 'full'] as const;\nexport type RadiusStep = typeof RADIUS_STEPS[number];\n\n/**\n * Semantic colour roles a component's `color` prop may name.\n *\n * These resolve through the --color-text-* roles rather than reaching past\n * them into the palette, which is what the semantic colour block in\n * src/tokens/tokens.ts says they should do. Spelled as palette steps, this\n * map was the reason a page could retint --color-text-muted and watch every\n * bd-h with color=\"muted\" ignore it: the values matched, so nothing looked\n * wrong until someone tried to change one.\n *\n * The prop vocabulary and the token vocabulary are deliberately not the same\n * words. `strong` and `primary` read better on a component than\n * `text-primary` and `text-brand` do, and renaming the prop would break\n * consumers' markup for no gain. The mapping is the seam, and it lives here.\n *\n * Every role clears 4.5:1 on white, which is what the docstring here always\n * claimed and what `subtle` did not do: it named neutral-400, which measures\n * 3.23:1 and fails 1.4.3 for text. It now resolves to --color-text-subtle\n * (neutral-500, 4.67:1). Nothing in this repository passed color=\"subtle\",\n * so the fix costs nothing today — note that neutral-400 is the step the\n * token layer calls `disabled`, and disabled text is exempt under 1.4.3,\n * which is presumably how the two got crossed.\n */\nexport const COLOR_ROLES = {\n primary : '--color-text-brand',\n strong : '--color-text-primary',\n muted : '--color-text-muted',\n subtle : '--color-text-subtle',\n inverse : '--color-text-inverse',\n /* Ink on a brand fill. `inverse` is for a dark neutral band; on a brand band\n the ink is the brand's, because a partner whose brand is light takes dark\n ink there, and white -- inverse -- would not read on it. Same pixel as\n inverse under Bitdefender. */\n 'on-brand': '--color-brand-on-fill',\n success : '--color-text-success',\n warning : '--color-text-warning',\n error : '--color-text-error'\n} as const;\nexport type ColorRole = keyof typeof COLOR_ROLES;\n\nexport const COLOR_ROLE_NAMES = Object.keys(COLOR_ROLES) as ColorRole[];\n\n/**\n * The hairline vocabulary.\n *\n * A divider is a border, and until now the only colour prop it had resolved\n * through COLOR_ROLES above -- the *ink* vocabulary. That is the category\n * error CLAUDE.md names (\"Never use a token from the wrong category\"), and\n * this file already carried a milder version of it: bd-divider-horizontal's\n * constructor records that its default used to say `subtle`, a text role that\n * matched the right value by coincidence.\n *\n * The cost was not theoretical. bd-quick-answer needs a hairline in\n * --status-brand-border, because its rule sits on a brand tint and a neutral\n * line reads as dirt there. No text role expresses that, so the component drew\n * its own `border-top` instead of composing the atom -- which is exactly the\n * \"dividers are not borders\" confusion the same document warns about, arrived\n * at from the other direction: the divider could not say what the component\n * meant, so the component stopped using the divider.\n *\n * `brand-subtle` is the one entry that reaches outside the --color-border-*\n * family, and it is here because it has a consumer today. The rest of the\n * status hairlines are deliberately absent until one does.\n *\n * `inverse` is deliberately NOT here. It would resolve to\n * --color-border-container-inverse, which is white at 12%, where the text\n * role it resolves to today is solid white -- and each divider then multiplies\n * that by its own `opacity` prop (0.25 by default on the horizontal, 1.00 on\n * the vertical). The dividers that pass color=\"inverse\" would drop from solid\n * white to 12%, or from 25% to 3%, and effectively vanish. It keeps falling\n * through to the legacy text role below, and that is recorded rather than\n * fixed: whether a hairline on a dark surface should be a 12% border role at\n * full opacity, or a solid one dimmed by the prop, is a real design question\n * and not this change's to answer.\n */\nexport const BORDER_ROLES = {\n default : '--color-border-default',\n subtle : '--color-border-subtle',\n strong : '--color-border-strong',\n container : '--color-border-container',\n brand : '--color-border-brand',\n disabled : '--color-border-disabled',\n 'brand-subtle': '--status-brand-border'\n} as const;\nexport type BorderRole = keyof typeof BORDER_ROLES;\n\nexport const BORDER_ROLE_NAMES = Object.keys(BORDER_ROLES) as BorderRole[];\n\nconst onScale = (steps: readonly string[], prefix: string) => (value: unknown): string =>\n steps.includes(String(value)) ? `var(${prefix}${value})` : '';\n\nexport const spacing = onScale(SPACING_STEPS, '--spacing-');\nexport const fontSize = onScale(FONT_SIZE_STEPS, '--typography-fontSize-');\nexport const fontWeight = onScale(FONT_WEIGHT_STEPS, '--typography-fontWeight-');\nexport const fontFamily = onScale(FONT_FAMILY_STEPS, '--typography-fontFamily-');\nexport const letterSpacing = onScale(LETTER_SPACING_STEPS, '--typography-letterSpacing-');\n/* none and full are corners a brand must not move -- square on purpose, and a\n circle -- so they stay on the scale; every other step reads the shape ramp a\n theme restates. Nothing calls this today; a caller that does gets partner\n corners for free. */\nconst radiusStep = onScale(RADIUS_STEPS, '--radius-');\nexport const radius = (step: unknown): string => (['none', 'full'].includes(String(step)) ? radiusStep(step) : onScale(RADIUS_STEPS, '--shape-radius-')(step));\n\n/* The border-width steps. A px spelling of a step -- \"2px\" -- is read as the\n step, because that is what callers wrote before there was a scale here. */\nexport const BORDER_WIDTH_STEPS = ['0', '1', '2', '3', '4', '8'] as const;\nexport type BorderWidthStep = typeof BORDER_WIDTH_STEPS[number];\nexport const borderWidth = (value: unknown): string => {\n const step = String(value ?? '').replace(/px$/, '');\n return (BORDER_WIDTH_STEPS as readonly string[]).includes(step) ? `var(--border-width-${step})` : '';\n};\n\n/* Not a scale: a fraction. An opacity given as a prop is kept only when it is\n a number from 0 to 1, so a stray string never reaches an inline style. */\nexport const opacity = (value: unknown): string => {\n if (value === '' || value == null) return '';\n const n = Number(value);\n return Number.isFinite(n) && n >= 0 && n <= 1 ? String(n) : '';\n};\n\nexport const space = (name: unknown): string =>\n (Object.hasOwn(SPACE_STEPS, name as PropertyKey) ? `var(--spacing-${SPACE_STEPS[name as SpaceName]})` : '');\n\n/** --icon-*-size wraps its step, so it needs a suffix onScale cannot express. */\nexport const iconSize = (value: unknown): string =>\n ((ICON_SIZE_STEPS as readonly string[]).includes(String(value)) ? `var(--icon-${value}-size)` : '');\n\nexport const color = (role: unknown): string =>\n Object.hasOwn(COLOR_ROLES, role as PropertyKey) ? `var(${COLOR_ROLES[role as ColorRole]})` : '';\n\n/**\n * A hairline's colour: border roles first, then the ink vocabulary as legacy.\n *\n * Border-first is the point -- `subtle` on a divider means\n * --color-border-subtle, not --color-text-subtle. The fallback exists so the\n * names already in use keep working (`inverse`, and `strong`, which resolves\n * to neutral-900 either way), and it is a migration path, not a second\n * vocabulary: a new divider should be spelled with a border role.\n */\nexport const borderColor = (role: unknown): string =>\n (Object.hasOwn(BORDER_ROLES, role as PropertyKey)\n ? `var(${BORDER_ROLES[role as BorderRole]})`\n : color(role));\n\n/**\n * A one-to-four-value spacing shorthand written as steps, e.g. \"10 0\" gives\n * `var(--spacing-10) var(--spacing-0)`. All parts must be on the scale, or\n * the whole value is dropped — a half-valid shorthand is worse than none.\n */\nexport const spacingShorthand = (value: unknown): string => {\n const parts = String(value ?? '').trim()\n .split(/\\s+/)\n .filter(Boolean);\n if (parts.length < 1 || parts.length > 4) return '';\n const refs = parts.map(spacing);\n return refs.every(Boolean) ? refs.join(' ') : '';\n};\n\n/* ================================================================\n BREAKPOINTS\n ================================================================\n The seven viewport widths, and the only place a media condition is built\n from them.\n\n This lives in JS rather than in the token file because a media condition\n cannot read a custom property — `@media (max-width: var(--breakpoint-md))`\n is not valid CSS — so the seven values have to be interpolated into the\n stylesheet at author time. `--breakpoint-*` in src/tokens/tokens.ts stays\n the published record of the scale; this is how a component consumes it.\n\n `above` and `below` return a media *condition*, not a whole `@media` rule,\n so they compose:\n\n @media ${below('md')} { ... }\n @media ${above('sm')} and ${below('lg')} { ... }\n\n ---\n\n WHY THE HELPER OWNS THE COMPLEMENT.\n\n A breakpoint is one number, but it has two sides, and writing the second\n one by hand is how the boundary drifts. `min-width: 768px` and\n `max-width: 768px` are both true at exactly 768px, so a component that\n spelled its mobile rule the obvious way applied both its mobile and its\n desktop styling at that one width: pricing-card.css.ts had\n `@media (max-width: 768px)` at one rule and\n `@media (min-width: 768px) and (max-width: 1024px)` at another, and\n thirteen more files used the same `max-width: 768px` form.\n\n The complement is derived here so that number is never typed. Do not write\n 767px, 991px or 1199px anywhere; write `below('md')`, `below('lg')`,\n `below('xl')`.\n\n ---\n\n WHY RANGE SYNTAX, AND NO EPSILON.\n\n `(width >= 768px)` and `(width < 768px)` are exact complements: every\n width, fractional ones included, matches one of them and never both. A\n viewport is not always a whole number of pixels -- browser zoom, some\n Android densities and fractional device-pixel-ratios all produce widths\n like 767.5px -- and the min-/max- spelling could not say \"narrower than\"\n without choosing a number below the breakpoint. `max-width: 767px` left\n every width between 767 and 768 matched by neither side, and the\n `max-width: 767.98px` this helper emitted until 2026-10-28 shrank that band\n to a fiftieth of a pixel rather than closing it. The range form has no\n number to choose.\n\n Media query range syntax is Baseline Widely available (since 2023-03), so\n it is used as is. The same conditions are valid in @container, where they\n ask the container's width instead of the viewport's:\n\n @container ${below('sm')} { ... } */\n\nexport const BREAKPOINTS = {\n xs : 0,\n sm : 576,\n md : 768,\n lg : 992,\n xl : 1200,\n xxl : 1400,\n /* Not a grid-progression step: the site's menu and footer widen here, and\n the page column has to widen with them. See --grid-container-max-xxxl. */\n xxxl: 1600\n} as const;\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\nexport const BREAKPOINT_NAMES = Object.keys(BREAKPOINTS) as Breakpoint[];\n\n/** Throws rather than returning empty — see the note in the file header. */\nconst step = (name: Breakpoint): number => {\n if (!Object.hasOwn(BREAKPOINTS, name)) {\n throw new Error(`Unknown breakpoint: ${name}. Expected one of ${BREAKPOINT_NAMES.join(', ')}.`);\n }\n return BREAKPOINTS[name];\n};\n\n/**\n * \"This breakpoint and wider.\"\n *\n * above('md') → (width >= 768px)\n *\n * `above('xs')` is `(width >= 0px)`, which is always true. That is a\n * harmless no-op rather than an error, because it is the honest answer for\n * the bottom of the scale — but a rule that needs no condition should have\n * no media query.\n */\nexport const above = (name: Breakpoint): string => `(width >= ${step(name)}px)`;\n\n/**\n * \"Narrower than this breakpoint\" — the exact complement of `above`.\n *\n * below('md') → (width < 768px)\n *\n * `below('xs')` throws: xs is 0, and no viewport is narrower than that, so\n * the query could only ever be dead CSS.\n */\nexport const below = (name: Breakpoint): string => {\n const value = step(name);\n if (value === 0) {\n throw new Error(`below('${name}') has no meaning: no viewport is narrower than ${value}px. Did you mean above('${name}')?`);\n }\n return `(width < ${value}px)`;\n};\n\n/**\n * The JS side of `below`, for the viewport logic CSS genuinely cannot express\n * — choosing which markup to render rather than how to style it.\n *\n * matchesBelow('md') → true when the viewport is narrower than md\n *\n * It reads the same scale as the stylesheet, so the two cannot disagree. That\n * is the failure this replaces: bd-footer switched at 767 in CSS and at 767\n * in JS while bd-footer-lp, sharing the same stylesheet, switched at 768.\n *\n * Prefer CSS. Reach for this only when the component's *behaviour* changes,\n * and re-read it on `resize` — the value is a snapshot, not a subscription.\n *\n * Outside a browser (SSR, a bare Node import) there is no viewport to be\n * narrower than, so this reports false. The name is still validated first, so\n * a typo throws in every environment rather than only in the browser.\n */\nexport const matchesBelow = (name: Breakpoint): boolean => {\n const condition = below(name);\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\n return window.matchMedia(condition).matches;\n};\n\n/* ================================================================\n ROLE STEPS\n ================================================================\n bd-h and bd-p size their text from the role their level or variant names\n -- `.bd-heading.h4` reads --typography-heading-h4-*, `variant=\"small\"`\n reads --typography-body-small-* -- and offer no other hook. A component\n whose type steps down at a width used to re-render with another level or\n variant, decided once from the screen at render time and stale after any\n resize, and moving the document outline with it.\n\n readAs() keeps the level and the variant and steps the size in CSS: inside\n a query, it points the role the element names at another one, on that\n element only.\n\n @container ${below('md')} {\n .card-title { ${readAs('heading-h4', 'heading-h5')} }\n }\n\n The declarations land on an element inside the component's own shadow\n root, where no page style can reach or override them -- not on :host,\n where a re-declared token would shadow the page's. A role name is written\n by the component author, so an unknown one throws, as below() does. */\n\nconst ROLE_AXES = {\n 'heading-h1' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h2' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h3' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h4' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h5' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n 'heading-h6' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'fontFamily'],\n /* bd-p's variant rules read four axes; the family is the paragraph's own. */\n 'body-large' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing'],\n 'body-regular': ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing'],\n 'body-small' : ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing']\n} as const;\nexport type TypeRole = keyof typeof ROLE_AXES;\n\n/** \"Text set in role `from` reads as role `to` here.\" Declarations, for inside a rule. */\nexport const readAs = (from: TypeRole, to: TypeRole): string => {\n for (const role of [from, to]) {\n if (!Object.hasOwn(ROLE_AXES, role)) {\n throw new Error(`Unknown type role: ${role}. Expected one of ${Object.keys(ROLE_AXES).join(', ')}.`);\n }\n }\n if (from.split('-')[0] !== to.split('-')[0]) {\n throw new Error(`readAs('${from}', '${to}'): a heading role reads as a heading, a body role as a body role.`);\n }\n return ROLE_AXES[from].map(axis => `--typography-${from}-${axis}: var(--typography-${to}-${axis});`).join(' ');\n};\n"],"mappings":"AAkBA,IAAaA,EAAgB,wGAG7B,EAGaC,EAAkB,CAC7B,MAAO,KAAM,KAAM,OAAQ,KAAM,KACjC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KACnD,EAGaC,EAAoB,CAAC,QAAS,SAAU,SAAU,WAAY,MAAM,EAIpEC,EAAoB,CAAC,OAAQ,MAAM,EAGnCC,EAAuB,CAAC,UAAW,QAAS,SAAU,OAAQ,QAAS,QAAQ,EAU/EC,EAAc,CACzB,KAAO,IAAK,MAAO,IAAK,MAAO,IAAK,MAAO,IAAK,GAAO,KAAM,GAAO,KACpE,GAAO,KAAM,GAAO,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,CAC/G,E"}
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** Styled entirely from design tokens — see npm run lint:tokens. */
|
|
3
|
-
export const skeletonCSS = css `
|
|
4
|
-
:host { display: block; }
|
|
5
|
-
|
|
6
|
-
.bone {
|
|
7
|
-
background: var(--color-surface-muted);
|
|
8
|
-
border-radius: var(--shape-radius-sm);
|
|
9
|
-
height: var(--spacing-16);
|
|
10
|
-
animation: bd-shimmer var(--transition-duration-slower) var(--transition-easing-smooth) infinite alternate;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.bone + .bone { margin-top: var(--spacing-8); }
|
|
14
|
-
|
|
15
|
-
:host([shape='circle']) .bone {
|
|
16
|
-
width: var(--dimension-40);
|
|
17
|
-
height: var(--dimension-40);
|
|
18
|
-
border-radius: var(--radius-full);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:host([shape='title']) .bone { height: var(--spacing-24); }
|
|
22
|
-
|
|
23
|
-
/* --opacity-pulse, not 0.45. The dim end of a "this is busy" pulse is the
|
|
24
|
-
same intent here, in bd-button and in bd-spinner; it was spelled three
|
|
25
|
-
times and two of the three said 0.4. The role now says it once. */
|
|
26
|
-
@keyframes bd-shimmer { to { opacity: var(--opacity-pulse); } }
|
|
27
|
-
|
|
28
|
-
@media (prefers-reduced-motion: reduce) {
|
|
29
|
-
.bone { animation: none; }
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
export default skeletonCSS;
|
|
1
|
+
import{css as e}from"lit";var t=e`:host{display:block}.bone{background:var(--color-surface-muted);border-radius:var(--shape-radius-sm);height:var(--spacing-16);animation:bd-shimmer var(--transition-duration-slower) var(--transition-easing-smooth) infinite alternate}.bone+.bone{margin-top:var(--spacing-8)}:host([shape=circle]) .bone{width:var(--dimension-40);height:var(--dimension-40);border-radius:var(--radius-full)}:host([shape=title]) .bone{height:var(--spacing-24)}@keyframes bd-shimmer{to{opacity:var(--opacity-pulse)}}@media (prefers-reduced-motion:reduce){.bone{animation:none}}`;export{t as default,t as skeletonCSS};
|
|
33
2
|
//# sourceMappingURL=skeleton.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.css.js","
|
|
1
|
+
{"version":3,"file":"skeleton.css.js","names":["skeletonCSS"],"sources":["../../../../src/components/skeleton/skeleton.css.ts"],"sourcesContent":["import { css } from 'lit';\n\n/** Styled entirely from design tokens — see npm run lint:tokens. */\nexport const skeletonCSS = css`\n :host { display: block; }\n\n .bone {\n background: var(--color-surface-muted);\n border-radius: var(--shape-radius-sm);\n height: var(--spacing-16);\n animation: bd-shimmer var(--transition-duration-slower) var(--transition-easing-smooth) infinite alternate;\n }\n\n .bone + .bone { margin-top: var(--spacing-8); }\n\n :host([shape='circle']) .bone {\n width: var(--dimension-40);\n height: var(--dimension-40);\n border-radius: var(--radius-full);\n }\n\n :host([shape='title']) .bone { height: var(--spacing-24); }\n\n /* --opacity-pulse, not 0.45. The dim end of a \"this is busy\" pulse is the\n same intent here, in bd-button and in bd-spinner; it was spelled three\n times and two of the three said 0.4. The role now says it once. */\n @keyframes bd-shimmer { to { opacity: var(--opacity-pulse); } }\n\n @media (prefers-reduced-motion: reduce) {\n .bone { animation: none; }\n }\n`;\n\nexport default skeletonCSS;\n"],"mappings":"A,0BAGA,IAAaA,EAAc,CAAG,6iB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LitElement } from
|
|
2
|
-
import
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "../../tokens/tokens.js";
|
|
3
3
|
type Shape = 'line' | 'title' | 'circle';
|
|
4
4
|
export declare class BdSkeleton extends LitElement {
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
@@ -1,41 +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 { 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 { skeletonCSS } from "./skeleton.css.js";
|
|
13
|
-
let BdSkeleton = class BdSkeleton extends LitElement {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.lines = 1;
|
|
17
|
-
this.shape = 'line';
|
|
18
|
-
}
|
|
19
|
-
static { this.styles = [skeletonCSS]; }
|
|
20
|
-
render() {
|
|
21
|
-
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 n from"./skeleton.css.js";import{LitElement as r,html as i,nothing as a}from"lit";import{property as o}from"lit/decorators.js";var s=class extends r{constructor(...e){super(...e),this.lines=1,this.shape=`line`}static{this.styles=[n]}render(){return i`
|
|
22
2
|
<span aria-hidden="true">
|
|
23
|
-
${Array.from({
|
|
3
|
+
${Array.from({length:this.lines},(e,t)=>i`<div
|
|
24
4
|
class="bone"
|
|
25
|
-
style=${
|
|
5
|
+
style=${t===this.lines-1&&this.lines>1?`width: 60%`:a}
|
|
26
6
|
></div>`)}
|
|
27
7
|
</span>
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
__decorate([
|
|
32
|
-
property({ type: Number })
|
|
33
|
-
], BdSkeleton.prototype, "lines", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
property({ type: String, reflect: true })
|
|
36
|
-
], BdSkeleton.prototype, "shape", void 0);
|
|
37
|
-
BdSkeleton = __decorate([
|
|
38
|
-
defineElement('bd-skeleton')
|
|
39
|
-
], BdSkeleton);
|
|
40
|
-
export { BdSkeleton };
|
|
8
|
+
`}};t([o({type:Number})],s.prototype,`lines`,void 0),t([o({type:String,reflect:!0})],s.prototype,`shape`,void 0),s=t([e(`bd-skeleton`)],s);export{s as BdSkeleton};
|
|
41
9
|
//# sourceMappingURL=skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","
|
|
1
|
+
{"version":3,"file":"skeleton.js","names":["_decorate","__decorate","skeletonCSS","BdSkeleton","LitElement","_args","i","nothing","property","defineElement"],"sources":["../../../../src/components/skeleton/skeleton.ts"],"sourcesContent":["import { LitElement, html, nothing } 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 { skeletonCSS } from './skeleton.css.ts';\n\ntype Shape = 'line' | 'title' | 'circle';\n\n@defineElement('bd-skeleton')\nexport class BdSkeleton extends LitElement {\n static styles = [skeletonCSS];\n\n @property({ type: Number })\n lines = 1;\n @property({ type: String, reflect: true })\n shape: Shape = 'line';\n\n render() {\n return html`\n <span aria-hidden=\"true\">\n ${Array.from({ length: this.lines }, (_unused, i) => html`<div\n class=\"bone\"\n style=${i === this.lines - 1 && this.lines > 1 ? 'width: 60%' : nothing}\n ></div>`)}\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bd-skeleton': BdSkeleton;\n }\n}\n"],"mappings":"A,2SAUO,IAAMG,EAAN,cAAyBC,CAAW,C,8BAIjC,KAAA,MAAA,EAEO,KAAA,MAAA,M,QALC,KAAA,OAAA,CAACF,CAAW,C,CAO5B,QAAS,CACP,MAAO,EAAI;;UAEL,MAAM,KAAK,CAAE,OAAQ,KAAK,KAAM,GAAI,EAAS,IAAM,CAAI;;kBAE/CI,IAAM,KAAK,MAAQ,GAAK,KAAK,MAAQ,EAAI,aAAeC,EAAQ;gBAClE,EAAE;;KAGhB,CACF,EAfGP,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAL,EAAA,UAAA,QAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAQ,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAL,EAAA,UAAA,QAAA,IAAA,EAAA,EAN1C,EAAAH,EAAA,CAAAS,EAAc,aAAa,CAAA,EAAAN,CAAA,E"}
|