@loafmarkets/ui 0.1.430 → 0.1.432

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
@@ -1167,9 +1167,9 @@ type PropertyInspectionTimesProps = {
1167
1167
  declare function PropertyInspectionTimes({ isAuthenticated, slots, loading, error, bookingSlotId, bookingStatus, bookingError, onBook, onRetry, onSignIn, }: PropertyInspectionTimesProps): react_jsx_runtime.JSX.Element;
1168
1168
 
1169
1169
  type OrderSide = 'BUY' | 'SELL';
1170
- type OrderType = 'MARKET' | 'LIMIT';
1170
+ type OrderType = 'MARKET' | 'LIMIT' | 'STOP_LIMIT' | 'STOP_MARKET' | 'TAKE_LIMIT' | 'TAKE_MARKET';
1171
1171
  type TimeInForce = 'GTC' | 'IOC' | 'FOK' | 'GTD';
1172
- type OrderStatus = 'OPEN' | 'PARTIALLY_FILLED' | 'FILLED' | 'CANCELLED' | 'REJECTED';
1172
+ type OrderStatus = 'OPEN' | 'PARTIALLY_FILLED' | 'FILLED' | 'CANCELLED' | 'REJECTED' | 'PENDING' | 'ARMED' | 'PLACED' | 'FAILED';
1173
1173
  interface OfferingOrder {
1174
1174
  readonly ipoOrderId?: number;
1175
1175
  readonly tokenName: string;
@@ -1193,10 +1193,13 @@ interface OrderHistoryItem {
1193
1193
  readonly quantity: number;
1194
1194
  readonly price: number | null;
1195
1195
  readonly status: OrderStatus;
1196
- readonly filledQuantity: number;
1196
+ /** Absent on a conditional order — its fills belong to the order it places (shared-types src/index.ts:308). */
1197
+ readonly filledQuantity?: number;
1197
1198
  readonly rejectionReason: string | null;
1198
1199
  readonly deadline: number;
1199
- readonly filledAt: number | null;
1200
+ readonly filledAt?: number | null;
1201
+ /** Stop/take and TP/SL legs only. */
1202
+ readonly triggerPrice?: number;
1200
1203
  readonly cancelledAt: number | null;
1201
1204
  readonly createdAt: number;
1202
1205
  readonly isOfferingOrder?: boolean;
package/dist/index.d.ts CHANGED
@@ -1167,9 +1167,9 @@ type PropertyInspectionTimesProps = {
1167
1167
  declare function PropertyInspectionTimes({ isAuthenticated, slots, loading, error, bookingSlotId, bookingStatus, bookingError, onBook, onRetry, onSignIn, }: PropertyInspectionTimesProps): react_jsx_runtime.JSX.Element;
1168
1168
 
1169
1169
  type OrderSide = 'BUY' | 'SELL';
1170
- type OrderType = 'MARKET' | 'LIMIT';
1170
+ type OrderType = 'MARKET' | 'LIMIT' | 'STOP_LIMIT' | 'STOP_MARKET' | 'TAKE_LIMIT' | 'TAKE_MARKET';
1171
1171
  type TimeInForce = 'GTC' | 'IOC' | 'FOK' | 'GTD';
1172
- type OrderStatus = 'OPEN' | 'PARTIALLY_FILLED' | 'FILLED' | 'CANCELLED' | 'REJECTED';
1172
+ type OrderStatus = 'OPEN' | 'PARTIALLY_FILLED' | 'FILLED' | 'CANCELLED' | 'REJECTED' | 'PENDING' | 'ARMED' | 'PLACED' | 'FAILED';
1173
1173
  interface OfferingOrder {
1174
1174
  readonly ipoOrderId?: number;
1175
1175
  readonly tokenName: string;
@@ -1193,10 +1193,13 @@ interface OrderHistoryItem {
1193
1193
  readonly quantity: number;
1194
1194
  readonly price: number | null;
1195
1195
  readonly status: OrderStatus;
1196
- readonly filledQuantity: number;
1196
+ /** Absent on a conditional order — its fills belong to the order it places (shared-types src/index.ts:308). */
1197
+ readonly filledQuantity?: number;
1197
1198
  readonly rejectionReason: string | null;
1198
1199
  readonly deadline: number;
1199
- readonly filledAt: number | null;
1200
+ readonly filledAt?: number | null;
1201
+ /** Stop/take and TP/SL legs only. */
1202
+ readonly triggerPrice?: number;
1200
1203
  readonly cancelledAt: number | null;
1201
1204
  readonly createdAt: number;
1202
1205
  readonly isOfferingOrder?: boolean;
package/dist/index.js CHANGED
@@ -16717,12 +16717,39 @@ var TickerTag = styled10__default.default.span`
16717
16717
  margin-left: 0.3rem;
16718
16718
  `;
16719
16719
  var sideLabel = (side) => side?.toUpperCase() === "SELL" ? "Sell" : "Buy";
16720
+ var isLiveOrder = (o) => o.status === "OPEN" || o.status === "PARTIALLY_FILLED" || o.status === "PENDING" || o.status === "ARMED";
16721
+ var isMarketType = (type) => type === "MARKET" || type.endsWith("_MARKET");
16722
+ var filledLabel = (order) => order.filledQuantity == null ? "\u2014" : `${order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0}%`;
16723
+ var ReasonMarker = styled10__default.default.span`
16724
+ display: inline-flex;
16725
+ align-items: center;
16726
+ justify-content: center;
16727
+ width: 0.95rem;
16728
+ height: 0.95rem;
16729
+ margin-left: 0.3rem;
16730
+ border: 1px solid rgba(246, 70, 93, 0.5);
16731
+ border-radius: 50%;
16732
+ color: #f6465d;
16733
+ font-size: 0.6rem;
16734
+ font-style: italic;
16735
+ font-weight: 600;
16736
+ line-height: 1;
16737
+ cursor: help;
16738
+ flex-shrink: 0;
16739
+ `;
16740
+ var TriggerText = styled10__default.default.span`
16741
+ display: block;
16742
+ font-size: 0.68rem;
16743
+ color: rgba(255, 255, 255, 0.5);
16744
+ font-variant-numeric: tabular-nums;
16745
+ margin-top: 0.1rem;
16746
+ `;
16720
16747
  var getOrderStatusMeta = (statusRaw) => {
16721
16748
  const status = statusRaw.toUpperCase();
16722
- if (status === "FILLED" || status === "CONFIRMED" || status === "ALLOCATED") {
16749
+ if (status === "FILLED" || status === "CONFIRMED" || status === "ALLOCATED" || status === "PLACED") {
16723
16750
  return { color: "#0ecb81", bg: "rgba(14,203,129,0.1)" };
16724
16751
  }
16725
- if (status === "CANCELLED" || status === "CANCELED" || status === "REJECTED") {
16752
+ if (status === "CANCELLED" || status === "CANCELED" || status === "REJECTED" || status === "FAILED") {
16726
16753
  return { color: "#f6465d", bg: "rgba(246,70,93,0.12)" };
16727
16754
  }
16728
16755
  return { color: "#E6C87E", bg: "rgba(240,185,11,0.15)" };
@@ -16937,14 +16964,12 @@ function PortfolioActivityPanel({
16937
16964
  [transfers]
16938
16965
  );
16939
16966
  const positionsCount = positions.length;
16940
- const openOrdersCount = React9.useMemo(
16941
- () => openOrders.filter((o) => o.status === "OPEN" || o.status === "PARTIALLY_FILLED").length,
16967
+ const openOrdersCount = React9.useMemo(() => openOrders.filter(isLiveOrder).length, [openOrders]);
16968
+ const cancellableOrdersCount = React9.useMemo(
16969
+ () => openOrders.filter((o) => !o.isOfferingOrder && isLiveOrder(o)).length,
16942
16970
  [openOrders]
16943
16971
  );
16944
- const pendingHistoryCount = React9.useMemo(
16945
- () => mergedOrderHistory.filter((o) => o.status === "OPEN" || o.status === "PARTIALLY_FILLED").length,
16946
- [mergedOrderHistory]
16947
- );
16972
+ const pendingHistoryCount = React9.useMemo(() => mergedOrderHistory.filter(isLiveOrder).length, [mergedOrderHistory]);
16948
16973
  const pendingOfferingsCount = React9.useMemo(
16949
16974
  () => offeringOrders.filter((o) => {
16950
16975
  const s = o.status.toUpperCase();
@@ -17269,7 +17294,7 @@ function PortfolioActivityPanel({
17269
17294
  /* @__PURE__ */ jsxRuntime.jsx(CDValue, { children: formatTimestamp(order.createdAt) })
17270
17295
  ] })
17271
17296
  ] }),
17272
- order.status === "REJECTED" && order.rejectionReason && /* @__PURE__ */ jsxRuntime.jsx(CDValue, { style: { marginTop: "0.4rem", color: "#f6465d", fontSize: "0.7rem" }, children: order.rejectionReason })
17297
+ order.rejectionReason && /* @__PURE__ */ jsxRuntime.jsx(CDValue, { style: { marginTop: "0.4rem", color: "#f6465d", fontSize: "0.7rem" }, children: order.rejectionReason })
17273
17298
  ] })
17274
17299
  ] }, rowKey);
17275
17300
  }),
@@ -17295,7 +17320,7 @@ function PortfolioActivityPanel({
17295
17320
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { children: formatCurrency4(order.price * order.quantity) }) }),
17296
17321
  /* @__PURE__ */ jsxRuntime.jsxs(GridCell, { children: [
17297
17322
  /* @__PURE__ */ jsxRuntime.jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, title: order.status === "REJECTED" && order.rejectionReason ? order.rejectionReason : void 0, children: prettyLabel(order.status) }),
17298
- order.status === "REJECTED" && order.rejectionReason && /* @__PURE__ */ jsxRuntime.jsx(CellText, { $muted: true, style: { fontSize: "0.62rem", marginTop: "0.2rem", maxWidth: "120px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: order.rejectionReason, children: order.rejectionReason })
17323
+ order.rejectionReason && /* @__PURE__ */ jsxRuntime.jsx(CellText, { $muted: true, style: { fontSize: "0.62rem", marginTop: "0.2rem", maxWidth: "120px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: order.rejectionReason, children: order.rejectionReason })
17299
17324
  ] }),
17300
17325
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $muted: true, children: formatTimestamp(order.createdAt) }) }),
17301
17326
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: order.txHash && /* @__PURE__ */ jsxRuntime.jsx(TxLink, { href: `${_blockExplorerBaseUrl}/${order.txHash}`, target: "_blank", rel: "noopener noreferrer", title: "View on Arbiscan", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -17310,10 +17335,10 @@ function PortfolioActivityPanel({
17310
17335
  activeTab === "open-orders" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17311
17336
  openOrders.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { children: "Open orders will appear here while they are working in the market." }),
17312
17337
  openOrders.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17313
- compactPositions && onCancelAllOrders && openOrdersCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(CancelAllRow, { children: /* @__PURE__ */ jsxRuntime.jsx(CancelAllBtn, { type: "button", disabled: cancellingAll, onClick: () => setCancelAllConfirmOpen(true), children: "Cancel All" }) }),
17338
+ compactPositions && onCancelAllOrders && cancellableOrdersCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(CancelAllRow, { children: /* @__PURE__ */ jsxRuntime.jsx(CancelAllBtn, { type: "button", disabled: cancellingAll, onClick: () => setCancelAllConfirmOpen(true), children: "Cancel All" }) }),
17314
17339
  compactPositions ? sortedOpenOrders.map((order) => {
17315
17340
  const meta = getOrderStatusMeta(order.status);
17316
- const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
17341
+ const filledPercent = filledLabel(order);
17317
17342
  const isCancelling = cancellingOrderId === order.id;
17318
17343
  const ordExpanded = expandedOpenOrders.has(order.id);
17319
17344
  const sideColor = sideLabel(order.side) === "Buy" ? "#0ecb81" : "#f6465d";
@@ -17328,8 +17353,7 @@ function PortfolioActivityPanel({
17328
17353
  ] }),
17329
17354
  /* @__PURE__ */ jsxRuntime.jsxs(CUnitsCell, { children: [
17330
17355
  /* @__PURE__ */ jsxRuntime.jsx(CCellLabel, { children: "Filled" }),
17331
- filledPercent,
17332
- "%"
17356
+ filledPercent
17333
17357
  ] }),
17334
17358
  /* @__PURE__ */ jsxRuntime.jsxs(CUnitsCell, { children: [
17335
17359
  /* @__PURE__ */ jsxRuntime.jsx(CCellLabel, { children: "Qty" }),
@@ -17352,7 +17376,13 @@ function PortfolioActivityPanel({
17352
17376
  ] }),
17353
17377
  /* @__PURE__ */ jsxRuntime.jsxs(CDetailItem, { children: [
17354
17378
  /* @__PURE__ */ jsxRuntime.jsx(CDLabel, { children: "Price" }),
17355
- /* @__PURE__ */ jsxRuntime.jsx(CDValue, { children: order.type === "MARKET" || !order.price ? "Market" : formatCurrency4(order.price) })
17379
+ /* @__PURE__ */ jsxRuntime.jsxs(CDValue, { children: [
17380
+ isMarketType(order.type) || !order.price ? "Market" : formatCurrency4(order.price),
17381
+ order.triggerPrice != null && /* @__PURE__ */ jsxRuntime.jsxs(TriggerText, { children: [
17382
+ "Trigger ",
17383
+ formatCurrency4(order.triggerPrice)
17384
+ ] })
17385
+ ] })
17356
17386
  ] }),
17357
17387
  /* @__PURE__ */ jsxRuntime.jsxs(CDetailItem, { children: [
17358
17388
  /* @__PURE__ */ jsxRuntime.jsx(CDLabel, { children: "Status" }),
@@ -17374,7 +17404,7 @@ function PortfolioActivityPanel({
17374
17404
  ] })
17375
17405
  ] }, `open-${order.id}`);
17376
17406
  }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17377
- /* @__PURE__ */ jsxRuntime.jsxs(GridHeader, { $columns: onCancelOrder ? "0.5fr 1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 82px" : "0.5fr 1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr", children: [
17407
+ /* @__PURE__ */ jsxRuntime.jsxs(GridHeader, { $columns: onCancelOrder ? "0.45fr 1.05fr 0.55fr 1fr 0.8fr 1.1fr 0.7fr 0.85fr 82px" : "0.45fr 1.05fr 0.55fr 1fr 0.8fr 1.1fr 0.7fr 0.85fr", children: [
17378
17408
  /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "ID" }),
17379
17409
  /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Asset" }),
17380
17410
  /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Side" }),
@@ -17383,15 +17413,15 @@ function PortfolioActivityPanel({
17383
17413
  /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Price" }),
17384
17414
  /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Filled" }),
17385
17415
  /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Status" }),
17386
- onCancelOrder && /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: onCancelAllOrders && openOrdersCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(CancelButton, { type: "button", disabled: cancellingAll, onClick: () => setCancelAllConfirmOpen(true), children: "Cancel All" }) })
17416
+ onCancelOrder && /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: onCancelAllOrders && cancellableOrdersCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(CancelButton, { type: "button", disabled: cancellingAll, onClick: () => setCancelAllConfirmOpen(true), children: "Cancel All" }) })
17387
17417
  ] }),
17388
17418
  pagedOpenOrders.map((order) => {
17389
17419
  const meta = getOrderStatusMeta(order.status);
17390
- const isMarket = order.type === "MARKET";
17391
- const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
17420
+ const isMarket = isMarketType(order.type);
17421
+ const filledPercent = filledLabel(order);
17392
17422
  const isCancelling = cancellingOrderId === order.id;
17393
17423
  const sideColor = sideLabel(order.side) === "Buy" ? "#0ecb81" : "#f6465d";
17394
- return /* @__PURE__ */ jsxRuntime.jsxs(GridRow, { $columns: onCancelOrder ? "0.5fr 1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 82px" : "0.5fr 1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr", children: [
17424
+ return /* @__PURE__ */ jsxRuntime.jsxs(GridRow, { $columns: onCancelOrder ? "0.45fr 1.05fr 0.55fr 1fr 0.8fr 1.1fr 0.7fr 0.85fr 82px" : "0.45fr 1.05fr 0.55fr 1fr 0.8fr 1.1fr 0.7fr 0.85fr", children: [
17395
17425
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $muted: true, children: order.id > 0 ? `#${order.id}` : "\u2014" }) }),
17396
17426
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $primary: true, $color: sideColor, $noHoverColor: true, $clickable: !!onAssetClick, onClick: onAssetClick ? () => onAssetClick(order.tokenName) : void 0, children: order.tokenName }) }),
17397
17427
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(SideBadge, { $side: sideLabel(order.side), children: sideLabel(order.side) }) }),
@@ -17400,12 +17430,18 @@ function PortfolioActivityPanel({
17400
17430
  formatNumber2(order.quantity),
17401
17431
  order.ticker && /* @__PURE__ */ jsxRuntime.jsx(TickerTag, { children: order.ticker.toUpperCase() })
17402
17432
  ] }) }),
