@deriv-web-design/ui 0.1.26 → 0.1.28

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.
@@ -5822,8 +5822,8 @@
5822
5822
  "name": "Sticky Market Cards",
5823
5823
  "component": "StickyMarketCards",
5824
5824
  "category": "cards",
5825
- "description": "Scroll-driven stack of overlapping, text-first market cards that pile up via position sticky, scaling and dimming as each card slides over the previous one.",
5826
- "purpose": "A scroll-driven stack of overlapping, text-first market cards. Each card piles on top of the previous one via `position: sticky` as the user scrolls, scaling down and dimming the card underneath for a layered depth effect. This block is designed to showcase a list of markets, products, or benefits one at a time as the user scrolls, with a maximum of 4 cards visibly stacked at once regardless of total count.",
5825
+ "description": "Scroll-driven stack of overlapping market cards that pile up via position sticky, scaling and dimming as each card slides over the previous one. Default cards use a tinted background image; the lottie variant places a manual-play animation beside stacked title and copy (tactical indices).",
5826
+ "purpose": "A scroll-driven stack of overlapping, text-first market cards. Each card piles on top of the previous one via `position: sticky` as the user scrolls, scaling down and dimming the card underneath for a layered depth effect. This block is designed to showcase a list of markets, products, or benefits one at a time as the user scrolls, with a maximum of 4 cards visibly stacked at once regardless of total count. The `lottie` variant swaps the background image for a manual-play animation panel beside the copy — the same pattern as tactical indices cards on the live site.",
5827
5827
  "keywords": [
5828
5828
  "sticky",
5829
5829
  "cards",
@@ -5837,7 +5837,10 @@
5837
5837
  "synthetics",
5838
5838
  "cfd",
5839
5839
  "trading",
5840
- "deriv"
5840
+ "deriv",
5841
+ "lottie",
5842
+ "tactical",
5843
+ "animation"
5841
5844
  ],
5842
5845
  "sectionType": "sticky-cards",
5843
5846
  "global": false,
@@ -5846,10 +5849,12 @@
5846
5849
  "items"
5847
5850
  ],
5848
5851
  "optionalFields": [
5849
- "sectionDescription"
5852
+ "sectionDescription",
5853
+ "variant"
5850
5854
  ],
5851
5855
  "variants": [
5852
- "default"
5856
+ "default",
5857
+ "lottie"
5853
5858
  ],
5854
5859
  "recommendedPosition": 3,
5855
5860
  "placement": [
@@ -5868,15 +5873,21 @@
5868
5873
  "cardImage": true,
5869
5874
  "cardThemes": true,
5870
5875
  "scrollAnimation": true,
5876
+ "lottie": true,
5877
+ "manualPlayback": true,
5871
5878
  "primaryButton": false,
5872
5879
  "secondaryButton": false,
5873
5880
  "badge": false,
5874
5881
  "avatar": false
5875
5882
  },
5876
5883
  "imageRoles": [
5877
- "card-background"
5884
+ "card-background",
5885
+ "animation",
5886
+ "poster"
5878
5887
  ],
