@coinbase/cdp-react 0.0.98 → 0.0.99

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 (198) 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/LinkAuthProvider.d.ts +31 -0
  51. package/dist/components/LinkAuth/LinkAuthTitle.d.ts +17 -0
  52. package/dist/components/LinkAuth/index.d.ts +170 -0
  53. package/dist/components/LinkAuth/types.d.ts +31 -0
  54. package/dist/components/LinkAuth/utils.d.ts +12 -0
  55. package/dist/components/LinkAuthModal/index.d.ts +112 -0
  56. package/dist/components/OAuthStatusModal/index.d.ts +24 -0
  57. package/dist/components/SendEvmTransactionButton/index.d.ts +27 -0
  58. package/dist/components/SendSolanaTransactionButton/index.d.ts +27 -0
  59. package/dist/components/SignIn/SignInAuthMethodButtons.d.ts +26 -0
  60. package/dist/components/SignIn/SignInBackButton.d.ts +40 -0
  61. package/dist/components/SignIn/SignInCredentials.d.ts +13 -0
  62. package/dist/components/SignIn/SignInDescription.d.ts +35 -0
  63. package/dist/components/SignIn/SignInFooter.d.ts +27 -0
  64. package/dist/components/SignIn/SignInForm.d.ts +39 -0
  65. package/dist/components/SignIn/SignInImage.d.ts +38 -0
  66. package/dist/components/SignIn/SignInProvider.d.ts +54 -0
  67. package/dist/components/SignIn/SignInTitle.d.ts +35 -0
  68. package/dist/components/SignIn/flows/SignInWithEmail.d.ts +26 -0
  69. package/dist/components/SignIn/flows/SignInWithOAuth.d.ts +19 -0
  70. package/dist/components/SignIn/flows/SignInWithSms.d.ts +26 -0
  71. package/dist/components/SignIn/hooks/useEmailForm.d.ts +7 -0
  72. package/dist/components/SignIn/hooks/useOTPForm.d.ts +8 -0
  73. package/dist/components/SignIn/hooks/usePhoneNumberForm.d.ts +7 -0
  74. package/dist/components/SignIn/hooks/useSignInWithOAuth.d.ts +8 -0
  75. package/dist/components/SignIn/index.d.ts +124 -0
  76. package/dist/components/SignIn/types.d.ts +37 -0
  77. package/dist/components/SignIn/useSignInReducer.d.ts +9 -0
  78. package/dist/components/SignInModal/index.d.ts +123 -0
  79. package/dist/components/SignOutButton/index.d.ts +39 -0
  80. package/dist/components/ThemeProvider/index.d.ts +70 -0
  81. package/dist/components/VerifyMfa/VerifyMfaDescription.d.ts +24 -0
  82. package/dist/components/VerifyMfa/VerifyMfaFlow.d.ts +30 -0
  83. package/dist/components/VerifyMfa/VerifyMfaFlowBackButton.d.ts +19 -0
  84. package/dist/components/VerifyMfa/VerifyMfaFlowProvider.d.ts +51 -0
  85. package/dist/components/VerifyMfa/VerifyMfaFooter.d.ts +18 -0
  86. package/dist/components/VerifyMfa/VerifyMfaImage.d.ts +23 -0
  87. package/dist/components/VerifyMfa/VerifyMfaItem.d.ts +20 -0
  88. package/dist/components/VerifyMfa/VerifyMfaItems.d.ts +18 -0
  89. package/dist/components/VerifyMfa/VerifyMfaProvider.d.ts +40 -0
  90. package/dist/components/VerifyMfa/VerifyMfaTitle.d.ts +24 -0
  91. package/dist/components/VerifyMfa/index.d.ts +55 -0
  92. package/dist/components/VerifyMfa/methods/sms.d.ts +29 -0
  93. package/dist/components/VerifyMfa/methods/totp.d.ts +29 -0
  94. package/dist/components/VerifyMfa/types.d.ts +33 -0
  95. package/dist/components/VerifyMfa/useVerifyMfaReducer.d.ts +7 -0
  96. package/dist/components/VerifyMfaInline/index.d.ts +212 -0
  97. package/dist/components/VerifyMfaModal/index.d.ts +114 -0
  98. package/dist/components/forms/AmountInput/index.d.ts +16 -0
  99. package/dist/components/forms/AmountInput/types.d.ts +9 -0
  100. package/dist/components/forms/AmountInput/useAmountInput.d.ts +14 -0
  101. package/dist/components/forms/AmountInput/useInputScale.d.ts +12 -0
  102. package/dist/components/forms/AmountInput/useNumberParseAndFormat.d.ts +20 -0
  103. package/dist/components/forms/CountrySelect/index.d.ts +9 -0
  104. package/dist/components/forms/EmailForm/index.d.ts +17 -0
  105. package/dist/components/forms/ExchangeAmountInput/index.d.ts +19 -0
  106. package/dist/components/forms/ExchangeAmountInput/types.d.ts +12 -0
  107. package/dist/components/forms/ExchangeAmountInput/useExchangeAmountInput.d.ts +17 -0
  108. package/dist/components/forms/Field/index.d.ts +15 -0
  109. package/dist/components/forms/Input/index.d.ts +15 -0
  110. package/dist/components/forms/Label/index.d.ts +8 -0
  111. package/dist/components/forms/OTP/index.d.ts +6 -0
  112. package/dist/components/forms/OTPForm/index.d.ts +20 -0
  113. package/dist/components/forms/PhoneNumberForm/index.d.ts +27 -0
  114. package/dist/components/forms/PhoneNumberInput/index.d.ts +16 -0
  115. package/dist/components/forms/PhoneNumberInput/maskOverride.d.ts +6 -0
  116. package/dist/components/forms/PhoneNumberInput/usePhoneNumberFormatter.d.ts +7 -0
  117. package/dist/components/forms/Select/index.d.ts +30 -0
  118. package/dist/components/ui/Badge/index.d.ts +19 -0
  119. package/dist/components/ui/Banner/index.d.ts +25 -0
  120. package/dist/components/ui/Button/index.d.ts +50 -0
  121. package/dist/components/ui/ButtonBase/index.d.ts +20 -0
  122. package/dist/components/ui/CoinbaseFooter/index.d.ts +16 -0
  123. package/dist/components/ui/CopyTextField/index.d.ts +35 -0
  124. package/dist/components/ui/Error/index.d.ts +14 -0
  125. package/dist/components/ui/IframeButton/index.d.ts +17 -0
  126. package/dist/components/ui/LoadingSkeleton/index.d.ts +22 -0
  127. package/dist/components/ui/LoadingSpinner/index.d.ts +11 -0
  128. package/dist/components/ui/Modal/index.d.ts +82 -0
  129. package/dist/components/ui/QRCode/QRCodeSvg.d.ts +35 -0
  130. package/dist/components/ui/QRCode/index.d.ts +7 -0
  131. package/dist/components/ui/QRCode/useCorners.d.ts +9 -0
  132. package/dist/components/ui/QRCode/useDotsPath.d.ts +18 -0
  133. package/dist/components/ui/QRCode/useLogo.d.ts +18 -0
  134. package/dist/components/ui/QRCode/useMatrix.d.ts +7 -0
  135. package/dist/components/ui/ServerError/index.d.ts +6 -0
  136. package/dist/components/ui/SuccessMessage/index.d.ts +14 -0
  137. package/dist/components/ui/SwitchFadeTransition/index.d.ts +15 -0
  138. package/dist/components/ui/SwitchSlideTransition/index.d.ts +16 -0
  139. package/dist/components/ui/SwitchTransition/index.d.ts +42 -0
  140. package/dist/components/ui/ToggleListItem/index.d.ts +31 -0
  141. package/dist/components/ui/VisuallyHidden/index.d.ts +18 -0
  142. package/dist/data/countries.d.ts +15 -0
  143. package/dist/data/countryNames.d.ts +4 -0
  144. package/dist/hooks/useKeyExportPostMessage.d.ts +25 -0
  145. package/dist/hooks/usePhoneNumberState.d.ts +47 -0
  146. package/dist/hooks/usePhoneNumberValidators.d.ts +8 -0
  147. package/dist/hooks/useTimeout.d.ts +18 -0
  148. package/dist/hooks/useTimer.d.ts +6 -0
  149. package/dist/hooks/useTransitionMap.d.ts +22 -0
  150. package/dist/hooks/useVerifyMfaModal.d.ts +78 -0
  151. package/dist/icons/IconAppleLogo.d.ts +22 -0
  152. package/dist/icons/IconArrowLeft.d.ts +22 -0
  153. package/dist/icons/IconArrowsUpDown.d.ts +22 -0
  154. package/dist/icons/IconCheck.d.ts +22 -0
  155. package/dist/icons/IconCheckCircle.d.ts +21 -0
  156. package/dist/icons/IconChevronDown.d.ts +22 -0
  157. package/dist/icons/IconCoinbaseMark.d.ts +22 -0
  158. package/dist/icons/IconCoinbaseWordmark.d.ts +22 -0
  159. package/dist/icons/IconCopy.d.ts +22 -0
  160. package/dist/icons/IconCreditCard.d.ts +22 -0
  161. package/dist/icons/IconCurrencies.d.ts +22 -0
  162. package/dist/icons/IconEnvelope.d.ts +22 -0
  163. package/dist/icons/IconExclamationCircle.d.ts +22 -0
  164. package/dist/icons/IconExclamationTriangle.d.ts +22 -0
  165. package/dist/icons/IconGoogleColorLogo.d.ts +22 -0
  166. package/dist/icons/IconGoogleLogo.d.ts +22 -0
  167. package/dist/icons/IconLock.d.ts +22 -0
  168. package/dist/icons/IconMinus.d.ts +21 -0
  169. package/dist/icons/IconPhone.d.ts +22 -0
  170. package/dist/icons/IconPinCode.d.ts +22 -0
  171. package/dist/icons/IconPlus.d.ts +21 -0
  172. package/dist/icons/IconShield.d.ts +22 -0
  173. package/dist/icons/IconSmartPhone.d.ts +22 -0
  174. package/dist/icons/IconTelegramLogo.d.ts +22 -0
  175. package/dist/icons/IconXLogo.d.ts +22 -0
  176. package/dist/icons/IconXMark.d.ts +22 -0
  177. package/dist/icons/SvgIcon.d.ts +6 -0
  178. package/dist/theme/cssVariables.d.ts +10 -0
  179. package/dist/theme/theme.d.ts +246 -0
  180. package/dist/theme/tokens.d.ts +54 -0
  181. package/dist/theme/utils.d.ts +63 -0
  182. package/dist/types/secureIframe.d.ts +3 -0
  183. package/dist/utils/capitalize.d.ts +8 -0
  184. package/dist/utils/childrenHasComponent.d.ts +10 -0
  185. package/dist/utils/clamp.d.ts +10 -0
  186. package/dist/utils/formatFiat.d.ts +11 -0
  187. package/dist/utils/formatPhoneNumber.d.ts +8 -0
  188. package/dist/utils/getMessageFromUnknownError.d.ts +9 -0
  189. package/dist/utils/isApiError.d.ts +21 -0
  190. package/dist/utils/isEmailInvalid.d.ts +15 -0
  191. package/dist/utils/openPopup.d.ts +15 -0
  192. package/dist/utils/parseValuesFromPhoneNumber.d.ts +16 -0
  193. package/dist/utils/sendIframeMessage.d.ts +8 -0
  194. package/dist/utils/toOAuthProviderType.d.ts +8 -0
  195. package/dist/utils/transition.d.ts +41 -0
  196. package/dist/version.d.ts +5 -1
  197. package/dist/version.js +1 -1
  198. package/package.json +5 -5
