@coinbase/cdp-react 0.0.51 → 0.0.53
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/assets/SignInAuthMethodButtons.css +1 -1
- package/dist/chunks/useSendComponentCallOnce.CUgcsUye.js +219 -0
- package/dist/components/AuthButton/index.js +31 -29
- package/dist/components/Fund/index.js +24 -23
- package/dist/components/FundModal/index.js +34 -32
- package/dist/components/OAuthStatusModal/index.js +53 -51
- package/dist/components/SendEvmTransactionButton/index.js +25 -23
- package/dist/components/SendSolanaTransactionButton/index.js +20 -18
- package/dist/components/SignIn/index.js +27 -26
- package/dist/components/SignInModal/index.js +34 -32
- package/dist/components/SignOutButton/index.js +13 -11
- package/dist/components/forms/AmountInput/index.d.ts +1 -1
- package/dist/components/forms/ExchangeAmountInput/index.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -15
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
.SignInAuthMethodButtons-module__auth-method-buttons___jYEH7{display:flex;flex-direction:column;gap:.5em}.SignInAuthMethodButtons-module__auth-btn___o1a09{padding-left:2em;padding-right:2em;gap:0}.SignInAuthMethodButtons-module__auth-btn-icon___VjvFY{flex-shrink:0;flex-grow:0;height:1.25em;width:
|
|
1
|
+
.SignInAuthMethodButtons-module__auth-method-buttons___jYEH7{display:flex;flex-direction:column;gap:.5em}.SignInAuthMethodButtons-module__auth-btn___o1a09{padding-left:2em;padding-right:2em;gap:0}.SignInAuthMethodButtons-module__auth-btn-icon___VjvFY{flex-shrink:0;flex-grow:0;height:1.25em;width:1.25em}.SignInAuthMethodButtons-module__auth-btn-icon___VjvFY svg{height:100%;width:100%}.SignInAuthMethodButtons-module__auth-btn-label___mEWd3{flex-grow:1;padding:0 1.75em 0 .5em}.SignInAuthMethodButtons-module__divider___zphEh{position:relative;text-align:center;margin:1em 0 .5em}.SignInAuthMethodButtons-module__divider___zphEh hr{border:0;border-top:1px solid var(--cdp-web-colors-page-border-default);margin:0;position:absolute;top:50%;left:0;right:0;transform:translateY(-50%)}.SignInAuthMethodButtons-module__divider___zphEh span{background-color:var(--cdp-web-colors-page-bg-default);color:var(--cdp-web-colors-page-text-muted);text-transform:uppercase;font-size:.875em;font-weight:500;padding:0 .5em;position:relative}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { useRef as k, useEffect as q } from "react";
|
|
2
|
+
function U(s) {
|
|
3
|
+
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
4
|
+
}
|
|
5
|
+
var F = { exports: {} }, B = { exports: {} }, S;
|
|
6
|
+
function H() {
|
|
7
|
+
return S || (S = 1, function() {
|
|
8
|
+
var s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = {
|
|
9
|
+
// Bit-wise rotation left
|
|
10
|
+
rotl: function(c, u) {
|
|
11
|
+
return c << u | c >>> 32 - u;
|
|
12
|
+
},
|
|
13
|
+
// Bit-wise rotation right
|
|
14
|
+
rotr: function(c, u) {
|
|
15
|
+
return c << 32 - u | c >>> u;
|
|
16
|
+
},
|
|
17
|
+
// Swap big-endian to little-endian and vice versa
|
|
18
|
+
endian: function(c) {
|
|
19
|
+
if (c.constructor == Number)
|
|
20
|
+
return l.rotl(c, 8) & 16711935 | l.rotl(c, 24) & 4278255360;
|
|
21
|
+
for (var u = 0; u < c.length; u++)
|
|
22
|
+
c[u] = l.endian(c[u]);
|
|
23
|
+
return c;
|
|
24
|
+
},
|
|
25
|
+
// Generate an array of any length of random bytes
|
|
26
|
+
randomBytes: function(c) {
|
|
27
|
+
for (var u = []; c > 0; c--)
|
|
28
|
+
u.push(Math.floor(Math.random() * 256));
|
|
29
|
+
return u;
|
|
30
|
+
},
|
|
31
|
+
// Convert a byte array to big-endian 32-bit words
|
|
32
|
+
bytesToWords: function(c) {
|
|
33
|
+
for (var u = [], f = 0, a = 0; f < c.length; f++, a += 8)
|
|
34
|
+
u[a >>> 5] |= c[f] << 24 - a % 32;
|
|
35
|
+
return u;
|
|
36
|
+
},
|
|
37
|
+
// Convert big-endian 32-bit words to a byte array
|
|
38
|
+
wordsToBytes: function(c) {
|
|
39
|
+
for (var u = [], f = 0; f < c.length * 32; f += 8)
|
|
40
|
+
u.push(c[f >>> 5] >>> 24 - f % 32 & 255);
|
|
41
|
+
return u;
|
|
42
|
+
},
|
|
43
|
+
// Convert a byte array to a hex string
|
|
44
|
+
bytesToHex: function(c) {
|
|
45
|
+
for (var u = [], f = 0; f < c.length; f++)
|
|
46
|
+
u.push((c[f] >>> 4).toString(16)), u.push((c[f] & 15).toString(16));
|
|
47
|
+
return u.join("");
|
|
48
|
+
},
|
|
49
|
+
// Convert a hex string to a byte array
|
|
50
|
+
hexToBytes: function(c) {
|
|
51
|
+
for (var u = [], f = 0; f < c.length; f += 2)
|
|
52
|
+
u.push(parseInt(c.substr(f, 2), 16));
|
|
53
|
+
return u;
|
|
54
|
+
},
|
|
55
|
+
// Convert a byte array to a base-64 string
|
|
56
|
+
bytesToBase64: function(c) {
|
|
57
|
+
for (var u = [], f = 0; f < c.length; f += 3)
|
|
58
|
+
for (var a = c[f] << 16 | c[f + 1] << 8 | c[f + 2], d = 0; d < 4; d++)
|
|
59
|
+
f * 8 + d * 6 <= c.length * 8 ? u.push(s.charAt(a >>> 6 * (3 - d) & 63)) : u.push("=");
|
|
60
|
+
return u.join("");
|
|
61
|
+
},
|
|
62
|
+
// Convert a base-64 string to a byte array
|
|
63
|
+
base64ToBytes: function(c) {
|
|
64
|
+
c = c.replace(/[^A-Z0-9+\/]/ig, "");
|
|
65
|
+
for (var u = [], f = 0, a = 0; f < c.length; a = ++f % 4)
|
|
66
|
+
a != 0 && u.push((s.indexOf(c.charAt(f - 1)) & Math.pow(2, -2 * a + 8) - 1) << a * 2 | s.indexOf(c.charAt(f)) >>> 6 - a * 2);
|
|
67
|
+
return u;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
B.exports = l;
|
|
71
|
+
}()), B.exports;
|
|
72
|
+
}
|
|
73
|
+
var E, w;
|
|
74
|
+
function m() {
|
|
75
|
+
if (w) return E;
|
|
76
|
+
w = 1;
|
|
77
|
+
var s = {
|
|
78
|
+
// UTF-8 encoding
|
|
79
|
+
utf8: {
|
|
80
|
+
// Convert a string to a byte array
|
|
81
|
+
stringToBytes: function(l) {
|
|
82
|
+
return s.bin.stringToBytes(unescape(encodeURIComponent(l)));
|
|
83
|
+
},
|
|
84
|
+
// Convert a byte array to a string
|
|
85
|
+
bytesToString: function(l) {
|
|
86
|
+
return decodeURIComponent(escape(s.bin.bytesToString(l)));
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
// Binary encoding
|
|
90
|
+
bin: {
|
|
91
|
+
// Convert a string to a byte array
|
|
92
|
+
stringToBytes: function(l) {
|
|
93
|
+
for (var c = [], u = 0; u < l.length; u++)
|
|
94
|
+
c.push(l.charCodeAt(u) & 255);
|
|
95
|
+
return c;
|
|
96
|
+
},
|
|
97
|
+
// Convert a byte array to a string
|
|
98
|
+
bytesToString: function(l) {
|
|
99
|
+
for (var c = [], u = 0; u < l.length; u++)
|
|
100
|
+
c.push(String.fromCharCode(l[u]));
|
|
101
|
+
return c.join("");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return E = s, E;
|
|
106
|
+
}
|
|
107
|
+
/*!
|
|
108
|
+
* Determine if an object is a Buffer
|
|
109
|
+
*
|
|
110
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
111
|
+
* @license MIT
|
|
112
|
+
*/
|
|
113
|
+
var C, A;
|
|
114
|
+
function L() {
|
|
115
|
+
if (A) return C;
|
|
116
|
+
A = 1, C = function(c) {
|
|
117
|
+
return c != null && (s(c) || l(c) || !!c._isBuffer);
|
|
118
|
+
};
|
|
119
|
+
function s(c) {
|
|
120
|
+
return !!c.constructor && typeof c.constructor.isBuffer == "function" && c.constructor.isBuffer(c);
|
|
121
|
+
}
|
|
122
|
+
function l(c) {
|
|
123
|
+
return typeof c.readFloatLE == "function" && typeof c.slice == "function" && s(c.slice(0, 0));
|
|
124
|
+
}
|
|
125
|
+
return C;
|
|
126
|
+
}
|
|
127
|
+
var P;
|
|
128
|
+
function J() {
|
|
129
|
+
return P || (P = 1, function() {
|
|
130
|
+
var s = H(), l = m().utf8, c = L(), u = m().bin, f = function(a, d) {
|
|
131
|
+
a.constructor == String ? d && d.encoding === "binary" ? a = u.stringToBytes(a) : a = l.stringToBytes(a) : c(a) ? a = Array.prototype.slice.call(a, 0) : !Array.isArray(a) && a.constructor !== Uint8Array && (a = a.toString());
|
|
132
|
+
for (var o = s.bytesToWords(a), g = a.length * 8, r = 1732584193, n = -271733879, e = -1732584194, t = 271733878, i = 0; i < o.length; i++)
|
|
133
|
+
o[i] = (o[i] << 8 | o[i] >>> 24) & 16711935 | (o[i] << 24 | o[i] >>> 8) & 4278255360;
|
|
134
|
+
o[g >>> 5] |= 128 << g % 32, o[(g + 64 >>> 9 << 4) + 14] = g;
|
|
135
|
+
for (var p = f._ff, h = f._gg, v = f._hh, y = f._ii, i = 0; i < o.length; i += 16) {
|
|
136
|
+
var M = r, O = n, D = e, R = t;
|
|
137
|
+
r = p(r, n, e, t, o[i + 0], 7, -680876936), t = p(t, r, n, e, o[i + 1], 12, -389564586), e = p(e, t, r, n, o[i + 2], 17, 606105819), n = p(n, e, t, r, o[i + 3], 22, -1044525330), r = p(r, n, e, t, o[i + 4], 7, -176418897), t = p(t, r, n, e, o[i + 5], 12, 1200080426), e = p(e, t, r, n, o[i + 6], 17, -1473231341), n = p(n, e, t, r, o[i + 7], 22, -45705983), r = p(r, n, e, t, o[i + 8], 7, 1770035416), t = p(t, r, n, e, o[i + 9], 12, -1958414417), e = p(e, t, r, n, o[i + 10], 17, -42063), n = p(n, e, t, r, o[i + 11], 22, -1990404162), r = p(r, n, e, t, o[i + 12], 7, 1804603682), t = p(t, r, n, e, o[i + 13], 12, -40341101), e = p(e, t, r, n, o[i + 14], 17, -1502002290), n = p(n, e, t, r, o[i + 15], 22, 1236535329), r = h(r, n, e, t, o[i + 1], 5, -165796510), t = h(t, r, n, e, o[i + 6], 9, -1069501632), e = h(e, t, r, n, o[i + 11], 14, 643717713), n = h(n, e, t, r, o[i + 0], 20, -373897302), r = h(r, n, e, t, o[i + 5], 5, -701558691), t = h(t, r, n, e, o[i + 10], 9, 38016083), e = h(e, t, r, n, o[i + 15], 14, -660478335), n = h(n, e, t, r, o[i + 4], 20, -405537848), r = h(r, n, e, t, o[i + 9], 5, 568446438), t = h(t, r, n, e, o[i + 14], 9, -1019803690), e = h(e, t, r, n, o[i + 3], 14, -187363961), n = h(n, e, t, r, o[i + 8], 20, 1163531501), r = h(r, n, e, t, o[i + 13], 5, -1444681467), t = h(t, r, n, e, o[i + 2], 9, -51403784), e = h(e, t, r, n, o[i + 7], 14, 1735328473), n = h(n, e, t, r, o[i + 12], 20, -1926607734), r = v(r, n, e, t, o[i + 5], 4, -378558), t = v(t, r, n, e, o[i + 8], 11, -2022574463), e = v(e, t, r, n, o[i + 11], 16, 1839030562), n = v(n, e, t, r, o[i + 14], 23, -35309556), r = v(r, n, e, t, o[i + 1], 4, -1530992060), t = v(t, r, n, e, o[i + 4], 11, 1272893353), e = v(e, t, r, n, o[i + 7], 16, -155497632), n = v(n, e, t, r, o[i + 10], 23, -1094730640), r = v(r, n, e, t, o[i + 13], 4, 681279174), t = v(t, r, n, e, o[i + 0], 11, -358537222), e = v(e, t, r, n, o[i + 3], 16, -722521979), n = v(n, e, t, r, o[i + 6], 23, 76029189), r = v(r, n, e, t, o[i + 9], 4, -640364487), t = v(t, r, n, e, o[i + 12], 11, -421815835), e = v(e, t, r, n, o[i + 15], 16, 530742520), n = v(n, e, t, r, o[i + 2], 23, -995338651), r = y(r, n, e, t, o[i + 0], 6, -198630844), t = y(t, r, n, e, o[i + 7], 10, 1126891415), e = y(e, t, r, n, o[i + 14], 15, -1416354905), n = y(n, e, t, r, o[i + 5], 21, -57434055), r = y(r, n, e, t, o[i + 12], 6, 1700485571), t = y(t, r, n, e, o[i + 3], 10, -1894986606), e = y(e, t, r, n, o[i + 10], 15, -1051523), n = y(n, e, t, r, o[i + 1], 21, -2054922799), r = y(r, n, e, t, o[i + 8], 6, 1873313359), t = y(t, r, n, e, o[i + 15], 10, -30611744), e = y(e, t, r, n, o[i + 6], 15, -1560198380), n = y(n, e, t, r, o[i + 13], 21, 1309151649), r = y(r, n, e, t, o[i + 4], 6, -145523070), t = y(t, r, n, e, o[i + 11], 10, -1120210379), e = y(e, t, r, n, o[i + 2], 15, 718787259), n = y(n, e, t, r, o[i + 9], 21, -343485551), r = r + M >>> 0, n = n + O >>> 0, e = e + D >>> 0, t = t + R >>> 0;
|
|
138
|
+
}
|
|
139
|
+
return s.endian([r, n, e, t]);
|
|
140
|
+
};
|
|
141
|
+
f._ff = function(a, d, o, g, r, n, e) {
|
|
142
|
+
var t = a + (d & o | ~d & g) + (r >>> 0) + e;
|
|
143
|
+
return (t << n | t >>> 32 - n) + d;
|
|
144
|
+
}, f._gg = function(a, d, o, g, r, n, e) {
|
|
145
|
+
var t = a + (d & g | o & ~g) + (r >>> 0) + e;
|
|
146
|
+
return (t << n | t >>> 32 - n) + d;
|
|
147
|
+
}, f._hh = function(a, d, o, g, r, n, e) {
|
|
148
|
+
var t = a + (d ^ o ^ g) + (r >>> 0) + e;
|
|
149
|
+
return (t << n | t >>> 32 - n) + d;
|
|
150
|
+
}, f._ii = function(a, d, o, g, r, n, e) {
|
|
151
|
+
var t = a + (o ^ (d | ~g)) + (r >>> 0) + e;
|
|
152
|
+
return (t << n | t >>> 32 - n) + d;
|
|
153
|
+
}, f._blocksize = 16, f._digestsize = 16, F.exports = function(a, d) {
|
|
154
|
+
if (a == null)
|
|
155
|
+
throw new Error("Illegal argument " + a);
|
|
156
|
+
var o = s.wordsToBytes(f(a, d));
|
|
157
|
+
return d && d.asBytes ? o : d && d.asString ? u.bytesToString(o) : s.bytesToHex(o);
|
|
158
|
+
};
|
|
159
|
+
}()), F.exports;
|
|
160
|
+
}
|
|
161
|
+
var G = J();
|
|
162
|
+
const N = /* @__PURE__ */ U(G), $ = "1f8d3e558f493e38a037dbfadb8ba344", z = "d473b1dcc969105adab157226cd9cf63", x = Symbol.for("@coinbase/cdp-analytics");
|
|
163
|
+
function W() {
|
|
164
|
+
const s = globalThis;
|
|
165
|
+
return s[x] || (s[x] = {
|
|
166
|
+
identifier: "",
|
|
167
|
+
enabled: !0,
|
|
168
|
+
isProduction: !1,
|
|
169
|
+
isUsingMocks: !1,
|
|
170
|
+
sendEvent: _,
|
|
171
|
+
sendActionCallEvent: (l) => _({ ...l, type: "action_call" }),
|
|
172
|
+
sendHookCallEvent: (l) => _({ ...l, type: "hook_call" }),
|
|
173
|
+
sendComponentCallEvent: (l) => _({ ...l, type: "component_call" })
|
|
174
|
+
}), s[x];
|
|
175
|
+
}
|
|
176
|
+
const T = W();
|
|
177
|
+
async function _(s) {
|
|
178
|
+
if (!T.enabled || !T.identifier)
|
|
179
|
+
return;
|
|
180
|
+
const l = Date.now(), u = [{
|
|
181
|
+
user_id: T.identifier,
|
|
182
|
+
event_type: s.type,
|
|
183
|
+
platform: I() ? "web" : "native",
|
|
184
|
+
timestamp: l,
|
|
185
|
+
event_properties: {
|
|
186
|
+
project_name: "cdp-embedded-wallet",
|
|
187
|
+
isLocalHost: K(),
|
|
188
|
+
isUsingMocks: T.isUsingMocks,
|
|
189
|
+
...s
|
|
190
|
+
}
|
|
191
|
+
}], f = JSON.stringify(u), a = l.toString(), d = N(f + a), o = {
|
|
192
|
+
client: T.isProduction ? z : $,
|
|
193
|
+
e: f,
|
|
194
|
+
checksum: d
|
|
195
|
+
};
|
|
196
|
+
await fetch("https://cca-lite.coinbase.com/amp", {
|
|
197
|
+
method: "POST",
|
|
198
|
+
mode: "no-cors",
|
|
199
|
+
headers: {
|
|
200
|
+
"Content-Type": "application/json"
|
|
201
|
+
},
|
|
202
|
+
body: JSON.stringify(o)
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
function I() {
|
|
206
|
+
return typeof window < "u" && typeof document < "u";
|
|
207
|
+
}
|
|
208
|
+
function K() {
|
|
209
|
+
return I() ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" : !1;
|
|
210
|
+
}
|
|
211
|
+
function Z(s) {
|
|
212
|
+
const l = k(!1);
|
|
213
|
+
q(() => {
|
|
214
|
+
l.current || (T.sendComponentCallEvent({ name: s }), l.current = !0);
|
|
215
|
+
}, [s]);
|
|
216
|
+
}
|
|
217
|
+
export {
|
|
218
|
+
Z as u
|
|
219
|
+
};
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { jsx as u, jsxs as
|
|
2
|
-
import { useIsInitialized as
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as u, jsxs as j, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { useIsInitialized as y, useIsSignedIn as z } from "@coinbase/cdp-hooks";
|
|
3
|
+
import { u as D } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
|
|
4
|
+
import { useState as m, useRef as M, useCallback as x, useEffect as f } from "react";
|
|
4
5
|
import { SignInModal as N } from "../SignInModal/index.js";
|
|
5
6
|
import { SignOutButton as $ } from "../SignOutButton/index.js";
|
|
6
|
-
import { LoadingSkeleton as
|
|
7
|
-
import '../../assets/AuthButton.css';const
|
|
8
|
-
loading:
|
|
9
|
-
},
|
|
7
|
+
import { LoadingSkeleton as q } from "../ui/LoadingSkeleton/index.js";
|
|
8
|
+
import '../../assets/AuthButton.css';const F = "AuthButton-module__loading___JpDqi", A = {
|
|
9
|
+
loading: F
|
|
10
|
+
}, K = ({
|
|
10
11
|
children: d,
|
|
11
12
|
closeOnSuccessDelay: S = 800,
|
|
12
13
|
onSignInSuccess: g,
|
|
13
|
-
onSignInSuccessTransitionEnd:
|
|
14
|
-
onSignOutSuccess:
|
|
14
|
+
onSignInSuccessTransitionEnd: p,
|
|
15
|
+
onSignOutSuccess: h,
|
|
15
16
|
placeholder: I,
|
|
16
17
|
signInModal: O,
|
|
17
|
-
signOutButton:
|
|
18
|
-
...
|
|
18
|
+
signOutButton: _,
|
|
19
|
+
...b
|
|
19
20
|
}) => {
|
|
20
|
-
|
|
21
|
+
D("auth_button");
|
|
22
|
+
const { isInitialized: n } = y(), { isSignedIn: r } = z(), [l, s] = m(r), [e, c] = m(!1), [i, a] = m(void 0), o = M(!1), C = x(() => {
|
|
21
23
|
g?.(), a(S);
|
|
22
|
-
}, [S, g]),
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
|
|
24
|
+
}, [S, g]), T = x(() => {
|
|
25
|
+
h?.(), s(!1);
|
|
26
|
+
}, [h]);
|
|
27
|
+
f(() => {
|
|
26
28
|
if (i === void 0)
|
|
27
29
|
return;
|
|
28
30
|
if (i === null) {
|
|
@@ -35,16 +37,16 @@ import '../../assets/AuthButton.css';const q = "AuthButton-module__loading___JpD
|
|
|
35
37
|
return () => {
|
|
36
38
|
t && clearTimeout(t);
|
|
37
39
|
};
|
|
38
|
-
}, [i]),
|
|
40
|
+
}, [i]), f(() => {
|
|
39
41
|
if (e)
|
|
40
42
|
return;
|
|
41
43
|
let t = null;
|
|
42
44
|
return o.current && (t = setTimeout(() => {
|
|
43
|
-
|
|
45
|
+
p?.(), o.current = !1, s(!0);
|
|
44
46
|
}, 200)), () => {
|
|
45
47
|
t && clearTimeout(t);
|
|
46
48
|
};
|
|
47
|
-
}, [e,
|
|
49
|
+
}, [e, p]), f(() => {
|
|
48
50
|
if (r) {
|
|
49
51
|
if (o.current)
|
|
50
52
|
return;
|
|
@@ -52,19 +54,19 @@ import '../../assets/AuthButton.css';const q = "AuthButton-module__loading___JpD
|
|
|
52
54
|
} else
|
|
53
55
|
s(!1);
|
|
54
56
|
}, [r, e]);
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */ u("div", { ...
|
|
57
|
+
const v = I ? I({ className: A.loading }) : /* @__PURE__ */ u(q, { className: A.loading }), B = _ ? _({ onSuccess: T }) : /* @__PURE__ */ u($, { onSuccess: T }), w = O ? O({ open: e, setIsOpen: c, onSuccess: C }) : /* @__PURE__ */ u(N, { open: e, setIsOpen: c, onSuccess: C });
|
|
58
|
+
return /* @__PURE__ */ u("div", { ...b, children: d ? d({
|
|
57
59
|
isInitialized: n,
|
|
58
60
|
isSignedIn: l,
|
|
59
|
-
Placeholder:
|
|
60
|
-
SignOutButton:
|
|
61
|
-
SignInModal:
|
|
62
|
-
}) : /* @__PURE__ */ k
|
|
63
|
-
!n &&
|
|
64
|
-
n && l &&
|
|
65
|
-
n && !l &&
|
|
61
|
+
Placeholder: v,
|
|
62
|
+
SignOutButton: B,
|
|
63
|
+
SignInModal: w
|
|
64
|
+
}) : /* @__PURE__ */ j(k, { children: [
|
|
65
|
+
!n && v,
|
|
66
|
+
n && l && B,
|
|
67
|
+
n && !l && w
|
|
66
68
|
] }) });
|
|
67
69
|
};
|
|
68
70
|
export {
|
|
69
|
-
|
|
71
|
+
K as AuthButton
|
|
70
72
|
};
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as n, jsxs as i, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { u as p } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
|
|
3
|
+
import { useId as c } from "react";
|
|
3
4
|
import { useAppConfig as F } from "../CDPReactProvider/index.js";
|
|
4
|
-
import { CoinbaseFooter as
|
|
5
|
-
import { FundForm as
|
|
6
|
-
import { FundProvider as
|
|
7
|
-
import { FundTitle as
|
|
8
|
-
import { useSetupOnrampEventListeners as
|
|
9
|
-
import '../../assets/Fund.css';const
|
|
10
|
-
fund:
|
|
11
|
-
},
|
|
5
|
+
import { CoinbaseFooter as a } from "../ui/CoinbaseFooter/index.js";
|
|
6
|
+
import { FundForm as l } from "./FundForm.js";
|
|
7
|
+
import { FundProvider as C, useFundContext as _ } from "./FundProvider.js";
|
|
8
|
+
import { FundTitle as b } from "./FundTitle.js";
|
|
9
|
+
import { useSetupOnrampEventListeners as x } from "./hooks/useSetupOnrampEventListeners.js";
|
|
10
|
+
import '../../assets/Fund.css';const g = "Fund-module__fund___6j-Og", h = {
|
|
11
|
+
fund: g
|
|
12
|
+
}, N = ({
|
|
12
13
|
className: o = "",
|
|
13
14
|
children: r,
|
|
14
15
|
openIn: e,
|
|
15
16
|
style: s,
|
|
16
17
|
submitLabel: u,
|
|
17
|
-
title:
|
|
18
|
-
...
|
|
19
|
-
}) => /* @__PURE__ */
|
|
18
|
+
title: t,
|
|
19
|
+
...m
|
|
20
|
+
}) => (p("fund"), /* @__PURE__ */ n(C, { ...m, children: /* @__PURE__ */ n("div", { className: `${h.fund} ${o}`, style: s, children: /* @__PURE__ */ n(j, { openIn: e, submitLabel: u, title: t, children: r }) }) })), j = ({
|
|
20
21
|
children: o,
|
|
21
22
|
openIn: r,
|
|
22
23
|
submitLabel: e,
|
|
23
24
|
title: s
|
|
24
25
|
}) => {
|
|
25
|
-
const { state: u } =
|
|
26
|
-
return
|
|
27
|
-
/* @__PURE__ */
|
|
26
|
+
const { state: u } = _(), t = c(), { showCoinbaseFooter: m } = F();
|
|
27
|
+
return x(), o ? typeof o == "function" ? o(u) : o : /* @__PURE__ */ n(l, { "aria-labelledby": t, openIn: r, submitLabel: e, children: ({ Content: d }) => /* @__PURE__ */ i(f, { children: [
|
|
28
|
+
/* @__PURE__ */ n(b, { id: t, children: s }),
|
|
28
29
|
d,
|
|
29
|
-
|
|
30
|
+
m && /* @__PURE__ */ n(v, {})
|
|
30
31
|
] }) });
|
|
31
|
-
},
|
|
32
|
+
}, v = (o) => /* @__PURE__ */ n(a, { ...o });
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
N as Fund,
|
|
35
|
+
v as FundFooter,
|
|
36
|
+
l as FundForm,
|
|
37
|
+
b as FundTitle,
|
|
38
|
+
_ as useFundContext
|
|
38
39
|
};
|
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { jsx as o, jsxs as i, Fragment as
|
|
1
|
+
import { jsx as o, jsxs as i, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { u as w } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
|
|
3
|
+
import { createContext as j, useState as A, useCallback as F, useMemo as S, useId as $, useContext as z } from "react";
|
|
2
4
|
import { c as x } from "../../chunks/lite.1fxw3LjI.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Fund as V, FundFooter as k } from "../Fund/index.js";
|
|
5
|
+
import { useAppConfig as V } from "../CDPReactProvider/index.js";
|
|
6
|
+
import { Fund as k, FundFooter as D } from "../Fund/index.js";
|
|
6
7
|
import { Button as v } from "../ui/Button/index.js";
|
|
7
|
-
import { Modal as
|
|
8
|
+
import { Modal as H, ModalContent as L, ModalTitle as R, ModalClose as U, ModalTrigger as W } from "../ui/Modal/index.js";
|
|
8
9
|
import { VisuallyHidden as C } from "../ui/VisuallyHidden/index.js";
|
|
9
|
-
import { IconXMark as
|
|
10
|
+
import { IconXMark as X } from "../../icons/IconXMark.js";
|
|
10
11
|
import { childrenHasComponent as g } from "../../utils/childrenHasComponent.js";
|
|
11
12
|
import { FundTitle as _ } from "../Fund/FundTitle.js";
|
|
12
|
-
import { FundForm as
|
|
13
|
-
import '../../assets/FundModal.css';const
|
|
14
|
-
trigger:
|
|
15
|
-
fund:
|
|
13
|
+
import { FundForm as q } from "../Fund/FundForm.js";
|
|
14
|
+
import '../../assets/FundModal.css';const B = "FundModal-module__trigger___2IuXj", E = "FundModal-module__fund___1AmQa", K = "FundModal-module__title___lNsoT", P = "FundModal-module__content___9f3ze", t = {
|
|
15
|
+
trigger: B,
|
|
16
|
+
fund: E,
|
|
16
17
|
"no-footer": "FundModal-module__no-footer___WKV78",
|
|
17
18
|
"title-buttons": "FundModal-module__title-buttons___Lctf7",
|
|
18
19
|
"close-button": "FundModal-module__close-button___jzdFM",
|
|
19
20
|
"close-icon": "FundModal-module__close-icon___WoA4a",
|
|
20
21
|
"fund-inner": "FundModal-module__fund-inner___UuOq3",
|
|
21
22
|
"tx-status": "FundModal-module__tx-status___fc-3f",
|
|
22
|
-
title:
|
|
23
|
-
content:
|
|
23
|
+
title: K,
|
|
24
|
+
content: P,
|
|
24
25
|
"error-view": "FundModal-module__error-view___hR1A0"
|
|
25
|
-
}, N =
|
|
26
|
+
}, N = j(null), y = () => {
|
|
26
27
|
const n = z(N);
|
|
27
28
|
if (!n)
|
|
28
29
|
throw new Error("useFundModalContext must be used within a FundModal");
|
|
29
30
|
return n;
|
|
30
31
|
}, b = ({ children: n, className: l = "", label: e, ...s }) => {
|
|
31
32
|
const { cryptoCurrency: r } = y();
|
|
32
|
-
return /* @__PURE__ */ o(
|
|
33
|
+
return /* @__PURE__ */ o(W, { asChild: !0, children: n || /* @__PURE__ */ o(v, { variant: "primary", className: x(t.trigger, l), ...s, children: e || `Deposit ${r.toUpperCase()}` }) });
|
|
33
34
|
}, f = (n) => {
|
|
34
|
-
const { showCoinbaseFooter: l } =
|
|
35
|
-
return /* @__PURE__ */ o(
|
|
36
|
-
|
|
35
|
+
const { showCoinbaseFooter: l } = V(), e = $(), { unmount: s, ...r } = y(), { openIn: m, submitLabel: u, title: a } = r;
|
|
36
|
+
return /* @__PURE__ */ o(L, { "aria-describedby": void 0, ...n, children: /* @__PURE__ */ o(
|
|
37
|
+
k,
|
|
37
38
|
{
|
|
38
39
|
className: x(t.fund, l ? "" : t["no-footer"]),
|
|
39
40
|
...r,
|
|
40
|
-
children: /* @__PURE__ */ i(
|
|
41
|
-
/* @__PURE__ */ o(C, { children: /* @__PURE__ */ o(
|
|
41
|
+
children: /* @__PURE__ */ i(p, { children: [
|
|
42
|
+
/* @__PURE__ */ o(C, { children: /* @__PURE__ */ o(R, { asChild: !0, children: /* @__PURE__ */ o(_, { as: "span", children: a }) }) }),
|
|
42
43
|
/* @__PURE__ */ o(
|
|
43
|
-
|
|
44
|
+
q,
|
|
44
45
|
{
|
|
45
46
|
"aria-labelledby": e,
|
|
46
47
|
openIn: m,
|
|
@@ -54,14 +55,14 @@ import '../../assets/FundModal.css';const q = "FundModal-module__trigger___2IuXj
|
|
|
54
55
|
children: [
|
|
55
56
|
/* @__PURE__ */ i("div", { className: t["title-buttons"], children: [
|
|
56
57
|
d === "error" ? /* @__PURE__ */ o(C, { children: /* @__PURE__ */ o(_, { id: e, children: a }) }) : /* @__PURE__ */ o(_, { className: t.title, id: e, children: a }),
|
|
57
|
-
/* @__PURE__ */ o(
|
|
58
|
+
/* @__PURE__ */ o(U, { asChild: !0, children: /* @__PURE__ */ o(
|
|
58
59
|
v,
|
|
59
60
|
{
|
|
60
61
|
className: t["close-button"],
|
|
61
62
|
"aria-label": "Close",
|
|
62
63
|
size: "md",
|
|
63
64
|
variant: "transparentSecondary",
|
|
64
|
-
children: /* @__PURE__ */ o(
|
|
65
|
+
children: /* @__PURE__ */ o(X, { className: t["close-icon"] })
|
|
65
66
|
}
|
|
66
67
|
) })
|
|
67
68
|
] }),
|
|
@@ -71,33 +72,34 @@ import '../../assets/FundModal.css';const q = "FundModal-module__trigger___2IuXj
|
|
|
71
72
|
)
|
|
72
73
|
}
|
|
73
74
|
),
|
|
74
|
-
l && /* @__PURE__ */ o(
|
|
75
|
+
l && /* @__PURE__ */ o(D, {})
|
|
75
76
|
] })
|
|
76
77
|
}
|
|
77
78
|
) });
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
}, io = ({ children: n, open: l, setIsOpen: e, ...s }) => {
|
|
80
|
+
w("fund_modal");
|
|
81
|
+
const r = l !== void 0, [m, u] = A(!1), a = r ? l : m, d = F(
|
|
82
|
+
(h) => r ? e?.(h) : u(h),
|
|
81
83
|
[r, e, u]
|
|
82
84
|
), c = F(() => {
|
|
83
85
|
d(!1);
|
|
84
|
-
}, [d]),
|
|
86
|
+
}, [d]), O = S(
|
|
85
87
|
() => ({
|
|
86
88
|
unmount: c,
|
|
87
89
|
...s
|
|
88
90
|
}),
|
|
89
91
|
[c, s]
|
|
90
|
-
),
|
|
91
|
-
return /* @__PURE__ */ o(N.Provider, { value:
|
|
92
|
+
), T = n ? g(n, b) : !1, M = n ? g(n, f) : !1, I = !T && !M;
|
|
93
|
+
return /* @__PURE__ */ o(N.Provider, { value: O, children: /* @__PURE__ */ o(H, { open: a, onOpenChange: d, children: I ? /* @__PURE__ */ i(p, { children: [
|
|
92
94
|
/* @__PURE__ */ o(b, { children: n }),
|
|
93
95
|
/* @__PURE__ */ o(f, {})
|
|
94
|
-
] }) : /* @__PURE__ */ i(
|
|
96
|
+
] }) : /* @__PURE__ */ i(p, { children: [
|
|
95
97
|
n,
|
|
96
|
-
!
|
|
98
|
+
!M && /* @__PURE__ */ o(f, {})
|
|
97
99
|
] }) }) });
|
|
98
100
|
};
|
|
99
101
|
export {
|
|
100
|
-
|
|
102
|
+
io as FundModal,
|
|
101
103
|
f as FundModalContent,
|
|
102
104
|
b as FundModalTrigger
|
|
103
105
|
};
|
|
@@ -1,57 +1,59 @@
|
|
|
1
1
|
import { jsx as s, jsxs as o, Fragment as l } from "react/jsx-runtime";
|
|
2
2
|
import "@coinbase/cdp-core";
|
|
3
3
|
import { useOAuthState as O } from "@coinbase/cdp-hooks";
|
|
4
|
-
import {
|
|
4
|
+
import { u as C } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
|
|
5
|
+
import { useState as I, useEffect as u, useRef as S, useCallback as b } from "react";
|
|
5
6
|
import { useProviderName as v } from "../CDPReactProvider/index.js";
|
|
6
|
-
import { OAUTH_PROVIDER_SESSION_STORAGE_KEY as
|
|
7
|
-
import { CoinbaseFooter as
|
|
8
|
-
import { LoadingSpinner as
|
|
9
|
-
import { Modal as
|
|
10
|
-
import { SwitchFadeTransition as
|
|
7
|
+
import { OAUTH_PROVIDER_SESSION_STORAGE_KEY as g } from "../SignIn/hooks/useSignInWithOAuth.js";
|
|
8
|
+
import { CoinbaseFooter as T } from "../ui/CoinbaseFooter/index.js";
|
|
9
|
+
import { LoadingSpinner as $ } from "../ui/LoadingSpinner/index.js";
|
|
10
|
+
import { Modal as w, ModalContent as E, ModalTitle as P, ModalDescription as R } from "../ui/Modal/index.js";
|
|
11
|
+
import { SwitchFadeTransition as y } from "../ui/SwitchFadeTransition/index.js";
|
|
11
12
|
import { VisuallyHidden as f } from "../ui/VisuallyHidden/index.js";
|
|
12
|
-
import { useTimer as
|
|
13
|
-
import { IconAppleLogo as
|
|
14
|
-
import { IconCheck as
|
|
15
|
-
import { IconGoogleColorLogo as
|
|
16
|
-
import { IconXMark as
|
|
13
|
+
import { useTimer as k } from "../../hooks/useTimer.js";
|
|
14
|
+
import { IconAppleLogo as U } from "../../icons/IconAppleLogo.js";
|
|
15
|
+
import { IconCheck as q } from "../../icons/IconCheck.js";
|
|
16
|
+
import { IconGoogleColorLogo as x } from "../../icons/IconGoogleColorLogo.js";
|
|
17
|
+
import { IconXMark as G } from "../../icons/IconXMark.js";
|
|
17
18
|
import { capitalize as d } from "../../utils/capitalize.js";
|
|
18
|
-
import '../../assets/OAuthStatusModal.css';const
|
|
19
|
+
import '../../assets/OAuthStatusModal.css';const H = "OAuthStatusModal-module__status___vU6x7", K = "OAuthStatusModal-module__graphic___2fKoa", L = "OAuthStatusModal-module__pad___oooMz", j = "OAuthStatusModal-module__spinner___Q3dYq", D = "OAuthStatusModal-module__icon___Lj5Gf", F = "OAuthStatusModal-module__subhead___Pg9GI", Y = "OAuthStatusModal-module__description___0qOZY", z = "OAuthStatusModal-module__ring___mKwSb", V = "OAuthStatusModal-module__invisible___IeRd0", t = {
|
|
19
20
|
"oauth-status-modal": "OAuthStatusModal-module__oauth-status-modal___I69Ii",
|
|
20
21
|
"transition-wrapper": "OAuthStatusModal-module__transition-wrapper___TmPRh",
|
|
21
|
-
status:
|
|
22
|
-
graphic:
|
|
23
|
-
pad:
|
|
24
|
-
spinner:
|
|
25
|
-
icon:
|
|
22
|
+
status: H,
|
|
23
|
+
graphic: K,
|
|
24
|
+
pad: L,
|
|
25
|
+
spinner: j,
|
|
26
|
+
icon: D,
|
|
26
27
|
"icon-success": "OAuthStatusModal-module__icon-success___gqMWr",
|
|
27
28
|
"icon-error": "OAuthStatusModal-module__icon-error___psI7m",
|
|
28
|
-
subhead:
|
|
29
|
-
description:
|
|
30
|
-
ring:
|
|
29
|
+
subhead: F,
|
|
30
|
+
description: Y,
|
|
31
|
+
ring: z,
|
|
31
32
|
"ring-success": "OAuthStatusModal-module__ring-success___unyM9",
|
|
32
33
|
"ring-error": "OAuthStatusModal-module__ring-error___OsgqU",
|
|
33
|
-
invisible:
|
|
34
|
-
},
|
|
34
|
+
invisible: V
|
|
35
|
+
}, W = ["pending", "success", "error"], Ot = () => {
|
|
36
|
+
C("oauth_status_modal");
|
|
35
37
|
const [n, e] = I(!1), { oauthState: r } = O(), a = v();
|
|
36
38
|
return u(() => {
|
|
37
39
|
if (r?.status === "pending" || r?.status === "error" || r?.status === "success") {
|
|
38
|
-
const c = sessionStorage.getItem(
|
|
40
|
+
const c = sessionStorage.getItem(g);
|
|
39
41
|
if (c === null || c !== a)
|
|
40
42
|
return;
|
|
41
|
-
sessionStorage.removeItem(
|
|
43
|
+
sessionStorage.removeItem(g), e(!0);
|
|
42
44
|
}
|
|
43
|
-
}, [r?.status, a]), /* @__PURE__ */ s(
|
|
44
|
-
/* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(
|
|
45
|
-
/* @__PURE__ */ s(f, { children: /* @__PURE__ */ o(
|
|
45
|
+
}, [r?.status, a]), /* @__PURE__ */ s(w, { open: n, onOpenChange: e, children: /* @__PURE__ */ o(E, { children: [
|
|
46
|
+
/* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(P, { children: "OAuth Status" }) }),
|
|
47
|
+
/* @__PURE__ */ s(f, { children: /* @__PURE__ */ o(R, { children: [
|
|
46
48
|
"Sign in with ",
|
|
47
49
|
d(a),
|
|
48
50
|
" ",
|
|
49
51
|
r?.status ? `${r?.status === "success" ? "successful" : r?.status === "error" ? "failed" : "pending"}` : ""
|
|
50
52
|
] }) }),
|
|
51
|
-
/* @__PURE__ */ s(
|
|
53
|
+
/* @__PURE__ */ s(J, { handleClose: () => e(!1) })
|
|
52
54
|
] }) });
|
|
53
|
-
},
|
|
54
|
-
const { oauthState: e } = O(), r = e?.providerType || "google", { timeRemaining: a, start: c, reset: m } =
|
|
55
|
+
}, J = ({ handleClose: n }) => {
|
|
56
|
+
const { oauthState: e } = O(), r = e?.providerType || "google", { timeRemaining: a, start: c, reset: m } = k(), _ = S(null), h = S(null), A = 250, p = b((i) => {
|
|
55
57
|
h.current === i || i === void 0 || (h.current = i, _.current?.transition.toggle(i));
|
|
56
58
|
}, []);
|
|
57
59
|
return u(() => {
|
|
@@ -60,28 +62,28 @@ import '../../assets/OAuthStatusModal.css';const G = "OAuthStatusModal-module__s
|
|
|
60
62
|
a !== null && a <= 0 && (m(), n());
|
|
61
63
|
}, [a, m, n]), /* @__PURE__ */ o("div", { className: t["oauth-status-modal"], children: [
|
|
62
64
|
/* @__PURE__ */ s(
|
|
63
|
-
|
|
65
|
+
y,
|
|
64
66
|
{
|
|
65
67
|
animateHeight: !1,
|
|
66
68
|
timeout: A,
|
|
67
|
-
items:
|
|
69
|
+
items: W,
|
|
68
70
|
initialEntered: !1,
|
|
69
71
|
transitionRef: _,
|
|
70
72
|
className: t["transition-wrapper"],
|
|
71
73
|
children: ({ itemKey: i, ...M }) => {
|
|
72
|
-
const N =
|
|
74
|
+
const N = B[i];
|
|
73
75
|
return /* @__PURE__ */ s("div", { ...M, className: t.status, children: /* @__PURE__ */ s(N, { timeRemaining: a, provider: r }) });
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
),
|
|
77
|
-
/* @__PURE__ */ s(
|
|
79
|
+
/* @__PURE__ */ s(T, {})
|
|
78
80
|
] });
|
|
79
|
-
},
|
|
80
|
-
const e =
|
|
81
|
+
}, Q = ({ provider: n }) => {
|
|
82
|
+
const e = tt[n];
|
|
81
83
|
return /* @__PURE__ */ o(l, { children: [
|
|
82
84
|
/* @__PURE__ */ o("div", { className: t.graphic, children: [
|
|
83
85
|
/* @__PURE__ */ s(
|
|
84
|
-
|
|
86
|
+
$,
|
|
85
87
|
{
|
|
86
88
|
strokeWidth: "5%",
|
|
87
89
|
staticStroke: !0,
|
|
@@ -97,10 +99,10 @@ import '../../assets/OAuthStatusModal.css';const G = "OAuthStatusModal-module__s
|
|
|
97
99
|
] }),
|
|
98
100
|
/* @__PURE__ */ s("p", { className: t.description, children: "Just a moment..." })
|
|
99
101
|
] });
|
|
100
|
-
},
|
|
102
|
+
}, X = ({ timeRemaining: n, provider: e }) => /* @__PURE__ */ o(l, { children: [
|
|
101
103
|
/* @__PURE__ */ o("div", { className: t.graphic, children: [
|
|
102
104
|
/* @__PURE__ */ s("span", { className: `${t.ring} ${t["ring-success"]}` }),
|
|
103
|
-
/* @__PURE__ */ s("span", { className: `${t.icon} ${t["icon-success"]}`, children: /* @__PURE__ */ s(
|
|
105
|
+
/* @__PURE__ */ s("span", { className: `${t.icon} ${t["icon-success"]}`, children: /* @__PURE__ */ s(q, {}) })
|
|
104
106
|
] }),
|
|
105
107
|
/* @__PURE__ */ o("p", { className: t.subhead, children: [
|
|
106
108
|
"Signed in with ",
|
|
@@ -110,23 +112,23 @@ import '../../assets/OAuthStatusModal.css';const G = "OAuthStatusModal-module__s
|
|
|
110
112
|
"This window will automatically close in ",
|
|
111
113
|
n ?? "soon"
|
|
112
114
|
] })
|
|
113
|
-
] }),
|
|
115
|
+
] }), Z = () => /* @__PURE__ */ o(l, { children: [
|
|
114
116
|
/* @__PURE__ */ o("div", { className: `${t.graphic} ${t.pad}`, children: [
|
|
115
117
|
/* @__PURE__ */ s("span", { className: `${t.ring} ${t["ring-error"]}` }),
|
|
116
|
-
/* @__PURE__ */ s("span", { className: `${t.icon} ${t["icon-error"]}`, children: /* @__PURE__ */ s(
|
|
118
|
+
/* @__PURE__ */ s("span", { className: `${t.icon} ${t["icon-error"]}`, children: /* @__PURE__ */ s(G, {}) })
|
|
117
119
|
] }),
|
|
118
120
|
/* @__PURE__ */ s("p", { className: t.subhead, children: "Sign in failed" }),
|
|
119
121
|
/* @__PURE__ */ s("p", { className: t.description, children: "Something went wrong. Please try again." })
|
|
120
|
-
] }),
|
|
121
|
-
pending:
|
|
122
|
-
success:
|
|
123
|
-
error:
|
|
124
|
-
},
|
|
125
|
-
google:
|
|
126
|
-
apple:
|
|
122
|
+
] }), B = {
|
|
123
|
+
pending: Q,
|
|
124
|
+
success: X,
|
|
125
|
+
error: Z
|
|
126
|
+
}, tt = {
|
|
127
|
+
google: x,
|
|
128
|
+
apple: U
|
|
127
129
|
};
|
|
128
130
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
Ot as OAuthStatusModal,
|
|
132
|
+
J as OAuthStatusModalContent,
|
|
133
|
+
Ot as default
|
|
132
134
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
-
import { useSendEvmTransaction as
|
|
3
|
-
import {
|
|
4
|
-
import { useState as
|
|
2
|
+
import { useSendEvmTransaction as _, APIError as S } from "@coinbase/cdp-hooks";
|
|
3
|
+
import { u as b } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
|
|
4
|
+
import { useState as T, useCallback as y } from "react";
|
|
5
|
+
import { c as C } from "../../chunks/lite.1fxw3LjI.js";
|
|
5
6
|
import { Button as w } from "../ui/Button/index.js";
|
|
6
7
|
import { getMessageFromUnknownError as x } from "../../utils/getMessageFromUnknownError.js";
|
|
7
8
|
import '../../assets/SendEvmTransactionButton.css';const B = {
|
|
8
9
|
"send-evm-transaction-button": "SendEvmTransactionButton-module__send-evm-transaction-button___74m57"
|
|
9
|
-
},
|
|
10
|
-
account:
|
|
11
|
-
children:
|
|
10
|
+
}, F = ({
|
|
11
|
+
account: e,
|
|
12
|
+
children: f,
|
|
12
13
|
className: u = "",
|
|
13
|
-
network:
|
|
14
|
+
network: s,
|
|
14
15
|
onClick: o,
|
|
15
16
|
onError: a,
|
|
16
17
|
onSuccess: i,
|
|
@@ -18,48 +19,49 @@ import '../../assets/SendEvmTransactionButton.css';const B = {
|
|
|
18
19
|
transaction: r,
|
|
19
20
|
...m
|
|
20
21
|
}) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
b("send_evm_transaction_button");
|
|
23
|
+
const [v, c] = T(!1), { sendEvmTransaction: d } = _(), g = y(
|
|
24
|
+
async (l) => {
|
|
25
|
+
l.preventDefault(), o?.(l);
|
|
24
26
|
try {
|
|
25
|
-
if (!
|
|
27
|
+
if (!e || !s || !r) {
|
|
26
28
|
const n = [];
|
|
27
|
-
throw
|
|
29
|
+
throw e || n.push("account"), s || n.push("network"), r || n.push("transaction"), new Error(`Missing required parameters: ${n.join(", ")}`);
|
|
28
30
|
}
|
|
29
31
|
c(!0);
|
|
30
32
|
const { transactionHash: t } = await d({
|
|
31
33
|
transaction: r,
|
|
32
|
-
evmAccount:
|
|
33
|
-
network:
|
|
34
|
+
evmAccount: e,
|
|
35
|
+
network: s
|
|
34
36
|
});
|
|
35
37
|
i?.(t);
|
|
36
38
|
} catch (t) {
|
|
37
39
|
let n;
|
|
38
|
-
if (t instanceof
|
|
40
|
+
if (t instanceof S || t instanceof Error)
|
|
39
41
|
n = t;
|
|
40
42
|
else {
|
|
41
|
-
const
|
|
42
|
-
n = new Error(
|
|
43
|
+
const h = x(t);
|
|
44
|
+
n = new Error(h);
|
|
43
45
|
}
|
|
44
46
|
a?.(n);
|
|
45
47
|
} finally {
|
|
46
48
|
c(!1);
|
|
47
49
|
}
|
|
48
50
|
},
|
|
49
|
-
[
|
|
51
|
+
[e, s, o, a, i, d, r]
|
|
50
52
|
);
|
|
51
53
|
return /* @__PURE__ */ E(
|
|
52
54
|
w,
|
|
53
55
|
{
|
|
54
|
-
className: m.asChild ? "" :
|
|
55
|
-
isPending:
|
|
56
|
+
className: m.asChild ? "" : C(B["send-evm-transaction-button"], u),
|
|
57
|
+
isPending: v,
|
|
56
58
|
pendingLabel: p || "Sending transaction...",
|
|
57
|
-
onClick:
|
|
59
|
+
onClick: g,
|
|
58
60
|
...m,
|
|
59
|
-
children:
|
|
61
|
+
children: f || "Send transaction"
|
|
60
62
|
}
|
|
61
63
|
);
|
|
62
64
|
};
|
|
63
65
|
export {
|
|
64
|
-
|
|
66
|
+
F as SendEvmTransactionButton
|
|
65
67
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useSendSolanaTransaction as
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useSendSolanaTransaction as b, APIError as T } from "@coinbase/cdp-hooks";
|
|
3
|
+
import { u as w } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
|
|
4
4
|
import { useState as x, useCallback as y } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { c as B } from "../../chunks/lite.1fxw3LjI.js";
|
|
6
|
+
import { Button as C } from "../ui/Button/index.js";
|
|
6
7
|
import { getMessageFromUnknownError as E } from "../../utils/getMessageFromUnknownError.js";
|
|
7
8
|
import '../../assets/SendSolanaTransactionButton.css';const P = {
|
|
8
9
|
"send-solana-transaction-button": "SendSolanaTransactionButton-module__send-solana-transaction-button___OxwvB"
|
|
9
|
-
},
|
|
10
|
+
}, D = ({
|
|
10
11
|
account: t,
|
|
11
|
-
children:
|
|
12
|
-
className:
|
|
12
|
+
children: u,
|
|
13
|
+
className: f = "",
|
|
13
14
|
network: s,
|
|
14
15
|
onClick: e,
|
|
15
16
|
onError: r,
|
|
@@ -18,16 +19,17 @@ import '../../assets/SendSolanaTransactionButton.css';const P = {
|
|
|
18
19
|
transaction: o,
|
|
19
20
|
...l
|
|
20
21
|
}) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
w("send_solana_transaction_button");
|
|
23
|
+
const [S, c] = x(!1), { sendSolanaTransaction: m } = b(), g = y(
|
|
24
|
+
async (d) => {
|
|
25
|
+
d.preventDefault(), e?.(d);
|
|
24
26
|
try {
|
|
25
27
|
if (!t || !s || !o) {
|
|
26
28
|
const n = [];
|
|
27
29
|
throw t || n.push("account"), s || n.push("network"), o || n.push("transaction"), new Error(`Missing required parameters: ${n.join(", ")}`);
|
|
28
30
|
}
|
|
29
31
|
c(!0);
|
|
30
|
-
const { transactionSignature: a } = await
|
|
32
|
+
const { transactionSignature: a } = await m({
|
|
31
33
|
transaction: o,
|
|
32
34
|
solanaAccount: t,
|
|
33
35
|
network: s
|
|
@@ -35,7 +37,7 @@ import '../../assets/SendSolanaTransactionButton.css';const P = {
|
|
|
35
37
|
i?.(a);
|
|
36
38
|
} catch (a) {
|
|
37
39
|
let n;
|
|
38
|
-
if (a instanceof
|
|
40
|
+
if (a instanceof T || a instanceof Error)
|
|
39
41
|
n = a;
|
|
40
42
|
else {
|
|
41
43
|
const h = E(a);
|
|
@@ -46,20 +48,20 @@ import '../../assets/SendSolanaTransactionButton.css';const P = {
|
|
|
46
48
|
c(!1);
|
|
47
49
|
}
|
|
48
50
|
},
|
|
49
|
-
[t, s, e, r, i,
|
|
51
|
+
[t, s, e, r, i, m, o]
|
|
50
52
|
);
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
53
|
+
return /* @__PURE__ */ _(
|
|
54
|
+
C,
|
|
53
55
|
{
|
|
54
|
-
className: l.asChild ? "" :
|
|
56
|
+
className: l.asChild ? "" : B(P["send-solana-transaction-button"], f),
|
|
55
57
|
isPending: S,
|
|
56
58
|
pendingLabel: p || "Sending transaction...",
|
|
57
59
|
onClick: g,
|
|
58
60
|
...l,
|
|
59
|
-
children:
|
|
61
|
+
children: u || "Send transaction"
|
|
60
62
|
}
|
|
61
63
|
);
|
|
62
64
|
};
|
|
63
65
|
export {
|
|
64
|
-
|
|
66
|
+
D as SendSolanaTransactionButton
|
|
65
67
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsx as n, jsxs as t, Fragment as
|
|
1
|
+
import { jsx as n, jsxs as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { u as d } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
|
|
2
3
|
import "react";
|
|
3
|
-
import { useAppConfig as
|
|
4
|
+
import { useAppConfig as u } from "../CDPReactProvider/index.js";
|
|
4
5
|
import { SignInAuthMethodButtons as f } from "./SignInAuthMethodButtons.js";
|
|
5
|
-
import { SignInBackButton as
|
|
6
|
-
import { SignInDescription as
|
|
7
|
-
import { SignInFooter as
|
|
8
|
-
import { SignInForm as
|
|
9
|
-
import { SignInImage as
|
|
10
|
-
import { SignInProvider as
|
|
6
|
+
import { SignInBackButton as I } from "./SignInBackButton.js";
|
|
7
|
+
import { SignInDescription as S } from "./SignInDescription.js";
|
|
8
|
+
import { SignInFooter as b } from "./SignInFooter.js";
|
|
9
|
+
import { SignInForm as k } from "./SignInForm.js";
|
|
10
|
+
import { SignInImage as w } from "./SignInImage.js";
|
|
11
|
+
import { SignInProvider as C, useSignInContext as h } from "./SignInProvider.js";
|
|
11
12
|
import { SignInTitle as v } from "./SignInTitle.js";
|
|
12
13
|
import "@coinbase/cdp-hooks";
|
|
13
14
|
import '../../assets/SignIn.css';const F = "SignIn-module__footer___3Gkbc", o = {
|
|
@@ -16,33 +17,33 @@ import '../../assets/SignIn.css';const F = "SignIn-module__footer___3Gkbc", o =
|
|
|
16
17
|
"back-button": "SignIn-module__back-button___bmE-y",
|
|
17
18
|
"back-button-wrapper": "SignIn-module__back-button-wrapper___Q9FA1",
|
|
18
19
|
footer: F
|
|
19
|
-
}, N = ({ className: r = "", children:
|
|
20
|
-
const { state: _ } = h(), { showCoinbaseFooter: g } =
|
|
20
|
+
}, N = ({ className: r = "", children: e, onSuccess: p, ...a }) => {
|
|
21
|
+
const { state: _ } = h(), { showCoinbaseFooter: g } = u(), s = typeof e == "function" ? e(_) : e;
|
|
21
22
|
return /* @__PURE__ */ t("div", { className: `${o["sign-in"]} ${r}`, ...a, children: [
|
|
22
|
-
|
|
23
|
-
!
|
|
24
|
-
/* @__PURE__ */ n("div", { className: o["back-button-wrapper"], children: /* @__PURE__ */ n(
|
|
25
|
-
/* @__PURE__ */ n(
|
|
26
|
-
/* @__PURE__ */ n(
|
|
23
|
+
s,
|
|
24
|
+
!s && /* @__PURE__ */ t(c, { children: [
|
|
25
|
+
/* @__PURE__ */ n("div", { className: o["back-button-wrapper"], children: /* @__PURE__ */ n(I, { className: o["back-button"] }) }),
|
|
26
|
+
/* @__PURE__ */ n(w, {}),
|
|
27
|
+
/* @__PURE__ */ n(k, { onSuccess: p, children: ({ authMethod: i, step: m, Form: l }) => /* @__PURE__ */ t(c, { children: [
|
|
27
28
|
/* @__PURE__ */ t("div", { className: o["title-desc-wrapper"], children: [
|
|
28
|
-
/* @__PURE__ */ n(v, { step: m, authMethod:
|
|
29
|
-
/* @__PURE__ */ n(
|
|
29
|
+
/* @__PURE__ */ n(v, { step: m, authMethod: i }),
|
|
30
|
+
/* @__PURE__ */ n(S, { step: m, authMethod: i })
|
|
30
31
|
] }),
|
|
31
32
|
l,
|
|
32
|
-
m === "credentials" && /* @__PURE__ */ n(f, { activeMethod:
|
|
33
|
+
m === "credentials" && /* @__PURE__ */ n(f, { activeMethod: i })
|
|
33
34
|
] }) }),
|
|
34
|
-
g && /* @__PURE__ */ n(
|
|
35
|
+
g && /* @__PURE__ */ n(b, { className: o.footer })
|
|
35
36
|
] })
|
|
36
37
|
] });
|
|
37
|
-
},
|
|
38
|
+
}, V = (r) => (d("sign_in"), /* @__PURE__ */ n(C, { children: /* @__PURE__ */ n(N, { ...r }) }));
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
V as SignIn,
|
|
40
41
|
f as SignInAuthMethodButtons,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
I as SignInBackButton,
|
|
43
|
+
S as SignInDescription,
|
|
44
|
+
b as SignInFooter,
|
|
45
|
+
k as SignInForm,
|
|
46
|
+
w as SignInImage,
|
|
46
47
|
v as SignInTitle,
|
|
47
48
|
h as useSignInContext
|
|
48
49
|
};
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { jsx as n, jsxs as t, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { u as I } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
|
|
3
3
|
import { createContext as C, useMemo as b, useContext as x } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { c as v } from "../../chunks/lite.1fxw3LjI.js";
|
|
5
|
+
import { useAppConfig as N } from "../CDPReactProvider/index.js";
|
|
6
|
+
import { SignIn as w } from "../SignIn/index.js";
|
|
6
7
|
import "@coinbase/cdp-hooks";
|
|
7
|
-
import { Button as
|
|
8
|
-
import { ModalTrigger as
|
|
8
|
+
import { Button as p } from "../ui/Button/index.js";
|
|
9
|
+
import { ModalTrigger as T, ModalContent as k, ModalClose as B, Modal as D, ModalTitle as F, ModalDescription as j } from "../ui/Modal/index.js";
|
|
9
10
|
import { VisuallyHidden as m } from "../ui/VisuallyHidden/index.js";
|
|
10
|
-
import { IconXMark as
|
|
11
|
+
import { IconXMark as y } from "../../icons/IconXMark.js";
|
|
11
12
|
import { childrenHasComponent as u } from "../../utils/childrenHasComponent.js";
|
|
12
|
-
import { SignInBackButton as
|
|
13
|
-
import { SignInImage as
|
|
14
|
-
import { SignInForm as
|
|
13
|
+
import { SignInBackButton as A } from "../SignIn/SignInBackButton.js";
|
|
14
|
+
import { SignInImage as V } from "../SignIn/SignInImage.js";
|
|
15
|
+
import { SignInForm as z } from "../SignIn/SignInForm.js";
|
|
15
16
|
import { SignInTitle as g } from "../SignIn/SignInTitle.js";
|
|
16
17
|
import { SignInDescription as _ } from "../SignIn/SignInDescription.js";
|
|
17
|
-
import { SignInAuthMethodButtons as
|
|
18
|
-
import { SignInFooter as
|
|
19
|
-
import '../../assets/SignInModal.css';const
|
|
20
|
-
trigger:
|
|
18
|
+
import { SignInAuthMethodButtons as E } from "../SignIn/SignInAuthMethodButtons.js";
|
|
19
|
+
import { SignInFooter as H } from "../SignIn/SignInFooter.js";
|
|
20
|
+
import '../../assets/SignInModal.css';const J = "SignInModal-module__trigger___IcJ8x", O = "SignInModal-module__footer___6qEo2", X = "SignInModal-module__buttons___jhaVn", i = {
|
|
21
|
+
trigger: J,
|
|
21
22
|
"sign-in": "SignInModal-module__sign-in___n05-5",
|
|
22
23
|
"no-footer": "SignInModal-module__no-footer___meSt1",
|
|
23
24
|
"title-desc-wrapper": "SignInModal-module__title-desc-wrapper___--XLa",
|
|
24
25
|
"sign-in-form": "SignInModal-module__sign-in-form___Jzx1-",
|
|
25
26
|
"sign-in-image": "SignInModal-module__sign-in-image___DGg7B",
|
|
26
|
-
footer:
|
|
27
|
+
footer: O,
|
|
27
28
|
buttons: X,
|
|
28
29
|
"back-button": "SignInModal-module__back-button___nMh2-",
|
|
29
30
|
"close-icon": "SignInModal-module__close-icon___b-gMh"
|
|
30
|
-
},
|
|
31
|
-
const o = x(
|
|
31
|
+
}, h = C(null), $ = () => {
|
|
32
|
+
const o = x(h);
|
|
32
33
|
if (!o)
|
|
33
34
|
throw new Error("useSignInModalContext must be used within a SignInModal");
|
|
34
35
|
return o;
|
|
@@ -37,10 +38,10 @@ import '../../assets/SignInModal.css';const H = "SignInModal-module__trigger___I
|
|
|
37
38
|
className: r = "",
|
|
38
39
|
label: l,
|
|
39
40
|
...e
|
|
40
|
-
}) => /* @__PURE__ */ n(
|
|
41
|
-
const { showCoinbaseFooter: r } =
|
|
42
|
-
return /* @__PURE__ */ n(
|
|
43
|
-
|
|
41
|
+
}) => /* @__PURE__ */ n(T, { asChild: !0, children: o || /* @__PURE__ */ n(p, { className: v(i.trigger, r), ...e, children: l || "Sign in" }) }), c = (o) => {
|
|
42
|
+
const { showCoinbaseFooter: r } = N(), { onSuccess: l } = $();
|
|
43
|
+
return /* @__PURE__ */ n(k, { ...o, children: /* @__PURE__ */ n(
|
|
44
|
+
w,
|
|
44
45
|
{
|
|
45
46
|
onSuccess: l,
|
|
46
47
|
className: `${i["sign-in"]} ${r ? "" : i["no-footer"]}`,
|
|
@@ -48,25 +49,26 @@ import '../../assets/SignInModal.css';const H = "SignInModal-module__trigger___I
|
|
|
48
49
|
children: /* @__PURE__ */ t(d, { children: [
|
|
49
50
|
/* @__PURE__ */ n(q, {}),
|
|
50
51
|
/* @__PURE__ */ t("div", { className: i.buttons, children: [
|
|
51
|
-
/* @__PURE__ */ n(
|
|
52
|
-
/* @__PURE__ */ n(
|
|
52
|
+
/* @__PURE__ */ n(A, { className: i["back-button"] }),
|
|
53
|
+
/* @__PURE__ */ n(B, { asChild: !0, children: /* @__PURE__ */ n(p, { "aria-label": "Close", size: "md", variant: "transparentSecondary", children: /* @__PURE__ */ n(y, { className: i["close-icon"] }) }) })
|
|
53
54
|
] }),
|
|
54
|
-
/* @__PURE__ */ n("div", { className: i["sign-in-image"], children: /* @__PURE__ */ n(
|
|
55
|
-
/* @__PURE__ */ n(
|
|
55
|
+
/* @__PURE__ */ n("div", { className: i["sign-in-image"], children: /* @__PURE__ */ n(V, {}) }),
|
|
56
|
+
/* @__PURE__ */ n(z, { onSuccess: l, children: ({ authMethod: e, step: s, Form: a }) => /* @__PURE__ */ t(d, { children: [
|
|
56
57
|
/* @__PURE__ */ t("div", { className: i["title-desc-wrapper"], children: [
|
|
57
58
|
s === "verification" ? /* @__PURE__ */ n(m, { as: "div", children: /* @__PURE__ */ n(g, {}) }) : /* @__PURE__ */ n(g, {}),
|
|
58
59
|
s === "credentials" ? /* @__PURE__ */ n(m, { as: "div", children: /* @__PURE__ */ n(_, { authMethod: e }) }) : /* @__PURE__ */ n(_, { authMethod: e })
|
|
59
60
|
] }),
|
|
60
61
|
/* @__PURE__ */ n("div", { className: i["sign-in-form"], children: a }),
|
|
61
|
-
s === "credentials" && /* @__PURE__ */ n(
|
|
62
|
+
s === "credentials" && /* @__PURE__ */ n(E, { activeMethod: e })
|
|
62
63
|
] }) }),
|
|
63
|
-
r && /* @__PURE__ */ n(
|
|
64
|
+
r && /* @__PURE__ */ n(H, { className: i.footer })
|
|
64
65
|
] })
|
|
65
66
|
}
|
|
66
67
|
) });
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
}, cn = ({ children: o, open: r, setIsOpen: l, onSuccess: e }) => {
|
|
69
|
+
I("sign_in_modal");
|
|
70
|
+
const s = o ? u(o, f) : !1, a = o ? u(o, c) : !1, M = !s && !a, S = b(() => ({ onSuccess: e }), [e]);
|
|
71
|
+
return /* @__PURE__ */ n(h.Provider, { value: S, children: /* @__PURE__ */ n(D, { open: r, onOpenChange: l, children: M ? /* @__PURE__ */ t(d, { children: [
|
|
70
72
|
/* @__PURE__ */ n(f, { children: o }),
|
|
71
73
|
/* @__PURE__ */ n(c, {})
|
|
72
74
|
] }) : /* @__PURE__ */ t(d, { children: [
|
|
@@ -74,11 +76,11 @@ import '../../assets/SignInModal.css';const H = "SignInModal-module__trigger___I
|
|
|
74
76
|
!a && /* @__PURE__ */ n(c, {})
|
|
75
77
|
] }) }) });
|
|
76
78
|
}, q = () => /* @__PURE__ */ t(m, { children: [
|
|
77
|
-
/* @__PURE__ */ n(
|
|
78
|
-
/* @__PURE__ */ n(
|
|
79
|
+
/* @__PURE__ */ n(F, { asChild: !0, children: /* @__PURE__ */ n(g, { as: "span" }) }),
|
|
80
|
+
/* @__PURE__ */ n(j, { asChild: !0, children: /* @__PURE__ */ n(_, { as: "span" }) })
|
|
79
81
|
] });
|
|
80
82
|
export {
|
|
81
|
-
|
|
83
|
+
cn as SignInModal,
|
|
82
84
|
c as SignInModalContent,
|
|
83
85
|
f as SignInModalTrigger
|
|
84
86
|
};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useSignOut as
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useSignOut as r } from "@coinbase/cdp-hooks";
|
|
3
|
+
import { u as e } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import {
|
|
5
|
+
import { c } from "../../chunks/lite.1fxw3LjI.js";
|
|
6
|
+
import { Button as a } from "../ui/Button/index.js";
|
|
6
7
|
import '../../assets/SignOutButton.css';const g = {
|
|
7
8
|
"sign-out-button": "SignOutButton-module__sign-out-button___qiybe"
|
|
8
|
-
},
|
|
9
|
+
}, d = ({
|
|
9
10
|
children: o,
|
|
10
11
|
className: n = "",
|
|
11
|
-
onSuccess:
|
|
12
|
+
onSuccess: u,
|
|
12
13
|
...t
|
|
13
14
|
}) => {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
e("sign_out_button");
|
|
16
|
+
const { signOut: i } = r(), s = async () => {
|
|
17
|
+
await i(), u?.();
|
|
16
18
|
};
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
19
|
+
return /* @__PURE__ */ m(
|
|
20
|
+
a,
|
|
19
21
|
{
|
|
20
22
|
className: t.asChild ? "" : c(g["sign-out-button"], n),
|
|
21
23
|
onClick: s,
|
|
@@ -25,5 +27,5 @@ import '../../assets/SignOutButton.css';const g = {
|
|
|
25
27
|
);
|
|
26
28
|
};
|
|
27
29
|
export {
|
|
28
|
-
|
|
30
|
+
d as SignOutButton
|
|
29
31
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { AmountInputProps } from './types';
|
|
3
|
-
export declare const AmountInput: import('react').ForwardRefExoticComponent<AmountInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
3
|
+
export declare const AmountInput: import('react').ForwardRefExoticComponent<AmountInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "max" | "min" | "onChange" | "inputMode"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { ExchangeAmountInputProps } from './types';
|
|
3
|
-
export declare const ExchangeAmountInput: import('react').ForwardRefExoticComponent<ExchangeAmountInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
3
|
+
export declare const ExchangeAmountInput: import('react').ForwardRefExoticComponent<ExchangeAmountInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "max" | "min" | "onChange" | "inputMode"> & import('react').RefAttributes<HTMLInputElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from './components/CDPReactProvider';
|
|
2
1
|
export * from './components/AuthButton';
|
|
2
|
+
export * from './components/CDPReactProvider';
|
|
3
3
|
export * from './components/Fund';
|
|
4
4
|
export * from './components/FundModal';
|
|
5
5
|
export * from './components/SendEvmTransactionButton';
|
|
6
6
|
export * from './components/SendSolanaTransactionButton';
|
|
7
7
|
export * from './components/SignIn';
|
|
8
|
-
export * from './components/SignOutButton';
|
|
9
8
|
export * from './components/SignInModal';
|
|
9
|
+
export * from './components/SignOutButton';
|
|
10
10
|
export * from './components/ThemeProvider';
|
|
11
11
|
export * from './components/ui/Button';
|
|
12
12
|
export * from './components/ui/Modal';
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AuthButton as e } from "./components/AuthButton/index.js";
|
|
2
|
+
import { ALL_AUTH_METHODS as n, AUTH_METHODS as m, CDPReactProvider as p, OAUTH_METHODS as f, useAppConfig as i, useProviderName as x } from "./components/CDPReactProvider/index.js";
|
|
3
3
|
import { Fund as s, FundFooter as c } from "./components/Fund/index.js";
|
|
4
4
|
import { FundModal as l, FundModalContent as u, FundModalTrigger as I } from "./components/FundModal/index.js";
|
|
5
5
|
import { SendEvmTransactionButton as S } from "./components/SendEvmTransactionButton/index.js";
|
|
6
6
|
import { SendSolanaTransactionButton as M } from "./components/SendSolanaTransactionButton/index.js";
|
|
7
7
|
import { SignIn as F } from "./components/SignIn/index.js";
|
|
8
8
|
import { useSignInReducer as A } from "./components/SignIn/useSignInReducer.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { SignInModal as B, SignInModalContent as k, SignInModalTrigger as D } from "./components/SignInModal/index.js";
|
|
10
|
+
import { SignOutButton as v } from "./components/SignOutButton/index.js";
|
|
11
11
|
import { ThemeProvider as O, useTheme as P } from "./components/ThemeProvider/index.js";
|
|
12
12
|
import { Button as R } from "./components/ui/Button/index.js";
|
|
13
13
|
import { Modal as L, ModalClose as _, ModalContent as V, ModalDescription as N, ModalTitle as j, ModalTrigger as X } from "./components/ui/Modal/index.js";
|
|
@@ -43,11 +43,11 @@ import { SignInImage as nr } from "./components/SignIn/SignInImage.js";
|
|
|
43
43
|
import { SignInTitle as pr } from "./components/SignIn/SignInTitle.js";
|
|
44
44
|
import { useSignInContext as ir } from "./components/SignIn/SignInProvider.js";
|
|
45
45
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
n as ALL_AUTH_METHODS,
|
|
47
|
+
m as AUTH_METHODS,
|
|
48
|
+
e as AuthButton,
|
|
49
49
|
R as Button,
|
|
50
|
-
|
|
50
|
+
p as CDPReactProvider,
|
|
51
51
|
s as Fund,
|
|
52
52
|
c as FundFooter,
|
|
53
53
|
Xo as FundForm,
|
|
@@ -72,7 +72,7 @@ export {
|
|
|
72
72
|
N as ModalDescription,
|
|
73
73
|
j as ModalTitle,
|
|
74
74
|
X as ModalTrigger,
|
|
75
|
-
|
|
75
|
+
f as OAUTH_METHODS,
|
|
76
76
|
S as SendEvmTransactionButton,
|
|
77
77
|
M as SendSolanaTransactionButton,
|
|
78
78
|
F as SignIn,
|
|
@@ -82,11 +82,11 @@ export {
|
|
|
82
82
|
or as SignInFooter,
|
|
83
83
|
er as SignInForm,
|
|
84
84
|
nr as SignInImage,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
B as SignInModal,
|
|
86
|
+
k as SignInModalContent,
|
|
87
|
+
D as SignInModalTrigger,
|
|
88
88
|
pr as SignInTitle,
|
|
89
|
-
|
|
89
|
+
v as SignOutButton,
|
|
90
90
|
O as ThemeProvider,
|
|
91
91
|
K as borderRadius,
|
|
92
92
|
Q as borderRadiusComponents,
|
|
@@ -108,9 +108,9 @@ export {
|
|
|
108
108
|
G as theme,
|
|
109
109
|
fo as themeToCssVariables,
|
|
110
110
|
no as tokens,
|
|
111
|
-
|
|
111
|
+
i as useAppConfig,
|
|
112
112
|
Go as useFundContext,
|
|
113
|
-
|
|
113
|
+
x as useProviderName,
|
|
114
114
|
ir as useSignInContext,
|
|
115
115
|
A as useSignInReducer,
|
|
116
116
|
P as useTheme
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@internationalized/number": "3.6.4",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": ">=18.2.0 <19.2.0",
|
|
19
|
-
"@coinbase/cdp-core": "^0.0.
|
|
20
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
19
|
+
"@coinbase/cdp-core": "^0.0.53",
|
|
20
|
+
"@coinbase/cdp-hooks": "^0.0.53"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@size-limit/preset-big-lib": "^11.2.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"vite": "^7.0.4",
|
|
48
48
|
"vite-plugin-dts": "^4.5.4",
|
|
49
49
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
50
|
-
"@coinbase/cdp-core": "^0.0.
|
|
51
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
50
|
+
"@coinbase/cdp-core": "^0.0.53",
|
|
51
|
+
"@coinbase/cdp-hooks": "^0.0.53"
|
|
52
52
|
},
|
|
53
53
|
"size-limit": [
|
|
54
54
|
{
|