5879
- "defaultValues": {},
5888
+ "defaultValues": {
5889
+ "variant": "default"
5890
+ },
5880
5891
  "fields": {
5881
5892
  "items": {
5882
5893
  "type": "array",
@@ -5885,11 +5896,22 @@
5885
5896
  "description": {
5886
5897
  "type": "string",
5887
5898
  "required": true,
5888
- "maxLength": 150
5899
+ "maxLength": 300
5889
5900
  },
5890
5901
  "imageUrl": {
5891
5902
  "type": "image",
5892
- "required": false
5903
+ "required": false,
5904
+ "description": "Background image for the default variant. Ignored when variant is \"lottie\"."
5905
+ },
5906
+ "lottiePosterUrl": {
5907
+ "type": "image",
5908
+ "required": false,
5909
+ "description": "Optional still frame while the Lottie is paused or loading."
5910
+ },
5911
+ "lottieSrc": {
5912
+ "type": "string",
5913
+ "required": false,
5914
+ "description": "`.lottie` URL for the media panel when variant is \"lottie\"."
5893
5915
  },
5894
5916
  "theme": {
5895
5917
  "type": "string",
@@ -5919,6 +5941,16 @@
5919
5941
  "type": "string",
5920
5942
  "required": true,
5921
5943
  "maxLength": 80
5944
+ },
5945
+ "variant": {
5946
+ "type": "string",
5947
+ "required": false,
5948
+ "default": "default",
5949
+ "enum": [
5950
+ "default",
5951
+ "lottie"
5952
+ ],
5953
+ "description": "Card layout mode. \"default\" uses a background image with title | description columns; \"lottie\" uses a solid theme card with a manual-play Lottie panel and stacked copy (tactical-indices)."
5922
5954
  }
5923
5955
  }
5924
5956
  },
@@ -3357,7 +3357,17 @@
3357
3357
  "imageUrl": {
3358
3358
  "type": "string",
3359
3359
  "required": false,
3360
- "description": "URL of the card's hero image."
3360
+ "description": "URL of the card's hero image (default variant). Ignored when the section `variant` is `\"lottie\"`."
3361
+ },
3362
+ "lottiePosterUrl": {
3363
+ "type": "string",
3364
+ "required": false,
3365
+ "description": "Optional still frame shown while the Lottie is paused / loading (`variant: \"lottie\"` only)."
3366
+ },
3367
+ "lottieSrc": {
3368
+ "type": "string",
3369
+ "required": false,
3370
+ "description": "`.lottie` (or animation-hosting `.json`) URL for the card media panel. Used when the section `variant` is `\"lottie\"`."
3361
3371
  },
3362
3372
  "theme": {
3363
3373
  "type": "StickyMarketCardTheme",
@@ -3380,6 +3390,12 @@
3380
3390
  "type": "string",
3381
3391
  "required": true,
3382
3392
  "description": "Section heading rendered as H2"
3393
+ },
3394
+ "variant": {
3395
+ "type": "StickyMarketCardsVariant",
3396
+ "required": false,
3397
+ "description": "Card layout mode.",
3398
+ "default": "default"
3383
3399
  }
3384
3400
  }
3385
3401
  },
package/dist/index.css CHANGED
@@ -6326,6 +6326,15 @@
6326
6326
  246,
6327
6327
  247,
6328
6328
  248;
6329
+ --smc-lottie-min-height: 18.75rem;
6330
+ --smc-lottie-aspect: 1312 / 854;
6331
+ --smc-lottie-panel-bg: transparent;
6332
+ --smc-lottie-radius: var(--radius-xl);
6333
+ --smc-lottie-gap: var(--spacing-32);
6334
+ --smc-control-bg: var(--color-slate-50);
6335
+ --smc-control-color: var(--color-slate-1200);
6336
+ --smc-scrim: rgb(0 0 0 / 10%);
6337
+ --smc-focus: var(--border-focus);
6329
6338
  }
