@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
package/README.md CHANGED
@@ -18,6 +18,11 @@ the CDP frontend SDK.
18
18
  - {@link CopySolanaKeyButton | CopySolanaKeyButton} - a button for copying the private key of a user's Solana address
19
19
  - {@link ExportWallet | ExportWallet} - a component for exporting a user's wallet; includes a title, a warning about keeping private keys secure, the CopyAddress component, and either the CopyEvmKeyButton or CopySolanaKeyButton depending on the type of address provided
20
20
  - {@link ExportWalletModal | ExportWalletModal} - a button that triggers a modal with the ExportWallet component
21
+ - {@link EnrollMfa | EnrollMfa} - a component for MFA enrollment; guides users through setting up two-factor authentication via TOTP
22
+ - {@link EnrollMfaModal | EnrollMfaModal} - a button that triggers a modal with the MFA enrollment flow
23
+ - {@link VerifyMfa | VerifyMfa} - a component for MFA verification; prompts enrolled users to enter their authenticator code
24
+ - {@link VerifyMfaModal | VerifyMfaModal} - a button that triggers a modal with the MFA verification flow
25
+ - {@link VerifyMfaInline | VerifyMfaInline} - a wrapper component for embedding MFA verification within existing UI flows
21
26
 
22
27
  ## Quickstart
23
28
 
