@glacislabs/stablegenie-zerodelta 4.14.2 → 4.15.0

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.cjs CHANGED
@@ -3567,7 +3567,7 @@ var CHANNEL_HEADER = "x-zd-channel";
3567
3567
  var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
3568
3568
  var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
3569
3569
  var WIDGET_CHANNEL = "widget";
3570
- var WIDGET_VERSION = "4.14.2" ;
3570
+ var WIDGET_VERSION = "4.15.0" ;
3571
3571
  var MAX_CHANNEL_VERSION_LEN = 32;
3572
3572
  function sanitizeVersion(raw2) {
3573
3573
  const v = String(raw2).trim();
@@ -6172,13 +6172,13 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
6172
6172
  .sg-ws-back:hover{color:var(--sg-text)}
6173
6173
  .sg-ws-close{display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:8px;background:transparent;color:#a7a9be;cursor:pointer}
6174
6174
  .sg-ws-close:hover{color:var(--sg-text)}
6175
- .sg-ws-back:focus-visible,.sg-ws-close:focus-visible,.sg-ws-icon-btn:focus-visible,.sg-ws-action:focus-visible,.sg-ws-sum:focus-visible,.sg-rcp-opt:focus-visible,.sg-rcp-custom:focus-visible,.sg-rcp-change:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
6175
+ .sg-ws-back:focus-visible,.sg-ws-close:focus-visible,.sg-ws-icon-btn:focus-visible,.sg-ws-action:focus-visible,.sg-ws-sum:focus-visible,.sg-rcp-opt:focus-visible,.sg-rcp-custom:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
6176
6176
  .sg-ws-main{display:flex;flex-direction:column;gap:16px}
6177
6177
  .sg-ws-title{margin:0;font-family:var(--sg-font-display);font-size:16px;font-weight:600;line-height:1.2;letter-spacing:.32px;color:var(--sg-t90)}
6178
6178
  .sg-ws[data-wide]{gap:16px}
6179
6179
  .sg-ws[data-wide] .sg-ws-sum-lead{min-width:0}
6180
6180
  .sg-ws[data-wide] .sg-ws-sum-text{overflow:hidden;text-overflow:ellipsis}
6181
- .sg-widget[data-sg-mode="dark"] :is(.sg-ws-action,.sg-rcp-custom,.sg-rcp-change,.sg-ws-icon-btn,.sg-rcp-tick){color:var(--sg-info)}
6181
+ .sg-widget[data-sg-mode="dark"] :is(.sg-ws-action,.sg-rcp-custom,.sg-rcp-value[data-tone="choose"],.sg-ws-icon-btn,.sg-rcp-tick){color:var(--sg-info)}
6182
6182
  .sg-ws[data-wide] .sg-ws-back{font-size:12px;font-weight:400}
6183
6183
  .sg-ws[data-wide] .sg-ws-title{font-family:var(--sg-font);font-size:18px;font-weight:500;letter-spacing:0}
6184
6184
  .sg-ws-list{display:flex;flex-direction:column;gap:4px}
@@ -6223,16 +6223,20 @@ button.sg-ws-sum{cursor:pointer}
6223
6223
  .sg-ws-foot{flex:0 0 auto}
6224
6224
  .sg-btn.sg-ws-cta{height:44px;min-height:44px;padding:0 24px}
6225
6225
  .sg-btn.sg-ws-cta:disabled{opacity:.2;cursor:not-allowed}
6226
- .sg-rcp-row{display:flex;align-items:center;justify-content:space-between;gap:8px;box-sizing:border-box;width:100%;padding:12px 16px;border-radius:24px;background:var(--sg-a4);font-size:12px;line-height:1.2;white-space:nowrap}
6226
+ .sg-rcp-row{display:flex;align-items:center;justify-content:space-between;gap:8px;box-sizing:border-box;width:100%;padding:12px 16px;border:0;border-radius:24px;background:var(--sg-a4);color:inherit;font:inherit;font-size:12px;line-height:1.2;text-align:left;white-space:nowrap}
6227
+ button.sg-rcp-row{cursor:pointer}
6228
+ button.sg-rcp-row:hover:not(:disabled){background:color-mix(in srgb,var(--sg-accent) 8%,transparent)}
6229
+ button.sg-rcp-row[data-wide]:hover:not(:disabled){background:var(--sg-a4)}
6230
+ button.sg-rcp-row:disabled{cursor:not-allowed;opacity:.6}
6231
+ button.sg-rcp-row:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
6227
6232
  .sg-rcp-row[data-wide]{background:transparent;border:1px solid var(--sg-a12);padding:12px 16px}
6228
6233
  .sg-rcp-row[data-tone="error"]{white-space:normal;color:var(--sg-danger);background:color-mix(in srgb,var(--sg-danger) 8%,transparent)}
6229
6234
  .sg-rcp-label{color:var(--sg-t60)}
6230
- .sg-rcp-end{display:inline-flex;align-items:center;gap:8px;min-width:0}
6231
- .sg-rcp-value{color:var(--sg-t90);overflow:hidden;text-overflow:ellipsis}
6232
- .sg-rcp-value[data-empty]{color:var(--sg-t50)}
6233
- .sg-rcp-change{padding:0;border:0;background:transparent;font:inherit;font-size:12px;font-weight:500;line-height:1.4;color:var(--sg-accent);cursor:pointer}
6234
- .sg-rcp-change:hover:not(:disabled){text-decoration:underline}
6235
- .sg-rcp-change:disabled{opacity:.5;cursor:not-allowed}
6235
+ .sg-rcp-end{display:inline-flex;align-items:center;gap:4px;min-width:0}
6236
+ .sg-rcp-end svg{flex:0 0 auto;color:var(--sg-t80)}
6237
+ .sg-rcp-value{color:var(--sg-t90);font-weight:500;overflow:hidden;text-overflow:ellipsis}
6238
+ .sg-rcp-value[data-tone="choose"]{color:var(--sg-accent)}
6239
+ .sg-rcp-value[data-empty]{color:var(--sg-t50);font-weight:400}
6236
6240
  .sg-rcp-opt{display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;width:100%;padding:18px 16px;border:1px solid var(--sg-a12);border-radius:24px;background:transparent;color:var(--sg-text);font:inherit;text-align:left;cursor:pointer}
6237
6241
  .sg-rcp-opt[data-selected]{border-color:transparent;background:var(--sg-a4)}
6238
6242
  .sg-rcp-opt:hover:not(:disabled):not([data-selected]){border-color:color-mix(in srgb,var(--sg-accent) 40%,transparent)}
@@ -6243,10 +6247,17 @@ button.sg-ws-sum{cursor:pointer}
6243
6247
  .sg-rcp-custom[data-open]{flex-direction:column;align-items:stretch;gap:8px;border-color:transparent;background:var(--sg-a4);cursor:default}
6244
6248
  .sg-rcp-custom-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
6245
6249
  .sg-rcp-custom-head label{cursor:text}
6246
- .sg-rcp-input{box-sizing:border-box;width:100%;padding:11px 16px;border:1px solid var(--sg-a12);border-radius:12px;background:var(--sg-bg);color:var(--sg-t90);font:inherit;font-size:12px;font-weight:400;line-height:1.2;outline:none;text-overflow:ellipsis}
6250
+ .sg-rcp-input{display:block;box-sizing:border-box;width:100%;margin:0;padding:11px 12px;border:1px solid var(--sg-a12);border-radius:12px;background:var(--sg-bg);color:var(--sg-t90);font:inherit;font-size:12px;font-weight:400;line-height:1.2;outline:none;resize:none;overflow:hidden;word-break:break-all;overflow-wrap:anywhere}
6247
6251
  .sg-rcp-input::placeholder{color:var(--sg-t50)}
6248
6252
  .sg-rcp-input:focus{border-color:var(--sg-accent)}
6249
- .sg-rcp-input[aria-invalid="true"]{border-color:var(--sg-danger)}
6253
+ .sg-rcp-input[aria-invalid="true"]{border-color:color-mix(in srgb,var(--sg-flag) 12%,transparent)}
6254
+ .sg-rcp-input[aria-invalid="true"]:focus{border-color:color-mix(in srgb,var(--sg-flag) 40%,transparent)}
6255
+ .sg-rcp-custom[data-invalid]{background:color-mix(in srgb,var(--sg-flag) 6%,transparent)}
6256
+ .sg-rcp-custom[data-invalid] .sg-rcp-custom-head label{color:var(--sg-t90)}
6257
+ .sg-rcp-custom[data-invalid] .sg-ws-error{font-size:11px;line-height:1.2;color:var(--sg-flag)}
6258
+ .sg-rcp-bad{display:flex;color:var(--sg-flag);opacity:.8;flex:0 0 auto}
6259
+ /* The wide card beside an open sheet draws its disabled CTA like the sheet's own (Figma 3155:50731, 20%). */
6260
+ .sg-duo .sg-cta-wrap .sg-btn:disabled{opacity:.2}
6250
6261
  .sg-rcp-hint{margin:0;font-size:12px;font-weight:400;line-height:1.2;color:var(--sg-t60)}
6251
6262
  .sg-widget[data-sg-takeover]{display:flex;flex-direction:column}
6252
6263
  .sg-widget[data-sg-takeover]>.sg-head,.sg-widget[data-sg-takeover]>.sg-foot{display:none}
@@ -8541,8 +8552,8 @@ function ShieldTickBold() {
8541
8552
  }
8542
8553
  ) });