6330
6339
  .smc {
6331
6340
  width: 100%;
@@ -6460,6 +6469,106 @@
6460
6469
  .smc__card-desc-wrap {
6461
6470
  flex: 1;
6462
6471
  }
6472
+ .smc__card-inner--lottie {
6473
+ padding: var(--smc-lottie-gap);
6474
+ min-height: var(--smc-lottie-min-height);
6475
+ align-items: stretch;
6476
+ }
6477
+ .smc__card-content--lottie {
6478
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
6479
+ align-items: stretch;
6480
+ gap: var(--smc-lottie-gap);
6481
+ }
6482
+ .smc__card-text {
6483
+ display: flex;
6484
+ flex-direction: column;
6485
+ justify-content: flex-start;
6486
+ align-items: flex-start;
6487
+ gap: var(--spacing-16);
6488
+ height: 100%;
6489
+ min-width: 0;
6490
+ }
6491
+ .smc__lottie {
6492
+ position: relative;
6493
+ isolation: isolate;
6494
+ align-self: start;
6495
+ width: 100%;
6496
+ min-width: 0;
6497
+ aspect-ratio: var(--smc-lottie-aspect);
6498
+ overflow: hidden;
6499
+ border-radius: var(--smc-lottie-radius);
6500
+ background-color: var(--smc-lottie-panel-bg);
6501
+ }
6502
+ .smc__lottie-media {
6503
+ position: absolute;
6504
+ z-index: 1;
6505
+ inset: 0;
6506
+ }
6507
+ .smc__lottie-media > *,
6508
+ .smc__lottie-player {
6509
+ width: 100% !important;
6510
+ height: 100% !important;
6511
+ }
6512
+ .smc__lottie-player {
6513
+ display: flex !important;
6514
+ align-items: stretch !important;
6515
+ justify-content: stretch !important;
6516
+ }
6517
+ .smc__lottie-media canvas,
6518
+ .smc__lottie-player canvas {
6519
+ width: 100% !important;
6520
+ height: 100% !important;
6521
+ display: block;
6522
+ }
6523
+ .smc__lottie-media img,
6524
+ .smc__lottie-poster {
6525
+ width: 100%;
6526
+ height: 100%;
6527
+ object-fit: cover;
6528
+ object-position: center;
6529
+ }
6530
+ .smc__lottie-poster {
6531
+ position: absolute;
6532
+ z-index: 2;
6533
+ inset: 0;
6534
+ }
6535
+ .smc__playback-toggle {
6536
+ position: absolute;
6537
+ z-index: 3;
6538
+ display: grid;
6539
+ inset: 0;
6540
+ padding: 0;
6541
+ place-items: center;
6542
+ border: 0;
6543
+ background: var(--smc-scrim);
6544
+ cursor: pointer;
6545
+ }
6546
+ .smc__playback-toggle--playing {
6547
+ background: transparent;
6548
+ }
6549
+ .smc__playback-toggle:focus-visible {
6550
+ outline: 2px solid var(--smc-focus);
6551
+ outline-offset: -4px;
6552
+ }
6553
+ .smc__control-icon {
6554
+ width: 64px;
6555
+ height: 64px;
6556
+ transition: opacity 150ms ease;
6557
+ }
6558
+ .smc__playback-toggle--playing .smc__control-icon {
6559
+ opacity: 0;
6560
+ }
6561
+ .smc__playback-toggle--playing:hover .smc__control-icon,
6562
+ .smc__playback-toggle--playing:focus-visible .smc__control-icon {
6563
+ opacity: 1;
6564
+ }
6565
+ .smc__control-disc {
6566
+ fill: var(--smc-control-bg);
6567
+ fill-opacity: 0.88;
6568
+ }
6569
+ .smc__control-glyph {
6570
+ fill: var(--smc-control-color);
6571
+ }
6463
6572
  .smc__card-title {
6464
6573
  margin: 0;
6465
6574
  font-family: var(--font-family-base);
@@ -6481,11 +6590,18 @@
6481
6590
  .smc__card-inner {
6482
6591
  padding: var(--spacing-24) var(--spacing-32);
6483
6592
  }
6593
+ .smc__card-inner--lottie {
6594
+ padding: var(--spacing-24);
6595
+ }
6484
6596
  .smc__card-content {
6485
6597
  grid-template-columns: 1fr;
6486
6598
  align-items: flex-start;
6487
6599
  gap: var(--spacing-24);
6488
6600
  }
6601
+ .smc__card-content--lottie {
6602
+ grid-template-columns: 1fr;
6603
+ gap: var(--spacing-24);
6604
+ }
6489
6605
  }
6490
6606
 
6491
6607
  /* templates/Table/Table.css */