@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.
Files changed (117) hide show
  1. package/README.md +10 -8
  2. package/dist/assets/Banner.css +1 -0
  3. package/dist/assets/CopyAddress.css +1 -0
  4. package/dist/assets/ExportWallet.css +1 -0
  5. package/dist/assets/ExportWalletModal.css +1 -0
  6. package/dist/assets/IframeButton.css +1 -0
  7. package/dist/assets/Input.css +1 -1
  8. package/dist/assets/LinkAuth.css +1 -0
  9. package/dist/assets/LinkAuthFlow.css +1 -0
  10. package/dist/assets/LinkAuthFlowBackButton.css +1 -0
  11. package/dist/assets/LinkAuthItem.css +1 -0
  12. package/dist/assets/LinkAuthItems.css +1 -0
  13. package/dist/assets/LinkAuthModal.css +1 -0
  14. package/dist/assets/LinkAuthTitle.css +1 -0
  15. package/dist/assets/SwitchSlideTransition.css +1 -1
  16. package/dist/chunks/LinkAuthFlow.CxSnHF2p.js +111 -0
  17. package/dist/components/CDPReactProvider/index.js +71 -55
  18. package/dist/components/CopyAddress/index.d.ts +8 -0
  19. package/dist/components/CopyAddress/index.js +61 -0
  20. package/dist/components/CopyEvmKeyButton/index.d.ts +13 -0
  21. package/dist/components/CopyEvmKeyButton/index.js +61 -0
  22. package/dist/components/CopySolanaKeyButton/index.d.ts +13 -0
  23. package/dist/components/CopySolanaKeyButton/index.js +61 -0
  24. package/dist/components/ExportWallet/index.d.ts +21 -0
  25. package/dist/components/ExportWallet/index.js +110 -0
  26. package/dist/components/ExportWalletModal/index.d.ts +18 -0
  27. package/dist/components/ExportWalletModal/index.js +96 -0
  28. package/dist/components/LinkAuth/LinkAuthFlow.d.ts +13 -0
  29. package/dist/components/LinkAuth/LinkAuthFlow.js +19 -0
  30. package/dist/components/LinkAuth/LinkAuthFlowBackButton.d.ts +9 -0
  31. package/dist/components/LinkAuth/LinkAuthFlowBackButton.js +40 -0
  32. package/dist/components/LinkAuth/LinkAuthFlowProvider.d.ts +33 -0
  33. package/dist/components/LinkAuth/LinkAuthFlowProvider.js +9 -0
  34. package/dist/components/LinkAuth/LinkAuthItem.d.ts +13 -0
  35. package/dist/components/LinkAuth/LinkAuthItem.js +48 -0
  36. package/dist/components/LinkAuth/LinkAuthItems.d.ts +9 -0
  37. package/dist/components/LinkAuth/LinkAuthItems.js +47 -0
  38. package/dist/components/LinkAuth/LinkAuthProvider.d.ts +12 -0
  39. package/dist/components/LinkAuth/LinkAuthProvider.js +108 -0
  40. package/dist/components/LinkAuth/LinkAuthTitle.d.ts +6 -0
  41. package/dist/components/LinkAuth/LinkAuthTitle.js +19 -0
  42. package/dist/components/LinkAuth/index.d.ts +17 -0
  43. package/dist/components/LinkAuth/index.js +93 -0
  44. package/dist/components/LinkAuth/types.d.ts +32 -0
  45. package/dist/components/LinkAuth/types.js +5 -0
  46. package/dist/components/LinkAuth/utils.d.ts +4 -0
  47. package/dist/components/LinkAuth/utils.js +7 -0
  48. package/dist/components/LinkAuthModal/index.d.ts +21 -0
  49. package/dist/components/LinkAuthModal/index.js +69 -0
  50. package/dist/components/OAuthStatusModal/index.d.ts +7 -1
  51. package/dist/components/OAuthStatusModal/index.js +115 -93
  52. package/dist/components/SignIn/SignInAuthMethodButtons.js +36 -34
  53. package/dist/components/SignIn/SignInForm.d.ts +2 -1
  54. package/dist/components/SignIn/SignInForm.js +19 -18
  55. package/dist/components/SignIn/SignInProvider.d.ts +2 -1
  56. package/dist/components/SignIn/SignInProvider.js +22 -17
  57. package/dist/components/SignIn/flows/SignInWithEmail.d.ts +1 -1
  58. package/dist/components/SignIn/flows/SignInWithEmail.js +66 -61
  59. package/dist/components/SignIn/flows/SignInWithSms.d.ts +1 -1
  60. package/dist/components/SignIn/flows/SignInWithSms.js +90 -2987
  61. package/dist/components/SignIn/hooks/useSignInWithOAuth.d.ts +0 -1
  62. package/dist/components/SignIn/hooks/useSignInWithOAuth.js +19 -20
  63. package/dist/components/SignIn/index.d.ts +3 -1
  64. package/dist/components/SignIn/index.js +16 -11
  65. package/dist/components/SignIn/types.d.ts +2 -0
  66. package/dist/components/SignIn/useSignInReducer.js +1 -0
  67. package/dist/components/SignInModal/index.d.ts +3 -1
  68. package/dist/components/SignInModal/index.js +72 -65
  69. package/dist/components/forms/Label/index.d.ts +2 -2
  70. package/dist/components/forms/PhoneNumberInput/index.js +24 -22
  71. package/dist/components/ui/Banner/index.d.ts +7 -0
  72. package/dist/components/ui/Banner/index.js +27 -0
  73. package/dist/components/ui/IframeButton/index.d.ts +11 -0
  74. package/dist/components/ui/IframeButton/index.js +50 -0
  75. package/dist/components/ui/Modal/index.js +22 -22
  76. package/dist/components/ui/SwitchTransition/index.d.ts +3 -1
  77. package/dist/components/ui/SwitchTransition/index.js +1 -1
  78. package/dist/hooks/useKeyExportPostMessage.d.ts +38 -0
  79. package/dist/hooks/useKeyExportPostMessage.js +83 -0
  80. package/dist/hooks/useTransitionMap.d.ts +50 -0
  81. package/dist/hooks/useTransitionMap.js +92 -0
  82. package/dist/icons/IconCopy.d.ts +2 -0
  83. package/dist/icons/IconCopy.js +10 -0
  84. package/dist/icons/index.d.ts +1 -0
  85. package/dist/icons/index.js +20 -18
  86. package/dist/index.d.ts +2 -2
  87. package/dist/index.js +122 -107
  88. package/dist/theme/theme.d.ts +33 -4
  89. package/dist/theme/tokens.d.ts +99 -12
  90. package/dist/theme/tokens.js +29 -12
  91. package/dist/types/secureIframe.d.ts +30 -0
  92. package/dist/types/secureIframe.js +13 -0
  93. package/dist/utils/childrenHasComponent.d.ts +1 -1
  94. package/dist/utils/formatPhoneNumber.d.ts +1 -0
  95. package/dist/utils/formatPhoneNumber.js +2910 -0
  96. package/dist/utils/index.d.ts +1 -0
  97. package/dist/utils/index.js +8 -6
  98. package/dist/utils/sendIframeMessage.d.ts +1 -0
  99. package/dist/utils/sendIframeMessage.js +13 -0
  100. package/dist/utils/transition.d.ts +30 -0
  101. package/dist/utils/transition.js +43 -0
  102. package/dist/version.d.ts +1 -1
  103. package/dist/version.js +1 -1
  104. package/package.json +8 -9
  105. package/dist/assets/ManageAuth.css +0 -1
  106. package/dist/assets/ManageAuthItem.css +0 -1
  107. package/dist/assets/ManageAuthModal.css +0 -1
  108. package/dist/components/ManageAuth/ManageAuthItem.d.ts +0 -9
  109. package/dist/components/ManageAuth/ManageAuthItem.js +0 -77
  110. package/dist/components/ManageAuth/ManageAuthProvider.d.ts +0 -8
  111. package/dist/components/ManageAuth/ManageAuthProvider.js +0 -64
  112. package/dist/components/ManageAuth/index.d.ts +0 -9
  113. package/dist/components/ManageAuth/index.js +0 -51
  114. package/dist/components/ManageAuth/types.d.ts +0 -13
  115. package/dist/components/ManageAuth/types.js +0 -1
  116. package/dist/components/ManageAuthModal/index.d.ts +0 -20
  117. 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 l } from "@coinbase/cdp-hooks";