@@ -2,22 +2,136 @@ import { ReactNode } from 'react';
2
2
  import { ButtonProps } from '../ui/Button';
3
3
  import { ModalContentProps } from '../ui/Modal';
4
4
  import { VerifyMfaProps } from '../VerifyMfa';
5
+ /**
6
+ * Props for the verify MFA modal trigger button
7
+ *
8
+ * @see {@link VerifyMfaModalTrigger}
9
+ */
5
10
  interface VerifyMfaModalTriggerProps extends Partial<Pick<ButtonProps, "className" | "fullWidth" | "size" | "style" | "variant">> {
11
+ /** If provided, will render the children instead of the default trigger button. */
6
12
  children?: ReactNode;
13
+ /** The label to display on the trigger button. */
7
14
  label?: ReactNode;
8
15
  }
16
+ /**
17
+ * Props for the VerifyMfaModal component.
18
+ *
19
+ * @see {@link VerifyMfaModal}
20
+ */
9
21
  interface VerifyMfaModalProps {
22
+ /** If provided, will render the children instead of the default trigger button. */
10
23
  children?: ReactNode;
24
+ /** Whether the modal is open. Note: if you set this, you must also set `setIsOpen`. */
11
25
  open?: boolean;
26
+ /** A function to set the modal's open state. Note: if you set this, you must also set `open`. */
12
27
  setIsOpen?: (value: boolean) => void;
28
+ /** A function to call when the verification is canceled. */
13
29
  onCancel?: () => void;
30
+ /** A function to call when the verification errors. */
14
31
  onError?: (error: Error) => void;
32
+ /** A function to call when MFA is successful verified. */
15
33
  onSuccess?: (mfaCode: string) => void;
16
34
  }
