@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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { given } from '../../given.js';
|
|
5
|
+
import { Card } from '../../core/card/Card.js';
|
|
6
|
+
import { Table } from '../../core/table/Table.js';
|
|
7
|
+
import { TableHead } from '../../core/table-head/TableHead.js';
|
|
8
|
+
import { TableBody } from '../../core/table-body/TableBody.js';
|
|
9
|
+
import { TableRow } from '../../core/table-row/TableRow.js';
|
|
10
|
+
import { TableCell } from '../../core/table-cell/TableCell.js';
|
|
11
|
+
import { TableHeaderCell } from '../../core/table-header-cell/TableHeaderCell.js';
|
|
12
|
+
import { tableCellParts } from '../../core/table-cell/TableCell.types.js';
|
|
13
|
+
import { arriving, useReveal } from '../use-reveal.js';
|
|
14
|
+
import './ComparisonTable.css';
|
|
15
|
+
import './comparison-table-impl.css';
|
|
16
|
+
import '../block-reveal.css';
|
|
17
|
+
import { comparisonTableDefaults, comparisonTableParts, } from './ComparisonTable.types.js';
|
|
18
|
+
/** The most columns drawn: the labels and three options. A fourth option is a column too narrow to read. */
|
|
19
|
+
const MOST = 4;
|
|
20
|
+
/**
|
|
21
|
+
* The Card for each ground. Card's own `surface` on the page; raised on the grey band, whose grey
|
|
22
|
+
* the plain surface would be; and turned round on the dark band, where a surface made for a light
|
|
23
|
+
* page would be dark words on near-black. The block knows its ground and the card does not, so the
|
|
24
|
+
* answer is here — FeatureCards' and ComparisonCards' rule for the same card.
|
|
25
|
+
*/
|
|
26
|
+
const SURFACE = {
|
|
27
|
+
page: { variant: 'surface', tone: 'default' },
|
|
28
|
+
subtle: { variant: 'surface-raised', tone: 'default' },
|
|
29
|
+
strong: { variant: 'surface', tone: 'inverse' },
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A row's label, as the header of its row.
|
|
33
|
+
*
|
|
34
|
+
* The page's table has a header cell for a column and none for a row: TableHeaderCell is scoped to
|
|
35
|
+
* its column and holds its name on one line, and TableCell is a value, a `td`. So the label is
|
|
36
|
+
* TableCell's own cell rendered as a `th` scoped to its row — its class and the size, rule and
|
|
37
|
+
* wrapping the row hands every cell it holds — and the Table's sheet draws it exactly as it draws
|
|
38
|
+
* the values beside it. Nothing about its measure is restated here; what is this block's is the
|
|
39
|
+
* weight, which the contract binds on the part.
|
|
40
|
+
*
|
|
41
|
+
* It takes what TableRow clones onto each cell and spells it as the data the sheet reads, rather
|
|
42
|
+
* than letting it reach the element as attributes a `th` does not have.
|
|
43
|
+
*/
|
|
44
|
+
function RowHeader({ size = 'md', dividers = 'rows', overflow = 'wrap', children, }) {
|
|
45
|
+
return (_jsx("th", { scope: "row", className: `${tableCellParts.root} ${comparisonTableParts['row-header']}`, "data-size": size, "data-align": "start", "data-numeric": "false", "data-dividers": dividers, "data-overflow": overflow, children: children }));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* One cell's words. A single line is text; several are a list, so a screen reader says how many
|
|
49
|
+
* there are and reads each as its own line rather than running a schedule's sessions together as
|
|
50
|
+
* one sentence. A list of one is the line it holds, and an empty list is an empty cell.
|
|
51
|
+
*
|
|
52
|
+
* `role="list"` spelled out: Safari drops a list's role once its markers are styled away, and the
|
|
53
|
+
* count is half of what the list tells a reader.
|
|
54
|
+
*/
|
|
55
|
+
function Lines({ value }) {
|
|
56
|
+
const lines = (Array.isArray(value) ? value : [value]).filter((line) => given(line));
|
|
57
|
+
if (lines.length === 0)
|
|
58
|
+
return null;
|
|
59
|
+
// Each line isolated, so a value keeps its own order in a right-to-left table: a sign or a
|
|
60
|
+
// range is neutral there, and "-3.00" came out "3.00-". Text in a right-to-left script still
|
|
61
|
+
// reads right to left — an isolate takes its direction from what it holds.
|
|
62
|
+
if (lines.length === 1)
|
|
63
|
+
return _jsx("bdi", { children: lines[0] });
|
|
64
|
+
return (_jsx("ul", { className: comparisonTableParts['cell-list'], role: "list", children: lines.map((line, at) => (
|
|
65
|
+
// A line's place is its identity: the cell is the page's copy, and nothing reorders it.
|
|
66
|
+
_jsx("li", { children: _jsx("bdi", { children: line }) }, at))) }));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A heading over a short comparison table — the reference site's DynamicTable, named for its job.
|
|
70
|
+
*
|
|
71
|
+
* Nothing is drawn here that the page already has. The card is the page's own Card and the grid is
|
|
72
|
+
* the page's own Table — its head, body, rows and cells — so the corner, the rules, a cell's inset
|
|
73
|
+
* and the scroll on a phone are theirs. What is this block's is the section around them and the
|
|
74
|
+
* three things the reference asks of the table that its props do not reach: the light band under
|
|
75
|
+
* the column names, the bold first column, and the columns' share of a card that scrolls rather
|
|
76
|
+
* than squeezes. The first is the impl sheet's, the second the row header above, the third a column
|
|
77
|
+
* count handed to the sheet as a custom property, FeatureScroll's way of passing a count.
|
|
78
|
+
*
|
|
79
|
+
* Its columns and rows are records rather than children, the way ComparisonCards takes its cards:
|
|
80
|
+
* every row has to be drawn against the same columns, which the block cannot check inside rows it
|
|
81
|
+
* was handed whole. Only the first four columns are drawn, the reference's own ceiling.
|
|
82
|
+
*
|
|
83
|
+
* It arrives the way every block does: the heading and the line, then the table, then its note.
|
|
84
|
+
* `'use client'` for that, for `useId`, which names the region by its heading — and because Table,
|
|
85
|
+
* which it composes, is a client component already.
|
|
86
|
+
*/
|
|
87
|
+
export function ComparisonTable({ ground = comparisonTableDefaults.ground, title, description, columns, rows, footnote, }) {
|
|
88
|
+
const titleId = useId();
|
|
89
|
+
const [band, revealed] = useReveal();
|
|
90
|
+
const shown = columns.slice(0, MOST);
|
|
91
|
+
const [labels, ...options] = shown;
|
|
92
|
+
// Nothing to compare is nothing drawn: a named region holding no row or no option leads nowhere.
|
|
93
|
+
if (labels === undefined || options.length === 0 || rows.length === 0)
|
|
94
|
+
return null;
|
|
95
|
+
// How many columns share the card, which the sheet multiplies into the table's narrowest width.
|
|
96
|
+
const count = { '--dds-comparisontable-columns': shown.length };
|
|
97
|
+
return (_jsx("section", { className: comparisonTableParts.root, "data-ground": ground, "aria-labelledby": titleId, children: _jsxs("div", { className: comparisonTableParts.inner, ref: band, "data-revealed": revealed, children: [_jsxs("div", { className: comparisonTableParts.header, children: [_jsx("h2", { className: comparisonTableParts.title, id: titleId, ...arriving(0), children: title }), given(description) ? (_jsx("p", { className: comparisonTableParts.description, ...arriving(1), children: description })) : null] }), _jsxs("div", { className: comparisonTableParts.body, children: [_jsx(Card, { ...SURFACE[ground], ...arriving(2), children: _jsxs(Table, { "aria-label": title, layout: "fixed", hoverable: false, headerCase: "title", style: count, children: [_jsx(TableHead, { children: _jsx(TableRow, { children: shown.map((column, at) => (
|
|
98
|
+
// A column's place is its identity; keys are the page's and may repeat a label.
|
|
99
|
+
_jsx(TableHeaderCell, { children: column.label }, at))) }) }), _jsx(TableBody, { children: rows.map((row, at) => (_jsxs(TableRow, { children: [_jsx(RowHeader, { children: row.label }), options.map((column, place) => (_jsx(TableCell, { children: _jsx(Lines, { value: row.values[column.key] }) }, place)))] }, at))) })] }) }), given(footnote) ? (_jsx("p", { className: comparisonTableParts.footnote, ...arriving(3), children: footnote })) : null] })] }) }));
|
|
100
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ComparisonTableColumn, ComparisonTableRow } from '../../comparison-table-data.js';
|
|
2
|
+
export interface ComparisonTableOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `page` — The default, and the page's own white. The card is the recessed surface on it, Card's own `surface`, so it has an edge
|
|
5
|
+
* `subtle` — The grey band, the reference design's ground for this section. The card is raised to color.bg.surface-card-raised on it — white in light — because its own fill is the band's grey. Painted as the band's tint over the page's own ground, so it is the same grey whatever is behind the section
|
|
6
|
+
* `strong` — `color.bg.brand-strong`, the dark band, for a section a reader should arrive at. The heading and the line under it turn white; the card turns to Card's inverse surface with white ink, its header band and rules to the band's own white veils
|
|
7
|
+
*/
|
|
8
|
+
ground?: 'page' | 'subtle' | 'strong';
|
|
9
|
+
/** Always. What is being compared, in the fewest words that name it — "MT5 on every device", "Web terminal or desktop app?". It names the section and the table's scroll region both. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** A line saying what the options have in common, or what the reader is choosing between, when the title alone does not. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Always. The columns, in reading order: first the labels' own — its `label` names what the rows are, "Features" — then the two or three options being compared, each with the `key` its values are filed under in every row and the `label` written over it. Only the first four are drawn; the columns share the card's width equally. */
|
|
14
|
+
columns: ComparisonTableColumn[];
|
|
15
|
+
/** Always. The rows, in reading order — each with its `label`, drawn as the row's header in the first column, and its `values` filed under the columns' keys. A value is one line, or a list of short lines that is drawn as a list. Keep them few enough to read without paging: a handful to a dozen. An empty list draws nothing. */
|
|
16
|
+
rows: ComparisonTableRow[];
|
|
17
|
+
/** A note true of the whole table — where the figures come from, what an asterisk means — under the card in small type. */
|
|
18
|
+
footnote?: string;
|
|
19
|
+
}
|
|
20
|
+
export type ComparisonTableProps = ComparisonTableOwnProps;
|
|
21
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
22
|
+
export declare const comparisonTableParts: {
|
|
23
|
+
readonly root: "dds-comparisontable";
|
|
24
|
+
readonly inner: "dds-comparisontable__inner";
|
|
25
|
+
readonly header: "dds-comparisontable__header";
|
|
26
|
+
readonly title: "dds-comparisontable__title";
|
|
27
|
+
readonly description: "dds-comparisontable__description";
|
|
28
|
+
readonly body: "dds-comparisontable__body";
|
|
29
|
+
readonly 'row-header': "dds-comparisontable__row-header";
|
|
30
|
+
readonly 'cell-list': "dds-comparisontable__cell-list";
|
|
31
|
+
readonly footnote: "dds-comparisontable__footnote";
|
|
32
|
+
};
|
|
33
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
34
|
+
export declare const comparisonTableDefaults: {
|
|
35
|
+
readonly ground: "page";
|
|
36
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// GENERATED from comparison-table.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const comparisonTableParts = {
|
|
4
|
+
root: 'dds-comparisontable',
|
|
5
|
+
inner: 'dds-comparisontable__inner',
|
|
6
|
+
header: 'dds-comparisontable__header',
|
|
7
|
+
title: 'dds-comparisontable__title',
|
|
8
|
+
description: 'dds-comparisontable__description',
|
|
9
|
+
body: 'dds-comparisontable__body',
|
|
10
|
+
'row-header': 'dds-comparisontable__row-header',
|
|
11
|
+
'cell-list': 'dds-comparisontable__cell-list',
|
|
12
|
+
footnote: 'dds-comparisontable__footnote',
|
|
13
|
+
};
|
|
14
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
15
|
+
export const comparisonTableDefaults = { ground: 'page' };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Scoped to this package, like the generated sheet beside it.
|
|
3
|
+
*
|
|
4
|
+
* Most of what is here is the page's Table, drawn the way the reference's comparison asks and its
|
|
5
|
+
* props do not reach. The block knows its ground and the table does not, so the answers are here
|
|
6
|
+
* rather than in Table — FaqAccordion's arrangement with the Accordion it holds.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* The header starts on a phone and is centred once the band is wide enough to hold a line.
|
|
11
|
+
*
|
|
12
|
+
* FeatureCards' rule and its reason: the table is stacked content under the heading, so a centred
|
|
13
|
+
* heading is symmetric with it — but centred text starts every line at a different edge, which
|
|
14
|
+
* costs a great deal across a phone's measure. The header and its line are capped narrower than the
|
|
15
|
+
* column, so `margin-inline: auto` is what centres those boxes rather than their words. The footnote
|
|
16
|
+
* stays at the start edge, with the cells it is a note on.
|
|
17
|
+
*
|
|
18
|
+
* `48rem` longhand because `var()` is not permitted in a container query condition, and it is the
|
|
19
|
+
* width the rest of this package folds at.
|
|
20
|
+
*/
|
|
21
|
+
@container (min-width: 48rem) {
|
|
22
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-comparisontable__header {
|
|
23
|
+
align-items: center;
|
|
24
|
+
margin-inline: auto;
|
|
25
|
+
text-align: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-comparisontable__description {
|
|
29
|
+
margin-inline: auto;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* The columns keep a readable width, and the card scrolls rather than squeezes them.
|
|
35
|
+
*
|
|
36
|
+
* The reference's phone: a table of three or four equal columns on a screen a third as wide sets
|
|
37
|
+
* every value a word to a line, so it holds a narrowest width and scrolls across inside its card.
|
|
38
|
+
* Table's root is already the scroll region, with the tab stop a keyboard needs to reach what is off
|
|
39
|
+
* the edge, so all this sets is the width it scrolls over — size.grid.track-sm, the narrowest a grid
|
|
40
|
+
* track goes before it drops a column, once per column. The count is the component's, handed over
|
|
41
|
+
* as `--dds-comparisontable-columns`, the one thing the sheet cannot read from the markup. From the
|
|
42
|
+
* fold the card is wider than that and nothing scrolls.
|
|
43
|
+
*
|
|
44
|
+
* The ink is the card's rather than the table's. Table draws its grid in color.fg.default, which is
|
|
45
|
+
* the right ink on every card but the dark band's; inheriting is what lets one rule serve all three.
|
|
46
|
+
*/
|
|
47
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-table__grid {
|
|
48
|
+
color: inherit;
|
|
49
|
+
min-inline-size: calc(var(--size-grid-track-sm) * var(--dds-comparisontable-columns, 3));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* The light band under the column names.
|
|
54
|
+
*
|
|
55
|
+
* TableHead paints nothing — a table's surface is whoever put it there — so the band is the block's.
|
|
56
|
+
* color.bg.subtle is an alpha, so it is one step from whichever card it lies on: grey on the
|
|
57
|
+
* recessed card, a lighter grey on the raised white one. On the dark band it is the band's own veil,
|
|
58
|
+
* which is white where the page's is black. The card's corner clips it, so its top edge follows the
|
|
59
|
+
* card's round.
|
|
60
|
+
*/
|
|
61
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-tablehead {
|
|
62
|
+
background-color: var(--color-bg-subtle);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable[data-ground="strong"] .dds-tablehead {
|
|
66
|
+
background-color: var(--color-bg-subtle-on-brand-strong);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
* The column names, in the card's ink and the row labels' weight, and on as many lines as they need.
|
|
71
|
+
*
|
|
72
|
+
* TableHeaderCell recedes a column's name to color.fg.muted, which is the right voice for a data
|
|
73
|
+
* table's headers and the wrong one here: the names are the options being compared, read as often
|
|
74
|
+
* as the labels down the side, and muted ink on the dark band is grey on near-black. So they take
|
|
75
|
+
* the card's ink, at label.md — the row labels' step, the reference setting both alike.
|
|
76
|
+
*
|
|
77
|
+
* And they wrap. A header cell holds its name on one line and clips the rest, which suits a long
|
|
78
|
+
* column of figures and not a comparison, where a clipped name is an option the reader cannot
|
|
79
|
+
* identify. Three classes deep, which beats the header cell's own class-and-attribute.
|
|
80
|
+
*/
|
|
81
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-tablehead .dds-tableheadercell {
|
|
82
|
+
color: inherit;
|
|
83
|
+
font-family: var(--font-label-md-family);
|
|
84
|
+
font-size: var(--font-label-md-size);
|
|
85
|
+
font-weight: var(--font-label-md-weight);
|
|
86
|
+
letter-spacing: var(--font-label-md-letter-spacing);
|
|
87
|
+
line-height: var(--font-label-md-line-height);
|
|
88
|
+
white-space: normal;
|
|
89
|
+
/* The clip and the ellipsis go with the single line: wrapping alone left them standing, so a
|
|
90
|
+
name longer than its column — a German one, at a phone's 128px — was still cut off. */
|
|
91
|
+
overflow: visible;
|
|
92
|
+
text-overflow: clip;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/*
|
|
96
|
+
* The rules on the dark band.
|
|
97
|
+
*
|
|
98
|
+
* The cells draw their rules in color.border.subtle, black at a few percent, which is gone on
|
|
99
|
+
* near-black. The band's own quiet rule is the counterpart, white where the page's is black.
|
|
100
|
+
*/
|
|
101
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable[data-ground="strong"] .dds-tablerow > :is(.dds-tablecell, .dds-tableheadercell) {
|
|
102
|
+
border-color: var(--color-border-subtle-inverse);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/*
|
|
106
|
+
* The cells' inset opens from the fold.
|
|
107
|
+
*
|
|
108
|
+
* The reference's two steps: sixteen on a phone, where every column is spending width it does not
|
|
109
|
+
* have, and twenty-four once the card has room — space.inset.md, which Table's middle size already
|
|
110
|
+
* sets, then space.inset.lg. Not Table's large size, which would set the values a step larger too;
|
|
111
|
+
* this is only the air. The row labels carry TableCell's class, so they open with the values.
|
|
112
|
+
*/
|
|
113
|
+
@container (min-width: 48rem) {
|
|
114
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-tablerow > :is(.dds-tablecell, .dds-tableheadercell) {
|
|
115
|
+
padding-block: var(--space-inset-lg);
|
|
116
|
+
padding-inline: var(--space-inset-lg);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/*
|
|
121
|
+
* The scroll region's ring, drawn inside the card.
|
|
122
|
+
*
|
|
123
|
+
* Table rings its scroll region outside its own edge, and here that edge is the card's, which clips
|
|
124
|
+
* whatever it holds to its corner — so the ring was cut away on every side and a keyboard reader
|
|
125
|
+
* tabbed into a table with nothing drawn to say so. Pulled in by its own width, it sits just inside
|
|
126
|
+
* the card. On the dark band it takes the band's own ring.
|
|
127
|
+
*/
|
|
128
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-table:focus-visible {
|
|
129
|
+
outline-offset: calc(var(--border-width-focus) * -1);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable[data-ground="strong"] .dds-table:focus-visible {
|
|
133
|
+
outline-color: var(--color-border-focus-on-brand-strong);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/*
|
|
137
|
+
* A heading with no line under it closes up: its bound step is the distance to the line, and with
|
|
138
|
+
* nothing there it would only add to the step from the header to what follows. `:last-child` is the
|
|
139
|
+
* condition itself, DataTable's way, rather than a prop standing in for it.
|
|
140
|
+
*/
|
|
141
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-comparisontable__title:last-child {
|
|
142
|
+
margin-block-end: 0;
|
|
143
|
+
}
|
|
@@ -19,4 +19,4 @@ export type { CtaBannerProps };
|
|
|
19
19
|
* It arrives the way every block does, and the way CtaBannerSlider's slides do: block-reveal.css
|
|
20
20
|
* brings the headline, the line and the actions up a step apart once the band is in view.
|
|
21
21
|
*/
|
|
22
|
-
export declare function CtaBanner({ title, headingLevel, description, actions, }: CtaBannerProps): import("react").JSX.Element;
|
|
22
|
+
export declare function CtaBanner({ title, headingLevel, description, actions, background, }: CtaBannerProps): import("react").JSX.Element;
|
|
@@ -6,6 +6,7 @@ import './cta-banner-impl.css';
|
|
|
6
6
|
import '../block-reveal.css';
|
|
7
7
|
import { arriving, useReveal } from '../use-reveal.js';
|
|
8
8
|
import { given } from '../../given.js';
|
|
9
|
+
import { Background } from '../../core/background/Background.js';
|
|
9
10
|
import { ctaBannerDefaults, ctaBannerParts } from './CtaBanner.types.js';
|
|
10
11
|
/**
|
|
11
12
|
* A full-bleed coral band carrying one promotion and the action it asks for.
|
|
@@ -23,9 +24,9 @@ import { ctaBannerDefaults, ctaBannerParts } from './CtaBanner.types.js';
|
|
|
23
24
|
* It arrives the way every block does, and the way CtaBannerSlider's slides do: block-reveal.css
|
|
24
25
|
* brings the headline, the line and the actions up a step apart once the band is in view.
|
|
25
26
|
*/
|
|
26
|
-
export function CtaBanner({ title, headingLevel = ctaBannerDefaults.headingLevel, description, actions, }) {
|
|
27
|
+
export function CtaBanner({ title, headingLevel = ctaBannerDefaults.headingLevel, description, actions, background = ctaBannerDefaults.background, }) {
|
|
27
28
|
const titleId = useId();
|
|
28
29
|
const [band, revealed] = useReveal();
|
|
29
30
|
const Title = headingLevel === 'h3' ? 'h3' : 'h2';
|
|
30
|
-
return (
|
|
31
|
+
return (_jsxs("section", { className: ctaBannerParts.root, "data-background": background, "aria-labelledby": titleId, children: [background === 'plain' ? null : (_jsx(Background, { tone: "brand", pattern: background, children: null })), _jsx("div", { className: ctaBannerParts.inner, ref: band, "data-revealed": revealed, children: _jsxs("div", { className: ctaBannerParts.content, children: [_jsxs("div", { className: ctaBannerParts.text, children: [_jsx(Title, { className: ctaBannerParts.title, id: titleId, ...arriving(0), children: title }), given(description) ? (_jsx("p", { className: ctaBannerParts.description, ...arriving(1), children: description })) : null] }), actions ? (_jsx("div", { className: ctaBannerParts.actions, ...arriving(2), children: actions })) : null] }) })] }));
|
|
31
32
|
}
|
|
@@ -11,6 +11,11 @@ export interface CtaBannerOwnProps {
|
|
|
11
11
|
description?: string;
|
|
12
12
|
/** The one action the message asks for, or two at most. The coral is the banner's ground, so the primary is Button variant="inverse" tone="brand" — a primary Button is coral on coral, and the tone keeps it near-black in both themes — and a second is Button variant="secondary" tone="brand" — a white tint with a white label, fixed in both themes like the band. */
|
|
13
13
|
actions?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* `grid` — The default: a fine rule grid behind the band's content — light coral hairlines rising out of a deeper red at the band's foot, moving slowly at rest and brightening around the pointer. Drawn by Background as a layer under the band's own content, so the band's layout is untouched.
|
|
16
|
+
* `plain` — The flat coral and nothing on it, asked for by name: a page that already spends its one pattern on another band, or a banner set among busy content where the grid would be texture fighting texture.
|
|
17
|
+
*/
|
|
18
|
+
background?: 'grid' | 'plain';
|
|
14
19
|
}
|
|
15
20
|
export type CtaBannerProps = CtaBannerOwnProps;
|
|
16
21
|
/** The class each part carries. Apply these — do not retype them. */
|
|
@@ -26,4 +31,5 @@ export declare const ctaBannerParts: {
|
|
|
26
31
|
/** Generated so defaults cannot drift from the contract. */
|
|
27
32
|
export declare const ctaBannerDefaults: {
|
|
28
33
|
readonly headingLevel: "h2";
|
|
34
|
+
readonly background: "grid";
|
|
29
35
|
};
|
|
@@ -10,4 +10,4 @@ export const ctaBannerParts = {
|
|
|
10
10
|
actions: 'dds-ctabanner__actions',
|
|
11
11
|
};
|
|
12
12
|
/** Generated so defaults cannot drift from the contract. */
|
|
13
|
-
export const ctaBannerDefaults = { headingLevel: 'h2' };
|
|
13
|
+
export const ctaBannerDefaults = { headingLevel: 'h2', background: 'grid' };
|
|
@@ -27,3 +27,11 @@
|
|
|
27
27
|
justify-content: center;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* The banner's column, lifted over the pattern layer. It is not positioned otherwise — the banner
|
|
33
|
+
* has no other layer to clear — so it is lifted only where the pattern is drawn.
|
|
34
|
+
*/
|
|
35
|
+
:where([data-dds-context="marketing"]) .dds-ctabanner[data-background] .dds-ctabanner__inner {
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
@@ -36,4 +36,4 @@ export type { CtaBannerSliderProps };
|
|
|
36
36
|
* the same rise, a step apart. The slide leaving drops to waiting at once, as that sheet has every
|
|
37
37
|
* part do, so the outgoing words never travel.
|
|
38
38
|
*/
|
|
39
|
-
export declare function CtaBannerSlider({ slides, headingLevel, autoplay, label, controlsLabel, slideLabel, }: CtaBannerSliderProps): import("react").JSX.Element | null;
|
|
39
|
+
export declare function CtaBannerSlider({ slides, headingLevel, autoplay, label, controlsLabel, slideLabel, roleDescription, slideRoleDescription, positionLabel, background, }: CtaBannerSliderProps): import("react").JSX.Element | null;
|
|
@@ -4,6 +4,7 @@ import './CtaBannerSlider.css';
|
|
|
4
4
|
import './cta-banner-slider-impl.css';
|
|
5
5
|
import '../block-reveal.css';
|
|
6
6
|
import { arriving, useReveal } from '../use-reveal.js';
|
|
7
|
+
import { Background } from '../../core/background/Background.js';
|
|
7
8
|
import { useRotation } from '../use-rotation.js';
|
|
8
9
|
import { given } from '../../given.js';
|
|
9
10
|
import { Button } from '../../core/button/Button.js';
|
|
@@ -42,19 +43,23 @@ import { ctaBannerSliderDefaults, ctaBannerSliderParts, } from './CtaBannerSlide
|
|
|
42
43
|
* the same rise, a step apart. The slide leaving drops to waiting at once, as that sheet has every
|
|
43
44
|
* part do, so the outgoing words never travel.
|
|
44
45
|
*/
|
|
45
|
-
export function CtaBannerSlider({ slides, headingLevel = ctaBannerSliderDefaults.headingLevel, autoplay = ctaBannerSliderDefaults.autoplay, label = ctaBannerSliderDefaults.label, controlsLabel = ctaBannerSliderDefaults.controlsLabel, slideLabel = ctaBannerSliderDefaults.slideLabel, }) {
|
|
46
|
+
export function CtaBannerSlider({ slides, headingLevel = ctaBannerSliderDefaults.headingLevel, autoplay = ctaBannerSliderDefaults.autoplay, label = ctaBannerSliderDefaults.label, controlsLabel = ctaBannerSliderDefaults.controlsLabel, slideLabel = ctaBannerSliderDefaults.slideLabel, roleDescription = ctaBannerSliderDefaults.roleDescription, slideRoleDescription = ctaBannerSliderDefaults.slideRoleDescription, positionLabel, background, }) {
|
|
46
47
|
const Title = headingLevel === 'h3' ? 'h3' : 'h2';
|
|
47
48
|
const count = slides.length;
|
|
48
49
|
// The band arriving on screen, as every block does; until then no slide has arrived.
|
|
49
50
|
const [band, revealed] = useReveal();
|
|
50
51
|
// Which slide is in view, and every way a reader moves, holds or stops the set — shared with
|
|
51
52
|
// TestimonialSlider, so the two rotate by one set of rules. See use-rotation.ts.
|
|
52
|
-
const { current, rotating, root, region, track, item, away, dots } = useRotation(count, autoplay
|
|
53
|
+
const { current, rotating, root, region, track, item, away, dots } = useRotation(count, autoplay, {
|
|
54
|
+
roleDescription,
|
|
55
|
+
slideRoleDescription,
|
|
56
|
+
positionLabel,
|
|
57
|
+
});
|
|
53
58
|
// Nothing to show is nothing drawn: a named region with no message in it is a landmark that
|
|
54
59
|
// leads a screen reader to an empty band.
|
|
55
60
|
if (count === 0)
|
|
56
61
|
return null;
|
|
57
|
-
return (
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
return (_jsxs("section", { ref: root, className: ctaBannerSliderParts.root, "aria-label": label, "data-background": background, ...region, children: [background === undefined ? null : (_jsx(Background, { tone: "brand", pattern: background, children: null })), _jsxs("div", { className: ctaBannerSliderParts.inner, ref: band, children: [_jsx("div", { className: ctaBannerSliderParts.track, ...track, children: slides.map((slide, at) => (_jsxs("div", { className: ctaBannerSliderParts.slide, ...item(at), "data-revealed": revealed && !away(at), children: [_jsxs("div", { className: ctaBannerSliderParts.text, children: [_jsx(Title, { className: ctaBannerSliderParts.title, ...arriving(0), children: slide.title }), given(slide.description) ? (_jsx("p", { className: ctaBannerSliderParts.description, ...arriving(1), children: slide.description })) : null] }), slide.primaryAction ? (_jsxs("div", { className: ctaBannerSliderParts.actions, ...arriving(2), children: [_jsx(Button, { variant: "inverse", tone: "brand", href: slide.primaryAction.href, children: slide.primaryAction.label }), slide.secondaryAction ? (_jsx(Button, { variant: "secondary", tone: "brand", href: slide.secondaryAction.href, children: slide.secondaryAction.label })) : null] })) : null] }, at))) }), rotating ? (_jsx("div", { className: ctaBannerSliderParts.controls, children: _jsx(PaginationDots, { ...dots,
|
|
63
|
+
/* A dot pressed stops the dots' own rotation; the band's press handler stops this. */
|
|
64
|
+
label: controlsLabel, itemLabel: slideLabel }) })) : null] })] }));
|
|
60
65
|
}
|
|
@@ -17,6 +17,16 @@ export interface CtaBannerSliderOwnProps {
|
|
|
17
17
|
controlsLabel?: string;
|
|
18
18
|
/** The word each dot is announced by, before its number — 'Slide 2'. Translate it with the page, as controlsLabel is; a page that translates only the group's name still has every dot announced in English. */
|
|
19
19
|
slideLabel?: string;
|
|
20
|
+
/**
|
|
21
|
+
* `grid` — A fine rule grid behind the slides: white hairlines on the coral, fading in towards the foot, brightening in a soft circle around the pointer. Drawn by Background as a layer under the band's content, by the stylesheet alone, so it holds still while the slides move and costs nothing at rest
|
|
22
|
+
*/
|
|
23
|
+
background?: 'grid';
|
|
24
|
+
/** What a screen reader calls the set while it rotates — announced in place of a region, as the word for this kind of thing. Translate it with the page: it is read out as given, so an untranslated one announces an English word on every page in every language. */
|
|
25
|
+
roleDescription?: string;
|
|
26
|
+
/** What a screen reader calls each item while the set rotates, for the reason roleDescription exists. Translate it with the page. */
|
|
27
|
+
slideRoleDescription?: string;
|
|
28
|
+
/** The accessible name of each item while the set rotates, given its place in the set counting from one — so a reader hears where they are. Without it each is named "2 of 5"; pass it to translate that with the page, in that language's own order and digits. */
|
|
29
|
+
positionLabel?: (position: number, count: number) => string;
|
|
20
30
|
}
|
|
21
31
|
export type CtaBannerSliderProps = CtaBannerSliderOwnProps;
|
|
22
32
|
/** The class each part carries. Apply these — do not retype them. */
|
|
@@ -38,4 +48,6 @@ export declare const ctaBannerSliderDefaults: {
|
|
|
38
48
|
readonly label: "Promotions";
|
|
39
49
|
readonly controlsLabel: "Slides";
|
|
40
50
|
readonly slideLabel: "Slide";
|
|
51
|
+
readonly roleDescription: "carousel";
|
|
52
|
+
readonly slideRoleDescription: "slide";
|
|
41
53
|
};
|
|
@@ -12,4 +12,4 @@ export const ctaBannerSliderParts = {
|
|
|
12
12
|
controls: 'dds-ctabannerslider__controls',
|
|
13
13
|
};
|
|
14
14
|
/** Generated so defaults cannot drift from the contract. */
|
|
15
|
-
export const ctaBannerSliderDefaults = { headingLevel: 'h2', autoplay: false, label: 'Promotions', controlsLabel: 'Slides', slideLabel: 'Slide' };
|
|
15
|
+
export const ctaBannerSliderDefaults = { headingLevel: 'h2', autoplay: false, label: 'Promotions', controlsLabel: 'Slides', slideLabel: 'Slide', roleDescription: 'carousel', slideRoleDescription: 'slide' };
|
|
@@ -71,3 +71,11 @@
|
|
|
71
71
|
justify-content: center;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* The band's column, lifted over the pattern layer when `background` asks for one. Not positioned
|
|
77
|
+
* otherwise — the band has no other layer for it to clear.
|
|
78
|
+
*/
|
|
79
|
+
:where([data-dds-context="marketing"]) .dds-ctabannerslider[data-background] .dds-ctabannerslider__inner {
|
|
80
|
+
position: relative;
|
|
81
|
+
}
|