@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.
- package/dist/components/AuthButton/index.d.ts +102 -0
- package/dist/components/CDPReactProvider/index.d.ts +114 -0
- package/dist/components/CopyAddress/index.d.ts +29 -0
- package/dist/components/CopyEvmKeyButton/index.d.ts +77 -0
- package/dist/components/CopySolanaKeyButton/index.d.ts +73 -0
- package/dist/components/EnrollMfa/EnrollMfaDescription.d.ts +21 -0
- package/dist/components/EnrollMfa/EnrollMfaFlow.d.ts +27 -0
- package/dist/components/EnrollMfa/EnrollMfaFlowBackButton.d.ts +19 -0
- package/dist/components/EnrollMfa/EnrollMfaFlowProvider.d.ts +52 -0
- package/dist/components/EnrollMfa/EnrollMfaFooter.d.ts +18 -0
- package/dist/components/EnrollMfa/EnrollMfaImage.d.ts +24 -0
- package/dist/components/EnrollMfa/EnrollMfaItem.d.ts +21 -0
- package/dist/components/EnrollMfa/EnrollMfaItems.d.ts +17 -0
- package/dist/components/EnrollMfa/EnrollMfaProvider.d.ts +35 -0
- package/dist/components/EnrollMfa/EnrollMfaTitle.d.ts +21 -0
- package/dist/components/EnrollMfa/index.d.ts +65 -0
- package/dist/components/EnrollMfa/methods/sms.d.ts +25 -0
- package/dist/components/EnrollMfa/methods/totp.d.ts +25 -0
- package/dist/components/EnrollMfa/types.d.ts +48 -0
- package/dist/components/EnrollMfa/useEnrollMfaReducer.d.ts +6 -0
- package/dist/components/EnrollMfaModal/index.d.ts +111 -0
- package/dist/components/ExportWallet/index.d.ts +163 -0
- package/dist/components/ExportWalletModal/index.d.ts +173 -0
- package/dist/components/Fund/FundForm.d.ts +18 -0
- package/dist/components/Fund/FundProvider.d.ts +17 -0
- package/dist/components/Fund/FundTitle.d.ts +12 -0
- package/dist/components/Fund/components/FundAmountInput.d.ts +13 -0
- package/dist/components/Fund/components/FundErrorScreen.d.ts +7 -0
- package/dist/components/Fund/components/FundPaymentMethods.d.ts +7 -0
- package/dist/components/Fund/components/FundPresetAmountInputs.d.ts +7 -0
- package/dist/components/Fund/components/FundTransactionStatus.d.ts +6 -0
- package/dist/components/Fund/hooks/useBuyUrl.d.ts +23 -0
- package/dist/components/Fund/hooks/useEmitLifecycleStatus.d.ts +12 -0
- package/dist/components/Fund/hooks/useExchangeRate.d.ts +17 -0
- package/dist/components/Fund/hooks/usePaymentMethods.d.ts +16 -0
- package/dist/components/Fund/hooks/usePopupMonitor.d.ts +9 -0
- package/dist/components/Fund/hooks/useSetupOnrampEventListeners.d.ts +6 -0
- package/dist/components/Fund/index.d.ts +87 -0
- package/dist/components/Fund/types.d.ts +137 -0
- package/dist/components/Fund/useFundReducer.d.ts +15 -0
- package/dist/components/Fund/utils/buildPaymentMethods.d.ts +15 -0
- package/dist/components/Fund/utils/setupOnrampEventListeners.d.ts +10 -0
- package/dist/components/Fund/utils/subscribeToWindowMessage.d.ts +27 -0
- package/dist/components/FundModal/index.d.ts +106 -0
- package/dist/components/LinkAuth/LinkAuthFlow.d.ts +25 -0
- package/dist/components/LinkAuth/LinkAuthFlowBackButton.d.ts +19 -0
- package/dist/components/LinkAuth/LinkAuthFlowProvider.d.ts +60 -0
- package/dist/components/LinkAuth/LinkAuthItem.d.ts +23 -0
- package/dist/components/LinkAuth/LinkAuthItems.d.ts +17 -0
- package/dist/components/LinkAuth/LinkAuthItems.js +30 -30
- package/dist/components/LinkAuth/LinkAuthProvider.d.ts +31 -0
- package/dist/components/LinkAuth/LinkAuthTitle.d.ts +17 -0
- package/dist/components/LinkAuth/index.d.ts +170 -0
- package/dist/components/LinkAuth/types.d.ts +31 -0
- package/dist/components/LinkAuth/utils.d.ts +12 -0
- package/dist/components/LinkAuthModal/index.d.ts +112 -0
- package/dist/components/OAuthStatusModal/index.d.ts +24 -0
- package/dist/components/SendEvmTransactionButton/index.d.ts +27 -0
- package/dist/components/SendSolanaTransactionButton/index.d.ts +27 -0
- package/dist/components/SignIn/SignInAuthMethodButtons.d.ts +26 -0
- package/dist/components/SignIn/SignInBackButton.d.ts +40 -0
- package/dist/components/SignIn/SignInCredentials.d.ts +13 -0
- package/dist/components/SignIn/SignInDescription.d.ts +35 -0
- package/dist/components/SignIn/SignInFooter.d.ts +27 -0
- package/dist/components/SignIn/SignInForm.d.ts +39 -0
- package/dist/components/SignIn/SignInImage.d.ts +38 -0
- package/dist/components/SignIn/SignInProvider.d.ts +54 -0
- package/dist/components/SignIn/SignInTitle.d.ts +35 -0
- package/dist/components/SignIn/flows/SignInWithEmail.d.ts +26 -0
- package/dist/components/SignIn/flows/SignInWithOAuth.d.ts +19 -0
- package/dist/components/SignIn/flows/SignInWithSms.d.ts +26 -0
- package/dist/components/SignIn/hooks/useEmailForm.d.ts +7 -0
- package/dist/components/SignIn/hooks/useOTPForm.d.ts +8 -0
- package/dist/components/SignIn/hooks/usePhoneNumberForm.d.ts +7 -0
- package/dist/components/SignIn/hooks/useSignInWithOAuth.d.ts +8 -0
- package/dist/components/SignIn/index.d.ts +124 -0
- package/dist/components/SignIn/types.d.ts +37 -0
- package/dist/components/SignIn/useSignInReducer.d.ts +9 -0
- package/dist/components/SignInModal/index.d.ts +123 -0
- package/dist/components/SignOutButton/index.d.ts +39 -0
- package/dist/components/ThemeProvider/index.d.ts +70 -0
- package/dist/components/VerifyMfa/VerifyMfaDescription.d.ts +24 -0
- package/dist/components/VerifyMfa/VerifyMfaFlow.d.ts +30 -0
- package/dist/components/VerifyMfa/VerifyMfaFlowBackButton.d.ts +19 -0
- package/dist/components/VerifyMfa/VerifyMfaFlowProvider.d.ts +51 -0
- package/dist/components/VerifyMfa/VerifyMfaFooter.d.ts +18 -0
- package/dist/components/VerifyMfa/VerifyMfaImage.d.ts +23 -0
- package/dist/components/VerifyMfa/VerifyMfaItem.d.ts +20 -0
- package/dist/components/VerifyMfa/VerifyMfaItems.d.ts +18 -0
- package/dist/components/VerifyMfa/VerifyMfaProvider.d.ts +40 -0
- package/dist/components/VerifyMfa/VerifyMfaTitle.d.ts +24 -0
- package/dist/components/VerifyMfa/index.d.ts +55 -0
- package/dist/components/VerifyMfa/methods/sms.d.ts +29 -0
- package/dist/components/VerifyMfa/methods/totp.d.ts +29 -0
- package/dist/components/VerifyMfa/types.d.ts +33 -0
- package/dist/components/VerifyMfa/useVerifyMfaReducer.d.ts +7 -0
- package/dist/components/VerifyMfaInline/index.d.ts +212 -0
- package/dist/components/VerifyMfaModal/index.d.ts +114 -0
- package/dist/components/forms/AmountInput/index.d.ts +16 -0
- package/dist/components/forms/AmountInput/types.d.ts +9 -0
- package/dist/components/forms/AmountInput/useAmountInput.d.ts +14 -0
- package/dist/components/forms/AmountInput/useInputScale.d.ts +12 -0
- package/dist/components/forms/AmountInput/useNumberParseAndFormat.d.ts +20 -0
- package/dist/components/forms/CountrySelect/index.d.ts +9 -0
- package/dist/components/forms/EmailForm/index.d.ts +17 -0
- package/dist/components/forms/ExchangeAmountInput/index.d.ts +19 -0
- package/dist/components/forms/ExchangeAmountInput/types.d.ts +12 -0
- package/dist/components/forms/ExchangeAmountInput/useExchangeAmountInput.d.ts +17 -0
- package/dist/components/forms/Field/index.d.ts +15 -0
- package/dist/components/forms/Input/index.d.ts +15 -0
- package/dist/components/forms/Label/index.d.ts +8 -0
- package/dist/components/forms/OTP/index.d.ts +6 -0
- package/dist/components/forms/OTPForm/index.d.ts +20 -0
- package/dist/components/forms/PhoneNumberForm/index.d.ts +27 -0
- package/dist/components/forms/PhoneNumberInput/index.d.ts +16 -0
- package/dist/components/forms/PhoneNumberInput/maskOverride.d.ts +6 -0
- package/dist/components/forms/PhoneNumberInput/usePhoneNumberFormatter.d.ts +7 -0
- package/dist/components/forms/Select/index.d.ts +30 -0
- package/dist/components/ui/Badge/index.d.ts +19 -0
- package/dist/components/ui/Banner/index.d.ts +25 -0
- package/dist/components/ui/Button/index.d.ts +50 -0
- package/dist/components/ui/ButtonBase/index.d.ts +20 -0
- package/dist/components/ui/CoinbaseFooter/index.d.ts +16 -0
- package/dist/components/ui/CopyTextField/index.d.ts +35 -0
- package/dist/components/ui/Error/index.d.ts +14 -0
- package/dist/components/ui/IframeButton/index.d.ts +17 -0
- package/dist/components/ui/LoadingSkeleton/index.d.ts +22 -0
- package/dist/components/ui/LoadingSpinner/index.d.ts +11 -0
- package/dist/components/ui/Modal/index.d.ts +82 -0
- package/dist/components/ui/QRCode/QRCodeSvg.d.ts +35 -0
- package/dist/components/ui/QRCode/index.d.ts +7 -0
- package/dist/components/ui/QRCode/useCorners.d.ts +9 -0
- package/dist/components/ui/QRCode/useDotsPath.d.ts +18 -0
- package/dist/components/ui/QRCode/useLogo.d.ts +18 -0
- package/dist/components/ui/QRCode/useMatrix.d.ts +7 -0
- package/dist/components/ui/ServerError/index.d.ts +6 -0
- package/dist/components/ui/SuccessMessage/index.d.ts +14 -0
- package/dist/components/ui/SwitchFadeTransition/index.d.ts +15 -0
- package/dist/components/ui/SwitchSlideTransition/index.d.ts +16 -0
- package/dist/components/ui/SwitchTransition/index.d.ts +42 -0
- package/dist/components/ui/ToggleListItem/index.d.ts +31 -0
- package/dist/components/ui/VisuallyHidden/index.d.ts +18 -0
- package/dist/data/countries.d.ts +15 -0
- package/dist/data/countryNames.d.ts +4 -0
- package/dist/hooks/useKeyExportPostMessage.d.ts +25 -0
- package/dist/hooks/usePhoneNumberState.d.ts +47 -0
- package/dist/hooks/usePhoneNumberValidators.d.ts +8 -0
- package/dist/hooks/useTimeout.d.ts +18 -0
- package/dist/hooks/useTimer.d.ts +6 -0
- package/dist/hooks/useTransitionMap.d.ts +22 -0
- package/dist/hooks/useVerifyMfaModal.d.ts +78 -0
- package/dist/icons/IconAppleLogo.d.ts +22 -0
- package/dist/icons/IconArrowLeft.d.ts +22 -0
- package/dist/icons/IconArrowsUpDown.d.ts +22 -0
- package/dist/icons/IconCheck.d.ts +22 -0
- package/dist/icons/IconCheckCircle.d.ts +21 -0
- package/dist/icons/IconChevronDown.d.ts +22 -0
- package/dist/icons/IconCoinbaseMark.d.ts +22 -0
- package/dist/icons/IconCoinbaseWordmark.d.ts +22 -0
- package/dist/icons/IconCopy.d.ts +22 -0
- package/dist/icons/IconCreditCard.d.ts +22 -0
- package/dist/icons/IconCurrencies.d.ts +22 -0
- package/dist/icons/IconEnvelope.d.ts +22 -0
- package/dist/icons/IconExclamationCircle.d.ts +22 -0
- package/dist/icons/IconExclamationTriangle.d.ts +22 -0
- package/dist/icons/IconGoogleColorLogo.d.ts +22 -0
- package/dist/icons/IconGoogleLogo.d.ts +22 -0
- package/dist/icons/IconLock.d.ts +22 -0
- package/dist/icons/IconMinus.d.ts +21 -0
- package/dist/icons/IconPhone.d.ts +22 -0
- package/dist/icons/IconPinCode.d.ts +22 -0
- package/dist/icons/IconPlus.d.ts +21 -0
- package/dist/icons/IconShield.d.ts +22 -0
- package/dist/icons/IconSmartPhone.d.ts +22 -0
- package/dist/icons/IconTelegramLogo.d.ts +22 -0
- package/dist/icons/IconXLogo.d.ts +22 -0
- package/dist/icons/IconXMark.d.ts +22 -0
- package/dist/icons/SvgIcon.d.ts +6 -0
- package/dist/theme/cssVariables.d.ts +10 -0
- package/dist/theme/theme.d.ts +246 -0
- package/dist/theme/tokens.d.ts +54 -0
- package/dist/theme/utils.d.ts +63 -0
- package/dist/types/secureIframe.d.ts +3 -0
- package/dist/utils/capitalize.d.ts +8 -0
- package/dist/utils/childrenHasComponent.d.ts +10 -0
- package/dist/utils/clamp.d.ts +10 -0
- package/dist/utils/formatFiat.d.ts +11 -0
- package/dist/utils/formatPhoneNumber.d.ts +8 -0
- package/dist/utils/getMessageFromUnknownError.d.ts +9 -0
- package/dist/utils/isApiError.d.ts +21 -0
- package/dist/utils/isEmailInvalid.d.ts +15 -0
- package/dist/utils/openPopup.d.ts +15 -0
- package/dist/utils/parseValuesFromPhoneNumber.d.ts +16 -0
- package/dist/utils/sendIframeMessage.d.ts +8 -0
- package/dist/utils/toOAuthProviderType.d.ts +8 -0
- package/dist/utils/transition.d.ts +41 -0
- package/dist/version.d.ts +5 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
|
@@ -2,20 +2,132 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { AuthMethod } from '../CDPReactProvider';
|
|
3
3
|
import { ButtonProps } from '../ui/Button';
|
|
4
4
|
import { ModalContentProps } from '../ui/Modal';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the link auth modal trigger button
|
|
7
|
+
*
|
|
8
|
+
* @see {@link LinkAuthModalTrigger}
|
|
9
|
+
*/
|
|
5
10
|
interface LinkAuthModalTriggerProps 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 link auth modal content.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link LinkAuthModalContent}
|
|
20
|
+
*/
|
|
9
21
|
interface LinkAuthModalContentProps extends ModalContentProps {
|
|
22
|
+
/** A function to call when an auth method is successfully linked. */
|
|
10
23
|
onLinkSuccess?: (method: string) => void;
|
|
11
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Props for the LinkAuthModal component.
|
|
27
|
+
*
|
|
28
|
+
* @see {@link LinkAuthModal}
|
|
29
|
+
*/
|
|
12
30
|
interface LinkAuthModalProps {
|
|
31
|
+
/** If provided, will render the children instead of the default trigger button. */
|
|
13
32
|
children?: ReactNode;
|
|
33
|
+
/** Whether the modal is open. Note: if you set this, you must also set `setIsOpen`. */
|
|
14
34
|
open?: boolean;
|
|
35
|
+
/** A function to set the modal's open state. Note: if you set this, you must also set `open`. */
|
|
15
36
|
setIsOpen?: (value: boolean) => void;
|
|
37
|
+
/** A function to call when an auth method is successfully linked. */
|
|
16
38
|
onLinkSuccess?: (method: AuthMethod | null) => void;
|
|
17
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* A trigger button that opens the link auth modal.
|
|
42
|
+
*
|
|
43
|
+
* @param {LinkAuthModalTriggerProps} props - The props for the LinkAuthModalTrigger component.
|
|
44
|
+
* @param {ReactNode} [props.children] - The children to render inside the trigger button.
|
|
45
|
+
* @param {ReactNode} [props.label] - The label to display on the trigger button.
|
|
46
|
+
* @returns {JSX.Element} The LinkAuthModalTrigger component.
|
|
47
|
+
*
|
|
48
|
+
* @group Components
|
|
49
|
+
*/
|
|
18
50
|
declare const LinkAuthModalTrigger: ({ children, className, label, ...props }: LinkAuthModalTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
/**
|
|
52
|
+
* The link auth modal content.
|
|
53
|
+
*
|
|
54
|
+
* @param {LinkAuthModalContentProps} props - The props for the LinkAuthModalContent component.
|
|
55
|
+
* @returns {JSX.Element} The LinkAuthModalContent component.
|
|
56
|
+
*
|
|
57
|
+
* @group Components
|
|
58
|
+
*/
|
|
19
59
|
declare const LinkAuthModalContent: (props: LinkAuthModalContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
/**
|
|
61
|
+
* A link auth modal component that wraps the {@link LinkAuth} component.
|
|
62
|
+
*
|
|
63
|
+
* @param {LinkAuthModalProps} props - The props for the LinkAuthModal component.
|
|
64
|
+
* @returns {JSX.Element} The LinkAuthModal component.
|
|
65
|
+
*
|
|
66
|
+
* @see {@link LinkAuthModalTrigger} for the trigger button.
|
|
67
|
+
* @see {@link LinkAuthModalContent} for the modal content.
|
|
68
|
+
*
|
|
69
|
+
* @group Components
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx lines
|
|
73
|
+
* // Render the LinkAuthModal component with a custom success handler
|
|
74
|
+
* function App() {
|
|
75
|
+
* const handleLinkSuccess = (method: string) => {
|
|
76
|
+
* console.log(`Successfully linked ${method}`);
|
|
77
|
+
* };
|
|
78
|
+
*
|
|
79
|
+
* return (
|
|
80
|
+
* <CDPReactProvider config={config}>
|
|
81
|
+
* <LinkAuthModal onLinkSuccess={handleLinkSuccess} />
|
|
82
|
+
* </CDPReactProvider>
|
|
83
|
+
* );
|
|
84
|
+
* }
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx lines
|
|
89
|
+
* // Render the LinkAuthModal component with a custom trigger button
|
|
90
|
+
* function App() {
|
|
91
|
+
* return (
|
|
92
|
+
* <CDPReactProvider config={config}>
|
|
93
|
+
* <LinkAuthModal>
|
|
94
|
+
* <button type="button">Manage linked accounts</button>
|
|
95
|
+
* </LinkAuthModal>
|
|
96
|
+
* </CDPReactProvider>
|
|
97
|
+
* );
|
|
98
|
+
* }
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```tsx lines
|
|
103
|
+
* // Render the LinkAuthModal component with a custom trigger button label
|
|
104
|
+
* function App() {
|
|
105
|
+
* return (
|
|
106
|
+
* <CDPReactProvider config={config}>
|
|
107
|
+
* <LinkAuthModal>
|
|
108
|
+
* <LinkAuthModalTrigger variant="secondary" label="Link more accounts" />
|
|
109
|
+
* </LinkAuthModal>
|
|
110
|
+
* </CDPReactProvider>
|
|
111
|
+
* );
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```tsx lines
|
|
117
|
+
* // Render the LinkAuthModal with controlled open state
|
|
118
|
+
* function App() {
|
|
119
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
120
|
+
*
|
|
121
|
+
* return (
|
|
122
|
+
* <CDPReactProvider config={config}>
|
|
123
|
+
* <LinkAuthModal open={isOpen} setIsOpen={setIsOpen}>
|
|
124
|
+
* <LinkAuthModalTrigger />
|
|
125
|
+
* <LinkAuthModalContent />
|
|
126
|
+
* </LinkAuthModal>
|
|
127
|
+
* </CDPReactProvider>
|
|
128
|
+
* );
|
|
129
|
+
* }
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
20
132
|
declare const LinkAuthModal: ({ children, open, setIsOpen, onLinkSuccess }: LinkAuthModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
133
|
export { LinkAuthModal, LinkAuthModalContent, LinkAuthModalTrigger, type LinkAuthModalProps, type LinkAuthModalContentProps, type LinkAuthModalTriggerProps, };
|
|
@@ -4,10 +4,34 @@ type OAuthStatusModalContentProps = {
|
|
|
4
4
|
isAccountLink?: boolean;
|
|
5
5
|
handleClose: () => void;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* The useOauthStatusModal hook provides a function to persist state for the oauth status modal for use on redirect.
|
|
9
|
+
*
|
|
10
|
+
* The returned function sets two values in session storage:
|
|
11
|
+
* 1. The app provider name (set in app config): this is used to identify which app intiiated the flow, in case of multiple CDPReactProvider instances.
|
|
12
|
+
* 2. Whether this is an account link flow: this is used to determine whether the user is signing in or linking an account.
|
|
13
|
+
*
|
|
14
|
+
* @returns {{persistOAuthState: (isAccountLink?: boolean) => void}} An object with a function to prepare the oauth status modal for use.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link OAuthStatusModal}
|
|
17
|
+
*
|
|
18
|
+
* @group Hooks
|
|
19
|
+
*/
|
|
7
20
|
export declare const useOauthStatusModal: () => {
|
|
8
21
|
persistOAuthState: (isAccountLink?: boolean) => void;
|
|
9
22
|
cleanupOAuthState: () => void;
|
|
10
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* The OAuthStatusModal component is a modal that displays the status of an OAuth flow.
|
|
26
|
+
*
|
|
27
|
+
* @returns {JSX.Element} The OAuthStatusModal component.
|
|
28
|
+
*/
|
|
11
29
|
export declare const OAuthStatusModal: () => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* The OAuthStatusModalContent component is a component that displays the status of an OAuth flow.
|
|
32
|
+
*
|
|
33
|
+
* @param {OAuthStatusModalContentProps} props - The props for the OAuthStatusModalContent component.
|
|
34
|
+
* @returns {JSX.Element} The OAuthStatusModalContent component.
|
|
35
|
+
*/
|
|
12
36
|
export declare const OAuthStatusModalContent: ({ isAccountLink, handleClose, }: OAuthStatusModalContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
37
|
export default OAuthStatusModal;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { APIError, SendEvmTransactionOptions } from '@coinbase/cdp-hooks';
|
|
2
2
|
import { ButtonProps } from '../ui/Button';
|
|
3
|
+
/**
|
|
4
|
+
* The props for the SendEvmTransactionButton component.
|
|
5
|
+
*
|
|
6
|
+
* @augments {Omit<ButtonProps, "onError">}
|
|
7
|
+
* @property {SendEvmTransactionOptions["evmAccount"]} account - The account to send the transaction from.
|
|
8
|
+
* @property {SendEvmTransactionOptions["network"]} network - The network to send the transaction on.
|
|
9
|
+
* @property {(error: APIError | Error) => void} [onError] - A function to call when the transaction errors.
|
|
10
|
+
* @property {(hash: string) => void} [onSuccess] - A function to call when the transaction is successful.
|
|
11
|
+
* @property {SendEvmTransactionOptions["transaction"]} transaction - The transaction to send.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link SendEvmTransactionButton}
|
|
14
|
+
*/
|
|
3
15
|
export interface SendEvmTransactionButtonProps extends Omit<ButtonProps, "onError"> {
|
|
4
16
|
account: SendEvmTransactionOptions["evmAccount"];
|
|
5
17
|
network: SendEvmTransactionOptions["network"];
|
|
@@ -7,4 +19,19 @@ export interface SendEvmTransactionButtonProps extends Omit<ButtonProps, "onErro
|
|
|
7
19
|
onSuccess?: (hash: string) => void;
|
|
8
20
|
transaction: SendEvmTransactionOptions["transaction"];
|
|
9
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* A button that signs and sends a transaction.
|
|
24
|
+
*
|
|
25
|
+
* @param {SendEvmTransactionButtonProps} props - The props for the SendEvmTransactionButton component.
|
|
26
|
+
* @param {SendEvmTransactionOptions["evmAccount"]} props.account - The account to send the transaction from.
|
|
27
|
+
* @param {SendEvmTransactionOptions["network"]} props.network - The network to send the transaction on.
|
|
28
|
+
* @param {(error: APIError | Error) => void} [props.onError] - A function to call when the transaction errors.
|
|
29
|
+
* @param {(hash: string) => void} [props.onSuccess] - A function to call when the transaction is successful.
|
|
30
|
+
* @param {ReactNode} [props.pendingLabel] - The label to display when the transaction is pending.
|
|
31
|
+
* @param {SendEvmTransactionOptions["transaction"]} props.transaction - The transaction to send.
|
|
32
|
+
* @param {ButtonVariant} [props.variant] - The variant of the button.
|
|
33
|
+
* @returns {JSX.Element} The rendered component.
|
|
34
|
+
*
|
|
35
|
+
* @group Components
|
|
36
|
+
*/
|
|
10
37
|
export declare const SendEvmTransactionButton: ({ account, children, className, network, onClick, onError, onSuccess, pendingLabel, transaction, ...props }: SendEvmTransactionButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { APIError, SendSolanaTransactionOptions } from '@coinbase/cdp-hooks';
|
|
2
2
|
import { ButtonProps } from '../ui/Button';
|
|
3
|
+
/**
|
|
4
|
+
* The props for the SendSolanaTransactionButton component.
|
|
5
|
+
*
|
|
6
|
+
* @augments {Omit<ButtonProps, "onError">}
|
|
7
|
+
* @property {SendSolanaTransactionOptions["solanaAccount"]} account - The Solana account to send the transaction from.
|
|
8
|
+
* @property {SendSolanaTransactionOptions["network"]} network - The network to send the transaction on.
|
|
9
|
+
* @property {(error: APIError | Error) => void} [onError] - A function to call when the transaction errors.
|
|
10
|
+
* @property {(signature: string) => void} [onSuccess] - A function to call when the transaction is successful.
|
|
11
|
+
* @property {SendSolanaTransactionOptions["transaction"]} transaction - The base64 encoded transaction to send.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link SendSolanaTransactionButton}
|
|
14
|
+
*/
|
|
3
15
|
export interface SendSolanaTransactionButtonProps extends Omit<ButtonProps, "onError"> {
|
|
4
16
|
account: SendSolanaTransactionOptions["solanaAccount"];
|
|
5
17
|
network: SendSolanaTransactionOptions["network"];
|
|
@@ -7,4 +19,19 @@ export interface SendSolanaTransactionButtonProps extends Omit<ButtonProps, "onE
|
|
|
7
19
|
onSuccess?: (signature: string) => void;
|
|
8
20
|
transaction: SendSolanaTransactionOptions["transaction"];
|
|
9
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* A button that signs and sends a Solana transaction.
|
|
24
|
+
*
|
|
25
|
+
* @param {SendSolanaTransactionButtonProps} props - The props for the SendSolanaTransactionButton component.
|
|
26
|
+
* @param {SendSolanaTransactionOptions["solanaAccount"]} props.account - The Solana account to send the transaction from.
|
|
27
|
+
* @param {SendSolanaTransactionOptions["network"]} props.network - The network to send the transaction on.
|
|
28
|
+
* @param {(error: APIError | Error) => void} [props.onError] - A function to call when the transaction errors.
|
|
29
|
+
* @param {(signature: string) => void} [props.onSuccess] - A function to call when the transaction is successful.
|
|
30
|
+
* @param {ReactNode} [props.pendingLabel] - The label to display when the transaction is pending.
|
|
31
|
+
* @param {SendSolanaTransactionOptions["transaction"]} props.transaction - The base64 encoded transaction to send.
|
|
32
|
+
* @param {ButtonVariant} [props.variant] - The variant of the button.
|
|
33
|
+
* @returns {JSX.Element} The rendered component.
|
|
34
|
+
*
|
|
35
|
+
* @group Components
|
|
36
|
+
*/
|
|
10
37
|
export declare const SendSolanaTransactionButton: ({ account, children, className, network, onClick, onError, onSuccess, pendingLabel, transaction, ...props }: SendSolanaTransactionButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,40 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { AuthMethod } from '../CDPReactProvider';
|
|
3
|
+
/**
|
|
4
|
+
* The props for an AuthMethodButton.
|
|
5
|
+
*
|
|
6
|
+
* @see {@link SignInAuthMethodButtonProps}
|
|
7
|
+
*/
|
|
3
8
|
export interface SignInAuthMethodButtonProps {
|
|
9
|
+
/** The key of the auth method. */
|
|
4
10
|
key: AuthMethod;
|
|
11
|
+
/** The label of the auth method. */
|
|
5
12
|
label: string;
|
|
13
|
+
/** The aria label of the auth method. */
|
|
6
14
|
ariaLabel?: string;
|
|
15
|
+
/** The icon of the auth method. */
|
|
7
16
|
icon: ReactNode;
|
|
17
|
+
/** Whether the auth method is pending. */
|
|
8
18
|
isPending?: boolean;
|
|
19
|
+
/** The function to call when the auth method is clicked. */
|
|
9
20
|
onClick: () => void;
|
|
10
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* The props for the AuthMethodButtons component.
|
|
24
|
+
*
|
|
25
|
+
* @see {@link SignInAuthMethodButtons}
|
|
26
|
+
*/
|
|
11
27
|
export interface SignInAuthMethodButtonsProps {
|
|
28
|
+
/** The active auth method. */
|
|
12
29
|
activeMethod?: AuthMethod;
|
|
13
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* The AuthMethodButtons component.
|
|
33
|
+
*
|
|
34
|
+
* @param {AuthMethodButtonProps} props - The props for the AuthMethodButtons component.
|
|
35
|
+
* @param {AuthMethod} [props.activeMethod] - The active auth method.
|
|
36
|
+
* @returns {JSX.Element} The AuthMethodButtons component.
|
|
37
|
+
*
|
|
38
|
+
* @group Components
|
|
39
|
+
*/
|
|
14
40
|
export declare const SignInAuthMethodButtons: ({ activeMethod }: SignInAuthMethodButtonsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,9 +1,49 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { ButtonSize, ButtonVariant } from '../../theme/theme';
|
|
3
3
|
import { SignInState } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* A button to go back to the previous step of the sign-in flow.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link SignInBackButton}
|
|
8
|
+
*/
|
|
4
9
|
export interface SignInBackButtonProps extends HTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
/** If set, will render the back button for this step of the sign in flow, regardless of the context value. */
|
|
5
11
|
step?: SignInState["step"];
|
|
12
|
+
/** The size of the button. */
|
|
6
13
|
size?: ButtonSize;
|
|
14
|
+
/** The variant of the button. */
|
|
7
15
|
variant?: ButtonVariant;
|
|
8
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* A button to go back to the previous step of the sign-in flow.
|
|
19
|
+
*
|
|
20
|
+
* @param {SignInBackButtonProps} props - The props for the component.
|
|
21
|
+
* @param {SignInState["step"]} [props.step] - If set, will render the back button for this step of the sign in flow, regardless of the context value.
|
|
22
|
+
* @param {ButtonSize} [props.size] - The size of the button.
|
|
23
|
+
* @param {ButtonVariant} [props.variant] - The variant of the button.
|
|
24
|
+
* @returns {JSX.Element} The sign-in back button.
|
|
25
|
+
*
|
|
26
|
+
* @group Components
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx lines
|
|
30
|
+
* function App() {
|
|
31
|
+
* // Customize the back button icon and label
|
|
32
|
+
* return (
|
|
33
|
+
* <CDPReactProvider config={config} theme={themeOverrides}>
|
|
34
|
+
* <SignIn>
|
|
35
|
+
* <SignInBackButton aria-label="go back">
|
|
36
|
+
* <MyCustomIcon />
|
|
37
|
+
* </SignInBackButton>
|
|
38
|
+
* <SignInImage />
|
|
39
|
+
* <SignInTitle />
|
|
40
|
+
* <SignInDescription />
|
|
41
|
+
* <SignInForm />
|
|
42
|
+
* <SignInFooter />
|
|
43
|
+
* </SignIn>
|
|
44
|
+
* </CDPReactProvider>
|
|
45
|
+
* );
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
9
49
|
export declare const SignInBackButton: ({ step: stepFromProps, children, onClick, size, variant, ["aria-label"]: ariaLabel, ...props }: SignInBackButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A component that renders styled credentials for the sign in flow.
|
|
4
|
+
*
|
|
5
|
+
* @param {HTMLAttributes<HTMLSpanElement>} props - The props for the component.
|
|
6
|
+
* @param {ReactNode} props.children - The children of the component.
|
|
7
|
+
* @returns {JSX.Element} The rendered component.
|
|
8
|
+
*
|
|
9
|
+
* @group Components
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx lines
|
|
13
|
+
* Email: <SignInCredentials>name@example.com</SignInCredentials>
|
|
14
|
+
*/
|
|
2
15
|
export declare const SignInCredentials: ({ children, ...props }: HTMLAttributes<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes } from 'react';
|
|
2
2
|
import { SignInTitleAndDescriptionProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The props for the SignInDescription component.
|
|
5
|
+
*
|
|
6
|
+
* @see {@link SignInDescription}
|
|
7
|
+
*/
|
|
3
8
|
export interface SignInDescriptionProps extends SignInTitleAndDescriptionProps, HTMLAttributes<HTMLElement> {
|
|
9
|
+
/** The element type to render the description as. */
|
|
4
10
|
as?: ElementType;
|
|
5
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* A description for the SignIn component.
|
|
14
|
+
*
|
|
15
|
+
* @param {SignInDescriptionProps} props - The props for the component.
|
|
16
|
+
* @returns {JSX.Element} The rendered component.
|
|
17
|
+
*
|
|
18
|
+
* @group Components
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx lines
|
|
22
|
+
* function App() {
|
|
23
|
+
* // Render a custom description in the SignIn component
|
|
24
|
+
* return (
|
|
25
|
+
* <CDPReactProvider config={config} theme={themeOverrides}>
|
|
26
|
+
* <SignIn>
|
|
27
|
+
* <SignInBackButton />
|
|
28
|
+
* <SignInImage />
|
|
29
|
+
* <SignInTitle />
|
|
30
|
+
* <SignInDescription>
|
|
31
|
+
* Custom Sign In Description
|
|
32
|
+
* </SignInDescription>
|
|
33
|
+
* <SignInForm />
|
|
34
|
+
* <SignInFooter />
|
|
35
|
+
* </SignIn>
|
|
36
|
+
* </CDPReactProvider>
|
|
37
|
+
* );
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
6
41
|
export declare const SignInDescription: ({ as: Component, authMethod: authMethodFromProps, children, className, step: stepFromProps, ...props }: SignInDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,29 @@
|
|
|
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
|
+
* @group Components
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx lines
|
|
12
|
+
* function App() {
|
|
13
|
+
* // Add class to the footer
|
|
14
|
+
* return (
|
|
15
|
+
* <CDPReactProvider config={config} theme={themeOverrides}>
|
|
16
|
+
* <SignIn>
|
|
17
|
+
* <SignInBackButton />
|
|
18
|
+
* <SignInImage />
|
|
19
|
+
* <SignInTitle />
|
|
20
|
+
* <SignInDescription />
|
|
21
|
+
* <SignInForm />
|
|
22
|
+
* <SignInFooter className="sign-in-footer" />
|
|
23
|
+
* </SignIn>
|
|
24
|
+
* </CDPReactProvider>
|
|
25
|
+
* );
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
2
29
|
export declare const SignInFooter: (props: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,54 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { AuthMethod } from '../CDPReactProvider';
|
|
3
3
|
import { SignInState } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the SignInForm component.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link SignInForm}
|
|
8
|
+
*/
|
|
4
9
|
export interface SignInFormProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
10
|
+
/** The element type to render the form as. */
|
|
5
11
|
as?: ElementType;
|
|
12
|
+
/** If set, will auto focus the form when the component mounts and after transitions. */
|
|
6
13
|
autoFocus?: boolean;
|
|
14
|
+
/** The function to call when the sign in is successful. */
|
|
7
15
|
onSuccess?: () => void;
|
|
16
|
+
/** If set, will render the form for this step of the sign in flow, regardless of the context value. */
|
|
8
17
|
step?: SignInState["step"];
|
|
18
|
+
/** The children of the component. */
|
|
9
19
|
children?: (props: {
|
|
10
20
|
step: SignInState["step"];
|
|
11
21
|
authMethod: AuthMethod;
|
|
12
22
|
Form: ReactNode;
|
|
13
23
|
}) => ReactNode;
|
|
14
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* The form for the SignIn component.
|
|
27
|
+
*
|
|
28
|
+
* @param {SignInFormProps} props - The component props.
|
|
29
|
+
* @returns {JSX.Element} The rendered component.
|
|
30
|
+
*
|
|
31
|
+
* @group Components
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx lines
|
|
35
|
+
* function App() {
|
|
36
|
+
* // Add div wrapper and class to the form
|
|
37
|
+
* return (
|
|
38
|
+
* <CDPReactProvider config={config} theme={themeOverrides}>
|
|
39
|
+
* <SignIn>
|
|
40
|
+
* <SignInBackButton />
|
|
41
|
+
* <SignInImage />
|
|
42
|
+
* <SignInTitle />
|
|
43
|
+
* <SignInDescription />
|
|
44
|
+
* <div className="sign-in-form-wrapper">
|
|
45
|
+
* <SignInForm className="sign-in-form" />
|
|
46
|
+
* </div>
|
|
47
|
+
* <SignInFooter />
|
|
48
|
+
* </SignIn>
|
|
49
|
+
* </CDPReactProvider>
|
|
50
|
+
* );
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
15
54
|
export declare const SignInForm: ({ autoFocus, onSuccess, step: stepFromProps, children, ...props }: SignInFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the SignInImage component.
|
|
3
|
+
*
|
|
4
|
+
* @see {@link SignInImage}
|
|
5
|
+
*/
|
|
1
6
|
export interface SignInImageProps {
|
|
7
|
+
/** The class name to apply to the component. */
|
|
2
8
|
className?: string;
|
|
9
|
+
/** The alt text for the image. */
|
|
3
10
|
alt?: string;
|
|
11
|
+
/** The source URL for the image. Uses the app logo by default. */
|
|
4
12
|
src?: string;
|
|
5
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* A logo or success icon for the SignIn component.
|
|
16
|
+
*
|
|
17
|
+
* @param {SignInImageProps} props - The props for the component.
|
|
18
|
+
* @param {string} [props.className] - The class name to apply to the component.
|
|
19
|
+
* @param {string} [props.alt] - The alt text for the image.
|
|
20
|
+
* @param {string} [props.src] - The source URL for the image. Uses the app logo by default.
|
|
21
|
+
* @returns {JSX.Element} The rendered component.
|
|
22
|
+
*
|
|
23
|
+
* @group Components
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx lines
|
|
27
|
+
* function App() {
|
|
28
|
+
* // Use a different image from your app logo in the SignIn component
|
|
29
|
+
* return (
|
|
30
|
+
* <CDPReactProvider config={config} theme={themeOverrides}>
|
|
31
|
+
* <SignIn>
|
|
32
|
+
* <SignInBackButton />
|
|
33
|
+
* <SignInImage src="https://example.com/image.png" alt="Example Image" />
|
|
34
|
+
* <SignInTitle />
|
|
35
|
+
* <SignInDescription />
|
|
36
|
+
* <SignInForm />
|
|
37
|
+
* <SignInFooter />
|
|
38
|
+
* </SignIn>
|
|
39
|
+
* </CDPReactProvider>
|
|
40
|
+
* );
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
6
44
|
export declare const SignInImage: ({ className, alt, src }: SignInImageProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,13 +1,67 @@
|
|
|
1
1
|
import { Dispatch, ReactNode } from 'react';
|
|
2
2
|
import { SignInAction, SignInState } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Context for the SignIn component.
|
|
5
|
+
*/
|
|
3
6
|
export declare const SignInContext: import('react').Context<{
|
|
4
7
|
state: SignInState;
|
|
5
8
|
dispatch: Dispatch<SignInAction>;
|
|
6
9
|
}>;
|
|
10
|
+
/**
|
|
11
|
+
* A context for the SignIn component.
|
|
12
|
+
*
|
|
13
|
+
* @returns {SignInState} The current state of the SignIn component.
|
|
14
|
+
*
|
|
15
|
+
* @group Hooks
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx lines
|
|
19
|
+
* function EmailComponent() {
|
|
20
|
+
* const { state } = useSignInContext();
|
|
21
|
+
* return <div>Submitted email: {state.email}</div>;
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* function App() {
|
|
25
|
+
* return (
|
|
26
|
+
* <CDPReactProvider config={config} theme={themeOverrides}>
|
|
27
|
+
* <SignIn>
|
|
28
|
+
* <SignInTitle />
|
|
29
|
+
* <SignInDescription />
|
|
30
|
+
* <EmailComponent />
|
|
31
|
+
* <SignInForm />
|
|
32
|
+
* </SignIn>
|
|
33
|
+
* </CDPReactProvider>
|
|
34
|
+
* );
|
|
35
|
+
*/
|
|
7
36
|
export declare const useSignInContext: () => {
|
|
8
37
|
state: SignInState;
|
|
9
38
|
dispatch: Dispatch<SignInAction>;
|
|
10
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* A provider for the SignInContext.
|
|
42
|
+
*
|
|
43
|
+
* @param {SignInProviderProps} props - The props for the SignInProvider component.
|
|
44
|
+
* @param {ReactNode} props.children - The children to render inside the provider.
|
|
45
|
+
* @returns {JSX.Element} The rendered component.
|
|
46
|
+
*
|
|
47
|
+
* @group Components
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx lines
|
|
51
|
+
* function App() {
|
|
52
|
+
* return (
|
|
53
|
+
* <CDPReactProvider config={config} theme={themeOverrides}>
|
|
54
|
+
* <SignInProvider>
|
|
55
|
+
* <SignInImage />
|
|
56
|
+
* <SignInTitle />
|
|
57
|
+
* <SignInDescription />
|
|
58
|
+
* <SignInForm />
|
|
59
|
+
* </SignInProvider>
|
|
60
|
+
* </CDPReactProvider>
|
|
61
|
+
* );
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
11
65
|
export declare const SignInProvider: ({ children, authMethods: authMethodsFromProps, }: {
|
|
12
66
|
children: ReactNode;
|
|
13
67
|
authMethods?: SignInState["authMethods"];
|
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes } from 'react';
|
|
2
2
|
import { SignInTitleAndDescriptionProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The props for the SignInTitle component.
|
|
5
|
+
*
|
|
6
|
+
* @see {@link SignInTitle}
|
|
7
|
+
*/
|
|
3
8
|
export interface SignInTitleProps extends SignInTitleAndDescriptionProps, HTMLAttributes<HTMLElement> {
|
|
9
|
+
/** The element type to render the title as. */
|
|
4
10
|
as?: ElementType;
|
|
5
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* A title for the SignIn component.
|
|
14
|
+
*
|
|
15
|
+
* @param {SignInTitleAndDescriptionProps} props - The props for the component.
|
|
16
|
+
* @returns {JSX.Element} The rendered component.
|
|
17
|
+
*
|
|
18
|
+
* @group Components
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx lines
|
|
22
|
+
* function App() {
|
|
23
|
+
* // Render a custom title in the SignIn component
|
|
24
|
+
* return (
|
|
25
|
+
* <CDPReactProvider config={config} theme={themeOverrides}>
|
|
26
|
+
* <SignIn>
|
|
27
|
+
* <SignInBackButton />
|
|
28
|
+
* <SignInImage />
|
|
29
|
+
* <SignInTitle>
|
|
30
|
+
* Custom Sign In Title
|
|
31
|
+
* </SignInTitle>
|
|
32
|
+
* <SignInDescription />
|
|
33
|
+
* <SignInForm />
|
|
34
|
+
* <SignInFooter />
|
|
35
|
+
* </SignIn>
|
|
36
|
+
* </CDPReactProvider>
|
|
37
|
+
* );
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
6
41
|
export declare const SignInTitle: ({ as: Component, children, className, authMethod: authMethodFromProps, step: stepFromProps, ...props }: SignInTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { SignInFlowProps, SignInTitleAndDescriptionProps, SignInFlowConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* The step of the email OTP flow.
|
|
4
|
+
*/
|
|
2
5
|
export type Step = "email" | "otp";
|
|
6
|
+
/**
|
|
7
|
+
* A component that renders the sign in with email flow.
|
|
8
|
+
*
|
|
9
|
+
* @param {SignInFlowProps} props - The props for the sign in with email flow.
|
|
10
|
+
* @param {SignInFlowProps["children"]} [props.children] - A function to render the children. If provided, the function will be called with the current step of the flow and the form component.
|
|
11
|
+
* @param {SignInFlowProps["onSuccess"]} props.onSuccess - The callback to call when the sign in is successful.
|
|
12
|
+
* @param {SignInFlowProps["step"]} props.step - The step to render the flow for.
|
|
13
|
+
* @returns {JSX.Element} The SignInWithEmail component.
|
|
14
|
+
*/
|
|
3
15
|
export declare const SignInWithEmail: ({ step: stepFromProps, autoFocus, onSuccess, children, }: SignInFlowProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* A component that renders the title for the sign in with email flow.
|
|
18
|
+
*
|
|
19
|
+
* @param {SignInTitleAndDescriptionProps} props - The props for the component.
|
|
20
|
+
* @param {Step} props.step - The step to render the component for.
|
|
21
|
+
* @returns {JSX.Element} The rendered component.
|
|
22
|
+
*/
|
|
4
23
|
export declare const SignInWithEmailTitle: ({ step }: SignInTitleAndDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* A component that renders the description for the sign in with email flow.
|
|
26
|
+
*
|
|
27
|
+
* @param {SignInTitleAndDescriptionProps} props - The props for the component.
|
|
28
|
+
* @param {Step} props.step - The step to render the component for.
|
|
29
|
+
* @returns {JSX.Element} The rendered component.
|
|
30
|
+
*/
|
|
5
31
|
export declare const SignInWithEmailDescription: ({ step }: SignInTitleAndDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
32
|
export declare const config: SignInFlowConfig;
|