35
+ /**
36
+ * Props for the VerifyMfaModalContent component.
37
+ *
38
+ * @see {@link VerifyMfaModalContent}
39
+ */
17
40
  interface VerifyMfaModalContentProps extends Omit<ModalContentProps, "children"> {
41
+ /** The children of the component. Leave empty to use the default verification UI. */
18
42
  children?: VerifyMfaProps["children"];
19
43
  }
44
+ /**
45
+ * A trigger button that opens the verify MFA modal.
46
+ *
47
+ * @param {VerifyMfaModalTriggerProps} props - The props for the VerifyMfaModalTrigger component.
48
+ * @param {ReactNode} [props.children] - The children to render inside the trigger button.
49
+ * @param {ReactNode} [props.label] - The label to display on the trigger button.
50
+ * @returns {JSX.Element} The VerifyMfaModalTrigger component.
51
+ *
52
+ * @group Components
53
+ */
20
54
  declare const VerifyMfaModalTrigger: ({ children, className, label, ...props }: VerifyMfaModalTriggerProps) => import("react/jsx-runtime").JSX.Element;
55
+ /**
56
+ * The verify MFA modal content.
57
+ *
58
+ * @param {VerifyMfaModalContentProps} props - The props for the VerifyMfaModalContent component.
59
+ * @returns {JSX.Element} The VerifyMfaModalContent component.
60
+ *
61
+ * @group Components
62
+ */
21
63
  declare const VerifyMfaModalContent: ({ children, ...props }: VerifyMfaModalContentProps) => import("react/jsx-runtime").JSX.Element;
