@deriv-com/dds-marketing 1.0.2 → 1.1.1
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 +22 -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,262 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Scoped to this package, like the generated sheet beside it.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* The header starts on a phone and is centred once the band is wide enough to hold a line.
|
|
7
|
+
*
|
|
8
|
+
* FeatureCards' rule and its reason: the cards are stacked content under the heading, so a centred
|
|
9
|
+
* heading is symmetric with them — but centred text starts every line at a different edge, which
|
|
10
|
+
* costs a great deal across a phone's measure. The header and its line are capped narrower than the
|
|
11
|
+
* column, so `margin-inline: auto` is what centres those boxes rather than their words.
|
|
12
|
+
*
|
|
13
|
+
* `48rem` longhand because `var()` is not permitted in a container query condition, and it is the
|
|
14
|
+
* width the rest of this package folds at.
|
|
15
|
+
*/
|
|
16
|
+
@container (min-width: 48rem) {
|
|
17
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__header {
|
|
18
|
+
align-items: center;
|
|
19
|
+
margin-inline: auto;
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__description {
|
|
24
|
+
margin-inline: auto;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
* One column on a phone. `minmax(0, 1fr)` rather than `1fr`, so a long unbroken value shrinks to
|
|
30
|
+
* the column instead of pushing the grid past the page.
|
|
31
|
+
*/
|
|
32
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid {
|
|
33
|
+
grid-template-columns: minmax(0, 1fr);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* A rule under every row but the last, in the card's own ink receded to opacity.track.
|
|
38
|
+
*
|
|
39
|
+
* The cards are several grounds — the page's own surface, which follows the theme, the fixed light
|
|
40
|
+
* surface and the coral of the highlighted set — and no one border role reads on all of them: the
|
|
41
|
+
* page's rules follow the theme, so color.border.default is white at sixteen on the fixed light card
|
|
42
|
+
* in dark mode and gone. The card's ink is the one colour certain to read on its own ground, so the
|
|
43
|
+
* rule is that ink, receded the way a track recedes behind the mark it carries. One rule for every
|
|
44
|
+
* card, and nothing to keep in step with the card's tone.
|
|
45
|
+
*/
|
|
46
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__row {
|
|
47
|
+
border-block-end-color: color-mix(in srgb, currentColor calc(var(--opacity-track) * 100%), transparent);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
* A long value wraps before it squeezes its label.
|
|
52
|
+
*
|
|
53
|
+
* Both halves of a row start at the width of their words and shrink in proportion to it, so a value
|
|
54
|
+
* a sentence long took the whole line and broke a two-word label over two lines. The value is held
|
|
55
|
+
* to three fifths of the row, the reference design's own cap give or take, and wraps at the end
|
|
56
|
+
* edge inside it; the label keeps the rest.
|
|
57
|
+
*/
|
|
58
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__row-value {
|
|
59
|
+
max-inline-size: 60%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__row:last-child {
|
|
63
|
+
border-block-end-width: var(--border-width-none);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* Side by side, the cards share the grid's rows.
|
|
68
|
+
*
|
|
69
|
+
* Two cards from the fold and three at full width — and three stay stacked until then, because a
|
|
70
|
+
* third card under a pair is compared with nothing beside it. Four are two rows of two from the
|
|
71
|
+
* fold, every card with a neighbour, and one row of four at full width. `:has()` asks the markup how many
|
|
72
|
+
* there are, FeatureCards' way; 64rem is where three columns of label and value have room.
|
|
73
|
+
*
|
|
74
|
+
* What lines the rows up is subgrid. Each cell spans the same run of the grid's rows — one for the
|
|
75
|
+
* intro, one per row of the longest card, one for the foot, a count the component hands over as
|
|
76
|
+
* `--dds-comparisoncards-tracks` — and the cell, the Card, the body and the list each pass those rows
|
|
77
|
+
* down rather than starting their own. So an intro two lines long in one card makes the intro row
|
|
78
|
+
* two lines long in all of them, and every card's first row starts level; a value that wraps in one
|
|
79
|
+
* card makes that row taller in every card, and the rules under it stay level too. Every card is as
|
|
80
|
+
* tall as the tallest for the same reason.
|
|
81
|
+
*
|
|
82
|
+
* The grid's row gap goes to nothing here, because its rows are now the cards' own lines rather than
|
|
83
|
+
* rows of cards: a gutter between them would open inside every card. Side by side there is only one
|
|
84
|
+
* row of cards, so the gutter has nothing else to separate.
|
|
85
|
+
*
|
|
86
|
+
* Written twice, once for each width, because a container query cannot be shared and the pair's
|
|
87
|
+
* rules have to hold from the fold while the three's start at full width. Where subgrid is not
|
|
88
|
+
* supported the cards still sit side by side, stretched to one height, and only the rows go unaligned.
|
|
89
|
+
*/
|
|
90
|
+
@container (min-width: 48rem) {
|
|
91
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(2):last-child), :has(> :nth-child(4):last-child)) {
|
|
92
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
93
|
+
row-gap: var(--space-gap-none);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(2):last-child), :has(> :nth-child(4):last-child)) > .dds-comparisoncards__item {
|
|
97
|
+
grid-row: span var(--dds-comparisoncards-tracks);
|
|
98
|
+
grid-template-rows: subgrid;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* The Card is a flex column of its own; here it is a grid passing the cell's rows on. */
|
|
102
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(2):last-child), :has(> :nth-child(4):last-child)) > .dds-comparisoncards__item > .dds-card,
|
|
103
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(2):last-child), :has(> :nth-child(4):last-child)) .dds-comparisoncards__body {
|
|
104
|
+
display: grid;
|
|
105
|
+
grid-row: 1 / -1;
|
|
106
|
+
grid-template-rows: subgrid;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(2):last-child), :has(> :nth-child(4):last-child)) .dds-comparisoncards__intro {
|
|
110
|
+
grid-row: 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Every row but the first and the last, so a card with fewer rows than its neighbour leaves the
|
|
114
|
+
rest empty and its foot still lands in the last row with the others. */
|
|
115
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(2):last-child), :has(> :nth-child(4):last-child)) .dds-comparisoncards__rows {
|
|
116
|
+
display: grid;
|
|
117
|
+
grid-row: 2 / -2;
|
|
118
|
+
grid-template-rows: subgrid;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(2):last-child), :has(> :nth-child(4):last-child)) .dds-comparisoncards__footer {
|
|
122
|
+
grid-row: -2 / -1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Four make two rows of two, and the second pair stands a gutter below the first. The grid's own
|
|
126
|
+
row gap is spent — it would open inside every card — so the gap is the lower cells' margin,
|
|
127
|
+
which a subgrid adds to the rows at its edge and keeps out of the rows inside it. */
|
|
128
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:has(> :nth-child(4):last-child) > .dds-comparisoncards__item:nth-child(n + 3) {
|
|
129
|
+
margin-block-start: var(--space-grid-gutter);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@container (min-width: 64rem) {
|
|
134
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:has(> :nth-child(3):last-child) {
|
|
135
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
136
|
+
row-gap: var(--space-gap-none);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* And four in one row of four: the second pair back level with the first. */
|
|
140
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:has(> :nth-child(4):last-child) {
|
|
141
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:has(> :nth-child(4):last-child) > .dds-comparisoncards__item:nth-child(n + 3) {
|
|
145
|
+
margin-block-start: 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(3):last-child), :has(> :nth-child(4):last-child)) > .dds-comparisoncards__item {
|
|
149
|
+
grid-row: span var(--dds-comparisoncards-tracks);
|
|
150
|
+
grid-template-rows: subgrid;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(3):last-child), :has(> :nth-child(4):last-child)) > .dds-comparisoncards__item > .dds-card,
|
|
154
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(3):last-child), :has(> :nth-child(4):last-child)) .dds-comparisoncards__body {
|
|
155
|
+
display: grid;
|
|
156
|
+
grid-row: 1 / -1;
|
|
157
|
+
grid-template-rows: subgrid;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(3):last-child), :has(> :nth-child(4):last-child)) .dds-comparisoncards__intro {
|
|
161
|
+
grid-row: 1;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(3):last-child), :has(> :nth-child(4):last-child)) .dds-comparisoncards__rows {
|
|
165
|
+
display: grid;
|
|
166
|
+
grid-row: 2 / -2;
|
|
167
|
+
grid-template-rows: subgrid;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:is(:has(> :nth-child(3):last-child), :has(> :nth-child(4):last-child)) .dds-comparisoncards__footer {
|
|
171
|
+
grid-row: -2 / -1;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/*
|
|
176
|
+
* The light card turns white on the subtle band.
|
|
177
|
+
*
|
|
178
|
+
* FeatureCards' answer and its reason. surface-light is gray.50 in both themes, and so is the subtle
|
|
179
|
+
* band in light mode, so the card had no edge there: it takes color.bg.surface-card-light-raised,
|
|
180
|
+
* white in light and its own gray.50 in dark. The block knows its ground and the card does not, so
|
|
181
|
+
* the answer is here rather than in Card; the ink is the card's own and does not change.
|
|
182
|
+
*/
|
|
183
|
+
:where([data-dds-context="marketing"])
|
|
184
|
+
.dds-comparisoncards[data-ground="subtle"]
|
|
185
|
+
.dds-comparisoncards__item
|
|
186
|
+
> .dds-card[data-variant="surface-light"] {
|
|
187
|
+
background-color: var(--color-bg-surface-card-light-raised);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/*
|
|
191
|
+
* And the standard card — Card's own surface, which follows the theme — on the painted grounds,
|
|
192
|
+
* FeatureCards' rules for the same card. On the grey band its recessed fill is the band's grey and
|
|
193
|
+
* vanishes, so it takes the raised fill, color.bg.surface-card-raised. On the dark band its fill and
|
|
194
|
+
* ink are made for a light page, dark words on near-black, so it turns round to the inverse surface
|
|
195
|
+
* and white ink, the values Card's own inverse uses.
|
|
196
|
+
*/
|
|
197
|
+
:where([data-dds-context="marketing"])
|
|
198
|
+
.dds-comparisoncards[data-ground="subtle"]
|
|
199
|
+
.dds-comparisoncards__item
|
|
200
|
+
> .dds-card[data-variant="surface"] {
|
|
201
|
+
background-color: var(--color-bg-surface-card-raised);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:where([data-dds-context="marketing"])
|
|
205
|
+
.dds-comparisoncards[data-ground="strong"]
|
|
206
|
+
.dds-comparisoncards__item
|
|
207
|
+
> .dds-card[data-variant="surface"] {
|
|
208
|
+
background-color: var(--color-bg-surface-inverse);
|
|
209
|
+
color: var(--color-fg-on-brand-strong);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/*
|
|
213
|
+
* The highlighted variant: the recommended card lifted off the page.
|
|
214
|
+
*
|
|
215
|
+
* The lift is elevation.surface.raised rather than movement — a card moved up would move its rows
|
|
216
|
+
* off their neighbours', and the rows lining up is the point of the block.
|
|
217
|
+
*
|
|
218
|
+
* Its badge is pinned to the card's top end corner, space.inset.xs in from the top and from the
|
|
219
|
+
* end edge, out of the card's flow so it moves no row; the card is what it is placed against.
|
|
220
|
+
*/
|
|
221
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards[data-variant='highlighted'] .dds-comparisoncards__item[data-recommended] > .dds-card {
|
|
222
|
+
box-shadow: var(--elevation-surface-raised);
|
|
223
|
+
position: relative;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__highlight {
|
|
227
|
+
inset-block-start: var(--space-inset-xs);
|
|
228
|
+
inset-inline-end: var(--space-inset-xs);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/*
|
|
232
|
+
* A heading with no line under it closes up: its bound step is the distance to the line, and with
|
|
233
|
+
* nothing there it would only add to the step from the header to what follows. `:last-child` is the
|
|
234
|
+
* condition itself, DataTable's way, rather than a prop standing in for it.
|
|
235
|
+
*/
|
|
236
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__title:last-child {
|
|
237
|
+
margin-block-end: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/*
|
|
241
|
+
* A recommended card with a badge starts its title below the badge.
|
|
242
|
+
*
|
|
243
|
+
* The badge is pinned into the card's top end corner, out of the flow, and the title runs under it
|
|
244
|
+
* — a long title on a narrow card ran beneath the badge. The head steps down by space.inset.md, so
|
|
245
|
+
* the title's first line clears the badge however long it runs, and the rows below still line up
|
|
246
|
+
* with the other cards', the head being the row the subgrid lets grow.
|
|
247
|
+
*/
|
|
248
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards[data-variant='highlighted'] .dds-comparisoncards__item[data-recommended]:has(.dds-comparisoncards__highlight) .dds-comparisoncards__card-head {
|
|
249
|
+
padding-block-start: var(--space-inset-md);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/*
|
|
253
|
+
* A pair holds to two thirds of the row from full width, centred — FeatureCards' rule and its
|
|
254
|
+
* reason: two cards across the whole width put each label half a page from its value.
|
|
255
|
+
*/
|
|
256
|
+
@container (min-width: 64rem) {
|
|
257
|
+
:where([data-dds-context="marketing"]) .dds-comparisoncards .dds-comparisoncards__grid:has(> :nth-child(2):last-child) {
|
|
258
|
+
inline-size: 100%;
|
|
259
|
+
margin-inline: auto;
|
|
260
|
+
max-inline-size: calc((100% - 2 * var(--space-grid-gutter)) * 2 / 3 + var(--space-grid-gutter));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* GENERATED from comparisontable.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable {
|
|
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-comparisontable .dds-comparisontable__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-comparisontable .dds-comparisontable__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-comparisontable .dds-comparisontable__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-comparisontable .dds-comparisontable__description {
|
|
44
|
+
margin: 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-comparisontable .dds-comparisontable__body {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
min-inline-size: 0;
|
|
57
|
+
row-gap: var(--space-gap-md);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-comparisontable__cell-list {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
list-style: none;
|
|
64
|
+
margin: 0;
|
|
65
|
+
padding: 0;
|
|
66
|
+
row-gap: var(--space-gap-xs);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-comparisontable__footnote {
|
|
70
|
+
margin: 0;
|
|
71
|
+
font-family: var(--font-body-sm-family);
|
|
72
|
+
font-size: var(--font-body-sm-size);
|
|
73
|
+
font-weight: var(--font-body-sm-weight);
|
|
74
|
+
letter-spacing: var(--font-body-sm-letter-spacing);
|
|
75
|
+
line-height: var(--font-body-sm-line-height);
|
|
76
|
+
max-inline-size: var(--size-measure-description);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable .dds-comparisontable__row-header {
|
|
80
|
+
font-weight: var(--font-label-md-weight);
|
|
81
|
+
letter-spacing: var(--font-label-md-letter-spacing);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable[data-ground="page"] {
|
|
85
|
+
background-color: var(--color-bg-page);
|
|
86
|
+
color: var(--color-fg-default);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable[data-ground="page"] .dds-comparisontable__footnote {
|
|
90
|
+
color: var(--color-fg-muted);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable[data-ground="strong"] {
|
|
94
|
+
background-color: var(--color-bg-brand-strong);
|
|
95
|
+
color: var(--color-fg-on-brand-strong);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable[data-ground="strong"] .dds-comparisontable__footnote {
|
|
99
|
+
color: var(--color-fg-muted-inverse);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable[data-ground="subtle"] {
|
|
103
|
+
background-color: var(--color-bg-page);
|
|
104
|
+
background-image: linear-gradient(var(--color-bg-band-subtle), var(--color-bg-band-subtle));
|
|
105
|
+
color: var(--color-fg-default);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:where([data-dds-context="marketing"]) .dds-comparisontable[data-ground="subtle"] .dds-comparisontable__footnote {
|
|
109
|
+
color: var(--color-fg-muted);
|
|
110
|
+
}
|
|
111
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import './ComparisonTable.css';
|
|
2
|
+
import './comparison-table-impl.css';
|
|
3
|
+
import '../block-reveal.css';
|
|
4
|
+
import { type ComparisonTableProps } from './ComparisonTable.types.js';
|
|
5
|
+
export type { ComparisonTableProps };
|
|
6
|
+
/**
|
|
7
|
+
* A heading over a short comparison table — the reference site's DynamicTable, named for its job.
|
|
8
|
+
*
|
|
9
|
+
* Nothing is drawn here that the page already has. The card is the page's own Card and the grid is
|
|
10
|
+
* the page's own Table — its head, body, rows and cells — so the corner, the rules, a cell's inset
|
|
11
|
+
* and the scroll on a phone are theirs. What is this block's is the section around them and the
|
|
12
|
+
* three things the reference asks of the table that its props do not reach: the light band under
|
|
13
|
+
* the column names, the bold first column, and the columns' share of a card that scrolls rather
|
|
14
|
+
* than squeezes. The first is the impl sheet's, the second the row header above, the third a column
|
|
15
|
+
* count handed to the sheet as a custom property, FeatureScroll's way of passing a count.
|
|
16
|
+
*
|
|
17
|
+
* Its columns and rows are records rather than children, the way ComparisonCards takes its cards:
|
|
18
|
+
* every row has to be drawn against the same columns, which the block cannot check inside rows it
|
|
19
|
+
* was handed whole. Only the first four columns are drawn, the reference's own ceiling.
|
|
20
|
+
*
|
|
21
|
+
* It arrives the way every block does: the heading and the line, then the table, then its note.
|
|
22
|
+
* `'use client'` for that, for `useId`, which names the region by its heading — and because Table,
|
|
23
|
+
* which it composes, is a client component already.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ComparisonTable({ ground, title, description, columns, rows, footnote, }: ComparisonTableProps): import("react").JSX.Element | null;
|
|
@@ -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' };
|