@coinbase/cdp-react 0.0.62 → 0.0.64

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 (29) hide show
  1. package/README.md +5 -0
  2. package/dist/assets/ExportWallet.css +1 -1
  3. package/dist/assets/IframeButton.css +1 -1
  4. package/dist/chunks/{LinkAuthFlow.CxSnHF2p.js → LinkAuthFlow.3HN888DV.js} +2 -2
  5. package/dist/components/CopyAddress/index.d.ts +1 -1
  6. package/dist/components/CopyAddress/index.js +16 -15
  7. package/dist/components/CopyEvmKeyButton/index.d.ts +6 -3
  8. package/dist/components/CopyEvmKeyButton/index.js +47 -45
  9. package/dist/components/CopySolanaKeyButton/index.d.ts +6 -3
  10. package/dist/components/CopySolanaKeyButton/index.js +47 -45
  11. package/dist/components/ExportWallet/index.d.ts +2 -2
  12. package/dist/components/ExportWallet/index.js +234 -63
  13. package/dist/components/ExportWalletModal/index.d.ts +8 -2
  14. package/dist/components/ExportWalletModal/index.js +15 -94
  15. package/dist/components/LinkAuth/LinkAuthFlow.js +2 -2
  16. package/dist/components/LinkAuth/LinkAuthFlowBackButton.js +1 -1
  17. package/dist/components/LinkAuth/LinkAuthFlowProvider.js +4 -4
  18. package/dist/components/LinkAuth/index.js +2 -2
  19. package/dist/components/LinkAuthModal/index.js +12 -12
  20. package/dist/components/ui/IframeButton/index.d.ts +9 -5
  21. package/dist/components/ui/IframeButton/index.js +128 -39
  22. package/dist/hooks/useKeyExportPostMessage.d.ts +6 -4
  23. package/dist/hooks/useKeyExportPostMessage.js +55 -48
  24. package/dist/index.d.ts +6 -0
  25. package/dist/index.js +167 -149
  26. package/dist/types/secureIframe.d.ts +31 -3
  27. package/dist/types/secureIframe.js +4 -6
  28. package/package.json +6 -6
  29. package/dist/assets/ExportWalletModal.css +0 -1
@@ -1,110 +1,281 @@
1
- import { jsx as o, jsxs as d, Fragment as _ } from "react/jsx-runtime";
2
- import { useCurrentUser as W } from "@coinbase/cdp-hooks";
3
- import { c as i } from "../../chunks/lite.1fxw3LjI.js";
4
- import { createContext as f, useMemo as c, useContext as C } from "react";
5
- import { CopyAddress as w } from "../CopyAddress/index.js";
6
- import { unstable_CopyEvmKeyButton as v } from "../CopyEvmKeyButton/index.js";
7
- import { unstable_CopySolanaKeyButton as b } from "../CopySolanaKeyButton/index.js";
1
+ import { u as F, A as B } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
2
+ import { createContext as M, useMemo as x, useContext as v } from "react";
3
+ import { VERSION as I } from "../../version.js";
4
+ import "../AuthButton/index.js";
5
+ import { useAppConfig as g } from "../CDPReactProvider/index.js";
6
+ import { CopyAddress as K } from "../CopyAddress/index.js";
7
+ import { CopyEvmKeyButton as V } from "../CopyEvmKeyButton/index.js";
8
+ import { CopySolanaKeyButton as z } from "../CopySolanaKeyButton/index.js";
9
+ import { jsx as o, jsxs as m, Fragment as E } from "react/jsx-runtime";
10
+ import { useCurrentUser as D } from "@coinbase/cdp-hooks";
11
+ import { c as f } from "../../chunks/lite.1fxw3LjI.js";
8
12
  import { Banner as h } from "../ui/Banner/index.js";