64
+ /**
65
+ * A verify MFA modal component that wraps the {@link VerifyMfa} component.
66
+ *
67
+ * @param {VerifyMfaModalProps} props - The props for the VerifyMfaModal component.
68
+ * @returns {JSX.Element} The VerifyMfaModal component.
69
+ *
70
+ * @see {@link VerifyMfaModalTrigger} for the trigger button.
71
+ * @see {@link VerifyMfaModalContent} for the modal content.
72
+ *
73
+ * @group Components
74
+ *
75
+ * @example
76
+ * ```tsx lines
77
+ * // Render the VerifyMfaModal component with a custom success handler
78
+ * function App() {
79
+ * const handleSuccess = (mfaCode: string) => {
80
+ * console.log(`Successfully verified`, mfaCode);
81
+ * };
82
+ *
83
+ * return (
84
+ * <CDPReactProvider config={config}>
85
+ * <VerifyMfaModal onSuccess={handleSuccess} />
86
+ * </CDPReactProvider>
87
+ * );
88
+ * }
89
+ * ```
90
+ *
91
+ * @example
92
+ * ```tsx lines
93
+ * // Render the VerifyMfaModal component with a custom trigger button
94
+ * function App() {
95
+ * return (
96
+ * <CDPReactProvider config={config}>
97
+ * <VerifyMfaModal>
98
+ * <button type="button">Verify</button>
99
+ * </VerifyMfaModal>
100
+ * </CDPReactProvider>
101
+ * );
102
+ * }
103
+ * ```
104
+ *
105
+ * @example
106
+ * ```tsx lines
107
+ * // Render the VerifyMfaModal component with a custom trigger button label
108
+ * function App() {
109
+ * return (
110
+ * <CDPReactProvider config={config}>
111
+ * <VerifyMfaModal>
112
+ * <VerifyMfaModalTrigger variant="secondary" label="Verify" />
113
+ * </VerifyMfaModal>
114
+ * </CDPReactProvider>
115
+ * );
116
+ * }
117
+ * ```
118
+ *
119
+ * @example
120
+ * ```tsx lines
121
+ * // Render the VerifyMfaModal with controlled open state
122
+ * function App() {
123
+ * const [isOpen, setIsOpen] = useState(false);
124
+ *
125
+ * return (
126
+ * <CDPReactProvider config={config}>
127
+ * <VerifyMfaModal open={isOpen} setIsOpen={setIsOpen}>
128
+ * <VerifyMfaModalTrigger />
129
+ * <VerifyMfaModalContent />
130
+ * </VerifyMfaModal>
131
+ * </CDPReactProvider>
132
+ * );
133
+ * }
134
+ * ```
135
+ */
22
136
  declare const VerifyMfaModal: ({ children, open, setIsOpen, onCancel, onError, onSuccess, }: VerifyMfaModalProps) => import("react/jsx-runtime").JSX.Element;