8543
8554
  }
8544
- function CloseCircleBold() {
8545
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
8555
+ function CloseCircleBold({ size = 14 }) {
8556
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
8546
8557
  "path",
8547
8558
  {
8548
8559
  fill: "currentColor",
@@ -8631,9 +8642,7 @@ function SheetFrame(props) {
8631
8642
  }
8632
8643
  function WalletChip(props) {
8633
8644
  const count = props.addresses.length;
8634
- if (!count) {
8635
- return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-wallet", onClick: props.onConnect, disabled: props.connecting, children: props.connecting ? "Connecting\u2026" : "Connect wallet" });
8636
- }
8645
+ if (!count) return null;
8637
8646
  const label2 = count === 1 ? chipShort(props.addresses[0]) : `${count} wallets`;
8638
8647
  return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", ref: props.btnRef, className: "sg-wallet", "data-connected": "true", onClick: props.onOpen, disabled: props.disabled, "aria-haspopup": "dialog", "aria-label": `Wallets: ${label2}`, children: [
8639
8648
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-wallet-dot", "aria-hidden": "true" }),
@@ -8708,19 +8717,44 @@ function RecipientRow({ state, disabled, wide }) {
8708
8717
  if (state.error) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-rcp-row", "data-wide": wide || void 0, "data-tone": "error", role: "alert", children: state.error });
8709
8718
  const address = state.shown;
8710
8719
  if (!address && !state.managed) return null;
8711
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-row", "data-wide": wide || void 0, children: [
8712
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-label", children: "Recipient" }),
8713
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-end", children: [
8714
- address ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-value", title: address, children: [
8715
- FAMILY_LABEL[state.recipientFamily],
8716
- " \xB7 ",
8717
- chipShort(address)
8718
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-value", "data-empty": "true", children: "Not set" }),
8719
- state.managed ? /* @__PURE__ */ jsxRuntime.jsx("button", { ref: state.triggerRef, type: "button", className: "sg-rcp-change", onClick: state.show, disabled, "aria-haspopup": "dialog", children: address ? "Change" : "Add" }) : null
8720
- ] })
8721
- ] });
8720
+ const value = address ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-value", title: address, children: [
8721
+ FAMILY_LABEL[state.recipientFamily],
8722
+ " \xB7 ",
8723
+ chipShort(address)
8724
+ ] }) : state.missing ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-value", "data-tone": "choose", children: "Choose" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-value", "data-empty": "true", children: "--" });
8725
+ if (!state.managed) {
8726
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-row", "data-wide": wide || void 0, children: [
8727
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-label", children: "Recipient" }),
8728
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-end", children: value })
8729
+ ] });
8730
+ }
8731
+ return /* @__PURE__ */ jsxRuntime.jsxs(
8732
+ "button",
8733
+ {
8734
+ ref: state.triggerRef,
8735
+ type: "button",
8736
+ className: "sg-rcp-row",
8737
+ "data-wide": wide || void 0,
8738
+ onClick: state.show,
8739
+ disabled,
8740
+ "aria-haspopup": "dialog",
8741
+ "aria-label": address ? `Recipient: ${FAMILY_LABEL[state.recipientFamily]} ${chipShort(address)}. Change recipient` : "Choose recipient",
8742
+ children: [
8743
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-label", children: "Recipient" }),
8744
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-end", children: [
8745
+ value,
8746
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, {})
8747
+ ] })
8748
+ ]
8749
+ }
8750
+ );
8722
8751
  }
