@loafmarkets/ui 0.1.99 → 0.1.101

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.js CHANGED
@@ -2767,7 +2767,8 @@ var formatDateShort = (value) => {
2767
2767
  if (diffS < 60) return "Just now";
2768
2768
  if (diffS < 3600) return `${Math.floor(diffS / 60)}m ago`;
2769
2769
  if (diffS < 86400) return `${Math.floor(diffS / 3600)}h ago`;
2770
- return d.toLocaleDateString(void 0, { month: "short", day: "numeric" });
2770
+ const time = d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit", hour12: true });
2771
+ return `${time} \xB7 ${d.toLocaleDateString(void 0, { month: "short", day: "numeric" })}`;
2771
2772
  };
2772
2773
  var formatTimeAgo = (timestamp) => {
2773
2774
  const diff = (Date.now() - new Date(timestamp).getTime()) / 1e3;
@@ -11967,49 +11968,41 @@ function PortfolioActivityPanel({
11967
11968
  ] }),
11968
11969
  activeTab === "positions" && showPositionsTab && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11969
11970
  positions.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { children: "No positions yet. Subscribe to an offering or buy on the secondary market." }),
11970
- positions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: pageSlice(positions).map((pos) => {
11971
- const currentValue = pos.quantity * pos.marketPrice;
11972
- const costBasis = pos.quantity * pos.averageEntryPrice;
11973
- const pnl = pos.propertyPnl ?? currentValue - costBasis;
11974
- const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
11975
- const totalPortfolioValue = positions.reduce((sum, p) => sum + p.quantity * p.marketPrice, 0);
11976
- const portfolioPercent = totalPortfolioValue > 0 ? currentValue / totalPortfolioValue * 100 : 0;
11977
- const isPositive = pnl >= 0;
11978
- return /* @__PURE__ */ jsxRuntime.jsxs(HoldingsItem, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: [
11979
- /* @__PURE__ */ jsxRuntime.jsxs(HoldingsLeft, { children: [
11980
- /* @__PURE__ */ jsxRuntime.jsx(HoldingsProperty, { children: pos.tokenName }),
11981
- /* @__PURE__ */ jsxRuntime.jsxs(HoldingsPortfolio, { children: [
11982
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
11983
- portfolioPercent.toFixed(1),
11984
- "%"
11971
+ positions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11972
+ /* @__PURE__ */ jsxRuntime.jsxs(PositionsHeader, { children: [
11973
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { children: "Asset" }),
11974
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { $align: "right", children: "Size" }),
11975
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { $align: "right", children: "Value" }),
11976
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { $align: "right", children: "Entry Price" }),
11977
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { $align: "right", children: "Mark Price" }),
11978
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { $align: "right", children: "PNL (%)" })
11979
+ ] }),
11980
+ pageSlice(positions).map((pos) => {
11981
+ const currentValue = pos.quantity * pos.marketPrice;
11982
+ const costBasis = pos.quantity * pos.averageEntryPrice;
11983
+ const pnl = pos.propertyPnl ?? currentValue - costBasis;
11984
+ const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
11985
+ const isPositive = pnl >= 0;
11986
+ return /* @__PURE__ */ jsxRuntime.jsxs(PositionsRow, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: [
11987
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsx(HoldingsProperty, { children: pos.tokenName }) }),
11988
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { $align: "right", children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatNumber2(pos.quantity) }) }),
11989
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { $align: "right", children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatCurrency5(currentValue) }) }),
11990
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { $align: "right", children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: "0.8rem" }, children: formatCurrency5(pos.averageEntryPrice) }) }),
11991
+ /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { $align: "right", children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatCurrency5(pos.marketPrice) }) }),
11992
+ /* @__PURE__ */ jsxRuntime.jsxs(PositionsCell, { $align: "right", children: [
11993
+ /* @__PURE__ */ jsxRuntime.jsxs(PnLAmount, { $positive: isPositive, children: [
11994
+ isPositive ? "+" : "-",
11995
+ formatCurrency5(Math.abs(pnl))
11985
11996
  ] }),
11986
- " of portfolio"
11987
- ] })
11988
- ] }),
11989
- /* @__PURE__ */ jsxRuntime.jsxs(HoldingsQuantity, { children: [
11990
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
11991
- formatNumber2(pos.quantity),
11992
- " ",
11993
- pos.tokenName
11994
- ] }),
11995
- /* @__PURE__ */ jsxRuntime.jsxs(HoldingsAvgEntry, { children: [
11996
- "Avg ",
11997
- formatCurrency5(pos.averageEntryPrice)
11998
- ] })
11999
- ] }),
12000
- /* @__PURE__ */ jsxRuntime.jsxs(HoldingsPnL, { children: [
12001
- /* @__PURE__ */ jsxRuntime.jsxs(PnLAmount, { $positive: isPositive, children: [
12002
- isPositive ? "+" : "-",
12003
- formatCurrency5(Math.abs(pnl))
12004
- ] }),
12005
- /* @__PURE__ */ jsxRuntime.jsxs(PnLPercentage, { $positive: isPositive, children: [
12006
- isPositive ? "+" : "",
12007
- pnlPercent.toFixed(1),
12008
- "%"
11997
+ /* @__PURE__ */ jsxRuntime.jsxs(PnLPercentage, { $positive: isPositive, children: [
11998
+ isPositive ? "+" : "",
11999
+ pnlPercent.toFixed(1),
12000
+ "%"
12001
+ ] })
12009
12002
  ] })
12010
- ] })
12011
- ] }, pos.tokenName);
12012
- }) })
12003
+ ] }, pos.tokenName);
12004
+ })
12005
+ ] })
12013
12006
  ] }),