23
137
  export { VerifyMfaModal, VerifyMfaModalContent, VerifyMfaModalTrigger, type VerifyMfaModalProps, type VerifyMfaModalContentProps, type VerifyMfaModalTriggerProps, };
@@ -1,3 +1,19 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { AmountInputProps } from './types';
3
+ /**
4
+ * The AmountInput component
5
+ *
6
+ * @param {AmountInputProps} props - The props for the AmountInput component
7
+ * @param {number} props.amount - The amount to display
8
+ * @param {string} [props.className] - The class name for the input
9
+ * @param {string} props.unit - The unit to display
10
+ * @param {number} [props.decimalPlaces] - The number of decimal places to display (default 2)
11
+ * @param {string} [props.locale] - The locale in BCP 47 format (e.g. "en-US").
12
+ * @param {number} [props.max] - The maximum value for the input
13
+ * @param {number} [props.min] - The minimum value for the input
14
+ * @param {Function} props.setAmount - A function to set the amount
15
+ * @param {Function} props.onBlur - A function to call when the input is blurred
16
+ * @param {Function} props.onPaste - A function to call when a value is pasted
17
+ * @param {string} [props.placeholder] - The placeholder for the input
18
+ */
3
19
  export declare const AmountInput: import('react').ForwardRefExoticComponent<AmountInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "inputMode" | "onChange" | "max" | "min"> & import('react').RefAttributes<HTMLInputElement>>;
@@ -1,4 +1,7 @@
1
1
  import { ChangeEvent, ClipboardEvent, FocusEvent, InputEvent, InputHTMLAttributes } from 'react';
