@coinbase/cdp-react 0.0.53 → 0.0.55

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.
@@ -0,0 +1 @@
1
+ .ManageAuth-module__manage-auth___4Hpt3{box-sizing:border-box;font:var(--cdp-web-font-size-base) / 1.5 var(--cdp-web-font-family-body);font-optical-sizing:auto;background-color:var(--cdp-web-colors-page-bg-default);color:var(--cdp-web-colors-page-text-default);display:flex;flex-direction:column;max-width:38.25em;overflow:hidden;width:100%;padding-bottom:1.5em}.ManageAuth-module__manage-auth___4Hpt3 *{box-sizing:border-box}.ManageAuth-module__list___lVrdU{display:flex;flex-direction:column;gap:.5em;list-style:none;margin:0;padding:0}.ManageAuth-module__error-wrapper___a9Edn{padding:.5em;background-color:var(--cdp-web-colors-bg-negativeWash);border-radius:.5em;margin:.5em 1.5em}.ManageAuth-module__error-text___43EOm{color:var(--cdp-web-colors-fg-onNegativeWash)}
@@ -0,0 +1 @@
1
+ .ManageAuthItem-module__item___a8mWi{display:flex;align-items:center;justify-content:space-between;height:3em;padding:.5em 1em;margin:0 1.5em;border:1px solid var(--cdp-web-colors-page-border-default);border-radius:.75em;transition:all .2s}.ManageAuthItem-module__item-content___dNkjt{display:flex;align-items:center;gap:.75em;flex:1}.ManageAuthItem-module__item-icon___-uLZ2{display:flex;align-items:center;justify-content:center;width:1.5em;height:1.5em;color:var(--cdp-web-colors-page-text-default)}.ManageAuthItem-module__item-text___kwvK6{display:flex;flex-direction:column;gap:.125em}.ManageAuthItem-module__item-label___u6HnP{font-weight:400;font-size:1em;color:var(--cdp-web-colors-page-text-default)}.ManageAuthItem-module__item-value___YnTDg{font-size:.875em;color:var(--cdp-web-colors-page-text-default)}.ManageAuthItem-module__item-action___JObQh{display:flex;align-items:center}.ManageAuthItem-module__button___NngMz{width:1.5em;height:1.5em;padding:0;font-size:1.25em}.ManageAuthItem-module__button___NngMz:disabled{opacity:.5;cursor:not-allowed}
@@ -0,0 +1 @@
1
+ .ManageAuthModal-module__header___irbw4{display:flex;align-items:center;justify-content:space-between;margin-bottom:1em;padding:1.5em 1.5em 0}.ManageAuthModal-module__title___2Z3vb{font-size:1.25em;font-weight:600;margin:0;color:var(--cdp-web-colors-page-text-default)}.ManageAuthModal-module__close-icon___WnVrd{width:1.25em;height:1.25em}
@@ -0,0 +1,9 @@
1
+ import { AuthMethod as ConfiguredAuthMethod } from '../CDPReactProvider';
2
+ interface ManageAuthItemProps {
3
+ authMethod: ConfiguredAuthMethod;
4
+ displayValue: string;
5
+ isLinked: boolean;
6
+ onLink: (method: ConfiguredAuthMethod) => void;
7
+ }
8
+ declare const ManageAuthItem: ({ authMethod, displayValue, isLinked, onLink }: ManageAuthItemProps) => import("react/jsx-runtime").JSX.Element;
9
+ export { ManageAuthItem as unstable_ManageAuthItem, type ManageAuthItemProps as unstable_ManageAuthItemProps, };
@@ -0,0 +1,77 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { useCallback as s } from "react";
3
+ import { Button as m } from "../ui/Button/index.js";
4
+ import { IconAppleLogo as _ } from "../../icons/IconAppleLogo.js";
5
+ import { IconEnvelope as d } from "../../icons/IconEnvelope.js";
6
+ import { IconGoogleLogo as h } from "../../icons/IconGoogleLogo.js";
7
+ import { IconPhone as g } from "../../icons/IconPhone.js";
8
+ import { IconMinus as p } from "../../icons/IconMinus.js";
9
+ import { IconPlus as b } from "../../icons/IconPlus.js";
10
+ import '../../assets/ManageAuthItem.css';const I = "ManageAuthItem-module__item___a8mWi", A = "ManageAuthItem-module__button___NngMz", t = {
11
+ item: I,
12
+ "item-content": "ManageAuthItem-module__item-content___dNkjt",
13
+ "item-icon": "ManageAuthItem-module__item-icon___-uLZ2",
14
+ "item-text": "ManageAuthItem-module__item-text___kwvK6",
15
+ "item-label": "ManageAuthItem-module__item-label___u6HnP",
16
+ "item-value": "ManageAuthItem-module__item-value___YnTDg",
17
+ "item-action": "ManageAuthItem-module__item-action___JObQh",
18
+ button: A
19
+ }, v = (a) => {
20
+ switch (a) {
21
+ case "email":
22
+ return /* @__PURE__ */ e(d, { "aria-label": "Email" });
23
+ case "sms":
24
+ return /* @__PURE__ */ e(g, { "aria-label": "Phone" });
25
+ case "oauth:google":
26
+ return /* @__PURE__ */ e(h, { "aria-label": "Google" });
27
+ case "oauth:apple":
28
+ return /* @__PURE__ */ e(_, { "aria-label": "Apple" });
29
+ default:
30
+ return null;
31
+ }
32
+ }, f = (a) => {
33
+ switch (a) {
34
+ case "email":
35
+ return "Email";
36
+ case "sms":
37
+ return "Phone";
38
+ case "oauth:google":
39
+ return "Google";
40
+ case "oauth:apple":
41
+ return "Apple";
42
+ default:
43
+ return null;
44
+ }
45
+ }, G = ({ authMethod: a, displayValue: o, isLinked: r, onLink: i }) => {
46
+ const c = v(a), n = f(a), u = s(() => {
47
+ i(a);
48
+ }, [a, i]);
49
+ return /* @__PURE__ */ l("div", { className: t.item, children: [
50
+ /* @__PURE__ */ l("div", { className: t["item-content"], children: [
51
+ /* @__PURE__ */ e("div", { className: t["item-icon"], children: c }),
52
+ /* @__PURE__ */ e("div", { className: t["item-text"], children: o ? /* @__PURE__ */ e("div", { className: t["item-value"], children: o }) : /* @__PURE__ */ e("div", { className: t["item-label"], children: n }) })
53
+ ] }),
54
+ /* @__PURE__ */ e("div", { className: t["item-action"], children: r ? /* @__PURE__ */ e(
55
+ m,
56
+ {
57
+ variant: "secondary",
58
+ className: t.button,
59
+ disabled: !0,
60
+ "aria-label": `Unlink ${n}`,
61
+ children: /* @__PURE__ */ e(p, { "aria-hidden": "true" })
62
+ }
63
+ ) : /* @__PURE__ */ e(
64
+ m,
65
+ {
66
+ variant: "primary",
67
+ className: t.button,
68
+ onClick: u,
69
+ "aria-label": `Link ${n}`,
70
+ children: /* @__PURE__ */ e(b, { "aria-hidden": "true" })
71
+ }
72
+ ) })
73
+ ] });
74
+ };
75
+ export {
76
+ G as unstable_ManageAuthItem
77
+ };
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ import { unstable_ManageAuthState as ManageAuthState } from './types';
3
+ interface ManageAuthProviderProps {
4
+ children: ReactNode;
5
+ }
6
+ declare const ManageAuthProvider: ({ children }: ManageAuthProviderProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const useManageAuthContext: () => ManageAuthState;
8
+ export { ManageAuthProvider as unstable_ManageAuthProvider, useManageAuthContext as unstable_useManageAuthContext, type ManageAuthProviderProps as unstable_ManageAuthProviderProps, };
@@ -0,0 +1,64 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useCurrentUser as p } from "@coinbase/cdp-hooks";
3
+ import { createContext as c, useState as r, useMemo as g, useContext as M } from "react";
4
+ import { useAppConfig as f } from "../CDPReactProvider/index.js";
5
+ const l = c(void 0), y = ({ children: t }) => {
6
+ const [o, s] = r(null), [n, i] = r(null), { currentUser: e } = p(), { authMethods: h } = f(), u = h.map((a) => {
7
+ switch (a) {
8
+ case "email":
9
+ return e?.authenticationMethods.email ? {
10
+ isLinked: !0,
11
+ displayValue: e.authenticationMethods.email.email,
12
+ method: "email"
13
+ } : {
14
+ isLinked: !1,
15
+ displayValue: "",
16
+ method: "email"
17
+ };
18
+ case "sms":
19
+ return e?.authenticationMethods.sms ? {
20
+ isLinked: !0,
21
+ displayValue: e.authenticationMethods.sms.phoneNumber,
22
+ method: "sms"
23
+ } : {
24
+ isLinked: !1,
25
+ displayValue: "",
26
+ method: "sms"
27
+ };
28
+ case "oauth:google":
29
+ return e?.authenticationMethods.google ? {
30
+ isLinked: !0,
31
+ displayValue: e.authenticationMethods.google.email ?? "",
32
+ method: "oauth:google"
33
+ } : {
34
+ isLinked: !1,
35
+ displayValue: "",
36
+ method: "oauth:google"
37
+ };
38
+ case "oauth:apple":
39
+ return e?.authenticationMethods.apple ? {
40
+ isLinked: !0,
41
+ displayValue: e.authenticationMethods.apple.email ?? "",
42
+ method: "oauth:apple"
43
+ } : {
44
+ isLinked: !1,
45
+ displayValue: "",
46
+ method: "oauth:apple"
47
+ };
48
+ }
49
+ return null;
50
+ }).filter((a) => a !== null), d = g(
51
+ () => ({ error: n, setError: i, manageAuthMethods: u, methodToLink: o, setMethodToLink: s }),
52
+ [n, i, u, o, s]
53
+ );
54
+ return /* @__PURE__ */ m(l.Provider, { value: d, children: t });
55
+ }, C = () => {
56
+ const t = M(l);
57
+ if (!t)
58
+ throw new Error("useManageAuthContext must be used within a ManageAuthProvider");
59
+ return t;
60
+ };
61
+ export {
62
+ y as unstable_ManageAuthProvider,
63
+ C as unstable_useManageAuthContext
64
+ };
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { unstable_ManageAuthState as ManageAuthState } from './types';
3
+ interface ManageAuthProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
4
+ children?: ReactNode | ((state: ManageAuthState) => ReactNode);
5
+ onLinkSuccess?: (method: string) => void;
6
+ }
7
+ declare const ManageAuthContent: ({ className, onLinkSuccess, ...props }: ManageAuthProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const ManageAuth: (props: ManageAuthProps) => import("react/jsx-runtime").JSX.Element;
9
+ export { ManageAuthContent as unstable_ManageAuthContent, ManageAuth as unstable_ManageAuth, type ManageAuthProps as unstable_ManageAuthProps, };
@@ -0,0 +1,51 @@
1
+ import { jsx as r, jsxs as p, Fragment as _ } from "react/jsx-runtime";
2
+ import { useLinkOAuth as d } from "@coinbase/cdp-hooks";
3
+ import { u as g } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
4
+ import { useCallback as A } from "react";
5
+ import { Error as f } from "../ui/Error/index.js";
6
+ import { unstable_ManageAuthItem as k } from "./ManageAuthItem.js";
7
+ import { unstable_useManageAuthContext as x, unstable_ManageAuthProvider as M } from "./ManageAuthProvider.js";
8
+ import "../CDPReactProvider/index.js";
9
+ import '../../assets/ManageAuth.css';const C = "ManageAuth-module__list___lVrdU", t = {
10
+ "manage-auth": "ManageAuth-module__manage-auth___4Hpt3",
11
+ list: C,
12
+ "error-wrapper": "ManageAuth-module__error-wrapper___a9Edn",
13
+ "error-text": "ManageAuth-module__error-text___43EOm"
14
+ }, E = ({ className: n = "", onLinkSuccess: o, ...u }) => {
15
+ const { manageAuthMethods: c, setMethodToLink: s, error: l, setError: i } = x(), { linkOAuth: m } = d(), h = A(
16
+ (e) => {
17
+ try {
18
+ if (e === "email")
19
+ s("email");
20
+ else if (e === "sms")
21
+ s("sms");
22
+ else if (e.startsWith("oauth:")) {
23
+ const a = e.replace("oauth:", "");
24
+ m(a);
25
+ } else
26
+ throw new Error(`Unsupported auth method: ${e}`);
27
+ o?.(e);
28
+ } catch (a) {
29
+ i(a instanceof Error ? a.message : "An unknown error occurred");
30
+ }
31
+ },
32
+ [m, o, i, s]
33
+ );
34
+ return /* @__PURE__ */ r("div", { className: `${t["manage-auth"]} ${n}`, ...u, children: /* @__PURE__ */ p(_, { children: [
35
+ l && /* @__PURE__ */ r("div", { className: t["error-wrapper"], children: /* @__PURE__ */ r(f, { role: "alert", children: /* @__PURE__ */ r("span", { className: t["error-text"], children: l }) }) }),
36
+ /* @__PURE__ */ r("ul", { className: t.list, children: c.map((e) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
37
+ k,
38
+ {
39
+ authMethod: e.method,
40
+ displayValue: e.displayValue,
41
+ isLinked: e.isLinked,
42
+ onLink: h
43
+ },
44
+ e.method
45
+ ) }, e.method)) })
46
+ ] }) });
47
+ }, V = (n) => (g("manage_auth"), /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(E, { ...n }) }));
48
+ export {
49
+ V as unstable_ManageAuth,
50
+ E as unstable_ManageAuthContent
51
+ };
@@ -0,0 +1,13 @@
1
+ import { AuthMethod as ConfiguredAuthMethod } from '../CDPReactProvider';
2
+ export type unstable_ManageAuthMethod = {
3
+ isLinked: boolean;
4
+ displayValue: string;
5
+ method: ConfiguredAuthMethod;
6
+ };
7
+ export interface unstable_ManageAuthState {
8
+ methodToLink: ConfiguredAuthMethod | null;
9
+ setMethodToLink: (method: ConfiguredAuthMethod) => void;
10
+ manageAuthMethods: unstable_ManageAuthMethod[];
11
+ error: string | null;
12
+ setError: (error: string | null) => void;
13
+ }
@@ -0,0 +1 @@
1
+ import "../CDPReactProvider/index.js";
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from 'react';
2
+ import { ButtonProps } from '../ui/Button';
3
+ import { ModalContentProps } from '../ui/Modal';
4
+ interface ManageAuthModalTriggerProps extends Partial<Pick<ButtonProps, "className" | "fullWidth" | "size" | "style" | "variant">> {
5
+ children?: ReactNode;
6
+ label?: ReactNode;
7
+ }
8
+ interface ManageAuthModalContentProps extends ModalContentProps {
9
+ onLinkSuccess?: (method: string) => void;
10
+ }
11
+ interface ManageAuthModalProps {
12
+ children?: ReactNode;
13
+ open?: boolean;
14
+ setIsOpen?: (value: boolean) => void;
15
+ onLinkSuccess?: (method: string) => void;
16
+ }
17
+ declare const ManageAuthModalTrigger: ({ children, className, label, ...props }: ManageAuthModalTriggerProps) => import("react/jsx-runtime").JSX.Element;
18
+ declare const ManageAuthModalContent: (props: ManageAuthModalContentProps) => import("react/jsx-runtime").JSX.Element;
19
+ declare const ManageAuthModal: ({ children, open, setIsOpen, onLinkSuccess }: ManageAuthModalProps) => import("react/jsx-runtime").JSX.Element;
20
+ export { ManageAuthModal as unstable_ManageAuthModal, ManageAuthModalContent as unstable_ManageAuthModalContent, ManageAuthModalTrigger as unstable_ManageAuthModalTrigger, type ManageAuthModalProps as unstable_ManageAuthModalProps, type ManageAuthModalContentProps as unstable_ManageAuthModalContentProps, type ManageAuthModalTriggerProps as unstable_ManageAuthModalTriggerProps, };
@@ -0,0 +1,53 @@
1
+ import { jsx as e, jsxs as o, Fragment as d } from "react/jsx-runtime";
2
+ import { u as p } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
3
+ import { createContext as A, useMemo as C, useContext as f } from "react";
4
+ import { unstable_ManageAuth as x } from "../ManageAuth/index.js";
5
+ import { Button as h } from "../ui/Button/index.js";
6
+ import { IconXMark as b } from "../../icons/IconXMark.js";
7
+ import "../CDPReactProvider/index.js";
8
+ import { Modal as T, ModalContent as k, ModalClose as v, ModalTrigger as w, ModalTitle as y, ModalDescription as L } from "../ui/Modal/index.js";
9
+ import { VisuallyHidden as D } from "../ui/VisuallyHidden/index.js";
10
+ import { childrenHasComponent as u } from "../../utils/childrenHasComponent.js";
11
+ import '../../assets/ManageAuthModal.css';const N = "ManageAuthModal-module__header___irbw4", V = "ManageAuthModal-module__title___2Z3vb", l = {
12
+ header: N,
13
+ title: V,
14
+ "close-icon": "ManageAuthModal-module__close-icon___WnVrd"
15
+ }, M = A(null), j = () => {
16
+ const a = f(M);
17
+ if (!a)
18
+ throw new Error("useManageAuthModalContext must be used within a ManageAuthModal");
19
+ return a;
20
+ }, c = ({
21
+ children: a,
22
+ className: t = "",
23
+ label: r,
24
+ ...n
25
+ }) => /* @__PURE__ */ e(w, { asChild: !0, children: a || /* @__PURE__ */ e(h, { className: t, ...n, children: r || "Link accounts" }) }), s = (a) => {
26
+ const { onLinkSuccess: t } = j();
27
+ return /* @__PURE__ */ o(k, { ...a, children: [
28
+ /* @__PURE__ */ e(H, {}),
29
+ /* @__PURE__ */ o("div", { className: l.header, children: [
30
+ /* @__PURE__ */ e("h2", { className: l.title, children: "Link a profile" }),
31
+ /* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(h, { "aria-label": "Close", size: "md", variant: "transparentSecondary", children: /* @__PURE__ */ e(b, { className: l["close-icon"] }) }) })
32
+ ] }),
33
+ /* @__PURE__ */ e(x, { onLinkSuccess: t })
34
+ ] });
35
+ }, X = ({ children: a, open: t, setIsOpen: r, onLinkSuccess: n }) => {
36
+ p("manage_auth_modal");
37
+ const m = a ? u(a, c) : !1, i = a ? u(a, s) : !1, g = !m && !i, _ = C(() => ({ onLinkSuccess: n }), [n]);
38
+ return /* @__PURE__ */ e(M.Provider, { value: _, children: /* @__PURE__ */ e(T, { open: t, onOpenChange: r, children: g ? /* @__PURE__ */ o(d, { children: [
39
+ /* @__PURE__ */ e(c, { children: a }),
40
+ /* @__PURE__ */ e(s, {})
41
+ ] }) : /* @__PURE__ */ o(d, { children: [
42
+ a,
43
+ !i && /* @__PURE__ */ e(s, {})
44
+ ] }) }) });
45
+ }, H = () => /* @__PURE__ */ o(D, { children: [
46
+ /* @__PURE__ */ e(y, { children: "Link a profile" }),
47
+ /* @__PURE__ */ e(L, { children: "Link additional authentication methods to your account" })
48
+ ] });
49
+ export {
50
+ X as unstable_ManageAuthModal,
51
+ s as unstable_ManageAuthModalContent,
52
+ c as unstable_ManageAuthModalTrigger
53
+ };
@@ -1,77 +1,78 @@
1
- import { jsx as s, jsxs as o, Fragment as l } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as e, 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 { u as C } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
5
- import { useState as I, useEffect as u, useRef as S, useCallback as b } from "react";
4
+ import { u as I } from "../../chunks/useSendComponentCallOnce.CUgcsUye.js";
5
+ import { useState as C, useEffect as u, useRef as g, useCallback as b } from "react";
6
6
  import { useProviderName as v } from "../CDPReactProvider/index.js";
