@swype-org/react-sdk 0.1.16 → 0.1.18
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 +117 -94
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +117 -94
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,52 +15,52 @@ var __export = (target, all) => {
|
|
|
15
15
|
|
|
16
16
|
// src/theme.ts
|
|
17
17
|
var darkTheme = {
|
|
18
|
-
bg: "#
|
|
19
|
-
bgCard: "#
|
|
20
|
-
bgInput: "#
|
|
21
|
-
bgHover: "#
|
|
22
|
-
bgOverlay: "rgba(
|
|
23
|
-
text: "#
|
|
24
|
-
textSecondary: "#
|
|
25
|
-
textMuted: "#
|
|
26
|
-
textInverse: "#
|
|
27
|
-
border: "#
|
|
28
|
-
borderFocus: "#
|
|
29
|
-
accent: "#
|
|
30
|
-
accentHover: "#
|
|
18
|
+
bg: "#071216",
|
|
19
|
+
bgCard: "#101c22",
|
|
20
|
+
bgInput: "#17272f",
|
|
21
|
+
bgHover: "#20343d",
|
|
22
|
+
bgOverlay: "rgba(3, 10, 13, 0.7)",
|
|
23
|
+
text: "#ecfeff",
|
|
24
|
+
textSecondary: "#b7d3dd",
|
|
25
|
+
textMuted: "#7fa4b0",
|
|
26
|
+
textInverse: "#052027",
|
|
27
|
+
border: "#2b4551",
|
|
28
|
+
borderFocus: "#2ec4cf",
|
|
29
|
+
accent: "#2eb6c2",
|
|
30
|
+
accentHover: "#239ba6",
|
|
31
31
|
accentText: "#ffffff",
|
|
32
|
-
success: "#
|
|
33
|
-
successBg: "#
|
|
34
|
-
error: "#
|
|
35
|
-
errorBg: "#
|
|
36
|
-
shadow: "0 1px
|
|
37
|
-
shadowLg: "0
|
|
38
|
-
radius: "
|
|
39
|
-
radiusLg: "
|
|
32
|
+
success: "#0f9d73",
|
|
33
|
+
successBg: "#0f2f2a",
|
|
34
|
+
error: "#d46a72",
|
|
35
|
+
errorBg: "#301d21",
|
|
36
|
+
shadow: "0 1px 4px rgba(0,0,0,0.35)",
|
|
37
|
+
shadowLg: "0 18px 44px rgba(0,0,0,0.42)",
|
|
38
|
+
radius: "14px",
|
|
39
|
+
radiusLg: "24px"
|
|
40
40
|
};
|
|
41
41
|
var lightTheme = {
|
|
42
|
-
bg: "#
|
|
43
|
-
bgCard: "#
|
|
44
|
-
bgInput: "#
|
|
45
|
-
bgHover: "#
|
|
46
|
-
bgOverlay: "rgba(
|
|
47
|
-
text: "#
|
|
48
|
-
textSecondary: "#
|
|
49
|
-
textMuted: "#
|
|
42
|
+
bg: "#ebf9fb",
|
|
43
|
+
bgCard: "#f9fdff",
|
|
44
|
+
bgInput: "#f1f8fb",
|
|
45
|
+
bgHover: "#e7f4f7",
|
|
46
|
+
bgOverlay: "rgba(7, 18, 22, 0.18)",
|
|
47
|
+
text: "#12222b",
|
|
48
|
+
textSecondary: "#4b6772",
|
|
49
|
+
textMuted: "#7d97a1",
|
|
50
50
|
textInverse: "#ffffff",
|
|
51
|
-
border: "#
|
|
52
|
-
borderFocus: "#
|
|
53
|
-
accent: "#
|
|
54
|
-
accentHover: "#
|
|
51
|
+
border: "#d2e4ea",
|
|
52
|
+
borderFocus: "#2eb6c2",
|
|
53
|
+
accent: "#2eb6c2",
|
|
54
|
+
accentHover: "#259da7",
|
|
55
55
|
accentText: "#ffffff",
|
|
56
|
-
success: "#
|
|
57
|
-
successBg: "#
|
|
58
|
-
error: "#
|
|
59
|
-
errorBg: "#
|
|
60
|
-
shadow: "0 1px 3px rgba(
|
|
61
|
-
shadowLg: "0
|
|
62
|
-
radius: "
|
|
63
|
-
radiusLg: "
|
|
56
|
+
success: "#0f9d73",
|
|
57
|
+
successBg: "#e6f7f1",
|
|
58
|
+
error: "#ce6670",
|
|
59
|
+
errorBg: "#fdf1f2",
|
|
60
|
+
shadow: "0 1px 3px rgba(12, 31, 39, 0.08)",
|
|
61
|
+
shadowLg: "0 20px 48px rgba(19, 61, 75, 0.14)",
|
|
62
|
+
radius: "14px",
|
|
63
|
+
radiusLg: "24px"
|
|
64
64
|
};
|
|
65
65
|
function getTheme(mode) {
|
|
66
66
|
return mode === "dark" ? darkTheme : lightTheme;
|
|
@@ -104,7 +104,8 @@ function SwypeProvider({
|
|
|
104
104
|
appId: SWYPE_PRIVY_APP_ID,
|
|
105
105
|
config: {
|
|
106
106
|
appearance: {
|
|
107
|
-
theme
|
|
107
|
+
theme,
|
|
108
|
+
accentColor: getTheme(theme).accent
|
|
108
109
|
}
|
|
109
110
|
},
|
|
110
111
|
children: /* @__PURE__ */ jsx(SwypeContext.Provider, { value, children })
|
|
@@ -1287,10 +1288,12 @@ function Spinner({ size = 40, label }) {
|
|
|
1287
1288
|
style: {
|
|
1288
1289
|
width: size,
|
|
1289
1290
|
height: size,
|
|
1290
|
-
border: `
|
|
1291
|
+
border: `4px solid ${tokens.bgInput}`,
|
|
1291
1292
|
borderTopColor: tokens.accent,
|
|
1293
|
+
borderRightColor: tokens.accent + "66",
|
|
1292
1294
|
borderRadius: "50%",
|
|
1293
|
-
|
|
1295
|
+
boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.1)",
|
|
1296
|
+
animation: "swype-spin 0.9s linear infinite"
|
|
1294
1297
|
}
|
|
1295
1298
|
}
|
|
1296
1299
|
),
|
|
@@ -1321,7 +1324,7 @@ function ProviderCard({ provider, selected, onClick }) {
|
|
|
1321
1324
|
padding: "14px 16px",
|
|
1322
1325
|
background: selected ? tokens.accent + "18" : hovered ? tokens.bgHover : tokens.bgInput,
|
|
1323
1326
|
border: `1.5px solid ${selected ? tokens.accent : tokens.border}`,
|
|
1324
|
-
borderRadius: tokens.
|
|
1327
|
+
borderRadius: tokens.radiusLg,
|
|
1325
1328
|
cursor: "pointer",
|
|
1326
1329
|
transition: "all 0.15s ease",
|
|
1327
1330
|
color: tokens.text,
|
|
@@ -1340,7 +1343,7 @@ function ProviderCard({ provider, selected, onClick }) {
|
|
|
1340
1343
|
style: {
|
|
1341
1344
|
width: 32,
|
|
1342
1345
|
height: 32,
|
|
1343
|
-
borderRadius: "
|
|
1346
|
+
borderRadius: "50%",
|
|
1344
1347
|
objectFit: "contain"
|
|
1345
1348
|
}
|
|
1346
1349
|
}
|
|
@@ -1350,7 +1353,7 @@ function ProviderCard({ provider, selected, onClick }) {
|
|
|
1350
1353
|
style: {
|
|
1351
1354
|
width: 32,
|
|
1352
1355
|
height: 32,
|
|
1353
|
-
borderRadius: "
|
|
1356
|
+
borderRadius: "50%",
|
|
1354
1357
|
background: tokens.accent + "30",
|
|
1355
1358
|
display: "flex",
|
|
1356
1359
|
alignItems: "center",
|
|
@@ -1456,10 +1459,11 @@ function AccountDropdown({
|
|
|
1456
1459
|
display: "flex",
|
|
1457
1460
|
alignItems: "center",
|
|
1458
1461
|
gap: "6px",
|
|
1459
|
-
background:
|
|
1460
|
-
border:
|
|
1462
|
+
background: tokens.bgCard,
|
|
1463
|
+
border: `1px solid ${tokens.border}`,
|
|
1461
1464
|
cursor: "pointer",
|
|
1462
|
-
padding: "
|
|
1465
|
+
padding: "7px 10px",
|
|
1466
|
+
borderRadius: "999px",
|
|
1463
1467
|
color: tokens.textSecondary,
|
|
1464
1468
|
fontFamily: "inherit",
|
|
1465
1469
|
fontSize: "0.85rem",
|
|
@@ -1516,7 +1520,7 @@ function AccountDropdown({
|
|
|
1516
1520
|
marginTop: "4px",
|
|
1517
1521
|
background: tokens.bgCard,
|
|
1518
1522
|
border: `1px solid ${tokens.border}`,
|
|
1519
|
-
borderRadius: tokens.
|
|
1523
|
+
borderRadius: tokens.radiusLg,
|
|
1520
1524
|
boxShadow: tokens.shadowLg,
|
|
1521
1525
|
zIndex: 50,
|
|
1522
1526
|
overflow: "hidden",
|
|
@@ -1575,8 +1579,8 @@ function AccountDropdown({
|
|
|
1575
1579
|
fontWeight: 600,
|
|
1576
1580
|
color: tokens.success,
|
|
1577
1581
|
background: tokens.successBg,
|
|
1578
|
-
padding: "
|
|
1579
|
-
borderRadius: "
|
|
1582
|
+
padding: "2px 7px",
|
|
1583
|
+
borderRadius: "999px",
|
|
1580
1584
|
textTransform: "uppercase",
|
|
1581
1585
|
letterSpacing: "0.03em"
|
|
1582
1586
|
},
|
|
@@ -1791,7 +1795,7 @@ function AdvancedSettings({
|
|
|
1791
1795
|
marginTop: "10px",
|
|
1792
1796
|
padding: "14px",
|
|
1793
1797
|
background: tokens.bgInput,
|
|
1794
|
-
borderRadius: tokens.
|
|
1798
|
+
borderRadius: tokens.radiusLg,
|
|
1795
1799
|
border: `1px solid ${tokens.border}`
|
|
1796
1800
|
},
|
|
1797
1801
|
children: [
|
|
@@ -1821,13 +1825,13 @@ function AdvancedSettings({
|
|
|
1821
1825
|
asset: isSelected ? null : asset
|
|
1822
1826
|
}),
|
|
1823
1827
|
style: {
|
|
1824
|
-
padding: "
|
|
1828
|
+
padding: "7px 14px",
|
|
1825
1829
|
fontSize: "0.8rem",
|
|
1826
1830
|
fontWeight: 600,
|
|
1827
1831
|
fontFamily: "inherit",
|
|
1828
|
-
borderRadius: "
|
|
1832
|
+
borderRadius: "999px",
|
|
1829
1833
|
border: `1.5px solid ${isSelected ? tokens.accent : tokens.border}`,
|
|
1830
|
-
background: isSelected ? tokens.accent + "18" :
|
|
1834
|
+
background: isSelected ? tokens.accent + "18" : tokens.bgCard,
|
|
1831
1835
|
color: isSelected ? tokens.accent : tokens.text,
|
|
1832
1836
|
cursor: "pointer",
|
|
1833
1837
|
outline: "none",
|
|
@@ -1865,13 +1869,13 @@ function AdvancedSettings({
|
|
|
1865
1869
|
chain: isSelected ? null : chain.name
|
|
1866
1870
|
}),
|
|
1867
1871
|
style: {
|
|
1868
|
-
padding: "
|
|
1872
|
+
padding: "7px 14px",
|
|
1869
1873
|
fontSize: "0.8rem",
|
|
1870
1874
|
fontWeight: 600,
|
|
1871
1875
|
fontFamily: "inherit",
|
|
1872
|
-
borderRadius: "
|
|
1876
|
+
borderRadius: "999px",
|
|
1873
1877
|
border: `1.5px solid ${isSelected ? tokens.accent : tokens.border}`,
|
|
1874
|
-
background: isSelected ? tokens.accent + "18" :
|
|
1878
|
+
background: isSelected ? tokens.accent + "18" : tokens.bgCard,
|
|
1875
1879
|
color: isSelected ? tokens.accent : tokens.text,
|
|
1876
1880
|
cursor: "pointer",
|
|
1877
1881
|
outline: "none",
|
|
@@ -1892,9 +1896,9 @@ function AdvancedSettings({
|
|
|
1892
1896
|
display: "flex",
|
|
1893
1897
|
alignItems: "center",
|
|
1894
1898
|
gap: "6px",
|
|
1895
|
-
background:
|
|
1899
|
+
background: tokens.bgCard,
|
|
1896
1900
|
border: `1px dashed ${tokens.border}`,
|
|
1897
|
-
borderRadius:
|
|
1901
|
+
borderRadius: "999px",
|
|
1898
1902
|
padding: "10px 14px",
|
|
1899
1903
|
width: "100%",
|
|
1900
1904
|
cursor: connectingNewAccount ? "not-allowed" : "pointer",
|
|
@@ -2516,7 +2520,7 @@ function SwypePayment({
|
|
|
2516
2520
|
background: tokens.bgCard,
|
|
2517
2521
|
borderRadius: tokens.radiusLg,
|
|
2518
2522
|
border: `1px solid ${tokens.border}`,
|
|
2519
|
-
padding: "
|
|
2523
|
+
padding: "30px 24px 24px",
|
|
2520
2524
|
maxWidth: 420,
|
|
2521
2525
|
width: "100%",
|
|
2522
2526
|
boxShadow: tokens.shadowLg,
|
|
@@ -2524,24 +2528,26 @@ function SwypePayment({
|
|
|
2524
2528
|
color: tokens.text
|
|
2525
2529
|
};
|
|
2526
2530
|
const headingStyle = {
|
|
2527
|
-
fontSize: "
|
|
2528
|
-
fontWeight:
|
|
2529
|
-
margin: "0 0
|
|
2531
|
+
fontSize: "2rem",
|
|
2532
|
+
fontWeight: 700,
|
|
2533
|
+
margin: "0 0 18px 0",
|
|
2534
|
+
letterSpacing: "-0.02em",
|
|
2530
2535
|
color: tokens.text,
|
|
2531
2536
|
textAlign: "center"
|
|
2532
2537
|
};
|
|
2533
2538
|
const btnPrimary = {
|
|
2534
2539
|
width: "100%",
|
|
2535
|
-
padding: "
|
|
2536
|
-
background: tokens.accent,
|
|
2540
|
+
padding: "15px 18px",
|
|
2541
|
+
background: `linear-gradient(180deg, ${tokens.accent}, ${tokens.accentHover})`,
|
|
2537
2542
|
color: tokens.accentText,
|
|
2538
2543
|
border: "none",
|
|
2539
|
-
borderRadius:
|
|
2540
|
-
fontSize: "
|
|
2541
|
-
fontWeight:
|
|
2544
|
+
borderRadius: "999px",
|
|
2545
|
+
fontSize: "1.03rem",
|
|
2546
|
+
fontWeight: 700,
|
|
2542
2547
|
cursor: "pointer",
|
|
2543
|
-
transition: "
|
|
2544
|
-
fontFamily: "inherit"
|
|
2548
|
+
transition: "filter 0.15s ease, transform 0.15s ease",
|
|
2549
|
+
fontFamily: "inherit",
|
|
2550
|
+
boxShadow: "0 8px 18px rgba(46, 182, 194, 0.28)"
|
|
2545
2551
|
};
|
|
2546
2552
|
const btnDisabled = {
|
|
2547
2553
|
...btnPrimary,
|
|
@@ -2550,15 +2556,16 @@ function SwypePayment({
|
|
|
2550
2556
|
};
|
|
2551
2557
|
({
|
|
2552
2558
|
...btnPrimary,
|
|
2559
|
+
background: tokens.bgCard,
|
|
2553
2560
|
color: tokens.textSecondary,
|
|
2554
2561
|
border: `1px solid ${tokens.border}`});
|
|
2555
2562
|
const errorStyle = {
|
|
2556
2563
|
background: tokens.errorBg,
|
|
2557
|
-
border: `1px solid ${tokens.error}`,
|
|
2558
|
-
borderRadius: tokens.
|
|
2559
|
-
padding: "
|
|
2564
|
+
border: `1px solid ${tokens.error}66`,
|
|
2565
|
+
borderRadius: tokens.radiusLg,
|
|
2566
|
+
padding: "11px 14px",
|
|
2560
2567
|
color: tokens.error,
|
|
2561
|
-
fontSize: "0.
|
|
2568
|
+
fontSize: "0.86rem",
|
|
2562
2569
|
marginBottom: "14px",
|
|
2563
2570
|
lineHeight: 1.5
|
|
2564
2571
|
};
|
|
@@ -2568,7 +2575,8 @@ function SwypePayment({
|
|
|
2568
2575
|
style: {
|
|
2569
2576
|
display: "flex",
|
|
2570
2577
|
alignItems: "center",
|
|
2571
|
-
|
|
2578
|
+
justifyContent: "center",
|
|
2579
|
+
gap: "10px",
|
|
2572
2580
|
marginBottom: "20px"
|
|
2573
2581
|
},
|
|
2574
2582
|
children: [
|
|
@@ -2576,10 +2584,22 @@ function SwypePayment({
|
|
|
2576
2584
|
"div",
|
|
2577
2585
|
{
|
|
2578
2586
|
style: {
|
|
2579
|
-
width:
|
|
2580
|
-
height:
|
|
2581
|
-
borderRadius:
|
|
2582
|
-
background: tokens.accent
|
|
2587
|
+
width: 28,
|
|
2588
|
+
height: 7,
|
|
2589
|
+
borderRadius: 999,
|
|
2590
|
+
background: tokens.accent,
|
|
2591
|
+
opacity: 0.95
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
),
|
|
2595
|
+
/* @__PURE__ */ jsx(
|
|
2596
|
+
"div",
|
|
2597
|
+
{
|
|
2598
|
+
style: {
|
|
2599
|
+
width: 8,
|
|
2600
|
+
height: 8,
|
|
2601
|
+
borderRadius: 999,
|
|
2602
|
+
background: tokens.border
|
|
2583
2603
|
}
|
|
2584
2604
|
}
|
|
2585
2605
|
),
|
|
@@ -2769,8 +2789,8 @@ function SwypePayment({
|
|
|
2769
2789
|
gap: "8px",
|
|
2770
2790
|
background: tokens.bgInput,
|
|
2771
2791
|
border: `1px solid ${tokens.border}`,
|
|
2772
|
-
borderRadius: tokens.
|
|
2773
|
-
padding: "
|
|
2792
|
+
borderRadius: tokens.radiusLg,
|
|
2793
|
+
padding: "6px 14px 6px 8px",
|
|
2774
2794
|
marginBottom: "8px"
|
|
2775
2795
|
},
|
|
2776
2796
|
children: [
|
|
@@ -2817,9 +2837,10 @@ function SwypePayment({
|
|
|
2817
2837
|
fontSize: "0.825rem",
|
|
2818
2838
|
fontWeight: 600,
|
|
2819
2839
|
color: tokens.textMuted,
|
|
2820
|
-
background: tokens.
|
|
2821
|
-
padding: "
|
|
2822
|
-
|
|
2840
|
+
background: tokens.bgCard,
|
|
2841
|
+
padding: "6px 12px",
|
|
2842
|
+
border: `1px solid ${tokens.border}`,
|
|
2843
|
+
borderRadius: "999px"
|
|
2823
2844
|
},
|
|
2824
2845
|
children: "USD"
|
|
2825
2846
|
}
|
|
@@ -2945,7 +2966,8 @@ function SwypePayment({
|
|
|
2945
2966
|
marginBottom: "16px",
|
|
2946
2967
|
padding: "12px 14px",
|
|
2947
2968
|
background: tokens.bgInput,
|
|
2948
|
-
borderRadius: tokens.
|
|
2969
|
+
borderRadius: tokens.radiusLg,
|
|
2970
|
+
border: `1px solid ${tokens.border}`,
|
|
2949
2971
|
lineHeight: 1.7
|
|
2950
2972
|
},
|
|
2951
2973
|
children: [
|
|
@@ -3144,9 +3166,9 @@ function SwypePayment({
|
|
|
3144
3166
|
width: "100%",
|
|
3145
3167
|
marginBottom: "12px",
|
|
3146
3168
|
padding: "10px 12px",
|
|
3147
|
-
borderRadius: tokens.
|
|
3169
|
+
borderRadius: tokens.radiusLg,
|
|
3148
3170
|
border: `1px solid ${tokens.border}`,
|
|
3149
|
-
background: tokens.
|
|
3171
|
+
background: tokens.bgInput,
|
|
3150
3172
|
color: tokens.text,
|
|
3151
3173
|
fontFamily: "inherit",
|
|
3152
3174
|
fontSize: "0.875rem",
|
|
@@ -3185,9 +3207,9 @@ function SwypePayment({
|
|
|
3185
3207
|
style: {
|
|
3186
3208
|
width: "100%",
|
|
3187
3209
|
padding: "10px 12px",
|
|
3188
|
-
borderRadius: tokens.
|
|
3210
|
+
borderRadius: tokens.radiusLg,
|
|
3189
3211
|
border: `1px solid ${tokens.border}`,
|
|
3190
|
-
background: tokens.
|
|
3212
|
+
background: tokens.bgInput,
|
|
3191
3213
|
color: tokens.text,
|
|
3192
3214
|
fontFamily: "inherit",
|
|
3193
3215
|
fontSize: "0.875rem",
|
|
@@ -3230,7 +3252,7 @@ function SwypePayment({
|
|
|
3230
3252
|
] }),
|
|
3231
3253
|
/* @__PURE__ */ jsx("h2", { style: { ...headingStyle, marginBottom: "8px" }, children: "Authorize Transfer" }),
|
|
3232
3254
|
/* @__PURE__ */ jsx("p", { style: { fontSize: "0.85rem", color: tokens.textSecondary, margin: "0 0 16px 0", lineHeight: 1.5 }, children: "Use your passkey to confirm this payment." }),
|
|
3233
|
-
/* @__PURE__ */ jsxs("div", { style: { fontSize: "0.825rem", color: tokens.textSecondary, padding: "12px 14px", background: tokens.bgInput, borderRadius: tokens.
|
|
3255
|
+
/* @__PURE__ */ jsxs("div", { style: { fontSize: "0.825rem", color: tokens.textSecondary, padding: "12px 14px", background: tokens.bgInput, borderRadius: tokens.radiusLg, border: `1px solid ${tokens.border}`, textAlign: "left", lineHeight: 1.7, marginBottom: "16px" }, children: [
|
|
3234
3256
|
payload.amount && payload.tokenSymbol && /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between" }, children: [
|
|
3235
3257
|
/* @__PURE__ */ jsx("span", { children: "Amount" }),
|
|
3236
3258
|
/* @__PURE__ */ jsxs("span", { style: { fontWeight: 600, color: tokens.text }, children: [
|
|
@@ -3421,7 +3443,8 @@ function SwypePayment({
|
|
|
3421
3443
|
margin: "0 0 24px 0",
|
|
3422
3444
|
padding: "14px",
|
|
3423
3445
|
background: tokens.bgInput,
|
|
3424
|
-
borderRadius: tokens.
|
|
3446
|
+
borderRadius: tokens.radiusLg,
|
|
3447
|
+
border: `1px solid ${tokens.border}`,
|
|
3425
3448
|
textAlign: "left",
|
|
3426
3449
|
lineHeight: 1.8
|
|
3427
3450
|
},
|