8723
- function RecipientSheet({ state, wide, minHeight }) {
8752
+ function RecipientSheet({
8753
+ state,
8754
+ wide,
8755
+ minHeight,
8756
+ onPending
8757
+ }) {
8724
8758
  const family = state.recipientFamily;
8725
8759
  const label2 = FAMILY_LABEL[family];
8726
8760
  const eligible = state.wallets.filter((w) => w.eligible);
@@ -8730,7 +8764,6 @@ function RecipientSheet({ state, wide, minHeight }) {
8730
8764
  return current ? { kind: "wallet", address: current.address } : { kind: "custom" };
8731
8765
  });
8732
8766
  const [draft, setDraft] = react.useState(state.typed);
8733
- const [editing, setEditing] = react.useState(false);
8734
8767
  const id = react.useId();
8735
8768
  const inputRef = react.useRef(null);
8736
8769
  const noWallet = family === "solana" && !state.familyWallet.address && !state.familyWallet.wallets.length;
@@ -8742,6 +8775,30 @@ function RecipientSheet({ state, wide, minHeight }) {
8742
8775
  const chosenWallet = choice.kind === "wallet" ? eligible.find((w) => w.address === choice.address) : void 0;
8743
8776
  const ready = choice.kind === "wallet" ? Boolean(chosenWallet) : valid;
8744
8777
  const custom = choice.kind === "custom";
8778
+ const appliedWallet = state.typed ? null : state.recipient ?? state.shown ?? null;
8779
+ const pending = choice.kind === "custom" ? !state.typed || draft.trim() !== state.typed : choice.address !== appliedWallet;
8780
+ const pendingRef = react.useRef(onPending);
8781
+ pendingRef.current = onPending;
8782
+ react.useEffect(() => pendingRef.current?.(pending), [pending]);
8783
+ react.useEffect(() => () => pendingRef.current?.(false), []);
8784
+ react.useLayoutEffect(() => {
8785
+ const el = inputRef.current;
8786
+ if (!el) return;
8787
+ const fit = () => {
8788
+ el.style.height = "auto";
8789
+ el.style.height = `${el.scrollHeight + (el.offsetHeight - el.clientHeight)}px`;
8790
+ };
8791
+ fit();
8792
+ if (typeof ResizeObserver === "undefined") return;
8793
+ let width = el.clientWidth;
8794
+ const observer = new ResizeObserver(() => {
8795
+ if (el.clientWidth === width) return;
8796
+ width = el.clientWidth;
8797
+ fit();
8798
+ });
8799
+ observer.observe(el);
8800
+ return () => observer.disconnect();
8801
+ }, [draft, custom, wide]);
8745
8802
  react.useEffect(() => {
8746
8803
  if (custom) inputRef.current?.focus();
8747
8804
  }, [custom]);
@@ -8798,33 +8855,35 @@ function RecipientSheet({ state, wide, minHeight }) {
8798
8855
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: wallet.name }),
8799
8856
  /* @__PURE__ */ jsxRuntime.jsx(AddCircle, {})
8800
8857
  ] }, wallet.name)) : null,
8801
- custom ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-custom", "data-open": "true", children: [
8858
+ custom ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-custom", "data-open": "true", "data-invalid": invalid || void 0, children: [
8802
8859
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-custom-head", children: [
8803
8860
  /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, children: "Add another address" }),
8804
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-tick", children: /* @__PURE__ */ jsxRuntime.jsx(Tick2, {}) })
8861
+ invalid ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-bad", children: /* @__PURE__ */ jsxRuntime.jsx(CloseCircleBold, { size: 16 }) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-tick", children: /* @__PURE__ */ jsxRuntime.jsx(Tick2, {}) })
8805
8862
  ] }),
8806
8863
  /* @__PURE__ */ jsxRuntime.jsx(
8807
- "input",
8864
+ "textarea",
8808
8865
  {
8809
8866
  ref: inputRef,
8867
+ rows: 1,
8810
8868
  id,
8811
8869
  className: "sg-rcp-input",
8812
8870
  placeholder: family === "solana" ? "Solana recipient address" : "0x...Recipient address",
8813
8871
  "aria-label": `${label2} recipient address`,
8814
8872
  "aria-invalid": invalid || void 0,
8815
8873
  "aria-describedby": invalid ? `${id}-error` : void 0,
8816
- value: editing || draft.length <= 34 ? draft : `${draft.slice(0, 13)}..${draft.slice(-15)}`,
8817
- onFocus: () => setEditing(true),
8818
- onBlur: () => setEditing(false),
8819
- onChange: (event) => setDraft(event.target.value),
8874
+ value: draft,
8875
+ onChange: (event) => setDraft(event.target.value.replace(/\s+/g, "")),
8820
8876
  onKeyDown: (event) => {
8821
- if (event.key === "Enter") confirm();
8877
+ if (event.key === "Enter") {
8878
+ event.preventDefault();
8879
+ confirm();
8880
+ }
8822
8881
  },
8823
8882
  spellCheck: false,
8824
8883
  autoComplete: "off"
8825
8884
  }
8826
8885
  ),