17403
- /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { children: isMarket || !order.price ? "Market" : formatCurrency4(order.price) }) }),
17404
- /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsxs(CellText, { $muted: true, children: [
17405
- filledPercent,
17406
- "%"
17407
- ] }) }),
17408
- /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }) }),
17433
+ /* @__PURE__ */ jsxRuntime.jsxs(GridCell, { $stack: order.triggerPrice != null, children: [
17434
+ /* @__PURE__ */ jsxRuntime.jsx(CellText, { children: isMarket || !order.price ? "Market" : formatCurrency4(order.price) }),
17435
+ order.triggerPrice != null && /* @__PURE__ */ jsxRuntime.jsxs(TriggerText, { children: [
17436
+ "Trigger ",
17437
+ formatCurrency4(order.triggerPrice)
17438
+ ] })
17439
+ ] }),
17440
+ /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $muted: true, children: filledPercent }) }),
17441
+ /* @__PURE__ */ jsxRuntime.jsxs(GridCell, { children: [
17442
+ /* @__PURE__ */ jsxRuntime.jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }),
17443
+ order.triggerPrice != null && order.rejectionReason && /* @__PURE__ */ jsxRuntime.jsx(ReasonMarker, { title: order.rejectionReason, "aria-label": "Why this order failed", children: "i" })
17444
+ ] }),
17409
17445
  onCancelOrder && /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(
17410
17446
  CancelButton,
17411
17447
  {
@@ -17427,7 +17463,7 @@ function PortfolioActivityPanel({
17427
17463
  mergedOrderHistory.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { children: "No orders yet. Place a trade to see it appear here." }),
17428
17464
  mergedOrderHistory.length > 0 && compactPositions && pagedOrderHistory.map((order) => {
17429
17465
  const meta = getOrderStatusMeta(order.status);
17430
- const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
17466
+ const filledPercent = filledLabel(order);
17431
17467
  const typeLabel = order.isOfferingOrder ? "Initial Offering" : prettyLabel(order.type);
17432
17468
  const sideColor = sideLabel(order.side) === "Buy" ? "#0ecb81" : "#f6465d";
17433
17469
  const rowKey = `oh-${order.id}`;
@@ -17466,26 +17502,29 @@ function PortfolioActivityPanel({
17466
17502
  ] }),
17467
17503
  /* @__PURE__ */ jsxRuntime.jsxs(CDetailItem, { children: [
17468
17504
  /* @__PURE__ */ jsxRuntime.jsx(CDLabel, { children: "Price" }),
17469
- /* @__PURE__ */ jsxRuntime.jsx(CDValue, { children: order.type === "MARKET" || !order.price ? "Market" : formatCurrency4(order.price) })
17505
+ /* @__PURE__ */ jsxRuntime.jsxs(CDValue, { children: [
17506
+ isMarketType(order.type) || !order.price ? "Market" : formatCurrency4(order.price),
17507
+ order.triggerPrice != null && /* @__PURE__ */ jsxRuntime.jsxs(TriggerText, { children: [
17508
+ "Trigger ",
17509
+ formatCurrency4(order.triggerPrice)
17510
+ ] })
17511
+ ] })
17470
17512
  ] }),
17471
17513
  /* @__PURE__ */ jsxRuntime.jsxs(CDetailItem, { children: [
17472
17514
  /* @__PURE__ */ jsxRuntime.jsx(CDLabel, { children: "Filled" }),
17473
- /* @__PURE__ */ jsxRuntime.jsxs(CDValue, { children: [
17474
- filledPercent,
17475
- "%"
17476
- ] })
17515
+ /* @__PURE__ */ jsxRuntime.jsx(CDValue, { children: filledPercent })
17477
17516
  ] }),
17478
17517
  /* @__PURE__ */ jsxRuntime.jsxs(CDetailItem, { children: [
17479
17518
  /* @__PURE__ */ jsxRuntime.jsx(CDLabel, { children: "Date" }),
17480
17519
  /* @__PURE__ */ jsxRuntime.jsx(CDValue, { children: formatTimestamp(order.createdAt) })
17481
17520
  ] })
17482
17521
  ] }),
17483
- order.status === "REJECTED" && order.rejectionReason && /* @__PURE__ */ jsxRuntime.jsx(CDValue, { style: { marginTop: "0.4rem", color: "#f6465d", fontSize: "0.7rem" }, children: order.rejectionReason })
17522
+ order.rejectionReason && /* @__PURE__ */ jsxRuntime.jsx(CDValue, { style: { marginTop: "0.4rem", color: "#f6465d", fontSize: "0.7rem" }, children: order.rejectionReason })
17484
17523
  ] })
