@deriv-web-design/ui 0.0.3 → 0.0.5

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/dist/index.d.mts CHANGED
@@ -150,6 +150,31 @@ interface ChipDropdownProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>
150
150
 
151
151
  declare const ChipDropdown: ({ size, label, tag, icon, options, value, onChange, disabled, className, ...props }: ChipDropdownProps) => react_jsx_runtime.JSX.Element;
152
152
 
153
+ interface BottomSheetAction {
154
+ label: string;
155
+ onClick: () => void;
156
+ }
157
+ interface BottomSheetProps {
158
+ /** Whether the sheet is visible */
159
+ open: boolean;
160
+ /** Called when the user dismisses the sheet (overlay click, close button, or Escape key) */
161
+ onClose: () => void;
162
+ /** Title displayed in the header */
163
+ title?: string;
164
+ /** Show the header row (title + close button). Default: true */
165
+ showHeader?: boolean;
166
+ /** Show the drag handle bar at the top. Default: true */
167
+ showHandleBar?: boolean;
168
+ /** Primary action button rendered at the bottom of the sheet */
169
+ primaryAction?: BottomSheetAction;
170
+ /** Secondary action button rendered below the primary */
171
+ secondaryAction?: BottomSheetAction;
172
+ /** Flexible body content — list items, form fields, etc. */
173
+ children?: ReactNode;
174
+ }
175
+
176
+ declare const BottomSheet: ({ open, onClose, title, showHeader, showHandleBar, primaryAction, secondaryAction, children, }: BottomSheetProps) => react.ReactPortal | null;
177
+
153
178
  interface CardTag {
154
179
  label: string;
155
180
  icon?: ReactNode;
@@ -251,4 +276,366 @@ interface FeatureCardsProps {
251
276
 
252
277
  declare const FeatureCards: ({ sectionTitle, sectionDescription, showLink, linkText, onLinkClick, cardColorScheme, cards, }: FeatureCardsProps) => react_jsx_runtime.JSX.Element;
253
278
 
254
- export { Accordion, type AccordionProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, type BreadcrumbSize, Button, type ButtonColorScheme, type ButtonIconPosition, type ButtonProps, type ButtonVariant, Card, type CardPrimaryStyle, type CardProps, type CardTag, type CardThumbnailType, Chip, ChipDropdown, type ChipDropdownOption, type ChipDropdownProps, type ChipProps, type ChipSize, type FeatureCardItem, FeatureCards, type FeatureCardsProps, Link, type LinkColorScheme, type LinkProps, Pagination, type PaginationProps, SearchField, type SearchFieldProps, type SearchFieldStatus, Tag, type TagFontWeight, type TagProps, type TagSize, type TagVariant, TextField, type TextFieldProps, type TextFieldStatus, type TextFieldVariant };
279
+ interface FooterLinkItem {
280
+ /** Link label text */
281
+ label: string;
282
+ /** Link href */
283
+ href?: string;
284
+ /** Renders an external-link icon and opens in a new tab */
285
+ isExternal?: boolean;
286
+ /** Optional click handler */
287
+ onClick?: () => void;
288
+ }
289
+ interface FooterNavSection {
290
+ /** Section heading (e.g. "Trade", "Markets") */
291
+ title: string;
292
+ /** List of navigation links in this section */
293
+ links: FooterLinkItem[];
294
+ }
295
+ interface FooterSocialLink {
296
+ /** Icon node (SVG or any ReactNode) */
297
+ icon: ReactNode;
298
+ /** Link href */
299
+ href?: string;
300
+ /** Accessible label for the link */
301
+ ariaLabel: string;
302
+ }
303
+ interface FooterAppBadge {
304
+ /** Inline SVG or ReactNode — use instead of imageSrc for pixel-perfect badges */
305
+ icon?: ReactNode;
306
+ /** Image source URL (used when icon is not provided) */
307
+ imageSrc?: string;
308
+ /** Image alt text */
309
+ imageAlt: string;
310
+ /** Link href (optional) */
311
+ href?: string;
312
+ }
313
+ interface FooterDerivGoProps {
314
+ /** Deriv GO product logo image source */
315
+ logoSrc: string;
316
+ /** Alt text for the logo */
317
+ logoAlt?: string;
318
+ /** Product title */
319
+ title?: string;
320
+ /** Short description */
321
+ description?: string;
322
+ /** QR code image source — shown only on desktop */
323
+ qrCodeSrc?: string;
324
+ /** Inline SVG or ReactNode — use instead of qrCodeSrc for pixel-perfect QR codes */
325
+ qrCodeIcon?: ReactNode;
326
+ /** Alt text for the QR code */
327
+ qrCodeAlt?: string;
328
+ /** Google Play store badge */
329
+ googlePlayBadge?: FooterAppBadge;
330
+ /** Apple App Store badge */
331
+ appStoreBadge?: FooterAppBadge;
332
+ /** Huawei AppGallery badge */
333
+ huaweiBadge?: FooterAppBadge;
334
+ /** Footnote text (e.g. "*Availability varies by country.") */
335
+ availabilityNote?: string;
336
+ }
337
+ interface FooterAiSummaryItem {
338
+ /** AI app icon image source */
339
+ imageSrc: string;
340
+ /** Alt / aria-label text */
341
+ imageAlt: string;
342
+ /** Link href */
343
+ href?: string;
344
+ }
345
+ interface FooterAiSummaryProps {
346
+ /** Prompt label shown above the icons */
347
+ label?: string;
348
+ /** List of AI app items */
349
+ items: FooterAiSummaryItem[];
350
+ }
351
+ interface FooterProps extends HTMLAttributes<HTMLElement> {
352
+ /** Deriv logo image source */
353
+ logoSrc: string;
354
+ /** Alt text for the logo */
355
+ logoAlt?: string;
356
+ /**
357
+ * Navigation structure.
358
+ * Outer array = columns (desktop grid), inner array = sections per column.
359
+ * On mobile/tablet all sections are flattened into an accordion list.
360
+ */
361
+ navColumns: FooterNavSection[][];
362
+ /** Social media links shown in the header row */
363
+ socialLinks?: FooterSocialLink[];
364
+ /** Deriv GO promotion banner */
365
+ derivGo?: FooterDerivGoProps;
366
+ /** "Investors in People" badge image source */
367
+ investorsInPeopleSrc?: string;
368
+ /** Alt text for the Investors in People badge */
369
+ investorsInPeopleAlt?: string;
370
+ /** Legal / licence text block (supports ReactNode for inline links) */
371
+ licenseText?: ReactNode;
372
+ /** Risk-warning paragraph text */
373
+ riskWarningText?: ReactNode;
374
+ /**
375
+ * AI summary section.
376
+ * Desktop: rendered inline inside the header row.
377
+ * Mobile: rendered as a standalone card below the header.
378
+ * Tablet: hidden.
379
+ */
380
+ aiSummary?: FooterAiSummaryProps;
381
+ }
382
+
383
+ declare const Footer: ({ logoSrc, logoAlt, navColumns, socialLinks, derivGo, investorsInPeopleSrc, investorsInPeopleAlt, licenseText, riskWarningText, aiSummary, className, ...props }: FooterProps) => react_jsx_runtime.JSX.Element;
384
+
385
+ type HeroVariant = "homepage" | "full-image" | "visuals" | "text-only";
386
+ interface HeroButtonProps {
387
+ /** Button label text */
388
+ label: string;
389
+ /** Click handler */
390
+ onClick?: () => void;
391
+ /** Link href — renders an anchor if provided */
392
+ href?: string;
393
+ }
394
+ interface HeroProps extends HTMLAttributes<HTMLElement> {
395
+ /**
396
+ * Layout variant:
397
+ * - "homepage" — dark bg, left-aligned text, right-side hero image, 100vh
398
+ * - "full-image" — full background image, center-aligned text, 100vh
399
+ * - "visuals" — light grey bg + SVG grid, center-aligned text, floating visuals, min-height 540px
400
+ * - "text-only" — same as visuals but without floating graphics
401
+ */
402
+ variant: HeroVariant;
403
+ /** Optional eyebrow / subtitle above the title */
404
+ subtitle?: string;
405
+ /** Main heading */
406
+ title: string;
407
+ /** Body copy below the title */
408
+ description?: string;
409
+ /**
410
+ * Primary CTA button (coral).
411
+ * Shown on all variants.
412
+ */
413
+ primaryButton?: HeroButtonProps;
414
+ /**
415
+ * Secondary CTA button (white outline).
416
+ * Shown on Homepage and Full Image variants.
417
+ */
418
+ secondaryButton?: HeroButtonProps;
419
+ /**
420
+ * Background image URL.
421
+ * - "homepage" — used as the full-bleed background behind the overlay
422
+ * - "full-image" — used as the full-bleed background behind the overlay
423
+ */
424
+ backgroundImageSrc?: string;
425
+ /**
426
+ * Right-side hero image for the Homepage variant.
427
+ * Accepts a ReactNode (e.g. <img>) or an image URL string.
428
+ */
429
+ heroImage?: ReactNode | string;
430
+ /**
431
+ * Left floating visual for the Visuals variant (desktop only).
432
+ * Accepts a ReactNode or image URL string.
433
+ */
434
+ leftVisual?: ReactNode | string;
435
+ /**
436
+ * Right floating visual for the Visuals variant (desktop only).
437
+ * Accepts a ReactNode or image URL string.
438
+ */
439
+ rightVisual?: ReactNode | string;
440
+ }
441
+
442
+ declare const Hero: ({ variant, subtitle, title, description, primaryButton, secondaryButton, backgroundImageSrc, heroImage, leftVisual, rightVisual, className, ...props }: HeroProps) => react_jsx_runtime.JSX.Element;
443
+
444
+ interface StatItem {
445
+ /** Numeric or short display value, e.g. "2.5M+" */
446
+ value: string;
447
+ /** Descriptive label below the value, e.g. "customers worldwide" */
448
+ label: string;
449
+ }
450
+ interface AwardItem {
451
+ /** URL of the award badge image (PNG, SVG, WebP, etc.) */
452
+ imageSrc: string;
453
+ /** Accessible alt text for the award image */
454
+ imageAlt?: string;
455
+ }
456
+ interface StatsProps extends HTMLAttributes<HTMLElement> {
457
+ /** Section heading (H2) */
458
+ title: string;
459
+ /** Optional body copy below the heading */
460
+ description?: string;
461
+ /**
462
+ * Ordered list of stats displayed in the centre card.
463
+ * Mark one item as `featured: true` to render it at the hero size.
464
+ */
465
+ stats: StatItem[];
466
+ /**
467
+ * Award badge images shown on the left side (desktop) / top row (mobile).
468
+ * Maximum 2 items recommended.
469
+ */
470
+ leftAwards?: AwardItem[];
471
+ /**
472
+ * Award badge images shown on the right side (desktop) / bottom row (mobile).
473
+ * Maximum 2 items recommended.
474
+ */
475
+ rightAwards?: AwardItem[];
476
+ }
477
+
478
+ declare const Stats: ({ title, description, stats, leftAwards, rightAwards, className, ...props }: StatsProps) => react_jsx_runtime.JSX.Element;
479
+
480
+ interface ScrollytellingItem {
481
+ /** Short market name, e.g. "Forex" */
482
+ title: string;
483
+ /** Body copy below the title */
484
+ description: string;
485
+ /** Visible label on the link, e.g. "Learn more" */
486
+ linkLabel: string;
487
+ /** URL the link points to */
488
+ link: string;
489
+ /**
490
+ * Optional override for media rendering.
491
+ * When omitted the component auto-detects based on the URL extension:
492
+ * *.lottie → DotLottie animation player
493
+ * everything else (png, jpg, svg, webp…) → <img>
494
+ */
495
+ mediaType?: "lottie" | "image";
496
+ /** URL to the .lottie file or any image asset (png, jpg, svg, webp…) */
497
+ mediaUrl: string;
498
+ }
499
+ interface ScrollytellingProps extends HTMLAttributes<HTMLElement> {
500
+ /** Section heading rendered as an H2 */
501
+ header: string;
502
+ /**
503
+ * Ordered list of market items.
504
+ * Drives both the desktop scrollytelling and the mobile stacked layout.
505
+ */
506
+ items: ScrollytellingItem[];
507
+ /**
508
+ * Controls which side the sticky media column sits on.
509
+ * @default "media-right"
510
+ */
511
+ variant?: "media-left" | "media-right";
512
+ }
513
+
514
+ declare const SCROLLYTELLING_DATA: ScrollytellingItem[];
515
+ declare const Scrollytelling: ({ header, items, variant, className, ...props }: ScrollytellingProps) => react_jsx_runtime.JSX.Element;
516
+
517
+ /** Visual colour theme for each card — matches the Figma palette. */
518
+ type StickyCardTheme = "light" | "coral" | "dark";
519
+ interface StickyCardItem {
520
+ /** Card heading */
521
+ title: string;
522
+ /** Body copy below the title */
523
+ description: string;
524
+ /** URL of the card's hero image (webp, png, jpg, etc.) */
525
+ imageUrl: string;
526
+ /**
527
+ * Background / text colour theme.
528
+ * light → slate-75 bg + dark text
529
+ * coral → coral-500 bg + white text
530
+ * dark → slate-1200 bg + white text
531
+ * @default "light"
532
+ */
533
+ theme?: StickyCardTheme;
534
+ }
535
+ interface StickyStackedCardsProps extends HTMLAttributes<HTMLElement> {
536
+ /** Section heading rendered as H2 */
537
+ header: string;
538
+ /**
539
+ * Ordered list of cards.
540
+ * On desktop each card is position:sticky and slides over the previous one.
541
+ * On mobile they render as a plain vertical stack.
542
+ */
543
+ items: StickyCardItem[];
544
+ }
545
+
546
+ declare const STEPS_DATA: StickyCardItem[];
547
+ declare const StickyStackedCards: ({ header, items, className, ...props }: StickyStackedCardsProps) => react_jsx_runtime.JSX.Element;
548
+
549
+ interface AvatarPosition {
550
+ left?: string;
551
+ right?: string;
552
+ top?: string;
553
+ }
554
+ interface AvatarItem {
555
+ /** Unique identifier */
556
+ id: number;
557
+ /** Image source URL */
558
+ imageUrl: string;
559
+ /**
560
+ * Distance rank from the center content area (0 = closest).
561
+ * Drives the center-outward animation stagger:
562
+ * delay = ANIM.delayAvatars + staggerRank × ANIM.stagger
563
+ */
564
+ staggerRank: number;
565
+ /** Absolute position within the 1280 × 680 desktop stage */
566
+ desktopPos: AvatarPosition;
567
+ /**
568
+ * Absolute position within the mobile stage.
569
+ * `null` = hidden on mobile.
570
+ */
571
+ mobilePos: AvatarPosition | null;
572
+ /** Whether this avatar is rendered on mobile viewports */
573
+ mobileVisible: boolean;
574
+ }
575
+ interface CTABannerProps extends HTMLAttributes<HTMLElement> {
576
+ /** Section headline */
577
+ headline?: string;
578
+ /** CTA button label */
579
+ ctaLabel?: string;
580
+ /** CTA button href */
581
+ ctaHref?: string;
582
+ /** Override the default avatar array */
583
+ avatars?: AvatarItem[];
584
+ /**
585
+ * Layout variant.
586
+ * - `standard` (default): 12 avatars, taller section (864px desktop)
587
+ * - `compact`: 7 avatars, section height matches stage (680px desktop)
588
+ */
589
+ variant?: "standard" | "compact";
590
+ }
591
+
592
+ declare const AVATAR_DATA: AvatarItem[];
593
+ declare const CTABanner: ({ headline, ctaLabel, ctaHref, avatars, variant, className, ...props }: CTABannerProps) => react_jsx_runtime.JSX.Element;
594
+
595
+ interface DayNightTransitionProps extends HTMLAttributes<HTMLDivElement> {
596
+ /** URL for the daytime background image */
597
+ dayImageUrl: string;
598
+ /** URL for the nighttime background image */
599
+ nightImageUrl: string;
600
+ /** Headline shown in the day state */
601
+ dayHeadline?: string;
602
+ /** Headline shown in the night state */
603
+ nightHeadline?: string;
604
+ /** Description shown in the day state */
605
+ dayDescription?: string;
606
+ /** Description shown in the night state */
607
+ nightDescription?: string;
608
+ /** Label for the CTA button */
609
+ ctaLabel?: string;
610
+ /** href for the CTA button */
611
+ ctaHref?: string;
612
+ }
613
+
614
+ declare const DayNightTransition: ({ dayImageUrl, nightImageUrl, dayHeadline, nightHeadline, dayDescription, nightDescription, ctaLabel, ctaHref, className, ...props }: DayNightTransitionProps) => react_jsx_runtime.JSX.Element;
615
+
616
+ interface LogoItem {
617
+ name: string;
618
+ url: string;
619
+ }
620
+ interface PaymentMethodsProps extends HTMLAttributes<HTMLElement> {
621
+ headline?: string;
622
+ body?: string;
623
+ disclaimer?: string;
624
+ ctaLabel?: string;
625
+ ctaHref?: string;
626
+ col1Logos?: LogoItem[];
627
+ col2Logos?: LogoItem[];
628
+ }
629
+
630
+ declare const COL_ONE_LOGOS: LogoItem[];
631
+ declare const COL_TWO_LOGOS: LogoItem[];
632
+ declare const TEXT_CONTENT: {
633
+ headline: string;
634
+ body: string;
635
+ disclaimer: string;
636
+ ctaLabel: string;
637
+ ctaHref: string;
638
+ };
639
+ declare const PaymentMethods: ({ headline, body, disclaimer, ctaLabel, ctaHref, col1Logos, col2Logos, className, ...props }: PaymentMethodsProps) => react_jsx_runtime.JSX.Element;
640
+
641
+ export { AVATAR_DATA, Accordion, type AccordionProps, type AvatarItem, type AvatarPosition, type AwardItem, BottomSheet, type BottomSheetAction, type BottomSheetProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, type BreadcrumbSize, Button, type ButtonColorScheme, type ButtonIconPosition, type ButtonProps, type ButtonVariant, COL_ONE_LOGOS, COL_TWO_LOGOS, CTABanner, type CTABannerProps, Card, type CardPrimaryStyle, type CardProps, type CardTag, type CardThumbnailType, Chip, ChipDropdown, type ChipDropdownOption, type ChipDropdownProps, type ChipProps, type ChipSize, DayNightTransition, type DayNightTransitionProps, type FeatureCardItem, FeatureCards, type FeatureCardsProps, Footer, type FooterAiSummaryItem, type FooterAiSummaryProps, type FooterAppBadge, type FooterDerivGoProps, type FooterLinkItem, type FooterNavSection, type FooterProps, type FooterSocialLink, Hero, type HeroButtonProps, type HeroProps, type HeroVariant, Link, type LinkColorScheme, type LinkProps, type LogoItem, Pagination, type PaginationProps, PaymentMethods, type PaymentMethodsProps, SCROLLYTELLING_DATA, STEPS_DATA, Scrollytelling, type ScrollytellingItem, type ScrollytellingProps, SearchField, type SearchFieldProps, type SearchFieldStatus, type StatItem, Stats, type StatsProps, type StickyCardItem, type StickyCardTheme, StickyStackedCards, type StickyStackedCardsProps, TEXT_CONTENT, Tag, type TagFontWeight, type TagProps, type TagSize, type TagVariant, TextField, type TextFieldProps, type TextFieldStatus, type TextFieldVariant };