@deriv-com/dds-marketing 0.2.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.llm/components/accordion.md +9 -1
- package/.llm/components/accordionitem.md +9 -1
- package/.llm/components/aspectratio.md +9 -1
- package/.llm/components/badge.md +9 -1
- package/.llm/components/bottomsheet.md +9 -1
- package/.llm/components/breadcrumb.md +9 -1
- package/.llm/components/breadcrumbitem.md +9 -1
- package/.llm/components/button.md +55 -27
- package/.llm/components/buttonicon.md +16 -8
- package/.llm/components/card.md +16 -2
- package/.llm/components/cardbody.md +29 -3
- package/.llm/components/cardbutton.md +16 -2
- package/.llm/components/checkbox.md +9 -1
- package/.llm/components/ctabanner.md +186 -0
- package/.llm/components/ctabannerslider.md +204 -0
- package/.llm/components/divider.md +9 -1
- package/.llm/components/dropdownmenu.md +15 -7
- package/.llm/components/faqaccordion.md +217 -0
- package/.llm/components/featurebullets.md +254 -0
- package/.llm/components/featurecards.md +313 -0
- package/.llm/components/featurescroll.md +284 -0
- package/.llm/components/featuresplit.md +249 -0
- package/.llm/components/filterchip.md +9 -1
- package/.llm/components/footer.md +9 -1
- package/.llm/components/footergroup.md +9 -1
- package/.llm/components/grid.md +9 -1
- package/.llm/components/icon.md +21 -3
- package/.llm/components/landinghero.md +254 -0
- package/.llm/components/link.md +13 -5
- package/.llm/components/logocolumns.md +235 -0
- package/.llm/components/logorows.md +212 -0
- package/.llm/components/menuitem.md +9 -1
- package/.llm/components/navbar.md +80 -16
- package/.llm/components/navbaritem.md +10 -2
- package/.llm/components/navbarmenu.md +9 -1
- package/.llm/components/navbarmenugroup.md +9 -1
- package/.llm/components/navbarpanel.md +10 -2
- package/.llm/components/navbarswitcher.md +10 -2
- package/.llm/components/navbarswitcheroption.md +9 -1
- package/.llm/components/option.md +9 -1
- package/.llm/components/pageheader.md +231 -0
- package/.llm/components/pagination.md +27 -90
- package/.llm/components/paginationdots.md +215 -0
- package/.llm/components/producthero.md +248 -0
- package/.llm/components/removablechip.md +9 -1
- package/.llm/components/row.md +9 -1
- package/.llm/components/scroller.md +9 -1
- package/.llm/components/searchinput.md +9 -1
- package/.llm/components/segmentedcontrol.md +9 -1
- package/.llm/components/segmentedcontrolitem.md +9 -1
- package/.llm/components/select.md +9 -1
- package/.llm/components/selectchip.md +57 -16
- package/.llm/components/spinner.md +9 -1
- package/.llm/components/stack.md +9 -1
- package/.llm/components/statusdot.md +9 -1
- package/.llm/components/subdomainnavbar.md +9 -1
- package/.llm/components/tab.md +11 -3
- package/.llm/components/table.md +9 -1
- package/.llm/components/tablebody.md +9 -1
- package/.llm/components/tablecell.md +9 -1
- package/.llm/components/tablehead.md +9 -1
- package/.llm/components/tableheadercell.md +9 -1
- package/.llm/components/tablerow.md +9 -1
- package/.llm/components/tablist.md +9 -1
- package/.llm/components/testimonialrow.md +235 -0
- package/.llm/components/testimonialslider.md +254 -0
- package/.llm/components/textarea.md +9 -1
- package/.llm/components/textinput.md +9 -1
- package/.llm/components/tooltip.md +9 -1
- package/.llm/components/typography.md +9 -1
- package/.llm/digest/button.md +11 -6
- package/.llm/digest/buttonicon.md +2 -2
- package/.llm/digest/card.md +1 -0
- package/.llm/digest/cardbody.md +3 -1
- package/.llm/digest/cardbutton.md +1 -0
- package/.llm/digest/ctabanner.md +44 -0
- package/.llm/digest/ctabannerslider.md +45 -0
- package/.llm/digest/dropdownmenu.md +1 -1
- package/.llm/digest/faqaccordion.md +43 -0
- package/.llm/digest/featurebullets.md +52 -0
- package/.llm/digest/featurecards.md +49 -0
- package/.llm/digest/featurescroll.md +52 -0
- package/.llm/digest/featuresplit.md +54 -0
- package/.llm/digest/landinghero.md +53 -0
- package/.llm/digest/logocolumns.md +55 -0
- package/.llm/digest/logorows.md +48 -0
- package/.llm/digest/navbar.md +18 -3
- package/.llm/digest/pageheader.md +49 -0
- package/.llm/digest/pagination.md +6 -17
- package/.llm/digest/paginationdots.md +43 -0
- package/.llm/digest/producthero.md +53 -0
- package/.llm/digest/selectchip.md +6 -1
- package/.llm/digest/testimonialrow.md +51 -0
- package/.llm/digest/testimonialslider.md +51 -0
- package/.llm/index.md +24 -3
- package/.llm/rules.md +43 -9
- package/.llm/tokens.md +56 -12
- package/AGENTS.md +32 -8
- package/README.md +41 -21
- package/dist/components/banner-data.d.ts +38 -0
- package/dist/components/banner-data.js +15 -0
- package/dist/components/blocks/block-reveal.css +90 -0
- package/dist/components/blocks/cta-banner/CtaBanner.css +66 -0
- package/dist/components/blocks/cta-banner/CtaBanner.d.ts +22 -0
- package/dist/components/blocks/cta-banner/CtaBanner.js +31 -0
- package/dist/components/blocks/cta-banner/CtaBanner.types.d.ts +29 -0
- package/dist/components/blocks/cta-banner/CtaBanner.types.js +13 -0
- package/dist/components/blocks/cta-banner/cta-banner-impl.css +29 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.css +90 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.d.ts +39 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.js +60 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.d.ts +41 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.js +15 -0
- package/dist/components/blocks/cta-banner-slider/cta-banner-slider-impl.css +73 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.css +54 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.d.ts +20 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.js +28 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.types.d.ts +25 -0
- package/dist/components/blocks/faq-accordion/FaqAccordion.types.js +10 -0
- package/dist/components/blocks/faq-accordion/faq-accordion-impl.css +54 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.css +139 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.d.ts +31 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.js +55 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.types.d.ts +39 -0
- package/dist/components/blocks/feature-bullets/FeatureBullets.types.js +16 -0
- package/dist/components/blocks/feature-bullets/feature-bullets-impl.css +104 -0
- package/dist/components/blocks/feature-cards/FeatureCards.css +84 -0
- package/dist/components/blocks/feature-cards/FeatureCards.d.ts +24 -0
- package/dist/components/blocks/feature-cards/FeatureCards.js +66 -0
- package/dist/components/blocks/feature-cards/FeatureCards.types.d.ts +33 -0
- package/dist/components/blocks/feature-cards/FeatureCards.types.js +14 -0
- package/dist/components/blocks/feature-cards/feature-cards-impl.css +245 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.css +137 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.d.ts +39 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.js +167 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.types.d.ts +40 -0
- package/dist/components/blocks/feature-scroll/FeatureScroll.types.js +17 -0
- package/dist/components/blocks/feature-scroll/feature-scroll-impl.css +292 -0
- package/dist/components/blocks/feature-split/FeatureSplit.css +95 -0
- package/dist/components/blocks/feature-split/FeatureSplit.d.ts +30 -0
- package/dist/components/blocks/feature-split/FeatureSplit.js +38 -0
- package/dist/components/blocks/feature-split/FeatureSplit.types.d.ts +39 -0
- package/dist/components/blocks/feature-split/FeatureSplit.types.js +14 -0
- package/dist/components/blocks/feature-split/feature-split-impl.css +83 -0
- package/dist/components/blocks/landing-hero/LandingHero.css +85 -0
- package/dist/components/blocks/landing-hero/LandingHero.d.ts +41 -0
- package/dist/components/blocks/landing-hero/LandingHero.js +54 -0
- package/dist/components/blocks/landing-hero/LandingHero.types.d.ts +37 -0
- package/dist/components/blocks/landing-hero/LandingHero.types.js +15 -0
- package/dist/components/blocks/landing-hero/landing-hero-impl.css +355 -0
- package/dist/components/blocks/logo-columns/LogoColumns.css +161 -0
- package/dist/components/blocks/logo-columns/LogoColumns.d.ts +23 -0
- package/dist/components/blocks/logo-columns/LogoColumns.js +46 -0
- package/dist/components/blocks/logo-columns/LogoColumns.types.d.ts +46 -0
- package/dist/components/blocks/logo-columns/LogoColumns.types.js +18 -0
- package/dist/components/blocks/logo-columns/logo-columns-impl.css +188 -0
- package/dist/components/blocks/logo-rows/LogoRows.css +122 -0
- package/dist/components/blocks/logo-rows/LogoRows.d.ts +20 -0
- package/dist/components/blocks/logo-rows/LogoRows.js +43 -0
- package/dist/components/blocks/logo-rows/LogoRows.types.d.ts +36 -0
- package/dist/components/blocks/logo-rows/LogoRows.types.js +16 -0
- package/dist/components/blocks/logo-rows/logo-rows-impl.css +179 -0
- package/dist/components/blocks/page-header/PageHeader.css +79 -0
- package/dist/components/blocks/page-header/PageHeader.d.ts +34 -0
- package/dist/components/blocks/page-header/PageHeader.js +43 -0
- package/dist/components/blocks/page-header/PageHeader.types.d.ts +32 -0
- package/dist/components/blocks/page-header/PageHeader.types.js +14 -0
- package/dist/components/blocks/page-header/page-header-impl.css +176 -0
- package/dist/components/blocks/product-hero/ProductHero.css +86 -0
- package/dist/components/blocks/product-hero/ProductHero.d.ts +35 -0
- package/dist/components/blocks/product-hero/ProductHero.js +48 -0
- package/dist/components/blocks/product-hero/ProductHero.types.d.ts +37 -0
- package/dist/components/blocks/product-hero/ProductHero.types.js +15 -0
- package/dist/components/blocks/product-hero/product-hero-impl.css +354 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.css +245 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.d.ts +20 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.js +128 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.d.ts +54 -0
- package/dist/components/blocks/testimonial-row/TestimonialRow.types.js +26 -0
- package/dist/components/blocks/testimonial-row/testimonial-row-impl.css +195 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.css +181 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.d.ts +22 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.js +36 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.d.ts +49 -0
- package/dist/components/blocks/testimonial-slider/TestimonialSlider.types.js +21 -0
- package/dist/components/blocks/testimonial-slider/testimonial-slider-impl.css +202 -0
- package/dist/components/blocks/use-reveal.d.ts +46 -0
- package/dist/components/blocks/use-reveal.js +120 -0
- package/dist/components/blocks/use-rotation.d.ts +62 -0
- package/dist/components/blocks/use-rotation.js +176 -0
- package/dist/components/core/accordion-item/AccordionItem.css +6 -5
- package/dist/components/core/bottom-sheet/BottomSheet.css +1 -1
- package/dist/components/core/button/Button.css +63 -16
- package/dist/components/core/button/Button.d.ts +14 -12
- package/dist/components/core/button/Button.js +43 -14
- package/dist/components/core/button/Button.types.d.ts +9 -14
- package/dist/components/core/button/button-impl.css +25 -0
- package/dist/components/core/button-icon/ButtonIcon.css +31 -15
- package/dist/components/core/button-icon/ButtonIcon.d.ts +2 -2
- package/dist/components/core/button-icon/ButtonIcon.js +2 -2
- package/dist/components/core/button-icon/ButtonIcon.types.d.ts +4 -4
- package/dist/components/core/card/Card.css +13 -4
- package/dist/components/core/card/Card.types.d.ts +2 -1
- package/dist/components/core/card-body/CardBody.css +11 -6
- package/dist/components/core/card-body/CardBody.d.ts +1 -1
- package/dist/components/core/card-body/CardBody.js +2 -2
- package/dist/components/core/card-body/CardBody.types.d.ts +4 -1
- package/dist/components/core/card-body/CardBody.types.js +1 -0
- package/dist/components/core/card-button/CardButton.css +13 -4
- package/dist/components/core/card-button/CardButton.types.d.ts +2 -1
- package/dist/components/core/checkbox/Checkbox.css +8 -1
- package/dist/components/core/dropdown-menu/DropdownMenu.css +13 -12
- package/dist/components/core/dropdown-menu/DropdownMenu.d.ts +5 -3
- package/dist/components/core/dropdown-menu/DropdownMenu.js +5 -3
- package/dist/components/core/filter-chip/FilterChip.css +2 -1
- package/dist/components/core/footer/footer-impl.css +1 -1
- package/dist/components/core/footer-group/FooterGroup.css +8 -7
- package/dist/components/core/icon/Icon.css +1 -1
- package/dist/components/core/link/Link.css +1 -1
- package/dist/components/core/link/Link.js +5 -5
- package/dist/components/core/menu-item/MenuItem.css +1 -1
- package/dist/components/core/navbar/Navbar.css +7 -8
- package/dist/components/core/navbar/Navbar.d.ts +17 -1
- package/dist/components/core/navbar/Navbar.js +139 -12
- package/dist/components/core/navbar/Navbar.types.d.ts +23 -4
- package/dist/components/core/navbar/Navbar.types.js +1 -1
- package/dist/components/core/navbar/navbar-impl.css +10 -3
- package/dist/components/core/navbar/navbar-material.css +96 -0
- package/dist/components/core/navbar-item/NavbarItem.css +4 -4
- package/dist/components/core/navbar-menu/NavbarMenu.css +7 -5
- package/dist/components/core/navbar-menu/NavbarMenu.d.ts +1 -0
- package/dist/components/core/navbar-menu/NavbarMenu.js +1 -0
- package/dist/components/core/navbar-menu/navbar-menu-impl.css +7 -7
- package/dist/components/core/navbar-switcher/NavbarSwitcher.css +6 -5
- package/dist/components/core/navbar-switcher/NavbarSwitcher.d.ts +1 -0
- package/dist/components/core/navbar-switcher/NavbarSwitcher.js +2 -1
- package/dist/components/core/option/Option.css +1 -1
- package/dist/components/core/pagination/Pagination.css +1 -75
- package/dist/components/core/pagination/Pagination.d.ts +4 -4
- package/dist/components/core/pagination/Pagination.js +11 -51
- package/dist/components/core/pagination/Pagination.types.d.ts +5 -17
- package/dist/components/core/pagination/Pagination.types.js +1 -3
- package/dist/components/core/pagination-dots/PaginationDots.css +60 -0
- package/dist/components/core/pagination-dots/PaginationDots.d.ts +25 -0
- package/dist/components/core/pagination-dots/PaginationDots.js +104 -0
- package/dist/components/core/pagination-dots/PaginationDots.types.d.ts +38 -0
- package/dist/components/core/pagination-dots/PaginationDots.types.js +9 -0
- package/dist/components/core/removable-chip/RemovableChip.css +3 -3
- package/dist/components/core/search-input/SearchInput.css +1 -1
- package/dist/components/core/segmented-control/SegmentedControl.css +1 -1
- package/dist/components/core/segmented-control-item/SegmentedControlItem.css +1 -1
- package/dist/components/core/select/Select.css +2 -1
- package/dist/components/core/select-chip/SelectChip.css +14 -7
- package/dist/components/core/select-chip/SelectChip.d.ts +1 -1
- package/dist/components/core/select-chip/SelectChip.js +7 -4
- package/dist/components/core/select-chip/SelectChip.types.d.ts +7 -1
- package/dist/components/core/select-chip/SelectChip.types.js +1 -1
- package/dist/components/core/select-chip/select-chip-impl.css +14 -3
- package/dist/components/core/status-dot/StatusDot.css +1 -1
- package/dist/components/core/subdomain-navbar/SubdomainNavbar.css +3 -3
- package/dist/components/core/tab/Tab.css +1 -1
- package/dist/components/core/tab/Tab.types.d.ts +1 -1
- package/dist/components/core/tab-list/TabList.css +1 -1
- package/dist/components/core/table/table-impl.css +36 -14
- package/dist/components/core/table-header-cell/TableHeaderCell.css +5 -5
- package/dist/components/core/text-area/TextArea.css +1 -1
- package/dist/components/core/text-input/TextInput.css +1 -1
- package/dist/components/core/tooltip/Tooltip.css +1 -1
- package/dist/components/core/typography/Typography.css +5 -5
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +30 -0
- package/dist/components/logo-data.d.ts +24 -0
- package/dist/components/logo-data.js +11 -0
- package/dist/components/scroll-data.d.ts +64 -0
- package/dist/components/scroll-data.js +17 -0
- package/dist/components/testimonial-row-data.d.ts +51 -0
- package/dist/components/testimonial-row-data.js +11 -0
- package/dist/components/testimonial-slider-data.d.ts +26 -0
- package/dist/components/testimonial-slider-data.js +10 -0
- package/dist/marketing.css +385 -14
- package/package.json +1 -6
|
@@ -23,7 +23,7 @@ Everything a card holds: the words inset from its edges and the picture that rea
|
|
|
23
23
|
|
|
24
24
|
## Anatomy
|
|
25
25
|
|
|
26
|
-
CardBody renders
|
|
26
|
+
CardBody renders 10 elements. A token binding names the part it applies to.
|
|
27
27
|
|
|
28
28
|
- `root` — `<div>`, class `dds-cardbody`. The whole of the card's content, and no padding of its own. That is the entire trick: the inset sits on `content` one level in, so the picture beside it can reach the card's edges without anything being cancelled back off. A body that padded itself and then pulled the picture out again with a negative margin would be two decisions undoing each other, and neither would be findable from the other.
|
|
29
29
|
|
|
@@ -78,7 +78,7 @@ CardBody renders 9 elements. A token binding names the part it applies to.
|
|
|
78
78
|
|
|
79
79
|
It takes font.h5, the smallest step the heading scale has and the one this package's cards already used. The level and the size are separate decisions and this part makes both, which is the trade for a consumer not having to know either.
|
|
80
80
|
|
|
81
|
-
It binds no colour. The Card sets one per variant on its root and colour inherits, so a title on the brand fill takes fg.on-
|
|
81
|
+
It binds no colour. The Card sets one per variant on its root and colour inherits, so a title on the brand fill takes fg.on-brand and the same title on the page takes fg.default without this part knowing which card it is in. Binding a role here would override that and put near-black text on the brand-strong fill.
|
|
82
82
|
|
|
83
83
|
It has two steps. `font.h5` is the default and is a heading over a group of cards; `compact` takes `font.label.md`, sixteen at semibold.
|
|
84
84
|
|
|
@@ -88,6 +88,7 @@ CardBody renders 9 elements. A token binding names the part it applies to.
|
|
|
88
88
|
A <p>. It binds no colour, for the reason the title does not.
|
|
89
89
|
|
|
90
90
|
It moves with the title. `font.body.md` by default and `font.body.sm` when the card is compact, which keeps the two a step apart — a sixteen-pixel title above sixteen-pixel copy is a card with no heading in it. Rendered only when `description` is set.
|
|
91
|
+
- `link` — `<div>`, class `dds-cardbody__link`. The card's way on, under the line and held off it by the step a description takes before its actions. A row so the Link hugs its words rather than stretching the width of the card, which would make the whole line a target. Rendered only when `link` is set.
|
|
91
92
|
- `media-frame` — `<div>`, class `dds-cardbody__media-frame`. The picture's own box, and the reason a zoom looks like a zoom. An <img> cannot clip itself — `overflow` does not apply to replaced content — so a picture that scales has to be scaled inside something. Without this the nearest clip is the Card's, one level up and around the copy as well, and a picture growing by a per cent pushes its bottom edge down over the eyebrow and the headline. In a body with no card around it at all, nothing clips it and it simply paints over whatever is below.
|
|
92
93
|
|
|
93
94
|
So the frame holds the shape and the picture moves inside it: the box keeps its place in the column while the art grows past its edges and is cut off at them, which is the whole effect.
|
|
@@ -177,6 +178,12 @@ Never for: The sentence explaining the card. That is description, which sits und
|
|
|
177
178
|
Use when: What the title means, usually a sentence or two. It takes the default body step, because a card's copy is copy rather than a caption. A string rather than a node, for the reason the title is one — a node prop cannot be given text in an examples row, and a card nobody can show is worse than a sentence that cannot hold a link.
|
|
178
179
|
Never for: A control. This body holds two regions and neither is a place to act from — a card with a call to action puts it in the Card beneath this, where it is not wearing the body's copy styling
|
|
179
180
|
|
|
181
|
+
### link — `node`
|
|
182
|
+
|
|
183
|
+
Accepts: Link
|
|
184
|
+
Use when: The card's own way on — "Learn more" — under the line, for a card in a Card rather than a CardButton: the card is read and the link is what is pressed. A standalone Link. On a card that paints its own ground, accent or accent-strong, give it tone="inherit" so it takes the card's white; on a light card it keeps its coral.
|
|
185
|
+
Never for: A card inside a CardButton. The whole card is already the link there, and a link inside a link is two destinations under one press — invalid HTML, and a screen reader announces both. Nor a Button: a card's way on is a destination, not an action.
|
|
186
|
+
|
|
180
187
|
### mark — `node`
|
|
181
188
|
|
|
182
189
|
Accepts: Icon
|
|
@@ -228,7 +235,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
228
235
|
|
|
229
236
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
230
237
|
Guidance only — cannot be checked automatically.
|
|
231
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
238
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
232
239
|
Guidance only — cannot be checked automatically.
|
|
233
240
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
234
241
|
|
|
@@ -280,6 +287,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
280
287
|
|
|
281
288
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
282
289
|
Guidance only — cannot be checked automatically.
|
|
290
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
291
|
+
|
|
292
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
293
|
+
|
|
294
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
295
|
+
|
|
296
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
297
|
+
Guidance only — cannot be checked automatically.
|
|
283
298
|
|
|
284
299
|
## Anti-examples
|
|
285
300
|
|
|
@@ -407,3 +422,14 @@ import { CardBody } from '@deriv-com/dds-marketing'
|
|
|
407
422
|
// inverse — it follows the dark ground
|
|
408
423
|
<CardBody tone="inverse" eyebrow="New" title="Deriv App" description="Manage accounts and access markets anytime." />
|
|
409
424
|
```
|
|
425
|
+
|
|
426
|
+
### With a way on
|
|
427
|
+
|
|
428
|
+
A way on under the line, for a card that is read rather than pressed. On a card that paints its own ground the Link takes tone="inherit" — FeatureCards shows it on dark and coral.
|
|
429
|
+
|
|
430
|
+
```tsx
|
|
431
|
+
import { CardBody, Link } from '@deriv-com/dds-marketing'
|
|
432
|
+
|
|
433
|
+
// A "Learn more" under the line
|
|
434
|
+
<CardBody title="Tight spreads" description="Competitive pricing on every market." link={<Link href="/pricing">Learn more</Link>} />
|
|
435
|
+
```
|
|
@@ -59,9 +59,10 @@ Apply these classes from the generated `cardButtonParts` constant rather than wr
|
|
|
59
59
|
|
|
60
60
|
## Props
|
|
61
61
|
|
|
62
|
-
### variant — `surface` | `surface-raised` | `accent` | `accent-strong` | `plain` (default `surface`)
|
|
62
|
+
### variant — `surface` | `surface-light` | `surface-raised` | `accent` | `accent-strong` | `plain` (default `surface`)
|
|
63
63
|
|
|
64
64
|
- `surface` — The default, and right for a pressable card on the page. The same recessed step off the white page that Card takes, so a row mixing pressable and plain cards reads as one row
|
|
65
|
+
- `surface-light` — A light card among dark ones that has to stay light in both themes — a row mixing a dark, a coral and a grey card, where the grey one flipping to dark in dark mode would make two dark cards. gray.50 with gray.950 text, fixed. For an ordinary card that follows the theme, surface.
|
|
65
66
|
- `surface-raised` — The card sits on a color.bg.subtle band rather than on the page, where the recessed fill all but disappears and this one lifts off the band instead
|
|
66
67
|
- `accent` — One card in a set is the promotional one and the page has already earned the colour
|
|
67
68
|
- `accent-strong` — A card carrying more weight than its neighbours. The darkest of the four, and the one that takes white at 20.55:1 — the most legible ground a marketing card has
|
|
@@ -99,7 +100,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
99
100
|
|
|
100
101
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
101
102
|
Guidance only — cannot be checked automatically.
|
|
102
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
103
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
103
104
|
Guidance only — cannot be checked automatically.
|
|
104
105
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
105
106
|
|
|
@@ -151,6 +152,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
151
152
|
|
|
152
153
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
153
154
|
Guidance only — cannot be checked automatically.
|
|
155
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
156
|
+
|
|
157
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
158
|
+
|
|
159
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
160
|
+
|
|
161
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
162
|
+
Guidance only — cannot be checked automatically.
|
|
154
163
|
|
|
155
164
|
## Anti-examples
|
|
156
165
|
|
|
@@ -211,6 +220,11 @@ import { CardBody, CardButton } from '@deriv-com/dds-marketing'
|
|
|
211
220
|
<CardBody title="Tight spreads" description="Competitive pricing on every market." />
|
|
212
221
|
</CardButton>
|
|
213
222
|
|
|
223
|
+
// surface-light — light in both themes
|
|
224
|
+
<CardButton variant="surface-light" href="/stocks/risk">
|
|
225
|
+
<CardBody title="Controlled risk" description="Set your limits with take profit and stop loss." />
|
|
226
|
+
</CardButton>
|
|
227
|
+
|
|
214
228
|
// surface-raised — on a subtle band
|
|
215
229
|
<CardButton variant="surface-raised" href="/markets/indices">
|
|
216
230
|
<CardBody title="Indices" description="Track the world’s major markets in one place." />
|
|
@@ -118,7 +118,7 @@ This is the phone's breakpoint, size.breakpoint.md, and not the wider one that d
|
|
|
118
118
|
|
|
119
119
|
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
120
120
|
Guidance only — cannot be checked automatically.
|
|
121
|
-
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link,
|
|
121
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
122
122
|
Guidance only — cannot be checked automatically.
|
|
123
123
|
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
124
124
|
|
|
@@ -170,6 +170,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
170
170
|
|
|
171
171
|
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
172
172
|
Guidance only — cannot be checked automatically.
|
|
173
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
174
|
+
|
|
175
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
176
|
+
|
|
177
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
178
|
+
|
|
179
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
180
|
+
Guidance only — cannot be checked automatically.
|
|
173
181
|
|
|
174
182
|
## Anti-examples
|
|
175
183
|
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<!-- GENERATED from cta-banner.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# CtaBanner
|
|
4
|
+
|
|
5
|
+
A full-bleed coral band carrying one short promotion and the action it asks for — the strip that breaks a long page with the one thing the page wants done, or closes it. Coral in both themes, because the brand is the same colour whatever the reader's theme. A headline, a line under it, and an action or two; nothing moves.
|
|
6
|
+
|
|
7
|
+
## Use when
|
|
8
|
+
|
|
9
|
+
- A short, high-contrast promotion with one clear action — open an account, start trading, download the app
|
|
10
|
+
- The band that closes a page, or breaks a long one, on the action the page exists to produce
|
|
11
|
+
|
|
12
|
+
## Do not use
|
|
13
|
+
|
|
14
|
+
- Two or three promotions to rotate between → `CtaBannerSlider`
|
|
15
|
+
- The band that opens the page → `LandingHero`
|
|
16
|
+
- A message that needs a picture beside it → `FeatureSplit`
|
|
17
|
+
- Two banners in one view — two coral strips are two demands, and the second makes the first one ordinary
|
|
18
|
+
- More than a headline, a line and two buttons
|
|
19
|
+
|
|
20
|
+
## Anatomy
|
|
21
|
+
|
|
22
|
+
CtaBanner renders 7 elements. A token binding names the part it applies to.
|
|
23
|
+
|
|
24
|
+
- `root` — `<section>`, class `dds-ctabanner`. The band. It paints color.bg.brand and sets color.fg.on-brand for everything on it, and both are the same in light and dark. A region named by its headline, so a reader can jump to it and past it.
|
|
25
|
+
- `inner` — `<div>`, class `dds-ctabanner__inner`. The measure and the gutter, the same column every band holds its content in: size.content.max, space.inset.page, space.section.default.
|
|
26
|
+
- `content` — `<div>`, class `dds-ctabanner__content`. The message: the headline and its line, then the action. The same column a CtaBannerSlider's slide is, so a banner and a slider read as one band with and without the movement. Its parts arrive the way every block's do — the headline, the line and the actions rising into place a step apart, from block-reveal.css — when the band first comes into view.
|
|
27
|
+
- `text` — `<div>`, class `dds-ctabanner__text`. The headline and the line under it, held to the heading measure so a headline at font.h1 breaks into a few words a line rather than running the width of the band.
|
|
28
|
+
- `title` — `<h2>`, class `dds-ctabanner__title`. The headline. h2 by default because a banner is a section of a page; `headingLevel` moves the level and never the size. `text-wrap: balance` so a two-line headline breaks evenly.
|
|
29
|
+
- `description` — `<p>`, class `dds-ctabanner__description`. The line under the headline, at the description measure. Rendered only when `description` is set.
|
|
30
|
+
- `actions` — `<div>`, class `dds-ctabanner__actions`. The action, or the pair. A row that wraps rather than shrinks, so two buttons on a phone stack instead of squeezing their labels. Rendered only when `actions` is set.
|
|
31
|
+
|
|
32
|
+
Apply these classes from the generated `ctaBannerParts` constant rather than writing the strings by hand.
|
|
33
|
+
|
|
34
|
+
## Composition
|
|
35
|
+
|
|
36
|
+
- Takes no children. Everything it renders comes from props
|
|
37
|
+
- Never contains: `CtaBanner`, `CtaBannerSlider`, `PageHeader`, `LandingHero`, `ProductHero`, `Footer`, `Navbar` — in children or in any prop that takes a node
|
|
38
|
+
|
|
39
|
+
## Props
|
|
40
|
+
|
|
41
|
+
### title — `string` **Required.**
|
|
42
|
+
|
|
43
|
+
Use when: Always — the message, in a few words. Short enough to take in at a glance; a line break goes where the words pause, not where the box runs out.
|
|
44
|
+
Never for: A sentence. The description is for the sentence; the title is what a reader takes in on the way past.
|
|
45
|
+
|
|
46
|
+
### headingLevel — `h2` | `h3` (default `h2`)
|
|
47
|
+
|
|
48
|
+
- `h2` — The default: a banner is a section of the page, under the page's own h1
|
|
49
|
+
- `h3` — A banner nested inside a section that already carries the h2 it belongs to
|
|
50
|
+
|
|
51
|
+
Use when: Matching the outline of the page around the banner. Size does not change with it — the headline is drawn at font.h1 at either level, the scale and the level being separate decisions.
|
|
52
|
+
|
|
53
|
+
### description — `string`
|
|
54
|
+
|
|
55
|
+
Use when: A line saying why the action is worth taking — what the reader gets, or how little it costs them.
|
|
56
|
+
Never for: A paragraph. A banner is read at a glance, on the way down a page; copy a reader has to work through is copy they scroll past.
|
|
57
|
+
|
|
58
|
+
### actions — `node`
|
|
59
|
+
|
|
60
|
+
Accepts: Button, Link
|
|
61
|
+
Use when: The one action the message asks for, or two at most. The coral is the banner's ground, so the primary is Button variant="inverse" tone="brand" — a primary Button is coral on coral, and the tone keeps it near-black in both themes — and a second is Button variant="secondary" tone="brand" — a white tint with a white label, fixed in both themes like the band.
|
|
62
|
+
Never for: A third action, or a primary Button: coral on the coral ground is a button nobody can see.
|
|
63
|
+
|
|
64
|
+
## Accessibility
|
|
65
|
+
|
|
66
|
+
Guaranteed by the component. Write none of it by hand: the ids these attributes point at are generated per instance, so an attribute set from outside either says the same thing twice or points at nothing.
|
|
67
|
+
|
|
68
|
+
- Announced as: `region`
|
|
69
|
+
- `Tab` — Moves through the actions in the order they were handed in. Nothing in the band is a composite widget.
|
|
70
|
+
- accessible name from title, so the band is a named region a screen reader can jump to and skip
|
|
71
|
+
|
|
72
|
+
## Rules
|
|
73
|
+
|
|
74
|
+
- **On a phone a section's actions stack and each fills the width, including when there is only one** — On a phone a page's actions stack, and each one fills the width. Not most of it, and not the width its label happens to need — the whole column.
|
|
75
|
+
|
|
76
|
+
Two side by side is what this replaces. On the narrowest screen each gets half a column minus the gap, which is rarely enough for a real label: the words wrap inside the pills, the two buttons come out different heights, and the pair reads as a broken row rather than as a choice. Stacked, each has the whole width and neither has to shorten its words to fit.
|
|
77
|
+
|
|
78
|
+
A single action fills too, and that is the part worth saying, because it is the one that looks unnecessary. A lone button has the room to sit at its natural width and still should not: a full-width control is the phone's convention for the thing the screen is asking you to do, and a pill hugging its label reads as one option among others that are not there. It also makes the target predictable — the whole width, wherever the thumb lands — which a centred pill does not.
|
|
79
|
+
|
|
80
|
+
Filling is the row's job rather than the button's. A button has no width of its own and is not given one; the row it sits in becomes a column and stretches its children, so nothing about the control changes and the same button is full width here and its own size on a desktop.
|
|
81
|
+
|
|
82
|
+
This is the phone's breakpoint, size.breakpoint.md, and not the wider one that decides whether a heading is centred. Those are different questions and they break at different widths: a heading stops being centred when the measure is the screen, while a button stops being full width much sooner than that — stretched across a tablet it is a long way from its own label, and a label centred in a metre of pill is harder to hit than one in a pill the size of the words.
|
|
83
|
+
|
|
84
|
+
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
85
|
+
Guidance only — cannot be checked automatically.
|
|
86
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
87
|
+
Guidance only — cannot be checked automatically.
|
|
88
|
+
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
89
|
+
|
|
90
|
+
color.bg.brand carries a second limit that is not about forgetting. Its ink measures 3.39:1, which clears the 3:1 a heading needs and misses the 4.5:1 running copy needs. A coral band may carry a headline and a call to action; a paragraph on one is text the reader has to work through at a ratio the waiver on that role does not cover — the waiver says so itself. A section with copy in it takes color.bg.brand-strong, which is near-black and carries white at full contrast.
|
|
91
|
+
|
|
92
|
+
color.bg.strong is not a section ground. It is the inverted fill for an action that has to outrank what surrounds it, and the components that paint it — Button and ButtonIcon in their inverse form — already set both halves in one rule, which is the pattern a hand-painted section has to copy.
|
|
93
|
+
Guidance only — cannot be checked automatically.
|
|
94
|
+
- **Every gap inside a section names the relationship it expresses, and the same relationship keeps its measure when it turns on its side** — A section's spacing is named by the relationship it expresses, not chosen by size. Every gap in a section has a role token, and reaching for a step off the generic scale because it happens to be the right number is how two sections written by two people stop lining up: the numbers agree today and drift the first time one of them is tuned.
|
|
95
|
+
|
|
96
|
+
The heading group is three steps, not one gap. An eyebrow sits nearer its title than the title sits to its description, and the actions sit further from the description than either — space.heading.eyebrow-title, space.heading.title-description, space.heading.description-actions, in that order. A single `gap` on the group cannot say this; it sets all three the same and the block reads as evenly spaced lines rather than as a mark, a name and a paragraph. The eyebrow has to identify itself for this to work, because a group that opens with a title must not give its description the eyebrow's tighter step.
|
|
97
|
+
|
|
98
|
+
The step between a title and its description follows the size of the title, which is why there are two of it. What a reader sees is not the gap but the gap plus the leading above it, and leading scales with the type: under a display title the leading is most of the space, under a card's title it is half as deep. One value for both makes a card look loose at the size that made a section look right. So space.heading.title-description is the display step and space.heading.title-description-compact is the step at a card's size, and the choice is made by how big the title is rather than by what kind of block it sits in.
|
|
99
|
+
|
|
100
|
+
Every one of those steps is smaller than the gap below the group, and that ordering is what holds the group together as one thing. space.heading.content is the step between a heading group and the content it introduces, and it is the widest measure inside a section: the one gap the eye reads as a change of subject rather than as a continuation.
|
|
101
|
+
|
|
102
|
+
That step is the same whether the content is under the heading or beside it. A split is the same relationship turned on its side — a heading group and the content it introduces — so the space between the two halves is space.heading.content, not a gutter. When the split collapses to one column on a phone the gap becomes vertical again, which is where it started, and nothing has to change for that to be right.
|
|
103
|
+
|
|
104
|
+
space.grid.gutter is between two things of the same kind. Two cards in a row are the same kind; the two halves of a split are not, which is why the gutter is the wrong measure there even when the number would have looked acceptable. The gutter runs on both axes, so a grid reads as an even field rather than as rows with a seam down them.
|
|
105
|
+
|
|
106
|
+
space.inset.card is the card's, not the page's. A row of cards padded differently is a row of different cards, and the fill is the only edge they have. A page composing a row does not get to choose it.
|
|
107
|
+
|
|
108
|
+
Column count is not a breakpoint decision. A row holds as many columns as fit before a column would be narrower than size.grid.column-min, and drops one when they would not. Written as a fixed count that collapses at a breakpoint, a four-up row keeps four columns at every width above the phone and sets its copy two or three words to a line through the whole of the tablet range — and on a narrow desktop, which no breakpoint sits on at all. The threshold is a property of the row rather than of a card: a card fills whatever cell it is given.
|
|
109
|
+
|
|
110
|
+
What this does not cover is the space above and below a section, which is space.section.default and space.section.compact, and the page's own side margin, which is space.inset.page. Those are the section's outside; everything here is its inside.
|
|
111
|
+
Guidance only — cannot be checked automatically.
|
|
112
|
+
- **A section's title is centred over stacked content, starts beside content in columns, and starts on a phone** — Two arrangements, and the title's alignment is decided by which one it is introducing rather than chosen per section.
|
|
113
|
+
|
|
114
|
+
Content stacked under the title — a row of cards, an accordion, a set of steps — takes a centred title. The heading group and the block below it share one axis, so a centred title is symmetric with the thing it names, and the eye drops from the middle of the words to the middle of the set. A title starting at the left over a centred or full-width block reads as belonging to the first column rather than to all of them.
|
|
115
|
+
|
|
116
|
+
Content beside the title — a split, a picture in the other half, anything laid out in columns — takes a title that starts where its content starts. The two share a left edge, and that edge is what says they are one thing read across rather than two stacked. Centring the title there breaks the only alignment the reader has to hold the halves together, and it drifts further from its content the wider the page gets.
|
|
117
|
+
|
|
118
|
+
The heading group is what carries this, not the heading alone. An eyebrow, a title and a description are read as one block and align together; aligning the title without them leaves a centred heading over start-aligned copy, which reads as a mistake rather than as a choice.
|
|
119
|
+
|
|
120
|
+
Centred means all of it, not just the words. A badge, a row of actions, a picture — these are flex children, and a flex child is placed by align-items rather than by text-align, so a block that only sets the text leaves everything that is not text at the start. A hero is the case that shows it: its title and copy centred while its badge and its buttons did not.
|
|
121
|
+
|
|
122
|
+
A capped block centres itself as well as its words. A heading group takes size.heading-group.max, and a cap that is not centred leaves the measure at the start of the column with the words centred inside it — composed, and a long way left of the middle it appears to be in.
|
|
123
|
+
|
|
124
|
+
Both arrangements go to the start on a phone. A centred block reverts below the breakpoint, and the reason is the measure: on a phone the measure is the screen, so a centred title wraps to three or four ragged lines and the eye loses the left edge it was tracking — the same symmetry that reads as composure on a desktop is what makes it hard to scan on a phone. Centring there has to be asked for twice, and a section title is not one of the things that asks: it is centred because there is room for it, and on a phone there is not. Going back to the start means all of it too, and a capped block is the one that hides a leftover: its words go to the start while its measure stays in the middle of the column, which reads as a title still centred over a badge and buttons that are not — the box in the middle and the line inside it at the edge.
|
|
125
|
+
|
|
126
|
+
A hero is a section like any other: its badge, title, copy and actions are one stacked block, so it is centred on a desktop and starts on a phone with everything else.
|
|
127
|
+
|
|
128
|
+
What this is not about is a page whose body is a form or a document. A title over a sign-up form or a guide is not introducing a set of content — it is the first line of the thing itself, and it keeps the alignment the body has, which for running text is the start. The distinction is whether the block below is content the title names or content the title is part of.
|
|
129
|
+
Guidance only — cannot be checked automatically.
|
|
130
|
+
- **Anything a pointer has to hit is at least 24px in both directions** — A control sized by its contents is as big as its contents, and a glyph is chosen for how it reads rather than for how easily it is hit. An icon-only button with no padding is a 16px target — smaller than the pad of a finger, and smaller than the tremor of a hand using a mouse.
|
|
131
|
+
|
|
132
|
+
WCAG 2.2 asks for 24 by 24 CSS pixels at AA. The exceptions are narrower than they look: inline targets inside a sentence are exempt, and so is a small target with 24px of clear space around it — but a clear button sits against the field it empties, and a field is itself a target, so the spacing exemption does not apply to the case that keeps arising.
|
|
133
|
+
|
|
134
|
+
The target and the mark are separate decisions, and conflating them is what produces both faults. Growing the glyph to 24px makes it shout; leaving the button at 16px makes it hard to hit. So the glyph keeps the size that reads correctly beside its text, and the box around it declares a minimum of its own — which is what size.target.min is for.
|
|
135
|
+
|
|
136
|
+
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
137
|
+
Guidance only — cannot be checked automatically.
|
|
138
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
139
|
+
|
|
140
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
141
|
+
|
|
142
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
143
|
+
|
|
144
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
145
|
+
Guidance only — cannot be checked automatically.
|
|
146
|
+
|
|
147
|
+
## Anti-examples
|
|
148
|
+
|
|
149
|
+
❌ CtaBanner for: Two or three promotions to rotate between
|
|
150
|
+
CtaBannerSlider is this band with a slider in it: the same layout, one message in view at a time, moved by dots and a swipe.
|
|
151
|
+
→ use `CtaBannerSlider` instead.
|
|
152
|
+
|
|
153
|
+
❌ CtaBanner for: The band that opens the page
|
|
154
|
+
An opening band is a hero, sized to be the first thing read. A coral strip at the top of a page competes with the navigation above it and the hero it should be.
|
|
155
|
+
→ use `LandingHero` instead.
|
|
156
|
+
|
|
157
|
+
❌ CtaBanner for: A message that needs a picture beside it
|
|
158
|
+
A banner is headline, line and button. A claim made by an image is a FeatureSplit.
|
|
159
|
+
→ use `FeatureSplit` instead.
|
|
160
|
+
|
|
161
|
+
## Example
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
import { CtaBanner, Button } from '@deriv-com/dds-marketing'
|
|
165
|
+
|
|
166
|
+
<CtaBanner title="Join 3M+ global traders" description="Open an account in minutes and start trading the world's markets." actions={<Button variant="inverse" href="/signup" tone="brand">Open account</Button>} />
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## In use
|
|
170
|
+
|
|
171
|
+
### One promotion
|
|
172
|
+
|
|
173
|
+
A headline, a line and the action. The coral is the same in both themes, so the action is Button variant="inverse" — a primary Button is coral on coral.
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
import { Button, CtaBanner } from '@deriv-com/dds-marketing'
|
|
177
|
+
|
|
178
|
+
// Headline, line and action
|
|
179
|
+
<CtaBanner title="Join 3M+ global traders" description="Open an account in minutes and start trading the world's markets." actions={<Button variant="inverse" href="/signup" tone="brand">Open account</Button>} />
|
|
180
|
+
|
|
181
|
+
// A message with no action
|
|
182
|
+
<CtaBanner title="Trading for anyone, anywhere" description="24/7 support in 14 languages, on every platform." />
|
|
183
|
+
|
|
184
|
+
// Nested under a section's own h2
|
|
185
|
+
<CtaBanner title="Trade on any device" headingLevel="h3" />
|
|
186
|
+
```
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<!-- GENERATED from cta-banner-slider.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# CtaBannerSlider
|
|
4
|
+
|
|
5
|
+
CtaBanner's layout with a slider in it: the same full-bleed coral band, rotating between two or three short promotions. One message is in view at a time, fading in where the last one was; dots show where the reader is. Coral in both themes, like the banner.
|
|
6
|
+
|
|
7
|
+
## Use when
|
|
8
|
+
|
|
9
|
+
- Rotating between two or three genuinely different promotions without a hero's weight — open an account, try a tool, download the app
|
|
10
|
+
|
|
11
|
+
## Do not use
|
|
12
|
+
|
|
13
|
+
- One promotion → `CtaBanner`
|
|
14
|
+
- The band that opens the page → `LandingHero`
|
|
15
|
+
- A message with more than a headline, a line and a button or two → `FeatureSplit`
|
|
16
|
+
- A single message — that is CtaBanner
|
|
17
|
+
- Messages that say the same thing twice, rotated to look like more
|
|
18
|
+
- A slider beside a CtaBanner in the same view — two coral strips are two demands
|
|
19
|
+
|
|
20
|
+
## Anatomy
|
|
21
|
+
|
|
22
|
+
CtaBannerSlider renders 9 elements. A token binding names the part it applies to.
|
|
23
|
+
|
|
24
|
+
- `root` — `<section>`, class `dds-ctabannerslider`. The band. It paints color.bg.brand and sets color.fg.on-brand for everything on it, the same in light and dark — CtaBanner's ground. A named region announced as a carousel, so a reader can jump to it and past it and knows it moves.
|
|
25
|
+
- `inner` — `<div>`, class `dds-ctabannerslider__inner`. The measure and the gutter, the same column every band holds its content in: size.content.max, space.inset.page, space.section.default.
|
|
26
|
+
- `track` — `<div>`, class `dds-ctabannerslider__track`. The slides, stacked in one place. Every slide sits in the same grid cell, so the band is as tall as its tallest message and nothing below it moves when one changes for another. Only the slide in view is drawn: the rest are at opacity.hidden, inert and hidden from assistive technology. A change is the new slide fading in where the old one stood — no travel, the old one's words gone at once — on motion.duration.slow and motion.easing.shift, the timing the dots move on, so the mark and the message change in the same beat. The words then arrive the way every block's do — the headline, the line and the actions rising into place a step apart, from block-reveal.css — each time a slide comes into view, and when the band first scrolls in. The slide leaving drops its words at once rather than sending them anywhere.
|
|
27
|
+
- `slide` — `<div>`, class `dds-ctabannerslider__slide`. One message, and one stop in the track: its group role, its "2 / 3" name and its inert state are set here. As wide as the banner's measure, never narrower — every slide sits in the same cell, so the band is as tall as the tallest.
|
|
28
|
+
- `text` — `<div>`, class `dds-ctabannerslider__text`. The headline and the line under it, held to the heading measure so a headline at font.h1 breaks into a few words a line rather than running the width of the band.
|
|
29
|
+
- `title` — `<h2>`, class `dds-ctabannerslider__title`. One slide's headline. h2 by default because a banner is a section of a page; `headingLevel` moves the level and never the size. `text-wrap: balance` so a two-line headline breaks evenly.
|
|
30
|
+
- `description` — `<p>`, class `dds-ctabannerslider__description`. The line under one slide's headline, at the description measure — drawn only for a slide that gives one.
|
|
31
|
+
- `actions` — `<div>`, class `dds-ctabannerslider__actions`. One slide's action, or its pair: the primary as Button variant="inverse" tone="brand", the second as Button variant="secondary" tone="brand" — a white tint with a white label. A row that wraps rather than shrinks, so two buttons on a phone stack instead of squeezing their labels. Drawn only for a slide with a primary action.
|
|
32
|
+
- `controls` — `<div>`, class `dds-ctabannerslider__controls`. The way through the slides, under them at the start of the content column: PaginationDots, saying where the reader is and moving to any slide pressed. With the swipe, the dots are the whole of how a reader moves the slider — there are no previous and next steps, by decision.
|
|
33
|
+
|
|
34
|
+
Apply these classes from the generated `ctaBannerSliderParts` constant rather than writing the strings by hand.
|
|
35
|
+
|
|
36
|
+
## Composition
|
|
37
|
+
|
|
38
|
+
- Takes no children. Everything it renders comes from props
|
|
39
|
+
- Never contains: `CtaBanner`, `CtaBannerSlider`, `PageHeader`, `LandingHero`, `ProductHero`, `Footer`, `Navbar` — in children or in any prop that takes a node
|
|
40
|
+
|
|
41
|
+
## Props
|
|
42
|
+
|
|
43
|
+
### slides — `data` `CtaBannerSlide[]` **Required.**
|
|
44
|
+
|
|
45
|
+
Use when: Always. The messages, in the order they rotate — two or three. Each is a headline, a line under it, and up to two actions as a label and a href: the banner draws the primary as Button variant="inverse" tone="brand", near-black in both themes, and the second as the white-tinted secondary, Button tone="brand", so no slide can put a coral button on the coral ground. A secondary is drawn only beside a primary — one action is the primary.
|
|
46
|
+
|
|
47
|
+
An empty list draws nothing — no region with nothing in it. A list of records rather than a child per slide, by decision: the set can come from a CMS, and there is one component to learn rather than two.
|
|
48
|
+
Never for: One message — that is CtaBanner — or a set padded out to rotate. Every slide is a few seconds of a reader's attention, and one that says what another said is a few seconds taken for nothing.
|
|
49
|
+
|
|
50
|
+
### headingLevel — `h2` | `h3` (default `h2`)
|
|
51
|
+
|
|
52
|
+
- `h2` — The default: a banner is a section of the page, under the page's own h1
|
|
53
|
+
- `h3` — A banner nested inside a section that already carries the h2 it belongs to
|
|
54
|
+
|
|
55
|
+
Use when: Matching the outline of the page around the banner, for every slide's headline at once. Size does not change with it — every headline is drawn at font.h1, the scale and the level being separate decisions.
|
|
56
|
+
|
|
57
|
+
### autoplay — `boolean` (default `false`)
|
|
58
|
+
|
|
59
|
+
Use when: Whether it advances on its own, holding each slide for motion.duration.dwell. Off by default, so a slider nobody configured stays still. On, it holds while the pointer is over it or focus is inside it, never moves for a reader who asked for less motion, and stops for good once the reader presses anything in it — a slide, its action, a dot — or swipes it. A press stops it for good — the WAI carousel pattern's rule that a reader who has interacted is reading, not watching. That gives a reader a way to stop the rotation, which WCAG 2.2.2 asks for, but not a visible one: nothing says a press will stop it, so a page that needs 2.2.2 met plainly should still offer its own pause, or leave autoplay off.
|
|
60
|
+
Never for: A banner whose slides carry more than a reader can take in during motion.duration.dwell — turn it off rather than shorten the copy to fit the timer.
|
|
61
|
+
|
|
62
|
+
### label — `string` (default `Promotions`)
|
|
63
|
+
|
|
64
|
+
Use when: The name the banner is announced by — a region a screen reader can jump to and skip. Name what it holds, not that it is a banner: 'Promotions', 'Offers'. Translate it with the page.
|
|
65
|
+
|
|
66
|
+
### controlsLabel — `string` (default `Slides`)
|
|
67
|
+
|
|
68
|
+
Use when: The name the dots are announced by, as a group inside the banner. Its own name rather than the banner's, so a screen reader moving into the dots hears what they are rather than 'Promotions' a second time. Translate it with the page, like label.
|
|
69
|
+
|
|
70
|
+
### slideLabel — `string` (default `Slide`)
|
|
71
|
+
|
|
72
|
+
Use when: The word each dot is announced by, before its number — 'Slide 2'. Translate it with the page, as controlsLabel is; a page that translates only the group's name still has every dot announced in English.
|
|
73
|
+
|
|
74
|
+
## Accessibility
|
|
75
|
+
|
|
76
|
+
Guaranteed by the component. Write none of it by hand: the ids these attributes point at are generated per instance, so an attribute set from outside either says the same thing twice or points at nothing.
|
|
77
|
+
|
|
78
|
+
- Announced as: `region`
|
|
79
|
+
- `Tab` — Moves through the actions of the slide in view, then the dots. Slides out of view are inert, so Tab never reaches a button the reader cannot see.
|
|
80
|
+
- `Enter` — On a dot, moves to that slide
|
|
81
|
+
- The headline of the slide in view is a real heading, so a reader moving by heading finds the message as well as the banner around it. Slides out of view are inert, so they are not in the heading list until they are in view.
|
|
82
|
+
- accessible name from label, so the banner is a named region a reader can jump to and skip
|
|
83
|
+
- Every slide out of view is inert and hidden from assistive technology, and the one in view is named by its position — '2 / 3' — so a reader knows where they are without seeing the dots
|
|
84
|
+
- No rotation for a reader who asked for less motion: autoplay is off under prefers-reduced-motion, and a slide changes without travelling
|
|
85
|
+
- Under autoplay, a hold while the pointer is over the banner or focus is inside it, no movement for a reader who asked for less motion, and a stop for good once the reader presses anything in it or swipes it. No pause control is drawn, so the way to stop it is a press, which nothing on screen announces
|
|
86
|
+
|
|
87
|
+
## Rules
|
|
88
|
+
|
|
89
|
+
- **On a phone a section's actions stack and each fills the width, including when there is only one** — On a phone a page's actions stack, and each one fills the width. Not most of it, and not the width its label happens to need — the whole column.
|
|
90
|
+
|
|
91
|
+
Two side by side is what this replaces. On the narrowest screen each gets half a column minus the gap, which is rarely enough for a real label: the words wrap inside the pills, the two buttons come out different heights, and the pair reads as a broken row rather than as a choice. Stacked, each has the whole width and neither has to shorten its words to fit.
|
|
92
|
+
|
|
93
|
+
A single action fills too, and that is the part worth saying, because it is the one that looks unnecessary. A lone button has the room to sit at its natural width and still should not: a full-width control is the phone's convention for the thing the screen is asking you to do, and a pill hugging its label reads as one option among others that are not there. It also makes the target predictable — the whole width, wherever the thumb lands — which a centred pill does not.
|
|
94
|
+
|
|
95
|
+
Filling is the row's job rather than the button's. A button has no width of its own and is not given one; the row it sits in becomes a column and stretches its children, so nothing about the control changes and the same button is full width here and its own size on a desktop.
|
|
96
|
+
|
|
97
|
+
This is the phone's breakpoint, size.breakpoint.md, and not the wider one that decides whether a heading is centred. Those are different questions and they break at different widths: a heading stops being centred when the measure is the screen, while a button stops being full width much sooner than that — stretched across a tablet it is a long way from its own label, and a label centred in a metre of pill is harder to hit than one in a pill the size of the words.
|
|
98
|
+
|
|
99
|
+
What this is not about is every row of controls. A set of filter chips, a pagination strip, a toolbar, a link sitting after a sentence — none of these is the page asking for something, and stacking them to full width would turn a strip the eye skims into a list it has to read. The test is whether the row is the call to action the section was written for.
|
|
100
|
+
Guidance only — cannot be checked automatically.
|
|
101
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
102
|
+
Guidance only — cannot be checked automatically.
|
|
103
|
+
- **A section that paints a ground sets the ink to go with it** — A page sits on color.bg.page, and a section that separates itself from it takes one of three grounds. color.bg.subtle is the light one and needs nothing further — the page's own ink still reads on it. The other two are dark and do not: color.bg.brand-strong takes color.fg.on-brand-strong, and color.bg.brand takes color.fg.on-solid. Both are white, and both are written as the role rather than the white they resolve to. Set one of those backgrounds without its ink and the text inherits whatever the page was already using, which is near-black on a dark band — legible to nobody, and invisible to every check here, because each pair passes contrast on its own and nothing can tell whether a section used both.
|
|
104
|
+
|
|
105
|
+
color.bg.brand carries a second limit that is not about forgetting. Its ink measures 3.39:1, which clears the 3:1 a heading needs and misses the 4.5:1 running copy needs. A coral band may carry a headline and a call to action; a paragraph on one is text the reader has to work through at a ratio the waiver on that role does not cover — the waiver says so itself. A section with copy in it takes color.bg.brand-strong, which is near-black and carries white at full contrast.
|
|
106
|
+
|
|
107
|
+
color.bg.strong is not a section ground. It is the inverted fill for an action that has to outrank what surrounds it, and the components that paint it — Button and ButtonIcon in their inverse form — already set both halves in one rule, which is the pattern a hand-painted section has to copy.
|
|
108
|
+
Guidance only — cannot be checked automatically.
|
|
109
|
+
- **Every gap inside a section names the relationship it expresses, and the same relationship keeps its measure when it turns on its side** — A section's spacing is named by the relationship it expresses, not chosen by size. Every gap in a section has a role token, and reaching for a step off the generic scale because it happens to be the right number is how two sections written by two people stop lining up: the numbers agree today and drift the first time one of them is tuned.
|
|
110
|
+
|
|
111
|
+
The heading group is three steps, not one gap. An eyebrow sits nearer its title than the title sits to its description, and the actions sit further from the description than either — space.heading.eyebrow-title, space.heading.title-description, space.heading.description-actions, in that order. A single `gap` on the group cannot say this; it sets all three the same and the block reads as evenly spaced lines rather than as a mark, a name and a paragraph. The eyebrow has to identify itself for this to work, because a group that opens with a title must not give its description the eyebrow's tighter step.
|
|
112
|
+
|
|
113
|
+
The step between a title and its description follows the size of the title, which is why there are two of it. What a reader sees is not the gap but the gap plus the leading above it, and leading scales with the type: under a display title the leading is most of the space, under a card's title it is half as deep. One value for both makes a card look loose at the size that made a section look right. So space.heading.title-description is the display step and space.heading.title-description-compact is the step at a card's size, and the choice is made by how big the title is rather than by what kind of block it sits in.
|
|
114
|
+
|
|
115
|
+
Every one of those steps is smaller than the gap below the group, and that ordering is what holds the group together as one thing. space.heading.content is the step between a heading group and the content it introduces, and it is the widest measure inside a section: the one gap the eye reads as a change of subject rather than as a continuation.
|
|
116
|
+
|
|
117
|
+
That step is the same whether the content is under the heading or beside it. A split is the same relationship turned on its side — a heading group and the content it introduces — so the space between the two halves is space.heading.content, not a gutter. When the split collapses to one column on a phone the gap becomes vertical again, which is where it started, and nothing has to change for that to be right.
|
|
118
|
+
|
|
119
|
+
space.grid.gutter is between two things of the same kind. Two cards in a row are the same kind; the two halves of a split are not, which is why the gutter is the wrong measure there even when the number would have looked acceptable. The gutter runs on both axes, so a grid reads as an even field rather than as rows with a seam down them.
|
|
120
|
+
|
|
121
|
+
space.inset.card is the card's, not the page's. A row of cards padded differently is a row of different cards, and the fill is the only edge they have. A page composing a row does not get to choose it.
|
|
122
|
+
|
|
123
|
+
Column count is not a breakpoint decision. A row holds as many columns as fit before a column would be narrower than size.grid.column-min, and drops one when they would not. Written as a fixed count that collapses at a breakpoint, a four-up row keeps four columns at every width above the phone and sets its copy two or three words to a line through the whole of the tablet range — and on a narrow desktop, which no breakpoint sits on at all. The threshold is a property of the row rather than of a card: a card fills whatever cell it is given.
|
|
124
|
+
|
|
125
|
+
What this does not cover is the space above and below a section, which is space.section.default and space.section.compact, and the page's own side margin, which is space.inset.page. Those are the section's outside; everything here is its inside.
|
|
126
|
+
Guidance only — cannot be checked automatically.
|
|
127
|
+
- **A section's title is centred over stacked content, starts beside content in columns, and starts on a phone** — Two arrangements, and the title's alignment is decided by which one it is introducing rather than chosen per section.
|
|
128
|
+
|
|
129
|
+
Content stacked under the title — a row of cards, an accordion, a set of steps — takes a centred title. The heading group and the block below it share one axis, so a centred title is symmetric with the thing it names, and the eye drops from the middle of the words to the middle of the set. A title starting at the left over a centred or full-width block reads as belonging to the first column rather than to all of them.
|
|
130
|
+
|
|
131
|
+
Content beside the title — a split, a picture in the other half, anything laid out in columns — takes a title that starts where its content starts. The two share a left edge, and that edge is what says they are one thing read across rather than two stacked. Centring the title there breaks the only alignment the reader has to hold the halves together, and it drifts further from its content the wider the page gets.
|
|
132
|
+
|
|
133
|
+
The heading group is what carries this, not the heading alone. An eyebrow, a title and a description are read as one block and align together; aligning the title without them leaves a centred heading over start-aligned copy, which reads as a mistake rather than as a choice.
|
|
134
|
+
|
|
135
|
+
Centred means all of it, not just the words. A badge, a row of actions, a picture — these are flex children, and a flex child is placed by align-items rather than by text-align, so a block that only sets the text leaves everything that is not text at the start. A hero is the case that shows it: its title and copy centred while its badge and its buttons did not.
|
|
136
|
+
|
|
137
|
+
A capped block centres itself as well as its words. A heading group takes size.heading-group.max, and a cap that is not centred leaves the measure at the start of the column with the words centred inside it — composed, and a long way left of the middle it appears to be in.
|
|
138
|
+
|
|
139
|
+
Both arrangements go to the start on a phone. A centred block reverts below the breakpoint, and the reason is the measure: on a phone the measure is the screen, so a centred title wraps to three or four ragged lines and the eye loses the left edge it was tracking — the same symmetry that reads as composure on a desktop is what makes it hard to scan on a phone. Centring there has to be asked for twice, and a section title is not one of the things that asks: it is centred because there is room for it, and on a phone there is not. Going back to the start means all of it too, and a capped block is the one that hides a leftover: its words go to the start while its measure stays in the middle of the column, which reads as a title still centred over a badge and buttons that are not — the box in the middle and the line inside it at the edge.
|
|
140
|
+
|
|
141
|
+
A hero is a section like any other: its badge, title, copy and actions are one stacked block, so it is centred on a desktop and starts on a phone with everything else.
|
|
142
|
+
|
|
143
|
+
What this is not about is a page whose body is a form or a document. A title over a sign-up form or a guide is not introducing a set of content — it is the first line of the thing itself, and it keeps the alignment the body has, which for running text is the start. The distinction is whether the block below is content the title names or content the title is part of.
|
|
144
|
+
Guidance only — cannot be checked automatically.
|
|
145
|
+
- **Anything a pointer has to hit is at least 24px in both directions** — A control sized by its contents is as big as its contents, and a glyph is chosen for how it reads rather than for how easily it is hit. An icon-only button with no padding is a 16px target — smaller than the pad of a finger, and smaller than the tremor of a hand using a mouse.
|
|
146
|
+
|
|
147
|
+
WCAG 2.2 asks for 24 by 24 CSS pixels at AA. The exceptions are narrower than they look: inline targets inside a sentence are exempt, and so is a small target with 24px of clear space around it — but a clear button sits against the field it empties, and a field is itself a target, so the spacing exemption does not apply to the case that keeps arising.
|
|
148
|
+
|
|
149
|
+
The target and the mark are separate decisions, and conflating them is what produces both faults. Growing the glyph to 24px makes it shout; leaving the button at 16px makes it hard to hit. So the glyph keeps the size that reads correctly beside its text, and the box around it declares a minimum of its own — which is what size.target.min is for.
|
|
150
|
+
|
|
151
|
+
Declared rather than emergent. Padding plus contents does clear 24px in several components today, and it is the weaker statement: it is a size nobody wrote down, so it moves when the type scale or the glyph does, and nothing says it was meant to be a target at all.
|
|
152
|
+
Guidance only — cannot be checked automatically.
|
|
153
|
+
- **A component is written along the reading axis, not along the page's left and right** — Every measure, inset and placement in this package names an axis rather than a side: inline-size and block-size, padding-inline and padding-block, inset-inline-start and inset-block-end, margin-inline: auto, text-align: start. Written that way a component follows whichever direction the page is read in, and a band whose claim ranges to the leading edge with its subject on the trailing one is the same composition in Arabic as in English, mirrored, with nothing restated. Written as left and right it is the same pixels in both, which is a layout nobody designed for the second language.
|
|
154
|
+
|
|
155
|
+
The enum values follow the same rule and for the same reason. A prop that names where a picture sits takes start and end, never left and right — FeatureSplit, FeatureBullets and FeatureScroll all declare mediaPosition that way, and the flex directions they generate flip on their own because row already means the reading order. A value called left would have to be re-read as right by every author working in a mirrored page, which is a translation this system should be doing rather than asking for.
|
|
156
|
+
|
|
157
|
+
The guidance a contract carries is part of the component, so it follows too. Describing a claim as ranging left is describing one of the two languages, and it was written that way here for a while: three of the opening bands said so in their own intent. A reader in a mirrored page meets that sentence and has to decide whether the component is wrong or the sentence is, and neither answer is one documentation should force.
|
|
158
|
+
|
|
159
|
+
Two things genuinely have no logical form and are not covered by this. A CSS gradient takes a physical direction — there is no to inline-end — so a pattern that must mirror has to be stated twice under a direction query, and one that is periodic and centred, like PageHeader's rule grid, does not need to. A glyph that points the way onward is the other: an arrow is a picture of a direction, and mirroring it belongs to the icon set rather than to the component holding it.
|
|
160
|
+
Guidance only — cannot be checked automatically.
|
|
161
|
+
|
|
162
|
+
## Anti-examples
|
|
163
|
+
|
|
164
|
+
❌ CtaBannerSlider for: One promotion
|
|
165
|
+
A slider of one has nothing to move to. CtaBanner is the same band with the message on it and no timer, no controls and nothing to announce as a carousel.
|
|
166
|
+
→ use `CtaBanner` instead.
|
|
167
|
+
|
|
168
|
+
❌ CtaBannerSlider for: The band that opens the page
|
|
169
|
+
An opening band is a hero, sized to be the first thing read. A coral strip at the top of a page competes with the navigation above it and the hero it should be.
|
|
170
|
+
→ use `LandingHero` instead.
|
|
171
|
+
|
|
172
|
+
❌ CtaBannerSlider for: A message with more than a headline, a line and a button or two
|
|
173
|
+
A slide is a short promotion read at a glance, and its actions are a label and a href the banner draws. A message that needs an image or its own controls is a FeatureSplit.
|
|
174
|
+
→ use `FeatureSplit` instead.
|
|
175
|
+
|
|
176
|
+
## Example
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
import { CtaBannerSlider } from '@deriv-com/dds-marketing'
|
|
180
|
+
|
|
181
|
+
<CtaBannerSlider slides={[{"title":"Join 3M+ global traders","description":"Open an account in minutes and start trading the world's markets.","primaryAction":{"label":"Open account","href":"/signup"},"secondaryAction":{"label":"Learn more","href":"/about"}},{"title":"Analyse markets with AI-powered insights","description":"Charts and signals that keep up with the market, on every platform.","primaryAction":{"label":"Try TradersView","href":"/tradersview"}}]} />
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## In use
|
|
185
|
+
|
|
186
|
+
### Rotating between promotions
|
|
187
|
+
|
|
188
|
+
One slide in view, dots to move between them. It holds while hovered or focused, stops once pressed, and stays still for a reader who asked for less motion.
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
import { CtaBannerSlider } from '@deriv-com/dds-marketing'
|
|
192
|
+
|
|
193
|
+
// Two slides, rotating
|
|
194
|
+
<CtaBannerSlider slides={[{"title":"Join 3M+ global traders","description":"Open an account in minutes and start trading the world's markets.","primaryAction":{"label":"Open account","href":"/signup"}},{"title":"Analyse markets with AI-powered insights","description":"Charts and signals that keep up with the market, on every platform.","primaryAction":{"label":"Try TradersView","href":"/tradersview"}}]} autoplay />
|
|
195
|
+
|
|
196
|
+
// Two slides, moved by hand only
|
|
197
|
+
<CtaBannerSlider slides={[{"title":"Join 3M+ global traders","description":"Open an account in minutes and start trading the world's markets.","primaryAction":{"label":"Open account","href":"/signup"}},{"title":"Analyse markets with AI-powered insights","description":"Charts and signals that keep up with the market, on every platform.","primaryAction":{"label":"Try TradersView","href":"/tradersview"}}]} />
|
|
198
|
+
|
|
199
|
+
// A slide with a primary and a secondary action
|
|
200
|
+
<CtaBannerSlider slides={[{"title":"Join 3M+ global traders","description":"Open an account in minutes and start trading the world's markets.","primaryAction":{"label":"Open account","href":"/signup"},"secondaryAction":{"label":"Learn more","href":"/about"}},{"title":"Analyse markets with AI-powered insights","description":"Charts and signals that keep up with the market, on every platform.","primaryAction":{"label":"Try TradersView","href":"/tradersview"}}]} />
|
|
201
|
+
|
|
202
|
+
// Headlines at h3, under a section's h2 — they look the same
|
|
203
|
+
<CtaBannerSlider slides={[{"title":"Join 3M+ global traders","description":"Open an account in minutes and start trading the world's markets.","primaryAction":{"label":"Open account","href":"/signup"}},{"title":"Analyse markets with AI-powered insights","description":"Charts and signals that keep up with the market, on every platform.","primaryAction":{"label":"Try TradersView","href":"/tradersview"}}]} headingLevel="h3" />
|
|
204
|
+
```
|