@coinbase/cdp-react 0.0.2 → 0.0.3
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 +3 -3
- package/dist/components/AuthButton/index.d.ts +1 -1
- package/dist/components/CDPReactProvider/index.d.ts +1 -1
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/LoadingSpinner/index.d.ts +1 -1
- package/dist/components/SignIn/SignInDescription.d.ts +1 -1
- package/dist/components/SignIn/SignInForm.d.ts +1 -1
- package/dist/components/SignIn/SignInForm.js +6 -6
- package/dist/components/SignIn/SignInImage.d.ts +1 -1
- package/dist/components/SignIn/SignInProvider.d.ts +1 -1
- package/dist/components/SignIn/SignInTitle.d.ts +1 -1
- package/dist/components/SignIn/index.d.ts +1 -1
- package/dist/components/SignIn/useSignInReducer.d.ts +1 -1
- package/dist/components/SignInModal/index.d.ts +1 -1
- package/dist/components/SignInModal/index.js +1 -1
- package/dist/components/SignOutButton/index.d.ts +1 -1
- package/dist/components/SignOutButton/index.js +1 -1
- package/dist/components/ThemeProvider/index.d.ts +1 -1
- package/dist/components/VisuallyHidden/index.d.ts +5 -8
- package/dist/components/VisuallyHidden/index.js +5 -14
- package/dist/icons/IconCheckCircle.d.ts +1 -1
- package/dist/icons/IconCoinbaseWordmark.d.ts +1 -1
- package/dist/icons/IconExclamationCircle.d.ts +1 -1
- package/dist/icons/IconLock.d.ts +1 -1
- package/dist/icons/IconXMark.d.ts +1 -1
- package/dist/icons/SvgIcon.d.ts +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -60,10 +60,10 @@ const appConfig = {
|
|
|
60
60
|
|
|
61
61
|
// You can customize the theme by overriding theme variables
|
|
62
62
|
const themeOverrides: Partial<Theme> = {
|
|
63
|
-
"colors-background": "black"
|
|
63
|
+
"colors-background": "black",
|
|
64
64
|
"colors-backgroundOverlay": "rgba(0,0,0,0.5)",
|
|
65
|
-
"colors-text": "white"
|
|
66
|
-
"colors-textSecondary": "#999999"
|
|
65
|
+
"colors-text": "white",
|
|
66
|
+
"colors-textSecondary": "#999999",
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AuthButton: () => import("react").JSX.Element;
|
|
1
|
+
export declare const AuthButton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,5 +7,5 @@ export interface AppConfig {
|
|
|
7
7
|
export type CDPReactProviderProps = CDPHooksProviderProps & ThemeProviderProps & {
|
|
8
8
|
app?: AppConfig;
|
|
9
9
|
};
|
|
10
|
-
export declare const CDPReactProvider: ({ children, config, theme, app }: CDPReactProviderProps) => import("react").JSX.Element;
|
|
10
|
+
export declare const CDPReactProvider: ({ children, config, theme, app }: CDPReactProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export declare const useAppConfig: () => AppConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormMessageProps, FormValidityStateProps } from '@radix-ui/react-form';
|
|
2
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { CSSProperties, JSX, ReactNode } from 'react';
|
|
3
3
|
export interface FormFieldProps {
|
|
4
4
|
children?: FormValidityStateProps["children"];
|
|
5
5
|
className?: string;
|
|
@@ -2,4 +2,4 @@ import { ElementType, HTMLAttributes } from 'react';
|
|
|
2
2
|
export type SignInDescriptionProps = {
|
|
3
3
|
as?: ElementType;
|
|
4
4
|
} & HTMLAttributes<HTMLElement>;
|
|
5
|
-
export declare const SignInDescription: ({ as: Component, children, className, ...props }: SignInDescriptionProps) => import("react").JSX.Element;
|
|
5
|
+
export declare const SignInDescription: ({ as: Component, children, className, ...props }: SignInDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ export type SignInFormProps = {
|
|
|
3
3
|
as?: ElementType;
|
|
4
4
|
onSuccess?: () => void;
|
|
5
5
|
} & HTMLAttributes<HTMLElement>;
|
|
6
|
-
export declare const SignInForm: ({ as: Component, className, onSuccess, ...props }: SignInFormProps) => import("react").JSX.Element;
|
|
6
|
+
export declare const SignInForm: ({ as: Component, className, onSuccess, ...props }: SignInFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,9 +2,10 @@ import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useSignInWithEmail as N, useVerifyEmailOTP as M } from "@coinbase/cdp-hooks";
|
|
3
3
|
import { Form as I, FormSubmit as P } from "@radix-ui/react-form";
|
|
4
4
|
import { useRef as R, useState as U, useEffect as A } from "react";
|
|
5
|
+
import { Button as b } from "../Button/index.js";
|
|
5
6
|
import { Field as x } from "../Field/index.js";
|
|
6
7
|
import { OTP as F } from "../OTP/index.js";
|
|
7
|
-
import { ServerError as
|
|
8
|
+
import { ServerError as C } from "../ServerError/index.js";
|
|
8
9
|
import { IconCoinbaseWordmark as B } from "../../icons/IconCoinbaseWordmark.js";
|
|
9
10
|
import { IconLock as V } from "../../icons/IconLock.js";
|
|
10
11
|
import { isApiError as T } from "../../utils/isApiError.js";
|
|
@@ -12,7 +13,6 @@ import { isEmailInvalid as k } from "../../utils/isEmailInvalid.js";
|
|
|
12
13
|
import { s as a } from "../../chunks/SignIn.module.Dl3CqKQ_.js";
|
|
13
14
|
import { useSignInContext as S } from "./SignInProvider.js";
|
|
14
15
|
import { withValidityState as W } from "../Input/index.js";
|
|
15
|
-
import { Button as C } from "../Button/index.js";
|
|
16
16
|
import { LoadingSpinner as D } from "../LoadingSpinner/index.js";
|
|
17
17
|
import { VisuallyHidden as $ } from "../VisuallyHidden/index.js";
|
|
18
18
|
const j = ({ submit: f }) => {
|
|
@@ -45,8 +45,8 @@ const j = ({ submit: f }) => {
|
|
|
45
45
|
})
|
|
46
46
|
}
|
|
47
47
|
),
|
|
48
|
-
n.error && /* @__PURE__ */ t(
|
|
49
|
-
/* @__PURE__ */ t(P, { asChild: !0, children: /* @__PURE__ */ t(
|
|
48
|
+
n.error && /* @__PURE__ */ t(C, { error: n.error, className: a.serverError }),
|
|
49
|
+
/* @__PURE__ */ t(P, { asChild: !0, children: /* @__PURE__ */ t(b, { type: "submit", isPending: n.isPending, children: "Continue with email" }) })
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
);
|
|
@@ -85,11 +85,11 @@ const j = ({ submit: f }) => {
|
|
|
85
85
|
/* @__PURE__ */ i("div", { className: a.formFooter, children: [
|
|
86
86
|
(e.isPending && !e.canResetOTP || e.error) && /* @__PURE__ */ i("div", { className: a.serverStateWrapper, children: [
|
|
87
87
|
e.isPending && !e.canResetOTP && /* @__PURE__ */ t(D, { className: a.loadingSpinner }),
|
|
88
|
-
e.error && /* @__PURE__ */ t(
|
|
88
|
+
e.error && /* @__PURE__ */ t(C, { error: e.error, className: a.serverError })
|
|
89
89
|
] }),
|
|
90
90
|
/* @__PURE__ */ i("div", { children: [
|
|
91
91
|
e.canResetOTP && /* @__PURE__ */ t(P, { asChild: !0, children: /* @__PURE__ */ t(
|
|
92
|
-
|
|
92
|
+
b,
|
|
93
93
|
{
|
|
94
94
|
type: "button",
|
|
95
95
|
onClick: E,
|
|
@@ -3,4 +3,4 @@ export type SignInImageProps = {
|
|
|
3
3
|
alt?: string;
|
|
4
4
|
src?: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const SignInImage: ({ className, alt, src }: SignInImageProps) => import("react").JSX.Element | null;
|
|
6
|
+
export declare const SignInImage: ({ className, alt, src }: SignInImageProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,4 +2,4 @@ import { ElementType, HTMLAttributes } from 'react';
|
|
|
2
2
|
export type SignInTitleProps = {
|
|
3
3
|
as?: ElementType;
|
|
4
4
|
} & HTMLAttributes<HTMLElement>;
|
|
5
|
-
export declare const SignInTitle: ({ as: Component, children, className, ...props }: SignInTitleProps) => import("react").JSX.Element;
|
|
5
|
+
export declare const SignInTitle: ({ as: Component, children, className, ...props }: SignInTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,5 +10,5 @@ export interface SignInProps {
|
|
|
10
10
|
className?: string;
|
|
11
11
|
onSuccess?: () => void;
|
|
12
12
|
}
|
|
13
|
-
export declare const SignIn: (props: SignInProps) => import("react").JSX.Element;
|
|
13
|
+
export declare const SignIn: (props: SignInProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export { SignInDescription, SignInForm, SignInImage, SignInTitle, useSignInContext, type SignInDescriptionProps, type SignInFormProps, type SignInImageProps, type SignInTitleProps, };
|
|
@@ -55,4 +55,4 @@ export type SignInAction = {
|
|
|
55
55
|
} | {
|
|
56
56
|
type: "CLEAR_ERROR";
|
|
57
57
|
};
|
|
58
|
-
export declare const useSignInReducer: (initialState: SignInState) => [SignInState, import('react').
|
|
58
|
+
export declare const useSignInReducer: (initialState: SignInState) => [SignInState, import('react').ActionDispatch<[action: SignInAction]>];
|
|
@@ -5,4 +5,4 @@ export type SignInModalProps = {
|
|
|
5
5
|
setIsOpen?: (value: boolean) => void;
|
|
6
6
|
onSuccess?: () => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const SignInModal: ({ children, open, setIsOpen, onSuccess }: SignInModalProps) => import("react").JSX.Element;
|
|
8
|
+
export declare const SignInModal: ({ children, open, setIsOpen, onSuccess }: SignInModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,13 +2,13 @@ import { jsxs as o, jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { Dialog as g, DialogTrigger as c, DialogPortal as m, DialogOverlay as _, DialogContent as d, DialogClose as I, DialogTitle as p, 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";
|
|
5
6
|
import { SignIn as S } from "../SignIn/index.js";
|
|
6
7
|
import { useTheme as D } from "../ThemeProvider/index.js";
|
|
7
8
|
import { SignInImage as M } from "../SignIn/SignInImage.js";
|
|
8
9
|
import { SignInTitle as f } from "../SignIn/SignInTitle.js";
|
|
9
10
|
import { SignInDescription as v } from "../SignIn/SignInDescription.js";
|
|
10
11
|
import { SignInForm as N } from "../SignIn/SignInForm.js";
|
|
11
|
-
import { Button as r } from "../Button/index.js";
|
|
12
12
|
import '../../assets/SignInModal.css';const y = "SignInModal-module__trigger___IcJ8x", T = "SignInModal-module__modal___PErrT", C = "SignInModal-module__signIn___hQuJk", x = "SignInModal-module__signInForm___6-UdI", B = "SignInModal-module__signInTitle___AF-XA", F = "SignInModal-module__signInDescription___SZjXu", W = "SignInModal-module__signInImage___hMBda", j = "SignInModal-module__closeWrapper___cx8Zq", X = "SignInModal-module__closeButton___yf-ZW", Z = "SignInModal-module__overlay___-0rmi", b = "SignInModal-module__spacer___x-lRH", i = {
|
|
13
13
|
trigger: y,
|
|
14
14
|
modal: T,
|
|
@@ -5,4 +5,4 @@ export type SignOutButtonProps = {
|
|
|
5
5
|
onSuccess?: () => void;
|
|
6
6
|
variant?: ButtonVariant;
|
|
7
7
|
};
|
|
8
|
-
export declare const SignOutButton: ({ children, variant, onSuccess }: SignOutButtonProps) => import("react").JSX.Element;
|
|
8
|
+
export declare const SignOutButton: ({ children, variant, onSuccess }: SignOutButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
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 "../../theme/theme.js";
|
|
5
4
|
import { Button as m } from "../Button/index.js";
|
|
5
|
+
import "../../theme/theme.js";
|
|
6
6
|
import '../../assets/SignOutButton.css';const g = "SignOutButton-module__signOutButton___WNhmy", c = {
|
|
7
7
|
signOutButton: g
|
|
8
8
|
}, l = ({ children: t, variant: n = "primary", onSuccess: o }) => {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
interface VisuallyHiddenProps {
|
|
3
|
+
as?: ElementType;
|
|
4
4
|
children?: ReactNode;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
children: ReactElement;
|
|
8
|
-
};
|
|
9
|
-
export declare const VisuallyHidden: ({ asChild, children }: VisuallyHiddenProps) => import("react").JSX.Element | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const VisuallyHidden: ({ as: Component, children }: VisuallyHiddenProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
7
|
export {};
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import '../../assets/VisuallyHidden.css';const
|
|
4
|
-
visuallyHidden:
|
|
5
|
-
}, u = ({
|
|
6
|
-
if (!l)
|
|
7
|
-
return null;
|
|
8
|
-
if (!e)
|
|
9
|
-
return /* @__PURE__ */ n("span", { className: i.visuallyHidden, children: l });
|
|
10
|
-
const s = d.only(l);
|
|
11
|
-
return a(s, {
|
|
12
|
-
className: `${i.visuallyHidden} ${s.props.className || ""}`.trim()
|
|
13
|
-
});
|
|
14
|
-
};
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import '../../assets/VisuallyHidden.css';const d = "VisuallyHidden-module__visuallyHidden___KiAzg", n = {
|
|
4
|
+
visuallyHidden: d
|
|
5
|
+
}, u = ({ as: s = "span", children: l }) => l ? /* @__PURE__ */ i(s, { className: n.visuallyHidden, children: l }) : null;
|
|
15
6
|
export {
|
|
16
7
|
u as VisuallyHidden
|
|
17
8
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
|
-
export declare const IconCheckCircle: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react").JSX.Element;
|
|
2
|
+
export declare const IconCheckCircle: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
|
-
export declare const IconCoinbaseWordmark: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react").JSX.Element;
|
|
2
|
+
export declare const IconCoinbaseWordmark: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
|
-
export declare const IconExclamationCircle: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react").JSX.Element;
|
|
2
|
+
export declare const IconExclamationCircle: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react/jsx-runtime").JSX.Element;
|
package/dist/icons/IconLock.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
|
-
export declare const IconLock: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react").JSX.Element;
|
|
2
|
+
export declare const IconLock: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
|
-
export declare const IconXMark: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react").JSX.Element;
|
|
2
|
+
export declare const IconXMark: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react/jsx-runtime").JSX.Element;
|
package/dist/icons/SvgIcon.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"@radix-ui/react-one-time-password-field": "^0.1.7"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"react": "
|
|
12
|
-
"@coinbase/cdp-
|
|
13
|
-
"@coinbase/cdp-
|
|
11
|
+
"react": ">=18.2.0",
|
|
12
|
+
"@coinbase/cdp-hooks": "^0.0.3",
|
|
13
|
+
"@coinbase/cdp-core": "^0.0.3"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@size-limit/preset-big-lib": "^11.2.0",
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"@size-limit/webpack-why": "^11.2.0",
|
|
20
20
|
"@testing-library/dom": "^10.0.0",
|
|
21
21
|
"@testing-library/jest-dom": "^6.6.3",
|
|
22
|
-
"@testing-library/react": "
|
|
22
|
+
"@testing-library/react": "^16.3.0",
|
|
23
23
|
"@testing-library/user-event": "^14.6.1",
|
|
24
24
|
"@types/glob": "^9.0.0",
|
|
25
|
-
"@types/react": "^
|
|
26
|
-
"@types/react-dom": "^
|
|
25
|
+
"@types/react": "^19.1.0",
|
|
26
|
+
"@types/react-dom": "^19.1.0",
|
|
27
27
|
"@vitejs/plugin-react": "^4.6.0",
|
|
28
28
|
"eslint-plugin-react": "^7.37.5",
|
|
29
29
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
30
30
|
"glob": "^11.0.3",
|
|
31
|
-
"react": "^
|
|
32
|
-
"react-dom": "^
|
|
31
|
+
"react": "^19.1.0",
|
|
32
|
+
"react-dom": "^19.1.0",
|
|
33
33
|
"size-limit": "^11.2.0",
|
|
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.3",
|
|
38
|
+
"@coinbase/cdp-hooks": "^0.0.3"
|
|
39
39
|
},
|
|
40
40
|
"size-limit": [
|
|
41
41
|
{
|