@deriv-com/dds-marketing 1.0.2 → 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 +89 -40
- 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 +9 -12
- package/.llm/components/ctabannerslider.md +15 -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 +2 -2
- package/.llm/components/illustrationscene.md +6 -10
- package/.llm/components/imagebanner.md +278 -0
- package/.llm/components/navbar.md +1 -1
- package/.llm/components/navbaritem.md +4 -0
- package/.llm/components/pageheader.md +4 -3
- 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 +11 -10
- 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 -4
- package/.llm/digest/ctabannerslider.md +4 -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/illustrationscene.md +2 -3
- package/.llm/digest/imagebanner.md +64 -0
- package/.llm/digest/navbaritem.md +1 -0
- package/.llm/digest/pageheader.md +2 -1
- 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 +19 -3
- package/.llm/tokens.md +26 -1
- package/AGENTS.md +17 -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.js +2 -2
- package/dist/components/blocks/cta-banner/CtaBanner.types.d.ts +4 -3
- package/dist/components/blocks/cta-banner/CtaBanner.types.js +1 -1
- 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 +6 -2
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.d.ts +8 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.js +1 -1
- 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/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.js +2 -2
- package/dist/components/blocks/page-header/PageHeader.types.d.ts +4 -2
- package/dist/components/blocks/page-header/PageHeader.types.js +1 -1
- package/dist/components/blocks/page-header/page-header-impl.css +5 -3
- 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 +23 -0
- package/dist/components/core/background/Background.d.ts +10 -4
- package/dist/components/core/background/Background.js +16 -7
- package/dist/components/core/background/Background.types.d.ts +11 -8
- package/dist/components/core/background/Background.types.js +3 -1
- package/dist/components/core/background/background-impl.css +334 -1
- package/dist/components/core/background/halftone.d.ts +11 -0
- package/dist/components/core/background/halftone.js +43 -3
- 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-shader.d.ts +11 -0
- package/dist/components/core/background/use-shader.js +25 -0
- package/dist/components/core/background/use-spotlight.d.ts +2 -1
- package/dist/components/core/background/use-spotlight.js +9 -1
- 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.js +1 -1
- package/dist/components/core/illustration-card/illustration-card-impl.css +20 -0
- package/dist/components/core/illustration-scene/IllustrationScene.css +4 -7
- package/dist/components/core/illustration-scene/IllustrationScene.types.d.ts +2 -3
- package/dist/components/core/illustration-scene/illustration-scene-impl.css +7 -1
- 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 +45 -0
- package/dist/components/index.js +32 -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 +77 -28
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -24,9 +24,9 @@ import { ctaBannerDefaults, ctaBannerParts } from './CtaBanner.types.js';
|
|
|
24
24
|
* It arrives the way every block does, and the way CtaBannerSlider's slides do: block-reveal.css
|
|
25
25
|
* brings the headline, the line and the actions up a step apart once the band is in view.
|
|
26
26
|
*/
|
|
27
|
-
export function CtaBanner({ title, headingLevel = ctaBannerDefaults.headingLevel, description, actions, background, }) {
|
|
27
|
+
export function CtaBanner({ title, headingLevel = ctaBannerDefaults.headingLevel, description, actions, background = ctaBannerDefaults.background, }) {
|
|
28
28
|
const titleId = useId();
|
|
29
29
|
const [band, revealed] = useReveal();
|
|
30
30
|
const Title = headingLevel === 'h3' ? 'h3' : 'h2';
|
|
31
|
-
return (_jsxs("section", { className: ctaBannerParts.root, "data-background": background, "aria-labelledby": titleId, children: [background ===
|
|
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] }) })] }));
|
|
32
32
|
}
|
|
@@ -12,10 +12,10 @@ export interface CtaBannerOwnProps {
|
|
|
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
14
|
/**
|
|
15
|
-
* `
|
|
16
|
-
* `
|
|
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
17
|
*/
|
|
18
|
-
background?: '
|
|
18
|
+
background?: 'grid' | 'plain';
|
|
19
19
|
}
|
|
20
20
|
export type CtaBannerProps = CtaBannerOwnProps;
|
|
21
21
|
/** The class each part carries. Apply these — do not retype them. */
|
|
@@ -31,4 +31,5 @@ export declare const ctaBannerParts: {
|
|
|
31
31
|
/** Generated so defaults cannot drift from the contract. */
|
|
32
32
|
export declare const ctaBannerDefaults: {
|
|
33
33
|
readonly headingLevel: "h2";
|
|
34
|
+
readonly background: "grid";
|
|
34
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' };
|
|
@@ -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, background, }: 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;
|
|
@@ -43,14 +43,18 @@ import { ctaBannerSliderDefaults, ctaBannerSliderParts, } from './CtaBannerSlide
|
|
|
43
43
|
* the same rise, a step apart. The slide leaving drops to waiting at once, as that sheet has every
|
|
44
44
|
* part do, so the outgoing words never travel.
|
|
45
45
|
*/
|
|
46
|
-
export function CtaBannerSlider({ slides, headingLevel = ctaBannerSliderDefaults.headingLevel, autoplay = ctaBannerSliderDefaults.autoplay, label = ctaBannerSliderDefaults.label, controlsLabel = ctaBannerSliderDefaults.controlsLabel, slideLabel = ctaBannerSliderDefaults.slideLabel, background, }) {
|
|
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, }) {
|
|
47
47
|
const Title = headingLevel === 'h3' ? 'h3' : 'h2';
|
|
48
48
|
const count = slides.length;
|
|
49
49
|
// The band arriving on screen, as every block does; until then no slide has arrived.
|
|
50
50
|
const [band, revealed] = useReveal();
|
|
51
51
|
// Which slide is in view, and every way a reader moves, holds or stops the set — shared with
|
|
52
52
|
// TestimonialSlider, so the two rotate by one set of rules. See use-rotation.ts.
|
|
53
|
-
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
|
+
});
|
|
54
58
|
// Nothing to show is nothing drawn: a named region with no message in it is a landmark that
|
|
55
59
|
// leads a screen reader to an empty band.
|
|
56
60
|
if (count === 0)
|
|
@@ -21,6 +21,12 @@ export interface CtaBannerSliderOwnProps {
|
|
|
21
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
22
|
*/
|
|
23
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;
|
|
24
30
|
}
|
|
25
31
|
export type CtaBannerSliderProps = CtaBannerSliderOwnProps;
|
|
26
32
|
/** The class each part carries. Apply these — do not retype them. */
|
|
@@ -42,4 +48,6 @@ export declare const ctaBannerSliderDefaults: {
|
|
|
42
48
|
readonly label: "Promotions";
|
|
43
49
|
readonly controlsLabel: "Slides";
|
|
44
50
|
readonly slideLabel: "Slide";
|
|
51
|
+
readonly roleDescription: "carousel";
|
|
52
|
+
readonly slideRoleDescription: "slide";
|
|
45
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' };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/* GENERATED from datatable.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-datatable {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
container-type: inline-size;
|
|
6
|
+
display: flex;
|
|
7
|
+
inline-size: 100%;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
overflow-wrap: anywhere;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__inner {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
inline-size: 100%;
|
|
17
|
+
min-inline-size: 0;
|
|
18
|
+
max-inline-size: var(--size-content-max);
|
|
19
|
+
padding-block: var(--space-section-default);
|
|
20
|
+
padding-inline: var(--space-inset-page);
|
|
21
|
+
row-gap: var(--space-heading-content);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__header {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
min-inline-size: 0;
|
|
28
|
+
max-inline-size: var(--size-measure-heading);
|
|
29
|
+
row-gap: var(--space-gap-none);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__title {
|
|
33
|
+
margin-block: 0;
|
|
34
|
+
text-wrap: balance;
|
|
35
|
+
font-family: var(--font-h2-family);
|
|
36
|
+
font-size: var(--font-h2-size);
|
|
37
|
+
font-weight: var(--font-h2-weight);
|
|
38
|
+
letter-spacing: var(--font-h2-letter-spacing);
|
|
39
|
+
line-height: var(--font-h2-line-height);
|
|
40
|
+
margin-block-end: var(--space-heading-title-description);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__description {
|
|
44
|
+
margin-block: 0;
|
|
45
|
+
font-family: var(--font-body-md-family);
|
|
46
|
+
font-size: var(--font-body-md-size);
|
|
47
|
+
font-weight: var(--font-body-md-weight);
|
|
48
|
+
letter-spacing: var(--font-body-md-letter-spacing);
|
|
49
|
+
line-height: var(--font-body-md-line-height);
|
|
50
|
+
max-inline-size: var(--size-measure-description);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__content {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
min-inline-size: 0;
|
|
57
|
+
row-gap: var(--space-gap-lg);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__frame {
|
|
61
|
+
border-style: solid;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
min-inline-size: 0;
|
|
66
|
+
overflow: clip;
|
|
67
|
+
position: relative;
|
|
68
|
+
background-color: var(--color-bg-page);
|
|
69
|
+
border-color: var(--color-border-subtle);
|
|
70
|
+
border-radius: var(--radius-surface);
|
|
71
|
+
border-width: var(--border-width-default);
|
|
72
|
+
color: var(--color-fg-default);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__toolbar {
|
|
76
|
+
align-items: center;
|
|
77
|
+
border-block-start-width: 0;
|
|
78
|
+
border-inline-width: 0;
|
|
79
|
+
border-style: solid;
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-wrap: wrap;
|
|
82
|
+
justify-content: space-between;
|
|
83
|
+
border-block-end-width: var(--border-width-hairline);
|
|
84
|
+
border-color: var(--color-border-subtle);
|
|
85
|
+
column-gap: var(--space-gap-md);
|
|
86
|
+
padding-block: var(--space-inset-md);
|
|
87
|
+
padding-inline: var(--space-inset-lg);
|
|
88
|
+
row-gap: var(--space-gap-sm);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__search {
|
|
92
|
+
inline-size: 100%;
|
|
93
|
+
min-inline-size: 0;
|
|
94
|
+
max-inline-size: var(--size-data-table-search);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__status {
|
|
98
|
+
margin: 0;
|
|
99
|
+
color: var(--color-fg-muted);
|
|
100
|
+
font-family: var(--font-body-sm-family);
|
|
101
|
+
font-size: var(--font-body-sm-size);
|
|
102
|
+
font-weight: var(--font-body-sm-weight);
|
|
103
|
+
letter-spacing: var(--font-body-sm-letter-spacing);
|
|
104
|
+
line-height: var(--font-body-sm-line-height);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__empty {
|
|
108
|
+
margin: 0;
|
|
109
|
+
text-align: center;
|
|
110
|
+
border-color: var(--color-border-subtle);
|
|
111
|
+
color: var(--color-fg-muted);
|
|
112
|
+
font-family: var(--font-body-md-family);
|
|
113
|
+
font-size: var(--font-body-md-size);
|
|
114
|
+
font-weight: var(--font-body-md-weight);
|
|
115
|
+
letter-spacing: var(--font-body-md-letter-spacing);
|
|
116
|
+
line-height: var(--font-body-md-line-height);
|
|
117
|
+
padding-block: var(--space-inset-2xl);
|
|
118
|
+
padding-inline: var(--space-inset-lg);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__pager {
|
|
122
|
+
border-block-end-width: 0;
|
|
123
|
+
border-inline-width: 0;
|
|
124
|
+
border-style: solid;
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
border-block-start-width: var(--border-width-hairline);
|
|
128
|
+
border-color: var(--color-border-subtle);
|
|
129
|
+
padding-block: var(--space-inset-md);
|
|
130
|
+
padding-inline: var(--space-inset-lg);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__footnote {
|
|
134
|
+
margin-block: 0;
|
|
135
|
+
font-family: var(--font-body-sm-family);
|
|
136
|
+
font-size: var(--font-body-sm-size);
|
|
137
|
+
font-weight: var(--font-body-sm-weight);
|
|
138
|
+
letter-spacing: var(--font-body-sm-letter-spacing);
|
|
139
|
+
line-height: var(--font-body-sm-line-height);
|
|
140
|
+
max-inline-size: var(--size-measure-description);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:where([data-dds-context="marketing"]) .dds-datatable[data-ground="page"] {
|
|
144
|
+
background-color: var(--color-bg-page);
|
|
145
|
+
color: var(--color-fg-default);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:where([data-dds-context="marketing"]) .dds-datatable[data-ground="page"] .dds-datatable__footnote {
|
|
149
|
+
color: var(--color-fg-muted);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:where([data-dds-context="marketing"]) .dds-datatable[data-ground="strong"] {
|
|
153
|
+
background-color: var(--color-bg-brand-strong);
|
|
154
|
+
color: var(--color-fg-on-brand-strong);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:where([data-dds-context="marketing"]) .dds-datatable[data-ground="strong"] .dds-datatable__footnote {
|
|
158
|
+
color: var(--color-fg-muted-inverse);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:where([data-dds-context="marketing"]) .dds-datatable[data-ground="subtle"] {
|
|
162
|
+
background-color: var(--color-bg-page);
|
|
163
|
+
background-image: linear-gradient(var(--color-bg-band-subtle), var(--color-bg-band-subtle));
|
|
164
|
+
color: var(--color-fg-default);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:where([data-dds-context="marketing"]) .dds-datatable[data-ground="subtle"] .dds-datatable__footnote {
|
|
168
|
+
color: var(--color-fg-muted);
|
|
169
|
+
}
|
|
170
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import './DataTable.css';
|
|
2
|
+
import './data-table-impl.css';
|
|
3
|
+
import '../block-reveal.css';
|
|
4
|
+
import { type DataTableProps } from './DataTable.types.js';
|
|
5
|
+
export type { DataTableProps };
|
|
6
|
+
/**
|
|
7
|
+
* A heading over a framed table a reader searches and pages through — the reference site's Table
|
|
8
|
+
* template, renamed because Table is already the grid it is drawn around.
|
|
9
|
+
*
|
|
10
|
+
* Everything that is a control is a component this package already has: the search is SearchInput,
|
|
11
|
+
* the pages are Pagination, and the grid is Table with its first column pinned. What this adds is
|
|
12
|
+
* the section — the heading, the frame, the count, the small print — and the two pieces of state
|
|
13
|
+
* the reference holds: the query and the page. Both are the block's own rather than the page's,
|
|
14
|
+
* because nothing outside the section reads them, and both are client-side: the rows are the ones
|
|
15
|
+
* the page handed in, searched and sliced here.
|
|
16
|
+
*
|
|
17
|
+
* Each row's name is a row header, so a screen reader announces the instrument before each of its
|
|
18
|
+
* values, as it announces each column's name. TableHeaderCell draws it with `scope="row"`, in the
|
|
19
|
+
* body, where a TableCell would otherwise go.
|
|
20
|
+
*
|
|
21
|
+
* The count is a polite live region from the first render, so a reader who cannot see the rows
|
|
22
|
+
* thin out as they type is told how many are left, and told in words when none are. When none are,
|
|
23
|
+
* the table is not drawn at all and the empty line is — TableBody's rule, a sentence in place of
|
|
24
|
+
* the data rather than a row pretending to be some.
|
|
25
|
+
*
|
|
26
|
+
* `'use client'` for the query, the page, the arrival and `useId`, which names the region by its
|
|
27
|
+
* heading.
|
|
28
|
+
*/
|
|
29
|
+
export declare function DataTable({ ground, title, description, columns, rows, pageSize, footnote, searchLabel, searchPlaceholder, clearLabel, emptyText, resultCount, paginationLabel, previousLabel, nextLabel, morePagesLabel, }: DataTableProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId, useMemo, useState } from 'react';
|
|
4
|
+
import './DataTable.css';
|
|
5
|
+
import './data-table-impl.css';
|
|
6
|
+
import '../block-reveal.css';
|
|
7
|
+
import { given } from '../../given.js';
|
|
8
|
+
import { Pagination } from '../../core/pagination/Pagination.js';
|
|
9
|
+
import { SearchInput } from '../../core/search-input/SearchInput.js';
|
|
10
|
+
import { Table } from '../../core/table/Table.js';
|
|
11
|
+
import { TableBody } from '../../core/table-body/TableBody.js';
|
|
12
|
+
import { TableCell } from '../../core/table-cell/TableCell.js';
|
|
13
|
+
import { TableHead } from '../../core/table-head/TableHead.js';
|
|
14
|
+
import { TableHeaderCell } from '../../core/table-header-cell/TableHeaderCell.js';
|
|
15
|
+
import { TableRow } from '../../core/table-row/TableRow.js';
|
|
16
|
+
import { arriving, useReveal } from '../use-reveal.js';
|
|
17
|
+
import { dataTableDefaults, dataTableParts } from './DataTable.types.js';
|
|
18
|
+
/** The count in English, for a page that passes none: where the reader is, or that nothing matched. */
|
|
19
|
+
const countInEnglish = (first, last, total) => total === 0 ? 'No results' : `Showing ${first}–${last} of ${total}`;
|
|
20
|
+
/**
|
|
21
|
+
* Whether a row holds the query in any of the columns drawn — case-insensitive, anywhere in the
|
|
22
|
+
* value. Only the drawn columns: a field the table does not show is one a reader could never see
|
|
23
|
+
* the match in, and a row matching on it would look like a row matching on nothing.
|
|
24
|
+
*/
|
|
25
|
+
const matches = (row, keys, query) => keys.some((key) => (row[key] ?? '').toLowerCase().includes(query));
|
|
26
|
+
/**
|
|
27
|
+
* A heading over a framed table a reader searches and pages through — the reference site's Table
|
|
28
|
+
* template, renamed because Table is already the grid it is drawn around.
|
|
29
|
+
*
|
|
30
|
+
* Everything that is a control is a component this package already has: the search is SearchInput,
|
|
31
|
+
* the pages are Pagination, and the grid is Table with its first column pinned. What this adds is
|
|
32
|
+
* the section — the heading, the frame, the count, the small print — and the two pieces of state
|
|
33
|
+
* the reference holds: the query and the page. Both are the block's own rather than the page's,
|
|
34
|
+
* because nothing outside the section reads them, and both are client-side: the rows are the ones
|
|
35
|
+
* the page handed in, searched and sliced here.
|
|
36
|
+
*
|
|
37
|
+
* Each row's name is a row header, so a screen reader announces the instrument before each of its
|
|
38
|
+
* values, as it announces each column's name. TableHeaderCell draws it with `scope="row"`, in the
|
|
39
|
+
* body, where a TableCell would otherwise go.
|
|
40
|
+
*
|
|
41
|
+
* The count is a polite live region from the first render, so a reader who cannot see the rows
|
|
42
|
+
* thin out as they type is told how many are left, and told in words when none are. When none are,
|
|
43
|
+
* the table is not drawn at all and the empty line is — TableBody's rule, a sentence in place of
|
|
44
|
+
* the data rather than a row pretending to be some.
|
|
45
|
+
*
|
|
46
|
+
* `'use client'` for the query, the page, the arrival and `useId`, which names the region by its
|
|
47
|
+
* heading.
|
|
48
|
+
*/
|
|
49
|
+
export function DataTable({ ground = dataTableDefaults.ground, title, description, columns, rows, pageSize = dataTableDefaults.pageSize, footnote, searchLabel = dataTableDefaults.searchLabel, searchPlaceholder = dataTableDefaults.searchPlaceholder, clearLabel = dataTableDefaults.clearLabel, emptyText = dataTableDefaults.emptyText, resultCount = countInEnglish, paginationLabel = dataTableDefaults.paginationLabel, previousLabel = dataTableDefaults.previousLabel, nextLabel = dataTableDefaults.nextLabel, morePagesLabel = dataTableDefaults.morePagesLabel, }) {
|
|
50
|
+
const titleId = useId();
|
|
51
|
+
const [band, revealed] = useReveal();
|
|
52
|
+
const [query, setQuery] = useState('');
|
|
53
|
+
const [page, setPage] = useState(1);
|
|
54
|
+
const keys = useMemo(() => columns.map((column) => column.key), [columns]);
|
|
55
|
+
const found = useMemo(() => {
|
|
56
|
+
const needle = query.trim().toLowerCase();
|
|
57
|
+
return needle === '' ? rows : rows.filter((row) => matches(row, keys, needle));
|
|
58
|
+
}, [rows, keys, query]);
|
|
59
|
+
// A page size that is not a whole number of at least one would divide the set by nothing.
|
|
60
|
+
const perPage = Number.isFinite(pageSize) ? Math.max(1, Math.trunc(pageSize)) : dataTableDefaults.pageSize;
|
|
61
|
+
const pages = Math.max(1, Math.ceil(found.length / perPage));
|
|
62
|
+
// Held to the last page rather than trusted: rows handed in again, shorter, can leave the page
|
|
63
|
+
// past the end, and a page past the end is an empty table under a count that says otherwise.
|
|
64
|
+
const current = Math.min(page, pages);
|
|
65
|
+
const start = (current - 1) * perPage;
|
|
66
|
+
const shown = found.slice(start, start + perPage);
|
|
67
|
+
const none = found.length === 0;
|
|
68
|
+
const [first, ...rest] = columns;
|
|
69
|
+
const search = (next) => {
|
|
70
|
+
setQuery(next);
|
|
71
|
+
// Every new query starts at its first page: page three of what the last query matched is a
|
|
72
|
+
// page of nothing, or of rows the reader never saw the first two pages of.
|
|
73
|
+
setPage(1);
|
|
74
|
+
};
|
|
75
|
+
return (_jsx("section", { className: dataTableParts.root, "data-ground": ground, "aria-labelledby": titleId, children: _jsxs("div", { className: dataTableParts.inner, ref: band, "data-revealed": revealed, children: [_jsxs("div", { className: dataTableParts.header, children: [_jsx("h2", { className: dataTableParts.title, id: titleId, ...arriving(0), children: title }), given(description) ? (_jsx("p", { className: dataTableParts.description, ...arriving(1), children: description })) : null] }), _jsxs("div", { className: dataTableParts.content, children: [_jsxs("div", { className: dataTableParts.frame, ...arriving(2), children: [_jsxs("div", { className: dataTableParts.toolbar, children: [_jsx("div", { className: dataTableParts.search, children: _jsx(SearchInput, { label: searchLabel, placeholder: searchPlaceholder, clearLabel: clearLabel, value: query, onChange: search }) }), _jsx("p", { className: dataTableParts.status, role: "status", "aria-live": "polite", children: none ? resultCount(0, 0, 0) : resultCount(start + 1, start + shown.length, found.length) })] }), none || first === undefined ? null : (
|
|
76
|
+
/* Named by the heading's words, as its caption — clipped rather than drawn twice, in
|
|
77
|
+
the block's stylesheet. Table names its scroller from the caption alone, so the
|
|
78
|
+
caption is what reaches both the grid and the region a keyboard tabs into. */
|
|
79
|
+
_jsxs(Table, { caption: title, pinFirstColumn: true, size: "sm", headerCase: "title", hoverable: false, children: [_jsx(TableHead, { children: _jsx(TableRow, { children: columns.map((column, at) => (_jsx(TableHeaderCell, { align: at === 0 ? 'start' : (column.align ?? 'start'), children: column.label }, column.key))) }) }), _jsx(TableBody, { children: shown.map((row, at) => (
|
|
80
|
+
/* The case by hand: Table hands its headerCase to the head's rows through
|
|
81
|
+
TableHead, and TableBody passes none on — so a body row would draw its row
|
|
82
|
+
header in the header row's default capitals. */
|
|
83
|
+
_jsxs(TableRow, { headerCase: "title", children: [_jsx(TableHeaderCell, { scope: "row", children: _jsx("bdi", { children: row[first.key] ?? '' }) }), rest.map((column) => (_jsx(TableCell, { align: column.align ?? 'start', numeric: column.align === 'end', children: _jsx("bdi", { children: row[column.key] ?? '' }) }, column.key)))] }, `${start + at}-${row[first.key] ?? ''}`))) })] })), _jsx("p", { className: dataTableParts.empty, hidden: !none, children: emptyText }), _jsx("div", { className: dataTableParts.pager, hidden: pages < 2, children: pages < 2 ? null : (_jsx(Pagination, { page: current, totalPages: pages, onPageChange: setPage, label: paginationLabel, previousLabel: previousLabel, nextLabel: nextLabel, morePagesLabel: morePagesLabel })) })] }), given(footnote) ? (_jsx("p", { className: dataTableParts.footnote, ...arriving(3), children: footnote })) : null] })] }) }));
|
|
84
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { DataTableColumn, DataTableRow } from '../../data-table-data.js';
|
|
2
|
+
export interface DataTableOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `page` — The default, and the page's own white. The frame's rule is what sets the table off
|
|
5
|
+
* `subtle` — The grey band — the reference design's slate section. The frame lifts off it as a raised card. Painted as the band's tint laid 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 listing a reader should arrive at. The heading and the small print turn white and muted-white; the frame stays the light surface it is everywhere else
|
|
7
|
+
*/
|
|
8
|
+
ground?: 'page' | 'subtle' | 'strong';
|
|
9
|
+
/** Always. What the rows are, in the fewest words — "Forex trading conditions", "Synthetic indices". It names the section and the table both. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** A line under the heading where the heading alone does not say which account or platform the conditions are for — "Conditions on Deriv MT5 Financial accounts." */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Always. The columns in reading order, each a `key` the rows hold its value under and the `label` drawn over it. The first is the rows' names — the instrument — and is pinned to the start edge while the rest scroll sideways; give a column of numbers `align: 'end'` so its figures line up. */
|
|
14
|
+
columns: DataTableColumn[];
|
|
15
|
+
/** Always. The records, in the order they are listed — each a value per column key, as the page would print it. Every value is searched as written. An empty list draws the empty line in place of the table. */
|
|
16
|
+
rows: DataTableRow[];
|
|
17
|
+
/** How many rows a page holds. Ten, the reference's, unless the rows are few enough that a second page would hold two or three of them — then raise it so the set is one page and the pages are not drawn at all. */
|
|
18
|
+
pageSize?: number;
|
|
19
|
+
/** A line of small print under the table — how current the figures are, what they are subject to. "Information is based on the most recent available trading data and may not represent today's conditions." */
|
|
20
|
+
footnote?: string;
|
|
21
|
+
/** The search's name — SearchInput's `label`, never drawn and always announced. Say what is searched where the default is vague for the page: "Search instruments". Translate it with the page. */
|
|
22
|
+
searchLabel?: string;
|
|
23
|
+
/** What the empty field shows, the reference's "Search" — or an example of a query, "EUR/USD". It disappears as the reader types and is never the field's name. Translate it with the page. */
|
|
24
|
+
searchPlaceholder?: string;
|
|
25
|
+
/** The name of the button that empties the search, which is a cross and says nothing on its own. Translate it with the page. */
|
|
26
|
+
clearLabel?: string;
|
|
27
|
+
/** The line drawn in place of the table when nothing matches the query. Translate it with the page; say what to try where the page can — "No markets match. Try a symbol, like EURUSD." */
|
|
28
|
+
emptyText?: string;
|
|
29
|
+
/** The count across from the search, given the first and last row on this page and how many matched — counting from one, and all three 0 when nothing matched. It is also what a screen reader is told, politely, as the query or the page changes. Without it the count reads "Showing 1–10 of 24", and "No results" when nothing matched; pass it to translate that with the page. */
|
|
30
|
+
resultCount?: (first: number, last: number, total: number) => string;
|
|
31
|
+
/** The name of the pages' navigation landmark, Pagination's `label`. Its own name rather than Pagination's default, so a reader listing landmarks can tell this table's pages from anything else on the page that is paginated. Translate it with the page. */
|
|
32
|
+
paginationLabel?: string;
|
|
33
|
+
/** The name of the step back through the pages, which is a glyph. Translate it with the page, and keep it parallel to nextLabel. */
|
|
34
|
+
previousLabel?: string;
|
|
35
|
+
/** The name of the step on through the pages, for the reason previousLabel exists. */
|
|
36
|
+
nextLabel?: string;
|
|
37
|
+
/** The name of the break between two runs of page numbers, which opens a menu of the pages it stands for. Only drawn when the pages run long. Translate it with the page. */
|
|
38
|
+
morePagesLabel?: string;
|
|
39
|
+
}
|
|
40
|
+
export type DataTableProps = DataTableOwnProps;
|
|
41
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
42
|
+
export declare const dataTableParts: {
|
|
43
|
+
readonly root: "dds-datatable";
|
|
44
|
+
readonly inner: "dds-datatable__inner";
|
|
45
|
+
readonly header: "dds-datatable__header";
|
|
46
|
+
readonly title: "dds-datatable__title";
|
|
47
|
+
readonly description: "dds-datatable__description";
|
|
48
|
+
readonly content: "dds-datatable__content";
|
|
49
|
+
readonly frame: "dds-datatable__frame";
|
|
50
|
+
readonly toolbar: "dds-datatable__toolbar";
|
|
51
|
+
readonly search: "dds-datatable__search";
|
|
52
|
+
readonly status: "dds-datatable__status";
|
|
53
|
+
readonly empty: "dds-datatable__empty";
|
|
54
|
+
readonly pager: "dds-datatable__pager";
|
|
55
|
+
readonly footnote: "dds-datatable__footnote";
|
|
56
|
+
};
|
|
57
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
58
|
+
export declare const dataTableDefaults: {
|
|
59
|
+
readonly ground: "page";
|
|
60
|
+
readonly pageSize: 10;
|
|
61
|
+
readonly searchLabel: "Search the table";
|
|
62
|
+
readonly searchPlaceholder: "Search";
|
|
63
|
+
readonly clearLabel: "Clear search";
|
|
64
|
+
readonly emptyText: "No results match your search.";
|
|
65
|
+
readonly paginationLabel: "Table pages";
|
|
66
|
+
readonly previousLabel: "Previous page";
|
|
67
|
+
readonly nextLabel: "Next page";
|
|
68
|
+
readonly morePagesLabel: "More pages";
|
|
69
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// GENERATED from data-table.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const dataTableParts = {
|
|
4
|
+
root: 'dds-datatable',
|
|
5
|
+
inner: 'dds-datatable__inner',
|
|
6
|
+
header: 'dds-datatable__header',
|
|
7
|
+
title: 'dds-datatable__title',
|
|
8
|
+
description: 'dds-datatable__description',
|
|
9
|
+
content: 'dds-datatable__content',
|
|
10
|
+
frame: 'dds-datatable__frame',
|
|
11
|
+
toolbar: 'dds-datatable__toolbar',
|
|
12
|
+
search: 'dds-datatable__search',
|
|
13
|
+
status: 'dds-datatable__status',
|
|
14
|
+
empty: 'dds-datatable__empty',
|
|
15
|
+
pager: 'dds-datatable__pager',
|
|
16
|
+
footnote: 'dds-datatable__footnote',
|
|
17
|
+
};
|
|
18
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
19
|
+
export const dataTableDefaults = { ground: 'page', pageSize: 10, searchLabel: 'Search the table', searchPlaceholder: 'Search', clearLabel: 'Clear search', emptyText: 'No results match your search.', paginationLabel: 'Table pages', previousLabel: 'Previous page', nextLabel: 'Next page', morePagesLabel: 'More pages' };
|