@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
@@ -1,17 +1,52 @@
1
+ /**
2
+ * The props for the QRCodeSVG component.
3
+ */
1
4
  export type QRCodeSVGProps = {
5
+ /** The value of the QR code */
2
6
  value: string;
7
+ /** The size of the QR code */
3
8
  size?: number;
9
+ /** The color of the QR code */
4
10
  color?: string;
11
+ /** The background color of the QR code */
5
12
  backgroundColor?: string;
13
+ /** The logo of the QR code */
6
14
  logo?: {
7
15
  uri: string;
8
16
  };
17
+ /** The size of the logo */
9
18
  logoSize?: number;
19
+ /** The background color of the logo */
10
20
  logoBackgroundColor?: string;
21
+ /** The margin of the logo */
11
22
  logoMargin?: number;
23
+ /** The border radius of the logo */
12
24
  logoBorderRadius?: number;
25
+ /** The error correction level of the QR code */
13
26
  ecl?: "L" | "M" | "Q" | "H";
27
+ /** Whether the data is async data fetched */
14
28
  isAsyncDataFetched?: boolean;
29
+ /** The fill color of the corners */
15
30
  cornerFillColor?: string;
16
31
  };
32
+ /**
33
+ * The QR code SVG component.
34
+ *
35
+ * @param {QRCodeSVGProps} props - The props for the QR code SVG.
36
+ * @param {string} props.value - The value of the QR code.
37
+ * @param {number} props.size - The size of the QR code.
38
+ * @param {string} props.color - The color of the QR code.
39
+ * @param {string} props.backgroundColor - The background color of the QR code.
40
+ * @param {string} props.logo - The logo of the QR code.
41
+ * @param {number} props.logoSize - The size of the logo.
42
+ * @param {string} props.logoBackgroundColor - The background color of the logo.
43
+ * @param {number} props.logoMargin - The margin of the logo.
44
+ * @param {number} props.logoBorderRadius - The border radius of the logo.
45
+ * @param {number} props.quietZone - The quiet zone of the QR code.
46
+ * @param {number} props.quietZoneBorderRadius - The border radius of the quiet zone.
47
+ * @param {string} props.ecl - The error correction level of the QR code.
48
+ * @param {string} props.gradientType - The type of gradient to use.
49
+ * @param {string} props.cornerFillColor - The fill color of the corners.
50
+ * @returns The QR code SVG component.
51
+ */
17
52
  export declare function QRCodeSVG({ value, size, color, backgroundColor, logo, logoSize, logoBackgroundColor, logoMargin, logoBorderRadius, ecl, cornerFillColor, }: QRCodeSVGProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,5 +1,12 @@
1
1
  import { HTMLAttributes } from 'react';
2
2
  import { QRCodeSVGProps } from './QRCodeSvg';
3
3
  type QRCodeProps = QRCodeSVGProps & Omit<HTMLAttributes<HTMLDivElement>, "children">;
4
+ /**
5
+ * The QR code component.
6
+ *
7
+ * @param {QRCodeProps} props - The props for the QR code.
8
+ * @param {ReactNode} props.children - The children of the QR code.
9
+ * @returns The QR code.
10
+ */
4
11
  export declare const QRCode: ({ value, size, color, backgroundColor, ecl, isAsyncDataFetched, cornerFillColor, className, ...props }: QRCodeProps) => import("react/jsx-runtime").JSX.Element;
5
12
  export {};
@@ -1 +1,10 @@
1
+ /**
2
+ * Get the corners of the QR code.
3
+ *
4
+ * @param {number} size - The size of the QR code.
5
+ * @param {number} matrixLength - The length of the matrix of the QR code.
6
+ * @param {string} backgroundColor - The background color of the corners.
7
+ * @param {string} fillColor - The fill color of the corners.
8
+ * @returns The corners of the QR code.
9
+ */
1
10
  export declare function useCorners(size: number, matrixLength: number, backgroundColor: string, fillColor?: string): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,29 @@
1
1
  export declare const CORNER_SIZE = 7;
2
2
  type UseDotsPathProps = {
3
+ /** The matrix of the QR code */
3
4
  matrix: number[][];
5
+ /** The size of the QR code */
4
6
  size: number;
7
+ /** The size of the logo */
5
8
  logoSize: number;
9
+ /** The margin of the logo */
6
10
  logoMargin: number;
11
+ /** The border radius of the logo */
7
12
  logoBorderRadius: number;
13
+ /** Whether the QR code has a logo */
8
14
  hasLogo: boolean;
9
15
  };
16
+ /**
17
+ * Get the path of the QR code.
18
+ *
19
+ * @param {UseDotsPathProps} props - The props for the useDotsPath hook.
20
+ * @param {number[][]} props.matrix - The matrix of the QR code.
21
+ * @param {number} props.size - The size of the QR code.
22
+ * @param {number} props.logoSize - The size of the logo.
23
+ * @param {number} props.logoMargin - The margin of the logo.
24
+ * @param {number} props.logoBorderRadius - The border radius of the logo.
25
+ * @param {boolean} props.hasLogo - Whether the QR code has a logo.
26
+ * @returns The path of the QR code.
27
+ */
10
28
  export declare function useDotsPath({ matrix, size, logoSize, logoMargin, logoBorderRadius, hasLogo, }: UseDotsPathProps): string;
11
29
  export {};
@@ -1,12 +1,30 @@
1
1
  type RenderLogoProps = {
2
+ /** The size of the QR code */
2
3
  size: number;
4
+ /** The logo to render */
3
5
  logo: {
4
6
  uri: string;
5
7
  } | undefined;
8
+ /** The size of the logo */
6
9
  logoSize: number;
10
+ /** The background color of the logo */
7
11
  logoBackgroundColor: string;
12
+ /** The margin of the logo */
8
13
  logoMargin: number;
14
+ /** The border radius of the logo */
9
15
  logoBorderRadius: number;
10
16
  };
17
+ /**
18
+ * Get the logo for the QR code.
19
+ *
20
+ * @param {RenderLogoProps} props - The props for the useLogo hook.
21
+ * @param {number} props.size - The size of the QR code.
22
+ * @param {string} props.logo - The logo to render.
23
+ * @param {number} props.logoSize - The size of the logo.
24
+ * @param {string} props.logoBackgroundColor - The background color of the logo.
25
+ * @param {number} props.logoMargin - The margin of the logo.
26
+ * @param {number} props.logoBorderRadius - The border radius of the logo.
27
+ * @returns The logo.
28
+ */
11
29
  export declare function useLogo({ size, logo, logoSize, logoBackgroundColor, logoMargin, logoBorderRadius, }: RenderLogoProps): import("react/jsx-runtime").JSX.Element | undefined;
12
30
  export {};
@@ -1 +1,8 @@
1
+ /**
2
+ * Generate the matrix for a QR code.
3
+ *
4
+ * @param value - The value to generate the matrix for.
5
+ * @param errorCorrectionLevel - The error correction level to use.
6
+ * @returns The matrix.
7
+ */
1
8
  export declare function useMatrix(value: string, errorCorrectionLevel: "L" | "M" | "Q" | "H"): any;
@@ -4,5 +4,11 @@ interface Props {
4
4
  id?: string;
5
5
  className?: string;
6
6
  }
7
+ /**
8
+ * A themed Error component.
9
+ *
10
+ * @param {Props} props - The props for the component.
11
+ * @returns {JSX.Element} The ServerError component.
12
+ */
7
13
  export declare const ServerError: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLDivElement>>;
8
14
  export {};
@@ -1,7 +1,21 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * The props for the SuccessMessage 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 SuccessMessage component.
17
+ *
18
+ * @param {Props} props - The props for the component.
19
+ * @returns {JSX.Element} The SuccessMessage component.
20
+ */
7
21
  export declare const SuccessMessage: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLParagraphElement>>;
@@ -1,5 +1,20 @@
1
1
  import { Key } from 'react';
2
2
  import { SwitchTransitionProps, SwitchTransitionRef } from '../SwitchTransition';
3
+ /**
4
+ * The props for the SwitchFadeTransition component.
5
+ */
3
6
  export type SwitchFadeTransitionProps<T extends Key> = Omit<SwitchTransitionProps<T>, "transitionName" | "unmountOnExit" | "mountOnEnter" | "preEnter">;
7
+ /**
8
+ * The ref for the SwitchFadeTransition component.
9
+ */
4
10
  export type SwitchFadeTransitionRef<T extends Key> = SwitchTransitionRef<T>;
11
+ /**
12
+ * A transition that slides the content in and out.
13
+ *
14
+ * @param props - The props for the component.
15
+ * @param props.children - The children to render.
16
+ * @param props.className - The class name to apply to the component.
17
+ * @param props.direction - The direction of the transition.
18
+ * @returns {JSX.Element} The SwitchFadeTransition component.
19
+ */
5
20
  export declare const SwitchFadeTransition: <T extends Key>({ children, className, ...props }: SwitchFadeTransitionProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,23 @@
1
1
  import { Key } from 'react';
2
2
  import { SwitchTransitionProps, SwitchTransitionRef } from '../SwitchTransition';
3
+ /**
4
+ * The props for the SwitchSlideTransition component.
5
+ */
3
6
  export interface SwitchSlideTransitionProps<T extends Key> extends Omit<SwitchTransitionProps<T>, "transitionName" | "unmountOnExit" | "mountOnEnter" | "preEnter"> {
4
7
  direction?: "left" | "right";
5
8
  }
9
+ /**
10
+ * The ref for the SwitchSlideTransition component.
11
+ */
6
12
  export type SwitchSlideTransitionRef<T extends Key> = SwitchTransitionRef<T>;
13
+ /**
14
+ * A transition that slides the content in and out.
15
+ *
16
+ * @param props - The props for the component.
17
+ * @param props.children - The children to render.
18
+ * @param props.className - The class name to apply to the component.
19
+ * @param props.direction - The direction of the transition.
20
+ * @param props.timeout - The timeout for the transition.
21
+ * @returns {JSX.Element} The SwitchSlideTransition component.
22
+ */
7
23
  export declare const SwitchSlideTransition: <T extends Key>({ children, className, direction, timeout, ...props }: SwitchSlideTransitionProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -2,13 +2,26 @@ import { ElementType, HTMLAttributes, Key, ReactNode, Ref } from 'react';
2
2
  import { TransitionMapOptions, TransitionMapResult } from '../../../hooks/useTransitionMap';
3
3
  import { TransitionState } from '../../../utils/transition';
4
4
  export { type TransitionMapOptions, type TransitionMapResult, type TransitionState };
5
+ /**
6
+ * TransitionRef type for the SwitchTransition component.
7
+ */
5
8
  export interface SwitchTransitionRef<T extends Key> {
9
+ /** The transition result. */
6
10
  transition: TransitionMapResult<T>;
7
11
  }
12
+ /**
13
+ * Props for the SwitchTransition component.
14
+ *
15
+ * @template T - The type of the key for the transition.
16
+ */
8
17
  export interface SwitchTransitionProps<T extends Key> extends Omit<HTMLAttributes<HTMLElement>, "children" | "autoFocus">, TransitionMapOptions<T> {
18
+ /** Whether to animate the height of the component. */
9
19
  animateHeight?: boolean;
20
+ /** Whether to auto focus on transition change. If a string is provided, it will be used as the selector for the focusable element. */
10
21
  autoFocus?: boolean | string;
22
+ /** The component or element to render. */
11
23
  as?: ElementType;
24
+ /** The children to transition between. */
12
25
  children: (props: {
13
26
  "data-index": number;
14
27
  inert?: boolean;
@@ -19,9 +32,38 @@ export interface SwitchTransitionProps<T extends Key> extends Omit<HTMLAttribute
19
32
  "data-is-resolved": TransitionState["isResolved"] | undefined;
20
33
  "data-parent": string;
21
34
  }) => ReactNode;
35
+ /** The class name to apply to the component. */
22
36
  className?: string;
37
+ /** Item keys to transition between. */
23
38
  items: readonly T[] | T[];
39
+ /** The name of the transition. Use one of the defined values to use a pre-defined transition, or a custom string to use a custom transition. */
24
40
  transitionName: "fade" | "slide-left" | "slide-right" | string;
41
+ /** A ref to provide access to the transition result. */
25
42
  transitionRef?: Ref<SwitchTransitionRef<T>>;
26
43
  }
44
+ /**
45
+ * A component that transitions between two children.
46
+ *
47
+ * @param {object} props - The props for the component.
48
+ * @param {TransitionMapOptions["allowMultiple"]} props.allowMultiple - Allow multiple items to be in the 'entered' state at the same time.
49
+ * @param {boolean} props.animateHeight - Whether to animate the height of the component.
50
+ * @param {boolean} props.autoFocus - Whether to auto focus the first focusable child on transition change.
51
+ * @param {ElementType} props.as - The component to render.
52
+ * @param {(props: { key: T } & Partial<TransitionState>) => ReactNode} props.children - A render function for each child. A child will be rednered for each item in the `items` prop, which will be passed to the render function as the `key` prop. The TransitionState (status, isMounted, isEnter, isResolved) will also be passed to the render function as data-attributes.
53
+ * @param {string} props.className - The class name to apply to the component.
54
+ * @param {T[]} props.items - Item keys to transition between.
55
+ * @param {TransitionMapOptions["enter"]} props.enter - Enable or disable enter phase transitions.
56
+ * @param {TransitionMapOptions["exit"]} props.exit - Enable or disable exit phase transition.
57
+ * @param {TransitionMapOptions["initialEntered"]} props.initialEntered - Beginning from 'entered' state.
58
+ * @param {TransitionMapOptions["mountOnEnter"]} props.mountOnEnter - State will be 'unmounted' until hit enter phase for the first time. It allows you to create lazily mounted component.
59
+ * @param {TransitionMapOptions["onStateChange"]} props.onStateChange - A callback function that is called when the state of the transition changes.
60
+ * @param {TransitionMapOptions["preEnter"]} props.preEnter - Add a 'preEnter' state immediately before 'entering', which is necessary to change DOM elements from unmounted or display: none with CSS transition (not necessary for CSS animation).
61
+ * @param {TransitionMapOptions["preExit"]} props.preExit - Add a 'preExit' state immediately before 'exiting'.
62
+ * @param {TransitionMapOptions["timeout"]} props.timeout - Set timeout in ms for transitions; you can set a single value or different values for enter and exit transitions.
63
+ * @param {TransitionMapOptions["unmountOnExit"]} props.unmountOnExit - State will become 'unmounted' after 'exiting' finishes. It allows you to transition component out of DOM.
64
+ * @param {"fade" | "slide-left" | "slide-right" | string} props.transitionName - The name of the transition. Use one of the defined values to use a pre-defined transition, or a custom string to use a custom transition.
65
+ * @param {Ref<TransitionMapResult<T>>} props.transitionRef - A ref to provide access to the transition result.
66
+ * @param {CSSProperties} props.style - Styles to apply to the component.
67
+ * @returns {JSX.Element} The component.
68
+ */
27
69
  export declare const SwitchTransition: <T extends Key>({ allowMultiple, animateHeight, autoFocus, initialEntered, as: Component, children, className, enter, exit, items, mountOnEnter, onStateChange, preEnter, preExit, style, timeout, transitionName, transitionRef, unmountOnExit, ...props }: SwitchTransitionProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,46 @@
1
1
  import { MouseEventHandler, ReactNode } from 'react';
2
+ /**
3
+ * The props for the ToggleListItem component.
4
+ */
2
5
  interface ToggleListItemProps {
6
+ /** An icon to display */
3
7
  icon?: ReactNode;
8
+ /** A label for the item */
4
9
  label: ReactNode;
10
+ /** Whether the item is in the active/enabled state */
5
11
  isActive?: boolean;
12
+ /** Whether the action button is pending */
6
13
  isPending?: boolean;
14
+ /** Whether the action button is disabled */
7
15
  isDisabled?: boolean;
16
+ /** A function to call when the activate button is clicked */
8
17
  onActivate?: MouseEventHandler<HTMLButtonElement>;
18
+ /** A function to call when the deactivate button is clicked */
9
19
  onDeactivate?: MouseEventHandler<HTMLButtonElement>;
20
+ /** Accessibility label for the activate button. Defaults to "Activate {label}" */
10
21
  activateAriaLabel?: string;
22
+ /** Accessibility label for the deactivate button. Defaults to "Deactivate {label}" */
11
23
  deactivateAriaLabel?: string;
24
+ /** The size of the list item. Defaults to "md" */
12
25
  size?: "md" | "sm";
13
26
  }
27
+ /**
28
+ * A component for displaying a list item with an activate/deactivate toggle button.
29
+ * Shows a plus icon when inactive, minus icon when active.
30
+ *
31
+ * @param {ToggleListItemProps} props - The props for the ToggleListItem component.
32
+ * @returns {JSX.Element} The ToggleListItem component.
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <ToggleListItem
37
+ * icon={<IconEmail />}
38
+ * label="Email"
39
+ * isActive={isLinked}
40
+ * onActivate={handleLink}
41
+ * onDeactivate={handleUnlink}
42
+ * />
43
+ * ```
44
+ */
14
45
  export declare const ToggleListItem: ({ icon, label, isActive, isPending, isDisabled, onActivate, onDeactivate, activateAriaLabel, deactivateAriaLabel, size, }: ToggleListItemProps) => import("react/jsx-runtime").JSX.Element;
15
46
  export type { ToggleListItemProps };
@@ -3,5 +3,23 @@ interface VisuallyHiddenProps {
3
3
  as?: ElementType;
4
4
  children?: ReactNode;
5
5
  }
6
+ /**
7
+ * Visually hidden component.
8
+ * Used to expose content to screen readers only.
9
+ *
10
+ * @param {VisuallyHiddenProps} props - The props for the component.
11
+ * @param {ElementType} [props.as] - The component to render. Note it must not have a Fragment as the root element. Defaults to "span".
12
+ * @param {ReactNode} [props.children] - The children of the component.
13
+ * @returns {JSX.Element} A visually hidden component.
14
+ *
15
+ * @example
16
+ * ```tsx lines
17
+ * // provide screen-reader accessible text for an abbreviation
18
+ * <p>
19
+ * <span aria-hidden="true">30s</span>
20
+ * <VisuallyHidden>30 seconds</VisuallyHidden>
21
+ * </p>
22
+ * ```
23
+ */
6
24
  export declare const VisuallyHidden: ({ as: Component, children }: VisuallyHiddenProps) => import("react/jsx-runtime").JSX.Element | null;
7
25
  export {};
@@ -1,12 +1,27 @@
1
1
  import { CountryCallingCode, CountryCode as ICountryCode } from 'libphonenumber-js';
2
+ /**
3
+ * Re-export the type for the country code.
4
+ */
2
5
  export type CountryCode = ICountryCode;
6
+ /**
7
+ * A country option for the country code select list.
8
+ */
3
9
  export type CountryOption = {
4
10
  callingCode: CountryCallingCode;
5
11
  code: CountryCode;
6
12
  flag: string;
7
13
  name: string;
8
14
  };
15
+ /**
16
+ * These contries are completely removed from the phone dropdown
17
+ */
9
18
  export declare const OFAC_BLOCKED_COUNTRIES: string[];
10
19
  export declare const DEFAULT_COUNTRY_CODE: CountryCode;
20
+ /**
21
+ * Returns the country calling code for a given country code.
22
+ *
23
+ * @param countryCode - The country code to get the calling code for.
24
+ * @returns The country calling code for the given country code.
25
+ */
11
26
  export declare const nonThrowingGetCountryCallingCode: (countryCode: CountryCode) => CountryCallingCode | undefined;
12
27
  export declare const countries: CountryOption[];
@@ -1 +1,5 @@
1
+ /**
2
+ * This file was copied from @cbhq/two-factor-register (/data/countryNames.ts)
3
+ * and currently only contains the country name for the US
4
+ */
1
5
  export declare const countryNames: Record<string, string>;
@@ -1,18 +1,43 @@
1
1
  import { RefObject } from 'react';
2
2
  import { SecureIframeChainType, SecureIframeKeyExportIncomingMessage, SecureIframeStatus, IframeTheme } from '../types/secureIframe';
3
+ /**
4
+ * The props for the useKeyExportPostMessage hook.
5
+ */
3
6
  export interface UseKeyExportPostMessageProps {
7
+ /** The address of the account to export. */
4
8
  address: string;
9
+ /** The type of account to export. */
5
10
  type: SecureIframeChainType;
11
+ /** The base path of the secure iframe. */
6
12
  basePath?: string;
13
+ /** The project ID. */
7
14
  projectId: string;
15
+ /** The label of the button. */
8
16
  label?: string;
17
+ /** The label to display on copy success. */
9
18
  copiedLabel?: string;
19
+ /** Whether to show an icon in the button. */
10
20
  icon: boolean;
21
+ /** The ref to the iframe. */
11
22
  iframeRef: RefObject<HTMLIFrameElement | null>;
23
+ /** The function to call when the status is updated. */
12
24
  onStatusUpdate?: (status: SecureIframeStatus, message?: string) => void;
25
+ /** The theme to use for the iframe. */
13
26
  theme?: IframeTheme;
14
27
  }
28
+ /**
29
+ * Sends a message to the secure iframe.
30
+ *
31
+ * @param el - The iframe element to send the message to.
32
+ * @param message - The message to send to the iframe.
33
+ */
15
34
  export declare const sendKeyExportMessage: (el: HTMLIFrameElement | null, message: SecureIframeKeyExportIncomingMessage) => void;
35
+ /**
36
+ * The hook to use the key export post message.
37
+ *
38
+ * @param {UseKeyExportPostMessageProps} props - The props for the useKeyExportPostMessage hook.
39
+ * @returns The iframe url and the onLoad function.
40
+ */
16
41
  export declare const useKeyExportPostMessage: ({ address, basePath, copiedLabel, icon, iframeRef, label, onStatusUpdate, projectId, theme, type, }: UseKeyExportPostMessageProps) => {
17
42
  iframeUrl: string;
18
43
  isPending: boolean;
@@ -1,15 +1,62 @@
1
1
  import { CountryCode } from 'libphonenumber-js';
2
2
  import { PhoneNumber } from '../utils/parseValuesFromPhoneNumber';
3
+ /**
4
+ * Options for the usePhoneNumberState hook.
5
+ */
3
6
  export interface UsePhoneNumberStateOptions {
7
+ /** The initial E.164 phone number string. */
4
8
  phoneNumber?: string;
9
+ /** The initial country code. Defaults to "US". */
5
10
  countryCode?: CountryCode;
11
+ /** Callback when the E.164 phone number changes. */
6
12
  onPhoneNumberChange?: (e164: string) => void;
13
+ /** Callback when the country code changes. */
7
14
  onCountryCodeChange?: (countryCode: CountryCode) => void;
8
15
  }
16
+ /**
17
+ * Return value from the usePhoneNumberState hook.
18
+ */
9
19
  export interface UsePhoneNumberStateResult {
20
+ /** The phone number object with value and e164 fields. */
10
21
  phoneNumberObject: PhoneNumber;
22
+ /** The current country code. */
11
23
  countryCode: CountryCode;
24
+ /** Handler for PhoneNumberInput/PhoneNumberForm onPhoneNumberChange prop. */
12
25
  handlePhoneNumberChange: (pn: PhoneNumber) => void;
26
+ /** Handler for PhoneNumberInput/PhoneNumberForm onCountryCodeChange prop. */
13
27
  handleCountryCodeChange: (countryCode: CountryCode) => void;
14
28
  }
29
+ /**
30
+ * A hook for managing phone number state with conversion between E.164 string
31
+ * and PhoneNumber object formats.
32
+ *
33
+ * This hook handles the bidirectional sync between:
34
+ * - An E.164 formatted string (used for API calls)
35
+ * - A PhoneNumber object with value/e164 fields (used by PhoneNumberInput/PhoneNumberForm)
36
+ *
37
+ * @param options - Configuration options for the hook.
38
+ * @param options.phoneNumber - The initial phone number.
39
+ * @param options.countryCode - The initial country code. Defaults to "US".
40
+ * @param options.onPhoneNumberChange - Callback when the phone number changes.
41
+ * @param options.onCountryCodeChange - Callback when the country code changes.
42
+ * @returns Phone number state and handlers for use with PhoneNumberInput/PhoneNumberForm.
43
+ *
44
+ * @example
45
+ * ```tsx
46
+ * const { phoneNumberObject, countryCode, handlePhoneNumberChange, handleCountryCodeChange } =
47
+ * usePhoneNumberState({
48
+ * phoneNumber: state.phoneNumber,
49
+ * onPhoneNumberChange: (e164) => dispatch({ type: "SET_PHONE_NUMBER", payload: { phoneNumber: e164 } }),
50
+ * });
51
+ *
52
+ * <PhoneNumberForm
53
+ * phoneNumber={phoneNumberObject}
54
+ * countryCode={countryCode}
55
+ * onPhoneNumberChange={handlePhoneNumberChange}
56
+ * onCountryCodeChange={handleCountryCodeChange}
57
+ * />
58
+ * ```
59
+ *
60
+ * @group Hooks
61
+ */
15
62
  export declare const usePhoneNumberState: ({ phoneNumber, countryCode: initialCountryCode, onPhoneNumberChange, onCountryCodeChange, }?: UsePhoneNumberStateOptions) => UsePhoneNumberStateResult;
@@ -3,6 +3,14 @@ import { CountryCode } from '../data/countries';
3
3
  interface UsePhoneNumberValidatorsProps {
4
4
  countryCode?: CountryCode;
5
5
  }
6
+ /**
7
+ * A hook that returns a set of phone number validation functions.
8
+ *
9
+ * @param {UsePhoneNumberValidatorsProps} props - The props for the hook.
10
+ * @param {UsePhoneNumberValidatorsProps["error"]} [props.error] - The error message or API error.
11
+ * @param {UsePhoneNumberValidatorsProps["countryCode"]} [props.countryCode] - The country code to use for validation. Defaults to "US".
12
+ * @returns {object} An object containing the validation functions.
13
+ */
6
14
  export declare const usePhoneNumberValidators: ({ countryCode }: UsePhoneNumberValidatorsProps) => {
7
15
  isInvalidCountry: (v: string) => boolean;
8
16
  isInvalidLength: (v: string) => boolean;
@@ -1,3 +1,21 @@
1
+ /**
2
+ * A hook that returns a `schedule` function for delayed callbacks with automatic cleanup.
3
+ *
4
+ * Calling `schedule` cancels any previously pending timeout. The timeout is
5
+ * automatically cancelled when the component unmounts, preventing state updates
6
+ * on unmounted components.
7
+ *
8
+ * @returns An object with `schedule` and `cancel` functions.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * const { schedule } = useTimeout();
13
+ *
14
+ * const handleSuccess = () => {
15
+ * schedule(() => resetView(), 800);
16
+ * };
17
+ * ```
18
+ */
1
19
  export declare const useTimeout: () => {
2
20
  schedule: (callback: () => void, delay: number) => void;
3
21
  cancel: () => void;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * A countdown timer hook.
3
+ * It uses timestamp comparisons to remain accurate despite browser throttling or event loop delays.
4
+ *
5
+ * @returns {object} An object containing the current time left, a function to start the timer, and a function to reset the timer.
6
+ */
1
7
  export declare const useTimer: () => {
2
8
  timeRemaining: number | null;
3
9
  start: (durationSeconds: number) => void;
@@ -1,4 +1,7 @@
1
1
  import { TransitionState } from '../utils/transition';
2
+ /**
3
+ * The options for a transition.
4
+ */
2
5
  export interface TransitionOptions {
3
6
  initialEntered?: boolean;
4
7
  mountOnEnter?: boolean;
@@ -15,9 +18,15 @@ export interface TransitionOptions {
15
18
  current: TransitionState;
16
19
  }) => void;
17
20
  }
21
+ /**
22
+ * The options for a transition item.
23
+ */
18
24
  export interface TransitionItemOptions {
19
25
  initialEntered?: boolean;
20
26
  }
27
+ /**
28
+ * The options for a transition map.
29
+ */
21
30
  export interface TransitionMapOptions<K> extends Omit<TransitionOptions, "onStateChange"> {
22
31
  allowMultiple?: boolean;
23
32
  onStateChange?: (event: {
@@ -25,6 +34,9 @@ export interface TransitionMapOptions<K> extends Omit<TransitionOptions, "onStat
25
34
  current: TransitionState;
26
35
  }) => void;
27
36
  }
37
+ /**
38
+ * The result of a transition map.
39
+ */
28
40
  export interface TransitionMapResult<K> {
29
41
  stateMap: ReadonlyMap<K, TransitionState>;
30
42
  toggle: (key: K, toEnter?: boolean) => void;
@@ -33,6 +45,16 @@ export interface TransitionMapResult<K> {
33
45
  setItem: (key: K, options?: TransitionItemOptions) => void;
34
46
  deleteItem: (key: K) => boolean;
35
47
  }
48
+ /**
49
+ * The useTransitionMap hook is a hook that provides a transition state map.
50
+ *
51
+ * @param {TransitionMapOptions<K>} options - The options for the transition map.
52
+ * @returns {TransitionMapResult<K>} - The result of the transition map.
53
+ *
54
+ * @see {@link SwitchTransition}
55
+ *
56
+ * @group Hooks
57
+ */
36
58
  declare const useTransitionMap: <K>(options?: TransitionMapOptions<K>) => {
37
59
  stateMap: Map<K, Readonly<{
38
60
  _s: number;