8827
- invalid ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${id}-error`, className: "sg-ws-error", children: shapeOk && !checksumOk ? "Checksum does not match. Check the address for a typo." : `Not a valid ${label2} address.` }) : null,
8886
+ invalid ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${id}-error`, className: "sg-ws-error", children: shapeOk && !checksumOk ? "Checksum does not match. Check the address for a typo." : `Enter a valid ${label2} address` }) : null,
8828
8887
  noWallet ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "sg-rcp-hint", children: [
8829
8888
  "No ",
8830
8889
  label2,
@@ -10975,6 +11034,8 @@ function ExchangeCard(props) {
10975
11034
  const title = config.title || (mode === "onramp" ? "Buy stablecoins" : mode === "offramp" ? "Cash out" : "Exchange");
10976
11035
  const soonLabel = mode === "onramp" ? "On-ramp coming soon" : "Off-ramp coming soon";
10977
11036
  const quotePaused = solActive ? false : addressed ? flow.quotePaused : idle2 && preview.status === "ready";
11037
+ const [recipientPending, setRecipientPending] = react.useState(false);
11038
+ const recipientLocked = wide && recipientState.open && recipientPending;
10978
11039
  const ctaLabel = rampMode ? soonLabel : submitting ? "Exchanging\u2026" : connected2 && flow.quoteStale ? flow.quotePaused ? "Refresh quote" : "Refreshing quote\u2026" : flow.insufficient ? "Insufficient balance" : flow.nativeShortfall || "Exchange";
10979
11040
  const selected = addressed ? flow.selected : null;
10980
11041
  const hasQuote = Boolean(quotable && !quoting && !quoteError && receive);
@@ -11008,8 +11069,6 @@ function ExchangeCard(props) {
11008
11069
  WalletChip,
11009
11070
  {
11010
11071
  addresses: sheetWallets.map((w) => w.address),
11011
- connecting: wallet.connecting,
11012
- onConnect: wallet.connect,
11013
11072
  btnRef: walletChipRef,
11014
11073
  disabled: submitting,
11015
11074
  onOpen: () => {
@@ -11078,7 +11137,7 @@ function ExchangeCard(props) {
11078
11137
  connect: !wallet.account ? { family: "evm", onClick: () => void wallet.connect(), busy: wallet.connecting } : !solanaWallet.address ? { family: "solana", onClick: (name) => void solanaWallet.connect(name), busy: solanaWallet.status === "connecting", choices: solanaWallet.wallets.map((w) => w.name) } : void 0,
11079
11138
  error: solanaWallet.error || wallet.error
11080
11139
  }
11081
- ) : recipientState.open ? /* @__PURE__ */ jsxRuntime.jsx(RecipientSheet, { state: recipientState, wide }) : sheet === "compliance" ? /* @__PURE__ */ jsxRuntime.jsx(ComplianceSheet, { compliance, direct: selected?.state === "DIRECT", hasQuote: complianceHasQuote, onClose: closeSheet }) : sheet === "quote" && hasQuote ? /* @__PURE__ */ jsxRuntime.jsx(
11140
+ ) : recipientState.open ? /* @__PURE__ */ jsxRuntime.jsx(RecipientSheet, { state: recipientState, wide, onPending: wide ? setRecipientPending : void 0 }) : sheet === "compliance" ? /* @__PURE__ */ jsxRuntime.jsx(ComplianceSheet, { compliance, direct: selected?.state === "DIRECT", hasQuote: complianceHasQuote, onClose: closeSheet }) : sheet === "quote" && hasQuote ? /* @__PURE__ */ jsxRuntime.jsx(
11082
11141
  QuoteSheet,
11083
11142
  {
11084
11143
  onClose: closeSheet,
@@ -11115,7 +11174,7 @@ function ExchangeCard(props) {
11115
11174
  {
11116
11175
  onClick: solFlow.run,
11117
11176
  busy: submitting,
11118
- disabled: !quotable || !cryptoReady || !!recipientState.error || !solFlow.plan || solFlow.insufficient || solFlow.solShort || solFlow.status === "quoting",
11177
+ disabled: recipientLocked || !quotable || !cryptoReady || !!recipientState.error || !solFlow.plan || solFlow.insufficient || solFlow.solShort || solFlow.status === "quoting",
11119
11178
  children: solFlow.status === "preparing" ? "Preparing order\u2026" : solFlow.status === "submitting" ? "Submitting\u2026" : solFlow.insufficient ? "Insufficient balance" : solFlow.solShort ? "Not enough SOL for network fees" : solFlow.status === "failed" ? "Try again" : !solFlow.plan ? "Exchange" : solFlow.needsPreparation ? "Continue in wallet" : "Submit"
11120
11179
  }
11121
11180
  );
@@ -11209,7 +11268,7 @@ function ExchangeCard(props) {
11209
11268
  "Connect ",
11210
11269
  recipientState.recipientFamily === "solana" ? "Solana" : "EVM",
11211
11270
  " wallet"
11212
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: rampMode ? void 0 : flow.submit, busy: submitting, disabled: needsRecipient || rampMode || !quotable || !cryptoReady || connected2 && (!flow.selected || flow.insufficient || !!flow.nativeShortfall || flow.status === "loading"), children: ctaLabel }),
11271
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: rampMode ? void 0 : flow.submit, busy: submitting, disabled: needsRecipient || recipientLocked || rampMode || !quotable || !cryptoReady || connected2 && (!flow.selected || flow.insufficient || !!flow.nativeShortfall || flow.status === "loading"), children: ctaLabel }),
11213
11272
  wallet.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: wallet.error }) : null
11214
11273
  ] });
11215
11274
  const notices = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -11230,7 +11289,7 @@ function ExchangeCard(props) {
11230
11289
  ] }),
11231
11290
  amountField,
11232
11291
  amountNoteEl,
11233
- /* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode !== "onramp" && fromBal ? shortBalance(fromBal.formatted) : null })
11292
+ /* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode === "onramp" ? null : fromBal ? shortBalance(fromBal.formatted) : connected2 ? null : "--" })
11234
11293
  ] })
11235
11294
  ] }),
11236
11295
  notices,
@@ -11248,7 +11307,7 @@ function ExchangeCard(props) {
11248
11307
  payToken
11249
11308
  ] }),
11250
11309
  amountNoteEl,
11251
- /* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode !== "onramp" && fromBal ? shortBalance(fromBal.formatted) : null })
11310
+ /* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode === "onramp" ? null : fromBal ? shortBalance(fromBal.formatted) : connected2 ? null : "--" })
11252
11311
  ] }),
11253
11312
  /* @__PURE__ */ jsxRuntime.jsx(FlipButton, { onClick: flip, disabled: !flippable }),
11254
11313
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-pane", "data-kind": "receive", children: [
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { CompliancePanel, PaymentIsland, StableGenieExchange, StableGeniePay, StableGenieProvider, StableGenieRwaExchange, StableGenieSwap, connectSolanaWallet, darkTheme, disconnectSolanaWallet, discoverSolanaWallets, lightTheme, mount, onSolanaAccountChange, resolveTheme, solanaWalletSigner, useSolanaWallet, watchSolanaWallets } from './chunk-DE25V6DB.js';
2
- export { EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, TRADEABLE_RWA_ASSETS, assetClassOf, brokenLaneReason, complianceChecks, complianceControlsLine, complianceView, counterpartTokens, createEngine, destinationAvailability, formatJurisdiction, humanizeComplianceReason, symbolKey } from './chunk-MVUMYVDR.js';
1
+ export { CompliancePanel, PaymentIsland, StableGenieExchange, StableGeniePay, StableGenieProvider, StableGenieRwaExchange, StableGenieSwap, connectSolanaWallet, darkTheme, disconnectSolanaWallet, discoverSolanaWallets, lightTheme, mount, onSolanaAccountChange, resolveTheme, solanaWalletSigner, useSolanaWallet, watchSolanaWallets } from './chunk-3U5Z5CC3.js';
2
+ export { EXECUTABLE_STABLE_ASSETS, STABLE_ASSETS, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, TRADEABLE_RWA_ASSETS, assetClassOf, brokenLaneReason, complianceChecks, complianceControlsLine, complianceView, counterpartTokens, createEngine, destinationAvailability, formatJurisdiction, humanizeComplianceReason, symbolKey } from './chunk-GWQKWJJA.js';
package/dist/mount.cjs CHANGED
@@ -3548,7 +3548,7 @@ var CHANNEL_HEADER = "x-zd-channel";
3548
3548
  var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
