@coinbase/cdp-react 0.0.11 → 0.0.13
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/README.md +4 -4
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Error.css +1 -1
- package/dist/assets/Field.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/LoadingSkeleton.css +1 -1
- package/dist/assets/LoadingSpinner.css +1 -1
- package/dist/assets/OTP.css +1 -1
- package/dist/assets/SignIn.css +1 -1
- package/dist/assets/SignInDescription.css +1 -0
- package/dist/assets/SignInForm.css +1 -0
- package/dist/assets/SignInImage.css +1 -0
- package/dist/assets/SignInModal.css +1 -1
- package/dist/assets/SignInTitle.css +1 -0
- package/dist/assets/SignOutButton.css +1 -1
- package/dist/assets/VisuallyHidden.css +1 -1
- package/dist/components/AuthButton/index.d.ts +7 -1
- package/dist/components/AuthButton/index.js +51 -31
- package/dist/components/Button/index.js +38 -22
- package/dist/components/Field/index.js +11 -11
- package/dist/components/LoadingSpinner/index.js +7 -7
- package/dist/components/OTP/index.js +26 -25
- package/dist/components/SignIn/SignInDescription.js +20 -18
- package/dist/components/SignIn/SignInForm.js +111 -100
- package/dist/components/SignIn/SignInImage.js +13 -11
- package/dist/components/SignIn/SignInTitle.js +12 -11
- package/dist/components/SignIn/index.js +22 -21
- package/dist/components/SignInModal/index.js +30 -30
- package/dist/components/SignOutButton/index.js +8 -8
- package/dist/components/ThemeProvider/index.d.ts +1 -3
- package/dist/components/ThemeProvider/index.js +7 -7
- package/dist/components/VisuallyHidden/index.js +4 -4
- package/dist/icons/IconCoinbaseWordmark.js +5 -5
- package/dist/index.js +45 -39
- package/dist/theme/cssVariables.d.ts +5 -0
- package/dist/theme/cssVariables.js +10 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +14 -8
- package/dist/theme/theme.d.ts +237 -33
- package/dist/theme/theme.js +3 -3
- package/dist/theme/tokens.d.ts +679 -45
- package/dist/theme/tokens.js +142 -43
- package/dist/theme/utils.d.ts +14 -2
- package/dist/theme/utils.js +23 -14
- package/package.json +9 -5
- package/dist/chunks/SignIn.module.Dl3CqKQ_.js +0 -20
|
@@ -1,113 +1,123 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useSignInWithEmail as
|
|
3
|
-
import { Form as
|
|
4
|
-
import { useState as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useSignInWithEmail as N, useVerifyEmailOTP as U } from "@coinbase/cdp-hooks";
|
|
3
|
+
import { Form as P, FormSubmit as R } from "@radix-ui/react-form";
|
|
4
|
+
import { useState as v, useEffect as y, useRef as A } from "react";
|
|
5
|
+
import { Field as V } from "../Field/index.js";
|
|
6
|
+
import { withValidityState as B } from "../Input/index.js";
|
|
7
|
+
import { LoadingSpinner as x } from "../LoadingSpinner/index.js";
|
|
8
|
+
import { OTP as q } from "../OTP/index.js";
|
|
9
|
+
import { ServerError as C } from "../ServerError/index.js";
|
|
10
|
+
import { VisuallyHidden as k } from "../VisuallyHidden/index.js";
|
|
11
|
+
import { IconCoinbaseWordmark as D } from "../../icons/IconCoinbaseWordmark.js";
|
|
10
12
|
import { IconLock as W } from "../../icons/IconLock.js";
|
|
11
|
-
import { isApiError as
|
|
12
|
-
import { isEmailInvalid as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
import { isApiError as T } from "../../utils/isApiError.js";
|
|
14
|
+
import { isEmailInvalid as $ } from "../../utils/isEmailInvalid.js";
|
|
15
|
+
import { useSignInContext as E } from "./SignInProvider.js";
|
|
16
|
+
import { Button as O } from "../Button/index.js";
|
|
17
|
+
import '../../assets/SignInForm.css';const j = "SignInForm-module__form___8Mc3V", J = "SignInForm-module__footer___6Lo9w", Z = "SignInForm-module__hr___fOcy4", G = "SignInForm-module__icon___qkJnq", n = {
|
|
18
|
+
form: j,
|
|
19
|
+
"form-footer": "SignInForm-module__form-footer___PqM2J",
|
|
20
|
+
"server-state-wrapper": "SignInForm-module__server-state-wrapper___QVsXy",
|
|
21
|
+
"loading-spinner": "SignInForm-module__loading-spinner___W6gZo",
|
|
22
|
+
"server-error": "SignInForm-module__server-error___dD9VE",
|
|
23
|
+
"reset-timer": "SignInForm-module__reset-timer___Ms2YZ",
|
|
24
|
+
footer: J,
|
|
25
|
+
"coinbase-icon": "SignInForm-module__coinbase-icon___vGv7u",
|
|
26
|
+
hr: Z,
|
|
27
|
+
icon: G
|
|
28
|
+
}, H = ({ submit: u }) => {
|
|
29
|
+
const { state: s, dispatch: d } = E(), e = () => d({ type: "CLEAR_ERROR" }), _ = (p) => (p.preventDefault(), u(s.email));
|
|
30
|
+
return /* @__PURE__ */ i(
|
|
31
|
+
P,
|
|
22
32
|
{
|
|
23
|
-
className:
|
|
33
|
+
className: n.form,
|
|
24
34
|
onClearServerErrors: e,
|
|
25
|
-
onSubmit:
|
|
35
|
+
onSubmit: _,
|
|
26
36
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
37
|
+
/* @__PURE__ */ o(
|
|
38
|
+
V,
|
|
29
39
|
{
|
|
30
40
|
label: "Email address",
|
|
31
41
|
name: "email",
|
|
32
42
|
validators: [
|
|
33
43
|
["valueMissing", "Email is required"],
|
|
34
44
|
["typeMismatch", "Use a valid email address"],
|
|
35
|
-
[
|
|
45
|
+
[$, "Use a valid email address"]
|
|
36
46
|
],
|
|
37
|
-
children:
|
|
47
|
+
children: B({
|
|
38
48
|
type: "email",
|
|
39
49
|
placeholder: "name@example.com",
|
|
40
50
|
required: !0,
|
|
41
|
-
value:
|
|
51
|
+
value: s.email,
|
|
42
52
|
onChange: (p) => {
|
|
43
53
|
d({ type: "SET_EMAIL", payload: { email: p.target.value } });
|
|
44
54
|
}
|
|
45
55
|
})
|
|
46
56
|
}
|
|
47
57
|
),
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */
|
|
58
|
+
s.error && /* @__PURE__ */ o(C, { error: s.error, className: n["server-error"] }),
|
|
59
|
+
/* @__PURE__ */ o(R, { asChild: !0, children: /* @__PURE__ */ o(O, { type: "submit", isPending: s.isPending, children: "Continue with email" }) })
|
|
50
60
|
]
|
|
51
61
|
}
|
|
52
62
|
);
|
|
53
|
-
},
|
|
63
|
+
}, Q = ({
|
|
54
64
|
reset: u,
|
|
55
|
-
resetCountdown:
|
|
65
|
+
resetCountdown: s,
|
|
56
66
|
submit: d
|
|
57
67
|
}) => {
|
|
58
|
-
const { state: e, dispatch:
|
|
59
|
-
u(),
|
|
68
|
+
const { state: e, dispatch: _ } = E(), p = () => _({ type: "CLEAR_ERROR" }), l = A([]), f = (c) => (c.preventDefault(), d(e.otp)), h = () => {
|
|
69
|
+
u(), l.current[0]?.focus();
|
|
60
70
|
};
|
|
61
|
-
return
|
|
62
|
-
e.step === "otp" &&
|
|
63
|
-
}, [e.step]), /* @__PURE__ */
|
|
64
|
-
|
|
71
|
+
return y(() => {
|
|
72
|
+
e.step === "otp" && l.current[0]?.focus();
|
|
73
|
+
}, [e.step]), /* @__PURE__ */ i(
|
|
74
|
+
P,
|
|
65
75
|
{
|
|
66
|
-
className: `${
|
|
76
|
+
className: `${n.form}`,
|
|
67
77
|
onClearServerErrors: p,
|
|
68
|
-
onSubmit:
|
|
78
|
+
onSubmit: f,
|
|
69
79
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
80
|
+
/* @__PURE__ */ o(
|
|
81
|
+
q,
|
|
72
82
|
{
|
|
73
|
-
ref:
|
|
83
|
+
ref: l,
|
|
74
84
|
name: "otp",
|
|
75
85
|
"aria-label": "Six-digit Verification Code",
|
|
76
86
|
passwordLength: 6,
|
|
77
87
|
value: e.otp,
|
|
78
|
-
onChange: (
|
|
79
|
-
onValueChange: (
|
|
80
|
-
|
|
88
|
+
onChange: (c) => c.preventDefault(),
|
|
89
|
+
onValueChange: (c) => {
|
|
90
|
+
_({ type: "SET_OTP", payload: { otp: c } });
|
|
81
91
|
},
|
|
82
92
|
autoSubmit: !0
|
|
83
93
|
}
|
|
84
94
|
),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
(e.isPending && !e.canResetOTP || e.error) && /* @__PURE__ */
|
|
87
|
-
e.isPending && !e.canResetOTP && /* @__PURE__ */
|
|
88
|
-
e.error && /* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ i("div", { className: n["form-footer"], children: [
|
|
96
|
+
(e.isPending && !e.canResetOTP || e.error) && /* @__PURE__ */ i("div", { className: n["server-state-wrapper"], children: [
|
|
97
|
+
e.isPending && !e.canResetOTP && /* @__PURE__ */ o(x, { className: n["loading-spinner"] }),
|
|
98
|
+
e.error && /* @__PURE__ */ o(C, { error: e.error, className: n["server-error"] })
|
|
89
99
|
] }),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
e.canResetOTP && /* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ i("div", { children: [
|
|
101
|
+
e.canResetOTP && /* @__PURE__ */ o(R, { asChild: !0, children: /* @__PURE__ */ o(
|
|
92
102
|
O,
|
|
93
103
|
{
|
|
94
104
|
type: "button",
|
|
95
|
-
onClick:
|
|
105
|
+
onClick: h,
|
|
96
106
|
isPending: e.isPending,
|
|
97
107
|
variant: "transparentPrimary",
|
|
98
108
|
children: "Resend code"
|
|
99
109
|
}
|
|
100
110
|
) }),
|
|
101
|
-
!e.canResetOTP && /* @__PURE__ */
|
|
111
|
+
!e.canResetOTP && /* @__PURE__ */ o("div", { className: n["reset-timer"], children: /* @__PURE__ */ i("p", { children: [
|
|
102
112
|
"Resend code in ",
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
113
|
+
/* @__PURE__ */ i("span", { "aria-hidden": "true", children: [
|
|
114
|
+
s,
|
|
105
115
|
"s"
|
|
106
116
|
] }),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
117
|
+
/* @__PURE__ */ i(k, { children: [
|
|
118
|
+
s,
|
|
109
119
|
" ",
|
|
110
|
-
|
|
120
|
+
s === 1 ? "second" : "seconds"
|
|
111
121
|
] })
|
|
112
122
|
] }) })
|
|
113
123
|
] })
|
|
@@ -115,71 +125,72 @@ const q = ({ submit: u }) => {
|
|
|
115
125
|
]
|
|
116
126
|
}
|
|
117
127
|
);
|
|
118
|
-
},
|
|
128
|
+
}, pe = ({
|
|
119
129
|
as: u = "div",
|
|
120
|
-
className:
|
|
130
|
+
className: s = "",
|
|
121
131
|
onSuccess: d,
|
|
122
132
|
...e
|
|
123
133
|
}) => {
|
|
124
|
-
const
|
|
125
|
-
|
|
134
|
+
const l = "An error occurred while signing in. Please try again.", [f, h] = v(0), [c, S] = v(!1), b = N(), F = U(), { state: a, dispatch: m } = E(), w = (t) => {
|
|
135
|
+
h(t), S(!0);
|
|
126
136
|
};
|
|
127
|
-
|
|
128
|
-
if (!
|
|
137
|
+
y(() => {
|
|
138
|
+
if (!c)
|
|
129
139
|
return;
|
|
130
|
-
const
|
|
131
|
-
|
|
140
|
+
const t = setInterval(() => {
|
|
141
|
+
h((r) => r > 1 ? r - 1 : (S(!1), 0));
|
|
132
142
|
}, 1e3);
|
|
133
|
-
return () => clearInterval(
|
|
134
|
-
}, [
|
|
135
|
-
|
|
136
|
-
}, [
|
|
137
|
-
const
|
|
138
|
-
if (!
|
|
139
|
-
|
|
143
|
+
return () => clearInterval(t);
|
|
144
|
+
}, [c]), y(() => {
|
|
145
|
+
f === 0 && a.step === "otp" && !a.canResetOTP && m({ type: "ALLOW_RESET_OTP" });
|
|
146
|
+
}, [f, a.step, a.canResetOTP, m]);
|
|
147
|
+
const I = async (t) => {
|
|
148
|
+
if (!a.isPending) {
|
|
149
|
+
m({ type: "SUBMIT_EMAIL", payload: { email: t } });
|
|
140
150
|
try {
|
|
141
|
-
const { flowId: r } = await
|
|
142
|
-
email:
|
|
151
|
+
const { flowId: r } = await b({
|
|
152
|
+
email: t
|
|
143
153
|
});
|
|
144
|
-
|
|
154
|
+
m({ type: "SUBMIT_EMAIL_SUCCESS", payload: { flowId: r } }), w(60);
|
|
145
155
|
} catch (r) {
|
|
146
|
-
const
|
|
147
|
-
|
|
156
|
+
const g = T(r) ? r : r instanceof Error && r.message || l;
|
|
157
|
+
m({ type: "SUBMIT_EMAIL_FAILURE", payload: { error: g } }), console.error(r);
|
|
148
158
|
}
|
|
149
159
|
}
|
|
150
|
-
},
|
|
151
|
-
if (!
|
|
152
|
-
if (
|
|
153
|
-
|
|
160
|
+
}, L = async (t) => {
|
|
161
|
+
if (!a.isPending) {
|
|
162
|
+
if (t.length !== 6) {
|
|
163
|
+
m({ type: "SET_OTP", payload: { otp: t } });
|
|
154
164
|
return;
|
|
155
165
|
}
|
|
156
|
-
|
|
166
|
+
m({ type: "SUBMIT_OTP", payload: { otp: t } });
|
|
157
167
|
try {
|
|
158
|
-
await
|
|
159
|
-
flowId:
|
|
160
|
-
otp:
|
|
161
|
-
}),
|
|
168
|
+
await F({
|
|
169
|
+
flowId: a.flowId,
|
|
170
|
+
otp: t
|
|
171
|
+
}), m({ type: "SUBMIT_OTP_SUCCESS", payload: { otp: t } }), d?.();
|
|
162
172
|
} catch (r) {
|
|
163
|
-
const
|
|
164
|
-
|
|
173
|
+
const g = T(r) ? r : r instanceof Error && r.message || l;
|
|
174
|
+
m({ type: "SUBMIT_OTP_FAILURE", payload: { error: g } }), console.error(r);
|
|
165
175
|
}
|
|
166
176
|
}
|
|
167
177
|
}, M = () => {
|
|
168
|
-
|
|
178
|
+
m({ type: "RESET_OTP" }), S(!1), I(a.email);
|
|
169
179
|
};
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
"Secured by
|
|
178
|
-
|
|
180
|
+
return /* @__PURE__ */ i(u, { className: `${n.form} ${s}`, ...e, children: [
|
|
181
|
+
a.step === "email" && /* @__PURE__ */ o(H, { submit: I }),
|
|
182
|
+
a.step === "otp" && /* @__PURE__ */ o(Q, { submit: L, reset: M, resetCountdown: f }),
|
|
183
|
+
/* @__PURE__ */ o("hr", { className: n.hr }),
|
|
184
|
+
/* @__PURE__ */ i("div", { className: n.footer, children: [
|
|
185
|
+
/* @__PURE__ */ o(W, { className: n.icon }),
|
|
186
|
+
/* @__PURE__ */ i("p", { children: [
|
|
187
|
+
"Secured by",
|
|
188
|
+
" ",
|
|
189
|
+
/* @__PURE__ */ o(D, { className: n["coinbase-icon"], "aria-label": "Coinbase" })
|
|
179
190
|
] })
|
|
180
191
|
] })
|
|
181
192
|
] });
|
|
182
193
|
};
|
|
183
194
|
export {
|
|
184
|
-
|
|
195
|
+
pe as SignInForm
|
|
185
196
|
};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useAppConfig as
|
|
2
|
+
import { useAppConfig as p } from "../CDPReactProvider/index.js";
|
|
3
3
|
import { IconCheckCircle as a } from "../../icons/IconCheckCircle.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { useSignInContext as _ } from "./SignInProvider.js";
|
|
5
|
+
import '../../assets/SignInImage.css';const f = "SignInImage-module__logo___rlzt-", i = {
|
|
6
|
+
logo: f,
|
|
7
|
+
"success-icon": "SignInImage-module__success-icon___avUF9"
|
|
8
|
+
}, l = (o) => /^https?:\/\//.test(o), S = ({ className: o = "", alt: r, src: t }) => {
|
|
9
|
+
const { state: g } = _(), { step: n } = g, s = p(), m = s.logoUrl && l(s.logoUrl) ? s.logoUrl : void 0, c = t && l(t) ? t : m, u = r || s.name;
|
|
10
|
+
return n !== "success" && c ? /* @__PURE__ */ e(
|
|
9
11
|
"img",
|
|
10
12
|
{
|
|
11
|
-
src:
|
|
12
|
-
alt:
|
|
13
|
-
className: `${
|
|
13
|
+
src: c,
|
|
14
|
+
alt: u || "",
|
|
15
|
+
className: `${i.logo} ${o}`,
|
|
14
16
|
width: 64,
|
|
15
17
|
height: 64
|
|
16
18
|
}
|
|
17
|
-
) :
|
|
19
|
+
) : n === "success" ? /* @__PURE__ */ e(a, { className: `${i["success-icon"]} ${o}` }) : null;
|
|
18
20
|
};
|
|
19
21
|
export {
|
|
20
|
-
|
|
22
|
+
S as SignInImage
|
|
21
23
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as c } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { useSignInContext as a } from "./SignInProvider.js";
|
|
4
|
+
import '../../assets/SignInTitle.css';const u = "SignInTitle-module__heading___QJ071", m = {
|
|
5
|
+
heading: u
|
|
6
|
+
}, p = ({
|
|
7
|
+
as: t = "h2",
|
|
8
|
+
children: n,
|
|
9
|
+
className: s = "",
|
|
10
|
+
...i
|
|
10
11
|
}) => {
|
|
11
|
-
const { state:
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
const { state: e } = a(), o = c(() => e.step === "success" ? "Success" : e.step === "otp" ? "Enter verification code" : "Sign in", [e.step]);
|
|
13
|
+
return /* @__PURE__ */ r(t, { className: `${m.heading} ${s}`, ...i, children: n || o });
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
p as SignInTitle
|
|
16
17
|
};
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
1
|
+
import { jsx as n, jsxs as r, Fragment as s } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/* @__PURE__ */ n(a, {}),
|
|
3
|
+
import { SignInDescription as g } from "./SignInDescription.js";
|
|
4
|
+
import { SignInForm as c } from "./SignInForm.js";
|
|
5
|
+
import { SignInImage as p } from "./SignInImage.js";
|
|
6
|
+
import { SignInProvider as I, useSignInContext as S } from "./SignInProvider.js";
|
|
7
|
+
import { SignInTitle as f } from "./SignInTitle.js";
|
|
8
|
+
import '../../assets/SignIn.css';const a = {
|
|
9
|
+
"sign-in": "SignIn-module__sign-in___cYpee"
|
|
10
|
+
}, l = ({ className: i = "", children: t, onSuccess: e }) => {
|
|
11
|
+
const { state: m } = S(), o = typeof t == "function" ? t(m) : t;
|
|
12
|
+
return /* @__PURE__ */ r("div", { className: `${a["sign-in"]} ${i}`, children: [
|
|
13
|
+
o,
|
|
14
|
+
!o && /* @__PURE__ */ r(s, { children: [
|
|
16
15
|
/* @__PURE__ */ n(p, {}),
|
|
17
|
-
/* @__PURE__ */ n(
|
|
16
|
+
/* @__PURE__ */ n(f, {}),
|
|
17
|
+
/* @__PURE__ */ n(g, {}),
|
|
18
|
+
/* @__PURE__ */ n(c, { onSuccess: e })
|
|
18
19
|
] })
|
|
19
20
|
] });
|
|
20
|
-
},
|
|
21
|
+
}, C = (i) => /* @__PURE__ */ n(I, { children: /* @__PURE__ */ n(l, { ...i }) });
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
C as SignIn,
|
|
24
|
+
g as SignInDescription,
|
|
25
|
+
c as SignInForm,
|
|
26
|
+
p as SignInImage,
|
|
27
|
+
f as SignInTitle,
|
|
27
28
|
S as useSignInContext
|
|
28
29
|
};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { jsxs as o, jsx as
|
|
2
|
-
import { Dialog as
|
|
1
|
+
import { jsxs as o, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as t, DialogTrigger as g, DialogPortal as _, DialogOverlay as d, DialogContent as c, DialogClose as p, DialogTitle as u, DialogDescription as I } from "@radix-ui/react-dialog";
|
|
3
3
|
import "react";
|
|
4
4
|
import { IconXMark as h } from "../../icons/IconXMark.js";
|
|
5
|
-
import { Button as r } from "../Button/index.js";
|
|
6
5
|
import { SignIn as S } from "../SignIn/index.js";
|
|
7
|
-
import { useTheme as
|
|
6
|
+
import { useTheme as f } from "../ThemeProvider/index.js";
|
|
8
7
|
import { SignInImage as M } from "../SignIn/SignInImage.js";
|
|
9
|
-
import { SignInTitle as
|
|
8
|
+
import { SignInTitle as D } from "../SignIn/SignInTitle.js";
|
|
10
9
|
import { SignInDescription as v } from "../SignIn/SignInDescription.js";
|
|
11
10
|
import { SignInForm as N } from "../SignIn/SignInForm.js";
|
|
12
|
-
import
|
|
11
|
+
import { Button as r } from "../Button/index.js";
|
|
12
|
+
import '../../assets/SignInModal.css';const y = "SignInModal-module__trigger___IcJ8x", C = "SignInModal-module__modal___PErrT", x = "SignInModal-module__overlay___-0rmi", b = "SignInModal-module__spacer___x-lRH", n = {
|
|
13
13
|
trigger: y,
|
|
14
|
-
modal:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
overlay:
|
|
14
|
+
modal: C,
|
|
15
|
+
"sign-in": "SignInModal-module__sign-in___n05-5",
|
|
16
|
+
"sign-in-form": "SignInModal-module__sign-in-form___Jzx1-",
|
|
17
|
+
"sign-in-title": "SignInModal-module__sign-in-title___cju2s",
|
|
18
|
+
"sign-in-description": "SignInModal-module__sign-in-description___-Oi9q",
|
|
19
|
+
"sign-in-image": "SignInModal-module__sign-in-image___DGg7B",
|
|
20
|
+
"close-wrapper": "SignInModal-module__close-wrapper___zuxDu",
|
|
21
|
+
"close-button": "SignInModal-module__close-button___k1I5Q",
|
|
22
|
+
overlay: x,
|
|
23
23
|
spacer: b
|
|
24
|
-
},
|
|
25
|
-
const { cssVariables:
|
|
26
|
-
return /* @__PURE__ */ o(
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
24
|
+
}, F = ({ children: l, open: a, setIsOpen: s, onSuccess: e }) => {
|
|
25
|
+
const { cssVariables: m } = f();
|
|
26
|
+
return /* @__PURE__ */ o(t, { open: a, onOpenChange: s, children: [
|
|
27
|
+
/* @__PURE__ */ i(g, { asChild: !0, children: l || /* @__PURE__ */ i(r, { variant: "primary", className: n.trigger, children: "Sign In" }) }),
|
|
28
|
+
/* @__PURE__ */ i(_, { children: /* @__PURE__ */ o(d, { className: n.overlay, style: m, children: [
|
|
29
|
+
/* @__PURE__ */ i("div", { className: n.spacer }),
|
|
30
|
+
/* @__PURE__ */ i(c, { className: n.modal, children: /* @__PURE__ */ o(S, { onSuccess: e, className: n["sign-in"], children: [
|
|
31
|
+
/* @__PURE__ */ i("div", { className: n["close-wrapper"], children: /* @__PURE__ */ i(p, { asChild: !0, children: /* @__PURE__ */ i(
|
|
32
32
|
r,
|
|
33
33
|
{
|
|
34
34
|
"aria-label": "Close",
|
|
35
35
|
variant: "transparentSecondary",
|
|
36
|
-
className: `${
|
|
37
|
-
children: /* @__PURE__ */
|
|
36
|
+
className: `${n["close-button"]}`,
|
|
37
|
+
children: /* @__PURE__ */ i(h, {})
|
|
38
38
|
}
|
|
39
39
|
) }) }),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ i("div", { className: n["sign-in-image"], children: /* @__PURE__ */ i(M, {}) }),
|
|
41
|
+
/* @__PURE__ */ i("div", { className: n["sign-in-title"], children: /* @__PURE__ */ i(u, { asChild: !0, children: /* @__PURE__ */ i(D, {}) }) }),
|
|
42
|
+
/* @__PURE__ */ i(I, { asChild: !0, children: /* @__PURE__ */ i(v, { className: n["sign-in-description"] }) }),
|
|
43
|
+
/* @__PURE__ */ i(N, { className: n["sign-in-form"], onSuccess: e })
|
|
44
44
|
] }) })
|
|
45
45
|
] }) })
|
|
46
46
|
] });
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
F as SignInModal
|
|
50
50
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useSignOut as r } from "@coinbase/cdp-hooks";
|
|
3
3
|
import "react";
|
|
4
|
-
import { Button as m } from "../Button/index.js";
|
|
5
4
|
import "../../theme/theme.js";
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { Button as m } from "../Button/index.js";
|
|
6
|
+
import '../../assets/SignOutButton.css';const e = {
|
|
7
|
+
"sign-out-button": "SignOutButton-module__sign-out-button___qiybe"
|
|
8
|
+
}, O = ({ children: t, variant: o = "primary", onSuccess: n }) => {
|
|
9
|
+
const i = r(), u = async () => {
|
|
10
|
+
await i(), n?.();
|
|
11
11
|
};
|
|
12
|
-
return /* @__PURE__ */ s(m, { variant:
|
|
12
|
+
return /* @__PURE__ */ s(m, { variant: o, className: e["sign-out-button"], onClick: u, children: t || "Sign out" });
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
O as SignOutButton
|
|
16
16
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import {
|
|
2
|
+
import { createContext as p, useMemo as s, useContext as u } from "react";
|
|
3
|
+
import { theme as n } from "../../theme/theme.js";
|
|
4
4
|
import { themeToCssVariables as l } from "../../theme/utils.js";
|
|
5
|
-
import '../../assets/ThemeProvider.css';const
|
|
6
|
-
wrapper:
|
|
7
|
-
}, a =
|
|
5
|
+
import '../../assets/ThemeProvider.css';const w = "ThemeProvider-module__wrapper___aXwhZ", d = {
|
|
6
|
+
wrapper: w
|
|
7
|
+
}, a = p(void 0), _ = ({
|
|
8
8
|
children: e,
|
|
9
9
|
className: c = "",
|
|
10
10
|
style: i,
|
|
@@ -13,14 +13,14 @@ import '../../assets/ThemeProvider.css';const d = "ThemeProvider-module__wrapper
|
|
|
13
13
|
const t = s(
|
|
14
14
|
() => o ? { ...n, ...o } : n,
|
|
15
15
|
[o]
|
|
16
|
-
), r = s(() => l(t), [t]),
|
|
16
|
+
), r = s(() => l(t), [t]), h = s(
|
|
17
17
|
() => ({
|
|
18
18
|
theme: t,
|
|
19
19
|
cssVariables: r
|
|
20
20
|
}),
|
|
21
21
|
[t, r]
|
|
22
22
|
);
|
|
23
|
-
return /* @__PURE__ */ m(a.Provider, { value:
|
|
23
|
+
return /* @__PURE__ */ m(a.Provider, { value: h, children: /* @__PURE__ */ m("div", { className: `${d.wrapper} ${c}`, style: { ...i, ...r }, children: e }) });
|
|
24
24
|
}, C = () => {
|
|
25
25
|
const e = u(a);
|
|
26
26
|
if (!e)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import '../../assets/VisuallyHidden.css';const d =
|
|
4
|
-
|
|
5
|
-
},
|
|
3
|
+
import '../../assets/VisuallyHidden.css';const d = {
|
|
4
|
+
"visually-hidden": "VisuallyHidden-module__visually-hidden___qdUPg"
|
|
5
|
+
}, a = ({ as: s = "span", children: l }) => l ? /* @__PURE__ */ i(s, { className: d["visually-hidden"], children: l }) : null;
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as VisuallyHidden
|
|
8
8
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as H, jsx as C } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { SvgIcon as
|
|
4
|
-
const
|
|
3
|
+
import { SvgIcon as r } from "./SvgIcon.js";
|
|
4
|
+
const V = (i) => /* @__PURE__ */ H(r, { width: "67", height: "13", viewBox: "0 0 67 13", fill: "none", ...i, children: [
|
|
5
5
|
/* @__PURE__ */ C("g", { clipPath: "url(#clip0_7507_87)", children: /* @__PURE__ */ C(
|
|
6
6
|
"path",
|
|
7
7
|
{
|
|
8
8
|
d: "M13.5224 3.8526C11.0884 3.8526 9.18662 5.70351 9.18662 8.18134C9.18662 10.6592 11.0404 12.4942 13.5224 12.4942C16.0044 12.4942 17.8903 10.6275 17.8903 8.1655C17.8903 5.71935 16.0366 3.8526 13.5224 3.8526ZM13.5388 10.7085C12.1527 10.7085 11.1371 9.63014 11.1371 8.18195C11.1371 6.71731 12.1363 5.63954 13.5224 5.63954C14.9248 5.63954 15.9399 6.73376 15.9399 8.18195C15.9399 9.63014 14.9248 10.7085 13.5388 10.7085ZM18.4219 5.7358H19.631V12.334H21.565V4.01344H18.4219V5.7358ZM4.31932 5.63893C5.33499 5.63893 6.14083 6.26646 6.44675 7.19983H8.4939C8.12291 5.20453 6.47899 3.8526 4.33574 3.8526C1.90179 3.8526 0 5.70351 0 8.18195C0 10.6604 1.85375 12.4948 4.33574 12.4948C6.43094 12.4948 8.10709 11.1429 8.47809 9.13116H6.44675C6.15665 10.0645 5.3508 10.7085 4.33514 10.7085C2.93266 10.7085 1.94984 9.63014 1.94984 8.18195C1.95045 6.71731 2.91746 5.63893 4.31932 5.63893ZM55.1696 7.37713L53.7513 7.16815C53.0744 7.07189 52.5909 6.84647 52.5909 6.3152C52.5909 5.7358 53.2198 5.44641 54.0736 5.44641C55.0084 5.44641 55.6051 5.84851 55.734 6.50833H57.6035C57.3937 4.83472 56.1044 3.85321 54.1223 3.85321C52.0752 3.85321 50.7213 4.8993 50.7213 6.37978C50.7213 7.79568 51.6081 8.61695 53.3967 8.87406L54.815 9.08303C55.5084 9.17929 55.8952 9.45346 55.8952 9.96828C55.8952 10.6281 55.2182 10.9016 54.2835 10.9016C53.1389 10.9016 52.4942 10.435 52.3975 9.72701H50.4957C50.6733 11.3525 51.9462 12.4948 54.2671 12.4948C56.3787 12.4948 57.7805 11.5292 57.7805 9.8714C57.7805 8.39092 56.7655 7.61839 55.1696 7.37713ZM20.598 0.585792C19.8888 0.585792 19.3567 1.10061 19.3567 1.80856C19.3567 2.51651 19.8882 3.03133 20.598 3.03133C21.3071 3.03133 21.8393 2.51651 21.8393 1.80856C21.8393 1.10061 21.3071 0.585792 20.598 0.585792ZM48.9807 6.86231C48.9807 5.06014 47.8848 3.85321 45.5639 3.85321C43.372 3.85321 42.1472 4.96388 41.9051 6.66978H43.8233C43.92 6.00996 44.4358 5.46286 45.5317 5.46286C46.5151 5.46286 46.9986 5.89725 46.9986 6.42852C46.9986 7.12063 46.1119 7.29731 45.016 7.41003C43.5332 7.57087 41.6959 8.08569 41.6959 10.017C41.6959 11.5139 42.8083 12.479 44.5811 12.479C45.9672 12.479 46.8375 11.8996 47.2729 10.9821C47.3374 11.8027 47.9498 12.334 48.8043 12.334H49.9325V10.6123H48.9813V6.86231H48.9807ZM47.0789 8.95448C47.0789 10.0651 46.1119 10.8858 44.9351 10.8858C44.2095 10.8858 43.5971 10.58 43.5971 9.93659C43.5971 9.11593 44.5805 8.89051 45.483 8.79425C46.3534 8.71383 46.8369 8.52069 47.0789 8.15027V8.95448ZM36.8122 3.8526C35.732 3.8526 34.8295 4.30345 34.1848 5.05953V0.505371H32.2508V12.334H34.1526V11.2398C34.7973 12.0282 35.7162 12.4948 36.8122 12.4948C39.133 12.4948 40.89 10.6604 40.89 8.18195C40.89 5.70351 39.1008 3.8526 36.8122 3.8526ZM36.5221 10.7085C35.136 10.7085 34.1203 9.63014 34.1203 8.18195C34.1203 6.73376 35.1518 5.63954 36.5379 5.63954C37.9403 5.63954 38.9232 6.71792 38.9232 8.18195C38.9232 9.63014 37.9081 10.7085 36.5221 10.7085ZM27.6249 3.8526C26.3678 3.8526 25.5456 4.36742 25.062 5.09182V4.01344H23.1438V12.3334H25.0779V7.81152C25.0779 6.54001 25.8837 5.63893 27.0764 5.63893C28.1887 5.63893 28.8814 6.4273 28.8814 7.57026V12.334H30.8155V7.42587C30.8161 5.33308 29.7366 3.8526 27.6249 3.8526ZM67 7.90839C67 5.52683 65.2594 3.85321 62.9221 3.85321C60.4401 3.85321 58.6186 5.71996 58.6186 8.18195C58.6186 10.7731 60.5691 12.4948 62.9544 12.4948C64.9693 12.4948 66.5487 11.3038 66.9513 9.6143H64.9364C64.6463 10.3545 63.9372 10.7731 62.986 10.7731C61.7447 10.7731 60.8099 10.0006 60.6007 8.64863H66.9994V7.90839H67ZM60.7138 7.26441C61.0203 6.10562 61.8906 5.54267 62.8899 5.54267C63.9858 5.54267 64.8239 6.1702 65.0173 7.26441H60.7138Z",
|
|
9
|
-
fill: "
|
|
9
|
+
fill: "#0050ff"
|
|
10
10
|
}
|
|
11
11
|
) }),
|
|
12
12
|
/* @__PURE__ */ C("defs", { children: /* @__PURE__ */ C("clipPath", { id: "clip0_7507_87", children: /* @__PURE__ */ C("rect", { width: "67", height: "11.9895", fill: "white", transform: "translate(0 0.505371)" }) }) })
|
|
13
13
|
] });
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
V as IconCoinbaseWordmark
|
|
16
16
|
};
|