@coinbase/cdp-react 0.0.98 → 0.0.100

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 (199) hide show
  1. package/dist/components/AuthButton/index.d.ts +102 -0
  2. package/dist/components/CDPReactProvider/index.d.ts +114 -0
  3. package/dist/components/CopyAddress/index.d.ts +29 -0
  4. package/dist/components/CopyEvmKeyButton/index.d.ts +77 -0
  5. package/dist/components/CopySolanaKeyButton/index.d.ts +73 -0
  6. package/dist/components/EnrollMfa/EnrollMfaDescription.d.ts +21 -0
  7. package/dist/components/EnrollMfa/EnrollMfaFlow.d.ts +27 -0
  8. package/dist/components/EnrollMfa/EnrollMfaFlowBackButton.d.ts +19 -0
  9. package/dist/components/EnrollMfa/EnrollMfaFlowProvider.d.ts +52 -0
  10. package/dist/components/EnrollMfa/EnrollMfaFooter.d.ts +18 -0
  11. package/dist/components/EnrollMfa/EnrollMfaImage.d.ts +24 -0
  12. package/dist/components/EnrollMfa/EnrollMfaItem.d.ts +21 -0
  13. package/dist/components/EnrollMfa/EnrollMfaItems.d.ts +17 -0
  14. package/dist/components/EnrollMfa/EnrollMfaProvider.d.ts +35 -0
  15. package/dist/components/EnrollMfa/EnrollMfaTitle.d.ts +21 -0
  16. package/dist/components/EnrollMfa/index.d.ts +65 -0
  17. package/dist/components/EnrollMfa/methods/sms.d.ts +25 -0
  18. package/dist/components/EnrollMfa/methods/totp.d.ts +25 -0
  19. package/dist/components/EnrollMfa/types.d.ts +48 -0
  20. package/dist/components/EnrollMfa/useEnrollMfaReducer.d.ts +6 -0
  21. package/dist/components/EnrollMfaModal/index.d.ts +111 -0
  22. package/dist/components/ExportWallet/index.d.ts +163 -0
  23. package/dist/components/ExportWalletModal/index.d.ts +173 -0
  24. package/dist/components/Fund/FundForm.d.ts +18 -0
  25. package/dist/components/Fund/FundProvider.d.ts +17 -0
  26. package/dist/components/Fund/FundTitle.d.ts +12 -0
  27. package/dist/components/Fund/components/FundAmountInput.d.ts +13 -0
  28. package/dist/components/Fund/components/FundErrorScreen.d.ts +7 -0
  29. package/dist/components/Fund/components/FundPaymentMethods.d.ts +7 -0
  30. package/dist/components/Fund/components/FundPresetAmountInputs.d.ts +7 -0
  31. package/dist/components/Fund/components/FundTransactionStatus.d.ts +6 -0
  32. package/dist/components/Fund/hooks/useBuyUrl.d.ts +23 -0
  33. package/dist/components/Fund/hooks/useEmitLifecycleStatus.d.ts +12 -0
  34. package/dist/components/Fund/hooks/useExchangeRate.d.ts +17 -0
  35. package/dist/components/Fund/hooks/usePaymentMethods.d.ts +16 -0
  36. package/dist/components/Fund/hooks/usePopupMonitor.d.ts +9 -0
  37. package/dist/components/Fund/hooks/useSetupOnrampEventListeners.d.ts +6 -0
  38. package/dist/components/Fund/index.d.ts +87 -0
  39. package/dist/components/Fund/types.d.ts +137 -0
  40. package/dist/components/Fund/useFundReducer.d.ts +15 -0
  41. package/dist/components/Fund/utils/buildPaymentMethods.d.ts +15 -0
  42. package/dist/components/Fund/utils/setupOnrampEventListeners.d.ts +10 -0
  43. package/dist/components/Fund/utils/subscribeToWindowMessage.d.ts +27 -0
  44. package/dist/components/FundModal/index.d.ts +106 -0
  45. package/dist/components/LinkAuth/LinkAuthFlow.d.ts +25 -0
  46. package/dist/components/LinkAuth/LinkAuthFlowBackButton.d.ts +19 -0
  47. package/dist/components/LinkAuth/LinkAuthFlowProvider.d.ts +60 -0
  48. package/dist/components/LinkAuth/LinkAuthItem.d.ts +23 -0
  49. package/dist/components/LinkAuth/LinkAuthItems.d.ts +17 -0
  50. package/dist/components/LinkAuth/LinkAuthItems.js +30 -30
  51. package/dist/components/LinkAuth/LinkAuthProvider.d.ts +31 -0
  52. package/dist/components/LinkAuth/LinkAuthTitle.d.ts +17 -0
  53. package/dist/components/LinkAuth/index.d.ts +170 -0
  54. package/dist/components/LinkAuth/types.d.ts +31 -0
  55. package/dist/components/LinkAuth/utils.d.ts +12 -0
  56. package/dist/components/LinkAuthModal/index.d.ts +112 -0
  57. package/dist/components/OAuthStatusModal/index.d.ts +24 -0
  58. package/dist/components/SendEvmTransactionButton/index.d.ts +27 -0
  59. package/dist/components/SendSolanaTransactionButton/index.d.ts +27 -0
  60. package/dist/components/SignIn/SignInAuthMethodButtons.d.ts +26 -0
  61. package/dist/components/SignIn/SignInBackButton.d.ts +40 -0
  62. package/dist/components/SignIn/SignInCredentials.d.ts +13 -0
  63. package/dist/components/SignIn/SignInDescription.d.ts +35 -0
  64. package/dist/components/SignIn/SignInFooter.d.ts +27 -0
  65. package/dist/components/SignIn/SignInForm.d.ts +39 -0
  66. package/dist/components/SignIn/SignInImage.d.ts +38 -0
  67. package/dist/components/SignIn/SignInProvider.d.ts +54 -0
  68. package/dist/components/SignIn/SignInTitle.d.ts +35 -0
  69. package/dist/components/SignIn/flows/SignInWithEmail.d.ts +26 -0
  70. package/dist/components/SignIn/flows/SignInWithOAuth.d.ts +19 -0
  71. package/dist/components/SignIn/flows/SignInWithSms.d.ts +26 -0
  72. package/dist/components/SignIn/hooks/useEmailForm.d.ts +7 -0
  73. package/dist/components/SignIn/hooks/useOTPForm.d.ts +8 -0
  74. package/dist/components/SignIn/hooks/usePhoneNumberForm.d.ts +7 -0
  75. package/dist/components/SignIn/hooks/useSignInWithOAuth.d.ts +8 -0
  76. package/dist/components/SignIn/index.d.ts +124 -0
  77. package/dist/components/SignIn/types.d.ts +37 -0
  78. package/dist/components/SignIn/useSignInReducer.d.ts +9 -0
  79. package/dist/components/SignInModal/index.d.ts +123 -0
  80. package/dist/components/SignOutButton/index.d.ts +39 -0
  81. package/dist/components/ThemeProvider/index.d.ts +70 -0
  82. package/dist/components/VerifyMfa/VerifyMfaDescription.d.ts +24 -0
  83. package/dist/components/VerifyMfa/VerifyMfaFlow.d.ts +30 -0
  84. package/dist/components/VerifyMfa/VerifyMfaFlowBackButton.d.ts +19 -0
  85. package/dist/components/VerifyMfa/VerifyMfaFlowProvider.d.ts +51 -0
  86. package/dist/components/VerifyMfa/VerifyMfaFooter.d.ts +18 -0
  87. package/dist/components/VerifyMfa/VerifyMfaImage.d.ts +23 -0
  88. package/dist/components/VerifyMfa/VerifyMfaItem.d.ts +20 -0
  89. package/dist/components/VerifyMfa/VerifyMfaItems.d.ts +18 -0
  90. package/dist/components/VerifyMfa/VerifyMfaProvider.d.ts +40 -0
  91. package/dist/components/VerifyMfa/VerifyMfaTitle.d.ts +24 -0
  92. package/dist/components/VerifyMfa/index.d.ts +55 -0
  93. package/dist/components/VerifyMfa/methods/sms.d.ts +29 -0
  94. package/dist/components/VerifyMfa/methods/totp.d.ts +29 -0
  95. package/dist/components/VerifyMfa/types.d.ts +33 -0
  96. package/dist/components/VerifyMfa/useVerifyMfaReducer.d.ts +7 -0
  97. package/dist/components/VerifyMfaInline/index.d.ts +212 -0
  98. package/dist/components/VerifyMfaModal/index.d.ts +114 -0
  99. package/dist/components/forms/AmountInput/index.d.ts +16 -0
  100. package/dist/components/forms/AmountInput/types.d.ts +9 -0
  101. package/dist/components/forms/AmountInput/useAmountInput.d.ts +14 -0
  102. package/dist/components/forms/AmountInput/useInputScale.d.ts +12 -0
  103. package/dist/components/forms/AmountInput/useNumberParseAndFormat.d.ts +20 -0
  104. package/dist/components/forms/CountrySelect/index.d.ts +9 -0
  105. package/dist/components/forms/EmailForm/index.d.ts +17 -0
  106. package/dist/components/forms/ExchangeAmountInput/index.d.ts +19 -0
  107. package/dist/components/forms/ExchangeAmountInput/types.d.ts +12 -0
  108. package/dist/components/forms/ExchangeAmountInput/useExchangeAmountInput.d.ts +17 -0
  109. package/dist/components/forms/Field/index.d.ts +15 -0
  110. package/dist/components/forms/Input/index.d.ts +15 -0
  111. package/dist/components/forms/Label/index.d.ts +8 -0
  112. package/dist/components/forms/OTP/index.d.ts +6 -0
  113. package/dist/components/forms/OTPForm/index.d.ts +20 -0
  114. package/dist/components/forms/PhoneNumberForm/index.d.ts +27 -0
  115. package/dist/components/forms/PhoneNumberInput/index.d.ts +16 -0
  116. package/dist/components/forms/PhoneNumberInput/maskOverride.d.ts +6 -0
  117. package/dist/components/forms/PhoneNumberInput/usePhoneNumberFormatter.d.ts +7 -0
  118. package/dist/components/forms/Select/index.d.ts +30 -0
  119. package/dist/components/ui/Badge/index.d.ts +19 -0
  120. package/dist/components/ui/Banner/index.d.ts +25 -0
  121. package/dist/components/ui/Button/index.d.ts +50 -0
  122. package/dist/components/ui/ButtonBase/index.d.ts +20 -0
  123. package/dist/components/ui/CoinbaseFooter/index.d.ts +16 -0
  124. package/dist/components/ui/CopyTextField/index.d.ts +35 -0
  125. package/dist/components/ui/Error/index.d.ts +14 -0
  126. package/dist/components/ui/IframeButton/index.d.ts +17 -0
  127. package/dist/components/ui/LoadingSkeleton/index.d.ts +22 -0
  128. package/dist/components/ui/LoadingSpinner/index.d.ts +11 -0
  129. package/dist/components/ui/Modal/index.d.ts +82 -0
  130. package/dist/components/ui/QRCode/QRCodeSvg.d.ts +35 -0
  131. package/dist/components/ui/QRCode/index.d.ts +7 -0
  132. package/dist/components/ui/QRCode/useCorners.d.ts +9 -0
  133. package/dist/components/ui/QRCode/useDotsPath.d.ts +18 -0
  134. package/dist/components/ui/QRCode/useLogo.d.ts +18 -0
  135. package/dist/components/ui/QRCode/useMatrix.d.ts +7 -0
  136. package/dist/components/ui/ServerError/index.d.ts +6 -0
  137. package/dist/components/ui/SuccessMessage/index.d.ts +14 -0
  138. package/dist/components/ui/SwitchFadeTransition/index.d.ts +15 -0
  139. package/dist/components/ui/SwitchSlideTransition/index.d.ts +16 -0
  140. package/dist/components/ui/SwitchTransition/index.d.ts +42 -0
  141. package/dist/components/ui/ToggleListItem/index.d.ts +31 -0
  142. package/dist/components/ui/VisuallyHidden/index.d.ts +18 -0
  143. package/dist/data/countries.d.ts +15 -0
  144. package/dist/data/countryNames.d.ts +4 -0
  145. package/dist/hooks/useKeyExportPostMessage.d.ts +25 -0
  146. package/dist/hooks/usePhoneNumberState.d.ts +47 -0
  147. package/dist/hooks/usePhoneNumberValidators.d.ts +8 -0
  148. package/dist/hooks/useTimeout.d.ts +18 -0
  149. package/dist/hooks/useTimer.d.ts +6 -0
  150. package/dist/hooks/useTransitionMap.d.ts +22 -0
  151. package/dist/hooks/useVerifyMfaModal.d.ts +78 -0
  152. package/dist/icons/IconAppleLogo.d.ts +22 -0
  153. package/dist/icons/IconArrowLeft.d.ts +22 -0
  154. package/dist/icons/IconArrowsUpDown.d.ts +22 -0
  155. package/dist/icons/IconCheck.d.ts +22 -0
  156. package/dist/icons/IconCheckCircle.d.ts +21 -0
  157. package/dist/icons/IconChevronDown.d.ts +22 -0
  158. package/dist/icons/IconCoinbaseMark.d.ts +22 -0
  159. package/dist/icons/IconCoinbaseWordmark.d.ts +22 -0
  160. package/dist/icons/IconCopy.d.ts +22 -0
  161. package/dist/icons/IconCreditCard.d.ts +22 -0
  162. package/dist/icons/IconCurrencies.d.ts +22 -0
  163. package/dist/icons/IconEnvelope.d.ts +22 -0
  164. package/dist/icons/IconExclamationCircle.d.ts +22 -0
  165. package/dist/icons/IconExclamationTriangle.d.ts +22 -0
  166. package/dist/icons/IconGoogleColorLogo.d.ts +22 -0
  167. package/dist/icons/IconGoogleLogo.d.ts +22 -0
  168. package/dist/icons/IconLock.d.ts +22 -0
  169. package/dist/icons/IconMinus.d.ts +21 -0
  170. package/dist/icons/IconPhone.d.ts +22 -0
  171. package/dist/icons/IconPinCode.d.ts +22 -0
  172. package/dist/icons/IconPlus.d.ts +21 -0
  173. package/dist/icons/IconShield.d.ts +22 -0
  174. package/dist/icons/IconSmartPhone.d.ts +22 -0
  175. package/dist/icons/IconTelegramLogo.d.ts +22 -0
  176. package/dist/icons/IconXLogo.d.ts +22 -0
  177. package/dist/icons/IconXMark.d.ts +22 -0
  178. package/dist/icons/SvgIcon.d.ts +6 -0
  179. package/dist/theme/cssVariables.d.ts +10 -0
  180. package/dist/theme/theme.d.ts +246 -0
  181. package/dist/theme/tokens.d.ts +54 -0
  182. package/dist/theme/utils.d.ts +63 -0
  183. package/dist/types/secureIframe.d.ts +3 -0
  184. package/dist/utils/capitalize.d.ts +8 -0
  185. package/dist/utils/childrenHasComponent.d.ts +10 -0
  186. package/dist/utils/clamp.d.ts +10 -0
  187. package/dist/utils/formatFiat.d.ts +11 -0
  188. package/dist/utils/formatPhoneNumber.d.ts +8 -0
  189. package/dist/utils/getMessageFromUnknownError.d.ts +9 -0
  190. package/dist/utils/isApiError.d.ts +21 -0
  191. package/dist/utils/isEmailInvalid.d.ts +15 -0
  192. package/dist/utils/openPopup.d.ts +15 -0
  193. package/dist/utils/parseValuesFromPhoneNumber.d.ts +16 -0
  194. package/dist/utils/sendIframeMessage.d.ts +8 -0
  195. package/dist/utils/toOAuthProviderType.d.ts +8 -0
  196. package/dist/utils/transition.d.ts +41 -0
  197. package/dist/version.d.ts +5 -1
  198. package/dist/version.js +1 -1
  199. package/package.json +5 -5
