@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.mjs CHANGED
@@ -5042,8 +5042,6 @@ var DEFAULT_ABOUT_PATH = "/about";
5042
5042
  var DEFAULT_LEARN_PATH = "/learn";
5043
5043
  var DEFAULT_API_PATH = "/api";
5044
5044
  var DEFAULT_PROPERTY_MAP_PATH = "/map";
5045
- var DEFAULT_LEADERBOARD_PATH = "/league";
5046
- var DEFAULT_LEADERBOARD_PAGE_PATH = "/leaderboard";
5047
5045
  var DEFAULT_PORTFOLIO_PATH = "/portfolio";
5048
5046
  var DEFAULT_LOAF_LIQUIDITY_PATH = "/loaf-liquidity";
5049
5047
  var DEFAULT_AUTH_RETURN_PARAM = "returnTo";
@@ -5064,8 +5062,6 @@ var Header = ({
5064
5062
  apiPath = DEFAULT_API_PATH,
5065
5063
  offeringsPath,
5066
5064
  propertyMapPath = DEFAULT_PROPERTY_MAP_PATH,
5067
- leaderboardPath = DEFAULT_LEADERBOARD_PATH,
5068
- leaderboardPagePath = DEFAULT_LEADERBOARD_PAGE_PATH,
5069
5065
  portfolioPath = DEFAULT_PORTFOLIO_PATH,
5070
5066
  loafLiquidityPath = DEFAULT_LOAF_LIQUIDITY_PATH,
5071
5067
  authLoginUrl,
@@ -5339,8 +5335,6 @@ var Header = ({
5339
5335
  const resolvedOfferingsPath = offeringsPath ?? void 0;
5340
5336
  const offeringsHref = resolvedOfferingsPath ?? resolvedHomePath;
5341
5337
  const resolvedPropertyMapPath = propertyMapPath ?? DEFAULT_PROPERTY_MAP_PATH;
5342
- const resolvedLeaderboardPath = leaderboardPath ?? DEFAULT_LEADERBOARD_PATH;
5343
- const resolvedLeaderboardPagePath = leaderboardPagePath ?? DEFAULT_LEADERBOARD_PAGE_PATH;
5344
5338
  const resolvedPortfolioPath = portfolioPath ?? DEFAULT_PORTFOLIO_PATH;
5345
5339
  const resolvedLoafLiquidityPath = loafLiquidityPath ?? DEFAULT_LOAF_LIQUIDITY_PATH;
5346
5340
  const inferredActiveTab = (() => {
@@ -5351,8 +5345,6 @@ var Header = ({
5351
5345
  if (locationPath === resolvedApiPath) return "api";
5352
5346
  if (resolvedOfferingsPath && locationPath.startsWith(resolvedOfferingsPath)) return "offerings";
5353
5347
  if (locationPath === resolvedPropertyMapPath) return "propertyMap";
5354
- if (locationPath === resolvedLeaderboardPagePath) return "leaderboardPage";
5355
- if (locationPath === resolvedLeaderboardPath) return "leaderboard";
5356
5348
  if (locationPath === resolvedPortfolioPath) return "portfolio";
5357
5349
  return null;
5358
5350
  })();
@@ -5361,8 +5353,6 @@ var Header = ({
5361
5353
  const homeActive = resolvedActiveTab === "home";
5362
5354
  const offeringsActive = resolvedActiveTab === "offerings";
5363
5355
  const propertyMapActive = resolvedActiveTab === "propertyMap";
5364
- const leaderboardActive = resolvedActiveTab === "leaderboard";
5365
- const leaderboardPageActive = resolvedActiveTab === "leaderboardPage";
5366
5356
  const aboutActive = resolvedActiveTab === "about";
5367
5357
  const portfolioActive = resolvedActiveTab === "portfolio";
5368
5358
  const learnActive = resolvedActiveTab === "learn";
@@ -5446,91 +5436,48 @@ var Header = ({
5446
5436
  /* @__PURE__ */ jsx(
5447
5437
  NavLink,
5448
5438
  {
5449
- href: resolvedLeaderboardPath,
5450
- className: leaderboardActive ? "active" : "",
5439
+ href: resolvedLearnPath,
5440
+ className: learnActive ? "active" : "",
5451
5441
  onClick: (event) => {
5452
5442
  event.preventDefault();
5453
- handleNavigation(resolvedLeaderboardPath);
5443
+ handleNavigation(resolvedLearnPath);
5454
5444
  },
5455
- children: "Competition"
5445
+ children: "Learn"
5456
5446
  }
5457
5447
  ),
5458
5448
  /* @__PURE__ */ jsx(
5459
5449
  NavLink,
5460
5450
  {
5461
- href: resolvedLeaderboardPagePath,
5462
- className: leaderboardPageActive ? "active" : "",
5451
+ href: resolvedAboutPath,
5452
+ className: aboutActive ? "active" : "",
5463
5453
  onClick: (event) => {
5464
5454
  event.preventDefault();
5465
- handleNavigation(resolvedLeaderboardPagePath);
5455
+ handleNavigation(resolvedAboutPath);
5466
5456
  },
5467
- children: "Leaderboard"
5457
+ children: "About"
5468
5458
  }
5469
5459
  ),
5470
5460
  /* @__PURE__ */ jsx(
5471
5461
  NavLink,
5472
5462
  {
5473
- href: resolvedLearnPath,
5474
- className: learnActive ? "active" : "",
5463
+ href: resolvedApiPath,
5464
+ className: apiActive ? "active" : "",
5475
5465
  onClick: (event) => {
5476
5466
  event.preventDefault();
5477
- handleNavigation(resolvedLearnPath);
5467
+ handleNavigation(resolvedApiPath);
5478
5468
  },
5479
- children: "Learn"
5469
+ children: "API"
5470
+ }
5471
+ ),
5472
+ /* @__PURE__ */ jsx(
5473
+ NavLink,
5474
+ {
5475
+ href: "https://docs.loafmarkets.com/en/",
5476
+ target: "_blank",
5477
+ rel: "noopener noreferrer",
5478
+ children: "Docs"
5480
5479
  }
5481
5480
  ),
5482
- /* @__PURE__ */ jsxs(MoreMenu, { className: "more-menu", children: [
5483
- /* @__PURE__ */ jsxs(
5484
- MoreTrigger,
5485
- {
5486
- type: "button",
5487
- className: `${isMoreMenuOpen ? "open" : ""} ${aboutActive || apiActive ? "active" : ""}`,
5488
- "aria-haspopup": "true",
5489
- "aria-expanded": isMoreMenuOpen,
5490
- onClick: () => setIsMoreMenuOpen((open) => !open),
5491
- children: [
5492
- "More",
5493
- /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6", strokeLinecap: "round", strokeLinejoin: "round" }) })
5494
- ]
5495
- }
5496
- ),
5497
- isMoreMenuOpen && /* @__PURE__ */ jsxs(MoreDropdown, { children: [
5498
- /* @__PURE__ */ jsx(
5499
- MoreItem,
5500
- {
5501
- href: resolvedAboutPath,
5502
- className: aboutActive ? "active" : "",
5503
- onClick: (event) => {
5504
- event.preventDefault();
5505
- handleNavigation(resolvedAboutPath);
5506
- },
5507
- children: "About"
5508
- }
5509
- ),
5510
- /* @__PURE__ */ jsx(
5511
- MoreItem,
5512
- {
5513
- href: resolvedApiPath,
5514
- className: apiActive ? "active" : "",
5515
- onClick: (event) => {
5516
- event.preventDefault();
5517
- handleNavigation(resolvedApiPath);
5518
- },
5519
- children: "API"
5520
- }
5521
- ),
5522
- /* @__PURE__ */ jsx(
5523
- MoreItem,
5524
- {
5525
- href: "https://docs.loafmarkets.com/en/",
5526
- target: "_blank",
5527
- rel: "noopener noreferrer",
5528
- onClick: () => setIsMoreMenuOpen(false),
5529
- children: "Docs"
5530
- }
5531
- )
5532
- ] })
5533
- ] }),
5534
5481
  /* @__PURE__ */ jsx("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(
5535
5482
  "div",
5536
5483
  {
@@ -5571,8 +5518,6 @@ var Header = ({
5571
5518
  ),
5572
5519
  /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(offeringsHref), children: "Initial Offerings" }),
5573
5520
  /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPropertyMapPath), children: "Property Map" }),
5574
- /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLeaderboardPath), children: "Competition" }),
5575
- /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLeaderboardPagePath), children: "Leaderboard" }),
5576
5521
  /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLearnPath), children: "Learn" }),