3549
3549
  var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
3550
3550
  var WIDGET_CHANNEL = "widget";
3551
- var WIDGET_VERSION = "4.14.2" ;
3551
+ var WIDGET_VERSION = "4.15.0" ;
3552
3552
  var MAX_CHANNEL_VERSION_LEN = 32;
3553
3553
  function sanitizeVersion(raw2) {
3554
3554
  const v = String(raw2).trim();
@@ -6153,13 +6153,13 @@ img.sg-tok-badge{width:16px;padding:0;object-fit:cover;background:var(--sg-bg)}
6153
6153
  .sg-ws-back:hover{color:var(--sg-text)}
6154
6154
  .sg-ws-close{display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:8px;background:transparent;color:#a7a9be;cursor:pointer}
6155
6155
  .sg-ws-close:hover{color:var(--sg-text)}
6156
- .sg-ws-back:focus-visible,.sg-ws-close:focus-visible,.sg-ws-icon-btn:focus-visible,.sg-ws-action:focus-visible,.sg-ws-sum:focus-visible,.sg-rcp-opt:focus-visible,.sg-rcp-custom:focus-visible,.sg-rcp-change:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
6156
+ .sg-ws-back:focus-visible,.sg-ws-close:focus-visible,.sg-ws-icon-btn:focus-visible,.sg-ws-action:focus-visible,.sg-ws-sum:focus-visible,.sg-rcp-opt:focus-visible,.sg-rcp-custom:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
6157
6157
  .sg-ws-main{display:flex;flex-direction:column;gap:16px}
6158
6158
  .sg-ws-title{margin:0;font-family:var(--sg-font-display);font-size:16px;font-weight:600;line-height:1.2;letter-spacing:.32px;color:var(--sg-t90)}
6159
6159
  .sg-ws[data-wide]{gap:16px}
6160
6160
  .sg-ws[data-wide] .sg-ws-sum-lead{min-width:0}
6161
6161
  .sg-ws[data-wide] .sg-ws-sum-text{overflow:hidden;text-overflow:ellipsis}
6162
- .sg-widget[data-sg-mode="dark"] :is(.sg-ws-action,.sg-rcp-custom,.sg-rcp-change,.sg-ws-icon-btn,.sg-rcp-tick){color:var(--sg-info)}
6162
+ .sg-widget[data-sg-mode="dark"] :is(.sg-ws-action,.sg-rcp-custom,.sg-rcp-value[data-tone="choose"],.sg-ws-icon-btn,.sg-rcp-tick){color:var(--sg-info)}
6163
6163
  .sg-ws[data-wide] .sg-ws-back{font-size:12px;font-weight:400}
6164
6164
  .sg-ws[data-wide] .sg-ws-title{font-family:var(--sg-font);font-size:18px;font-weight:500;letter-spacing:0}
6165
6165
  .sg-ws-list{display:flex;flex-direction:column;gap:4px}
@@ -6204,16 +6204,20 @@ button.sg-ws-sum{cursor:pointer}
6204
6204
  .sg-ws-foot{flex:0 0 auto}
6205
6205
  .sg-btn.sg-ws-cta{height:44px;min-height:44px;padding:0 24px}
6206
6206
  .sg-btn.sg-ws-cta:disabled{opacity:.2;cursor:not-allowed}
6207
- .sg-rcp-row{display:flex;align-items:center;justify-content:space-between;gap:8px;box-sizing:border-box;width:100%;padding:12px 16px;border-radius:24px;background:var(--sg-a4);font-size:12px;line-height:1.2;white-space:nowrap}
6207
+ .sg-rcp-row{display:flex;align-items:center;justify-content:space-between;gap:8px;box-sizing:border-box;width:100%;padding:12px 16px;border:0;border-radius:24px;background:var(--sg-a4);color:inherit;font:inherit;font-size:12px;line-height:1.2;text-align:left;white-space:nowrap}
6208
+ button.sg-rcp-row{cursor:pointer}
6209
+ button.sg-rcp-row:hover:not(:disabled){background:color-mix(in srgb,var(--sg-accent) 8%,transparent)}
6210
+ button.sg-rcp-row[data-wide]:hover:not(:disabled){background:var(--sg-a4)}
6211
+ button.sg-rcp-row:disabled{cursor:not-allowed;opacity:.6}
6212
+ button.sg-rcp-row:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}
6208
6213
  .sg-rcp-row[data-wide]{background:transparent;border:1px solid var(--sg-a12);padding:12px 16px}
6209
6214
  .sg-rcp-row[data-tone="error"]{white-space:normal;color:var(--sg-danger);background:color-mix(in srgb,var(--sg-danger) 8%,transparent)}
6210
6215
  .sg-rcp-label{color:var(--sg-t60)}
6211
- .sg-rcp-end{display:inline-flex;align-items:center;gap:8px;min-width:0}
6212
- .sg-rcp-value{color:var(--sg-t90);overflow:hidden;text-overflow:ellipsis}
6213
- .sg-rcp-value[data-empty]{color:var(--sg-t50)}
6214
- .sg-rcp-change{padding:0;border:0;background:transparent;font:inherit;font-size:12px;font-weight:500;line-height:1.4;color:var(--sg-accent);cursor:pointer}
6215
- .sg-rcp-change:hover:not(:disabled){text-decoration:underline}
6216
- .sg-rcp-change:disabled{opacity:.5;cursor:not-allowed}
6216
+ .sg-rcp-end{display:inline-flex;align-items:center;gap:4px;min-width:0}
6217
+ .sg-rcp-end svg{flex:0 0 auto;color:var(--sg-t80)}
6218
+ .sg-rcp-value{color:var(--sg-t90);font-weight:500;overflow:hidden;text-overflow:ellipsis}
6219
+ .sg-rcp-value[data-tone="choose"]{color:var(--sg-accent)}
6220
+ .sg-rcp-value[data-empty]{color:var(--sg-t50);font-weight:400}
6217
6221
  .sg-rcp-opt{display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;width:100%;padding:18px 16px;border:1px solid var(--sg-a12);border-radius:24px;background:transparent;color:var(--sg-text);font:inherit;text-align:left;cursor:pointer}
6218
6222
  .sg-rcp-opt[data-selected]{border-color:transparent;background:var(--sg-a4)}
6219
6223
  .sg-rcp-opt:hover:not(:disabled):not([data-selected]){border-color:color-mix(in srgb,var(--sg-accent) 40%,transparent)}
@@ -6224,10 +6228,17 @@ button.sg-ws-sum{cursor:pointer}
6224
6228
  .sg-rcp-custom[data-open]{flex-direction:column;align-items:stretch;gap:8px;border-color:transparent;background:var(--sg-a4);cursor:default}
6225
6229
  .sg-rcp-custom-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
6226
6230
  .sg-rcp-custom-head label{cursor:text}
6227
- .sg-rcp-input{box-sizing:border-box;width:100%;padding:11px 16px;border:1px solid var(--sg-a12);border-radius:12px;background:var(--sg-bg);color:var(--sg-t90);font:inherit;font-size:12px;font-weight:400;line-height:1.2;outline:none;text-overflow:ellipsis}
6231
+ .sg-rcp-input{display:block;box-sizing:border-box;width:100%;margin:0;padding:11px 12px;border:1px solid var(--sg-a12);border-radius:12px;background:var(--sg-bg);color:var(--sg-t90);font:inherit;font-size:12px;font-weight:400;line-height:1.2;outline:none;resize:none;overflow:hidden;word-break:break-all;overflow-wrap:anywhere}
6228
6232
  .sg-rcp-input::placeholder{color:var(--sg-t50)}
6229
6233
  .sg-rcp-input:focus{border-color:var(--sg-accent)}
6230
- .sg-rcp-input[aria-invalid="true"]{border-color:var(--sg-danger)}
6234
+ .sg-rcp-input[aria-invalid="true"]{border-color:color-mix(in srgb,var(--sg-flag) 12%,transparent)}
6235
+ .sg-rcp-input[aria-invalid="true"]:focus{border-color:color-mix(in srgb,var(--sg-flag) 40%,transparent)}
6236
+ .sg-rcp-custom[data-invalid]{background:color-mix(in srgb,var(--sg-flag) 6%,transparent)}
6237
+ .sg-rcp-custom[data-invalid] .sg-rcp-custom-head label{color:var(--sg-t90)}
6238
+ .sg-rcp-custom[data-invalid] .sg-ws-error{font-size:11px;line-height:1.2;color:var(--sg-flag)}
6239
+ .sg-rcp-bad{display:flex;color:var(--sg-flag);opacity:.8;flex:0 0 auto}
6240
+ /* The wide card beside an open sheet draws its disabled CTA like the sheet's own (Figma 3155:50731, 20%). */
6241
+ .sg-duo .sg-cta-wrap .sg-btn:disabled{opacity:.2}
6231
6242
  .sg-rcp-hint{margin:0;font-size:12px;font-weight:400;line-height:1.2;color:var(--sg-t60)}
6232
6243
  .sg-widget[data-sg-takeover]{display:flex;flex-direction:column}
6233
6244
  .sg-widget[data-sg-takeover]>.sg-head,.sg-widget[data-sg-takeover]>.sg-foot{display:none}
@@ -8522,8 +8533,8 @@ function ShieldTickBold() {
8522
8533
  }
8523
8534
  ) });
