@coinbase/cdp-react 0.0.78 → 0.0.80

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 (164) hide show
  1. package/README.md +5 -0
  2. package/dist/assets/Badge.css +1 -0
  3. package/dist/assets/Banner.css +1 -1
  4. package/dist/assets/CDPReactProvider.css +1 -0
  5. package/dist/assets/CoinbaseFooter.css +1 -1
  6. package/dist/assets/CopyTextField.css +1 -0
  7. package/dist/assets/EnrollMfa.css +1 -0
  8. package/dist/assets/EnrollMfaDescription.css +1 -0
  9. package/dist/assets/EnrollMfaFlow.css +1 -0
  10. package/dist/assets/EnrollMfaFlowBackButton.css +1 -0
  11. package/dist/assets/EnrollMfaItems.css +1 -0
  12. package/dist/assets/EnrollMfaModal.css +1 -0
  13. package/dist/assets/EnrollMfaTitle.css +1 -0
  14. package/dist/assets/ExportWallet.css +1 -1
  15. package/dist/assets/OTPForm.css +1 -1
  16. package/dist/assets/QRCode.css +1 -0
  17. package/dist/assets/ToggleListItem.css +1 -0
  18. package/dist/assets/VerifyMfaDescription.css +1 -0
  19. package/dist/assets/VerifyMfaFlow.css +1 -0
  20. package/dist/assets/VerifyMfaImage.css +1 -0
  21. package/dist/assets/VerifyMfaInline.css +1 -0
  22. package/dist/assets/VerifyMfaTitle.css +1 -0
  23. package/dist/assets/totp.css +1 -0
  24. package/dist/chunks/CDPReactProvider.CIQm4C4z.js +299 -0
  25. package/dist/chunks/{LinkAuthFlow.3HN888DV.js → LinkAuthFlow.BaUSMzGH.js} +1 -1
  26. package/dist/chunks/index.CKQKBoX2.js +9 -0
  27. package/dist/chunks/{index.Bvudzh_y.js → index.C_DV0Ud7.js} +1 -1
  28. package/dist/chunks/index.Dp-lIxM1.js +9 -0
  29. package/dist/components/CDPReactProvider/index.d.ts +4 -1
  30. package/dist/components/CDPReactProvider/index.js +11 -79
  31. package/dist/components/CopyAddress/index.js +24 -60
  32. package/dist/components/EnrollMfa/EnrollMfaDescription.d.ts +6 -0
  33. package/dist/components/EnrollMfa/EnrollMfaDescription.js +21 -0
  34. package/dist/components/EnrollMfa/EnrollMfaFlow.d.ts +12 -0
  35. package/dist/components/EnrollMfa/EnrollMfaFlow.js +46 -0
  36. package/dist/components/EnrollMfa/EnrollMfaFlowBackButton.d.ts +9 -0
  37. package/dist/components/EnrollMfa/EnrollMfaFlowBackButton.js +39 -0
  38. package/dist/components/EnrollMfa/EnrollMfaFlowProvider.d.ts +21 -0
  39. package/dist/components/EnrollMfa/EnrollMfaFlowProvider.js +34 -0
  40. package/dist/components/EnrollMfa/EnrollMfaFooter.d.ts +2 -0
  41. package/dist/components/EnrollMfa/EnrollMfaFooter.js +7 -0
  42. package/dist/components/EnrollMfa/EnrollMfaImage.d.ts +6 -0
  43. package/dist/components/EnrollMfa/EnrollMfaImage.js +19 -0
  44. package/dist/components/EnrollMfa/EnrollMfaItem.d.ts +11 -0
  45. package/dist/components/EnrollMfa/EnrollMfaItem.js +21 -0
  46. package/dist/components/EnrollMfa/EnrollMfaItems.d.ts +9 -0
  47. package/dist/components/EnrollMfa/EnrollMfaItems.js +39 -0
  48. package/dist/components/EnrollMfa/EnrollMfaProvider.d.ts +14 -0
  49. package/dist/components/EnrollMfa/EnrollMfaProvider.js +24 -0
  50. package/dist/components/EnrollMfa/EnrollMfaTitle.d.ts +6 -0
  51. package/dist/components/EnrollMfa/EnrollMfaTitle.js +21 -0
  52. package/dist/components/EnrollMfa/index.d.ts +20 -0
  53. package/dist/components/EnrollMfa/index.js +171 -0
  54. package/dist/components/EnrollMfa/methods/totp.d.ts +6 -0
  55. package/dist/components/EnrollMfa/methods/totp.js +120 -0
  56. package/dist/components/EnrollMfa/types.d.ts +83 -0
  57. package/dist/components/EnrollMfa/types.js +2 -0
  58. package/dist/components/EnrollMfa/useEnrollMfaReducer.d.ts +3 -0
  59. package/dist/components/EnrollMfa/useEnrollMfaReducer.js +111 -0
  60. package/dist/components/EnrollMfaModal/index.d.ts +20 -0
  61. package/dist/components/EnrollMfaModal/index.js +144 -0
  62. package/dist/components/ExportWallet/index.d.ts +2 -1
  63. package/dist/components/ExportWallet/index.js +225 -165
  64. package/dist/components/ExportWalletModal/index.d.ts +7 -4
  65. package/dist/components/ExportWalletModal/index.js +9 -7
  66. package/dist/components/Fund/index.js +5 -5
  67. package/dist/components/FundModal/index.js +14 -14
  68. package/dist/components/LinkAuth/LinkAuthFlow.js +2 -2
  69. package/dist/components/LinkAuth/LinkAuthFlowBackButton.js +2 -2
  70. package/dist/components/LinkAuth/LinkAuthFlowProvider.js +2 -2
  71. package/dist/components/LinkAuth/LinkAuthItem.js +26 -45
  72. package/dist/components/LinkAuth/LinkAuthItems.js +1 -1
  73. package/dist/components/LinkAuth/LinkAuthProvider.js +1 -1
  74. package/dist/components/LinkAuth/index.js +3 -3
  75. package/dist/components/LinkAuth/types.js +1 -1
  76. package/dist/components/LinkAuth/utils.js +1 -1
  77. package/dist/components/LinkAuthModal/index.js +2 -2
  78. package/dist/components/OAuthStatusModal/index.js +1 -1
  79. package/dist/components/SignIn/SignInAuthMethodButtons.js +1 -1
  80. package/dist/components/SignIn/SignInBackButton.js +1 -1
  81. package/dist/components/SignIn/SignInDescription.js +2 -2
  82. package/dist/components/SignIn/SignInForm.js +2 -2
  83. package/dist/components/SignIn/SignInImage.js +5 -5
  84. package/dist/components/SignIn/SignInProvider.js +1 -1
  85. package/dist/components/SignIn/SignInTitle.js +2 -2
  86. package/dist/components/SignIn/flows/SignInWithEmail.js +1 -1
  87. package/dist/components/SignIn/flows/SignInWithOAuth.js +1 -1
  88. package/dist/components/SignIn/flows/SignInWithSms.js +1 -1
  89. package/dist/components/SignIn/index.js +4 -4
  90. package/dist/components/SignIn/types.js +1 -1
  91. package/dist/components/SignIn/useSignInReducer.js +1 -1
  92. package/dist/components/SignInModal/index.js +13 -13
  93. package/dist/components/ThemeProvider/index.d.ts +4 -6
  94. package/dist/components/ThemeProvider/index.js +32 -21
  95. package/dist/components/VerifyMfa/VerifyMfaDescription.d.ts +6 -0
  96. package/dist/components/VerifyMfa/VerifyMfaDescription.js +21 -0
  97. package/dist/components/VerifyMfa/VerifyMfaFlow.d.ts +11 -0
  98. package/dist/components/VerifyMfa/VerifyMfaFlow.js +19 -0
  99. package/dist/components/VerifyMfa/VerifyMfaFooter.d.ts +2 -0
  100. package/dist/components/VerifyMfa/VerifyMfaFooter.js +7 -0
  101. package/dist/components/VerifyMfa/VerifyMfaImage.d.ts +6 -0
  102. package/dist/components/VerifyMfa/VerifyMfaImage.js +21 -0
  103. package/dist/components/VerifyMfa/VerifyMfaProvider.d.ts +15 -0
  104. package/dist/components/VerifyMfa/VerifyMfaProvider.js +28 -0
  105. package/dist/components/VerifyMfa/VerifyMfaTitle.d.ts +6 -0
  106. package/dist/components/VerifyMfa/VerifyMfaTitle.js +21 -0
  107. package/dist/components/VerifyMfa/index.d.ts +16 -0
  108. package/dist/components/VerifyMfa/index.js +20 -0
  109. package/dist/components/VerifyMfa/methods/totp.d.ts +6 -0
  110. package/dist/components/VerifyMfa/methods/totp.js +69 -0
  111. package/dist/components/VerifyMfa/types.d.ts +60 -0
  112. package/dist/components/VerifyMfa/types.js +2 -0
  113. package/dist/components/VerifyMfa/useVerifyMfaReducer.d.ts +2 -0
  114. package/dist/components/VerifyMfa/useVerifyMfaReducer.js +61 -0
  115. package/dist/components/VerifyMfaInline/index.d.ts +40 -0
  116. package/dist/components/VerifyMfaInline/index.js +175 -0
  117. package/dist/components/VerifyMfaModal/index.d.ts +23 -0
  118. package/dist/components/VerifyMfaModal/index.js +19 -0
  119. package/dist/components/forms/AmountInput/index.d.ts +1 -1
  120. package/dist/components/forms/ExchangeAmountInput/index.d.ts +1 -1
  121. package/dist/components/forms/OTPForm/index.d.ts +2 -2
  122. package/dist/components/forms/OTPForm/index.js +81 -64
  123. package/dist/components/ui/Badge/index.d.ts +7 -0
  124. package/dist/components/ui/Badge/index.js +9 -0
  125. package/dist/components/ui/CopyTextField/index.d.ts +10 -0
  126. package/dist/components/ui/CopyTextField/index.js +81 -0
  127. package/dist/components/ui/Modal/index.js +4 -4
  128. package/dist/components/ui/QRCode/QRCodeSvg.d.ts +17 -0
  129. package/dist/components/ui/QRCode/QRCodeSvg.js +57 -0
  130. package/dist/components/ui/QRCode/index.d.ts +5 -0
  131. package/dist/components/ui/QRCode/index.js +31 -0
  132. package/dist/components/ui/QRCode/useCorners.d.ts +1 -0
  133. package/dist/components/ui/QRCode/useCorners.js +72 -0
  134. package/dist/components/ui/QRCode/useDotsPath.d.ts +11 -0
  135. package/dist/components/ui/QRCode/useDotsPath.js +66 -0
  136. package/dist/components/ui/QRCode/useLogo.d.ts +12 -0
  137. package/dist/components/ui/QRCode/useLogo.js +52 -0
  138. package/dist/components/ui/QRCode/useMatrix.d.ts +1 -0
  139. package/dist/components/ui/QRCode/useMatrix.js +17 -0
  140. package/dist/components/ui/ToggleListItem/index.d.ts +15 -0
  141. package/dist/components/ui/ToggleListItem/index.js +52 -0
  142. package/dist/hooks/useKeyExportPostMessage.js +67 -55
  143. package/dist/hooks/useVerifyMfaModal.d.ts +22 -0
  144. package/dist/hooks/useVerifyMfaModal.js +10 -0
  145. package/dist/icons/IconCoinbaseWordmark.js +10 -13
  146. package/dist/icons/IconPinCode.d.ts +2 -0
  147. package/dist/icons/IconPinCode.js +13 -0
  148. package/dist/icons/IconShield.d.ts +2 -0
  149. package/dist/icons/IconShield.js +7 -0
  150. package/dist/icons/IconSmartPhone.d.ts +2 -0
  151. package/dist/icons/IconSmartPhone.js +7 -0
  152. package/dist/icons/index.d.ts +5 -2
  153. package/dist/icons/index.js +22 -16
  154. package/dist/index.d.ts +6 -0
  155. package/dist/index.js +220 -165
  156. package/dist/theme/theme.d.ts +104 -0
  157. package/dist/theme/tokens.d.ts +312 -0
  158. package/dist/theme/tokens.js +70 -0
  159. package/dist/utils/transition.d.ts +2 -2
  160. package/dist/version.d.ts +1 -1
  161. package/dist/version.js +1 -1
  162. package/package.json +9 -7
  163. package/dist/assets/CopyAddress.css +0 -1
  164. package/dist/assets/LinkAuthItem.css +0 -1
