@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,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Scoped to this package, like the generated sheet beside it.
|
|
3
|
+
*
|
|
4
|
+
* `:where([data-dds-context="marketing"])` confines these rules without contributing
|
|
5
|
+
* specificity, so the one override below still ties or beats exactly what it did before.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* The status glyph's box is one line of the message tall.
|
|
10
|
+
*
|
|
11
|
+
* The contract binds the font size and the line height on this part, which is what makes it
|
|
12
|
+
* one line — but a line's height is those two multiplied, and a binding carries one token,
|
|
13
|
+
* not an expression over two. So the multiplication happens here, over the same variables the
|
|
14
|
+
* contract bound: no measure is declared, and retuning either token moves this with it.
|
|
15
|
+
*
|
|
16
|
+
* Why a height at all, when the part could simply hold the glyph: aligned to the start of the
|
|
17
|
+
* block axis, a glyph is as tall as itself — 16px against a 21px line — so its middle sits
|
|
18
|
+
* above the first line's and the words beside it read as pushed down. A box one line tall with
|
|
19
|
+
* the glyph centred in it puts the two middles on each other.
|
|
20
|
+
*
|
|
21
|
+
* Centred geometrically rather than on the inline baseline. `vertical-align: middle` is the
|
|
22
|
+
* usual recipe and it is not the same thing: it puts a glyph's middle on the baseline plus half
|
|
23
|
+
* an x-height, which lands a pixel or so below the middle of a line of capitals and leaves the
|
|
24
|
+
* glyph hanging under the baseline where the type has its descender.
|
|
25
|
+
*
|
|
26
|
+
* One rule rather than one per size, because the message is font.body.sm at every step — it is
|
|
27
|
+
* the small print under a field whatever size it is, and the field's own sizes do not reach it. The day
|
|
28
|
+
* that stops being true this needs a second rule, and naming the role rather than a measure is
|
|
29
|
+
* what will make that obvious.
|
|
30
|
+
*
|
|
31
|
+
* The same problem InlineAlert solved first, and the same answer; the argument in full is in
|
|
32
|
+
* inline-alert-impl.css.
|
|
33
|
+
*/
|
|
34
|
+
:where([data-dds-context="marketing"]) .dds-textinput__message-icon {
|
|
35
|
+
block-size: calc(var(--font-body-sm-size) * var(--font-body-sm-line-height));
|
|
36
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* GENERATED from tooltip.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-tooltip {
|
|
4
|
+
transition-property: opacity, scale;
|
|
5
|
+
align-items: center;
|
|
6
|
+
display: flex;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
width: max-content;
|
|
9
|
+
font-family: var(--font-body-sm-family);
|
|
10
|
+
font-size: var(--font-body-sm-size);
|
|
11
|
+
font-weight: var(--font-body-sm-weight);
|
|
12
|
+
line-height: var(--font-body-sm-line-height);
|
|
13
|
+
transition-duration: var(--motion-duration-fast);
|
|
14
|
+
transition-timing-function: var(--motion-easing-enter);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:where([data-dds-context="marketing"]) .dds-tooltip .dds-tooltip__caret {
|
|
18
|
+
box-sizing: content-box;
|
|
19
|
+
color: var(--color-bg-strong);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:where([data-dds-context="marketing"]) .dds-tooltip .dds-tooltip__body {
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
overflow-wrap: break-word;
|
|
25
|
+
text-wrap: balance;
|
|
26
|
+
background-color: var(--color-bg-strong);
|
|
27
|
+
border-radius: var(--radius-subtle);
|
|
28
|
+
box-shadow: var(--elevation-surface-floating);
|
|
29
|
+
color: var(--color-fg-on-strong);
|
|
30
|
+
max-inline-size: var(--size-tooltip-max);
|
|
31
|
+
padding-block: var(--space-inset-sm);
|
|
32
|
+
padding-inline: var(--space-inset-md);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-placement="bottom"] {
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
transform-origin: top;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-placement="left"] {
|
|
41
|
+
flex-direction: row-reverse;
|
|
42
|
+
transform-origin: right;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-placement="right"] {
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
transform-origin: left;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-placement="top"] {
|
|
51
|
+
flex-direction: column-reverse;
|
|
52
|
+
transform-origin: bottom;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-alignment="center"] .dds-tooltip__caret {
|
|
56
|
+
align-self: center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-alignment="end"] .dds-tooltip__caret {
|
|
60
|
+
align-self: flex-end;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-alignment="start"] .dds-tooltip__caret {
|
|
64
|
+
align-self: flex-start;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-hidden="true"] {
|
|
68
|
+
opacity: var(--opacity-hidden);
|
|
69
|
+
scale: var(--motion-scale-enter);
|
|
70
|
+
transition-duration: var(--motion-duration-instant);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-placement="bottom"] .dds-tooltip__caret {
|
|
74
|
+
height: var(--space-gap-xs);
|
|
75
|
+
padding-inline: var(--space-inset-sm);
|
|
76
|
+
width: var(--space-gap-sm);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-placement="left"] .dds-tooltip__caret {
|
|
80
|
+
height: var(--space-gap-sm);
|
|
81
|
+
padding-block: var(--space-inset-sm);
|
|
82
|
+
width: var(--space-gap-xs);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-placement="right"] .dds-tooltip__caret {
|
|
86
|
+
height: var(--space-gap-sm);
|
|
87
|
+
padding-block: var(--space-inset-sm);
|
|
88
|
+
width: var(--space-gap-xs);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:where([data-dds-context="marketing"]) .dds-tooltip[data-placement="top"] .dds-tooltip__caret {
|
|
92
|
+
height: var(--space-gap-xs);
|
|
93
|
+
padding-inline: var(--space-inset-sm);
|
|
94
|
+
width: var(--space-gap-sm);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@media (prefers-reduced-motion: reduce) {
|
|
98
|
+
:where([data-dds-context="marketing"]) .dds-tooltip,
|
|
99
|
+
:where([data-dds-context="marketing"]) .dds-tooltip * { transition: none !important; }
|
|
100
|
+
}
|
|
101
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import './Tooltip.css';
|
|
2
|
+
import './tooltip-impl.css';
|
|
3
|
+
import { type TooltipProps } from './Tooltip.types.js';
|
|
4
|
+
export type { TooltipProps };
|
|
5
|
+
/**
|
|
6
|
+
* The chip only. When it appears, and where, is the anchor's decision — this
|
|
7
|
+
* component has neither a timer nor a position of its own. Both ship beside it, as
|
|
8
|
+
* `useTooltip` and `TooltipAnchor`, so that a consumer with a trigger this cannot
|
|
9
|
+
* wrap still has the parts to assemble one.
|
|
10
|
+
*
|
|
11
|
+
* `placement` names where the tooltip sits relative to its anchor — `top` is above
|
|
12
|
+
* it — and the caret is drawn on the opposite edge so it points back at what it
|
|
13
|
+
* describes. Naming the placement rather than the caret's own edge is what lets the
|
|
14
|
+
* wrapper pass one value straight through to two readers: the stylesheet that moves
|
|
15
|
+
* the chip, and this file that picks which triangle to draw. Neither has to remember
|
|
16
|
+
* to invert it. Nothing here moves the tooltip, so a `placement` that disagrees with
|
|
17
|
+
* where the chip actually sits is still the consumer's mistake to avoid.
|
|
18
|
+
*
|
|
19
|
+
* `role="tooltip"` carries no behaviour of its own; it is what makes the
|
|
20
|
+
* `aria-describedby` on the anchor announce as a description rather than as a
|
|
21
|
+
* second, unrelated run of text. Which is why the contract's second `a11y`
|
|
22
|
+
* requirement has no executable `check`: the association lives on the anchor,
|
|
23
|
+
* and nothing in this component's own DOM can prove it was made.
|
|
24
|
+
*
|
|
25
|
+
* `id` is not a declared prop — it arrives through `HTMLAttributes`, and the
|
|
26
|
+
* anchor needs it to point here at all. That is the reason this contract has an
|
|
27
|
+
* `api.extends` where Card deliberately does not.
|
|
28
|
+
*
|
|
29
|
+
* `showCaret` decides whether the caret is rendered at all, rather than rendered and
|
|
30
|
+
* hidden. That is a contract decision and not this file's: the anatomy declares the
|
|
31
|
+
* part `presentWhen: "showCaret"`, which is how a conditional part is described here
|
|
32
|
+
* and how the generated stylesheet and behaviour test both come to know about it.
|
|
33
|
+
* The alternative it replaced — one `placement` value meaning "nowhere", drawing a
|
|
34
|
+
* caret and then hiding it with `display: none` — spent a whole axis of the variant
|
|
35
|
+
* matrix on a chip that had no position to point from.
|
|
36
|
+
*
|
|
37
|
+
* DOM order is fixed: caret first, always. `flex-direction` carries the side —
|
|
38
|
+
* `column` and `column-reverse`, `row` and `row-reverse` — so which end of the
|
|
39
|
+
* chip the caret sits at is decided by the stylesheet from the contract, and this
|
|
40
|
+
* file never branches on placement.
|
|
41
|
+
*
|
|
42
|
+
* `hidden` shadows the native attribute of the same name and does not mean what it
|
|
43
|
+
* means: native `hidden` is `display: none`, and a tooltip that leaves the layout
|
|
44
|
+
* has nothing to fade from and no box to fade in. This one is a bound opacity, so
|
|
45
|
+
* the chip stays where it is, stays measurable, and stays pointed at by the anchor's
|
|
46
|
+
* `aria-describedby` — the description is still announced with the control it
|
|
47
|
+
* explains, which is the whole reason that association exists. Shadowing a native
|
|
48
|
+
* attribute is Input's precedent, where `size` means the control's scale rather than
|
|
49
|
+
* a character count.
|
|
50
|
+
*/
|
|
51
|
+
export declare function Tooltip({ placement, alignment, showCaret, hidden, children, ...rest }: TooltipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import './Tooltip.css';
|
|
3
|
+
import './tooltip-impl.css';
|
|
4
|
+
import { tooltipDefaults, tooltipParts } from './Tooltip.types.js';
|
|
5
|
+
/**
|
|
6
|
+
* The caret, once per side the tooltip can sit on.
|
|
7
|
+
*
|
|
8
|
+
* Keyed by `placement`, which names where the tooltip is — so each entry holds the
|
|
9
|
+
* triangle that points back the other way, at the anchor. `top` means the tooltip
|
|
10
|
+
* is above its anchor, so `top` draws a triangle pointing down. Reading this table
|
|
11
|
+
* as "the direction the caret points" gets every entry backwards, which is the one
|
|
12
|
+
* mistake this shape invites.
|
|
13
|
+
*
|
|
14
|
+
* Four paths rather than one path rotated four ways, because rotation is not
|
|
15
|
+
* something a contract can express: `structure` carries CSS keywords, and every
|
|
16
|
+
* form of `rotate` needs an angle. Drawing each direction moves that decision
|
|
17
|
+
* into geometry, where it costs nothing — the shape of a triangle is not a design
|
|
18
|
+
* decision that a designer would ever want to vary by brand or mode.
|
|
19
|
+
*
|
|
20
|
+
* Shape is all that is left here. How big the caret is, and how far it sits from
|
|
21
|
+
* the chip's rounded corner, are both design decisions and both live in the
|
|
22
|
+
* contract — `width`/`height` per side, and `padding-inline`/`padding-block` for
|
|
23
|
+
* the inset that keeps the caret clear of the chip's rounded corner. This file
|
|
24
|
+
* carried the size for one pass, as an `em` ratio on the SVG itself, and that put
|
|
25
|
+
* a decision where no contract, no generated doc and no Figma push could see it.
|
|
26
|
+
*
|
|
27
|
+
* So there is no width or height attribute below. The stylesheet supplies both,
|
|
28
|
+
* and each direction carries only its own viewBox — the aspect the triangle is
|
|
29
|
+
* drawn at, which has to agree with the bound box or the shape would be scaled to
|
|
30
|
+
* fit and stop being the shape that was drawn.
|
|
31
|
+
*/
|
|
32
|
+
const CARET = {
|
|
33
|
+
top: { viewBox: '0 0 8 4', d: 'M0 0 L4 4 L8 0 Z' },
|
|
34
|
+
right: { viewBox: '0 0 4 8', d: 'M4 0 L0 4 L4 8 Z' },
|
|
35
|
+
bottom: { viewBox: '0 0 8 4', d: 'M0 4 L4 0 L8 4 Z' },
|
|
36
|
+
left: { viewBox: '0 0 4 8', d: 'M0 0 L4 4 L0 8 Z' },
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The chip only. When it appears, and where, is the anchor's decision — this
|
|
40
|
+
* component has neither a timer nor a position of its own. Both ship beside it, as
|
|
41
|
+
* `useTooltip` and `TooltipAnchor`, so that a consumer with a trigger this cannot
|
|
42
|
+
* wrap still has the parts to assemble one.
|
|
43
|
+
*
|
|
44
|
+
* `placement` names where the tooltip sits relative to its anchor — `top` is above
|
|
45
|
+
* it — and the caret is drawn on the opposite edge so it points back at what it
|
|
46
|
+
* describes. Naming the placement rather than the caret's own edge is what lets the
|
|
47
|
+
* wrapper pass one value straight through to two readers: the stylesheet that moves
|
|
48
|
+
* the chip, and this file that picks which triangle to draw. Neither has to remember
|
|
49
|
+
* to invert it. Nothing here moves the tooltip, so a `placement` that disagrees with
|
|
50
|
+
* where the chip actually sits is still the consumer's mistake to avoid.
|
|
51
|
+
*
|
|
52
|
+
* `role="tooltip"` carries no behaviour of its own; it is what makes the
|
|
53
|
+
* `aria-describedby` on the anchor announce as a description rather than as a
|
|
54
|
+
* second, unrelated run of text. Which is why the contract's second `a11y`
|
|
55
|
+
* requirement has no executable `check`: the association lives on the anchor,
|
|
56
|
+
* and nothing in this component's own DOM can prove it was made.
|
|
57
|
+
*
|
|
58
|
+
* `id` is not a declared prop — it arrives through `HTMLAttributes`, and the
|
|
59
|
+
* anchor needs it to point here at all. That is the reason this contract has an
|
|
60
|
+
* `api.extends` where Card deliberately does not.
|
|
61
|
+
*
|
|
62
|
+
* `showCaret` decides whether the caret is rendered at all, rather than rendered and
|
|
63
|
+
* hidden. That is a contract decision and not this file's: the anatomy declares the
|
|
64
|
+
* part `presentWhen: "showCaret"`, which is how a conditional part is described here
|
|
65
|
+
* and how the generated stylesheet and behaviour test both come to know about it.
|
|
66
|
+
* The alternative it replaced — one `placement` value meaning "nowhere", drawing a
|
|
67
|
+
* caret and then hiding it with `display: none` — spent a whole axis of the variant
|
|
68
|
+
* matrix on a chip that had no position to point from.
|
|
69
|
+
*
|
|
70
|
+
* DOM order is fixed: caret first, always. `flex-direction` carries the side —
|
|
71
|
+
* `column` and `column-reverse`, `row` and `row-reverse` — so which end of the
|
|
72
|
+
* chip the caret sits at is decided by the stylesheet from the contract, and this
|
|
73
|
+
* file never branches on placement.
|
|
74
|
+
*
|
|
75
|
+
* `hidden` shadows the native attribute of the same name and does not mean what it
|
|
76
|
+
* means: native `hidden` is `display: none`, and a tooltip that leaves the layout
|
|
77
|
+
* has nothing to fade from and no box to fade in. This one is a bound opacity, so
|
|
78
|
+
* the chip stays where it is, stays measurable, and stays pointed at by the anchor's
|
|
79
|
+
* `aria-describedby` — the description is still announced with the control it
|
|
80
|
+
* explains, which is the whole reason that association exists. Shadowing a native
|
|
81
|
+
* attribute is Input's precedent, where `size` means the control's scale rather than
|
|
82
|
+
* a character count.
|
|
83
|
+
*/
|
|
84
|
+
export function Tooltip({ placement = tooltipDefaults.placement, alignment = tooltipDefaults.alignment, showCaret = tooltipDefaults.showCaret, hidden = tooltipDefaults.hidden, children, ...rest }) {
|
|
85
|
+
const caret = CARET[placement];
|
|
86
|
+
return (_jsxs("div", { className: tooltipParts.root, role: "tooltip", "data-placement": placement, "data-alignment": alignment, "data-hidden": hidden, ...rest, children: [showCaret && (_jsx("svg", { className: tooltipParts.caret, viewBox: caret.viewBox, "aria-hidden": "true", children: _jsx("path", { d: caret.d, fill: "currentColor" }) })), _jsx("div", { className: tooltipParts.body, children: children })] }));
|
|
87
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TooltipOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `top` — The tooltip sits above its anchor, so the caret drops from the bottom edge to meet it
|
|
5
|
+
* `right` — The tooltip sits on the trailing side of its anchor — the right in English, the left in Arabic — so the caret reaches back across to meet it. The name is physical and the behaviour is logical: the chip's own direction mirrors this, caret and all
|
|
6
|
+
* `bottom` — The tooltip sits below its anchor, so the caret rises from the top edge to meet it
|
|
7
|
+
* `left` — The tooltip sits on the leading side of its anchor — the left in English, the right in Arabic — so the caret reaches across to meet it. The name is physical and the behaviour is logical: the chip's own direction mirrors this, caret and all
|
|
8
|
+
*/
|
|
9
|
+
placement?: 'top' | 'right' | 'bottom' | 'left';
|
|
10
|
+
/**
|
|
11
|
+
* `center` — The chip is centred on its anchor and the caret's point lands on the middle of it. Use this unless the chip is much wider than the thing it points at
|
|
12
|
+
* `start` — The chip's leading edge lines up with the anchor's own, so a chip wider than its anchor grows away from it rather than back across the layout. For an anchor at the start of a row
|
|
13
|
+
* `end` — The mirror of start: the chip's trailing edge lines up with the anchor's, for an anchor at the end of a row
|
|
14
|
+
*/
|
|
15
|
+
alignment?: 'center' | 'start' | 'end';
|
|
16
|
+
/** Whatever reveals the tooltip has not revealed it yet, or has dismissed it. Defaults to false, which means visible — so something has to drive this, or the chip is simply on. Keeping it mounted and hidden rather than unmounting it is what lets it fade in, and what keeps the anchor's aria-describedby pointing at something real.
|
|
17
|
+
|
|
18
|
+
Flipping it is the whole animation. The chip fades from opacity.hidden and scales up from motion.scale.enter over motion.duration.fast on motion.easing.enter, growing out of the edge nearest its anchor rather than its own middle. The dismissal is not animated at all — transition-duration is motion.duration.instant while hidden, because by then the pointer has already gone somewhere else. Do not write a transition of your own: the stylesheet declares transition-property from what this axis changes, and a second declaration would both override that list and escape the prefers-reduced-motion guard generated with it. */
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
/** Drawn by default. Leave it on whenever something holds the chip against its anchor — the point is what ties a floating description to the control it belongs to */
|
|
21
|
+
showCaret?: boolean;
|
|
22
|
+
/** Allowed: text */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export type TooltipProps = TooltipOwnProps & Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'placement' | 'alignment' | 'hidden' | 'showCaret'>;
|
|
26
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
27
|
+
export declare const tooltipParts: {
|
|
28
|
+
readonly root: "dds-tooltip";
|
|
29
|
+
readonly caret: "dds-tooltip__caret";
|
|
30
|
+
readonly body: "dds-tooltip__body";
|
|
31
|
+
};
|
|
32
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
33
|
+
export declare const tooltipDefaults: {
|
|
34
|
+
readonly placement: "top";
|
|
35
|
+
readonly alignment: "center";
|
|
36
|
+
readonly hidden: false;
|
|
37
|
+
readonly showCaret: true;
|
|
38
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// GENERATED from tooltip.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const tooltipParts = {
|
|
4
|
+
root: 'dds-tooltip',
|
|
5
|
+
caret: 'dds-tooltip__caret',
|
|
6
|
+
body: 'dds-tooltip__body',
|
|
7
|
+
};
|
|
8
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
9
|
+
export const tooltipDefaults = { placement: 'top', alignment: 'center', hidden: false, showCaret: true };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import './tooltip-anchor.css';
|
|
2
|
+
import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
|
|
3
|
+
import { type TooltipProps } from './Tooltip.types.js';
|
|
4
|
+
import { type UseTooltipOptions } from './use-tooltip.js';
|
|
5
|
+
export interface TooltipAnchorProps extends UseTooltipOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The trigger: one element, which the description is attached to and the pointer and
|
|
8
|
+
* focus handlers are added to. It has to be something focus can rest on — a button
|
|
9
|
+
* or a link, not a span — or the description is one no keyboard ever reaches.
|
|
10
|
+
*
|
|
11
|
+
* Typed as a single element rather than ReactNode because this clones it. Text, a
|
|
12
|
+
* fragment or a list has nothing to clone and nowhere to put an aria-describedby, so
|
|
13
|
+
* the constraint is better carried by the type than discovered at runtime.
|
|
14
|
+
*
|
|
15
|
+
* A component works as well as a plain element, provided it forwards the props it is
|
|
16
|
+
* handed — which is what a contract's `api.extends` promises, and why Button can be a
|
|
17
|
+
* trigger. One that declares none swallows them silently: the type still fits, and the
|
|
18
|
+
* description reaches nothing.
|
|
19
|
+
*/
|
|
20
|
+
children: ReactElement<HTMLAttributes<HTMLElement>>;
|
|
21
|
+
/** The description. Short — the contract's own guidance is that this is a label, not a panel. */
|
|
22
|
+
content: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Which side of the anchor the chip sits on, passed straight through to the chip so
|
|
25
|
+
* one value places the box and draws the caret pointing back the other way.
|
|
26
|
+
*/
|
|
27
|
+
placement?: TooltipProps['placement'];
|
|
28
|
+
/** Where along that side, which is the axis the placement did not use. */
|
|
29
|
+
alignment?: TooltipProps['alignment'];
|
|
30
|
+
/** Passed through to the chip, which renders the caret or leaves it out. */
|
|
31
|
+
showCaret?: TooltipProps['showCaret'];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A trigger and its tooltip, placed against each other.
|
|
35
|
+
*
|
|
36
|
+
* `Tooltip` is the chip and nothing else, and `useTooltip` is when it arrives. This is
|
|
37
|
+
* the third thing neither of them does: where it lands. It is a wrapper rather than
|
|
38
|
+
* anything cleverer because the placement is pure CSS — one positioning context around
|
|
39
|
+
* both boxes, and `placement` read by a stylesheet — so there is nothing to measure,
|
|
40
|
+
* nothing to watch for resizes, and no layout pass to be one frame behind.
|
|
41
|
+
*
|
|
42
|
+
* What that buys is that the caret now lands on the point it names. What it does not
|
|
43
|
+
* buy is flipping: a chip whose named side has no room overflows rather than moving to
|
|
44
|
+
* the side that does, because knowing there is no room means measuring the viewport.
|
|
45
|
+
* The contract says as much in its own guidance, and this module does not retract it.
|
|
46
|
+
*
|
|
47
|
+
* Reach past this to `useTooltip` when the trigger is not something this can wrap —
|
|
48
|
+
* one already inside another component, or one that is not an element at all. That is
|
|
49
|
+
* the whole of what an external anchor needs: the hook's `anchorProps` go on whatever
|
|
50
|
+
* the trigger turns out to be, and `tooltipProps` on a chip rendered wherever suits.
|
|
51
|
+
*/
|
|
52
|
+
export declare function TooltipAnchor({ children, content, placement, alignment, showCaret, ...options }: TooltipAnchorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import './tooltip-anchor.css';
|
|
4
|
+
import { cloneElement } from 'react';
|
|
5
|
+
import { Tooltip } from './Tooltip.js';
|
|
6
|
+
import { tooltipDefaults } from './Tooltip.types.js';
|
|
7
|
+
import { useTooltip } from './use-tooltip.js';
|
|
8
|
+
/**
|
|
9
|
+
* The two boxes this renders. Written here and in tooltip-anchor.css, and nowhere
|
|
10
|
+
* else — there is no generated constant for them, because they are this module's own
|
|
11
|
+
* DOM rather than parts the contract declares. A part declared in the contract has to
|
|
12
|
+
* appear in Tooltip's own markup, and keeping a positioning wrapper out of Tooltip is
|
|
13
|
+
* what this module is for.
|
|
14
|
+
*/
|
|
15
|
+
const parts = {
|
|
16
|
+
root: 'dds-tooltip-anchor',
|
|
17
|
+
tip: 'dds-tooltip-anchor__tip',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Both handlers, the trigger's own first.
|
|
21
|
+
*
|
|
22
|
+
* cloneElement replaces rather than merges, so a trigger that already listened for the
|
|
23
|
+
* pointer would silently stop doing so — the kind of loss that shows up as a bug in
|
|
24
|
+
* the consumer's own code, nowhere near here.
|
|
25
|
+
*/
|
|
26
|
+
function chain(theirs, ours) {
|
|
27
|
+
if (theirs === undefined)
|
|
28
|
+
return ours;
|
|
29
|
+
return (event) => {
|
|
30
|
+
theirs(event);
|
|
31
|
+
ours(event);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A trigger and its tooltip, placed against each other.
|
|
36
|
+
*
|
|
37
|
+
* `Tooltip` is the chip and nothing else, and `useTooltip` is when it arrives. This is
|
|
38
|
+
* the third thing neither of them does: where it lands. It is a wrapper rather than
|
|
39
|
+
* anything cleverer because the placement is pure CSS — one positioning context around
|
|
40
|
+
* both boxes, and `placement` read by a stylesheet — so there is nothing to measure,
|
|
41
|
+
* nothing to watch for resizes, and no layout pass to be one frame behind.
|
|
42
|
+
*
|
|
43
|
+
* What that buys is that the caret now lands on the point it names. What it does not
|
|
44
|
+
* buy is flipping: a chip whose named side has no room overflows rather than moving to
|
|
45
|
+
* the side that does, because knowing there is no room means measuring the viewport.
|
|
46
|
+
* The contract says as much in its own guidance, and this module does not retract it.
|
|
47
|
+
*
|
|
48
|
+
* Reach past this to `useTooltip` when the trigger is not something this can wrap —
|
|
49
|
+
* one already inside another component, or one that is not an element at all. That is
|
|
50
|
+
* the whole of what an external anchor needs: the hook's `anchorProps` go on whatever
|
|
51
|
+
* the trigger turns out to be, and `tooltipProps` on a chip rendered wherever suits.
|
|
52
|
+
*/
|
|
53
|
+
export function TooltipAnchor({ children, content, placement = tooltipDefaults.placement, alignment = tooltipDefaults.alignment, showCaret = tooltipDefaults.showCaret, ...options }) {
|
|
54
|
+
const { anchorProps, tooltipProps } = useTooltip(options);
|
|
55
|
+
const own = children.props;
|
|
56
|
+
const described = own['aria-describedby'];
|
|
57
|
+
const trigger = cloneElement(children, {
|
|
58
|
+
// Appended rather than replaced. A trigger that already carries a description has
|
|
59
|
+
// two of them, and a reader is meant to hear both.
|
|
60
|
+
'aria-describedby': described === undefined
|
|
61
|
+
? anchorProps['aria-describedby']
|
|
62
|
+
: `${described} ${anchorProps['aria-describedby']}`,
|
|
63
|
+
onPointerEnter: chain(own.onPointerEnter, anchorProps.onPointerEnter),
|
|
64
|
+
onPointerLeave: chain(own.onPointerLeave, anchorProps.onPointerLeave),
|
|
65
|
+
onFocus: chain(own.onFocus, anchorProps.onFocus),
|
|
66
|
+
onBlur: chain(own.onBlur, anchorProps.onBlur),
|
|
67
|
+
});
|
|
68
|
+
return (_jsxs("span", { className: parts.root, children: [trigger, _jsx("span", { className: parts.tip, "data-placement": placement, "data-alignment": alignment, children: _jsx(Tooltip, { ...tooltipProps, placement: placement, alignment: alignment, showCaret: showCaret, children: content }) })] }));
|
|
69
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Placement for TooltipAnchor, which no contract describes.
|
|
3
|
+
*
|
|
4
|
+
* These two boxes are a behaviour module's own DOM rather than parts of the
|
|
5
|
+
* component's anatomy, and the difference is load-bearing: a part declared in the
|
|
6
|
+
* contract has to appear in Tooltip's own markup — the generated behaviour test
|
|
7
|
+
* asserts exactly that — and keeping a positioning wrapper out of Tooltip is the
|
|
8
|
+
* whole reason this module exists. So the classes are written here and in
|
|
9
|
+
* TooltipAnchor.tsx, and nowhere else.
|
|
10
|
+
*
|
|
11
|
+
* Every value is a token, read through the same custom properties the chip's own
|
|
12
|
+
* generated stylesheet reads. Nothing here is a raw dimension: `100%`, `50%`, `0`
|
|
13
|
+
* and `max-content` are the geometry of "beside the anchor", not sizes anyone would
|
|
14
|
+
* want to tune per brand.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor {
|
|
18
|
+
/* The positioning context. Inline-block so it hugs the trigger rather than
|
|
19
|
+
whatever column the trigger sits in — otherwise a chip centred on the anchor
|
|
20
|
+
centres on the column, and lands nowhere near the thing it describes. */
|
|
21
|
+
position: relative;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip {
|
|
26
|
+
position: absolute;
|
|
27
|
+
|
|
28
|
+
/* Out of the flow means shrink-to-fit, and shrink-to-fit against a single inset is
|
|
29
|
+
measured from that inset to the containing block's edge — so a wide chip on a
|
|
30
|
+
narrow trigger would wrap at whatever that distance happened to be. max-content
|
|
31
|
+
puts the measure back on the text, and the chip's own max-inline-size still caps
|
|
32
|
+
it. This is the one thing the preview harness that prototyped this never hit,
|
|
33
|
+
because its trigger was always wider than its sample sentence. */
|
|
34
|
+
width: max-content;
|
|
35
|
+
|
|
36
|
+
/* Never a target. The chip already refuses the pointer, but this box is larger than
|
|
37
|
+
the chip's ink and sits over content the pointer does need. */
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
|
|
40
|
+
/* How far the chip clears the anchor: the caret's own height, so that the gap and
|
|
41
|
+
the thing crossing it scale together. It stays the same with showCaret false —
|
|
42
|
+
a description touching the control it describes reads as part of it. */
|
|
43
|
+
--dds-tooltip-anchor-gap: var(--space-gap-xs);
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
Above the page it floats over.
|
|
47
|
+
`position: absolute` alone leaves this at `z-index: auto`, which paints in tree
|
|
48
|
+
order among positioned elements — so any positioned sibling declared later covers
|
|
49
|
+
the chip, and a tooltip on the first of two cards loses to the second. Measured
|
|
50
|
+
before this line existed: `tipZ: auto`.
|
|
51
|
+
`layer.popup` rather than a number chosen here. The primitive ramp has carried
|
|
52
|
+
0/100/200/300/400/800/1600 all along, and the reason components reach for bare
|
|
53
|
+
integers is that no semantic role pointed at it — so this is the first consumer of
|
|
54
|
+
the role rather than the eighth hand-picked value.
|
|
55
|
+
It does not make the chip immune. A z-index only orders siblings within a stacking
|
|
56
|
+
context, so an ancestor that creates one — a transform, a filter, an opacity below
|
|
57
|
+
1, an isolation — still traps the chip inside it however high this goes. The only
|
|
58
|
+
thing that escapes that is the top layer, which means the popover API and a
|
|
59
|
+
different positioning story. Worth knowing before this is trusted absolutely. */
|
|
60
|
+
z-index: var(--layer-popup);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
* Which side the chip sits on, read from `placement` directly rather than through a
|
|
65
|
+
* vocabulary of its own — that prop already names where the tooltip is, which is why
|
|
66
|
+
* it names the placement and not the caret's edge. A lookup translating one name into
|
|
67
|
+
* another is a second opinion waiting to disagree with the contract.
|
|
68
|
+
*
|
|
69
|
+
* Logical insets, because `left` and `right` name the leading and trailing side rather
|
|
70
|
+
* than two points of the compass: a leading-side tooltip is on the right in Arabic, and
|
|
71
|
+
* `inset-inline-end` puts it there with nothing here to help it. The block axis is not
|
|
72
|
+
* mirrored by direction, so `top` and `bottom` mean what they say.
|
|
73
|
+
*/
|
|
74
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='top'] {
|
|
75
|
+
inset-block-end: 100%;
|
|
76
|
+
margin-block-end: var(--dds-tooltip-anchor-gap);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='bottom'] {
|
|
80
|
+
inset-block-start: 100%;
|
|
81
|
+
margin-block-start: var(--dds-tooltip-anchor-gap);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='left'] {
|
|
85
|
+
inset-inline-end: 100%;
|
|
86
|
+
margin-inline-end: var(--dds-tooltip-anchor-gap);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='right'] {
|
|
90
|
+
inset-inline-start: 100%;
|
|
91
|
+
margin-inline-start: var(--dds-tooltip-anchor-gap);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* Where along that side, which is the axis the placement did not use: the inline axis
|
|
96
|
+
* for a chip above or below, the block axis for one beside. Twelve arrangements in all,
|
|
97
|
+
* which is the number the contract's own guidance names.
|
|
98
|
+
*
|
|
99
|
+
* Centring is the one place a physical inset is correct. `left: 50%` puts the chip's
|
|
100
|
+
* left edge on the anchor's middle and the shift takes back half the chip's width, and
|
|
101
|
+
* those two cancel in either direction — a logical inset would need the shift to change
|
|
102
|
+
* sign with the direction, which is two rules to say what one says here.
|
|
103
|
+
*
|
|
104
|
+
* `start` and `end` share an edge with the anchor instead: the chip's leading edge on
|
|
105
|
+
* the anchor's leading edge, its trailing on the trailing. What they did before was hold
|
|
106
|
+
* the caret's point over the anchor's middle, which is what `center` is already for —
|
|
107
|
+
* two of the three values agreed about the caret and disagreed about the chip, and the
|
|
108
|
+
* chip wider than its anchor hung back across the layout it came from. An inset of zero
|
|
109
|
+
* is the whole rule now, and the caret lands wherever its own inset from that edge puts
|
|
110
|
+
* it: inside any anchor wider than the corner it clears.
|
|
111
|
+
*/
|
|
112
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='top'][data-alignment='center'],
|
|
113
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='bottom'][data-alignment='center'] {
|
|
114
|
+
left: 50%;
|
|
115
|
+
translate: -50% 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='top'][data-alignment='start'],
|
|
119
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='bottom'][data-alignment='start'] {
|
|
120
|
+
inset-inline-start: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='top'][data-alignment='end'],
|
|
124
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='bottom'][data-alignment='end'] {
|
|
125
|
+
inset-inline-end: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* The same three arrangements on the block axis, for a chip beside its anchor. The
|
|
129
|
+
harness that prototyped this placed those centred whatever the alignment said, which
|
|
130
|
+
left four of the twelve points unreachable. */
|
|
131
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='left'][data-alignment='center'],
|
|
132
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='right'][data-alignment='center'] {
|
|
133
|
+
inset-block-start: 50%;
|
|
134
|
+
translate: 0 -50%;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='left'][data-alignment='start'],
|
|
138
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='right'][data-alignment='start'] {
|
|
139
|
+
inset-block-start: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='left'][data-alignment='end'],
|
|
143
|
+
:where([data-dds-context="marketing"]) .dds-tooltip-anchor__tip[data-placement='right'][data-alignment='end'] {
|
|
144
|
+
inset-block-end: 0;
|
|
145
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* Implementation CSS that the contract's staticCss cannot express. */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* The caret's drawing, mirrored for right-to-left.
|
|
5
|
+
*
|
|
6
|
+
* `placement` left and right name the leading and trailing side, not two fixed
|
|
7
|
+
* points of the compass, and the chip's own `flex-direction` is already logical —
|
|
8
|
+
* `row` and `row-reverse` follow the inline direction. So the caret's *box* moves to
|
|
9
|
+
* the correct edge under RTL with nothing here to help it: a tooltip on the leading
|
|
10
|
+
* side is on the right in Arabic, and its caret lands on the left, which is the edge
|
|
11
|
+
* facing the anchor.
|
|
12
|
+
*
|
|
13
|
+
* What cannot follow is the triangle. It is one of four fixed paths in Tooltip.tsx,
|
|
14
|
+
* drawn rather than rotated because an angle is not something a contract can carry,
|
|
15
|
+
* and a path has no way to flip itself. Without this rule the box arrives on the
|
|
16
|
+
* correct edge with the point aimed away from the anchor — the one arrangement worse
|
|
17
|
+
* than having no caret at all.
|
|
18
|
+
*
|
|
19
|
+
* The inline axis only. `top` and `bottom` sit on the block axis, which right-to-left
|
|
20
|
+
* does not mirror; scaling those would take a caret that already points at its anchor
|
|
21
|
+
* and turn it around.
|
|
22
|
+
*
|
|
23
|
+
* `scale` rather than `transform`, so that a consumer's own transform on the part is
|
|
24
|
+
* not silently replaced by this one.
|
|
25
|
+
*/
|
|
26
|
+
:where([data-dds-context="marketing"]) .dds-tooltip:dir(rtl)[data-placement='left'] .dds-tooltip__caret,
|
|
27
|
+
:where([data-dds-context="marketing"]) .dds-tooltip:dir(rtl)[data-placement='right'] .dds-tooltip__caret {
|
|
28
|
+
scale: -1 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* The transform origin's inline half, mirrored for right-to-left.
|
|
33
|
+
*
|
|
34
|
+
* The chip scales up out of the edge nearest its anchor, and the contract names that
|
|
35
|
+
* edge per placement — `left` places the chip on the leading side, so the edge facing
|
|
36
|
+
* the anchor is its `right`. That holds in English and inverts in Arabic: the leading
|
|
37
|
+
* side is the right, the chip sits there, and the edge facing the anchor is its `left`.
|
|
38
|
+
*
|
|
39
|
+
* `transform-origin` has no logical keyword to say this with. It takes `left` and
|
|
40
|
+
* `right`, never `inline-start` — so unlike `flex-direction` and the logical insets in
|
|
41
|
+
* tooltip-anchor.css, the generated rule cannot follow the direction on its own, and
|
|
42
|
+
* this is the same gap the caret's path above falls into.
|
|
43
|
+
*
|
|
44
|
+
* The inline axis only, for the same reason: `top` and `bottom` sit on the block axis,
|
|
45
|
+
* which right-to-left does not mirror. Without this the chip grows out of the edge
|
|
46
|
+
* facing away from its anchor, which reads as retreating from the control it describes.
|
|
47
|
+
*/
|
|
48
|
+
:where([data-dds-context="marketing"]) .dds-tooltip:dir(rtl)[data-placement='left'] {
|
|
49
|
+
transform-origin: left;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:where([data-dds-context="marketing"]) .dds-tooltip:dir(rtl)[data-placement='right'] {
|
|
53
|
+
transform-origin: right;
|
|
54
|
+
}
|