@coinbase/cdp-react 0.0.16 → 0.0.17

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.
@@ -1,8 +1,8 @@
1
1
  import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
2
  import { OneTimePasswordField as _, OneTimePasswordFieldInput as f, OneTimePasswordFieldHiddenInput as P } from "@radix-ui/react-one-time-password-field";
3
3
  import { forwardRef as O, useId as T, useRef as h, useEffect as y } from "react";
4
- import { Error as I } from "../Error/index.js";
5
- import { Input as v } from "../Input/index.js";
4
+ import { Input as I } from "../Input/index.js";
5
+ import { Error as v } from "../Error/index.js";
6
6
  import '../../assets/OTP.css';const w = "OTP-module__otp___EUcSo", N = "OTP-module__input___MEBPV", r = {
7
7
  otp: w,
8
8
  "group-container": "OTP-module__group-container___rfrCo",
@@ -29,7 +29,7 @@ import '../../assets/OTP.css';const w = "OTP-module__otp___EUcSo", N = "OTP-modu
29
29
  },
30
30
  children: [
31
31
  Array.from({ length: s }, (e, t) => /* @__PURE__ */ o("div", { className: r["input-container"], children: /* @__PURE__ */ o(f, { asChild: !0, children: /* @__PURE__ */ o(
32
- v,
32
+ I,
33
33
  {
34
34
  name: `${c.name || "otp"}-${t}`,
35
35
  ref: (m) => p(m, t),
@@ -40,7 +40,7 @@ import '../../assets/OTP.css';const w = "OTP-module__otp___EUcSo", N = "OTP-modu
40
40
  ]
41
41
  }
42
42
  ),
43
- i && /* @__PURE__ */ o(I, { id: u, children: i })
43
+ i && /* @__PURE__ */ o(v, { id: u, children: i })
44
44
  ] });
45
45
  }
46
46
  );
@@ -1,12 +1,12 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import "@coinbase/cdp-hooks";
3
3
  import { forwardRef as t } from "react";
4
- import { Error as p } from "../Error/index.js";
5
- import { isApiError as f } from "../../utils/isApiError.js";
4
+ import { isApiError as p } from "../../utils/isApiError.js";
5
+ import { Error as f } from "../Error/index.js";
6
6
  const a = t(
7
7
  ({ error: r, id: o, className: e = "" }, m) => {
8
- const i = f(r) ? r.errorMessage : r;
9
- return /* @__PURE__ */ s(p, { ref: m, id: o, className: e, children: i });
8
+ const i = p(r) ? r.errorMessage : r;
9
+ return /* @__PURE__ */ s(f, { ref: m, id: o, className: e, children: i });
10
10
  }
11
11
  );
12
12
  a.displayName = "ServerError";
@@ -5,16 +5,16 @@ import { useState as v, useEffect as y, useRef as B } from "react";
5
5
  import { Button as C } from "../Button/index.js";
6
6
  import { useAppConfig as k } from "../CDPReactProvider/index.js";
7
7
  import { Field as x } from "../Field/index.js";
8
- import { LoadingSpinner as q } from "../LoadingSpinner/index.js";
9
- import { OTP as D } from "../OTP/index.js";
8
+ import { OTP as q } from "../OTP/index.js";
10
9
  import { ServerError as O } from "../ServerError/index.js";
11
- import { VisuallyHidden as W } from "../VisuallyHidden/index.js";
12
- import { IconCoinbaseWordmark as Q } from "../../icons/IconCoinbaseWordmark.js";
13
- import { IconLock as Z } from "../../icons/IconLock.js";
10
+ import { IconCoinbaseWordmark as D } from "../../icons/IconCoinbaseWordmark.js";
11
+ import { IconLock as W } from "../../icons/IconLock.js";
14
12
  import { isApiError as T } from "../../utils/isApiError.js";
15
- import { isEmailInvalid as $ } from "../../utils/isEmailInvalid.js";
13
+ import { isEmailInvalid as Q } from "../../utils/isEmailInvalid.js";
16
14
  import { useSignInContext as E } from "./SignInProvider.js";
