@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,217 @@
|
|
|
1
|
+
<!-- GENERATED from faq-accordion.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# FaqAccordion
|
|
4
|
+
|
|
5
|
+
A section of questions and answers: a heading over an Accordion, one question open at a time. The answers are put away until a reader asks for one, so a page can carry the ten things people ask before they sign up without being ten paragraphs long.
|
|
6
|
+
|
|
7
|
+
The rows are AccordionItems, handed in as children; this draws the heading and the column and wraps them in the Accordion that keeps one open. Everything about a row — the rule between rows, the chevron, the keyboard — is Accordion's.
|
|
8
|
+
|
|
9
|
+
## Use when
|
|
10
|
+
|
|
11
|
+
- The questions a reader asks before acting — fees, limits, how long a withdrawal takes — near the end of a landing page or on a help page
|
|
12
|
+
- Objections a page has to answer without making every reader read every answer
|
|
13
|
+
|
|
14
|
+
## Do not use
|
|
15
|
+
|
|
16
|
+
- The answers are short enough to read all at once → `FeatureBullets`
|
|
17
|
+
- Each item is a feature, not a question → `FeatureCards`
|
|
18
|
+
- Content a reader must see — terms, risk warnings, anything the page is obliged to show. A folded answer is one most readers never open
|
|
19
|
+
- Navigation. A row that opens to a list of links is a menu wearing a question
|
|
20
|
+
|
|
21
|
+
## Anatomy
|
|
22
|
+
|
|
23
|
+
FaqAccordion renders 4 elements. A token binding names the part it applies to.
|
|
24
|
+
|
|
25
|
+
- `root` — `<section>`, class `dds-faqaccordion`. The section. It paints the ground and the ink to go with it — see `ground` — and asks its own width, so the heading centres on the section's measure rather than the window's.
|
|
26
|
+
- `inner` — `<div>`, class `dds-faqaccordion__inner`. The measure and the gutter, the same column every band holds its content in, and the step from the heading to the questions: space.heading.content.
|
|
27
|
+
- `title` — `<h2>`, class `dds-faqaccordion__title`. What the questions are about. `h2` because a section sits under the page's own heading, and every question below it is an `h3` — Accordion's own default level. Starts on a phone, centred from the fold.
|
|
28
|
+
- `list` — `<div>`, class `dds-faqaccordion__list`. The questions, as wide as the column — the reference design's list runs the content width. It holds the Accordion this draws around the rows, which keeps one open and rules between them and nowhere else. On the dark band it is also where the questions are turned round, since AccordionItem has no tone of its own: see `ground`.
|
|
29
|
+
|
|
30
|
+
Apply these classes from the generated `faqAccordionParts` constant rather than writing the strings by hand.
|
|
31
|
+
|
|
32
|
+
## Composition
|
|
33
|
+
|
|
34
|
+
- Can contain: `AccordionItem`
|
|
35
|
+
- Never contains: `Accordion`, `FaqAccordion`, `LandingHero`, `ProductHero`, `PageHeader`, `Footer`, `Navbar` — in children or in any prop that takes a node
|
|
36
|
+
- Holds at least 2
|
|
37
|
+
|
|
38
|
+
## Props
|
|
39
|
+
|
|
40
|
+
### ground — `page` | `subtle` | `strong` (default `page`)
|
|
41
|
+
|
|
42
|
+
- `page` — The default, and the page's own white. A section that has nothing to separate itself from what is above it — most of them — and the ground a reader is already on
|
|
43
|
+
- `subtle` — A quiet step off the page, for a band that wants to read as its own section without changing the page's voice — the reference design's slate FAQ. Painted as the band's tint laid over the page's own ground, so it is the same grey whatever is behind the section.
|
|
44
|
+
- `strong` — `color.bg.brand-strong`, the dark band. It stops the page rather than dividing it, so it is for a section a reader should arrive at — and one per page is usually one more than enough. The questions turn round with it: white headings, a muted chevron and rules in the band's own veil, fixed like the band
|
|
45
|
+
|
|
46
|
+
Use when: Which of the page's three grounds this section paints. A marketing page is white, and a band that wants to be seen as a band takes one of the other two — so this is how a page builds its rhythm: white, white, grey, white, dark. Two in a row is a deliberate pair rather than an accident, and the section above knows nothing about the one below it, so the page is the only thing that can decide.
|
|
47
|
+
|
|
48
|
+
The ink follows the ground and is not a second decision: a dark band carries white type because this sets both halves in one value, which is what the painted-ground-carries-its-ink rule exists to stop a page getting wrong.
|
|
49
|
+
Never for: Marking importance. Every section on a page painted a ground is a page with no emphasis left.
|
|
50
|
+
|
|
51
|
+
### title — `string` **Required.**
|
|
52
|
+
|
|
53
|
+
Use when: Always. What the questions are about, in the fewest words — "Frequently asked questions", "Withdrawals".
|
|
54
|
+
Never for: A question. The rows are the questions; the heading is what they share.
|
|
55
|
+
|
|
56
|
+
## Accessibility
|
|
57
|
+
|
|
58
|
+
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.
|
|
59
|
+
|
|
60
|
+
- Announced as: `region`
|
|
61
|
+
- `Tab` — Moves from question to question. Each heading is a button; Enter or Space opens its answer and closes whichever was open — the keyboard is AccordionItem's.
|
|
62
|
+
- accessible name from title, so the section is a named region a screen reader can jump to and skip
|
|
63
|
+
- The questions are headings one level under the section's own, so a reader moving by heading lands on each question and the outline reads as the page's.
|
|
64
|
+
|
|
65
|
+
## Rules
|
|
66
|
+
|
|
67
|
+
- **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.
|
|
68
|
+
|
|
69
|
+
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.
|
|
70
|
+
|
|
71
|
+
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.
|
|
72
|
+
|
|
73
|
+
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.
|
|
74
|
+
|
|
75
|
+
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.
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
Guidance only — cannot be checked automatically.
|
|
79
|
+
- **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.
|
|
80
|
+
Guidance only — cannot be checked automatically.
|
|
81
|
+
- **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.
|
|
82
|
+
|
|
83
|
+
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.
|
|
84
|
+
|
|
85
|
+
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.
|
|
86
|
+
Guidance only — cannot be checked automatically.
|
|
87
|
+
- **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.
|
|
88
|
+
|
|
89
|
+
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.
|
|
90
|
+
|
|
91
|
+
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.
|
|
92
|
+
|
|
93
|
+
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.
|
|
94
|
+
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
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.
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
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.
|
|
104
|
+
Guidance only — cannot be checked automatically.
|
|
105
|
+
- **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.
|
|
106
|
+
|
|
107
|
+
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.
|
|
108
|
+
|
|
109
|
+
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.
|
|
110
|
+
|
|
111
|
+
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.
|
|
112
|
+
|
|
113
|
+
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.
|
|
114
|
+
|
|
115
|
+
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.
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
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.
|
|
120
|
+
|
|
121
|
+
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.
|
|
122
|
+
Guidance only — cannot be checked automatically.
|
|
123
|
+
- **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.
|
|
124
|
+
|
|
125
|
+
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.
|
|
126
|
+
|
|
127
|
+
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.
|
|
128
|
+
|
|
129
|
+
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.
|
|
130
|
+
Guidance only — cannot be checked automatically.
|
|
131
|
+
- **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.
|
|
132
|
+
|
|
133
|
+
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.
|
|
134
|
+
|
|
135
|
+
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.
|
|
136
|
+
|
|
137
|
+
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.
|
|
138
|
+
Guidance only — cannot be checked automatically.
|
|
139
|
+
|
|
140
|
+
## Anti-examples
|
|
141
|
+
|
|
142
|
+
❌ FaqAccordion for: The answers are short enough to read all at once
|
|
143
|
+
A list a reader scans needs nothing opened; folding six one-line answers makes six clicks of what was one glance
|
|
144
|
+
→ use `FeatureBullets` instead.
|
|
145
|
+
|
|
146
|
+
❌ FaqAccordion for: Each item is a feature, not a question
|
|
147
|
+
Features are compared side by side; questions are looked up one at a time
|
|
148
|
+
→ use `FeatureCards` instead.
|
|
149
|
+
|
|
150
|
+
## Example
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { FaqAccordion, AccordionItem } from '@deriv-com/dds-marketing'
|
|
154
|
+
|
|
155
|
+
<FaqAccordion title="Frequently asked questions">
|
|
156
|
+
<AccordionItem title="Is there a minimum deposit?" onExpandedChange={(expanded) => { /* your handler */ }}>There is no minimum on any account. Fund it with whatever you plan to trade.</AccordionItem>
|
|
157
|
+
<AccordionItem title="How long do withdrawals take?" onExpandedChange={(expanded) => { /* your handler */ }}>Most withdrawals reach you within one working day. Card refunds can take up to five.</AccordionItem>
|
|
158
|
+
<AccordionItem title="Which markets can I trade?" onExpandedChange={(expanded) => { /* your handler */ }}>Forex, stocks, stock indices, commodities, cryptocurrencies and derived indices, all from one account.</AccordionItem>
|
|
159
|
+
<AccordionItem title="Is my money safe?" onExpandedChange={(expanded) => { /* your handler */ }}>Client funds are held in segregated accounts, separate from the company's own.</AccordionItem>
|
|
160
|
+
<AccordionItem title="Can I try trading without risking money?" onExpandedChange={(expanded) => { /* your handler */ }}>Every account comes with a free demo account, funded with virtual money and reloadable whenever you like.</AccordionItem>
|
|
161
|
+
</FaqAccordion>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## In use
|
|
165
|
+
|
|
166
|
+
Most rows below hold the same set, written once here:
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import { AccordionItem } from '@deriv-com/dds-marketing'
|
|
170
|
+
|
|
171
|
+
const accordionitems = (
|
|
172
|
+
<>
|
|
173
|
+
<AccordionItem title="Is there a minimum deposit?">There is no minimum on any account. Fund it with whatever you plan to trade.</AccordionItem>
|
|
174
|
+
<AccordionItem title="How long do withdrawals take?">Most withdrawals reach you within one working day. Card refunds can take up to five.</AccordionItem>
|
|
175
|
+
<AccordionItem title="Which markets can I trade?">Forex, stocks, stock indices, commodities, cryptocurrencies and derived indices, all from one account.</AccordionItem>
|
|
176
|
+
</>
|
|
177
|
+
)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### The three grounds
|
|
181
|
+
|
|
182
|
+
The page for a section with nothing to set it apart, the grey band to close a page, the dark band for one a reader should arrive at — the questions turned round with it.
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
import { FaqAccordion } from '@deriv-com/dds-marketing'
|
|
186
|
+
|
|
187
|
+
// ground="page"
|
|
188
|
+
<FaqAccordion title="Frequently asked questions">{accordionitems}</FaqAccordion>
|
|
189
|
+
|
|
190
|
+
// ground="subtle"
|
|
191
|
+
<FaqAccordion ground="subtle" title="Frequently asked questions">{accordionitems}</FaqAccordion>
|
|
192
|
+
|
|
193
|
+
// ground="strong"
|
|
194
|
+
<FaqAccordion ground="strong" title="Frequently asked questions">{accordionitems}</FaqAccordion>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### How many questions
|
|
198
|
+
|
|
199
|
+
Two at least, because a set is what makes an accordion worth opening. One open at a time, and rules only between rows.
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
import { AccordionItem, FaqAccordion } from '@deriv-com/dds-marketing'
|
|
203
|
+
|
|
204
|
+
// Two questions
|
|
205
|
+
<FaqAccordion title="Withdrawals">
|
|
206
|
+
<AccordionItem title="Is there a minimum deposit?" onExpandedChange={(expanded) => { /* your handler */ }}>There is no minimum on any account. Fund it with whatever you plan to trade.</AccordionItem>
|
|
207
|
+
<AccordionItem title="How long do withdrawals take?" onExpandedChange={(expanded) => { /* your handler */ }}>Most withdrawals reach you within one working day. Card refunds can take up to five.</AccordionItem>
|
|
208
|
+
</FaqAccordion>
|
|
209
|
+
|
|
210
|
+
// Four questions
|
|
211
|
+
<FaqAccordion title="Frequently asked questions">
|
|
212
|
+
<AccordionItem title="Is there a minimum deposit?" onExpandedChange={(expanded) => { /* your handler */ }}>There is no minimum on any account. Fund it with whatever you plan to trade.</AccordionItem>
|
|
213
|
+
<AccordionItem title="How long do withdrawals take?" onExpandedChange={(expanded) => { /* your handler */ }}>Most withdrawals reach you within one working day. Card refunds can take up to five.</AccordionItem>
|
|
214
|
+
<AccordionItem title="Which markets can I trade?" onExpandedChange={(expanded) => { /* your handler */ }}>Forex, stocks, stock indices, commodities, cryptocurrencies and derived indices, all from one account.</AccordionItem>
|
|
215
|
+
<AccordionItem title="Is my money safe?" onExpandedChange={(expanded) => { /* your handler */ }}>Client funds are held in segregated accounts, separate from the company's own.</AccordionItem>
|
|
216
|
+
</FaqAccordion>
|
|
217
|
+
```
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
<!-- GENERATED from feature-bullets.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# FeatureBullets
|
|
4
|
+
|
|
5
|
+
A section pairing a claim with a ruled list of what something includes, beside one picture.
|
|
6
|
+
|
|
7
|
+
The list is the argument: each line is one thing a reader gets, and the column is meant to be counted rather than read. The check against each line is the component's own and the one thing the page does not supply — the same six strings with a bullet are a summary, with a check they are a promise.
|
|
8
|
+
|
|
9
|
+
It sits on the page's own ground by default; `ground` paints the grey or the dark band where the section needs setting apart from the ones around it.
|
|
10
|
+
|
|
11
|
+
## Use when
|
|
12
|
+
|
|
13
|
+
- A page has to list what a product or a plan includes, and the list is the argument
|
|
14
|
+
- Several benefits are each one line long and are read by scanning rather than reading
|
|
15
|
+
- A claim needs something beside it, and a picture is the only thing there is to put there
|
|
16
|
+
|
|
17
|
+
## Do not use
|
|
18
|
+
|
|
19
|
+
- The items are two or three words and belong on one line → `Badge`
|
|
20
|
+
- Each item needs a heading and a paragraph of its own → `Card`
|
|
21
|
+
- The section opens the page → `ProductHero`
|
|
22
|
+
- A comparison. Every line here is included and marked so; a list where some items are absent needs a mark for absence, which this has no way to say
|
|
23
|
+
- Running prose broken into lines. A check against a sentence claims the sentence is a feature
|
|
24
|
+
- The page's opening or closing band. This is a section in the middle of a page and carries no navigation of its own
|
|
25
|
+
|
|
26
|
+
## Anatomy
|
|
27
|
+
|
|
28
|
+
FeatureBullets renders 10 elements. A token binding names the part it applies to.
|
|
29
|
+
|
|
30
|
+
- `root` — `<section>`, class `dds-featurebullets`. The section. It paints the ground that separates it from the page above and below, and asks its own width so the split folds on the section's measure rather than the window's.
|
|
31
|
+
|
|
32
|
+
It paints one of the page's three grounds and the ink that goes with it, in one decision — see `ground`. The ink is set here and inherited by everything inside, which is the package's rule about a section that paints a ground: stated once, it cannot be half-applied.
|
|
33
|
+
- `inner` — `<div>`, class `dds-featurebullets__inner`. The measure and the gutter, holding the section's content in the same column as every other section on the page.
|
|
34
|
+
- `split` — `<div>`, class `dds-featurebullets__split`. The two halves. A row at full width with the picture on whichever side `mediaPosition` names, and one column below the fold with the list first — because a reader on a phone came for the words, whichever side the picture takes on a desktop.
|
|
35
|
+
- `content` — `<div>`, class `dds-featurebullets__content`. The claim and the list under it.
|
|
36
|
+
|
|
37
|
+
It sets no gap of its own. The step from the claim to the list is the title's own `margin-block-end`, which is how FeatureSplit and FeatureScroll carry theirs — a column whose steps are a single gap can only ever say one thing, and the moment a second part joins it the two distances have to be told apart.
|
|
38
|
+
- `title` — `<h2>`, class `dds-featurebullets__title`. What the list is a list of. `h2` because a section in the middle of a page sits under the page's own heading, and a second `h1` would be a second page.
|
|
39
|
+
- `list` — `<ul>`, class `dds-featurebullets__list`. The inclusions, as a list rather than a stack of divs — a screen reader announces how many there are before reading one, which is the whole way this section is meant to be taken in.
|
|
40
|
+
|
|
41
|
+
Nothing separates the rows: each carries its own rule on its start edge and its own padding inside it, so a gap here would be a second distance doing the first one's job and the rules would stop landing between the lines. `space.gap.none` is that said rather than left out — a part that binds nothing reads as one somebody forgot.
|
|
42
|
+
- `item` — `<li>`, class `dds-featurebullets__item`. One inclusion. Ruled above rather than below, which is what Accordion does and for the same reason: every rule then belongs to a row and sits over it, so the lines fall between the rows and none is left under the last one.
|
|
43
|
+
|
|
44
|
+
The rows arrive one after another as the section comes up, in the order they are read, so a set a reader is meant to count appears to count itself. It is the one place in this package where a longer cascade is right: everywhere else a block arrives as one thing, and here the arriving is the list's own argument being made.
|
|
45
|
+
|
|
46
|
+
The rule is drawn in `color.border.subtle`, which is black at five per cent — an alpha, so it tints whatever it lands on, and on a dark band it tints black with black and draws nothing. `color.border.subtle-inverse` is the counterpart and is what the dark ground takes.
|
|
47
|
+
- `mark` — `<span>`, class `dds-featurebullets__mark`. The check against each line, and the one thing here the page does not supply. It is what makes this a list of inclusions rather than a list: the same words with a bullet are a summary.
|
|
48
|
+
|
|
49
|
+
Its colour follows the ground, and not for contrast — the mark is decoration and the title says what it says. `color.fg.brand-accent` is the brand red at full saturation and its own description limits it to the bare page, never a tint: on `color.bg.subtle` the role for a brand mark is `color.fg.brand`, and on the dark band it is the band's own ink. A mark that kept one value across three grounds would be right on one of them.
|
|
50
|
+
- `text` — `<span>`, class `dds-featurebullets__text`. The line itself.
|
|
51
|
+
- `media` — `<div>`, class `dds-featurebullets__media`. The picture, and one of the section's two halves rather than an addition to it. Held to a square and cropped to fill it, so a section is the same shape whatever the page passes — three of these down a page with three different crops is three sections that do not line up.
|
|
52
|
+
|
|
53
|
+
Apply these classes from the generated `featureBulletsParts` constant rather than writing the strings by hand.
|
|
54
|
+
|
|
55
|
+
## Composition
|
|
56
|
+
|
|
57
|
+
- Takes no children. Everything it renders comes from props
|
|
58
|
+
- Never contains: `FeatureBullets`, `LandingHero`, `ProductHero`, `PageHeader`, `Footer`, `Navbar`, `Table`, `Accordion` — in children or in any prop that takes a node
|
|
59
|
+
|
|
60
|
+
## Props
|
|
61
|
+
|
|
62
|
+
### ground — `page` | `subtle` | `strong` (default `page`)
|
|
63
|
+
|
|
64
|
+
- `page` — The default, and the page's own white. A section that has nothing to separate itself from what is above it — most of them — and the ground a reader is already on
|
|
65
|
+
- `subtle` — A quiet step off the page, for a band that wants to read as its own section without changing the page's voice. The one to reach for first when two sections need telling apart. Painted as the band's tint laid over the page's own ground, so it is the same grey whatever is behind the section — in dark mode the tint alone took on whatever it was set against, and on a light surface it was light ink on white.
|
|
66
|
+
- `strong` — `color.bg.brand-strong`, the dark band. It stops the page rather than dividing it, so it is for a section a reader should arrive at — and one per page is usually one more than enough
|
|
67
|
+
|
|
68
|
+
Use when: Which of the page's three grounds this section paints. A marketing page is white, and a band that wants to be seen as a band takes one of the other two — so this is how a page builds its rhythm: white, white, grey, white, dark. Two in a row is a deliberate pair rather than an accident, and the section above knows nothing about the one below it, so the page is the only thing that can decide.
|
|
69
|
+
|
|
70
|
+
The ink follows the ground and is not a second decision: a dark band carries white type because this sets both halves in one value, which is what the painted-ground-carries-its-ink rule exists to stop a page getting wrong.
|
|
71
|
+
Never for: Marking importance. Every section on a page painted dark is a page with no emphasis left, and a reader stops reading the grounds as meaning anything. Alternating for its own sake is the same mistake more slowly.
|
|
72
|
+
|
|
73
|
+
And never the brand's own coral, `color.bg.brand`, which is not offered here. That ground belongs to the band that asks a reader to do something — the one place on a page where the brand colour is the point rather than decoration — and a feature section wearing it is a page with two calls to action, one of which does nothing. It is `color.bg.brand-strong` that this offers: the dark brand ground, which is a band breaking a page rather than a band asking for something.
|
|
74
|
+
|
|
75
|
+
### mediaPosition — `end` | `start` (default `end`)
|
|
76
|
+
|
|
77
|
+
- `end` — The default. The list is read first, which is the order the section argues in
|
|
78
|
+
- `start` — The second of two on a page, so the two do not read as one column with a picture stuck to one side
|
|
79
|
+
|
|
80
|
+
Use when: Which side the picture takes at full width. Alternating it down a page is what stops three of these in a row reading as one long column, and it is the page's decision rather than this section's — which is why it is a prop and not a rule.
|
|
81
|
+
|
|
82
|
+
It is the arrangement at full width and never a promise about a phone: below the fold the list is always first, because a reader on a phone came for the words.
|
|
83
|
+
Never for: Moving the picture on a phone. There is one column there and the list leads it
|
|
84
|
+
|
|
85
|
+
### title — `string` **Required.**
|
|
86
|
+
|
|
87
|
+
Use when: Always. What the list is a list of, in the fewest words that say it
|
|
88
|
+
Never for: A sentence. The list underneath is the argument; this only has to name it
|
|
89
|
+
|
|
90
|
+
### bullets — `data` `string[]` **Required.**
|
|
91
|
+
|
|
92
|
+
Use when: Always. One line per thing included, each short enough to take in at a glance. Strings rather than nodes, because every line is marked the same way and a line free to bring its own mark is a list that stops being one
|
|
93
|
+
Never for: A sentence per line, or a line that is not included in what the title names. The mark against each one is a claim the page is making
|
|
94
|
+
|
|
95
|
+
### media — `node` **Required.**
|
|
96
|
+
|
|
97
|
+
Accepts: *
|
|
98
|
+
Use when: Always. The picture that sits beside the list — a screenshot, a photograph, an illustration. The section is a split and the picture is one half of it: without one the list runs to a measure it was never sized for, and what is left is a heading over a column with a gap beside it.
|
|
99
|
+
Never for: Anything a reader has to read or press. It is held to a square and cropped to fill it, so words in it are cropped too
|
|
100
|
+
|
|
101
|
+
## Accessibility
|
|
102
|
+
|
|
103
|
+
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.
|
|
104
|
+
|
|
105
|
+
- Announced as: `region`
|
|
106
|
+
- `Tab` — Moves past the section. Nothing in it is operable — the list is read, not used — so there is nothing here to land on.
|
|
107
|
+
- 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
|
|
108
|
+
- The inclusions are a list element, so a screen reader announces how many there are before reading the first. A stack of divs reads as prose and loses the count, which is the one thing a reader scanning this section is taking from it
|
|
109
|
+
- The mark against each line is decoration and is hidden from assistive technology. What it says — that the line is included — is what the section's own title says once, and announcing it per line is six repetitions of one fact
|
|
110
|
+
- The picture is decoration and is hidden from assistive technology. What the section says is the title and the inclusions; a picture carrying something they do not is a section that reads as half empty to anyone who cannot see it
|
|
111
|
+
|
|
112
|
+
## Rules
|
|
113
|
+
|
|
114
|
+
- **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.
|
|
115
|
+
|
|
116
|
+
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.
|
|
117
|
+
|
|
118
|
+
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.
|
|
119
|
+
|
|
120
|
+
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.
|
|
121
|
+
|
|
122
|
+
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.
|
|
123
|
+
|
|
124
|
+
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.
|
|
125
|
+
Guidance only — cannot be checked automatically.
|
|
126
|
+
- **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.
|
|
127
|
+
Guidance only — cannot be checked automatically.
|
|
128
|
+
- **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.
|
|
129
|
+
|
|
130
|
+
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.
|
|
131
|
+
|
|
132
|
+
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.
|
|
133
|
+
Guidance only — cannot be checked automatically.
|
|
134
|
+
- **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.
|
|
135
|
+
|
|
136
|
+
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.
|
|
137
|
+
|
|
138
|
+
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.
|
|
139
|
+
|
|
140
|
+
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.
|
|
141
|
+
|
|
142
|
+
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.
|
|
143
|
+
|
|
144
|
+
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.
|
|
145
|
+
|
|
146
|
+
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.
|
|
147
|
+
|
|
148
|
+
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.
|
|
149
|
+
|
|
150
|
+
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.
|
|
151
|
+
Guidance only — cannot be checked automatically.
|
|
152
|
+
- **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.
|
|
153
|
+
|
|
154
|
+
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.
|
|
155
|
+
|
|
156
|
+
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.
|
|
157
|
+
|
|
158
|
+
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.
|
|
159
|
+
|
|
160
|
+
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.
|
|
161
|
+
|
|
162
|
+
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.
|
|
163
|
+
|
|
164
|
+
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.
|
|
165
|
+
|
|
166
|
+
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.
|
|
167
|
+
|
|
168
|
+
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.
|
|
169
|
+
Guidance only — cannot be checked automatically.
|
|
170
|
+
- **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.
|
|
171
|
+
|
|
172
|
+
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.
|
|
173
|
+
|
|
174
|
+
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.
|
|
175
|
+
|
|
176
|
+
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.
|
|
177
|
+
Guidance only — cannot be checked automatically.
|
|
178
|
+
- **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.
|
|
179
|
+
|
|
180
|
+
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.
|
|
181
|
+
|
|
182
|
+
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.
|
|
183
|
+
|
|
184
|
+
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.
|
|
185
|
+
Guidance only — cannot be checked automatically.
|
|
186
|
+
|
|
187
|
+
## Anti-examples
|
|
188
|
+
|
|
189
|
+
❌ FeatureBullets for: The items are two or three words and belong on one line
|
|
190
|
+
A row of marks reads faster than a column of them, and six words do not need six rows
|
|
191
|
+
→ use `Badge` instead.
|
|
192
|
+
|
|
193
|
+
❌ FeatureBullets for: Each item needs a heading and a paragraph of its own
|
|
194
|
+
A list whose items are each a paragraph is a set of cards, and a reader scanning it has stopped scanning
|
|
195
|
+
→ use `Card` instead.
|
|
196
|
+
|
|
197
|
+
❌ FeatureBullets for: The section opens the page
|
|
198
|
+
A page's opening band is a claim, not an inventory
|
|
199
|
+
→ use `ProductHero` instead.
|
|
200
|
+
|
|
201
|
+
## Example
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
import { FeatureBullets, AspectRatio } from '@deriv-com/dds-marketing'
|
|
205
|
+
|
|
206
|
+
<FeatureBullets title="Everything a forex account includes" bullets={["Zero commission on every trade","Spreads from 0.0 pips","Over 50 currency pairs","Execution in under 100 milliseconds","24/7 customer support"]} media={<AspectRatio ratio="square" />} />
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## In use
|
|
210
|
+
|
|
211
|
+
### The ground it sits on
|
|
212
|
+
|
|
213
|
+
The three grounds a page can put a section on. The page is white, so a band painting one of the other two is saying it is its own section — and the ink follows the ground.
|
|
214
|
+
|
|
215
|
+
```tsx
|
|
216
|
+
import { AspectRatio, FeatureBullets } from '@deriv-com/dds-marketing'
|
|
217
|
+
|
|
218
|
+
// On the page itself
|
|
219
|
+
<FeatureBullets ground="page" title="Everything a forex account includes" bullets={["Zero commission on every trade","Spreads from 0.0 pips","Over 50 currency pairs","Execution in under 100 milliseconds","24/7 customer support"]} media={<AspectRatio ratio="square" />} />
|
|
220
|
+
|
|
221
|
+
// On the quiet ground
|
|
222
|
+
<FeatureBullets ground="subtle" title="Everything a forex account includes" bullets={["Zero commission on every trade","Spreads from 0.0 pips","Over 50 currency pairs","Execution in under 100 milliseconds","24/7 customer support"]} media={<AspectRatio ratio="square" />} />
|
|
223
|
+
|
|
224
|
+
// On the dark band
|
|
225
|
+
<FeatureBullets ground="strong" title="Everything a forex account includes" bullets={["Zero commission on every trade","Spreads from 0.0 pips","Over 50 currency pairs","Execution in under 100 milliseconds","24/7 customer support"]} media={<AspectRatio ratio="square" />} />
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Which side the picture takes
|
|
229
|
+
|
|
230
|
+
Alternating it down a page is what stops three of these in a row reading as one long column. Below the fold there is one column and the list leads it either way.
|
|
231
|
+
|
|
232
|
+
```tsx
|
|
233
|
+
import { AspectRatio, FeatureBullets } from '@deriv-com/dds-marketing'
|
|
234
|
+
|
|
235
|
+
// Picture last — the default
|
|
236
|
+
<FeatureBullets mediaPosition="end" title="Everything a forex account includes" bullets={["Zero commission on every trade","Spreads from 0.0 pips","Over 50 currency pairs","Execution in under 100 milliseconds","24/7 customer support"]} media={<AspectRatio ratio="square" />} />
|
|
237
|
+
|
|
238
|
+
// Picture first — for the second of two
|
|
239
|
+
<FeatureBullets mediaPosition="start" title="And everything a demo account includes" bullets={["Zero commission on every trade","Spreads from 0.0 pips","Over 50 currency pairs"]} media={<AspectRatio ratio="square" />} />
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### How long the list runs
|
|
243
|
+
|
|
244
|
+
Each line is one thing, short enough to take in at a glance. The rules fall between the rows, so the set is bounded by the section's own step rather than by a line above the first or under the last.
|
|
245
|
+
|
|
246
|
+
```tsx
|
|
247
|
+
import { AspectRatio, FeatureBullets } from '@deriv-com/dds-marketing'
|
|
248
|
+
|
|
249
|
+
// Three
|
|
250
|
+
<FeatureBullets title="What you get" bullets={["Zero commission on every trade","Spreads from 0.0 pips","Over 50 currency pairs"]} media={<AspectRatio ratio="square" />} />
|
|
251
|
+
|
|
252
|
+
// Five
|
|
253
|
+
<FeatureBullets title="What you get" bullets={["Zero commission on every trade","Spreads from 0.0 pips","Over 50 currency pairs","Execution in under 100 milliseconds","24/7 customer support"]} media={<AspectRatio ratio="square" />} />
|
|
254
|
+
```
|