5577
5522
  /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedAboutPath), children: "About" }),
5578
5523
  /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedApiPath), children: "API" }),
@@ -6090,77 +6035,6 @@ var NavLink = styled10.a`
6090
6035
  }
6091
6036
  }
6092
6037
  `;
6093
- var MoreMenu = styled10.div`
6094
- position: relative;
6095
- display: flex;
6096
- align-items: center;
6097
- height: 56px;
6098
- `;
6099
- var MoreTrigger = styled10.button`
6100
- margin: 0 12px;
6101
- padding: 0 4px;
6102
- height: 56px;
6103
- display: inline-flex;
6104
- align-items: center;
6105
- gap: 4px;
6106
- background: none;
6107
- border: none;
6108
- cursor: pointer;
6109
- color: #eaecef;
6110
- font-weight: 500;
6111
- font-size: 14px;
6112
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
6113
- letter-spacing: 0.2px;
6114
- transition: color 0.2s ease;
6115
-
6116
- &:hover,
6117
- &.active {
6118
- color: #E6C87E;
6119
- }
6120
-
6121
- svg {
6122
- width: 14px;
6123
- height: 14px;
6124
- transition: transform 0.2s ease;
6125
- }
6126
- &.open svg {
6127
- transform: rotate(180deg);
6128
- }
6129
- `;
6130
- var MoreDropdown = styled10.div`
6131
- position: absolute;
6132
- top: 100%;
6133
- right: 0;
6134
- min-width: 160px;
6135
- padding: 6px;
6136
- background: #1e2026;
6137
- border: 1px solid #2b3139;
6138
- border-radius: 10px;
6139
- box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
6140
- display: flex;
6141
- flex-direction: column;
6142
- z-index: 1100;
6143
- `;
6144
- var MoreItem = styled10.a`
6145
- padding: 10px 12px;
6146
- border-radius: 6px;
6147
- color: #eaecef;
6148
- font-weight: 500;
6149
- font-size: 14px;
6150
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
6151
- letter-spacing: 0.2px;
6152
- text-decoration: none;
6153
- cursor: pointer;
6154
- transition: background 0.15s ease, color 0.15s ease;
6155
-
6156
- &:hover {
6157
- background: #2b3139;
6158
- color: #E6C87E;
6159
- }
6160
- &.active {
6161
- color: #E6C87E;
6162
- }
6163
- `;
6164
6038
  var Button2 = styled10.button.attrs({ type: "button" })`
6165
6039
  padding: 0.5rem 1rem;
6166
6040
  border-radius: 6px;
@@ -14968,6 +14842,7 @@ function PortfolioActivityPanel({
14968
14842
  showPositionsTab = false,
14969
14843
  showSubscriptionsTab = true,
14970
14844
  onPositionClick,
14845
+ onSharePosition,
14971
14846
  onAssetClick,
14972
14847
  onClosePosition,
14973
14848
  offeringOrders = [],
@@ -15259,17 +15134,23 @@ function PortfolioActivityPanel({
15259
15134
  ] }),
15260
15135
  /* @__PURE__ */ jsxs(CPnlCell, { children: [
15261
15136
  /* @__PURE__ */ jsx(CCellLabel, { children: "PNL (%)" }),
15262
- /* @__PURE__ */ jsxs(CPnlLine, { children: [
15263
- /* @__PURE__ */ jsxs(CPnlValue, { $positive: isPositive, children: [
15264
- isPositive ? "+" : "-",
15265
- formatCurrency4(Math.abs(pnl))
15137
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.4rem" }, children: [
15138
+ /* @__PURE__ */ jsxs(CPnlLine, { children: [
15139
+ /* @__PURE__ */ jsxs(CPnlValue, { $positive: isPositive, children: [
15140
+ isPositive ? "+" : "-",
15141
+ formatCurrency4(Math.abs(pnl))
15142
+ ] }),
15143
+ /* @__PURE__ */ jsxs(CPnlPct, { $positive: isPositive, children: [
15144
+ "(",
15145
+ isPositive ? "+" : "",
15146
+ pnlPercent.toFixed(1),
15147
+ "%)"
15148
+ ] })
15266
15149
  ] }),
15267
- /* @__PURE__ */ jsxs(CPnlPct, { $positive: isPositive, children: [
15268
- "(",
15269
- isPositive ? "+" : "",
15270
- pnlPercent.toFixed(1),
15271
- "%)"
15272
- ] })
15150
+ onSharePosition && !pos.settling && /* @__PURE__ */ jsx(CShareIconBtn, { role: "button", "aria-label": "Share position", onClick: (e) => {
15151
+ e.stopPropagation();
15152
+ onSharePosition(pos);
15153
+ }, children: /* @__PURE__ */ jsx(ShareIcon, {}) })
15273
15154
  ] })
15274
15155
  ] }),
15275
15156
  /* @__PURE__ */ jsx(CChevronWrap, { $open: posExpanded, children: /* @__PURE__ */ 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__ */ jsx("polyline", { points: "6 9 12 15 18 9" }) }) })
@@ -15289,16 +15170,16 @@ function PortfolioActivityPanel({
15289
15170
  /* @__PURE__ */ jsx(CDValue, { children: formatCurrency4(pos.marketPrice) })
15290
15171
  ] })
15291
15172
  ] }),
15292
- onClosePosition && !pos.settling && /* @__PURE__ */ jsxs(CActionRow, { children: [
15293
- /* @__PURE__ */ jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice), children: "Market Sell" }),
15294
- /* @__PURE__ */ jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice), children: "Limit Sell" })
15173
+ (onClosePosition || onSharePosition) && !pos.settling && /* @__PURE__ */ jsxs(CActionRow, { children: [
15174
+ onClosePosition && /* @__PURE__ */ jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice), children: "Market Sell" }),
15175
+ onClosePosition && /* @__PURE__ */ jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice), children: "Limit Sell" })
15295
15176
  ] })
15296
15177
  ] })
15297
15178
  ] }, pos.tokenName);
15298
15179
  })
15299
15180
  ] }),
15300
15181
  positions.length > 0 && !compactPositions && /* @__PURE__ */ jsxs(Fragment, { children: [
15301
- /* @__PURE__ */ jsxs(PositionsHeader, { $hasClose: !!onClosePosition, children: [
15182
+ /* @__PURE__ */ jsxs(PositionsHeader, { $hasClose: !!(onClosePosition || onSharePosition), children: [
15302
15183
  /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "asset", onClick: () => handlePosSort("asset"), children: [
15303
15184
  "Asset ",
15304
15185
  posSortKey === "asset" && (posSortAsc ? "\u2191" : "\u2193")
@@ -15331,7 +15212,7 @@ function PortfolioActivityPanel({
15331
15212
  const pnl = pos.propertyPnl ?? currentValue - costBasis;
15332
15213
  const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
15333
15214
  const isPositive = pnl >= 0;
15334
- return /* @__PURE__ */ jsxs(PositionsRow, { $hasClose: !!onClosePosition, children: [
15215
+ return /* @__PURE__ */ jsxs(PositionsRow, { $hasClose: !!(onClosePosition || onSharePosition), children: [
15335
15216
  /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
15336
15217
  /* @__PURE__ */ jsx(HoldingsPropertyLink, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: pos.tokenName }),
15337
15218
  pos.settling && /* @__PURE__ */ jsx(SettlingTip, { children: /* @__PURE__ */ jsx(SettlingSpinner, {}) })
@@ -15348,23 +15229,29 @@ function PortfolioActivityPanel({
15348
15229
  ] }) }),
15349
15230
  /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: "0.8rem" }, children: formatCurrency4(pos.averageEntryPrice) }) }),
15350
15231
  /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatCurrency4(pos.marketPrice) }) }),
15351
- /* @__PURE__ */ jsxs(PositionsCell, { children: [
15352
- /* @__PURE__ */ jsxs(PnLAmount, { $positive: isPositive, children: [
15353
- isPositive ? "+" : "-",
15354
- formatCurrency4(Math.abs(pnl))
15232
+ /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.4rem" }, children: [
15233
+ /* @__PURE__ */ jsxs("span", { style: { display: "flex", flexDirection: "column" }, children: [
15234
+ /* @__PURE__ */ jsxs(PnLAmount, { $positive: isPositive, children: [
15235
+ isPositive ? "+" : "-",
15236
+ formatCurrency4(Math.abs(pnl))
15237
+ ] }),
15238
+ /* @__PURE__ */ jsxs(PnLPercentage, { $positive: isPositive, children: [
15239
+ isPositive ? "+" : "",
15240
+ pnlPercent.toFixed(1),
15241
+ "%"
15242
+ ] })
15355
15243
  ] }),
15356
- /* @__PURE__ */ jsxs(PnLPercentage, { $positive: isPositive, children: [
15357
- isPositive ? "+" : "",
15358
- pnlPercent.toFixed(1),
15359
- "%"
15360
- ] })
15361
- ] }),
15362
- onClosePosition && /* @__PURE__ */ jsx(PositionsCell, { children: !pos.settling && /* @__PURE__ */ jsxs(CloseActions, { children: [
15363
- /* @__PURE__ */ jsx(CloseBtn, { onClick: (e) => {
15244
+ onSharePosition && !pos.settling && /* @__PURE__ */ jsx(CShareIconBtn, { role: "button", "aria-label": "Share position", onClick: (e) => {
15245
+ e.stopPropagation();
15246
+ onSharePosition(pos);
15247
+ }, children: /* @__PURE__ */ jsx(ShareIcon, {}) })
15248
+ ] }) }),
15249
+ (onClosePosition || onSharePosition) && /* @__PURE__ */ jsx(PositionsCell, { children: !pos.settling && /* @__PURE__ */ jsxs(CloseActions, { children: [
15250
+ onClosePosition && /* @__PURE__ */ jsx(CloseBtn, { onClick: (e) => {
15364
15251
  e.stopPropagation();
15365
15252
  onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice);
15366
15253
  }, children: "Market Sell" }),
15367
- /* @__PURE__ */ jsx(CloseBtn, { onClick: (e) => {
15254
+ onClosePosition && /* @__PURE__ */ jsx(CloseBtn, { onClick: (e) => {
15368
15255
  e.stopPropagation();
15369
15256
  onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice);
15370
15257
  }, children: "Limit Sell" })
@@ -16255,6 +16142,29 @@ var CloseBtn = styled10.button`
16255
16142
  border-color: rgba(230, 200, 126, 0.5);
