@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.cjs
CHANGED
|
@@ -2288,18 +2288,30 @@ function StepProgress({ phase }) {
|
|
|
2288
2288
|
return /* @__PURE__ */ jsxRuntime.jsx("img", { src: SWYPE_MASCOT, alt: "Swype", style: mascotStyle });
|
|
2289
2289
|
}
|
|
2290
2290
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: containerStyle3, children: [
|
|
2291
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2292
|
-
|
|
2291
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: sectionStyle("flex-end"), children: [
|
|
2292
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: labelStyle(tokens.text), children: "Link" }),
|
|
2293
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: dotStyle(tokens.accent) })
|
|
2294
|
+
] }),
|
|
2293
2295
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: lineStyle(tokens.textMuted) }),
|
|
2294
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2295
|
-
|
|
2296
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: sectionStyle("flex-start"), children: [
|
|
2297
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: dotStyle(tokens.textMuted) }),
|
|
2298
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: labelStyle(tokens.textMuted), children: "Deposit" })
|
|
2299
|
+
] })
|
|
2296
2300
|
] });
|
|
2297
2301
|
}
|
|
2298
2302
|
var containerStyle3 = {
|
|
2299
2303
|
display: "flex",
|
|
2300
2304
|
alignItems: "center",
|
|
2301
|
-
gap: 6
|
|
2305
|
+
gap: 6,
|
|
2306
|
+
width: "100%"
|
|
2302
2307
|
};
|
|
2308
|
+
var sectionStyle = (justify) => ({
|
|
2309
|
+
flex: 1,
|
|
2310
|
+
display: "flex",
|
|
2311
|
+
alignItems: "center",
|
|
2312
|
+
justifyContent: justify,
|
|
2313
|
+
gap: 6
|
|
2314
|
+
});
|
|
2303
2315
|
var dotStyle = (color) => ({
|
|
2304
2316
|
width: 8,
|
|
2305
2317
|
height: 8,
|
|
@@ -2456,19 +2468,16 @@ var badgeStyle = (color) => ({
|
|
|
2456
2468
|
});
|
|
2457
2469
|
function PoweredByFooter() {
|
|
2458
2470
|
const { tokens } = useSwypeConfig();
|
|
2459
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
2460
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
] }),
|
|
2470
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: pillStyle(tokens.textMuted, tokens.border), children: "Beta Version" })
|
|
2471
|
-
] });
|
|
2471
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: containerStyle5(tokens.textMuted), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: rowStyle, children: [
|
|
2472
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2473
|
+
"path",
|
|
2474
|
+
{
|
|
2475
|
+
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",
|
|
2476
|
+
fill: "currentColor"
|
|
2477
|
+
}
|
|
2478
|
+
) }),
|
|
2479
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Powered by Blink" })
|
|
2480
|
+
] }) });
|
|
2472
2481
|
}
|
|
2473
2482
|
var containerStyle5 = (color) => ({
|
|
2474
2483
|
display: "flex",
|
|
@@ -2485,14 +2494,6 @@ var rowStyle = {
|
|
|
2485
2494
|
alignItems: "center",
|
|
2486
2495
|
gap: 6
|
|
2487
2496
|
};
|
|
2488
|
-
var pillStyle = (color, border) => ({
|
|
2489
|
-
fontSize: "0.65rem",
|
|
2490
|
-
fontWeight: 600,
|
|
2491
|
-
padding: "2px 8px",
|
|
2492
|
-
borderRadius: 999,
|
|
2493
|
-
border: `1px solid ${border}`,
|
|
2494
|
-
color
|
|
2495
|
-
});
|
|
2496
2497
|
function PrimaryButton({ children, onClick, disabled, loading, icon }) {
|
|
2497
2498
|
const { tokens } = useSwypeConfig();
|
|
2498
2499
|
const isDisabled = disabled || loading;
|
|
@@ -2512,7 +2513,7 @@ function PrimaryButton({ children, onClick, disabled, loading, icon }) {
|
|
|
2512
2513
|
}
|
|
2513
2514
|
var buttonStyle = (tokens, disabled) => ({
|
|
2514
2515
|
width: "100%",
|
|
2515
|
-
padding: "
|
|
2516
|
+
padding: "18px 24px",
|
|
2516
2517
|
background: `linear-gradient(180deg, ${tokens.accent}, ${tokens.accentHover})`,
|
|
2517
2518
|
color: tokens.accentText,
|
|
2518
2519
|
border: "none",
|
|
@@ -2523,7 +2524,7 @@ var buttonStyle = (tokens, disabled) => ({
|
|
|
2523
2524
|
opacity: disabled ? 0.5 : 1,
|
|
2524
2525
|
transition: "filter 0.15s ease, transform 0.15s ease",
|
|
2525
2526
|
fontFamily: "inherit",
|
|
2526
|
-
boxShadow: "0
|
|
2527
|
+
boxShadow: "0 6px 20px rgba(178, 255, 147, 0.25)",
|
|
2527
2528
|
display: "flex",
|
|
2528
2529
|
alignItems: "center",
|
|
2529
2530
|
justifyContent: "center",
|
|
@@ -3101,6 +3102,7 @@ function PasskeyScreen({
|
|
|
3101
3102
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack, onLogout }),
|
|
3102
3103
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle4, children: [
|
|
3103
3104
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle3(tokens.text), children: "Secure your account with a passkey" }),
|
|
3105
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle2(tokens.textSecondary), children: "This enables secure one-tap deposits on this device" }),
|
|
3104
3106
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorBannerStyle2(tokens), children: error })
|
|
3105
3107
|
] })
|
|
3106
3108
|
]
|
|
@@ -3122,6 +3124,12 @@ var headingStyle3 = (color) => ({
|
|
|
3122
3124
|
color,
|
|
3123
3125
|
margin: "24px 0 8px"
|
|
3124
3126
|
});
|
|
3127
|
+
var subtitleStyle2 = (color) => ({
|
|
3128
|
+
fontSize: "0.86rem",
|
|
3129
|
+
color,
|
|
3130
|
+
margin: "0 0 20px",
|
|
3131
|
+
lineHeight: 1.5
|
|
3132
|
+
});
|
|
3125
3133
|
var errorBannerStyle2 = (tokens) => ({
|
|
3126
3134
|
background: tokens.errorBg,
|
|
3127
3135
|
border: `1px solid ${tokens.error}66`,
|
|
@@ -3259,7 +3267,7 @@ function WalletPickerScreen({
|
|
|
3259
3267
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { title: "Set up Swype", onBack, onLogout }),
|
|
3260
3268
|
hasPending && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3261
3269
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle4(tokens.text), children: "Continue where you left off" }),
|
|
3262
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
3270
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle3(tokens.textSecondary), children: "You have a wallet that still needs setup" }),
|
|
3263
3271
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: pendingListStyle, children: pendingConnections.map((acct) => {
|
|
3264
3272
|
const wallet = acct.wallets[0];
|
|
3265
3273
|
const address = wallet ? truncateAddress(wallet.name) : void 0;
|
|
@@ -3363,7 +3371,7 @@ var headingStyle4 = (color) => ({
|
|
|
3363
3371
|
color,
|
|
3364
3372
|
margin: "8px 0 4px"
|
|
3365
3373
|
});
|
|
3366
|
-
var
|
|
3374
|
+
var subtitleStyle3 = (color) => ({
|
|
3367
3375
|
fontSize: "0.88rem",
|
|
3368
3376
|
color,
|
|
3369
3377
|
margin: "0 0 24px"
|
|
@@ -3765,7 +3773,7 @@ function SetupStatusScreen({
|
|
|
3765
3773
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle5, children: [
|
|
3766
3774
|
/* @__PURE__ */ jsxRuntime.jsx("img", { src: SWYPE_MASCOT, alt: "Swype", style: mascotStyle2 }),
|
|
3767
3775
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle6(tokens.text), children: "Done!" }),
|
|
3768
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
3776
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle4(tokens.textSecondary), children: "Return to the app to try one-tap deposits." })
|
|
3769
3777
|
] })
|
|
3770
3778
|
] });
|
|
3771
3779
|
}
|
|
@@ -3804,7 +3812,7 @@ var headingStyle6 = (color) => ({
|
|
|
3804
3812
|
color,
|
|
3805
3813
|
margin: "20px 0 8px"
|
|
3806
3814
|
});
|
|
3807
|
-
var
|
|
3815
|
+
var subtitleStyle4 = (color) => ({
|
|
3808
3816
|
fontSize: "0.9rem",
|
|
3809
3817
|
color,
|
|
3810
3818
|
margin: "0 0 28px",
|
|
@@ -3859,6 +3867,22 @@ function DepositScreen({
|
|
|
3859
3867
|
}) {
|
|
3860
3868
|
const { tokens } = useSwypeConfig();
|
|
3861
3869
|
const amount = initialAmount;
|
|
3870
|
+
const [accountPickerOpen, setAccountPickerOpen] = react.useState(false);
|
|
3871
|
+
const pickerRef = react.useRef(null);
|
|
3872
|
+
react.useEffect(() => {
|
|
3873
|
+
if (!accountPickerOpen) return;
|
|
3874
|
+
const handleClick = (e) => {
|
|
3875
|
+
if (pickerRef.current && !pickerRef.current.contains(e.target)) {
|
|
3876
|
+
setAccountPickerOpen(false);
|
|
3877
|
+
}
|
|
3878
|
+
};
|
|
3879
|
+
document.addEventListener("mousedown", handleClick);
|
|
3880
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
3881
|
+
}, [accountPickerOpen]);
|
|
3882
|
+
const selectedAccount = accounts?.find((a) => a.id === selectedAccountId);
|
|
3883
|
+
const selectedProviderName = selectedAccount?.name ?? "Wallet";
|
|
3884
|
+
const selectedProviderLogo = KNOWN_LOGOS[selectedProviderName.toLowerCase()];
|
|
3885
|
+
const hasMultipleAccounts = accounts != null && accounts.length > 1;
|
|
3862
3886
|
const isLowBalance = availableBalance < MIN_DEPOSIT;
|
|
3863
3887
|
const exceedsLimit = remainingLimit != null && amount > remainingLimit && !isLowBalance;
|
|
3864
3888
|
const canDeposit = amount >= MIN_DEPOSIT && !exceedsLimit && !isLowBalance && !processing;
|
|
@@ -3924,94 +3948,116 @@ function DepositScreen({
|
|
|
3924
3948
|
] }),
|
|
3925
3949
|
children: [
|
|
3926
3950
|
/* @__PURE__ */ jsxRuntime.jsx(ScreenHeader, { onBack }),
|
|
3927
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
3928
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3929
|
-
|
|
3930
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
3931
|
-
"
|
|
3932
|
-
|
|
3951
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: pickerRef, style: depositCardWrapStyle, children: [
|
|
3952
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: depositCardStyle(tokens), children: [
|
|
3953
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: depositLabelStyle(tokens.textMuted), children: "Depositing" }),
|
|
3954
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: amountRowStyle2, children: [
|
|
3955
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: amountValueStyle(tokens.text), children: [
|
|
3956
|
+
"$",
|
|
3957
|
+
amount.toLocaleString("en-US", { minimumFractionDigits: 0, maximumFractionDigits: 2 })
|
|
3958
|
+
] }),
|
|
3959
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3960
|
+
"button",
|
|
3961
|
+
{
|
|
3962
|
+
type: "button",
|
|
3963
|
+
onClick: onSelectToken,
|
|
3964
|
+
style: tokenIconButtonStyle2(!!onSelectToken),
|
|
3965
|
+
children: [
|
|
3966
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: tokenIconWrapStyle2, children: [
|
|
3967
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", children: [
|
|
3968
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "18", cy: "18", r: "18", fill: "#2DB84B" }),
|
|
3969
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: "18", y: "23", textAnchor: "middle", fontSize: "18", fill: "#fff", fontWeight: "700", children: "$" })
|
|
3970
|
+
] }),
|
|
3971
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", style: checkBadgeStyle2, children: [
|
|
3972
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#2775CA" }),
|
|
3973
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
3974
|
+
] })
|
|
3975
|
+
] }),
|
|
3976
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.5 }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 9l6 6 6-6", stroke: tokens.textMuted, strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3977
|
+
]
|
|
3978
|
+
}
|
|
3979
|
+
)
|
|
3933
3980
|
] }),
|
|
3934
3981
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3935
3982
|
"button",
|
|
3936
3983
|
{
|
|
3937
3984
|
type: "button",
|
|
3938
|
-
onClick:
|
|
3939
|
-
style:
|
|
3985
|
+
onClick: hasMultipleAccounts ? () => setAccountPickerOpen(!accountPickerOpen) : void 0,
|
|
3986
|
+
style: walletBalanceRowStyle(hasMultipleAccounts),
|
|
3940
3987
|
children: [
|
|
3941
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
] }),
|
|
3946
|
-
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", style: checkBadgeStyle2, children: [
|
|
3947
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#2775CA" }),
|
|
3948
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
3949
|
-
] })
|
|
3988
|
+
selectedProviderLogo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: selectedProviderLogo, alt: selectedProviderName, style: providerLogoStyle }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: providerFallbackStyle(tokens.textMuted), children: selectedProviderName.charAt(0) }),
|
|
3989
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: walletBalanceStyle(tokens.text), children: [
|
|
3990
|
+
"$",
|
|
3991
|
+
availableBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
3950
3992
|
] }),
|
|
3951
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "
|
|
3993
|
+
hasMultipleAccounts && /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.4 }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 10l5-5 5 5M7 14l5 5 5-5", stroke: tokens.textMuted, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
3952
3994
|
]
|
|
3953
3995
|
}
|
|
3954
3996
|
)
|
|
3955
|
-
] })
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3997
|
+
] }),
|
|
3998
|
+
accountPickerOpen && accounts && accounts.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: accountDropdownOuterStyle(tokens), children: [
|
|
3999
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: accountDropdownLabelStyle(tokens.textMuted), children: "Choose account" }),
|
|
4000
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: accountDropdownInnerStyle(tokens), children: [
|
|
4001
|
+
accounts.map((account) => {
|
|
4002
|
+
const preferredWallet = getPreferredDepositWallet(account, amount);
|
|
4003
|
+
const active = hasActiveDepositWallet(account);
|
|
4004
|
+
const isSelected = account.id === selectedAccountId;
|
|
4005
|
+
const walletAddress = preferredWallet ? getWalletAddress(preferredWallet) : null;
|
|
4006
|
+
const truncatedAddress = walletAddress ? `${walletAddress.slice(0, 6)}...${walletAddress.slice(-4)}` : null;
|
|
4007
|
+
const accountBalance = account.wallets.reduce(
|
|
4008
|
+
(sum, w) => sum + w.balance.available.amount,
|
|
4009
|
+
0
|
|
4010
|
+
);
|
|
4011
|
+
const providerLogo = KNOWN_LOGOS[account.name.toLowerCase()];
|
|
4012
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4013
|
+
"button",
|
|
4014
|
+
{
|
|
4015
|
+
type: "button",
|
|
4016
|
+
onClick: () => {
|
|
4017
|
+
if (active) {
|
|
4018
|
+
onSelectAccount?.(account.id);
|
|
4019
|
+
} else {
|
|
4020
|
+
onAuthorizeAccount?.(account.id);
|
|
4021
|
+
}
|
|
4022
|
+
setAccountPickerOpen(false);
|
|
4023
|
+
},
|
|
4024
|
+
style: accountRowStyle(tokens, isSelected),
|
|
4025
|
+
children: [
|
|
4026
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: accountRowLeftStyle, children: [
|
|
4027
|
+
providerLogo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: providerLogo, alt: account.name, style: accountLogoStyle }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: accountFallbackIconStyle(tokens.textMuted), children: account.name.charAt(0) }),
|
|
4028
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: accountInfoStyle, children: [
|
|
4029
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: accountAddressStyle(tokens.text), children: truncatedAddress ?? account.nickname ?? account.name }),
|
|
4030
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: accountBalanceTextStyle(tokens.textMuted), children: [
|
|
4031
|
+
"$",
|
|
4032
|
+
accountBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
4033
|
+
] })
|
|
4034
|
+
] })
|
|
4035
|
+
] }),
|
|
4036
|
+
isSelected ? /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
|
|
4037
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "11", fill: tokens.success }),
|
|
4038
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 11l3 3 5-5", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
4039
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: radioEmptyStyle(tokens.border) })
|
|
4040
|
+
]
|
|
4041
|
+
},
|
|
4042
|
+
account.id
|
|
4043
|
+
);
|
|
4044
|
+
}),
|
|
4045
|
+
onAddProvider && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3972
4046
|
"button",
|
|
3973
4047
|
{
|
|
3974
4048
|
type: "button",
|
|
3975
4049
|
onClick: () => {
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
} else {
|
|
3979
|
-
onAuthorizeAccount?.(account.id);
|
|
3980
|
-
}
|
|
4050
|
+
onAddProvider();
|
|
4051
|
+
setAccountPickerOpen(false);
|
|
3981
4052
|
},
|
|
3982
|
-
style:
|
|
4053
|
+
style: addAccountBtnStyle(tokens),
|
|
3983
4054
|
children: [
|
|
3984
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3985
|
-
|
|
3986
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: accountInfoStyle, children: [
|
|
3987
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: accountAddressStyle(tokens.text), children: truncatedAddress ?? account.nickname ?? account.name }),
|
|
3988
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: accountBalanceTextStyle(tokens.textMuted), children: [
|
|
3989
|
-
"$",
|
|
3990
|
-
accountBalance.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
3991
|
-
] })
|
|
3992
|
-
] })
|
|
3993
|
-
] }),
|
|
3994
|
-
isSelected ? /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
|
|
3995
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "11", fill: tokens.success }),
|
|
3996
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 11l3 3 5-5", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
3997
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: radioEmptyStyle(tokens.border) })
|
|
4055
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) }),
|
|
4056
|
+
"Add Account"
|
|
3998
4057
|
]
|
|
3999
|
-
}
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
}),
|
|
4003
|
-
onAddProvider && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4004
|
-
"button",
|
|
4005
|
-
{
|
|
4006
|
-
type: "button",
|
|
4007
|
-
onClick: onAddProvider,
|
|
4008
|
-
style: addAccountBtnStyle(tokens),
|
|
4009
|
-
children: [
|
|
4010
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) }),
|
|
4011
|
-
"Add Account"
|
|
4012
|
-
]
|
|
4013
|
-
}
|
|
4014
|
-
)
|
|
4058
|
+
}
|
|
4059
|
+
)
|
|
4060
|
+
] })
|
|
4015
4061
|
] })
|
|
4016
4062
|
] }),
|
|
4017
4063
|
remainingLimit != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: spendingLimitStyle(tokens.textMuted), children: [
|
|
@@ -4027,12 +4073,15 @@ function DepositScreen({
|
|
|
4027
4073
|
}
|
|
4028
4074
|
);
|
|
4029
4075
|
}
|
|
4076
|
+
var depositCardWrapStyle = {
|
|
4077
|
+
position: "relative",
|
|
4078
|
+
marginBottom: 20
|
|
4079
|
+
};
|
|
4030
4080
|
var depositCardStyle = (tokens) => ({
|
|
4031
4081
|
background: tokens.bgInput,
|
|
4032
4082
|
border: `1px solid ${tokens.border}`,
|
|
4033
4083
|
borderRadius: tokens.radiusLg,
|
|
4034
|
-
padding: "16px 20px"
|
|
4035
|
-
marginBottom: 20
|
|
4084
|
+
padding: "16px 20px"
|
|
4036
4085
|
});
|
|
4037
4086
|
var depositLabelStyle = (color) => ({
|
|
4038
4087
|
fontSize: "0.75rem",
|
|
@@ -4072,16 +4121,60 @@ var checkBadgeStyle2 = {
|
|
|
4072
4121
|
bottom: -1,
|
|
4073
4122
|
right: -3
|
|
4074
4123
|
};
|
|
4075
|
-
var
|
|
4076
|
-
|
|
4124
|
+
var walletBalanceRowStyle = (clickable) => ({
|
|
4125
|
+
display: "flex",
|
|
4126
|
+
alignItems: "center",
|
|
4127
|
+
gap: 8,
|
|
4128
|
+
background: "transparent",
|
|
4129
|
+
border: "none",
|
|
4130
|
+
padding: 0,
|
|
4131
|
+
cursor: clickable ? "pointer" : "default",
|
|
4132
|
+
fontFamily: "inherit",
|
|
4133
|
+
outline: "none"
|
|
4134
|
+
});
|
|
4135
|
+
var providerLogoStyle = {
|
|
4136
|
+
width: 18,
|
|
4137
|
+
height: 18,
|
|
4138
|
+
borderRadius: "50%",
|
|
4139
|
+
objectFit: "contain"
|
|
4077
4140
|
};
|
|
4078
|
-
var
|
|
4141
|
+
var providerFallbackStyle = (color) => ({
|
|
4142
|
+
width: 18,
|
|
4143
|
+
height: 18,
|
|
4144
|
+
borderRadius: "50%",
|
|
4145
|
+
display: "flex",
|
|
4146
|
+
alignItems: "center",
|
|
4147
|
+
justifyContent: "center",
|
|
4148
|
+
fontSize: "0.65rem",
|
|
4149
|
+
fontWeight: 700,
|
|
4150
|
+
color,
|
|
4151
|
+
flexShrink: 0
|
|
4152
|
+
});
|
|
4153
|
+
var walletBalanceStyle = (color) => ({
|
|
4154
|
+
fontSize: "0.9rem",
|
|
4155
|
+
fontWeight: 600,
|
|
4156
|
+
color
|
|
4157
|
+
});
|
|
4158
|
+
var accountDropdownOuterStyle = (tokens) => ({
|
|
4159
|
+
position: "absolute",
|
|
4160
|
+
top: "100%",
|
|
4161
|
+
left: 0,
|
|
4162
|
+
right: 0,
|
|
4163
|
+
marginTop: 4,
|
|
4164
|
+
background: tokens.bgCard,
|
|
4165
|
+
border: `1px solid ${tokens.border}`,
|
|
4166
|
+
borderRadius: tokens.radiusLg,
|
|
4167
|
+
boxShadow: tokens.shadowLg,
|
|
4168
|
+
zIndex: 50,
|
|
4169
|
+
padding: "12px 14px 14px"
|
|
4170
|
+
});
|
|
4171
|
+
var accountDropdownLabelStyle = (color) => ({
|
|
4079
4172
|
fontSize: "0.78rem",
|
|
4080
4173
|
fontWeight: 500,
|
|
4081
4174
|
color,
|
|
4082
4175
|
marginBottom: 8
|
|
4083
4176
|
});
|
|
4084
|
-
var
|
|
4177
|
+
var accountDropdownInnerStyle = (tokens) => ({
|
|
4085
4178
|
background: tokens.bgInput,
|
|
4086
4179
|
border: `1px solid ${tokens.border}`,
|
|
4087
4180
|
borderRadius: tokens.radiusLg,
|
|
@@ -4093,7 +4186,7 @@ var accountRowStyle = (tokens, isSelected) => ({
|
|
|
4093
4186
|
justifyContent: "space-between",
|
|
4094
4187
|
width: "100%",
|
|
4095
4188
|
padding: "14px 16px",
|
|
4096
|
-
background: "transparent",
|
|
4189
|
+
background: isSelected ? `${tokens.accent}10` : "transparent",
|
|
4097
4190
|
border: "none",
|
|
4098
4191
|
borderBottom: `1px solid ${tokens.border}`,
|
|
4099
4192
|
cursor: "pointer",
|
|
@@ -4296,14 +4389,14 @@ function SuccessScreen({
|
|
|
4296
4389
|
amount.toFixed(2),
|
|
4297
4390
|
" deposited"
|
|
4298
4391
|
] }),
|
|
4299
|
-
merchantName && /* @__PURE__ */ jsxRuntime.jsxs("p", { style:
|
|
4392
|
+
merchantName && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle5(tokens.textSecondary), children: [
|
|
4300
4393
|
"to ",
|
|
4301
4394
|
merchantName
|
|
4302
4395
|
] })
|
|
4303
4396
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4304
4397
|
/* @__PURE__ */ jsxRuntime.jsx(IconCircle, { variant: "error", size: 64, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.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 }) }) }),
|
|
4305
4398
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle7(tokens.text), children: "Transfer failed" }),
|
|
4306
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
4399
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle5(tokens.error), children: error })
|
|
4307
4400
|
] }),
|
|
4308
4401
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: summaryCardStyle(tokens), children: [
|
|
4309
4402
|
sourceName && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: summaryRowStyle, children: [
|
|
@@ -4349,7 +4442,7 @@ var headingStyle7 = (color) => ({
|
|
|
4349
4442
|
color,
|
|
4350
4443
|
margin: "20px 0 4px"
|
|
4351
4444
|
});
|
|
4352
|
-
var
|
|
4445
|
+
var subtitleStyle5 = (color) => ({
|
|
4353
4446
|
fontSize: "0.9rem",
|
|
4354
4447
|
color,
|
|
4355
4448
|
margin: "0 0 20px"
|
|
@@ -4457,7 +4550,7 @@ function SelectSourceScreen({
|
|
|
4457
4550
|
onLogout
|
|
4458
4551
|
}
|
|
4459
4552
|
),
|
|
4460
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
4553
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle6(tokens.textMuted), children: "Choose which chain and token to pay from." }),
|
|
4461
4554
|
/* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle3(tokens.textSecondary), children: "Chain" }),
|
|
4462
4555
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: optionListStyle, children: choices.map((chain) => {
|
|
4463
4556
|
const isSelected = chain.chainName === selectedChainName;
|
|
@@ -4514,7 +4607,7 @@ function SelectSourceScreen({
|
|
|
4514
4607
|
}
|
|
4515
4608
|
);
|
|
4516
4609
|
}
|
|
4517
|
-
var
|
|
4610
|
+
var subtitleStyle6 = (color) => ({
|
|
4518
4611
|
fontSize: "0.85rem",
|
|
4519
4612
|
color,
|
|
4520
4613
|
margin: "0 0 20px",
|
|
@@ -4630,7 +4723,7 @@ function AdvancedSourceScreen({
|
|
|
4630
4723
|
}
|
|
4631
4724
|
),
|
|
4632
4725
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle8(tokens.text), children: "Set up One-Tap deposits" }),
|
|
4633
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
4726
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle7(tokens.textSecondary), children: "Select a token source for your One-Tap deposits." }),
|
|
4634
4727
|
/* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle4(tokens.textSecondary), children: "Select tokens to approve" }),
|
|
4635
4728
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: chainListStyle, children: choices.map((chain) => {
|
|
4636
4729
|
const isExpanded = expandedChain === chain.chainName;
|
|
@@ -4700,7 +4793,7 @@ var headingStyle8 = (color) => ({
|
|
|
4700
4793
|
color,
|
|
4701
4794
|
margin: "8px 0 4px"
|
|
4702
4795
|
});
|
|
4703
|
-
var
|
|
4796
|
+
var subtitleStyle7 = (color) => ({
|
|
4704
4797
|
fontSize: "0.86rem",
|
|
4705
4798
|
color,
|
|
4706
4799
|
margin: "0 0 20px",
|
|
@@ -4934,7 +5027,7 @@ function OpenWalletScreen({
|
|
|
4934
5027
|
displayName,
|
|
4935
5028
|
"..."
|
|
4936
5029
|
] }),
|
|
4937
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
5030
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: "Approve the connection in your wallet extension." }),
|
|
4938
5031
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
4939
5032
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 14 }),
|
|
4940
5033
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Waiting for authorization..." })
|
|
@@ -4963,7 +5056,7 @@ function OpenWalletScreen({
|
|
|
4963
5056
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle8, children: [
|
|
4964
5057
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: logoCircleStyle(tokens.bgInput), children: logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle2 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 32 }) }),
|
|
4965
5058
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle10(tokens.text), children: loading ? "Connecting..." : `Open ${displayName}` }),
|
|
4966
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style:
|
|
5059
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: subtitleStyle8(tokens.textSecondary), children: loading ? "Creating transfer and preparing your wallet link..." : `Continue in ${displayName} to authorize this connection.` }),
|
|
4967
5060
|
!loading && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: waitingBadgeStyle(tokens), children: [
|
|
4968
5061
|
/* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 14 }),
|
|
4969
5062
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Waiting for authorization..." })
|
|
@@ -5010,7 +5103,7 @@ var headingStyle10 = (color) => ({
|
|
|
5010
5103
|
color,
|
|
5011
5104
|
margin: "20px 0 8px"
|
|
5012
5105
|
});
|
|
5013
|
-
var
|
|
5106
|
+
var subtitleStyle8 = (color) => ({
|
|
5014
5107
|
fontSize: "0.9rem",
|
|
5015
5108
|
color,
|
|
5016
5109
|
margin: "0 0 24px",
|
|
@@ -5062,7 +5155,7 @@ function ConfirmSignScreen({
|
|
|
5062
5155
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle9, children: [
|
|
5063
5156
|
logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: displayName, style: logoStyle3 }) : /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 }),
|
|
5064
5157
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: headingStyle11(tokens.text), children: "Wallet authorized" }),
|
|
5065
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { style:
|
|
5158
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: subtitleStyle9(tokens.textSecondary), children: [
|
|
5066
5159
|
displayName,
|
|
5067
5160
|
" approved the connection. Tap below to confirm your payment."
|
|
5068
5161
|
] }),
|
|
@@ -5097,7 +5190,7 @@ var headingStyle11 = (color) => ({
|
|
|
5097
5190
|
color,
|
|
5098
5191
|
margin: "20px 0 8px"
|
|
5099
5192
|
});
|
|
5100
|
-
var
|
|
5193
|
+
var subtitleStyle9 = (color) => ({
|
|
5101
5194
|
fontSize: "0.9rem",
|
|
5102
5195
|
color,
|
|
5103
5196
|
margin: "0 0 24px",
|