2
+ /**
3
+ * The props for the AmountInput component
4
+ */
2
5
  export interface AmountInputProps {
3
6
  amount: number | undefined;
4
7
  unit?: string;
@@ -8,7 +11,13 @@ export interface AmountInputProps {
8
11
  min?: number;
9
12
  setAmount: (amount: number) => void;
10
13
  }
14
+ /**
15
+ * The parameters for the useAmountInput hook
16
+ */
11
17
  export type UseAmoutInputParams = Pick<AmountInputProps, "amount" | "decimalPlaces" | "locale" | "max" | "min" | "setAmount"> & Pick<InputHTMLAttributes<HTMLInputElement>, "onBlur" | "onPaste">;
18
+ /**
19
+ * The return value of the useAmountInput hook
20
+ */
12
21
  export interface UseAmoutInputReturn {
13
22
  handleBeforeInput: (e: InputEvent<HTMLInputElement>) => void;
14
23
  handleBlur: (e: FocusEvent<HTMLInputElement>) => void;
@@ -1,2 +1,16 @@
1
1
  import { UseAmoutInputParams, UseAmoutInputReturn } from './types';
2
+ /**
3
+ * The hook for the AmountInput component
4
+ *
5
+ * @param {UseAmoutInputParams} params - The parameters for the useAmountInput hook
6
+ * @param {number} params.amount - The amount to display
7
+ * @param {number} params.decimalPlaces - The number of decimal places to display
8
+ * @param {string} [params.locale] - The locale to use
9
+ * @param {number} [params.max] - The maximum value
10
+ * @param {number} [params.min] - The minimum value
11
+ * @param {(e: FocusEvent<HTMLInputElement>) => void} [params.onBlur] - A function to call when the input is blurred
12
+ * @param {(e: ClipboardEvent<HTMLInputElement>) => void} [params.onPaste] - A function to call when the input is pasted
13
+ * @param {(value: number) => void} [params.setAmount] - The function to set the amount value
14
+ * @returns {UseAmoutInputReturn} - The number value, input value, and handlers for the input
15
+ */
2
16
  export declare const useAmountInput: ({ amount, decimalPlaces, locale, max, min, setAmount, onBlur, onPaste, }: UseAmoutInputParams) => UseAmoutInputReturn;
@@ -7,6 +7,18 @@ interface UseInputScaleParams {
7
7
  inputRef: RefObject<HTMLInputElement | null>;
8
8
  scaleWrapperRef: RefObject<HTMLElement | null>;
9
9
  }
10
+ /**
11
+ * The parameters for the useInputScale hook
12
+ *
13
+ * @param {UseInputScaleParams} params - The parameters for the useInputScale hook
14
+ * @param {number} [params.minScale] - The minimum scale to apply to the input.
15
+ * @param {RefObject<HTMLInputElement>} params.containerRef - The ref to the container (for the max available width)
16
+ * @param {RefObject<HTMLInputElement>} params.measureRef - The ref to the element to measure (the value + currency width)
17
+ * @param {RefObject<HTMLInputElement>} params.inputRef - The ref to the input element
18
+ * @param {RefObject<HTMLInputElement>} params.scaleWrapperRef - The ref to the wrapper that will be scaled to fit the container
19
+ * @param {RefObject<HTMLInputElement>} params.valueRef - The ref to the value element (the amount)
20
+ * @returns {number} The scale value to apply to ensure the content fits within the container
21
+ */
10
22
  export declare const useInputScale: ({ minScale, containerRef, measureRef, inputRef, scaleWrapperRef, valueRef, }: UseInputScaleParams) => {
11
23
  updateScale: () => void;
12
24
  };
@@ -1,11 +1,31 @@
1
1
  import { NumberParser, NumberFormatter } from '@internationalized/number';
2
+ /**
3
+ * The parameters for the useNumberParseAndFormat hook
4
+ */
2
5
  export interface UseNumberParseAndFormatParams {
6
+ /** An input value from which to detect the numbering system. If not provided, the numbering system will be detected from the locale. */
3
7
  inputValue?: string;
8
+ /** The locale in BCP 47 format (e.g. "en-US") */
4
9
  locale?: string;
10
+ /** The options for the NumberFormatter */
5
11
  options?: Intl.NumberFormatOptions;
6
12
  }
13
+ /**
14
+ * The return type of the useNumberParseAndFormat hook
15
+ */
7
16
  export interface UseNumberParseAndFormatReturn {
17
+ /** The NumberParser instance */
8
18
  parser: NumberParser;
19
+ /** The NumberFormatter instance */
9
20
  formatter: NumberFormatter;
10
21
  }
22
+ /**
23
+ * The useNumberParseAndFormat hook
24
+ *
25
+ * @param {UseNumberParseAndFormatParams} [params] - The parameters for the useNumberParseAndFormat hook
26
+ * @param {string} [params.inputValue] - An input value from which to detect the numbering system. If not provided, the numbering system will be detected from the locale.
27
+ * @param {string} [params.locale] - The locale in BCP 47 format (e.g. "en-US").
28
+ * @param {Intl.NumberFormatOptions} [params.options] - The options for the NumberFormatter.
29
+ * @returns {UseNumberParseAndFormatReturn} The formatter and parser instances
30
+ */
11
31
  export declare const useNumberParseAndFormat: (params?: UseNumberParseAndFormatParams) => UseNumberParseAndFormatReturn;
@@ -1,5 +1,8 @@
1
1
  import { CountryCode } from '../../../data/countries';
2
2
  import { InputSize } from '../../../theme/theme';
3
+ /**
4
+ * CountrySelect component props
5
+ */
3
6
  export interface CountrySelectProps {
4
7
  className?: string;
5
8
  size?: InputSize;
@@ -7,4 +10,10 @@ export interface CountrySelectProps {
7
10
  value?: CountryCode;
8
11
  onValueChange?: (value: CountryCode) => void;
9
12
  }
13
+ /**
14
+ * CountrySelect component.
15
+ *
16
+ * @param {CountrySelectProps} props - The props for the CountrySelect component.
17
+ * @returns {JSX.Element} The CountrySelect component.
18
+ */
10
19
  export declare const CountrySelect: ({ className, size, defaultValue, value, onValueChange, }: CountrySelectProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,8 @@
1
1
  import { APIError } from '@coinbase/cdp-hooks';
2
2
  import { FormHTMLAttributes } from 'react';
3
+ /**
4
+ * The props for the EmailForm component.
5
+ */
3
6
  export interface EmailFormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "children"> {
4
7
  email?: string;
5
8
  error?: string | APIError;
@@ -8,4 +11,18 @@ export interface EmailFormProps extends Omit<FormHTMLAttributes<HTMLFormElement>
8
11
  onEmailChange?: (value: string) => void;
9
12
  submitLabel?: string;
10
13
  }
14
+ /**
15
+ * A form for signing in with an email address.
16
+ *
17
+ * @param {EmailFormProps} props - The props for the component.
18
+ * @param {string} [props.className] - The class name to apply to the form.
19
+ * @param {string} [props.email] - The value of the email input.
20
+ * @param {string} [props.error] - A (server) error message to display.
21
+ * @param {boolean} [props.isPending] - Whether the form is pending.
22
+ * @param {() => void} [props.onClearServerErrors] - A function to clear server errors.
23
+ * @param {(value: string) => void} [props.onEmailChange] - A function to handle email input value changes.
24
+ * @param {string} [props.submitLabel] - The label for the submit button.
25
+ * @param {FormEventHandler<HTMLFormElement>} [props.onSubmit] - A function to handle form submission.
26
+ * @returns {JSX.Element} The EmailForm component.
27
+ */
11
28
  export declare const EmailForm: ({ className, email, error, onEmailChange, isPending, submitLabel, ...props }: EmailFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,22 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { ExchangeAmountInputProps } from './types';
3
+ /**
4
+ * ExchangeAmountInput component
5
+ *
6
+ * @param {ExchangeAmountInputProps} props - The props for the ExchangeAmountInput component
7
+ * @param {string} props.cryptoAmount - The amount in crypto
8
+ * @param {string} props.cryptoCurrency - The currency of the crypto value
9
+ * @param {number} [props.cryptoDecimalPlaces] - The number of decimal places for the crypto amount (default 8)
10
+ * @param {string} props.exchangeRate - The exchange rate
11
+ * @param {string} props.fiatAmount - The amount in fiat
12
+ * @param {string} props.fiatCurrency - The currency of the fiat value
13
+ * @param {number} [props.fiatDecimalPlaces] - The number of decimal places for the fiat amount (defualt 2)
14
+ * @param {InputType} props.inputType - The type of input (crypto or fiat)
15
+ * @param {boolean} [props.isExchangeRatePending] - Whether the exchange rate is pending
16
+ * @param {string} [props.locale] - The locale in BCP 47 format (e.g. "en-US").
17
+ * @param {Function} props.setCryptoAmount - The function to set the crypto amount
18
+ * @param {Function} props.setFiatAmount - The function to set the fiat amount
19
+ * @param {Function} props.setInputType - The function to set the input type
20
+ * @returns {JSX.Element} The AmountInput component
21
+ */
3
22
  export declare const ExchangeAmountInput: import('react').ForwardRefExoticComponent<ExchangeAmountInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "inputMode" | "onChange" | "max" | "min"> & import('react').RefAttributes<HTMLInputElement>>;
@@ -1,5 +1,11 @@
1
1
  import { AmountInputProps } from '../AmountInput/types';
2
+ /**
3
+ * The type of input (crypto or fiat)
4
+ */
2
5
  export type InputType = "crypto" | "fiat";
6
+ /**
7
+ * The props for the ExchangeAmountInput component
8
+ */
3
9
  export type ExchangeAmountInputProps = {
4
10
  cryptoAmount: AmountInputProps["amount"];
5
11
  cryptoDecimalPlaces?: AmountInputProps["decimalPlaces"];
@@ -17,7 +23,13 @@ export type ExchangeAmountInputProps = {
17
23
  setFiatAmount: AmountInputProps["setAmount"];
18
24
  setInputType: (inputType: InputType) => void;
19
25
  };
26
+ /**
27
+ * The parameters for the useExchangeAmountInput hook
28
+ */
20
29
  export type UseExchangeAmountInputParams = Omit<ExchangeAmountInputProps, "max" | "min" | "setInputType">;
30
+ /**
31
+ * The return value of the useExchangeAmountInput hook
32
+ */
21
33
  export interface UseExchangeAmountInputReturn {
22
34
  formatInputValue: (value: number) => string;
23
35
  formatOutputValue: (value: number) => string;
@@ -1,2 +1,19 @@
1
1
  import { UseExchangeAmountInputParams, UseExchangeAmountInputReturn } from './types';
2
+ /**
3
+ * The hook for the ExchangeAmountInput component
4
+ *
5
+ * @param {UseExchangeAmountInputParams} params - The parameters for the useExchangeAmountInput hook
6
+ * @param {string} params.cryptoAmount - The amount in crypto
7
+ * @param {string} params.cryptoCurrency - The currency of the crypto value
8
+ * @param {number} [params.cryptoDecimalPlaces] - The number of decimal places for the crypto amount (default 8)
9
+ * @param {string} params.exchangeRate - The exchange rate
10
+ * @param {string} params.fiatAmount - The amount in fiat
11
+ * @param {string} params.fiatCurrency - The currency of the fiat value
12
+ * @param {number} [params.fiatDecimalPlaces] - The number of decimal places for the fiat amount (defualt 2)
13
+ * @param {InputType} params.inputType - The type of input (crypto or fiat)
14
+ * @param {string} [params.locale] - The locale in BCP 47 format (e.g. "en-US").
15
+ * @param {Function} params.setCryptoAmount - The function to set the crypto amount
16
+ * @param {Function} params.setFiatAmount - The function to set the fiat amount
17
+ * @returns {UseExchangeAmountInputReturn} - The active and inactive values, the active and inactive currencies, the active and inactive decimal places, and the functions to handle changing values.
18
+ */
2
19
  export declare const useExchangeAmountInput: ({ cryptoAmount, cryptoCurrency, cryptoDecimalPlaces, exchangeRate, fiatAmount, fiatCurrency, fiatDecimalPlaces, inputType, locale, setFiatAmount, setCryptoAmount, }: UseExchangeAmountInputParams) => UseExchangeAmountInputReturn;
@@ -1,5 +1,14 @@
1
1
  import { FormMessageProps, FormValidityStateProps } from '@radix-ui/react-form';
2
2
  import { CSSProperties, JSX, ReactNode } from 'react';
3
+ /**
4
+ * The props for the Field component.
5
+ *
6
+ * @interface FormFieldProps
7
+ * @augments {HTMLAttributes<HTMLDivElement>}
8
+ * @property {string} label - The label for the input.
9
+ * @property {string} name - The name of the input.
10
+ * @property {FormMessageProps["match"]} validators - The validators for the input.
11
+ */
3
12
  export interface FormFieldProps {
4
13
  children?: FormValidityStateProps["children"];
5
14
  className?: string;
@@ -9,4 +18,10 @@ export interface FormFieldProps {
9
18
  style?: CSSProperties;
10
19
  validators?: [FormMessageProps["match"], ReactNode][];
11
20
  }
21
+ /**
22
+ * A themed form field component with a label and validation messages.
23
+ *
24
+ * @param {FormFieldProps} props - The props for the component.
25
+ * @returns {JSX.Element} The Input component.
26
+ */
12
27
  export declare const Field: ({ children, className, inlineError, label, name, style, validators, }: FormFieldProps) => JSX.Element;
@@ -1,8 +1,23 @@
1
1
  import { FormValidityStateProps } from '@radix-ui/react-form';
2
2
  import { InputHTMLAttributes } from 'react';
3
3
  import { InputSize } from '../../../theme/theme';
4
+ /**
5
+ * The props for the Input component.
6
+ */
4
7
  export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
5
8
  size?: InputSize;
6
9
  }
10
+ /**
11
+ * A themed input component with a label.
12
+ *
13
+ * @param {InputHTMLAttributes<HTMLInputElement>} props - The props for the input.
14
+ * @returns {JSX.Element} The Input component.
15
+ */
7
16
  export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
17
+ /**
18
+ * A higher-order component that adds validity state to the input.
19
+ *
20
+ * @param props - The props for the input.
21
+ * @returns {JSX.Element} The Input component.
22
+ */
8
23
  export declare const withValidityState: (props: InputProps) => FormValidityStateProps["children"];
@@ -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;