/** * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import { FC } from 'react'; import { SignUpProps as SignUpV1Props } from './v1/SignUp'; import { SignUpProps as SignUpV2Props } from './v2/SignUp'; /** * Props for the SignUp component. * Extends SignUpV1Props & SignUpV2Props for full compatibility with both React SignUp components. */ export type SignUpProps = SignUpV1Props | SignUpV2Props; /** * A styled SignUp component that provides embedded sign-up flow with pre-built styling. * This component routes to the appropriate version-specific implementation based on the platform. * * @example * // Default UI * ```tsx * import { SignUp } from '@asgardeo/react'; * * const App = () => { * return ( * { * console.log('Sign-up successful:', response); * // Handle successful sign-up (e.g., redirect, show confirmation) * }} * onError={(error) => { * console.error('Sign-up failed:', error); * }} * onComplete={(redirectUrl) => { * // Platform-specific redirect handling (e.g., Next.js router.push) * router.push(redirectUrl); // or window.location.href = redirectUrl * }} * size="medium" * variant="outlined" * afterSignUpUrl="/welcome" * /> * ); * }; * ``` * * @example * // Custom UI with render props * ```tsx * import { SignUp } from '@asgardeo/react'; * * const App = () => { * return ( * console.error('Error:', error)} * onComplete={(response) => console.log('Success:', response)} * > * {({values, errors, handleInputChange, handleSubmit, isLoading, components}) => ( *
*

Custom Sign Up

* {isLoading ? ( *

Loading...

* ) : ( *
{ * e.preventDefault(); * handleSubmit(components[0], values); * }}> * handleInputChange('username', e.target.value)} * /> * {errors.username && {errors.username}} * *
* )} *
* )} *
* ); * }; * ``` */ declare const SignUp: FC; export default SignUp; //# sourceMappingURL=SignUp.d.ts.map