7
- import { OAUTH_PROVIDER_SESSION_STORAGE_KEY as g } from "../SignIn/hooks/useSignInWithOAuth.js";
7
+ import { OAUTH_PROVIDER_SESSION_STORAGE_KEY as S } from "../SignIn/hooks/useSignInWithOAuth.js";
8
8
  import { CoinbaseFooter as T } from "../ui/CoinbaseFooter/index.js";
9
9
  import { LoadingSpinner as $ } from "../ui/LoadingSpinner/index.js";
10
10
  import { Modal as w, ModalContent as E, ModalTitle as P, ModalDescription as R } from "../ui/Modal/index.js";
11
11
  import { SwitchFadeTransition as y } from "../ui/SwitchFadeTransition/index.js";
12
12
  import { VisuallyHidden as f } from "../ui/VisuallyHidden/index.js";
13
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";
14
+ import { IconAppleLogo as x } from "../../icons/IconAppleLogo.js";
15
+ import { IconCheck as L } from "../../icons/IconCheck.js";
16
+ import { IconGoogleColorLogo as U } from "../../icons/IconGoogleColorLogo.js";
17
+ import { IconXLogo as q } from "../../icons/IconXLogo.js";
17
18
  import { IconXMark as G } from "../../icons/IconXMark.js";