17485
17524
  ] }, rowKey);
17486
17525
  }),
17487
17526
  mergedOrderHistory.length > 0 && !compactPositions && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17488
- /* @__PURE__ */ jsxRuntime.jsxs(GridHeader, { $columns: "0.5fr 1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 1fr", children: [
17527
+ /* @__PURE__ */ jsxRuntime.jsxs(GridHeader, { $columns: "0.45fr 1.05fr 0.55fr 1fr 0.8fr 1.1fr 0.7fr 0.85fr 1fr", children: [
17489
17528
  /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "ID" }),
17490
17529
  /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Asset" }),
17491
17530
  /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Side" }),
@@ -17498,11 +17537,11 @@ function PortfolioActivityPanel({
17498
17537
  ] }),
17499
17538
  pagedOrderHistory.map((order) => {
17500
17539
  const meta = getOrderStatusMeta(order.status);
17501
- const isMarket = order.type === "MARKET";
17502
- const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
17540
+ const isMarket = isMarketType(order.type);
17541
+ const filledPercent = filledLabel(order);
17503
17542
  const typeLabel = order.isOfferingOrder ? "Initial Offering" : prettyLabel(order.type);
17504
17543
  const sideColor = sideLabel(order.side) === "Buy" ? "#0ecb81" : "#f6465d";
17505
- return /* @__PURE__ */ jsxRuntime.jsxs(GridRow, { $columns: "0.5fr 1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 1fr", children: [
17544
+ return /* @__PURE__ */ jsxRuntime.jsxs(GridRow, { $columns: "0.45fr 1.05fr 0.55fr 1fr 0.8fr 1.1fr 0.7fr 0.85fr 1fr", children: [
17506
17545
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $muted: true, children: order.id > 0 ? `#${order.id}` : "\u2014" }) }),
17507
17546
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $primary: true, $color: sideColor, $noHoverColor: true, $clickable: !!onAssetClick, onClick: onAssetClick ? () => onAssetClick(order.tokenName) : void 0, children: order.tokenName }) }),
17508
17547
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(SideBadge, { $side: sideLabel(order.side), children: sideLabel(order.side) }) }),
@@ -17511,12 +17550,18 @@ function PortfolioActivityPanel({
17511
17550
  formatNumber2(order.quantity),
17512
17551
  order.ticker && /* @__PURE__ */ jsxRuntime.jsx(TickerTag, { children: order.ticker.toUpperCase() })
17513
17552
  ] }) }),
