@orderly.network/markets 3.0.4-alpha.2 → 3.0.4-alpha.4

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
@@ -66,16 +66,28 @@ var init_rwaDotTooltip = __esm({
66
66
  return /* @__PURE__ */ jsx(
67
67
  Tooltip,
68
68
  {
69
+ className: "oui-pointer-events-none",
70
+ disableHoverableContent: true,
69
71
  content: /* @__PURE__ */ jsx(Text, { color: isInTradingHours ? "success" : "danger", children: isInTradingHours ? t("trading.rwa.marketHours") : t("trading.rwa.outsideMarketHours") }),
70
- children: /* @__PURE__ */ jsx(Box, { py: 2, px: 1, children: /* @__PURE__ */ jsx(
72
+ children: /* @__PURE__ */ jsx(
71
73
  Box,
72
74
  {
73
- width: 4,
74
- height: 4,
75
- r: "full",
76
- className: isInTradingHours ? "oui-bg-success" : "oui-bg-danger"
75
+ as: "span",
76
+ py: 2,
77
+ px: 1,
78
+ className: "oui-inline-flex oui-shrink-0 oui-items-center",
79
+ children: /* @__PURE__ */ jsx(
80
+ Box,
81
+ {
82
+ as: "span",
83
+ width: 4,
84
+ height: 4,
85
+ r: "full",
86
+ className: isInTradingHours ? "oui-bg-success" : "oui-bg-danger"
87
+ }
88
+ )
77
89
  }
78
- ) })
90
+ )
79
91
  }
80
92
  );
81
93
  };
@@ -104,7 +116,7 @@ var init_symbolDisplay = __esm({
104
116
  const symbol = children;
105
117
  const symbolsInfo = useSymbolsInfo();
106
118
  const displayName = symbolsInfo[symbol]("displayName");
107
- const suffix = record?.isRwa || showBadge ? /* @__PURE__ */ jsxs(Flex, { gapX: 0, itemAlign: "center", children: [
119
+ const suffix = record?.isRwa || showBadge ? /* @__PURE__ */ jsxs(Flex, { as: "span", display: "inlineFlex", gapX: 0, itemAlign: "center", children: [
108
120
  record?.isRwa && /* @__PURE__ */ jsx(RwaDotTooltip, { record }),
109
121
  showBadge && /* @__PURE__ */ jsx(SymbolBadge, { symbol })
110
122
  ] }) : null;
@@ -494,7 +506,7 @@ var init_marketsHeader_ui = __esm({
494
506
  } = props;
495
507
  const { onSymbolChange } = useMarketsContext();
496
508
  const { t } = useTranslation();
497
- const cls3 = cn(
509
+ const cls2 = cn(
498
510
  "oui-min-w-0 oui-flex-[0_0_calc((100%_-_32px)_/_3)] 3xl:oui-flex-[0_0_calc((100%_-_48px)_/_4)]",
499
511
  enableScroll && "oui-cursor-pointer oui-select-none"
500
512
  );
@@ -516,7 +528,7 @@ var init_marketsHeader_ui = __esm({
516
528
  total24Amount,
517
529
  totalOpenInterest,
518
530
  tvl,
519
- className: cls3
531
+ className: cls2
520
532
  }
521
533
  ),
522
534
  /* @__PURE__ */ jsx(
@@ -524,7 +536,7 @@ var init_marketsHeader_ui = __esm({
524
536
  {
525
537
  data: news,
526
538
  title: /* @__PURE__ */ jsx(Text.gradient, { color: "brand", children: t("markets.newListings") }),
527
- className: cls3,
539
+ className: cls2,
528
540
  onSymbol
529
541
  }
530
542
  ),
@@ -533,7 +545,7 @@ var init_marketsHeader_ui = __esm({
533
545
  {
534
546
  data: gainers,
535
547
  title: /* @__PURE__ */ jsx(Text, { className: "oui-text-success-light", children: t("markets.topGainers") }),
536
- className: cls3,
548
+ className: cls2,
537
549
  onSymbol
538
550
  }
539
551
  ),
@@ -542,7 +554,7 @@ var init_marketsHeader_ui = __esm({
542
554
  {
543
555
  data: losers,
544
556
  title: /* @__PURE__ */ jsx(Text, { className: "oui-text-danger-light", children: t("markets.topLosers") }),
545
- className: cls3,
557
+ className: cls2,
546
558
  onSymbol
547
559
  }
548
560
  )
@@ -638,29 +650,33 @@ var init_marketsHeader_ui = __esm({
638
650
  ListItem = (props) => {
639
651
  const { item } = props;
640
652
  return /* @__PURE__ */ jsxs(
641
- Flex,
653
+ Box,
642
654
  {
643
655
  width: "100%",
644
- gapX: 3,
645
656
  py: 2,
646
657
  px: 4,
647
- className: cn("oui-cursor-pointer hover:oui-bg-base-8", props.className),
658
+ className: cn(
659
+ "oui-grid oui-grid-cols-[minmax(0,1fr)_96px_72px] oui-items-center oui-gap-x-3",
660
+ "oui-cursor-pointer hover:oui-bg-base-8",
661
+ props.className
662
+ ),
648
663
  onClick: () => {
649
664
  props.onSymbol(item);
650
665
  },
651
666
  children: [
652
- /* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", showIcon: true, className: "oui-w-full", children: item.symbol }),
653
- /* @__PURE__ */ jsx(Flex, { width: "100%", justify: "end", children: /* @__PURE__ */ jsx(
667
+ /* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", showIcon: true, className: "oui-min-w-0", children: item.symbol }),
668
+ /* @__PURE__ */ jsx(Flex, { justify: "end", children: /* @__PURE__ */ jsx(
654
669
  Text.numeral,
655
670
  {
656
671
  currency: "$",
657
672
  size: "xs",
658
673
  weight: "semibold",
659
674
  dp: item.quote_dp,
675
+ className: "oui-tabular-nums oui-text-right",
660
676
  children: item["24h_close"]
661
677
  }
662
678
  ) }),
663
- /* @__PURE__ */ jsx(Flex, { width: "100%", justify: "end", children: /* @__PURE__ */ jsx(
679
+ /* @__PURE__ */ jsx(Flex, { justify: "end", children: /* @__PURE__ */ jsx(
664
680
  Text.numeral,
665
681
  {
666
682
  rule: "percentages",
@@ -668,6 +684,7 @@ var init_marketsHeader_ui = __esm({
668
684
  size: "xs",
669
685
  weight: "semibold",
670
686
  showIdentifier: true,
687
+ className: "oui-tabular-nums oui-text-right",
671
688
  children: item.change
672
689
  }
673
690
  ) })
@@ -1062,29 +1079,33 @@ var init_marketsHeader_mobile_ui = __esm({
1062
1079
  ListItem2 = (props) => {
1063
1080
  const { item } = props;
1064
1081
  return /* @__PURE__ */ jsxs(
1065
- Flex,
1082
+ Box,
1066
1083
  {
1067
1084
  width: "100%",
1068
- gapX: 3,
1069
1085
  py: 2,
1070
1086
  px: 4,
1071
- className: cn("oui-cursor-pointer hover:oui-bg-base-8", props.className),
1087
+ className: cn(
1088
+ "oui-grid oui-grid-cols-[minmax(0,1fr)_96px_72px] oui-items-center oui-gap-x-3",
1089
+ "oui-cursor-pointer hover:oui-bg-base-8",
1090
+ props.className
1091
+ ),
1072
1092
  onClick: () => {
1073
1093
  props.onSymbol(item);
1074
1094
  },
1075
1095
  children: [
1076
- /* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", showIcon: true, className: "oui-w-full", children: item.symbol }),
1077
- /* @__PURE__ */ jsx(Flex, { width: "100%", justify: "end", children: /* @__PURE__ */ jsx(
1096
+ /* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", showIcon: true, className: "oui-min-w-0", children: item.symbol }),
1097
+ /* @__PURE__ */ jsx(Flex, { justify: "end", children: /* @__PURE__ */ jsx(
1078
1098
  Text.numeral,
1079
1099
  {
1080
1100
  currency: "$",
1081
1101
  size: "xs",
1082
1102
  weight: "semibold",
1083
1103
  dp: item.quote_dp,
1104
+ className: "oui-tabular-nums oui-text-right",
1084
1105
  children: item["24h_close"]
1085
1106
  }
1086
1107
  ) }),
1087
- /* @__PURE__ */ jsx(Flex, { width: "100%", justify: "end", children: /* @__PURE__ */ jsx(
1108
+ /* @__PURE__ */ jsx(Flex, { justify: "end", children: /* @__PURE__ */ jsx(
1088
1109
  Text.numeral,
1089
1110
  {
1090
1111
  rule: "percentages",
@@ -1092,6 +1113,7 @@ var init_marketsHeader_mobile_ui = __esm({
1092
1113
  size: "xs",
1093
1114
  weight: "semibold",
1094
1115
  showIdentifier: true,
1116
+ className: "oui-tabular-nums oui-text-right",
1095
1117
  children: item.change
1096
1118
  }
1097
1119
  ) })
@@ -1647,6 +1669,7 @@ function getSymbolColumn(favorite, isFavoriteList = false, options) {
1647
1669
  title: i18n.t("common.symbol"),
1648
1670
  dataIndex: "symbol",
1649
1671
  width: 150,
1672
+ className: "oui-z-10",
1650
1673
  onSort: true,
1651
1674
  render: (value, record) => {
1652
1675
  let favoritesIcon;
@@ -3583,7 +3606,7 @@ var init_marketsDataList = __esm({
3583
3606
  init_marketsDataList_ui();
3584
3607
  }
3585
3608
  });
3586
- var LazySearchInput2, LazyMarketsListWidget, cls, ExpandMarkets;
3609
+ var LazySearchInput2, LazyMarketsListWidget, expandListTableClassNames, ExpandMarketsListPanel, ExpandMarkets;
3587
3610
  var init_expandMarkets_ui = __esm({
3588
3611
  "src/components/expandMarkets/expandMarkets.ui.tsx"() {
3589
3612
  init_useCommunityTabs();
@@ -3603,7 +3626,17 @@ var init_expandMarkets_ui = __esm({
3603
3626
  return { default: mod.MarketsListWidget };
3604
3627
  })
3605
3628
  );
3606
- cls = "oui-h-full";
3629
+ expandListTableClassNames = {
3630
+ root: cn(
3631
+ "oui-expandMarkets-list",
3632
+ /** min-w-0: flex/grid descendants may shrink so table-fixed + w-full respect parent width. */
3633
+ "oui-flex oui-min-h-0 oui-w-full oui-min-w-0 oui-max-w-full oui-flex-1 oui-flex-col"
3634
+ ),
3635
+ scroll: cn("oui-min-h-0 oui-w-full oui-min-w-0 oui-max-w-full oui-flex-1")
3636
+ };
3637
+ ExpandMarketsListPanel = ({
3638
+ children
3639
+ }) => /* @__PURE__ */ jsx("div", { className: "oui-flex oui-size-full oui-min-h-0 oui-min-w-0 oui-flex-col", children: /* @__PURE__ */ jsx("div", { className: "oui-flex oui-min-h-0 oui-w-full oui-min-w-0 oui-flex-1 oui-flex-col oui-overflow-hidden", children }) });
3607
3640
  ExpandMarkets = (props) => {
3608
3641
  const { activeTab, onTabChange, tabSort, onTabSort } = props;
3609
3642
  const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
@@ -3612,15 +3645,16 @@ var init_expandMarkets_ui = __esm({
3612
3645
  const tabDataFilters = useCustomTabDataFilters(tabs);
3613
3646
  const renderBuiltInContent = (type) => {
3614
3647
  const tabType = type;
3615
- return /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3648
+ return /* @__PURE__ */ jsx(ExpandMarketsListPanel, { children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3616
3649
  LazyMarketsListWidget,
3617
3650
  {
3618
3651
  type: tabType,
3619
3652
  initialSort: tabSort[type],
3620
3653
  onSort: onTabSort(tabType),
3621
3654
  tableClassNames: {
3622
- root: "oui-expandMarkets-list",
3655
+ root: expandListTableClassNames.root,
3623
3656
  scroll: cn(
3657
+ expandListTableClassNames.scroll,
3624
3658
  "oui-px-1",
3625
3659
  tabType === "favorites" /* Favorites */ ? "oui-pb-9" : "oui-pb-2"
3626
3660
  )
@@ -3642,19 +3676,27 @@ var init_expandMarkets_ui = __esm({
3642
3676
  storageKey: "orderly_expand_markets_community_sel_sub_tab",
3643
3677
  classNames: {
3644
3678
  tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
3645
- tabsContent: "oui-h-full"
3679
+ tabsListContainer: "oui-shrink-0",
3680
+ tabsContent: "oui-min-h-0 oui-min-w-0 oui-w-full oui-flex-1 oui-overflow-hidden"
3646
3681
  },
3647
- className: cn("oui-expandMarkets-community-tabs", cls),
3682
+ className: cn(
3683
+ "oui-expandMarkets-community-tabs",
3684
+ "oui-flex oui-size-full oui-min-h-0 oui-min-w-0 oui-flex-col"
3685
+ ),
3648
3686
  showScrollIndicator: true,
3649
- renderPanel: (selected) => /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3687
+ renderPanel: (selected) => /* @__PURE__ */ jsx(ExpandMarketsListPanel, { children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3650
3688
  LazyMarketsListWidget,
3651
3689
  {
3652
3690
  type: "all" /* All */,
3653
3691
  initialSort: tabSort["community" /* Community */],
3654
3692
  onSort: onTabSort("community" /* Community */),
3655
3693
  tableClassNames: {
3656
- root: "oui-expandMarkets-list",
3657
- scroll: cn("oui-px-1", "oui-pb-2")
3694
+ root: expandListTableClassNames.root,
3695
+ scroll: cn(
3696
+ expandListTableClassNames.scroll,
3697
+ "oui-px-1",
3698
+ "oui-pb-2"
3699
+ )
3658
3700
  },
3659
3701
  dataFilter: createCommunityBrokerFilter(selected)
3660
3702
  }
@@ -3663,7 +3705,7 @@ var init_expandMarkets_ui = __esm({
3663
3705
  );
3664
3706
  };
3665
3707
  const renderCustomContent = (key) => {
3666
- return /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3708
+ return /* @__PURE__ */ jsx(ExpandMarketsListPanel, { children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3667
3709
  LazyMarketsListWidget,
3668
3710
  {
3669
3711
  type: "all" /* All */,
@@ -3671,8 +3713,12 @@ var init_expandMarkets_ui = __esm({
3671
3713
  initialSort: tabSort[key],
3672
3714
  onSort: onTabSort(key),
3673
3715
  tableClassNames: {
3674
- root: "oui-expandMarkets-list",
3675
- scroll: cn("oui-px-1", "oui-pb-2")
3716
+ root: expandListTableClassNames.root,
3717
+ scroll: cn(
3718
+ expandListTableClassNames.scroll,
3719
+ "oui-px-1",
3720
+ "oui-pb-2"
3721
+ )
3676
3722
  }
3677
3723
  }
3678
3724
  ) }) });
@@ -3682,7 +3728,8 @@ var init_expandMarkets_ui = __esm({
3682
3728
  {
3683
3729
  className: cn(
3684
3730
  "oui-markets-expandMarkets",
3685
- "oui-overflow-hidden oui-font-semibold"
3731
+ /** Search row + tabs/list: second row minmax(0,1fr) passes a bounded height into Tabs. */
3732
+ "oui-grid oui-size-full oui-min-h-0 oui-min-w-0 oui-grid-rows-[auto_minmax(0,1fr)] oui-overflow-hidden oui-font-semibold"
3686
3733
  ),
3687
3734
  height: "100%",
3688
3735
  children: [
@@ -3700,11 +3747,17 @@ var init_expandMarkets_ui = __esm({
3700
3747
  value: activeTab,
3701
3748
  onValueChange: onTabChange,
3702
3749
  classNames: {
3750
+ /** Keep tab row from shrinking when Tabs root is a column flex container. */
3751
+ tabsListContainer: "oui-shrink-0",
3703
3752
  tabsList: cn("oui-my-[6px]"),
3704
- tabsContent: "oui-h-full",
3753
+ /** Occupy remaining height under triggers; inner ExpandMarketsListPanel supplies flex column. */
3754
+ tabsContent: "oui-min-h-0 oui-min-w-0 oui-w-full oui-flex-1 oui-overflow-hidden",
3705
3755
  scrollIndicator: "oui-mx-3"
3706
3756
  },
3707
- className: cn("oui-expandMarkets-tabs", cls),
3757
+ className: cn(
3758
+ "oui-expandMarkets-tabs",
3759
+ "oui-flex oui-size-full oui-min-h-0 oui-min-w-0 oui-flex-col"
3760
+ ),
3708
3761
  showScrollIndicator: true,
3709
3762
  children: tabs?.map((tab, index) => {
3710
3763
  const key = tabKey(tab, index);
@@ -4607,6 +4660,7 @@ var init_sideMarkets_ui = __esm({
4607
4660
  {
4608
4661
  width: "100%",
4609
4662
  height: "100%",
4663
+ className: cn(className, "oui-min-h-0 oui-min-w-0 oui-max-w-full"),
4610
4664
  children: renderContent()
4611
4665
  }
4612
4666
  );
@@ -4765,12 +4819,12 @@ var init_dropDownMarkets_ui = __esm({
4765
4819
  }
4766
4820
  )
4767
4821
  ] });
4768
- const cls3 = "oui-h-[calc(100%_-_36px)]";
4822
+ const cls2 = "oui-h-[calc(100%_-_36px)]";
4769
4823
  const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
4770
4824
  const { tabs } = useMarketsContext();
4771
4825
  const tabDataFilters = useCustomTabDataFilters(tabs);
4772
4826
  const renderBuiltInContent = (tabType) => {
4773
- return /* @__PURE__ */ jsx("div", { className: cls3, children: /* @__PURE__ */ jsx(
4827
+ return /* @__PURE__ */ jsx("div", { className: cls2, children: /* @__PURE__ */ jsx(
4774
4828
  MarketsListWidget,
4775
4829
  {
4776
4830
  type: tabType,
@@ -4801,9 +4855,9 @@ var init_dropDownMarkets_ui = __esm({
4801
4855
  tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
4802
4856
  tabsContent: "oui-h-full"
4803
4857
  },
4804
- className: cn("oui-dropDownMarkets-community-tabs", cls3),
4858
+ className: cn("oui-dropDownMarkets-community-tabs", cls2),
4805
4859
  showScrollIndicator: true,
4806
- renderPanel: (selected) => /* @__PURE__ */ jsx("div", { className: cls3, children: /* @__PURE__ */ jsx(
4860
+ renderPanel: (selected) => /* @__PURE__ */ jsx("div", { className: cls2, children: /* @__PURE__ */ jsx(
4807
4861
  MarketsListWidget,
4808
4862
  {
4809
4863
  type: "all" /* All */,
@@ -4822,7 +4876,7 @@ var init_dropDownMarkets_ui = __esm({
4822
4876
  );
4823
4877
  };
4824
4878
  const renderCustomContent = (key) => {
4825
- return /* @__PURE__ */ jsx("div", { className: cls3, children: /* @__PURE__ */ jsx(
4879
+ return /* @__PURE__ */ jsx("div", { className: cls2, children: /* @__PURE__ */ jsx(
4826
4880
  MarketsListWidget,
4827
4881
  {
4828
4882
  type: "all" /* All */,
@@ -4862,7 +4916,7 @@ var init_dropDownMarkets_ui = __esm({
4862
4916
  tabsContent: "oui-h-full",
4863
4917
  scrollIndicator: "oui-mx-0"
4864
4918
  },
4865
- className: cn("oui-dropDownMarkets-tabs", cls3),
4919
+ className: cn("oui-dropDownMarkets-tabs", cls2),
4866
4920
  showScrollIndicator: true,
4867
4921
  children: tabs?.map((tab, index) => {
4868
4922
  const key = tabKey(tab, index);
@@ -5615,7 +5669,7 @@ var TABLE_CLASSNAMES = {
5615
5669
  var LazySearchInput3 = React6.lazy(
5616
5670
  () => Promise.resolve().then(() => (init_searchInput(), searchInput_exports)).then((mod) => ({ default: mod.SearchInput }))
5617
5671
  );
5618
- var cls2 = "oui-h-[calc(100%_-_36px)]";
5672
+ var cls = "oui-h-[calc(100%_-_36px)]";
5619
5673
  var MarketTabPanel = ({
5620
5674
  type,
5621
5675
  getColumns,
@@ -5625,7 +5679,7 @@ var MarketTabPanel = ({
5625
5679
  renderHeader,
5626
5680
  emptyView
5627
5681
  }) => {
5628
- return /* @__PURE__ */ jsx("div", { className: cls2, children: /* @__PURE__ */ jsx(
5682
+ return /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(
5629
5683
  MarketsListWidget,
5630
5684
  {
5631
5685
  type,
@@ -5701,7 +5755,7 @@ var SubMenuMarkets = (props) => {
5701
5755
  tabsContent: "oui-h-full",
5702
5756
  scrollIndicator: "oui-mx-1"
5703
5757
  },
5704
- className: cn("oui-subMenuMarkets-community-tabs", cls2),
5758
+ className: cn("oui-subMenuMarkets-community-tabs", cls),
5705
5759
  showScrollIndicator: true,
5706
5760
  renderPanel: (selected) => /* @__PURE__ */ jsx(
5707
5761
  MarketTabPanel,
@@ -5717,7 +5771,7 @@ var SubMenuMarkets = (props) => {
5717
5771
  );
5718
5772
  };
5719
5773
  const renderCustomContent = (key) => {
5720
- return /* @__PURE__ */ jsx("div", { className: cls2, children: /* @__PURE__ */ jsx(
5774
+ return /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(
5721
5775
  MarketsListWidget,
5722
5776
  {
5723
5777
  type: "all" /* All */,
@@ -5752,7 +5806,7 @@ var SubMenuMarkets = (props) => {
5752
5806
  tabsContent: "oui-h-full",
5753
5807
  scrollIndicator: "oui-mx-1"
5754
5808
  },
5755
- className: cn(cls2, "oui-subMenuMarkets-tabs oui-my-1.5"),
5809
+ className: cn(cls, "oui-subMenuMarkets-tabs oui-my-1.5"),
5756
5810
  showScrollIndicator: true,
5757
5811
  children: tabs?.map((tab, index) => {
5758
5812
  const key = tabKey(tab, index);