@deriv-com/dds-marketing 0.1.0 → 1.0.0
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/.llm/components/accordion.md +201 -0
- package/.llm/components/accordionitem.md +244 -0
- package/.llm/components/aspectratio.md +220 -0
- package/.llm/components/badge.md +239 -0
- package/.llm/components/bottomsheet.md +412 -0
- package/.llm/components/breadcrumb.md +205 -0
- package/.llm/components/breadcrumbitem.md +186 -0
- package/.llm/components/button.md +295 -0
- package/.llm/components/buttonicon.md +321 -0
- package/.llm/components/card.md +327 -0
- package/.llm/components/cardbody.md +435 -0
- package/.llm/components/cardbutton.md +273 -0
- package/.llm/components/checkbox.md +293 -0
- package/.llm/components/ctabanner.md +186 -0
- package/.llm/components/ctabannerslider.md +204 -0
- package/.llm/components/divider.md +238 -0
- package/.llm/components/dropdownmenu.md +461 -0
- package/.llm/components/faqaccordion.md +217 -0
- package/.llm/components/featurebullets.md +254 -0
- package/.llm/components/featurecards.md +313 -0
- package/.llm/components/featurescroll.md +284 -0
- package/.llm/components/featuresplit.md +249 -0
- package/.llm/components/filterchip.md +322 -0
- package/.llm/components/footer.md +416 -0
- package/.llm/components/footergroup.md +249 -0
- package/.llm/components/grid.md +667 -0
- package/.llm/components/icon.md +202 -0
- package/.llm/components/landinghero.md +254 -0
- package/.llm/components/link.md +362 -0
- package/.llm/components/logocolumns.md +235 -0
- package/.llm/components/logorows.md +212 -0
- package/.llm/components/menuitem.md +226 -0
- package/.llm/components/navbar.md +522 -0
- package/.llm/components/navbaritem.md +246 -0
- package/.llm/components/navbarmenu.md +327 -0
- package/.llm/components/navbarmenugroup.md +192 -0
- package/.llm/components/navbarpanel.md +263 -0
- package/.llm/components/navbarswitcher.md +351 -0
- package/.llm/components/navbarswitcheroption.md +164 -0
- package/.llm/components/option.md +276 -0
- package/.llm/components/pageheader.md +231 -0
- package/.llm/components/pagination.md +298 -0
- package/.llm/components/paginationdots.md +215 -0
- package/.llm/components/producthero.md +248 -0
- package/.llm/components/removablechip.md +255 -0
- package/.llm/components/row.md +389 -0
- package/.llm/components/scroller.md +478 -0
- package/.llm/components/searchinput.md +287 -0
- package/.llm/components/segmentedcontrol.md +366 -0
- package/.llm/components/segmentedcontrolitem.md +280 -0
- package/.llm/components/select.md +517 -0
- package/.llm/components/selectchip.md +375 -0
- package/.llm/components/spinner.md +230 -0
- package/.llm/components/stack.md +342 -0
- package/.llm/components/statusdot.md +213 -0
- package/.llm/components/subdomainnavbar.md +335 -0
- package/.llm/components/tab.md +299 -0
- package/.llm/components/table.md +668 -0
- package/.llm/components/tablebody.md +266 -0
- package/.llm/components/tablecell.md +256 -0
- package/.llm/components/tablehead.md +256 -0
- package/.llm/components/tableheadercell.md +306 -0
- package/.llm/components/tablerow.md +293 -0
- package/.llm/components/tablist.md +218 -0
- package/.llm/components/testimonialrow.md +235 -0
- package/.llm/components/testimonialslider.md +254 -0
- package/.llm/components/textarea.md +370 -0
- package/.llm/components/textinput.md +475 -0
- package/.llm/components/tooltip.md +275 -0
- package/.llm/components/typography.md +253 -0
- package/.llm/digest/accordion.md +43 -0
- package/.llm/digest/accordionitem.md +47 -0
- package/.llm/digest/aspectratio.md +47 -0
- package/.llm/digest/badge.md +45 -0
- package/.llm/digest/bottomsheet.md +69 -0
- package/.llm/digest/breadcrumb.md +38 -0
- package/.llm/digest/breadcrumbitem.md +43 -0
- package/.llm/digest/button.md +53 -0
- package/.llm/digest/buttonicon.md +61 -0
- package/.llm/digest/card.md +51 -0
- package/.llm/digest/cardbody.md +70 -0
- package/.llm/digest/cardbutton.md +50 -0
- package/.llm/digest/checkbox.md +63 -0
- package/.llm/digest/ctabanner.md +44 -0
- package/.llm/digest/ctabannerslider.md +45 -0
- package/.llm/digest/divider.md +52 -0
- package/.llm/digest/dropdownmenu.md +67 -0
- package/.llm/digest/faqaccordion.md +43 -0
- package/.llm/digest/featurebullets.md +52 -0
- package/.llm/digest/featurecards.md +49 -0
- package/.llm/digest/featurescroll.md +52 -0
- package/.llm/digest/featuresplit.md +54 -0
- package/.llm/digest/filterchip.md +68 -0
- package/.llm/digest/footer.md +57 -0
- package/.llm/digest/footergroup.md +42 -0
- package/.llm/digest/grid.md +62 -0
- package/.llm/digest/icon.md +45 -0
- package/.llm/digest/landinghero.md +53 -0
- package/.llm/digest/link.md +59 -0
- package/.llm/digest/logocolumns.md +55 -0
- package/.llm/digest/logorows.md +48 -0
- package/.llm/digest/menuitem.md +46 -0
- package/.llm/digest/navbar.md +75 -0
- package/.llm/digest/navbaritem.md +54 -0
- package/.llm/digest/navbarmenu.md +54 -0
- package/.llm/digest/navbarmenugroup.md +40 -0
- package/.llm/digest/navbarpanel.md +53 -0
- package/.llm/digest/navbarswitcher.md +51 -0
- package/.llm/digest/navbarswitcheroption.md +37 -0
- package/.llm/digest/option.md +54 -0
- package/.llm/digest/pageheader.md +49 -0
- package/.llm/digest/pagination.md +60 -0
- package/.llm/digest/paginationdots.md +43 -0
- package/.llm/digest/producthero.md +53 -0
- package/.llm/digest/removablechip.md +51 -0
- package/.llm/digest/row.md +60 -0
- package/.llm/digest/scroller.md +59 -0
- package/.llm/digest/searchinput.md +56 -0
- package/.llm/digest/segmentedcontrol.md +59 -0
- package/.llm/digest/segmentedcontrolitem.md +59 -0
- package/.llm/digest/select.md +92 -0
- package/.llm/digest/selectchip.md +73 -0
- package/.llm/digest/spinner.md +52 -0
- package/.llm/digest/stack.md +56 -0
- package/.llm/digest/statusdot.md +46 -0
- package/.llm/digest/subdomainnavbar.md +54 -0
- package/.llm/digest/tab.md +60 -0
- package/.llm/digest/table.md +71 -0
- package/.llm/digest/tablebody.md +49 -0
- package/.llm/digest/tablecell.md +55 -0
- package/.llm/digest/tablehead.md +50 -0
- package/.llm/digest/tableheadercell.md +65 -0
- package/.llm/digest/tablerow.md +56 -0
- package/.llm/digest/tablist.md +46 -0
- package/.llm/digest/testimonialrow.md +51 -0
- package/.llm/digest/testimonialslider.md +51 -0
- package/.llm/digest/textarea.md +78 -0
- package/.llm/digest/textinput.md +95 -0
- package/.llm/digest/tooltip.md +58 -0
- package/.llm/digest/typography.md +59 -0
- package/.llm/index.md +107 -0
- package/.llm/rules.md +146 -0
- package/.llm/tokens.md +385 -0
- package/AGENTS.md +189 -0
- package/LICENSE +21 -0
- package/README.md +78 -10
- package/dist/components/banner-data.d.ts +38 -0
- package/dist/components/banner-data.js +15 -0
- package/dist/components/blocks/block-reveal.css +90 -0
- package/dist/components/blocks/cta-banner/CtaBanner.css +66 -0
- package/dist/components/blocks/cta-banner/CtaBanner.d.ts +22 -0
- package/dist/components/blocks/cta-banner/CtaBanner.js +31 -0
- package/dist/components/blocks/cta-banner/CtaBanner.types.d.ts +29 -0
- package/dist/components/blocks/cta-banner/CtaBanner.types.js +13 -0
- package/dist/components/blocks/cta-banner/cta-banner-impl.css +29 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.css +90 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.d.ts +39 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.js +60 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.d.ts +41 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.js +15 -0
- package/dist/components/blocks/cta-banner-slider/cta-banner-slider-impl.css +73 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.css +54 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.d.ts +20 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.js +28 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.types.d.ts +25 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.types.js +10 -0
- package/dist/components/blocks/faq-accordion/faq-accordion-impl.css +54 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.css +139 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.d.ts +31 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.js +55 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.types.d.ts +39 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.types.js +16 -0
- package/dist/components/blocks/feature-bullets/feature-bullets-impl.css +104 -0
- package/dist/components/blocks/feature-cards/FeatureCards.css +84 -0
- package/dist/components/blocks/feature-cards/FeatureCards.d.ts +24 -0
- package/dist/components/blocks/feature-cards/FeatureCards.js +66 -0
- package/dist/components/blocks/feature-cards/FeatureCards.types.d.ts +33 -0
- package/dist/components/blocks/feature-cards/FeatureCards.types.js +14 -0
- package/dist/components/blocks/feature-cards/feature-cards-impl.css +245 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.css +137 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.d.ts +39 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.js +167 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.types.d.ts +40 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.types.js +17 -0
- package/dist/components/blocks/feature-scroll/feature-scroll-impl.css +292 -0
- package/dist/components/blocks/feature-split/FeatureSplit.css +95 -0
- package/dist/components/blocks/feature-split/FeatureSplit.d.ts +30 -0
- package/dist/components/blocks/feature-split/FeatureSplit.js +38 -0
- package/dist/components/blocks/feature-split/FeatureSplit.types.d.ts +39 -0
- package/dist/components/blocks/feature-split/FeatureSplit.types.js +14 -0
- package/dist/components/blocks/feature-split/feature-split-impl.css +83 -0
- package/dist/components/blocks/landing-hero/LandingHero.css +85 -0
- package/dist/components/blocks/landing-hero/LandingHero.d.ts +41 -0
- package/dist/components/blocks/landing-hero/LandingHero.js +54 -0
- package/dist/components/blocks/landing-hero/LandingHero.types.d.ts +37 -0
- package/dist/components/blocks/landing-hero/LandingHero.types.js +15 -0
- package/dist/components/blocks/landing-hero/landing-hero-impl.css +355 -0
- package/dist/components/blocks/logo-columns/LogoColumns.css +161 -0
- package/dist/components/blocks/logo-columns/LogoColumns.d.ts +23 -0
- package/dist/components/blocks/logo-columns/LogoColumns.js +46 -0
- package/dist/components/blocks/logo-columns/LogoColumns.types.d.ts +46 -0
- package/dist/components/blocks/logo-columns/LogoColumns.types.js +18 -0
- package/dist/components/blocks/logo-columns/logo-columns-impl.css +188 -0
- package/dist/components/blocks/logo-rows/LogoRows.css +122 -0
- package/dist/components/blocks/logo-rows/LogoRows.d.ts +20 -0
- package/dist/components/blocks/logo-rows/LogoRows.js +43 -0
- package/dist/components/blocks/logo-rows/LogoRows.types.d.ts +36 -0
- package/dist/components/blocks/logo-rows/LogoRows.types.js +16 -0
- package/dist/components/blocks/logo-rows/logo-rows-impl.css +179 -0
- package/dist/components/blocks/page-header/PageHeader.css +79 -0
- package/dist/components/blocks/page-header/PageHeader.d.ts +34 -0
- package/dist/components/blocks/page-header/PageHeader.js +43 -0
- package/dist/components/blocks/page-header/PageHeader.types.d.ts +32 -0
- package/dist/components/blocks/page-header/PageHeader.types.js +14 -0
- package/dist/components/blocks/page-header/page-header-impl.css +176 -0
- package/dist/components/blocks/product-hero/ProductHero.css +86 -0
- package/dist/components/blocks/product-hero/ProductHero.d.ts +35 -0
- package/dist/components/blocks/product-hero/ProductHero.js +48 -0
- package/dist/components/blocks/product-hero/ProductHero.types.d.ts +37 -0
- package/dist/components/blocks/product-hero/ProductHero.types.js +15 -0
- package/dist/components/blocks/product-hero/product-hero-impl.css +354 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.css +245 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.d.ts +20 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.js +128 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.d.ts +54 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.js +26 -0
- package/dist/components/blocks/testimonial-row/testimonial-row-impl.css +195 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.css +181 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.d.ts +22 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.js +36 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.d.ts +49 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.js +21 -0
- package/dist/components/blocks/testimonial-slider/testimonial-slider-impl.css +202 -0
- package/dist/components/blocks/use-reveal.d.ts +46 -0
- package/dist/components/blocks/use-reveal.js +120 -0
- package/dist/components/blocks/use-rotation.d.ts +62 -0
- package/dist/components/blocks/use-rotation.js +176 -0
- package/dist/components/core/accordion/Accordion.css +10 -0
- package/dist/components/core/accordion/Accordion.d.ts +20 -0
- package/dist/components/core/accordion/Accordion.js +69 -0
- package/dist/components/core/accordion/Accordion.types.d.ts +20 -0
- package/dist/components/core/accordion/Accordion.types.js +7 -0
- package/dist/components/core/accordion-item/AccordionItem.css +99 -0
- package/dist/components/core/accordion-item/AccordionItem.d.ts +44 -0
- package/dist/components/core/accordion-item/AccordionItem.js +63 -0
- package/dist/components/core/accordion-item/AccordionItem.types.d.ts +32 -0
- package/dist/components/core/accordion-item/AccordionItem.types.js +13 -0
- package/dist/components/core/accordion-item/accordion-item-impl.css +107 -0
- package/dist/components/core/badge/Badge.css +37 -0
- package/dist/components/core/badge/Badge.d.ts +37 -0
- package/dist/components/core/badge/Badge.js +40 -0
- package/dist/components/core/badge/Badge.types.d.ts +24 -0
- package/dist/components/core/badge/Badge.types.js +8 -0
- package/dist/components/core/badge/badge-impl.css +32 -0
- package/dist/components/core/bottom-sheet/BottomSheet.css +178 -0
- package/dist/components/core/bottom-sheet/BottomSheet.d.ts +22 -0
- package/dist/components/core/bottom-sheet/BottomSheet.js +359 -0
- package/dist/components/core/bottom-sheet/BottomSheet.types.d.ts +67 -0
- package/dist/components/core/bottom-sheet/BottomSheet.types.js +18 -0
- package/dist/components/core/bottom-sheet/bottom-sheet-impl.css +57 -0
- package/dist/components/core/breadcrumb/Breadcrumb.css +19 -0
- package/dist/components/core/breadcrumb/Breadcrumb.d.ts +16 -0
- package/dist/components/core/breadcrumb/Breadcrumb.js +22 -0
- package/dist/components/core/breadcrumb/Breadcrumb.types.d.ts +18 -0
- package/dist/components/core/breadcrumb/Breadcrumb.types.js +9 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.css +34 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.d.ts +12 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.js +15 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.types.d.ts +22 -0
- package/dist/components/core/breadcrumb-item/BreadcrumbItem.types.js +9 -0
- package/dist/components/core/button/Button.css +188 -0
- package/dist/components/core/button/Button.d.ts +27 -0
- package/dist/components/core/button/Button.js +57 -0
- package/dist/components/core/button/Button.types.d.ts +35 -0
- package/dist/components/core/button/Button.types.js +9 -0
- package/dist/components/core/button/button-impl.css +71 -0
- package/dist/components/core/button-icon/ButtonIcon.css +151 -0
- package/dist/components/core/button-icon/ButtonIcon.d.ts +34 -0
- package/dist/components/core/button-icon/ButtonIcon.js +117 -0
- package/dist/components/core/button-icon/ButtonIcon.types.d.ts +41 -0
- package/dist/components/core/button-icon/ButtonIcon.types.js +8 -0
- package/dist/components/core/card/Card.css +74 -0
- package/dist/components/core/card/Card.d.ts +24 -0
- package/dist/components/core/card/Card.js +26 -0
- package/dist/components/core/card/Card.types.d.ts +34 -0
- package/dist/components/core/card/Card.types.js +7 -0
- package/dist/components/core/card-body/CardBody.css +144 -0
- package/dist/components/core/card-body/CardBody.d.ts +62 -0
- package/dist/components/core/card-body/CardBody.js +97 -0
- package/dist/components/core/card-body/CardBody.types.d.ts +64 -0
- package/dist/components/core/card-body/CardBody.types.js +16 -0
- package/dist/components/core/card-body/card-body-impl.css +87 -0
- package/dist/components/core/card-button/CardButton.css +82 -0
- package/dist/components/core/card-button/CardButton.d.ts +27 -0
- package/dist/components/core/card-button/CardButton.js +37 -0
- package/dist/components/core/card-button/CardButton.types.d.ts +25 -0
- package/dist/components/core/card-button/CardButton.types.js +7 -0
- package/dist/components/core/card-button/card-button-impl.css +39 -0
- package/dist/components/core/checkbox/Checkbox.css +156 -0
- package/dist/components/core/checkbox/Checkbox.d.ts +21 -0
- package/dist/components/core/checkbox/Checkbox.js +97 -0
- package/dist/components/core/checkbox/Checkbox.types.d.ts +46 -0
- package/dist/components/core/checkbox/Checkbox.types.js +15 -0
- package/dist/components/core/checkbox/checkbox-impl.css +90 -0
- package/dist/components/core/divider/Divider.css +41 -0
- package/dist/components/core/divider/Divider.d.ts +46 -0
- package/dist/components/core/divider/Divider.js +51 -0
- package/dist/components/core/divider/Divider.types.d.ts +25 -0
- package/dist/components/core/divider/Divider.types.js +9 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.css +147 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.d.ts +24 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.js +311 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.types.d.ts +62 -0
- package/dist/components/core/dropdown-menu/DropdownMenu.types.js +12 -0
- package/dist/components/core/dropdown-menu/dropdown-menu-impl.css +70 -0
- package/dist/components/core/filter-chip/FilterChip.css +150 -0
- package/dist/components/core/filter-chip/FilterChip.d.ts +23 -0
- package/dist/components/core/filter-chip/FilterChip.js +37 -0
- package/dist/components/core/filter-chip/FilterChip.types.d.ts +53 -0
- package/dist/components/core/filter-chip/FilterChip.types.js +12 -0
- package/dist/components/core/footer/Footer.css +104 -0
- package/dist/components/core/footer/Footer.d.ts +43 -0
- package/dist/components/core/footer/Footer.js +53 -0
- package/dist/components/core/footer/Footer.types.d.ts +47 -0
- package/dist/components/core/footer/Footer.types.js +18 -0
- package/dist/components/core/footer/footer-impl.css +218 -0
- package/dist/components/core/footer-group/FooterGroup.css +91 -0
- package/dist/components/core/footer-group/FooterGroup.d.ts +32 -0
- package/dist/components/core/footer-group/FooterGroup.js +64 -0
- package/dist/components/core/footer-group/FooterGroup.types.d.ts +25 -0
- package/dist/components/core/footer-group/FooterGroup.types.js +12 -0
- package/dist/components/core/footer-group/footer-group-impl.css +78 -0
- package/dist/components/core/icon/Icon.css +40 -0
- package/dist/components/core/icon/Icon.d.ts +23 -0
- package/dist/components/core/icon/Icon.js +79 -0
- package/dist/components/core/icon/Icon.types.d.ts +24 -0
- package/dist/components/core/icon/Icon.types.js +7 -0
- package/dist/components/core/link/Link.css +89 -0
- package/dist/components/core/link/Link.d.ts +37 -0
- package/dist/components/core/link/Link.js +141 -0
- package/dist/components/core/link/Link.types.d.ts +41 -0
- package/dist/components/core/link/Link.types.js +9 -0
- package/dist/components/core/link/link-impl.css +168 -0
- package/dist/components/core/menu-item/MenuItem.css +70 -0
- package/dist/components/core/menu-item/MenuItem.d.ts +11 -0
- package/dist/components/core/menu-item/MenuItem.js +26 -0
- package/dist/components/core/menu-item/MenuItem.types.d.ts +28 -0
- package/dist/components/core/menu-item/MenuItem.types.js +9 -0
- package/dist/components/core/navbar/Navbar.css +134 -0
- package/dist/components/core/navbar/Navbar.d.ts +52 -0
- package/dist/components/core/navbar/Navbar.js +498 -0
- package/dist/components/core/navbar/Navbar.types.d.ts +68 -0
- package/dist/components/core/navbar/Navbar.types.js +17 -0
- package/dist/components/core/navbar/navbar-impl.css +597 -0
- package/dist/components/core/navbar/navbar-material.css +96 -0
- package/dist/components/core/navbar-item/NavbarItem.css +75 -0
- package/dist/components/core/navbar-item/NavbarItem.d.ts +22 -0
- package/dist/components/core/navbar-item/NavbarItem.js +40 -0
- package/dist/components/core/navbar-item/NavbarItem.types.d.ts +34 -0
- package/dist/components/core/navbar-item/NavbarItem.types.js +10 -0
- package/dist/components/core/navbar-menu/NavbarMenu.css +130 -0
- package/dist/components/core/navbar-menu/NavbarMenu.d.ts +6 -0
- package/dist/components/core/navbar-menu/NavbarMenu.js +187 -0
- package/dist/components/core/navbar-menu/NavbarMenu.types.d.ts +45 -0
- package/dist/components/core/navbar-menu/NavbarMenu.types.js +12 -0
- package/dist/components/core/navbar-menu/navbar-menu-impl.css +186 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.css +26 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.d.ts +17 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.js +22 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.types.d.ts +14 -0
- package/dist/components/core/navbar-menu-group/NavbarMenuGroup.types.js +7 -0
- package/dist/components/core/navbar-panel/NavbarPanel.css +87 -0
- package/dist/components/core/navbar-panel/NavbarPanel.d.ts +34 -0
- package/dist/components/core/navbar-panel/NavbarPanel.js +46 -0
- package/dist/components/core/navbar-panel/NavbarPanel.types.d.ts +29 -0
- package/dist/components/core/navbar-panel/NavbarPanel.types.js +12 -0
- package/dist/components/core/navbar-panel/navbar-panel-impl.css +104 -0
- package/dist/components/core/navbar-panel/use-navbar-panel.d.ts +26 -0
- package/dist/components/core/navbar-panel/use-navbar-panel.js +135 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.css +118 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.d.ts +21 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.js +91 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.types.d.ts +46 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.types.js +13 -0
- package/dist/components/core/navbar-switcher/navbar-switcher-impl.css +179 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.css +39 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.d.ts +16 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.js +19 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.types.d.ts +18 -0
- package/dist/components/core/navbar-switcher-option/NavbarSwitcherOption.types.js +7 -0
- package/dist/components/core/option/Option.css +133 -0
- package/dist/components/core/option/Option.d.ts +25 -0
- package/dist/components/core/option/Option.js +31 -0
- package/dist/components/core/option/Option.types.d.ts +44 -0
- package/dist/components/core/option/Option.types.js +14 -0
- package/dist/components/core/pagination/Pagination.css +163 -0
- package/dist/components/core/pagination/Pagination.d.ts +30 -0
- package/dist/components/core/pagination/Pagination.js +366 -0
- package/dist/components/core/pagination/Pagination.types.d.ts +47 -0
- package/dist/components/core/pagination/Pagination.types.js +12 -0
- package/dist/components/core/pagination/pagination-impl.css +17 -0
- package/dist/components/core/pagination-dots/PaginationDots.css +60 -0
- package/dist/components/core/pagination-dots/PaginationDots.d.ts +25 -0
- package/dist/components/core/pagination-dots/PaginationDots.js +104 -0
- package/dist/components/core/pagination-dots/PaginationDots.types.d.ts +38 -0
- package/dist/components/core/pagination-dots/PaginationDots.types.js +9 -0
- package/dist/components/core/removable-chip/RemovableChip.css +125 -0
- package/dist/components/core/removable-chip/RemovableChip.d.ts +25 -0
- package/dist/components/core/removable-chip/RemovableChip.js +36 -0
- package/dist/components/core/removable-chip/RemovableChip.types.d.ts +38 -0
- package/dist/components/core/removable-chip/RemovableChip.types.js +13 -0
- package/dist/components/core/search-input/SearchInput.css +205 -0
- package/dist/components/core/search-input/SearchInput.d.ts +5 -0
- package/dist/components/core/search-input/SearchInput.js +81 -0
- package/dist/components/core/search-input/SearchInput.types.d.ts +43 -0
- package/dist/components/core/search-input/SearchInput.types.js +13 -0
- package/dist/components/core/search-input/search-input-impl.css +20 -0
- package/dist/components/core/segmented-control/SegmentedControl.css +57 -0
- package/dist/components/core/segmented-control/SegmentedControl.d.ts +37 -0
- package/dist/components/core/segmented-control/SegmentedControl.js +269 -0
- package/dist/components/core/segmented-control/SegmentedControl.types.d.ts +38 -0
- package/dist/components/core/segmented-control/SegmentedControl.types.js +8 -0
- package/dist/components/core/segmented-control/segmented-control-impl.css +57 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.css +151 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.d.ts +50 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.js +101 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.types.d.ts +37 -0
- package/dist/components/core/segmented-control-item/SegmentedControlItem.types.js +10 -0
- package/dist/components/core/segmented-control-item/segmented-control-item-impl.css +69 -0
- package/dist/components/core/select/Select.css +401 -0
- package/dist/components/core/select/Select.d.ts +29 -0
- package/dist/components/core/select/Select.js +524 -0
- package/dist/components/core/select/Select.types.d.ts +96 -0
- package/dist/components/core/select/Select.types.js +26 -0
- package/dist/components/core/select/select-impl.css +114 -0
- package/dist/components/core/select-chip/SelectChip.css +162 -0
- package/dist/components/core/select-chip/SelectChip.d.ts +20 -0
- package/dist/components/core/select-chip/SelectChip.js +276 -0
- package/dist/components/core/select-chip/SelectChip.types.d.ts +62 -0
- package/dist/components/core/select-chip/SelectChip.types.js +14 -0
- package/dist/components/core/select-chip/select-chip-impl.css +49 -0
- package/dist/components/core/spinner/Spinner.css +76 -0
- package/dist/components/core/spinner/Spinner.d.ts +5 -0
- package/dist/components/core/spinner/Spinner.js +29 -0
- package/dist/components/core/spinner/Spinner.types.d.ts +37 -0
- package/dist/components/core/spinner/Spinner.types.js +10 -0
- package/dist/components/core/spinner/spinner-impl.css +27 -0
- package/dist/components/core/status-dot/StatusDot.css +43 -0
- package/dist/components/core/status-dot/StatusDot.d.ts +35 -0
- package/dist/components/core/status-dot/StatusDot.js +46 -0
- package/dist/components/core/status-dot/StatusDot.types.d.ts +29 -0
- package/dist/components/core/status-dot/StatusDot.types.js +7 -0
- package/dist/components/core/status-dot/status-dot-impl.css +42 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.css +89 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.d.ts +21 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.js +127 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.types.d.ts +43 -0
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.types.js +13 -0
- package/dist/components/core/subdomain-navbar/subdomain-navbar-impl.css +147 -0
- package/dist/components/core/tab/Tab.css +113 -0
- package/dist/components/core/tab/Tab.d.ts +36 -0
- package/dist/components/core/tab/Tab.js +53 -0
- package/dist/components/core/tab/Tab.types.d.ts +42 -0
- package/dist/components/core/tab/Tab.types.js +13 -0
- package/dist/components/core/tab/tab-impl.css +49 -0
- package/dist/components/core/tab-list/TabList.css +40 -0
- package/dist/components/core/tab-list/TabList.d.ts +26 -0
- package/dist/components/core/tab-list/TabList.js +124 -0
- package/dist/components/core/tab-list/TabList.types.d.ts +20 -0
- package/dist/components/core/tab-list/TabList.types.js +7 -0
- package/dist/components/core/tab-list/tab-list-impl.css +56 -0
- package/dist/components/core/table/Table.css +40 -0
- package/dist/components/core/table/Table.d.ts +19 -0
- package/dist/components/core/table/Table.js +55 -0
- package/dist/components/core/table/Table.types.d.ts +59 -0
- package/dist/components/core/table/Table.types.js +9 -0
- package/dist/components/core/table/table-impl.css +97 -0
- package/dist/components/core/table/use-table-sort.d.ts +43 -0
- package/dist/components/core/table/use-table-sort.js +51 -0
- package/dist/components/core/table-body/TableBody.css +6 -0
- package/dist/components/core/table-body/TableBody.d.ts +12 -0
- package/dist/components/core/table-body/TableBody.js +26 -0
- package/dist/components/core/table-body/TableBody.types.d.ts +36 -0
- package/dist/components/core/table-body/TableBody.types.js +7 -0
- package/dist/components/core/table-cell/TableCell.css +76 -0
- package/dist/components/core/table-cell/TableCell.d.ts +21 -0
- package/dist/components/core/table-cell/TableCell.js +31 -0
- package/dist/components/core/table-cell/TableCell.types.d.ts +43 -0
- package/dist/components/core/table-cell/TableCell.types.js +7 -0
- package/dist/components/core/table-head/TableHead.css +6 -0
- package/dist/components/core/table-head/TableHead.d.ts +22 -0
- package/dist/components/core/table-head/TableHead.js +52 -0
- package/dist/components/core/table-head/TableHead.types.d.ts +39 -0
- package/dist/components/core/table-head/TableHead.types.js +7 -0
- package/dist/components/core/table-head/table-head-impl.css +51 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.css +126 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.d.ts +21 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.js +34 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.types.d.ts +56 -0
- package/dist/components/core/table-header-cell/TableHeaderCell.types.js +9 -0
- package/dist/components/core/table-header-cell/table-header-cell-impl.css +74 -0
- package/dist/components/core/table-row/TableRow.css +18 -0
- package/dist/components/core/table-row/TableRow.d.ts +17 -0
- package/dist/components/core/table-row/TableRow.js +32 -0
- package/dist/components/core/table-row/TableRow.types.d.ts +45 -0
- package/dist/components/core/table-row/TableRow.types.js +7 -0
- package/dist/components/core/table-row/table-row-impl.css +31 -0
- package/dist/components/core/text-area/TextArea.css +325 -0
- package/dist/components/core/text-area/TextArea.d.ts +13 -0
- package/dist/components/core/text-area/TextArea.js +133 -0
- package/dist/components/core/text-area/TextArea.types.d.ts +67 -0
- package/dist/components/core/text-area/TextArea.types.js +19 -0
- package/dist/components/core/text-area/text-area-impl.css +36 -0
- package/dist/components/core/text-input/TextInput.css +400 -0
- package/dist/components/core/text-input/TextInput.d.ts +5 -0
- package/dist/components/core/text-input/TextInput.js +130 -0
- package/dist/components/core/text-input/TextInput.types.d.ts +96 -0
- package/dist/components/core/text-input/TextInput.types.js +24 -0
- package/dist/components/core/text-input/text-input-impl.css +36 -0
- package/dist/components/core/tooltip/Tooltip.css +101 -0
- package/dist/components/core/tooltip/Tooltip.d.ts +51 -0
- package/dist/components/core/tooltip/Tooltip.js +87 -0
- package/dist/components/core/tooltip/Tooltip.types.d.ts +38 -0
- package/dist/components/core/tooltip/Tooltip.types.js +9 -0
- package/dist/components/core/tooltip/TooltipAnchor.d.ts +52 -0
- package/dist/components/core/tooltip/TooltipAnchor.js +69 -0
- package/dist/components/core/tooltip/tooltip-anchor.css +145 -0
- package/dist/components/core/tooltip/tooltip-impl.css +54 -0
- package/dist/components/core/tooltip/use-tooltip.d.ts +111 -0
- package/dist/components/core/tooltip/use-tooltip.js +189 -0
- package/dist/components/core/typography/Typography.css +96 -0
- package/dist/components/core/typography/Typography.d.ts +297 -0
- package/dist/components/core/typography/Typography.js +28 -0
- package/dist/components/core/typography/Typography.types.d.ts +40 -0
- package/dist/components/core/typography/Typography.types.js +7 -0
- package/dist/components/css-time.d.ts +20 -0
- package/dist/components/css-time.js +30 -0
- package/dist/components/given.d.ts +7 -0
- package/dist/components/given.js +9 -0
- package/dist/components/hover-open.d.ts +34 -0
- package/dist/components/hover-open.js +90 -0
- package/dist/components/index.d.ts +149 -1
- package/dist/components/index.js +145 -2
- package/dist/components/layout/aspect-ratio/AspectRatio.css +29 -0
- package/dist/components/layout/aspect-ratio/AspectRatio.d.ts +24 -0
- package/dist/components/layout/aspect-ratio/AspectRatio.js +26 -0
- package/dist/components/layout/aspect-ratio/AspectRatio.types.d.ts +22 -0
- package/dist/components/layout/aspect-ratio/AspectRatio.types.js +7 -0
- package/dist/components/layout/aspect-ratio/aspect-ratio-impl.css +44 -0
- package/dist/components/layout/grid/Grid.css +76 -0
- package/dist/components/layout/grid/Grid.d.ts +31 -0
- package/dist/components/layout/grid/Grid.js +33 -0
- package/dist/components/layout/grid/Grid.types.d.ts +48 -0
- package/dist/components/layout/grid/Grid.types.js +7 -0
- package/dist/components/layout/grid/grid-impl.css +62 -0
- package/dist/components/layout/row/Row.css +85 -0
- package/dist/components/layout/row/Row.d.ts +32 -0
- package/dist/components/layout/row/Row.js +34 -0
- package/dist/components/layout/row/Row.types.d.ts +45 -0
- package/dist/components/layout/row/Row.types.js +7 -0
- package/dist/components/layout/scroller/Scroller.css +59 -0
- package/dist/components/layout/scroller/Scroller.d.ts +34 -0
- package/dist/components/layout/scroller/Scroller.js +36 -0
- package/dist/components/layout/scroller/Scroller.types.d.ts +38 -0
- package/dist/components/layout/scroller/Scroller.types.js +7 -0
- package/dist/components/layout/scroller/scroller-impl.css +45 -0
- package/dist/components/layout/stack/Stack.css +73 -0
- package/dist/components/layout/stack/Stack.d.ts +28 -0
- package/dist/components/layout/stack/Stack.js +30 -0
- package/dist/components/layout/stack/Stack.types.d.ts +41 -0
- package/dist/components/layout/stack/Stack.types.js +7 -0
- package/dist/components/logo-data.d.ts +24 -0
- package/dist/components/logo-data.js +11 -0
- package/dist/components/scroll-data.d.ts +64 -0
- package/dist/components/scroll-data.js +17 -0
- package/dist/components/testimonial-row-data.d.ts +51 -0
- package/dist/components/testimonial-row-data.js +11 -0
- package/dist/components/testimonial-slider-data.d.ts +26 -0
- package/dist/components/testimonial-slider-data.js +10 -0
- package/dist/components/visually-hidden.d.ts +22 -0
- package/dist/components/visually-hidden.js +31 -0
- package/dist/fonts/LICENSE-inter.txt +93 -0
- package/dist/fonts/LICENSE-red-hat-mono.txt +93 -0
- package/dist/fonts/fonts.css +111 -0
- package/dist/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/fonts/red-hat-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/red-hat-mono-latin-wght-normal.woff2 +0 -0
- package/dist/marketing.css +581 -162
- package/package.json +13 -4
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cloneElement, isValidElement } from 'react';
|
|
3
|
+
import './ButtonIcon.css';
|
|
4
|
+
import { buttonIconDefaults, buttonIconParts } from './ButtonIcon.types.js';
|
|
5
|
+
/**
|
|
6
|
+
* One press carried by a glyph alone.
|
|
7
|
+
*
|
|
8
|
+
* Which element it renders is decided by `href` and nothing else, which is CardButton's
|
|
9
|
+
* shape rather than Button's. Button has since taken the same shape; when this was written its job was
|
|
10
|
+
* defined as moving a visitor along a funnel, so it was an anchor always. A glyph-alone control has no such
|
|
11
|
+
* single job — a footer's social row goes somewhere and a promotional bar's dismiss does
|
|
12
|
+
* not, and both are one press with one mark. An `<a>` gives cmd-click, a destination in
|
|
13
|
+
* the status bar and a copyable link; a `<button>` answers Space and does what the page
|
|
14
|
+
* says. Two components for that would be two names for one gesture.
|
|
15
|
+
*
|
|
16
|
+
* The classes come from `buttonIconParts` rather than being typed here — the stylesheet is
|
|
17
|
+
* generated from the same anatomy, and a class retyped slightly differently renders a part
|
|
18
|
+
* bare with its rule sitting unused.
|
|
19
|
+
*
|
|
20
|
+
* It is typed against `AnchorHTMLAttributes`, which is the branch it takes in the ordinary
|
|
21
|
+
* case, and it is what puts `target` and `rel` in reach — a marketing destination leaves the
|
|
22
|
+
* site often enough that the pairing is the consumer's decision rather than an axis of this
|
|
23
|
+
* component, which is the ruling Button already recorded. The generator takes one interface,
|
|
24
|
+
* so this is a choice rather than a union: what it gives up is the form-participation
|
|
25
|
+
* attributes a `<button>` carries — `form`, `name`, `value` — which an icon-only control in a
|
|
26
|
+
* form wants far less often than an external link wants `rel="noopener"`. `type` survives as
|
|
27
|
+
* a string, so an intentional submit still compiles.
|
|
28
|
+
*
|
|
29
|
+
* There is no `loading` and no `disabled`, which is where this stops following product's
|
|
30
|
+
* ButtonIcon. Neither has an honest anchor form: the browser owns a link's pending state
|
|
31
|
+
* and shows it in the chrome, and `aria-disabled` on a link still follows the link when it
|
|
32
|
+
* is pressed. A prop that meant one thing on one branch and nothing on the other would be
|
|
33
|
+
* worse than its absence.
|
|
34
|
+
*/
|
|
35
|
+
export function ButtonIcon({ icon, label, variant = buttonIconDefaults.variant, size = buttonIconDefaults.size, tone = buttonIconDefaults.tone, href, ...rest }) {
|
|
36
|
+
/*
|
|
37
|
+
What both branches carry. Spread after `rest` so none of it can be written over from
|
|
38
|
+
the call site: the classes are how the generated stylesheet finds its parts, and the
|
|
39
|
+
accessible name is the only name this control has.
|
|
40
|
+
*/
|
|
41
|
+
const shared = {
|
|
42
|
+
className: buttonIconParts.root,
|
|
43
|
+
// Read from data attributes rather than folded into the class, the way Button and Card do.
|
|
44
|
+
'data-variant': variant,
|
|
45
|
+
'data-tone': tone,
|
|
46
|
+
'data-size': size,
|
|
47
|
+
/*
|
|
48
|
+
The entire accessible name. Button gets one from its children; this draws no text, so
|
|
49
|
+
without this attribute there is nothing to announce and the control is a shape with a
|
|
50
|
+
press on it.
|
|
51
|
+
*/
|
|
52
|
+
'aria-label': label,
|
|
53
|
+
};
|
|
54
|
+
/*
|
|
55
|
+
aria-hidden because the mark names nothing: `label` has already named the control, and a
|
|
56
|
+
footer row of these would otherwise announce the picture on every one.
|
|
57
|
+
*/
|
|
58
|
+
const applied = { 'aria-hidden': 'true' };
|
|
59
|
+
/*
|
|
60
|
+
The glyph, cloned rather than wrapped.
|
|
61
|
+
|
|
62
|
+
The class has to reach the `<svg>` itself. Every glyph in the icon package ships `width`
|
|
63
|
+
and `height` presentation attributes defaulting to 24, so a box around it keeps its own
|
|
64
|
+
measure and the mark keeps the package's — and the only thing that overrides an attribute
|
|
65
|
+
is a CSS length on the element carrying it. Product's Icon clones for exactly this reason
|
|
66
|
+
and says so; Marketing Button puts its arrow's class in the same place, the difference
|
|
67
|
+
being only that Button chose its own glyph and so had the element in hand.
|
|
68
|
+
|
|
69
|
+
A wrapper was the first shape here and it was wrong twice: the mark stood at whatever size
|
|
70
|
+
it was imported at, and the hand-written rule dragging it back to the box's measure was a
|
|
71
|
+
second place the size was decided — in a file beside the generated one, where the next
|
|
72
|
+
person to change `icon.control.*` would not think to look.
|
|
73
|
+
|
|
74
|
+
Not a clone that injects a size, which is the thing product's ButtonIcon pulled out: that
|
|
75
|
+
reached only glyphs which happen to read a `size` prop and did nothing for a bare one. A
|
|
76
|
+
className reaches every element in the package, and any the caller set is kept.
|
|
77
|
+
|
|
78
|
+
Nor Marketing's own Icon, which Badge and Tab wrap their glyphs in. Icon draws from
|
|
79
|
+
`icon.size`, and that ramp steps 16 then 20 while the control ramp is 18 then 20 — so
|
|
80
|
+
there is no step an md control could ask it for, and rounding to either neighbour would
|
|
81
|
+
put this mark a measure away from the same glyph beside a label in the same band. The
|
|
82
|
+
contract's `icon` part records the same reasoning.
|
|
83
|
+
*/
|
|
84
|
+
const mark = isValidElement(icon) ? (cloneElement(icon, {
|
|
85
|
+
className: [buttonIconParts.icon, icon.props.className].filter(Boolean).join(' '),
|
|
86
|
+
...applied,
|
|
87
|
+
})) : (
|
|
88
|
+
/*
|
|
89
|
+
Anything that is not a single element cannot be cloned, and the preview hands every node
|
|
90
|
+
slot a sample string. Product's Icon keeps a box for that case rather than throwing —
|
|
91
|
+
`Children.only` took the whole preview down there — so the class lands on something and
|
|
92
|
+
the part is still findable.
|
|
93
|
+
*/
|
|
94
|
+
_jsx("span", { className: buttonIconParts.icon, ...applied, children: icon }));
|
|
95
|
+
if (href !== undefined) {
|
|
96
|
+
// No cast: `rest` is already the anchor's own attribute set, so `target` and `rel`
|
|
97
|
+
// arrive typed and land on the element that understands them.
|
|
98
|
+
return (_jsx("a", { ...rest, ...shared, href: href, children: mark }));
|
|
99
|
+
}
|
|
100
|
+
return (
|
|
101
|
+
/*
|
|
102
|
+
A button, not a submit. The element's own default is `submit`, so one of these dropped
|
|
103
|
+
into a newsletter form would send it — and a dismiss that submitted a form is the kind
|
|
104
|
+
of fault nobody looks for in an icon.
|
|
105
|
+
|
|
106
|
+
Above the spread rather than below it, which is where this differs from CardButton: an
|
|
107
|
+
icon-only submit beside an email field is a real thing to want, so a consumer who says
|
|
108
|
+
so still wins. A card is never a form's submit, which is why it can afford to force it.
|
|
109
|
+
|
|
110
|
+
The cast is on this branch rather than the other, which is the mirror of CardButton and
|
|
111
|
+
follows from the props being the anchor's: an `<a>`'s `type` is the destination's MIME
|
|
112
|
+
type and so is a plain string, which a `<button>`'s own `type` will not accept. Runtime
|
|
113
|
+
is unaffected — a consumer writing "submit" still gets a submit — but the two elements
|
|
114
|
+
disagree about what the word means, and TypeScript is right to say so.
|
|
115
|
+
*/
|
|
116
|
+
_jsx("button", { type: "button", ...rest, ...shared, children: mark }));
|
|
117
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ButtonIconOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `primary` — The one glyph-alone press a section is built around — a play control over a hero, the single action a band exists for. Carries the brand fill, which is what makes it findable at a glance and what makes it meaningless once there are two.
|
|
5
|
+
* `secondary` — The ordinary case for these, because they usually arrive several at a time — a footer's social row, a carousel's two directions, a bar's dismiss. Button's secondary, drawn as a circle: the lightest tint the ramp offers, color.bg.subtle, with hover and press layered over the fill as a background-image rather than replacing it, so a glyph-alone control and a labelled one beside it read as one family. On the dark band, tone="inverse" keeps the fill and turns it white.
|
|
6
|
+
* `inverse` — A section that paints its own ground — a brand-coloured band, a photo, a dark takeover. There the brand fill is invisible against the fill behind it and a neutral tint is lost over a photograph, so the only thing that reads is a solid at the far end of the neutral ramp: pure black in light, pure white in dark. It outranks everything near it, which is what makes it right there and wrong anywhere else.
|
|
7
|
+
* `plain` — The control sits on a surface that has already said what it is — the exit on a sheet, a step in a set of marks — and a tint behind it would be the loudest thing there. It keeps the target and the states and gives up only the fill, so what a reader presses is unchanged and what they see is the glyph.
|
|
8
|
+
*/
|
|
9
|
+
variant?: 'primary' | 'secondary' | 'inverse' | 'plain';
|
|
10
|
+
/**
|
|
11
|
+
* `sm` — A dense row of controls — a filter bar, a utility strip, a compact carousel. A square of size.control.sm holding a mark at icon.control.sm. Desktop only: at thirty-two it is below what a finger reliably hits.
|
|
12
|
+
* `md` — The default, and nearly everywhere — footers, navigation bars, promotional bars, carousels. A square of size.control.md holding a mark at icon.control.md, which is the measure Button's label-side glyph takes at the same step.
|
|
13
|
+
* `lg` — One prominent press, usually the only control in view — a play control over a hero, a single action in a conversion band. A square of size.control.lg holding a mark at icon.control.lg. One per page, in the same spirit as Button's own lg.
|
|
14
|
+
*/
|
|
15
|
+
size?: 'sm' | 'md' | 'lg';
|
|
16
|
+
/**
|
|
17
|
+
* `default` — The control is on a light ground, which is every surface this package paints by default
|
|
18
|
+
* `inverse` — The control stands on the dark band, color.bg.brand-strong — a mark in a navigation bar on a hero, a social mark in a footer — which is the same near-black in light and dark. The ink and the tints move to the band's fixed roles; nothing else does
|
|
19
|
+
*/
|
|
20
|
+
tone?: 'default' | 'inverse';
|
|
21
|
+
/** Always — the glyph is the whole control, so it is required rather than a slot that may be empty. Pass the glyph itself, from the icon package, rather than one already sized: the size a mark takes in this circle is this component's decision, at icon.control.md on md and icon.control.lg on lg, and the width and height the glyph shipped with are overridden by the class this component clones onto it. */
|
|
22
|
+
icon: ReactNode;
|
|
23
|
+
/** Always. It is the entire accessible name, because nothing on screen carries one — the words that would have been the label if there had been room for one. Required rather than optional: an optional name on a control that draws none is a control that ships unnamed. On the anchor branch it names the destination; on the button branch it names what happens. */
|
|
24
|
+
label: string;
|
|
25
|
+
/** The press goes somewhere with a URL of its own — a social account, an app store, another page. It makes this an anchor rather than a button, which is what gives a visitor cmd-click, a visible destination and a copyable link, none of which mean anything for a press the page handles itself. This is the ordinary case on a marketing page.
|
|
26
|
+
|
|
27
|
+
`target` and `rel` are not props of this component and do not need to be: it is typed against AnchorHTMLAttributes, so `target="_blank"` and `rel="noopener noreferrer"` are already in reach and land on the anchor. A destination leaving the site is common enough here that the pairing is the page's decision rather than an axis of this component, which is the ruling Button recorded first. */
|
|
28
|
+
href?: string;
|
|
29
|
+
}
|
|
30
|
+
export type ButtonIconProps = ButtonIconOwnProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'className' | 'variant' | 'size' | 'tone' | 'icon' | 'label' | 'href'>;
|
|
31
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
32
|
+
export declare const buttonIconParts: {
|
|
33
|
+
readonly root: "dds-buttonicon";
|
|
34
|
+
readonly icon: "dds-buttonicon__icon";
|
|
35
|
+
};
|
|
36
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
37
|
+
export declare const buttonIconDefaults: {
|
|
38
|
+
readonly variant: "primary";
|
|
39
|
+
readonly size: "md";
|
|
40
|
+
readonly tone: "default";
|
|
41
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// GENERATED from button-icon.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const buttonIconParts = {
|
|
4
|
+
root: 'dds-buttonicon',
|
|
5
|
+
icon: 'dds-buttonicon__icon',
|
|
6
|
+
};
|
|
7
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
8
|
+
export const buttonIconDefaults = { variant: 'primary', size: 'md', tone: 'default' };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* GENERATED from card.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-card {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
border-radius: var(--radius-surface);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="accent-strong"] {
|
|
12
|
+
background-color: var(--color-bg-surface-card-strong);
|
|
13
|
+
color: var(--color-fg-on-brand-strong);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="accent"] {
|
|
17
|
+
background-color: var(--color-bg-brand);
|
|
18
|
+
color: var(--color-fg-on-brand);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="plain"] {
|
|
22
|
+
border-radius: var(--radius-none);
|
|
23
|
+
color: var(--color-fg-default);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="surface-light"] {
|
|
27
|
+
background-color: var(--color-bg-surface-card-light);
|
|
28
|
+
color: var(--color-fg-on-surface-card-light);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="surface-raised"] {
|
|
32
|
+
background-color: var(--color-bg-surface-card-raised);
|
|
33
|
+
color: var(--color-fg-default);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="surface"] {
|
|
37
|
+
background-color: var(--color-bg-surface);
|
|
38
|
+
color: var(--color-fg-default);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="accent-strong"][data-compact="true"] {
|
|
42
|
+
border-radius: var(--radius-surface-compact);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="accent"][data-compact="true"] {
|
|
46
|
+
border-radius: var(--radius-surface-compact);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="plain"][data-tone="inverse"] {
|
|
50
|
+
color: var(--color-fg-on-brand-strong);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="surface-light"][data-compact="true"] {
|
|
54
|
+
border-radius: var(--radius-surface-compact);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="surface-raised"][data-compact="true"] {
|
|
58
|
+
border-radius: var(--radius-surface-compact);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="surface-raised"][data-tone="inverse"] {
|
|
62
|
+
background-color: var(--color-bg-surface-raised-on-brand-strong);
|
|
63
|
+
color: var(--color-fg-on-brand-strong);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="surface"][data-compact="true"] {
|
|
67
|
+
border-radius: var(--radius-surface-compact);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:where([data-dds-context="marketing"]) .dds-card[data-variant="surface"][data-tone="inverse"] {
|
|
71
|
+
background-color: var(--color-bg-surface-inverse);
|
|
72
|
+
color: var(--color-fg-on-brand-strong);
|
|
73
|
+
}
|
|
74
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import './Card.css';
|
|
2
|
+
import { type CardProps } from './Card.types.js';
|
|
3
|
+
export type { CardProps };
|
|
4
|
+
/**
|
|
5
|
+
* A `<div>` with a fill, a corner, and nothing else.
|
|
6
|
+
*
|
|
7
|
+
* There is no padding here on purpose: the shape a marketing card most often
|
|
8
|
+
* takes is a picture reaching the edges with copy inset beneath it, and one
|
|
9
|
+
* measure cannot serve both. `CardBody` holds the inset, one level in, so a
|
|
10
|
+
* card can hold either or both without either fighting the other.
|
|
11
|
+
*
|
|
12
|
+
* The variant is a ground, not an emphasis. Which one is right follows from
|
|
13
|
+
* what the card is sitting on rather than from how important it is — `surface`
|
|
14
|
+
* is recessed against the white page, `surface-raised` lifts off a subtle band,
|
|
15
|
+
* and the two brand fills are the page having earned a colour. The stylesheet
|
|
16
|
+
* reads it from `data-variant`, so it is set here rather than folded into the
|
|
17
|
+
* class.
|
|
18
|
+
*
|
|
19
|
+
* `tone` says which way round the ground is rather than how dark it is. A card on a band that
|
|
20
|
+
* paints its own dark ground takes `inverse`, and its neutral fill becomes a veil of white over
|
|
21
|
+
* that band instead of a sheet of paper on top of it — an opaque white rectangle on a dark footer
|
|
22
|
+
* reads as a hole punched in it. The brand fills ignore it: they carry their own ground either way.
|
|
23
|
+
*/
|
|
24
|
+
export declare function Card({ variant, tone, compact, children, ...rest }: CardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import './Card.css';
|
|
3
|
+
import { cardDefaults, cardParts } from './Card.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* A `<div>` with a fill, a corner, and nothing else.
|
|
6
|
+
*
|
|
7
|
+
* There is no padding here on purpose: the shape a marketing card most often
|
|
8
|
+
* takes is a picture reaching the edges with copy inset beneath it, and one
|
|
9
|
+
* measure cannot serve both. `CardBody` holds the inset, one level in, so a
|
|
10
|
+
* card can hold either or both without either fighting the other.
|
|
11
|
+
*
|
|
12
|
+
* The variant is a ground, not an emphasis. Which one is right follows from
|
|
13
|
+
* what the card is sitting on rather than from how important it is — `surface`
|
|
14
|
+
* is recessed against the white page, `surface-raised` lifts off a subtle band,
|
|
15
|
+
* and the two brand fills are the page having earned a colour. The stylesheet
|
|
16
|
+
* reads it from `data-variant`, so it is set here rather than folded into the
|
|
17
|
+
* class.
|
|
18
|
+
*
|
|
19
|
+
* `tone` says which way round the ground is rather than how dark it is. A card on a band that
|
|
20
|
+
* paints its own dark ground takes `inverse`, and its neutral fill becomes a veil of white over
|
|
21
|
+
* that band instead of a sheet of paper on top of it — an opaque white rectangle on a dark footer
|
|
22
|
+
* reads as a hole punched in it. The brand fills ignore it: they carry their own ground either way.
|
|
23
|
+
*/
|
|
24
|
+
export function Card({ variant = cardDefaults.variant, tone = cardDefaults.tone, compact = cardDefaults.compact, children, ...rest }) {
|
|
25
|
+
return (_jsx("div", { className: cardParts.root, "data-variant": variant, "data-tone": tone, "data-compact": compact ? 'true' : 'false', ...rest, children: children }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface CardOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `surface` — The default, and right for a card on the page. The marketing page is white and this is a step off it, so the card is told apart by being recessed — no shadow and no border, because the fill is already the edge
|
|
5
|
+
* `surface-light` — A light card among dark ones that has to stay light in both themes — a row mixing a dark, a coral and a grey card, where the grey one flipping to dark in dark mode would make two dark cards and break the set. gray.50 with gray.950 text, fixed. For an ordinary card that follows the theme, surface.
|
|
6
|
+
* `surface-raised` — The card sits on a color.bg.subtle band rather than on the page. There the recessed fill is only 1.09:1 against its ground and all but disappears; this one is 1.23:1 the other way, lifting off the band instead of sinking into it
|
|
7
|
+
* `plain` — An editorial card — an article, a post, a story — where the picture and the headline are what separate one card from the next. It paints no background, so it shows whatever is under it: the page, a subtle band, or a section that has taken a colour. The corner and the clip are still the card's, so a picture at the top of it meets a rounded edge rather than squaring one off It takes no corner either: radius.surface is the shape of a fill, and with no fill there is nothing to round — a rounded picture sitting on the page reads as a floating tile rather than as the art leading an article.
|
|
8
|
+
* `accent` — One card in a set is the promotional one and the page has already earned the colour. The coral is the loudest ground here, so a row of them is a row of nothing louder than the rest
|
|
9
|
+
* `accent-strong` — A card carrying more weight than its neighbours, where the coral would be too loud and the page ground too quiet. The darkest of the four, and the one that takes white at 20.55:1 — the most legible ground a marketing card has
|
|
10
|
+
*/
|
|
11
|
+
variant?: 'surface' | 'surface-light' | 'surface-raised' | 'plain' | 'accent' | 'accent-strong';
|
|
12
|
+
/**
|
|
13
|
+
* `default` — The page is light, which is nearly every page. The fills are opaque and the ink is dark
|
|
14
|
+
* `inverse` — The card sits on a band that paints its own dark ground. The neutral fills become a veil of white over that ground rather than a sheet of paper on top of it, which is what keeps a card on a dark band from reading as a hole cut in it. The two neutral variants stay two steps apart: `surface` is the quiet one a panel wants, `surface-raised` the stronger lift that suits something the size of a control.
|
|
15
|
+
*/
|
|
16
|
+
tone?: 'default' | 'inverse';
|
|
17
|
+
/** The card is small enough that a generous corner is a fifth of its width. `radius.surface` is twenty-four, which is the corner of a feature card in a grid; on a rail beside a footer's columns it reads as bulbous. This takes it to `radius.surface-compact`.
|
|
18
|
+
|
|
19
|
+
It pairs with CardBody's prop of the same name, and the two are separate because the box and its contents are separate components: this one owns the ground and the corner, that one owns the inset and the type. A small card wants both. */
|
|
20
|
+
compact?: boolean;
|
|
21
|
+
/** Allowed: any content */
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export type CardProps = CardOwnProps & Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'variant' | 'tone' | 'compact'>;
|
|
25
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
26
|
+
export declare const cardParts: {
|
|
27
|
+
readonly root: "dds-card";
|
|
28
|
+
};
|
|
29
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
30
|
+
export declare const cardDefaults: {
|
|
31
|
+
readonly variant: "surface";
|
|
32
|
+
readonly tone: "default";
|
|
33
|
+
readonly compact: false;
|
|
34
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// GENERATED from card.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const cardParts = {
|
|
4
|
+
root: 'dds-card',
|
|
5
|
+
};
|
|
6
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
7
|
+
export const cardDefaults = { variant: 'surface', tone: 'default', compact: false };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/* GENERATED from cardbody.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-cardbody {
|
|
4
|
+
transition-property: background-color, color;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex: auto;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
min-block-size: 0;
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__scrim {
|
|
14
|
+
display: block;
|
|
15
|
+
inset: 0;
|
|
16
|
+
position: absolute;
|
|
17
|
+
background-color: var(--color-bg-overlay);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__content {
|
|
21
|
+
transition-property: padding-block, padding-inline;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
position: relative;
|
|
25
|
+
gap: var(--space-heading-title-description-compact);
|
|
26
|
+
padding-block: var(--space-inset-card);
|
|
27
|
+
padding-inline: var(--space-inset-card);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__mark {
|
|
31
|
+
align-self: flex-start;
|
|
32
|
+
display: flex;
|
|
33
|
+
margin-block-end: var(--space-gap-lg);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__eyebrow {
|
|
37
|
+
transition-property: color;
|
|
38
|
+
margin: 0;
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
font-family: var(--font-eyebrow-sm-family);
|
|
41
|
+
font-size: var(--font-eyebrow-sm-size);
|
|
42
|
+
font-weight: var(--font-eyebrow-sm-weight);
|
|
43
|
+
letter-spacing: var(--font-eyebrow-sm-letter-spacing);
|
|
44
|
+
line-height: var(--font-eyebrow-sm-line-height);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__title {
|
|
48
|
+
transition-property: font-family, font-size, font-weight, letter-spacing, line-height;
|
|
49
|
+
margin: 0;
|
|
50
|
+
font-family: var(--font-h5-family);
|
|
51
|
+
font-size: var(--font-h5-size);
|
|
52
|
+
font-weight: var(--font-h5-weight);
|
|
53
|
+
letter-spacing: var(--font-h5-letter-spacing);
|
|
54
|
+
line-height: var(--font-h5-line-height);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__description {
|
|
58
|
+
transition-property: font-family, font-size, font-weight, letter-spacing, line-height;
|
|
59
|
+
margin: 0;
|
|
60
|
+
font-family: var(--font-body-md-family);
|
|
61
|
+
font-size: var(--font-body-md-size);
|
|
62
|
+
font-weight: var(--font-body-md-weight);
|
|
63
|
+
letter-spacing: var(--font-body-md-letter-spacing);
|
|
64
|
+
line-height: var(--font-body-md-line-height);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__link {
|
|
68
|
+
display: flex;
|
|
69
|
+
margin-block-start: var(--space-heading-description-actions);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__media-frame {
|
|
73
|
+
display: block;
|
|
74
|
+
flex: auto;
|
|
75
|
+
min-block-size: 0;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__media {
|
|
80
|
+
block-size: 100%;
|
|
81
|
+
display: block;
|
|
82
|
+
inline-size: 100%;
|
|
83
|
+
object-fit: cover;
|
|
84
|
+
border-radius: var(--radius-none);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-over-media="true"] {
|
|
88
|
+
display: grid;
|
|
89
|
+
background-color: var(--color-bg-brand-strong);
|
|
90
|
+
color: var(--color-fg-on-brand-strong);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-flush="true"] .dds-cardbody__content {
|
|
94
|
+
padding-inline: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-over-media="true"] .dds-cardbody__media-frame {
|
|
98
|
+
block-size: 100%;
|
|
99
|
+
inset: 0;
|
|
100
|
+
position: absolute;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-compact="true"] .dds-cardbody__content {
|
|
104
|
+
padding-block: var(--space-inset-md);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-compact="true"] .dds-cardbody__description {
|
|
108
|
+
font-family: var(--font-body-sm-family);
|
|
109
|
+
font-size: var(--font-body-sm-size);
|
|
110
|
+
font-weight: var(--font-body-sm-weight);
|
|
111
|
+
letter-spacing: var(--font-body-sm-letter-spacing);
|
|
112
|
+
line-height: var(--font-body-sm-line-height);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-compact="true"] .dds-cardbody__title {
|
|
116
|
+
font-family: var(--font-label-md-family);
|
|
117
|
+
font-size: var(--font-label-md-size);
|
|
118
|
+
font-weight: var(--font-label-md-weight);
|
|
119
|
+
letter-spacing: var(--font-label-md-letter-spacing);
|
|
120
|
+
line-height: var(--font-label-md-line-height);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-over-media="false"] .dds-cardbody__eyebrow {
|
|
124
|
+
color: var(--color-fg-muted);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-zoom-on-hover="true"] .dds-cardbody__media {
|
|
128
|
+
transition-duration: var(--motion-duration-media-hover);
|
|
129
|
+
transition-timing-function: var(--motion-easing-media-hover);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-flush="false"][data-compact="true"] .dds-cardbody__content {
|
|
133
|
+
padding-inline: var(--space-inset-md);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-over-media="false"][data-tone="inverse"] .dds-cardbody__eyebrow {
|
|
137
|
+
color: var(--color-fg-muted-inverse);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@media (prefers-reduced-motion: reduce) {
|
|
141
|
+
:where([data-dds-context="marketing"]) .dds-cardbody,
|
|
142
|
+
:where([data-dds-context="marketing"]) .dds-cardbody * { transition: none !important; }
|
|
143
|
+
}
|
|
144
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import './CardBody.css';
|
|
2
|
+
import './card-body-impl.css';
|
|
3
|
+
import { type CardBodyProps } from './CardBody.types.js';
|
|
4
|
+
export type { CardBodyProps };
|
|
5
|
+
/**
|
|
6
|
+
* Everything a `Card` holds: the words inset from its edges, and the picture
|
|
7
|
+
* that reaches them.
|
|
8
|
+
*
|
|
9
|
+
* The inset lives on `content` rather than on this component's own box. That is
|
|
10
|
+
* the whole reason both fit in one region — a body that padded itself and then
|
|
11
|
+
* pulled the picture back out with a negative margin would be two decisions
|
|
12
|
+
* undoing each other, and the system has no way to write the second one anyway:
|
|
13
|
+
* `staticCss` takes keywords, `100%` and `0`, so there is no negative value to
|
|
14
|
+
* reach for.
|
|
15
|
+
*
|
|
16
|
+
* `mediaPosition` reorders the elements rather than painting them somewhere
|
|
17
|
+
* else. A CSS `order` would move the picture visually and leave a screen reader
|
|
18
|
+
* hearing the old sequence, which is the one way a caption can end up read as an
|
|
19
|
+
* introduction. So it is not a styling axis and emits no rule — it decides which
|
|
20
|
+
* of two nodes is written first.
|
|
21
|
+
*
|
|
22
|
+
* `overMedia` is the axis, and it is a different question: not where the picture
|
|
23
|
+
* sits in the column but whether it is in the column at all. Under it the root
|
|
24
|
+
* becomes a grid, the picture and the wash are pinned to all four edges and out
|
|
25
|
+
* of the flow, and the content is the only child left to occupy the cell. The
|
|
26
|
+
* two props do not compose — a picture that is the ground has no position in a
|
|
27
|
+
* column it left — so `mediaPosition` is not read at all in that branch, which
|
|
28
|
+
* is why the markup below chooses between two whole shapes rather than
|
|
29
|
+
* threading one through the other.
|
|
30
|
+
*
|
|
31
|
+
* `flush` is the other axis, and it is the one prop here that answers to a
|
|
32
|
+
* decision made on a different component. Card's `plain` variant paints no
|
|
33
|
+
* ground, so there is no fill for the copy to be held off and the picture
|
|
34
|
+
* becomes the card's edge instead — at which point the inline inset indents the
|
|
35
|
+
* words from their own picture. It drops that half and keeps the block padding,
|
|
36
|
+
* which was never about the fill. Nothing can check the pair: the ground is
|
|
37
|
+
* Card's prop and the inset is this one's, and neither component can see the
|
|
38
|
+
* other.
|
|
39
|
+
*
|
|
40
|
+
* `zoomOnHover` is the third axis and the only one whose rule is not in the
|
|
41
|
+
* generated sheet. A state bound on a part emits hover on that part, which would
|
|
42
|
+
* zoom the picture only while the pointer was on the picture and leave it still
|
|
43
|
+
* over the headline of the same card. The root's hover reaching its own child has
|
|
44
|
+
* no vocabulary here, so it is in the impl sheet beside this file.
|
|
45
|
+
*
|
|
46
|
+
* `given` on the four strings that gate a region: absence is the switch, so an
|
|
47
|
+
* empty string and a string of spaces both count as absent. A title bound to a
|
|
48
|
+
* value that has not loaded would otherwise render an empty heading, which a
|
|
49
|
+
* screen reader announces as a heading with no name — and `src=""` is worse than
|
|
50
|
+
* nothing, since a browser resolves it against the page URL and re-requests the
|
|
51
|
+
* document as an image.
|
|
52
|
+
*
|
|
53
|
+
* `alt` is not read through `given`, and `mark` is not either. An `alt` of `""` is
|
|
54
|
+
* a real answer meaning "skip this, the copy already said it", and collapsing it
|
|
55
|
+
* into absence would put a filename back into a screen reader. A node is not
|
|
56
|
+
* blank-able the way a string is, so `mark` is tested against `undefined`.
|
|
57
|
+
*
|
|
58
|
+
* No region sets a colour. Card sets one per variant on its root and colour
|
|
59
|
+
* inherits, so the same title is `fg.on-solid` on the brand fill and
|
|
60
|
+
* `fg.default` on the page without this component knowing which card it is in.
|
|
61
|
+
*/
|
|
62
|
+
export declare function CardBody({ eyebrow, title, description, link, mark, src, alt, aspect, mediaPosition, overMedia, flush, compact, tone, zoomOnHover, children: _children, ...rest }: CardBodyProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { given } from '../../given.js';
|
|
3
|
+
import { Icon } from '../icon/Icon.js';
|
|
4
|
+
import './CardBody.css';
|
|
5
|
+
import './card-body-impl.css';
|
|
6
|
+
import { cardBodyDefaults, cardBodyParts } from './CardBody.types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Everything a `Card` holds: the words inset from its edges, and the picture
|
|
9
|
+
* that reaches them.
|
|
10
|
+
*
|
|
11
|
+
* The inset lives on `content` rather than on this component's own box. That is
|
|
12
|
+
* the whole reason both fit in one region — a body that padded itself and then
|
|
13
|
+
* pulled the picture back out with a negative margin would be two decisions
|
|
14
|
+
* undoing each other, and the system has no way to write the second one anyway:
|
|
15
|
+
* `staticCss` takes keywords, `100%` and `0`, so there is no negative value to
|
|
16
|
+
* reach for.
|
|
17
|
+
*
|
|
18
|
+
* `mediaPosition` reorders the elements rather than painting them somewhere
|
|
19
|
+
* else. A CSS `order` would move the picture visually and leave a screen reader
|
|
20
|
+
* hearing the old sequence, which is the one way a caption can end up read as an
|
|
21
|
+
* introduction. So it is not a styling axis and emits no rule — it decides which
|
|
22
|
+
* of two nodes is written first.
|
|
23
|
+
*
|
|
24
|
+
* `overMedia` is the axis, and it is a different question: not where the picture
|
|
25
|
+
* sits in the column but whether it is in the column at all. Under it the root
|
|
26
|
+
* becomes a grid, the picture and the wash are pinned to all four edges and out
|
|
27
|
+
* of the flow, and the content is the only child left to occupy the cell. The
|
|
28
|
+
* two props do not compose — a picture that is the ground has no position in a
|
|
29
|
+
* column it left — so `mediaPosition` is not read at all in that branch, which
|
|
30
|
+
* is why the markup below chooses between two whole shapes rather than
|
|
31
|
+
* threading one through the other.
|
|
32
|
+
*
|
|
33
|
+
* `flush` is the other axis, and it is the one prop here that answers to a
|
|
34
|
+
* decision made on a different component. Card's `plain` variant paints no
|
|
35
|
+
* ground, so there is no fill for the copy to be held off and the picture
|
|
36
|
+
* becomes the card's edge instead — at which point the inline inset indents the
|
|
37
|
+
* words from their own picture. It drops that half and keeps the block padding,
|
|
38
|
+
* which was never about the fill. Nothing can check the pair: the ground is
|
|
39
|
+
* Card's prop and the inset is this one's, and neither component can see the
|
|
40
|
+
* other.
|
|
41
|
+
*
|
|
42
|
+
* `zoomOnHover` is the third axis and the only one whose rule is not in the
|
|
43
|
+
* generated sheet. A state bound on a part emits hover on that part, which would
|
|
44
|
+
* zoom the picture only while the pointer was on the picture and leave it still
|
|
45
|
+
* over the headline of the same card. The root's hover reaching its own child has
|
|
46
|
+
* no vocabulary here, so it is in the impl sheet beside this file.
|
|
47
|
+
*
|
|
48
|
+
* `given` on the four strings that gate a region: absence is the switch, so an
|
|
49
|
+
* empty string and a string of spaces both count as absent. A title bound to a
|
|
50
|
+
* value that has not loaded would otherwise render an empty heading, which a
|
|
51
|
+
* screen reader announces as a heading with no name — and `src=""` is worse than
|
|
52
|
+
* nothing, since a browser resolves it against the page URL and re-requests the
|
|
53
|
+
* document as an image.
|
|
54
|
+
*
|
|
55
|
+
* `alt` is not read through `given`, and `mark` is not either. An `alt` of `""` is
|
|
56
|
+
* a real answer meaning "skip this, the copy already said it", and collapsing it
|
|
57
|
+
* into absence would put a filename back into a screen reader. A node is not
|
|
58
|
+
* blank-able the way a string is, so `mark` is tested against `undefined`.
|
|
59
|
+
*
|
|
60
|
+
* No region sets a colour. Card sets one per variant on its root and colour
|
|
61
|
+
* inherits, so the same title is `fg.on-solid` on the brand fill and
|
|
62
|
+
* `fg.default` on the page without this component knowing which card it is in.
|
|
63
|
+
*/
|
|
64
|
+
export function CardBody({ eyebrow, title, description, link, mark, src, alt, aspect, mediaPosition = cardBodyDefaults.mediaPosition, overMedia = cardBodyDefaults.overMedia, flush = cardBodyDefaults.flush, compact = cardBodyDefaults.compact, tone = cardBodyDefaults.tone, zoomOnHover = cardBodyDefaults.zoomOnHover, children: _children, ...rest }) {
|
|
65
|
+
// Pulled out of `rest` and deliberately unused. `HTMLAttributes` carries a
|
|
66
|
+
// `children` the contract does not declare, and the generator only omits props
|
|
67
|
+
// it knows about — so the type accepts children this component has no slot for,
|
|
68
|
+
// with no complaint from TypeScript. Left in `rest` it would spread onto the div
|
|
69
|
+
// and be silently overridden by the regions below: the same nothing, harder to
|
|
70
|
+
// explain.
|
|
71
|
+
void _children;
|
|
72
|
+
const media = given(src) ? (
|
|
73
|
+
// The frame, not the picture, is what sits in the column: it takes the height the
|
|
74
|
+
// copy leaves and clips whatever grows past it. An <img> cannot clip itself, so a
|
|
75
|
+
// picture that scales on hover has to scale inside something.
|
|
76
|
+
_jsx("div", { className: cardBodyParts['media-frame'],
|
|
77
|
+
// Applied here rather than bound, because the contract cannot hold it: a
|
|
78
|
+
// token binding needs a token and the system has no aspect-ratio one, and a
|
|
79
|
+
// structural rule needs a styling axis, which a number cannot be. Setting it
|
|
80
|
+
// also has to undo the `flex: auto` the stylesheet sets unconditionally —
|
|
81
|
+
// left alone, flex-grow wins over `aspect-ratio` in this column and the ratio
|
|
82
|
+
// asked for is silently not the ratio drawn.
|
|
83
|
+
//
|
|
84
|
+
// On the frame rather than on the picture, which is where it moved when the
|
|
85
|
+
// frame arrived: the ratio is a fact about the box, and the picture inside it
|
|
86
|
+
// fills that box at 100% and covers.
|
|
87
|
+
style: aspect === undefined ? undefined : { flex: 'none', aspectRatio: aspect }, children: _jsx("img", { className: cardBodyParts.media, src: src, alt: alt }) })) : null;
|
|
88
|
+
const content = (_jsxs("div", { className: cardBodyParts.content, children: [mark !== undefined ? (_jsx("div", { className: cardBodyParts.mark, children: _jsx(Icon, { size: "lg", children: mark }) })) : null, given(eyebrow) ? _jsx("p", { className: cardBodyParts.eyebrow, children: eyebrow }) : null, given(title) ? _jsx("h3", { className: cardBodyParts.title, children: title }) : null, given(description) ? (_jsx("p", { className: cardBodyParts.description, children: description })) : null, link ? _jsx("div", { className: cardBodyParts.link, children: link }) : null] }));
|
|
89
|
+
if (overMedia) {
|
|
90
|
+
return (
|
|
91
|
+
// Both values, never just the set one. The stylesheet selects on
|
|
92
|
+
// `[data-over-media="true"]`, and an attribute that is simply absent when false
|
|
93
|
+
// would leave the two branches distinguished by nothing a selector can name.
|
|
94
|
+
_jsxs("div", { className: cardBodyParts.root, "data-over-media": "true", "data-flush": flush ? 'true' : 'false', "data-zoom-on-hover": zoomOnHover ? 'true' : 'false', "data-compact": compact ? 'true' : 'false', "data-tone": tone, ...rest, children: [media, _jsx("span", { className: cardBodyParts.scrim }), content] }));
|
|
95
|
+
}
|
|
96
|
+
return (_jsxs("div", { className: cardBodyParts.root, "data-over-media": "false", "data-flush": flush ? 'true' : 'false', "data-zoom-on-hover": zoomOnHover ? 'true' : 'false', "data-compact": compact ? 'true' : 'false', "data-tone": tone, ...rest, children: [mediaPosition === 'above' ? media : null, content, mediaPosition === 'above' ? null : media] }));
|
|
97
|
+
}
|