@@ -14,6 +14,7 @@ interface ExportWalletProps extends Omit<HTMLAttributes<HTMLDivElement>, "childr
14
14
  onCopySuccess?: () => void;
15
15
  onIframeError?: (error?: string) => void;
16
16
  onIframeSessionExpired?: () => void;
17
+ skipMfa?: boolean;
17
18
  }
18
19
  interface ExportWalletContext extends Pick<ExportWalletProps, "address" | "onIframeReady" | "onCopySuccess" | "onIframeError" | "onIframeSessionExpired"> {
19
20
  type: "evm-eoa" | "evm-smart" | "solana";
@@ -27,5 +28,5 @@ declare const ExportWalletWarning: (props: HTMLAttributes<HTMLDivElement>) => im
27
28
  declare const ExportWalletCopyAddress: ({ label, ...props }: ExportWalletCopyAddressProps) => import("react/jsx-runtime").JSX.Element;
28
29
  declare const ExportWalletCopyKeyButton: ({ fullWidth, ...props }: ExportWalletCopyKeyButtonProps) => import("react/jsx-runtime").JSX.Element | null;
29
30
  declare const ExportWalletFooter: (props: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
30
- declare const ExportWallet: ({ address, children, className, onIframeError, onIframeReady, onIframeSessionExpired, onCopySuccess, ...props }: ExportWalletProps) => import("react/jsx-runtime").JSX.Element;
31
+ declare const ExportWallet: ({ address, children, className, onIframeError, onIframeReady, onIframeSessionExpired, onCopySuccess, skipMfa, ...props }: ExportWalletProps) => import("react/jsx-runtime").JSX.Element;
31
32
  export { ExportWallet, ExportWalletCopyAddress, ExportWalletCopyKeyButton, ExportWalletFooter, ExportWalletTitle, ExportWalletWarning, type ExportWalletProps, type ExportWalletCopyAddressProps, type ExportWalletCopyKeyButtonProps, type ExportWalletTitleProps, };
@@ -1,20 +1,23 @@
1
- import { u as S, A as K } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
2
- import { createContext as N, useMemo as x, useState as V, useCallback as Y, useContext as A } from "react";
3
- import { VERSION as z } from "../../version.js";
1
+ import { u as S, A as z } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
2
+ import { createContext as A, useContext as k, useMemo as h, useState as D, useCallback as L } from "react";
3
+ import { VERSION as U } from "../../version.js";
4
4
  import "../AuthButton/index.js";
5
- import { useAppConfig as g } from "../CDPReactProvider/index.js";
6
- import { CopyAddress as D } from "../CopyAddress/index.js";
7
- import { CopyEvmKeyButton as U } from "../CopyEvmKeyButton/index.js";
8
- import { CopySolanaKeyButton as X } from "../CopySolanaKeyButton/index.js";
9
- import { jsx as o, jsxs as d, Fragment as E } from "react/jsx-runtime";
10
- import { useCurrentUser as Z } from "@coinbase/cdp-hooks";
11
- import { c as h } from "../../chunks/lite.1fxw3LjI.js";
12
- import { Banner as _ } from "../ui/Banner/index.js";
13
- import { CoinbaseFooter as $ } from "../ui/CoinbaseFooter/index.js";
14
- import { Button as T } from "../ui/Button/index.js";
15
- import { Modal as q, ModalClose as H, ModalContent as L, ModalTitle as G, ModalTrigger as J } from "../ui/Modal/index.js";
16
- import { IconXMark as Q } from "../../icons/IconXMark.js";
17
- import { childrenHasComponent as M } from "../../utils/childrenHasComponent.js";
5
+ import { u as b } from "../../chunks/CDPReactProvider.CIQm4C4z.js";
6
+ import { CopyAddress as q } from "../CopyAddress/index.js";
7
+ import { CopyEvmKeyButton as H } from "../CopyEvmKeyButton/index.js";
8
+ import { CopySolanaKeyButton as J } from "../CopySolanaKeyButton/index.js";
9
+ import "../EnrollMfa/index.js";
10
+ import "../EnrollMfaModal/index.js";
11
+ import { jsx as t, jsxs as _, Fragment as y } from "react/jsx-runtime";
12
+ import { useCurrentUser as X } from "@coinbase/cdp-hooks";
13
+ import { c as m } from "../../chunks/lite.1fxw3LjI.js";
14
+ import { Banner as w } from "../ui/Banner/index.js";
15
+ import { CoinbaseFooter as C } from "../ui/CoinbaseFooter/index.js";
16
+ import { VerifyMfaInline as F, VerifyMfaInlineFlow as I, useVerifyMfaInlineContext as Z } from "../VerifyMfaInline/index.js";
17
+ import { Button as R } from "../ui/Button/index.js";
18
+ import { Modal as $, ModalClose as G, ModalContent as Q, ModalTitle as tt, ModalTrigger as ot } from "../ui/Modal/index.js";
19
+ import { IconXMark as et } from "../../icons/IconXMark.js";
20
+ import { childrenHasComponent as g } from "../../utils/childrenHasComponent.js";
18
21
  import "../Fund/index.js";
19
22
  import "../FundModal/index.js";
20
23
  import "../LinkAuth/index.js";
@@ -42,9 +45,12 @@ import "../../icons/IconExclamationCircle.js";
42
45
  import "../../icons/IconExclamationTriangle.js";
43
46
  import "../../icons/IconGoogleLogo.js";
44
47
  import "../../icons/IconLock.js";
45
- import "../../icons/IconPhone.js";
46
48
  import "../../icons/IconMinus.js";
49
+ import "../../icons/IconPhone.js";
50
+ import "../../icons/IconPinCode.js";
47
51
  import "../../icons/IconPlus.js";
52
+ import "../../icons/IconShield.js";
53
+ import "../../icons/IconSmartPhone.js";
48
54
  import "../../utils/clamp.js";
49
55
  import "../../utils/getMessageFromUnknownError.js";
50
56
  import "../../utils/isApiError.js";
@@ -52,10 +58,20 @@ import "../../utils/isEmailInvalid.js";
52
58
  import "../../utils/parseValuesFromPhoneNumber.js";
53
59
  import "../../utils/sendIframeMessage.js";
54
60
  import "@coinbase/cdp-core";
61
+ import "../EnrollMfa/EnrollMfaDescription.js";
62
+ import "../EnrollMfa/EnrollMfaFlow.js";
63
+ import "../EnrollMfa/EnrollMfaFlowBackButton.js";
64
+ import "../EnrollMfa/EnrollMfaFooter.js";
65
+ import "../EnrollMfa/EnrollMfaImage.js";
66
+ import "../EnrollMfa/EnrollMfaItem.js";
67
+ import "../EnrollMfa/EnrollMfaItems.js";
68
+ import "../EnrollMfa/EnrollMfaTitle.js";
69
+ import "../EnrollMfa/EnrollMfaProvider.js";
70
+ import "../EnrollMfa/EnrollMfaFlowProvider.js";
55
71
  import "../Fund/FundForm.js";
56
72
  import "../Fund/FundTitle.js";
57
73
  import "../Fund/FundProvider.js";
58
- import "../../chunks/LinkAuthFlow.3HN888DV.js";
74
+ import "../../chunks/LinkAuthFlow.BaUSMzGH.js";
59
75
  import "../LinkAuth/LinkAuthFlowBackButton.js";
60
76
  import "../LinkAuth/LinkAuthItem.js";
61
77
  import "../LinkAuth/LinkAuthItems.js";
@@ -69,243 +85,287 @@ import "../SignIn/SignInForm.js";
69
85
  import "../SignIn/SignInImage.js";
70
86
  import "../SignIn/SignInTitle.js";
71
87
  import "../SignIn/SignInProvider.js";
72
- import '../../assets/ExportWallet.css';const tt = "ExportWallet-module__footer___NvrFY", f = {
88
+ import "../VerifyMfa/VerifyMfaDescription.js";
89
+ import "../VerifyMfa/VerifyMfaFooter.js";
90
+ import "../VerifyMfa/VerifyMfaFlow.js";
91
+ import "../VerifyMfa/VerifyMfaImage.js";
92
+ import "../VerifyMfa/VerifyMfaTitle.js";
93
+ import "../VerifyMfa/VerifyMfaProvider.js";
94
+ import '../../assets/ExportWallet.css';const rt = "ExportWallet-module__footer___NvrFY", E = {
73
95
  "export-wallet": "ExportWallet-module__export-wallet___EyZys",
74
96
  "no-footer": "ExportWallet-module__no-footer___fzl3R",
97
+ "flex-container": "ExportWallet-module__flex-container___-vm5t",
75
98
  "export-wallet-title": "ExportWallet-module__export-wallet-title___MuI09",
76
- footer: tt
77
- }, k = N({
99
+ footer: rt
100
+ }, T = A({
78
101
  address: "",
79
102
  isSessionExpired: !1,
80
103
  type: "evm-eoa"
81
- }), C = () => {
82
- const t = A(k);
83
- if (!t)
104
+ }), W = () => {
105
+ const o = k(T);
106
+ if (!o)
84
107
  throw new Error("useExportWalletContext must be used within a ExportWalletProvider");
85
- return t;
86
- }, ot = ({
87
- address: t,
108
+ return o;
109
+ }, at = ({
110
+ address: o,
88
111
  children: e,
89
112
  onIframeError: r,
90
113
  onIframeReady: a,
91
- onIframeSessionExpired: l,
114
+ onIframeSessionExpired: n,
92
115
  onCopySuccess: s
93
116
  }) => {
94
- const { currentUser: n } = Z(), i = x(
95
- () => !!n?.solanaAccountObjects?.find((w) => w.address === t),
96
- [n?.solanaAccountObjects, t]
97
- ), m = x(
98
- () => !!n?.evmSmartAccountObjects?.find((w) => w.address === t),
99
- [n?.evmSmartAccountObjects, t]
100
- ), c = i ? "solana" : m ? "evm-smart" : "evm-eoa", [u, y] = V(!1), v = Y(() => {
101
- y(!0), l?.();
102
- }, [l]), B = x(
117
+ const { currentUser: i } = X(), c = h(
118
+ () => !!i?.solanaAccountObjects?.find((v) => v.address === o),
119
+ [i?.solanaAccountObjects, o]
120
+ ), d = h(
121
+ () => !!i?.evmSmartAccountObjects?.find((v) => v.address === o),
122
+ [i?.evmSmartAccountObjects, o]
123
+ ), u = c ? "solana" : d ? "evm-smart" : "evm-eoa", [p, x] = D(!1), f = L(() => {
124
+ x(!0), n?.();
125
+ }, [n]), Y = h(
103
126
  () => ({
104
- address: t,
105
- isSessionExpired: u,
106
- type: c,
127
+ address: o,
128
+ isSessionExpired: p,
129
+ type: u,
107
130
  onIframeError: r,
108
131
  onIframeReady: a,
109
- onIframeSessionExpired: v,
132
+ onIframeSessionExpired: f,
110
133
  onCopySuccess: s
111
134
  }),
112
135
  [
113
- t,
136
+ o,
137
+ p,
114
138
  u,
115
- c,
116
- v,
139
+ f,
117
140
  r,
118
141
  a,
119
142
  s
120
143
  ]
121
144
  );
122
- return /* @__PURE__ */ o(k.Provider, { value: B, children: e });
123
- }, P = ({
124
- children: t,
145
+ return /* @__PURE__ */ t(T.Provider, { value: Y, children: e });
146
+ }, lt = ({
147
+ children: o,
125
148
  className: e = "",
126
149
  as: r = "h2",
127
150
  ...a
128
- }) => /* @__PURE__ */ o(
151
+ }) => /* @__PURE__ */ t(
129
152
  r,
130
153
  {
131
154
  "data-part": "title",
132
- className: h(f["export-wallet-title"], e),
155
+ className: m(E["export-wallet-title"], e),
133
156
  ...a,
134
- children: t || "Export your wallet"
157
+ children: o || "Export your wallet"
135
158
  }
136
- ), F = (t) => {
137
- const { isSessionExpired: e, type: r } = C();
138
- return e ? /* @__PURE__ */ o(_, { "data-part": "warning", variant: "warning", ...t, children: "Your export session has expired." }) : r === "evm-smart" ? /* @__PURE__ */ o(_, { "data-part": "warning", variant: "warning", ...t, children: "Cannot export a smart account's private key; only the owner's private key can be exported." }) : /* @__PURE__ */ o(_, { "data-part": "warning", variant: "warning", ...t, children: "Do not share your private key with anyone" });
139
- }, I = ({
140
- label: t = "Your wallet address",
159
+ ), P = (o) => {
160
+ const { isSessionExpired: e, type: r } = W();
161
+ return e ? /* @__PURE__ */ t(w, { "data-part": "warning", variant: "warning", ...o, children: "Your export session has expired." }) : r === "evm-smart" ? /* @__PURE__ */ t(w, { "data-part": "warning", variant: "warning", ...o, children: "Cannot export a smart account's private key; only the owner's private key can be exported." }) : /* @__PURE__ */ t(w, { "data-part": "warning", variant: "warning", ...o, children: "Do not share your private key with anyone" });
162
+ }, j = ({
163
+ label: o = "Your wallet address",
141
164
  ...e
142
165
  }) => {
143
- const { address: r } = C();
144
- return /* @__PURE__ */ o(D, { "data-part": "copy-address", address: r, label: t, ...e });
166
+ const { address: r } = W();
167
+ return /* @__PURE__ */ t(q, { "data-part": "copy-address", address: r, label: o, ...e });
145
168
  }, O = ({
146
- fullWidth: t = !0,
169
+ fullWidth: o = !0,
147
170
  ...e
148
171
  }) => {
149
- const { address: r, type: a, onIframeError: l, onIframeReady: s, onIframeSessionExpired: n, onCopySuccess: i } = C();
150
- return a === "solana" ? /* @__PURE__ */ o(
151
- X,
172
+ const { address: r, type: a, onIframeError: n, onIframeReady: s, onIframeSessionExpired: i, onCopySuccess: c } = W();
173
+ return a === "solana" ? /* @__PURE__ */ t(
174
+ J,
152
175
  {
153
- fullWidth: t,
176
+ fullWidth: o,
154
177
  address: r,
155
- onError: l,
178
+ onError: n,
156
179
  onReady: s,
157
- onSessionExpired: n,
158
- onSuccess: i,
180
+ onSessionExpired: i,
181
+ onSuccess: c,
159
182
  ...e
160
183
  }
161
- ) : a === "evm-eoa" ? /* @__PURE__ */ o(
162
- U,
184
+ ) : a === "evm-eoa" ? /* @__PURE__ */ t(
185
+ H,
163
186
  {
164
- fullWidth: t,
187
+ fullWidth: o,
165
188
  address: r,
166
- onError: l,
189
+ onError: n,
167
190
  onReady: s,
168
- onSessionExpired: n,
169
- onSuccess: i,
191
+ onSessionExpired: i,
192
+ onSuccess: c,
170
193
  ...e
171
194
  }
172
195
  ) : null;
173
- }, R = (t) => /* @__PURE__ */ o($, { "data-part": "coinbase-footer", ...t }), et = ({ children: t }) => {
174
- const { showCoinbaseFooter: e } = g(), { type: r, isSessionExpired: a } = C();
175
- return t && typeof t == "function" ? t({ type: r, isSessionExpired: a }) : t || /* @__PURE__ */ d(E, { children: [
176
- /* @__PURE__ */ o(P, {}),
177
- /* @__PURE__ */ o(F, {}),
178
- /* @__PURE__ */ o(I, {}),
179
- /* @__PURE__ */ o(O, {}),
180
- e && /* @__PURE__ */ o(R, { className: f.footer })
196
+ }, nt = (o) => /* @__PURE__ */ t(C, { "data-part": "coinbase-footer", ...o }), it = ({ children: o }) => {
197
+ const { showCoinbaseFooter: e } = b(), { type: r, isSessionExpired: a } = W();
198
+ return o && typeof o == "function" ? o({ type: r, isSessionExpired: a }) : o || /* @__PURE__ */ _(y, { children: [
199
+ /* @__PURE__ */ t(lt, {}),
200
+ /* @__PURE__ */ t(P, {}),
201
+ /* @__PURE__ */ t(j, {}),
202
+ /* @__PURE__ */ t(O, {}),
203
+ e && /* @__PURE__ */ t(nt, { className: E.footer })
181
204
  ] });
182
- }, rt = ({
183
- address: t,
205
+ }, st = ({
206
+ address: o,
184
207
  children: e,
185
208
  className: r = "",
186
209
  onIframeError: a,
187
- onIframeReady: l,
210
+ onIframeReady: n,
188
211
  onIframeSessionExpired: s,
189
- onCopySuccess: n,
190
- ...i
212
+ onCopySuccess: i,
213
+ skipMfa: c = !1,
214
+ ...d
191
215
  }) => {
192
216
  S("export_wallet");
193
- const { showCoinbaseFooter: m } = g();
194
- return /* @__PURE__ */ o(
217
+ const { showCoinbaseFooter: u } = b(), p = /* @__PURE__ */ t(
218
+ at,
219
+ {
220
+ address: o,
221
+ onIframeReady: n,
222
+ onCopySuccess: i,
223
+ onIframeError: a,
224
+ onIframeSessionExpired: s,
225
+ children: /* @__PURE__ */ t(it, { children: e })
226
+ }
227
+ );
228
+ return /* @__PURE__ */ t(
195
229
  "div",
196
230
  {
197
- className: h(
198
- f["export-wallet"],
199
- !m && f["no-footer"],
231
+ className: m(
232
+ E["export-wallet"],
233
+ !u && E["no-footer"],
200
234
  r
201
235
  ),
202
- ...i,
203
- children: /* @__PURE__ */ o(
204
- ot,
205
- {
206
- address: t,
207
- onIframeReady: l,
208
- onCopySuccess: n,
209
- onIframeError: a,
210
- onIframeSessionExpired: s,
211
- children: /* @__PURE__ */ o(et, { children: e })
212
- }
213
- )
236
+ ...d,
237
+ children: c ? p : /* @__PURE__ */ t(F, { verifyFirst: !0, children: /* @__PURE__ */ t(I, { transition: "fade", children: /* @__PURE__ */ t("div", { className: m(E["flex-container"]), children: p }) }) })
214
238
  }
215
239
  );
216
- }, at = "ExportWalletModal-module__trigger___zMk8N", nt = "ExportWalletModal-module__content___KzNol", lt = "ExportWalletModal-module__footer___byg1T", st = "ExportWalletModal-module__modal___pX1AP", p = {
240
+ }, pt = "ExportWalletModal-module__wrapper___r1E1L", mt = "ExportWalletModal-module__trigger___zMk8N", ct = "ExportWalletModal-module__content___KzNol", dt = "ExportWalletModal-module__footer___byg1T", ut = "ExportWalletModal-module__modal___pX1AP", l = {
217
241
  "export-wallet": "ExportWalletModal-module__export-wallet___--L56",
218
- trigger: at,
242
+ "in-mfa-flow": "ExportWalletModal-module__in-mfa-flow___9Fe8k",
243
+ wrapper: pt,
244
+ "no-footer": "ExportWalletModal-module__no-footer___J8uj2",
245
+ trigger: mt,
219
246
  "title-bar": "ExportWalletModal-module__title-bar___RTPZq",
220
- content: nt,
247
+ "title-bar-space-bottom": "ExportWalletModal-module__title-bar-space-bottom___l-NvR",
248
+ "export-wallet-title": "ExportWalletModal-module__export-wallet-title___2k0L-",
249
+ content: ct,
221
250
  "close-button": "ExportWalletModal-module__close-button___ImsDR",
222
251
  "close-icon": "ExportWalletModal-module__close-icon___iAfyT",
223
- footer: lt,
224
- modal: st
225
- }, j = N(null), it = () => {
226
- const t = A(j);
227
- if (!t)
252
+ footer: dt,
253
+ "footer-space-top": "ExportWalletModal-module__footer-space-top___URl9q",
254
+ "visually-hidden": "ExportWalletModal-module__visually-hidden___JAcNA",
255
+ modal: ut
256
+ }, V = A(null), _t = () => {
257
+ const o = k(V);
258
+ if (!o)
228
259
  throw new Error("useExportWalletModalContext must be used within a ExportWalletModal");
229
- return t;
230
- }, b = ({
231
- children: t,
260
+ return o;
261
+ }, N = ({
262
+ children: o,
232
263
  className: e = "",
233
264
  label: r,
234
265
  ...a
235
- }) => /* @__PURE__ */ o(J, { asChild: !0, children: t || /* @__PURE__ */ o(T, { className: h(p.trigger, e), ...a, children: r || "Export wallet" }) }), pt = ({
236
- children: t = "Copy private key to export wallet",
237
- ...e
238
- }) => /* @__PURE__ */ o(G, { asChild: !0, children: /* @__PURE__ */ o(P, { ...e, children: t }) }), mt = ({ children: t }) => /* @__PURE__ */ o(H, { asChild: !0, children: t || /* @__PURE__ */ o(
239
- T,
266
+ }) => /* @__PURE__ */ t(ot, { asChild: !0, children: o || /* @__PURE__ */ t(R, { className: m(l.trigger, e), ...a, children: r || "Export wallet" }) }), B = ({
267
+ children: o = "Copy private key to export wallet",
268
+ as: e = "h2",
269
+ className: r = "",
270
+ ...a
271
+ }) => /* @__PURE__ */ t(tt, { asChild: !0, children: /* @__PURE__ */ t(e, { className: m(l["export-wallet-title"], r), ...a, children: o }) }), K = ({ children: o }) => /* @__PURE__ */ t(G, { asChild: !0, children: o || /* @__PURE__ */ t(
272
+ R,
240
273
  {
241
274
  "aria-label": "Close",
242
- className: p["close-button"],
275
+ className: l["close-button"],
243
276
  variant: "transparentSecondary",
244
- children: /* @__PURE__ */ o(Q, { className: p["close-icon"] })
277
+ children: /* @__PURE__ */ t(et, { className: l["close-icon"] })
245
278
  }
246
- ) }), W = ({
247
- children: t,
279
+ ) }), xt = ({ children: o }) => {
280
+ const { view: e } = Z();
281
+ return /* @__PURE__ */ _("div", { className: l["title-bar"], children: [
282
+ /* @__PURE__ */ t(B, { className: m(e === "content" ? "" : l["visually-hidden"]), children: o }),
283
+ /* @__PURE__ */ t(K, {})
284
+ ] });
285
+ }, M = ({
286
+ children: o,
248
287
  className: e = "",
249
- ...r
288
+ title: r,
289
+ ...a
250
290
  }) => {
251
- const { showCoinbaseFooter: a } = g(), { address: l, onIframeReady: s, onCopySuccess: n, onIframeError: i, onIframeSessionExpired: m } = it();
252
- return /* @__PURE__ */ o(L, { "aria-describedby": void 0, className: h(p.modal, e), ...r, children: /* @__PURE__ */ o(
253
- rt,
291
+ const { showCoinbaseFooter: n } = b(), { address: s, onIframeReady: i, onCopySuccess: c, onIframeError: d, onIframeSessionExpired: u, skipMfa: p } = _t(), x = /* @__PURE__ */ t(
292
+ st,
254
293
  {
255
- address: l,
256
- onIframeReady: s,
257
- onCopySuccess: n,
258
- onIframeError: i,
259
- onIframeSessionExpired: m,
260
- className: p["export-wallet"],
261
- children: t || (({ isSessionExpired: c }) => /* @__PURE__ */ d(E, { children: [
262
- /* @__PURE__ */ d("div", { className: p["title-bar"], children: [
263
- /* @__PURE__ */ o(pt, {}),
264
- /* @__PURE__ */ o(mt, {})
294
+ address: s,
295
+ onIframeReady: i,
296
+ onCopySuccess: c,
297
+ onIframeError: d,
298
+ onIframeSessionExpired: u,
299
+ className: m(l["export-wallet"], !p && l["in-mfa-flow"]),
300
+ skipMfa: !0,
301
+ children: o || (({ isSessionExpired: f }) => /* @__PURE__ */ _(y, { children: [
302
+ p && /* @__PURE__ */ _("div", { className: m(l["title-bar"], l["title-bar-space-bottom"]), children: [
303
+ /* @__PURE__ */ t(B, {}),
304
+ /* @__PURE__ */ t(K, {})
265
305
  ] }),
266
- /* @__PURE__ */ d("div", { className: p.content, children: [
267
- c ? /* @__PURE__ */ o(_, { role: "alert", "data-part": "warning", variant: "warning", children: "Your export session has expired. Please close and reopen the modal to export again." }) : /* @__PURE__ */ o(F, {}),
268
- /* @__PURE__ */ o(I, {}),
269
- /* @__PURE__ */ o(O, {}),
270
- a && /* @__PURE__ */ o(R, { className: p.footer })
306
+ /* @__PURE__ */ _("div", { className: l.content, children: [
307
+ f ? /* @__PURE__ */ t(w, { role: "alert", "data-part": "warning", variant: "warning", children: "Your export session has expired. Please close and reopen the modal to export again." }) : /* @__PURE__ */ t(P, {}),
308
+ /* @__PURE__ */ t(j, {}),
309
+ /* @__PURE__ */ t(O, {}),
310
+ p && n && /* @__PURE__ */ t(C, { className: l.footer })
271
311
  ] })
272
312
  ] }))
273
313
  }
314
+ );
315
+ return /* @__PURE__ */ t(Q, { "aria-describedby": void 0, className: m(l.modal, e), ...a, children: p ? x : /* @__PURE__ */ _(
316
+ F,
317
+ {
318
+ className: m(l.wrapper, n ? "" : l["no-footer"]),
319
+ verifyFirst: !0,
320
+ children: [
321
+ /* @__PURE__ */ t(xt, { children: r }),
322
+ /* @__PURE__ */ t(I, { transition: "fade", children: x }),
323
+ n && /* @__PURE__ */ t(C, { className: m(l.footer, l["footer-space-top"]) })
324
+ ]
325
+ }
274
326
  ) });
275
- }, Ao = ({
276
- address: t,
327
+ }, ee = ({
328
+ address: o,
277
329
  children: e,
278
330
  onIframeReady: r,
279
331
  onCopySuccess: a,
280
- onIframeError: l,
332
+ onIframeError: n,
281
333
  onIframeSessionExpired: s,
282
- open: n,
283
- setIsOpen: i
334
+ open: i,
335
+ setIsOpen: c,
336
+ skipMfa: d = !1
284
337
  }) => {
285
338
  S("export_wallet_modal");
286
- const m = x(
287
- () => ({ address: t, onIframeReady: r, onCopySuccess: a, onIframeError: l, onIframeSessionExpired: s }),
288
- [t, r, a, l, s]
289
- ), c = e ? M(e, b) : !1, u = e ? M(e, W) : !1, y = !c && !u;
290
- return /* @__PURE__ */ o(j.Provider, { value: m, children: /* @__PURE__ */ o(q, { open: n, onOpenChange: i, children: y ? /* @__PURE__ */ d(E, { children: [
291
- /* @__PURE__ */ o(b, { children: e }),
292
- /* @__PURE__ */ o(W, {})
293
- ] }) : /* @__PURE__ */ d(E, { children: [
339
+ const u = h(
340
+ () => ({
341
+ address: o,
342
+ onIframeReady: r,
343
+ onCopySuccess: a,
344
+ onIframeError: n,
345
+ onIframeSessionExpired: s,
346
+ skipMfa: d
347
+ }),
348
+ [o, r, a, n, s, d]
349
+ ), p = e ? g(e, N) : !1, x = e ? g(e, M) : !1, f = !p && !x;
350
+ return /* @__PURE__ */ t(V.Provider, { value: u, children: /* @__PURE__ */ t($, { open: i, onOpenChange: c, children: f ? /* @__PURE__ */ _(y, { children: [
351
+ /* @__PURE__ */ t(N, { children: e }),
352
+ /* @__PURE__ */ t(M, {})
353
+ ] }) : /* @__PURE__ */ _(y, { children: [
294
354
  e,
295
- !u && /* @__PURE__ */ o(W, {})
355
+ !x && /* @__PURE__ */ t(M, {})
296
356
  ] }) }) });
297
357
  };
298
- K.registerPackageVersion("react", z);
358
+ z.registerPackageVersion("react", U);
299
359
  export {
300
- Ao as E,
301
- rt as ExportWallet,
302
- I as ExportWalletCopyAddress,
360
+ ee as E,
361
+ st as ExportWallet,
362
+ j as ExportWalletCopyAddress,
303
363
  O as ExportWalletCopyKeyButton,
304
- R as ExportWalletFooter,
305
- P as ExportWalletTitle,
306
- F as ExportWalletWarning,
307
- mt as a,
308
- W as b,
309
- pt as c,
310
- b as d
364
+ nt as ExportWalletFooter,
365
+ lt as ExportWalletTitle,
366
+ P as ExportWalletWarning,
367
+ K as a,
368
+ M as b,
369
+ B as c,
370
+ N as d
311
371
  };
@@ -6,7 +6,9 @@ interface ExportWalletModalTriggerProps extends Partial<Pick<ButtonProps, "class
6
6
  children?: ReactNode;
7
7
  label?: ReactNode;
8
8
  }
9
- type ExportWalletModalContentProps = Omit<ModalContentProps, "children"> & Pick<ExportWalletProps, "children">;
9
+ type ExportWalletModalContentProps = Omit<ModalContentProps, "children"> & Pick<ExportWalletProps, "children"> & {
10
+ title?: ReactNode;
11
+ };
10
12
  type ExportWalletModalTitleProps = ExportWalletTitleProps;
11
13
  interface ExportWalletModalCloseProps {
12
14
  children?: ReactNode;
@@ -15,10 +17,11 @@ interface ExportWalletModalProps extends Pick<ExportWalletProps, "address" | "on
15
17
  children?: ReactNode;
16
18
  open?: boolean;
17
19
  setIsOpen?: (value: boolean) => void;
20
+ skipMfa?: boolean;
18
21
  }
19
22
  declare const ExportWalletModalTrigger: ({ children, className, label, ...props }: ExportWalletModalTriggerProps) => import("react/jsx-runtime").JSX.Element;
20
- declare const ExportWalletModalTitle: ({ children, ...props }: ExportWalletModalTitleProps) => import("react/jsx-runtime").JSX.Element;
23
+ declare const ExportWalletModalTitle: ({ children, as: Component, className, ...props }: ExportWalletModalTitleProps) => import("react/jsx-runtime").JSX.Element;
21
24
  declare const ExportWalletModalClose: ({ children }: ExportWalletModalCloseProps) => import("react/jsx-runtime").JSX.Element;
22
- declare const ExportWalletModalContent: ({ children, className, ...props }: ExportWalletModalContentProps) => import("react/jsx-runtime").JSX.Element;
23
- declare const ExportWalletModal: ({ address, children, onIframeReady, onCopySuccess, onIframeError, onIframeSessionExpired, open, setIsOpen, }: ExportWalletModalProps) => import("react/jsx-runtime").JSX.Element;
25
+ declare const ExportWalletModalContent: ({ children, className, title, ...props }: ExportWalletModalContentProps) => import("react/jsx-runtime").JSX.Element;
26
+ declare const ExportWalletModal: ({ address, children, onIframeReady, onCopySuccess, onIframeError, onIframeSessionExpired, open, setIsOpen, skipMfa, }: ExportWalletModalProps) => import("react/jsx-runtime").JSX.Element;
24
27
  export { ExportWalletModal, ExportWalletModalClose, ExportWalletModalContent, ExportWalletModalTitle, ExportWalletModalTrigger, type ExportWalletModalProps, type ExportWalletModalCloseProps, type ExportWalletModalContentProps, type ExportWalletModalTitleProps, type ExportWalletModalTriggerProps, };
@@ -2,17 +2,19 @@ import "react/jsx-runtime";
2
2
  import "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
3
3
  import "react";
4
4
  import "../../chunks/lite.1fxw3LjI.js";
5
- import "../CDPReactProvider/index.js";
6
- import { E, a as M, b as W, c as g, d as n } from "../ExportWallet/index.js";
5
+ import "../../chunks/CDPReactProvider.CIQm4C4z.js";
6
+ import { E as W, a as g, b as n, c as C, d as T } from "../ExportWallet/index.js";
7
7
  import "../ui/Banner/index.js";
8
8
  import "../ui/Button/index.js";
9
9
  import "../ui/Modal/index.js";
10
10
  import "../../icons/IconXMark.js";
11
11
  import "../../utils/childrenHasComponent.js";
12
+ import "../ui/CoinbaseFooter/index.js";
13
+ import "../VerifyMfaInline/index.js";
12
14
  export {
13
- E as ExportWalletModal,
14
- M as ExportWalletModalClose,
15
- W as ExportWalletModalContent,
16
- g as ExportWalletModalTitle,
17
- n as ExportWalletModalTrigger
15
+ W as ExportWalletModal,
16
+ g as ExportWalletModalClose,
17
+ n as ExportWalletModalContent,
18
+ C as ExportWalletModalTitle,
19
+ T as ExportWalletModalTrigger
18
20
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as n, jsxs as i, Fragment as f } from "react/jsx-runtime";
2
2
  import { u as p } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
3
- import { useId as c } from "react";
4
- import { useAppConfig as F } from "../CDPReactProvider/index.js";
5
- import { CoinbaseFooter as a } from "../ui/CoinbaseFooter/index.js";
3
+ import { useId as a } from "react";
4
+ import { u as c } from "../../chunks/CDPReactProvider.CIQm4C4z.js";
5
+ import { CoinbaseFooter as F } from "../ui/CoinbaseFooter/index.js";
6
6
  import { FundForm as l } from "./FundForm.js";
7
7
  import { FundProvider as C, useFundContext as _ } from "./FundProvider.js";
8
8
  import { FundTitle as b } from "./FundTitle.js";
@@ -23,13 +23,13 @@ import '../../assets/Fund.css';const g = "Fund-module__fund___6j-Og", h = {
23
23
  submitLabel: e,
24
24
  title: s
25
25
  }) => {
26
- const { state: u } = _(), t = c(), { showCoinbaseFooter: m } = F();
26
+ const { state: u } = _(), t = a(), { showCoinbaseFooter: m } = c();
27
27
  return x(), o ? typeof o == "function" ? o(u) : o : /* @__PURE__ */ n(l, { "aria-labelledby": t, openIn: r, submitLabel: e, children: ({ Content: d }) => /* @__PURE__ */ i(f, { children: [
28
28
  /* @__PURE__ */ n(b, { id: t, children: s }),
29
29
  d,
30
30
  m && /* @__PURE__ */ n(v, {})
31
31
  ] }) });
32
- }, v = (o) => /* @__PURE__ */ n(a, { ...o });
32
+ }, v = (o) => /* @__PURE__ */ n(F, { ...o });
33
33
  export {
34
34
  N as Fund,
35
35
  v as FundFooter,