@swype-org/react-sdk 0.1.189 → 0.1.192
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 +215 -122
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +215 -122
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2285,18 +2285,30 @@ function StepProgress({ phase }) {
|
|
|
2285
2285
|
return /* @__PURE__ */ jsx("img", { src: SWYPE_MASCOT, alt: "Swype", style: mascotStyle });
|
|
2286
2286
|
}
|
|
2287
2287
|
return /* @__PURE__ */ jsxs("div", { style: containerStyle3, children: [
|
|
2288
|
-
/* @__PURE__ */
|
|
2289
|
-
|
|
2288
|
+
/* @__PURE__ */ jsxs("div", { style: sectionStyle("flex-end"), children: [
|
|
2289
|
+
/* @__PURE__ */ jsx("span", { style: labelStyle(tokens.text), children: "Link" }),
|
|
2290
|
+
/* @__PURE__ */ jsx("span", { style: dotStyle(tokens.accent) })
|
|
2291
|
+
] }),
|
|
2290
2292
|
/* @__PURE__ */ jsx("span", { style: lineStyle(tokens.textMuted) }),
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
|
|
2293
|
+
/* @__PURE__ */ jsxs("div", { style: sectionStyle("flex-start"), children: [
|
|
2294
|
+
/* @__PURE__ */ jsx("span", { style: dotStyle(tokens.textMuted) }),
|
|
2295
|
+
/* @__PURE__ */ jsx("span", { style: labelStyle(tokens.textMuted), children: "Deposit" })
|
|
2296
|
+
] })
|
|
2293
2297
|
] });
|
|
2294
2298
|
}
|
|
2295
2299
|
var containerStyle3 = {
|
|
2296
2300
|
display: "flex",
|
|
2297
2301
|
alignItems: "center",
|
|
2298
|
-
gap: 6
|
|
2302
|
+
gap: 6,
|
|
2303
|
+
width: "100%"
|
|
2299
2304
|
};
|
|
2305
|
+
var sectionStyle = (justify) => ({
|
|
2306
|
+
flex: 1,
|
|
2307
|
+
display: "flex",
|
|
2308
|
+
alignItems: "center",
|
|
2309
|
+
justifyContent: justify,
|
|
2310
|
+
gap: 6
|
|
2311
|
+
});
|
|
2300
2312
|
var dotStyle = (color) => ({
|
|
2301
2313
|
width: 8,
|
|
2302
2314
|
height: 8,
|
|
@@ -2453,19 +2465,16 @@ var badgeStyle = (color) => ({
|
|
|
2453
2465
|
});
|
|
2454
2466
|
function PoweredByFooter() {
|
|
2455
2467
|
const { tokens } = useSwypeConfig();
|
|
2456
|
-
return /* @__PURE__ */
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
] }),
|
|
2467
|
-
/* @__PURE__ */ jsx("span", { style: pillStyle(tokens.textMuted, tokens.border), children: "Beta Version" })
|
|
2468
|
-
] });
|
|
2468
|
+
return /* @__PURE__ */ jsx("div", { style: containerStyle5(tokens.textMuted), children: /* @__PURE__ */ jsxs("div", { style: rowStyle, children: [
|
|
2469
|
+
/* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
|
|
2470
|
+
"path",
|
|
2471
|
+
{
|
|
2472
|
+
d: "M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM12 17c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3-9H9V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2z",
|
|
2473
|
+
fill: "currentColor"
|
|
2474
|
+
}
|
|
2475
|
+
) }),
|
|
2476
|
+
/* @__PURE__ */ jsx("span", { children: "Powered by Blink" })
|
|
2477
|
+
] }) });
|
|
2469
2478
|
}
|
|
2470
2479
|
var containerStyle5 = (color) => ({
|
|
2471
2480
|
display: "flex",
|
|
@@ -2482,14 +2491,6 @@ var rowStyle = {
|
|
|
2482
2491
|
alignItems: "center",
|
|
2483
2492
|
gap: 6
|
|
2484
2493
|
};
|
|
2485
|
-
var pillStyle = (color, border) => ({
|
|
2486
|
-
fontSize: "0.65rem",
|
|
2487
|
-
fontWeight: 600,
|
|
2488
|
-
padding: "2px 8px",
|
|
2489
|
-
borderRadius: 999,
|
|
2490
|
-
border: `1px solid ${border}`,
|
|
2491
|
-
color
|
|
2492
|
-
});
|
|
2493
2494
|
function PrimaryButton({ children, onClick, disabled, loading, icon }) {
|
|
2494
2495
|
const { tokens } = useSwypeConfig();
|
|
2495
2496
|
const isDisabled = disabled || loading;
|
|
@@ -2509,7 +2510,7 @@ function PrimaryButton({ children, onClick, disabled, loading, icon }) {
|
|
|
2509
2510
|
}
|
|
2510
2511
|
var buttonStyle = (tokens, disabled) => ({
|
|
2511
2512
|
width: "100%",
|
|
2512
|
-
padding: "
|
|
2513
|
+
padding: "18px 24px",
|
|
2513
2514
|
background: `linear-gradient(180deg, ${tokens.accent}, ${tokens.accentHover})`,
|
|
2514
2515
|
color: tokens.accentText,
|
|
2515
2516
|
border: "none",
|
|
@@ -2520,7 +2521,7 @@ var buttonStyle = (tokens, disabled) => ({
|
|
|
2520
2521
|
opacity: disabled ? 0.5 : 1,
|
|
2521
2522
|
transition: "filter 0.15s ease, transform 0.15s ease",
|
|
2522
2523
|
fontFamily: "inherit",
|
|
2523
|
-
boxShadow: "0
|
|
2524
|
+
boxShadow: "0 6px 20px rgba(178, 255, 147, 0.25)",
|
|
2524
2525
|
display: "flex",
|
|
2525
2526
|
alignItems: "center",
|
|
2526
2527
|
justifyContent: "center",
|
|
@@ -3098,6 +3099,7 @@ function PasskeyScreen({
|
|
|
3098
3099
|
/* @__PURE__ */ jsx(ScreenHeader, { onBack, onLogout }),
|
|
3099
3100
|
/* @__PURE__ */ jsxs("div", { style: contentStyle4, children: [
|
|
3100
3101
|
/* @__PURE__ */ jsx("h2", { style: headingStyle3(tokens.text), children: "Secure your account with a passkey" }),
|
|
3102
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle2(tokens.textSecondary), children: "This enables secure one-tap deposits on this device" }),
|
|
3101
3103
|
error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle2(tokens), children: error })
|
|
3102
3104
|
] })
|
|
3103
3105
|
]
|
|
@@ -3119,6 +3121,12 @@ var headingStyle3 = (color) => ({
|
|
|
3119
3121
|
color,
|
|
3120
3122
|
margin: "24px 0 8px"
|
|
3121
3123
|
});
|
|
3124
|
+
var subtitleStyle2 = (color) => ({
|
|
3125
|
+
fontSize: "0.86rem",
|
|
3126
|
+
color,
|
|
3127
|
+
margin: "0 0 20px",
|
|
3128
|
+
lineHeight: 1.5
|
|
3129
|
+
});
|
|
3122
3130
|
var errorBannerStyle2 = (tokens) => ({
|
|
3123
3131
|
background: tokens.errorBg,
|
|
3124
3132
|
border: `1px solid ${tokens.error}66`,
|
|
@@ -3256,7 +3264,7 @@ function WalletPickerScreen({
|
|
|
3256
3264
|
/* @__PURE__ */ jsx(ScreenHeader, { title: "Set up Swype", onBack, onLogout }),
|
|
3257
3265
|
hasPending && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3258
3266
|
/* @__PURE__ */ jsx("h2", { style: headingStyle4(tokens.text), children: "Continue where you left off" }),
|
|
3259
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
3267
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle3(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
|
|
3260
3268
|
/* @__PURE__ */ jsx("div", { style: pendingListStyle, children: pendingConnections.map((acct) => {
|
|
3261
3269
|
const wallet = acct.wallets[0];
|
|
3262
3270
|
const address = wallet ? truncateAddress(wallet.name) : void 0;
|
|
@@ -3360,7 +3368,7 @@ var headingStyle4 = (color) => ({
|
|
|
3360
3368
|
color,
|
|
3361
3369
|
margin: "8px 0 4px"
|
|
3362
3370
|
});
|
|
3363
|
-
var
|
|
3371
|
+
var subtitleStyle3 = (color) => ({
|
|
3364
3372
|
fontSize: "0.88rem",
|
|
3365
3373
|
color,
|
|
3366
3374
|
margin: "0 0 24px"
|
|
@@ -3762,7 +3770,7 @@ function SetupStatusScreen({
|
|
|
3762
3770
|
/* @__PURE__ */ jsxs("div", { style: contentStyle5, children: [
|
|
3763
3771
|
/* @__PURE__ */ jsx("img", { src: SWYPE_MASCOT, alt: "Swype", style: mascotStyle2 }),
|
|
3764
3772
|
/* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "Done!" }),
|
|
3765
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
3773
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Return to the app to try one-tap deposits." })
|
|
3766
3774
|
] })
|
|
3767
3775
|
] });
|
|
3768
3776
|
}
|
|
@@ -3801,7 +3809,7 @@ var headingStyle6 = (color) => ({
|
|
|
3801
3809
|
color,
|
|
3802
3810
|
margin: "20px 0 8px"
|
|
3803
3811
|
});
|
|
3804
|
-
var
|
|
3812
|
+
var subtitleStyle4 = (color) => ({
|
|
3805
3813
|
fontSize: "0.9rem",
|
|
3806
3814
|
color,
|
|
3807
3815
|
margin: "0 0 28px",
|
|
@@ -3856,6 +3864,22 @@ function DepositScreen({
|
|
|
3856
3864
|
}) {
|
|
3857
3865
|
const { tokens } = useSwypeConfig();
|
|
3858
3866
|
const amount = initialAmount;
|
|
3867
|
+
const [accountPickerOpen, setAccountPickerOpen] = useState(false);
|
|
3868
|
+
const pickerRef = useRef(null);
|
|
3869
|
+
useEffect(() => {
|
|
3870
|
+
if (!accountPickerOpen) return;
|
|
3871
|
+
const handleClick = (e) => {
|
|
3872
|
+
if (pickerRef.current && !pickerRef.current.contains(e.target)) {
|
|
3873
|
+
setAccountPickerOpen(false);
|
|
3874
|
+
}
|
|
3875
|
+
};
|
|
3876
|
+
document.addEventListener("mousedown", handleClick);
|
|
3877
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
3878
|
+
}, [accountPickerOpen]);
|
|
3879
|
+
const selectedAccount = accounts?.find((a) => a.id === selectedAccountId);
|
|
3880
|
+
const selectedProviderName = selectedAccount?.name ?? "Wallet";
|
|
3881
|
+
const selectedProviderLogo = KNOWN_LOGOS[selectedProviderName.toLowerCase()];
|
|
3882
|
+
const hasMultipleAccounts = accounts != null && accounts.length > 1;
|
|
3859
3883
|
const isLowBalance = availableBalance < MIN_DEPOSIT;
|
|
3860
3884
|
const exceedsLimit = remainingLimit != null && amount > remainingLimit && !isLowBalance;
|
|
3861
3885
|
const canDeposit = amount >= MIN_DEPOSIT && !exceedsLimit && !isLowBalance && !processing;
|
|
@@ -3921,94 +3945,116 @@ function DepositScreen({
|
|
|
3921
3945
|
] }),
|
|
3922
3946
|
children: [
|
|
3923
3947
|
/* @__PURE__ */ jsx(ScreenHeader, { onBack }),
|
|
3924
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
3925
|
-
/* @__PURE__ */
|
|
3926
|
-
|
|
3927
|
-
/* @__PURE__ */ jsxs("div", { style:
|
|
3928
|
-
"
|
|
3929
|
-
|
|
3948
|
+
/* @__PURE__ */ jsxs("div", { ref: pickerRef, style: depositCardWrapStyle, children: [
|
|
3949
|
+
/* @__PURE__ */ jsxs("div", { style: depositCardStyle(tokens), children: [
|
|
3950
|
+
/* @__PURE__ */ jsx("div", { style: depositLabelStyle(tokens.textMuted), children: "Depositing" }),
|
|
3951
|
+
/* @__PURE__ */ jsxs("div", { style: amountRowStyle2, children: [
|
|
3952
|
+
/* @__PURE__ */ jsxs("div", { style: amountValueStyle(tokens.text), children: [
|
|
3953
|
+
"$",
|
|
3954
|
+
amount.toLocaleString("en-US", { minimumFractionDigits: 0, maximumFractionDigits: 2 })
|
|
3955
|
+
] }),
|
|
3956
|
+
/* @__PURE__ */ jsxs(
|
|
3957
|
+
"button",
|
|
3958
|
+
{
|
|
3959
|
+
type: "button",
|
|
3960
|
+
onClick: onSelectToken,
|
|
3961
|
+
style: tokenIconButtonStyle2(!!onSelectToken),
|
|
3962
|
+
children: [
|
|
3963
|
+
/* @__PURE__ */ jsxs("div", { style: tokenIconWrapStyle2, children: [
|
|
3964
|
+
/* @__PURE__ */ jsxs("svg", { width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", children: [
|
|
3965
|
+
/* @__PURE__ */ jsx("circle", { cx: "18", cy: "18", r: "18", fill: "#2DB84B" }),
|
|
3966
|
+
/* @__PURE__ */ jsx("text", { x: "18", y: "23", textAnchor: "middle", fontSize: "18", fill: "#fff", fontWeight: "700", children: "$" })
|
|
3967
|
+
] }),
|
|
3968
|
+
/* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", style: checkBadgeStyle2, children: [
|
|
3969
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#2775CA" }),
|
|
3970
|
+
/* @__PURE__ */ jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
3971
|
+
] })
|
|
3972
|
+
] }),
|
|
3973
|
+
/* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.5 }, children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6", stroke: tokens.textMuted, strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3974
|
+
]
|
|
3975
|
+
}
|
|
3976
|
+
)
|
|
3930
3977
|
] }),
|
|
3931
3978
|
/* @__PURE__ */ jsxs(
|
|
3932
3979
|
"button",
|
|
3933
3980
|
{
|
|
3934
3981
|
type: "button",
|
|
3935
|
-
onClick:
|
|
3936
|
-
style:
|
|
3982
|
+
onClick: hasMultipleAccounts ? () => setAccountPickerOpen(!accountPickerOpen) : void 0,
|
|
3983
|
+
style: walletBalanceRowStyle(hasMultipleAccounts),
|
|
3937
3984
|
children: [
|
|
3938
|
-
/* @__PURE__ */
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
] }),
|
|
3943
|
-
/* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", style: checkBadgeStyle2, children: [
|
|
3944
|
-
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#2775CA" }),
|
|
3945
|
-
/* @__PURE__ */ jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
3946
|
-
] })
|
|
3985
|
+
selectedProviderLogo ? /* @__PURE__ */ jsx("img", { src: selectedProviderLogo, alt: selectedProviderName, style: providerLogoStyle }) : /* @__PURE__ */ jsx("div", { style: providerFallbackStyle(tokens.textMuted), children: selectedProviderName.charAt(0) }),
|
|
3986
|
+
/* @__PURE__ */ jsxs("span", { style: walletBalanceStyle(tokens.text), children: [
|
|
3987
|
+
"$",
|
|
3988
|
+
availableBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
3947
3989
|
] }),
|
|
3948
|
-
/* @__PURE__ */ jsx("svg", { width: "
|
|
3990
|
+
hasMultipleAccounts && /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.4 }, children: /* @__PURE__ */ jsx("path", { d: "M7 10l5-5 5 5M7 14l5 5 5-5", stroke: tokens.textMuted, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3949
3991
|
]
|
|
3950
3992
|
}
|
|
3951
3993
|
)
|
|
3952
|
-
] })
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3994
|
+
] }),
|
|
3995
|
+
accountPickerOpen && accounts && accounts.length > 0 && /* @__PURE__ */ jsxs("div", { style: accountDropdownOuterStyle(tokens), children: [
|
|
3996
|
+
/* @__PURE__ */ jsx("div", { style: accountDropdownLabelStyle(tokens.textMuted), children: "Choose account" }),
|
|
3997
|
+
/* @__PURE__ */ jsxs("div", { style: accountDropdownInnerStyle(tokens), children: [
|
|
3998
|
+
accounts.map((account) => {
|
|
3999
|
+
const preferredWallet = getPreferredDepositWallet(account, amount);
|
|
4000
|
+
const active = hasActiveDepositWallet(account);
|
|
4001
|
+
const isSelected = account.id === selectedAccountId;
|
|
4002
|
+
const walletAddress = preferredWallet ? getWalletAddress(preferredWallet) : null;
|
|
4003
|
+
const truncatedAddress = walletAddress ? `${walletAddress.slice(0, 6)}...${walletAddress.slice(-4)}` : null;
|
|
4004
|
+
const accountBalance = account.wallets.reduce(
|
|
4005
|
+
(sum, w) => sum + w.balance.available.amount,
|
|
4006
|
+
0
|
|
4007
|
+
);
|
|
4008
|
+
const providerLogo = KNOWN_LOGOS[account.name.toLowerCase()];
|
|
4009
|
+
return /* @__PURE__ */ jsxs(
|
|
4010
|
+
"button",
|
|
4011
|
+
{
|
|
4012
|
+
type: "button",
|
|
4013
|
+
onClick: () => {
|
|
4014
|
+
if (active) {
|
|
4015
|
+
onSelectAccount?.(account.id);
|
|
4016
|
+
} else {
|
|
4017
|
+
onAuthorizeAccount?.(account.id);
|
|
4018
|
+
}
|
|
4019
|
+
setAccountPickerOpen(false);
|
|
4020
|
+
},
|
|
4021
|
+
style: accountRowStyle(tokens, isSelected),
|
|
4022
|
+
children: [
|
|
4023
|
+
/* @__PURE__ */ jsxs("div", { style: accountRowLeftStyle, children: [
|
|
4024
|
+
providerLogo ? /* @__PURE__ */ jsx("img", { src: providerLogo, alt: account.name, style: accountLogoStyle }) : /* @__PURE__ */ jsx("div", { style: accountFallbackIconStyle(tokens.textMuted), children: account.name.charAt(0) }),
|
|
4025
|
+
/* @__PURE__ */ jsxs("div", { style: accountInfoStyle, children: [
|
|
4026
|
+
/* @__PURE__ */ jsx("span", { style: accountAddressStyle(tokens.text), children: truncatedAddress ?? account.nickname ?? account.name }),
|
|
4027
|
+
/* @__PURE__ */ jsxs("span", { style: accountBalanceTextStyle(tokens.textMuted), children: [
|
|
4028
|
+
"$",
|
|
4029
|
+
accountBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
4030
|
+
] })
|
|
4031
|
+
] })
|
|
4032
|
+
] }),
|
|
4033
|
+
isSelected ? /* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
|
|
4034
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "11", fill: tokens.success }),
|
|
4035
|
+
/* @__PURE__ */ jsx("path", { d: "M7 11l3 3 5-5", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
4036
|
+
] }) : /* @__PURE__ */ jsx("div", { style: radioEmptyStyle(tokens.border) })
|
|
4037
|
+
]
|
|
4038
|
+
},
|
|
4039
|
+
account.id
|
|
4040
|
+
);
|
|
4041
|
+
}),
|
|
4042
|
+
onAddProvider && /* @__PURE__ */ jsxs(
|
|
3969
4043
|
"button",
|
|
3970
4044
|
{
|
|
3971
4045
|
type: "button",
|
|
3972
4046
|
onClick: () => {
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
} else {
|
|
3976
|
-
onAuthorizeAccount?.(account.id);
|
|
3977
|
-
}
|
|
4047
|
+
onAddProvider();
|
|
4048
|
+
setAccountPickerOpen(false);
|
|
3978
4049
|
},
|
|
3979
|
-
style:
|
|
4050
|
+
style: addAccountBtnStyle(tokens),
|
|
3980
4051
|
children: [
|
|
3981
|
-
/* @__PURE__ */
|
|
3982
|
-
|
|
3983
|
-
/* @__PURE__ */ jsxs("div", { style: accountInfoStyle, children: [
|
|
3984
|
-
/* @__PURE__ */ jsx("span", { style: accountAddressStyle(tokens.text), children: truncatedAddress ?? account.nickname ?? account.name }),
|
|
3985
|
-
/* @__PURE__ */ jsxs("span", { style: accountBalanceTextStyle(tokens.textMuted), children: [
|
|
3986
|
-
"$",
|
|
3987
|
-
accountBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
3988
|
-
] })
|
|
3989
|
-
] })
|
|
3990
|
-
] }),
|
|
3991
|
-
isSelected ? /* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
|
|
3992
|
-
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "11", fill: tokens.success }),
|
|
3993
|
-
/* @__PURE__ */ jsx("path", { d: "M7 11l3 3 5-5", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
3994
|
-
] }) : /* @__PURE__ */ jsx("div", { style: radioEmptyStyle(tokens.border) })
|
|
4052
|
+
/* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) }),
|
|
4053
|
+
"Add Account"
|
|
3995
4054
|
]
|
|
3996
|
-
}
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
}),
|
|
4000
|
-
onAddProvider && /* @__PURE__ */ jsxs(
|
|
4001
|
-
"button",
|
|
4002
|
-
{
|
|
4003
|
-
type: "button",
|
|
4004
|
-
onClick: onAddProvider,
|
|
4005
|
-
style: addAccountBtnStyle(tokens),
|
|
4006
|
-
children: [
|
|
4007
|
-
/* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) }),
|
|
4008
|
-
"Add Account"
|
|
4009
|
-
]
|
|
4010
|
-
}
|
|
4011
|
-
)
|
|
4055
|
+
}
|
|
4056
|
+
)
|
|
4057
|
+
] })
|
|
4012
4058
|
] })
|
|
4013
4059
|
] }),
|
|
4014
4060
|
remainingLimit != null && /* @__PURE__ */ jsxs("div", { style: spendingLimitStyle(tokens.textMuted), children: [
|
|
@@ -4024,12 +4070,15 @@ function DepositScreen({
|
|
|
4024
4070
|
}
|
|
4025
4071
|
);
|
|
4026
4072
|
}
|
|
4073
|
+
var depositCardWrapStyle = {
|
|
4074
|
+
position: "relative",
|
|
4075
|
+
marginBottom: 20
|
|
4076
|
+
};
|
|
4027
4077
|
var depositCardStyle = (tokens) => ({
|
|
4028
4078
|
background: tokens.bgInput,
|
|
4029
4079
|
border: `1px solid ${tokens.border}`,
|
|
4030
4080
|
borderRadius: tokens.radiusLg,
|
|
4031
|
-
padding: "16px 20px"
|
|
4032
|
-
marginBottom: 20
|
|
4081
|
+
padding: "16px 20px"
|
|
4033
4082
|
});
|
|
4034
4083
|
var depositLabelStyle = (color) => ({
|
|
4035
4084
|
fontSize: "0.75rem",
|
|
@@ -4069,16 +4118,60 @@ var checkBadgeStyle2 = {
|
|
|
4069
4118
|
bottom: -1,
|
|
4070
4119
|
right: -3
|
|
4071
4120
|
};
|
|
4072
|
-
var
|
|
4073
|
-
|
|
4121
|
+
var walletBalanceRowStyle = (clickable) => ({
|
|
4122
|
+
display: "flex",
|
|
4123
|
+
alignItems: "center",
|
|
4124
|
+
gap: 8,
|
|
4125
|
+
background: "transparent",
|
|
4126
|
+
border: "none",
|
|
4127
|
+
padding: 0,
|
|
4128
|
+
cursor: clickable ? "pointer" : "default",
|
|
4129
|
+
fontFamily: "inherit",
|
|
4130
|
+
outline: "none"
|
|
4131
|
+
});
|
|
4132
|
+
var providerLogoStyle = {
|
|
4133
|
+
width: 18,
|
|
4134
|
+
height: 18,
|
|
4135
|
+
borderRadius: "50%",
|
|
4136
|
+
objectFit: "contain"
|
|
4074
4137
|
};
|
|
4075
|
-
var
|
|
4138
|
+
var providerFallbackStyle = (color) => ({
|
|
4139
|
+
width: 18,
|
|
4140
|
+
height: 18,
|
|
4141
|
+
borderRadius: "50%",
|
|
4142
|
+
display: "flex",
|
|
4143
|
+
alignItems: "center",
|
|
4144
|
+
justifyContent: "center",
|
|
4145
|
+
fontSize: "0.65rem",
|
|
4146
|
+
fontWeight: 700,
|
|
4147
|
+
color,
|
|
4148
|
+
flexShrink: 0
|
|
4149
|
+
});
|
|
4150
|
+
var walletBalanceStyle = (color) => ({
|
|
4151
|
+
fontSize: "0.9rem",
|
|
4152
|
+
fontWeight: 600,
|
|
4153
|
+
color
|
|
4154
|
+
});
|
|
4155
|
+
var accountDropdownOuterStyle = (tokens) => ({
|
|
4156
|
+
position: "absolute",
|
|
4157
|
+
top: "100%",
|
|
4158
|
+
left: 0,
|
|
4159
|
+
right: 0,
|
|
4160
|
+
marginTop: 4,
|
|
4161
|
+
background: tokens.bgCard,
|
|
4162
|
+
border: `1px solid ${tokens.border}`,
|
|
4163
|
+
borderRadius: tokens.radiusLg,
|
|
4164
|
+
boxShadow: tokens.shadowLg,
|
|
4165
|
+
zIndex: 50,
|
|
4166
|
+
padding: "12px 14px 14px"
|
|
4167
|
+
});
|
|
4168
|
+
var accountDropdownLabelStyle = (color) => ({
|
|
4076
4169
|
fontSize: "0.78rem",
|
|
4077
4170
|
fontWeight: 500,
|
|
4078
4171
|
color,
|
|
4079
4172
|
marginBottom: 8
|
|
4080
4173
|
});
|
|
4081
|
-
var
|
|
4174
|
+
var accountDropdownInnerStyle = (tokens) => ({
|
|
4082
4175
|
background: tokens.bgInput,
|
|
4083
4176
|
border: `1px solid ${tokens.border}`,
|
|
4084
4177
|
borderRadius: tokens.radiusLg,
|
|
@@ -4090,7 +4183,7 @@ var accountRowStyle = (tokens, isSelected) => ({
|
|
|
4090
4183
|
justifyContent: "space-between",
|
|
4091
4184
|
width: "100%",
|
|
4092
4185
|
padding: "14px 16px",
|
|
4093
|
-
background: "transparent",
|
|
4186
|
+
background: isSelected ? `${tokens.accent}10` : "transparent",
|
|
4094
4187
|
border: "none",
|
|
4095
4188
|
borderBottom: `1px solid ${tokens.border}`,
|
|
4096
4189
|
cursor: "pointer",
|
|
@@ -4293,14 +4386,14 @@ function SuccessScreen({
|
|
|
4293
4386
|
amount.toFixed(2),
|
|
4294
4387
|
" deposited"
|
|
4295
4388
|
] }),
|
|
4296
|
-
merchantName && /* @__PURE__ */ jsxs("p", { style:
|
|
4389
|
+
merchantName && /* @__PURE__ */ jsxs("p", { style: subtitleStyle5(tokens.textSecondary), children: [
|
|
4297
4390
|
"to ",
|
|
4298
4391
|
merchantName
|
|
4299
4392
|
] })
|
|
4300
4393
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4301
4394
|
/* @__PURE__ */ jsx(IconCircle, { variant: "error", size: 64, children: /* @__PURE__ */ jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z", fill: tokens.error }) }) }),
|
|
4302
4395
|
/* @__PURE__ */ jsx("h2", { style: headingStyle7(tokens.text), children: "Transfer failed" }),
|
|
4303
|
-
error && /* @__PURE__ */ jsx("p", { style:
|
|
4396
|
+
error && /* @__PURE__ */ jsx("p", { style: subtitleStyle5(tokens.error), children: error })
|
|
4304
4397
|
] }),
|
|
4305
4398
|
/* @__PURE__ */ jsxs("div", { style: summaryCardStyle(tokens), children: [
|
|
4306
4399
|
sourceName && /* @__PURE__ */ jsxs("div", { style: summaryRowStyle, children: [
|
|
@@ -4346,7 +4439,7 @@ var headingStyle7 = (color) => ({
|
|
|
4346
4439
|
color,
|
|
4347
4440
|
margin: "20px 0 4px"
|
|
4348
4441
|
});
|
|
4349
|
-
var
|
|
4442
|
+
var subtitleStyle5 = (color) => ({
|
|
4350
4443
|
fontSize: "0.9rem",
|
|
4351
4444
|
color,
|
|
4352
4445
|
margin: "0 0 20px"
|
|
@@ -4454,7 +4547,7 @@ function SelectSourceScreen({
|
|
|
4454
4547
|
onLogout
|
|
4455
4548
|
}
|
|
4456
4549
|
),
|
|
4457
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
4550
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle6(tokens.textMuted), children: "Choose which chain and token to pay from." }),
|
|
4458
4551
|
/* @__PURE__ */ jsx("label", { style: labelStyle3(tokens.textSecondary), children: "Chain" }),
|
|
4459
4552
|
/* @__PURE__ */ jsx("div", { style: optionListStyle, children: choices.map((chain) => {
|
|
4460
4553
|
const isSelected = chain.chainName === selectedChainName;
|
|
@@ -4511,7 +4604,7 @@ function SelectSourceScreen({
|
|
|
4511
4604
|
}
|
|
4512
4605
|
);
|
|
4513
4606
|
}
|
|
4514
|
-
var
|
|
4607
|
+
var subtitleStyle6 = (color) => ({
|
|
4515
4608
|
fontSize: "0.85rem",
|
|
4516
4609
|
color,
|
|
4517
4610
|
margin: "0 0 20px",
|
|
@@ -4627,7 +4720,7 @@ function AdvancedSourceScreen({
|
|
|
4627
4720
|
}
|
|
4628
4721
|
),
|
|
4629
4722
|
/* @__PURE__ */ jsx("h2", { style: headingStyle8(tokens.text), children: "Set up One-Tap deposits" }),
|
|
4630
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
4723
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle7(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
|
|
4631
4724
|
/* @__PURE__ */ jsx("label", { style: labelStyle4(tokens.textSecondary), children: "Select tokens to approve" }),
|
|
4632
4725
|
/* @__PURE__ */ jsx("div", { style: chainListStyle, children: choices.map((chain) => {
|
|
4633
4726
|
const isExpanded = expandedChain === chain.chainName;
|
|
@@ -4697,7 +4790,7 @@ var headingStyle8 = (color) => ({
|
|
|
4697
4790
|
color,
|
|
4698
4791
|
margin: "8px 0 4px"
|
|
4699
4792
|
});
|
|
4700
|
-
var
|
|
4793
|
+
var subtitleStyle7 = (color) => ({
|
|
4701
4794
|
fontSize: "0.86rem",
|
|
4702
4795
|
color,
|
|
4703
4796
|
margin: "0 0 20px",
|
|
@@ -4931,7 +5024,7 @@ function OpenWalletScreen({
|
|
|
4931
5024
|
displayName,
|
|
4932
5025
|
"..."
|
|
4933
5026
|
] }),
|
|
4934
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
5027
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: "Approve the connection in your wallet extension." }),
|
|
4935
5028
|
/* @__PURE__ */ jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
4936
5029
|
/* @__PURE__ */ jsx(Spinner, { size: 14 }),
|
|
4937
5030
|
/* @__PURE__ */ jsx("span", { children: "Waiting for authorization..." })
|
|
@@ -4960,7 +5053,7 @@ function OpenWalletScreen({
|
|
|
4960
5053
|
/* @__PURE__ */ jsxs("div", { style: contentStyle8, children: [
|
|
4961
5054
|
/* @__PURE__ */ jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsx(Spinner, { size: 32 }) }),
|
|
4962
5055
|
/* @__PURE__ */ jsx("h2", { style: headingStyle10(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
|
|
4963
|
-
/* @__PURE__ */ jsx("p", { style:
|
|
5056
|
+
/* @__PURE__ */ jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
|
|
4964
5057
|
!loading && /* @__PURE__ */ jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
4965
5058
|
/* @__PURE__ */ jsx(Spinner, { size: 14 }),
|
|
4966
5059
|
/* @__PURE__ */ jsx("span", { children: "Waiting for authorization..." })
|
|
@@ -5007,7 +5100,7 @@ var headingStyle10 = (color) => ({
|
|
|
5007
5100
|
color,
|
|
5008
5101
|
margin: "20px 0 8px"
|
|
5009
5102
|
});
|
|
5010
|
-
var
|
|
5103
|
+
var subtitleStyle8 = (color) => ({
|
|
5011
5104
|
fontSize: "0.9rem",
|
|
5012
5105
|
color,
|
|
5013
5106
|
margin: "0 0 24px",
|
|
@@ -5059,7 +5152,7 @@ function ConfirmSignScreen({
|
|
|
5059
5152
|
/* @__PURE__ */ jsxs("div", { style: contentStyle9, children: [
|
|
5060
5153
|
logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: displayName, style: logoStyle3 }) : /* @__PURE__ */ jsx(Spinner, { size: 48 }),
|
|
5061
5154
|
/* @__PURE__ */ jsx("h2", { style: headingStyle11(tokens.text), children: "Wallet authorized" }),
|
|
5062
|
-
/* @__PURE__ */ jsxs("p", { style:
|
|
5155
|
+
/* @__PURE__ */ jsxs("p", { style: subtitleStyle9(tokens.textSecondary), children: [
|
|
5063
5156
|
displayName,
|
|
5064
5157
|
" approved the connection. Tap below to confirm your payment."
|
|
5065
5158
|
] }),
|
|
@@ -5094,7 +5187,7 @@ var headingStyle11 = (color) => ({
|
|
|
5094
5187
|
color,
|
|
5095
5188
|
margin: "20px 0 8px"
|
|
5096
5189
|
});
|
|
5097
|
-
var
|
|
5190
|
+
var subtitleStyle9 = (color) => ({
|
|
5098
5191
|
fontSize: "0.9rem",
|
|
5099
5192
|
color,
|
|
5100
5193
|
margin: "0 0 24px",
|