@loafmarkets/ui 0.1.48 → 0.1.49

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
@@ -5690,7 +5690,9 @@ var UserButton = styled24.button.attrs({ type: "button" })`
5690
5690
  var DropdownMenu = styled24.div`
5691
5691
  position: absolute;
5692
5692
  top: 100%;
5693
- left: 0;
5693
+ /* Anchor to the button's right edge so a short label (narrow button) near
5694
+ the viewport's right edge doesn't push the 180px-wide panel off-screen. */
5695
+ right: 0;
5694
5696
  margin-top: 0.25rem;
5695
5697
  background-color: #0d1117;
5696
5698
  border-radius: 8px;
@@ -11744,10 +11746,16 @@ function OrderConfirmationModal({
11744
11746
  estExposure,
11745
11747
  orderTotal,
11746
11748
  availableBalance,
11747
- onConfirm
11749
+ onConfirm,
11750
+ isPlacing = false,
11751
+ placingLabel = "Placing order\u2026"
11748
11752
  }) {
11749
11753
  if (!open) return null;
11750
- return /* @__PURE__ */ jsx(Overlay3, { onClick: onClose, children: /* @__PURE__ */ jsxs(Modal, { onClick: (e) => e.stopPropagation(), children: [
11754
+ const handleOverlayClose = () => {
11755
+ if (isPlacing) return;
11756
+ onClose();
11757
+ };
11758
+ return /* @__PURE__ */ jsx(Overlay3, { onClick: handleOverlayClose, children: /* @__PURE__ */ jsxs(Modal, { onClick: (e) => e.stopPropagation(), children: [
11751
11759
  /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsxs("h3", { children: [
11752
11760
  "Confirm Order",
11753
11761
  /* @__PURE__ */ jsx(Badge2, { children: "Subscribe" })
@@ -11802,8 +11810,29 @@ function OrderConfirmationModal({
11802
11810
  "."
11803
11811
  ] }),
11804
11812
  /* @__PURE__ */ jsxs(ButtonRow2, { children: [
11805
- /* @__PURE__ */ jsx("button", { type: "button", onClick: onClose, className: "secondary", children: "Cancel" }),
11806
- !hasInsufficientFunds && /* @__PURE__ */ jsx("button", { type: "button", onClick: onConfirm, className: "primary", children: "Place Order" })
11813
+ /* @__PURE__ */ jsx(
11814
+ "button",
11815
+ {
11816
+ type: "button",
11817
+ onClick: onClose,
11818
+ className: "secondary",
11819
+ disabled: isPlacing,
11820
+ children: "Cancel"
11821
+ }
11822
+ ),
11823
+ !hasInsufficientFunds && /* @__PURE__ */ jsx(
11824
+ "button",
11825
+ {
11826
+ type: "button",
11827
+ onClick: onConfirm,
11828
+ className: "primary",
11829
+ disabled: isPlacing,
11830
+ children: isPlacing ? /* @__PURE__ */ jsxs(Fragment, { children: [
11831
+ /* @__PURE__ */ jsx(Spinner, { "aria-hidden": true }),
11832
+ /* @__PURE__ */ jsx("span", { children: placingLabel })
11833
+ ] }) : "Place Order"
11834
+ }
11835
+ )
11807
11836
  ] })
11808
11837
  ] }) });
11809
11838
  }
@@ -11914,6 +11943,20 @@ var Summary = styled24.div`
11914
11943
  font-size: 0.9rem;
11915
11944
  line-height: 1.5;
11916
11945
  `;
11946
+ var spin = keyframes`
11947
+ to { transform: rotate(360deg); }
11948
+ `;
11949
+ var Spinner = styled24.span`
11950
+ display: inline-block;
11951
+ width: 14px;
11952
+ height: 14px;
11953
+ border-radius: 50%;
11954
+ border: 2px solid rgba(255, 255, 255, 0.35);
11955
+ border-top-color: #fff;
11956
+ animation: ${spin} 0.7s linear infinite;
11957
+ margin-right: 0.5rem;
11958
+ vertical-align: -2px;
11959
+ `;
11917
11960
  var ButtonRow2 = styled24.div`
11918
11961
  display: flex;
11919
11962
  gap: 1rem;
@@ -11924,6 +11967,13 @@ var ButtonRow2 = styled24.div`
11924
11967
  font-weight: 600;
11925
11968
  font-size: 0.95rem;
11926
11969
  cursor: pointer;
11970
+ display: inline-flex;
11971
+ align-items: center;
11972
+ justify-content: center;
11973
+ }
11974
+ button:disabled {
11975
+ cursor: not-allowed;
11976
+ opacity: 0.75;
11927
11977
  }
11928
11978
  .secondary {
11929
11979
  background: rgba(255,255,255,0.1);
@@ -12267,7 +12317,9 @@ function PropertyBuy({
12267
12317
  estExposure,
12268
12318
  orderTotal,
12269
12319
  availableBalance,
12270
- onConfirm: confirmOrder
12320
+ onConfirm: confirmOrder,
12321
+ isPlacing: isPurchaseInFlight,
12322
+ placingLabel: purchaseStatus === "checking-allowance" ? "Checking allowance\u2026" : purchaseStatus === "approving" ? "Approving USDL\u2026" : purchaseStatus === "purchasing" ? "Confirming purchase\u2026" : purchaseStatus === "pending-allocation" ? "Awaiting allocation\u2026" : "Placing order\u2026"
12271
12323
  }
12272
12324
  )
12273
12325
  ] });