18
19
  import { capitalize as d } from "../../utils/capitalize.js";
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 = {
20
+ import '../../assets/OAuthStatusModal.css';const H = "OAuthStatusModal-module__status___vU6x7", K = "OAuthStatusModal-module__graphic___2fKoa", j = "OAuthStatusModal-module__pad___oooMz", D = "OAuthStatusModal-module__spinner___Q3dYq", F = "OAuthStatusModal-module__icon___Lj5Gf", Y = "OAuthStatusModal-module__subhead___Pg9GI", z = "OAuthStatusModal-module__description___0qOZY", V = "OAuthStatusModal-module__ring___mKwSb", W = "OAuthStatusModal-module__invisible___IeRd0", t = {
20
21
  "oauth-status-modal": "OAuthStatusModal-module__oauth-status-modal___I69Ii",
21
22
  "transition-wrapper": "OAuthStatusModal-module__transition-wrapper___TmPRh",
22
23
  status: H,
23
24
  graphic: K,
24
- pad: L,
25
- spinner: j,
26
- icon: D,
25
+ pad: j,
26
+ spinner: D,
27
+ icon: F,
27
28
  "icon-success": "OAuthStatusModal-module__icon-success___gqMWr",
28
29
  "icon-error": "OAuthStatusModal-module__icon-error___psI7m",
29
- subhead: F,
30
- description: Y,
31
- ring: z,
30
+ subhead: Y,
31
+ description: z,
32
+ ring: V,
32
33
  "ring-success": "OAuthStatusModal-module__ring-success___unyM9",
33
34
  "ring-error": "OAuthStatusModal-module__ring-error___OsgqU",
34
- invisible: V
35
- }, W = ["pending", "success", "error"], Ot = () => {
36
- C("oauth_status_modal");
37
- const [n, e] = I(!1), { oauthState: r } = O(), a = v();
35
+ invisible: W
36
+ }, X = ["pending", "success", "error"], Mt = () => {
37
+ I("oauth_status_modal");
38
+ const [n, o] = C(!1), { oauthState: r } = O(), a = v();
38
39
  return u(() => {
39
40
  if (r?.status === "pending" || r?.status === "error" || r?.status === "success") {
40
- const c = sessionStorage.getItem(g);
41
+ const c = sessionStorage.getItem(S);
41
42
  if (c === null || c !== a)
42
43
  return;
43
- sessionStorage.removeItem(g), e(!0);
44
+ sessionStorage.removeItem(S), o(!0);
44
45
  }
45
- }, [r?.status, a]), /* @__PURE__ */ s(w, { open: n, onOpenChange: e, children: /* @__PURE__ */ o(E, { children: [
46
+ }, [r?.status, a]), /* @__PURE__ */ s(w, { open: n, onOpenChange: o, children: /* @__PURE__ */ e(E, { children: [
46
47
  /* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(P, { children: "OAuth Status" }) }),
47
- /* @__PURE__ */ s(f, { children: /* @__PURE__ */ o(R, { children: [
48
+ /* @__PURE__ */ s(f, { children: /* @__PURE__ */ e(R, { children: [
48
49
  "Sign in with ",
49
50
  d(a),
50
51
  " ",
51
52
  r?.status ? `${r?.status === "success" ? "successful" : r?.status === "error" ? "failed" : "pending"}` : ""
52
53
  ] }) }),
53
- /* @__PURE__ */ s(J, { handleClose: () => e(!1) })
54
+ /* @__PURE__ */ s(J, { handleClose: () => o(!1) })
54
55
  ] }) });
55
56
  }, 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) => {
57
- h.current === i || i === void 0 || (h.current = i, _.current?.transition.toggle(i));
57
+ const { oauthState: o } = O(), r = o?.providerType || "google", { timeRemaining: a, start: c, reset: m } = k(), _ = g(null), p = g(null), A = 250, h = b((i) => {
58
+ p.current === i || i === void 0 || (p.current = i, _.current?.transition.toggle(i));
58
59
  }, []);
59
60
  return u(() => {
60
- p(e?.status), e?.status === "success" && c(3);
61
- }, [e?.status, p, c]), u(() => {
61
+ h(o?.status), o?.status === "success" && c(3);
62
+ }, [o?.status, h, c]), u(() => {
62
63
  a !== null && a <= 0 && (m(), n());
63
- }, [a, m, n]), /* @__PURE__ */ o("div", { className: t["oauth-status-modal"], children: [
64
+ }, [a, m, n]), /* @__PURE__ */ e("div", { className: t["oauth-status-modal"], children: [
64
65
  /* @__PURE__ */ s(
65
66
  y,
66
67
  {
67
68
  animateHeight: !1,
68
69
  timeout: A,
69
- items: W,
70
+ items: X,
70
71
  initialEntered: !1,
71
72
  transitionRef: _,
72
73
  className: t["transition-wrapper"],
73
74
  children: ({ itemKey: i, ...M }) => {
74
- const N = B[i];
75
+ const N = tt[i];
75
76
  return /* @__PURE__ */ s("div", { ...M, className: t.status, children: /* @__PURE__ */ s(N, { timeRemaining: a, provider: r }) });
76
77
  }
77
78
  }
@@ -79,9 +80,9 @@ import '../../assets/OAuthStatusModal.css';const H = "OAuthStatusModal-module__s
79
80
  /* @__PURE__ */ s(T, {})
80
81
  ] });
81
82
  }, Q = ({ provider: n }) => {
82
- const e = tt[n];
83
- return /* @__PURE__ */ o(l, { children: [
84
- /* @__PURE__ */ o("div", { className: t.graphic, children: [
83
+ const o = st[n];
84
+ return /* @__PURE__ */ e(l, { children: [
85
+ /* @__PURE__ */ e("div", { className: t.graphic, children: [
85
86
  /* @__PURE__ */ s(
86
87
  $,
87
88
  {
@@ -91,44 +92,45 @@ import '../../assets/OAuthStatusModal.css';const H = "OAuthStatusModal-module__s
91
92
  className: t.spinner
92
93
  }
93
94
  ),
94
- e && /* @__PURE__ */ s("span", { className: t.icon, children: /* @__PURE__ */ s(e, {}) })
95
+ o && /* @__PURE__ */ s("span", { className: t.icon, children: /* @__PURE__ */ s(o, {}) })
95
96
  ] }),
96
- /* @__PURE__ */ o("p", { className: t.subhead, children: [
97
+ /* @__PURE__ */ e("p", { className: t.subhead, children: [
97
98
  "Signing in with ",
98
99
  d(n)
99
100
  ] }),
100
101
  /* @__PURE__ */ s("p", { className: t.description, children: "Just a moment..." })
101
102
  ] });
102
- }, X = ({ timeRemaining: n, provider: e }) => /* @__PURE__ */ o(l, { children: [
103
- /* @__PURE__ */ o("div", { className: t.graphic, children: [
103
+ }, Z = ({ timeRemaining: n, provider: o }) => /* @__PURE__ */ e(l, { children: [
104
+ /* @__PURE__ */ e("div", { className: t.graphic, children: [
104
105
  /* @__PURE__ */ s("span", { className: `${t.ring} ${t["ring-success"]}` }),
105
- /* @__PURE__ */ s("span", { className: `${t.icon} ${t["icon-success"]}`, children: /* @__PURE__ */ s(q, {}) })
106
+ /* @__PURE__ */ s("span", { className: `${t.icon} ${t["icon-success"]}`, children: /* @__PURE__ */ s(L, {}) })
106
107
  ] }),
107
- /* @__PURE__ */ o("p", { className: t.subhead, children: [
108
+ /* @__PURE__ */ e("p", { className: t.subhead, children: [
108
109
  "Signed in with ",
109
- d(e)
110
+ d(o)
110
111
  ] }),
111
- /* @__PURE__ */ o("p", { className: `${t.description} ${n === null ? t.invisible : ""}`, children: [
112
+ /* @__PURE__ */ e("p", { className: `${t.description} ${n === null ? t.invisible : ""}`, children: [
112
113
  "This window will automatically close in ",
113
114
  n ?? "soon"
114
115
  ] })
115
- ] }), Z = () => /* @__PURE__ */ o(l, { children: [
116
- /* @__PURE__ */ o("div", { className: `${t.graphic} ${t.pad}`, children: [
116
+ ] }), B = () => /* @__PURE__ */ e(l, { children: [
117
+ /* @__PURE__ */ e("div", { className: `${t.graphic} ${t.pad}`, children: [
117
118
  /* @__PURE__ */ s("span", { className: `${t.ring} ${t["ring-error"]}` }),
118
119
  /* @__PURE__ */ s("span", { className: `${t.icon} ${t["icon-error"]}`, children: /* @__PURE__ */ s(G, {}) })
119
120
  ] }),
120
121
  /* @__PURE__ */ s("p", { className: t.subhead, children: "Sign in failed" }),
121
122
  /* @__PURE__ */ s("p", { className: t.description, children: "Something went wrong. Please try again." })
122
- ] }), B = {
123
+ ] }), tt = {
123
124
  pending: Q,
124
- success: X,
125
- error: Z
126
- }, tt = {
127
- google: x,
128
- apple: U
125
+ success: Z,
126
+ error: B
127
+ }, st = {
128
+ google: U,
129
+ apple: x,
130
+ x: q
129
131
  };
130
132
  export {
131
- Ot as OAuthStatusModal,
133
+ Mt as OAuthStatusModal,
132
134
  J as OAuthStatusModalContent,
133
- Ot as default
135
+ Mt as default
134
136
  };
@@ -1,21 +1,22 @@
1
1
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
2
2
  import { useCallback as I, useMemo as v } from "react";
3
3
  import { useAppConfig as y } from "../CDPReactProvider/index.js";
4
- import { useSignInWithOAuth as S } from "./hooks/useSignInWithOAuth.js";
5
- import { useSignInContext as C } from "./SignInProvider.js";
4
+ import { useSignInWithOAuth as C } from "./hooks/useSignInWithOAuth.js";
5
+ import { useSignInContext as S } from "./SignInProvider.js";
6
6
  import { Button as M } from "../ui/Button/index.js";
7
7
  import { ServerError as k } from "../ui/ServerError/index.js";
8
8
  import { IconAppleLogo as B } from "../../icons/IconAppleLogo.js";
9
9
  import { IconEnvelope as E } from "../../icons/IconEnvelope.js";
10
10
  import { IconGoogleLogo as P } from "../../icons/IconGoogleLogo.js";
11
11
  import { IconPhone as O } from "../../icons/IconPhone.js";
12
+ import { IconXLogo as w } from "../../icons/IconXLogo.js";
12
13
  import { toOAuthProviderType as _ } from "../../utils/toOAuthProviderType.js";
13
- import '../../assets/SignInAuthMethodButtons.css';const N = "SignInAuthMethodButtons-module__divider___zphEh", o = {
14
+ import '../../assets/SignInAuthMethodButtons.css';const x = "SignInAuthMethodButtons-module__divider___zphEh", o = {
14
15
  "auth-method-buttons": "SignInAuthMethodButtons-module__auth-method-buttons___jYEH7",
15
16
  "auth-btn": "SignInAuthMethodButtons-module__auth-btn___o1a09",
16
17
  "auth-btn-icon": "SignInAuthMethodButtons-module__auth-btn-icon___VjvFY",
17
18
  "auth-btn-label": "SignInAuthMethodButtons-module__auth-btn-label___mEWd3",
18
- divider: N
19
+ divider: x
19
20
  }, b = {
20
21
  email: {
21
22
  label: "Continue with email",
@@ -32,37 +33,41 @@ import '../../assets/SignInAuthMethodButtons.css';const N = "SignInAuthMethodBut
32
33
  "oauth:apple": {
33
34
  label: "Continue with Apple",
34
35
  icon: /* @__PURE__ */ n(B, {})
36
+ },
37
+ "oauth:x": {
38
+ label: "Continue with X",
39
+ icon: /* @__PURE__ */ n(w, {})
35
40
  }
36
- }, U = ({ activeMethod: u }) => {
41
+ }, V = ({ activeMethod: u }) => {
37
42
  const { authMethods: a } = y(), {
38
43
  signInWithOAuth: l,
39
44
  isPending: s,
40
45
  error: h,
41
46
  oauthProvider: c
42
- } = S(), p = I(
47
+ } = C(), m = I(
43
48
  async (t) => {
44
- const i = _(t);
45
- i && l(i);
49
+ const e = _(t);
50
+ e && l(e);
46
51
  },
47
52
  [l]
48
- ), { dispatch: d } = C(), e = v(() => (a || ["email"]).map((t) => {
53
+ ), { dispatch: p } = S(), i = v(() => (a || ["email"]).map((t) => {
49
54
  if (!b[t])
50
55
  return null;
51
- const { label: i, icon: g } = b[t], m = t.startsWith("oauth:"), f = m ? () => p(t) : () => d({ type: "SET_AUTH_METHOD", payload: { authMethod: t } }), A = m && c.current === _(t) && s;
56
+ const { label: e, icon: g } = b[t], d = t.startsWith("oauth:"), f = d ? () => m(t) : () => p({ type: "SET_AUTH_METHOD", payload: { authMethod: t } }), A = d && c.current === _(t) && s;
52
57
  return {
53
58
  key: t,
54
- label: i,
59
+ label: e,
55
60
  icon: g,
56
61
  onClick: f,
57
62
  isPending: A
58
63
  };
59
- }).filter((t) => t !== null), [a, d, p, s, c]);
60
- return !e.length || e.length === 1 && e[0].key === u ? null : /* @__PURE__ */ r("div", { className: o["auth-method-buttons"], children: [
64
+ }).filter((t) => t !== null), [a, p, m, s, c]);
65
+ return !i.length || i.length === 1 && i[0].key === u ? null : /* @__PURE__ */ r("div", { className: o["auth-method-buttons"], children: [
61
66
  /* @__PURE__ */ r("div", { className: o.divider, children: [
62
67
  /* @__PURE__ */ n("hr", {}),
63
68
  /* @__PURE__ */ n("span", { children: "or" })
64
69
  ] }),
65
- e.map((t) => t.key === u ? null : /* @__PURE__ */ r(
70
+ i.map((t) => t.key === u ? null : /* @__PURE__ */ r(
66
71
  M,
67
72
  {
68
73
  "aria-label": t.ariaLabel,
@@ -82,5 +87,5 @@ import '../../assets/SignInAuthMethodButtons.css';const N = "SignInAuthMethodBut
82
87
  ] });
83
88
  };
84
89
  export {
85
- U as SignInAuthMethodButtons
90
+ V as SignInAuthMethodButtons
86
91
  };
@@ -0,0 +1,2 @@
1
+ import { SVGProps } from 'react';
2
+ export declare const IconMinus: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "react";
3
+ import { SvgIcon as i } from "./SvgIcon.js";
4
+ const l = (r) => /* @__PURE__ */ o(i, { width: "12", height: "2", viewBox: "0 0 12 2", fill: "currentColor", ...r, children: /* @__PURE__ */ o("path", { d: "M12 1.2H0V0H12V1.2Z", fill: "#5B616E" }) });
5
+ export {
6
+ l as IconMinus
7
+ };
@@ -0,0 +1,2 @@
1
+ import { SVGProps } from 'react';
2
+ export declare const IconPlus: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "react";
3
+ import { SvgIcon as t } from "./SvgIcon.js";
4
+ const H = (r) => /* @__PURE__ */ o(t, { width: "10", height: "10", viewBox: "0 0 10 10", fill: "currentColor", ...r, children: /* @__PURE__ */ o("path", { d: "M4.19995 5.79995V10H5.79995V5.79995H10V4.19995H5.79995V0H4.19995V4.19995H0V5.79995H4.19995Z" }) });
5
+ export {
6
+ H as IconPlus
7
+ };
@@ -0,0 +1,2 @@
1
+ import { SVGProps } from 'react';
2
+ export declare const IconXLogo: (props: Omit<SVGProps<SVGSVGElement>, "viewBox">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "react";
3
+ import { SvgIcon as r } from "./SvgIcon.js";
4
+ const e = (L) => /* @__PURE__ */ o(r, { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", ...L, children: /* @__PURE__ */ o(
5
+ "path",
6
+ {
7
+ fill: "currentColor",
8
+ d: "M8.92704 6.34822L14.5111 0H13.1879L8.33921 5.51207L4.4666 0H0L5.85615 8.33522L0 14.9923H1.32333L6.44364 9.17137L10.5334 14.9923H15L8.92671 6.34822H8.92704ZM7.11456 8.40866L6.52121 7.57866L1.80014 0.974259H3.83269L7.64265 6.30422L8.236 7.13422L13.1885 14.0623H11.156L7.11456 8.40897V8.40866Z"
9
+ }
10
+ ) });
11
+ export {
12
+ e as IconXLogo
13
+ };
@@ -1,3 +1,4 @@
1
+ export * from './IconAppleLogo';
1
2
  export * from './IconArrowLeft';
2
3
  export * from './IconArrowsUpDown';
3
4
  export * from './IconCheck';
@@ -6,6 +7,9 @@ export * from './IconChevronDown';
6
7
  export * from './IconEnvelope';
7
8
  export * from './IconExclamationCircle';
8
9
  export * from './IconExclamationTriangle';
10
+ export * from './IconGoogleLogo';
9
11
  export * from './IconLock';
10
12
  export * from './IconPhone';
11
13
  export * from './IconXMark';
14
+ export * from './IconMinus';
15
+ export * from './IconPlus';
@@ -1,24 +1,32 @@
1
- import { IconArrowLeft as e } from "./IconArrowLeft.js";
2
- import { IconArrowsUpDown as c } from "./IconArrowsUpDown.js";
3
- import { IconCheck as m } from "./IconCheck.js";
4
- import { IconCheckCircle as x } from "./IconCheckCircle.js";
5
- import { IconChevronDown as I } from "./IconChevronDown.js";
6
- import { IconEnvelope as l } from "./IconEnvelope.js";
7
- import { IconExclamationCircle as C } from "./IconExclamationCircle.js";
8
- import { IconExclamationTriangle as k } from "./IconExclamationTriangle.js";
1
+ import { IconAppleLogo as e } from "./IconAppleLogo.js";
2
+ import { IconArrowLeft as c } from "./IconArrowLeft.js";
3
+ import { IconArrowsUpDown as t } from "./IconArrowsUpDown.js";
4
+ import { IconCheck as x } from "./IconCheck.js";
5
+ import { IconCheckCircle as I } from "./IconCheckCircle.js";
6
+ import { IconChevronDown as a } from "./IconChevronDown.js";
7
+ import { IconEnvelope as C } from "./IconEnvelope.js";
8
+ import { IconExclamationCircle as h } from "./IconExclamationCircle.js";
9
+ import { IconExclamationTriangle as w } from "./IconExclamationTriangle.js";
10
+ import { IconGoogleLogo as s } from "./IconGoogleLogo.js";
9
11
  import { IconLock as E } from "./IconLock.js";
10
- import { IconPhone as A } from "./IconPhone.js";
11
- import { IconXMark as L } from "./IconXMark.js";
12
+ import { IconPhone as v } from "./IconPhone.js";
13
+ import { IconXMark as M } from "./IconXMark.js";
14
+ import { IconMinus as G } from "./IconMinus.js";
15
+ import { IconPlus as U } from "./IconPlus.js";
12
16
  export {
13
- e as IconArrowLeft,
14
- c as IconArrowsUpDown,
15
- m as IconCheck,
16
- x as IconCheckCircle,
17
- I as IconChevronDown,
18
- l as IconEnvelope,
19
- C as IconExclamationCircle,
20
- k as IconExclamationTriangle,
17
+ e as IconAppleLogo,
18
+ c as IconArrowLeft,
19
+ t as IconArrowsUpDown,
20
+ x as IconCheck,
21
+ I as IconCheckCircle,
22
+ a as IconChevronDown,
23
+ C as IconEnvelope,
24
+ h as IconExclamationCircle,
25
+ w as IconExclamationTriangle,
26
+ s as IconGoogleLogo,
21
27
  E as IconLock,
22
- A as IconPhone,
23
- L as IconXMark
28
+ G as IconMinus,
29
+ v as IconPhone,
30
+ U as IconPlus,
31
+ M as IconXMark
24
32
  };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,8 @@ export * from './components/AuthButton';
2
2
  export * from './components/CDPReactProvider';
3
3
  export * from './components/Fund';
4
4
  export * from './components/FundModal';
5
+ export * from './components/ManageAuth';
6
+ export * from './components/ManageAuthModal';
5
7
  export * from './components/SendEvmTransactionButton';
6
8
  export * from './components/SendSolanaTransactionButton';
7
9
  export * from './components/SignIn';
package/dist/index.js CHANGED
@@ -1,117 +1,134 @@
1
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
- import { Fund as s, FundFooter as c } from "./components/Fund/index.js";
4
- import { FundModal as l, FundModalContent as u, FundModalTrigger as I } from "./components/FundModal/index.js";
5
- import { SendEvmTransactionButton as S } from "./components/SendEvmTransactionButton/index.js";
6
- import { SendSolanaTransactionButton as M } from "./components/SendSolanaTransactionButton/index.js";
7
- import { SignIn as F } from "./components/SignIn/index.js";
8
- import { useSignInReducer as A } from "./components/SignIn/useSignInReducer.js";
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
- import { ThemeProvider as O, useTheme as P } from "./components/ThemeProvider/index.js";
12
- import { Button as R } from "./components/ui/Button/index.js";
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";
14
- import { cssVariables as y } from "./theme/cssVariables.js";
15
- import { theme as G } from "./theme/theme.js";
16
- import { borderRadius as K, borderRadiusComponents as Q, borderRadiusSemantic as W, colors as Y, colorsBase as Z, colorsComponents as $, colorsSemantic as oo, font as ro, fontComponents as eo, fontSemantic as to, tokens as no } from "./theme/tokens.js";
17
- import { flattenTokensObject as po, themeToCssVariables as fo } from "./theme/utils.js";
18
- import { IconArrowLeft as xo } from "./icons/IconArrowLeft.js";
19
- import { IconArrowsUpDown as so } from "./icons/IconArrowsUpDown.js";
20
- import { IconCheck as lo } from "./icons/IconCheck.js";
21
- import { IconCheckCircle as Io } from "./icons/IconCheckCircle.js";
22
- import { IconChevronDown as So } from "./icons/IconChevronDown.js";
23
- import { IconEnvelope as Mo } from "./icons/IconEnvelope.js";
24
- import { IconExclamationCircle as Fo } from "./icons/IconExclamationCircle.js";
25
- import { IconExclamationTriangle as Ao } from "./icons/IconExclamationTriangle.js";
26
- import { IconLock as Bo } from "./icons/IconLock.js";
27
- import { IconPhone as Do } from "./icons/IconPhone.js";
28
- import { IconXMark as vo } from "./icons/IconXMark.js";
29
- import { clamp as Oo } from "./utils/clamp.js";
30
- import { getMessageFromUnknownError as wo } from "./utils/getMessageFromUnknownError.js";
31
- import { isApiError as Uo } from "./utils/isApiError.js";
32
- import { isEmailInvalid as _o } from "./utils/isEmailInvalid.js";
33
- import { parseValuesFromPhoneNumber as No } from "./utils/parseValuesFromPhoneNumber.js";
34
- import { FundForm as Xo } from "./components/Fund/FundForm.js";
35
- import { FundTitle as yo } from "./components/Fund/FundTitle.js";
36
- import { useFundContext as Go } from "./components/Fund/FundProvider.js";
37
- import { SignInAuthMethodButtons as Ko } from "./components/SignIn/SignInAuthMethodButtons.js";
38
- import { SignInBackButton as Wo } from "./components/SignIn/SignInBackButton.js";
39
- import { SignInDescription as Zo } from "./components/SignIn/SignInDescription.js";
40
- import { SignInFooter as or } from "./components/SignIn/SignInFooter.js";
41
- import { SignInForm as er } from "./components/SignIn/SignInForm.js";
42
- import { SignInImage as nr } from "./components/SignIn/SignInImage.js";
43
- import { SignInTitle as pr } from "./components/SignIn/SignInTitle.js";
44
- import { useSignInContext as ir } from "./components/SignIn/SignInProvider.js";
2
+ import { ALL_AUTH_METHODS as n, AUTH_METHODS as m, CDPReactProvider as a, OAUTH_METHODS as p, useAppConfig as f, useProviderName as x } from "./components/CDPReactProvider/index.js";
3
+ import { Fund as l, FundFooter as s } from "./components/Fund/index.js";
4
+ import { FundModal as c, FundModalContent as d, FundModalTrigger as g } from "./components/FundModal/index.js";
5
+ import { unstable_ManageAuth as M, unstable_ManageAuthContent as S } from "./components/ManageAuth/index.js";
6
+ import { unstable_ManageAuthItem as C } from "./components/ManageAuth/ManageAuthItem.js";
7
+ import { unstable_ManageAuthModal as A, unstable_ManageAuthModalContent as F, unstable_ManageAuthModalTrigger as b } from "./components/ManageAuthModal/index.js";
8
+ import { SendEvmTransactionButton as _ } from "./components/SendEvmTransactionButton/index.js";
9
+ import { SendSolanaTransactionButton as k } from "./components/SendSolanaTransactionButton/index.js";
10
+ import { SignIn as v } from "./components/SignIn/index.js";
11
+ import { useSignInReducer as H } from "./components/SignIn/useSignInReducer.js";
12
+ import { SignInModal as O, SignInModalContent as w, SignInModalTrigger as R } from "./components/SignInModal/index.js";
13
+ import { SignOutButton as V } from "./components/SignOutButton/index.js";
14
+ import { ThemeProvider as j, useTheme as G } from "./components/ThemeProvider/index.js";
15
+ import { Button as q } from "./components/ui/Button/index.js";
16
+ import { Modal as z, ModalClose as J, ModalContent as K, ModalDescription as Q, ModalTitle as W, ModalTrigger as Y } from "./components/ui/Modal/index.js";
17
+ import { cssVariables as $ } from "./theme/cssVariables.js";
18
+ import { theme as ro } from "./theme/theme.js";
19
+ import { borderRadius as to, borderRadiusComponents as no, borderRadiusSemantic as mo, colors as ao, colorsBase as po, colorsComponents as fo, colorsSemantic as xo, font as io, fontComponents as lo, fontSemantic as so, tokens as uo } from "./theme/tokens.js";
20
+ import { flattenTokensObject as go, themeToCssVariables as Io } from "./theme/utils.js";
21
+ import { IconAppleLogo as So } from "./icons/IconAppleLogo.js";
22
+ import { IconArrowLeft as Co } from "./icons/IconArrowLeft.js";
23
+ import { IconArrowsUpDown as Ao } from "./icons/IconArrowsUpDown.js";
24
+ import { IconCheck as bo } from "./icons/IconCheck.js";
25
+ import { IconCheckCircle as _o } from "./icons/IconCheckCircle.js";
26
+ import { IconChevronDown as ko } from "./icons/IconChevronDown.js";
27
+ import { IconEnvelope as vo } from "./icons/IconEnvelope.js";
28
+ import { IconExclamationCircle as Ho } from "./icons/IconExclamationCircle.js";
29
+ import { IconExclamationTriangle as Oo } from "./icons/IconExclamationTriangle.js";
30
+ import { IconGoogleLogo as Ro } from "./icons/IconGoogleLogo.js";
31
+ import { IconLock as Vo } from "./icons/IconLock.js";
32
+ import { IconPhone as jo } from "./icons/IconPhone.js";
33
+ import { IconXMark as Xo } from "./icons/IconXMark.js";
34
+ import { IconMinus as yo } from "./icons/IconMinus.js";
35
+ import { IconPlus as Jo } from "./icons/IconPlus.js";
36
+ import { clamp as Qo } from "./utils/clamp.js";
37
+ import { getMessageFromUnknownError as Yo } from "./utils/getMessageFromUnknownError.js";
38
+ import { isApiError as $o } from "./utils/isApiError.js";
39
+ import { isEmailInvalid as rr } from "./utils/isEmailInvalid.js";
40
+ import { parseValuesFromPhoneNumber as tr } from "./utils/parseValuesFromPhoneNumber.js";
41
+ import { FundForm as mr } from "./components/Fund/FundForm.js";
42
+ import { FundTitle as pr } from "./components/Fund/FundTitle.js";
43
+ import { useFundContext as xr } from "./components/Fund/FundProvider.js";
44
+ import { SignInAuthMethodButtons as lr } from "./components/SignIn/SignInAuthMethodButtons.js";
45
+ import { SignInBackButton as ur } from "./components/SignIn/SignInBackButton.js";
46
+ import { SignInDescription as dr } from "./components/SignIn/SignInDescription.js";
47
+ import { SignInFooter as Ir } from "./components/SignIn/SignInFooter.js";
48
+ import { SignInForm as Sr } from "./components/SignIn/SignInForm.js";
49
+ import { SignInImage as Cr } from "./components/SignIn/SignInImage.js";
50
+ import { SignInTitle as Ar } from "./components/SignIn/SignInTitle.js";
51
+ import { useSignInContext as br } from "./components/SignIn/SignInProvider.js";
45
52
  export {
46
53
  n as ALL_AUTH_METHODS,
47
54
  m as AUTH_METHODS,
48
55
  e as AuthButton,
49
- R as Button,
50
- p as CDPReactProvider,
51
- s as Fund,
52
- c as FundFooter,
53
- Xo as FundForm,
54
- l as FundModal,
55
- u as FundModalContent,
56
- I as FundModalTrigger,
57
- yo as FundTitle,
58
- xo as IconArrowLeft,
59
- so as IconArrowsUpDown,
60
- lo as IconCheck,
61
- Io as IconCheckCircle,
62
- So as IconChevronDown,
63
- Mo as IconEnvelope,
64
- Fo as IconExclamationCircle,
65
- Ao as IconExclamationTriangle,
66
- Bo as IconLock,
67
- Do as IconPhone,
68
- vo as IconXMark,
69
- L as Modal,
70
- _ as ModalClose,
71
- V as ModalContent,
72
- N as ModalDescription,
73
- j as ModalTitle,
74
- X as ModalTrigger,
75
- f as OAUTH_METHODS,
76
- S as SendEvmTransactionButton,
77
- M as SendSolanaTransactionButton,
78
- F as SignIn,
79
- Ko as SignInAuthMethodButtons,
80
- Wo as SignInBackButton,
81
- Zo as SignInDescription,
82
- or as SignInFooter,
83
- er as SignInForm,
84
- nr as SignInImage,
85
- B as SignInModal,
86
- k as SignInModalContent,
87
- D as SignInModalTrigger,
88
- pr as SignInTitle,
89
- v as SignOutButton,
90
- O as ThemeProvider,
91
- K as borderRadius,
92
- Q as borderRadiusComponents,
93
- W as borderRadiusSemantic,
94
- Oo as clamp,
95
- Y as colors,
96
- Z as colorsBase,
97
- $ as colorsComponents,
98
- oo as colorsSemantic,
99
- y as cssVariables,
100
- po as flattenTokensObject,
101
- ro as font,
102
- eo as fontComponents,
103
- to as fontSemantic,
104
- wo as getMessageFromUnknownError,
105
- Uo as isApiError,
106
- _o as isEmailInvalid,
107
- No as parseValuesFromPhoneNumber,
108
- G as theme,
109
- fo as themeToCssVariables,
110
- no as tokens,
111
- i as useAppConfig,
112
- Go as useFundContext,
56
+ q as Button,
57
+ a as CDPReactProvider,
58
+ l as Fund,
59
+ s as FundFooter,
60
+ mr as FundForm,
61
+ c as FundModal,
62
+ d as FundModalContent,
63
+ g as FundModalTrigger,
64
+ pr as FundTitle,
65
+ So as IconAppleLogo,
66
+ Co as IconArrowLeft,
67
+ Ao as IconArrowsUpDown,
68
+ bo as IconCheck,
69
+ _o as IconCheckCircle,
70
+ ko as IconChevronDown,
71
+ vo as IconEnvelope,
72
+ Ho as IconExclamationCircle,
73
+ Oo as IconExclamationTriangle,
74
+ Ro as IconGoogleLogo,
75
+ Vo as IconLock,
76
+ yo as IconMinus,
77
+ jo as IconPhone,
78
+ Jo as IconPlus,
79
+ Xo as IconXMark,
80
+ z as Modal,
81
+ J as ModalClose,
82
+ K as ModalContent,
83
+ Q as ModalDescription,
84
+ W as ModalTitle,
85
+ Y as ModalTrigger,
86
+ p as OAUTH_METHODS,
87
+ _ as SendEvmTransactionButton,
88
+ k as SendSolanaTransactionButton,
89
+ v as SignIn,
90
+ lr as SignInAuthMethodButtons,
91
+ ur as SignInBackButton,
92
+ dr as SignInDescription,
93
+ Ir as SignInFooter,
94
+ Sr as SignInForm,
95
+ Cr as SignInImage,
96
+ O as SignInModal,
97
+ w as SignInModalContent,
98
+ R as SignInModalTrigger,
99
+ Ar as SignInTitle,
100
+ V as SignOutButton,
101
+ j as ThemeProvider,
102
+ to as borderRadius,
103
+ no as borderRadiusComponents,
104
+ mo as borderRadiusSemantic,
105
+ Qo as clamp,
106
+ ao as colors,
107
+ po as colorsBase,
108
+ fo as colorsComponents,
109
+ xo as colorsSemantic,
110
+ $ as cssVariables,
111
+ go as flattenTokensObject,
112
+ io as font,
113
+ lo as fontComponents,
114
+ so as fontSemantic,
115
+ Yo as getMessageFromUnknownError,
116
+ $o as isApiError,
117
+ rr as isEmailInvalid,
118
+ tr as parseValuesFromPhoneNumber,
119
+ ro as theme,
120
+ Io as themeToCssVariables,
121
+ uo as tokens,
122
+ M as unstable_ManageAuth,
123
+ S as unstable_ManageAuthContent,
124
+ C as unstable_ManageAuthItem,
125
+ A as unstable_ManageAuthModal,
126
+ F as unstable_ManageAuthModalContent,
127
+ b as unstable_ManageAuthModalTrigger,
128
+ f as useAppConfig,
129
+ xr as useFundContext,
113
130
  x as useProviderName,
114
- ir as useSignInContext,
115
- A as useSignInReducer,
116
- P as useTheme
131
+ br as useSignInContext,
132
+ H as useSignInReducer,
133
+ G as useTheme
117
134
  };
@@ -403,6 +403,13 @@ export declare const theme: Flattened<{
403
403
  readonly secondary: {
404
404
  readonly value: "#eef0f3";
405
405
  };
406
+ readonly negativeWash: {
407
+ readonly value: "{colors.fg.negative}";
408
+ readonly modify: {
409
+ readonly type: "color-mix";
410
+ readonly value: readonly [readonly ["{colors.bg.default}", "90%"]];
411
+ };
412
+ };
406
413
  };
407
414
  readonly fg: {
408
415
  readonly default: {
@@ -420,6 +427,9 @@ export declare const theme: Flattened<{
420
427
  readonly onSecondary: {
421
428
  readonly value: "#0a0b0d";
422
429
  };
430
+ readonly onNegativeWash: {
431
+ readonly value: "{colors.fg.default}";
432
+ };
423
433
  readonly positive: {
424
434
  readonly value: "#098551";
425
435
  };
@@ -44,6 +44,13 @@ export declare const colorsSemantic: {
44
44
  readonly secondary: {
45
45
  readonly value: "#eef0f3";
46
46
  };
47
+ readonly negativeWash: {
48
+ readonly value: "{colors.fg.negative}";
49
+ readonly modify: {
50
+ readonly type: "color-mix";
51
+ readonly value: readonly [readonly ["{colors.bg.default}", "90%"]];
52
+ };
53
+ };
47
54
  };
48
55
  readonly fg: {
49
56
  readonly default: {
@@ -61,6 +68,9 @@ export declare const colorsSemantic: {
61
68
  readonly onSecondary: {
62
69
  readonly value: "#0a0b0d";
63
70
  };
71
+ readonly onNegativeWash: {
72
+ readonly value: "{colors.fg.default}";
73
+ };
64
74
  readonly positive: {
65
75
  readonly value: "#098551";
66
76
  };
@@ -738,6 +748,13 @@ export declare const colors: {
738
748
  readonly secondary: {
739
749
  readonly value: "#eef0f3";
740
750
  };
751
+ readonly negativeWash: {
752
+ readonly value: "{colors.fg.negative}";
753
+ readonly modify: {
754
+ readonly type: "color-mix";
755
+ readonly value: readonly [readonly ["{colors.bg.default}", "90%"]];
756
+ };
757
+ };
741
758
  };
742
759
  readonly fg: {
743
760
  readonly default: {
@@ -755,6 +772,9 @@ export declare const colors: {
755
772
  readonly onSecondary: {
756
773
  readonly value: "#0a0b0d";
757
774
  };
775
+ readonly onNegativeWash: {
776
+ readonly value: "{colors.fg.default}";
777
+ };
758
778
  readonly positive: {
759
779
  readonly value: "#098551";
760
780
  };
@@ -1396,6 +1416,13 @@ export declare const tokens: {
1396
1416
  readonly secondary: {
1397
1417
  readonly value: "#eef0f3";
1398
1418
  };
1419
+ readonly negativeWash: {
1420
+ readonly value: "{colors.fg.negative}";
1421
+ readonly modify: {
1422
+ readonly type: "color-mix";
1423
+ readonly value: readonly [readonly ["{colors.bg.default}", "90%"]];
1424
+ };
1425
+ };
1399
1426
  };
1400
1427
  readonly fg: {
1401
1428
  readonly default: {
@@ -1413,6 +1440,9 @@ export declare const tokens: {
1413
1440
  readonly onSecondary: {
1414
1441
  readonly value: "#0a0b0d";
1415
1442
  };
1443
+ readonly onNegativeWash: {
1444
+ readonly value: "{colors.fg.default}";
1445
+ };
1416
1446
  readonly positive: {
1417
1447
  readonly value: "#098551";
1418
1448
  };
@@ -29,8 +29,12 @@ const e = {
29
29
  // skeleton background
30
30
  primary: { value: e.blue500 },
31
31
  // primary color background
32
- secondary: { value: e.gray100 }
32
+ secondary: { value: e.gray100 },
33
33
  // secondary color background
34
+ negativeWash: {
35
+ value: "{colors.fg.negative}",
36
+ modify: { type: "color-mix", value: [["{colors.bg.default}", "90%"]] }
37
+ }
34
38
  },
35
39
  fg: {
36
40
  default: { value: e.black },
@@ -43,6 +47,8 @@ const e = {
43
47
  // text on primary color
44
48
  onSecondary: { value: e.black },
45
49
  // text on secondary color
50
+ onNegativeWash: { value: "{colors.fg.default}" },
51
+ // text on negative wash color
46
52
  positive: { value: e.green500 },
47
53
  // positive color text
48
54
  negative: { value: e.red500 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-react",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
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.53",
20
- "@coinbase/cdp-hooks": "^0.0.53"
19
+ "@coinbase/cdp-core": "^0.0.55",
20
+ "@coinbase/cdp-hooks": "^0.0.55"
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.53",
51
- "@coinbase/cdp-hooks": "^0.0.53"
50
+ "@coinbase/cdp-core": "^0.0.55",
51
+ "@coinbase/cdp-hooks": "^0.0.55"
52
52
  },
53
53
  "size-limit": [
54
54
  {