@coinbase/cdp-react 0.0.58 → 0.0.61
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 +10 -8
- package/dist/assets/Banner.css +1 -0
- package/dist/assets/CopyAddress.css +1 -0
- package/dist/assets/ExportWallet.css +1 -0
- package/dist/assets/ExportWalletModal.css +1 -0
- package/dist/assets/IframeButton.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/LinkAuth.css +1 -0
- package/dist/assets/LinkAuthFlow.css +1 -0
- package/dist/assets/LinkAuthFlowBackButton.css +1 -0
- package/dist/assets/LinkAuthItem.css +1 -0
- package/dist/assets/LinkAuthItems.css +1 -0
- package/dist/assets/LinkAuthModal.css +1 -0
- package/dist/assets/LinkAuthTitle.css +1 -0
- package/dist/assets/SwitchSlideTransition.css +1 -1
- package/dist/chunks/LinkAuthFlow.CxSnHF2p.js +111 -0
- package/dist/components/CDPReactProvider/index.js +71 -55
- package/dist/components/CopyAddress/index.d.ts +8 -0
- package/dist/components/CopyAddress/index.js +61 -0
- package/dist/components/CopyEvmKeyButton/index.d.ts +13 -0
- package/dist/components/CopyEvmKeyButton/index.js +61 -0
- package/dist/components/CopySolanaKeyButton/index.d.ts +13 -0
- package/dist/components/CopySolanaKeyButton/index.js +61 -0
- package/dist/components/ExportWallet/index.d.ts +21 -0
- package/dist/components/ExportWallet/index.js +110 -0
- package/dist/components/ExportWalletModal/index.d.ts +18 -0
- package/dist/components/ExportWalletModal/index.js +96 -0
- package/dist/components/LinkAuth/LinkAuthFlow.d.ts +13 -0
- package/dist/components/LinkAuth/LinkAuthFlow.js +19 -0
- package/dist/components/LinkAuth/LinkAuthFlowBackButton.d.ts +9 -0
- package/dist/components/LinkAuth/LinkAuthFlowBackButton.js +40 -0
- package/dist/components/LinkAuth/LinkAuthFlowProvider.d.ts +33 -0
- package/dist/components/LinkAuth/LinkAuthFlowProvider.js +9 -0
- package/dist/components/LinkAuth/LinkAuthItem.d.ts +13 -0
- package/dist/components/LinkAuth/LinkAuthItem.js +48 -0
- package/dist/components/LinkAuth/LinkAuthItems.d.ts +9 -0
- package/dist/components/LinkAuth/LinkAuthItems.js +47 -0
- package/dist/components/LinkAuth/LinkAuthProvider.d.ts +12 -0
- package/dist/components/LinkAuth/LinkAuthProvider.js +108 -0
- package/dist/components/LinkAuth/LinkAuthTitle.d.ts +6 -0
- package/dist/components/LinkAuth/LinkAuthTitle.js +19 -0
- package/dist/components/LinkAuth/index.d.ts +17 -0
- package/dist/components/LinkAuth/index.js +93 -0
- package/dist/components/LinkAuth/types.d.ts +32 -0
- package/dist/components/LinkAuth/types.js +5 -0
- package/dist/components/LinkAuth/utils.d.ts +4 -0
- package/dist/components/LinkAuth/utils.js +7 -0
- package/dist/components/LinkAuthModal/index.d.ts +21 -0
- package/dist/components/LinkAuthModal/index.js +69 -0
- package/dist/components/OAuthStatusModal/index.d.ts +7 -1
- package/dist/components/OAuthStatusModal/index.js +115 -93
- package/dist/components/SignIn/SignInAuthMethodButtons.js +36 -34
- package/dist/components/SignIn/SignInForm.d.ts +2 -1
- package/dist/components/SignIn/SignInForm.js +19 -18
- package/dist/components/SignIn/SignInProvider.d.ts +2 -1
- package/dist/components/SignIn/SignInProvider.js +22 -17
- package/dist/components/SignIn/flows/SignInWithEmail.d.ts +1 -1
- package/dist/components/SignIn/flows/SignInWithEmail.js +66 -61
- package/dist/components/SignIn/flows/SignInWithSms.d.ts +1 -1
- package/dist/components/SignIn/flows/SignInWithSms.js +90 -2987
- package/dist/components/SignIn/hooks/useSignInWithOAuth.d.ts +0 -1
- package/dist/components/SignIn/hooks/useSignInWithOAuth.js +19 -20
- package/dist/components/SignIn/index.d.ts +3 -1
- package/dist/components/SignIn/index.js +16 -11
- package/dist/components/SignIn/types.d.ts +2 -0
- package/dist/components/SignIn/useSignInReducer.js +1 -0
- package/dist/components/SignInModal/index.d.ts +3 -1
- package/dist/components/SignInModal/index.js +72 -65
- package/dist/components/forms/Label/index.d.ts +2 -2
- package/dist/components/forms/PhoneNumberInput/index.js +24 -22
- package/dist/components/ui/Banner/index.d.ts +7 -0
- package/dist/components/ui/Banner/index.js +27 -0
- package/dist/components/ui/IframeButton/index.d.ts +11 -0
- package/dist/components/ui/IframeButton/index.js +50 -0
- package/dist/components/ui/Modal/index.js +22 -22
- package/dist/components/ui/SwitchTransition/index.d.ts +3 -1
- package/dist/components/ui/SwitchTransition/index.js +1 -1
- package/dist/hooks/useKeyExportPostMessage.d.ts +38 -0
- package/dist/hooks/useKeyExportPostMessage.js +83 -0
- package/dist/hooks/useTransitionMap.d.ts +50 -0
- package/dist/hooks/useTransitionMap.js +92 -0
- package/dist/icons/IconCopy.d.ts +2 -0
- package/dist/icons/IconCopy.js +10 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +20 -18
- package/dist/index.d.ts +2 -2
- package/dist/index.js +122 -107
- package/dist/theme/theme.d.ts +33 -4
- package/dist/theme/tokens.d.ts +99 -12
- package/dist/theme/tokens.js +29 -12
- package/dist/types/secureIframe.d.ts +30 -0
- package/dist/types/secureIframe.js +13 -0
- package/dist/utils/childrenHasComponent.d.ts +1 -1
- package/dist/utils/formatPhoneNumber.d.ts +1 -0
- package/dist/utils/formatPhoneNumber.js +2910 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +8 -6
- package/dist/utils/sendIframeMessage.d.ts +1 -0
- package/dist/utils/sendIframeMessage.js +13 -0
- package/dist/utils/transition.d.ts +30 -0
- package/dist/utils/transition.js +43 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -9
- package/dist/assets/ManageAuth.css +0 -1
- package/dist/assets/ManageAuthItem.css +0 -1
- package/dist/assets/ManageAuthModal.css +0 -1
- package/dist/components/ManageAuth/ManageAuthItem.d.ts +0 -9
- package/dist/components/ManageAuth/ManageAuthItem.js +0 -77
- package/dist/components/ManageAuth/ManageAuthProvider.d.ts +0 -8
- package/dist/components/ManageAuth/ManageAuthProvider.js +0 -64
- package/dist/components/ManageAuth/index.d.ts +0 -9
- package/dist/components/ManageAuth/index.js +0 -51
- package/dist/components/ManageAuth/types.d.ts +0 -13
- package/dist/components/ManageAuth/types.js +0 -1
- package/dist/components/ManageAuthModal/index.d.ts +0 -20
- package/dist/components/ManageAuthModal/index.js +0 -53
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OAuth2ProviderType, APIError } from '@coinbase/cdp-hooks';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
|
-
export declare const OAUTH_PROVIDER_SESSION_STORAGE_KEY = "cdp-react-sign-in-with-oauth-provider-name";
|
|
4
3
|
export type UseSignInWithOAuthReturnType = {
|
|
5
4
|
error: string | APIError | null;
|
|
6
5
|
isPending: boolean;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { useSignInWithOAuth as
|
|
2
|
-
import { useState as c, useRef as
|
|
3
|
-
import {
|
|
4
|
-
import { isApiError as
|
|
5
|
-
const
|
|
6
|
-
const { signInWithOAuth:
|
|
1
|
+
import { useSignInWithOAuth as g } from "@coinbase/cdp-hooks";
|
|
2
|
+
import { useState as c, useRef as f, useCallback as m } from "react";
|
|
3
|
+
import { useOauthStatusModal as A } from "../../OAuthStatusModal/index.js";
|
|
4
|
+
import { isApiError as I } from "../../../utils/isApiError.js";
|
|
5
|
+
const E = () => {
|
|
6
|
+
const { signInWithOAuth: n } = g(), [r, s] = c(!1), [l, e] = c(null), o = f(null), i = "An error occurred while signing in. Please try again.", { persistOAuthState: u } = A();
|
|
7
7
|
return {
|
|
8
|
-
signInWithOAuth:
|
|
9
|
-
async (
|
|
10
|
-
if (!
|
|
11
|
-
|
|
8
|
+
signInWithOAuth: m(
|
|
9
|
+
async (a) => {
|
|
10
|
+
if (!r) {
|
|
11
|
+
o.current = a, s(!0), e(null);
|
|
12
12
|
try {
|
|
13
|
-
await
|
|
14
|
-
} catch (
|
|
15
|
-
const h =
|
|
16
|
-
|
|
13
|
+
await n(a), u(!1);
|
|
14
|
+
} catch (t) {
|
|
15
|
+
const h = I(t) ? t : t instanceof Error && t.message || i;
|
|
16
|
+
e(h), s(!1), console.error(t);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
[
|
|
20
|
+
[r, n, u]
|
|
21
21
|
),
|
|
22
|
-
oauthProvider:
|
|
23
|
-
isPending:
|
|
24
|
-
error:
|
|
22
|
+
oauthProvider: o,
|
|
23
|
+
isPending: r,
|
|
24
|
+
error: l
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
29
|
-
W as useSignInWithOAuth
|
|
28
|
+
E as useSignInWithOAuth
|
|
30
29
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { AuthMethod } from '../CDPReactProvider';
|
|
2
3
|
import { SignInAuthMethodButtons, SignInAuthMethodButtonsProps } from './SignInAuthMethodButtons';
|
|
3
4
|
import { SignInBackButton, SignInBackButtonProps } from './SignInBackButton';
|
|
4
5
|
import { SignInDescription, SignInDescriptionProps } from './SignInDescription';
|
|
@@ -11,6 +12,7 @@ import { SignInState, SignInAction } from './types';
|
|
|
11
12
|
export interface SignInProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
12
13
|
children?: ReactNode | ((state: SignInState) => ReactNode);
|
|
13
14
|
onSuccess?: () => void;
|
|
15
|
+
authMethods?: AuthMethod[];
|
|
14
16
|
}
|
|
15
|
-
export declare const SignIn: (props: SignInProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const SignIn: ({ authMethods, ...props }: SignInProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export { SignInAuthMethodButtons, SignInBackButton, SignInDescription, SignInFooter, SignInForm, SignInImage, SignInTitle, useSignInContext, type SignInAuthMethodButtonsProps, type SignInBackButtonProps, type SignInDescriptionProps, type SignInFormProps, type SignInImageProps, type SignInTitleProps, type SignInState, type SignInAction, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
1
|
+
import { jsx as n, jsxs as r, Fragment as c } from "react/jsx-runtime";
|
|
2
2
|
import { u as d } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { useAppConfig as u } from "../CDPReactProvider/index.js";
|
|
@@ -11,31 +11,36 @@ import { SignInImage as w } from "./SignInImage.js";
|
|
|
11
11
|
import { SignInProvider as C, useSignInContext as h } from "./SignInProvider.js";
|
|
12
12
|
import { SignInTitle as v } from "./SignInTitle.js";
|
|
13
13
|
import "@coinbase/cdp-hooks";
|
|
14
|
-
import '../../assets/SignIn.css';const F = "SignIn-module__footer___3Gkbc",
|
|
14
|
+
import '../../assets/SignIn.css';const F = "SignIn-module__footer___3Gkbc", t = {
|
|
15
15
|
"sign-in": "SignIn-module__sign-in___cYpee",
|
|
16
16
|
"title-desc-wrapper": "SignIn-module__title-desc-wrapper___VpPcA",
|
|
17
17
|
"back-button": "SignIn-module__back-button___bmE-y",
|
|
18
18
|
"back-button-wrapper": "SignIn-module__back-button-wrapper___Q9FA1",
|
|
19
19
|
footer: F
|
|
20
|
-
}, N = ({
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
}, N = ({
|
|
21
|
+
className: e = "",
|
|
22
|
+
children: o,
|
|
23
|
+
onSuccess: p,
|
|
24
|
+
...a
|
|
25
|
+
}) => {
|
|
26
|
+
const { state: _ } = h(), { showCoinbaseFooter: g } = u(), s = typeof o == "function" ? o(_) : o;
|
|
27
|
+
return /* @__PURE__ */ r("div", { className: `${t["sign-in"]} ${e}`, ...a, children: [
|
|
23
28
|
s,
|
|
24
|
-
!s && /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */ n("div", { className:
|
|
29
|
+
!s && /* @__PURE__ */ r(c, { children: [
|
|
30
|
+
/* @__PURE__ */ n("div", { className: t["back-button-wrapper"], children: /* @__PURE__ */ n(I, { className: t["back-button"] }) }),
|
|
26
31
|
/* @__PURE__ */ n(w, {}),
|
|
27
|
-
/* @__PURE__ */ n(k, { onSuccess: p, children: ({ authMethod: i, step: m, Form: l }) => /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ n(k, { onSuccess: p, children: ({ authMethod: i, step: m, Form: l }) => /* @__PURE__ */ r(c, { children: [
|
|
33
|
+
/* @__PURE__ */ r("div", { className: t["title-desc-wrapper"], children: [
|
|
29
34
|
/* @__PURE__ */ n(v, { step: m, authMethod: i }),
|
|
30
35
|
/* @__PURE__ */ n(S, { step: m, authMethod: i })
|
|
31
36
|
] }),
|
|
32
37
|
l,
|
|
33
38
|
m === "credentials" && /* @__PURE__ */ n(f, { activeMethod: i })
|
|
34
39
|
] }) }),
|
|
35
|
-
g && /* @__PURE__ */ n(b, { className:
|
|
40
|
+
g && /* @__PURE__ */ n(b, { className: t.footer })
|
|
36
41
|
] })
|
|
37
42
|
] });
|
|
38
|
-
}, V = (
|
|
43
|
+
}, V = ({ authMethods: e, ...o }) => (d("sign_in"), /* @__PURE__ */ n(C, { authMethods: e, children: /* @__PURE__ */ n(N, { ...o }) }));
|
|
39
44
|
export {
|
|
40
45
|
V as SignIn,
|
|
41
46
|
f as SignInAuthMethodButtons,
|
|
@@ -7,6 +7,7 @@ export interface SignInTitleAndDescriptionProps {
|
|
|
7
7
|
}
|
|
8
8
|
export interface SignInState {
|
|
9
9
|
authMethod: AuthMethod;
|
|
10
|
+
authMethods: AuthMethod[];
|
|
10
11
|
canResetOTP: boolean;
|
|
11
12
|
email: string;
|
|
12
13
|
error: string | APIError | null;
|
|
@@ -93,6 +94,7 @@ export type SignInAction = {
|
|
|
93
94
|
};
|
|
94
95
|
export interface SignInFlowProps {
|
|
95
96
|
step: SignInState["step"];
|
|
97
|
+
autoFocus?: boolean;
|
|
96
98
|
onSuccess?: () => void;
|
|
97
99
|
children?: (props: {
|
|
98
100
|
step: SignInState["step"];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { AuthMethod } from '../CDPReactProvider';
|
|
2
3
|
import { ButtonProps } from '../ui/Button';
|
|
3
4
|
import { ModalContentProps } from '../ui/Modal';
|
|
4
5
|
export interface SignInModalTriggerProps extends Partial<Pick<ButtonProps, "className" | "fullWidth" | "size" | "style" | "variant">> {
|
|
@@ -9,6 +10,7 @@ export interface SignInModalContentProps extends ModalContentProps {
|
|
|
9
10
|
onSuccess?: () => void;
|
|
10
11
|
}
|
|
11
12
|
export interface SignInModalProps {
|
|
13
|
+
authMethods?: AuthMethod[];
|
|
12
14
|
children?: ReactNode;
|
|
13
15
|
open?: boolean;
|
|
14
16
|
setIsOpen?: (value: boolean) => void;
|
|
@@ -16,4 +18,4 @@ export interface SignInModalProps {
|
|
|
16
18
|
}
|
|
17
19
|
export declare const SignInModalTrigger: ({ children, className, label, ...props }: SignInModalTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
export declare const SignInModalContent: (props: SignInModalContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const SignInModal: ({ children, open, setIsOpen, onSuccess }: SignInModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const SignInModal: ({ authMethods, children, open, setIsOpen, onSuccess, }: SignInModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,86 +1,93 @@
|
|
|
1
|
-
import { jsx as n, jsxs as t, Fragment as
|
|
2
|
-
import { u as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { c as
|
|
5
|
-
import { useAppConfig as
|
|
6
|
-
import { SignIn as
|
|
1
|
+
import { jsx as n, jsxs as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { u as C } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
|
|
3
|
+
import { createContext as b, useMemo as x, useContext as v } from "react";
|
|
4
|
+
import { c as N } from "../../chunks/lite.1fxw3LjI.js";
|
|
5
|
+
import { useAppConfig as w } from "../CDPReactProvider/index.js";
|
|
6
|
+
import { SignIn as T } from "../SignIn/index.js";
|
|
7
7
|
import "@coinbase/cdp-hooks";
|
|
8
|
-
import { Button as
|
|
9
|
-
import { ModalTrigger as
|
|
10
|
-
import { VisuallyHidden as
|
|
11
|
-
import { IconXMark as
|
|
12
|
-
import { childrenHasComponent as
|
|
13
|
-
import { SignInBackButton as
|
|
14
|
-
import { SignInImage as
|
|
15
|
-
import { SignInForm as
|
|
16
|
-
import { SignInTitle as
|
|
17
|
-
import { SignInDescription as
|
|
18
|
-
import { SignInAuthMethodButtons as
|
|
19
|
-
import { SignInFooter as
|
|
20
|
-
import '../../assets/SignInModal.css';const
|
|
21
|
-
trigger:
|
|
8
|
+
import { Button as h } from "../ui/Button/index.js";
|
|
9
|
+
import { ModalTrigger as k, ModalContent as B, ModalClose as D, Modal as F, ModalTitle as j, ModalDescription as y } from "../ui/Modal/index.js";
|
|
10
|
+
import { VisuallyHidden as g } from "../ui/VisuallyHidden/index.js";
|
|
11
|
+
import { IconXMark as A } from "../../icons/IconXMark.js";
|
|
12
|
+
import { childrenHasComponent as f } from "../../utils/childrenHasComponent.js";
|
|
13
|
+
import { SignInBackButton as V } from "../SignIn/SignInBackButton.js";
|
|
14
|
+
import { SignInImage as z } from "../SignIn/SignInImage.js";
|
|
15
|
+
import { SignInForm as E } from "../SignIn/SignInForm.js";
|
|
16
|
+
import { SignInTitle as _ } from "../SignIn/SignInTitle.js";
|
|
17
|
+
import { SignInDescription as u } from "../SignIn/SignInDescription.js";
|
|
18
|
+
import { SignInAuthMethodButtons as H } from "../SignIn/SignInAuthMethodButtons.js";
|
|
19
|
+
import { SignInFooter as J } from "../SignIn/SignInFooter.js";
|
|
20
|
+
import '../../assets/SignInModal.css';const O = "SignInModal-module__trigger___IcJ8x", X = "SignInModal-module__footer___6qEo2", $ = "SignInModal-module__buttons___jhaVn", e = {
|
|
21
|
+
trigger: O,
|
|
22
22
|
"sign-in": "SignInModal-module__sign-in___n05-5",
|
|
23
23
|
"no-footer": "SignInModal-module__no-footer___meSt1",
|
|
24
24
|
"title-desc-wrapper": "SignInModal-module__title-desc-wrapper___--XLa",
|
|
25
25
|
"sign-in-form": "SignInModal-module__sign-in-form___Jzx1-",
|
|
26
26
|
"sign-in-image": "SignInModal-module__sign-in-image___DGg7B",
|
|
27
|
-
footer:
|
|
28
|
-
buttons:
|
|
27
|
+
footer: X,
|
|
28
|
+
buttons: $,
|
|
29
29
|
"back-button": "SignInModal-module__back-button___nMh2-",
|
|
30
30
|
"close-icon": "SignInModal-module__close-icon___b-gMh"
|
|
31
|
-
},
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
31
|
+
}, M = b(null), q = () => {
|
|
32
|
+
const i = v(M);
|
|
33
|
+
if (!i)
|
|
34
34
|
throw new Error("useSignInModalContext must be used within a SignInModal");
|
|
35
|
-
return
|
|
36
|
-
},
|
|
37
|
-
children:
|
|
38
|
-
className:
|
|
39
|
-
label:
|
|
40
|
-
...
|
|
41
|
-
}) => /* @__PURE__ */ n(
|
|
42
|
-
const { showCoinbaseFooter:
|
|
43
|
-
return /* @__PURE__ */ n(
|
|
44
|
-
|
|
35
|
+
return i;
|
|
36
|
+
}, p = ({
|
|
37
|
+
children: i,
|
|
38
|
+
className: o = "",
|
|
39
|
+
label: s,
|
|
40
|
+
...r
|
|
41
|
+
}) => /* @__PURE__ */ n(k, { asChild: !0, children: i || /* @__PURE__ */ n(h, { className: N(e.trigger, o), ...r, children: s || "Sign in" }) }), m = (i) => {
|
|
42
|
+
const { showCoinbaseFooter: o } = w(), { authMethods: s, onSuccess: r } = q();
|
|
43
|
+
return /* @__PURE__ */ n(B, { ...i, children: /* @__PURE__ */ n(
|
|
44
|
+
T,
|
|
45
45
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */ n(
|
|
46
|
+
authMethods: s,
|
|
47
|
+
onSuccess: r,
|
|
48
|
+
className: `${e["sign-in"]} ${o ? "" : e["no-footer"]}`,
|
|
49
|
+
...i,
|
|
50
|
+
children: /* @__PURE__ */ t(c, { children: [
|
|
51
|
+
/* @__PURE__ */ n(G, {}),
|
|
52
|
+
/* @__PURE__ */ t("div", { className: e.buttons, children: [
|
|
53
|
+
/* @__PURE__ */ n(V, { className: e["back-button"] }),
|
|
54
|
+
/* @__PURE__ */ n(D, { asChild: !0, children: /* @__PURE__ */ n(h, { "aria-label": "Close", size: "md", variant: "transparentSecondary", children: /* @__PURE__ */ n(A, { className: e["close-icon"] }) }) })
|
|
54
55
|
] }),
|
|
55
|
-
/* @__PURE__ */ n("div", { className:
|
|
56
|
-
/* @__PURE__ */ n(
|
|
57
|
-
/* @__PURE__ */ t("div", { className:
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
/* @__PURE__ */ n("div", { className: e["sign-in-image"], children: /* @__PURE__ */ n(z, {}) }),
|
|
57
|
+
/* @__PURE__ */ n(E, { onSuccess: r, children: ({ authMethod: l, step: a, Form: d }) => /* @__PURE__ */ t(c, { children: [
|
|
58
|
+
/* @__PURE__ */ t("div", { className: e["title-desc-wrapper"], children: [
|
|
59
|
+
a === "verification" ? /* @__PURE__ */ n(g, { as: "div", children: /* @__PURE__ */ n(_, {}) }) : /* @__PURE__ */ n(_, {}),
|
|
60
|
+
a === "credentials" ? /* @__PURE__ */ n(g, { as: "div", children: /* @__PURE__ */ n(u, { authMethod: l }) }) : /* @__PURE__ */ n(u, { authMethod: l })
|
|
60
61
|
] }),
|
|
61
|
-
/* @__PURE__ */ n("div", { className:
|
|
62
|
-
|
|
62
|
+
/* @__PURE__ */ n("div", { className: e["sign-in-form"], children: d }),
|
|
63
|
+
a === "credentials" && /* @__PURE__ */ n(H, { activeMethod: l })
|
|
63
64
|
] }) }),
|
|
64
|
-
|
|
65
|
+
o && /* @__PURE__ */ n(J, { className: e.footer })
|
|
65
66
|
] })
|
|
66
67
|
}
|
|
67
68
|
) });
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
}, mn = ({
|
|
70
|
+
authMethods: i,
|
|
71
|
+
children: o,
|
|
72
|
+
open: s,
|
|
73
|
+
setIsOpen: r,
|
|
74
|
+
onSuccess: l
|
|
75
|
+
}) => {
|
|
76
|
+
C("sign_in_modal");
|
|
77
|
+
const a = o ? f(o, p) : !1, d = o ? f(o, m) : !1, S = !a && !d, I = x(() => ({ authMethods: i, onSuccess: l }), [i, l]);
|
|
78
|
+
return /* @__PURE__ */ n(M.Provider, { value: I, children: /* @__PURE__ */ n(F, { open: s, onOpenChange: r, children: S ? /* @__PURE__ */ t(c, { children: [
|
|
79
|
+
/* @__PURE__ */ n(p, { children: o }),
|
|
80
|
+
/* @__PURE__ */ n(m, {})
|
|
81
|
+
] }) : /* @__PURE__ */ t(c, { children: [
|
|
75
82
|
o,
|
|
76
|
-
!
|
|
83
|
+
!d && /* @__PURE__ */ n(m, {})
|
|
77
84
|
] }) }) });
|
|
78
|
-
},
|
|
79
|
-
/* @__PURE__ */ n(
|
|
80
|
-
/* @__PURE__ */ n(
|
|
85
|
+
}, G = () => /* @__PURE__ */ t(g, { children: [
|
|
86
|
+
/* @__PURE__ */ n(j, { asChild: !0, children: /* @__PURE__ */ n(_, { as: "span" }) }),
|
|
87
|
+
/* @__PURE__ */ n(y, { asChild: !0, children: /* @__PURE__ */ n(u, { as: "span" }) })
|
|
81
88
|
] });
|
|
82
89
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
mn as SignInModal,
|
|
91
|
+
m as SignInModalContent,
|
|
92
|
+
p as SignInModalTrigger
|
|
86
93
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ElementType,
|
|
2
|
-
interface LabelProps extends
|
|
1
|
+
import { ElementType, LabelHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
3
3
|
as?: ElementType;
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as h, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import "libphonenumber-js";
|
|
3
3
|
import { forwardRef as R, useRef as S, useCallback as d, useMemo as w, useEffect as z } from "react";
|
|
4
4
|
import { CountrySelect as B } from "../CountrySelect/index.js";
|
|
@@ -15,14 +15,14 @@ import '../../../assets/PhoneNumberInput.css';const A = "PhoneNumberInput-module
|
|
|
15
15
|
"country-calling-code": "PhoneNumberInput-module__country-calling-code___N6zDW"
|
|
16
16
|
}, T = R(
|
|
17
17
|
({
|
|
18
|
-
autoComplete:
|
|
19
|
-
className:
|
|
18
|
+
autoComplete: a = "tel-national",
|
|
19
|
+
className: _ = "",
|
|
20
20
|
countryCode: n = "US",
|
|
21
21
|
countryOptions: p = !0,
|
|
22
22
|
onCountryCodeChange: g,
|
|
23
23
|
onPhoneNumberChange: c,
|
|
24
24
|
phoneNumber: f,
|
|
25
|
-
...
|
|
25
|
+
...u
|
|
26
26
|
}, o) => {
|
|
27
27
|
const b = S(null), C = d(
|
|
28
28
|
(e) => {
|
|
@@ -31,7 +31,7 @@ import '../../../assets/PhoneNumberInput.css';const A = "PhoneNumberInput-module
|
|
|
31
31
|
[o]
|
|
32
32
|
), {
|
|
33
33
|
formatBeforePhoneNumberChange: v,
|
|
34
|
-
formatBeforeCountryCodeChange:
|
|
34
|
+
formatBeforeCountryCodeChange: y,
|
|
35
35
|
placeholder: P,
|
|
36
36
|
formattedDisplayNumber: V
|
|
37
37
|
} = k(f.value, n), j = d(
|
|
@@ -44,10 +44,10 @@ import '../../../assets/PhoneNumberInput.css';const A = "PhoneNumberInput-module
|
|
|
44
44
|
[v, c, f]
|
|
45
45
|
), r = d(
|
|
46
46
|
(e) => {
|
|
47
|
-
const t =
|
|
47
|
+
const t = y(e);
|
|
48
48
|
g?.(e), c?.(t);
|
|
49
49
|
},
|
|
50
|
-
[
|
|
50
|
+
[y, g, c]
|
|
51
51
|
), x = d(
|
|
52
52
|
(e) => {
|
|
53
53
|
r(e), setTimeout(() => {
|
|
@@ -55,28 +55,30 @@ import '../../../assets/PhoneNumberInput.css';const A = "PhoneNumberInput-module
|
|
|
55
55
|
}, 0);
|
|
56
56
|
},
|
|
57
57
|
[r]
|
|
58
|
-
),
|
|
59
|
-
const e = [l["phone-number-input"],
|
|
60
|
-
return
|
|
61
|
-
}, [
|
|
58
|
+
), i = typeof p == "boolean" ? p : p.length > 0, m = !i && n ? W.find((e) => e.code === n) : void 0, N = u["aria-invalid"] && u["aria-invalid"] !== "false", I = u["data-success"] && u["data-success"] !== "false", D = w(() => {
|
|
59
|
+
const e = [l["phone-number-input"], _];
|
|
60
|
+
return N && e.push(l.invalid), I && e.push(l.success), !i && m && e.push(l["inline-country-calling-code"]), e.join(" ");
|
|
61
|
+
}, [N, I, _, m, i]);
|
|
62
62
|
return z(() => {
|
|
63
63
|
r(n);
|
|
64
|
-
}, [n, r]), /* @__PURE__ */
|
|
65
|
-
!
|
|
66
|
-
|
|
64
|
+
}, [n, r]), /* @__PURE__ */ h("div", { className: D, children: [
|
|
65
|
+
!i && m && /* @__PURE__ */ s(U, { country: m }),
|
|
66
|
+
i && /* @__PURE__ */ s(
|
|
67
67
|
B,
|
|
68
68
|
{
|
|
69
|
+
"aria-label": "Country code",
|
|
69
70
|
defaultValue: n,
|
|
70
71
|
onValueChange: x
|
|
71
72
|
}
|
|
72
73
|
),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ s(
|
|
74
75
|
H,
|
|
75
76
|
{
|
|
76
|
-
...
|
|
77
|
+
...u,
|
|
78
|
+
"aria-label": "Phone number",
|
|
77
79
|
ref: C,
|
|
78
80
|
className: l.input,
|
|
79
|
-
autoComplete:
|
|
81
|
+
autoComplete: a,
|
|
80
82
|
onChange: j,
|
|
81
83
|
placeholder: P,
|
|
82
84
|
type: "tel",
|
|
@@ -87,12 +89,12 @@ import '../../../assets/PhoneNumberInput.css';const A = "PhoneNumberInput-module
|
|
|
87
89
|
}
|
|
88
90
|
);
|
|
89
91
|
T.displayName = "PhoneNumberInput";
|
|
90
|
-
const U = ({ country:
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
92
|
+
const U = ({ country: a }) => /* @__PURE__ */ h("span", { className: l["country-calling-code"], children: [
|
|
93
|
+
/* @__PURE__ */ s("span", { "aria-hidden": "true", children: a.flag }),
|
|
94
|
+
/* @__PURE__ */ s(M, { children: a.name }),
|
|
95
|
+
/* @__PURE__ */ h("span", { children: [
|
|
94
96
|
"+",
|
|
95
|
-
|
|
97
|
+
a.callingCode
|
|
96
98
|
] })
|
|
97
99
|
] });
|
|
98
100
|
export {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface BannerProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
variant?: "success" | "warning" | "error";
|
|
5
|
+
}
|
|
6
|
+
export declare const Banner: ({ className, children, icon, variant, ...props }: BannerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "../../../chunks/lite.1fxw3LjI.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { IconCheckCircle as _ } from "../../../icons/IconCheckCircle.js";
|
|
5
|
+
import { IconExclamationCircle as x } from "../../../icons/IconExclamationCircle.js";
|
|
6
|
+
import { IconExclamationTriangle as d } from "../../../icons/IconExclamationTriangle.js";
|
|
7
|
+
import '../../../assets/Banner.css';const p = "Banner-module__banner___vODjX", f = "Banner-module__icon___wzB6C", u = "Banner-module__text___fTYC-", c = {
|
|
8
|
+
banner: p,
|
|
9
|
+
icon: f,
|
|
10
|
+
text: u
|
|
11
|
+
}, B = {
|
|
12
|
+
error: x,
|
|
13
|
+
success: _,
|
|
14
|
+
warning: d
|
|
15
|
+
}, N = ({ className: a = "", children: s, icon: n, variant: o, ...i }) => {
|
|
16
|
+
const r = o ? B[o] : void 0, m = n || r;
|
|
17
|
+
return /* @__PURE__ */ e("div", { "data-variant": o, className: l(c.banner, a), ...i, children: [
|
|
18
|
+
m && /* @__PURE__ */ e("span", { className: c.icon, children: [
|
|
19
|
+
n,
|
|
20
|
+
!n && r && /* @__PURE__ */ t(r, {})
|
|
21
|
+
] }),
|
|
22
|
+
/* @__PURE__ */ t("div", { className: c.text, children: s })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
N as Banner
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IframeHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ButtonSize } from '../../../theme/theme';
|
|
3
|
+
interface IframeButtonProps extends IframeHTMLAttributes<HTMLIFrameElement> {
|
|
4
|
+
isPending?: boolean;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
icon?: boolean;
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
}
|
|
10
|
+
export declare const IframeButton: import('react').ForwardRefExoticComponent<IframeButtonProps & import('react').RefAttributes<HTMLIFrameElement>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as t } from "../../../chunks/lite.1fxw3LjI.js";
|
|
3
|
+
import { forwardRef as f } from "react";
|
|
4
|
+
import { LoadingSkeleton as u } from "../LoadingSkeleton/index.js";
|
|
5
|
+
import '../../../assets/IframeButton.css';const c = "IframeButton-module__label___Vvl8W", B = "IframeButton-module__iframe___0RBLL", I = "IframeButton-module__hidden___LcF1X", e = {
|
|
6
|
+
"iframe-button": "IframeButton-module__iframe-button___XeAhH",
|
|
7
|
+
"full-width": "IframeButton-module__full-width___lQWpM",
|
|
8
|
+
"size-lg": "IframeButton-module__size-lg___HCOiF",
|
|
9
|
+
"size-md": "IframeButton-module__size-md___p44a4",
|
|
10
|
+
"size-sm": "IframeButton-module__size-sm___U8ILi",
|
|
11
|
+
"size-xs": "IframeButton-module__size-xs___S2jGa",
|
|
12
|
+
"loading-skeleton": "IframeButton-module__loading-skeleton___fzBol",
|
|
13
|
+
label: c,
|
|
14
|
+
"with-icon": "IframeButton-module__with-icon___KBiq1",
|
|
15
|
+
iframe: B,
|
|
16
|
+
hidden: I
|
|
17
|
+
}, h = {
|
|
18
|
+
xs: e["size-xs"],
|
|
19
|
+
sm: e["size-sm"],
|
|
20
|
+
md: e["size-md"],
|
|
21
|
+
lg: e["size-lg"]
|
|
22
|
+
}, z = f(
|
|
23
|
+
({ className: l = "", isPending: _, label: i, icon: a, fullWidth: s, size: m, ...n }, r) => /* @__PURE__ */ d(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: t(
|
|
27
|
+
e["iframe-button"],
|
|
28
|
+
a && e["with-icon"],
|
|
29
|
+
s && e["full-width"],
|
|
30
|
+
m && h[m]
|
|
31
|
+
),
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ o("span", { className: e.label, children: i }),
|
|
34
|
+
_ && /* @__PURE__ */ o(u, { className: t(e["loading-skeleton"]) }),
|
|
35
|
+
/* @__PURE__ */ o(
|
|
36
|
+
"iframe",
|
|
37
|
+
{
|
|
38
|
+
ref: r,
|
|
39
|
+
className: t(e.iframe, _ ? e.hidden : void 0, l),
|
|
40
|
+
...n
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
z.displayName = "IframeButton";
|
|
48
|
+
export {
|
|
49
|
+
z as IframeButton
|
|
50
|
+
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { Dialog as
|
|
3
|
-
import { c as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import '../../../assets/Modal.css';const
|
|
7
|
-
modal:
|
|
8
|
-
overlay:
|
|
9
|
-
spacer:
|
|
10
|
-
},
|
|
11
|
-
({ children:
|
|
12
|
-
const { cssVariables: s } =
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as _, DialogTitle as p, DialogDescription as g, DialogPortal as M, DialogOverlay as D, DialogContent as f, DialogClose as u, DialogTrigger as y } from "@radix-ui/react-dialog";
|
|
3
|
+
import { c as e } from "../../../chunks/lite.1fxw3LjI.js";
|
|
4
|
+
import { forwardRef as v, useMemo as C } from "react";
|
|
5
|
+
import { useTheme as T } from "../../ThemeProvider/index.js";
|
|
6
|
+
import '../../../assets/Modal.css';const x = "Modal-module__modal___MUsZA", N = "Modal-module__overlay___-RqGQ", h = "Modal-module__spacer___dIfOA", a = {
|
|
7
|
+
modal: x,
|
|
8
|
+
overlay: N,
|
|
9
|
+
spacer: h
|
|
10
|
+
}, j = v(
|
|
11
|
+
({ children: r, className: t = "", overlayClassName: c = "", overlayStyle: l, ...i }, d) => {
|
|
12
|
+
const { cssVariables: s } = T(), m = C(
|
|
13
13
|
() => ({ ...s, ...l }),
|
|
14
14
|
[s, l]
|
|
15
15
|
);
|
|
16
|
-
return /* @__PURE__ */ o(
|
|
16
|
+
return /* @__PURE__ */ o(M, { children: /* @__PURE__ */ n(D, { className: e(a.overlay, c), style: m, children: [
|
|
17
17
|
/* @__PURE__ */ o("div", { className: a.spacer }),
|
|
18
|
-
/* @__PURE__ */ o(
|
|
18
|
+
/* @__PURE__ */ o(f, { ...i, ref: d, className: e(a.modal, t), children: r })
|
|
19
19
|
] }) });
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
|
-
|
|
23
|
-
const
|
|
22
|
+
j.displayName = "ModalContent";
|
|
23
|
+
const w = _, G = u, I = g, P = p, Q = y;
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
w as Modal,
|
|
26
|
+
G as ModalClose,
|
|
27
|
+
j as ModalContent,
|
|
28
|
+
I as ModalDescription,
|
|
29
|
+
P as ModalTitle,
|
|
30
|
+
Q as ModalTrigger
|
|
31
31
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes, Key, ReactNode, Ref } from 'react';
|
|
2
|
-
import { TransitionMapOptions, TransitionMapResult
|
|
2
|
+
import { TransitionMapOptions, TransitionMapResult } from '../../../hooks/useTransitionMap';
|
|
3
|
+
import { TransitionState } from '../../../utils/transition';
|
|
4
|
+
export { type TransitionMapOptions, type TransitionMapResult, type TransitionState };
|
|
3
5
|
export interface SwitchTransitionRef<T extends Key> {
|
|
4
6
|
transition: TransitionMapResult<T>;
|
|
5
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as b, Fragment as H } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as R, useId as J, useState as _, useImperativeHandle as P, useLayoutEffect as j, useEffect as Q } from "react";
|
|
3
|
-
import { useTransitionMap as U } from "
|
|
3
|
+
import { useTransitionMap as U } from "../../../hooks/useTransitionMap.js";
|
|
4
4
|
import '../../../assets/SwitchTransition.css';const V = {
|
|
5
5
|
"transition-wrapper": "SwitchTransition-module__transition-wrapper___jrI35"
|
|
6
6
|
}, W = (v) => {
|