@loafmarkets/ui 0.1.239 → 0.1.241

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
@@ -12580,6 +12580,7 @@ var progressShrink = keyframes`
12580
12580
  var VARIANT_COLORS = {
12581
12581
  success: { accent: "#0ecb81", icon: "\u2713" },
12582
12582
  error: { accent: "#f6465d", icon: "\u2715" },
12583
+ sell: { accent: "#f6465d", icon: "\u2713" },
12583
12584
  info: { accent: "#E6C656", icon: "\u2139" },
12584
12585
  pending: { accent: "#7EB3E6", icon: "\u25CC" }
12585
12586
  };
@@ -13695,6 +13696,7 @@ function PortfolioActivityPanel({
13695
13696
  tradeHistory = [],
13696
13697
  transfers = [],
13697
13698
  onCancelOrder,
13699
+ onCancelAllOrders,
13698
13700
  onAmendOrder,
13699
13701
  cancellingOrderId = null,
13700
13702
  defaultTab,
@@ -13707,6 +13709,8 @@ function PortfolioActivityPanel({
13707
13709
  const [activeTab, setActiveTab] = useState(resolvedDefaultTab);
13708
13710
  const [activityPage, setActivityPage] = useState(0);
13709
13711
  const [pendingCancelOrderId, setPendingCancelOrderId] = useState(null);
13712
+ const [cancelAllConfirmOpen, setCancelAllConfirmOpen] = useState(false);
13713
+ const [cancellingAll, setCancellingAll] = useState(false);
13710
13714
  const [closeAllOpen, setCloseAllOpen] = useState(false);
13711
13715
  const [closeAllType, setCloseAllType] = useState("market");
13712
13716
  const [posSortKey, setPosSortKey] = useState("asset");
@@ -13946,6 +13950,7 @@ function PortfolioActivityPanel({
13946
13950
  activeTab === "open-orders" && /* @__PURE__ */ jsxs(Fragment, { children: [
13947
13951
  openOrders.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "Open orders will appear here while they are working in the market." }),
13948
13952
  openOrders.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
13953
+ onCancelAllOrders && openOrdersCount > 1 && /* @__PURE__ */ jsx(CancelAllRow, { children: /* @__PURE__ */ jsx(CancelAllBtn, { type: "button", disabled: cancellingAll, onClick: () => setCancelAllConfirmOpen(true), children: "Cancel All" }) }),
13949
13954
  /* @__PURE__ */ jsxs(GridHeader, { $columns: onCancelOrder ? "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 70px" : "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr", children: [
13950
13955
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Asset" }),
13951
13956
  /* @__PURE__ */ jsx(GridHeaderCell, { children: "Side" }),
@@ -14095,6 +14100,36 @@ function PortfolioActivityPanel({
14095
14100
  }
14096
14101
  )
14097
14102
  ] }),
14103
+ cancelAllConfirmOpen && /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setCancelAllConfirmOpen(false), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
14104
+ /* @__PURE__ */ jsx(CancelConfirmTitle, { children: "Cancel All Orders" }),
14105
+ /* @__PURE__ */ jsxs(CancelConfirmBody, { children: [
14106
+ "Are you sure you want to cancel all ",
14107
+ openOrdersCount,
14108
+ " open orders? This action cannot be undone."
14109
+ ] }),
14110
+ /* @__PURE__ */ jsxs(CancelConfirmActions, { children: [
14111
+ /* @__PURE__ */ jsx(CancelConfirmDismiss, { type: "button", onClick: () => setCancelAllConfirmOpen(false), children: "Keep Orders" }),
14112
+ /* @__PURE__ */ jsx(
14113
+ CancelConfirmProceed,
14114
+ {
14115
+ type: "button",
14116
+ disabled: cancellingAll,
14117
+ onClick: async () => {
14118
+ if (onCancelAllOrders) {
14119
+ setCancellingAll(true);
14120
+ try {
14121
+ await onCancelAllOrders();
14122
+ } finally {
14123
+ setCancellingAll(false);
14124
+ }
14125
+ }
14126
+ setCancelAllConfirmOpen(false);
14127
+ },
14128
+ children: cancellingAll ? "Cancelling\u2026" : "Yes, Cancel All"
14129
+ }
14130
+ )
14131
+ ] })
14132
+ ] }) }),
14098
14133
  pendingCancelOrderId !== null && /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setPendingCancelOrderId(null), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
14099
14134
  /* @__PURE__ */ jsx(CancelConfirmTitle, { children: "Cancel Order" }),
14100
14135
  /* @__PURE__ */ jsx(CancelConfirmBody, { children: "Are you sure you want to cancel this order? This action cannot be undone." }),
@@ -14370,6 +14405,33 @@ var CancelButton = styled9.button`
14370
14405
  cursor: not-allowed;
14371
14406
  }
14372
14407
  `;
14408
+ var CancelAllRow = styled9.div`
14409
+ display: flex;
14410
+ justify-content: flex-end;
14411
+ margin-bottom: 0.4rem;
14412
+ `;
14413
+ var CancelAllBtn = styled9.button`
14414
+ background: rgba(246, 70, 93, 0.08);
14415
+ border: 1px solid rgba(246, 70, 93, 0.3);
14416
+ border-radius: 4px;
14417
+ padding: 0.2rem 0.7rem;
14418
+ font-size: 0.62rem;
14419
+ font-weight: 600;
14420
+ color: #f6465d;
14421
+ cursor: pointer;
14422
+ white-space: nowrap;
14423
+ transition: all 0.15s ease;
14424
+
14425
+ &:hover {
14426
+ background: rgba(246, 70, 93, 0.18);
14427
+ border-color: rgba(246, 70, 93, 0.5);
14428
+ }
14429
+
14430
+ &:disabled {
14431
+ opacity: 0.4;
14432
+ cursor: not-allowed;
14433
+ }
14434
+ `;
14373
14435
  var GridHeader = styled9.div`
14374
14436
  display: grid;
14375
14437
  grid-template-columns: ${(p) => p.$columns};