@deriv-com/dds-marketing 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.llm/components/accordion.md +8 -0
- package/.llm/components/accordionitem.md +8 -0
- package/.llm/components/aspectratio.md +8 -0
- package/.llm/components/badge.md +8 -0
- package/.llm/components/bottomsheet.md +8 -0
- package/.llm/components/breadcrumb.md +8 -0
- package/.llm/components/breadcrumbitem.md +8 -0
- package/.llm/components/button.md +46 -22
- package/.llm/components/buttonicon.md +14 -6
- package/.llm/components/card.md +15 -1
- package/.llm/components/cardbody.md +28 -2
- package/.llm/components/cardbutton.md +15 -1
- package/.llm/components/checkbox.md +8 -0
- package/.llm/components/ctabanner.md +186 -0
- package/.llm/components/ctabannerslider.md +204 -0
- package/.llm/components/divider.md +8 -0
- package/.llm/components/dropdownmenu.md +13 -5
- 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 +8 -0
- package/.llm/components/footer.md +8 -0
- package/.llm/components/footergroup.md +8 -0
- package/.llm/components/grid.md +8 -0
- package/.llm/components/icon.md +8 -0
- package/.llm/components/landinghero.md +254 -0
- package/.llm/components/link.md +9 -1
- package/.llm/components/logocolumns.md +235 -0
- package/.llm/components/logorows.md +212 -0
- package/.llm/components/menuitem.md +8 -0
- package/.llm/components/navbar.md +79 -15
- package/.llm/components/navbaritem.md +9 -1
- package/.llm/components/navbarmenu.md +8 -0
- package/.llm/components/navbarmenugroup.md +8 -0
- package/.llm/components/navbarpanel.md +9 -1
- package/.llm/components/navbarswitcher.md +9 -1
- package/.llm/components/navbarswitcheroption.md +8 -0
- package/.llm/components/option.md +8 -0
- package/.llm/components/pageheader.md +231 -0
- package/.llm/components/pagination.md +26 -89
- package/.llm/components/paginationdots.md +215 -0
- package/.llm/components/producthero.md +248 -0
- package/.llm/components/removablechip.md +8 -0
- package/.llm/components/row.md +8 -0
- package/.llm/components/scroller.md +8 -0
- package/.llm/components/searchinput.md +8 -0
- package/.llm/components/segmentedcontrol.md +8 -0
- package/.llm/components/segmentedcontrolitem.md +8 -0
- package/.llm/components/select.md +8 -0
- package/.llm/components/selectchip.md +56 -15
- package/.llm/components/spinner.md +8 -0
- package/.llm/components/stack.md +8 -0
- package/.llm/components/statusdot.md +8 -0
- package/.llm/components/subdomainnavbar.md +8 -0
- package/.llm/components/tab.md +8 -0
- package/.llm/components/table.md +8 -0
- package/.llm/components/tablebody.md +8 -0
- package/.llm/components/tablecell.md +8 -0
- package/.llm/components/tablehead.md +8 -0
- package/.llm/components/tableheadercell.md +8 -0
- package/.llm/components/tablerow.md +8 -0
- package/.llm/components/tablist.md +8 -0
- package/.llm/components/testimonialrow.md +235 -0
- package/.llm/components/testimonialslider.md +254 -0
- package/.llm/components/textarea.md +8 -0
- package/.llm/components/textinput.md +8 -0
- package/.llm/components/tooltip.md +8 -0
- package/.llm/components/typography.md +8 -0
- 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 +24 -0
- package/.llm/tokens.md +56 -12
- package/AGENTS.md +28 -3
- 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/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-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
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
<!-- GENERATED from pagination-dots.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# PaginationDots
|
|
4
|
+
|
|
5
|
+
A row of marks, one per position in a short sequence — the slides of a slider, the steps of a walkthrough — with the one the reader is on drawn as a longer, solid pill and the rest as small translucent dots. Every mark is a button that moves there. It draws in the ink of whatever it stands on, so the same row reads white on a coral band and near-black on the page. Under autoplay it also moves on its own.
|
|
6
|
+
|
|
7
|
+
## Use when
|
|
8
|
+
|
|
9
|
+
- Showing where the reader is in a short sequence they move through — a slider's slides, a carousel of cards, the steps of a walkthrough — and letting them jump to any of it
|
|
10
|
+
|
|
11
|
+
## Do not use
|
|
12
|
+
|
|
13
|
+
- A set divided into pages of results → `Pagination`
|
|
14
|
+
- More than about ten positions — a dot carries no number, so past a handful the reader is counting marks too small and too many to count
|
|
15
|
+
- The only way through a sequence without thinking about it: the marks are 8px-wide targets, so a row that stands alone — as CtaBannerSlider's does, beside a swipe — is the hardest control a pointer has to hit on the page. Give the holder previous and next steps where the sequence is one a reader works through.
|
|
16
|
+
|
|
17
|
+
## Anatomy
|
|
18
|
+
|
|
19
|
+
PaginationDots renders 3 elements. A token binding names the part it applies to.
|
|
20
|
+
|
|
21
|
+
- `root` — `<div>`, class `dds-paginationdots`. The row, and the group the marks are announced as. A group rather than navigation: moving between slides is not going somewhere on the site. Its gap is space.gap.sm, the width of a dot, between every pair of marks whichever is current.
|
|
22
|
+
- `dot` — `<button>`, class `dds-paginationdots__dot`. One position. The button is the target and the mark is its child: the target is size.target.min tall, so the row is easy to hit along the axis a pointer comes from, and as wide as its mark — under WCAG's 24px on that axis, recorded as a target waiver, so the space between one mark and the next is the row's own gap and nothing else. Centred in a wider box, an 8px dot carried 16px of air either side while the stretched current pill filled its box edge to edge, and the gaps either side of the pill came out narrower than every other. Under the default variant it takes the ink of the ground it stands on — currentcolor — so nothing names a colour; under accent it is color.fg.brand-accent, and the mark inside follows it either way.
|
|
23
|
+
- `mark` — `<span>`, class `dds-paginationdots__mark`. The mark the reader sees. The rest are size.dot.diameter circles at opacity.dot-rest; the current one is solid and stretches to size.dot.current, so the position reads by shape as well as by weight. It is the reference banner's mark — the stretch moves the neighbours along, which the reference accepts for the clearer current. Only its width and its opacity travel, on motion.duration.slow and motion.easing.shift — the same clock and curve a slider moves its slides on — so the pill leaves the old mark and grows on the new one in the same beat as the slide it marks, rather than finishing first and leaving the slide to catch up.
|
|
24
|
+
|
|
25
|
+
Apply these classes from the generated `paginationDotsParts` constant rather than writing the strings by hand.
|
|
26
|
+
|
|
27
|
+
## Composition
|
|
28
|
+
|
|
29
|
+
- Takes no children. Everything it renders comes from props
|
|
30
|
+
|
|
31
|
+
## Props
|
|
32
|
+
|
|
33
|
+
### variant — `default` | `accent` (default `default`)
|
|
34
|
+
|
|
35
|
+
- `default` — The marks take the ink of whatever the row stands on — white on a coral or dark band, near-black on the page — so the row belongs to its ground. The usual choice, and the only one on a band.
|
|
36
|
+
- `accent` — On the bare page, where the row should carry the brand: the marks are color.fg.brand-accent, the current pill solid coral and the rest the same coral held back. The solid pill clears 3:1 against the page at 3.11:1, just; the resting marks do not, as at the default — so only on the page's own ground, where nothing takes the coral lower.
|
|
37
|
+
|
|
38
|
+
Use when: Whether the marks belong to their ground or to the brand.
|
|
39
|
+
Never for: accent on a coral or brand band, where coral marks on the coral ground disappear, or on a tinted surface, which takes the coral below the 3:1 a mark is owed.
|
|
40
|
+
|
|
41
|
+
### page — `number` (default `1`)
|
|
42
|
+
|
|
43
|
+
Use when: Which position the reader is on, counted from 1. The consumer holds it, because the slide or step in view is theirs too and the two are one fact.
|
|
44
|
+
|
|
45
|
+
### totalPages — `number` (default `1`)
|
|
46
|
+
|
|
47
|
+
Use when: How many positions there are, which is how many marks the row draws.
|
|
48
|
+
|
|
49
|
+
### onPageChange — `callback`
|
|
50
|
+
|
|
51
|
+
Use when: Whenever the marks should move anything — called with the position pressed. The row does not move itself; the consumer sets page from it.
|
|
52
|
+
|
|
53
|
+
### autoplay — `boolean` (default `false`)
|
|
54
|
+
|
|
55
|
+
Use when: The sequence should move on its own — a slider of promotions, a hero that rotates. The row advances page through onPageChange every motion.duration.dwell, wrapping from the last position to the first. It holds while `paused` is set, never moves for a reader who asked for less motion, and stops for good once the reader presses a mark. That last is the WAI carousel pattern's rule that a reader who has chosen a position 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.
|
|
56
|
+
Never for: A sequence the reader has to work through — a walkthrough, a form in steps. Moving it for them takes away the one thing they came to control.
|
|
57
|
+
|
|
58
|
+
### paused — `boolean` (default `false`)
|
|
59
|
+
|
|
60
|
+
Use when: Whatever holds the row wants the rotation held for now — while the pointer is over the slide or focus is inside it, so a reader is never moved on mid-sentence. It lets go when this goes false.
|
|
61
|
+
|
|
62
|
+
### label — `string` (default `Slides`)
|
|
63
|
+
|
|
64
|
+
Use when: The name the row is announced by, as a group. Name what the positions are: 'Slides', 'Steps'. Translate it with the page.
|
|
65
|
+
|
|
66
|
+
### itemLabel — `string` (default `Slide`)
|
|
67
|
+
|
|
68
|
+
Use when: The word each mark is named by, before its number — 'Slide 2'. Translate it with the page; a language that puts the number first is the reason a sentence template would be better, and the reason this is not yet one.
|
|
69
|
+
|
|
70
|
+
## Accessibility
|
|
71
|
+
|
|
72
|
+
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.
|
|
73
|
+
|
|
74
|
+
- Announced as: `group`
|
|
75
|
+
- `Tab` — Moves through the marks in order. Each is a separate button rather than one roving control, because each is a place the reader can see and pick
|
|
76
|
+
- `Enter` — Moves to the position the focused mark names
|
|
77
|
+
- `Space` — Moves to the position the focused mark names
|
|
78
|
+
- accessible name from label, so the row is a named group
|
|
79
|
+
- Each mark is a button named by its position — 'Slide 2' — and the current one carries aria-current, so the position is announced as well as drawn
|
|
80
|
+
- Every mark is size.target.min tall. Its width is the mark's own, below WCAG 2.5.8's 24px — recorded as a target waiver, with the reason and the review date
|
|
81
|
+
- Under autoplay, no movement for a reader who asked for less motion, a hold while the holder sets paused, and a stop for good once the reader presses a mark. No pause control is drawn, so the way to stop it is a press, which nothing on screen announces
|
|
82
|
+
- Only the current mark clears the 3:1 WCAG 1.4.11 asks of a control against its ground. The resting marks, at opacity.dot-rest, do not — around 1.7:1 in white on the coral band and 1.9:1 in accent on the page — and cannot without becoming as solid as the current one, which would lose the one difference the row exists to show. The current position is carried by the solid pill and by aria-current
|
|
83
|
+
|
|
84
|
+
## Rules
|
|
85
|
+
|
|
86
|
+
- **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.
|
|
87
|
+
|
|
88
|
+
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.
|
|
89
|
+
|
|
90
|
+
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.
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
|
|
94
|
+
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.
|
|
95
|
+
|
|
96
|
+
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.
|
|
97
|
+
Guidance only — cannot be checked automatically.
|
|
98
|
+
- **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, Input and Switch simultaneously.
|
|
99
|
+
Guidance only — cannot be checked automatically.
|
|
100
|
+
- **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.
|
|
101
|
+
|
|
102
|
+
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.
|
|
103
|
+
|
|
104
|
+
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.
|
|
105
|
+
Guidance only — cannot be checked automatically.
|
|
106
|
+
- **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.
|
|
107
|
+
|
|
108
|
+
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.
|
|
109
|
+
|
|
110
|
+
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.
|
|
111
|
+
|
|
112
|
+
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.
|
|
113
|
+
|
|
114
|
+
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.
|
|
115
|
+
|
|
116
|
+
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.
|
|
117
|
+
|
|
118
|
+
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.
|
|
119
|
+
|
|
120
|
+
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.
|
|
121
|
+
|
|
122
|
+
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.
|
|
123
|
+
Guidance only — cannot be checked automatically.
|
|
124
|
+
- **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.
|
|
125
|
+
|
|
126
|
+
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.
|
|
127
|
+
|
|
128
|
+
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.
|
|
129
|
+
|
|
130
|
+
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.
|
|
131
|
+
|
|
132
|
+
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.
|
|
133
|
+
|
|
134
|
+
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.
|
|
135
|
+
|
|
136
|
+
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.
|
|
137
|
+
|
|
138
|
+
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.
|
|
139
|
+
|
|
140
|
+
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.
|
|
141
|
+
Guidance only — cannot be checked automatically.
|
|
142
|
+
- **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.
|
|
143
|
+
|
|
144
|
+
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.
|
|
145
|
+
|
|
146
|
+
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.
|
|
147
|
+
|
|
148
|
+
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.
|
|
149
|
+
Guidance only — cannot be checked automatically.
|
|
150
|
+
- **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.
|
|
151
|
+
|
|
152
|
+
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.
|
|
153
|
+
|
|
154
|
+
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.
|
|
155
|
+
|
|
156
|
+
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.
|
|
157
|
+
Guidance only — cannot be checked automatically.
|
|
158
|
+
|
|
159
|
+
## Anti-examples
|
|
160
|
+
|
|
161
|
+
❌ PaginationDots for: A set divided into pages of results
|
|
162
|
+
Results are a set the reader wants to know the size of and jump across by number. Dots carry no number, so past a handful they cannot say where in the set the reader is.
|
|
163
|
+
→ use `Pagination` instead.
|
|
164
|
+
|
|
165
|
+
## Example
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
import { PaginationDots } from '@deriv-com/dds-marketing'
|
|
169
|
+
|
|
170
|
+
<PaginationDots page={2} totalPages={4} />
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## In use
|
|
174
|
+
|
|
175
|
+
### Where the reader is
|
|
176
|
+
|
|
177
|
+
The current position stretches into a solid pill; the rest stay small and translucent. Every mark is a button that moves there.
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
import { PaginationDots } from '@deriv-com/dds-marketing'
|
|
181
|
+
|
|
182
|
+
// First of four
|
|
183
|
+
<PaginationDots page={1} totalPages={4} />
|
|
184
|
+
|
|
185
|
+
// Third of four
|
|
186
|
+
<PaginationDots page={3} totalPages={4} />
|
|
187
|
+
|
|
188
|
+
// Steps of a walkthrough
|
|
189
|
+
<PaginationDots page={2} totalPages={5} label="Steps" itemLabel="Step" />
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Whose colour
|
|
193
|
+
|
|
194
|
+
default takes the ground's ink, so it reads on any band. accent carries the brand coral, for the bare page only.
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
import { PaginationDots } from '@deriv-com/dds-marketing'
|
|
198
|
+
|
|
199
|
+
// default — the ground's ink
|
|
200
|
+
<PaginationDots page={2} totalPages={4} variant="default" />
|
|
201
|
+
|
|
202
|
+
// accent — the brand coral
|
|
203
|
+
<PaginationDots page={2} totalPages={4} variant="accent" />
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Moving on its own
|
|
207
|
+
|
|
208
|
+
autoplay advances the row every dwell, wrapping at the end. It holds while paused is set, and stays still for a reader who asked for less motion.
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
import { PaginationDots } from '@deriv-com/dds-marketing'
|
|
212
|
+
|
|
213
|
+
// Rotating
|
|
214
|
+
<PaginationDots page={1} totalPages={4} autoplay />
|
|
215
|
+
```
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
<!-- GENERATED from product-hero.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# ProductHero
|
|
4
|
+
|
|
5
|
+
The band that opens a product or a market page: the one thing the page is about, centred, over a ground dark enough that nothing above it competes.
|
|
6
|
+
|
|
7
|
+
The second of three opening bands. Which one a page takes follows from where the page sits rather than from a prop — this is the product tier, one thing a reader can trade or one market to trade it in.
|
|
8
|
+
|
|
9
|
+
The claim is centred and the product sits under it rather than beside it, whole and uncropped: on this tier the thing itself is what the reader came to see. A screen tall, like the tier above it.
|
|
10
|
+
|
|
11
|
+
## Use when
|
|
12
|
+
|
|
13
|
+
- A product or a market page needs its opening band — a platform, an instrument, an asset class
|
|
14
|
+
- The thing the page is about is worth showing whole, under the claim rather than beside it
|
|
15
|
+
- The steps between an eyebrow, a title, a description and the actions under them have to be the same on every product page
|
|
16
|
+
|
|
17
|
+
## Do not use
|
|
18
|
+
|
|
19
|
+
- The page is the front page, or a campaign page under it → `LandingHero`
|
|
20
|
+
- The page is a company or a legal one — contact, about, terms → `PageHeader`
|
|
21
|
+
- The band closes the page rather than opening it → `Footer`
|
|
22
|
+
- A landing, company or legal page. Each tier has its own band, and the reason they are separate components is so that this cannot be overridden
|
|
23
|
+
- A second band further down the page. This is the page's opening and its `h1`
|
|
24
|
+
- The navigation above it or the trail beneath that. Both are the page's and neither is the band's
|
|
25
|
+
|
|
26
|
+
## Anatomy
|
|
27
|
+
|
|
28
|
+
ProductHero renders 9 elements. A token binding names the part it applies to.
|
|
29
|
+
|
|
30
|
+
- `root` — `<section>`, class `dds-producthero`. The band. It paints the ground, carries the background image where there is one, and clips everything to its own edge so a visual that overruns cannot widen the page. `container-type` is what its own rules ask their width against, so a band placed in a narrow region of a wide page folds on its own measure rather than the window's.
|
|
31
|
+
- `inner` — `<div>`, class `dds-producthero__inner`. The measure, and the gutter. It caps the content at the page's own maximum and holds the page inset, which is what keeps a band's text in the same column as the section under it. Positioned so it sits above the photograph without either of them naming a stacking order.
|
|
32
|
+
- `content` — `<div>`, class `dds-producthero__content`. The column the band is read down: the text, then what a reader can do about it, then the visual in the arrangement that puts one there. One step between them, because the move from reading to acting is the same move on every page. It takes the whole measure rather than hugging its longest line: `inner` is a flex row, so a column that declared no width would shrink to its text and sit at the leading edge — which centring inside it cannot correct, because the box being centred in is already the wrong shape.
|
|
33
|
+
- `text` — `<div>`, class `dds-producthero__text`. The eyebrow, the title and the description, in that order. It sets no gap of its own: the step from an eyebrow to a title and the step from a title to a description are two different roles, and a single gap could only ever be one of them. Each part carries its own.
|
|
34
|
+
- `eyebrow` — `<p>`, class `dds-producthero__eyebrow`. The line above the title. Set at label weight rather than body, because it is a label — a reader takes it in without reading it, and at regular weight it reads as a first sentence the title then interrupts.
|
|
35
|
+
|
|
36
|
+
Set in `font.eyebrow.lg`, which is sized against the heading under it rather than against body text. It took an interactive text role for a while and read as small print over a display title — the same sixteen pixels a button's label takes, under eighty. Rendered only when `eyebrow` is set.
|
|
37
|
+
- `title` — `<h1>`, class `dds-producthero__title`. The page's leading heading, and the band's accessible name. It renders as `h2` when `headingLevel` says so and is set identically either way. `text-wrap: balance` because a two-line title broken one-word-short reads as a mistake at this size, where at body size nobody would notice.
|
|
38
|
+
- `description` — `<p>`, class `dds-producthero__description`. The sentence under the title. Held to a readable measure rather than the band's — a line of sixteen-pixel text run across twelve hundred pixels is a line a reader loses their place in, and the measure role exists so no page has to guess where to stop it. Rendered only when `description` is set.
|
|
39
|
+
- `actions` — `<div>`, class `dds-producthero__actions`. What a reader can do. It wraps rather than scrolls, because two full-width buttons on a phone are two rows and a row that scrolled sideways would hide the second one. Rendered only when `actions` is set.
|
|
40
|
+
- `media` — `<div>`, class `dds-producthero__media`. The product itself, under the claim. In the column rather than against the band's edge — a product page is about one thing and the reader came to see it whole, so nothing crops it. It clips what it holds, because the corner it binds is otherwise a radius on a box nothing is drawn inside: the picture kept its own square edges and the token did nothing.
|
|
41
|
+
|
|
42
|
+
It is a square with square corners, standing on the band's foot.
|
|
43
|
+
|
|
44
|
+
A square because what goes here is the product itself rather than a scene around it — a shape with no long side does not ask to be composed into, so a screenshot, a device and a person all sit in it the same way, and a page of these bands keeps one silhouette. Square corners because it is not a card: a rounded edge says the picture is an object placed on the band, and this one is meant to read as the thing the page is about, seen inside it. And on the foot because a picture with air under it floats — cropped by the band's own edge it is standing in the band, which is the arrangement LandingHero's subject takes for the same reason. Rendered only when `media` is set.
|
|
45
|
+
|
|
46
|
+
Apply these classes from the generated `productHeroParts` constant rather than writing the strings by hand.
|
|
47
|
+
|
|
48
|
+
## Composition
|
|
49
|
+
|
|
50
|
+
- Takes no children. Everything it renders comes from props
|
|
51
|
+
- Never contains: `ProductHero`, `LandingHero`, `Footer`, `Navbar`, `SubdomainNavbar`, `Table`, `Accordion`, `BottomSheet` — in children or in any prop that takes a node
|
|
52
|
+
|
|
53
|
+
## Props
|
|
54
|
+
|
|
55
|
+
### eyebrow — `string`
|
|
56
|
+
|
|
57
|
+
Use when: A word or two placing the page before its title names it — a product family, a market, a campaign
|
|
58
|
+
Never for: A second sentence. This is the line a reader takes in without reading; at the length of a clause it is a description in the wrong place and at the wrong weight
|
|
59
|
+
|
|
60
|
+
### title — `string` **Required.**
|
|
61
|
+
|
|
62
|
+
Use when: Always. The one thing the page is about, in the fewest words that still say it. It is the page's leading heading and the band's accessible name
|
|
63
|
+
Never for: A sentence with a full stop. A title that reads as prose is a description that has been set at eighty pixels
|
|
64
|
+
|
|
65
|
+
### headingLevel — `h1` | `h2` (default `h1`)
|
|
66
|
+
|
|
67
|
+
- `h1` — The default, and correct whenever the hero opens the page — which is what a hero is for
|
|
68
|
+
- `h2` — The rare page that already carries its `h1` elsewhere, and would otherwise have two
|
|
69
|
+
|
|
70
|
+
Use when: Which heading element the title renders as. The default is right for the band a page opens with, which is the only place this belongs.
|
|
71
|
+
|
|
72
|
+
The appearance never changes — both levels bind `font.h1`, because the size is the band's decision and the level is the document's.
|
|
73
|
+
Never for: Making the title look smaller. The level is what a screen reader builds its outline from, and nothing about it reaches the type
|
|
74
|
+
|
|
75
|
+
### description — `string`
|
|
76
|
+
|
|
77
|
+
Use when: The sentence under the title that says what the claim above it means, for the reader who is not yet convinced by the claim alone
|
|
78
|
+
Never for: A paragraph. It is held to a readable measure and set at body size; past a couple of sentences a reader scrolls rather than reads, and the actions go under the fold
|
|
79
|
+
|
|
80
|
+
### actions — `node`
|
|
81
|
+
|
|
82
|
+
Accepts: Button, Link
|
|
83
|
+
Use when: The one or two things the page wants a reader to do. Composed by the page rather than described to this component, so a call to action is the same Button here as anywhere else on the site
|
|
84
|
+
Never for: A row of destinations. Three or more controls under a title is a menu, and a reader who has to choose between five things chooses none
|
|
85
|
+
|
|
86
|
+
### media — `node`
|
|
87
|
+
|
|
88
|
+
Accepts: AspectRatio
|
|
89
|
+
Use when: The product itself, under the claim and the actions — in the column, capped to the measure, and whole
|
|
90
|
+
Never for: The background. A photograph filling the band is `backgroundImage`; this sits in front of it, in the column, and is never cropped
|
|
91
|
+
|
|
92
|
+
### backgroundImage — `string`
|
|
93
|
+
|
|
94
|
+
Use when: A photograph filling the whole band. It is shown as it is — nothing is painted over it, so choose one already dark enough that the title reads on it
|
|
95
|
+
Never for: A flat colour, or a bright photograph. The band already paints its ground, and nothing here darkens an image on the page's behalf — a pale one leaves the claim unreadable
|
|
96
|
+
|
|
97
|
+
## Accessibility
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
- Announced as: `region`
|
|
102
|
+
- `Tab` — Moves through whatever the actions hold, in the order the page composed them. Nothing in the band is a composite widget — there is no roving tabindex and no arrow keys, because a hero is read rather than operated.
|
|
103
|
+
- accessible name from title, so the band is a named region a screen reader can jump to and skip rather than an unlabelled section a reader has to walk
|
|
104
|
+
- Both visual slots are decoration and are hidden from assistive technology. What the band says is the title and the description; an image conveying something they do not is a hero that reads as empty to anyone who cannot see it
|
|
105
|
+
- The title renders as h1 by default and h2 only where the page already carries its h1. Nothing about the level changes the type, so a page cannot be tempted to choose it for the size
|
|
106
|
+
|
|
107
|
+
## Rules
|
|
108
|
+
|
|
109
|
+
- **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.
|
|
110
|
+
|
|
111
|
+
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.
|
|
112
|
+
|
|
113
|
+
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.
|
|
114
|
+
|
|
115
|
+
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.
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
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
|
+
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, Input and Switch simultaneously.
|
|
122
|
+
Guidance only — cannot be checked automatically.
|
|
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
|
+
|
|
125
|
+
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.
|
|
126
|
+
|
|
127
|
+
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.
|
|
128
|
+
Guidance only — cannot be checked automatically.
|
|
129
|
+
- **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.
|
|
130
|
+
|
|
131
|
+
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.
|
|
132
|
+
|
|
133
|
+
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.
|
|
134
|
+
|
|
135
|
+
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.
|
|
136
|
+
|
|
137
|
+
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.
|
|
138
|
+
|
|
139
|
+
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.
|
|
140
|
+
|
|
141
|
+
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.
|
|
142
|
+
|
|
143
|
+
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.
|
|
144
|
+
|
|
145
|
+
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.
|
|
146
|
+
Guidance only — cannot be checked automatically.
|
|
147
|
+
- **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.
|
|
148
|
+
|
|
149
|
+
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.
|
|
150
|
+
|
|
151
|
+
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.
|
|
152
|
+
|
|
153
|
+
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.
|
|
154
|
+
|
|
155
|
+
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.
|
|
156
|
+
|
|
157
|
+
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.
|
|
158
|
+
|
|
159
|
+
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.
|
|
160
|
+
|
|
161
|
+
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.
|
|
162
|
+
|
|
163
|
+
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.
|
|
164
|
+
Guidance only — cannot be checked automatically.
|
|
165
|
+
- **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.
|
|
166
|
+
|
|
167
|
+
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.
|
|
168
|
+
|
|
169
|
+
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.
|
|
170
|
+
|
|
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
|
+
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.
|
|
181
|
+
|
|
182
|
+
## Anti-examples
|
|
183
|
+
|
|
184
|
+
❌ ProductHero for: The page is the front page, or a campaign page under it
|
|
185
|
+
The landing tier, where the claim ranges to the reading edge and the subject crops against the band's edge
|
|
186
|
+
→ use `LandingHero` instead.
|
|
187
|
+
|
|
188
|
+
❌ ProductHero for: The page is a company or a legal one — contact, about, terms
|
|
189
|
+
The tertiary tier: a short band with no photograph, because those pages open with their content
|
|
190
|
+
→ use `PageHeader` instead.
|
|
191
|
+
|
|
192
|
+
❌ ProductHero for: The band closes the page rather than opening it
|
|
193
|
+
→ use `Footer` instead.
|
|
194
|
+
|
|
195
|
+
## Example
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
import { ProductHero, Button, AspectRatio } from '@deriv-com/dds-marketing'
|
|
199
|
+
|
|
200
|
+
<ProductHero backgroundImage="/sample-band-ground.svg" eyebrow="Forex" title="Trade global currencies" description="Speculate on over 50 major, minor and exotic currency pairs, with competitive spreads and 0% commission." actions={<Button variant="primary">Try free demo</Button>} media={<AspectRatio ratio="square" />} />
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## In use
|
|
204
|
+
|
|
205
|
+
### The band as a page has it
|
|
206
|
+
|
|
207
|
+
The photograph, the claim centred over it, and the product under the actions — in the column, capped to the measure, and whole.
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import { AspectRatio, Button, ProductHero } from '@deriv-com/dds-marketing'
|
|
211
|
+
|
|
212
|
+
// The photograph, the claim, and the visual beside it
|
|
213
|
+
<ProductHero backgroundImage="/sample-band-ground.svg" eyebrow="Forex" title="Trade global currencies" description="Speculate on over 50 major, minor and exotic currency pairs, with competitive spreads and 0% commission." actions={<Button variant="primary">Try free demo</Button>} media={<AspectRatio ratio="square" />} />
|
|
214
|
+
|
|
215
|
+
// The same band with no photograph, on its own ground
|
|
216
|
+
<ProductHero eyebrow="Forex" title="Trade global currencies" description="Speculate on over 50 major, minor and exotic currency pairs, with competitive spreads and 0% commission." actions={<Button variant="primary">Try free demo</Button>} media={<AspectRatio ratio="square" />} />
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### How much the band carries
|
|
220
|
+
|
|
221
|
+
Every part above the actions is optional. A band with a title alone is still the page's opening, and the steps close up rather than leaving a gap where a part would have been.
|
|
222
|
+
|
|
223
|
+
```tsx
|
|
224
|
+
import { Button, ProductHero } from '@deriv-com/dds-marketing'
|
|
225
|
+
|
|
226
|
+
// Title alone
|
|
227
|
+
<ProductHero title="Trade global currencies" />
|
|
228
|
+
|
|
229
|
+
// Title and description
|
|
230
|
+
<ProductHero title="Trade global currencies" description="Speculate on over 50 major, minor and exotic currency pairs, with competitive spreads and 0% commission." />
|
|
231
|
+
|
|
232
|
+
// The whole band
|
|
233
|
+
<ProductHero eyebrow="Forex" title="Trade global currencies" description="Speculate on over 50 major, minor and exotic currency pairs, with competitive spreads and 0% commission." actions={<Button variant="primary">Try free demo</Button>} />
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### The document's outline
|
|
237
|
+
|
|
238
|
+
The title is the page's leading heading. `headingLevel` changes the element a screen reader builds its outline from and nothing about the type, which is the band's decision either way.
|
|
239
|
+
|
|
240
|
+
```tsx
|
|
241
|
+
import { ProductHero } from '@deriv-com/dds-marketing'
|
|
242
|
+
|
|
243
|
+
// h1 — the default, and what a hero opening a page is
|
|
244
|
+
<ProductHero headingLevel="h1" title="Trade global currencies" description="Speculate on over 50 major, minor and exotic currency pairs, with competitive spreads and 0% commission." />
|
|
245
|
+
|
|
246
|
+
// h2 — the page already carries its h1 elsewhere
|
|
247
|
+
<ProductHero headingLevel="h2" title="Trade global currencies" description="Speculate on over 50 major, minor and exotic currency pairs, with competitive spreads and 0% commission." />
|
|
248
|
+
```
|
|
@@ -164,6 +164,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
164
164
|
|
|
165
165
|
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.
|
|
166
166
|
Guidance only — cannot be checked automatically.
|
|
167
|
+
- **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.
|
|
168
|
+
|
|
169
|
+
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.
|
|
170
|
+
|
|
171
|
+
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.
|
|
172
|
+
|
|
173
|
+
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.
|
|
174
|
+
Guidance only — cannot be checked automatically.
|
|
167
175
|
|
|
168
176
|
## Anti-examples
|
|
169
177
|
|
package/.llm/components/row.md
CHANGED
|
@@ -180,6 +180,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
180
180
|
|
|
181
181
|
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.
|
|
182
182
|
Guidance only — cannot be checked automatically.
|
|
183
|
+
- **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.
|
|
184
|
+
|
|
185
|
+
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.
|
|
186
|
+
|
|
187
|
+
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.
|
|
188
|
+
|
|
189
|
+
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.
|
|
190
|
+
Guidance only — cannot be checked automatically.
|
|
183
191
|
|
|
184
192
|
## Anti-examples
|
|
185
193
|
|
|
@@ -185,6 +185,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
185
185
|
|
|
186
186
|
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.
|
|
187
187
|
Guidance only — cannot be checked automatically.
|
|
188
|
+
- **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.
|
|
189
|
+
|
|
190
|
+
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.
|
|
191
|
+
|
|
192
|
+
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.
|
|
193
|
+
|
|
194
|
+
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.
|
|
195
|
+
Guidance only — cannot be checked automatically.
|
|
188
196
|
|
|
189
197
|
## Anti-examples
|
|
190
198
|
|
|
@@ -185,6 +185,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
185
185
|
|
|
186
186
|
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.
|
|
187
187
|
Guidance only — cannot be checked automatically.
|
|
188
|
+
- **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.
|
|
189
|
+
|
|
190
|
+
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.
|
|
191
|
+
|
|
192
|
+
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.
|
|
193
|
+
|
|
194
|
+
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.
|
|
195
|
+
Guidance only — cannot be checked automatically.
|
|
188
196
|
|
|
189
197
|
## Anti-examples
|
|
190
198
|
|
|
@@ -199,6 +199,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
199
199
|
|
|
200
200
|
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.
|
|
201
201
|
Guidance only — cannot be checked automatically.
|
|
202
|
+
- **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.
|
|
203
|
+
|
|
204
|
+
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.
|
|
205
|
+
|
|
206
|
+
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.
|
|
207
|
+
|
|
208
|
+
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.
|
|
209
|
+
Guidance only — cannot be checked automatically.
|
|
202
210
|
|
|
203
211
|
## Anti-examples
|
|
204
212
|
|
|
@@ -180,6 +180,14 @@ The target and the mark are separate decisions, and conflating them is what prod
|
|
|
180
180
|
|
|
181
181
|
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.
|
|
182
182
|
Guidance only — cannot be checked automatically.
|
|
183
|
+
- **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.
|
|
184
|
+
|
|
185
|
+
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.
|
|
186
|
+
|
|
187
|
+
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.
|
|
188
|
+
|
|
189
|
+
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.
|
|
190
|
+
Guidance only — cannot be checked automatically.
|
|
183
191
|
|
|
184
192
|
## Anti-examples
|
|
185
193
|
|