@swype-org/react-sdk 0.1.205 → 0.1.206
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 +8 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3891,50 +3891,6 @@ function DepositScreen({
|
|
|
3891
3891
|
const isLowBalance = availableBalance < MIN_DEPOSIT;
|
|
3892
3892
|
const exceedsLimit = remainingLimit != null && amount > remainingLimit && !isLowBalance;
|
|
3893
3893
|
const canDeposit = amount >= MIN_DEPOSIT && !exceedsLimit && !isLowBalance && !processing;
|
|
3894
|
-
const headerTitle = merchantName ? `Deposit to ${merchantName}` : "Deposit";
|
|
3895
|
-
if (isLowBalance) {
|
|
3896
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3897
|
-
ScreenLayout,
|
|
3898
|
-
{
|
|
3899
|
-
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3900
|
-
/* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onSwitchWallet, children: "Switch wallet" }),
|
|
3901
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: switchHintStyle(tokens.textMuted), children: "Use a different wallet with more balance" }),
|
|
3902
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: outlineBtnWrapStyle, children: /* @__PURE__ */ jsxRuntime.jsx(OutlineButton, { onClick: onBack, children: "Back to deposit options" }) }),
|
|
3903
|
-
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
3904
|
-
] }),
|
|
3905
|
-
children: [
|
|
3906
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: headerTitle, onBack, onLogout }),
|
|
3907
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: lowBalanceAmountDisplayStyle, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: lowBalanceAmountStyle, children: [
|
|
3908
|
-
"$",
|
|
3909
|
-
amount.toFixed(2)
|
|
3910
|
-
] }) }),
|
|
3911
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: lowBalanceRowStyle, children: [
|
|
3912
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: lowBalanceLeftStyle, children: [
|
|
3913
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: lowBalanceCoinStyle(tokens.warning), children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", children: [
|
|
3914
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor" }),
|
|
3915
|
-
/* @__PURE__ */ jsxRuntime.jsx("text", { x: "12", y: "16", textAnchor: "middle", fontSize: "12", fill: "#fff", fontWeight: "700", children: "$" })
|
|
3916
|
-
] }) }),
|
|
3917
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3918
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: lowBalanceLabelStyle(tokens.textMuted), children: selectedSourceLabel ?? "Available" }),
|
|
3919
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "1rem", fontWeight: 700, color: tokens.warning }, children: [
|
|
3920
|
-
"$",
|
|
3921
|
-
availableBalance.toFixed(2)
|
|
3922
|
-
] })
|
|
3923
|
-
] })
|
|
3924
|
-
] }),
|
|
3925
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z", fill: tokens.warning }) })
|
|
3926
|
-
] }),
|
|
3927
|
-
/* @__PURE__ */ jsxRuntime.jsxs(WarningBanner, { title: "Not enough funds", children: [
|
|
3928
|
-
"Your wallet balance is $",
|
|
3929
|
-
availableBalance.toFixed(2),
|
|
3930
|
-
" \u2014 you need at least $",
|
|
3931
|
-
MIN_DEPOSIT.toFixed(2),
|
|
3932
|
-
" to deposit via One-Tap."
|
|
3933
|
-
] })
|
|
3934
|
-
]
|
|
3935
|
-
}
|
|
3936
|
-
);
|
|
3937
|
-
}
|
|
3938
3894
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3939
3895
|
ScreenLayout,
|
|
3940
3896
|
{
|
|
@@ -4065,6 +4021,13 @@ function DepositScreen({
|
|
|
4065
4021
|
". Increase your limit to continue."
|
|
4066
4022
|
] })
|
|
4067
4023
|
] }),
|
|
4024
|
+
!accountPickerOpen && isLowBalance && /* @__PURE__ */ jsxRuntime.jsxs(WarningBanner, { title: "Not enough funds", children: [
|
|
4025
|
+
"Your wallet balance is $",
|
|
4026
|
+
availableBalance.toFixed(2),
|
|
4027
|
+
" \u2014 you need at least $",
|
|
4028
|
+
MIN_DEPOSIT.toFixed(2),
|
|
4029
|
+
" to deposit via One-Tap."
|
|
4030
|
+
] }),
|
|
4068
4031
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle5(tokens), children: error })
|
|
4069
4032
|
]
|
|
4070
4033
|
}
|
|
@@ -4268,46 +4231,6 @@ var limitExceededHintStyle = (color) => ({
|
|
|
4268
4231
|
margin: "12px 0 2px",
|
|
4269
4232
|
lineHeight: 1.5
|
|
4270
4233
|
});
|
|
4271
|
-
var switchHintStyle = (color) => ({
|
|
4272
|
-
textAlign: "center",
|
|
4273
|
-
fontSize: "0.8rem",
|
|
4274
|
-
color,
|
|
4275
|
-
margin: "10px 0"
|
|
4276
|
-
});
|
|
4277
|
-
var outlineBtnWrapStyle = {
|
|
4278
|
-
marginBottom: 8
|
|
4279
|
-
};
|
|
4280
|
-
var lowBalanceAmountDisplayStyle = {
|
|
4281
|
-
textAlign: "center",
|
|
4282
|
-
padding: "20px 0 8px"
|
|
4283
|
-
};
|
|
4284
|
-
var lowBalanceAmountStyle = {
|
|
4285
|
-
fontSize: "2.5rem",
|
|
4286
|
-
fontWeight: 700,
|
|
4287
|
-
color: "#ccc",
|
|
4288
|
-
letterSpacing: "-0.02em"
|
|
4289
|
-
};
|
|
4290
|
-
var lowBalanceRowStyle = {
|
|
4291
|
-
display: "flex",
|
|
4292
|
-
alignItems: "center",
|
|
4293
|
-
justifyContent: "space-between",
|
|
4294
|
-
marginBottom: 16
|
|
4295
|
-
};
|
|
4296
|
-
var lowBalanceLeftStyle = {
|
|
4297
|
-
display: "flex",
|
|
4298
|
-
alignItems: "center",
|
|
4299
|
-
gap: 10
|
|
4300
|
-
};
|
|
4301
|
-
var lowBalanceCoinStyle = (color) => ({
|
|
4302
|
-
color,
|
|
4303
|
-
display: "flex",
|
|
4304
|
-
alignItems: "center"
|
|
4305
|
-
});
|
|
4306
|
-
var lowBalanceLabelStyle = (color) => ({
|
|
4307
|
-
fontSize: "0.72rem",
|
|
4308
|
-
color,
|
|
4309
|
-
fontWeight: 500
|
|
4310
|
-
});
|
|
4311
4234
|
function SuccessScreen({
|
|
4312
4235
|
amount,
|
|
4313
4236
|
currency,
|
|
@@ -5662,7 +5585,7 @@ function StepRendererContent({
|
|
|
5662
5585
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5663
5586
|
SetupScreen,
|
|
5664
5587
|
{
|
|
5665
|
-
availableBalance: selectedSource ? selectedSource.balance.available.amount : selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) :
|
|
5588
|
+
availableBalance: selectedSource ? selectedSource.balance.available.amount : selectSourceAvailableBalance > 0 ? selectSourceAvailableBalance : selectedAccount ? selectedAccount.wallets.reduce((sum, w) => sum + w.balance.available.amount, 0) : maxSourceBalance,
|
|
5666
5589
|
tokenCount: effectiveTokenCount,
|
|
5667
5590
|
sourceName,
|
|
5668
5591
|
onSetupOneTap: handlers.onSetupOneTap,
|