@deriv-web-design/ui-templates 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,419 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { CardPrimaryStyle } from '@deriv-web-design/ui-core/core';
3
+ import { ReactNode, HTMLAttributes } from 'react';
4
+
5
+ interface FeatureCardItem {
6
+ title: string;
7
+ description: string;
8
+ colorScheme?: CardPrimaryStyle;
9
+ image?: string;
10
+ imageAlt?: string;
11
+ showLink?: boolean;
12
+ linkText?: string;
13
+ onLinkClick?: () => void;
14
+ }
15
+ interface FeatureCardsProps {
16
+ sectionTitle: string;
17
+ sectionDescription?: string;
18
+ showLink?: boolean;
19
+ linkText?: string;
20
+ onLinkClick?: () => void;
21
+ /** Controls the visual style of all cards in the grid */
22
+ cardColorScheme?: CardPrimaryStyle;
23
+ cards: FeatureCardItem[];
24
+ }
25
+
26
+ declare const FeatureCards: ({ sectionTitle, sectionDescription, showLink, linkText, onLinkClick, cardColorScheme, cards, }: FeatureCardsProps) => react_jsx_runtime.JSX.Element;
27
+
28
+ interface FeatureCardSecondaryItem {
29
+ title: string;
30
+ description: string;
31
+ icon?: ReactNode;
32
+ showIcon?: boolean;
33
+ showLink?: boolean;
34
+ linkText?: string;
35
+ onLinkClick?: () => void;
36
+ }
37
+ interface FeatureCardsSecondaryProps {
38
+ sectionTitle: string;
39
+ sectionDescription?: string;
40
+ showLink?: boolean;
41
+ linkText?: string;
42
+ onLinkClick?: () => void;
43
+ cards: FeatureCardSecondaryItem[];
44
+ }
45
+
46
+ declare const FeatureCardsSecondary: ({ sectionTitle, sectionDescription, showLink, linkText, onLinkClick, cards, }: FeatureCardsSecondaryProps) => react_jsx_runtime.JSX.Element;
47
+
48
+ type HeroVariant = "split" | "centered" | "showcase" | "visuals" | "minimal";
49
+ interface HeroButtonProps {
50
+ /** Button label text */
51
+ label: string;
52
+ /** Click handler */
53
+ onClick?: () => void;
54
+ /** Link href — renders an anchor if provided */
55
+ href?: string;
56
+ }
57
+ interface HeroProps extends HTMLAttributes<HTMLElement> {
58
+ /**
59
+ * Layout variant:
60
+ *
61
+ * - "split" — dark bg, left-aligned text, right-side hero image, 100vh
62
+ * - "centered" — full background image, center-aligned text, 100vh
63
+ * - "showcase" — dark bg + full-bleed bg image, center-aligned text, large product image
64
+ * below buttons, smaller floating image below that.
65
+ * - "visuals" — light grey bg + SVG grid, center-aligned text, floating visuals, min-height 540px
66
+ * - "minimal" — same as visuals but without floating graphics
67
+ */
68
+ variant: HeroVariant;
69
+ /** Optional eyebrow / subtitle above the title */
70
+ subtitle?: string;
71
+ /** Main heading */
72
+ title: string;
73
+ /** Body copy below the title */
74
+ description?: string;
75
+ /**
76
+ * Primary CTA button (coral).
77
+ * Shown on all variants.
78
+ */
79
+ primaryButton?: HeroButtonProps;
80
+ /**
81
+ * Secondary CTA button (white outline).
82
+ * Shown on Split, Centered and Showcase variants.
83
+ */
84
+ secondaryButton?: HeroButtonProps;
85
+ /**
86
+ * Background image URL.
87
+ * - "split" — used as the full-bleed background behind the overlay
88
+ * - "centered" — used as the full-bleed background behind the overlay
89
+ * - "showcase" — used as the full-bleed background behind the overlay
90
+ */
91
+ backgroundImageSrc?: string;
92
+ /**
93
+ * Right-side hero image for the Split variant.
94
+ * Accepts a ReactNode (e.g. <img>) or an image URL string.
95
+ */
96
+ heroImage?: ReactNode | string;
97
+ /**
98
+ * Left floating visual for the Visuals variant.
99
+ * Accepts a ReactNode or image URL string.
100
+ */
101
+ leftVisual?: ReactNode | string;
102
+ /**
103
+ * Right floating visual for the Visuals variant.
104
+ * Accepts a ReactNode or image URL string.
105
+ */
106
+ rightVisual?: ReactNode | string;
107
+ /**
108
+ * Large product image shown centered below the CTA buttons in the Showcase variant.
109
+ * Accepts a ReactNode or image URL string.
110
+ */
111
+ productImage?: ReactNode | string;
112
+ /**
113
+ * Smaller floating image shown below the productImage in the Showcase variant.
114
+ * Accepts a ReactNode or image URL string.
115
+ */
116
+ floatingImage?: ReactNode | string;
117
+ }
118
+
119
+ declare const Hero: ({ variant, subtitle, title, description, primaryButton, secondaryButton, backgroundImageSrc, heroImage, leftVisual, rightVisual, productImage, floatingImage, className, ...props }: HeroProps) => react_jsx_runtime.JSX.Element;
120
+
121
+ interface StatItem {
122
+ /** Numeric or short display value, e.g. "2.5M+" */
123
+ value: string;
124
+ /** Descriptive label below the value, e.g. "customers worldwide" */
125
+ label: string;
126
+ }
127
+ interface AwardItem {
128
+ /** URL of the award badge image (PNG, SVG, WebP, etc.) */
129
+ imageSrc: string;
130
+ /** Accessible alt text for the award image */
131
+ imageAlt?: string;
132
+ }
133
+ interface StatsProps extends HTMLAttributes<HTMLElement> {
134
+ /** Section heading (H2) */
135
+ title: string;
136
+ /** Optional body copy below the heading */
137
+ description?: string;
138
+ /**
139
+ * Ordered list of stats displayed in the centre card.
140
+ * Mark one item as `featured: true` to render it at the hero size.
141
+ */
142
+ stats: StatItem[];
143
+ /**
144
+ * Award badge images shown on the left side (desktop) / top row (mobile).
145
+ * Maximum 2 items recommended.
146
+ */
147
+ leftAwards?: AwardItem[];
148
+ /**
149
+ * Award badge images shown on the right side (desktop) / bottom row (mobile).
150
+ * Maximum 2 items recommended.
151
+ */
152
+ rightAwards?: AwardItem[];
153
+ }
154
+
155
+ declare const Stats: ({ title, description, stats, leftAwards, rightAwards, className, ...props }: StatsProps) => react_jsx_runtime.JSX.Element;
156
+
157
+ interface FeatureScrollItem {
158
+ /** Short feature name, e.g. "Forex" */
159
+ title: string;
160
+ /** Body copy below the title */
161
+ description: string;
162
+ /** Visible label on the link, e.g. "Learn more" */
163
+ linkLabel: string;
164
+ /** URL the link points to */
165
+ link: string;
166
+ /**
167
+ * Optional override for media rendering.
168
+ * When omitted the component auto-detects based on the URL extension:
169
+ * *.lottie → DotLottie animation player
170
+ * everything else (png, jpg, svg, webp…) → <img>
171
+ */
172
+ mediaType?: "lottie" | "image";
173
+ /** URL to the .lottie file or any image asset (png, jpg, svg, webp…) */
174
+ mediaUrl: string;
175
+ }
176
+ interface FeatureScrollProps extends HTMLAttributes<HTMLElement> {
177
+ /** Section heading rendered as an H2 */
178
+ header: string;
179
+ /**
180
+ * Ordered list of feature items.
181
+ * Drives both the desktop scroll-driven layout and the mobile stacked layout.
182
+ */
183
+ items: FeatureScrollItem[];
184
+ /**
185
+ * Controls which side the sticky media column sits on.
186
+ * @default "media-right"
187
+ */
188
+ variant?: "media-left" | "media-right";
189
+ }
190
+
191
+ declare const FEATURE_SCROLL_DATA: FeatureScrollItem[];
192
+ declare const FeatureScroll: ({ header, items, variant, className, ...props }: FeatureScrollProps) => react_jsx_runtime.JSX.Element;
193
+
194
+ /** Visual colour theme for each card — matches the Figma palette. */
195
+ type StickyCardTheme = "light" | "coral" | "dark";
196
+ interface StickyCardItem {
197
+ /** Card heading */
198
+ title: string;
199
+ /** Body copy below the title */
200
+ description: string;
201
+ /** URL of the card's hero image (webp, png, jpg, etc.) */
202
+ imageUrl: string;
203
+ /**
204
+ * Background / text colour theme.
205
+ * light → slate-75 bg + dark text
206
+ * coral → coral-500 bg + white text
207
+ * dark → slate-1200 bg + white text
208
+ * @default "light"
209
+ */
210
+ theme?: StickyCardTheme;
211
+ }
212
+ interface StickyStackedCardsProps extends HTMLAttributes<HTMLElement> {
213
+ /** Section heading rendered as H2 */
214
+ header: string;
215
+ /**
216
+ * Ordered list of cards.
217
+ * On desktop each card is position:sticky and slides over the previous one.
218
+ * On mobile they render as a plain vertical stack.
219
+ */
220
+ items: StickyCardItem[];
221
+ }
222
+
223
+ declare const STEPS_DATA: StickyCardItem[];
224
+ declare const StickyStackedCards: ({ header, items, className, ...props }: StickyStackedCardsProps) => react_jsx_runtime.JSX.Element;
225
+
226
+ interface AvatarPosition {
227
+ left?: string;
228
+ right?: string;
229
+ top?: string;
230
+ }
231
+ interface AvatarItem {
232
+ /** Unique identifier */
233
+ id: number;
234
+ /** Image source URL */
235
+ imageUrl: string;
236
+ /**
237
+ * Distance rank from the center content area (0 = closest).
238
+ * Drives the center-outward animation stagger:
239
+ * delay = ANIM.delayAvatars + staggerRank × ANIM.stagger
240
+ */
241
+ staggerRank: number;
242
+ /** Absolute position within the 1280 × 680 desktop stage */
243
+ desktopPos: AvatarPosition;
244
+ /**
245
+ * Absolute position within the mobile stage.
246
+ * `null` = hidden on mobile.
247
+ */
248
+ mobilePos: AvatarPosition | null;
249
+ /** Whether this avatar is rendered on mobile viewports */
250
+ mobileVisible: boolean;
251
+ }
252
+ interface CTABannerProps extends HTMLAttributes<HTMLElement> {
253
+ /** Section headline */
254
+ headline?: string;
255
+ /** CTA button label */
256
+ ctaLabel?: string;
257
+ /** CTA button href */
258
+ ctaHref?: string;
259
+ /** Override the default avatar array */
260
+ avatars?: AvatarItem[];
261
+ /**
262
+ * Layout variant.
263
+ * - `standard` (default): 12 avatars, taller section (864px desktop)
264
+ * - `compact`: 7 avatars, section height matches stage (680px desktop)
265
+ */
266
+ variant?: "standard" | "compact";
267
+ }
268
+
269
+ declare const AVATAR_DATA: AvatarItem[];
270
+ declare const CTABanner: ({ headline, ctaLabel, ctaHref, avatars, variant, className, ...props }: CTABannerProps) => react_jsx_runtime.JSX.Element;
271
+
272
+ interface DayNightTransitionProps extends HTMLAttributes<HTMLDivElement> {
273
+ /** URL for the daytime background image */
274
+ dayImageUrl: string;
275
+ /** URL for the nighttime background image */
276
+ nightImageUrl: string;
277
+ /** Headline shown in the day state */
278
+ dayHeadline?: string;
279
+ /** Headline shown in the night state */
280
+ nightHeadline?: string;
281
+ /** Description shown in the day state */
282
+ dayDescription?: string;
283
+ /** Description shown in the night state */
284
+ nightDescription?: string;
285
+ /** Label for the CTA button */
286
+ ctaLabel?: string;
287
+ /** href for the CTA button */
288
+ ctaHref?: string;
289
+ /** When true, the CTA button is omitted (e.g. hero blocks that end on copy only). */
290
+ hideCta?: boolean;
291
+ /** Headline typography scale — maps to global `--typography-h1-*` or `--typography-h2-*` tokens. */
292
+ headlineLevel?: "h1" | "h2";
293
+ /** Description typography scale — maps to `--typography-body-md-*` or `--typography-body-lg-*` tokens. */
294
+ descriptionLevel?: "body-md" | "body-lg";
295
+ /**
296
+ * Webflow-style headline: fixed `prefix` plus `dayWord` / `nightWord` overlaid and scroll-crossfaded
297
+ * (same pattern as `DayNightTransitionV2` HTML: “Trade all ” + day + night).
298
+ */
299
+ inlineDayNightHeadline?: {
300
+ prefix: string;
301
+ dayWord: string;
302
+ nightWord: string;
303
+ };
304
+ /**
305
+ * `"webflow-day-night-v2"` replays IX2 scroll curves from Webflow export `DayNightTransitionV2`
306
+ * (`SCROLLING_IN_VIEW` + `SCROLL_PROGRESS` actionLists `a` / `a-2` in `js/webflow.js`).
307
+ */
308
+ scrollPreset?: "default" | "webflow-day-night-v2";
309
+ }
310
+
311
+ declare const DayNightTransition: ({ dayImageUrl, nightImageUrl, dayHeadline, nightHeadline, dayDescription, nightDescription, ctaLabel, ctaHref, hideCta, headlineLevel, descriptionLevel, inlineDayNightHeadline, scrollPreset, className, ...props }: DayNightTransitionProps) => react_jsx_runtime.JSX.Element;
312
+
313
+ /**
314
+ * **DayNightTransitionV2** Storybook preset: same headlines, body copy, CTA, and
315
+ * typography defaults (h2 + body-md) as the **Default** story; Webflow IX2 scroll
316
+ * timing via `scrollPreset: "webflow-day-night-v2"` plus `dnt--layout-v2` /
317
+ * `dnt--webflow-v2` for layout and backgrounds.
318
+ */
319
+ declare const dayNightTransitionV2Preset: Pick<DayNightTransitionProps, "className" | "dayImageUrl" | "nightImageUrl" | "dayHeadline" | "nightHeadline" | "dayDescription" | "nightDescription" | "ctaLabel" | "ctaHref" | "scrollPreset">;
320
+
321
+ interface LogoItem {
322
+ name: string;
323
+ url: string;
324
+ }
325
+ interface LogoMarqueeProps extends HTMLAttributes<HTMLElement> {
326
+ headline?: string;
327
+ body?: string;
328
+ disclaimer?: string;
329
+ ctaLabel?: string;
330
+ ctaHref?: string;
331
+ col1Logos?: LogoItem[];
332
+ col2Logos?: LogoItem[];
333
+ }
334
+
335
+ declare const COL_ONE_LOGOS: LogoItem[];
336
+ declare const COL_TWO_LOGOS: LogoItem[];
337
+ declare const TEXT_CONTENT: {
338
+ headline: string;
339
+ body: string;
340
+ disclaimer: string;
341
+ ctaLabel: string;
342
+ ctaHref: string;
343
+ };
344
+ declare const LogoMarquee: ({ headline, body, disclaimer, ctaLabel, ctaHref, col1Logos, col2Logos, className, ...props }: LogoMarqueeProps) => react_jsx_runtime.JSX.Element;
345
+
346
+ type StepsImagePosition = "left" | "right";
347
+ interface StepItem {
348
+ /** Step title */
349
+ title: string;
350
+ /** Step body copy */
351
+ description: string;
352
+ }
353
+ interface StepsProps {
354
+ /** Section headline (H2) */
355
+ title: string;
356
+ /** Ordered list of steps */
357
+ steps: StepItem[];
358
+ /** Image source URL */
359
+ image?: string;
360
+ /** Accessible alt text for the image */
361
+ imageAlt?: string;
362
+ /**
363
+ * Which side the image sits on (default: "left").
364
+ * On mobile the image always stacks above the content.
365
+ */
366
+ imagePosition?: StepsImagePosition;
367
+ }
368
+
369
+ declare const Steps: ({ title, steps, image, imageAlt, imagePosition, }: StepsProps) => react_jsx_runtime.JSX.Element;
370
+
371
+ type DownloadBannerStyle = "light" | "light-2" | "dark";
372
+ interface DownloadBannerProps {
373
+ /**
374
+ * Visual style of the inner card.
375
+ * - "light" → slate-100 outer section, white inner card
376
+ * - "light-2" → white outer section, slate-100 inner card (default)
377
+ * - "dark" → white outer section, slate-1200 inner card
378
+ */
379
+ style?: DownloadBannerStyle;
380
+ /** QR code image URL. When provided the QR block is shown on desktop. */
381
+ qrCodeImage?: string;
382
+ /** Accessible alt text for the QR code image */
383
+ qrCodeAlt?: string;
384
+ /** First line of text beside the QR code (default: "Scan to download") */
385
+ qrTitle?: string;
386
+ /** Second line of text beside the QR code (default: "Android & iOS") */
387
+ qrSubtitle?: string;
388
+ /** Heading shown on mobile above the badge grid (default: "Available on") */
389
+ mobileTitle?: string;
390
+ showAppStore?: boolean;
391
+ showGooglePlay?: boolean;
392
+ showAppGallery?: boolean;
393
+ showWindows?: boolean;
394
+ showMacOS?: boolean;
395
+ showLinux?: boolean;
396
+ showWeb?: boolean;
397
+ appStoreHref?: string;
398
+ googlePlayHref?: string;
399
+ appGalleryHref?: string;
400
+ windowsHref?: string;
401
+ macOSHref?: string;
402
+ linuxHref?: string;
403
+ webHref?: string;
404
+ /** Optional small-print disclaimer shown below the QR text */
405
+ disclaimer?: string;
406
+ }
407
+
408
+ declare const DownloadBanner: ({ style, qrCodeImage, qrCodeAlt, qrTitle, qrSubtitle, mobileTitle, showAppStore, showGooglePlay, showAppGallery, showWindows, showMacOS, showLinux, showWeb, appStoreHref, googlePlayHref, appGalleryHref, windowsHref, macOSHref, linuxHref, webHref, disclaimer, }: DownloadBannerProps) => react_jsx_runtime.JSX.Element;
409
+
410
+ interface TextScrollProps {
411
+ /** The large body copy that animates word-by-word on scroll */
412
+ text: string;
413
+ /** Additional class names forwarded to the section root */
414
+ className?: string;
415
+ }
416
+
417
+ declare const TextScroll: ({ text, className }: TextScrollProps) => react_jsx_runtime.JSX.Element;
418
+
419
+ export { AVATAR_DATA, type AvatarItem, type AvatarPosition, type AwardItem, COL_ONE_LOGOS, COL_TWO_LOGOS, CTABanner, type CTABannerProps, DayNightTransition, type DayNightTransitionProps, DownloadBanner, type DownloadBannerProps, type DownloadBannerStyle, FEATURE_SCROLL_DATA, type FeatureCardItem, type FeatureCardSecondaryItem, FeatureCards, type FeatureCardsProps, FeatureCardsSecondary, type FeatureCardsSecondaryProps, FeatureScroll, type FeatureScrollItem, type FeatureScrollProps, Hero, type HeroButtonProps, type HeroProps, type HeroVariant, type LogoItem, LogoMarquee, type LogoMarqueeProps, STEPS_DATA, type StatItem, Stats, type StatsProps, type StepItem, Steps, type StepsImagePosition, type StepsProps, type StickyCardItem, type StickyCardTheme, StickyStackedCards, type StickyStackedCardsProps, TEXT_CONTENT, TextScroll, type TextScrollProps, dayNightTransitionV2Preset };