@deriv-com/dds-marketing 1.1.3 → 1.2.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/accordion.md +6 -0
- package/.llm/components/accordionitem.md +6 -0
- package/.llm/components/aspectratio.md +6 -0
- package/.llm/components/awards.md +6 -0
- package/.llm/components/background.md +49 -10
- package/.llm/components/badge.md +6 -0
- package/.llm/components/bottomsheet.md +6 -0
- package/.llm/components/breadcrumb.md +6 -0
- package/.llm/components/breadcrumbitem.md +6 -0
- package/.llm/components/button.md +9 -3
- package/.llm/components/buttonicon.md +7 -1
- package/.llm/components/card.md +6 -0
- package/.llm/components/cardbody.md +7 -1
- package/.llm/components/cardbutton.md +6 -0
- package/.llm/components/checkbox.md +6 -0
- package/.llm/components/comparisoncards.md +9 -3
- package/.llm/components/comparisontable.md +6 -0
- package/.llm/components/ctabanner.md +6 -0
- package/.llm/components/ctabannerslider.md +6 -0
- package/.llm/components/datatable.md +6 -0
- package/.llm/components/divider.md +6 -0
- package/.llm/components/documentlink.md +237 -0
- package/.llm/components/documents.md +268 -0
- package/.llm/components/downloadbanner.md +7 -1
- package/.llm/components/dropdownmenu.md +6 -0
- package/.llm/components/estimator.md +6 -0
- package/.llm/components/faqaccordion.md +6 -0
- package/.llm/components/featurebullets.md +6 -0
- package/.llm/components/featurecards.md +42 -2
- package/.llm/components/featurecardscarousel.md +7 -1
- package/.llm/components/featurescroll.md +6 -0
- package/.llm/components/featuresplit.md +6 -0
- package/.llm/components/featurestack.md +6 -0
- package/.llm/components/featuretabs.md +369 -0
- package/.llm/components/filterchip.md +6 -0
- package/.llm/components/footer.md +6 -0
- package/.llm/components/footergroup.md +6 -0
- package/.llm/components/grid.md +30 -1
- package/.llm/components/icon.md +6 -0
- package/.llm/components/illustrationcard.md +52 -2
- package/.llm/components/illustrationcheck.md +193 -0
- package/.llm/components/illustrationchoice.md +187 -0
- package/.llm/components/illustrationcode.md +192 -0
- package/.llm/components/illustrationlist.md +175 -0
- package/.llm/components/illustrationscene.md +29 -3
- package/.llm/components/imagebanner.md +30 -5
- package/.llm/components/landinghero.md +6 -0
- package/.llm/components/link.md +7 -1
- package/.llm/components/logocolumns.md +7 -1
- package/.llm/components/logorows.md +42 -2
- package/.llm/components/menuitem.md +6 -0
- package/.llm/components/navbar.md +6 -0
- package/.llm/components/navbaritem.md +6 -0
- package/.llm/components/navbarmenu.md +6 -0
- package/.llm/components/navbarmenugroup.md +6 -0
- package/.llm/components/navbarpanel.md +6 -0
- package/.llm/components/navbarswitcher.md +6 -0
- package/.llm/components/navbarswitcheroption.md +6 -0
- package/.llm/components/option.md +6 -0
- package/.llm/components/pageheader.md +6 -0
- package/.llm/components/pagination.md +6 -0
- package/.llm/components/paginationdots.md +6 -0
- package/.llm/components/producthero.md +29 -4
- package/.llm/components/progressbar.md +305 -0
- package/.llm/components/removablechip.md +6 -0
- package/.llm/components/resourcebanner.md +6 -0
- package/.llm/components/row.md +6 -0
- package/.llm/components/scenescroll.md +38 -24
- package/.llm/components/scenescrollword.md +267 -0
- package/.llm/components/scroller.md +6 -0
- package/.llm/components/searchinput.md +6 -0
- package/.llm/components/segmentedcontrol.md +28 -1
- package/.llm/components/segmentedcontrolitem.md +6 -0
- package/.llm/components/select.md +6 -0
- package/.llm/components/selectchip.md +6 -0
- package/.llm/components/spinner.md +6 -0
- package/.llm/components/stack.md +6 -0
- package/.llm/components/stats.md +46 -1
- package/.llm/components/statscarousel.md +227 -0
- package/.llm/components/statusdot.md +41 -1
- package/.llm/components/steps.md +6 -0
- package/.llm/components/stickycards.md +6 -0
- package/.llm/components/subdomainnavbar.md +6 -0
- package/.llm/components/tab.md +6 -0
- package/.llm/components/table.md +6 -0
- package/.llm/components/tablebody.md +6 -0
- package/.llm/components/tablecell.md +6 -0
- package/.llm/components/tablehead.md +6 -0
- package/.llm/components/tableheadercell.md +6 -0
- package/.llm/components/tablerow.md +6 -0
- package/.llm/components/tablist.md +6 -0
- package/.llm/components/teamgrid.md +6 -0
- package/.llm/components/testimonialrow.md +43 -3
- package/.llm/components/testimonialslider.md +8 -2
- package/.llm/components/textarea.md +6 -0
- package/.llm/components/textinput.md +6 -0
- package/.llm/components/textscroll.md +6 -0
- package/.llm/components/tiers.md +13 -7
- package/.llm/components/tooltip.md +6 -0
- package/.llm/components/typography.md +63 -1
- package/.llm/digest/background.md +14 -6
- package/.llm/digest/button.md +1 -1
- package/.llm/digest/buttonicon.md +1 -1
- package/.llm/digest/documentlink.md +52 -0
- package/.llm/digest/documents.md +51 -0
- package/.llm/digest/downloadbanner.md +1 -1
- package/.llm/digest/featurecards.md +7 -0
- package/.llm/digest/featuretabs.md +50 -0
- package/.llm/digest/grid.md +1 -0
- package/.llm/digest/illustrationcard.md +6 -1
- package/.llm/digest/illustrationcheck.md +42 -0
- package/.llm/digest/illustrationchoice.md +43 -0
- package/.llm/digest/illustrationcode.md +41 -0
- package/.llm/digest/illustrationlist.md +38 -0
- package/.llm/digest/illustrationscene.md +4 -2
- package/.llm/digest/imagebanner.md +9 -3
- package/.llm/digest/logocolumns.md +1 -1
- package/.llm/digest/logorows.md +8 -1
- package/.llm/digest/producthero.md +8 -2
- package/.llm/digest/progressbar.md +56 -0
- package/.llm/digest/scenescroll.md +6 -5
- package/.llm/digest/scenescrollword.md +56 -0
- package/.llm/digest/segmentedcontrol.md +3 -0
- package/.llm/digest/stats.md +8 -0
- package/.llm/digest/statscarousel.md +48 -0
- package/.llm/digest/statusdot.md +7 -0
- package/.llm/digest/testimonialrow.md +8 -1
- package/.llm/digest/testimonialslider.md +1 -1
- package/.llm/digest/typography.md +18 -0
- package/.llm/index.md +14 -4
- package/.llm/rules.md +10 -0
- package/.llm/tokens.md +12 -3
- package/AGENTS.md +13 -2
- package/dist/components/arrival.d.ts +32 -0
- package/dist/components/arrival.js +140 -0
- package/dist/components/arrives.d.ts +17 -0
- package/dist/components/arrives.js +14 -0
- package/dist/components/blocks/awards/Awards.js +2 -27
- package/dist/components/blocks/block-pattern.css +23 -0
- package/dist/components/blocks/comparison-cards/comparison-cards-impl.css +29 -0
- package/dist/components/blocks/documents/Documents.css +90 -0
- package/dist/components/blocks/documents/Documents.d.ts +22 -0
- package/dist/components/blocks/documents/Documents.js +30 -0
- package/dist/components/blocks/documents/Documents.types.d.ts +37 -0
- package/dist/components/blocks/documents/Documents.types.js +14 -0
- package/dist/components/blocks/documents/documents-impl.css +103 -0
- package/dist/components/blocks/download-banner/DownloadBanner.css +1 -1
- package/dist/components/blocks/download-banner/DownloadBanner.types.d.ts +1 -1
- package/dist/components/blocks/feature-cards/FeatureCards.d.ts +2 -1
- package/dist/components/blocks/feature-cards/FeatureCards.js +10 -7
- package/dist/components/blocks/feature-cards/FeatureCards.types.d.ts +9 -1
- package/dist/components/blocks/feature-cards/feature-cards-impl.css +15 -3
- package/dist/components/blocks/feature-cards-carousel/FeatureCardsCarousel.types.d.ts +1 -1
- package/dist/components/blocks/feature-cards-carousel/feature-cards-carousel-impl.css +12 -0
- package/dist/components/blocks/feature-tabs/FeatureTabs.css +100 -0
- package/dist/components/blocks/feature-tabs/FeatureTabs.d.ts +23 -0
- package/dist/components/blocks/feature-tabs/FeatureTabs.js +38 -0
- package/dist/components/blocks/feature-tabs/FeatureTabs.types.d.ts +35 -0
- package/dist/components/blocks/feature-tabs/FeatureTabs.types.js +14 -0
- package/dist/components/blocks/feature-tabs/feature-tabs-impl.css +53 -0
- package/dist/components/blocks/image-banner/ImageBanner.css +1 -1
- package/dist/components/blocks/image-banner/ImageBanner.d.ts +1 -1
- package/dist/components/blocks/image-banner/ImageBanner.js +2 -2
- package/dist/components/blocks/image-banner/ImageBanner.types.d.ts +9 -7
- package/dist/components/blocks/image-banner/ImageBanner.types.js +1 -1
- package/dist/components/blocks/image-banner/image-banner-impl.css +77 -26
- package/dist/components/blocks/laurel.d.ts +16 -0
- package/dist/components/blocks/laurel.js +28 -0
- package/dist/components/blocks/logo-columns/LogoColumns.css +1 -1
- package/dist/components/blocks/logo-columns/LogoColumns.types.d.ts +1 -1
- package/dist/components/blocks/logo-rows/LogoRows.css +1 -1
- package/dist/components/blocks/logo-rows/LogoRows.d.ts +2 -1
- package/dist/components/blocks/logo-rows/LogoRows.js +7 -4
- package/dist/components/blocks/logo-rows/LogoRows.types.d.ts +9 -1
- package/dist/components/blocks/pattern-tone.d.ts +11 -0
- package/dist/components/blocks/pattern-tone.js +7 -0
- package/dist/components/blocks/product-hero/ProductHero.d.ts +1 -1
- package/dist/components/blocks/product-hero/ProductHero.js +2 -2
- package/dist/components/blocks/product-hero/ProductHero.types.d.ts +8 -3
- package/dist/components/blocks/product-hero/ProductHero.types.js +1 -1
- package/dist/components/blocks/product-hero/product-hero-impl.css +54 -0
- package/dist/components/blocks/resource-banner/ResourceBanner.css +1 -1
- package/dist/components/blocks/scene-scroll/SceneScroll.css +1 -1
- package/dist/components/blocks/scene-scroll/SceneScroll.d.ts +6 -5
- package/dist/components/blocks/scene-scroll/SceneScroll.js +8 -7
- package/dist/components/blocks/scene-scroll/SceneScroll.types.d.ts +5 -5
- package/dist/components/blocks/scene-scroll/SceneScroll.types.js +1 -1
- package/dist/components/blocks/scene-scroll/scene-scroll-impl.css +61 -44
- package/dist/components/blocks/scene-scroll-word/SceneScrollWord.css +105 -0
- package/dist/components/blocks/scene-scroll-word/SceneScrollWord.d.ts +31 -0
- package/dist/components/blocks/scene-scroll-word/SceneScrollWord.js +67 -0
- package/dist/components/blocks/scene-scroll-word/SceneScrollWord.types.d.ts +39 -0
- package/dist/components/blocks/scene-scroll-word/SceneScrollWord.types.js +18 -0
- package/dist/components/blocks/scene-scroll-word/scene-scroll-word-impl.css +370 -0
- package/dist/components/blocks/stats/Stats.d.ts +2 -1
- package/dist/components/blocks/stats/Stats.js +17 -14
- package/dist/components/blocks/stats/Stats.types.d.ts +8 -0
- package/dist/components/blocks/stats/stats-impl.css +4 -1
- package/dist/components/blocks/stats/use-wheel.d.ts +1 -1
- package/dist/components/blocks/stats/use-wheel.js +8 -4
- package/dist/components/blocks/stats-carousel/StatsCarousel.css +209 -0
- package/dist/components/blocks/stats-carousel/StatsCarousel.d.ts +20 -0
- package/dist/components/blocks/stats-carousel/StatsCarousel.js +48 -0
- package/dist/components/blocks/stats-carousel/StatsCarousel.types.d.ts +43 -0
- package/dist/components/blocks/stats-carousel/StatsCarousel.types.js +23 -0
- package/dist/components/blocks/stats-carousel/stats-carousel-impl.css +233 -0
- package/dist/components/blocks/sticky-cards/sticky-cards-impl.css +8 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.css +1 -1
- package/dist/components/blocks/testimonial-row/TestimonialRow.d.ts +2 -1
- package/dist/components/blocks/testimonial-row/TestimonialRow.js +16 -13
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.d.ts +9 -1
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.css +1 -1
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.d.ts +1 -1
- package/dist/components/blocks/tiers/Tiers.types.d.ts +1 -1
- package/dist/components/core/background/Background.css +19 -0
- package/dist/components/core/background/Background.types.d.ts +2 -1
- package/dist/components/core/background/background-impl.css +47 -15
- package/dist/components/core/background/halftone.js +1 -1
- package/dist/components/core/button/Button.css +5 -5
- package/dist/components/core/button-icon/ButtonIcon.types.d.ts +1 -1
- package/dist/components/core/card-body/CardBody.css +5 -0
- package/dist/components/core/card-body/CardBody.types.d.ts +1 -1
- package/dist/components/core/document-link/DocumentLink.css +59 -0
- package/dist/components/core/document-link/DocumentLink.d.ts +19 -0
- package/dist/components/core/document-link/DocumentLink.js +21 -0
- package/dist/components/core/document-link/DocumentLink.types.d.ts +41 -0
- package/dist/components/core/document-link/DocumentLink.types.js +11 -0
- package/dist/components/core/document-link/document-link-impl.css +23 -0
- package/dist/components/core/illustration-card/IllustrationCard.css +7 -0
- package/dist/components/core/illustration-card/IllustrationCard.d.ts +5 -1
- package/dist/components/core/illustration-card/IllustrationCard.js +34 -8
- package/dist/components/core/illustration-card/IllustrationCard.types.d.ts +8 -1
- package/dist/components/core/illustration-card/IllustrationCard.types.js +1 -0
- package/dist/components/core/illustration-card/illustration-card-impl.css +113 -0
- package/dist/components/core/illustration-check/IllustrationCheck.css +25 -0
- package/dist/components/core/illustration-check/IllustrationCheck.d.ts +16 -0
- package/dist/components/core/illustration-check/IllustrationCheck.js +22 -0
- package/dist/components/core/illustration-check/IllustrationCheck.types.d.ts +25 -0
- package/dist/components/core/illustration-check/IllustrationCheck.types.js +9 -0
- package/dist/components/core/illustration-check/illustration-check-impl.css +76 -0
- package/dist/components/core/illustration-choice/IllustrationChoice.css +62 -0
- package/dist/components/core/illustration-choice/IllustrationChoice.d.ts +16 -0
- package/dist/components/core/illustration-choice/IllustrationChoice.js +31 -0
- package/dist/components/core/illustration-choice/IllustrationChoice.types.d.ts +25 -0
- package/dist/components/core/illustration-choice/IllustrationChoice.types.js +11 -0
- package/dist/components/core/illustration-choice/illustration-choice-impl.css +103 -0
- package/dist/components/core/illustration-code/IllustrationCode.css +25 -0
- package/dist/components/core/illustration-code/IllustrationCode.d.ts +12 -0
- package/dist/components/core/illustration-code/IllustrationCode.js +20 -0
- package/dist/components/core/illustration-code/IllustrationCode.types.d.ts +23 -0
- package/dist/components/core/illustration-code/IllustrationCode.types.js +8 -0
- package/dist/components/core/illustration-code/illustration-code-impl.css +42 -0
- package/dist/components/core/illustration-list/IllustrationList.css +19 -0
- package/dist/components/core/illustration-list/IllustrationList.d.ts +16 -0
- package/dist/components/core/illustration-list/IllustrationList.js +18 -0
- package/dist/components/core/illustration-list/IllustrationList.types.d.ts +15 -0
- package/dist/components/core/illustration-list/IllustrationList.types.js +6 -0
- package/dist/components/core/illustration-list/illustration-list-impl.css +52 -0
- package/dist/components/core/illustration-scene/IllustrationScene.css +6 -0
- package/dist/components/core/illustration-scene/IllustrationScene.d.ts +3 -2
- package/dist/components/core/illustration-scene/IllustrationScene.js +4 -3
- package/dist/components/core/illustration-scene/IllustrationScene.types.d.ts +5 -1
- package/dist/components/core/illustration-scene/IllustrationScene.types.js +2 -1
- package/dist/components/core/illustration-scene/illustration-scene-impl.css +65 -0
- package/dist/components/core/link/link-impl.css +5 -19
- package/dist/components/core/progress-bar/ProgressBar.css +101 -0
- package/dist/components/core/progress-bar/ProgressBar.d.ts +5 -0
- package/dist/components/core/progress-bar/ProgressBar.js +34 -0
- package/dist/components/core/progress-bar/ProgressBar.types.d.ts +52 -0
- package/dist/components/core/progress-bar/ProgressBar.types.js +12 -0
- package/dist/components/core/progress-bar/progress-bar-impl.css +45 -0
- package/dist/components/core/segmented-control/SegmentedControl.d.ts +1 -1
- package/dist/components/core/segmented-control/SegmentedControl.js +13 -5
- package/dist/components/core/segmented-control/SegmentedControl.types.d.ts +5 -1
- package/dist/components/core/segmented-control/segmented-control-impl.css +35 -0
- package/dist/components/core/status-dot/StatusDot.d.ts +1 -1
- package/dist/components/core/status-dot/StatusDot.js +7 -4
- package/dist/components/core/status-dot/StatusDot.types.d.ts +9 -1
- package/dist/components/core/status-dot/status-dot-impl.css +101 -0
- package/dist/components/core/typography/Typography.d.ts +3 -283
- package/dist/components/core/typography/Typography.js +9 -1
- package/dist/components/core/typography/Typography.types.d.ts +9 -15
- package/dist/components/core/typography/TypographyMotion.d.ts +28 -0
- package/dist/components/core/typography/TypographyMotion.js +43 -0
- package/dist/components/core/typography/typography-impl.css +106 -0
- package/dist/components/illustration-data.d.ts +15 -0
- package/dist/components/illustration-data.js +7 -0
- package/dist/components/index.d.ts +22 -1
- package/dist/components/index.js +20 -0
- package/dist/components/layout/grid/Grid.css +5 -0
- package/dist/components/layout/grid/Grid.types.d.ts +2 -1
- package/dist/components/scene-scroll-data.d.ts +35 -0
- package/dist/components/tiers-data.d.ts +3 -2
- package/dist/marketing.css +24 -6
- package/package.json +1 -1
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
:where([data-dds-context="marketing"]) .dds-cardbody .dds-cardbody__media-frame {
|
|
73
|
+
transition-property: border-radius;
|
|
73
74
|
display: block;
|
|
74
75
|
flex: auto;
|
|
75
76
|
min-block-size: 0;
|
|
@@ -120,6 +121,10 @@
|
|
|
120
121
|
line-height: var(--font-label-md-line-height);
|
|
121
122
|
}
|
|
122
123
|
|
|
124
|
+
:where([data-dds-context="marketing"]) .dds-cardbody[data-flush="true"] .dds-cardbody__media-frame {
|
|
125
|
+
border-radius: var(--radius-container);
|
|
126
|
+
}
|
|
127
|
+
|
|
123
128
|
:where([data-dds-context="marketing"]) .dds-cardbody[data-over-media="false"] .dds-cardbody__eyebrow {
|
|
124
129
|
color: var(--color-fg-muted);
|
|
125
130
|
}
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
export interface CardBodyOwnProps {
|
|
3
3
|
/** The picture is the card's ground and the copy is read on top of it. Set explicitly rather than inferred from src, which BannerBody can afford to do and this cannot: there, art is always behind the words, so having art and being over it are the same fact. Here a picture is a region in the column by default, and the same src means two different cards */
|
|
4
4
|
overMedia?: boolean;
|
|
5
|
-
/** The card has no fill for the copy to be held off — Card's `plain` variant, where the picture is the card's edge rather than the ground being it. The inline inset goes and the copy lines up with the picture above it; the block padding stays, because the space between a picture and the line under it is still doing its job */
|
|
5
|
+
/** The card has no fill for the copy to be held off — Card's `plain` variant, where the picture is the card's edge rather than the ground being it. The inline inset goes and the copy lines up with the picture above it; the block padding stays, because the space between a picture and the line under it is still doing its job. The picture takes the corners every contained picture in the blocks has, since with no fill around it the picture is the card's shape */
|
|
6
6
|
flush?: boolean;
|
|
7
7
|
/** The card is pressable and its picture is what answers the pointer — an editorial card inside a CardButton, on any ground. The picture grows by motion.scale.media-hover and media-frame clips it, so what the reader sees is the frame holding still while the art moves inside it. Setting this is also what stops the card lifting: CardButton suppresses its own lift when the body it holds zooms, so the two motions never compete */
|
|
8
8
|
zoomOnHover?: boolean;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* GENERATED from documentlink.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-documentlink {
|
|
4
|
+
align-items: center;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
min-inline-size: 0;
|
|
10
|
+
overflow-wrap: anywhere;
|
|
11
|
+
row-gap: 0;
|
|
12
|
+
column-gap: var(--space-gap-md);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:where([data-dds-context="marketing"]) .dds-documentlink .dds-documentlink__link {
|
|
16
|
+
align-items: center;
|
|
17
|
+
color: inherit;
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
min-inline-size: 0;
|
|
20
|
+
text-decoration-line: none;
|
|
21
|
+
column-gap: var(--space-gap-sm);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where([data-dds-context="marketing"]) .dds-documentlink .dds-documentlink__mark {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
flex: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:where([data-dds-context="marketing"]) .dds-documentlink .dds-documentlink__action {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:where([data-dds-context="marketing"]) .dds-documentlink[data-variant="chip"] {
|
|
35
|
+
background-color: var(--color-bg-surface-card-raised);
|
|
36
|
+
border-color: var(--color-border-subtle);
|
|
37
|
+
border-radius: var(--radius-surface);
|
|
38
|
+
border-width: var(--border-width-hairline);
|
|
39
|
+
color: var(--color-fg-default);
|
|
40
|
+
padding-block: var(--space-inset-sm);
|
|
41
|
+
padding-inline: var(--space-inset-md);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:where([data-dds-context="marketing"]) .dds-documentlink[data-variant="chip"] .dds-documentlink__title {
|
|
45
|
+
font-family: var(--font-label-md-family);
|
|
46
|
+
font-size: var(--font-label-md-size);
|
|
47
|
+
font-weight: var(--font-label-md-weight);
|
|
48
|
+
letter-spacing: var(--font-label-md-letter-spacing);
|
|
49
|
+
line-height: var(--font-label-md-line-height);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:where([data-dds-context="marketing"]) .dds-documentlink[data-variant="plain"] .dds-documentlink__title {
|
|
53
|
+
font-family: var(--font-body-sm-family);
|
|
54
|
+
font-size: var(--font-body-sm-size);
|
|
55
|
+
font-weight: var(--font-body-sm-weight);
|
|
56
|
+
letter-spacing: var(--font-body-sm-letter-spacing);
|
|
57
|
+
line-height: var(--font-body-sm-line-height);
|
|
58
|
+
}
|
|
59
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import './DocumentLink.css';
|
|
3
|
+
import './document-link-impl.css';
|
|
4
|
+
import { type DocumentLinkProps } from './DocumentLink.types.js';
|
|
5
|
+
export type { DocumentLinkProps };
|
|
6
|
+
/**
|
|
7
|
+
* One document a reader can open or save — a policy, a key information document, a country's
|
|
8
|
+
* licence — drawn the same way wherever a page lists documents.
|
|
9
|
+
*
|
|
10
|
+
* The mark and the title are one link. A second link beside it (`action`) is its sibling, never its
|
|
11
|
+
* child, so the row is a surface holding two targets rather than a target holding another. An
|
|
12
|
+
* external document opens in a new tab and a download saves the file, and each says so in words a
|
|
13
|
+
* screen reader hears and nobody sees, after the title.
|
|
14
|
+
*
|
|
15
|
+
* No state and no script, so it renders on a server as it is.
|
|
16
|
+
*/
|
|
17
|
+
export declare function DocumentLink({ variant, href, external, download, mark, action, externalLabel, downloadLabel, children, ...rest }: DocumentLinkProps & {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FileSolidIcon } from '@deriv-com/quill-icons-web';
|
|
3
|
+
import './DocumentLink.css';
|
|
4
|
+
import './document-link-impl.css';
|
|
5
|
+
import { Icon } from '../icon/Icon.js';
|
|
6
|
+
import { visuallyHidden } from '../../visually-hidden.js';
|
|
7
|
+
import { documentLinkDefaults, documentLinkParts } from './DocumentLink.types.js';
|
|
8
|
+
/**
|
|
9
|
+
* One document a reader can open or save — a policy, a key information document, a country's
|
|
10
|
+
* licence — drawn the same way wherever a page lists documents.
|
|
11
|
+
*
|
|
12
|
+
* The mark and the title are one link. A second link beside it (`action`) is its sibling, never its
|
|
13
|
+
* child, so the row is a surface holding two targets rather than a target holding another. An
|
|
14
|
+
* external document opens in a new tab and a download saves the file, and each says so in words a
|
|
15
|
+
* screen reader hears and nobody sees, after the title.
|
|
16
|
+
*
|
|
17
|
+
* No state and no script, so it renders on a server as it is.
|
|
18
|
+
*/
|
|
19
|
+
export function DocumentLink({ variant = documentLinkDefaults.variant, href, external = documentLinkDefaults.external, download = documentLinkDefaults.download, mark, action, externalLabel = documentLinkDefaults.externalLabel, downloadLabel = documentLinkDefaults.downloadLabel, children, ...rest }) {
|
|
20
|
+
return (_jsxs("div", { ...rest, className: documentLinkParts.root, "data-variant": variant, children: [_jsxs("a", { className: documentLinkParts.link, href: href, target: external ? '_blank' : undefined, rel: external ? 'noopener noreferrer' : undefined, download: download ? '' : undefined, children: [_jsx("span", { className: documentLinkParts.mark, "aria-hidden": "true", children: _jsx(Icon, { size: variant === 'chip' ? 'lg' : 'md', children: mark ?? _jsx(FileSolidIcon, {}) }) }), _jsx("span", { className: documentLinkParts.title, children: children }), external ? _jsxs("span", { style: visuallyHidden, children: [" ", externalLabel] }) : null, download ? _jsxs("span", { style: visuallyHidden, children: [" ", downloadLabel] }) : null] }), action ? _jsx("div", { className: documentLinkParts.action, children: action }) : null] }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface DocumentLinkOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `chip` — The default: the document on a surface of its own, for a list of documents grouped under headings
|
|
5
|
+
* `plain` — The mark and the title on the page itself, for a grid of many short entries — a licence per country, each behind its flag
|
|
6
|
+
*/
|
|
7
|
+
variant?: 'chip' | 'plain';
|
|
8
|
+
/** Always. Where the document is: a URL, usually a PDF */
|
|
9
|
+
href: string;
|
|
10
|
+
/** The document is hosted off the site — opens in a new tab, and its accessible name ends with `externalLabel` */
|
|
11
|
+
external?: boolean;
|
|
12
|
+
/** The link saves the file rather than opening it — its accessible name ends with `downloadLabel` */
|
|
13
|
+
download?: boolean;
|
|
14
|
+
/** What kind of document it is, as a glyph — FilePdfSolidIcon for a PDF, FileShieldSolidIcon for a policy, or a country's flag from `@deriv-com/dds-marketing/icons/flag` (`MaltaIcon`, `GermanyIcon`) for one country's licence. Left out, a plain file */
|
|
15
|
+
mark?: ReactNode;
|
|
16
|
+
/** A second link beside the document — "Choose language" — drawn at the far end of the row as its own target */
|
|
17
|
+
action?: ReactNode;
|
|
18
|
+
/** What an external document's accessible name ends with. Never drawn. Translate it with the page */
|
|
19
|
+
externalLabel?: string;
|
|
20
|
+
/** What a download's accessible name ends with. Never drawn. Translate it with the page */
|
|
21
|
+
downloadLabel?: string;
|
|
22
|
+
/** Allowed: text */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export type DocumentLinkProps = DocumentLinkOwnProps & Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'variant' | 'href' | 'external' | 'download' | 'mark' | 'action' | 'externalLabel' | 'downloadLabel'>;
|
|
26
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
27
|
+
export declare const documentLinkParts: {
|
|
28
|
+
readonly root: "dds-documentlink";
|
|
29
|
+
readonly link: "dds-documentlink__link";
|
|
30
|
+
readonly mark: "dds-documentlink__mark";
|
|
31
|
+
readonly title: "dds-documentlink__title";
|
|
32
|
+
readonly action: "dds-documentlink__action";
|
|
33
|
+
};
|
|
34
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
35
|
+
export declare const documentLinkDefaults: {
|
|
36
|
+
readonly variant: "chip";
|
|
37
|
+
readonly external: false;
|
|
38
|
+
readonly download: false;
|
|
39
|
+
readonly externalLabel: "(opens in a new tab)";
|
|
40
|
+
readonly downloadLabel: "(downloads a file)";
|
|
41
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// GENERATED from document-link.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const documentLinkParts = {
|
|
4
|
+
root: 'dds-documentlink',
|
|
5
|
+
link: 'dds-documentlink__link',
|
|
6
|
+
mark: 'dds-documentlink__mark',
|
|
7
|
+
title: 'dds-documentlink__title',
|
|
8
|
+
action: 'dds-documentlink__action',
|
|
9
|
+
};
|
|
10
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
11
|
+
export const documentLinkDefaults = { variant: 'chip', external: false, download: false, externalLabel: '(opens in a new tab)', downloadLabel: '(downloads a file)' };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Scoped to this package, like the generated sheet beside it.
|
|
3
|
+
*
|
|
4
|
+
* The document's link answers the pointer and the keyboard itself, since the row around it is not
|
|
5
|
+
* interactive: its title underlines on hover, and focus draws the package's ring round the link —
|
|
6
|
+
* border.width.focus in color.border.focus — offset off the mark and the words.
|
|
7
|
+
*/
|
|
8
|
+
:where([data-dds-context="marketing"]) .dds-documentlink .dds-documentlink__link:hover .dds-documentlink__title {
|
|
9
|
+
text-decoration-line: underline;
|
|
10
|
+
text-decoration-thickness: var(--border-width-default);
|
|
11
|
+
text-underline-offset: 0.2em;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:where([data-dds-context="marketing"]) .dds-documentlink .dds-documentlink__link:focus-visible {
|
|
15
|
+
border-radius: var(--radius-subtle);
|
|
16
|
+
outline: var(--border-width-focus) solid var(--color-border-focus);
|
|
17
|
+
outline-offset: var(--border-width-focus);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* A chip's border is drawn only where the chip is; a plain entry has none to draw. */
|
|
21
|
+
:where([data-dds-context="marketing"]) .dds-documentlink[data-variant='chip'] {
|
|
22
|
+
border-style: solid;
|
|
23
|
+
}
|
|
@@ -26,6 +26,13 @@
|
|
|
26
26
|
gap: var(--space-gap-sm);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__stage {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
min-block-size: 0;
|
|
33
|
+
row-gap: var(--space-gap-sm);
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-ratio="landscape"] {
|
|
30
37
|
aspect-ratio: var(--aspect-landscape);
|
|
31
38
|
}
|
|
@@ -14,9 +14,13 @@ export type { IllustrationCardProps };
|
|
|
14
14
|
* `label`, and its contents are `inert`: real components draw it, so it looks exactly like the
|
|
15
15
|
* product, and none of them can be focused, pressed or typed into.
|
|
16
16
|
*
|
|
17
|
+
* It can move once, as it arrives — frosting over its photograph, or playing two states of the
|
|
18
|
+
* product, the second after the first — and whatever moves inside it waits for it to land: it is
|
|
19
|
+
* the host its parts' arrivals follow (see arrival.ts).
|
|
20
|
+
*
|
|
17
21
|
* And it scales like a picture. The UI is laid out at its own size and, where the pane is too small
|
|
18
22
|
* to hold it, scaled down as a whole to fit — never up — so a pane on a phone shows the same picture
|
|
19
23
|
* smaller rather than text overlapping or cut off. The scale is worked out when the pane changes
|
|
20
24
|
* size and at no other time.
|
|
21
25
|
*/
|
|
22
|
-
export declare function IllustrationCard({ ratio, label, children, ...rest }: IllustrationCardProps): import("react").JSX.Element;
|
|
26
|
+
export declare function IllustrationCard({ ratio, label, motion, then, children, ...rest }: IllustrationCardProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useLayoutEffect, useRef } from 'react';
|
|
4
4
|
import './IllustrationCard.css';
|
|
5
5
|
import './illustration-card-impl.css';
|
|
6
|
+
import { useArrival } from '../../arrival.js';
|
|
6
7
|
import { illustrationCardDefaults, illustrationCardParts, } from './IllustrationCard.types.js';
|
|
7
8
|
/**
|
|
8
9
|
* A pane of glass holding a picture of the product, in one of three shapes.
|
|
@@ -16,13 +17,19 @@ import { illustrationCardDefaults, illustrationCardParts, } from './Illustration
|
|
|
16
17
|
* `label`, and its contents are `inert`: real components draw it, so it looks exactly like the
|
|
17
18
|
* product, and none of them can be focused, pressed or typed into.
|
|
18
19
|
*
|
|
20
|
+
* It can move once, as it arrives — frosting over its photograph, or playing two states of the
|
|
21
|
+
* product, the second after the first — and whatever moves inside it waits for it to land: it is
|
|
22
|
+
* the host its parts' arrivals follow (see arrival.ts).
|
|
23
|
+
*
|
|
19
24
|
* And it scales like a picture. The UI is laid out at its own size and, where the pane is too small
|
|
20
25
|
* to hold it, scaled down as a whole to fit — never up — so a pane on a phone shows the same picture
|
|
21
26
|
* smaller rather than text overlapping or cut off. The scale is worked out when the pane changes
|
|
22
27
|
* size and at no other time.
|
|
23
28
|
*/
|
|
24
|
-
export function IllustrationCard({ ratio = illustrationCardDefaults.ratio, label, children, ...rest }) {
|
|
25
|
-
|
|
29
|
+
export function IllustrationCard({ ratio = illustrationCardDefaults.ratio, label, motion, then, children, ...rest }) {
|
|
30
|
+
// The pane arrives as one thing and is the host the motions inside it follow, so it runs its
|
|
31
|
+
// arrival whether or not it moves itself: a figure that rolls inside it waits for it to land.
|
|
32
|
+
const [pane, arrival] = useArrival();
|
|
26
33
|
const content = useRef(null);
|
|
27
34
|
useLayoutEffect(() => {
|
|
28
35
|
const root = pane.current;
|
|
@@ -30,6 +37,11 @@ export function IllustrationCard({ ratio = illustrationCardDefaults.ratio, label
|
|
|
30
37
|
if (root === null || inner === null || typeof ResizeObserver === 'undefined')
|
|
31
38
|
return undefined;
|
|
32
39
|
const fit = () => {
|
|
40
|
+
// Back to the UI's own size before the pane is measured. A pane whose height follows what it
|
|
41
|
+
// holds — a strip at the foot of a scene, capped at a share of it — is only as tall as its
|
|
42
|
+
// last fit left the UI; measured first, each fit would find less room than the last.
|
|
43
|
+
inner.style.transform = '';
|
|
44
|
+
inner.style.inlineSize = '';
|
|
33
45
|
const style = getComputedStyle(root);
|
|
34
46
|
const across = root.clientWidth - Number.parseFloat(style.paddingInlineStart) - Number.parseFloat(style.paddingInlineEnd);
|
|
35
47
|
const down = root.clientHeight - Number.parseFloat(style.paddingBlockStart) - Number.parseFloat(style.paddingBlockEnd);
|
|
@@ -37,18 +49,32 @@ export function IllustrationCard({ ratio = illustrationCardDefaults.ratio, label
|
|
|
37
49
|
return;
|
|
38
50
|
// Laid out unscaled at the pane's own width, to see how much room the UI wants there — down,
|
|
39
51
|
// and across, since a line that cannot wrap (a large figure) overflows sideways.
|
|
40
|
-
inner.style.transform = '';
|
|
41
52
|
inner.style.inlineSize = `${across}px`;
|
|
42
53
|
const tall = inner.scrollHeight;
|
|
43
54
|
const wide = inner.scrollWidth;
|
|
44
|
-
|
|
55
|
+
let scale = Math.min(1, down / tall, across / wide);
|
|
45
56
|
if (scale >= 1) {
|
|
46
57
|
inner.style.inlineSize = '';
|
|
47
58
|
return;
|
|
48
59
|
}
|
|
49
60
|
// Scaled, the UI is narrower than the pane too; laying it out wider by the same factor gives
|
|
50
|
-
// the width back, so the picture fills the pane across as well as down. Wider, it
|
|
51
|
-
//
|
|
61
|
+
// the width back, so the picture fills the pane across as well as down. Wider, it wraps less
|
|
62
|
+
// and is shorter — so the scale found at the pane's own width is a floor, not the answer, and
|
|
63
|
+
// in a wide, short pane (a strip at the foot of a scene) a far smaller one than the UI needs.
|
|
64
|
+
// The largest scale whose widened layout still fits is found by halving the gap a few times;
|
|
65
|
+
// each try is one layout, and this runs only when the pane changes size.
|
|
66
|
+
const fits = (candidate) => {
|
|
67
|
+
inner.style.inlineSize = `${across / candidate}px`;
|
|
68
|
+
return inner.scrollHeight * candidate <= down && inner.scrollWidth * candidate <= across + 0.5;
|
|
69
|
+
};
|
|
70
|
+
let ceiling = 1;
|
|
71
|
+
for (let step = 0; step < 6; step += 1) {
|
|
72
|
+
const middle = (scale + ceiling) / 2;
|
|
73
|
+
if (fits(middle))
|
|
74
|
+
scale = middle;
|
|
75
|
+
else
|
|
76
|
+
ceiling = middle;
|
|
77
|
+
}
|
|
52
78
|
inner.style.inlineSize = `${across / scale}px`;
|
|
53
79
|
inner.style.transformOrigin = style.direction === 'rtl' ? 'top right' : 'top left';
|
|
54
80
|
inner.style.transform = `scale(${scale})`;
|
|
@@ -78,5 +104,5 @@ export function IllustrationCard({ ratio = illustrationCardDefaults.ratio, label
|
|
|
78
104
|
cancelAnimationFrame(queued);
|
|
79
105
|
};
|
|
80
106
|
}, []);
|
|
81
|
-
return (_jsx("div", { ...rest, ref: pane, className: illustrationCardParts.root, "data-ratio": ratio, "data-theme": "dark", role: "img", "aria-label": label, children: _jsx("div", { ref: content, className: illustrationCardParts.content, inert: true, children: children }) }));
|
|
107
|
+
return (_jsx("div", { ...rest, ref: pane, className: illustrationCardParts.root, "data-ratio": ratio, "data-theme": "dark", "data-arrival-host": "", "data-arrival": arrival === 'still' ? undefined : arrival, "data-motion": then ? undefined : motion, role: "img", "aria-label": label, children: _jsx("div", { ref: content, className: illustrationCardParts.content, "data-story": then ? '' : undefined, inert: true, children: then ? (_jsxs(_Fragment, { children: [_jsx("div", { className: illustrationCardParts.stage, "data-stage": "first", children: children }), _jsx("div", { className: illustrationCardParts.stage, "data-stage": "then", children: then })] })) : (children) }) }));
|
|
82
108
|
}
|
|
@@ -8,14 +8,21 @@ export interface IllustrationCardOwnProps {
|
|
|
8
8
|
ratio?: 'landscape' | 'square' | 'upright';
|
|
9
9
|
/** Always. What the picture shows, in a sentence — "Trade ticket: buy Gold to rise over 5 minutes, staking 10 USD". The pane is one image to assistive technology and this is its whole description; nothing inside it is read out on its own */
|
|
10
10
|
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* `frost` — The pane frosts over its photograph as it arrives: the glass blurs in over motion.duration.dramatic, and what it holds fades in a step of motion.duration.stagger apart once the glass is mostly there. For a pane in an IllustrationScene, where there is a photograph to soften
|
|
13
|
+
*/
|
|
14
|
+
motion?: 'frost';
|
|
15
|
+
/** A second state of the same product, played once after the first: the order goes in, then the position is open. The pane shows what it holds for motion.duration.hold, then that gives way to this — out over motion.duration.slow, in over motion.duration.reveal. Still, and for a reader who asked for less movement, the pane is this second state, so `label` describes it */
|
|
16
|
+
then?: ReactNode;
|
|
11
17
|
/** Allowed: any content */
|
|
12
18
|
children: ReactNode;
|
|
13
19
|
}
|
|
14
|
-
export type IllustrationCardProps = IllustrationCardOwnProps & Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'ratio' | 'label'>;
|
|
20
|
+
export type IllustrationCardProps = IllustrationCardOwnProps & Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'ratio' | 'label' | 'motion' | 'then'>;
|
|
15
21
|
/** The class each part carries. Apply these — do not retype them. */
|
|
16
22
|
export declare const illustrationCardParts: {
|
|
17
23
|
readonly root: "dds-illustrationcard";
|
|
18
24
|
readonly content: "dds-illustrationcard__content";
|
|
25
|
+
readonly stage: "dds-illustrationcard__stage";
|
|
19
26
|
};
|
|
20
27
|
/** Generated so defaults cannot drift from the contract. */
|
|
21
28
|
export declare const illustrationCardDefaults: {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export const illustrationCardParts = {
|
|
4
4
|
root: 'dds-illustrationcard',
|
|
5
5
|
content: 'dds-illustrationcard__content',
|
|
6
|
+
stage: 'dds-illustrationcard__stage',
|
|
6
7
|
};
|
|
7
8
|
/** Generated so defaults cannot drift from the contract. */
|
|
8
9
|
export const illustrationCardDefaults = { ratio: 'landscape' };
|
|
@@ -45,3 +45,116 @@
|
|
|
45
45
|
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__content > * {
|
|
46
46
|
flex-shrink: 0;
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
* The motions the pane plays once, as it arrives.
|
|
51
|
+
*
|
|
52
|
+
* `data-arrival` is the pane's own answer from useArrival (arrival.ts): `waiting` holds each motion
|
|
53
|
+
* at its first frame, `playing` runs it, and no attribute at all — a server's render, a reader who
|
|
54
|
+
* asked for less movement — is the pane at rest in its final state. Every motion is declared on
|
|
55
|
+
* both answers, with `both` fill and the waiting one paused, so the first frame is on screen before
|
|
56
|
+
* anything moves and the last one stays when it is done. The package's motion tokens throughout.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/* Two states of one pane in one cell, so the second takes the first one's place. */
|
|
60
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__content[data-story] {
|
|
61
|
+
display: grid;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Both states in the one cell. */
|
|
65
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__stage {
|
|
66
|
+
grid-area: 1 / 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* At rest the pane is its second state, the one `label` describes. */
|
|
70
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__stage[data-stage='first'] {
|
|
71
|
+
visibility: hidden;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@keyframes dds-illustrationcard-frost {
|
|
75
|
+
from {
|
|
76
|
+
-webkit-backdrop-filter: blur(0);
|
|
77
|
+
backdrop-filter: blur(0);
|
|
78
|
+
background-color: transparent;
|
|
79
|
+
background-image: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@keyframes dds-illustrationcard-fade-in {
|
|
84
|
+
from {
|
|
85
|
+
opacity: var(--opacity-hidden);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@keyframes dds-illustrationcard-story-leave {
|
|
90
|
+
from {
|
|
91
|
+
visibility: visible;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
to {
|
|
95
|
+
opacity: var(--opacity-hidden);
|
|
96
|
+
translate: 0 calc(-1 * var(--space-gap-sm));
|
|
97
|
+
visibility: hidden;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@keyframes dds-illustrationcard-story-arrive {
|
|
102
|
+
from {
|
|
103
|
+
opacity: var(--opacity-hidden);
|
|
104
|
+
translate: var(--motion-translate-hover);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
* `motion="frost"`: the glass blurs in over the photograph, then what it holds fades in, a step of
|
|
110
|
+
* motion.duration.stagger apart, once the glass is most of the way there — motion.duration.slow in.
|
|
111
|
+
* The steps are counted down the pane's own column; a ninth thing and after share the eighth's step.
|
|
112
|
+
*/
|
|
113
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-motion='frost'][data-arrival] {
|
|
114
|
+
animation: dds-illustrationcard-frost var(--motion-duration-dramatic) var(--motion-easing-reveal) both;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-motion='frost'][data-arrival] .dds-illustrationcard__content > * {
|
|
118
|
+
animation: dds-illustrationcard-fade-in var(--motion-duration-reveal) var(--motion-easing-reveal) both;
|
|
119
|
+
animation-delay: calc(var(--motion-duration-slow) + var(--dds-illustrationcard-step, 0) * var(--motion-duration-stagger));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__content > :nth-child(2) { --dds-illustrationcard-step: 1; }
|
|
123
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__content > :nth-child(3) { --dds-illustrationcard-step: 2; }
|
|
124
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__content > :nth-child(4) { --dds-illustrationcard-step: 3; }
|
|
125
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__content > :nth-child(5) { --dds-illustrationcard-step: 4; }
|
|
126
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__content > :nth-child(6) { --dds-illustrationcard-step: 5; }
|
|
127
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__content > :nth-child(7) { --dds-illustrationcard-step: 6; }
|
|
128
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard .dds-illustrationcard__content > :nth-child(n + 8) { --dds-illustrationcard-step: 7; }
|
|
129
|
+
|
|
130
|
+
/*
|
|
131
|
+
* `then`: the first state holds for motion.duration.hold, then gives way — out over
|
|
132
|
+
* motion.duration.slow, rising a little — and the second comes up into its place a step of
|
|
133
|
+
* motion.duration.fast behind, over motion.duration.reveal.
|
|
134
|
+
*/
|
|
135
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-arrival] .dds-illustrationcard__stage[data-stage='first'] {
|
|
136
|
+
animation: dds-illustrationcard-story-leave var(--motion-duration-slow) var(--motion-easing-reveal) var(--motion-duration-hold) both;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-arrival] .dds-illustrationcard__stage[data-stage='then'] {
|
|
140
|
+
animation: dds-illustrationcard-story-arrive var(--motion-duration-reveal) var(--motion-easing-reveal)
|
|
141
|
+
calc(var(--motion-duration-hold) + var(--motion-duration-fast)) both;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/*
|
|
145
|
+
* Waiting: every motion above held at its first frame. `!important` because each motion is an
|
|
146
|
+
* `animation` shorthand, which resets the play state, and several are more specific than this.
|
|
147
|
+
*/
|
|
148
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-arrival='waiting'],
|
|
149
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-arrival='waiting'] .dds-illustrationcard__content > *,
|
|
150
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-arrival='waiting'] .dds-illustrationcard__stage {
|
|
151
|
+
animation-play-state: paused !important;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@media (prefers-reduced-motion: reduce) {
|
|
155
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-arrival],
|
|
156
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-arrival] .dds-illustrationcard__content > *,
|
|
157
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcard[data-arrival] .dds-illustrationcard__stage {
|
|
158
|
+
animation: none;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* GENERATED from illustrationcheck.contract.json. Do not edit. */
|
|
2
|
+
|
|
3
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcheck {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
flex-shrink: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcheck .dds-illustrationcheck__ring {
|
|
9
|
+
stroke-width: var(--border-width-strong);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcheck .dds-illustrationcheck__tick {
|
|
13
|
+
stroke-width: var(--border-width-strong);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcheck[data-size="lg"] {
|
|
17
|
+
height: var(--icon-size-lg);
|
|
18
|
+
width: var(--icon-size-lg);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:where([data-dds-context="marketing"]) .dds-illustrationcheck[data-size="xl"] {
|
|
22
|
+
height: var(--icon-size-xl);
|
|
23
|
+
width: var(--icon-size-xl);
|
|
24
|
+
}
|
|
25
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './IllustrationCheck.css';
|
|
2
|
+
import './illustration-check-impl.css';
|
|
3
|
+
import { type IllustrationCheckProps } from './IllustrationCheck.types.js';
|
|
4
|
+
export type { IllustrationCheckProps };
|
|
5
|
+
/**
|
|
6
|
+
* A ring with a tick in it: the mark a picture of the product shows when something has gone
|
|
7
|
+
* through.
|
|
8
|
+
*
|
|
9
|
+
* Drawn rather than taken from the glyph set, because it moves in parts — the ring spins and closes,
|
|
10
|
+
* then the tick draws in — and a glyph is one shape. Both strokes measure their own length as one
|
|
11
|
+
* (`pathLength`), so the stylesheet draws them in by that fraction whatever the drawing's size.
|
|
12
|
+
* In the colour of the text around it, like an Icon.
|
|
13
|
+
*
|
|
14
|
+
* No script of its own: a mark that resolves on arrival is wrapped to take one (arrives.tsx).
|
|
15
|
+
*/
|
|
16
|
+
export declare function IllustrationCheck({ size, motion, label, ...rest }: IllustrationCheckProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import './IllustrationCheck.css';
|
|
3
|
+
import './illustration-check-impl.css';
|
|
4
|
+
import { Arrives } from '../../arrives.js';
|
|
5
|
+
import { given } from '../../given.js';
|
|
6
|
+
import { illustrationCheckDefaults, illustrationCheckParts, } from './IllustrationCheck.types.js';
|
|
7
|
+
/**
|
|
8
|
+
* A ring with a tick in it: the mark a picture of the product shows when something has gone
|
|
9
|
+
* through.
|
|
10
|
+
*
|
|
11
|
+
* Drawn rather than taken from the glyph set, because it moves in parts — the ring spins and closes,
|
|
12
|
+
* then the tick draws in — and a glyph is one shape. Both strokes measure their own length as one
|
|
13
|
+
* (`pathLength`), so the stylesheet draws them in by that fraction whatever the drawing's size.
|
|
14
|
+
* In the colour of the text around it, like an Icon.
|
|
15
|
+
*
|
|
16
|
+
* No script of its own: a mark that resolves on arrival is wrapped to take one (arrives.tsx).
|
|
17
|
+
*/
|
|
18
|
+
export function IllustrationCheck({ size = illustrationCheckDefaults.size, motion, label, ...rest }) {
|
|
19
|
+
const named = given(label);
|
|
20
|
+
const mark = (_jsx("span", { ...rest, className: illustrationCheckParts.root, "data-size": size, "data-motion": motion, role: named ? 'img' : undefined, "aria-label": named ? label : undefined, "aria-hidden": named ? undefined : true, children: _jsxs("svg", { viewBox: "0 0 56 56", width: "100%", height: "100%", fill: "none", stroke: "currentColor", "aria-hidden": "true", children: [_jsx("circle", { className: illustrationCheckParts.ring, cx: "28", cy: "28", r: "25", pathLength: 1 }), _jsx("path", { className: illustrationCheckParts.tick, d: "M17 29.5l7.5 7.5L40 21", pathLength: 1, strokeLinecap: "round", strokeLinejoin: "round" })] }) }));
|
|
21
|
+
return motion === undefined ? mark : _jsx(Arrives, { children: mark });
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export interface IllustrationCheckOwnProps {
|
|
3
|
+
/**
|
|
4
|
+
* `lg` — Thirty-two pixels, icon.size.lg. Beside a line of words in a pane
|
|
5
|
+
* `xl` — Forty-eight pixels, icon.size.xl, and the default. The mark as the subject of a pane
|
|
6
|
+
*/
|
|
7
|
+
size?: 'lg' | 'xl';
|
|
8
|
+
/**
|
|
9
|
+
* `resolve` — The ring spins open like a Spinner for two turns, closes, and the tick draws in — the moment something goes through
|
|
10
|
+
*/
|
|
11
|
+
motion?: 'resolve';
|
|
12
|
+
/** Only where the mark says something nothing beside it does — rarely. It names the mark as an image */
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
export type IllustrationCheckProps = IllustrationCheckOwnProps & Omit<HTMLAttributes<HTMLSpanElement>, 'className' | 'size' | 'motion' | 'label'>;
|
|
16
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
17
|
+
export declare const illustrationCheckParts: {
|
|
18
|
+
readonly root: "dds-illustrationcheck";
|
|
19
|
+
readonly ring: "dds-illustrationcheck__ring";
|
|
20
|
+
readonly tick: "dds-illustrationcheck__tick";
|
|
21
|
+
};
|
|
22
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
23
|
+
export declare const illustrationCheckDefaults: {
|
|
24
|
+
readonly size: "xl";
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// GENERATED from illustration-check.contract.json. Do not edit.
|
|
2
|
+
/** The class each part carries. Apply these — do not retype them. */
|
|
3
|
+
export const illustrationCheckParts = {
|
|
4
|
+
root: 'dds-illustrationcheck',
|
|
5
|
+
ring: 'dds-illustrationcheck__ring',
|
|
6
|
+
tick: 'dds-illustrationcheck__tick',
|
|
7
|
+
};
|
|
8
|
+
/** Generated so defaults cannot drift from the contract. */
|
|
9
|
+
export const illustrationCheckDefaults = { size: 'xl' };
|