@@ -0,0 +1 @@
1
+ .Badge-module__badge___IxlOE{align-items:center;border-radius:var(--cdp-web-borderRadius-badge);display:inline-flex;font-size:var(--cdp-web-font-size-base);font-family:var(--cdp-web-font-family-page);font-weight:500;justify-content:center;line-height:1;min-height:1em;min-width:1em;padding:.75em}.Badge-module__badge___IxlOE svg,.Badge-module__badge___IxlOE img{display:block;height:1.5em;width:1.5em;margin:0}.Badge-module__badge___IxlOE[data-variant=primary]{background-color:var(--cdp-web-colors-badge-primary-bg-default);color:var(--cdp-web-colors-badge-primary-text-default)}.Badge-module__badge___IxlOE[data-variant=secondary]{background-color:var(--cdp-web-colors-badge-secondary-bg-default);color:var(--cdp-web-colors-badge-secondary-text-default)}.Badge-module__badge___IxlOE[data-variant=warning]{background-color:var(--cdp-web-colors-badge-warning-bg-default);color:var(--cdp-web-colors-badge-warning-text-default)}
@@ -1 +1 @@
1
- .Banner-module__banner___vODjX{border-radius:var(--cdp-web-borderRadius-banner);display:flex;gap:.5em;padding:.75em;line-height:1.25em;background-color:var(--cdp-web-colors-bg-alternate);color:var(--cdp-web-colors-page-text-default)}.Banner-module__banner___vODjX[data-variant=error]{background-color:var(--cdp-web-colors-bg-negativeWash);color:var(--cdp-web-colors-fg-onNegativeWash)}.Banner-module__banner___vODjX[data-variant=success]{background-color:var(--cdp-web-colors-bg-positiveWash);color:var(--cdp-web-colors-fg-onPositiveWash)}.Banner-module__banner___vODjX[data-variant=warning]{background-color:var(--cdp-web-colors-bg-warningWash);color:var(--cdp-web-colors-fg-onWarningWash)}.Banner-module__banner___vODjX .Banner-module__icon___wzB6C{width:1.5em;height:1.25em;display:flex;align-items:center;justify-content:center}.Banner-module__banner___vODjX[data-variant=error] .Banner-module__icon___wzB6C{color:var(--cdp-web-colors-fg-negative)}.Banner-module__banner___vODjX[data-variant=success] .Banner-module__icon___wzB6C{color:var(--cdp-web-colors-fg-positive)}.Banner-module__banner___vODjX[data-variant=warning] .Banner-module__icon___wzB6C{color:var(--cdp-web-colors-fg-warning)}.Banner-module__banner___vODjX svg{width:.875em;height:.875em}.Banner-module__banner___vODjX .Banner-module__text___fTYC-{font-size:.875em;padding-right:.25em}
1
+ .Banner-module__banner___vODjX{border-radius:var(--cdp-web-borderRadius-banner);display:flex;gap:.5em;padding:.75em;line-height:1.25em;background-color:var(--cdp-web-colors-bg-alternate);color:var(--cdp-web-colors-page-text-default)}.Banner-module__banner___vODjX[data-variant=error]{background-color:var(--cdp-web-colors-banner-error-bg-default);color:var(--cdp-web-colors-banner-error-text-default)}.Banner-module__banner___vODjX[data-variant=success]{background-color:var(--cdp-web-colors-banner-success-bg-default);color:var(--cdp-web-colors-banner-success-text-default)}.Banner-module__banner___vODjX[data-variant=warning]{background-color:var(--cdp-web-colors-banner-warning-bg-default);color:var(--cdp-web-colors-banner-warning-text-default)}.Banner-module__banner___vODjX .Banner-module__icon___wzB6C{width:1.5em;height:1.25em;display:flex;align-items:center;justify-content:center}.Banner-module__banner___vODjX[data-variant=error] .Banner-module__icon___wzB6C{color:var(--cdp-web-colors-banner-error-icon-default)}.Banner-module__banner___vODjX[data-variant=success] .Banner-module__icon___wzB6C{color:var(--cdp-web-colors-banner-success-icon-default)}.Banner-module__banner___vODjX[data-variant=warning] .Banner-module__icon___wzB6C{color:var(--cdp-web-colors-banner-warning-icon-default)}.Banner-module__banner___vODjX svg{width:.875em;height:.875em}.Banner-module__banner___vODjX .Banner-module__text___fTYC-{font-size:.875em;padding-right:.25em}
@@ -0,0 +1 @@
1
+ .VerifyMfa-module__mfa-verification___txLpd{box-sizing:border-box;font:var(--cdp-web-font-size-base) / 1.5 var(--cdp-web-font-family-body);font-optical-sizing:auto;background-color:var(--cdp-web-colors-page-bg-default);color:var(--cdp-web-colors-page-text-default);display:flex;flex-direction:column;max-width:38.25em;padding:1em 2em;overflow:hidden;width:100%}.VerifyMfa-module__mfa-verification___txLpd *{box-sizing:border-box}.VerifyMfa-module__mfa-verification-content___-ksMh{display:flex;flex-direction:column;align-items:center;gap:1em;width:100%}.VerifyMfa-module__mfa-verification-form___7b69Y{padding-top:.5em}.VerifyMfa-module__footer___3bANn{padding-top:.75em;margin-top:auto;width:100%}.VerifyMfaModal-module__verify___GZ6dw{padding-top:1.5em}.VerifyMfaModal-module__content___BSj0G{display:flex;flex-direction:column;gap:1em}.VerifyMfaModal-module__header___2plY9{display:flex;align-items:center;justify-content:space-between}.VerifyMfaModal-module__close-icon___pyobJ{width:1.5em;height:1.5em}.VerifyMfaModal-module__close-button___h9yrq{padding:0}.VerifyMfaModal-module__trigger___YXiwC{padding-left:2em;padding-right:2em}.VerifyMfaModal-module__flow___HE2Lf{padding-top:.5em;padding-bottom:1em}
@@ -1 +1 @@
1
- .CoinbaseFooter-module__footer___d0ToM{color:var(--cdp-web-colors-page-text-muted);display:flex;align-items:center;justify-content:center;gap:.5em;line-height:1;padding:1em 2em 0}.CoinbaseFooter-module__text___dmxyS{display:flex;align-items:center;font-size:.75em;gap:.25em;margin:0}.CoinbaseFooter-module__icon___3-qMm{height:auto;width:.75em}.CoinbaseFooter-module__coinbase-icon___Ws6HN{height:1em;width:auto}
1
+ .CoinbaseFooter-module__footer___d0ToM{color:var(--cdp-web-colors-page-text-muted);display:flex;align-items:center;justify-content:center;gap:.5em;line-height:1;padding:1em 1.5em 0}.CoinbaseFooter-module__text___dmxyS{display:flex;align-items:center;font-size:.75em;gap:.25em;margin:0}.CoinbaseFooter-module__icon___3-qMm{height:auto;width:.75em}.CoinbaseFooter-module__coinbase-icon___Ws6HN{height:1em;width:auto}
@@ -0,0 +1 @@
1
+ .CopyTextField-module__copy-text-field___zvHRO{display:flex;flex-direction:column;gap:.25em}.CopyTextField-module__visually-hidden___-sZqH{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0)}.CopyTextField-module__label___gpVUi{display:block}.CopyTextField-module__input-container___tSIdj{position:relative;background-color:var(--cdp-web-colors-input-bg-readonly);color:var(--cdp-web-colors-input-text-readonly);cursor:pointer;border-radius:var(--cdp-web-borderRadius-input);padding:.75em;display:flex;align-items:center;justify-content:space-between;gap:.5em}.CopyTextField-module__text-truncated___mKZc-{color:var(--cdp-web-colors-input-text-readonly);font-size:.875em;overflow:hidden;pointer-events:none;text-overflow:ellipsis;transition:opacity .2s ease-out;white-space:nowrap}.CopyTextField-module__text-truncated___mKZc-.CopyTextField-module__disabled___HTUmj{opacity:.5}.CopyTextField-module__copy-button___U0AJC{align-items:center;background:transparent;border:0;border-radius:var(--cdp-web-borderRadius-cta);color:var(--cdp-web-colors-input-text-readonly);cursor:pointer;display:flex;height:1.5em;line-height:1;justify-content:center;padding:0;width:1.5em}.CopyTextField-module__copy-button___U0AJC:focus{outline:none}.CopyTextField-module__copy-button___U0AJC:focus-visible{--cdp-web-button-ring-color: var(--cdp-web-colors-input-border-focus);--cdp-web-button-ring-inset-color: var(--cdp-web-colors-page-bg-default);box-shadow:inset 0 0 0 2px var(--cdp-web-button-ring-inset-color),0 0 0 2px var(--cdp-web-button-ring-color)}.CopyTextField-module__success-icon___uzpP3{display:block;width:1.25em;height:1.25em}.CopyTextField-module__copy-icon___FKK7q{display:block;width:.875em;height:.875em}
@@ -0,0 +1 @@
1
+ .EnrollMfa-module__mfa-enrollment___80xnL{box-sizing:border-box;font:var(--cdp-web-font-size-base) / 1.5 var(--cdp-web-font-family-body);font-optical-sizing:auto;background-color:var(--cdp-web-colors-page-bg-default);color:var(--cdp-web-colors-page-text-default);display:flex;flex-direction:column;max-width:38.25em;padding:.75em 1.5em 1em;overflow:hidden;width:100%}.EnrollMfa-module__img___JmjV1:empty{display:none}.EnrollMfa-module__flex-container___9Dazs{display:flex;flex-direction:column;align-items:stretch;width:100%}.EnrollMfa-module__gap-2___BKEqR{gap:1em}.EnrollMfa-module__gap-3___JKVyF{gap:1.5em}.EnrollMfa-module__centered___YxB8I{text-align:center}.EnrollMfa-module__footer___Zro3u{margin-top:.75em}
@@ -0,0 +1 @@
1
+ .EnrollMfaDescription-module__description___qWKL6{color:var(--cdp-web-colors-page-text-muted);font-size:.875em;line-height:normal;margin:0}
@@ -0,0 +1 @@
1
+ .EnrollMfaFlow-module__method-wrapper___yT4Pj{width:100%}.EnrollMfaFlow-module__list___oGYkb{display:flex;flex-direction:column;gap:.75em;width:100%}
@@ -0,0 +1 @@
1
+ .EnrollMfaFlowBackButton-module__button___8J7mz{padding:0}.EnrollMfaFlowBackButton-module__icon___H7y5j{width:1.5em;height:1.5em}
@@ -0,0 +1 @@
1
+ .EnrollMfaItems-module__list___5ZZmE{list-style:none;margin:0;padding:0;width:100%}
@@ -0,0 +1 @@
1
+ .EnrollMfaModal-module__enroll___RFMmp{padding-top:1.5em}.EnrollMfaModal-module__enroll___RFMmp.EnrollMfaModal-module__no-footer___EMCyT{padding-bottom:1.5em}.EnrollMfaModal-module__header___ZotIP{display:flex;align-items:center;justify-content:space-between}.EnrollMfaModal-module__close-icon___L9an5{width:1.5em;height:1.5em}.EnrollMfaModal-module__close-button___-qa5Z{padding:0}.EnrollMfaModal-module__trigger___AxlwE{padding-left:2em;padding-right:2em}.EnrollMfaModal-module__img___bTKfB:empty{display:none}.EnrollMfaModal-module__flex-container___O6xYx{display:flex;flex-direction:column;align-items:stretch;width:100%}.EnrollMfaModal-module__gap-2___NBJPS{gap:1em}.EnrollMfaModal-module__gap-3___Jp1Oy{gap:1.5em}.EnrollMfaModal-module__centered___LhCxM{text-align:center}.EnrollMfaModal-module__footer___Adcfg{margin-top:.75em}
@@ -0,0 +1 @@
1
+ .EnrollMfaTitle-module__heading___ogrZZ{font-size:1em;font-weight:500;line-height:1.5;margin:0}
@@ -1 +1 @@
1
- .ExportWallet-module__export-wallet___EyZys{box-sizing:border-box;font:var(--cdp-web-font-size-base) / 1.5 var(--cdp-web-font-family-body);font-optical-sizing:auto;background-color:var(--cdp-web-colors-page-bg-default);color:var(--cdp-web-colors-page-text-default);display:flex;flex-direction:column;max-width:38.25em;gap:1em;padding:1.5em 1.5em 1em;overflow:hidden;width:100%}.ExportWallet-module__export-wallet___EyZys.ExportWallet-module__no-footer___fzl3R{padding-bottom:1.5em}.ExportWallet-module__export-wallet___EyZys [data-part=iframe-button]{margin:-2px;width:calc(100% + 4px)}.ExportWallet-module__export-wallet___EyZys *{box-sizing:border-box}.ExportWallet-module__export-wallet-title___MuI09{font-size:1em;line-height:1.1;font-weight:600;margin:0}.ExportWallet-module__footer___NvrFY{padding-left:0;padding-right:0}.ExportWalletModal-module__export-wallet___--L56{height:100%;overflow:hidden;gap:0}.ExportWalletModal-module__trigger___zMk8N{padding-left:2em;padding-right:2em}.ExportWalletModal-module__title-bar___RTPZq{display:flex;justify-content:space-between;align-items:center;margin-bottom:1em;width:100%}.ExportWalletModal-module__content___KzNol{display:flex;flex-direction:column;gap:1em}.ExportWalletModal-module__close-button___ImsDR{padding:0}.ExportWalletModal-module__close-icon___iAfyT{height:1.5em;width:1.5em}.ExportWalletModal-module__footer___byg1T{padding:.75em 0 0}@media (min-width: 450px){.ExportWalletModal-module__modal___pX1AP{max-width:25em}}
1
+ .ExportWallet-module__export-wallet___EyZys{box-sizing:border-box;font:var(--cdp-web-font-size-base) / 1.5 var(--cdp-web-font-family-body);font-optical-sizing:auto;background-color:var(--cdp-web-colors-page-bg-default);color:var(--cdp-web-colors-page-text-default);display:flex;flex-direction:column;max-width:38.25em;gap:1em;padding:1.5em 1.5em 1em;overflow:hidden;width:100%}.ExportWallet-module__export-wallet___EyZys.ExportWallet-module__no-footer___fzl3R{padding-bottom:1.5em}.ExportWallet-module__flex-container___-vm5t{display:flex;flex-direction:column;gap:1em}.ExportWallet-module__export-wallet___EyZys [data-part=iframe-button]{margin:-2px;width:calc(100% + 4px)}.ExportWallet-module__export-wallet___EyZys *{box-sizing:border-box}.ExportWallet-module__export-wallet-title___MuI09{font-size:1em;line-height:1.1;font-weight:500;margin:0}.ExportWallet-module__footer___NvrFY{padding-left:0;padding-right:0}.ExportWalletModal-module__export-wallet___--L56{height:100%;overflow:hidden;gap:0}.ExportWalletModal-module__export-wallet___--L56.ExportWalletModal-module__in-mfa-flow___9Fe8k{background:transparent;overflow:visible;padding:1em 0 0}.ExportWalletModal-module__wrapper___r1E1L{box-sizing:border-box;color:var(--cdp-web-colors-page-text-default);font:var(--cdp-web-font-size-base) / 1.5 var(--cdp-web-font-family-body);font-optical-sizing:auto;padding:1.5em 1.5em 1em}.ExportWalletModal-module__wrapper___r1E1L.ExportWalletModal-module__no-footer___J8uj2{padding-bottom:1.5em}.ExportWalletModal-module__trigger___zMk8N{padding-left:2em;padding-right:2em}.ExportWalletModal-module__title-bar___RTPZq{display:flex;justify-content:space-between;align-items:center;width:100%}.ExportWalletModal-module__title-bar-space-bottom___l-NvR{margin-bottom:1em}.ExportWalletModal-module__export-wallet-title___2k0L-{font-size:1em;line-height:1.1;font-weight:500;margin:0}.ExportWalletModal-module__content___KzNol{display:flex;flex-direction:column;gap:1em}.ExportWalletModal-module__close-button___ImsDR{margin-left:auto;margin-right:0;padding:0}.ExportWalletModal-module__close-icon___iAfyT{height:1.5em;width:1.5em}.ExportWalletModal-module__footer___byg1T{padding:.75em 0 0}.ExportWalletModal-module__footer-space-top___URl9q{margin-top:1em}.ExportWalletModal-module__visually-hidden___JAcNA{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@media (min-width: 450px){.ExportWalletModal-module__modal___pX1AP{max-width:25em}}
@@ -1 +1 @@
1
- .OTPForm-module__otp-form___G1-63 [data-part=input-group]{padding-bottom:1.5em}.OTPForm-module__otp-form___G1-63 [data-part=success],.OTPForm-module__otp-form___G1-63 [data-part=error]{margin-top:-1.5em}.OTPForm-module__form-footer___ybmdd{display:flex;flex-flow:column nowrap;align-items:stretch;justify-content:center;min-height:1.5em;padding-top:1.5em;padding-bottom:.5em}.OTPForm-module__server-state-wrapper___R5j5k{margin-top:-1.5em;min-height:1.5em;position:relative;top:-.25em}.OTPForm-module__loading-spinner___8N9XU{color:var(--cdp-web-colors-link-primary-text-default);display:block;margin:0 auto}.OTPForm-module__resend-wrapper___aZUAz{display:flex;align-items:center;justify-content:center;text-align:center;min-height:1.5em}.OTPForm-module__reset-timer___7ElWj{color:var(--cdp-web-colors-page-text-muted);font-weight:500;line-height:1em;min-height:1em;display:flex;align-items:center;justify-content:center}.OTPForm-module__reset-timer___7ElWj p{font-size:.875em;line-height:1;margin:0}
1
+ .OTPForm-module__otp-form___G1-63 [data-part=input-group]{padding-bottom:1.5em}.OTPForm-module__otp-form___G1-63 [data-part=success],.OTPForm-module__otp-form___G1-63 [data-part=error]{margin-top:-1.5em}.OTPForm-module__resend-controls___yFns-{display:flex;flex-flow:column nowrap;align-items:stretch;justify-content:center;min-height:1.5em;padding-top:1.5em;padding-bottom:.5em}.OTPForm-module__loading-spinner-wrapper___iw7f0{margin-top:-1.5em;min-height:1.5em;position:relative;top:.25em}.OTPForm-module__resend-controls-spinner-wrapper___AyU3A{top:-.25em}.OTPForm-module__loading-spinner___8N9XU{color:var(--cdp-web-colors-link-primary-text-default);display:block;margin:0 auto}.OTPForm-module__resend-wrapper___aZUAz{display:flex;align-items:center;justify-content:center;text-align:center;min-height:1.5em}.OTPForm-module__reset-timer___7ElWj{color:var(--cdp-web-colors-page-text-muted);font-weight:500;line-height:1em;min-height:1em;display:flex;align-items:center;justify-content:center}.OTPForm-module__reset-timer___7ElWj p{font-size:.875em;line-height:1;margin:0}
@@ -0,0 +1 @@
1
+ .QRCode-module__qr-code___Ourka{margin:0 auto}
@@ -0,0 +1 @@
1
+ .ToggleListItem-module__item___MoMVD{display:flex;align-items:center;justify-content:flex-start;gap:.75em;padding:.75em 1em;margin:0;box-shadow:inset 0 0 0 1px var(--cdp-web-colors-page-border-default);color:var(--cdp-web-colors-page-text-default);border-radius:.75em}.ToggleListItem-module__item___MoMVD[data-size=md]{padding:.75em 1em}.ToggleListItem-module__item___MoMVD[data-size=sm]{padding:.5em 1em}.ToggleListItem-module__item-icon___-fk9h{display:flex;align-items:center;justify-content:center;width:1em;height:1em}.ToggleListItem-module__item-icon___-fk9h svg{width:.875em;height:.875em}.ToggleListItem-module__item-text___nFMfG{font-weight:500;font-size:.875em;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ToggleListItem-module__item-action___G48jL{display:flex;align-items:center;margin-left:auto;margin-right:0}.ToggleListItem-module__button___MEFkz{width:1.5em;height:1.5em;padding:0}.ToggleListItem-module__button___MEFkz:disabled{opacity:.5;cursor:not-allowed}.ToggleListItem-module__button___MEFkz svg{width:.75em;height:.75em}
@@ -0,0 +1 @@
1
+ .VerifyMfaDescription-module__description___mDWgu{color:var(--cdp-web-colors-page-text-muted);font-size:.875em;line-height:normal;text-align:center;margin:0}
@@ -0,0 +1 @@
1
+ .VerifyMfaFlow-module__method-wrapper___LEPzD{width:100%}
@@ -0,0 +1 @@
1
+ .VerifyMfaImage-module__image___xftcN{text-align:center;width:100%}
@@ -0,0 +1 @@
1
+ .VerifyMfaInline-module__verify-mfa-inline___mn38o{box-sizing:border-box;overflow:hidden;width:100%}.VerifyMfaInline-module__verify-mfa-inline___mn38o *{box-sizing:border-box}.VerifyMfaInline-module__icon___pezMX{width:1.5em;height:auto}div.VerifyMfaInline-module__mfa-verification___WyY76{padding:0}.VerifyMfaInline-module__mfa-verification-content___M4fq0{display:flex;flex-direction:column;align-items:center;gap:1em;width:100%}.VerifyMfaInline-module__mfa-verification-form___8h2u-{padding-top:.5em}
@@ -0,0 +1 @@
1
+ .VerifyMfaTitle-module__heading___18nul{font-size:1em;font-weight:500;line-height:1.5;text-align:center;margin:0}
@@ -0,0 +1 @@
1
+ .totp-module__qr-code___qyK1k{border-radius:12px;margin:0 auto;max-width:142px;overflow:hidden;width:100%}.totp-module__qr-code___qyK1k svg{display:block;height:auto;transition:opacity .2s ease-out;width:100%}.totp-module__qr-code___qyK1k.totp-module__expired___SKiyj svg{opacity:.5;filter:blur(4px)}.totp-module__container___1aL5H{display:flex;flex-direction:column;gap:1em}.totp-module__copy-key___iwzZf{display:flex;flex-direction:column;gap:.25em}.totp-module__copy-key___iwzZf.totp-module__expired___SKiyj [data-part=input-text]{filter:blur(4px)}.totp-module__otp-form___OzooV{padding-top:.5em}
@@ -0,0 +1,299 @@
1
+ import { jsx as o, jsxs as p, Fragment as N } from "react/jsx-runtime";
2
+ import { OAuth2ProviderType as Q, CDPContext as ee, CDPHooksProvider as oe } from "@coinbase/cdp-hooks";
3
+ import { useRef as A, useEffect as S, createContext as D, useState as $, useCallback as m, useMemo as E, useContext as P, useId as j, lazy as te } from "react";
4
+ import { registerMfaListener as re, cancelMfaVerification as ne } from "@coinbase/cdp-core";
5
+ import { A as se, u as J } from "./useSendComponentCallOnce.BHZMuo6E.js";
6
+ import { ThemeProvider as ae } from "../components/ThemeProvider/index.js";
7
+ import { c as ie } from "./lite.1fxw3LjI.js";
8
+ import { Button as Y } from "../components/ui/Button/index.js";
9
+ import { Modal as ce, ModalContent as fe, ModalClose as le, ModalTitle as de, ModalDescription as ue, ModalTrigger as me } from "../components/ui/Modal/index.js";
10
+ import { VerifyMfaDescription as q } from "../components/VerifyMfa/VerifyMfaDescription.js";
11
+ import { VerifyMfaFlow as z } from "../components/VerifyMfa/VerifyMfaFlow.js";
12
+ import { VerifyMfaFooter as B } from "../components/VerifyMfa/VerifyMfaFooter.js";
13
+ import { VerifyMfaImage as G } from "../components/VerifyMfa/VerifyMfaImage.js";
14
+ import { VerifyMfaProvider as pe, useVerifyMfaContext as he } from "../components/VerifyMfa/VerifyMfaProvider.js";
15
+ import { VerifyMfaTitle as X } from "../components/VerifyMfa/VerifyMfaTitle.js";
16
+ import { IconXMark as Me } from "../icons/IconXMark.js";
17
+ import { childrenHasComponent as I } from "../utils/childrenHasComponent.js";
18
+ import '../assets/CDPReactProvider.css';function _e(e) {
19
+ const t = A(!1);
20
+ S(() => {
21
+ t.current || (se.sendHookCallEvent({ name: e }), t.current = !0);
22
+ }, [e]);
23
+ }
24
+ const ve = "VerifyMfa-module__footer___3bANn", b = {
25
+ "mfa-verification": "VerifyMfa-module__mfa-verification___txLpd",
26
+ "mfa-verification-content": "VerifyMfa-module__mfa-verification-content___-ksMh",
27
+ "mfa-verification-form": "VerifyMfa-module__mfa-verification-form___7b69Y",
28
+ footer: ve
29
+ }, ye = ({
30
+ className: e = "",
31
+ children: t,
32
+ ...r
33
+ }) => {
34
+ const { state: n } = he(), { showCoinbaseFooter: s } = R(), a = typeof t == "function" ? t(n) : t;
35
+ return /* @__PURE__ */ p("div", { className: `${b["mfa-verification"]} ${e}`, ...r, children: [
36
+ a,
37
+ !a && /* @__PURE__ */ p("div", { className: b["mfa-verification-content"], children: [
38
+ /* @__PURE__ */ o(G, {}),
39
+ /* @__PURE__ */ p("div", { children: [
40
+ /* @__PURE__ */ o(X, {}),
41
+ /* @__PURE__ */ o(q, {})
42
+ ] }),
43
+ /* @__PURE__ */ o(z, { className: b["mfa-verification-form"] }),
44
+ s && /* @__PURE__ */ o(B, { className: b.footer })
45
+ ] })
46
+ ] });
47
+ }, Ce = ({ onSuccess: e, onError: t, ...r }) => (J("verify_mfa"), /* @__PURE__ */ o(pe, { onError: t, onSuccess: e, children: /* @__PURE__ */ o(ye, { ...r }) })), ge = "VerifyMfaModal-module__verify___GZ6dw", Ve = "VerifyMfaModal-module__content___BSj0G", Ae = "VerifyMfaModal-module__header___2plY9", Pe = "VerifyMfaModal-module__trigger___YXiwC", we = "VerifyMfaModal-module__flow___HE2Lf", V = {
48
+ verify: ge,
49
+ content: Ve,
50
+ header: Ae,
51
+ "close-icon": "VerifyMfaModal-module__close-icon___pyobJ",
52
+ "close-button": "VerifyMfaModal-module__close-button___h9yrq",
53
+ trigger: Pe,
54
+ flow: we
55
+ }, K = D(null), xe = () => {
56
+ const e = P(K);
57
+ if (!e)
58
+ throw new Error("useVerifyMfaModalContext must be used within a VerifyMfaModal");
59
+ return e;
60
+ }, U = ({
61
+ children: e,
62
+ className: t = "",
63
+ label: r,
64
+ ...n
65
+ }) => /* @__PURE__ */ o(me, { asChild: !0, children: e || /* @__PURE__ */ o(Y, { className: ie(V.trigger, t), ...n, children: r || "Verify" }) }), O = ({ children: e, ...t }) => {
66
+ const { onSuccess: r, onError: n } = xe(), { showCoinbaseFooter: s } = R();
67
+ return /* @__PURE__ */ o(fe, { ...t, children: /* @__PURE__ */ o(Ce, { className: V.verify, onSuccess: r, onError: n, children: (a) => /* @__PURE__ */ p(N, { children: [
68
+ e ? typeof e == "function" ? e(a) : e : null,
69
+ !e && /* @__PURE__ */ p(N, { children: [
70
+ /* @__PURE__ */ p("div", { className: V.header, children: [
71
+ /* @__PURE__ */ o("span", {}),
72
+ /* @__PURE__ */ o(le, { asChild: !0, children: /* @__PURE__ */ o(
73
+ Y,
74
+ {
75
+ className: V["close-button"],
76
+ "aria-label": "Close",
77
+ size: "md",
78
+ variant: "transparentSecondary",
79
+ children: /* @__PURE__ */ o(Me, { className: V["close-icon"] })
80
+ }
81
+ ) })
82
+ ] }),
83
+ /* @__PURE__ */ p("div", { className: V.content, children: [
84
+ /* @__PURE__ */ o(G, {}),
85
+ /* @__PURE__ */ p("div", { children: [
86
+ /* @__PURE__ */ o(de, { asChild: !0, children: /* @__PURE__ */ o(X, {}) }),
87
+ /* @__PURE__ */ o(ue, { asChild: !0, children: /* @__PURE__ */ o(q, {}) })
88
+ ] }),
89
+ /* @__PURE__ */ o("div", { className: V.flow, children: /* @__PURE__ */ o(z, {}) })
90
+ ] }),
91
+ s && /* @__PURE__ */ o(B, {})
92
+ ] })
93
+ ] }) }) });
94
+ }, be = ({
95
+ children: e,
96
+ open: t,
97
+ setIsOpen: r,
98
+ onCancel: n,
99
+ onError: s,
100
+ onSuccess: a
101
+ }) => {
102
+ J("verify_mfa_modal");
103
+ const f = t !== void 0 && r !== void 0, [i, u] = $(!1), M = f ? t : i, l = A(!1), _ = m(
104
+ (v) => {
105
+ l.current = !0, a?.(v);
106
+ },
107
+ [a]
108
+ ), y = m(
109
+ (v) => {
110
+ f ? r?.(v) : u(v), v || (l.current || n?.(), l.current = !1);
111
+ },
112
+ [f, r, u, n]
113
+ ), h = e ? I(e, U) : !1, d = e ? I(e, O) : !1, w = !h && !d, x = E(
114
+ () => ({ onCancel: n, onError: s, onSuccess: _ }),
115
+ [n, s, _]
116
+ );
117
+ return /* @__PURE__ */ o(K.Provider, { value: x, children: /* @__PURE__ */ o(ce, { open: M, onOpenChange: y, children: w ? /* @__PURE__ */ p(N, { children: [
118
+ /* @__PURE__ */ o(U, { children: e }),
119
+ /* @__PURE__ */ o(O, {})
120
+ ] }) : /* @__PURE__ */ p(N, { children: [
121
+ e,
122
+ !d && /* @__PURE__ */ o(O, {})
123
+ ] }) }) });
124
+ }, Oe = (e) => e?.closest("[data-cdp-provider]")?.getAttribute?.("data-cdp-provider") ?? null, F = D(void 0), Ne = "__core_mfa_handler__", Se = ({ children: e }) => {
125
+ const { mfa: t } = R(), r = He(), { disableAutoPrompt: n } = t, [s, a] = $(null), f = A(/* @__PURE__ */ new Map()), i = A(!1), u = m((c, C) => {
126
+ f.current.set(c, C);
127
+ }, []), M = m((c) => {
128
+ f.current.delete(c);
129
+ }, []), l = A(s);
130
+ l.current = s;
131
+ const _ = A(null), y = m((c) => l.current !== null ? !1 : (_.current = document.activeElement, a(c), !0), []), h = m(() => {
132
+ a(null);
133
+ const c = _.current;
134
+ _.current = null, c && requestAnimationFrame(() => {
135
+ c.focus();
136
+ });
137
+ }, []);
138
+ S(() => n ? void 0 : re(() => {
139
+ const C = document.activeElement, k = Oe(C);
140
+ k !== null && k !== r || (i.current = !0, y(Ne));
141
+ }), [n, y, r]);
142
+ const d = s ? f.current.get(s)?.current : void 0, w = s !== null, x = m(
143
+ (c) => {
144
+ c || h();
145
+ },
146
+ [h]
147
+ ), v = m(
148
+ (c) => {
149
+ i.current && (i.current = !1), d?.onSuccess?.(c);
150
+ const C = d?.closeOnSuccessDelay === void 0 ? 500 : d?.closeOnSuccessDelay;
151
+ C !== null && (C === 0 ? h() : setTimeout(() => h(), C));
152
+ },
153
+ [d, h]
154
+ ), L = m(
155
+ (c) => {
156
+ d?.onError?.(c);
157
+ },
158
+ [d]
159
+ ), T = m(() => {
160
+ i.current && (ne(), i.current = !1), d?.onCancel?.();
161
+ }, [d]), Z = E(
162
+ () => ({
163
+ register: u,
164
+ unregister: M,
165
+ open: y,
166
+ close: h
167
+ }),
168
+ [u, M, y, h]
169
+ );
170
+ return /* @__PURE__ */ p(F.Provider, { value: Z, children: [
171
+ e,
172
+ /* @__PURE__ */ o(
173
+ be,
174
+ {
175
+ open: w,
176
+ setIsOpen: x,
177
+ onSuccess: v,
178
+ onError: L,
179
+ onCancel: T,
180
+ children: /* @__PURE__ */ o(O, {})
181
+ }
182
+ )
183
+ ] });
184
+ }, Qe = (e = {}) => {
185
+ const t = P(F);
186
+ if (!t)
187
+ throw new Error(
188
+ "useVerifyMfaModal must be used within a MfaVerificationProvider or CDPReactProvider"
189
+ );
190
+ _e("use_verify_mfa_modal");
191
+ const r = j(), n = A(e);
192
+ S(() => {
193
+ n.current = e;
194
+ }, [e]);
195
+ const { register: s, unregister: a, open: f, close: i } = t;
196
+ S(() => (s(r, n), () => a(r)), [s, a, r]);
197
+ const u = m(() => f(r), [f, r]), M = m(() => {
198
+ i();
199
+ }, [i]);
200
+ return { open: u, close: M };
201
+ }, eo = () => P(F) ?? {
202
+ register: () => {
203
+ },
204
+ unregister: () => {
205
+ },
206
+ open: () => !1,
207
+ close: () => {
208
+ }
209
+ }, Ee = te(() => import("../components/OAuthStatusModal/index.js")), W = (e) => {
210
+ try {
211
+ return JSON.stringify(e);
212
+ } catch {
213
+ }
214
+ return "";
215
+ }, Te = Object.keys(Q).map((e) => `oauth:${e}`), De = [
216
+ /** Email OTP method */
217
+ "email",
218
+ /** SMS OTP method */
219
+ "sms"
220
+ ], oo = [...De, ...Te], to = ({
221
+ children: e,
222
+ className: t = "",
223
+ config: r,
224
+ name: n,
225
+ style: s,
226
+ theme: a
227
+ }) => {
228
+ const f = j(), i = n ?? f, { appName: u, appLogoUrl: M, showCoinbaseFooter: l, authMethods: _, ...y } = r, h = W(y), d = E(() => y, [h]), w = { appName: u, appLogoUrl: M, showCoinbaseFooter: l, authMethods: _ }, x = _?.some((T) => T.startsWith("oauth:")), v = /* @__PURE__ */ o(Fe, { name: i, config: w, children: /* @__PURE__ */ o(ae, { className: t, style: s, theme: a, "data-cdp-provider": i, children: /* @__PURE__ */ p(Se, { children: [
229
+ e,
230
+ x && /* @__PURE__ */ o(Ee, {})
231
+ ] }) }) });
232
+ return P(ee) ? v : /* @__PURE__ */ o(oe, { config: d, children: v });
233
+ }, H = D(
234
+ void 0
235
+ ), g = {
236
+ appName: "",
237
+ appLogoUrl: "",
238
+ showCoinbaseFooter: !0,
239
+ authMethods: ["email"],
240
+ mfa: {
241
+ disableAutoPrompt: !1
242
+ }
243
+ }, Fe = ({
244
+ children: e,
245
+ config: t,
246
+ name: r
247
+ }) => {
248
+ const {
249
+ appName: n = g.appName,
250
+ appLogoUrl: s = g.appLogoUrl,
251
+ showCoinbaseFooter: a = g.showCoinbaseFooter,
252
+ authMethods: f = g.authMethods,
253
+ mfa: { disableAutoPrompt: i = g.mfa.disableAutoPrompt } = g.mfa
254
+ } = t ?? {}, u = W(f), M = E(() => {
255
+ let l = ["email"];
256
+ try {
257
+ l = JSON.parse(u);
258
+ } catch {
259
+ }
260
+ return {
261
+ app: {
262
+ appName: n,
263
+ appLogoUrl: s,
264
+ showCoinbaseFooter: a,
265
+ authMethods: Array.isArray(l) && l?.length ? l : g.authMethods,
266
+ mfa: {
267
+ disableAutoPrompt: i
268
+ }
269
+ },
270
+ name: r
271
+ };
272
+ }, [n, s, a, u, r, i]);
273
+ return /* @__PURE__ */ o(H.Provider, { value: M, children: e });
274
+ }, R = () => {
275
+ const e = P(H);
276
+ if (!e)
277
+ throw new Error("useAppConfig must be used within an AppConfigProvider");
278
+ return e.app;
279
+ }, He = () => {
280
+ const e = P(H);
281
+ if (!e)
282
+ throw new Error("useProviderName must be used within an AppConfigProvider");
283
+ return e.name ?? "";
284
+ };
285
+ export {
286
+ De as A,
287
+ to as C,
288
+ Te as O,
289
+ Ce as V,
290
+ He as a,
291
+ Qe as b,
292
+ oo as c,
293
+ be as d,
294
+ O as e,
295
+ U as f,
296
+ Se as g,
297
+ eo as h,
298
+ R as u
299
+ };
@@ -1,6 +1,6 @@
1
1
  import { jsx as i, jsxs as m, Fragment as p } from "react/jsx-runtime";
2
2
  import { createContext as S, useContext as I, useMemo as v, forwardRef as A, useRef as L, useImperativeHandle as x, useEffect as N } from "react";
3
- import { useAppConfig as C } from "../components/CDPReactProvider/index.js";
3
+ import { u as C } from "./CDPReactProvider.CIQm4C4z.js";
4
4
  import { SignIn as _ } from "../components/SignIn/index.js";
5
5
  import "@coinbase/cdp-hooks";
6
6
  import { SwitchSlideTransition as T } from "../components/ui/SwitchSlideTransition/index.js";
@@ -0,0 +1,9 @@
1
+ import "@coinbase/cdp-hooks";
2
+ import "react";
3
+ import { totpMethodConfig as t } from "../components/EnrollMfa/methods/totp.js";
4
+ const p = {
5
+ totp: t
6
+ };
7
+ export {
8
+ p as m
9
+ };
@@ -1,5 +1,5 @@
1
1
  import { OAuth2ProviderType as t } from "@coinbase/cdp-hooks";
2
- import "../components/CDPReactProvider/index.js";
2
+ import "./CDPReactProvider.CIQm4C4z.js";
3
3
  import { config as i } from "../components/SignIn/flows/SignInWithEmail.js";
4
4
  import { config as m } from "../components/SignIn/flows/SignInWithSms.js";
5
5
  import "react";
@@ -0,0 +1,9 @@
1
+ import "@coinbase/cdp-hooks";
2
+ import "react";
3
+ import { totpMethodConfig as t } from "../components/VerifyMfa/methods/totp.js";
4
+ const r = {
5
+ totp: t
6
+ };
7
+ export {
8
+ r as m
9
+ };
@@ -9,12 +9,15 @@ export interface AppConfig {
9
9
  appLogoUrl?: string;
10
10
  showCoinbaseFooter?: boolean;
11
11
  authMethods?: [AuthMethod, ...AuthMethod[]];
12
+ mfa?: {
13
+ disableAutoPrompt?: boolean;
14
+ };
12
15
  }
13
16
  export type Config = AppConfig & CDPHooksConfig;
14
17
  export type CDPReactProviderProps = {
15
18
  config: Config;
16
19
  name?: string;
17
20
  } & ThemeProviderProps;
18
- export declare const CDPReactProvider: ({ children, className, config, name, style, theme, }: CDPReactProviderProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const CDPReactProvider: ({ children, className, config, name: nameFromProps, style, theme, }: CDPReactProviderProps) => import("react/jsx-runtime").JSX.Element;
19
22
  export declare const useAppConfig: () => Required<AppConfig>;
20
23
  export declare const useProviderName: () => string;
@@ -1,81 +1,13 @@
1
- import { jsx as c, jsxs as y } from "react/jsx-runtime";
2
- import { OAuth2ProviderType as w, CDPContext as O, CDPHooksProvider as H } from "@coinbase/cdp-hooks";
3
- import { lazy as N, createContext as T, useContext as m, useMemo as g } from "react";
4
- import { ThemeProvider as b } from "../ThemeProvider/index.js";
5
- const D = N(() => import("../OAuthStatusModal/index.js")), l = (o) => {
6
- try {
7
- return JSON.stringify(o);
8
- } catch {
9
- }
10
- return "";
11
- }, S = Object.keys(w).map((o) => `oauth:${o}`), U = [
12
- /** Email OTP method */
13
- "email",
14
- /** SMS OTP method */
15
- "sms"
16
- ], J = [...U, ...S], V = ({
17
- children: o,
18
- className: r = "",
19
- config: n,
20
- name: s,
21
- style: a,
22
- theme: i
23
- }) => {
24
- const { appName: h, appLogoUrl: p, showCoinbaseFooter: u, authMethods: t, ...d } = n, A = l(d), M = g(() => d, [A]), P = { appName: h, appLogoUrl: p, showCoinbaseFooter: u, authMethods: t }, v = t?.some((x) => x.startsWith("oauth:")), f = /* @__PURE__ */ c(L, { name: s, config: P, children: /* @__PURE__ */ y(b, { className: r, style: a, theme: i, children: [
25
- o,
26
- v && /* @__PURE__ */ c(D, {})
27
- ] }) });
28
- return m(O) ? f : /* @__PURE__ */ c(H, { config: M, children: f });
29
- }, C = T(
30
- void 0
31
- ), e = {
32
- appName: "",
33
- appLogoUrl: "",
34
- showCoinbaseFooter: !0,
35
- authMethods: ["email"]
36
- }, L = ({
37
- children: o,
38
- config: r,
39
- name: n
40
- }) => {
41
- const {
42
- appName: s = e.appName,
43
- appLogoUrl: a = e.appLogoUrl,
44
- showCoinbaseFooter: i = e.showCoinbaseFooter,
45
- authMethods: h = e.authMethods
46
- } = r ?? {}, p = l(h), u = g(() => {
47
- let t = ["email"];
48
- try {
49
- t = JSON.parse(p);
50
- } catch {
51
- }
52
- return {
53
- app: {
54
- appName: s,
55
- appLogoUrl: a,
56
- showCoinbaseFooter: i,
57
- authMethods: Array.isArray(t) && t?.length ? t : e.authMethods
58
- },
59
- name: n
60
- };
61
- }, [s, a, i, p, n]);
62
- return /* @__PURE__ */ c(C.Provider, { value: u, children: o });
63
- }, z = () => {
64
- const o = m(C);
65
- if (!o)
66
- throw new Error("useAppConfig must be used within an AppConfigProvider");
67
- return o.app;
68
- }, K = () => {
69
- const o = m(C);
70
- if (!o)
71
- throw new Error("useProviderName must be used within an AppConfigProvider");
72
- return o.name ?? "";
73
- };
1
+ import "react/jsx-runtime";
2
+ import "@coinbase/cdp-hooks";
3
+ import "react";
4
+ import { c as p, A as m, C as t, O as A, u as H, a as T } from "../../chunks/CDPReactProvider.CIQm4C4z.js";
5
+ import "../ThemeProvider/index.js";
74
6
  export {
75
- J as ALL_AUTH_METHODS,
76
- U as AUTH_METHODS,
77
- V as CDPReactProvider,
78
- S as OAUTH_METHODS,
79
- z as useAppConfig,
80
- K as useProviderName
7
+ p as ALL_AUTH_METHODS,
8
+ m as AUTH_METHODS,
9
+ t as CDPReactProvider,
10
+ A as OAUTH_METHODS,
11
+ H as useAppConfig,
12
+ T as useProviderName
81
13
  };