@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.cjs
CHANGED
|
@@ -18,52 +18,52 @@ var __export = (target, all) => {
|
|
|
18
18
|
|
|
19
19
|
// src/theme.ts
|
|
20
20
|
var darkTheme = {
|
|
21
|
-
bg: "#
|
|
22
|
-
bgCard: "#
|
|
23
|
-
bgInput: "#
|
|
24
|
-
bgHover: "#
|
|
25
|
-
bgOverlay: "rgba(
|
|
26
|
-
text: "#
|
|
27
|
-
textSecondary: "#
|
|
28
|
-
textMuted: "#
|
|
29
|
-
textInverse: "#
|
|
30
|
-
border: "#
|
|
31
|
-
borderFocus: "#
|
|
32
|
-
accent: "#
|
|
33
|
-
accentHover: "#
|
|
21
|
+
bg: "#071216",
|
|
22
|
+
bgCard: "#101c22",
|
|
23
|
+
bgInput: "#17272f",
|
|
24
|
+
bgHover: "#20343d",
|
|
25
|
+
bgOverlay: "rgba(3, 10, 13, 0.7)",
|
|
26
|
+
text: "#ecfeff",
|
|
27
|
+
textSecondary: "#b7d3dd",
|
|
28
|
+
textMuted: "#7fa4b0",
|
|
29
|
+
textInverse: "#052027",
|
|
30
|
+
border: "#2b4551",
|
|
31
|
+
borderFocus: "#2ec4cf",
|
|
32
|
+
accent: "#2eb6c2",
|
|
33
|
+
accentHover: "#239ba6",
|
|
34
34
|
accentText: "#ffffff",
|
|
35
|
-
success: "#
|
|
36
|
-
successBg: "#
|
|
37
|
-
error: "#
|
|
38
|
-
errorBg: "#
|
|
39
|
-
shadow: "0 1px
|
|
40
|
-
shadowLg: "0
|
|
41
|
-
radius: "
|
|
42
|
-
radiusLg: "
|
|
35
|
+
success: "#0f9d73",
|
|
36
|
+
successBg: "#0f2f2a",
|
|
37
|
+
error: "#d46a72",
|
|
38
|
+
errorBg: "#301d21",
|
|
39
|
+
shadow: "0 1px 4px rgba(0,0,0,0.35)",
|
|
40
|
+
shadowLg: "0 18px 44px rgba(0,0,0,0.42)",
|
|
41
|
+
radius: "14px",
|
|
42
|
+
radiusLg: "24px"
|
|
43
43
|
};
|
|
44
44
|
var lightTheme = {
|
|
45
|
-
bg: "#
|
|
46
|
-
bgCard: "#
|
|
47
|
-
bgInput: "#
|
|
48
|
-
bgHover: "#
|
|
49
|
-
bgOverlay: "rgba(
|
|
50
|
-
text: "#
|
|
51
|
-
textSecondary: "#
|
|
52
|
-
textMuted: "#
|
|
45
|
+
bg: "#ebf9fb",
|
|
46
|
+
bgCard: "#f9fdff",
|
|
47
|
+
bgInput: "#f1f8fb",
|
|
48
|
+
bgHover: "#e7f4f7",
|
|
49
|
+
bgOverlay: "rgba(7, 18, 22, 0.18)",
|
|
50
|
+
text: "#12222b",
|
|
51
|
+
textSecondary: "#4b6772",
|
|
52
|
+
textMuted: "#7d97a1",
|
|
53
53
|
textInverse: "#ffffff",
|
|
54
|
-
border: "#
|
|
55
|
-
borderFocus: "#
|
|
56
|
-
accent: "#
|
|
57
|
-
accentHover: "#
|
|
54
|
+
border: "#d2e4ea",
|
|
55
|
+
borderFocus: "#2eb6c2",
|
|
56
|
+
accent: "#2eb6c2",
|
|
57
|
+
accentHover: "#259da7",
|
|
58
58
|
accentText: "#ffffff",
|
|
59
|
-
success: "#
|
|
60
|
-
successBg: "#
|
|
61
|
-
error: "#
|
|
62
|
-
errorBg: "#
|
|
63
|
-
shadow: "0 1px 3px rgba(
|
|
64
|
-
shadowLg: "0
|
|
65
|
-
radius: "
|
|
66
|
-
radiusLg: "
|
|
59
|
+
success: "#0f9d73",
|
|
60
|
+
successBg: "#e6f7f1",
|
|
61
|
+
error: "#ce6670",
|
|
62
|
+
errorBg: "#fdf1f2",
|
|
63
|
+
shadow: "0 1px 3px rgba(12, 31, 39, 0.08)",
|
|
64
|
+
shadowLg: "0 20px 48px rgba(19, 61, 75, 0.14)",
|
|
65
|
+
radius: "14px",
|
|
66
|
+
radiusLg: "24px"
|
|
67
67
|
};
|
|
68
68
|
function getTheme(mode) {
|
|
69
69
|
return mode === "dark" ? darkTheme : lightTheme;
|
|
@@ -107,7 +107,8 @@ function SwypeProvider({
|
|
|
107
107
|
appId: SWYPE_PRIVY_APP_ID,
|
|
108
108
|
config: {
|
|
109
109
|
appearance: {
|
|
110
|
-
theme
|
|
110
|
+
theme,
|
|
111
|
+
accentColor: getTheme(theme).accent
|
|
111
112
|
}
|
|
112
113
|
},
|
|
113
114
|
children: /* @__PURE__ */ jsxRuntime.jsx(SwypeContext.Provider, { value, children })
|
|
@@ -1290,10 +1291,12 @@ function Spinner({ size = 40, label }) {
|
|
|
1290
1291
|
style: {
|
|
1291
1292
|
width: size,
|
|
1292
1293
|
height: size,
|
|
1293
|
-
border: `
|
|
1294
|
+
border: `4px solid ${tokens.bgInput}`,
|
|
1294
1295
|
borderTopColor: tokens.accent,
|
|
1296
|
+
borderRightColor: tokens.accent + "66",
|
|
1295
1297
|
borderRadius: "50%",
|
|
1296
|
-
|
|
1298
|
+
boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.1)",
|
|
1299
|
+
animation: "swype-spin 0.9s linear infinite"
|
|
1297
1300
|
}
|
|
1298
1301
|
}
|
|
1299
1302
|
),
|
|
@@ -1324,7 +1327,7 @@ function ProviderCard({ provider, selected, onClick }) {
|
|
|
1324
1327
|
padding: "14px 16px",
|
|
1325
1328
|
background: selected ? tokens.accent + "18" : hovered ? tokens.bgHover : tokens.bgInput,
|
|
1326
1329
|
border: `1.5px solid ${selected ? tokens.accent : tokens.border}`,
|
|
1327
|
-
borderRadius: tokens.
|
|
1330
|
+
borderRadius: tokens.radiusLg,
|
|
1328
1331
|
cursor: "pointer",
|
|
1329
1332
|
transition: "all 0.15s ease",
|
|
1330
1333
|
color: tokens.text,
|
|
@@ -1343,7 +1346,7 @@ function ProviderCard({ provider, selected, onClick }) {
|
|
|
1343
1346
|
style: {
|
|
1344
1347
|
width: 32,
|
|
1345
1348
|
height: 32,
|
|
1346
|
-
borderRadius: "
|
|
1349
|
+
borderRadius: "50%",
|
|
1347
1350
|
objectFit: "contain"
|
|
1348
1351
|
}
|
|
1349
1352
|
}
|
|
@@ -1353,7 +1356,7 @@ function ProviderCard({ provider, selected, onClick }) {
|
|
|
1353
1356
|
style: {
|
|
1354
1357
|
width: 32,
|
|
1355
1358
|
height: 32,
|
|
1356
|
-
borderRadius: "
|
|
1359
|
+
borderRadius: "50%",
|
|
1357
1360
|
background: tokens.accent + "30",
|
|
1358
1361
|
display: "flex",
|
|
1359
1362
|
alignItems: "center",
|
|
@@ -1459,10 +1462,11 @@ function AccountDropdown({
|
|
|
1459
1462
|
display: "flex",
|
|
1460
1463
|
alignItems: "center",
|
|
1461
1464
|
gap: "6px",
|
|
1462
|
-
background:
|
|
1463
|
-
border:
|
|
1465
|
+
background: tokens.bgCard,
|
|
1466
|
+
border: `1px solid ${tokens.border}`,
|
|
1464
1467
|
cursor: "pointer",
|
|
1465
|
-
padding: "
|
|
1468
|
+
padding: "7px 10px",
|
|
1469
|
+
borderRadius: "999px",
|
|
1466
1470
|
color: tokens.textSecondary,
|
|
1467
1471
|
fontFamily: "inherit",
|
|
1468
1472
|
fontSize: "0.85rem",
|
|
@@ -1519,7 +1523,7 @@ function AccountDropdown({
|
|
|
1519
1523
|
marginTop: "4px",
|
|
1520
1524
|
background: tokens.bgCard,
|
|
1521
1525
|
border: `1px solid ${tokens.border}`,
|
|
1522
|
-
borderRadius: tokens.
|
|
1526
|
+
borderRadius: tokens.radiusLg,
|
|
1523
1527
|
boxShadow: tokens.shadowLg,
|
|
1524
1528
|
zIndex: 50,
|
|
1525
1529
|
overflow: "hidden",
|
|
@@ -1578,8 +1582,8 @@ function AccountDropdown({
|
|
|
1578
1582
|
fontWeight: 600,
|
|
1579
1583
|
color: tokens.success,
|
|
1580
1584
|
background: tokens.successBg,
|
|
1581
|
-
padding: "
|
|
1582
|
-
borderRadius: "
|
|
1585
|
+
padding: "2px 7px",
|
|
1586
|
+
borderRadius: "999px",
|
|
1583
1587
|
textTransform: "uppercase",
|
|
1584
1588
|
letterSpacing: "0.03em"
|
|
1585
1589
|
},
|
|
@@ -1794,7 +1798,7 @@ function AdvancedSettings({
|
|
|
1794
1798
|
marginTop: "10px",
|
|
1795
1799
|
padding: "14px",
|
|
1796
1800
|
background: tokens.bgInput,
|
|
1797
|
-
borderRadius: tokens.
|
|
1801
|
+
borderRadius: tokens.radiusLg,
|
|
1798
1802
|
border: `1px solid ${tokens.border}`
|
|
1799
1803
|
},
|
|
1800
1804
|
children: [
|
|
@@ -1824,13 +1828,13 @@ function AdvancedSettings({
|
|
|
1824
1828
|
asset: isSelected ? null : asset
|
|
1825
1829
|
}),
|
|
1826
1830
|
style: {
|
|
1827
|
-
padding: "
|
|
1831
|
+
padding: "7px 14px",
|
|
1828
1832
|
fontSize: "0.8rem",
|
|
1829
1833
|
fontWeight: 600,
|
|
1830
1834
|
fontFamily: "inherit",
|
|
1831
|
-
borderRadius: "
|
|
1835
|
+
borderRadius: "999px",
|
|
1832
1836
|
border: `1.5px solid ${isSelected ? tokens.accent : tokens.border}`,
|
|
1833
|
-
background: isSelected ? tokens.accent + "18" :
|
|
1837
|
+
background: isSelected ? tokens.accent + "18" : tokens.bgCard,
|
|
1834
1838
|
color: isSelected ? tokens.accent : tokens.text,
|
|
1835
1839
|
cursor: "pointer",
|
|
1836
1840
|
outline: "none",
|
|
@@ -1868,13 +1872,13 @@ function AdvancedSettings({
|
|
|
1868
1872
|
chain: isSelected ? null : chain.name
|
|
1869
1873
|
}),
|
|
1870
1874
|
style: {
|
|
1871
|
-
padding: "
|
|
1875
|
+
padding: "7px 14px",
|
|
1872
1876
|
fontSize: "0.8rem",
|
|
1873
1877
|
fontWeight: 600,
|
|
1874
1878
|
fontFamily: "inherit",
|
|
1875
|
-
borderRadius: "
|
|
1879
|
+
borderRadius: "999px",
|
|
1876
1880
|
border: `1.5px solid ${isSelected ? tokens.accent : tokens.border}`,
|
|
1877
|
-
background: isSelected ? tokens.accent + "18" :
|
|
1881
|
+
background: isSelected ? tokens.accent + "18" : tokens.bgCard,
|
|
1878
1882
|
color: isSelected ? tokens.accent : tokens.text,
|
|
1879
1883
|
cursor: "pointer",
|
|
1880
1884
|
outline: "none",
|
|
@@ -1895,9 +1899,9 @@ function AdvancedSettings({
|
|
|
1895
1899
|
display: "flex",
|
|
1896
1900
|
alignItems: "center",
|
|
1897
1901
|
gap: "6px",
|
|
1898
|
-
background:
|
|
1902
|
+
background: tokens.bgCard,
|
|
1899
1903
|
border: `1px dashed ${tokens.border}`,
|
|
1900
|
-
borderRadius:
|
|
1904
|
+
borderRadius: "999px",
|
|
1901
1905
|
padding: "10px 14px",
|
|
1902
1906
|
width: "100%",
|
|
1903
1907
|
cursor: connectingNewAccount ? "not-allowed" : "pointer",
|
|
@@ -2519,7 +2523,7 @@ function SwypePayment({
|
|
|
2519
2523
|
background: tokens.bgCard,
|
|
2520
2524
|
borderRadius: tokens.radiusLg,
|
|
2521
2525
|
border: `1px solid ${tokens.border}`,
|
|
2522
|
-
padding: "
|
|
2526
|
+
padding: "30px 24px 24px",
|
|
2523
2527
|
maxWidth: 420,
|
|
2524
2528
|
width: "100%",
|
|
2525
2529
|
boxShadow: tokens.shadowLg,
|
|
@@ -2527,24 +2531,26 @@ function SwypePayment({
|
|
|
2527
2531
|
color: tokens.text
|
|
2528
2532
|
};
|
|
2529
2533
|
const headingStyle = {
|
|
2530
|
-
fontSize: "
|
|
2531
|
-
fontWeight:
|
|
2532
|
-
margin: "0 0
|
|
2534
|
+
fontSize: "2rem",
|
|
2535
|
+
fontWeight: 700,
|
|
2536
|
+
margin: "0 0 18px 0",
|
|
2537
|
+
letterSpacing: "-0.02em",
|
|
2533
2538
|
color: tokens.text,
|
|
2534
2539
|
textAlign: "center"
|
|
2535
2540
|
};
|
|
2536
2541
|
const btnPrimary = {
|
|
2537
2542
|
width: "100%",
|
|
2538
|
-
padding: "
|
|
2539
|
-
background: tokens.accent,
|
|
2543
|
+
padding: "15px 18px",
|
|
2544
|
+
background: `linear-gradient(180deg, ${tokens.accent}, ${tokens.accentHover})`,
|
|
2540
2545
|
color: tokens.accentText,
|
|
2541
2546
|
border: "none",
|
|
2542
|
-
borderRadius:
|
|
2543
|
-
fontSize: "
|
|
2544
|
-
fontWeight:
|
|
2547
|
+
borderRadius: "999px",
|
|
2548
|
+
fontSize: "1.03rem",
|
|
2549
|
+
fontWeight: 700,
|
|
2545
2550
|
cursor: "pointer",
|
|
2546
|
-
transition: "
|
|
2547
|
-
fontFamily: "inherit"
|
|
2551
|
+
transition: "filter 0.15s ease, transform 0.15s ease",
|
|
2552
|
+
fontFamily: "inherit",
|
|
2553
|
+
boxShadow: "0 8px 18px rgba(46, 182, 194, 0.28)"
|
|
2548
2554
|
};
|
|
2549
2555
|
const btnDisabled = {
|
|
2550
2556
|
...btnPrimary,
|
|
@@ -2553,15 +2559,16 @@ function SwypePayment({
|
|
|
2553
2559
|
};
|
|
2554
2560
|
({
|
|
2555
2561
|
...btnPrimary,
|
|
2562
|
+
background: tokens.bgCard,
|
|
2556
2563
|
color: tokens.textSecondary,
|
|
2557
2564
|
border: `1px solid ${tokens.border}`});
|
|
2558
2565
|
const errorStyle = {
|
|
2559
2566
|
background: tokens.errorBg,
|
|
2560
|
-
border: `1px solid ${tokens.error}`,
|
|
2561
|
-
borderRadius: tokens.
|
|
2562
|
-
padding: "
|
|
2567
|
+
border: `1px solid ${tokens.error}66`,
|
|
2568
|
+
borderRadius: tokens.radiusLg,
|
|
2569
|
+
padding: "11px 14px",
|
|
2563
2570
|
color: tokens.error,
|
|
2564
|
-
fontSize: "0.
|
|
2571
|
+
fontSize: "0.86rem",
|
|
2565
2572
|
marginBottom: "14px",
|
|
2566
2573
|
lineHeight: 1.5
|
|
2567
2574
|
};
|
|
@@ -2571,7 +2578,8 @@ function SwypePayment({
|
|
|
2571
2578
|
style: {
|
|
2572
2579
|
display: "flex",
|
|
2573
2580
|
alignItems: "center",
|
|
2574
|
-
|
|
2581
|
+
justifyContent: "center",
|
|
2582
|
+
gap: "10px",
|
|
2575
2583
|
marginBottom: "20px"
|
|
2576
2584
|
},
|
|
2577
2585
|
children: [
|
|
@@ -2579,10 +2587,22 @@ function SwypePayment({
|
|
|
2579
2587
|
"div",
|
|
2580
2588
|
{
|
|
2581
2589
|
style: {
|
|
2582
|
-
width:
|
|
2583
|
-
height:
|
|
2584
|
-
borderRadius:
|
|
2585
|
-
background: tokens.accent
|
|
2590
|
+
width: 28,
|
|
2591
|
+
height: 7,
|
|
2592
|
+
borderRadius: 999,
|
|
2593
|
+
background: tokens.accent,
|
|
2594
|
+
opacity: 0.95
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
),
|
|
2598
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2599
|
+
"div",
|
|
2600
|
+
{
|
|
2601
|
+
style: {
|
|
2602
|
+
width: 8,
|
|
2603
|
+
height: 8,
|
|
2604
|
+
borderRadius: 999,
|
|
2605
|
+
background: tokens.border
|
|
2586
2606
|
}
|
|
2587
2607
|
}
|
|
2588
2608
|
),
|
|
@@ -2772,8 +2792,8 @@ function SwypePayment({
|
|
|
2772
2792
|
gap: "8px",
|
|
2773
2793
|
background: tokens.bgInput,
|
|
2774
2794
|
border: `1px solid ${tokens.border}`,
|
|
2775
|
-
borderRadius: tokens.
|
|
2776
|
-
padding: "
|
|
2795
|
+
borderRadius: tokens.radiusLg,
|
|
2796
|
+
padding: "6px 14px 6px 8px",
|
|
2777
2797
|
marginBottom: "8px"
|
|
2778
2798
|
},
|
|
2779
2799
|
children: [
|
|
@@ -2820,9 +2840,10 @@ function SwypePayment({
|
|
|
2820
2840
|
fontSize: "0.825rem",
|
|
2821
2841
|
fontWeight: 600,
|
|
2822
2842
|
color: tokens.textMuted,
|
|
2823
|
-
background: tokens.
|
|
2824
|
-
padding: "
|
|
2825
|
-
|
|
2843
|
+
background: tokens.bgCard,
|
|
2844
|
+
padding: "6px 12px",
|
|
2845
|
+
border: `1px solid ${tokens.border}`,
|
|
2846
|
+
borderRadius: "999px"
|
|
2826
2847
|
},
|
|
2827
2848
|
children: "USD"
|
|
2828
2849
|
}
|
|
@@ -2948,7 +2969,8 @@ function SwypePayment({
|
|
|
2948
2969
|
marginBottom: "16px",
|
|
2949
2970
|
padding: "12px 14px",
|
|
2950
2971
|
background: tokens.bgInput,
|
|
2951
|
-
borderRadius: tokens.
|
|
2972
|
+
borderRadius: tokens.radiusLg,
|
|
2973
|
+
border: `1px solid ${tokens.border}`,
|
|
2952
2974
|
lineHeight: 1.7
|
|
2953
2975
|
},
|
|
2954
2976
|
children: [
|
|
@@ -3147,9 +3169,9 @@ function SwypePayment({
|
|
|
3147
3169
|
width: "100%",
|
|
3148
3170
|
marginBottom: "12px",
|
|
3149
3171
|
padding: "10px 12px",
|
|
3150
|
-
borderRadius: tokens.
|
|
3172
|
+
borderRadius: tokens.radiusLg,
|
|
3151
3173
|
border: `1px solid ${tokens.border}`,
|
|
3152
|
-
background: tokens.
|
|
3174
|
+
background: tokens.bgInput,
|
|
3153
3175
|
color: tokens.text,
|
|
3154
3176
|
fontFamily: "inherit",
|
|
3155
3177
|
fontSize: "0.875rem",
|
|
@@ -3188,9 +3210,9 @@ function SwypePayment({
|
|
|
3188
3210
|
style: {
|
|
3189
3211
|
width: "100%",
|
|
3190
3212
|
padding: "10px 12px",
|
|
3191
|
-
borderRadius: tokens.
|
|
3213
|
+
borderRadius: tokens.radiusLg,
|
|
3192
3214
|
border: `1px solid ${tokens.border}`,
|
|
3193
|
-
background: tokens.
|
|
3215
|
+
background: tokens.bgInput,
|
|
3194
3216
|
color: tokens.text,
|
|
3195
3217
|
fontFamily: "inherit",
|
|
3196
3218
|
fontSize: "0.875rem",
|
|
@@ -3233,7 +3255,7 @@ function SwypePayment({
|
|
|
3233
3255
|
] }),
|
|
3234
3256
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: { ...headingStyle, marginBottom: "8px" }, children: "Authorize Transfer" }),
|
|
3235
3257
|
/* @__PURE__ */ jsxRuntime.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." }),
|
|
3236
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "0.825rem", color: tokens.textSecondary, padding: "12px 14px", background: tokens.bgInput, borderRadius: tokens.
|
|
3258
|
+
/* @__PURE__ */ jsxRuntime.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: [
|
|
3237
3259
|
payload.amount && payload.tokenSymbol && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between" }, children: [
|
|
3238
3260
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Amount" }),
|
|
3239
3261
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 600, color: tokens.text }, children: [
|
|
@@ -3424,7 +3446,8 @@ function SwypePayment({
|
|
|
3424
3446
|
margin: "0 0 24px 0",
|
|
3425
3447
|
padding: "14px",
|
|
3426
3448
|
background: tokens.bgInput,
|
|
3427
|
-
borderRadius: tokens.
|
|
3449
|
+
borderRadius: tokens.radiusLg,
|
|
3450
|
+
border: `1px solid ${tokens.border}`,
|
|
3428
3451
|
textAlign: "left",
|
|
3429
3452
|
lineHeight: 1.8
|
|
3430
3453
|
},
|