16256
16143
  }
16257
16144
  `;
16145
+ var CShareIconBtn = styled10.span`
16146
+ display: inline-flex;
16147
+ align-items: center;
16148
+ justify-content: center;
16149
+ width: 26px;
16150
+ height: 26px;
16151
+ border-radius: 6px;
16152
+ color: #E6C87E;
16153
+ cursor: pointer;
16154
+ pointer-events: auto;
16155
+ transition: color 0.15s ease, background 0.15s ease;
16156
+ &:hover {
16157
+ color: #F2D898;
16158
+ background: rgba(230, 200, 126, 0.14);
16159
+ }
16160
+ &:active { background: rgba(230, 200, 126, 0.22); }
16161
+ svg { width: 15px; height: 15px; }
16162
+ `;
16163
+ var ShareIcon = () => /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
16164
+ /* @__PURE__ */ jsx("path", { d: "M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7" }),
16165
+ /* @__PURE__ */ jsx("polyline", { points: "16 6 12 2 8 6" }),
16166
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "2", x2: "12", y2: "15" })
16167
+ ] });
16258
16168
  var CloseAllHeaderBtn = styled10.button`
16259
16169
  background: rgba(230, 200, 126, 0.1);
16260
16170
  border: 1px solid rgba(230, 200, 126, 0.3);