@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 +60 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -78
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2741,7 +2741,8 @@ var formatDateShort = (value) => {
|
|
|
2741
2741
|
if (diffS < 60) return "Just now";
|
|
2742
2742
|
if (diffS < 3600) return `${Math.floor(diffS / 60)}m ago`;
|
|
2743
2743
|
if (diffS < 86400) return `${Math.floor(diffS / 3600)}h ago`;
|
|
2744
|
-
|
|
2744
|
+
const time = d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit", hour12: true });
|
|
2745
|
+
return `${time} \xB7 ${d.toLocaleDateString(void 0, { month: "short", day: "numeric" })}`;
|
|
2745
2746
|
};
|
|
2746
2747
|
var formatTimeAgo = (timestamp) => {
|
|
2747
2748
|
const diff = (Date.now() - new Date(timestamp).getTime()) / 1e3;
|
|
@@ -11941,49 +11942,41 @@ function PortfolioActivityPanel({
|
|
|
11941
11942
|
] }),
|
|
11942
11943
|
activeTab === "positions" && showPositionsTab && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11943
11944
|
positions.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "No positions yet. Subscribe to an offering or buy on the secondary market." }),
|
|
11944
|
-
positions.length > 0 && /* @__PURE__ */
|
|
11945
|
-
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11945
|
+
positions.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11946
|
+
/* @__PURE__ */ jsxs(PositionsHeader, { children: [
|
|
11947
|
+
/* @__PURE__ */ jsx(PositionsHeaderCell, { children: "Asset" }),
|
|
11948
|
+
/* @__PURE__ */ jsx(PositionsHeaderCell, { $align: "right", children: "Size" }),
|
|
11949
|
+
/* @__PURE__ */ jsx(PositionsHeaderCell, { $align: "right", children: "Value" }),
|
|
11950
|
+
/* @__PURE__ */ jsx(PositionsHeaderCell, { $align: "right", children: "Entry Price" }),
|
|
11951
|
+
/* @__PURE__ */ jsx(PositionsHeaderCell, { $align: "right", children: "Mark Price" }),
|
|
11952
|
+
/* @__PURE__ */ jsx(PositionsHeaderCell, { $align: "right", children: "PNL (%)" })
|
|
11953
|
+
] }),
|
|
11954
|
+
pageSlice(positions).map((pos) => {
|
|
11955
|
+
const currentValue = pos.quantity * pos.marketPrice;
|
|
11956
|
+
const costBasis = pos.quantity * pos.averageEntryPrice;
|
|
11957
|
+
const pnl = pos.propertyPnl ?? currentValue - costBasis;
|
|
11958
|
+
const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
|
|
11959
|
+
const isPositive = pnl >= 0;
|
|
11960
|
+
return /* @__PURE__ */ jsxs(PositionsRow, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: [
|
|
11961
|
+
/* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsx(HoldingsProperty, { children: pos.tokenName }) }),
|
|
11962
|
+
/* @__PURE__ */ jsx(PositionsCell, { $align: "right", children: /* @__PURE__ */ jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatNumber2(pos.quantity) }) }),
|
|
11963
|
+
/* @__PURE__ */ jsx(PositionsCell, { $align: "right", children: /* @__PURE__ */ jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatCurrency5(currentValue) }) }),
|
|
11964
|
+
/* @__PURE__ */ jsx(PositionsCell, { $align: "right", children: /* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: "0.8rem" }, children: formatCurrency5(pos.averageEntryPrice) }) }),
|
|
11965
|
+
/* @__PURE__ */ jsx(PositionsCell, { $align: "right", children: /* @__PURE__ */ jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatCurrency5(pos.marketPrice) }) }),
|
|
11966
|
+
/* @__PURE__ */ jsxs(PositionsCell, { $align: "right", children: [
|
|
11967
|
+
/* @__PURE__ */ jsxs(PnLAmount, { $positive: isPositive, children: [
|
|
11968
|
+
isPositive ? "+" : "-",
|
|
11969
|
+
formatCurrency5(Math.abs(pnl))
|
|
11959
11970
|
] }),
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
formatNumber2(pos.quantity),
|
|
11966
|
-
" ",
|
|
11967
|
-
pos.tokenName
|
|
11968
|
-
] }),
|
|
11969
|
-
/* @__PURE__ */ jsxs(HoldingsAvgEntry, { children: [
|
|
11970
|
-
"Avg ",
|
|
11971
|
-
formatCurrency5(pos.averageEntryPrice)
|
|
11972
|
-
] })
|
|
11973
|
-
] }),
|
|
11974
|
-
/* @__PURE__ */ jsxs(HoldingsPnL, { children: [
|
|
11975
|
-
/* @__PURE__ */ jsxs(PnLAmount, { $positive: isPositive, children: [
|
|
11976
|
-
isPositive ? "+" : "-",
|
|
11977
|
-
formatCurrency5(Math.abs(pnl))
|
|
11978
|
-
] }),
|
|
11979
|
-
/* @__PURE__ */ jsxs(PnLPercentage, { $positive: isPositive, children: [
|
|
11980
|
-
isPositive ? "+" : "",
|
|
11981
|
-
pnlPercent.toFixed(1),
|
|
11982
|
-
"%"
|
|
11971
|
+
/* @__PURE__ */ jsxs(PnLPercentage, { $positive: isPositive, children: [
|
|
11972
|
+
isPositive ? "+" : "",
|
|
11973
|
+
pnlPercent.toFixed(1),
|
|
11974
|
+
"%"
|
|
11975
|
+
] })
|
|
11983
11976
|
] })
|
|
11984
|
-
] })
|
|
11985
|
-
|
|
11986
|
-
|
|
11977
|
+
] }, pos.tokenName);
|
|
11978
|
+
})
|
|
11979
|
+
] })
|
|
11987
11980
|
] }),
|
|
11988
11981
|
activeTab === "subscriptions" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11989
11982
|
offeringOrders.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "IPO allocations will appear here once you subscribe." }),
|
|
@@ -12365,53 +12358,42 @@ var PaginationLabel = styled25.span`
|
|
|
12365
12358
|
font-size: 0.8rem;
|
|
12366
12359
|
color: rgba(255, 255, 255, 0.4);
|
|
12367
12360
|
`;
|
|
12368
|
-
var
|
|
12361
|
+
var PositionsHeader = styled25.div`
|
|
12362
|
+
display: grid;
|
|
12363
|
+
grid-template-columns: 1.2fr 0.8fr 1fr 1fr 1fr 1.2fr;
|
|
12364
|
+
gap: 0 0.5rem;
|
|
12365
|
+
padding: 0.4rem 0.5rem;
|
|
12366
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
|
12367
|
+
`;
|
|
12368
|
+
var PositionsHeaderCell = styled25.div`
|
|
12369
|
+
font-size: 0.68rem;
|
|
12370
|
+
font-weight: 500;
|
|
12371
|
+
color: rgba(255, 255, 255, 0.4);
|
|
12372
|
+
text-align: ${(p) => p.$align || "left"};
|
|
12373
|
+
white-space: nowrap;
|
|
12374
|
+
`;
|
|
12375
|
+
var PositionsRow = styled25.div`
|
|
12369
12376
|
display: grid;
|
|
12370
|
-
grid-template-columns: 1fr 1fr 1fr;
|
|
12377
|
+
grid-template-columns: 1.2fr 0.8fr 1fr 1fr 1fr 1.2fr;
|
|
12371
12378
|
align-items: center;
|
|
12372
|
-
|
|
12373
|
-
|
|
12379
|
+
gap: 0 0.5rem;
|
|
12380
|
+
padding: 0.5rem 0.5rem;
|
|
12374
12381
|
cursor: pointer;
|
|
12375
|
-
|
|
12382
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.03);
|
|
12383
|
+
&:last-child { border-bottom: none; }
|
|
12384
|
+
&:hover { background: rgba(255, 255, 255, 0.02); }
|
|
12376
12385
|
`;
|
|
12377
|
-
var
|
|
12386
|
+
var PositionsCell = styled25.div`
|
|
12378
12387
|
display: flex;
|
|
12379
12388
|
flex-direction: column;
|
|
12380
|
-
|
|
12389
|
+
align-items: ${(p) => p.$align === "right" ? "flex-end" : "flex-start"};
|
|
12390
|
+
gap: 0.1rem;
|
|
12381
12391
|
`;
|
|
12382
12392
|
var HoldingsProperty = styled25.div`
|
|
12383
|
-
font-size: 0.
|
|
12393
|
+
font-size: 0.8rem;
|
|
12384
12394
|
font-weight: 600;
|
|
12385
12395
|
color: #fff;
|
|
12386
12396
|
`;
|
|
12387
|
-
var HoldingsPortfolio = styled25.div`
|
|
12388
|
-
font-size: 0.7rem;
|
|
12389
|
-
color: rgba(255, 255, 255, 0.5);
|
|
12390
|
-
span {
|
|
12391
|
-
color: var(--color-accent, #E6C87E);
|
|
12392
|
-
font-weight: 500;
|
|
12393
|
-
}
|
|
12394
|
-
`;
|
|
12395
|
-
var HoldingsQuantity = styled25.div`
|
|
12396
|
-
display: flex;
|
|
12397
|
-
flex-direction: column;
|
|
12398
|
-
align-items: center;
|
|
12399
|
-
gap: 0.15rem;
|
|
12400
|
-
font-size: 0.85rem;
|
|
12401
|
-
font-weight: 500;
|
|
12402
|
-
color: #fff;
|
|
12403
|
-
`;
|
|
12404
|
-
var HoldingsAvgEntry = styled25.div`
|
|
12405
|
-
font-size: 0.7rem;
|
|
12406
|
-
color: var(--color-accent, #E6C87E);
|
|
12407
|
-
font-weight: 500;
|
|
12408
|
-
`;
|
|
12409
|
-
var HoldingsPnL = styled25.div`
|
|
12410
|
-
display: flex;
|
|
12411
|
-
flex-direction: column;
|
|
12412
|
-
align-items: flex-end;
|
|
12413
|
-
gap: 0.15rem;
|
|
12414
|
-
`;
|
|
12415
12397
|
var PnLAmount = styled25.div`
|
|
12416
12398
|
font-size: 0.85rem;
|
|
12417
12399
|
font-weight: 600;
|