2
- import { useState as c, useRef as m, useCallback as I } from "react";
3
- import { useProviderName as f } from "../../CDPReactProvider/index.js";
4
- import { isApiError as A } from "../../../utils/isApiError.js";
5
- const O = "cdp-react-sign-in-with-oauth-provider-name", W = () => {
6
- const { signInWithOAuth: t } = l(), [n, e] = c(!1), [g, s] = c(null), o = f(), i = m(null), a = "An error occurred while signing in. Please try again.";
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: I(
9
- async (u) => {
10
- if (!n) {
11
- i.current = u, e(!0), s(null);
8
+ signInWithOAuth: m(
9
+ async (a) => {
10
+ if (!r) {
11
+ o.current = a, s(!0), e(null);
12
12
  try {
13
- await t(u), sessionStorage.setItem(O, o);
14
- } catch (r) {
15
- const h = A(r) ? r : r instanceof Error && r.message || a;
16
- s(h), e(!1), console.error(r);
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
- [n, t, o]
20
+ [r, n, u]
21
21
  ),
22
- oauthProvider: i,
23
- isPending: n,
24
- error: g
22
+ oauthProvider: o,
23
+ isPending: r,
24
+ error: l
25
25
  };
26
26
  };
27
27
  export {
28
- O as OAUTH_PROVIDER_SESSION_STORAGE_KEY,
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 t, Fragment as c } from "react/jsx-runtime";
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", o = {
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 = ({ className: r = "", children: e, onSuccess: p, ...a }) => {
21
- const { state: _ } = h(), { showCoinbaseFooter: g } = u(), s = typeof e == "function" ? e(_) : e;
22
- return /* @__PURE__ */ t("div", { className: `${o["sign-in"]} ${r}`, ...a, children: [
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__ */ t(c, { children: [
25
- /* @__PURE__ */ n("div", { className: o["back-button-wrapper"], children: /* @__PURE__ */ n(I, { className: o["back-button"] }) }),
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__ */ t(c, { children: [
28
- /* @__PURE__ */ t("div", { className: o["title-desc-wrapper"], children: [
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: o.footer })
40
+ g && /* @__PURE__ */ n(b, { className: t.footer })
36
41
  ] })
37
42
  ] });
38
- }, V = (r) => (d("sign_in"), /* @__PURE__ */ n(C, { children: /* @__PURE__ */ n(N, { ...r }) }));
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"];
@@ -72,6 +72,7 @@ function l(e, r) {
72
72
  case "RESET_STATE":
73
73
  return {
74
74
  authMethod: e.authMethod,
75
+ authMethods: e.authMethods,
75
76
  canResetOTP: !1,
76
77
  error: null,
77
78
  isPending: !1,
@@ -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 d } from "react/jsx-runtime";
2
- import { u as I } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
3
- import { createContext as C, useMemo as b, useContext as x } from "react";
4
- import { c as v } from "../../chunks/lite.1fxw3LjI.js";
5
- import { useAppConfig as N } from "../CDPReactProvider/index.js";
6
- import { SignIn as w } from "../SignIn/index.js";
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 p } from "../ui/Button/index.js";
9
- import { ModalTrigger as T, ModalContent as k, ModalClose as B, Modal as D, ModalTitle as F, ModalDescription as j } from "../ui/Modal/index.js";
10
- import { VisuallyHidden as m } from "../ui/VisuallyHidden/index.js";
11
- import { IconXMark as y } from "../../icons/IconXMark.js";
12
- import { childrenHasComponent as u } from "../../utils/childrenHasComponent.js";
13
- import { SignInBackButton as A } from "../SignIn/SignInBackButton.js";
14
- import { SignInImage as V } from "../SignIn/SignInImage.js";
15
- import { SignInForm as z } from "../SignIn/SignInForm.js";
16
- import { SignInTitle as g } from "../SignIn/SignInTitle.js";
17
- import { SignInDescription as _ } from "../SignIn/SignInDescription.js";
18
- import { SignInAuthMethodButtons as E } from "../SignIn/SignInAuthMethodButtons.js";
19
- import { SignInFooter as H } from "../SignIn/SignInFooter.js";
20
- import '../../assets/SignInModal.css';const J = "SignInModal-module__trigger___IcJ8x", O = "SignInModal-module__footer___6qEo2", X = "SignInModal-module__buttons___jhaVn", i = {
21
- trigger: J,
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: O,
28
- buttons: X,
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
- }, h = C(null), $ = () => {
32
- const o = x(h);
33
- if (!o)
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 o;
36
- }, f = ({
37
- children: o,
38
- className: r = "",
39
- label: l,
40
- ...e
41
- }) => /* @__PURE__ */ n(T, { asChild: !0, children: o || /* @__PURE__ */ n(p, { className: v(i.trigger, r), ...e, children: l || "Sign in" }) }), c = (o) => {
42
- const { showCoinbaseFooter: r } = N(), { onSuccess: l } = $();
43
- return /* @__PURE__ */ n(k, { ...o, children: /* @__PURE__ */ n(
44
- w,
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
- onSuccess: l,
47
- className: `${i["sign-in"]} ${r ? "" : i["no-footer"]}`,
48
- ...o,
49
- children: /* @__PURE__ */ t(d, { children: [
50
- /* @__PURE__ */ n(q, {}),
51
- /* @__PURE__ */ t("div", { className: i.buttons, children: [
52
- /* @__PURE__ */ n(A, { className: i["back-button"] }),
53
- /* @__PURE__ */ n(B, { asChild: !0, children: /* @__PURE__ */ n(p, { "aria-label": "Close", size: "md", variant: "transparentSecondary", children: /* @__PURE__ */ n(y, { className: i["close-icon"] }) }) })
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: i["sign-in-image"], children: /* @__PURE__ */ n(V, {}) }),
56
- /* @__PURE__ */ n(z, { onSuccess: l, children: ({ authMethod: e, step: s, Form: a }) => /* @__PURE__ */ t(d, { children: [
57
- /* @__PURE__ */ t("div", { className: i["title-desc-wrapper"], children: [
58
- s === "verification" ? /* @__PURE__ */ n(m, { as: "div", children: /* @__PURE__ */ n(g, {}) }) : /* @__PURE__ */ n(g, {}),
59
- s === "credentials" ? /* @__PURE__ */ n(m, { as: "div", children: /* @__PURE__ */ n(_, { authMethod: e }) }) : /* @__PURE__ */ n(_, { authMethod: e })
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: i["sign-in-form"], children: a }),
62
- s === "credentials" && /* @__PURE__ */ n(E, { activeMethod: e })
62
+ /* @__PURE__ */ n("div", { className: e["sign-in-form"], children: d }),
63
+ a === "credentials" && /* @__PURE__ */ n(H, { activeMethod: l })
63
64
  ] }) }),
64
- r && /* @__PURE__ */ n(H, { className: i.footer })
65
+ o && /* @__PURE__ */ n(J, { className: e.footer })
65
66
  ] })
66
67
  }
67
68
  ) });
68
- }, cn = ({ children: o, open: r, setIsOpen: l, onSuccess: e }) => {
69
- I("sign_in_modal");
70
- const s = o ? u(o, f) : !1, a = o ? u(o, c) : !1, M = !s && !a, S = b(() => ({ onSuccess: e }), [e]);
71
- return /* @__PURE__ */ n(h.Provider, { value: S, children: /* @__PURE__ */ n(D, { open: r, onOpenChange: l, children: M ? /* @__PURE__ */ t(d, { children: [
72
- /* @__PURE__ */ n(f, { children: o }),
73
- /* @__PURE__ */ n(c, {})
74
- ] }) : /* @__PURE__ */ t(d, { children: [
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
- !a && /* @__PURE__ */ n(c, {})
83
+ !d && /* @__PURE__ */ n(m, {})
77
84
  ] }) }) });
78
- }, q = () => /* @__PURE__ */ t(m, { children: [
79
- /* @__PURE__ */ n(F, { asChild: !0, children: /* @__PURE__ */ n(g, { as: "span" }) }),
80
- /* @__PURE__ */ n(j, { asChild: !0, children: /* @__PURE__ */ n(_, { as: "span" }) })
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
- cn as SignInModal,
84
- c as SignInModalContent,
85
- f as SignInModalTrigger
90
+ mn as SignInModal,
91
+ m as SignInModalContent,
92
+ p as SignInModalTrigger
86
93
  };
@@ -1,5 +1,5 @@
1
- import { ElementType, HTMLAttributes, ReactNode } from 'react';
2
- interface LabelProps extends HTMLAttributes<HTMLLabelElement> {
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 _, jsx as i } from "react/jsx-runtime";
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: u = "tel-national",
19
- className: h = "",
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
- ...a
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: N,
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 = N(e);
47
+ const t = y(e);
48
48
  g?.(e), c?.(t);
49
49
  },
50
- [N, g, c]
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
- ), s = typeof p == "boolean" ? p : p.length > 0, m = !s && n ? W.find((e) => e.code === n) : void 0, y = a["aria-invalid"] && a["aria-invalid"] !== "false", I = a["data-success"] && a["data-success"] !== "false", D = w(() => {
59
- const e = [l["phone-number-input"], h];
60
- return y && e.push(l.invalid), I && e.push(l.success), !s && m && e.push(l["inline-country-calling-code"]), e.join(" ");
61
- }, [y, I, h, m, s]);
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__ */ _("div", { className: D, children: [
65
- !s && m && /* @__PURE__ */ i(U, { country: m }),
66
- s && /* @__PURE__ */ i(
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__ */ i(
74
+ /* @__PURE__ */ s(
74
75
  H,
75
76
  {
76
- ...a,
77
+ ...u,
78
+ "aria-label": "Phone number",
77
79
  ref: C,
78
80
  className: l.input,
79
- autoComplete: u,
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: u }) => /* @__PURE__ */ _("span", { className: l["country-calling-code"], children: [
91
- /* @__PURE__ */ i("span", { "aria-hidden": "true", children: u.flag }),
92
- /* @__PURE__ */ i(M, { children: u.name }),
93
- /* @__PURE__ */ _("span", { children: [
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
- u.callingCode
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 d } from "react/jsx-runtime";
2
- import { Dialog as m, DialogTitle as n, DialogDescription as _, DialogPortal as p, DialogOverlay as g, DialogContent as M, DialogClose as D, DialogTrigger as f } from "@radix-ui/react-dialog";
3
- import { c as u } from "../../../chunks/lite.1fxw3LjI.js";
4
- import { forwardRef as y, useMemo as v } from "react";
5
- import { useTheme as C } from "../../ThemeProvider/index.js";
6
- import '../../../assets/Modal.css';const T = "Modal-module__modal___MUsZA", x = "Modal-module__overlay___-RqGQ", N = "Modal-module__spacer___dIfOA", a = {
7
- modal: T,
8
- overlay: x,
9
- spacer: N
10
- }, h = y(
11
- ({ children: e, overlayClassName: r = "", overlayStyle: l, ...t }, c) => {
12
- const { cssVariables: s } = C(), i = v(
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(p, { children: /* @__PURE__ */ d(g, { className: u(a.overlay, r), style: i, children: [
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(M, { ...t, ref: c, className: a.modal, children: e })
18
+ /* @__PURE__ */ o(f, { ...i, ref: d, className: e(a.modal, t), children: r })
19
19
  ] }) });
20
20
  }
21
21
  );
22
- h.displayName = "ModalContent";
23
- const q = m, w = D, G = _, I = n, P = f;
22
+ j.displayName = "ModalContent";
23
+ const w = _, G = u, I = g, P = p, Q = y;
24
24
  export {
25
- q as Modal,
26
- w as ModalClose,
27
- h as ModalContent,
28
- G as ModalDescription,
29
- I as ModalTitle,
30
- P as ModalTrigger
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, TransitionState } from 'react-transition-state';
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 "react-transition-state";
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) => {