@deriv-web-design/ui 0.1.24 → 0.1.26

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.mjs CHANGED
@@ -2652,6 +2652,13 @@ function DotLottieInView({
2652
2652
  );
2653
2653
  }
2654
2654
 
2655
+ // components/DotLottieInView/lottie-src.ts
2656
+ function isLottieSrc(value) {
2657
+ if (!value) return false;
2658
+ if (/\.lottie(\?|#|$)/i.test(value)) return true;
2659
+ return /\/[^/?#]+\.json(\?|#|$)/i.test(value) && /lottie|cdn\.|website-files/i.test(value);
2660
+ }
2661
+
2655
2662
  // templates/FeatureScroll/FeatureScroll.tsx
2656
2663
  import { jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
2657
2664
  var FEATURE_SCROLL_DATA = [
@@ -2660,42 +2667,42 @@ var FEATURE_SCROLL_DATA = [
2660
2667
  description: "Trade the most popular currency pairs with high leverage, tight spreads, and fast execution.",
2661
2668
  linkLabel: "Learn more",
2662
2669
  link: "/markets/forex",
2663
- mediaUrl: "https://cdn.prod.website-files.com/66fbaad381fa6866fa4991f3/675a906489e5aadf94e501c4_Forex.lottie"
2670
+ mediaUrl: "/lottie/markets/forex.lottie"
2664
2671
  },
2665
2672
  {
2666
2673
  title: "Derived Indices",
2667
2674
  description: "Trade 24/7 on exclusive Synthetic and Derived Indices. Choose volatility levels that match your strategy.",
2668
2675
  linkLabel: "Learn more",
2669
2676
  link: "/markets/derived-indices/synthetic-indices",
2670
- mediaUrl: "https://cdn.prod.website-files.com/66fbaad381fa6866fa4991f3/675a9064588b0d2709e7ceac_Derived%20Indices.lottie"
2677
+ mediaUrl: "/lottie/markets/derived-indices.lottie"
2671
2678
  },
2672
2679
  {
2673
2680
  title: "Stocks",
2674
2681
  description: "Trade global market leaders like Apple, Tesla, and NVIDIA.",
2675
2682
  linkLabel: "Learn more",
2676
2683
  link: "/markets/stocks",
2677
- mediaUrl: "https://cdn.prod.website-files.com/66fbaad381fa6866fa4991f3/675a9064892f97175b724a9c_Stocks.lottie"
2684
+ mediaUrl: "/lottie/markets/stocks.lottie"
2678
2685
  },
2679
2686
  {
2680
2687
  title: "Commodities",
2681
2688
  description: "Trade gold, silver, oil, natural gas, sugar, and more.",
2682
2689
  linkLabel: "Learn more",
2683
2690
  link: "/markets/commodities",
2684
- mediaUrl: "https://cdn.prod.website-files.com/66fbaad381fa6866fa4991f3/675a9064edd96a014a6092cf_Commodities.lottie"
2691
+ mediaUrl: "/lottie/markets/commodities.lottie"
2685
2692
  },
2686
2693
  {
2687
2694
  title: "Cryptos",
2688
2695
  description: "Trade round the clock on the volatility of cryptocurrencies like Bitcoin and Ethereum.",
2689
2696
  linkLabel: "Learn more",
2690
2697
  link: "/markets/cryptocurrencies",
2691
- mediaUrl: "https://cdn.prod.website-files.com/66fbaad381fa6866fa4991f3/675a90647b8d9652a28b94e3_Crypto.lottie"
2698
+ mediaUrl: "/lottie/markets/crypto.lottie"
2692
2699
  },
2693
2700
  {
2694
2701
  title: "Stock Indices",
2695
2702
  description: "Trade offerings that track the top global stock indices.",
2696
2703
  linkLabel: "Learn more",
2697
2704
  link: "/markets/stock-indices",
2698
- mediaUrl: "https://cdn.prod.website-files.com/66fbaad381fa6866fa4991f3/675a9064f2c16e4e0732abfb_Stock%20Indices.lottie"
2705
+ mediaUrl: "/lottie/markets/stock-indices.lottie"
2699
2706
  }
2700
2707
  ];
2701
2708
  var ChevronRight2 = () => /* @__PURE__ */ jsx28(
@@ -2726,7 +2733,7 @@ function mediaSrc(item) {
2726
2733
  function resolveMediaType(item) {
2727
2734
  if (item.mediaType) return item.mediaType;
2728
2735
  const src = mediaSrc(item);
2729
- return src?.split("?")[0].endsWith(".lottie") ? "lottie" : "image";
2736
+ return src && isLottieSrc(src) ? "lottie" : "image";
2730
2737
  }
2731
2738
  var MediaRenderer = ({ item, active, rootMargin, threshold }) => {
2732
2739
  const src = mediaSrc(item);
@@ -3481,6 +3488,18 @@ var CTABanner = ({
3481
3488
  import { useRef as useRef11, useState as useState11, useEffect as useEffect9, useCallback as useCallback2 } from "react";
3482
3489
  import { motion as motion2, AnimatePresence } from "framer-motion";
3483
3490
 
3491
+ // components/Navbar/languageGridVars.ts
3492
+ function resolveLanguageGridVars(itemCount, languageRows) {
3493
+ if (typeof languageRows === "number" && Number.isFinite(languageRows) && languageRows >= 1) {
3494
+ const rows = Math.floor(languageRows);
3495
+ return {
3496
+ "--lang-rows": rows,
3497
+ "--lang-cols": Math.ceil(itemCount / rows)
3498
+ };
3499
+ }
3500
+ return { "--lang-rows": Math.ceil(itemCount / 3) };
3501
+ }
3502
+
3484
3503
  // assets/icon-globe.svg
3485
3504
  var icon_globe_default = 'data:image/svg+xml,<svg width="16" height="24" viewBox="0 0 16 24" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<g clip-path="url(%23clip0_8670_6187)">%0A<path d="M8 18.5C8.21875 18.5 8.84375 18.2812 9.46875 17C9.75 16.4375 10 15.7812 10.1562 15H5.8125C6 15.7812 6.21875 16.4375 6.5 17C7.15625 18.2812 7.75 18.5 8 18.5ZM5.5625 13.5H10.4062C10.4688 13.0312 10.5 12.5312 10.5 12C10.5 11.5 10.4688 11 10.4062 10.5H5.5625C5.5 11 5.5 11.5 5.5 12C5.5 12.5312 5.5 13.0312 5.5625 13.5ZM5.8125 9H10.1562C10 8.25 9.75 7.59375 9.46875 7.03125C8.84375 5.75 8.21875 5.5 8 5.5C7.75 5.5 7.15625 5.75 6.5 7.03125C6.21875 7.59375 6 8.25 5.8125 9ZM11.9062 10.5C11.9688 11 11.9688 11.5 11.9688 12C11.9688 12.5312 11.9688 13.0312 11.9062 13.5H14.3125C14.4375 13.0312 14.5 12.5312 14.5 12C14.5 11.5 14.4375 11 14.3125 10.5H11.9062ZM13.75 9C13.0938 7.71875 12 6.6875 10.6875 6.09375C11.125 6.90625 11.4688 7.90625 11.6875 9H13.75ZM4.28125 9C4.5 7.90625 4.84375 6.90625 5.28125 6.09375C3.96875 6.6875 2.875 7.71875 2.21875 9H4.28125ZM1.65625 10.5C1.5625 11 1.5 11.5 1.5 12C1.5 12.5312 1.53125 13.0312 1.65625 13.5H4.0625C4 13.0312 4 12.5312 4 12C4 11.5 4 11 4.0625 10.5H1.65625ZM10.6875 17.9375C12 17.3438 13.0938 16.3125 13.75 15H11.6875C11.4688 16.125 11.125 17.125 10.6875 17.9375ZM5.28125 17.9375C4.84375 17.125 4.5 16.125 4.28125 15H2.21875C2.875 16.3125 3.96875 17.3438 5.28125 17.9375ZM8 20C5.125 20 2.5 18.5 1.0625 16C-0.375 13.5312 -0.375 10.5 1.0625 8C2.5 5.53125 5.125 4 8 4C10.8438 4 13.4688 5.53125 14.9062 8C16.3438 10.5 16.3438 13.5312 14.9062 16C13.4688 18.5 10.8438 20 8 20Z" fill="%23181C25"/>%0A</g>%0A<defs>%0A<clipPath id="clip0_8670_6187">%0A<rect width="16" height="24" fill="white"/>%0A</clipPath>%0A</defs>%0A</svg>%0A';
3486
3505
 
@@ -3711,6 +3730,7 @@ var Navbar = ({
3711
3730
  languageLabel,
3712
3731
  onLanguageClick,
3713
3732
  languageItems,
3733
+ languageRows,
3714
3734
  activeLanguageCode,
3715
3735
  onLanguageSelect,
3716
3736
  className,
@@ -3911,7 +3931,10 @@ var Navbar = ({
3911
3931
  "div",
3912
3932
  {
3913
3933
  className: "navbar__lang-dropdown-grid",
3914
- style: { "--lang-rows": Math.ceil(languageItems.length / 3) },
3934
+ style: resolveLanguageGridVars(
3935
+ languageItems.length,
3936
+ languageRows
3937
+ ),
3915
3938
  children: languageItems.map((lang) => /* @__PURE__ */ jsx32(
3916
3939
  "button",
3917
3940
  {
@@ -8906,8 +8929,8 @@ function OptionsTypes({
8906
8929
  }
8907
8930
 
8908
8931
  // templates/OptionsTypes/OptionsTypes.data.ts
8909
- var WEBFLOW_CDN = "https://cdn.prod.website-files.com/661e6e1e01dd2f56adc6d370";
8910
8932
  var WEBFLOW_ICON_CDN = "https://cdn.prod.website-files.com/68da5c86c91c54f39c86c2b7";
8933
+ var LOTTIE = "/lottie/trade-clips";
8911
8934
  var FOREX = {
8912
8935
  label: "Forex",
8913
8936
  icon: "forex",
@@ -8961,12 +8984,12 @@ var OPTIONS_TYPES_DIGITAL_CONTENT = {
8961
8984
  {
8962
8985
  id: "rise",
8963
8986
  label: "Rise",
8964
- src: `${WEBFLOW_CDN}/6630e43019db0934b75c5105_Web%20Trade%20Clip%20-%20UpDown%20(Rise).lottie`
8987
+ src: `${LOTTIE}/rise.lottie`
8965
8988
  },
8966
8989
  {
8967
8990
  id: "fall",
8968
8991
  label: "Fall",
8969
- src: `${WEBFLOW_CDN}/6630e42f22255a766c2af8aa_Web%20Trade%20Clip%20-%20UpDown%20(Fall).lottie`
8992
+ src: `${LOTTIE}/fall.lottie`
8970
8993
  }
8971
8994
  ],
8972
8995
  markets: DIGITAL_MARKETS,
@@ -8980,12 +9003,12 @@ var OPTIONS_TYPES_DIGITAL_CONTENT = {
8980
9003
  {
8981
9004
  id: "higher",
8982
9005
  label: "Higher",
8983
- src: `${WEBFLOW_CDN}/6630e42f93f0aa3f60d68dd2_Web%20Trade%20Clip%20-%20UpDown%20(Higher).lottie`
9006
+ src: `${LOTTIE}/higher.lottie`
8984
9007
  },
8985
9008
  {
8986
9009
  id: "lower",
8987
9010
  label: "Lower",
8988
- src: `${WEBFLOW_CDN}/6630e42f8922eb31fcbf275f_Web%20Trade%20Clip%20-%20%20UpDown%20(Lower).lottie`
9011
+ src: `${LOTTIE}/lower.lottie`
8989
9012
  }
8990
9013
  ],
8991
9014
  markets: DIGITAL_MARKETS,
@@ -8999,12 +9022,12 @@ var OPTIONS_TYPES_DIGITAL_CONTENT = {
8999
9022
  {
9000
9023
  id: "touch",
9001
9024
  label: "Touch",
9002
- src: `${WEBFLOW_CDN}/6630e3a120a6dcbe6ab22239_Web%20Trade%20Clip%20-%20TouchNoTouch%20(Touch).lottie`
9025
+ src: `${LOTTIE}/touch.lottie`
9003
9026
  },
9004
9027
  {
9005
9028
  id: "no-touch",
9006
9029
  label: "No Touch",
9007
- src: `${WEBFLOW_CDN}/6630e3a158064e5c58362ddd_Web%20Trade%20Clip%20-%20TouchNoTouch%20(No%20Touch).lottie`
9030
+ src: `${LOTTIE}/no-touch.lottie`
9008
9031
  }
9009
9032
  ],
9010
9033
  markets: DIGITAL_MARKETS,
@@ -9024,7 +9047,7 @@ var OPTIONS_TYPES_ACCUMULATOR_CONTENT = {
9024
9047
  {
9025
9048
  id: "accumulator",
9026
9049
  label: "Accumulator",
9027
- src: `${WEBFLOW_CDN}/6630e0fff230226872ee39ed_Web%20Trade%20Clip%20-%20Accumulators%20(Accumulators).lottie`
9050
+ src: `${LOTTIE}/accumulator.lottie`
9028
9051
  }
9029
9052
  ],
9030
9053
  markets: [DERIVED_INDICES],
@@ -9044,12 +9067,12 @@ var OPTIONS_TYPES_VANILLA_CONTENT = {
9044
9067
  {
9045
9068
  id: "call",
9046
9069
  label: "Call",
9047
- src: `${WEBFLOW_CDN}/6630e3c100c107af706a72f6_Web%20Trade%20Clip%20-%20Vanilla%20(Call).lottie`
9070
+ src: `${LOTTIE}/vanilla-call.lottie`
9048
9071
  },
9049
9072
  {
9050
9073
  id: "put",
9051
9074
  label: "Put",
9052
- src: `${WEBFLOW_CDN}/6630e3c2f230226872f0d58d_Web%20Trade%20Clip%20-%20Vanilla%20(Put).lottie`
9075
+ src: `${LOTTIE}/vanilla-put.lottie`
9053
9076
  }
9054
9077
  ],
9055
9078
  markets: [DERIVED_INDICES],
@@ -9062,19 +9085,19 @@ var OPTIONS_TYPES_TURBO_CONTENT = {
9062
9085
  heading: "How do Turbo Options work",
9063
9086
  items: [
9064
9087
  {
9065
- id: "turbo-up-down",
9066
- title: "Turbo Up/Down",
9067
- description: "Decide whether the market price will stay above (Up) or drop below (Down) a set barrier. Your payout adjusts based on how far the price moves in your chosen direction, letting you take advantage of both rising and falling markets.",
9088
+ id: "turbo-long-short",
9089
+ title: "Turbo Long/Short",
9090
+ description: "Decide whether the market price will stay above (Long) or drop below (Short) a set barrier. Your payout adjusts based on how far the price moves in your chosen direction, letting you take advantage of both rising and falling markets.",
9068
9091
  animations: [
9069
9092
  {
9070
- id: "up",
9071
- label: "Up",
9072
- src: `${WEBFLOW_CDN}/664aff68ca9411ee61c84443_Web%20Trade%20Clip%20(Up).lottie`
9093
+ id: "long",
9094
+ label: "Long",
9095
+ src: `${LOTTIE}/turbo-long.lottie`
9073
9096
  },
9074
9097
  {
9075
- id: "down",
9076
- label: "Down",
9077
- src: `${WEBFLOW_CDN}/664aff6801c5297f6a1f6e6c_Web%20Trade%20Clip%20(Down).lottie`
9098
+ id: "short",
9099
+ label: "Short",
9100
+ src: `${LOTTIE}/turbo-short.lottie`
9078
9101
  }
9079
9102
  ],
9080
9103
  markets: [DERIVED_INDICES],
@@ -9094,12 +9117,12 @@ var OPTIONS_TYPES_MULTIPLIERS_CONTENT = {
9094
9117
  {
9095
9118
  id: "up",
9096
9119
  label: "Up",
9097
- src: `${WEBFLOW_CDN}/6630e305e7f044e7deae8a90_Web%20Trade%20Clip%20-%20Multipliers%20(Up).lottie`
9120
+ src: `${LOTTIE}/multipliers-up.lottie`
9098
9121
  },
9099
9122
  {
9100
9123
  id: "down",
9101
9124
  label: "Down",
9102
- src: `${WEBFLOW_CDN}/6630e3055be526fd74f10190_Web%20Trade%20Clip%20-%20Multipliers%20(Down).lottie`
9125
+ src: `${LOTTIE}/multipliers-down.lottie`
9103
9126
  }
9104
9127
  ],
9105
9128
  markets: [DERIVED_INDICES, FOREX, CRYPTOCURRENCIES, COMMODITIES],
@@ -9119,13 +9142,13 @@ var OPTIONS_TYPES_EU_MULTIPLIERS_CONTENT = {
9119
9142
  {
9120
9143
  id: "up",
9121
9144
  label: "Up",
9122
- src: `${WEBFLOW_CDN}/6630e305e7f044e7deae8a90_Web%20Trade%20Clip%20-%20Multipliers%20(Up).lottie`,
9145
+ src: `${LOTTIE}/multipliers-up.lottie`,
9123
9146
  iconUrl: `${WEBFLOW_ICON_CDN}/68e4859893e33d078096e151_66585fe0e1dc7e70cc75dec1_multipliers-up-sm.svg`
9124
9147
  },
9125
9148
  {
9126
9149
  id: "down",
9127
9150
  label: "Down",
9128
- src: `${WEBFLOW_CDN}/6630e3055be526fd74f10190_Web%20Trade%20Clip%20-%20Multipliers%20(Down).lottie`,
9151
+ src: `${LOTTIE}/multipliers-down.lottie`,
9129
9152
  iconUrl: `${WEBFLOW_ICON_CDN}/68e4859893e33d078096e155_66585fe0e1dc7e70cc75dee8_multipliers-down-sm.svg`
9130
9153
  }
9131
9154
  ]
@@ -9490,15 +9513,15 @@ var LinkModal = ({
9490
9513
  }
9491
9514
  };
9492
9515
  if (!open || typeof document === "undefined") return null;
9493
- const rootClass = ["lm", className].filter(Boolean).join(" ");
9516
+ const rootClass = ["lkm", className].filter(Boolean).join(" ");
9494
9517
  return createPortal2(
9495
9518
  /* @__PURE__ */ jsxs63("div", { className: rootClass, onClick: onClose, children: [
9496
- /* @__PURE__ */ jsx67("div", { className: "lm__scrim", "aria-hidden": "true" }),
9519
+ /* @__PURE__ */ jsx67("div", { className: "lkm__scrim", "aria-hidden": "true" }),
9497
9520
  /* @__PURE__ */ jsxs63(
9498
9521
  "div",
9499
9522
  {
9500
9523
  ref: panelRef,
9501
- className: "lm__panel",
9524
+ className: "lkm__panel",
9502
9525
  role: "dialog",
9503
9526
  "aria-modal": "true",
9504
9527
  "aria-labelledby": titleId,
@@ -9511,14 +9534,14 @@ var LinkModal = ({
9511
9534
  "button",
9512
9535
  {
9513
9536
  type: "button",
9514
- className: "lm__close",
9537
+ className: "lkm__close",
9515
9538
  onClick: onClose,
9516
9539
  "aria-label": closeLabel,
9517
9540
  children: /* @__PURE__ */ jsx67(XMarkIcon3, {})
9518
9541
  }
9519
9542
  ),
9520
- /* @__PURE__ */ jsx67(HeadingTag, { id: titleId, className: "lm__title", children: title }),
9521
- children && /* @__PURE__ */ jsx67("div", { className: "lm__body", children })
9543
+ /* @__PURE__ */ jsx67(HeadingTag, { id: titleId, className: "lkm__title", children: title }),
9544
+ children && /* @__PURE__ */ jsx67("div", { className: "lkm__body", children })
9522
9545
  ]
9523
9546
  }
9524
9547
  )
@@ -9855,6 +9878,7 @@ export {
9855
9878
  Tiers,
9856
9879
  TradingCalculator,
9857
9880
  TradingCalculatorHowTo,
9858
- dayNightTransitionV2Preset
9881
+ dayNightTransitionV2Preset,
9882
+ isLottieSrc
9859
9883
  };
9860
9884
  //# sourceMappingURL=index.mjs.map