12014
12007
  activeTab === "subscriptions" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12015
12008
  offeringOrders.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { children: "IPO allocations will appear here once you subscribe." }),
@@ -12391,53 +12384,42 @@ var PaginationLabel = styled25__default.default.span`
12391
12384
  font-size: 0.8rem;
12392
12385
  color: rgba(255, 255, 255, 0.4);
12393
12386
  `;
12394
- var HoldingsItem = styled25__default.default.div`
12387
+ var PositionsHeader = styled25__default.default.div`
12388
+ display: grid;
12389
+ grid-template-columns: 1.2fr 0.8fr 1fr 1fr 1fr 1.2fr;
12390
+ gap: 0 0.5rem;
12391
+ padding: 0.4rem 0.5rem;
12392
+ border-bottom: 1px solid rgba(255, 255, 255, 0.06);
12393
+ `;
12394
+ var PositionsHeaderCell = styled25__default.default.div`
12395
+ font-size: 0.68rem;
12396
+ font-weight: 500;
12397
+ color: rgba(255, 255, 255, 0.4);
12398
+ text-align: ${(p) => p.$align || "left"};
12399
+ white-space: nowrap;
12400
+ `;
12401
+ var PositionsRow = styled25__default.default.div`
12395
12402
  display: grid;
12396
- grid-template-columns: 1fr 1fr 1fr;
12403
+ grid-template-columns: 1.2fr 0.8fr 1fr 1fr 1fr 1.2fr;
12397
12404
  align-items: center;
12398
- padding: 0.5rem 0;
12399
- min-height: 50px;
12405
+ gap: 0 0.5rem;
12406
+ padding: 0.5rem 0.5rem;
12400
12407
  cursor: pointer;
12401
- &:hover { background: rgba(255, 255, 255, 0.015); }
12408
+ border-bottom: 1px solid rgba(255, 255, 255, 0.03);
12409
+ &:last-child { border-bottom: none; }
12410
+ &:hover { background: rgba(255, 255, 255, 0.02); }
12402
12411
  `;
12403
- var HoldingsLeft = styled25__default.default.div`
12412
+ var PositionsCell = styled25__default.default.div`
12404
12413
  display: flex;
12405
12414
  flex-direction: column;
12406
- gap: 0.15rem;
12415
+ align-items: ${(p) => p.$align === "right" ? "flex-end" : "flex-start"};
12416
+ gap: 0.1rem;
12407
12417
  `;
12408
12418
  var HoldingsProperty = styled25__default.default.div`
12409
- font-size: 0.85rem;
12419
+ font-size: 0.8rem;
12410
12420
  font-weight: 600;
12411
12421
  color: #fff;
12412
12422
  `;
12413
- var HoldingsPortfolio = styled25__default.default.div`
12414
- font-size: 0.7rem;
12415
- color: rgba(255, 255, 255, 0.5);
12416
- span {
12417
- color: var(--color-accent, #E6C87E);
12418
- font-weight: 500;
12419
- }
12420
- `;
12421
- var HoldingsQuantity = styled25__default.default.div`
12422
- display: flex;
12423
- flex-direction: column;
12424
- align-items: center;
12425
- gap: 0.15rem;
12426
- font-size: 0.85rem;
12427
- font-weight: 500;
12428
- color: #fff;
12429
- `;
12430
- var HoldingsAvgEntry = styled25__default.default.div`
12431
- font-size: 0.7rem;
12432
- color: var(--color-accent, #E6C87E);
12433
- font-weight: 500;
12434
- `;
12435
- var HoldingsPnL = styled25__default.default.div`
12436
- display: flex;
12437
- flex-direction: column;
12438
- align-items: flex-end;
12439
- gap: 0.15rem;
12440
- `;
12441
12423
  var PnLAmount = styled25__default.default.div`
12442
12424
  font-size: 0.85rem;
12443
12425
  font-weight: 600;