@deriv-com/dds-marketing 1.1.2 → 1.1.3
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 +4 -0
- package/.llm/components/accordionitem.md +4 -0
- package/.llm/components/aspectratio.md +4 -0
- package/.llm/components/awards.md +4 -0
- package/.llm/components/background.md +4 -0
- package/.llm/components/badge.md +7 -3
- package/.llm/components/bottomsheet.md +7 -3
- package/.llm/components/breadcrumb.md +4 -0
- package/.llm/components/breadcrumbitem.md +4 -0
- package/.llm/components/button.md +4 -0
- package/.llm/components/buttonicon.md +10 -6
- package/.llm/components/card.md +5 -1
- package/.llm/components/cardbody.md +5 -1
- package/.llm/components/cardbutton.md +4 -0
- package/.llm/components/checkbox.md +1 -1
- package/.llm/components/comparisoncards.md +4 -0
- package/.llm/components/comparisontable.md +4 -0
- package/.llm/components/ctabanner.md +4 -0
- package/.llm/components/ctabannerslider.md +4 -0
- package/.llm/components/datatable.md +4 -0
- package/.llm/components/divider.md +4 -0
- package/.llm/components/downloadbanner.md +4 -0
- package/.llm/components/dropdownmenu.md +9 -5
- package/.llm/components/estimator.md +336 -0
- package/.llm/components/faqaccordion.md +4 -0
- package/.llm/components/featurebullets.md +4 -0
- package/.llm/components/featurecards.md +5 -1
- package/.llm/components/featurecardscarousel.md +4 -0
- package/.llm/components/featurescroll.md +4 -0
- package/.llm/components/featuresplit.md +4 -0
- package/.llm/components/featurestack.md +4 -0
- package/.llm/components/filterchip.md +5 -1
- package/.llm/components/footer.md +4 -0
- package/.llm/components/footergroup.md +4 -0
- package/.llm/components/grid.md +4 -0
- package/.llm/components/icon.md +9 -5
- package/.llm/components/illustrationcard.md +4 -0
- package/.llm/components/illustrationscene.md +4 -0
- package/.llm/components/imagebanner.md +5 -1
- package/.llm/components/landinghero.md +4 -0
- package/.llm/components/link.md +5 -1
- package/.llm/components/logocolumns.md +4 -0
- package/.llm/components/logorows.md +4 -0
- package/.llm/components/menuitem.md +6 -2
- package/.llm/components/navbar.md +5 -1
- package/.llm/components/navbaritem.md +4 -0
- package/.llm/components/navbarmenu.md +4 -0
- package/.llm/components/navbarmenugroup.md +4 -0
- package/.llm/components/navbarpanel.md +4 -0
- package/.llm/components/navbarswitcher.md +10 -6
- package/.llm/components/navbarswitcheroption.md +4 -0
- package/.llm/components/option.md +5 -1
- package/.llm/components/pageheader.md +4 -0
- package/.llm/components/pagination.md +4 -0
- package/.llm/components/paginationdots.md +4 -0
- package/.llm/components/producthero.md +4 -0
- package/.llm/components/removablechip.md +5 -1
- package/.llm/components/resourcebanner.md +4 -0
- package/.llm/components/row.md +4 -0
- package/.llm/components/scenescroll.md +4 -0
- package/.llm/components/scroller.md +4 -0
- package/.llm/components/searchinput.md +4 -0
- package/.llm/components/segmentedcontrol.md +5 -1
- package/.llm/components/segmentedcontrolitem.md +6 -2
- package/.llm/components/select.md +4 -0
- package/.llm/components/selectchip.md +4 -0
- package/.llm/components/spinner.md +4 -0
- package/.llm/components/stack.md +4 -0
- package/.llm/components/stats.md +4 -0
- package/.llm/components/statusdot.md +4 -0
- package/.llm/components/steps.md +4 -0
- package/.llm/components/stickycards.md +4 -0
- package/.llm/components/subdomainnavbar.md +5 -1
- package/.llm/components/tab.md +6 -2
- package/.llm/components/table.md +4 -0
- package/.llm/components/tablebody.md +4 -0
- package/.llm/components/tablecell.md +4 -0
- package/.llm/components/tablehead.md +4 -0
- package/.llm/components/tableheadercell.md +4 -0
- package/.llm/components/tablerow.md +4 -0
- package/.llm/components/tablist.md +4 -0
- package/.llm/components/teamgrid.md +4 -0
- package/.llm/components/testimonialrow.md +4 -0
- package/.llm/components/testimonialslider.md +4 -0
- package/.llm/components/textarea.md +4 -0
- package/.llm/components/textinput.md +5 -1
- package/.llm/components/textscroll.md +4 -0
- package/.llm/components/tiers.md +4 -0
- package/.llm/components/typography.md +4 -0
- package/.llm/digest/accordion.md +1 -1
- package/.llm/digest/accordionitem.md +1 -1
- package/.llm/digest/aspectratio.md +1 -1
- package/.llm/digest/awards.md +1 -1
- package/.llm/digest/background.md +1 -1
- package/.llm/digest/badge.md +1 -1
- package/.llm/digest/bottomsheet.md +1 -1
- package/.llm/digest/breadcrumb.md +1 -1
- package/.llm/digest/breadcrumbitem.md +1 -1
- package/.llm/digest/button.md +1 -1
- package/.llm/digest/buttonicon.md +1 -1
- package/.llm/digest/card.md +1 -1
- package/.llm/digest/cardbody.md +1 -1
- package/.llm/digest/cardbutton.md +1 -1
- package/.llm/digest/checkbox.md +1 -1
- package/.llm/digest/comparisoncards.md +1 -1
- package/.llm/digest/comparisontable.md +1 -1
- package/.llm/digest/ctabanner.md +1 -1
- package/.llm/digest/ctabannerslider.md +1 -1
- package/.llm/digest/datatable.md +1 -1
- package/.llm/digest/divider.md +1 -1
- package/.llm/digest/downloadbanner.md +1 -1
- package/.llm/digest/dropdownmenu.md +1 -1
- package/.llm/digest/estimator.md +66 -0
- package/.llm/digest/faqaccordion.md +1 -1
- package/.llm/digest/featurebullets.md +1 -1
- package/.llm/digest/featurecards.md +1 -1
- package/.llm/digest/featurecardscarousel.md +1 -1
- package/.llm/digest/featurescroll.md +1 -1
- package/.llm/digest/featuresplit.md +1 -1
- package/.llm/digest/featurestack.md +1 -1
- package/.llm/digest/filterchip.md +1 -1
- package/.llm/digest/footer.md +1 -1
- package/.llm/digest/footergroup.md +1 -1
- package/.llm/digest/grid.md +1 -1
- package/.llm/digest/icon.md +1 -1
- package/.llm/digest/illustrationcard.md +1 -1
- package/.llm/digest/illustrationscene.md +1 -1
- package/.llm/digest/imagebanner.md +2 -2
- package/.llm/digest/landinghero.md +1 -1
- package/.llm/digest/link.md +1 -1
- package/.llm/digest/logocolumns.md +1 -1
- package/.llm/digest/logorows.md +1 -1
- package/.llm/digest/menuitem.md +1 -1
- package/.llm/digest/navbar.md +1 -1
- package/.llm/digest/navbaritem.md +1 -1
- package/.llm/digest/navbarmenu.md +1 -1
- package/.llm/digest/navbarmenugroup.md +1 -1
- package/.llm/digest/navbarpanel.md +1 -1
- package/.llm/digest/navbarswitcher.md +1 -1
- package/.llm/digest/navbarswitcheroption.md +1 -1
- package/.llm/digest/option.md +1 -1
- package/.llm/digest/pageheader.md +1 -1
- package/.llm/digest/pagination.md +1 -1
- package/.llm/digest/paginationdots.md +1 -1
- package/.llm/digest/producthero.md +1 -1
- package/.llm/digest/removablechip.md +1 -1
- package/.llm/digest/resourcebanner.md +1 -1
- package/.llm/digest/row.md +1 -1
- package/.llm/digest/scenescroll.md +1 -1
- package/.llm/digest/scroller.md +1 -1
- package/.llm/digest/searchinput.md +1 -1
- package/.llm/digest/segmentedcontrol.md +1 -1
- package/.llm/digest/segmentedcontrolitem.md +2 -2
- package/.llm/digest/select.md +1 -1
- package/.llm/digest/selectchip.md +1 -1
- package/.llm/digest/spinner.md +1 -1
- package/.llm/digest/stack.md +1 -1
- package/.llm/digest/stats.md +1 -1
- package/.llm/digest/statusdot.md +1 -1
- package/.llm/digest/steps.md +1 -1
- package/.llm/digest/stickycards.md +1 -1
- package/.llm/digest/subdomainnavbar.md +1 -1
- package/.llm/digest/tab.md +1 -1
- package/.llm/digest/table.md +1 -1
- package/.llm/digest/tablebody.md +1 -1
- package/.llm/digest/tablecell.md +1 -1
- package/.llm/digest/tablehead.md +1 -1
- package/.llm/digest/tableheadercell.md +1 -1
- package/.llm/digest/tablerow.md +1 -1
- package/.llm/digest/tablist.md +1 -1
- package/.llm/digest/teamgrid.md +1 -1
- package/.llm/digest/testimonialrow.md +1 -1
- package/.llm/digest/testimonialslider.md +1 -1
- package/.llm/digest/textarea.md +1 -1
- package/.llm/digest/textinput.md +1 -1
- package/.llm/digest/textscroll.md +1 -1
- package/.llm/digest/tiers.md +1 -1
- package/.llm/digest/typography.md +1 -1
- package/.llm/index.md +2 -1
- package/.llm/tokens.md +1 -0
- package/AGENTS.md +1 -0
- package/README.md +28 -3
- package/dist/components/blocks/comparison-cards/comparison-cards-impl.css +0 -12
- package/dist/components/blocks/estimator/Estimator.css +206 -0
- package/dist/components/blocks/estimator/Estimator.d.ts +27 -0
- package/dist/components/blocks/estimator/Estimator.js +61 -0
- package/dist/components/blocks/estimator/Estimator.types.d.ts +63 -0
- package/dist/components/blocks/estimator/Estimator.types.js +25 -0
- package/dist/components/blocks/estimator/estimator-impl.css +159 -0
- package/dist/components/blocks/image-banner/ImageBanner.d.ts +1 -0
- package/dist/components/blocks/image-banner/ImageBanner.js +2 -1
- package/dist/components/blocks/image-banner/ImageBanner.types.d.ts +1 -1
- package/dist/components/blocks/image-banner/image-banner-impl.css +7 -51
- package/dist/components/core/segmented-control-item/SegmentedControlItem.types.d.ts +1 -1
- package/dist/components/core/select/Select.css +2 -0
- package/dist/components/core/select/select-impl.css +58 -0
- package/dist/components/core/text-area/TextArea.css +2 -0
- package/dist/components/core/text-area/text-area-impl.css +54 -0
- package/dist/components/core/text-input/TextInput.css +2 -0
- package/dist/components/core/text-input/text-input-impl.css +63 -0
- package/dist/components/estimator-data.d.ts +29 -0
- package/dist/components/estimator-data.js +12 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +2 -0
- package/dist/icons/accounts.d.ts +1 -0
- package/dist/icons/accounts.js +1 -0
- package/dist/icons/app-stores.d.ts +1 -0
- package/dist/icons/app-stores.js +1 -0
- package/dist/icons/currency.d.ts +1 -0
- package/dist/icons/currency.js +1 -0
- package/dist/icons/flag.d.ts +1 -0
- package/dist/icons/flag.js +1 -0
- package/dist/icons/illustrative.d.ts +1 -0
- package/dist/icons/illustrative.js +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +4 -0
- package/dist/icons/markets.d.ts +1 -0
- package/dist/icons/markets.js +1 -0
- package/dist/icons/social.d.ts +1 -0
- package/dist/icons/social.js +1 -0
- package/dist/icons/system.d.ts +1 -0
- package/dist/icons/system.js +1 -0
- package/dist/icons/trade.d.ts +1 -0
- package/dist/icons/trade.js +1 -0
- package/dist/marketing.css +2 -0
- package/package.json +44 -2
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
<!-- GENERATED from estimator.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# Estimator
|
|
4
|
+
|
|
5
|
+
Sets the page's own fields beside the figures worked out from them: a trading calculator, a converter, an income estimate.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
9
|
+
A section that turns a reader's inputs into figures: the page's own fields on one side of a card, and the results they produce on the other — a trading calculator's margin and pip value, a converter's amount received, a partner's estimated income.
|
|
10
|
+
|
|
11
|
+
It owns the layout and none of the arithmetic. The page passes the fields it needs and the figures it has worked out, from a live feed, a formula or both, and the block sets them the same way wherever it is used: a heading, a card, an inputs panel, a results panel that announces each change, and one way onward. That is what lets one block serve tools that would otherwise each be built once, by hand, for one page.
|
|
12
|
+
|
|
13
|
+
Two layouts: `stacked`, the heading centred above the card and the inputs beside the results, for a tool with several fields and several figures; and `split`, the heading beside the card and the inputs above the results inside it, for a compact tool a page introduces with a few lines of its own.
|
|
14
|
+
|
|
15
|
+
## Use when
|
|
16
|
+
|
|
17
|
+
- A page lets a reader work something out before they act — a margin, a pip value, a swap charge, a conversion, an income estimate
|
|
18
|
+
- The figures change as the reader types or picks, and should be announced as they do
|
|
19
|
+
- The same tool appears on several pages in several forms — the margin, pip and swap calculators are one layout with different fields and figures
|
|
20
|
+
|
|
21
|
+
## Do not use
|
|
22
|
+
|
|
23
|
+
- The figures are fixed facts rather than the result of anything the reader enters → `Stats`
|
|
24
|
+
- Options are compared side by side rather than worked out from an input → `ComparisonCards`
|
|
25
|
+
- The tool is a form that sends something — a sign-up, a contact request → `FeatureSplit`
|
|
26
|
+
- Fetching or calculating anything. The block has no data source and no formula: a page that wants live prices or a margin computes them and passes the figures in, so the block stays the same on every page and in every test
|
|
27
|
+
- A form that submits. Nothing here is sent anywhere; the way onward is a link or a button to the page that does the real thing
|
|
28
|
+
- A table of many figures. Past six or so results the panel stops being an answer and becomes a listing, which is what DataTable is for
|
|
29
|
+
|
|
30
|
+
## Anatomy
|
|
31
|
+
|
|
32
|
+
Estimator renders 19 elements. A token binding names the part it applies to.
|
|
33
|
+
|
|
34
|
+
- `root` — `<section>`, class `dds-estimator`. The section. It paints one of the page's three grounds and the ink that goes with it — see `ground` — and asks its own width, so the layout folds on the section's measure rather than the window's.
|
|
35
|
+
- `inner` — `<div>`, class `dds-estimator__inner`. The measure and the gutter, holding the heading and the tool in the same column as every other section on the page. A column on a phone and under `stacked`; a row of two equal halves at full width under `split`.
|
|
36
|
+
- `header` — `<div>`, class `dds-estimator__header`. The title and the line under it. Centred over the card under `stacked`, and at the start beside it under `split` — the package's rule for a section's heading over stacked content and beside content in columns.
|
|
37
|
+
- `title` — `<h2>`, class `dds-estimator__title`. What the tool works out. `h2`, because a section in the middle of a page sits under the page's own heading.
|
|
38
|
+
- `description` — `<p>`, class `dds-estimator__description`. The line under the title, held to a readable measure. Rendered only when `description` is set.
|
|
39
|
+
- `tool` — `<div>`, class `dds-estimator__tool`. The card the tool sits in — a Card at its `surface` variant, so the tool is the same object as every other card on the page, turned to the raised fill on the grey band and the inverse one on the dark band, as ComparisonCards' cards are.
|
|
40
|
+
- `panels` — `<div>`, class `dds-estimator__panels`. The two panels inside the card, held off its edges by the card inset. A column on a phone and under `split`; the inputs beside the results from the fold under `stacked`.
|
|
41
|
+
- `inputs` — `<form>`, class `dds-estimator__inputs`. The page's own fields, in the order they are filled, a step apart — held in a form, so Enter in a field asks for the figures through `onCalculate`, which is what a reader expects of a calculator. Its submit is caught, so the form never leaves the page.
|
|
42
|
+
- `inputs-label` — `<h3>`, class `dds-estimator__inputs-label`. The inputs panel's heading, an `h3` under the section's `h2`. Rendered only when `inputsLabel` is set.
|
|
43
|
+
- `results` — `<div>`, class `dds-estimator__results`. The answer: a white panel inside the grey card — the reference calculator's — so the change of fill is the line between the question and what it comes to, with no rule drawn. The figures, and the way onward under them. A polite live region, rendered from the first paint so a screen reader is already listening when the figures change: a reader is told the new values without being interrupted mid-word.
|
|
44
|
+
- `results-label` — `<h3>`, class `dds-estimator__results-label`. The results panel's heading, an `h3` under the section's `h2`. Rendered only when `resultsLabel` is set.
|
|
45
|
+
- `list` — `<dl>`, class `dds-estimator__list`. The figures as a description list, so each value is announced with the label it answers. One column on a phone; two from the fold, so a set of four reads as a block of figures rather than a long column.
|
|
46
|
+
- `result` — `<div>`, class `dds-estimator__result`. One figure: its label, its value and, where it has one, its note — ruled off from the next.
|
|
47
|
+
- `result-label` — `<dt>`, class `dds-estimator__result-label`. What the figure is, in the muted ink at the small body step.
|
|
48
|
+
- `result-value` — `<dd>`, class `dds-estimator__result-value`. The figure, at the h4 step — the largest thing in the card, because it is the answer the reader came for — isolated so a sign or a currency keeps its place in a right-to-left line.
|
|
49
|
+
- `result-note` — `<dd>`, class `dds-estimator__result-note`. The line that qualifies a figure, where it has one, in the muted ink at the small body step.
|
|
50
|
+
- `empty` — `<p>`, class `dds-estimator__empty`. What the panel says before there are figures: shown in place of the list while `results` is empty. Rendered only when `emptyMessage` is set.
|
|
51
|
+
- `action` — `<div>`, class `dds-estimator__action`. The way onward under the figures. It fills the panel's width on a phone, as every section's actions do. Rendered only when `action` is set.
|
|
52
|
+
- `input-actions` — `<div>`, class `dds-estimator__input-actions`. The row of the page's Calculate and Reset under the fields, sharing its width. On a phone the buttons stack and each fills the width, as every section's actions do. Rendered only when `inputActions` is set.
|
|
53
|
+
|
|
54
|
+
Apply these classes from the generated `estimatorParts` constant rather than writing the strings by hand.
|
|
55
|
+
|
|
56
|
+
## Composition
|
|
57
|
+
|
|
58
|
+
- Takes no children. Everything it renders comes from props
|
|
59
|
+
- Never contains: `FeatureSplit`, `FeatureBullets`, `LandingHero`, `ProductHero`, `PageHeader`, `Footer`, `Navbar`, `Table`, `Accordion` — in children or in any prop that takes a node
|
|
60
|
+
|
|
61
|
+
## Props
|
|
62
|
+
|
|
63
|
+
### ground — `page` | `subtle` | `strong` (default `page`)
|
|
64
|
+
|
|
65
|
+
- `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
|
|
66
|
+
- `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.
|
|
67
|
+
- `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
|
|
68
|
+
|
|
69
|
+
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.
|
|
70
|
+
|
|
71
|
+
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.
|
|
72
|
+
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.
|
|
73
|
+
|
|
74
|
+
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.
|
|
75
|
+
|
|
76
|
+
### layout — `stacked` | `split` (default `stacked`)
|
|
77
|
+
|
|
78
|
+
- `stacked` — The default. The heading centred above a wide card, the inputs beside the results — a calculator with several fields and several figures, where the two panels each need room
|
|
79
|
+
- `split` — The heading and a few lines beside the card, the inputs above the results inside it — a compact tool a page introduces in its own words, a converter or a single estimate
|
|
80
|
+
|
|
81
|
+
Use when: How the heading and the tool share the section at full width. On a phone both are one column whichever is chosen: the heading, then the card, the inputs above the results.
|
|
82
|
+
Never for: Varying between two tools on one page. Pick the layout the tool's size calls for, and the page reads as one system
|
|
83
|
+
|
|
84
|
+
### title — `string` **Required.**
|
|
85
|
+
|
|
86
|
+
Use when: Always. What the tool works out, in a few words — 'Trading calculator', 'Buy crypto in seconds', 'Estimate your earnings'.
|
|
87
|
+
Never for: Instructions. How to use the tool is the fields' own labels, not the heading
|
|
88
|
+
|
|
89
|
+
### description — `string`
|
|
90
|
+
|
|
91
|
+
Use when: A line or two under the title saying what the figures are for or where they come from — 'Live prices, updated every few seconds'.
|
|
92
|
+
Never for: A disclaimer the results depend on. That is a result's `note`, read beside the figure it qualifies
|
|
93
|
+
|
|
94
|
+
### inputsLabel — `string`
|
|
95
|
+
|
|
96
|
+
Use when: A heading over the inputs panel, where the two panels need naming — 'Calculator' over the fields and 'Results' over the figures. Leave both out for a tool whose fields name themselves.
|
|
97
|
+
Never for: One panel only. Name both or neither
|
|
98
|
+
|
|
99
|
+
### inputs — `node` **Required.**
|
|
100
|
+
|
|
101
|
+
Accepts: *
|
|
102
|
+
Use when: Always. The fields the reader fills in — Select, TextInput, SearchInput, SegmentedControl, a slider — in the order they are filled. The page owns their values and works the results out from them.
|
|
103
|
+
Never for: A submit button. The results update as the fields change; the way onward is `action`
|
|
104
|
+
|
|
105
|
+
### inputActions — `node`
|
|
106
|
+
|
|
107
|
+
Accepts: Button
|
|
108
|
+
Use when: A tool that works its figures out when asked rather than as the reader types — a calculation too slow or too costly to run on every keystroke, or one where half-filled fields would show figures that mislead. 'Calculate', whose press calls the page's own handler, and 'Reset' beside it to clear the fields. They share the row; on a phone they stack and each fills the width.
|
|
109
|
+
Never for: A tool whose figures already follow the fields. A button that does what typing already did is a step the reader has to find and press for nothing
|
|
110
|
+
|
|
111
|
+
### onCalculate — `callback`
|
|
112
|
+
|
|
113
|
+
Use when: Whenever inputActions holds a Calculate button: Enter in any of the fields calls it, as the button's own press does — wire the button's onClick to the same function. The page works the figures out and passes them as `results`; the results panel announces them.
|
|
114
|
+
Never for: Sending anything. The form never leaves the page; a tool that submits to a server is a form section, not this
|
|
115
|
+
|
|
116
|
+
### resultsLabel — `string`
|
|
117
|
+
|
|
118
|
+
Use when: A heading over the results panel, with inputsLabel — 'Results', 'You receive'.
|
|
119
|
+
Never for: One panel only. Name both or neither
|
|
120
|
+
|
|
121
|
+
### results — `data` `EstimatorResult[]` **Required.**
|
|
122
|
+
|
|
123
|
+
Use when: The figures the inputs produce, in reading order — a `label`, a `value` written exactly as it is to be read, and an optional `note`. Pass an empty list until the inputs are complete, and the panel shows `emptyMessage` instead. Each change is announced politely, so a reader using a screen reader hears the new figures without being interrupted.
|
|
124
|
+
Never for: A value the page has not worked out. Pass nothing rather than a placeholder figure: a wrong number on a trading page is worse than none
|
|
125
|
+
|
|
126
|
+
### emptyMessage — `string`
|
|
127
|
+
|
|
128
|
+
Use when: What the results panel says before there are figures to show — 'Choose an instrument to see the results'. Translate it with the page.
|
|
129
|
+
Never for: An error. A failed feed is the page's to say, in a result's note or its own message
|
|
130
|
+
|
|
131
|
+
### action — `node`
|
|
132
|
+
|
|
133
|
+
Accepts: Button, Link
|
|
134
|
+
Use when: The one thing a reader does once they have their figures — 'Open an account', 'Trade now', 'Become a partner'. Under the results, where the reader's eye already is.
|
|
135
|
+
Never for: More than one action. One tool, one next step
|
|
136
|
+
|
|
137
|
+
## Accessibility
|
|
138
|
+
|
|
139
|
+
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.
|
|
140
|
+
|
|
141
|
+
- Announced as: `region`
|
|
142
|
+
- `Tab` — Moves through the page's own fields in the inputs panel, then any Calculate and Reset, then to the way onward. The figures hold nothing to press.
|
|
143
|
+
- `Enter` — In a plain field, calls onCalculate — the same as pressing Calculate. Enter in a picker's search or a text area keeps its own meaning. Without onCalculate it does nothing, and never leaves the page.
|
|
144
|
+
- accessible name from title, so the section is a named region a screen reader can jump to and skip
|
|
145
|
+
- The results panel is a polite live region from the first paint, so each new set of figures is announced once, after the reader stops typing, without interrupting them
|
|
146
|
+
- Each figure is a description list entry, so its value is announced with the label it answers, and its note with it
|
|
147
|
+
|
|
148
|
+
## Rules
|
|
149
|
+
|
|
150
|
+
- **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.
|
|
151
|
+
|
|
152
|
+
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.
|
|
153
|
+
|
|
154
|
+
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.
|
|
155
|
+
|
|
156
|
+
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.
|
|
157
|
+
|
|
158
|
+
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.
|
|
159
|
+
|
|
160
|
+
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.
|
|
161
|
+
Guidance only — cannot be checked automatically.
|
|
162
|
+
- **Never nest one interactive element inside another** — Nested interactive elements produce ambiguous hit targets and an unreachable inner control for keyboard and screen-reader users. This is why the rule cannot live on any single component — it constrains Button, Link, CardButton and TextInput simultaneously.
|
|
163
|
+
Guidance only — cannot be checked automatically.
|
|
164
|
+
- **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.
|
|
165
|
+
|
|
166
|
+
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.
|
|
167
|
+
|
|
168
|
+
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.
|
|
169
|
+
Guidance only — cannot be checked automatically.
|
|
170
|
+
- **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.
|
|
171
|
+
|
|
172
|
+
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.
|
|
173
|
+
|
|
174
|
+
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.
|
|
175
|
+
|
|
176
|
+
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.
|
|
177
|
+
|
|
178
|
+
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.
|
|
179
|
+
|
|
180
|
+
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.
|
|
181
|
+
|
|
182
|
+
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.
|
|
183
|
+
|
|
184
|
+
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.
|
|
185
|
+
|
|
186
|
+
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.
|
|
187
|
+
Guidance only — cannot be checked automatically.
|
|
188
|
+
- **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.
|
|
189
|
+
|
|
190
|
+
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.
|
|
191
|
+
|
|
192
|
+
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.
|
|
193
|
+
|
|
194
|
+
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.
|
|
195
|
+
|
|
196
|
+
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.
|
|
197
|
+
|
|
198
|
+
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.
|
|
199
|
+
|
|
200
|
+
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.
|
|
201
|
+
|
|
202
|
+
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.
|
|
203
|
+
|
|
204
|
+
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.
|
|
205
|
+
Guidance only — cannot be checked automatically.
|
|
206
|
+
- **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.
|
|
207
|
+
|
|
208
|
+
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.
|
|
209
|
+
|
|
210
|
+
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.
|
|
211
|
+
|
|
212
|
+
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.
|
|
213
|
+
Guidance only — cannot be checked automatically.
|
|
214
|
+
- **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.
|
|
215
|
+
|
|
216
|
+
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.
|
|
217
|
+
|
|
218
|
+
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.
|
|
219
|
+
|
|
220
|
+
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.
|
|
221
|
+
Guidance only — cannot be checked automatically.
|
|
222
|
+
|
|
223
|
+
## Anti-examples
|
|
224
|
+
|
|
225
|
+
❌ Estimator for: The figures are fixed facts rather than the result of anything the reader enters
|
|
226
|
+
Headline numbers a page states, with no inputs to produce them
|
|
227
|
+
→ use `Stats` instead.
|
|
228
|
+
|
|
229
|
+
❌ Estimator for: Options are compared side by side rather than worked out from an input
|
|
230
|
+
A card per option with its own rows, which a reader compares across rather than computes
|
|
231
|
+
→ use `ComparisonCards` instead.
|
|
232
|
+
|
|
233
|
+
❌ Estimator for: The tool is a form that sends something — a sign-up, a contact request
|
|
234
|
+
A form submits; this block shows what inputs produce, and sends nothing
|
|
235
|
+
→ use `FeatureSplit` instead.
|
|
236
|
+
|
|
237
|
+
## Example
|
|
238
|
+
|
|
239
|
+
```tsx
|
|
240
|
+
import { Estimator, Button, Stack } from '@deriv-com/dds-marketing'
|
|
241
|
+
|
|
242
|
+
<Estimator title="Trading calculator" description="Work out the margin, pip value and swap on a trade before you place it." inputsLabel="Calculator" resultsLabel="Results" inputs={<Stack gap="md" align="stretch" />} inputActions={<><Button variant="primary">Calculate</Button><Button variant="secondary">Reset</Button></>} results={[{"label":"Margin required","value":"216.84 USD","note":"At 1:500 leverage"},{"label":"Pip value","value":"10.00 USD"},{"label":"Swap long","value":"-7.42 USD","note":"Per lot, per night"},{"label":"Swap short","value":"1.96 USD","note":"Per lot, per night"}]} />
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## In use
|
|
246
|
+
|
|
247
|
+
### A trading calculator
|
|
248
|
+
|
|
249
|
+
Several fields beside several figures: the heading centred above a wide card, the inputs beside the results.
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
import { Button, Estimator, Option, Select, Stack, TextInput } from '@deriv-com/dds-marketing'
|
|
253
|
+
|
|
254
|
+
// Margin, pip value and swap
|
|
255
|
+
<Estimator title="Trading calculator" description="Work out the margin, pip value and swap on a trade before you place it." inputsLabel="Calculator" resultsLabel="Results" inputs={<Stack gap="md" align="stretch" />} results={[{"label":"Margin required","value":"216.84 USD","note":"At 1:500 leverage"},{"label":"Pip value","value":"10.00 USD"},{"label":"Swap long","value":"-7.42 USD","note":"Per lot, per night"},{"label":"Swap short","value":"1.96 USD","note":"Per lot, per night"}]} action={<Button variant="primary">Open an account</Button>} />
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Calculate on demand
|
|
259
|
+
|
|
260
|
+
For figures worked out when asked: Calculate submits the fields — as Enter in any of them does — and Reset clears them. With no way onward under the results, Calculate is the card's one primary.
|
|
261
|
+
|
|
262
|
+
```tsx
|
|
263
|
+
import { Button, Estimator, Option, Select, Stack, TextInput } from '@deriv-com/dds-marketing'
|
|
264
|
+
|
|
265
|
+
// Calculate and Reset
|
|
266
|
+
<Estimator title="Trading calculator" description="Work out the margin, pip value and swap on a trade before you place it." inputsLabel="Calculator" resultsLabel="Results" inputs={<Stack gap="md" align="stretch" />} results={[{"label":"Margin required","value":"216.84 USD","note":"At 1:500 leverage"},{"label":"Pip value","value":"10.00 USD"},{"label":"Swap long","value":"-7.42 USD","note":"Per lot, per night"},{"label":"Swap short","value":"1.96 USD","note":"Per lot, per night"}]} inputActions={<><Button variant="primary">Calculate</Button><Button variant="secondary">Reset</Button></>} />
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Before the inputs are complete
|
|
270
|
+
|
|
271
|
+
An empty list shows the waiting message instead of figures, never a zero that reads as an answer.
|
|
272
|
+
|
|
273
|
+
```tsx
|
|
274
|
+
import { Button, Estimator, Option, Select, Stack, TextInput } from '@deriv-com/dds-marketing'
|
|
275
|
+
|
|
276
|
+
// No figures yet
|
|
277
|
+
<Estimator title="Trading calculator" description="Work out the margin, pip value and swap on a trade before you place it." inputsLabel="Calculator" resultsLabel="Results" inputs={<Stack gap="md" align="stretch" />} results={[]} action={<Button variant="primary">Open an account</Button>} emptyMessage="Choose an instrument and a volume to see the results." />
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### The ground it sits on
|
|
281
|
+
|
|
282
|
+
The card takes the raised fill on the grey band, and the dark theme — fields and all — on the dark band.
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
import { Button, Estimator, Option, Select, Stack, TextInput } from '@deriv-com/dds-marketing'
|
|
286
|
+
|
|
287
|
+
// On the quiet ground
|
|
288
|
+
<Estimator title="Trading calculator" description="Work out the margin, pip value and swap on a trade before you place it." inputsLabel="Calculator" resultsLabel="Results" inputs={<Stack gap="md" align="stretch" />} results={[{"label":"Margin required","value":"216.84 USD","note":"At 1:500 leverage"},{"label":"Pip value","value":"10.00 USD"},{"label":"Swap long","value":"-7.42 USD","note":"Per lot, per night"},{"label":"Swap short","value":"1.96 USD","note":"Per lot, per night"}]} action={<Button variant="primary">Open an account</Button>} ground="subtle" />
|
|
289
|
+
|
|
290
|
+
// On the dark band
|
|
291
|
+
<Estimator title="Trading calculator" description="Work out the margin, pip value and swap on a trade before you place it." inputsLabel="Calculator" resultsLabel="Results" inputs={<Stack gap="md" align="stretch" />} results={[{"label":"Margin required","value":"216.84 USD","note":"At 1:500 leverage"},{"label":"Pip value","value":"10.00 USD"},{"label":"Swap long","value":"-7.42 USD","note":"Per lot, per night"},{"label":"Swap short","value":"1.96 USD","note":"Per lot, per night"}]} action={<Button variant="primary">Open an account</Button>} ground="strong" />
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### A crypto converter
|
|
295
|
+
|
|
296
|
+
A compact tool beside the words that introduce it: the inputs above the figure inside the card.
|
|
297
|
+
|
|
298
|
+
```tsx
|
|
299
|
+
import { Button, Estimator, Option, Select, Stack, TextInput } from '@deriv-com/dds-marketing'
|
|
300
|
+
|
|
301
|
+
// Pay and receive
|
|
302
|
+
<Estimator layout="split" title="Buy crypto in seconds" description="Live prices from Deriv Crypto Exchange, updated as you type." inputs={<Stack gap="md" align="stretch" />} results={[{"label":"You receive","value":"0.0214 BTC","note":"At 1 BTC = 46,720.00 USDT"}]} action={<Button variant="primary">Trade on Deriv</Button>} />
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### An estimate from one field
|
|
306
|
+
|
|
307
|
+
The same layout as an affiliate's income estimate: one input, one figure, one way onward.
|
|
308
|
+
|
|
309
|
+
```tsx
|
|
310
|
+
import { Button, Estimator, Stack, TextInput } from '@deriv-com/dds-marketing'
|
|
311
|
+
|
|
312
|
+
// Monthly income
|
|
313
|
+
<Estimator layout="split" title="Estimate your earnings" description="See what you could earn each month by referring clients to Deriv." inputs={<Stack gap="md" align="stretch" />} results={[{"label":"Monthly income","value":"$2,400","note":"An estimate at $120 a client"}]} action={<Button variant="primary">Become a partner</Button>} />
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Split, before the inputs are complete
|
|
317
|
+
|
|
318
|
+
The waiting message in the compact card.
|
|
319
|
+
|
|
320
|
+
```tsx
|
|
321
|
+
import { Button, Estimator, Option, Select, Stack, TextInput } from '@deriv-com/dds-marketing'
|
|
322
|
+
|
|
323
|
+
// No figure yet
|
|
324
|
+
<Estimator layout="split" title="Buy crypto in seconds" description="Live prices from Deriv Crypto Exchange, updated as you type." inputs={<Stack gap="md" align="stretch" />} results={[]} action={<Button variant="primary">Trade on Deriv</Button>} emptyMessage="Enter an amount to see what you receive." />
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Split on the dark band
|
|
328
|
+
|
|
329
|
+
The card in the dark theme beside a heading in the band's own ink.
|
|
330
|
+
|
|
331
|
+
```tsx
|
|
332
|
+
import { Button, Estimator, Option, Select, Stack, TextInput } from '@deriv-com/dds-marketing'
|
|
333
|
+
|
|
334
|
+
// On the dark band
|
|
335
|
+
<Estimator layout="split" title="Buy crypto in seconds" description="Live prices from Deriv Crypto Exchange, updated as you type." inputs={<Stack gap="md" align="stretch" />} results={[{"label":"You receive","value":"0.0214 BTC","note":"At 1 BTC = 46,720.00 USDT"}]} action={<Button variant="primary">Trade on Deriv</Button>} ground="strong" />
|
|
336
|
+
```
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# FaqAccordion
|
|
4
4
|
|
|
5
|
+
A section of questions and answers, one open at a time.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
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
10
|
|
|
7
11
|
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.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# FeatureBullets
|
|
4
4
|
|
|
5
|
+
Pairs a claim and a list of what is included with one picture.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A section pairing a claim with a ruled list of what something includes, beside one picture.
|
|
6
10
|
|
|
7
11
|
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.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# FeatureCards
|
|
4
4
|
|
|
5
|
+
A heading over a grid of feature cards.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A section that opens with a heading and sets a grid of cards under it — the shape a marketing page uses for “why choose us” and “what you get”. Each card is the page's own Card or CardButton with a CardBody inside; this decides the heading, the column and how many cards sit on a row, and nothing about a card.
|
|
6
10
|
|
|
7
11
|
One column on a phone, two from the fold, and three at full width — four when there are exactly four and two when there are two, so a set is one full row rather than a row and an orphan, or a row with a gap in it.
|
|
@@ -318,7 +322,7 @@ The reference's FeatureCardsIcon: every card a light Card whose CardBody leads w
|
|
|
318
322
|
|
|
319
323
|
```tsx
|
|
320
324
|
import { Card, CardBody, FeatureCards, Link } from '@deriv-com/dds-marketing'
|
|
321
|
-
import { ClockThreeRegularIcon, FileShieldRegularIcon, GlobeRegularIcon, LockRegularIcon } from '@deriv-com/
|
|
325
|
+
import { ClockThreeRegularIcon, FileShieldRegularIcon, GlobeRegularIcon, LockRegularIcon } from '@deriv-com/dds-marketing/icons'
|
|
322
326
|
|
|
323
327
|
// Three cards, a mark on each
|
|
324
328
|
<FeatureCards ground="subtle" title="Why choose Deriv" description="Trusted by traders since 1999, with the safeguards to show for it.">
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# FeatureCardsCarousel
|
|
4
4
|
|
|
5
|
+
A heading over a row of feature cards the reader scrolls through.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A feature band that sets its cards in a row a reader moves along rather than a grid: a heading and a line over a row of the page's own cards, the next one's edge showing past the last in view, with dots saying where the reader is and two arrows stepping it a card at a time. One card is the focus at a time and the rest wait at the edge, so each gets a screen's attention without the page paying a screen of scrolling for it.
|
|
6
10
|
|
|
7
11
|
The reference design's FeatureCardsCarousel. Each card is the page's own Card or CardButton with a CardBody inside, as in FeatureCards — its fill, its picture, its words and where it leads are the card's; this decides the heading, the row and the way along it, and nothing about a card.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# FeatureScroll
|
|
4
4
|
|
|
5
|
+
Gives each feature a screen of its own, with its picture pinned beside the text.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A section that gives a set of things one screen each, with the picture pinned beside the words while a reader is on them.
|
|
6
10
|
|
|
7
11
|
For a set too long to compare and too important to list — six markets, five platforms. A grid of cards asks a reader which to read first and most read none; this arrives at one at a time, at the cost of a screen of scrolling each.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# FeatureSplit
|
|
4
4
|
|
|
5
|
+
One claim, a supporting line and a link, beside a single picture.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A section putting one claim, a line explaining it and a way onward beside a single picture.
|
|
6
10
|
|
|
7
11
|
The plainest block here, and that is what it is for: somewhere to make one more point about something the page has already introduced, without opening a list or a set of cards. A split rather than a stack, because the same words over a full-width photograph read as a caption and beside one as a claim with evidence.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# FeatureStack
|
|
4
4
|
|
|
5
|
+
A heading and supporting line above a large illustration.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A section that leads with a statement and ends on a picture: a heading, a line under it where the heading needs one, a link on to more where the page has one, and a large illustration — a globe, a map, a product shot — standing on the band's foot. FeatureSplit stacked: where a split sets the words beside the picture, this sets them over it. From the fold the words are centred over the picture; on a phone they start at the edge and the picture takes the column.
|
|
6
10
|
|
|
7
11
|
The reference design's PartnersPayout layout, taken down to its frame. The figures the reference drew between the heading and the picture are the page's content and not the block's: a page that wants figures puts them in its own section, or in the copy.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# FilterChip
|
|
4
4
|
|
|
5
|
+
Turns one filter on or off, in place.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A token the reader turns on and off in place, standing for one narrowing of the set shown beside it. On a marketing site that set is an index — articles, help topics, market pages, an events list — and the chips are the topics it can be cut down to. It is a button that stays where it is and reports whether it applies, which is what separates it from a control that takes the reader somewhere. Reach for one where a handful of narrowings sit above the list they narrow and any number of them may be on at once.
|
|
6
10
|
|
|
7
11
|
## Use when
|
|
@@ -281,7 +285,7 @@ The leading glyph says what kind of narrowing this is and stays put when chosen.
|
|
|
281
285
|
|
|
282
286
|
```tsx
|
|
283
287
|
import { Badge, FilterChip } from '@deriv-com/dds-marketing'
|
|
284
|
-
import { ArrowUpRightRegularIcon, ChartCandlestickRegularIcon } from '@deriv-com/
|
|
288
|
+
import { ArrowUpRightRegularIcon, ChartCandlestickRegularIcon } from '@deriv-com/dds-marketing/icons'
|
|
285
289
|
|
|
286
290
|
// A count — the fact a reader wants before pressing
|
|
287
291
|
<FilterChip label="Education" content="badge" badge={<Badge label="24" variant="neutral" />} />
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# Footer
|
|
4
4
|
|
|
5
|
+
The band that closes every marketing page: brand, links, legal text.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
The band that closes a marketing page, and the sections every one of them is made of: whose site this is, where else it goes, what the law obliges it to say, and the line that closes it.
|
|
6
10
|
|
|
7
11
|
It holds no destinations and no wording of its own. What goes in it is what the page composes — the links, the groups they fall into, the disclaimer's paragraphs — because the foot of a marketing site is written by the site, and a component that took an array of links would be a second router to keep in step with the first. What this owns is the band: the ground it paints, the measure it holds its content to, the order its sections come in, and the space between them.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# FooterGroup
|
|
4
4
|
|
|
5
|
+
A titled list of links in the footer.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A named handful of destinations in the footer: a word over a short list. It is the footer's repeating unit and the only thing inside it that repeats — everything else in a footer appears once.
|
|
6
10
|
|
|
7
11
|
It is not a column. A footer's columns hold two or three of these stacked, and which group lands in which column is the footer's business rather than the group's: Trade, Markets and Payments share one, Platforms, Promotions and Tools share the next. A group that assumed it was a column would be a group that could not be put beside another.
|
package/.llm/components/grid.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# Grid
|
|
4
4
|
|
|
5
|
+
Lays items out in equal columns with consistent spacing.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A field of equal tracks, and one measure between them. It draws nothing — no ground, no edge, no padding — and owns one decision: how many things sit across, and how narrow a track may get before one of them drops.
|
|
6
10
|
|
|
7
11
|
It is the third answer to several things that will not fit on a line. A row squashes them, a wrapped row lets them fall where they fall, and this puts them in columns that agree — every cell the same width as the cell above it, every row starting at the same place. That agreement is the whole of what it offers and the only reason to reach for it over a wrapped Row.
|
package/.llm/components/icon.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Icon
|
|
4
4
|
|
|
5
|
-
Renders a Quill
|
|
5
|
+
Renders a Quill glyph at a token size, in the colour of the text around it.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
9
|
+
Renders a Quill system glyph at a token size, taking its colour from the text around it. The glyph is imported from @deriv-com/dds-marketing/icons and passed as the only child. Its components are named shape, then weight, then Icon — MagnifyingGlassRegularIcon, EnvelopeRegularIcon, CircleCheckSolidIcon — and the weight is chosen at the import site because Icon has no weight prop and cannot have one.
|
|
6
10
|
|
|
7
11
|
The same component Product has, on Marketing's own ramp. The last one here was a copy that nothing had asked for and it was deleted for that; what asks for this one is three components already drawing glyphs by hand — Breadcrumb's separator, AccordionItem's chevron and whatever a page puts in CardBody's mark — each repeating the same two bindings and the same reason.
|
|
8
12
|
|
|
@@ -164,8 +168,8 @@ Two things genuinely have no logical form and are not covered by this. A CSS gra
|
|
|
164
168
|
|
|
165
169
|
```tsx
|
|
166
170
|
import { Icon } from '@deriv-com/dds-marketing'
|
|
167
|
-
import { EnvelopeRegularIcon } from '@deriv-com/
|
|
168
|
-
import { EnvelopeRegularIcon } from '@deriv-com/
|
|
171
|
+
import { EnvelopeRegularIcon } from '@deriv-com/dds-marketing/icons'
|
|
172
|
+
import { EnvelopeRegularIcon } from '@deriv-com/dds-marketing/icons'
|
|
169
173
|
|
|
170
174
|
<Icon><EnvelopeRegularIcon /></Icon>
|
|
171
175
|
```
|
|
@@ -178,7 +182,7 @@ One glyph at every step, because the variable is the size. A new shape in each r
|
|
|
178
182
|
|
|
179
183
|
```tsx
|
|
180
184
|
import { Icon } from '@deriv-com/dds-marketing'
|
|
181
|
-
import { EnvelopeRegularIcon } from '@deriv-com/
|
|
185
|
+
import { EnvelopeRegularIcon } from '@deriv-com/dds-marketing/icons'
|
|
182
186
|
|
|
183
187
|
// xs — inline and supporting, against small text
|
|
184
188
|
<Icon size="xs"><EnvelopeRegularIcon /></Icon>
|
|
@@ -202,7 +206,7 @@ A glyph beside words that already say the same thing is announced twice, so it s
|
|
|
202
206
|
|
|
203
207
|
```tsx
|
|
204
208
|
import { Icon } from '@deriv-com/dds-marketing'
|
|
205
|
-
import { EnvelopeRegularIcon } from '@deriv-com/
|
|
209
|
+
import { EnvelopeRegularIcon } from '@deriv-com/dds-marketing/icons'
|
|
206
210
|
|
|
207
211
|
// Decorative — role="presentation", no name
|
|
208
212
|
<Icon><EnvelopeRegularIcon /></Icon>
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# IllustrationCard
|
|
4
4
|
|
|
5
|
+
A glass card showing product information, used as an illustration.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A pane of glass holding a piece of product information — a market's price, a balance, a status — in one of three shapes, used as a picture: laid over a photograph or a piece of art, or standing on its own as the image a section shows beside its words. It is never the section's content. What a section says is set in the section's own blocks and type; this is an illustration of the product, the way a screenshot would be one, only drawn from the system's own parts.
|
|
6
10
|
|
|
7
11
|
It owns the two things every such picture has to get right and nobody gets right twice: its shape and its surface. The shape is one of three — four by three, square, three by four — so pictures on one page and across a site agree, and none is a one-off. The surface is always dark glass over a blur of whatever is behind it, in light mode and dark alike — the product as it looks in its dark theme, which a picture of it should not change with the page — so the pane reads as part of the image it sits on rather than a box pasted onto it.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# IllustrationScene
|
|
4
4
|
|
|
5
|
+
A photograph with an IllustrationCard laid over it.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A photograph with an IllustrationCard laid over it — the product shown in the hands of the people who use it: a trade ticket over a trader on the move, a balance over someone at a desk. The scene owns how the two meet, so every such picture across a site is composed the same way: the photograph fills one of three shapes, and the glass card sits over it at a fixed share of the frame, centred or towards one edge.
|
|
6
10
|
|
|
7
11
|
The photograph is the scene and the card is what it says. The card's `label` describes the whole picture to assistive technology; the photograph is decoration unless `alt` says otherwise.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# ImageBanner
|
|
4
4
|
|
|
5
|
+
A dark card pairing a headline and one action with a photograph.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
A dark card in the middle of a page, pairing a headline and a line under it with a photograph — beside it or behind it, with one action.
|
|
6
10
|
|
|
7
11
|
The reference site's ImageBanner, and a break rather than an opening: a dark, editorial moment between lighter sections that asks for one thing. The card is dark on every ground; `ground` paints the band it sits in, the way it does for every block.
|
|
@@ -100,7 +104,7 @@ Never for: Artwork with words in it. The cover photograph sits under a scrim and
|
|
|
100
104
|
|
|
101
105
|
### parallax — `boolean` (default `true`)
|
|
102
106
|
|
|
103
|
-
Use when: The photograph drifts against the scroll as the card passes through the view,
|
|
107
|
+
Use when: The photograph drifts against the scroll as the card passes through the view, the drift every block's picture shares — drawn at motion.scale.parallax and moved from motion.translate.parallax-from to motion.translate.parallax-to over the whole pass — so it reads as further away than the card — the reference design's ParallaxBanner, which this replaces. On by default, as every block's picture drifts: pass false for a card whose photograph must hold still under its button.
|
|
104
108
|
Never for: Holding still for a reader who asked for less motion — it already holds still for them, and in a browser that cannot drive it from the scroll.
|
|
105
109
|
|
|
106
110
|
## Accessibility
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# LandingHero
|
|
4
4
|
|
|
5
|
+
Opens a main landing page with its headline over a dark background.
|
|
6
|
+
|
|
7
|
+
## Why it is built this way
|
|
8
|
+
|
|
5
9
|
The band that opens a main landing page: the one thing the page is about, said once, at the top, over a ground dark enough that nothing above it competes.
|
|
6
10
|
|
|
7
11
|
One of three opening bands, and the widest. Which one a page takes follows from where the page sits rather than from a prop — this is the landing tier, the front page and the campaign pages under it.
|