@orderly.network/markets 3.0.4-alpha.4 → 3.1.0-alpha.0

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
@@ -601,7 +601,7 @@ var init_marketsHeader_ui = __esm({
601
601
  value: tvl
602
602
  }
603
603
  ];
604
- }, [total24Amount, totalOpenInterest, tvl]);
604
+ }, [t, total24Amount, totalOpenInterest, tvl]);
605
605
  return /* @__PURE__ */ jsx(
606
606
  Flex,
607
607
  {
@@ -672,7 +672,7 @@ var init_marketsHeader_ui = __esm({
672
672
  size: "xs",
673
673
  weight: "semibold",
674
674
  dp: item.quote_dp,
675
- className: "oui-tabular-nums oui-text-right",
675
+ className: "oui-tabular-nums oui-text-end",
676
676
  children: item["24h_close"]
677
677
  }
678
678
  ) }),
@@ -684,7 +684,7 @@ var init_marketsHeader_ui = __esm({
684
684
  size: "xs",
685
685
  weight: "semibold",
686
686
  showIdentifier: true,
687
- className: "oui-tabular-nums oui-text-right",
687
+ className: "oui-tabular-nums oui-text-end",
688
688
  children: item.change
689
689
  }
690
690
  ) })
@@ -1027,7 +1027,7 @@ var init_marketsHeader_mobile_ui = __esm({
1027
1027
  value: tvl
1028
1028
  }
1029
1029
  ];
1030
- }, [total24Amount, totalOpenInterest, tvl]);
1030
+ }, [t, total24Amount, totalOpenInterest, tvl]);
1031
1031
  return /* @__PURE__ */ jsx(
1032
1032
  Flex,
1033
1033
  {
@@ -1041,7 +1041,7 @@ var init_marketsHeader_mobile_ui = __esm({
1041
1041
  {
1042
1042
  ...item,
1043
1043
  className: cn(
1044
- index !== list.length - 1 && "oui-border-r oui-border-line-6"
1044
+ index !== list.length - 1 && "oui-border-e oui-border-line-6"
1045
1045
  )
1046
1046
  },
1047
1047
  `item-${index}`
@@ -1101,7 +1101,7 @@ var init_marketsHeader_mobile_ui = __esm({
1101
1101
  size: "xs",
1102
1102
  weight: "semibold",
1103
1103
  dp: item.quote_dp,
1104
- className: "oui-tabular-nums oui-text-right",
1104
+ className: "oui-tabular-nums oui-text-end",
1105
1105
  children: item["24h_close"]
1106
1106
  }
1107
1107
  ) }),
@@ -1113,7 +1113,7 @@ var init_marketsHeader_mobile_ui = __esm({
1113
1113
  size: "xs",
1114
1114
  weight: "semibold",
1115
1115
  showIdentifier: true,
1116
- className: "oui-tabular-nums oui-text-right",
1116
+ className: "oui-tabular-nums oui-text-end",
1117
1117
  children: item.change
1118
1118
  }
1119
1119
  ) })
@@ -1369,7 +1369,7 @@ var init_favoritesDropdownMenu_ui = __esm({
1369
1369
  onValueChange,
1370
1370
  classNames: {
1371
1371
  root: cn(
1372
- "oui-ml-px oui-h-7 oui-w-full oui-rounded-sm oui-bg-base-6",
1372
+ "oui-ms-px oui-h-7 oui-w-full oui-rounded-sm oui-bg-base-6",
1373
1373
  overLen && "focus-within:oui-outline-danger focus-visible:oui-outline-danger"
1374
1374
  )
1375
1375
  },
@@ -1681,7 +1681,7 @@ function getSymbolColumn(favorite, isFavoriteList = false, options) {
1681
1681
  height: 12,
1682
1682
  justify: "center",
1683
1683
  itemAlign: "center",
1684
- className: "oui-mr-1 oui-cursor-pointer",
1684
+ className: "oui-me-1 oui-cursor-pointer",
1685
1685
  children: record.isFavorite ? /* @__PURE__ */ jsx(FavoritesIcon2, { className: "oui-size-3" }) : /* @__PURE__ */ jsx(UnFavoritesIcon2, { className: "oui-size-3" })
1686
1686
  }
1687
1687
  ) });