17514
- /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { children: isMarket || !order.price ? "Market" : formatCurrency4(order.price) }) }),
17515
- /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsxs(CellText, { $muted: true, children: [
17516
- filledPercent,
17517
- "%"
17518
- ] }) }),
17519
- /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }) }),
17553
+ /* @__PURE__ */ jsxRuntime.jsxs(GridCell, { $stack: order.triggerPrice != null, children: [
17554
+ /* @__PURE__ */ jsxRuntime.jsx(CellText, { children: isMarket || !order.price ? "Market" : formatCurrency4(order.price) }),
17555
+ order.triggerPrice != null && /* @__PURE__ */ jsxRuntime.jsxs(TriggerText, { children: [
17556
+ "Trigger ",
17557
+ formatCurrency4(order.triggerPrice)
17558
+ ] })
17559
+ ] }),
17560
+ /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $muted: true, children: filledPercent }) }),
17561
+ /* @__PURE__ */ jsxRuntime.jsxs(GridCell, { children: [
17562
+ /* @__PURE__ */ jsxRuntime.jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }),
17563
+ order.triggerPrice != null && order.rejectionReason && /* @__PURE__ */ jsxRuntime.jsx(ReasonMarker, { title: order.rejectionReason, "aria-label": "Why this order failed", children: "i" })
17564
+ ] }),
17520
17565
  /* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $muted: true, children: formatTimestamp(order.createdAt) }) })
17521
17566
  ] }, order.id);
17522
17567
  })
@@ -17720,7 +17765,7 @@ function PortfolioActivityPanel({
17720
17765
  /* @__PURE__ */ jsxRuntime.jsx(CancelConfirmTitle, { children: "Cancel All Orders" }),
17721
17766
  /* @__PURE__ */ jsxRuntime.jsxs(CancelConfirmBody, { children: [
17722
17767
  "Are you sure you want to cancel all ",
17723
- openOrdersCount,
17768
+ cancellableOrdersCount,
17724
17769
  " open orders? This action cannot be undone."
17725
17770
  ] }),
17726
17771
  /* @__PURE__ */ jsxRuntime.jsxs(CancelConfirmActions, { children: [
@@ -17988,7 +18033,9 @@ var GridRow = styled10__default.default.div`
17988
18033
  `;
17989
18034
  var GridCell = styled10__default.default.div`
17990
18035
  display: flex;
17991
- align-items: center;
18036
+ align-items: ${(p) => p.$stack ? "flex-start" : "center"};
18037
+ flex-direction: ${(p) => p.$stack ? "column" : "row"};
18038
+ justify-content: center;
17992
18039
  min-width: 0;
17993
18040
  `;
17994
18041
  var CellText = styled10__default.default.span`