17
- import { withValidityState as j } from "../Input/index.js";
15
+ import { withValidityState as Z } from "../Input/index.js";
16
+ import { LoadingSpinner as $ } from "../LoadingSpinner/index.js";
17
+ import { VisuallyHidden as j } from "../VisuallyHidden/index.js";
18
18
  import '../../assets/SignInForm.css';const J = "SignInForm-module__form___8Mc3V", G = "SignInForm-module__footer___6Lo9w", H = "SignInForm-module__hr___fOcy4", X = "SignInForm-module__icon___qkJnq", n = {
19
19
  "form-wrapper": "SignInForm-module__form-wrapper___SlQkZ",
20
20
  form: J,
@@ -45,9 +45,9 @@ import '../../assets/SignInForm.css';const J = "SignInForm-module__form___8Mc3V"
45
45
  validators: [
46
46
  ["valueMissing", "Email is required"],
47
47
  ["typeMismatch", "Use a valid email address"],
48
- [$, "Use a valid email address"]
48
+ [Q, "Use a valid email address"]
49
49
  ],
50
- children: j({
50
+ children: Z({
51
51
  autoComplete: "email",
52
52
  type: "email",
53
53
  placeholder: "name@example.com",
@@ -82,7 +82,7 @@ import '../../assets/SignInForm.css';const J = "SignInForm-module__form___8Mc3V"
82
82
  onSubmit: f,
83
83
  children: [
84
84
  /* @__PURE__ */ o(
85
- D,
85
+ q,
86
86
  {
87
87
  ref: l,
88
88
  name: "otp",
@@ -98,7 +98,7 @@ import '../../assets/SignInForm.css';const J = "SignInForm-module__form___8Mc3V"
98
98
  ),
99
99
  /* @__PURE__ */ s("div", { className: n["form-footer"], children: [
100
100
  (e.isPending && !e.canResetOTP || e.error) && /* @__PURE__ */ s("div", { className: n["server-state-wrapper"], children: [
101
- e.isPending && !e.canResetOTP && /* @__PURE__ */ o(q, { className: n["loading-spinner"] }),
101
+ e.isPending && !e.canResetOTP && /* @__PURE__ */ o($, { className: n["loading-spinner"] }),
102
102
  e.error && /* @__PURE__ */ o(O, { error: e.error, className: n["server-error"] })
103
103
  ] }),
104
104
  /* @__PURE__ */ s("div", { className: n["resend-wrapper"], children: [
@@ -118,7 +118,7 @@ import '../../assets/SignInForm.css';const J = "SignInForm-module__form___8Mc3V"
118
118
  i,
119
119
  "s"
120
120
  ] }),
121
- /* @__PURE__ */ s(W, { children: [
121
+ /* @__PURE__ */ s(j, { children: [
122
122
  i,
123
123
  " ",
124
124
  i === 1 ? "second" : "seconds"
@@ -187,11 +187,11 @@ import '../../assets/SignInForm.css';const J = "SignInForm-module__form___8Mc3V"
187
187
  F && /* @__PURE__ */ s(A, { children: [
188
188
  /* @__PURE__ */ o("hr", { className: n.hr }),
189
189
  /* @__PURE__ */ s("div", { className: n.footer, children: [
190
- /* @__PURE__ */ o(Z, { className: n.icon }),
190
+ /* @__PURE__ */ o(W, { className: n.icon }),
191
191
  /* @__PURE__ */ s("p", { children: [
192
192
  "Secured by",
193
193
  " ",
194
- /* @__PURE__ */ o(Q, { className: n["coinbase-icon"], "aria-label": "Coinbase" })
194
+ /* @__PURE__ */ o(D, { className: n["coinbase-icon"], "aria-label": "Coinbase" })
195
195
  ] })
196
196
  ] })
197
197
  ] })
@@ -1,10 +1,11 @@
1
1
  import { jsxs as o, jsx as i } from "react/jsx-runtime";
2
- import { Dialog as g, DialogTrigger as m, DialogPortal as _, DialogOverlay as d, DialogContent as c, DialogClose as p, DialogTitle as I, DialogDescription as u } from "@radix-ui/react-dialog";
2
+ import { Dialog as m, DialogTrigger as g, DialogPortal as _, DialogOverlay as d, DialogContent as c, DialogClose as p, DialogTitle as I, DialogDescription as u } 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
- import { useTheme as S } from "../ThemeProvider/index.js";
7
- import { SignIn as f } from "../SignIn/index.js";
5
+ import { Button as e } from "../Button/index.js";
6
+ import { SignIn as S } from "../SignIn/index.js";
7
+ import "@coinbase/cdp-hooks";
8
+ import { useTheme as f } from "../ThemeProvider/index.js";
8
9
  import { SignInImage as M } from "../SignIn/SignInImage.js";
9
10
  import { SignInTitle as D } from "../SignIn/SignInTitle.js";
10
11
  import { SignInDescription as v } from "../SignIn/SignInDescription.js";
@@ -20,15 +21,15 @@ import '../../assets/SignInModal.css';const y = "SignInModal-module__trigger___I
20
21
  "close-button": "SignInModal-module__close-button___k1I5Q",
21
22
  overlay: x,
22
23
  spacer: b
23
- }, G = ({ children: l, open: a, setIsOpen: s, onSuccess: e }) => {
24
- const { cssVariables: t } = S();
25
- return /* @__PURE__ */ o(g, { open: a, onOpenChange: s, children: [
26
- /* @__PURE__ */ i(m, { asChild: !0, children: l || /* @__PURE__ */ i(r, { variant: "primary", className: n.trigger, children: "Sign In" }) }),
24
+ }, H = ({ children: l, open: a, setIsOpen: s, onSuccess: r }) => {
25
+ const { cssVariables: t } = f();
26
+ return /* @__PURE__ */ o(m, { open: a, onOpenChange: s, children: [
27
+ /* @__PURE__ */ i(g, { asChild: !0, children: l || /* @__PURE__ */ i(e, { variant: "primary", className: n.trigger, children: "Sign In" }) }),
27
28
  /* @__PURE__ */ i(_, { children: /* @__PURE__ */ o(d, { className: n.overlay, style: t, children: [
28
29
  /* @__PURE__ */ i("div", { className: n.spacer }),
29
- /* @__PURE__ */ i(c, { className: n.modal, children: /* @__PURE__ */ o(f, { onSuccess: e, className: n["sign-in"], children: [
30
+ /* @__PURE__ */ i(c, { className: n.modal, children: /* @__PURE__ */ o(S, { onSuccess: r, className: n["sign-in"], children: [
30
31
  /* @__PURE__ */ i(p, { asChild: !0, children: /* @__PURE__ */ i(
31
- r,
32
+ e,
32
33
  {
33
34
  "aria-label": "Close",
34
35
  variant: "transparentSecondary",
@@ -39,11 +40,11 @@ import '../../assets/SignInModal.css';const y = "SignInModal-module__trigger___I
39
40
  /* @__PURE__ */ i("div", { className: n["sign-in-image"], children: /* @__PURE__ */ i(M, {}) }),
40
41
  /* @__PURE__ */ i("div", { className: n["sign-in-title"], children: /* @__PURE__ */ i(I, { asChild: !0, children: /* @__PURE__ */ i(D, {}) }) }),
41
42
  /* @__PURE__ */ i(u, { asChild: !0, children: /* @__PURE__ */ i(v, { className: n["sign-in-description"] }) }),
42
- /* @__PURE__ */ i(N, { className: n["sign-in-form"], onSuccess: e })
43
+ /* @__PURE__ */ i(N, { className: n["sign-in-form"], onSuccess: r })
43
44
  ] }) })
44
45
  ] }) })
45
46
  ] });
46
47
  };
47
48
  export {
48
- G as SignInModal
49
+ H as SignInModal
49
50
  };
package/dist/index.js CHANGED
@@ -1,58 +1,58 @@
1
1
  import { CDPReactProvider as e, useAppConfig as t } from "./components/CDPReactProvider/index.js";
2
2
  import { AuthButton as m } from "./components/AuthButton/index.js";
3
3
  import { SendTransactionButton as f } from "./components/SendTransactionButton/index.js";
4
- import { SignOutButton as x } from "./components/SignOutButton/index.js";
5
- import { SignInModal as c } from "./components/SignInModal/index.js";
6
- import { cssVariables as l } from "./theme/cssVariables.js";
7
- import { theme as g } from "./theme/theme.js";
8
- import { colors as u, colorsBase as C, colorsComponents as d, colorsSemantic as h, font as k, tokens as T } from "./theme/tokens.js";
9
- import { flattenTokensObject as E, themeToCssVariables as b } from "./theme/utils.js";
10
- import { IconCheckCircle as A } from "./icons/IconCheckCircle.js";
11
- import { IconExclamationCircle as P } from "./icons/IconExclamationCircle.js";
12
- import { IconLock as F } from "./icons/IconLock.js";
13
- import { IconXMark as R } from "./icons/IconXMark.js";
14
- import { getMessageFromUnknownError as j } from "./utils/getMessageFromUnknownError.js";
15
- import { isApiError as L } from "./utils/isApiError.js";
16
- import { isEmailInvalid as X } from "./utils/isEmailInvalid.js";
17
- import { SignIn as y } from "./components/SignIn/index.js";
18
- import { SignInDescription as G } from "./components/SignIn/SignInDescription.js";
19
- import { SignInForm as J } from "./components/SignIn/SignInForm.js";
20
- import { SignInImage as N } from "./components/SignIn/SignInImage.js";
21
- import { SignInTitle as W } from "./components/SignIn/SignInTitle.js";
22
- import { useSignInContext as Z } from "./components/SignIn/SignInProvider.js";
23
- import { useSignInReducer as $ } from "./components/SignIn/useSignInReducer.js";
24
- import { ThemeProvider as ro, useTheme as eo } from "./components/ThemeProvider/index.js";
4
+ import { SignIn as x } from "./components/SignIn/index.js";
5
+ import { useSignInReducer as c } from "./components/SignIn/useSignInReducer.js";
6
+ import { SignOutButton as l } from "./components/SignOutButton/index.js";
7
+ import { SignInModal as g } from "./components/SignInModal/index.js";
8
+ import { ThemeProvider as u, useTheme as C } from "./components/ThemeProvider/index.js";
9
+ import { cssVariables as h } from "./theme/cssVariables.js";
10
+ import { theme as T } from "./theme/theme.js";
11
+ import { colors as E, colorsBase as b, colorsComponents as v, colorsSemantic as A, font as M, tokens as P } from "./theme/tokens.js";
12
+ import { flattenTokensObject as F, themeToCssVariables as O } from "./theme/utils.js";
13
+ import { IconCheckCircle as V } from "./icons/IconCheckCircle.js";
14
+ import { IconExclamationCircle as w } from "./icons/IconExclamationCircle.js";
15
+ import { IconLock as U } from "./icons/IconLock.js";
16
+ import { IconXMark as q } from "./icons/IconXMark.js";
17
+ import { getMessageFromUnknownError as z } from "./utils/getMessageFromUnknownError.js";
18
+ import { isApiError as H } from "./utils/isApiError.js";
19
+ import { isEmailInvalid as K } from "./utils/isEmailInvalid.js";
20
+ import { SignInDescription as Q } from "./components/SignIn/SignInDescription.js";
21
+ import { SignInForm as Y } from "./components/SignIn/SignInForm.js";
22
+ import { SignInImage as _ } from "./components/SignIn/SignInImage.js";
23
+ import { SignInTitle as oo } from "./components/SignIn/SignInTitle.js";
24
+ import { useSignInContext as eo } from "./components/SignIn/SignInProvider.js";
25
25
  export {
26
26
  m as AuthButton,
27
27
  e as CDPReactProvider,
28
- A as IconCheckCircle,
29
- P as IconExclamationCircle,
30
- F as IconLock,
31
- R as IconXMark,
28
+ V as IconCheckCircle,
29
+ w as IconExclamationCircle,
30
+ U as IconLock,
31
+ q as IconXMark,
32
32
  f as SendTransactionButton,
33
- y as SignIn,
34
- G as SignInDescription,
35
- J as SignInForm,
36
- N as SignInImage,
37
- c as SignInModal,
38
- W as SignInTitle,
39
- x as SignOutButton,
40
- ro as ThemeProvider,
41
- u as colors,
42
- C as colorsBase,
43
- d as colorsComponents,
44
- h as colorsSemantic,
45
- l as cssVariables,
46
- E as flattenTokensObject,
47
- k as font,
48
- j as getMessageFromUnknownError,
49
- L as isApiError,
50
- X as isEmailInvalid,
51
- g as theme,
52
- b as themeToCssVariables,
53
- T as tokens,
33
+ x as SignIn,
34
+ Q as SignInDescription,
35
+ Y as SignInForm,
36
+ _ as SignInImage,
37
+ g as SignInModal,
38
+ oo as SignInTitle,
39
+ l as SignOutButton,
40
+ u as ThemeProvider,
41
+ E as colors,
42
+ b as colorsBase,
43
+ v as colorsComponents,
44
+ A as colorsSemantic,
45
+ h as cssVariables,
46
+ F as flattenTokensObject,
47
+ M as font,
48
+ z as getMessageFromUnknownError,
49
+ H as isApiError,
50
+ K as isEmailInvalid,
51
+ T as theme,
52
+ O as themeToCssVariables,
53
+ P as tokens,
54
54
  t as useAppConfig,
55
- Z as useSignInContext,
56
- $ as useSignInReducer,
57
- eo as useTheme
55
+ eo as useSignInContext,
56
+ c as useSignInReducer,
57
+ C as useTheme
58
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-react",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
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-core": "^0.0.16",
13
- "@coinbase/cdp-hooks": "^0.0.16"
12
+ "@coinbase/cdp-core": "^0.0.17",
13
+ "@coinbase/cdp-hooks": "^0.0.17"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@size-limit/preset-big-lib": "^11.2.0",
@@ -38,8 +38,8 @@
38
38
  "vite": "^7.0.4",
39
39
  "vite-plugin-dts": "^4.5.4",
40
40
  "vite-plugin-lib-inject-css": "^2.2.2",
41
- "@coinbase/cdp-core": "^0.0.16",
42
- "@coinbase/cdp-hooks": "^0.0.16"
41
+ "@coinbase/cdp-core": "^0.0.17",
42
+ "@coinbase/cdp-hooks": "^0.0.17"
43
43
  },
44
44
  "size-limit": [
45
45
  {