8524
8535
  }
8525
- function CloseCircleBold() {
8526
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
8536
+ function CloseCircleBold({ size = 14 }) {
8537
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
8527
8538
  "path",
8528
8539
  {
8529
8540
  fill: "currentColor",
@@ -8612,9 +8623,7 @@ function SheetFrame(props) {
8612
8623
  }
8613
8624
  function WalletChip(props) {
8614
8625
  const count = props.addresses.length;
8615
- if (!count) {
8616
- return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "sg-wallet", onClick: props.onConnect, disabled: props.connecting, children: props.connecting ? "Connecting\u2026" : "Connect wallet" });
8617
- }
8626
+ if (!count) return null;
8618
8627
  const label2 = count === 1 ? chipShort(props.addresses[0]) : `${count} wallets`;
8619
8628
  return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", ref: props.btnRef, className: "sg-wallet", "data-connected": "true", onClick: props.onOpen, disabled: props.disabled, "aria-haspopup": "dialog", "aria-label": `Wallets: ${label2}`, children: [
8620
8629
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-wallet-dot", "aria-hidden": "true" }),
@@ -8689,19 +8698,44 @@ function RecipientRow({ state, disabled, wide }) {
8689
8698
  if (state.error) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sg-rcp-row", "data-wide": wide || void 0, "data-tone": "error", role: "alert", children: state.error });
8690
8699
  const address = state.shown;
8691
8700
  if (!address && !state.managed) return null;
8692
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-row", "data-wide": wide || void 0, children: [
8693
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-label", children: "Recipient" }),
8694
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-end", children: [
8695
- address ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-value", title: address, children: [
8696
- FAMILY_LABEL[state.recipientFamily],
8697
- " \xB7 ",
8698
- chipShort(address)
8699
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-value", "data-empty": "true", children: "Not set" }),
8700
- state.managed ? /* @__PURE__ */ jsxRuntime.jsx("button", { ref: state.triggerRef, type: "button", className: "sg-rcp-change", onClick: state.show, disabled, "aria-haspopup": "dialog", children: address ? "Change" : "Add" }) : null
8701
- ] })
8702
- ] });
8701
+ const value = address ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-value", title: address, children: [
8702
+ FAMILY_LABEL[state.recipientFamily],
8703
+ " \xB7 ",
8704
+ chipShort(address)
8705
+ ] }) : state.missing ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-value", "data-tone": "choose", children: "Choose" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-value", "data-empty": "true", children: "--" });
8706
+ if (!state.managed) {
8707
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-row", "data-wide": wide || void 0, children: [
8708
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-label", children: "Recipient" }),
8709
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-end", children: value })
8710
+ ] });
8711
+ }
8712
+ return /* @__PURE__ */ jsxRuntime.jsxs(
8713
+ "button",
8714
+ {
8715
+ ref: state.triggerRef,
8716
+ type: "button",
8717
+ className: "sg-rcp-row",
8718
+ "data-wide": wide || void 0,
8719
+ onClick: state.show,
8720
+ disabled,
8721
+ "aria-haspopup": "dialog",
8722
+ "aria-label": address ? `Recipient: ${FAMILY_LABEL[state.recipientFamily]} ${chipShort(address)}. Change recipient` : "Choose recipient",
8723
+ children: [
8724
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-label", children: "Recipient" }),
8725
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sg-rcp-end", children: [
8726
+ value,
8727
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, {})
8728
+ ] })
8729
+ ]
8730
+ }
8731
+ );
8703
8732
  }
