@deriv-com/dds-marketing 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.llm/components/awards.md +209 -0
- package/.llm/components/background.md +420 -0
- package/.llm/components/bottomsheet.md +5 -0
- package/.llm/components/comparisoncards.md +257 -0
- package/.llm/components/comparisontable.md +231 -0
- package/.llm/components/ctabanner.md +22 -0
- package/.llm/components/ctabannerslider.md +36 -2
- package/.llm/components/datatable.md +273 -0
- package/.llm/components/downloadbanner.md +283 -0
- package/.llm/components/featurecards.md +41 -3
- package/.llm/components/featurecardscarousel.md +311 -0
- package/.llm/components/featuresplit.md +5 -0
- package/.llm/components/featurestack.md +227 -0
- package/.llm/components/illustrationcard.md +236 -0
- package/.llm/components/illustrationscene.md +229 -0
- package/.llm/components/imagebanner.md +278 -0
- package/.llm/components/landinghero.md +24 -0
- package/.llm/components/navbar.md +1 -1
- package/.llm/components/navbaritem.md +4 -0
- package/.llm/components/pageheader.md +22 -0
- package/.llm/components/paginationdots.md +6 -1
- package/.llm/components/producthero.md +35 -11
- package/.llm/components/resourcebanner.md +247 -0
- package/.llm/components/scenescroll.md +222 -0
- package/.llm/components/select.md +17 -0
- package/.llm/components/stats.md +219 -0
- package/.llm/components/steps.md +286 -0
- package/.llm/components/stickycards.md +251 -0
- package/.llm/components/tableheadercell.md +19 -0
- package/.llm/components/teamgrid.md +243 -0
- package/.llm/components/testimonialrow.md +5 -0
- package/.llm/components/testimonialslider.md +14 -1
- package/.llm/components/textarea.md +13 -0
- package/.llm/components/textinput.md +13 -0
- package/.llm/components/textscroll.md +187 -0
- package/.llm/components/tiers.md +227 -0
- package/.llm/digest/awards.md +45 -0
- package/.llm/digest/background.md +53 -0
- package/.llm/digest/bottomsheet.md +2 -0
- package/.llm/digest/comparisoncards.md +51 -0
- package/.llm/digest/comparisontable.md +53 -0
- package/.llm/digest/ctabanner.md +4 -0
- package/.llm/digest/ctabannerslider.md +7 -0
- package/.llm/digest/datatable.md +65 -0
- package/.llm/digest/downloadbanner.md +65 -0
- package/.llm/digest/featurecards.md +1 -1
- package/.llm/digest/featurecardscarousel.md +54 -0
- package/.llm/digest/featuresplit.md +1 -0
- package/.llm/digest/featurestack.md +48 -0
- package/.llm/digest/illustrationcard.md +46 -0
- package/.llm/digest/illustrationscene.md +50 -0
- package/.llm/digest/imagebanner.md +64 -0
- package/.llm/digest/landinghero.md +7 -0
- package/.llm/digest/navbaritem.md +1 -0
- package/.llm/digest/pageheader.md +4 -0
- package/.llm/digest/paginationdots.md +3 -1
- package/.llm/digest/producthero.md +4 -2
- package/.llm/digest/resourcebanner.md +53 -0
- package/.llm/digest/scenescroll.md +49 -0
- package/.llm/digest/select.md +5 -0
- package/.llm/digest/stats.md +46 -0
- package/.llm/digest/steps.md +55 -0
- package/.llm/digest/stickycards.md +52 -0
- package/.llm/digest/tableheadercell.md +4 -0
- package/.llm/digest/teamgrid.md +53 -0
- package/.llm/digest/testimonialrow.md +2 -0
- package/.llm/digest/testimonialslider.md +4 -0
- package/.llm/digest/textarea.md +4 -0
- package/.llm/digest/textinput.md +4 -0
- package/.llm/digest/textscroll.md +43 -0
- package/.llm/digest/tiers.md +50 -0
- package/.llm/index.md +25 -2
- package/.llm/tokens.md +37 -1
- package/AGENTS.md +20 -1
- package/dist/components/awards-data.d.ts +24 -0
- package/dist/components/awards-data.js +11 -0
- package/dist/components/block-image-data.d.ts +24 -0
- package/dist/components/block-image-data.js +9 -0
- package/dist/components/blocks/awards/Awards.css +134 -0
- package/dist/components/blocks/awards/Awards.d.ts +24 -0
- package/dist/components/blocks/awards/Awards.js +114 -0
- package/dist/components/blocks/awards/Awards.types.d.ts +31 -0
- package/dist/components/blocks/awards/Awards.types.js +16 -0
- package/dist/components/blocks/awards/awards-impl.css +222 -0
- package/dist/components/blocks/cards-of.d.ts +16 -0
- package/dist/components/blocks/cards-of.js +23 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.css +195 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.d.ts +24 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.js +75 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.types.d.ts +49 -0
- package/dist/components/blocks/comparison-cards/ComparisonCards.types.js +26 -0
- package/dist/components/blocks/comparison-cards/comparison-cards-impl.css +262 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.css +111 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.d.ts +25 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.js +100 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.types.d.ts +36 -0
- package/dist/components/blocks/comparison-table/ComparisonTable.types.js +15 -0
- package/dist/components/blocks/comparison-table/comparison-table-impl.css +143 -0
- package/dist/components/blocks/cta-banner/CtaBanner.css +1 -0
- package/dist/components/blocks/cta-banner/CtaBanner.d.ts +1 -1
- package/dist/components/blocks/cta-banner/CtaBanner.js +3 -2
- package/dist/components/blocks/cta-banner/CtaBanner.types.d.ts +6 -0
- package/dist/components/blocks/cta-banner/CtaBanner.types.js +1 -1
- package/dist/components/blocks/cta-banner/cta-banner-impl.css +8 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.css +1 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.d.ts +1 -1
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.js +10 -5
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.d.ts +12 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.js +1 -1
- package/dist/components/blocks/cta-banner-slider/cta-banner-slider-impl.css +8 -0
- package/dist/components/blocks/data-table/DataTable.css +170 -0
- package/dist/components/blocks/data-table/DataTable.d.ts +29 -0
- package/dist/components/blocks/data-table/DataTable.js +84 -0
- package/dist/components/blocks/data-table/DataTable.types.d.ts +69 -0
- package/dist/components/blocks/data-table/DataTable.types.js +19 -0
- package/dist/components/blocks/data-table/data-table-impl.css +155 -0
- package/dist/components/blocks/download-banner/DownloadBanner.css +228 -0
- package/dist/components/blocks/download-banner/DownloadBanner.d.ts +28 -0
- package/dist/components/blocks/download-banner/DownloadBanner.js +75 -0
- package/dist/components/blocks/download-banner/DownloadBanner.types.d.ts +56 -0
- package/dist/components/blocks/download-banner/DownloadBanner.types.js +23 -0
- package/dist/components/blocks/download-banner/download-banner-impl.css +216 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.css +1 -0
- package/dist/components/blocks/faq-accordion/faq-accordion-impl.css +3 -7
- package/dist/components/blocks/feature-bullets/FeatureBullets.css +1 -0
- package/dist/components/blocks/feature-bullets/feature-bullets-impl.css +14 -1
- package/dist/components/blocks/feature-cards/FeatureCards.css +1 -0
- package/dist/components/blocks/feature-cards/FeatureCards.d.ts +2 -1
- package/dist/components/blocks/feature-cards/FeatureCards.js +4 -21
- package/dist/components/blocks/feature-cards/feature-cards-impl.css +10 -9
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.css +115 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.d.ts +30 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.js +160 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.types.d.ts +52 -0
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.types.js +17 -0
- package/dist/components/blocks/feature-cards-carousel/feature-cards-carousel-impl.css +207 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.css +1 -0
- package/dist/components/blocks/feature-split/FeatureSplit.css +1 -0
- package/dist/components/blocks/feature-split/feature-split-impl.css +14 -1
- package/dist/components/blocks/feature-stack/FeatureStack.css +86 -0
- package/dist/components/blocks/feature-stack/FeatureStack.d.ts +19 -0
- package/dist/components/blocks/feature-stack/FeatureStack.js +27 -0
- package/dist/components/blocks/feature-stack/FeatureStack.types.d.ts +34 -0
- package/dist/components/blocks/feature-stack/FeatureStack.types.js +14 -0
- package/dist/components/blocks/feature-stack/feature-stack-impl.css +87 -0
- package/dist/components/blocks/image-banner/ImageBanner.css +133 -0
- package/dist/components/blocks/image-banner/ImageBanner.d.ts +32 -0
- package/dist/components/blocks/image-banner/ImageBanner.js +41 -0
- package/dist/components/blocks/image-banner/ImageBanner.types.d.ts +54 -0
- package/dist/components/blocks/image-banner/ImageBanner.types.js +14 -0
- package/dist/components/blocks/image-banner/image-banner-impl.css +281 -0
- package/dist/components/blocks/landing-hero/LandingHero.css +1 -0
- package/dist/components/blocks/landing-hero/LandingHero.d.ts +1 -1
- package/dist/components/blocks/landing-hero/LandingHero.js +4 -3
- package/dist/components/blocks/landing-hero/LandingHero.types.d.ts +7 -3
- package/dist/components/blocks/logo-columns/LogoColumns.css +1 -0
- package/dist/components/blocks/logo-rows/LogoRows.css +1 -0
- package/dist/components/blocks/page-header/PageHeader.css +1 -0
- package/dist/components/blocks/page-header/PageHeader.d.ts +1 -1
- package/dist/components/blocks/page-header/PageHeader.js +3 -2
- package/dist/components/blocks/page-header/PageHeader.types.d.ts +6 -0
- package/dist/components/blocks/page-header/PageHeader.types.js +1 -1
- package/dist/components/blocks/page-header/page-header-impl.css +10 -0
- package/dist/components/blocks/product-hero/ProductHero.css +8 -3
- package/dist/components/blocks/product-hero/ProductHero.d.ts +1 -1
- package/dist/components/blocks/product-hero/ProductHero.js +5 -2
- package/dist/components/blocks/product-hero/ProductHero.types.d.ts +5 -1
- package/dist/components/blocks/product-hero/ProductHero.types.js +1 -0
- package/dist/components/blocks/product-hero/product-hero-impl.css +43 -12
- package/dist/components/blocks/resource-banner/ResourceBanner.css +106 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.d.ts +32 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.js +51 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.types.d.ts +44 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.types.js +14 -0
- package/dist/components/blocks/resource-banner/resource-banner-impl.css +69 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.css +93 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.d.ts +36 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.js +54 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.types.d.ts +32 -0
- package/dist/components/blocks/scene-scroll/SceneScroll.types.js +15 -0
- package/dist/components/blocks/scene-scroll/scene-scroll-impl.css +275 -0
- package/dist/components/blocks/stats/Stats.css +139 -0
- package/dist/components/blocks/stats/Stats.d.ts +24 -0
- package/dist/components/blocks/stats/Stats.js +120 -0
- package/dist/components/blocks/stats/Stats.types.d.ts +36 -0
- package/dist/components/blocks/stats/Stats.types.js +19 -0
- package/dist/components/blocks/stats/stats-count.d.ts +34 -0
- package/dist/components/blocks/stats/stats-count.js +61 -0
- package/dist/components/blocks/stats/stats-impl.css +284 -0
- package/dist/components/blocks/stats/use-wheel.d.ts +37 -0
- package/dist/components/blocks/stats/use-wheel.js +126 -0
- package/dist/components/blocks/steps/Steps.css +202 -0
- package/dist/components/blocks/steps/Steps.d.ts +32 -0
- package/dist/components/blocks/steps/Steps.js +65 -0
- package/dist/components/blocks/steps/Steps.types.d.ts +48 -0
- package/dist/components/blocks/steps/Steps.types.js +21 -0
- package/dist/components/blocks/steps/steps-impl.css +216 -0
- package/dist/components/blocks/steps/use-turn.d.ts +33 -0
- package/dist/components/blocks/steps/use-turn.js +75 -0
- package/dist/components/blocks/sticky-cards/StickyCards.css +154 -0
- package/dist/components/blocks/sticky-cards/StickyCards.d.ts +35 -0
- package/dist/components/blocks/sticky-cards/StickyCards.js +153 -0
- package/dist/components/blocks/sticky-cards/StickyCards.types.d.ts +43 -0
- package/dist/components/blocks/sticky-cards/StickyCards.types.js +18 -0
- package/dist/components/blocks/sticky-cards/sticky-cards-impl.css +393 -0
- package/dist/components/blocks/team-grid/TeamGrid.css +159 -0
- package/dist/components/blocks/team-grid/TeamGrid.d.ts +28 -0
- package/dist/components/blocks/team-grid/TeamGrid.js +74 -0
- package/dist/components/blocks/team-grid/TeamGrid.types.d.ts +51 -0
- package/dist/components/blocks/team-grid/TeamGrid.types.js +20 -0
- package/dist/components/blocks/team-grid/team-grid-impl.css +129 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.css +1 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.d.ts +1 -1
- package/dist/components/blocks/testimonial-row/TestimonialRow.js +4 -3
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.d.ts +3 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.js +1 -1
- package/dist/components/blocks/testimonial-row/testimonial-row-impl.css +8 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.css +1 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.d.ts +1 -1
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.js +2 -2
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.d.ts +8 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.js +1 -1
- package/dist/components/blocks/text-scroll/TextScroll.css +53 -0
- package/dist/components/blocks/text-scroll/TextScroll.d.ts +5 -0
- package/dist/components/blocks/text-scroll/TextScroll.js +71 -0
- package/dist/components/blocks/text-scroll/TextScroll.types.d.ts +22 -0
- package/dist/components/blocks/text-scroll/TextScroll.types.js +10 -0
- package/dist/components/blocks/text-scroll/text-scroll-impl.css +115 -0
- package/dist/components/blocks/tiers/Tiers.css +233 -0
- package/dist/components/blocks/tiers/Tiers.d.ts +32 -0
- package/dist/components/blocks/tiers/Tiers.js +68 -0
- package/dist/components/blocks/tiers/Tiers.types.d.ts +45 -0
- package/dist/components/blocks/tiers/Tiers.types.js +25 -0
- package/dist/components/blocks/tiers/tiers-impl.css +185 -0
- package/dist/components/blocks/use-rotation.d.ts +12 -2
- package/dist/components/blocks/use-rotation.js +6 -28
- package/dist/components/comparison-cards-data.d.ts +59 -0
- package/dist/components/comparison-cards-data.js +12 -0
- package/dist/components/comparison-table-data.d.ts +39 -0
- package/dist/components/comparison-table-data.js +11 -0
- package/dist/components/core/accordion-item/AccordionItem.css +1 -5
- package/dist/components/core/background/Background.css +92 -0
- package/dist/components/core/background/Background.d.ts +27 -0
- package/dist/components/core/background/Background.js +45 -0
- package/dist/components/core/background/Background.types.d.ts +39 -0
- package/dist/components/core/background/Background.types.js +11 -0
- package/dist/components/core/background/background-impl.css +760 -0
- package/dist/components/core/background/halftone.d.ts +134 -0
- package/dist/components/core/background/halftone.js +722 -0
- package/dist/components/core/background/patterns.d.ts +66 -0
- package/dist/components/core/background/patterns.js +244 -0
- package/dist/components/core/background/shader.d.ts +44 -0
- package/dist/components/core/background/shader.js +307 -0
- package/dist/components/core/background/use-halftone.d.ts +15 -0
- package/dist/components/core/background/use-halftone.js +27 -0
- package/dist/components/core/background/use-offscreen.d.ts +10 -0
- package/dist/components/core/background/use-offscreen.js +30 -0
- package/dist/components/core/background/use-shader.d.ts +11 -0
- package/dist/components/core/background/use-shader.js +25 -0
- package/dist/components/core/background/use-spotlight.d.ts +14 -0
- package/dist/components/core/background/use-spotlight.js +73 -0
- package/dist/components/core/bottom-sheet/BottomSheet.js +2 -2
- package/dist/components/core/bottom-sheet/BottomSheet.types.d.ts +3 -1
- package/dist/components/core/breadcrumb/Breadcrumb.d.ts +1 -0
- package/dist/components/core/breadcrumb/Breadcrumb.js +1 -0
- package/dist/components/core/breadcrumb/breadcrumb-impl.css +11 -0
- package/dist/components/core/button/button-impl.css +14 -1
- package/dist/components/core/illustration-card/IllustrationCard.css +40 -0
- package/dist/components/core/illustration-card/IllustrationCard.d.ts +22 -0
- package/dist/components/core/illustration-card/IllustrationCard.js +82 -0
- package/dist/components/core/illustration-card/IllustrationCard.types.d.ts +23 -0
- package/dist/components/core/illustration-card/IllustrationCard.types.js +8 -0
- package/dist/components/core/illustration-card/illustration-card-impl.css +47 -0
- package/dist/components/core/illustration-scene/IllustrationScene.css +41 -0
- package/dist/components/core/illustration-scene/IllustrationScene.d.ts +14 -0
- package/dist/components/core/illustration-scene/IllustrationScene.js +16 -0
- package/dist/components/core/illustration-scene/IllustrationScene.types.d.ts +32 -0
- package/dist/components/core/illustration-scene/IllustrationScene.types.js +8 -0
- package/dist/components/core/illustration-scene/illustration-scene-impl.css +46 -0
- package/dist/components/core/link/Link.js +7 -3
- package/dist/components/core/link/link-impl.css +29 -2
- package/dist/components/core/navbar/Navbar.css +2 -2
- package/dist/components/core/navbar/Navbar.types.d.ts +1 -1
- package/dist/components/core/navbar-item/NavbarItem.d.ts +2 -1
- package/dist/components/core/navbar-item/NavbarItem.js +3 -10
- package/dist/components/core/navbar-item/NavbarItem.types.d.ts +4 -1
- package/dist/components/core/navbar-item/NavbarItem.types.js +1 -1
- package/dist/components/core/navbar-item/navbar-item-impl.css +10 -0
- package/dist/components/core/navbar-menu/navbar-menu-impl.css +9 -0
- package/dist/components/core/navbar-switcher/navbar-switcher-impl.css +19 -0
- package/dist/components/core/pagination/Pagination.js +1 -1
- package/dist/components/core/pagination/pagination-impl.css +9 -0
- package/dist/components/core/pagination-dots/PaginationDots.d.ts +1 -1
- package/dist/components/core/pagination-dots/PaginationDots.js +3 -3
- package/dist/components/core/pagination-dots/PaginationDots.types.d.ts +3 -1
- package/dist/components/core/segmented-control/SegmentedControl.css +4 -3
- package/dist/components/core/segmented-control/SegmentedControl.js +17 -3
- package/dist/components/core/segmented-control-item/SegmentedControlItem.css +2 -1
- package/dist/components/core/select/Select.js +3 -3
- package/dist/components/core/select/Select.types.d.ts +11 -1
- package/dist/components/core/select/Select.types.js +1 -1
- package/dist/components/core/tab-list/TabList.js +9 -1
- package/dist/components/core/table-header-cell/TableHeaderCell.d.ts +1 -1
- package/dist/components/core/table-header-cell/TableHeaderCell.js +5 -2
- package/dist/components/core/table-header-cell/TableHeaderCell.types.d.ts +7 -1
- package/dist/components/core/table-header-cell/TableHeaderCell.types.js +1 -1
- package/dist/components/core/text-area/TextArea.d.ts +1 -1
- package/dist/components/core/text-area/TextArea.js +2 -2
- package/dist/components/core/text-area/TextArea.types.d.ts +9 -1
- package/dist/components/core/text-area/TextArea.types.js +1 -1
- package/dist/components/core/text-input/TextInput.d.ts +1 -1
- package/dist/components/core/text-input/TextInput.js +2 -2
- package/dist/components/core/text-input/TextInput.types.d.ts +9 -1
- package/dist/components/core/text-input/TextInput.types.js +1 -1
- package/dist/components/data-table-data.d.ts +33 -0
- package/dist/components/data-table-data.js +12 -0
- package/dist/components/download-banner-data.d.ts +52 -0
- package/dist/components/download-banner-data.js +11 -0
- package/dist/components/index.d.ts +51 -0
- package/dist/components/index.js +38 -0
- package/dist/components/resource-banner-data.d.ts +34 -0
- package/dist/components/resource-banner-data.js +13 -0
- package/dist/components/scene-scroll-data.d.ts +24 -0
- package/dist/components/scene-scroll-data.js +9 -0
- package/dist/components/stats-data.d.ts +28 -0
- package/dist/components/stats-data.js +11 -0
- package/dist/components/steps-data.d.ts +38 -0
- package/dist/components/steps-data.js +13 -0
- package/dist/components/sticky-cards-data.d.ts +43 -0
- package/dist/components/sticky-cards-data.js +12 -0
- package/dist/components/team-grid-data.d.ts +38 -0
- package/dist/components/team-grid-data.js +11 -0
- package/dist/components/tiers-data.d.ts +47 -0
- package/dist/components/tiers-data.js +13 -0
- package/dist/marketing.css +101 -28
- package/package.json +1 -1
|
@@ -0,0 +1,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' };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Scoped to this package, like the generated sheet beside it.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* The frame's fill: the stack the table's pinned column paints.
|
|
7
|
+
*
|
|
8
|
+
* Table's pinned first column cannot be see-through — the values slide under it — so it paints a
|
|
9
|
+
* ground of its own, and that ground is a fixed stack: the page as an opaque floor, the grey band
|
|
10
|
+
* over it and a raised card over that. In light all three are opaque and the stack is white; in
|
|
11
|
+
* dark the band and the card are each white at six, so the stack is a lifted grey. The frame
|
|
12
|
+
* paints the same stack, which is what makes the pinned cells the frame's own colour on every
|
|
13
|
+
* ground and in both themes rather than a strip of a slightly different grey down the table.
|
|
14
|
+
*
|
|
15
|
+
* The floor is the contract's binding; the two layers over it are here because a binding holds
|
|
16
|
+
* one layer and this is two. Listed topmost first, as Table lists them.
|
|
17
|
+
*/
|
|
18
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__frame {
|
|
19
|
+
background-image:
|
|
20
|
+
linear-gradient(var(--color-bg-surface-card-raised), var(--color-bg-surface-card-raised)),
|
|
21
|
+
linear-gradient(var(--color-bg-band-subtle), var(--color-bg-band-subtle));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* A part waiting for its state is out of the layout, not merely empty.
|
|
26
|
+
*
|
|
27
|
+
* The empty line and the pager are always in the markup and `hidden` until they are wanted. The
|
|
28
|
+
* browser's own `[hidden]` is `display: none` at the lowest weight there is, and the generated
|
|
29
|
+
* sheet's `display: flex` on the pager beats it — so it is said again here, a class deeper.
|
|
30
|
+
*/
|
|
31
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__empty[hidden],
|
|
32
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__pager[hidden] {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* The table's name is the heading's, already on screen.
|
|
38
|
+
*
|
|
39
|
+
* Table names its grid and its scroller from its caption and from nothing else, so the heading's
|
|
40
|
+
* words are handed to it as one — and clipped here rather than drawn a second time an inch under
|
|
41
|
+
* the first. Clipped, not hidden: `display: none` would take the name out of the accessibility
|
|
42
|
+
* tree with the pixels, which is the half that was wanted.
|
|
43
|
+
*
|
|
44
|
+
* SegmentedControlItem's recipe: `clip-path: inset(50%)` clips the caption to nothing without the
|
|
45
|
+
* one-pixel box of the older one, which needs a raw dimension no token covers, and `position:
|
|
46
|
+
* absolute` takes it out of the flow so the grid starts at the frame's rule. The frame is the
|
|
47
|
+
* positioned box it is held in — see its `position` in the contract — so it cannot stray to the
|
|
48
|
+
* foot of the document and widen it.
|
|
49
|
+
*/
|
|
50
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-table .dds-table__caption {
|
|
51
|
+
clip-path: inset(50%);
|
|
52
|
+
padding: 0;
|
|
53
|
+
position: absolute;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* The scroller's focus ring, drawn inside its edge.
|
|
59
|
+
*
|
|
60
|
+
* The table runs the frame's full width and the frame clips to keep its corner, so a ring drawn
|
|
61
|
+
* outside the scroller — Table's own — would be cut off down both sides, which is a ring a keyboard
|
|
62
|
+
* reader sees only half of. Pulled in by its own width, it is whole.
|
|
63
|
+
*/
|
|
64
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-table {
|
|
65
|
+
outline-offset: calc(-1 * var(--border-width-focus));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* Values on one line, so the table is as wide as its values and scrolls.
|
|
70
|
+
*
|
|
71
|
+
* A specification table's values are short — "1:1000", "-3.00", "Mon–Fri 00:00–21:00" — and one
|
|
72
|
+
* broken over two lines is one a reader misreads down the column. Held to a line, the columns take
|
|
73
|
+
* the room their values need, and the scroller takes the rest: the reference's `max-content` table.
|
|
74
|
+
*
|
|
75
|
+
* Written against the cell's `data-overflow` so it outweighs TableCell's own `wrap` rule, which
|
|
76
|
+
* would otherwise tie with it and win on order — TableCell's sheet arrives after this one.
|
|
77
|
+
*/
|
|
78
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-tablecell[data-overflow] {
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
* The row's name: a row header that reads as the row's name rather than as a column's.
|
|
84
|
+
*
|
|
85
|
+
* TableHeaderCell is drawn for the header row — muted, ranged to the foot of the cell, at a
|
|
86
|
+
* label's tight leading — and two of those are wrong down the side of the table. The name is the
|
|
87
|
+
* strongest thing in its row, so it takes the default ink; and it sits at the top of the row at the
|
|
88
|
+
* values' leading, as the values beside it do, so the first lines share a baseline.
|
|
89
|
+
*
|
|
90
|
+
* It keeps the header's single line. Allowed to wrap, the one column that could was the one the
|
|
91
|
+
* table squeezed whenever it nearly fitted — "Boom 1000 Index" over three lines beside values with
|
|
92
|
+
* room to spare — so the name holds its width and the values scroll under it instead.
|
|
93
|
+
*/
|
|
94
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-tableheadercell[scope='row'] {
|
|
95
|
+
color: var(--color-fg-default);
|
|
96
|
+
line-height: var(--font-body-sm-line-height);
|
|
97
|
+
vertical-align: top;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/*
|
|
101
|
+
* From the fold, the heading group is centred over the table, the small print centred under it,
|
|
102
|
+
* and the pages move to the end edge.
|
|
103
|
+
*
|
|
104
|
+
* Stats' rule and its reason for the header: content stacked under a heading takes a centred
|
|
105
|
+
* heading, and the header and its line are capped narrower than the column, so `margin-inline:
|
|
106
|
+
* auto` is what centres those boxes rather than their words inside a box left at the start edge.
|
|
107
|
+
* The note under the table follows the reference, centred under the frame. The pages are centred
|
|
108
|
+
* on a phone, where they are the width of the frame, and go to the end edge beside nothing once
|
|
109
|
+
* there is room — the reference's footer.
|
|
110
|
+
*
|
|
111
|
+
* `48rem` longhand because `var()` is not permitted in a container query condition, and it is the
|
|
112
|
+
* width the rest of this package folds at.
|
|
113
|
+
*/
|
|
114
|
+
@container (min-width: 48rem) {
|
|
115
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__header {
|
|
116
|
+
align-items: center;
|
|
117
|
+
margin-inline: auto;
|
|
118
|
+
text-align: center;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__description {
|
|
122
|
+
margin-inline: auto;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__pager {
|
|
126
|
+
justify-content: flex-end;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* The small print centres under the table with the heading over it; on a phone both start at the edge. */
|
|
130
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__footnote {
|
|
131
|
+
margin-inline: auto;
|
|
132
|
+
text-align: center;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/*
|
|
137
|
+
* A heading with no line under it closes up, Stats' way: its bound step is the distance to the
|
|
138
|
+
* line, and with nothing there it would only add to the step from the header to the table.
|
|
139
|
+
*/
|
|
140
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__title:last-child {
|
|
141
|
+
margin-block-end: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/*
|
|
145
|
+
* On a phone the search takes the row, as size.data-table.search says: the cap is for the fold,
|
|
146
|
+
* where the search shares its row with the count. Below it the count wraps underneath, and a search
|
|
147
|
+
* stopped short of the edge is room thrown away on the narrowest screen.
|
|
148
|
+
*
|
|
149
|
+
* `47.9375rem` is the last width below the fold, LogoRows' bound.
|
|
150
|
+
*/
|
|
151
|
+
@container (max-width: 47.9375rem) {
|
|
152
|
+
:where([data-dds-context="marketing"]) .dds-datatable .dds-datatable__search {
|
|
153
|
+
max-inline-size: none;
|
|
154
|
+
}
|
|
155
|
+
}
|