9
- import { CoinbaseFooter as A } from "../ui/CoinbaseFooter/index.js";
10
- import "../../index.js";
11
- import { useAppConfig as B } from "../CDPReactProvider/index.js";
12
- import '../../assets/ExportWallet.css';const F = "ExportWallet-module__footer___NvrFY", u = {
13
+ import { CoinbaseFooter as O } from "../ui/CoinbaseFooter/index.js";
14
+ import { Button as b } from "../ui/Button/index.js";
15
+ import { Modal as j, ModalClose as U, ModalContent as X, ModalTitle as Y, ModalTrigger as Z } from "../ui/Modal/index.js";
16
+ import { IconXMark as $ } from "../../icons/IconXMark.js";
17
+ import { childrenHasComponent as W } from "../../utils/childrenHasComponent.js";
18
+ import "../Fund/index.js";
19
+ import "../FundModal/index.js";
20
+ import "../LinkAuth/index.js";
21
+ import "../LinkAuthModal/index.js";
22
+ import "../SendEvmTransactionButton/index.js";
23
+ import "../SendSolanaTransactionButton/index.js";
24
+ import "../SignIn/index.js";
25
+ import "../SignIn/useSignInReducer.js";
26
+ import "../SignInModal/index.js";
27
+ import "../SignOutButton/index.js";
28
+ import "../ThemeProvider/index.js";
29
+ import "../../theme/cssVariables.js";
30
+ import "../../theme/theme.js";
31
+ import "../../theme/tokens.js";
32
+ import "../../theme/utils.js";
33
+ import "../../icons/IconAppleLogo.js";
34
+ import "../../icons/IconArrowLeft.js";
35
+ import "../../icons/IconArrowsUpDown.js";
36
+ import "../../icons/IconCheck.js";
37
+ import "../../icons/IconCheckCircle.js";
38
+ import "../../icons/IconChevronDown.js";
39
+ import "../../icons/IconCopy.js";
40
+ import "../../icons/IconEnvelope.js";
41
+ import "../../icons/IconExclamationCircle.js";
42
+ import "../../icons/IconExclamationTriangle.js";
43
+ import "../../icons/IconGoogleLogo.js";
44
+ import "../../icons/IconLock.js";
45
+ import "../../icons/IconPhone.js";
46
+ import "../../icons/IconMinus.js";
47
+ import "../../icons/IconPlus.js";
48
+ import "../../utils/clamp.js";
49
+ import "../../utils/getMessageFromUnknownError.js";
50
+ import "../../utils/isApiError.js";
51
+ import "../../utils/isEmailInvalid.js";
52
+ import "../../utils/parseValuesFromPhoneNumber.js";
53
+ import "../../utils/sendIframeMessage.js";
54
+ import "@coinbase/cdp-core";
55
+ import "../Fund/FundForm.js";
56
+ import "../Fund/FundTitle.js";
57
+ import "../Fund/FundProvider.js";
58
+ import "../../chunks/LinkAuthFlow.3HN888DV.js";
59
+ import "../LinkAuth/LinkAuthFlowBackButton.js";
60
+ import "../LinkAuth/LinkAuthItem.js";
61
+ import "../LinkAuth/LinkAuthItems.js";
62
+ import "../LinkAuth/LinkAuthTitle.js";
63
+ import "../LinkAuth/LinkAuthProvider.js";
64
+ import "../SignIn/SignInAuthMethodButtons.js";
65
+ import "../SignIn/SignInBackButton.js";
66
+ import "../SignIn/SignInDescription.js";
67
+ import "../SignIn/SignInFooter.js";
68
+ import "../SignIn/SignInForm.js";
69
+ import "../SignIn/SignInImage.js";
70
+ import "../SignIn/SignInTitle.js";
71
+ import "../SignIn/SignInProvider.js";
72
+ import '../../assets/ExportWallet.css';const q = "ExportWallet-module__footer___NvrFY", _ = {
13
73
  "export-wallet": "ExportWallet-module__export-wallet___EyZys",
74
+ "no-footer": "ExportWallet-module__no-footer___fzl3R",
14
75
  "export-wallet-title": "ExportWallet-module__export-wallet-title___MuI09",
15
- footer: F
16
- }, x = f({
76
+ footer: q
77
+ }, N = M({
17
78
  address: "",
18
- type: "evm"
19
- }), m = () => {
20
- const t = C(x);
79
+ type: "evm-eoa"
80
+ }), C = () => {
81
+ const t = v(N);
21
82
  if (!t)
22
83
  throw new Error("useExportWalletContext must be used within a ExportWalletProvider");
23
84
  return t;
24
- }, K = ({
85
+ }, H = ({
25
86
  address: t,
26
87
  children: r,
27
88
  onIframeError: e,
28
- onIframeReady: n,
29
- onCopySuccess: l
89
+ onIframeReady: l,
90
+ onCopySuccess: n
30
91
  }) => {
31
- const { currentUser: a } = W(), p = c(
32
- () => !!a?.solanaAccounts?.find((E) => E === t),
92
+ const { currentUser: a } = D(), i = x(
93
+ () => !!a?.solanaAccounts?.find((c) => c === t),
33
94
  [a?.solanaAccounts, t]
34
- ) ? "solana" : "evm", y = c(
35
- () => ({ address: t, type: p, onIframeError: e, onIframeReady: n, onCopySuccess: l }),
36
- [t, p, e, n, l]
95
+ ), s = x(
96
+ () => !!a?.evmSmartAccounts?.find((c) => c === t),
97
+ [a?.evmSmartAccounts, t]
98
+ ), d = i ? "solana" : s ? "evm-smart" : "evm-eoa", u = x(
99
+ () => ({ address: t, type: d, onIframeError: e, onIframeReady: l, onCopySuccess: n }),
100
+ [t, d, e, l, n]
37
101
  );
38
- return /* @__PURE__ */ o(x.Provider, { value: y, children: r });
39
- }, S = ({
102
+ return /* @__PURE__ */ o(N.Provider, { value: u, children: r });
103
+ }, A = ({
40
104
  children: t,
41
105
  className: r = "",
42
106
  as: e = "h2",
43
- ...n
44
- }) => /* @__PURE__ */ o(e, { className: i(u["export-wallet-title"], r), ...n, children: t || "Export your wallet" }), g = (t) => /* @__PURE__ */ o(h, { variant: "warning", ...t, children: "Do not share your private key with anyone" }), N = ({
107
+ ...l
108
+ }) => /* @__PURE__ */ o(
109
+ e,
110
+ {
111
+ "data-part": "title",
112
+ className: f(_["export-wallet-title"], r),
113
+ ...l,
114
+ children: t || "Export your wallet"
115
+ }
116
+ ), S = (t) => {
117
+ const { type: r } = C();
118
+ return r === "evm-smart" ? /* @__PURE__ */ o(h, { "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(h, { "data-part": "warning", variant: "warning", ...t, children: "Do not share your private key with anyone" });
119
+ }, T = ({
45
120
  label: t = "Your wallet address",
46
121
  ...r
47
122
  }) => {
48
- const { address: e } = m();
49
- return /* @__PURE__ */ o(w, { address: e, label: t, ...r });
50
- }, P = ({
123
+ const { address: e } = C();
124
+ return /* @__PURE__ */ o(K, { "data-part": "copy-address", address: e, label: t, ...r });
125
+ }, k = ({
51
126
  fullWidth: t = !0,
52
127
  ...r
53
128
  }) => {
54
- const { address: e, type: n, onIframeError: l, onIframeReady: a, onCopySuccess: s } = m();
55
- return n === "solana" ? /* @__PURE__ */ o(
56
- b,
129
+ const { address: e, type: l, onIframeError: n, onIframeReady: a, onCopySuccess: i } = C();
130
+ return l === "solana" ? /* @__PURE__ */ o(
131
+ z,
57
132
  {
58
133
  fullWidth: t,
59
134
  address: e,
60
- onError: l,
135
+ onError: n,
61
136
  onReady: a,
62
- onSuccess: s,
137
+ onSuccess: i,
63
138
  ...r
64
139
  }
65
- ) : n === "evm" ? /* @__PURE__ */ o(
66
- v,
140
+ ) : l === "evm-eoa" ? /* @__PURE__ */ o(
141
+ V,
67
142
  {
68
143
  fullWidth: t,
69
144
  address: e,
70
- onError: l,
145
+ onError: n,
71
146
  onReady: a,
72
- onSuccess: s,
147
+ onSuccess: i,
73
148
  ...r
74
149
  }
75
150
  ) : null;
76
- }, j = (t) => /* @__PURE__ */ o(A, { ...t }), z = ({
151
+ }, P = (t) => /* @__PURE__ */ o(O, { "data-part": "coinbase-footer", ...t }), L = ({
77
152
  address: t,
78
153
  children: r,
79
154
  className: e = "",
80
- onIframeError: n,
81
- onIframeReady: l,
155
+ onIframeError: l,
156
+ onIframeReady: n,
82
157
  onCopySuccess: a,
83
- ...s
158
+ ...i
159
+ }) => {
160
+ const { showCoinbaseFooter: s } = g();
161
+ return /* @__PURE__ */ o(
162
+ "div",
163
+ {
164
+ className: f(
165
+ _["export-wallet"],
166
+ !s && _["no-footer"],
167
+ e
168
+ ),
169
+ ...i,
170
+ children: /* @__PURE__ */ o(
171
+ H,
172
+ {
173
+ address: t,
174
+ onIframeReady: n,
175
+ onCopySuccess: a,
176
+ onIframeError: l,
177
+ children: r || /* @__PURE__ */ m(E, { children: [
178
+ /* @__PURE__ */ o(A, {}),
179
+ /* @__PURE__ */ o(S, {}),
180
+ /* @__PURE__ */ o(T, {}),
181
+ /* @__PURE__ */ o(k, {}),
182
+ s && /* @__PURE__ */ o(P, { className: _.footer })
183
+ ] })
184
+ }
185
+ )
186
+ }
187
+ );
188
+ }, G = "ExportWalletModal-module__trigger___zMk8N", J = "ExportWalletModal-module__content___KzNol", Q = "ExportWalletModal-module__footer___byg1T", tt = "ExportWalletModal-module__modal___pX1AP", p = {
189
+ "export-wallet": "ExportWalletModal-module__export-wallet___--L56",
190
+ trigger: G,
191
+ "title-bar": "ExportWalletModal-module__title-bar___RTPZq",
192
+ content: J,
193
+ "close-button": "ExportWalletModal-module__close-button___ImsDR",
194
+ "close-icon": "ExportWalletModal-module__close-icon___iAfyT",
195
+ footer: Q,
196
+ modal: tt
197
+ }, R = M(null), ot = () => {
198
+ const t = v(R);
199
+ if (!t)
200
+ throw new Error("useExportWalletModalContext must be used within a ExportWalletModal");
201
+ return t;
202
+ }, w = ({
203
+ children: t,
204
+ className: r = "",
205
+ label: e,
206
+ ...l
207
+ }) => /* @__PURE__ */ o(Z, { asChild: !0, children: t || /* @__PURE__ */ o(b, { className: f(p.trigger, r), ...l, children: e || "Export wallet" }) }), rt = ({
208
+ children: t = "Copy private key to export wallet",
209
+ ...r
210
+ }) => /* @__PURE__ */ o(Y, { asChild: !0, children: /* @__PURE__ */ o(A, { ...r, children: t }) }), et = ({ children: t }) => /* @__PURE__ */ o(U, { asChild: !0, children: t || /* @__PURE__ */ o(
211
+ b,
212
+ {
213
+ "aria-label": "Close",
214
+ className: p["close-button"],
215
+ variant: "transparentSecondary",
216
+ children: /* @__PURE__ */ o($, { className: p["close-icon"] })
217
+ }
218
+ ) }), y = ({
219
+ children: t,
220
+ className: r = "",
221
+ ...e
84
222
  }) => {
85
- const { showCoinbaseFooter: p } = B();
86
- return /* @__PURE__ */ o("div", { className: i(u["export-wallet"], e), ...s, children: /* @__PURE__ */ o(
87
- K,
223
+ const { showCoinbaseFooter: l } = g(), { address: n, onIframeReady: a, onCopySuccess: i, onIframeError: s } = ot();
224
+ return /* @__PURE__ */ o(X, { "aria-describedby": void 0, className: f(p.modal, r), ...e, children: /* @__PURE__ */ o(
225
+ L,
88
226
  {
89
- address: t,
90
- onIframeReady: l,
91
- onCopySuccess: a,
92
- onIframeError: n,
93
- children: r || /* @__PURE__ */ d(_, { children: [
94
- /* @__PURE__ */ o(S, {}),
95
- /* @__PURE__ */ o(g, {}),
96
- /* @__PURE__ */ o(N, {}),
97
- /* @__PURE__ */ o(P, {}),
98
- p && /* @__PURE__ */ o(j, { className: u.footer })
227
+ address: n,
228
+ onIframeReady: a,
229
+ onCopySuccess: i,
230
+ onIframeError: s,
231
+ className: p["export-wallet"],
232
+ children: t || /* @__PURE__ */ m(E, { children: [
233
+ /* @__PURE__ */ m("div", { className: p["title-bar"], children: [
234
+ /* @__PURE__ */ o(rt, {}),
235
+ /* @__PURE__ */ o(et, {})
236
+ ] }),
237
+ /* @__PURE__ */ m("div", { className: p.content, children: [
238
+ /* @__PURE__ */ o(S, {}),
239
+ /* @__PURE__ */ o(T, {}),
240
+ /* @__PURE__ */ o(k, {}),
241
+ l && /* @__PURE__ */ o(P, { className: p.footer })
242
+ ] })
99
243
  ] })
100
244
  }
101
245
  ) });
246
+ }, wo = ({
247
+ address: t,
248
+ children: r,
249
+ onIframeReady: e,
250
+ onCopySuccess: l,
251
+ onIframeError: n,
252
+ open: a,
253
+ setIsOpen: i
254
+ }) => {
255
+ F("export_wallet_modal");
256
+ const s = x(
257
+ () => ({ address: t, onIframeReady: e, onCopySuccess: l, onIframeError: n }),
258
+ [t, e, l, n]
259
+ ), d = r ? W(r, w) : !1, u = r ? W(r, y) : !1, c = !d && !u;
260
+ return /* @__PURE__ */ o(R.Provider, { value: s, children: /* @__PURE__ */ o(j, { open: a, onOpenChange: i, children: c ? /* @__PURE__ */ m(E, { children: [
261
+ /* @__PURE__ */ o(w, { children: r }),
262
+ /* @__PURE__ */ o(y, {})
263
+ ] }) : /* @__PURE__ */ m(E, { children: [
264
+ r,
265
+ !u && /* @__PURE__ */ o(y, {})
266
+ ] }) }) });
102
267
  };
268
+ B.registerPackageVersion("react", I);
103
269
  export {
104
- z as unstable_ExportWallet,
105
- N as unstable_ExportWalletCopyAddress,
106
- P as unstable_ExportWalletCopyKeyButton,
107
- j as unstable_ExportWalletFooter,
108
- S as unstable_ExportWalletTitle,
109
- g as unstable_ExportWalletWarning
270
+ wo as E,
271
+ L as ExportWallet,
272
+ T as ExportWalletCopyAddress,
273
+ k as ExportWalletCopyKeyButton,
274
+ P as ExportWalletFooter,
275
+ A as ExportWalletTitle,
276
+ S as ExportWalletWarning,
277
+ et as a,
278
+ y as b,
279
+ rt as c,
280
+ w as d
110
281
  };
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { unstable_ExportWalletProps as ExportWalletProps } from '../ExportWallet';
2
+ import { ExportWalletProps, ExportWalletTitleProps } from '../ExportWallet';
3
3
  import { ButtonProps } from '../ui/Button';
4
4
  import { ModalContentProps } from '../ui/Modal';
5
5
  interface ExportWalletModalTriggerProps extends Partial<Pick<ButtonProps, "className" | "fullWidth" | "size" | "style" | "variant">> {
@@ -7,12 +7,18 @@ interface ExportWalletModalTriggerProps extends Partial<Pick<ButtonProps, "class
7
7
  label?: ReactNode;
8
8
  }
9
9
  type ExportWalletModalContentProps = ModalContentProps;
10
+ type ExportWalletModalTitleProps = ExportWalletTitleProps;
11
+ interface ExportWalletModalCloseProps {
12
+ children?: ReactNode;
13
+ }
10
14
  interface ExportWalletModalProps extends Pick<ExportWalletProps, "address" | "onIframeReady" | "onCopySuccess" | "onIframeError"> {
11
15
  children?: ReactNode;
12
16
  open?: boolean;
13
17
  setIsOpen?: (value: boolean) => void;
14
18
  }
15
19
  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;
21
+ declare const ExportWalletModalClose: ({ children }: ExportWalletModalCloseProps) => import("react/jsx-runtime").JSX.Element;
16
22
  declare const ExportWalletModalContent: ({ children, className, ...props }: ExportWalletModalContentProps) => import("react/jsx-runtime").JSX.Element;
17
23
  declare const ExportWalletModal: ({ address, children, onIframeReady, onCopySuccess, onIframeError, open, setIsOpen, }: ExportWalletModalProps) => import("react/jsx-runtime").JSX.Element;
18
- export { ExportWalletModal as unstable_ExportWalletModal, ExportWalletModalTrigger as unstable_ExportWalletModalTrigger, ExportWalletModalContent as unstable_ExportWalletModalContent, type ExportWalletModalProps as unstable_ExportWalletModalProps, type ExportWalletModalTriggerProps as unstable_ExportWalletModalTriggerProps, type ExportWalletModalContentProps as unstable_ExportWalletModalContentProps, };
24
+ export { ExportWalletModal, ExportWalletModalClose, ExportWalletModalContent, ExportWalletModalTitle, ExportWalletModalTrigger, type ExportWalletModalProps, type ExportWalletModalCloseProps, type ExportWalletModalContentProps, type ExportWalletModalTitleProps, type ExportWalletModalTriggerProps, };
@@ -1,96 +1,17 @@
1
- import { jsx as t, jsxs as n, Fragment as _ } from "react/jsx-runtime";
2
- import { u as g } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
3
- import { createContext as b, useMemo as h, useContext as y } from "react";
4
- import { c as E } from "../../chunks/lite.1fxw3LjI.js";
5
- import { useAppConfig as T } from "../CDPReactProvider/index.js";
6
- import { unstable_ExportWallet as w, unstable_ExportWalletWarning as N, unstable_ExportWalletCopyAddress as v, unstable_ExportWalletCopyKeyButton as A, unstable_ExportWalletFooter as F, unstable_ExportWalletTitle as j } from "../ExportWallet/index.js";
7
- import { Button as W } from "../ui/Button/index.js";
8
- import { Modal as k, ModalTrigger as B, ModalContent as K, ModalTitle as P, ModalClose as R } from "../ui/Modal/index.js";
9
- import { IconXMark as z } from "../../icons/IconXMark.js";
10
- import { childrenHasComponent as m } from "../../utils/childrenHasComponent.js";
11
- import '../../assets/ExportWalletModal.css';const D = "ExportWalletModal-module__trigger___zMk8N", I = "ExportWalletModal-module__content___KzNol", O = "ExportWalletModal-module__footer___byg1T", S = "ExportWalletModal-module__modal___pX1AP", e = {
12
- "export-wallet": "ExportWalletModal-module__export-wallet___--L56",
13
- "no-footer": "ExportWalletModal-module__no-footer___J8uj2",
14
- trigger: D,
15
- "title-bar": "ExportWalletModal-module__title-bar___RTPZq",
16
- content: I,
17
- "close-button": "ExportWalletModal-module__close-button___ImsDR",
18
- "close-icon": "ExportWalletModal-module__close-icon___iAfyT",
19
- footer: O,
20
- modal: S
21
- }, M = b(null), X = () => {
22
- const o = y(M);
23
- if (!o)
24
- throw new Error("useExportWalletModalContext must be used within a ExportWalletModal");
25
- return o;
26
- }, u = ({
27
- children: o,
28
- className: l = "",
29
- label: r,
30
- ...a
31
- }) => /* @__PURE__ */ t(B, { asChild: !0, children: o || /* @__PURE__ */ t(W, { className: E(e.trigger, l), ...a, children: r || "Export wallet" }) }), $ = ({
32
- children: o = "Copy private key to export wallet",
33
- ...l
34
- }) => /* @__PURE__ */ t(P, { asChild: !0, children: /* @__PURE__ */ t(j, { ...l, children: o }) }), q = ({ children: o }) => /* @__PURE__ */ t(R, { asChild: !0, children: o || /* @__PURE__ */ t(
35
- W,
36
- {
37
- "aria-label": "Close",
38
- className: e["close-button"],
39
- variant: "transparentSecondary",
40
- children: /* @__PURE__ */ t(z, { className: e["close-icon"] })
41
- }
42
- ) }), i = ({
43
- children: o,
44
- className: l = "",
45
- ...r
46
- }) => {
47
- const { showCoinbaseFooter: a } = T(), { address: s, onIframeReady: d, onCopySuccess: p, onIframeError: c } = X();
48
- return /* @__PURE__ */ t(K, { "aria-describedby": void 0, className: E(e.modal, l), ...r, children: /* @__PURE__ */ t(
49
- w,
50
- {
51
- address: s,
52
- onIframeReady: d,
53
- onCopySuccess: p,
54
- onIframeError: c,
55
- className: `${e["export-wallet"]} ${a ? "" : e["no-footer"]}`,
56
- children: o || /* @__PURE__ */ n(_, { children: [
57
- /* @__PURE__ */ n("div", { className: e["title-bar"], children: [
58
- /* @__PURE__ */ t($, {}),
59
- /* @__PURE__ */ t(q, {})
60
- ] }),
61
- /* @__PURE__ */ n("div", { className: e.content, children: [
62
- /* @__PURE__ */ t(N, {}),
63
- /* @__PURE__ */ t(v, {}),
64
- /* @__PURE__ */ t(A, {}),
65
- a && /* @__PURE__ */ t(F, { className: e.footer })
66
- ] })
67
- ] })
68
- }
69
- ) });
70
- }, ot = ({
71
- address: o,
72
- children: l,
73
- onIframeReady: r,
74
- onCopySuccess: a,
75
- onIframeError: s,
76
- open: d,
77
- setIsOpen: p
78
- }) => {
79
- g("export_wallet_modal");
80
- const c = h(
81
- () => ({ address: o, onIframeReady: r, onCopySuccess: a, onIframeError: s }),
82
- [o, r, a, s]
83
- ), C = l ? m(l, u) : !1, x = l ? m(l, i) : !1, f = !C && !x;
84
- return /* @__PURE__ */ t(M.Provider, { value: c, children: /* @__PURE__ */ t(k, { open: d, onOpenChange: p, children: f ? /* @__PURE__ */ n(_, { children: [
85
- /* @__PURE__ */ t(u, { children: l }),
86
- /* @__PURE__ */ t(i, {})
87
- ] }) : /* @__PURE__ */ n(_, { children: [
88
- l,
89
- !x && /* @__PURE__ */ t(i, {})
90
- ] }) }) });
91
- };
1
+ import "react/jsx-runtime";
2
+ import "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
3
+ import "react";
4
+ import "../../chunks/lite.1fxw3LjI.js";
5
+ import "../CDPReactProvider/index.js";
6
+ import { E as x, a as E, b as M, c as W, d as g } from "../ExportWallet/index.js";
7
+ import "../ui/Button/index.js";
8
+ import "../ui/Modal/index.js";
9
+ import "../../icons/IconXMark.js";
10
+ import "../../utils/childrenHasComponent.js";
92
11
  export {
93
- ot as unstable_ExportWalletModal,
94
- i as unstable_ExportWalletModalContent,
95
- u as unstable_ExportWalletModalTrigger
12
+ x as ExportWalletModal,
13
+ E as ExportWalletModalClose,
14
+ M as ExportWalletModalContent,
15
+ W as ExportWalletModalTitle,
16
+ g as ExportWalletModalTrigger
96
17
  };
@@ -5,7 +5,7 @@ import "../SignIn/index.js";
5
5
  import "@coinbase/cdp-hooks";
6
6
  import "../ui/SwitchSlideTransition/index.js";
7
7
  import "../ui/VisuallyHidden/index.js";
8
- import { L as x } from "../../chunks/LinkAuthFlow.CxSnHF2p.js";
8
+ import { a as A } from "../../chunks/LinkAuthFlow.3HN888DV.js";
9
9
  import "./LinkAuthItems.js";
10
10
  import "./types.js";
11
11
  import "../SignIn/SignInProvider.js";
@@ -15,5 +15,5 @@ import "../SignIn/SignInTitle.js";
15
15
  import "../SignIn/SignInDescription.js";
16
16
  import "../SignIn/SignInFooter.js";
17
17
  export {
18
- x as LinkAuthFlow
18
+ A as LinkAuthFlow
19
19
  };
@@ -3,7 +3,7 @@ import { c as k } from "../../chunks/lite.1fxw3LjI.js";
3
3
  import "react";
4
4
  import { Button as p } from "../ui/Button/index.js";
5
5
  import { IconArrowLeft as f } from "../../icons/IconArrowLeft.js";
6
- import { b as w } from "../../chunks/LinkAuthFlow.CxSnHF2p.js";
6
+ import { b as w } from "../../chunks/LinkAuthFlow.3HN888DV.js";
7
7
  import { useLinkAuthContext as _ } from "./LinkAuthProvider.js";
8
8
  import "../CDPReactProvider/index.js";
9
9
  import { methodToView as b } from "./utils.js";
@@ -1,9 +1,9 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../CDPReactProvider/index.js";
4
- import { a, u as e, b as n } from "../../chunks/LinkAuthFlow.CxSnHF2p.js";
4
+ import { L as e, u as n, b as s } from "../../chunks/LinkAuthFlow.3HN888DV.js";
5
5
  export {
6
- a as LinkAuthFlowProvider,
7
- e as useLinkAuthFlow,
8
- n as useLinkAuthFlowInternal
6
+ e as LinkAuthFlowProvider,
7
+ n as useLinkAuthFlow,
8
+ s as useLinkAuthFlowInternal
9
9
  };
@@ -8,8 +8,8 @@ import { Banner as U } from "../ui/Banner/index.js";
8
8
  import { getMessageFromUnknownError as D } from "../../utils/getMessageFromUnknownError.js";
9
9
  import "libphonenumber-js";
10
10
  import { toOAuthProviderType as H } from "../../utils/toOAuthProviderType.js";
11
- import { a as M, L as v } from "../../chunks/LinkAuthFlow.CxSnHF2p.js";
12
- import { u as mt } from "../../chunks/LinkAuthFlow.CxSnHF2p.js";
11
+ import { L as M, a as v } from "../../chunks/LinkAuthFlow.3HN888DV.js";
12
+ import { u as mt } from "../../chunks/LinkAuthFlow.3HN888DV.js";
13
13
  import { LinkAuthFlowBackButton as V } from "./LinkAuthFlowBackButton.js";
14
14
  import { LinkAuthItem as dt } from "./LinkAuthItem.js";
15
15
  import { LinkAuthItems as ft } from "./LinkAuthItems.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx as o, jsxs as n, Fragment as d } from "react/jsx-runtime";
2
2
  import { u as p } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
3
- import { createContext as L, useMemo as f, useContext as g } from "react";
3
+ import { createContext as f, useMemo as L, useContext as g } from "react";
4
4
  import { c as A } from "../../chunks/lite.1fxw3LjI.js";
5
5
  import "../CDPReactProvider/index.js";
6
6
  import { LinkAuth as C, LinkAuthError as x } from "../LinkAuth/index.js";
@@ -11,14 +11,14 @@ import { IconXMark as F } from "../../icons/IconXMark.js";
11
11
  import { childrenHasComponent as c } from "../../utils/childrenHasComponent.js";
12
12
  import { LinkAuthTitle as H } from "../LinkAuth/LinkAuthTitle.js";
13
13
  import { LinkAuthFlowBackButton as j } from "../LinkAuth/LinkAuthFlowBackButton.js";
14
- import { L as B } from "../../chunks/LinkAuthFlow.CxSnHF2p.js";
14
+ import { a as B } from "../../chunks/LinkAuthFlow.3HN888DV.js";
15
15
  import '../../assets/LinkAuthModal.css';const S = "LinkAuthModal-module__header___qoco6", D = "LinkAuthModal-module__error___Srl7H", E = "LinkAuthModal-module__trigger___aHDfG", r = {
16
16
  header: S,
17
17
  error: D,
18
18
  "close-icon": "LinkAuthModal-module__close-icon___Fe02C",
19
19
  "close-button": "LinkAuthModal-module__close-button___x6j3c",
20
20
  trigger: E
21
- }, h = L(null), O = () => {
21
+ }, h = f(null), O = () => {
22
22
  const e = g(h);
23
23
  if (!e)
24
24
  throw new Error("useLinkAuthModalContext must be used within a LinkAuthModal");
@@ -26,9 +26,9 @@ import '../../assets/LinkAuthModal.css';const S = "LinkAuthModal-module__header_
26
26
  }, u = ({
27
27
  children: e,
28
28
  className: t = "",
29
- label: l,
30
- ...i
31
- }) => /* @__PURE__ */ o(T, { asChild: !0, children: e || /* @__PURE__ */ o(m, { className: A(r.trigger, t), ...i, children: l || "Link accounts" }) }), a = (e) => {
29
+ label: i,
30
+ ...a
31
+ }) => /* @__PURE__ */ o(T, { asChild: !0, children: e || /* @__PURE__ */ o(m, { className: A(r.trigger, t), ...a, children: i || "Link accounts" }) }), l = (e) => {
32
32
  const { onLinkSuccess: t } = O();
33
33
  return /* @__PURE__ */ n(v, { "aria-describedby": void 0, ...e, children: [
34
34
  /* @__PURE__ */ o(y, { children: /* @__PURE__ */ o(w, { children: "Link a profile" }) }),
@@ -51,19 +51,19 @@ import '../../assets/LinkAuthModal.css';const S = "LinkAuthModal-module__header_
51
51
  /* @__PURE__ */ o(B, {})
52
52
  ] })
53
53
  ] });
54
- }, Z = ({ children: e, open: t, setIsOpen: l, onLinkSuccess: i }) => {
54
+ }, Z = ({ children: e, open: t, setIsOpen: i, onLinkSuccess: a }) => {
55
55
  p("manage_auth_modal");
56
- const _ = e ? c(e, u) : !1, s = e ? c(e, a) : !1, k = !_ && !s, M = f(() => ({ onLinkSuccess: i }), [i]);
57
- return /* @__PURE__ */ o(h.Provider, { value: M, children: /* @__PURE__ */ o(b, { open: t, onOpenChange: l, children: k ? /* @__PURE__ */ n(d, { children: [
56
+ const _ = e ? c(e, u) : !1, s = e ? c(e, l) : !1, k = !_ && !s, M = L(() => ({ onLinkSuccess: a }), [a]);
57
+ return /* @__PURE__ */ o(h.Provider, { value: M, children: /* @__PURE__ */ o(b, { open: t, onOpenChange: i, children: k ? /* @__PURE__ */ n(d, { children: [
58
58
  /* @__PURE__ */ o(u, { children: e }),
59
- /* @__PURE__ */ o(a, {})
59
+ /* @__PURE__ */ o(l, {})
60
60
  ] }) : /* @__PURE__ */ n(d, { children: [
61
61
  e,
62
- !s && /* @__PURE__ */ o(a, {})
62
+ !s && /* @__PURE__ */ o(l, {})
63
63
  ] }) }) });
64
64
  };
65
65
  export {
66
66
  Z as LinkAuthModal,
67
- a as LinkAuthModalContent,
67
+ l as LinkAuthModalContent,
68
68
  u as LinkAuthModalTrigger
69
69
  };
@@ -1,11 +1,15 @@
1
1
  import { IframeHTMLAttributes, ReactNode } from 'react';
2
- import { ButtonSize } from '../../../theme/theme';
2
+ import { ButtonSize, ButtonVariant } from '../../../theme/theme';
3
+ import { IframeTheme } from '../../../types/secureIframe';
3
4
  interface IframeButtonProps extends IframeHTMLAttributes<HTMLIFrameElement> {
4
- isPending?: boolean;
5
- label: ReactNode;
6
5
  icon?: boolean;
6
+ isPending?: boolean;
7
7
  fullWidth?: boolean;
8
+ label: ReactNode;
9
+ onThemeChange?: (theme: IframeTheme) => void;
8
10
  size?: ButtonSize;
11
+ theme?: Partial<IframeTheme>;
12
+ variant?: Extract<ButtonVariant, "primary" | "secondary">;
9
13
  }
10
- export declare const IframeButton: import('react').ForwardRefExoticComponent<IframeButtonProps & import('react').RefAttributes<HTMLIFrameElement>>;
11
- export {};
14
+ declare const IframeButton: import('react').ForwardRefExoticComponent<IframeButtonProps & import('react').RefAttributes<HTMLIFrameElement>>;
15
+ export { IframeButton, type IframeButtonProps, type IframeTheme };