8704
- function RecipientSheet({ state, wide, minHeight }) {
8733
+ function RecipientSheet({
8734
+ state,
8735
+ wide,
8736
+ minHeight,
8737
+ onPending
8738
+ }) {
8705
8739
  const family = state.recipientFamily;
8706
8740
  const label2 = FAMILY_LABEL[family];
8707
8741
  const eligible = state.wallets.filter((w) => w.eligible);
@@ -8711,7 +8745,6 @@ function RecipientSheet({ state, wide, minHeight }) {
8711
8745
  return current ? { kind: "wallet", address: current.address } : { kind: "custom" };
8712
8746
  });
8713
8747
  const [draft, setDraft] = react.useState(state.typed);
8714
- const [editing, setEditing] = react.useState(false);
8715
8748
  const id = react.useId();
8716
8749
  const inputRef = react.useRef(null);
8717
8750
  const noWallet = family === "solana" && !state.familyWallet.address && !state.familyWallet.wallets.length;
@@ -8723,6 +8756,30 @@ function RecipientSheet({ state, wide, minHeight }) {
8723
8756
  const chosenWallet = choice.kind === "wallet" ? eligible.find((w) => w.address === choice.address) : void 0;
8724
8757
  const ready = choice.kind === "wallet" ? Boolean(chosenWallet) : valid;
8725
8758
  const custom = choice.kind === "custom";
8759
+ const appliedWallet = state.typed ? null : state.recipient ?? state.shown ?? null;
8760
+ const pending = choice.kind === "custom" ? !state.typed || draft.trim() !== state.typed : choice.address !== appliedWallet;
8761
+ const pendingRef = react.useRef(onPending);
8762
+ pendingRef.current = onPending;
8763
+ react.useEffect(() => pendingRef.current?.(pending), [pending]);
8764
+ react.useEffect(() => () => pendingRef.current?.(false), []);
8765
+ react.useLayoutEffect(() => {
8766
+ const el = inputRef.current;
8767
+ if (!el) return;
8768
+ const fit = () => {
8769
+ el.style.height = "auto";
8770
+ el.style.height = `${el.scrollHeight + (el.offsetHeight - el.clientHeight)}px`;
8771
+ };
8772
+ fit();
8773
+ if (typeof ResizeObserver === "undefined") return;
8774
+ let width = el.clientWidth;
8775
+ const observer = new ResizeObserver(() => {
8776
+ if (el.clientWidth === width) return;
8777
+ width = el.clientWidth;
8778
+ fit();
8779
+ });
8780
+ observer.observe(el);
8781
+ return () => observer.disconnect();
8782
+ }, [draft, custom, wide]);
8726
8783
  react.useEffect(() => {
8727
8784
  if (custom) inputRef.current?.focus();
8728
8785
  }, [custom]);
@@ -8779,33 +8836,35 @@ function RecipientSheet({ state, wide, minHeight }) {
8779
8836
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: wallet.name }),
8780
8837
  /* @__PURE__ */ jsxRuntime.jsx(AddCircle, {})
8781
8838
  ] }, wallet.name)) : null,
8782
- custom ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-custom", "data-open": "true", children: [
8839
+ custom ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-custom", "data-open": "true", "data-invalid": invalid || void 0, children: [
8783
8840
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-rcp-custom-head", children: [
8784
8841
  /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, children: "Add another address" }),
8785
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-tick", children: /* @__PURE__ */ jsxRuntime.jsx(Tick2, {}) })
8842
+ invalid ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-bad", children: /* @__PURE__ */ jsxRuntime.jsx(CloseCircleBold, { size: 16 }) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sg-rcp-tick", children: /* @__PURE__ */ jsxRuntime.jsx(Tick2, {}) })
8786
8843
  ] }),
8787
8844
  /* @__PURE__ */ jsxRuntime.jsx(
8788
- "input",
8845
+ "textarea",
8789
8846
  {
8790
8847
  ref: inputRef,
8848
+ rows: 1,
8791
8849
  id,
8792
8850
  className: "sg-rcp-input",
8793
8851
  placeholder: family === "solana" ? "Solana recipient address" : "0x...Recipient address",
8794
8852
  "aria-label": `${label2} recipient address`,
8795
8853
  "aria-invalid": invalid || void 0,
8796
8854
  "aria-describedby": invalid ? `${id}-error` : void 0,
8797
- value: editing || draft.length <= 34 ? draft : `${draft.slice(0, 13)}..${draft.slice(-15)}`,
8798
- onFocus: () => setEditing(true),
8799
- onBlur: () => setEditing(false),
8800
- onChange: (event) => setDraft(event.target.value),
8855
+ value: draft,
8856
+ onChange: (event) => setDraft(event.target.value.replace(/\s+/g, "")),
8801
8857
  onKeyDown: (event) => {
8802
- if (event.key === "Enter") confirm();
8858
+ if (event.key === "Enter") {
8859
+ event.preventDefault();
8860
+ confirm();
8861
+ }
8803
8862
  },
8804
8863
  spellCheck: false,
8805
8864
  autoComplete: "off"
8806
8865
  }
8807
8866
  ),