@@ -1803,7 +1803,7 @@ function getLastAnd24hPercentageColumn(favorite, isFavoriteList = false) {
1803
1803
  "div",
1804
1804
  {
1805
1805
  className: cn(
1806
- "oui-absolute oui-right-0 oui-top-[6.5px]",
1806
+ "oui-absolute oui-end-0 oui-top-[6.5px]",
1807
1807
  "oui-hidden group-hover:oui-block"
1808
1808
  ),
1809
1809
  children: /* @__PURE__ */ jsxs(
@@ -1873,13 +1873,12 @@ var init_column = __esm({
1873
1873
  init_symbolDisplay();
1874
1874
  }
1875
1875
  });
1876
-
1877
- // src/components/sideMarkets/column.tsx
1878
1876
  var useSideMarketsColumns;
1879
1877
  var init_column2 = __esm({
1880
1878
  "src/components/sideMarkets/column.tsx"() {
1881
1879
  init_column();
1882
1880
  useSideMarketsColumns = (favorite, isFavoriteList = false) => {
1881
+ useTranslation();
1883
1882
  const symbolCol = getSymbolColumn(favorite, isFavoriteList, {
1884
1883
  stackLeverageInSecondRow: true
1885
1884
  });
@@ -2187,7 +2186,7 @@ var init_favoritesEmpty = __esm({
2187
2186
  /* @__PURE__ */ jsx(
2188
2187
  PlusIcon,
2189
2188
  {
2190
- className: "oui-mr-1 oui-text-base-contrast",
2189
+ className: "oui-me-1 oui-text-base-contrast",
2191
2190
  opacity: 1,
2192
2191
  size: 12
2193
2192
  }
@@ -2425,6 +2424,51 @@ var init_favoritesTabs_ui = __esm({
2425
2424
  };
2426
2425
  }
2427
2426
  });
2427
+ function getRTLScrollType() {
2428
+ if (cachedRTLScrollType) {
2429
+ return cachedRTLScrollType;
2430
+ }
2431
+ if (typeof document === "undefined" || !document.body) {
2432
+ cachedRTLScrollType = "negative";
2433
+ return cachedRTLScrollType;
2434
+ }
2435
+ const outer = document.createElement("div");
2436
+ const inner = document.createElement("div");
2437
+ outer.dir = "rtl";
2438
+ outer.style.width = "4px";
2439
+ outer.style.height = "1px";
2440
+ outer.style.overflow = "scroll";
2441
+ outer.style.visibility = "hidden";
2442
+ outer.style.position = "absolute";
2443
+ outer.style.top = "-9999px";
2444
+ inner.style.width = "8px";
2445
+ inner.style.height = "1px";
2446
+ outer.appendChild(inner);
2447
+ document.body.appendChild(outer);
2448
+ if (outer.scrollLeft > 0) {
2449
+ cachedRTLScrollType = "default";
2450
+ } else {
2451
+ outer.scrollLeft = 1;
2452
+ cachedRTLScrollType = outer.scrollLeft === 0 ? "negative" : "reverse";
2453
+ }
2454
+ document.body.removeChild(outer);
2455
+ return cachedRTLScrollType;
2456
+ }
2457
+ function getScrollLeftForLogicalOffset(element, offset) {
2458
+ const max = Math.max(element.scrollWidth - element.clientWidth, 0);
2459
+ const nextOffset = Math.min(Math.max(offset, 0), max);
2460
+ if (getComputedStyle(element).direction !== "rtl") {
2461
+ return nextOffset;
2462
+ }
2463
+ switch (getRTLScrollType()) {
2464
+ case "negative":
2465
+ return -nextOffset;
2466
+ case "default":
2467
+ return max - nextOffset;
2468
+ case "reverse":
2469
+ return nextOffset;
2470
+ }
2471
+ }
2428
2472
  function useFavoritesTabScript(options) {
2429
2473
  const { favorite, size = "default" } = options;
2430
2474
  const {
@@ -2454,7 +2498,11 @@ function useFavoritesTabScript(options) {
2454
2498
  const scrollToRight = () => {
2455
2499
  setTimeout(() => {
2456
2500
  if (scrollView.current) {
2457
- scrollView.current.scrollLeft = scrollView.current.scrollWidth - scrollView.current.clientWidth;
2501
+ const logicalEnd = scrollView.current.scrollWidth - scrollView.current.clientWidth;
2502
+ scrollView.current.scrollLeft = getScrollLeftForLogicalOffset(
2503
+ scrollView.current,
2504
+ logicalEnd
2505
+ );
2458
2506
  }
2459
2507
  }, 0);
2460
2508
  };
@@ -2529,8 +2577,10 @@ function useFavoritesTabScript(options) {
2529
2577
  scrollable
2530
2578
  };
2531
2579
  }
2580
+ var cachedRTLScrollType;
2532
2581
  var init_favoritesTabs_script = __esm({
2533
2582
  "src/components/favoritesTabs/favoritesTabs.script.ts"() {
2583
+ cachedRTLScrollType = null;
2534
2584
  }
2535
2585
  });
2536
2586
  var FavoritesTabWidget;
@@ -2637,9 +2687,9 @@ function resolveSuffix(suffix) {
2637
2687
  return void 0;
2638
2688
  }
2639
2689
  if (typeof suffix === "string") {
2640
- return /* @__PURE__ */ jsx("span", { className: "oui-ml-1 oui-inline-flex oui-items-center oui-rounded oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)] oui-px-2", children: /* @__PURE__ */ jsx(GradientText, { color: "brand", children: suffix }) });
2690
+ return /* @__PURE__ */ jsx("span", { className: "oui-ms-1 oui-inline-flex oui-items-center oui-rounded oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)] oui-px-2", children: /* @__PURE__ */ jsx(GradientText, { color: "brand", children: suffix }) });
2641
2691
  }
2642
- return /* @__PURE__ */ jsx("span", { className: "oui-ml-1", children: suffix });
2692
+ return /* @__PURE__ */ jsx("span", { className: "oui-ms-1", children: suffix });
2643
2693
  }
2644
2694
  function composeTabTitle(label, options) {
2645
2695
  const icon = options?.icon;
@@ -2754,7 +2804,7 @@ var init_marketsDataList_mobile_ui = __esm({
2754
2804
  getLastAnd24hPercentageColumn(favorite, isFavoriteList)
2755
2805
  ];
2756
2806
  },
2757
- []
2807
+ [t]
2758
2808
  );
2759
2809
  const { getFavoritesProps } = useFavoritesProps();
2760
2810
  const builtInMeta = useMemo(
@@ -3482,7 +3532,7 @@ var init_marketsDataList_ui = __esm({
3482
3532
  classNames: {
3483
3533
  tabsList: "oui-tabs-markets-list",
3484
3534
  tabsContent: "oui-tabs-markets-content",
3485
- scrollIndicator: "oui-mr-3"
3535
+ scrollIndicator: "oui-me-3"
3486
3536
  },
3487
3537
  className: "oui-markets-list-tabs",
3488
3538
  showScrollIndicator: true,
@@ -3980,7 +4030,7 @@ var init_columns = __esm({
3980
4030
  dataIndex: "symbol",
3981
4031
  onSort: true,
3982
4032
  width: 180,
3983
- className: isMobile ? "oui-pl-0" : void 0,
4033
+ className: isMobile ? "oui-ps-0" : void 0,
3984
4034
  render: (value, record) => {
3985
4035
  if (isMobile) {
3986
4036
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", gapY: 1, children: [
@@ -4371,7 +4421,7 @@ var init_columns2 = __esm({
4371
4421
  dataIndex: "symbol",
4372
4422
  width: 220,
4373
4423
  onSort: true,
4374
- className: isMobile ? "oui-pl-0" : void 0,
4424
+ className: isMobile ? "oui-ps-0" : void 0,
4375
4425
  render: (value, record) => {
4376
4426
  if (isMobile) {
4377
4427
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", gapY: 1, children: [
@@ -4697,7 +4747,7 @@ var init_column4 = __esm({
4697
4747
  e.stopPropagation();
4698
4748
  };
4699
4749
  const iconCls = "oui-w-4 oui-h-4 oui-text-base-contrast-54 hover:oui-text-base-contrast";
4700
- const actions = /* @__PURE__ */ jsx("div", { className: cn("oui-absolute oui-right-1 oui-top-[3px]"), children: /* @__PURE__ */ jsxs(
4750
+ const actions = /* @__PURE__ */ jsx("div", { className: cn("oui-absolute oui-end-1 oui-top-[3px]"), children: /* @__PURE__ */ jsxs(
4701
4751
  Flex,
4702
4752
  {
4703
4753
  className: cn(
@@ -5085,12 +5135,12 @@ var init_marketItem_ui = __esm({
5085
5135
  {
5086
5136
  direction: "row",
5087
5137
  className: cn(
5088
- "oui-mr-3 oui-h-[18px] oui-shrink-0 oui-cursor-pointer oui-items-center oui-rounded",
5138
+ "oui-me-3 oui-h-[18px] oui-shrink-0 oui-cursor-pointer oui-items-center oui-rounded",
5089
5139
  "oui-transition-all oui-duration-200"
5090
5140
  ),
5091
5141
  onClick: handleClick,
5092
5142
  children: [
5093
- /* @__PURE__ */ jsxs(Flex, { gapX: 1, itemAlign: "center", className: "oui-mr-[6px]", children: [
5143
+ /* @__PURE__ */ jsxs(Flex, { gapX: 1, itemAlign: "center", className: "oui-me-[6px]", children: [
5094
5144
  /* @__PURE__ */ jsx(TokenIcon, { symbol, className: "oui-size-[18px]" }),
5095
5145
  /* @__PURE__ */ jsx(
5096
5146
  SymbolDisplay,
@@ -5102,7 +5152,7 @@ var init_marketItem_ui = __esm({
5102
5152
  }
5103
5153
  )
5104
5154
  ] }),
5105
- /* @__PURE__ */ jsx(Flex, { gapX: 1, className: "oui-mr-[6px]", children: /* @__PURE__ */ jsx(
5155
+ /* @__PURE__ */ jsx(Flex, { gapX: 1, className: "oui-me-[6px]", children: /* @__PURE__ */ jsx(
5106
5156
  Text.numeral,
5107
5157
  {
5108
5158
  dp: tickerData.quote_dp || 2,
@@ -5111,7 +5161,7 @@ var init_marketItem_ui = __esm({
5111
5161
  children: tickerData["24h_close"]
5112
5162
  }
5113
5163
  ) }),
5114
- /* @__PURE__ */ jsx(Flex, { gapX: 1, className: "oui-mr-3", children: /* @__PURE__ */ jsx(
5164
+ /* @__PURE__ */ jsx(Flex, { gapX: 1, className: "oui-me-3", children: /* @__PURE__ */ jsx(
5115
5165
  Text.numeral,
5116
5166
  {
5117
5167
  rule: "percentages",
@@ -5226,7 +5276,7 @@ var init_marketTypeFilter_ui = __esm({
5226
5276
  Box,
5227
5277
  {
5228
5278
  className: cn(
5229
- "oui-absolute oui-left-0 oui-z-50",
5279
+ "oui-absolute oui-start-0 oui-z-50",
5230
5280
  "oui-bg-base-9 oui-border oui-border-line-6 oui-rounded-[12px]",
5231
5281
  "oui-shadow-lg oui-w-[320px] oui-p-5",
5232
5282
  // animation
@@ -5268,7 +5318,7 @@ var init_marketTypeFilter_ui = __esm({
5268
5318
  {
5269
5319
  htmlFor: htmlId,
5270
5320
  className: cn(
5271
- "oui-text-2xs oui-ml-1",
5321
+ "oui-text-2xs oui-ms-1",
5272
5322
  "oui-break-normal oui-whitespace-nowrap oui-cursor-pointer"
5273
5323
  ),
5274
5324
  children: getOptionLabel(tab)
@@ -5328,7 +5378,7 @@ var init_marketTypeFilter_ui = __esm({
5328
5378
  {
5329
5379
  htmlFor: htmlId,
5330
5380
  className: cn(
5331
- "oui-text-2xs oui-ml-1",
5381
+ "oui-text-2xs oui-ms-1",
5332
5382
  "oui-break-normal oui-whitespace-nowrap oui-cursor-pointer"
5333
5383
  ),
5334
5384
  children: tab.name
@@ -6293,7 +6343,7 @@ var CountdownText = (props) => {
6293
6343
  return /* @__PURE__ */ jsxs("span", { className: "oui-text-base-contrast oui-px-1", children: [
6294
6344
  days > 0 ? /* @__PURE__ */ jsxs("span", { children: [
6295
6345
  daysStr,
6296
- /* @__PURE__ */ jsx("span", { className: "oui-text-base-contrast-54 oui-mr-1 oui-ml-[2px]", children: t("common.dayShort") })
6346
+ /* @__PURE__ */ jsx("span", { className: "oui-text-base-contrast-54 oui-me-1 oui-ms-[2px]", children: t("common.dayShort") })
6297
6347
  ] }) : "",
6298
6348
  hoursStr,
6299
6349
  ":",
@@ -6705,7 +6755,7 @@ var SymbolInfoBarFull = (props) => {
6705
6755
  height: 12,
6706
6756
  justify: "center",
6707
6757
  itemAlign: "center",
6708
- className: "oui-mr-1 oui-cursor-pointer",
6758
+ className: "oui-me-1 oui-cursor-pointer",
6709
6759
  children: isFavorite ? /* @__PURE__ */ jsx(FavoritesIcon2, { className: "oui-size-3 oui-text-warning-darken" }) : /* @__PURE__ */ jsx(UnFavoritesIcon2, { className: "oui-size-3 oui-text-base-contrast-36 hover:oui-text-warning-darken" })
6710
6760
  }
6711
6761
  ) }) });
@@ -6894,9 +6944,9 @@ var ScrollIndicator2 = (props) => {
6894
6944
  },
6895
6945
  className: cn(
6896
6946
  "oui-flex oui-w-[80px] oui-items-center",
6897
- "oui-absolute oui-inset-y-0 oui-rounded-l",
6898
- leading && "oui-left-0 oui-pl-1",
6899
- tailing && "oui-right-0 oui-rotate-180 oui-pr-1"
6947
+ "oui-absolute oui-inset-y-0 oui-rounded-s",
6948
+ leading && "oui-start-0 oui-ps-1",
6949
+ tailing && "oui-end-0 oui-rotate-180 oui-pe-1"
6900
6950
  ),
6901
6951
  children: /* @__PURE__ */ jsx(ArrowLeftIcon, { className: "oui-text-base-contrast-54 hover:oui-text-base-contrast-80" })
6902
6952
  }
@@ -6932,7 +6982,7 @@ var RwaCountdown = ({ closeCountdown, isRwa, open, closeTimeInterval }) => {
6932
6982
  r: "lg",
6933
6983
  className: "oui-w-full oui-text-warning-darken oui-bg-warning-darken/15 oui-flex-1 oui-my-2 oui-text-sm",
6934
6984
  children: [
6935
- /* @__PURE__ */ jsxs(Flex, { className: "oui-w-full oui-pr-2", children: [
6985
+ /* @__PURE__ */ jsxs(Flex, { className: "oui-w-full oui-pe-2", children: [
6936
6986
  /* @__PURE__ */ jsx(NewsFillIcon, { className: "oui-text-warning-darken", size: 16 }),
6937
6987
  /* @__PURE__ */ jsxs(Flex, { children: [
6938
6988
  t("trading.rwa.countdown.title"),
@@ -7587,7 +7637,7 @@ var MarketsMobileContent = (props) => {
7587
7637
  leading: props.navProps?.leftNav && /* @__PURE__ */ jsx(
7588
7638
  LeftNavUI,
7589
7639
  {
7590
- className: "-oui-mr-4 oui-ml-3",
7640
+ className: "-oui-me-4 oui-ms-3",
7591
7641
  ...props?.navProps?.leftNav,
7592
7642
  logo: props?.navProps?.logo,
7593
7643
  routerAdapter: props?.navProps?.routerAdapter