@deriv-com/dds-marketing 1.0.1 → 1.0.2
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/background.md +371 -0
- package/.llm/components/ctabanner.md +25 -0
- package/.llm/components/ctabannerslider.md +21 -0
- package/.llm/components/illustrationcard.md +236 -0
- package/.llm/components/illustrationscene.md +233 -0
- package/.llm/components/landinghero.md +24 -0
- package/.llm/components/pageheader.md +21 -0
- package/.llm/digest/background.md +52 -0
- package/.llm/digest/ctabanner.md +4 -0
- package/.llm/digest/ctabannerslider.md +3 -0
- package/.llm/digest/illustrationcard.md +46 -0
- package/.llm/digest/illustrationscene.md +51 -0
- package/.llm/digest/landinghero.md +7 -0
- package/.llm/digest/pageheader.md +3 -0
- package/.llm/index.md +7 -0
- package/.llm/tokens.md +11 -0
- package/AGENTS.md +3 -0
- package/dist/components/blocks/cta-banner/CtaBanner.d.ts +1 -1
- package/dist/components/blocks/cta-banner/CtaBanner.js +3 -2
- package/dist/components/blocks/cta-banner/CtaBanner.types.d.ts +5 -0
- package/dist/components/blocks/cta-banner/cta-banner-impl.css +8 -0
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.d.ts +1 -1
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.js +5 -4
- package/dist/components/blocks/cta-banner-slider/CtaBannerSlider.types.d.ts +4 -0
- package/dist/components/blocks/cta-banner-slider/cta-banner-slider-impl.css +8 -0
- package/dist/components/blocks/landing-hero/LandingHero.d.ts +1 -1
- package/dist/components/blocks/landing-hero/LandingHero.js +4 -3
- package/dist/components/blocks/landing-hero/LandingHero.types.d.ts +7 -3
- package/dist/components/blocks/page-header/PageHeader.d.ts +1 -1
- package/dist/components/blocks/page-header/PageHeader.js +3 -2
- package/dist/components/blocks/page-header/PageHeader.types.d.ts +4 -0
- package/dist/components/blocks/page-header/page-header-impl.css +8 -0
- package/dist/components/core/background/Background.css +69 -0
- package/dist/components/core/background/Background.d.ts +21 -0
- package/dist/components/core/background/Background.js +36 -0
- package/dist/components/core/background/Background.types.d.ts +36 -0
- package/dist/components/core/background/Background.types.js +9 -0
- package/dist/components/core/background/background-impl.css +427 -0
- package/dist/components/core/background/halftone.d.ts +123 -0
- package/dist/components/core/background/halftone.js +682 -0
- package/dist/components/core/background/use-halftone.d.ts +15 -0
- package/dist/components/core/background/use-halftone.js +27 -0
- package/dist/components/core/background/use-offscreen.d.ts +10 -0
- package/dist/components/core/background/use-offscreen.js +30 -0
- package/dist/components/core/background/use-spotlight.d.ts +13 -0
- package/dist/components/core/background/use-spotlight.js +65 -0
- package/dist/components/core/illustration-card/IllustrationCard.css +40 -0
- package/dist/components/core/illustration-card/IllustrationCard.d.ts +22 -0
- package/dist/components/core/illustration-card/IllustrationCard.js +82 -0
- package/dist/components/core/illustration-card/IllustrationCard.types.d.ts +23 -0
- package/dist/components/core/illustration-card/IllustrationCard.types.js +8 -0
- package/dist/components/core/illustration-card/illustration-card-impl.css +27 -0
- package/dist/components/core/illustration-scene/IllustrationScene.css +44 -0
- package/dist/components/core/illustration-scene/IllustrationScene.d.ts +14 -0
- package/dist/components/core/illustration-scene/IllustrationScene.js +16 -0
- package/dist/components/core/illustration-scene/IllustrationScene.types.d.ts +33 -0
- package/dist/components/core/illustration-scene/IllustrationScene.types.js +8 -0
- package/dist/components/core/illustration-scene/illustration-scene-impl.css +40 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +6 -0
- package/dist/marketing.css +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
<!-- GENERATED from illustration-card.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# IllustrationCard
|
|
4
|
+
|
|
5
|
+
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
|
+
|
|
7
|
+
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 glass over a blur of whatever is behind it — light glass in light mode, a faint frosted white in dark — so the pane reads as part of the image it sits on rather than a box pasted onto it.
|
|
8
|
+
|
|
9
|
+
Everything inside is illustrative: built from the system's real components so it looks exactly like the product, and made inert, so nothing in it can be focused, pressed or typed into, and a screen reader hears one image described by `label`. The product information inside is the page's. A photograph or a person it sits on, or beside, is the page's or a block's to place; this is the pane alone.
|
|
10
|
+
|
|
11
|
+
## Use when
|
|
12
|
+
|
|
13
|
+
- Product information laid over a photograph or a piece of art — a market's price and status over a picture of a trader, a balance over a device
|
|
14
|
+
- A standalone image of the product beside a section's words, where a screenshot would be too literal: the pane is the picture the section shows
|
|
15
|
+
- Several such pictures across a site that have to agree in shape and surface without each page deciding
|
|
16
|
+
|
|
17
|
+
## Do not use
|
|
18
|
+
|
|
19
|
+
- A section has content to present — features, benefits, steps, a list → `FeatureCards`
|
|
20
|
+
- The content is something a reader acts on — a link, a form, a set of options → `Card`
|
|
21
|
+
- There is only a photograph → `AspectRatio`
|
|
22
|
+
- A section's content. Headings, descriptions, features and lists belong in the section's own blocks and type; a pane of them reads as a picture, and a reader skims past what the page meant them to read
|
|
23
|
+
- A container for anything other than product information — a quote, a call to action, a form, navigation. It is an illustration of the product and nothing else
|
|
24
|
+
- Live readings presented as a picture. What the pane shows is illustrative — a price, a status drawn to explain — and a reader takes a number in it at face value; anything relied on belongs in the page's text
|
|
25
|
+
- Any other shape. The three ratios are the whole of the choice, so every picture on a site agrees; one that needed a fourth is a different component
|
|
26
|
+
- A real interface a reader is meant to operate. The pane makes everything in it inert — a button in it is a picture of a button — so anything a reader must press belongs outside it, in the section's own actions
|
|
27
|
+
|
|
28
|
+
## Anatomy
|
|
29
|
+
|
|
30
|
+
IllustrationCard renders 2 elements. A token binding names the part it applies to.
|
|
31
|
+
|
|
32
|
+
- `root` — `<div>`, class `dds-illustrationcard`. The pane: one of three proportions whatever is put in it — the aspect tokens — and the glass. Its fill is color.bg.surface-glass — white at most of its strength in light mode, a faint frosted white in dark — over a blur of size.backdrop-blur in illustration-card-impl.css, because a blur is a function no binding can name. It holds radius.surface and space.inset.card like a Card, a hairline edge so its outline survives on a light page, and the default ink, color.fg.default, which follows the glass from dark on light to light on frosted. It is one image to assistive technology — `role="img"`, named by `label` — so a screen reader hears what the picture shows in a sentence rather than a list of controls that are not there.
|
|
33
|
+
- `content` — `<div>`, class `dds-illustrationcard__content`. What the pane holds, made a picture. It is `inert`: whatever components draw it — a Button, a SegmentedControl, a TextInput — look exactly as they do anywhere, and none of them can be focused, tabbed to, pressed or typed into, so a reader never meets a control that does nothing. Laid out down the pane from the start edge at its own size, and scaled down as a whole where the pane is too small to hold it — the way a picture shrinks — so a pane on a phone shows the same UI smaller rather than overlapped or cut off. The shape is fixed: the UI never stretches the pane.
|
|
34
|
+
|
|
35
|
+
Apply these classes from the generated `illustrationCardParts` constant rather than writing the strings by hand.
|
|
36
|
+
|
|
37
|
+
## Composition
|
|
38
|
+
|
|
39
|
+
- Can contain: any content
|
|
40
|
+
- Never contains: `IllustrationCard`, `Background` — in children or in any prop that takes a node
|
|
41
|
+
|
|
42
|
+
## Props
|
|
43
|
+
|
|
44
|
+
### ratio — `landscape` | `square` | `upright` (default `landscape`)
|
|
45
|
+
|
|
46
|
+
- `landscape` — Four by three, and the default. For a panel beside words in a wide section
|
|
47
|
+
- `square` — One by one. For a grid of panels, or a column no wider than it is tall
|
|
48
|
+
- `upright` — Three by four. For a phone, or a narrow column beside a tall run of words
|
|
49
|
+
|
|
50
|
+
Use when: The panel's shape. One of three, so panels across a site agree
|
|
51
|
+
Never for: Fitting a particular piece of UI. The shape is a decision about the layout; the UI is laid out for it
|
|
52
|
+
|
|
53
|
+
### label — `string` **Required.**
|
|
54
|
+
|
|
55
|
+
Use when: Always. What the picture shows, in a sentence — "Trade ticket: buy Gold to rise over 5 minutes, staking 10 USD". The pane is one image to assistive technology and this is its whole description; nothing inside it is read out on its own
|
|
56
|
+
Never for: A title or a caption the page shows. It is never drawn; a heading the reader sees belongs to the section beside the picture
|
|
57
|
+
|
|
58
|
+
Also accepts everything from `HTMLAttributes<HTMLDivElement>`.
|
|
59
|
+
|
|
60
|
+
## Accessibility
|
|
61
|
+
|
|
62
|
+
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.
|
|
63
|
+
|
|
64
|
+
- Announced as: `img`
|
|
65
|
+
- the pane is one image, named by `label`, and nothing inside it reaches the accessibility tree on its own. A picture of a trade ticket read out as a segmented control, two fields and a button tells a screen-reader user there is a form here that does not exist
|
|
66
|
+
- nothing inside the pane can be focused or operated. It is inert, so a keyboard skips straight past it and a pointer cannot press what only looks like a control
|
|
67
|
+
- the pane's ink meets contrast against the glass and the darkest ground it stands on. What is behind the glass varies; in light mode the near-white fill carries the dark ink, and in dark mode the frosted white is faint enough that the band beneath decides the contrast for the light ink
|
|
68
|
+
|
|
69
|
+
## Rules
|
|
70
|
+
|
|
71
|
+
- **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.
|
|
72
|
+
|
|
73
|
+
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.
|
|
74
|
+
|
|
75
|
+
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.
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
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.
|
|
80
|
+
|
|
81
|
+
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.
|
|
82
|
+
Guidance only — cannot be checked automatically.
|
|
83
|
+
- **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.
|
|
84
|
+
Guidance only — cannot be checked automatically.
|
|
85
|
+
- **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.
|
|
86
|
+
|
|
87
|
+
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.
|
|
88
|
+
|
|
89
|
+
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.
|
|
90
|
+
Guidance only — cannot be checked automatically.
|
|
91
|
+
- **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.
|
|
92
|
+
|
|
93
|
+
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.
|
|
94
|
+
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
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.
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
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.
|
|
104
|
+
|
|
105
|
+
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.
|
|
106
|
+
|
|
107
|
+
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.
|
|
108
|
+
Guidance only — cannot be checked automatically.
|
|
109
|
+
- **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.
|
|
110
|
+
|
|
111
|
+
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.
|
|
112
|
+
|
|
113
|
+
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.
|
|
114
|
+
|
|
115
|
+
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.
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
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.
|
|
120
|
+
|
|
121
|
+
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.
|
|
122
|
+
|
|
123
|
+
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.
|
|
124
|
+
|
|
125
|
+
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.
|
|
126
|
+
Guidance only — cannot be checked automatically.
|
|
127
|
+
- **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.
|
|
128
|
+
|
|
129
|
+
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.
|
|
130
|
+
|
|
131
|
+
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.
|
|
132
|
+
|
|
133
|
+
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.
|
|
134
|
+
Guidance only — cannot be checked automatically.
|
|
135
|
+
- **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.
|
|
136
|
+
|
|
137
|
+
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.
|
|
138
|
+
|
|
139
|
+
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.
|
|
140
|
+
|
|
141
|
+
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.
|
|
142
|
+
Guidance only — cannot be checked automatically.
|
|
143
|
+
|
|
144
|
+
## Anti-examples
|
|
145
|
+
|
|
146
|
+
❌ IllustrationCard for: A section has content to present — features, benefits, steps, a list
|
|
147
|
+
A section's content is read, compared and acted on, and belongs in the blocks built for it. This pane is a picture of the product; content set in it reads as an illustration nobody is meant to read closely
|
|
148
|
+
→ use `FeatureCards` instead.
|
|
149
|
+
|
|
150
|
+
❌ IllustrationCard for: The content is something a reader acts on — a link, a form, a set of options
|
|
151
|
+
This is a picture: it explains and does not invite a press. A card that leads somewhere is a Card or a CardButton, whose surface reads as a control
|
|
152
|
+
→ use `Card` instead.
|
|
153
|
+
|
|
154
|
+
❌ IllustrationCard for: There is only a photograph
|
|
155
|
+
The glass pane is the point of this component; a picture on its own is an AspectRatio
|
|
156
|
+
→ use `AspectRatio` instead.
|
|
157
|
+
|
|
158
|
+
## Example
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import { IllustrationCard, Badge, Typography, Row, StatusDot } from '@deriv-com/dds-marketing'
|
|
162
|
+
|
|
163
|
+
<IllustrationCard ratio="landscape" label="Synthetic indices: Volatility 75 Index at 1,204.55, open now and all weekend">
|
|
164
|
+
<Badge label="Synthetic indices" variant="neutral" />
|
|
165
|
+
<Typography variant="h5">Volatility 75 Index</Typography>
|
|
166
|
+
<Typography variant="figure">1,204.55</Typography>
|
|
167
|
+
<Row gap="xs" align="center">
|
|
168
|
+
<StatusDot variant="success" label="Open" />
|
|
169
|
+
<Typography variant="body-sm">Open now — and all weekend</Typography>
|
|
170
|
+
</Row>
|
|
171
|
+
</IllustrationCard>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## In use
|
|
175
|
+
|
|
176
|
+
### Its three shapes
|
|
177
|
+
|
|
178
|
+
Four by three, square and three by four, and nothing else, so every panel on a site agrees. The UI inside is laid out for the shape.
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
import { Badge, IllustrationCard, Row, StatusDot, Typography } from '@deriv-com/dds-marketing'
|
|
182
|
+
|
|
183
|
+
// landscape — 4:3, the default
|
|
184
|
+
<IllustrationCard ratio="landscape" label="Synthetic indices: Volatility 75 Index at 1,204.55, open now and all weekend">
|
|
185
|
+
<Badge label="Synthetic indices" variant="neutral" />
|
|
186
|
+
<Typography variant="h5">Volatility 75 Index</Typography>
|
|
187
|
+
<Typography variant="figure">1,204.55</Typography>
|
|
188
|
+
<Row gap="xs" align="center">
|
|
189
|
+
<StatusDot variant="success" label="Open" />
|
|
190
|
+
<Typography variant="body-sm">Open now — and all weekend</Typography>
|
|
191
|
+
</Row>
|
|
192
|
+
</IllustrationCard>
|
|
193
|
+
|
|
194
|
+
// square — 1:1
|
|
195
|
+
<IllustrationCard ratio="square" label="Synthetic indices: Volatility 75 Index at 1,204.55, open now and all weekend">
|
|
196
|
+
<Badge label="Synthetic indices" variant="neutral" />
|
|
197
|
+
<Typography variant="h5">Volatility 75 Index</Typography>
|
|
198
|
+
<Typography variant="figure">1,204.55</Typography>
|
|
199
|
+
<Row gap="xs" align="center">
|
|
200
|
+
<StatusDot variant="success" label="Open" />
|
|
201
|
+
<Typography variant="body-sm">Open now — and all weekend</Typography>
|
|
202
|
+
</Row>
|
|
203
|
+
</IllustrationCard>
|
|
204
|
+
|
|
205
|
+
// upright — 3:4
|
|
206
|
+
<IllustrationCard ratio="upright" label="Synthetic indices: Volatility 75 Index at 1,204.55, open now and all weekend">
|
|
207
|
+
<Badge label="Synthetic indices" variant="neutral" />
|
|
208
|
+
<Typography variant="h5">Volatility 75 Index</Typography>
|
|
209
|
+
<Typography variant="figure">1,204.55</Typography>
|
|
210
|
+
<Row gap="xs" align="center">
|
|
211
|
+
<StatusDot variant="success" label="Open" />
|
|
212
|
+
<Typography variant="body-sm">Open now — and all weekend</Typography>
|
|
213
|
+
</Row>
|
|
214
|
+
</IllustrationCard>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### As a picture on a dark band
|
|
218
|
+
|
|
219
|
+
Standing on its own as the image a band shows — the glass blurs what is behind it, so it reads as part of the scene rather than as the band's content.
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
import { Background, Badge, IllustrationCard, Row, StatusDot, Typography } from '@deriv-com/dds-marketing'
|
|
223
|
+
|
|
224
|
+
// the pane as the picture
|
|
225
|
+
<Background tone="dark">
|
|
226
|
+
<IllustrationCard ratio="landscape" label="Synthetic indices: Volatility 75 Index at 1,204.55, open now and all weekend">
|
|
227
|
+
<Badge label="Synthetic indices" variant="neutral" />
|
|
228
|
+
<Typography variant="h5">Volatility 75 Index</Typography>
|
|
229
|
+
<Typography variant="figure">1,204.55</Typography>
|
|
230
|
+
<Row gap="xs" align="center">
|
|
231
|
+
<StatusDot variant="success" label="Open" />
|
|
232
|
+
<Typography variant="body-sm">Open now — and all weekend</Typography>
|
|
233
|
+
</Row>
|
|
234
|
+
</IllustrationCard>
|
|
235
|
+
</Background>
|
|
236
|
+
```
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
<!-- GENERATED from illustration-scene.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# IllustrationScene
|
|
4
|
+
|
|
5
|
+
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
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
## Use when
|
|
10
|
+
|
|
11
|
+
- Product information shown over a photograph — a trade ticket, a balance, a market's status — where the photograph sets the scene and the card says what the product does
|
|
12
|
+
- A hero or a feature section needs a picture of the product in use rather than a screenshot or a photograph alone
|
|
13
|
+
|
|
14
|
+
## Do not use
|
|
15
|
+
|
|
16
|
+
- The card stands on its own, with no photograph behind it → `IllustrationCard`
|
|
17
|
+
- There is only a photograph → `AspectRatio`
|
|
18
|
+
- A section's content. Like the card it holds, the scene is a picture of the product, and what a section says belongs in its own blocks
|
|
19
|
+
- More than one card over one photograph. A second card is a second picture competing for the same eye; two scenes side by side say two things clearly
|
|
20
|
+
- A photograph whose subject sits where the card goes. The card covers the middle of the frame, or one side of it with `placement`; choose or crop the photograph so the person or the object stays clear of it
|
|
21
|
+
|
|
22
|
+
## Anatomy
|
|
23
|
+
|
|
24
|
+
IllustrationScene renders 2 elements. A token binding names the part it applies to.
|
|
25
|
+
|
|
26
|
+
- `root` — `<div>`, class `dds-illustrationscene`. The frame, and the shape: one of three proportions — the aspect tokens, the same three IllustrationCard takes — holding radius.surface like a Card and clipping the photograph to it. It places the card it holds over the photograph, at a share of its width that depends on the shape, so every scene across a site composes the same way.
|
|
27
|
+
- `image` — `<img>`, class `dds-illustrationscene__image`. The photograph, filling the frame and cropped to it from the centre. Decoration unless `alt` says otherwise: the card's `label` already describes the whole picture, so most scenes leave the photograph out of the accessibility tree. While it loads, the frame shows color.bg.surface, so the card is never left floating on nothing.
|
|
28
|
+
|
|
29
|
+
Apply these classes from the generated `illustrationSceneParts` constant rather than writing the strings by hand.
|
|
30
|
+
|
|
31
|
+
## Composition
|
|
32
|
+
|
|
33
|
+
- Can contain: `IllustrationCard`
|
|
34
|
+
- Never contains: `IllustrationScene`, `Background` — in children or in any prop that takes a node
|
|
35
|
+
- Holds at least 1 and at most 1
|
|
36
|
+
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
### ratio — `landscape` | `square` | `upright` (default `square`)
|
|
40
|
+
|
|
41
|
+
- `landscape` — Four by three. A scene beside words in a wide section; the card takes a little under half the width
|
|
42
|
+
- `square` — One by one, and the default — the shape most such scenes are drawn in. The card takes a little over half the width
|
|
43
|
+
- `upright` — Three by four. A scene on a phone or in a narrow column; the card takes most of the width
|
|
44
|
+
|
|
45
|
+
Use when: The scene's shape. One of three, the same three IllustrationCard takes, so scenes and cards across a site agree
|
|
46
|
+
Never for: Fitting a particular photograph. The shape is a decision about the layout; the photograph is chosen or cropped for it
|
|
47
|
+
|
|
48
|
+
### placement — `center` | `start` | `end` (default `center`)
|
|
49
|
+
|
|
50
|
+
- `center` — The default: the card in the middle of the frame. For a photograph whose subject frames the middle — a person looking down at what the card shows
|
|
51
|
+
- `start` — The card towards the start edge, for a photograph whose subject is at the end
|
|
52
|
+
- `end` — The card towards the end edge, for a photograph whose subject is at the start
|
|
53
|
+
|
|
54
|
+
Use when: Where the card sits over the photograph, so the subject of the photograph stays clear of it
|
|
55
|
+
Never for: Anything but keeping the photograph's subject clear. The card's size is fixed by the shape; placement moves it and nothing else
|
|
56
|
+
|
|
57
|
+
### src — `string` **Required.**
|
|
58
|
+
|
|
59
|
+
Use when: Always. The photograph the scene is set in
|
|
60
|
+
Never for: A data URI holding a photograph. A scene's photograph is the heaviest thing on its page and belongs in a file the browser can cache
|
|
61
|
+
|
|
62
|
+
### alt — `string` (default ``)
|
|
63
|
+
|
|
64
|
+
Use when: Empty by default, because the card's `label` describes the whole picture and the photograph is decoration. Write one only where the photograph says something the label does not
|
|
65
|
+
Never for: Repeating the card's label. A screen reader would hear the picture described twice
|
|
66
|
+
|
|
67
|
+
Also accepts everything from `HTMLAttributes<HTMLDivElement>`.
|
|
68
|
+
|
|
69
|
+
## Accessibility
|
|
70
|
+
|
|
71
|
+
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.
|
|
72
|
+
|
|
73
|
+
- the picture is described once. The card's label names what the scene shows; the photograph is decoration with an empty alt unless it says something the label does not
|
|
74
|
+
- nothing in the scene can be operated. The card it holds is inert, and the photograph is an image
|
|
75
|
+
|
|
76
|
+
## Rules
|
|
77
|
+
|
|
78
|
+
- **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.
|
|
79
|
+
|
|
80
|
+
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.
|
|
81
|
+
|
|
82
|
+
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.
|
|
83
|
+
|
|
84
|
+
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.
|
|
85
|
+
|
|
86
|
+
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.
|
|
87
|
+
|
|
88
|
+
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.
|
|
89
|
+
Guidance only — cannot be checked automatically.
|
|
90
|
+
- **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.
|
|
91
|
+
Guidance only — cannot be checked automatically.
|
|
92
|
+
- **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.
|
|
93
|
+
|
|
94
|
+
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.
|
|
95
|
+
|
|
96
|
+
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.
|
|
97
|
+
Guidance only — cannot be checked automatically.
|
|
98
|
+
- **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.
|
|
99
|
+
|
|
100
|
+
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.
|
|
101
|
+
|
|
102
|
+
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.
|
|
103
|
+
|
|
104
|
+
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.
|
|
105
|
+
|
|
106
|
+
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.
|
|
107
|
+
|
|
108
|
+
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.
|
|
109
|
+
|
|
110
|
+
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.
|
|
111
|
+
|
|
112
|
+
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.
|
|
113
|
+
|
|
114
|
+
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.
|
|
115
|
+
Guidance only — cannot be checked automatically.
|
|
116
|
+
- **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.
|
|
117
|
+
|
|
118
|
+
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.
|
|
119
|
+
|
|
120
|
+
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.
|
|
121
|
+
|
|
122
|
+
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.
|
|
123
|
+
|
|
124
|
+
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.
|
|
125
|
+
|
|
126
|
+
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.
|
|
127
|
+
|
|
128
|
+
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.
|
|
129
|
+
|
|
130
|
+
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.
|
|
131
|
+
|
|
132
|
+
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.
|
|
133
|
+
Guidance only — cannot be checked automatically.
|
|
134
|
+
- **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.
|
|
135
|
+
|
|
136
|
+
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.
|
|
137
|
+
|
|
138
|
+
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.
|
|
139
|
+
|
|
140
|
+
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.
|
|
141
|
+
Guidance only — cannot be checked automatically.
|
|
142
|
+
- **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.
|
|
143
|
+
|
|
144
|
+
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.
|
|
145
|
+
|
|
146
|
+
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.
|
|
147
|
+
|
|
148
|
+
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.
|
|
149
|
+
Guidance only — cannot be checked automatically.
|
|
150
|
+
|
|
151
|
+
## Anti-examples
|
|
152
|
+
|
|
153
|
+
❌ IllustrationScene for: The card stands on its own, with no photograph behind it
|
|
154
|
+
A card standing on a band or beside words needs no scene; the card alone is the picture
|
|
155
|
+
→ use `IllustrationCard` instead.
|
|
156
|
+
|
|
157
|
+
❌ IllustrationScene for: There is only a photograph
|
|
158
|
+
Without a card over it, a photograph is an AspectRatio
|
|
159
|
+
→ use `AspectRatio` instead.
|
|
160
|
+
|
|
161
|
+
## Example
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
import { IllustrationScene, IllustrationCard, Badge, Typography, Row, StatusDot } from '@deriv-com/dds-marketing'
|
|
165
|
+
|
|
166
|
+
<IllustrationScene ratio="square" src="/sample-card-image.svg">
|
|
167
|
+
<IllustrationCard ratio="square" label="Synthetic indices: Volatility 75 Index at 1,204.55, open now">
|
|
168
|
+
<Badge label="Synthetic indices" variant="neutral" />
|
|
169
|
+
<Typography variant="h5">Volatility 75 Index</Typography>
|
|
170
|
+
<Typography variant="figure">1,204.55</Typography>
|
|
171
|
+
<Row gap="xs" align="center">
|
|
172
|
+
<StatusDot variant="success" label="Open" />
|
|
173
|
+
<Typography variant="body-sm">Open now</Typography>
|
|
174
|
+
</Row>
|
|
175
|
+
</IllustrationCard>
|
|
176
|
+
</IllustrationScene>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## In use
|
|
180
|
+
|
|
181
|
+
Most rows below hold the same set, written once here:
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
import { Badge, IllustrationCard, Row, StatusDot, Typography } from '@deriv-com/dds-marketing'
|
|
185
|
+
|
|
186
|
+
const illustrationcards = (
|
|
187
|
+
<>
|
|
188
|
+
<IllustrationCard ratio="square" label="Synthetic indices: Volatility 75 Index at 1,204.55, open now">
|
|
189
|
+
<Badge label="Synthetic indices" variant="neutral" />
|
|
190
|
+
<Typography variant="h5">Volatility 75 Index</Typography>
|
|
191
|
+
<Typography variant="figure">1,204.55</Typography>
|
|
192
|
+
<Row gap="xs" align="center">
|
|
193
|
+
<StatusDot variant="success" label="Open" />
|
|
194
|
+
<Typography variant="body-sm">Open now</Typography>
|
|
195
|
+
</Row>
|
|
196
|
+
</IllustrationCard>
|
|
197
|
+
</>
|
|
198
|
+
)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Its three shapes
|
|
202
|
+
|
|
203
|
+
The same three shapes as the card, and the card's share of the frame fixed for each, so every scene across a site is composed the same way.
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
import { IllustrationScene } from '@deriv-com/dds-marketing'
|
|
207
|
+
|
|
208
|
+
// landscape — 4:3
|
|
209
|
+
<IllustrationScene ratio="landscape" src="/sample-card-image.svg">{illustrationcards}</IllustrationScene>
|
|
210
|
+
|
|
211
|
+
// square — 1:1, the default
|
|
212
|
+
<IllustrationScene ratio="square" src="/sample-card-image.svg">{illustrationcards}</IllustrationScene>
|
|
213
|
+
|
|
214
|
+
// upright — 3:4
|
|
215
|
+
<IllustrationScene ratio="upright" src="/sample-card-image.svg">{illustrationcards}</IllustrationScene>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Where the card sits
|
|
219
|
+
|
|
220
|
+
Centred, or towards one edge, so the photograph's subject stays clear of the card.
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
import { IllustrationScene } from '@deriv-com/dds-marketing'
|
|
224
|
+
|
|
225
|
+
// center — the default
|
|
226
|
+
<IllustrationScene ratio="square" src="/sample-card-image.svg">{illustrationcards}</IllustrationScene>
|
|
227
|
+
|
|
228
|
+
// start
|
|
229
|
+
<IllustrationScene ratio="square" src="/sample-card-image.svg" placement="start">{illustrationcards}</IllustrationScene>
|
|
230
|
+
|
|
231
|
+
// end
|
|
232
|
+
<IllustrationScene ratio="square" src="/sample-card-image.svg" placement="end">{illustrationcards}</IllustrationScene>
|
|
233
|
+
```
|
|
@@ -100,6 +100,13 @@ Never for: The background. A photograph filling the band is `backgroundImage`; t
|
|
|
100
100
|
Use when: A photograph filling the whole band. It is shown as it is — nothing is painted over it, so choose one already dark enough that the title reads on it
|
|
101
101
|
Never for: A flat colour, or a bright photograph. The band already paints its ground, and nothing here darkens an image on the page's behalf — a pale one leaves the claim unreadable
|
|
102
102
|
|
|
103
|
+
### background — `halftone`
|
|
104
|
+
|
|
105
|
+
- `halftone` — A halftone drawn behind the band's content: coral dots blending to white at the glow's heart, on the band's own dark ground, following the pointer over the band. Drawn by Background, placed as a layer under the content, so the band's own layout is untouched.
|
|
106
|
+
|
|
107
|
+
Use when: The band is the page's one standout moment and wants more than a flat fill. Leave it out and the band is its flat ground, as it always was
|
|
108
|
+
Never for: More than one band on a page. The pattern is what makes a band the one a reader remembers, and two of them make neither
|
|
109
|
+
|
|
103
110
|
## Accessibility
|
|
104
111
|
|
|
105
112
|
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.
|
|
@@ -198,6 +205,9 @@ Two things genuinely have no logical form and are not covered by this. A CSS gra
|
|
|
198
205
|
❌ LandingHero for: The band closes the page rather than opening it
|
|
199
206
|
→ use `Footer` instead.
|
|
200
207
|
|
|
208
|
+
❌ background=halftone + backgroundImage is set
|
|
209
|
+
Two grounds on one band: the photograph would paint over the pattern, or the pattern over the photograph. A hero is a picture or a pattern, never both
|
|
210
|
+
|
|
201
211
|
## Example
|
|
202
212
|
|
|
203
213
|
```tsx
|
|
@@ -252,3 +262,17 @@ import { LandingHero } from '@deriv-com/dds-marketing'
|
|
|
252
262
|
// h2 — the page already carries its h1 elsewhere
|
|
253
263
|
<LandingHero headingLevel="h2" title="Trade the markets you know" description="Open a free demo account with virtual funds and practise on real market prices." />
|
|
254
264
|
```
|
|
265
|
+
|
|
266
|
+
### A halftone ground
|
|
267
|
+
|
|
268
|
+
The band's dark ground with a halftone glowing behind the words and following the pointer, drawn by Background under the band's own content.
|
|
269
|
+
|
|
270
|
+
```tsx
|
|
271
|
+
import { Button, LandingHero } from '@deriv-com/dds-marketing'
|
|
272
|
+
|
|
273
|
+
// halftone — move the pointer over it
|
|
274
|
+
<LandingHero eyebrow="Trading for" title="Anyone, anywhere, anytime" description="Widest range of products, markets and platforms, with 24/7 customer support." actions={<Button variant="primary">Open account</Button>} background="halftone" />
|
|
275
|
+
|
|
276
|
+
// without — the flat ground
|
|
277
|
+
<LandingHero eyebrow="Trading for" title="Anyone, anywhere, anytime" description="Widest range of products, markets and platforms, with 24/7 customer support." actions={<Button variant="primary">Open account</Button>} />
|
|
278
|
+
```
|
|
@@ -78,6 +78,13 @@ Accepts: Button, Link
|
|
|
78
78
|
Use when: The one or two things the page wants a reader to do. Composed by the page rather than described to this component, so a call to action is the same Button here as anywhere else on the site
|
|
79
79
|
Never for: A row of destinations. Three or more controls under a title is a menu, and a reader who has to choose between five things chooses none
|
|
80
80
|
|
|
81
|
+
### background — `halftone`
|
|
82
|
+
|
|
83
|
+
- `halftone` — A halftone drawn behind the band's content: coral dots blending to white at the glow's heart, on the band's own dark ground, following the pointer over the band. Drawn by Background, placed as a layer under the content, so the band's own layout is untouched. It replaces the rule grid rather than joining it: two patterns on one band are texture fighting texture.
|
|
84
|
+
|
|
85
|
+
Use when: The band is the page's one standout moment and wants more than a flat fill. Leave it out and the band is its flat ground, as it always was
|
|
86
|
+
Never for: More than one band on a page. The pattern is what makes a band the one a reader remembers, and two of them make neither
|
|
87
|
+
|
|
81
88
|
## Accessibility
|
|
82
89
|
|
|
83
90
|
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.
|
|
@@ -229,3 +236,17 @@ import { PageHeader } from '@deriv-com/dds-marketing'
|
|
|
229
236
|
// h2 — the page already carries its h1 elsewhere
|
|
230
237
|
<PageHeader headingLevel="h2" title="Contact us" description="Got questions? Here's how to get answers." />
|
|
231
238
|
```
|
|
239
|
+
|
|
240
|
+
### A halftone ground
|
|
241
|
+
|
|
242
|
+
The band's dark ground with a halftone in place of the rule grid, glowing behind the title and following the pointer.
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
import { PageHeader } from '@deriv-com/dds-marketing'
|
|
246
|
+
|
|
247
|
+
// halftone — move the pointer over it
|
|
248
|
+
<PageHeader title="Contact us" description="Got questions? Here's how to get answers." background="halftone" />
|
|
249
|
+
|
|
250
|
+
// without — the flat ground
|
|
251
|
+
<PageHeader title="Contact us" description="Got questions? Here's how to get answers." />
|
|
252
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!-- GENERATED from background.contract.json. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# Background
|
|
4
|
+
|
|
5
|
+
A ground a section or a block sits on, painted with a pattern rather than a flat fill — a halftone, an aurora, a rule grid or rings. …
|
|
6
|
+
|
|
7
|
+
`import { Background } from '@deriv-com/dds-marketing'`
|
|
8
|
+
|
|
9
|
+
## Reach for it when
|
|
10
|
+
|
|
11
|
+
- A band that has to stand apart from the page around it with more than a change of fill — the opening of a landing page, a call to action, a section that closes a long page …
|
|
12
|
+
- A dark band that would otherwise be a flat slab. The glow gives it a centre for the eye, which is where the band's heading or its action should sit
|
|
13
|
+
- A light page that wants one moment of brand colour without a coral block: the dots carry the colour at a fraction of the area a fill would
|
|
14
|
+
|
|
15
|
+
## Something else, when
|
|
16
|
+
|
|
17
|
+
- The band only needs separating from the page around it → **nothing in this system does this**
|
|
18
|
+
- The ground is a picture or a video → **AspectRatio**
|
|
19
|
+
|
|
20
|
+
## Never
|
|
21
|
+
|
|
22
|
+
- Carrying meaning. The pattern is hidden from assistive technology and reads differently on every screen size, so nothing a reader needs may depend on it — not a highlight, not a direction, not a state
|
|
23
|
+
- Behind long reading. Dots behind a paragraph are texture under every word, and the brightest of them sit exactly where the eye is reading; put prose on a plain ground and keep this for the band that opens or closes it
|
|
24
|
+
- Two in a row. Adjacent patterned bands lose the edge between them, and the reader sees one long busy surface rather than two sections
|
|
25
|
+
- A card, a panel or any surface smaller than a band. At a few hundred pixels the glow has nowhere to fall off to, and the dots read as noise rather than light
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
- **tone** `enum` · default "dark" — Which ground the dots are drawn on. It sets the flat colour under the pattern, the dots' ink — coral on the dark and light grounds, white on the coral one — and the ink of what sits on it
|
|
30
|
+
- `dark` — The default, and the band the pattern was drawn for: coral dots glowing on color.bg.brand-strong, which is dark in both modes. …
|
|
31
|
+
- `light` — Coral dots on the page's own ground, for a light page that wants one moment of brand colour without a solid coral band. …
|
|
32
|
+
- `brand` — White dots on the coral brand fill, for a call to action standing on it. …
|
|
33
|
+
- never: Matching the page's colour mode. Dark is dark in both modes — a band that should invert with the theme is a plain section on color.bg.page, not this
|
|
34
|
+
- **pattern** `enum` · default "halftone" — Which pattern is drawn. The halftone is the default and the one that moves most; the aurora drifts slowly; the grid and the rings are the quietest, their lines rising and spreading at a band's pace. …
|
|
35
|
+
- `halftone` — A grid of dots across the whole band that grow towards a soft glow and settle to a fine screen away from it. The default, and the one that moves most
|
|
36
|
+
- `aurora` — Broad soft pools of the brand's colour rising from the band's foot and drifting slowly into one another — light as colour rather than as points. Drawn by the stylesheet: no canvas. …
|
|
37
|
+
- `grid` — A fine rule grid of hairlines, fading in towards the band's foot — the grid PageHeader paints, offered for any band. Drawn by the stylesheet: no canvas. …
|
|
38
|
+
- `rings` — Hairline circles spreading out from the middle of the band's foot, fading in towards it, at size.rings.pitch. Drawn by the stylesheet: no canvas. …
|
|
39
|
+
- never: Choosing per breakpoint. A pattern is the band's identity; one that changed between a phone and a desk would be two bands
|
|
40
|
+
- **animated** `boolean` · default true — On by default: every pattern moves slowly at rest, whether or not anybody is pointing at it — the halftone's glow and the aurora's pools drift along the band's foot, the grid's rules rise and the rings spread outward, each over motion.duration.drift. …
|
|
41
|
+
- never: Holding still for readers who asked for less motion. Every pattern already holds still for them, whatever this says; this is the page's choice, not the reader's
|
|
42
|
+
- **interactive** `boolean` · default true — On by default: the pattern answers a pointer over the band. …
|
|
43
|
+
- never: Guiding the reader to something. The glow follows the pointer rather than leading it, holds still on touch screens and for readers who asked for less motion, and so can point at nothing anybody can rely on
|
|
44
|
+
|
|
45
|
+
## Inside it
|
|
46
|
+
|
|
47
|
+
- 1 component is refused inside it; the list and the reasons are in the long document.
|
|
48
|
+
- Renders 3 parts: root, canvas, content.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
The reasoning behind each of these, the parts this renders, its states and snippets that compile: `.llm/components/background.md`.
|