@loafmarkets/ui 0.1.385 → 0.1.386

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.d.mts CHANGED
@@ -643,7 +643,7 @@ type HeaderPortfolioData = {
643
643
  pnl: number;
644
644
  pnlPercent: number;
645
645
  };
646
- type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "leaderboard" | "leaderboardPage" | "about" | "portfolio" | "learn" | "api";
646
+ type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "about" | "portfolio" | "learn" | "api";
647
647
  type HeaderLoginPopupComponentProps = {
648
648
  onClose: () => void;
649
649
  initialView?: LoginPopupView;
@@ -664,8 +664,6 @@ type HeaderProps = {
664
664
  apiPath?: string;
665
665
  offeringsPath?: string;
666
666
  propertyMapPath?: string;
667
- leaderboardPath?: string;
668
- leaderboardPagePath?: string;
669
667
  portfolioPath?: string;
670
668
  loafLiquidityPath?: string;
671
669
  /** Absolute URL for the auth/login surface (e.g. https://auth.loafmarkets.com/login). */
@@ -1001,6 +999,8 @@ type PortfolioActivityPanelProps = {
1001
999
  /** Click handler for the asset name in the Open Orders / Order History / Trade History rows — opens that asset. */
1002
1000
  onAssetClick?: (tokenName: string) => void;
1003
1001
  onClosePosition?: (tokenName: string, type: 'market' | 'limit', quantity: number, marketPrice: number) => void;
1002
+ /** Open the shareable position card for a held position. */
1003
+ onSharePosition?: (pos: PortfolioPosition) => void;
1004
1004
  offeringOrders?: readonly OfferingOrder[];
1005
1005
  openOrders?: readonly OrderHistoryItem[];
1006
1006
  orderHistory?: readonly OrderHistoryItem[];
@@ -1017,7 +1017,7 @@ type PortfolioActivityPanelProps = {
1017
1017
  className?: string;
1018
1018
  style?: React.CSSProperties;
1019
1019
  };
1020
- declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onAssetClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1020
+ declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onSharePosition, onAssetClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1021
1021
 
1022
1022
  type SelectorItem = {
1023
1023
  readonly tokenName: string;
package/dist/index.d.ts CHANGED
@@ -643,7 +643,7 @@ type HeaderPortfolioData = {
643
643
  pnl: number;
644
644
  pnlPercent: number;
645
645
  };
646
- type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "leaderboard" | "leaderboardPage" | "about" | "portfolio" | "learn" | "api";
646
+ type HeaderActiveTab = "home" | "trade" | "offerings" | "propertyMap" | "about" | "portfolio" | "learn" | "api";
647
647
  type HeaderLoginPopupComponentProps = {
648
648
  onClose: () => void;
649
649
  initialView?: LoginPopupView;
@@ -664,8 +664,6 @@ type HeaderProps = {
664
664
  apiPath?: string;
665
665
  offeringsPath?: string;
666
666
  propertyMapPath?: string;
667
- leaderboardPath?: string;
668
- leaderboardPagePath?: string;
669
667
  portfolioPath?: string;
670
668
  loafLiquidityPath?: string;
671
669
  /** Absolute URL for the auth/login surface (e.g. https://auth.loafmarkets.com/login). */
@@ -1001,6 +999,8 @@ type PortfolioActivityPanelProps = {
1001
999
  /** Click handler for the asset name in the Open Orders / Order History / Trade History rows — opens that asset. */
1002
1000
  onAssetClick?: (tokenName: string) => void;
1003
1001
  onClosePosition?: (tokenName: string, type: 'market' | 'limit', quantity: number, marketPrice: number) => void;
1002
+ /** Open the shareable position card for a held position. */
1003
+ onSharePosition?: (pos: PortfolioPosition) => void;
1004
1004
  offeringOrders?: readonly OfferingOrder[];
1005
1005
  openOrders?: readonly OrderHistoryItem[];
1006
1006
  orderHistory?: readonly OrderHistoryItem[];
@@ -1017,7 +1017,7 @@ type PortfolioActivityPanelProps = {
1017
1017
  className?: string;
1018
1018
  style?: React.CSSProperties;
1019
1019
  };
1020
- declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onAssetClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1020
+ declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onSharePosition, onAssetClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, cancellingOrderId, compactPositions, defaultTab, onTabChange, pageSize, blockExplorerBaseUrl: _blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
1021
1021
 
1022
1022
  type SelectorItem = {
1023
1023
  readonly tokenName: string;
package/dist/index.js CHANGED
@@ -5067,8 +5067,6 @@ var DEFAULT_ABOUT_PATH = "/about";
5067
5067
  var DEFAULT_LEARN_PATH = "/learn";
5068
5068
  var DEFAULT_API_PATH = "/api";
5069
5069
  var DEFAULT_PROPERTY_MAP_PATH = "/map";
5070
- var DEFAULT_LEADERBOARD_PATH = "/league";
5071
- var DEFAULT_LEADERBOARD_PAGE_PATH = "/leaderboard";
5072
5070
  var DEFAULT_PORTFOLIO_PATH = "/portfolio";
5073
5071
  var DEFAULT_LOAF_LIQUIDITY_PATH = "/loaf-liquidity";
5074
5072
  var DEFAULT_AUTH_RETURN_PARAM = "returnTo";
@@ -5089,8 +5087,6 @@ var Header = ({
5089
5087
  apiPath = DEFAULT_API_PATH,
5090
5088
  offeringsPath,
5091
5089
  propertyMapPath = DEFAULT_PROPERTY_MAP_PATH,
5092
- leaderboardPath = DEFAULT_LEADERBOARD_PATH,
5093
- leaderboardPagePath = DEFAULT_LEADERBOARD_PAGE_PATH,
5094
5090
  portfolioPath = DEFAULT_PORTFOLIO_PATH,
5095
5091
  loafLiquidityPath = DEFAULT_LOAF_LIQUIDITY_PATH,
5096
5092
  authLoginUrl,
@@ -5364,8 +5360,6 @@ var Header = ({
5364
5360
  const resolvedOfferingsPath = offeringsPath ?? void 0;
5365
5361
  const offeringsHref = resolvedOfferingsPath ?? resolvedHomePath;
5366
5362
  const resolvedPropertyMapPath = propertyMapPath ?? DEFAULT_PROPERTY_MAP_PATH;
5367
- const resolvedLeaderboardPath = leaderboardPath ?? DEFAULT_LEADERBOARD_PATH;
5368
- const resolvedLeaderboardPagePath = leaderboardPagePath ?? DEFAULT_LEADERBOARD_PAGE_PATH;
5369
5363
  const resolvedPortfolioPath = portfolioPath ?? DEFAULT_PORTFOLIO_PATH;
5370
5364
  const resolvedLoafLiquidityPath = loafLiquidityPath ?? DEFAULT_LOAF_LIQUIDITY_PATH;
5371
5365
  const inferredActiveTab = (() => {
@@ -5376,8 +5370,6 @@ var Header = ({
5376
5370
  if (locationPath === resolvedApiPath) return "api";
5377
5371
  if (resolvedOfferingsPath && locationPath.startsWith(resolvedOfferingsPath)) return "offerings";
5378
5372
  if (locationPath === resolvedPropertyMapPath) return "propertyMap";
5379
- if (locationPath === resolvedLeaderboardPagePath) return "leaderboardPage";
5380
- if (locationPath === resolvedLeaderboardPath) return "leaderboard";
5381
5373
  if (locationPath === resolvedPortfolioPath) return "portfolio";
5382
5374
  return null;
5383
5375
  })();
@@ -5386,8 +5378,6 @@ var Header = ({
5386
5378
  const homeActive = resolvedActiveTab === "home";
5387
5379
  const offeringsActive = resolvedActiveTab === "offerings";
5388
5380
  const propertyMapActive = resolvedActiveTab === "propertyMap";
5389
- const leaderboardActive = resolvedActiveTab === "leaderboard";
5390
- const leaderboardPageActive = resolvedActiveTab === "leaderboardPage";
5391
5381
  const aboutActive = resolvedActiveTab === "about";
5392
5382
  const portfolioActive = resolvedActiveTab === "portfolio";
5393
5383
  const learnActive = resolvedActiveTab === "learn";
@@ -5471,91 +5461,48 @@ var Header = ({
5471
5461
  /* @__PURE__ */ jsxRuntime.jsx(
5472
5462
  NavLink,
5473
5463
  {
5474
- href: resolvedLeaderboardPath,
5475
- className: leaderboardActive ? "active" : "",
5464
+ href: resolvedLearnPath,
5465
+ className: learnActive ? "active" : "",
5476
5466
  onClick: (event) => {
5477
5467
  event.preventDefault();
5478
- handleNavigation(resolvedLeaderboardPath);
5468
+ handleNavigation(resolvedLearnPath);
5479
5469
  },
5480
- children: "Competition"
5470
+ children: "Learn"
5481
5471
  }
5482
5472
  ),
5483
5473
  /* @__PURE__ */ jsxRuntime.jsx(
5484
5474
  NavLink,
5485
5475
  {
5486
- href: resolvedLeaderboardPagePath,
5487
- className: leaderboardPageActive ? "active" : "",
5476
+ href: resolvedAboutPath,
5477
+ className: aboutActive ? "active" : "",
5488
5478
  onClick: (event) => {
5489
5479
  event.preventDefault();
5490
- handleNavigation(resolvedLeaderboardPagePath);
5480
+ handleNavigation(resolvedAboutPath);
5491
5481
  },
5492
- children: "Leaderboard"
5482
+ children: "About"
5493
5483
  }
5494
5484
  ),
5495
5485
  /* @__PURE__ */ jsxRuntime.jsx(
5496
5486
  NavLink,
5497
5487
  {
5498
- href: resolvedLearnPath,
5499
- className: learnActive ? "active" : "",
5488
+ href: resolvedApiPath,
5489
+ className: apiActive ? "active" : "",
5500
5490
  onClick: (event) => {
5501
5491
  event.preventDefault();
5502
- handleNavigation(resolvedLearnPath);
5492
+ handleNavigation(resolvedApiPath);
5503
5493
  },
5504
- children: "Learn"
5494
+ children: "API"
5495
+ }
5496
+ ),
5497
+ /* @__PURE__ */ jsxRuntime.jsx(
5498
+ NavLink,
5499
+ {
5500
+ href: "https://docs.loafmarkets.com/en/",
5501
+ target: "_blank",
5502
+ rel: "noopener noreferrer",
5503
+ children: "Docs"
5505
5504
  }
5506
5505
  ),
5507
- /* @__PURE__ */ jsxRuntime.jsxs(MoreMenu, { className: "more-menu", children: [
5508
- /* @__PURE__ */ jsxRuntime.jsxs(
5509
- MoreTrigger,
5510
- {
5511
- type: "button",
5512
- className: `${isMoreMenuOpen ? "open" : ""} ${aboutActive || apiActive ? "active" : ""}`,
5513
- "aria-haspopup": "true",
5514
- "aria-expanded": isMoreMenuOpen,
5515
- onClick: () => setIsMoreMenuOpen((open) => !open),
5516
- children: [
5517
- "More",
5518
- /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 9l6 6 6-6", strokeLinecap: "round", strokeLinejoin: "round" }) })
5519
- ]
5520
- }
5521
- ),
5522
- isMoreMenuOpen && /* @__PURE__ */ jsxRuntime.jsxs(MoreDropdown, { children: [
5523
- /* @__PURE__ */ jsxRuntime.jsx(
5524
- MoreItem,
5525
- {
5526
- href: resolvedAboutPath,
5527
- className: aboutActive ? "active" : "",
5528
- onClick: (event) => {
5529
- event.preventDefault();
5530
- handleNavigation(resolvedAboutPath);
5531
- },
5532
- children: "About"
5533
- }
5534
- ),
5535
- /* @__PURE__ */ jsxRuntime.jsx(
5536
- MoreItem,
5537
- {
5538
- href: resolvedApiPath,
5539
- className: apiActive ? "active" : "",
5540
- onClick: (event) => {
5541
- event.preventDefault();
5542
- handleNavigation(resolvedApiPath);
5543
- },
5544
- children: "API"
5545
- }
5546
- ),
5547
- /* @__PURE__ */ jsxRuntime.jsx(
5548
- MoreItem,
5549
- {
5550
- href: "https://docs.loafmarkets.com/en/",
5551
- target: "_blank",
5552
- rel: "noopener noreferrer",
5553
- onClick: () => setIsMoreMenuOpen(false),
5554
- children: "Docs"
5555
- }
5556
- )
5557
- ] })
5558
- ] }),
5559
5506
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(
5560
5507
  "div",
5561
5508
  {
@@ -5596,8 +5543,6 @@ var Header = ({
5596
5543
  ),
5597
5544
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(offeringsHref), children: "Initial Offerings" }),
5598
5545
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPropertyMapPath), children: "Property Map" }),
5599
- /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLeaderboardPath), children: "Competition" }),
5600
- /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLeaderboardPagePath), children: "Leaderboard" }),
5601
5546
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLearnPath), children: "Learn" }),
5602
5547
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedAboutPath), children: "About" }),
5603
5548
  /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedApiPath), children: "API" }),
@@ -6115,77 +6060,6 @@ var NavLink = styled10__default.default.a`
6115
6060
  }
6116
6061
  }
6117
6062
  `;
6118
- var MoreMenu = styled10__default.default.div`
6119
- position: relative;
6120
- display: flex;
6121
- align-items: center;
6122
- height: 56px;
6123
- `;
6124
- var MoreTrigger = styled10__default.default.button`
6125
- margin: 0 12px;
6126
- padding: 0 4px;
6127
- height: 56px;
6128
- display: inline-flex;
6129
- align-items: center;
6130
- gap: 4px;
6131
- background: none;
6132
- border: none;
6133
- cursor: pointer;
6134
- color: #eaecef;
6135
- font-weight: 500;
6136
- font-size: 14px;
6137
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
6138
- letter-spacing: 0.2px;
6139
- transition: color 0.2s ease;
6140
-
6141
- &:hover,
6142
- &.active {
6143
- color: #E6C87E;
6144
- }
6145
-
6146
- svg {
6147
- width: 14px;
6148
- height: 14px;
6149
- transition: transform 0.2s ease;
6150
- }
6151
- &.open svg {
6152
- transform: rotate(180deg);
6153
- }
6154
- `;
6155
- var MoreDropdown = styled10__default.default.div`
6156
- position: absolute;
6157
- top: 100%;
6158
- right: 0;
6159
- min-width: 160px;
6160
- padding: 6px;
6161
- background: #1e2026;
6162
- border: 1px solid #2b3139;
6163
- border-radius: 10px;
6164
- box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
6165
- display: flex;
6166
- flex-direction: column;
6167
- z-index: 1100;
6168
- `;
6169
- var MoreItem = styled10__default.default.a`
6170
- padding: 10px 12px;
6171
- border-radius: 6px;
6172
- color: #eaecef;
6173
- font-weight: 500;
6174
- font-size: 14px;
6175
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
6176
- letter-spacing: 0.2px;
6177
- text-decoration: none;
6178
- cursor: pointer;
6179
- transition: background 0.15s ease, color 0.15s ease;
6180
-
6181
- &:hover {
6182
- background: #2b3139;
6183
- color: #E6C87E;
6184
- }
6185
- &.active {
6186
- color: #E6C87E;
6187
- }
6188
- `;
6189
6063
  var Button2 = styled10__default.default.button.attrs({ type: "button" })`
6190
6064
  padding: 0.5rem 1rem;
6191
6065
  border-radius: 6px;
@@ -14993,6 +14867,7 @@ function PortfolioActivityPanel({
14993
14867
  showPositionsTab = false,
14994
14868
  showSubscriptionsTab = true,
14995
14869
  onPositionClick,
14870
+ onSharePosition,
14996
14871
  onAssetClick,
14997
14872
  onClosePosition,
14998
14873
  offeringOrders = [],
@@ -15284,17 +15159,23 @@ function PortfolioActivityPanel({
15284
15159
  ] }),
15285
15160
  /* @__PURE__ */ jsxRuntime.jsxs(CPnlCell, { children: [
15286
15161
  /* @__PURE__ */ jsxRuntime.jsx(CCellLabel, { children: "PNL (%)" }),
15287
- /* @__PURE__ */ jsxRuntime.jsxs(CPnlLine, { children: [
15288
- /* @__PURE__ */ jsxRuntime.jsxs(CPnlValue, { $positive: isPositive, children: [
15289
- isPositive ? "+" : "-",
15290
- formatCurrency4(Math.abs(pnl))
15162
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.4rem" }, children: [
15163
+ /* @__PURE__ */ jsxRuntime.jsxs(CPnlLine, { children: [
15164
+ /* @__PURE__ */ jsxRuntime.jsxs(CPnlValue, { $positive: isPositive, children: [
15165
+ isPositive ? "+" : "-",
15166
+ formatCurrency4(Math.abs(pnl))
15167
+ ] }),
15168
+ /* @__PURE__ */ jsxRuntime.jsxs(CPnlPct, { $positive: isPositive, children: [
15169
+ "(",
15170
+ isPositive ? "+" : "",
15171
+ pnlPercent.toFixed(1),
15172
+ "%)"
15173
+ ] })
15291
15174
  ] }),
15292
- /* @__PURE__ */ jsxRuntime.jsxs(CPnlPct, { $positive: isPositive, children: [
15293
- "(",
15294
- isPositive ? "+" : "",
15295
- pnlPercent.toFixed(1),
15296
- "%)"
15297
- ] })
15175
+ onSharePosition && !pos.settling && /* @__PURE__ */ jsxRuntime.jsx(CShareIconBtn, { role: "button", "aria-label": "Share position", onClick: (e) => {
15176
+ e.stopPropagation();
15177
+ onSharePosition(pos);
15178
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(ShareIcon, {}) })
15298
15179
  ] })
15299
15180
  ] }),
15300
15181
  /* @__PURE__ */ jsxRuntime.jsx(CChevronWrap, { $open: posExpanded, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(255,255,255,0.5)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" }) }) })
@@ -15314,16 +15195,16 @@ function PortfolioActivityPanel({
15314
15195
  /* @__PURE__ */ jsxRuntime.jsx(CDValue, { children: formatCurrency4(pos.marketPrice) })
15315
15196
  ] })
15316
15197
  ] }),
15317
- onClosePosition && !pos.settling && /* @__PURE__ */ jsxRuntime.jsxs(CActionRow, { children: [
15318
- /* @__PURE__ */ jsxRuntime.jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice), children: "Market Sell" }),
15319
- /* @__PURE__ */ jsxRuntime.jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice), children: "Limit Sell" })
15198
+ (onClosePosition || onSharePosition) && !pos.settling && /* @__PURE__ */ jsxRuntime.jsxs(CActionRow, { children: [
15199
+ onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice), children: "Market Sell" }),
15200
+ onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice), children: "Limit Sell" })
15320
15201
  ] })
15321
15202
  ] })
15322
15203
  ] }, pos.tokenName);
15323
15204
  })
15324
15205
  ] }),
15325
15206
  positions.length > 0 && !compactPositions && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
15326
- /* @__PURE__ */ jsxRuntime.jsxs(PositionsHeader, { $hasClose: !!onClosePosition, children: [
15207
+ /* @__PURE__ */ jsxRuntime.jsxs(PositionsHeader, { $hasClose: !!(onClosePosition || onSharePosition), children: [
15327
15208
  /* @__PURE__ */ jsxRuntime.jsxs(SortableHeaderCell, { $active: posSortKey === "asset", onClick: () => handlePosSort("asset"), children: [
15328
15209
  "Asset ",
15329
15210
  posSortKey === "asset" && (posSortAsc ? "\u2191" : "\u2193")
@@ -15356,7 +15237,7 @@ function PortfolioActivityPanel({
15356
15237
  const pnl = pos.propertyPnl ?? currentValue - costBasis;
15357
15238
  const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
15358
15239
  const isPositive = pnl >= 0;
15359
- return /* @__PURE__ */ jsxRuntime.jsxs(PositionsRow, { $hasClose: !!onClosePosition, children: [
15240
+ return /* @__PURE__ */ jsxRuntime.jsxs(PositionsRow, { $hasClose: !!(onClosePosition || onSharePosition), children: [
15360
15241
  /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
15361
15242
  /* @__PURE__ */ jsxRuntime.jsx(HoldingsPropertyLink, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: pos.tokenName }),
15362
15243
  pos.settling && /* @__PURE__ */ jsxRuntime.jsx(SettlingTip, { children: /* @__PURE__ */ jsxRuntime.jsx(SettlingSpinner, {}) })
@@ -15373,23 +15254,29 @@ function PortfolioActivityPanel({
15373
15254
  ] }) }),
15374
15255
  /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: "0.8rem" }, children: formatCurrency4(pos.averageEntryPrice) }) }),
15375
15256
  /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatCurrency4(pos.marketPrice) }) }),
15376
- /* @__PURE__ */ jsxRuntime.jsxs(PositionsCell, { children: [
15377
- /* @__PURE__ */ jsxRuntime.jsxs(PnLAmount, { $positive: isPositive, children: [
15378
- isPositive ? "+" : "-",
15379
- formatCurrency4(Math.abs(pnl))
15257
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.4rem" }, children: [
15258
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", flexDirection: "column" }, children: [
15259
+ /* @__PURE__ */ jsxRuntime.jsxs(PnLAmount, { $positive: isPositive, children: [
15260
+ isPositive ? "+" : "-",
15261
+ formatCurrency4(Math.abs(pnl))
15262
+ ] }),
15263
+ /* @__PURE__ */ jsxRuntime.jsxs(PnLPercentage, { $positive: isPositive, children: [
15264
+ isPositive ? "+" : "",
15265
+ pnlPercent.toFixed(1),
15266
+ "%"
15267
+ ] })
15380
15268
  ] }),
15381
- /* @__PURE__ */ jsxRuntime.jsxs(PnLPercentage, { $positive: isPositive, children: [
15382
- isPositive ? "+" : "",
15383
- pnlPercent.toFixed(1),
15384
- "%"
15385
- ] })
15386
- ] }),
15387
- onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: !pos.settling && /* @__PURE__ */ jsxRuntime.jsxs(CloseActions, { children: [
15388
- /* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { onClick: (e) => {
15269
+ onSharePosition && !pos.settling && /* @__PURE__ */ jsxRuntime.jsx(CShareIconBtn, { role: "button", "aria-label": "Share position", onClick: (e) => {
15270
+ e.stopPropagation();
15271
+ onSharePosition(pos);
15272
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(ShareIcon, {}) })
15273
+ ] }) }),
15274
+ (onClosePosition || onSharePosition) && /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: !pos.settling && /* @__PURE__ */ jsxRuntime.jsxs(CloseActions, { children: [
15275
+ onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { onClick: (e) => {
15389
15276
  e.stopPropagation();
15390
15277
  onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice);
15391
15278
  }, children: "Market Sell" }),
15392
- /* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { onClick: (e) => {
15279
+ onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { onClick: (e) => {
15393
15280
  e.stopPropagation();
15394
15281
  onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice);
15395
15282
  }, children: "Limit Sell" })
@@ -16280,6 +16167,29 @@ var CloseBtn = styled10__default.default.button`
16280
16167
  border-color: rgba(230, 200, 126, 0.5);
16281
16168
  }
16282
16169
  `;
16170
+ var CShareIconBtn = styled10__default.default.span`
16171
+ display: inline-flex;
16172
+ align-items: center;
16173
+ justify-content: center;
16174
+ width: 26px;
16175
+ height: 26px;
16176
+ border-radius: 6px;
16177
+ color: #E6C87E;
16178
+ cursor: pointer;
16179
+ pointer-events: auto;
16180
+ transition: color 0.15s ease, background 0.15s ease;
16181
+ &:hover {
16182
+ color: #F2D898;
16183
+ background: rgba(230, 200, 126, 0.14);
16184
+ }
16185
+ &:active { background: rgba(230, 200, 126, 0.22); }
16186
+ svg { width: 15px; height: 15px; }
16187
+ `;
16188
+ var ShareIcon = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
16189
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7" }),
16190
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "16 6 12 2 8 6" }),
16191
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "2", x2: "12", y2: "15" })
16192
+ ] });
16283
16193
  var CloseAllHeaderBtn = styled10__default.default.button`
16284
16194
  background: rgba(230, 200, 126, 0.1);
16285
16195
  border: 1px solid rgba(230, 200, 126, 0.3);