@deriv-com/dds-marketing 1.0.1 → 1.1.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/awards.md +209 -0
- package/.llm/components/background.md +420 -0
- package/.llm/components/bottomsheet.md +5 -0
- package/.llm/components/comparisoncards.md +257 -0
- package/.llm/components/comparisontable.md +231 -0
- package/.llm/components/ctabanner.md +22 -0
- package/.llm/components/ctabannerslider.md +36 -2
- package/.llm/components/datatable.md +273 -0
- package/.llm/components/downloadbanner.md +283 -0
- package/.llm/components/featurecards.md +41 -3
- package/.llm/components/featurecardscarousel.md +311 -0
- package/.llm/components/featuresplit.md +5 -0
- package/.llm/components/featurestack.md +227 -0
- package/.llm/components/illustrationcard.md +236 -0
- package/.llm/components/illustrationscene.md +229 -0
- package/.llm/components/imagebanner.md +278 -0
- package/.llm/components/landinghero.md +24 -0
- package/.llm/components/navbar.md +1 -1
- package/.llm/components/navbaritem.md +4 -0
- package/.llm/components/pageheader.md +22 -0
- package/.llm/components/paginationdots.md +6 -1
- package/.llm/components/producthero.md +35 -11
- package/.llm/components/resourcebanner.md +247 -0
- package/.llm/components/scenescroll.md +222 -0
- package/.llm/components/select.md +17 -0
- package/.llm/components/stats.md +219 -0
- package/.llm/components/steps.md +286 -0
- package/.llm/components/stickycards.md +251 -0
- package/.llm/components/tableheadercell.md +19 -0
- package/.llm/components/teamgrid.md +243 -0
- package/.llm/components/testimonialrow.md +5 -0
- package/.llm/components/testimonialslider.md +14 -1
- package/.llm/components/textarea.md +13 -0
- package/.llm/components/textinput.md +13 -0
- package/.llm/components/textscroll.md +187 -0
- package/.llm/components/tiers.md +227 -0
- package/.llm/digest/awards.md +45 -0
- package/.llm/digest/background.md +53 -0
- package/.llm/digest/bottomsheet.md +2 -0
- package/.llm/digest/comparisoncards.md +51 -0
- package/.llm/digest/comparisontable.md +53 -0
- package/.llm/digest/ctabanner.md +4 -0
- package/.llm/digest/ctabannerslider.md +7 -0
- package/.llm/digest/datatable.md +65 -0
- package/.llm/digest/downloadbanner.md +65 -0
- package/.llm/digest/featurecards.md +1 -1
- package/.llm/digest/featurecardscarousel.md +54 -0
- package/.llm/digest/featuresplit.md +1 -0
- package/.llm/digest/featurestack.md +48 -0
- package/.llm/digest/illustrationcard.md +46 -0
- package/.llm/digest/illustrationscene.md +50 -0
- package/.llm/digest/imagebanner.md +64 -0
- package/.llm/digest/landinghero.md +7 -0
- package/.llm/digest/navbaritem.md +1 -0
- package/.llm/digest/pageheader.md +4 -0
- package/.llm/digest/paginationdots.md +3 -1
- package/.llm/digest/producthero.md +4 -2
- package/.llm/digest/resourcebanner.md +53 -0
- package/.llm/digest/scenescroll.md +49 -0
- package/.llm/digest/select.md +5 -0
- package/.llm/digest/stats.md +46 -0
- package/.llm/digest/steps.md +55 -0
- package/.llm/digest/stickycards.md +52 -0
- package/.llm/digest/tableheadercell.md +4 -0
- package/.llm/digest/teamgrid.md +53 -0
- package/.llm/digest/testimonialrow.md +2 -0
- package/.llm/digest/testimonialslider.md +4 -0
- package/.llm/digest/textarea.md +4 -0
- package/.llm/digest/textinput.md +4 -0
- package/.llm/digest/textscroll.md +43 -0
- package/.llm/digest/tiers.md +50 -0
- package/.llm/index.md +25 -2
- package/.llm/tokens.md +37 -1
- package/AGENTS.md +20 -1
- package/dist/components/awards-data.d.ts +24 -0
- package/dist/components/awards-data.js +11 -0
- package/dist/components/block-image-data.d.ts +24 -0
- package/dist/components/block-image-data.js +9 -0
- package/dist/components/blocks/awards/Awards.css +134 -0
- package/dist/components/blocks/awards/Awards.d.ts +24 -0
- package/dist/components/blocks/awards/Awards.js +114 -0
- package/dist/components/blocks/awards/Awards.types.d.ts +31 -0
- package/dist/components/blocks/awards/Awards.types.js +16 -0
- package/dist/components/blocks/awards/awards-impl.css +222 -0
- package/dist/components/blocks/cards-of.d.ts +16 -0
- package/dist/components/blocks/cards-of.js +23 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.css +195 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.d.ts +24 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.js +75 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.types.d.ts +49 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.types.js +26 -0
- package/dist/components/blocks/comparison-cards/comparison-cards-impl.css +262 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.css +111 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.d.ts +25 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.js +100 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.types.d.ts +36 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.types.js +15 -0
- package/dist/components/blocks/comparison-table/comparison-table-impl.css +143 -0
- package/dist/components/blocks/cta-banner/CtaBanner.css +1 -0
- package/dist/components/blocks/cta-banner/CtaBanner.d.ts +1 -1
- package/dist/components/blocks/cta-banner/CtaBanner.js +3 -2
- package/dist/components/blocks/cta-banner/CtaBanner.types.d.ts +6 -0
- package/dist/components/blocks/cta-banner/CtaBanner.types.js +1 -1
- package/dist/components/blocks/cta-banner/cta-banner-impl.css +8 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.css +1 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.d.ts +1 -1
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.js +10 -5
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.d.ts +12 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.js +1 -1
- package/dist/components/blocks/cta-banner-slider/cta-banner-slider-impl.css +8 -0
- package/dist/components/blocks/data-table/DataTable.css +170 -0
- package/dist/components/blocks/data-table/DataTable.d.ts +29 -0
- package/dist/components/blocks/data-table/DataTable.js +84 -0
- package/dist/components/blocks/data-table/DataTable.types.d.ts +69 -0
- package/dist/components/blocks/data-table/DataTable.types.js +19 -0
- package/dist/components/blocks/data-table/data-table-impl.css +155 -0
- package/dist/components/blocks/download-banner/DownloadBanner.css +228 -0
- package/dist/components/blocks/download-banner/DownloadBanner.d.ts +28 -0
- package/dist/components/blocks/download-banner/DownloadBanner.js +75 -0
- package/dist/components/blocks/download-banner/DownloadBanner.types.d.ts +56 -0
- package/dist/components/blocks/download-banner/DownloadBanner.types.js +23 -0
- package/dist/components/blocks/download-banner/download-banner-impl.css +216 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.css +1 -0
- package/dist/components/blocks/faq-accordion/faq-accordion-impl.css +3 -7
- package/dist/components/blocks/feature-bullets/FeatureBullets.css +1 -0
- package/dist/components/blocks/feature-bullets/feature-bullets-impl.css +14 -1
- package/dist/components/blocks/feature-cards/FeatureCards.css +1 -0
- package/dist/components/blocks/feature-cards/FeatureCards.d.ts +2 -1
- package/dist/components/blocks/feature-cards/FeatureCards.js +4 -21
- package/dist/components/blocks/feature-cards/feature-cards-impl.css +10 -9
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.css +115 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.d.ts +30 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.js +160 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.types.d.ts +52 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.types.js +17 -0
- package/dist/components/blocks/feature-cards-carousel/feature-cards-carousel-impl.css +207 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.css +1 -0
- package/dist/components/blocks/feature-split/FeatureSplit.css +1 -0
- package/dist/components/blocks/feature-split/feature-split-impl.css +14 -1
- package/dist/components/blocks/feature-stack/FeatureStack.css +86 -0
- package/dist/components/blocks/feature-stack/FeatureStack.d.ts +19 -0
- package/dist/components/blocks/feature-stack/FeatureStack.js +27 -0
- package/dist/components/blocks/feature-stack/FeatureStack.types.d.ts +34 -0
- package/dist/components/blocks/feature-stack/FeatureStack.types.js +14 -0
- package/dist/components/blocks/feature-stack/feature-stack-impl.css +87 -0
- package/dist/components/blocks/image-banner/ImageBanner.css +133 -0
- package/dist/components/blocks/image-banner/ImageBanner.d.ts +32 -0
- package/dist/components/blocks/image-banner/ImageBanner.js +41 -0
- package/dist/components/blocks/image-banner/ImageBanner.types.d.ts +54 -0
- package/dist/components/blocks/image-banner/ImageBanner.types.js +14 -0
- package/dist/components/blocks/image-banner/image-banner-impl.css +281 -0
- package/dist/components/blocks/landing-hero/LandingHero.css +1 -0
- package/dist/components/blocks/landing-hero/LandingHero.d.ts +1 -1
- package/dist/components/blocks/landing-hero/LandingHero.js +4 -3
- package/dist/components/blocks/landing-hero/LandingHero.types.d.ts +7 -3
- package/dist/components/blocks/logo-columns/LogoColumns.css +1 -0
- package/dist/components/blocks/logo-rows/LogoRows.css +1 -0
- package/dist/components/blocks/page-header/PageHeader.css +1 -0
- package/dist/components/blocks/page-header/PageHeader.d.ts +1 -1
- package/dist/components/blocks/page-header/PageHeader.js +3 -2
- package/dist/components/blocks/page-header/PageHeader.types.d.ts +6 -0
- package/dist/components/blocks/page-header/PageHeader.types.js +1 -1
- package/dist/components/blocks/page-header/page-header-impl.css +10 -0
- package/dist/components/blocks/product-hero/ProductHero.css +8 -3
- package/dist/components/blocks/product-hero/ProductHero.d.ts +1 -1
- package/dist/components/blocks/product-hero/ProductHero.js +5 -2
- package/dist/components/blocks/product-hero/ProductHero.types.d.ts +5 -1
- package/dist/components/blocks/product-hero/ProductHero.types.js +1 -0
- package/dist/components/blocks/product-hero/product-hero-impl.css +43 -12
- package/dist/components/blocks/resource-banner/ResourceBanner.css +106 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.d.ts +32 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.js +51 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.types.d.ts +44 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.types.js +14 -0
- package/dist/components/blocks/resource-banner/resource-banner-impl.css +69 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.css +93 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.d.ts +36 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.js +54 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.types.d.ts +32 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.types.js +15 -0
- package/dist/components/blocks/scene-scroll/scene-scroll-impl.css +275 -0
- package/dist/components/blocks/stats/Stats.css +139 -0
- package/dist/components/blocks/stats/Stats.d.ts +24 -0
- package/dist/components/blocks/stats/Stats.js +120 -0
- package/dist/components/blocks/stats/Stats.types.d.ts +36 -0
- package/dist/components/blocks/stats/Stats.types.js +19 -0
- package/dist/components/blocks/stats/stats-count.d.ts +34 -0
- package/dist/components/blocks/stats/stats-count.js +61 -0
- package/dist/components/blocks/stats/stats-impl.css +284 -0
- package/dist/components/blocks/stats/use-wheel.d.ts +37 -0
- package/dist/components/blocks/stats/use-wheel.js +126 -0
- package/dist/components/blocks/steps/Steps.css +202 -0
- package/dist/components/blocks/steps/Steps.d.ts +32 -0
- package/dist/components/blocks/steps/Steps.js +65 -0
- package/dist/components/blocks/steps/Steps.types.d.ts +48 -0
- package/dist/components/blocks/steps/Steps.types.js +21 -0
- package/dist/components/blocks/steps/steps-impl.css +216 -0
- package/dist/components/blocks/steps/use-turn.d.ts +33 -0
- package/dist/components/blocks/steps/use-turn.js +75 -0
- package/dist/components/blocks/sticky-cards/StickyCards.css +154 -0
- package/dist/components/blocks/sticky-cards/StickyCards.d.ts +35 -0
- package/dist/components/blocks/sticky-cards/StickyCards.js +153 -0
- package/dist/components/blocks/sticky-cards/StickyCards.types.d.ts +43 -0
- package/dist/components/blocks/sticky-cards/StickyCards.types.js +18 -0
- package/dist/components/blocks/sticky-cards/sticky-cards-impl.css +393 -0
- package/dist/components/blocks/team-grid/TeamGrid.css +159 -0
- package/dist/components/blocks/team-grid/TeamGrid.d.ts +28 -0
- package/dist/components/blocks/team-grid/TeamGrid.js +74 -0
- package/dist/components/blocks/team-grid/TeamGrid.types.d.ts +51 -0
- package/dist/components/blocks/team-grid/TeamGrid.types.js +20 -0
- package/dist/components/blocks/team-grid/team-grid-impl.css +129 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.css +1 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.d.ts +1 -1
- package/dist/components/blocks/testimonial-row/TestimonialRow.js +4 -3
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.d.ts +3 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.js +1 -1
- package/dist/components/blocks/testimonial-row/testimonial-row-impl.css +8 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.css +1 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.d.ts +1 -1
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.js +2 -2
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.d.ts +8 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.js +1 -1
- package/dist/components/blocks/text-scroll/TextScroll.css +53 -0
- package/dist/components/blocks/text-scroll/TextScroll.d.ts +5 -0
- package/dist/components/blocks/text-scroll/TextScroll.js +71 -0
- package/dist/components/blocks/text-scroll/TextScroll.types.d.ts +22 -0
- package/dist/components/blocks/text-scroll/TextScroll.types.js +10 -0
- package/dist/components/blocks/text-scroll/text-scroll-impl.css +115 -0
- package/dist/components/blocks/tiers/Tiers.css +233 -0
- package/dist/components/blocks/tiers/Tiers.d.ts +32 -0
- package/dist/components/blocks/tiers/Tiers.js +68 -0
- package/dist/components/blocks/tiers/Tiers.types.d.ts +45 -0
- package/dist/components/blocks/tiers/Tiers.types.js +25 -0
- package/dist/components/blocks/tiers/tiers-impl.css +185 -0
- package/dist/components/blocks/use-rotation.d.ts +12 -2
- package/dist/components/blocks/use-rotation.js +6 -28
- package/dist/components/comparison-cards-data.d.ts +59 -0
- package/dist/components/comparison-cards-data.js +12 -0
- package/dist/components/comparison-table-data.d.ts +39 -0
- package/dist/components/comparison-table-data.js +11 -0
- package/dist/components/core/accordion-item/AccordionItem.css +1 -5
- package/dist/components/core/background/Background.css +92 -0
- package/dist/components/core/background/Background.d.ts +27 -0
- package/dist/components/core/background/Background.js +45 -0
- package/dist/components/core/background/Background.types.d.ts +39 -0
- package/dist/components/core/background/Background.types.js +11 -0
- package/dist/components/core/background/background-impl.css +760 -0
- package/dist/components/core/background/halftone.d.ts +134 -0
- package/dist/components/core/background/halftone.js +722 -0
- package/dist/components/core/background/patterns.d.ts +66 -0
- package/dist/components/core/background/patterns.js +244 -0
- package/dist/components/core/background/shader.d.ts +44 -0
- package/dist/components/core/background/shader.js +307 -0
- package/dist/components/core/background/use-halftone.d.ts +15 -0
- package/dist/components/core/background/use-halftone.js +27 -0
- package/dist/components/core/background/use-offscreen.d.ts +10 -0
- package/dist/components/core/background/use-offscreen.js +30 -0
- package/dist/components/core/background/use-shader.d.ts +11 -0
- package/dist/components/core/background/use-shader.js +25 -0
- package/dist/components/core/background/use-spotlight.d.ts +14 -0
- package/dist/components/core/background/use-spotlight.js +73 -0
- package/dist/components/core/bottom-sheet/BottomSheet.js +2 -2
- package/dist/components/core/bottom-sheet/BottomSheet.types.d.ts +3 -1
- package/dist/components/core/breadcrumb/Breadcrumb.d.ts +1 -0
- package/dist/components/core/breadcrumb/Breadcrumb.js +1 -0
- package/dist/components/core/breadcrumb/breadcrumb-impl.css +11 -0
- package/dist/components/core/button/button-impl.css +14 -1
- package/dist/components/core/illustration-card/IllustrationCard.css +40 -0
- package/dist/components/core/illustration-card/IllustrationCard.d.ts +22 -0
- package/dist/components/core/illustration-card/IllustrationCard.js +82 -0
- package/dist/components/core/illustration-card/IllustrationCard.types.d.ts +23 -0
- package/dist/components/core/illustration-card/IllustrationCard.types.js +8 -0
- package/dist/components/core/illustration-card/illustration-card-impl.css +47 -0
- package/dist/components/core/illustration-scene/IllustrationScene.css +41 -0
- package/dist/components/core/illustration-scene/IllustrationScene.d.ts +14 -0
- package/dist/components/core/illustration-scene/IllustrationScene.js +16 -0
- package/dist/components/core/illustration-scene/IllustrationScene.types.d.ts +32 -0
- package/dist/components/core/illustration-scene/IllustrationScene.types.js +8 -0
- package/dist/components/core/illustration-scene/illustration-scene-impl.css +46 -0
- package/dist/components/core/link/Link.js +7 -3
- package/dist/components/core/link/link-impl.css +29 -2
- package/dist/components/core/navbar/Navbar.css +2 -2
- package/dist/components/core/navbar/Navbar.types.d.ts +1 -1
- package/dist/components/core/navbar-item/NavbarItem.d.ts +2 -1
- package/dist/components/core/navbar-item/NavbarItem.js +3 -10
- package/dist/components/core/navbar-item/NavbarItem.types.d.ts +4 -1
- package/dist/components/core/navbar-item/NavbarItem.types.js +1 -1
- package/dist/components/core/navbar-item/navbar-item-impl.css +10 -0
- package/dist/components/core/navbar-menu/navbar-menu-impl.css +9 -0
- package/dist/components/core/navbar-switcher/navbar-switcher-impl.css +19 -0
- package/dist/components/core/pagination/Pagination.js +1 -1
- package/dist/components/core/pagination/pagination-impl.css +9 -0
- package/dist/components/core/pagination-dots/PaginationDots.d.ts +1 -1
- package/dist/components/core/pagination-dots/PaginationDots.js +3 -3
- package/dist/components/core/pagination-dots/PaginationDots.types.d.ts +3 -1
- package/dist/components/core/segmented-control/SegmentedControl.css +4 -3
- package/dist/components/core/segmented-control/SegmentedControl.js +17 -3
- package/dist/components/core/segmented-control-item/SegmentedControlItem.css +2 -1
- package/dist/components/core/select/Select.js +3 -3
- package/dist/components/core/select/Select.types.d.ts +11 -1
- package/dist/components/core/select/Select.types.js +1 -1
- package/dist/components/core/tab-list/TabList.js +9 -1
- package/dist/components/core/table-header-cell/TableHeaderCell.d.ts +1 -1
- package/dist/components/core/table-header-cell/TableHeaderCell.js +5 -2
- package/dist/components/core/table-header-cell/TableHeaderCell.types.d.ts +7 -1
- package/dist/components/core/table-header-cell/TableHeaderCell.types.js +1 -1
- package/dist/components/core/text-area/TextArea.d.ts +1 -1
- package/dist/components/core/text-area/TextArea.js +2 -2
- package/dist/components/core/text-area/TextArea.types.d.ts +9 -1
- package/dist/components/core/text-area/TextArea.types.js +1 -1
- package/dist/components/core/text-input/TextInput.d.ts +1 -1
- package/dist/components/core/text-input/TextInput.js +2 -2
- package/dist/components/core/text-input/TextInput.types.d.ts +9 -1
- package/dist/components/core/text-input/TextInput.types.js +1 -1
- package/dist/components/data-table-data.d.ts +33 -0
- package/dist/components/data-table-data.js +12 -0
- package/dist/components/download-banner-data.d.ts +52 -0
- package/dist/components/download-banner-data.js +11 -0
- package/dist/components/index.d.ts +51 -0
- package/dist/components/index.js +38 -0
- package/dist/components/resource-banner-data.d.ts +34 -0
- package/dist/components/resource-banner-data.js +13 -0
- package/dist/components/scene-scroll-data.d.ts +24 -0
- package/dist/components/scene-scroll-data.js +9 -0
- package/dist/components/stats-data.d.ts +28 -0
- package/dist/components/stats-data.js +11 -0
- package/dist/components/steps-data.d.ts +38 -0
- package/dist/components/steps-data.js +13 -0
- package/dist/components/sticky-cards-data.d.ts +43 -0
- package/dist/components/sticky-cards-data.js +12 -0
- package/dist/components/team-grid-data.d.ts +38 -0
- package/dist/components/team-grid-data.js +11 -0
- package/dist/components/tiers-data.d.ts +47 -0
- package/dist/components/tiers-data.js +13 -0
- package/dist/marketing.css +101 -28
- package/package.json +1 -1
|
@@ -91,11 +91,24 @@
|
|
|
91
91
|
*/
|
|
92
92
|
:where([data-dds-context="marketing"]) .dds-featurebullets .dds-featurebullets__media > * {
|
|
93
93
|
block-size: 100%;
|
|
94
|
-
display: block;
|
|
95
94
|
inline-size: 100%;
|
|
96
95
|
object-fit: cover;
|
|
97
96
|
}
|
|
98
97
|
|
|
98
|
+
/*
|
|
99
|
+
* Bare media is a block; a component keeps its own display.
|
|
100
|
+
*
|
|
101
|
+
* `display: block` is for what arrives as a raw element — an image, a video, an inline SVG — which
|
|
102
|
+
* sits on a text baseline otherwise and leaves a gap under it. Written at no weight at all, so a
|
|
103
|
+
* component the page placed here — an IllustrationScene, whose grid lays its pane over its photo —
|
|
104
|
+
* keeps the display its own sheet gives it. In the rule above, a class deeper than the component's
|
|
105
|
+
* root, it turned the scene's grid into a block, and the pane fell below the photo and was clipped.
|
|
106
|
+
*/
|
|
107
|
+
:where([data-dds-context="marketing"] .dds-featurebullets .dds-featurebullets__media > *) {
|
|
108
|
+
display: block;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
99
112
|
:where([data-dds-context="marketing"]) .dds-featurebullets .dds-featurebullets__media img {
|
|
100
113
|
block-size: 100%;
|
|
101
114
|
display: block;
|
|
@@ -13,7 +13,8 @@ export type { FeatureCardsProps };
|
|
|
13
13
|
* how many cards share a row.
|
|
14
14
|
*
|
|
15
15
|
* The row is read from the cards. One column on a phone and two from the fold; at full width three,
|
|
16
|
-
* four when there are exactly four, and one
|
|
16
|
+
* four when there are exactly four, two filling the row half each, and one held to two thirds of
|
|
17
|
+
* it, centred. A card
|
|
17
18
|
* alone lays its words beside a portrait picture. The stylesheet asks all of it of the markup — the
|
|
18
19
|
* count is already there, and a prop restating it is a second place for the two to disagree.
|
|
19
20
|
*
|
|
@@ -1,31 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useId } from 'react';
|
|
4
4
|
import './FeatureCards.css';
|
|
5
5
|
import './feature-cards-impl.css';
|
|
6
6
|
import '../block-reveal.css';
|
|
7
7
|
import { given } from '../../given.js';
|
|
8
|
+
import { cardsOf } from '../cards-of.js';
|
|
8
9
|
import { arriving, useReveal } from '../use-reveal.js';
|
|
9
10
|
import { featureCardsDefaults, featureCardsParts } from './FeatureCards.types.js';
|
|
10
|
-
/**
|
|
11
|
-
* The cards, with any fragment opened out.
|
|
12
|
-
*
|
|
13
|
-
* `Children.toArray` flattens arrays and leaves a fragment whole, so a page writing
|
|
14
|
-
* `<>{cards}</>` handed over one child: every card in a single cell, and the grid reading the set
|
|
15
|
-
* as one card alone. A fragment is the page grouping its own markup, never a card, so it is opened
|
|
16
|
-
* out here and the grid counts what is inside it.
|
|
17
|
-
*/
|
|
18
|
-
function cardsOf(children, within = '') {
|
|
19
|
-
return Children.toArray(children).flatMap((child, at) => {
|
|
20
|
-
// `toArray` keys a fragment's children afresh — `.0`, `.1` — so a card is keyed by the
|
|
21
|
-
// fragment it came out of as well as its own place, or two cards from different groups share a
|
|
22
|
-
// key and React reconciles one into the other's cell.
|
|
23
|
-
const key = `${within}${isValidElement(child) && child.key !== null ? child.key : at}`;
|
|
24
|
-
return isValidElement(child) && child.type === Fragment
|
|
25
|
-
? cardsOf(child.props.children, `${key}/`)
|
|
26
|
-
: [{ key, card: child }];
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
11
|
/**
|
|
30
12
|
* Where a card comes in the arrival, capped so a long set does not keep a reader waiting.
|
|
31
13
|
*
|
|
@@ -46,7 +28,8 @@ const LAST_STEP = FIRST_CARD + 3;
|
|
|
46
28
|
* how many cards share a row.
|
|
47
29
|
*
|
|
48
30
|
* The row is read from the cards. One column on a phone and two from the fold; at full width three,
|
|
49
|
-
* four when there are exactly four, and one
|
|
31
|
+
* four when there are exactly four, two filling the row half each, and one held to two thirds of
|
|
32
|
+
* it, centred. A card
|
|
50
33
|
* alone lays its words beside a portrait picture. The stylesheet asks all of it of the markup — the
|
|
51
34
|
* count is already there, and a prop restating it is a second place for the two to disagree.
|
|
52
35
|
*
|
|
@@ -122,22 +122,23 @@
|
|
|
122
122
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
/* A pair as two columns of their own, rather than two of three with an empty third beside them
|
|
126
|
-
the
|
|
125
|
+
/* A pair as two columns of their own, rather than two of three with an empty third beside them,
|
|
126
|
+
across the whole row as three and four are — each card half of it. */
|
|
127
127
|
:where([data-dds-context="marketing"]) .dds-featurecards .dds-featurecards__grid:has(> :nth-child(2):last-child) {
|
|
128
128
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/*
|
|
132
|
-
* One
|
|
132
|
+
* One card alone holds to two thirds of the row, centred, rather than the whole of it.
|
|
133
133
|
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* the
|
|
134
|
+
* One across the full width is a banner. Two thirds is exactly two of the three columns and the
|
|
135
|
+
* gutter between them — the width a pair takes in a row of three. Computed from the row's own
|
|
136
|
+
* width and gutter rather than a fixed measure, so it follows the grid wherever the grid is.
|
|
137
|
+
*
|
|
138
|
+
* A pair is not held: it fills the row, as three and four do, so a section's cards reach the same
|
|
139
|
+
* edges whatever their number.
|
|
139
140
|
*/
|
|
140
|
-
:where([data-dds-context="marketing"]) .dds-featurecards .dds-featurecards__grid:
|
|
141
|
+
:where([data-dds-context="marketing"]) .dds-featurecards .dds-featurecards__grid:has(> :only-child) {
|
|
141
142
|
margin-inline: auto;
|
|
142
143
|
max-inline-size: calc((100% - 2 * var(--space-grid-gutter)) * 2 / 3 + var(--space-grid-gutter));
|
|
143
144
|
inline-size: 100%;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* GENERATED from featurecardscarousel.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
container-type: inline-size;
|
|
6
|
+
display: flex;
|
|
7
|
+
inline-size: 100%;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
overflow: clip;
|
|
10
|
+
overflow-wrap: anywhere;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__inner {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
inline-size: 100%;
|
|
18
|
+
min-inline-size: 0;
|
|
19
|
+
max-inline-size: var(--size-content-max);
|
|
20
|
+
padding-block: var(--space-section-default);
|
|
21
|
+
padding-inline: var(--space-inset-page);
|
|
22
|
+
row-gap: var(--space-heading-content);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__header {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
min-inline-size: 0;
|
|
29
|
+
max-inline-size: var(--size-measure-heading);
|
|
30
|
+
row-gap: var(--space-gap-none);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__title {
|
|
34
|
+
margin-block: 0;
|
|
35
|
+
text-wrap: balance;
|
|
36
|
+
font-family: var(--font-h2-family);
|
|
37
|
+
font-size: var(--font-h2-size);
|
|
38
|
+
font-weight: var(--font-h2-weight);
|
|
39
|
+
letter-spacing: var(--font-h2-letter-spacing);
|
|
40
|
+
line-height: var(--font-h2-line-height);
|
|
41
|
+
margin-block-end: var(--space-heading-title-description);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__description {
|
|
45
|
+
margin-block: 0;
|
|
46
|
+
font-family: var(--font-body-md-family);
|
|
47
|
+
font-size: var(--font-body-md-size);
|
|
48
|
+
font-weight: var(--font-body-md-weight);
|
|
49
|
+
letter-spacing: var(--font-body-md-letter-spacing);
|
|
50
|
+
line-height: var(--font-body-md-line-height);
|
|
51
|
+
max-inline-size: var(--size-measure-description);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__carousel {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
min-inline-size: 0;
|
|
58
|
+
row-gap: var(--space-gap-xl);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__track {
|
|
62
|
+
display: flex;
|
|
63
|
+
outline-style: solid;
|
|
64
|
+
column-gap: var(--space-grid-gutter);
|
|
65
|
+
outline-width: var(--border-width-none);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__item {
|
|
69
|
+
display: grid;
|
|
70
|
+
min-inline-size: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__footer {
|
|
74
|
+
align-items: center;
|
|
75
|
+
display: flex;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
column-gap: var(--space-gap-lg);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__nav {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex: none;
|
|
83
|
+
column-gap: var(--space-gap-md);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__nav-slot {
|
|
87
|
+
display: flex;
|
|
88
|
+
border-radius: var(--radius-pill);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel .dds-featurecardscarousel__track:focus-visible {
|
|
92
|
+
outline-color: var(--color-border-focus);
|
|
93
|
+
outline-width: var(--border-width-focus);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel[data-ground="page"] {
|
|
97
|
+
background-color: var(--color-bg-page);
|
|
98
|
+
color: var(--color-fg-default);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel[data-ground="strong"] {
|
|
102
|
+
background-color: var(--color-bg-brand-strong);
|
|
103
|
+
color: var(--color-fg-on-brand-strong);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel[data-ground="subtle"] {
|
|
107
|
+
background-color: var(--color-bg-page);
|
|
108
|
+
background-image: linear-gradient(var(--color-bg-band-subtle), var(--color-bg-band-subtle));
|
|
109
|
+
color: var(--color-fg-default);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:where([data-dds-context="marketing"]) .dds-featurecardscarousel[data-ground="strong"] .dds-featurecardscarousel__track:focus-visible {
|
|
113
|
+
outline-color: var(--color-border-focus-on-brand-strong);
|
|
114
|
+
}
|
|
115
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import './FeatureCardsCarousel.css';
|
|
2
|
+
import './feature-cards-carousel-impl.css';
|
|
3
|
+
import '../block-reveal.css';
|
|
4
|
+
import { type FeatureCardsCarouselProps } from './FeatureCardsCarousel.types.js';
|
|
5
|
+
export type { FeatureCardsCarouselProps };
|
|
6
|
+
/**
|
|
7
|
+
* A heading over a row of the page's own cards, moved along a stop at a time — the reference site's
|
|
8
|
+
* FeatureCardsCarousel.
|
|
9
|
+
*
|
|
10
|
+
* The cards are Card or CardButton with a CardBody inside, as in FeatureCards: a card's fill, its
|
|
11
|
+
* picture and where it leads are the card's, so the reference's coral, dark and light slides are
|
|
12
|
+
* Card's accent, accent-strong and surface-light, and its cover picture is CardBody's overMedia.
|
|
13
|
+
* What this decides is the heading, the row and the way along it.
|
|
14
|
+
*
|
|
15
|
+
* The browser does the scrolling and the snapping, TestimonialRow's way; this reads where the row
|
|
16
|
+
* is. A stop is a card's start, until the last few cards are all in view — those share the last
|
|
17
|
+
* stop, the row's end, so the row never scrolls into empty space and there are fewer dots than
|
|
18
|
+
* cards at full width. The dots say which stop the row is at and move to any one pressed; the
|
|
19
|
+
* arrows step one either way.
|
|
20
|
+
*
|
|
21
|
+
* Autoplay is off unless asked for. On, PaginationDots holds the clock, as it does for every block
|
|
22
|
+
* that rotates: each motion.duration.dwell it reports the next stop, wrapping from the last to the
|
|
23
|
+
* first, and this scrolls there. It holds while the pointer is over the band or focus is inside it,
|
|
24
|
+
* never runs for a reader who asked for less motion, and stops for good once the reader presses
|
|
25
|
+
* anything in the band or swipes the row.
|
|
26
|
+
*
|
|
27
|
+
* `'use client'` for the row's position, the clock, the arrival, and `useId`, which names the
|
|
28
|
+
* region by its heading.
|
|
29
|
+
*/
|
|
30
|
+
export declare function FeatureCardsCarousel({ ground, title, description, autoplay, label, previousLabel, nextLabel, controlsLabel, stopLabel, children, }: FeatureCardsCarouselProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useId, useRef, useState } from 'react';
|
|
4
|
+
import { ChevronLeftRegularIcon, ChevronRightRegularIcon } from '@deriv-com/quill-icons-web';
|
|
5
|
+
import './FeatureCardsCarousel.css';
|
|
6
|
+
import './feature-cards-carousel-impl.css';
|
|
7
|
+
import '../block-reveal.css';
|
|
8
|
+
import { given } from '../../given.js';
|
|
9
|
+
import { ButtonIcon } from '../../core/button-icon/ButtonIcon.js';
|
|
10
|
+
import { PaginationDots } from '../../core/pagination-dots/PaginationDots.js';
|
|
11
|
+
import { cardsOf } from '../cards-of.js';
|
|
12
|
+
import { arriving, useReveal } from '../use-reveal.js';
|
|
13
|
+
import { featureCardsCarouselDefaults, featureCardsCarouselParts, } from './FeatureCardsCarousel.types.js';
|
|
14
|
+
/** Close enough to an end to call it the end: a snapped row can rest a pixel short of it. */
|
|
15
|
+
const AT_END = 2;
|
|
16
|
+
const OPENING = { stops: 1, current: 0, back: false, on: true };
|
|
17
|
+
/**
|
|
18
|
+
* The row's own measures, read rather than assumed: one card and the gap after it, and how far the
|
|
19
|
+
* row can scroll at all.
|
|
20
|
+
*/
|
|
21
|
+
function measure(row) {
|
|
22
|
+
const card = row.firstElementChild;
|
|
23
|
+
const gap = Number.parseFloat(getComputedStyle(row).columnGap) || 0;
|
|
24
|
+
return {
|
|
25
|
+
step: (card?.offsetWidth ?? row.clientWidth) + gap,
|
|
26
|
+
furthest: Math.max(0, row.scrollWidth - row.clientWidth),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A heading over a row of the page's own cards, moved along a stop at a time — the reference site's
|
|
31
|
+
* FeatureCardsCarousel.
|
|
32
|
+
*
|
|
33
|
+
* The cards are Card or CardButton with a CardBody inside, as in FeatureCards: a card's fill, its
|
|
34
|
+
* picture and where it leads are the card's, so the reference's coral, dark and light slides are
|
|
35
|
+
* Card's accent, accent-strong and surface-light, and its cover picture is CardBody's overMedia.
|
|
36
|
+
* What this decides is the heading, the row and the way along it.
|
|
37
|
+
*
|
|
38
|
+
* The browser does the scrolling and the snapping, TestimonialRow's way; this reads where the row
|
|
39
|
+
* is. A stop is a card's start, until the last few cards are all in view — those share the last
|
|
40
|
+
* stop, the row's end, so the row never scrolls into empty space and there are fewer dots than
|
|
41
|
+
* cards at full width. The dots say which stop the row is at and move to any one pressed; the
|
|
42
|
+
* arrows step one either way.
|
|
43
|
+
*
|
|
44
|
+
* Autoplay is off unless asked for. On, PaginationDots holds the clock, as it does for every block
|
|
45
|
+
* that rotates: each motion.duration.dwell it reports the next stop, wrapping from the last to the
|
|
46
|
+
* first, and this scrolls there. It holds while the pointer is over the band or focus is inside it,
|
|
47
|
+
* never runs for a reader who asked for less motion, and stops for good once the reader presses
|
|
48
|
+
* anything in the band or swipes the row.
|
|
49
|
+
*
|
|
50
|
+
* `'use client'` for the row's position, the clock, the arrival, and `useId`, which names the
|
|
51
|
+
* region by its heading.
|
|
52
|
+
*/
|
|
53
|
+
export function FeatureCardsCarousel({ ground = featureCardsCarouselDefaults.ground, title, description, autoplay = featureCardsCarouselDefaults.autoplay, label = featureCardsCarouselDefaults.label, previousLabel = featureCardsCarouselDefaults.previousLabel, nextLabel = featureCardsCarouselDefaults.nextLabel, controlsLabel = featureCardsCarouselDefaults.controlsLabel, stopLabel = featureCardsCarouselDefaults.stopLabel, children, }) {
|
|
54
|
+
const titleId = useId();
|
|
55
|
+
const [band, revealed] = useReveal();
|
|
56
|
+
const row = useRef(null);
|
|
57
|
+
const back = useRef(null);
|
|
58
|
+
const on = useRef(null);
|
|
59
|
+
const [place, setPlace] = useState(OPENING);
|
|
60
|
+
// The same answer, read outside a render: the focus hand-off below compares against it, and a
|
|
61
|
+
// state updater is no place for a side effect — React may call one twice.
|
|
62
|
+
const was = useRef(place);
|
|
63
|
+
/*
|
|
64
|
+
A pointer over the band or focus inside it holds the clock for as long as it lasts; a press or a
|
|
65
|
+
swipe stops it for good — CtaBannerSlider's rules, the WAI carousel pattern's. PaginationDots
|
|
66
|
+
keeps its own stop for a dot pressed; these cover the rest of the band.
|
|
67
|
+
*/
|
|
68
|
+
const [held, setHeld] = useState(false);
|
|
69
|
+
const [stopped, setStopped] = useState(false);
|
|
70
|
+
const cards = cardsOf(children);
|
|
71
|
+
const read = useCallback(() => {
|
|
72
|
+
const element = row.current;
|
|
73
|
+
if (element === null)
|
|
74
|
+
return;
|
|
75
|
+
const { step, furthest } = measure(element);
|
|
76
|
+
// `abs`, because a right-to-left row counts its scroll position down from zero.
|
|
77
|
+
const at = Math.abs(element.scrollLeft);
|
|
78
|
+
const stops = furthest <= AT_END || step <= 0 ? 1 : Math.ceil((furthest - AT_END) / step) + 1;
|
|
79
|
+
const current = at >= furthest - AT_END ? stops - 1 : Math.min(stops - 1, Math.round(at / step));
|
|
80
|
+
const next = { stops, current, back: at > AT_END, on: at < furthest - AT_END };
|
|
81
|
+
const before = was.current;
|
|
82
|
+
if (before.stops === next.stops &&
|
|
83
|
+
before.current === next.current &&
|
|
84
|
+
before.back === next.back &&
|
|
85
|
+
before.on === next.on) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
// An arrow pressed to the end of the row is about to go inert with focus on it, which drops
|
|
89
|
+
// focus to the page. Hand it to the other arrow first, which has somewhere to go.
|
|
90
|
+
const focused = document.activeElement;
|
|
91
|
+
if (before.on && !next.on && on.current?.contains(focused))
|
|
92
|
+
back.current?.querySelector('button')?.focus();
|
|
93
|
+
if (before.back && !next.back && back.current?.contains(focused))
|
|
94
|
+
on.current?.querySelector('button')?.focus();
|
|
95
|
+
was.current = next;
|
|
96
|
+
setPlace(next);
|
|
97
|
+
}, []);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
const element = row.current;
|
|
100
|
+
if (element === null)
|
|
101
|
+
return;
|
|
102
|
+
read();
|
|
103
|
+
// Asked defensively: a renderer with no ResizeObserver measures once, on mount.
|
|
104
|
+
if (typeof ResizeObserver === 'undefined')
|
|
105
|
+
return;
|
|
106
|
+
const watching = new ResizeObserver(read);
|
|
107
|
+
watching.observe(element);
|
|
108
|
+
return () => watching.disconnect();
|
|
109
|
+
// The count too: a page that swaps the set at the same width leaves the row's own box the size
|
|
110
|
+
// it was, so nothing above would fire, and the dots would describe the old set.
|
|
111
|
+
}, [read, cards.length]);
|
|
112
|
+
// Nothing to show is nothing drawn: a named region with no card in it leads nowhere.
|
|
113
|
+
if (cards.length === 0)
|
|
114
|
+
return null;
|
|
115
|
+
/** Scroll the row to a stop: a card's start, or the row's end for the last. */
|
|
116
|
+
const go = (to) => {
|
|
117
|
+
const element = row.current;
|
|
118
|
+
if (element === null)
|
|
119
|
+
return;
|
|
120
|
+
const { step, furthest } = measure(element);
|
|
121
|
+
const stop = Math.min(Math.max(0, to), place.stops - 1);
|
|
122
|
+
const left = stop >= place.stops - 1 ? furthest : stop * step;
|
|
123
|
+
const style = getComputedStyle(element);
|
|
124
|
+
const still = typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
125
|
+
element.scrollTo({
|
|
126
|
+
left: left * (style.direction === 'rtl' ? -1 : 1),
|
|
127
|
+
behavior: still ? 'auto' : 'smooth',
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
const scrolls = place.back || place.on;
|
|
131
|
+
// Button's secondary, as a circle; on the dark band its inverse tone turns the tint white.
|
|
132
|
+
const arrow = { variant: 'secondary', tone: ground === 'strong' ? 'inverse' : 'default' };
|
|
133
|
+
// Any primary press in the band stops the clock; the press itself still does what it does.
|
|
134
|
+
const press = (event) => {
|
|
135
|
+
if (event.isPrimary && (event.pointerType !== 'mouse' || event.button === 0))
|
|
136
|
+
setStopped(true);
|
|
137
|
+
};
|
|
138
|
+
return (_jsx("section", { className: featureCardsCarouselParts.root, "data-ground": ground, "aria-labelledby": titleId, onPointerEnter: (event) => {
|
|
139
|
+
if (event.pointerType === 'mouse')
|
|
140
|
+
setHeld(true);
|
|
141
|
+
}, onPointerLeave: (event) => {
|
|
142
|
+
if (event.pointerType === 'mouse')
|
|
143
|
+
setHeld(false);
|
|
144
|
+
}, onPointerDownCapture: press,
|
|
145
|
+
// A keyboard press on an arrow is a press too; a pointer's has already stopped it.
|
|
146
|
+
onClickCapture: () => setStopped(true), onFocus: () => setHeld(true), onBlur: (event) => {
|
|
147
|
+
// Held while focus is anywhere inside, released only when it leaves the band altogether.
|
|
148
|
+
if (!event.currentTarget.contains(event.relatedTarget))
|
|
149
|
+
setHeld(false);
|
|
150
|
+
}, children: _jsxs("div", { className: featureCardsCarouselParts.inner, ref: band, "data-revealed": revealed, children: [_jsxs("div", { className: featureCardsCarouselParts.header, children: [_jsx("h2", { className: featureCardsCarouselParts.title, id: titleId, ...arriving(0), children: title }), given(description) ? (_jsx("p", { className: featureCardsCarouselParts.description, ...arriving(1), children: description })) : null] }), _jsxs("div", { className: featureCardsCarouselParts.carousel, children: [_jsx("div", { ref: row, className: featureCardsCarouselParts.track, role: "group", "aria-label": label, tabIndex: 0, onScroll: read, ...arriving(2), children: cards.map(({ key, card }) => (
|
|
151
|
+
/* Each card in a place of its own, so the card is the page's element and keeps its
|
|
152
|
+
own transitions; the place is what takes the row's measure. */
|
|
153
|
+
_jsx("div", { className: featureCardsCarouselParts.item, children: card }, key))) }), cards.length > 1 ? (_jsxs("div", { className: featureCardsCarouselParts.footer, hidden: !scrolls, ...arriving(3), children: [_jsx(PaginationDots
|
|
154
|
+
// The coral marks on the page's own white, and the band's ink on a painted one —
|
|
155
|
+
// PaginationDots' own ruling on where its accent belongs.
|
|
156
|
+
, {
|
|
157
|
+
// The coral marks on the page's own white, and the band's ink on a painted one —
|
|
158
|
+
// PaginationDots' own ruling on where its accent belongs.
|
|
159
|
+
variant: ground === 'page' ? 'accent' : 'default', page: place.current + 1, totalPages: place.stops, onPageChange: (page) => go(page - 1), autoplay: autoplay, paused: held || stopped, label: controlsLabel, itemLabel: stopLabel }), _jsxs("div", { className: featureCardsCarouselParts.nav, children: [_jsx("span", { ref: back, className: featureCardsCarouselParts['nav-slot'], "data-available": place.back, inert: !place.back, children: _jsx(ButtonIcon, { icon: _jsx(ChevronLeftRegularIcon, {}), label: previousLabel, ...arrow, onClick: () => go(place.current - 1) }) }), _jsx("span", { ref: on, className: featureCardsCarouselParts['nav-slot'], "data-available": place.on, inert: !place.on, children: _jsx(ButtonIcon, { icon: _jsx(ChevronRightRegularIcon, {}), label: nextLabel, ...arrow, onClick: () => go(place.current + 1) }) })] })] })) : null] })] }) }));
|
|
160
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface FeatureCardsCarouselOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `page` — The default, and the page's own white. A section that has nothing to separate itself from what is above it — most of them — and the ground a reader is already on
|
|
5
|
+
* `subtle` — A quiet step off the page, for a band that wants to read as its own section without changing the page's voice. The one to reach for first when two sections need telling apart. A light card — surface-light — turns white on it, color.bg.surface-card-light-raised, because its own gray.50 is the band's and would vanish into it. A dark card — accent-strong — is lifted to color.bg.surface-card-strong-raised, a step lighter in dark mode, where the band is within a shade of its gray.900. A plain surface card is raised off it the same way, to color.bg.surface-card-raised, because the recessed fill is the band's gray too. Painted as the band's tint laid over the page's own ground, so it is the same grey whatever is behind the section — in dark mode the tint alone took on whatever it was set against, and on a light surface it was light ink on white.
|
|
6
|
+
* `strong` — `color.bg.brand-strong`, the dark band. It stops the page rather than dividing it, so it is for a section a reader should arrive at — and one per page is usually one more than enough. The coloured cards keep their own grounds on it; a neutral card — surface or surface-raised — turns to Card's inverse fill and white ink, and a plain card takes the white ink alone, because their own would be dark ink on near-black; an eyebrow inside any of them takes the band's quieter ink
|
|
7
|
+
*/
|
|
8
|
+
ground?: 'page' | 'subtle' | 'strong';
|
|
9
|
+
/** Always. What the cards are, in the fewest words that name them — "What you get", "Built for every trader". */
|
|
10
|
+
title: string;
|
|
11
|
+
/** A line saying what the set has in common, when the title alone does not. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Whether the row moves on to the next stop on its own, holding each for motion.duration.dwell and returning to the start after the last. Off by default, so a row nobody configured stays still. On, it holds while the pointer is over the band or focus is inside it, never moves for a reader who asked for less motion, and stops for good once the reader presses anything in it — a card, an arrow, a dot — or swipes the row: the WAI carousel pattern's rule that a reader who has touched it is reading, not watching. That gives a reader a way to stop it, which WCAG 2.2.2 asks for, but not a visible one, as in CtaBannerSlider: a page that needs 2.2.2 met plainly should leave it off. */
|
|
14
|
+
autoplay?: boolean;
|
|
15
|
+
/** The name the row is announced by. The row is a scrolling region a keyboard has to be able to reach, so it carries a tab stop and a name of its own — Scroller's rule, as in TestimonialRow. Its own name rather than the section's, so a screen reader moving into it hears what it is. Translate it with the page. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** The accessible name of the arrow stepping the row back. A glyph announces nothing, so this is the whole of the control's name. Translate it with the page, and keep it parallel to nextLabel. */
|
|
18
|
+
previousLabel?: string;
|
|
19
|
+
/** The accessible name of the arrow stepping the row on, for the reason previousLabel exists. */
|
|
20
|
+
nextLabel?: string;
|
|
21
|
+
/** The name the dots are announced by, as a group inside the band. Its own name rather than the row's, so a screen reader moving into the dots hears what they are. Translate it with the page, like label. */
|
|
22
|
+
controlsLabel?: string;
|
|
23
|
+
/** The word each dot is announced by, before its number — "Position 2". A dot is a place the row stops, not a card: at full width the last few cards share the last stop, so there are fewer dots than cards. Translate it with the page, as controlsLabel is. */
|
|
24
|
+
stopLabel?: string;
|
|
25
|
+
/** Allowed: Card, CardButton */
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export type FeatureCardsCarouselProps = FeatureCardsCarouselOwnProps;
|
|
29
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
30
|
+
export declare const featureCardsCarouselParts: {
|
|
31
|
+
readonly root: "dds-featurecardscarousel";
|
|
32
|
+
readonly inner: "dds-featurecardscarousel__inner";
|
|
33
|
+
readonly header: "dds-featurecardscarousel__header";
|
|
34
|
+
readonly title: "dds-featurecardscarousel__title";
|
|
35
|
+
readonly description: "dds-featurecardscarousel__description";
|
|
36
|
+
readonly carousel: "dds-featurecardscarousel__carousel";
|
|
37
|
+
readonly track: "dds-featurecardscarousel__track";
|
|
38
|
+
readonly item: "dds-featurecardscarousel__item";
|
|
39
|
+
readonly footer: "dds-featurecardscarousel__footer";
|
|
40
|
+
readonly nav: "dds-featurecardscarousel__nav";
|
|
41
|
+
readonly 'nav-slot': "dds-featurecardscarousel__nav-slot";
|
|
42
|
+
};
|
|
43
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
44
|
+
export declare const featureCardsCarouselDefaults: {
|
|
45
|
+
readonly ground: "page";
|
|
46
|
+
readonly autoplay: false;
|
|
47
|
+
readonly label: "Features";
|
|
48
|
+
readonly previousLabel: "Previous cards";
|
|
49
|
+
readonly nextLabel: "Next cards";
|
|
50
|
+
readonly controlsLabel: "Positions";
|
|
51
|
+
readonly stopLabel: "Position";
|
|
52
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// GENERATED from feature-cards-carousel.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const featureCardsCarouselParts = {
|
|
4
|
+
root: 'dds-featurecardscarousel',
|
|
5
|
+
inner: 'dds-featurecardscarousel__inner',
|
|
6
|
+
header: 'dds-featurecardscarousel__header',
|
|
7
|
+
title: 'dds-featurecardscarousel__title',
|
|
8
|
+
description: 'dds-featurecardscarousel__description',
|
|
9
|
+
carousel: 'dds-featurecardscarousel__carousel',
|
|
10
|
+
track: 'dds-featurecardscarousel__track',
|
|
11
|
+
item: 'dds-featurecardscarousel__item',
|
|
12
|
+
footer: 'dds-featurecardscarousel__footer',
|
|
13
|
+
nav: 'dds-featurecardscarousel__nav',
|
|
14
|
+
'nav-slot': 'dds-featurecardscarousel__nav-slot',
|
|
15
|
+
};
|
|
16
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
17
|
+
export const featureCardsCarouselDefaults = { ground: 'page', autoplay: false, label: 'Features', previousLabel: 'Previous cards', nextLabel: 'Next cards', controlsLabel: 'Positions', stopLabel: 'Position' };
|