@coinbase/cdp-react 0.0.6 → 0.0.7
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.
|
@@ -5,16 +5,16 @@ import { useState as I, useEffect as T, useRef as F } from "react";
|
|
|
5
5
|
import { Button as O } from "../Button/index.js";
|
|
6
6
|
import { Field as B } from "../Field/index.js";
|
|
7
7
|
import { withValidityState as x } from "../Input/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { LoadingSpinner as V } from "../LoadingSpinner/index.js";
|
|
9
|
+
import { OTP as k } from "../OTP/index.js";
|
|
9
10
|
import { ServerError as b } from "../ServerError/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
11
|
+
import { VisuallyHidden as W } from "../VisuallyHidden/index.js";
|
|
12
|
+
import { IconCoinbaseWordmark as D } from "../../icons/IconCoinbaseWordmark.js";
|
|
13
|
+
import { IconLock as $ } from "../../icons/IconLock.js";
|
|
12
14
|
import { isApiError as P } from "../../utils/isApiError.js";
|
|
13
|
-
import { isEmailInvalid as
|
|
15
|
+
import { isEmailInvalid as j } from "../../utils/isEmailInvalid.js";
|
|
14
16
|
import { s } from "../../chunks/SignIn.module.Dl3CqKQ_.js";
|
|
15
17
|
import { useSignInContext as g } from "./SignInProvider.js";
|
|
16
|
-
import { LoadingSpinner as $ } from "../LoadingSpinner/index.js";
|
|
17
|
-
import { VisuallyHidden as j } from "../VisuallyHidden/index.js";
|
|
18
18
|
const q = ({ submit: u }) => {
|
|
19
19
|
const { state: n, dispatch: d } = g(), e = () => d({ type: "CLEAR_ERROR" }), f = (p) => (p.preventDefault(), u(n.email));
|
|
20
20
|
return /* @__PURE__ */ o(
|
|
@@ -32,7 +32,7 @@ const q = ({ submit: u }) => {
|
|
|
32
32
|
validators: [
|
|
33
33
|
["valueMissing", "Email is required"],
|
|
34
34
|
["typeMismatch", "Use a valid email address"],
|
|
35
|
-
[
|
|
35
|
+
[j, "Use a valid email address"]
|
|
36
36
|
],
|
|
37
37
|
children: x({
|
|
38
38
|
type: "email",
|
|
@@ -68,7 +68,7 @@ const q = ({ submit: u }) => {
|
|
|
68
68
|
onSubmit: h,
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ t(
|
|
71
|
-
|
|
71
|
+
k,
|
|
72
72
|
{
|
|
73
73
|
ref: c,
|
|
74
74
|
name: "otp",
|
|
@@ -84,7 +84,7 @@ const q = ({ submit: u }) => {
|
|
|
84
84
|
),
|
|
85
85
|
/* @__PURE__ */ o("div", { className: s.formFooter, children: [
|
|
86
86
|
(e.isPending && !e.canResetOTP || e.error) && /* @__PURE__ */ o("div", { className: s.serverStateWrapper, children: [
|
|
87
|
-
e.isPending && !e.canResetOTP && /* @__PURE__ */ t(
|
|
87
|
+
e.isPending && !e.canResetOTP && /* @__PURE__ */ t(V, { className: s.loadingSpinner }),
|
|
88
88
|
e.error && /* @__PURE__ */ t(b, { error: e.error, className: s.serverError })
|
|
89
89
|
] }),
|
|
90
90
|
/* @__PURE__ */ o("div", { children: [
|
|
@@ -104,7 +104,7 @@ const q = ({ submit: u }) => {
|
|
|
104
104
|
n,
|
|
105
105
|
"s"
|
|
106
106
|
] }),
|
|
107
|
-
/* @__PURE__ */ o(
|
|
107
|
+
/* @__PURE__ */ o(W, { children: [
|
|
108
108
|
n,
|
|
109
109
|
" ",
|
|
110
110
|
n === 1 ? "second" : "seconds"
|
|
@@ -172,11 +172,11 @@ const q = ({ submit: u }) => {
|
|
|
172
172
|
i.step === "otp" && /* @__PURE__ */ t(H, { submit: N, reset: M, resetCountdown: h }),
|
|
173
173
|
/* @__PURE__ */ t("hr", { className: s.hr }),
|
|
174
174
|
/* @__PURE__ */ o("div", { className: s.footer, children: [
|
|
175
|
-
/* @__PURE__ */ t(
|
|
175
|
+
/* @__PURE__ */ t($, { className: s.icon }),
|
|
176
176
|
/* @__PURE__ */ o("p", { children: [
|
|
177
177
|
"Secured by",
|
|
178
178
|
" ",
|
|
179
|
-
/* @__PURE__ */ t("a", { href: "https://www.coinbase.com/security", target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ t(
|
|
179
|
+
/* @__PURE__ */ t("a", { href: "https://www.coinbase.com/security", target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ t(D, { className: s.coinbaseIcon, "aria-label": "Coinbase" }) })
|
|
180
180
|
] })
|
|
181
181
|
] })
|
|
182
182
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"react": ">=18.2.0",
|
|
12
|
-
"@coinbase/cdp-
|
|
13
|
-
"@coinbase/cdp-
|
|
12
|
+
"@coinbase/cdp-core": "^0.0.7",
|
|
13
|
+
"@coinbase/cdp-hooks": "^0.0.7"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@size-limit/preset-big-lib": "^11.2.0",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"vite": "^7.0.4",
|
|
35
35
|
"vite-plugin-dts": "^4.5.4",
|
|
36
36
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
37
|
-
"@coinbase/cdp-core": "^0.0.
|
|
38
|
-
"@coinbase/cdp-hooks": "^0.0.
|
|
37
|
+
"@coinbase/cdp-core": "^0.0.7",
|
|
38
|
+
"@coinbase/cdp-hooks": "^0.0.7"
|
|
39
39
|
},
|
|
40
40
|
"size-limit": [
|
|
41
41
|
{
|