8808
- invalid ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${id}-error`, className: "sg-ws-error", children: shapeOk && !checksumOk ? "Checksum does not match. Check the address for a typo." : `Not a valid ${label2} address.` }) : null,
8867
+ invalid ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${id}-error`, className: "sg-ws-error", children: shapeOk && !checksumOk ? "Checksum does not match. Check the address for a typo." : `Enter a valid ${label2} address` }) : null,
8809
8868
  noWallet ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "sg-rcp-hint", children: [
8810
8869
  "No ",
8811
8870
  label2,
@@ -10956,6 +11015,8 @@ function ExchangeCard(props) {
10956
11015
  const title = config.title || (mode === "onramp" ? "Buy stablecoins" : mode === "offramp" ? "Cash out" : "Exchange");
10957
11016
  const soonLabel = mode === "onramp" ? "On-ramp coming soon" : "Off-ramp coming soon";
10958
11017
  const quotePaused = solActive ? false : addressed ? flow.quotePaused : idle2 && preview.status === "ready";
11018
+ const [recipientPending, setRecipientPending] = react.useState(false);
11019
+ const recipientLocked = wide && recipientState.open && recipientPending;
10959
11020
  const ctaLabel = rampMode ? soonLabel : submitting ? "Exchanging\u2026" : connected2 && flow.quoteStale ? flow.quotePaused ? "Refresh quote" : "Refreshing quote\u2026" : flow.insufficient ? "Insufficient balance" : flow.nativeShortfall || "Exchange";
10960
11021
  const selected = addressed ? flow.selected : null;
10961
11022
  const hasQuote = Boolean(quotable && !quoting && !quoteError && receive);
@@ -10989,8 +11050,6 @@ function ExchangeCard(props) {
10989
11050
  WalletChip,
10990
11051
  {
10991
11052
  addresses: sheetWallets.map((w) => w.address),
10992
- connecting: wallet.connecting,
10993
- onConnect: wallet.connect,
10994
11053
  btnRef: walletChipRef,
10995
11054
  disabled: submitting,
10996
11055
  onOpen: () => {
@@ -11059,7 +11118,7 @@ function ExchangeCard(props) {
11059
11118
  connect: !wallet.account ? { family: "evm", onClick: () => void wallet.connect(), busy: wallet.connecting } : !solanaWallet.address ? { family: "solana", onClick: (name) => void solanaWallet.connect(name), busy: solanaWallet.status === "connecting", choices: solanaWallet.wallets.map((w) => w.name) } : void 0,
11060
11119
  error: solanaWallet.error || wallet.error
11061
11120
  }
11062
- ) : recipientState.open ? /* @__PURE__ */ jsxRuntime.jsx(RecipientSheet, { state: recipientState, wide }) : sheet === "compliance" ? /* @__PURE__ */ jsxRuntime.jsx(ComplianceSheet, { compliance, direct: selected?.state === "DIRECT", hasQuote: complianceHasQuote, onClose: closeSheet }) : sheet === "quote" && hasQuote ? /* @__PURE__ */ jsxRuntime.jsx(
11121
+ ) : recipientState.open ? /* @__PURE__ */ jsxRuntime.jsx(RecipientSheet, { state: recipientState, wide, onPending: wide ? setRecipientPending : void 0 }) : sheet === "compliance" ? /* @__PURE__ */ jsxRuntime.jsx(ComplianceSheet, { compliance, direct: selected?.state === "DIRECT", hasQuote: complianceHasQuote, onClose: closeSheet }) : sheet === "quote" && hasQuote ? /* @__PURE__ */ jsxRuntime.jsx(
11063
11122
  QuoteSheet,
11064
11123
  {
11065
11124
  onClose: closeSheet,
@@ -11096,7 +11155,7 @@ function ExchangeCard(props) {
11096
11155
  {
11097
11156
  onClick: solFlow.run,
11098
11157
  busy: submitting,
11099
- disabled: !quotable || !cryptoReady || !!recipientState.error || !solFlow.plan || solFlow.insufficient || solFlow.solShort || solFlow.status === "quoting",
11158
+ disabled: recipientLocked || !quotable || !cryptoReady || !!recipientState.error || !solFlow.plan || solFlow.insufficient || solFlow.solShort || solFlow.status === "quoting",
11100
11159
  children: solFlow.status === "preparing" ? "Preparing order\u2026" : solFlow.status === "submitting" ? "Submitting\u2026" : solFlow.insufficient ? "Insufficient balance" : solFlow.solShort ? "Not enough SOL for network fees" : solFlow.status === "failed" ? "Try again" : !solFlow.plan ? "Exchange" : solFlow.needsPreparation ? "Continue in wallet" : "Submit"
11101
11160
  }
11102
11161
  );
@@ -11190,7 +11249,7 @@ function ExchangeCard(props) {
11190
11249
  "Connect ",
11191
11250
  recipientState.recipientFamily === "solana" ? "Solana" : "EVM",
11192
11251
  " wallet"
11193
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: rampMode ? void 0 : flow.submit, busy: submitting, disabled: needsRecipient || rampMode || !quotable || !cryptoReady || connected2 && (!flow.selected || flow.insufficient || !!flow.nativeShortfall || flow.status === "loading"), children: ctaLabel }),
11252
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: rampMode ? void 0 : flow.submit, busy: submitting, disabled: needsRecipient || recipientLocked || rampMode || !quotable || !cryptoReady || connected2 && (!flow.selected || flow.insufficient || !!flow.nativeShortfall || flow.status === "loading"), children: ctaLabel }),
11194
11253
  wallet.error ? /* @__PURE__ */ jsxRuntime.jsx(StatusPanel, { tone: "error", children: wallet.error }) : null
11195
11254
  ] });
11196
11255
  const notices = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -11211,7 +11270,7 @@ function ExchangeCard(props) {
11211
11270
  ] }),
11212
11271
  amountField,
11213
11272
  amountNoteEl,
11214
- /* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode !== "onramp" && fromBal ? shortBalance(fromBal.formatted) : null })
11273
+ /* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode === "onramp" ? null : fromBal ? shortBalance(fromBal.formatted) : connected2 ? null : "--" })
11215
11274
  ] })
11216
11275
  ] }),
11217
11276
  notices,
@@ -11229,7 +11288,7 @@ function ExchangeCard(props) {
11229
11288
  payToken
11230
11289
  ] }),
11231
11290
  amountNoteEl,
11232
- /* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode !== "onramp" && fromBal ? shortBalance(fromBal.formatted) : null })
11291
+ /* @__PURE__ */ jsxRuntime.jsx(PaneFoot, { usd: mode === "onramp" ? null : fromUsd, balance: mode === "onramp" ? null : fromBal ? shortBalance(fromBal.formatted) : connected2 ? null : "--" })
11233
11292
  ] }),
11234
11293
  /* @__PURE__ */ jsxRuntime.jsx(FlipButton, { onClick: flip, disabled: !flippable }),
11235
11294
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sg-pane", "data-kind": "receive", children: [
package/dist/mount.js CHANGED
@@ -1,2 +1,2 @@
1
- export { mount } from './chunk-DE25V6DB.js';
2
- import './chunk-MVUMYVDR.js';
1
+ export { mount } from './chunk-3U5Z5CC3.js';
2
+ import './chunk-GWQKWJJA.js';