@loafmarkets/ui 0.1.370 → 0.1.372

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
@@ -7,6 +7,7 @@ import { twMerge } from 'tailwind-merge';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import styled10, { keyframes, css } from 'styled-components';
9
9
  import * as ReactDOM from 'react-dom';
10
+ import { createPortal } from 'react-dom';
10
11
  import { Newspaper } from 'lucide-react';
11
12
  import * as LightweightCharts from 'lightweight-charts';
12
13
  import { MdKingBed, MdBathtub, MdDirectionsCar, MdPool, MdYard, MdFitnessCenter } from 'react-icons/md';
@@ -1874,6 +1875,7 @@ var Orderbook = React5.forwardRef(
1874
1875
  amountPrecision = 2,
1875
1876
  defaultTab = "orderbook",
1876
1877
  onTabChange,
1878
+ showTradesTab = true,
1877
1879
  rightHeader,
1878
1880
  variant = "auto",
1879
1881
  userOrderPrices,
@@ -1887,7 +1889,9 @@ var Orderbook = React5.forwardRef(
1887
1889
  ...props
1888
1890
  }, ref) => {
1889
1891
  const resolvedRightHeader = rightHeader ?? /* @__PURE__ */ jsx(LoafLiquidityBadge, { className: "text-[0.6rem] orderbook-ll-badge", onClick: onLoafLiquidityClick });
1890
- const [tab, setTab] = React5.useState(defaultTab);
1892
+ const [tab, setTabState] = React5.useState(defaultTab);
1893
+ const setTab = setTabState;
1894
+ const effectiveTab = showTradesTab ? tab : "orderbook";
1891
1895
  const [tradeFilter, setTradeFilter] = React5.useState("all");
1892
1896
  const viewportCompact = useViewportCompact(COMPACT_BREAKPOINT_PX);
1893
1897
  const { userAskPrices, userBidPrices } = React5.useMemo(() => {
@@ -1981,7 +1985,8 @@ var Orderbook = React5.forwardRef(
1981
1985
  const midClass = midChangePercent == null ? "text-white" : midChangePercent >= 0 ? "text-[#0ecb81]" : "text-[#f6465d]";
1982
1986
  const tradeFiltered = trades.filter((t) => tradeFilter === "all" || t.type === tradeFilter);
1983
1987
  const layoutProps = {
1984
- tab,
1988
+ tab: effectiveTab,
1989
+ showTradesTab,
1985
1990
  handleTab,
1986
1991
  tradeFilter,
1987
1992
  setTradeFilter,
@@ -2058,6 +2063,7 @@ function SkeletonRow({ compact }) {
2058
2063
  }
2059
2064
  function DesktopOrderbookLayout({
2060
2065
  tab,
2066
+ showTradesTab = true,
2061
2067
  handleTab,
2062
2068
  tradeFilter,
2063
2069
  setTradeFilter,
@@ -2107,7 +2113,7 @@ function DesktopOrderbookLayout({
2107
2113
  ]
2108
2114
  }
2109
2115
  ),
2110
- /* @__PURE__ */ jsxs(
2116
+ showTradesTab ? /* @__PURE__ */ jsxs(
2111
2117
  "button",
2112
2118
  {
2113
2119
  type: "button",
@@ -2121,7 +2127,7 @@ function DesktopOrderbookLayout({
2121
2127
  tab === "trades" ? /* @__PURE__ */ jsx("span", { className: "absolute -bottom-px left-0 h-[2px] w-full bg-[#E6C87E]" }) : null
2122
2128
  ]
2123
2129
  }
2124
- )
2130
+ ) : null
2125
2131
  ] }),
2126
2132
  tab === "trades" ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs", children: [
2127
2133
  /* @__PURE__ */ jsx(
@@ -2260,6 +2266,7 @@ function DesktopOrderbookLayout({
2260
2266
  }
2261
2267
  function MobileOrderbookLayout({
2262
2268
  tab,
2269
+ showTradesTab = true,
2263
2270
  handleTab,
2264
2271
  tradeFilter,
2265
2272
  setTradeFilter,
@@ -2308,7 +2315,7 @@ function MobileOrderbookLayout({
2308
2315
  children: "Orderbook"
2309
2316
  }
2310
2317
  ),
2311
- /* @__PURE__ */ jsx(
2318
+ showTradesTab ? /* @__PURE__ */ jsx(
2312
2319
  "span",
2313
2320
  {
2314
2321
  onClick: () => handleTab("trades"),
@@ -2322,7 +2329,7 @@ function MobileOrderbookLayout({
2322
2329
  },
2323
2330
  children: "Trades"
2324
2331
  }
2325
- )
2332
+ ) : null
2326
2333
  ] }),
2327
2334
  tab === "trades" ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 text-[0.6rem] text-white/70", children: ["all", "buy", "sell"].map((filter) => /* @__PURE__ */ jsx(
2328
2335
  "button",
@@ -5353,7 +5360,7 @@ var Header = ({
5353
5360
  return /* @__PURE__ */ jsxs(Fragment, { children: [
5354
5361
  /* @__PURE__ */ jsx(SafeAreaCover, {}),
5355
5362
  /* @__PURE__ */ jsx(Overlay, { $isOpen: isMobileMenuOpen, onClick: () => setIsMobileMenuOpen(false) }),
5356
- /* @__PURE__ */ jsxs(HeaderContainer, { id: "loaf-header", $bgOpacity: headerBgOpacity, children: [
5363
+ /* @__PURE__ */ jsxs(HeaderContainer, { id: "loaf-header", $bgOpacity: headerBgOpacity, $menuOpen: isMobileMenuOpen, children: [
5357
5364
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
5358
5365
  /* @__PURE__ */ jsxs(Logo, { children: [
5359
5366
  /* @__PURE__ */ jsx(LogoLink, { href: logoHref ?? resolvedHomePath, onClick: handleLogoNavigation, children: /* @__PURE__ */ jsx("img", { src: Loaf_logo_Banner_default, alt: "LOAF Logo" }) }),
@@ -5784,7 +5791,8 @@ var Overlay = styled10.div`
5784
5791
  height: 100%;
5785
5792
  background-color: rgba(0, 0, 0, 0.7);
5786
5793
  backdrop-filter: blur(3px);
5787
- z-index: 970;
5794
+ /* Above the trade page's sticky/console layers (z 2000) + close modal (10001). */
5795
+ z-index: 10070;
5788
5796
  `;
5789
5797
  var MobileOnlyButton = styled10.button.attrs({ type: "button" })`
5790
5798
  display: none;
@@ -5832,7 +5840,11 @@ var HeaderContainer = styled10.header`
5832
5840
  top: 0;
5833
5841
  left: 0;
5834
5842
  right: 0;
5835
- z-index: 1000;
5843
+ /* Normally 1000. When the mobile menu is open, lift the whole header
5844
+ (and the Nav drawer trapped inside its stacking context) above the
5845
+ backdrop Overlay (10070) AND the trade page's modal layers (10001) so
5846
+ the drawer renders on top instead of being dimmed by the backdrop. */
5847
+ z-index: ${({ $menuOpen }) => $menuOpen ? 10075 : 1e3};
5836
5848
  width: 100%;
5837
5849
  /* Fallback min-height for browsers that can't evaluate calc+env */
5838
5850
  min-height: 56px;
@@ -5926,7 +5938,8 @@ var Nav = styled10.nav`
5926
5938
  max-width: 100%;
5927
5939
  height: calc(100dvh - var(--loaf-menu-top, calc(56px + max(env(safe-area-inset-top, 0px), var(--telegram-safe-top, 0px)))));
5928
5940
  background: rgb(17, 17, 19);
5929
- z-index: 980;
5941
+ /* Above the trade page's sticky/console layers (z 2000) + close modal (10001). */
5942
+ z-index: 10080;
5930
5943
  /* Gentle fade + slide-down instead of an abrupt slide-in. */
5931
5944
  opacity: ${(props) => props.$isOpen ? "1" : "0"};
5932
5945
  transform: ${(props) => props.$isOpen ? "translateY(0)" : "translateY(-14px)"};
@@ -5946,7 +5959,7 @@ var Nav = styled10.nav`
5946
5959
  align-items: center;
5947
5960
  justify-content: center;
5948
5961
  min-height: 100%;
5949
- padding: 2rem 1.5rem 2.5rem;
5962
+ padding: 3.5rem 1.5rem 2.5rem;
5950
5963
  gap: 0.4rem;
5951
5964
  }
5952
5965
  }
@@ -7162,8 +7175,8 @@ var LoginPopup = ({
7162
7175
  /* @__PURE__ */ jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
7163
7176
  /* @__PURE__ */ jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
7164
7177
  ] }) }),
7165
- /* @__PURE__ */ jsx(KycHeading, { children: "Verify Your Identity" }),
7166
- /* @__PURE__ */ jsx(KycSubline, { children: "Initial offerings are only available to verified investors" }),
7178
+ /* @__PURE__ */ jsx(KycHeading, { children: "Verify Wholesale Status" }),
7179
+ /* @__PURE__ */ jsx(KycSubline, { children: "Initial offerings are only available to accredited or wholesale investors" }),
7167
7180
  /* @__PURE__ */ jsx(KycStartButton, { type: "button", onClick: handleKycStart, disabled: kycLoading, children: kycLoading ? "Verifying\u2026" : kycStatusProp === "PENDING" || kycStatusProp === "ON_HOLD" ? "Resume Verification" : "Start Verification" }),
7168
7181
  /* @__PURE__ */ jsx(KycDuration, { children: "Takes about 2 minutes" }),
7169
7182
  /* @__PURE__ */ jsx(KycDivider, {}),
@@ -7249,7 +7262,7 @@ var LoginPopup = ({
7249
7262
  /* @__PURE__ */ jsx("div", { style: { color: "rgba(255,255,255,0.5)", fontSize: "0.8rem" }, children: "Deposit USDC from an exchange or wallet" })
7250
7263
  ] })
7251
7264
  ] }),
7252
- /* @__PURE__ */ jsxs(ModalOptionCard, { onClick: handleFiatFund, disabled: fiatFundingLoading, children: [
7265
+ /* @__PURE__ */ jsxs(ModalOptionCard, { onClick: handleFiatFund, disabled: true, children: [
7253
7266
  /* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", style: { color: "rgba(255,255,255,0.6)", flexShrink: 0 }, children: [
7254
7267
  /* @__PURE__ */ jsx("line", { x1: "3", y1: "22", x2: "21", y2: "22" }),
7255
7268
  /* @__PURE__ */ jsx("line", { x1: "6", y1: "18", x2: "6", y2: "11" }),
@@ -7259,7 +7272,10 @@ var LoginPopup = ({
7259
7272
  /* @__PURE__ */ jsx("polygon", { points: "12 2 20 7 4 7" })
7260
7273
  ] }),
7261
7274
  /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
7262
- /* @__PURE__ */ jsx("div", { style: { color: "#fff", fontWeight: 600, fontSize: "0.95rem", marginBottom: "0.25rem" }, children: fiatFundingLoading ? "Loading widget\u2026" : "Bank Deposit" }),
7275
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "0.25rem" }, children: [
7276
+ /* @__PURE__ */ jsx("span", { style: { color: "#fff", fontWeight: 600, fontSize: "0.95rem" }, children: fiatFundingLoading ? "Loading widget\u2026" : "Bank Deposit" }),
7277
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "0.6rem", fontWeight: 700, color: "#E6C87E", background: "rgba(230,198,86,0.12)", padding: "0.12rem 0.4rem", borderRadius: "4px", textTransform: "uppercase", letterSpacing: "0.04em", whiteSpace: "nowrap" }, children: "Coming Soon" })
7278
+ ] }),
7263
7279
  /* @__PURE__ */ jsx("div", { style: { color: "rgba(255,255,255,0.5)", fontSize: "0.8rem" }, children: "Deposit to your account via card or bank transfer" })
7264
7280
  ] })
7265
7281
  ] })
@@ -11846,7 +11862,8 @@ function AssetSelectorBar({
11846
11862
  onSelect,
11847
11863
  trailing,
11848
11864
  imageUrl,
11849
- badgeLabel
11865
+ badgeLabel,
11866
+ tickerPrimary
11850
11867
  }) {
11851
11868
  const [isDropdownOpen, setIsDropdownOpen] = useState(false);
11852
11869
  const hasItems = selectorItems && selectorItems.length > 0;
@@ -11857,9 +11874,14 @@ function AssetSelectorBar({
11857
11874
  ];
11858
11875
  return /* @__PURE__ */ jsx(AssetSelectorWrapper, { children: /* @__PURE__ */ jsxs(IPOAssetSelector, { children: [
11859
11876
  imageUrl && /* @__PURE__ */ jsx(AssetThumbnail, { src: imageUrl, alt: propertyName }),
11860
- /* @__PURE__ */ jsx(AssetSelectorDropdown, { onClick: () => hasItems && setIsDropdownOpen((prev) => !prev), children: /* @__PURE__ */ jsxs(AssetName, { children: [
11861
- propertyName,
11862
- currentTicker ? ` (${currentTicker.toUpperCase()})` : "",
11877
+ /* @__PURE__ */ jsx(AssetSelectorDropdown, { $flush: tickerPrimary, onClick: () => hasItems && setIsDropdownOpen((prev) => !prev), children: /* @__PURE__ */ jsxs(AssetName, { children: [
11878
+ tickerPrimary && currentTicker ? /* @__PURE__ */ jsxs(AssetIdentity, { children: [
11879
+ /* @__PURE__ */ jsx(AssetTicker, { children: currentTicker.toUpperCase() }),
11880
+ /* @__PURE__ */ jsx(AssetSubName, { children: propertyName })
11881
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
11882
+ propertyName,
11883
+ currentTicker ? ` (${currentTicker.toUpperCase()})` : ""
11884
+ ] }),
11863
11885
  badgeLabel && /* @__PURE__ */ jsx(CompetitionBadge, { children: badgeLabel }),
11864
11886
  hasItems && /* @__PURE__ */ jsx(
11865
11887
  "svg",
@@ -11888,7 +11910,7 @@ function AssetSelectorBar({
11888
11910
  ] })
11889
11911
  ] })
11890
11912
  ] }, m.label)) }),
11891
- trailing != null && /* @__PURE__ */ jsx(TrailingWrapper, { children: /* @__PURE__ */ jsx(TrailingInner, { children: trailing }) }),
11913
+ trailing != null && /* @__PURE__ */ jsx(TrailingWrapper, { className: "asset-bar-trailing", children: /* @__PURE__ */ jsx(TrailingInner, { children: trailing }) }),
11892
11914
  isDropdownOpen && hasItems && /* @__PURE__ */ jsx(IPODropdown, { children: selectorItems.map((item) => {
11893
11915
  const isCurrent = item.tokenName === currentTokenName;
11894
11916
  const status = item.status?.toUpperCase();
@@ -11979,13 +12001,40 @@ var AssetSelectorDropdown = styled10.div`
11979
12001
  display: flex;
11980
12002
  align-items: center;
11981
12003
  cursor: pointer;
11982
- padding: 0.5rem;
12004
+ /* $flush (tickerPrimary): no horizontal padding / no hover box, so opening the
12005
+ selector doesn't make the ticker appear shoved right by the highlight box. */
12006
+ padding: ${(p) => p.$flush ? "0.25rem 0" : "0.5rem"};
11983
12007
  border-radius: 8px;
11984
- transition: all 0.2s ease;
12008
+ transition: ${(p) => p.$flush ? "none" : "all 0.2s ease"};
11985
12009
  flex: 0 1 auto;
11986
12010
  min-width: 0;
11987
12011
  overflow: hidden;
11988
- &:hover { background-color: rgba(255,255,255,0.05); }
12012
+ &:hover { background-color: ${(p) => p.$flush ? "transparent" : "rgba(255,255,255,0.05)"}; }
12013
+ `;
12014
+ var AssetIdentity = styled10.div`
12015
+ display: flex;
12016
+ flex-direction: column;
12017
+ min-width: 0;
12018
+ line-height: 1.2;
12019
+ `;
12020
+ var AssetTicker = styled10.span`
12021
+ font-weight: 700;
12022
+ font-size: 1.35rem;
12023
+ color: var(--color-text);
12024
+ letter-spacing: -0.01em;
12025
+ white-space: nowrap;
12026
+ overflow: hidden;
12027
+ text-overflow: ellipsis;
12028
+
12029
+ @media (max-width: 480px) { font-size: 1.2rem; }
12030
+ `;
12031
+ var AssetSubName = styled10.span`
12032
+ font-size: 0.8rem;
12033
+ font-weight: 500;
12034
+ color: rgba(255, 255, 255, 0.4);
12035
+ white-space: nowrap;
12036
+ overflow: hidden;
12037
+ text-overflow: ellipsis;
11989
12038
  `;
11990
12039
  var AssetName = styled10.div`
11991
12040
  display: flex;
@@ -14663,27 +14712,30 @@ function PortfolioActivityPanel({
14663
14712
  ] }, pos.tokenName);
14664
14713
  })
14665
14714
  ] }),
14666
- positions.length > 0 && closeAllOpen && onClosePosition && /* @__PURE__ */ jsx(CloseAllOverlay, { onClick: () => setCloseAllOpen(false), children: /* @__PURE__ */ jsxs(CloseAllModal, { onClick: (e) => e.stopPropagation(), children: [
14667
- /* @__PURE__ */ jsx(CloseAllModalX, { onClick: () => setCloseAllOpen(false), children: "\xD7" }),
14668
- /* @__PURE__ */ jsx(CloseAllTitle, { children: "Confirm Sell All" }),
14669
- /* @__PURE__ */ jsx(CloseAllDesc, { children: "This will sell all your positions and cancel their associated TP/SL orders." }),
14670
- /* @__PURE__ */ jsxs(CloseAllOption, { onClick: () => setCloseAllType("market"), children: [
14671
- /* @__PURE__ */ jsx(CloseAllRadio, { $selected: closeAllType === "market" }),
14672
- /* @__PURE__ */ jsx("span", { children: "Market Sell" })
14673
- ] }),
14674
- /* @__PURE__ */ jsxs(CloseAllOption, { onClick: () => setCloseAllType("limit"), children: [
14675
- /* @__PURE__ */ jsx(CloseAllRadio, { $selected: closeAllType === "limit" }),
14676
- /* @__PURE__ */ jsx("span", { children: "Limit Sell at Mid Price" })
14677
- ] }),
14678
- /* @__PURE__ */ jsxs(CloseAllConfirmBtn, { onClick: () => {
14679
- positions.forEach((pos) => onClosePosition(pos.tokenName, closeAllType, pos.quantity, pos.marketPrice));
14680
- setCloseAllOpen(false);
14681
- }, children: [
14682
- "Confirm ",
14683
- closeAllType === "market" ? "Market" : "Limit",
14684
- " Sell"
14685
- ] })
14686
- ] }) })
14715
+ positions.length > 0 && closeAllOpen && onClosePosition && typeof document !== "undefined" && createPortal(
14716
+ /* @__PURE__ */ jsx(CloseAllOverlay, { onClick: () => setCloseAllOpen(false), children: /* @__PURE__ */ jsxs(CloseAllModal, { onClick: (e) => e.stopPropagation(), children: [
14717
+ /* @__PURE__ */ jsx(CloseAllModalX, { onClick: () => setCloseAllOpen(false), children: "\xD7" }),
14718
+ /* @__PURE__ */ jsx(CloseAllTitle, { children: "Confirm Sell All" }),
14719
+ /* @__PURE__ */ jsx(CloseAllDesc, { children: "This will sell all your positions and cancel their associated TP/SL orders." }),
14720
+ /* @__PURE__ */ jsxs(CloseAllOption, { onClick: () => setCloseAllType("market"), children: [
14721
+ /* @__PURE__ */ jsx(CloseAllRadio, { $selected: closeAllType === "market" }),
14722
+ /* @__PURE__ */ jsx("span", { children: "Market Sell" })
14723
+ ] }),
14724
+ /* @__PURE__ */ jsxs(CloseAllOption, { onClick: () => setCloseAllType("limit"), children: [
14725
+ /* @__PURE__ */ jsx(CloseAllRadio, { $selected: closeAllType === "limit" }),
14726
+ /* @__PURE__ */ jsx("span", { children: "Limit Sell at Mid Price" })
14727
+ ] }),
14728
+ /* @__PURE__ */ jsxs(CloseAllConfirmBtn, { onClick: () => {
14729
+ positions.forEach((pos) => onClosePosition(pos.tokenName, closeAllType, pos.quantity, pos.marketPrice));
14730
+ setCloseAllOpen(false);
14731
+ }, children: [
14732
+ "Confirm ",
14733
+ closeAllType === "market" ? "Market" : "Limit",
14734
+ " Sell"
14735
+ ] })
14736
+ ] }) }),
14737
+ document.body
14738
+ )
14687
14739
  ] }),
14688
14740
  activeTab === "subscriptions" && /* @__PURE__ */ jsxs(Fragment, { children: [
14689
14741
  offeringOrders.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "IPO allocations will appear here once you subscribe." }),
@@ -15140,57 +15192,63 @@ function PortfolioActivityPanel({
15140
15192
  ] }),
15141
15193
  /* @__PURE__ */ jsx(PaginationBtn, { disabled: currentPage >= totalPages - 1, onClick: () => setCurrentPage((p) => p + 1), children: "Next \u203A" })
15142
15194
  ] }),
15143
- cancelAllConfirmOpen && /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setCancelAllConfirmOpen(false), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
15144
- /* @__PURE__ */ jsx(CancelConfirmTitle, { children: "Cancel All Orders" }),
15145
- /* @__PURE__ */ jsxs(CancelConfirmBody, { children: [
15146
- "Are you sure you want to cancel all ",
15147
- openOrdersCount,
15148
- " open orders? This action cannot be undone."
15149
- ] }),
15150
- /* @__PURE__ */ jsxs(CancelConfirmActions, { children: [
15151
- /* @__PURE__ */ jsx(CancelConfirmDismiss, { type: "button", onClick: () => setCancelAllConfirmOpen(false), children: "Keep Orders" }),
15152
- /* @__PURE__ */ jsx(
15153
- CancelConfirmProceed,
15154
- {
15155
- type: "button",
15156
- disabled: cancellingAll,
15157
- onClick: async () => {
15158
- if (onCancelAllOrders) {
15159
- setCancellingAll(true);
15160
- try {
15161
- await onCancelAllOrders();
15162
- } finally {
15163
- setCancellingAll(false);
15195
+ cancelAllConfirmOpen && typeof document !== "undefined" && createPortal(
15196
+ /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setCancelAllConfirmOpen(false), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
15197
+ /* @__PURE__ */ jsx(CancelConfirmTitle, { children: "Cancel All Orders" }),
15198
+ /* @__PURE__ */ jsxs(CancelConfirmBody, { children: [
15199
+ "Are you sure you want to cancel all ",
15200
+ openOrdersCount,
15201
+ " open orders? This action cannot be undone."
15202
+ ] }),
15203
+ /* @__PURE__ */ jsxs(CancelConfirmActions, { children: [
15204
+ /* @__PURE__ */ jsx(CancelConfirmDismiss, { type: "button", onClick: () => setCancelAllConfirmOpen(false), children: "Keep Orders" }),
15205
+ /* @__PURE__ */ jsx(
15206
+ CancelConfirmProceed,
15207
+ {
15208
+ type: "button",
15209
+ disabled: cancellingAll,
15210
+ onClick: async () => {
15211
+ if (onCancelAllOrders) {
15212
+ setCancellingAll(true);
15213
+ try {
15214
+ await onCancelAllOrders();
15215
+ } finally {
15216
+ setCancellingAll(false);
15217
+ }
15164
15218
  }
15165
- }
15166
- setCancelAllConfirmOpen(false);
15167
- },
15168
- children: cancellingAll ? "Cancelling\u2026" : "Yes, Cancel All"
15169
- }
15170
- )
15171
- ] })
15172
- ] }) }),
15173
- pendingCancelOrderId !== null && /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setPendingCancelOrderId(null), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
15174
- /* @__PURE__ */ jsx(CancelConfirmTitle, { children: "Cancel Order" }),
15175
- /* @__PURE__ */ jsx(CancelConfirmBody, { children: "Are you sure you want to cancel this order? This action cannot be undone." }),
15176
- /* @__PURE__ */ jsxs(CancelConfirmActions, { children: [
15177
- /* @__PURE__ */ jsx(CancelConfirmDismiss, { type: "button", onClick: () => setPendingCancelOrderId(null), children: "Keep Order" }),
15178
- /* @__PURE__ */ jsx(
15179
- CancelConfirmProceed,
15180
- {
15181
- type: "button",
15182
- disabled: cancellingOrderId != null,
15183
- onClick: async () => {
15184
- if (onCancelOrder && pendingCancelOrderId !== null) {
15185
- await onCancelOrder(pendingCancelOrderId);
15186
- }
15187
- setPendingCancelOrderId(null);
15188
- },
15189
- children: cancellingOrderId === pendingCancelOrderId ? "Cancelling\u2026" : "Yes, Cancel"
15190
- }
15191
- )
15192
- ] })
15193
- ] }) })
15219
+ setCancelAllConfirmOpen(false);
15220
+ },
15221
+ children: cancellingAll ? "Cancelling\u2026" : "Yes, Cancel All"
15222
+ }
15223
+ )
15224
+ ] })
15225
+ ] }) }),
15226
+ document.body
15227
+ ),
15228
+ pendingCancelOrderId !== null && typeof document !== "undefined" && createPortal(
15229
+ /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setPendingCancelOrderId(null), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
15230
+ /* @__PURE__ */ jsx(CancelConfirmTitle, { children: "Cancel Order" }),
15231
+ /* @__PURE__ */ jsx(CancelConfirmBody, { children: "Are you sure you want to cancel this order? This action cannot be undone." }),
15232
+ /* @__PURE__ */ jsxs(CancelConfirmActions, { children: [
15233
+ /* @__PURE__ */ jsx(CancelConfirmDismiss, { type: "button", onClick: () => setPendingCancelOrderId(null), children: "Keep Order" }),
15234
+ /* @__PURE__ */ jsx(
15235
+ CancelConfirmProceed,
15236
+ {
15237
+ type: "button",
15238
+ disabled: cancellingOrderId != null,
15239
+ onClick: async () => {
15240
+ if (onCancelOrder && pendingCancelOrderId !== null) {
15241
+ await onCancelOrder(pendingCancelOrderId);
15242
+ }
15243
+ setPendingCancelOrderId(null);
15244
+ },
15245
+ children: cancellingOrderId === pendingCancelOrderId ? "Cancelling\u2026" : "Yes, Cancel"
15246
+ }
15247
+ )
15248
+ ] })
15249
+ ] }) }),
15250
+ document.body
15251
+ )
15194
15252
  ] });
15195
15253
  }
15196
15254
  var Container2 = styled10.div`
@@ -15446,7 +15504,8 @@ var CancelConfirmOverlay = styled10.div`
15446
15504
  display: flex;
15447
15505
  align-items: center;
15448
15506
  justify-content: center;
15449
- z-index: 1000;
15507
+ /* Above the trade page's fullscreen/sticky layers (TradePage.css uses up to 10001). */
15508
+ z-index: 10050;
15450
15509
  `;
15451
15510
  var CancelConfirmModal = styled10.div`
15452
15511
  background: #1a1a1a;
@@ -15560,7 +15619,8 @@ var CloseAllOverlay = styled10.div`
15560
15619
  display: flex;
15561
15620
  align-items: center;
15562
15621
  justify-content: center;
15563
- z-index: 1000;
15622
+ /* Above the trade page's fullscreen/sticky layers (TradePage.css uses up to 10001). */
15623
+ z-index: 10050;
15564
15624
  `;
15565
15625
  var CloseAllModal = styled10.div`
15566
15626
  background: #1a1a1a;