@@ -3,5 +3,13 @@ interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
3
3
  as?: ElementType;
4
4
  children?: ReactNode;
5
5
  }
6
+ /**
7
+ * A label component.
8
+ *
9
+ * @param {LabelProps} props - The props for the component.
10
+ * @param {ElementType} [props.as] - The element type to render the label as.
11
+ * @param {ReactNode} [props.children] - The children to render inside the label.
12
+ * @returns {JSX.Element} The label component.
13
+ */
6
14
  export declare const Label: ({ as: Component, children, className, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
7
15
  export {};
@@ -6,5 +6,11 @@ type OTPProps = {
6
6
  label?: ReactNode;
7
7
  passwordLength?: number;
8
8
  } & OneTimePasswordFieldProps;
9
+ /**
10
+ * A themed OTP component with a label.
11
+ *
12
+ * @param {OTPProps} props - The props for the component.
13
+ * @returns {JSX.Element} The OTP component.
14
+ */
9
15
  export declare const OTP: import('react').ForwardRefExoticComponent<Omit<OTPProps, "ref"> & import('react').RefAttributes<HTMLInputElement[]>>;
10
16
  export {};
@@ -1,5 +1,8 @@
1
1
  import { APIError } from '@coinbase/cdp-hooks';
2
2
  import { FormHTMLAttributes, Ref } from 'react';
3
+ /**
4
+ * The props for the OTPForm component.
5
+ */
3
6
  export interface OTPFormProps extends FormHTMLAttributes<HTMLFormElement> {
4
7
  canResetOTP?: boolean;
5
8
  error?: string | APIError;
@@ -13,4 +16,21 @@ export interface OTPFormProps extends FormHTMLAttributes<HTMLFormElement> {
13
16
  resendCountdown?: number | null;
14
17
  successMessage?: string;
15
18
  }
19
+ /**
20
+ * A form for signing in with an email address.
21
+ *
22
+ * @param {OTPFormProps} props - The props for the component.
23
+ * @param {OTPFormProps["canResetOTP"]} [props.canResetOTP] - Whether the OTP can be reset.
24
+ * @param {OTPFormProps["error"]} [props.error] - A (server) error message.
25
+ * @param {OTPFormProps["isPending"]} [props.isPending] - Whether the sign in is pending.
26
+ * @param {OTPFormProps["onOTPChange"]} [props.onOTPChange] - A function to call when the OTP input value changes.
27
+ * @param {OTPFormProps["onResendOTP"]} [props.onResendOTP] - A function to call when the OTP is resent.
28
+ * @param {OTPFormProps["otp"]} [props.otp] - The value for the OTP input group.
29
+ * @param {OTPFormProps["otpInputsRef"]} [props.otpInputsRef] - A ref for the OTP inputs (one input per digit).
30
+ * @param {OTPFormProps["passwordLength"]} [props.passwordLength] - The length of the password. Defaults to 6.
31
+ * @param {OTPFormProps["resendCountdown"]} [props.resendCountdown] - The number of seconds remaining before the OTP can be resent.
32
+ * @param {OTPFormProps["successMessage"]} [props.successMessage] - A success message to display.
33
+ * @param {FormEventHandler<HTMLFormElement>} [props.onSubmit] - A function to handle form submission.
34
+ * @returns {JSX.Element} The OTPForm component.
35
+ */
16
36
  export declare const OTPForm: ({ canResetOTP, children, error, isPending, onOTPChange, onResendOTP, otp, otpInputsRef, passwordLength, resendCountdown, successMessage, ...props }: OTPFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,42 @@
1
1
  import { APIError } from '@coinbase/cdp-hooks';
2
2
  import { FormHTMLAttributes, ReactNode } from 'react';
3
3
  import { PhoneNumberInputProps } from '../PhoneNumberInput';
4
+ /**
5
+ * The props for the PhoneNumberForm component.
6
+ */
4
7
  export interface PhoneNumberFormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "children"> {
8
+ /** The value of the country code input. */
5
9
  countryCode: PhoneNumberInputProps["countryCode"];
10
+ /** Either a boolean to enable or disable the default list of countries or an array of country options to display. */
6
11
  countryOptions?: PhoneNumberInputProps["countryOptions"];
12
+ /** An error message to display. */
7
13
  error?: string | APIError;
14
+ /** Whether the form is pending. */
8
15
  isPending?: boolean;
16
+ /** A function to call to clear the provided error. */
9
17
  onClearServerErrors?: () => void;
18
+ /** A function to call when the country code changes. */
10
19
  onCountryCodeChange: PhoneNumberInputProps["onCountryCodeChange"];
20
+ /** A function to call when the phone number changes. */
11
21
  onPhoneNumberChange: PhoneNumberInputProps["onPhoneNumberChange"];
22
+ /** The value of the phone number input. */
12
23
  phoneNumber: PhoneNumberInputProps["phoneNumber"];
24
+ /** The label for the submit button. */
13
25
  submitLabel?: ReactNode;
14
26
  }
27
+ /**
28
+ * A form for signing in with a phone number.
29
+ *
30
+ * @param {PhoneNumberFormProps} props - The props for the component.
31
+ * @param {PhoneNumberFormProps["className"]} [props.className] - The class name to apply to the form.
32
+ * @param {PhoneNumberFormProps["countryCode"]} [props.countryCode] - The value of the country code input.
33
+ * @param {PhoneNumberFormProps["error"]} [props.error] - A (server) error message.
34
+ * @param {PhoneNumberFormProps["isPending"]} [props.isPending] - Whether the form is pending.
35
+ * @param {PhoneNumberFormProps["onClearServerErrors"]} [props.onClearServerErrors] - A function to clear server errors.
36
+ * @param {PhoneNumberFormProps["onCountryCodeChange"]} [props.onCountryCodeChange] - A function to call when the country code changes.
37
+ * @param {PhoneNumberFormProps["onPhoneNumberChange"]} [props.onPhoneNumberChange] - A function to call when the phone number changes.
38
+ * @param {PhoneNumberFormProps["phoneNumber"]} [props.phoneNumber] - The value of the phone number input.
39
+ * @param {PhoneNumberFormProps["submitLabel"]} [props.submitLabel] - The label for the submit button.
40
+ * @returns {JSX.Element} The PhoneNumberForm component.
41
+ */
15
42
  export declare const PhoneNumberForm: ({ className, countryCode, countryOptions, error, isPending, onCountryCodeChange, onPhoneNumberChange, phoneNumber, submitLabel, ...props }: PhoneNumberFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,9 @@ import { CountryCode } from 'libphonenumber-js';
2
2
  import { InputProps } from '../Input';
3
3
  import { CountryOption } from '../../../data/countries';
4
4
  import { PhoneNumber } from '../../../utils/parseValuesFromPhoneNumber';
5
+ /**
6
+ * Props for the PhoneNumberInput component.
7
+ */
5
8
  export interface PhoneNumberInputProps extends Omit<InputProps, "value" | "onChange"> {
6
9
  onCountryCodeChange?: (newCountry: CountryCode) => void;
7
10
  countryCode?: CountryCode;
@@ -9,4 +12,17 @@ export interface PhoneNumberInputProps extends Omit<InputProps, "value" | "onCha
9
12
  onPhoneNumberChange: (phoneNumber: PhoneNumber) => void;
10
13
  phoneNumber: PhoneNumber;
11
14
  }
15
+ /**
16
+ * A phone number input component.
17
+ *
18
+ * @param props - The props for the PhoneNumberInput component.
19
+ * @param {string} [props.autoComplete] - The auto complete attribute for the input.
20
+ * @param {string} [props.className] - The class name for the PhoneNumberInput component.
21
+ * @param {CountryCode} [props.countryCode] - The country code for the phone number.
22
+ * @param {boolean | CountryOption[]} [props.countryOptions] - The country options to display.
23
+ * @param {(value: CountryCode) => void} props.onCountryCodeChange - The function to call when the country code changes.
24
+ * @param {(value: string) => void} props.onPhoneNumberChange - The function to call when the phone number changes.
25
+ * @param {string} props.phoneNumber - The value of the phone number.
26
+ * @returns {JSX.Element} The PhoneNumberInput component.
27
+ */
12
28
  export declare const PhoneNumberInput: import('react').ForwardRefExoticComponent<PhoneNumberInputProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -4,5 +4,11 @@ type MaskFormatOverride = {
4
4
  maxLength?: number;
5
5
  normalizer?: (value: string) => string;
6
6
  };
7
+ /**
8
+ * Get the mask override for a country code.
9
+ *
10
+ * @param [countryCode] - The country code to get the mask override for.
11
+ * @returns {MaskFormatOverride} The mask override for the country code.
12
+ */
7
13
  export declare const getMaskOverride: (countryCode?: CountryCode) => MaskFormatOverride;
8
14
  export {};
@@ -1,4 +1,11 @@
1
1
  import { CountryCode } from 'libphonenumber-js';
2
+ /**
3
+ * A hook that formats a phone number.
4
+ *
5
+ * @param phoneNumber - The phone number to format.
6
+ * @param [countryCode] - The country code to format the phone number for.
7
+ * @returns {object} An object with the formatted phone number, a placeholder string, and functions to format the phone number and country code.
8
+ */
2
9
  export declare const usePhoneNumberFormatter: (phoneNumber: string, countryCode: CountryCode | undefined) => {
3
10
  formatBeforePhoneNumberChange: (inputPhoneNumber: string) => import('../../../utils/parseValuesFromPhoneNumber').PhoneNumber;
4
11
  formatBeforeCountryCodeChange: (newCountryCode: CountryCode) => import('../../../utils/parseValuesFromPhoneNumber').PhoneNumber;
@@ -1,20 +1,50 @@
1
1
  import { SelectProps as SelectPropsPrimitive, SelectContentProps as SelectContentPropsPrimitive, SelectItemProps as SelectItemPropsPrimitive, SelectTriggerProps as SelectTriggerPropsPrimitive, SelectValueProps } from '@radix-ui/react-select';
2
2
  import { ReactNode } from 'react';
3
3
  import { InputSize } from '../../../theme/theme';
4
+ /**
5
+ * Select component props
6
+ */
4
7
  export interface SelectProps extends SelectPropsPrimitive {
5
8
  className?: string;
6
9
  }
10
+ /**
11
+ * SelectTrigger component props
12
+ */
7
13
  export interface SelectTriggerProps extends SelectTriggerPropsPrimitive {
8
14
  className?: string;
9
15
  placeholder?: SelectValueProps["placeholder"];
10
16
  size?: InputSize;
11
17
  }
18
+ /**
19
+ * SelectContent component props
20
+ */
12
21
  export interface SelectContentProps extends SelectContentPropsPrimitive {
13
22
  className?: string;
14
23
  }
24
+ /**
25
+ * SelectItem component props
26
+ */
15
27
  export interface SelectItemProps extends SelectItemPropsPrimitive {
16
28
  indicator?: boolean | ReactNode;
17
29
  }
30
+ /**
31
+ * Select component.
32
+ *
33
+ * @param {SelectProps} props - The props for the select.
34
+ * @returns {JSX.Element} The select component.
35
+ *
36
+ * @example
37
+ * ```tsx lines
38
+ * <Select>
39
+ * <SelectTrigger placeholder="Select an option" aria-label="Select an option" />
40
+ * <SelectContent>
41
+ * <SelectItem value="option-1">Option 1</SelectItem>
42
+ * <SelectItem value="option-2">Option 2</SelectItem>
43
+ * <SelectItem value="option-3">Option 3</SelectItem>
44
+ * </SelectContent>
45
+ * </Select>
46
+ * ```
47
+ */
18
48
  export declare const Select: ({ children, ...props }: SelectProps) => import("react/jsx-runtime").JSX.Element;
19
49
  export declare const SelectTrigger: import('react').ForwardRefExoticComponent<SelectTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
20
50
  export declare const SelectContent: import('react').ForwardRefExoticComponent<SelectContentProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,6 +1,25 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * The props for the Badge component.
4
+ */
2
5
  export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
6
+ /** The content of the badge. */
3
7
  children?: ReactNode;
8
+ /** The variant of the badge. Defaults to "primary". */
4
9
  variant?: "primary" | "secondary" | "warning";
5
10
  }
11
+ /**
12
+ * The props for the Badge component.
13
+ *
14
+ * @param {BadgeProps} props - The props for the Badge component.
15
+ * @returns {JSX.Element} The Badge component.
16
+ *
17
+ * @group Components
18
+ *
19
+ * @example
20
+ * ```tsx lines
21
+ * // Render a primary badge
22
+ * <Badge variant="primary">1</Badge>
23
+ * ```
24
+ */
6
25
  export declare const Badge: ({ children, className, variant, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,31 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * The props for the Banner component.
4
+ */
2
5
  export interface BannerProps extends HTMLAttributes<HTMLElement> {
6
+ /** A custom icon to display in the banner. If not provided, the variant icon will be displayed. */
3
7
  icon?: ReactNode;
8
+ /** The variant of the banner. When undefined, no icon will be rendered unless provided via the `icon` prop. */
4
9
  variant?: "success" | "warning" | "error";
5
10
  }
11
+ /**
12
+ * The Banner component is used to display a message to the user.
13
+ *
14
+ * @param {BannerProps} props - The props for the Banner component.
15
+ * @returns {JSX.Element} The Banner component.
16
+ *
17
+ * @group Components
18
+ *
19
+ * @example
20
+ * ```tsx lines
21
+ * // Render a success banner
22
+ * <Banner variant="success">A success message</Banner>
23
+ * ```
24
+ *
25
+ * @example
26
+ * ```tsx lines
27
+ * // Render a banner with no variant and a custom icon
28
+ * <Banner icon={<CustomIcon />}>A banner message</Banner>
29
+ * ```
30
+ */
6
31
  export declare const Banner: ({ className, children, icon, variant, ...props }: BannerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,58 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ButtonBaseProps } from '../ButtonBase';
3
3
  import { ButtonVariant } from '../../../theme/theme';
4
+ /**
5
+ * The props for the Button component.
6
+ *
7
+ * @interface ButtonProps
8
+ * @augments {ButtonBaseProps}
9
+ * @property {ReactNode} [pendingLabel] - The label to display when the button is pending.
10
+ * @property {ButtonVariant} [variant] - The variant of the button. Defaults to "primary".
11
+ */
4
12
  export interface ButtonProps extends ButtonBaseProps {
13
+ /** A label to render when the button state is pending. */
5
14
  pendingLabel?: ReactNode;
15
+ /** The variant of the button. Defaults to "primary". */
6
16
  variant?: ButtonVariant;
7
17
  }
18
+ /**
19
+ * A themed button component with loading state.
20
+ *
21
+ * @param {ButtonProps} props - The props for the component.
22
+ * @returns {JSX.Element} The Button component.
23
+ *
24
+ * @group Components
25
+ *
26
+ * @example
27
+ * ```tsx lines
28
+ * // Render a submit button
29
+ * <Button type="submit" onClick={() => console.log("Button clicked")}>Click me</Button>
30
+ * ```
31
+ *
32
+ * @example
33
+ * ```tsx lines
34
+ * // Render a small secondary button
35
+ * <Button type="button" variant="secondary" size="sm">Secondary button</Button>
36
+ * ```
37
+ *
38
+ * @example
39
+ * ```tsx lines
40
+ * // Render a full width button
41
+ * <Button fullWidth>Full width button</Button>
42
+ * ```
43
+ *
44
+ * @example
45
+ * ```tsx lines
46
+ * // Render a button with a pending state
47
+ * <Button isPending pendingLabel="Sending...">Send transaction</Button>
48
+ * ```
49
+ *
50
+ * @example
51
+ * ```tsx lines
52
+ * // Render a button with a custom button element
53
+ * <Button onClick={() => console.log("Button clicked")} asChild>
54
+ * <button>Send transaction</button>
55
+ * </Button>
56
+ * ```
57
+ */
8
58
  export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,9 +1,29 @@
1
1
  import { ButtonHTMLAttributes } from 'react';
2
2
  import { ButtonSize } from '../../../theme/theme';
3
+ /**
4
+ * The props for the Input component.
5
+ *
6
+ * @interface ButtonBaseProps
7
+ * @augments {ButtonHTMLAttributes<HTMLButtonElement>}
8
+ * @property {boolean} [asChild] - Set to true to use a custom element or component in place of the default one.
9
+ * @property {boolean} [fullWidth] - Whether the button should be full width.
10
+ * @property {boolean} [isPending] - Whether the button is pending.
11
+ * @property {ButtonSize} [size] - The size of the button. Defaults to "md".
12
+ */
3
13
  export interface ButtonBaseProps extends ButtonHTMLAttributes<HTMLButtonElement> {
14
+ /** Set to true to use a custom element or component in place of the default button element. */
4
15
  asChild?: boolean;
16
+ /** Whether the button should be full width. */
5
17
  fullWidth?: boolean;
18
+ /** Whether the button state is pending. */
6
19
  isPending?: boolean;
20
+ /** The size of the button. Defaults to "md". */
7
21
  size?: ButtonSize;
8
22
  }
23
+ /**
24
+ * A themed button component with loading state.
25
+ *
26
+ * @param {ButtonBaseProps} props - The props for the component.
27
+ * @returns {JSX.Element} The Button component.
28
+ */
9
29
  export declare const ButtonBase: import('react').ForwardRefExoticComponent<ButtonBaseProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,2 +1,18 @@
1
1
  import { HTMLAttributes } from 'react';
2
+ /**
3
+ * A footer component for the sign-in flow.
4
+ *
5
+ * @param {HTMLAttributes<HTMLDivElement>} props - The props for the component.
6
+ * @returns {JSX.Element} The sign-in footer.
7
+ *
8
+ * @example
9
+ * ```tsx lines
10
+ * function App() {
11
+ * // Add class to the footer
12
+ * return (
13
+ * <CoinbaseFooter className="sign-in-footer" />
14
+ * );
15
+ * }
16
+ * ```
17
+ */
2
18
  export declare const CoinbaseFooter: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,45 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * The props for the CopyTextField component.
4
+ *
5
+ * @see {@link CopyTextField}
6
+ */
2
7
  export interface CopyTextFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
8
+ /** The value to copy to the clipboard. */
3
9
  value: string;
10
+ /** Custom display content. If not provided, displays the full value. */
4
11
  displayValue?: ReactNode;
12
+ /** The label for the field. */
5
13
  label?: string;
14
+ /** Aria label for the copy button. Defaults to "Copy". */
6
15
  copyAriaLabel?: string;
16
+ /** A function to call when the copy button is clicked. */
7
17
  onCopy?: () => void;
18
+ /** A function to call when the value is copied successfully. */
8
19
  onCopySuccess?: () => void;
9
20
  }
21
+ /**
22
+ * A component that displays a value in a text field style container with a copy button.
23
+ *
24
+ * @param {CopyTextFieldProps} props - The props for the component.
25
+ * @returns {JSX.Element} The CopyTextField component.
26
+ *
27
+ * @group Components
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * // Display full value
32
+ * <CopyTextField value="some-secret-key" label="Secret Key" />
33
+ * ```
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * // With truncated display
38
+ * <CopyTextField
39
+ * value={address}
40
+ * displayValue={`${address.slice(0, 6)}...${address.slice(-4)}`}
41
+ * label="Address"
42
+ * />
43
+ * ```
44
+ */
10
45
  export declare const CopyTextField: ({ className, value, displayValue, label, copyAriaLabel, onCopy, onCopySuccess, ...props }: CopyTextFieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,21 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * The props for the Error component.
4
+ *
5
+ * @interface Props
6
+ * @property {ReactNode} children - The children of the component.
7
+ * @property {string} [id] - The id of the component.
8
+ * @property {string} [className] - The class name of the component.
9
+ */
2
10
  export interface Props extends HTMLAttributes<HTMLParagraphElement> {
3
11
  children: ReactNode;
4
12
  id?: string;
5
13
  className?: string;
6
14
  }
15
+ /**
16
+ * A themed Error component.
17
+ *
18
+ * @param {Props} props - The props for the component.
19
+ * @returns {JSX.Element} The Error component.
20
+ */
7
21
  export declare const Error: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLParagraphElement>>;
@@ -1,15 +1,32 @@
1
1
  import { IframeHTMLAttributes, ReactNode } from 'react';
2
2
  import { ButtonSize, ButtonVariant } from '../../../theme/theme';
3
3
  import { IframeTheme } from '../../../types/secureIframe';
4
+ /**
5
+ * The props for the IframeButton component.
6
+ */
4
7
  interface IframeButtonProps extends IframeHTMLAttributes<HTMLIFrameElement> {
8
+ /** Whether to show an icon in the button. */
5
9
  icon?: boolean;
10
+ /** Whether the button is pending. */
6
11
  isPending?: boolean;
12
+ /** Whether the button should be full width. */
7
13
  fullWidth?: boolean;
14
+ /** The label to display on the button. */
8
15
  label: ReactNode;
16
+ /** A function to call when the theme changes. */
9
17
  onThemeChange?: (theme: IframeTheme) => void;
18
+ /** The size of the button. */
10
19
  size?: ButtonSize;
20
+ /** Theme overrides to apply to the button. The theme will be computed from the provided variant and then this theme object will be merged on top of it. */
11
21
  theme?: Partial<IframeTheme>;
22
+ /** The variant of the button. Defaults to "primary". */
12
23
  variant?: Extract<ButtonVariant, "primary" | "secondary">;
13
24
  }
25
+ /**
26
+ * The IframeButton component is used to display a button that opens a secure iframe.
27
+ *
28
+ * @param {IframeButtonProps} props - The props for the IframeButton component.
29
+ * @returns {JSX.Element} The IframeButton component.
30
+ */
14
31
  declare const IframeButton: import('react').ForwardRefExoticComponent<IframeButtonProps & import('react').RefAttributes<HTMLIFrameElement>>;
15
32
  export { IframeButton, type IframeButtonProps, type IframeTheme };
@@ -5,5 +5,27 @@ interface LoadingSkeletonProps {
5
5
  style?: CSSProperties;
6
6
  children?: ReactNode;
7
7
  }
8
+ /**
9
+ * Loading skeleton component.
10
+ * Applies a pulse animation to the component.
11
+ *
12
+ * @param {LoadingSkeletonProps} props - The props for the component.
13
+ * @param {ElementType} [props.as] - The component to render. Note it must not have a Fragment as the root element. Defaults to "div".
14
+ * @param {ReactNode} [props.children] - The children of the component.
15
+ * @returns {JSX.Element} A loading skeleton component.
16
+ *
17
+ * @example
18
+ * ```tsx lines
19
+ * function LoadingCard() {
20
+ * return (
21
+ * <div className="loading-card">
22
+ * <LoadingSkeleton className="loading-title" />
23
+ * <LoadingSkeleton className="loading-p-line-1" />
24
+ * <LoadingSkeleton className="loading-p-line-2" />
25
+ * </div>
26
+ * )
27
+ * }
28
+ * ```
29
+ */
8
30
  export declare const LoadingSkeleton: ({ as: Component, children, className, style, }: LoadingSkeletonProps) => import("react/jsx-runtime").JSX.Element;
9
31
  export {};
@@ -6,5 +6,16 @@ interface LoadingSpinnerProps {
6
6
  strokeWidth?: string | number;
7
7
  style?: CSSProperties;
8
8
  }
9
+ /**
10
+ * Loading spinner component.
11
+ *
12
+ * @param {object} props - The props for the component.
13
+ * @param {string} [props.className] - The class name for the component.
14
+ * @param {boolean} [props.staticStroke] - Whether to show the static outline.
15
+ * @param {string} [props.staticStrokeColor] - The color of the static outline.
16
+ * @param {string | number} [props.strokeWidth] - The width of the spinner.
17
+ * @param {CSSProperties} [props.style] - The style for the component.
18
+ * @returns {JSX.Element} A loading spinner component.
19
+ */
9
20
  export declare const LoadingSpinner: ({ className, staticStroke, staticStrokeColor, strokeWidth, style, }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element;
10
21
  export {};
@@ -1,12 +1,94 @@
1
1
  import { DialogContentProps } from '@radix-ui/react-dialog';
2
2
  import { CSSProperties, HTMLAttributes } from 'react';
3
+ /**
4
+ * Props for the ModalContent component.
5
+ *
6
+ * @augments DialogContentProps
7
+ * @augments HTMLAttributes<HTMLDivElement>
8
+ * @property {string} overlayClassName - The class name to apply to the overlay.
9
+ * @property {CSSProperties} overlayStyle - The style to apply to the overlay.
10
+ *
11
+ * @see {@link ModalContent}
12
+ */
3
13
  export interface ModalContentProps extends DialogContentProps, HTMLAttributes<HTMLDivElement> {
4
14
  overlayClassName?: string;
5
15
  overlayStyle?: CSSProperties;
6
16
  }
17
+ /**
18
+ * The ModalContent component is a wrapper around a DialogOverlay and DialogContent. It is intended to be used with the {@link Modal} component.
19
+ *
20
+ * @see {@link Modal}
21
+ * @see {@link ModalClose}
22
+ * @see {@link ModalDescription}
23
+ * @see {@link ModalTitle}
24
+ * @see {@link ModalTrigger}
25
+ * @see https://www.radix-ui.com/primitives/docs/components/dialog
26
+ *
27
+ * @group Components
28
+ */
7
29
  export declare const ModalContent: import('react').ForwardRefExoticComponent<ModalContentProps & import('react').RefAttributes<HTMLDivElement>>;
30
+ /**
31
+ * The Modal component is the same as the Dialog component from Radix UI. This component is used to render the Radix UI Dialog component as a modal.
32
+ *
33
+ * @see {@link ModalClose}
34
+ * @see {@link ModalContent}
35
+ * @see {@link ModalDescription}
36
+ * @see {@link ModalTitle}
37
+ * @see {@link ModalTrigger}
38
+ * @see https://www.radix-ui.com/primitives/docs/components/dialog
39
+ *
40
+ * @group Components
41
+ */
8
42
  export declare const Modal: import('react').FC<import('@radix-ui/react-dialog').DialogProps>;
43
+ /**
44
+ * The ModalClose component is the same as the DialogClose component from Radix UI. It is intended to be used with the {@link Modal} component.
45
+ *
46
+ * @see {@link Modal}
47
+ * @see {@link ModalContent}
48
+ * @see {@link ModalDescription}
49
+ * @see {@link ModalTitle}
50
+ * @see {@link ModalTrigger}
51
+ * @see https://www.radix-ui.com/primitives/docs/components/dialog
52
+ *
53
+ * @group Components
54
+ */
9
55
  export declare const ModalClose: import('react').ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
56
+ /**
57
+ * The ModalDescription component is the same as the DialogDescription component from Radix UI. It is intended to be used with the {@link Modal} component.
58
+ *
59
+ * @see {@link Modal}
60
+ * @see {@link ModalClose}
61
+ * @see {@link ModalContent}
62
+ * @see {@link ModalTitle}
63
+ * @see {@link ModalTrigger}
64
+ * @see https://www.radix-ui.com/primitives/docs/components/dialog
65
+ *
66
+ * @group Components
67
+ */
10
68
  export declare const ModalDescription: import('react').ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogDescriptionProps & import('react').RefAttributes<HTMLParagraphElement>>;
69
+ /**
70
+ * The ModalTitle component is the same as the DialogTitle component from Radix UI. It is intended to be used with the {@link Modal} component.
71
+ *
72
+ * @see {@link Modal}
73
+ * @see {@link ModalClose}
74
+ * @see {@link ModalContent}
75
+ * @see {@link ModalDescription}
76
+ * @see {@link ModalTrigger}
77
+ * @see https://www.radix-ui.com/primitives/docs/components/dialog
78
+ *
79
+ * @group Components
80
+ */
11
81
  export declare const ModalTitle: import('react').ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogTitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
82
+ /**
83
+ * The ModalTrigger component is the same as the DialogTrigger component from Radix UI. It is intended to be used with the {@link Modal} component.
84
+ *
85
+ * @see {@link Modal}
86
+ * @see {@link ModalClose}
87
+ * @see {@link ModalContent}
88
+ * @see {@link ModalDescription}
89
+ * @see {@link ModalTitle}
90
+ * @see https://www.radix-ui.com/primitives/docs/components/dialog
91
+ *
92
+ * @group Components
93
+ */
12
94
  export declare const ModalTrigger: import('react').ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;