UNPKG

@sikka/hawa

Version:

Modern UI Kit made with Tailwind

292 lines (279 loc) • 10.4 kB
import * as React from 'react'; import React__default, { FC } from 'react'; import { a as ThirdPartyAuthTextsTypes, P as PositionType, L as LoginFormTextsTypes, D as DirectionType, b as RegisterFormTextsTypes, N as NewPasswordTextsTypes, c as ResetPasswordTextsTypes } from '../../textTypes-DXLtO2fL.js'; type AuthButtonsType = { texts?: ThirdPartyAuthTextsTypes; viaMetamask?: boolean; viaNafath?: boolean; viaGoogle?: boolean; viaTwitter?: boolean; viaGithub?: boolean; viaMicrosoft?: boolean; viaEmail?: boolean; viaPhone?: boolean; viaApple?: boolean; isMetamaskLoading?: boolean; isNafathLoading?: boolean; isGoogleLoading?: boolean; isGithubLoading?: boolean; isTwitterLoading?: boolean; isMicrosoftLoading?: boolean; isEmailLoading?: boolean; isPhoneLoading?: boolean; isAppleLoading?: boolean; handleMetamask?: () => void; handleNafath?: () => void; handleGoogle?: () => void; handleTwitter?: () => void; handleApple?: () => void; handleMicrosoft?: () => void; handleGithub?: () => void; handleEmail?: () => void; handlePhone?: () => void; }; declare const AuthButtons: React__default.FC<AuthButtonsType>; type LabelProps = { hint?: React.ReactNode; hintSide?: PositionType; htmlFor?: string; required?: boolean; }; type PhoneInputProps = { preferredCountry?: { label: string; }; helperText?: any; label?: string; labelProps?: LabelProps; placeholder?: string; handleChange?: (value: string) => void; inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>; countryCodes?: { label: string; }[]; }; type LoginFormTypes = { /** Object containing text labels used throughout the form. */ texts?: LoginFormTextsTypes; /** If true, only logos are displayed in third-party auth buttons.*/ logosOnly?: boolean; /** Direction of text and UI elements, either left-to-right or right-to-left. */ direction?: DirectionType; /** If true, an error alert is displayed at the top of the form. */ showError?: boolean; /** Callback function triggered when the error alert is dismissed. */ onErrorDismissed?: () => void; /** Title text of error alert.*/ errorTitle?: string; /** Description text of error alert. */ errorText?: string; /** Login identifier type user will use to log in. */ loginType?: "email" | "username" | "phone" | "link"; /** If true, the reset password option is hidden. */ withResetPassword?: boolean; /** If true, the register option is hidden. */ allowRegister?: boolean; /** If true, a loading spinner is displayed within the main form submit button. */ isLoading?: boolean; /** If true, a loading spinner is displayed within the Google login button. */ isGoogleLoading?: boolean; /** If true, a loading spinner is displayed within the Twitter login button. */ isTwitterLoading?: boolean; /** If true, a loading spinner is displayed within the Github login button. */ isGithubLoading?: boolean; /** If true, Google login option is displayed. */ viaGoogle?: boolean; /** If true, Github login option is displayed. */ viaGithub?: boolean; /** If true, Twitter login option is displayed. */ viaTwitter?: boolean; /** Function to handle form submission. */ onLogin: (e: any) => void; /** Function to route user to the register page. */ onRouteToRegister?: () => void; /** Function to handle forgotten password case. */ onForgotPassword?: () => void; /** Function to handle Google login. */ onGoogleLogin?: () => void; /** Function to handle Github login. */ onGithubLogin?: () => void; /** Function to handle Twitter login. */ onTwitterLogin?: () => void; /** Additional buttons to add under the login button */ additionalButtons?: any; /** The minimum length of the password input field */ minPasswordLength?: number; /** If true, the form is displayed without a card container styling.*/ cardless?: boolean; /** Props to pass to the PhoneInput component */ phoneInputProps?: PhoneInputProps; }; declare const LoginForm: FC<LoginFormTypes>; type SelectOptionProps = { value: any; label: any; }; type RegisterFormTypes = { /** Object containing text labels used throughout the form. */ texts?: RegisterFormTextsTypes; /** Direction of text and layout, either 'rtl' (right-to-left) or 'ltr' (left-to-right). */ direction?: DirectionType; /** Determines whether to display logos only or with text in the social media registration section. */ logosOnly?: boolean; /** Enables registration via Google when set to true. */ viaGoogle?: boolean; /** Enables registration via Github when set to true. */ viaGithub?: boolean; /** Enables registration via Twitter when set to true. */ viaTwitter?: boolean; /** Determines whether to show the referral code field. */ showRefCode?: boolean; /** Determines whether to show the user source selection. */ showUserSource?: boolean; /** Determines whether to show the terms acceptance checkbox. */ showTermsOption?: boolean; /** Determines whether to show the newsletter subscription checkbox. */ showNewsletterOption?: boolean; /** Callback function triggered on form submission. */ onRegister: (e: any) => void; /** Callback function triggered to route to the login page. */ onRouteToLogin?: () => void; /** Callback function triggered to handle registration via Google. */ onGoogleRegister?: () => void; /** Callback function triggered to handle registration via Github. */ onGithubRegister?: () => void; /** Callback function triggered to handle registration via Twitter. */ onTwitterRegister?: () => void; /** Callback function triggered to route to the Terms of Service page. */ onRouteToTOS?: () => void; /** Determines whether to show an error alert. */ showError?: boolean; /** Callback function triggered when the error alert is dismissed. */ onErrorDismissed?: () => void; /** Title for the error alert. */ errorTitle?: any; /** Text for the error alert. */ errorText?: any; /** Array containing the fields to be included in the form. */ registerFields?: string[]; /** Indicates whether the form submission is in progress. */ isLoading?: boolean; /** If true, a loading spinner is displayed within the Google login button. */ isGoogleLoading?: boolean; /** If true, a loading spinner is displayed within the Twitter login button. */ isTwitterLoading?: boolean; /** If true, a loading spinner is displayed within the Github login button. */ isGithubLoading?: boolean; /** The options of "How did you learn about us?" select field. */ userReferenceOptions?: SelectOptionProps[]; /** To add more custom buttons under the register button. */ additionalButtons?: any; /** To add more custom input fields */ additionalInputs?: any; /** To customize the username input field */ usernameOptions?: { label?: LabelProps; }; classNames?: { root?: string; form?: string; card?: string; }; /** The minimum length of the password input field */ minPasswordLength?: number; /** If true, the form is displayed without a card container styling.*/ cardless?: boolean; }; declare const RegisterForm: FC<RegisterFormTypes>; type AppLandingTextsTypes = ThirdPartyAuthTextsTypes & { newUserText?: string; createAccount?: string; }; type AppLandingTypes = { texts?: AppLandingTextsTypes; viaGoogle?: boolean; viaTwitter?: boolean; viaGithub?: boolean; viaMicrosoft?: boolean; viaEmail?: boolean; viaPhone?: boolean; viaApple?: boolean; allowRegister?: boolean; size?: "small" | "normal" | "full"; direction?: DirectionType; handleRouteToRegister?: () => void; handleGoogle?: () => void; handleTwitter?: () => void; handleApple?: () => void; handleMicrosoft?: () => void; handleGithub?: () => void; handleEmail?: () => void; handlePhone?: () => void; }; declare const AppLanding: FC<AppLandingTypes>; type CheckEmailBlocks = { handleResend?: () => void; texts?: { checkEmail: string; resendEmail: string; pleaseVerify: string; }; }; declare const CheckEmail: FC<CheckEmailBlocks>; type NewPasswordTypes = { handleNewPassword: (e: any) => void; handleRouteToRegister: () => void; isLoading: boolean; direction?: DirectionType; allowRegister?: boolean; showSuccess: boolean; texts: NewPasswordTextsTypes; /** If true, an error alert is displayed at the top of the form. */ showError?: boolean; /** Title text of error alert. */ errorTitle?: string; /** Description text of error alert. */ errorText?: string; }; declare const NewPasswordForm: FC<NewPasswordTypes>; type ResetPasswordType = { handleResetPassword: (e: any) => void; handleRouteToRegister: () => void; sent: any; isLoading: boolean; headless?: boolean; allowRegister?: boolean; direction?: DirectionType; texts?: ResetPasswordTextsTypes; /** If true, an error alert is displayed at the top of the form. */ showError?: boolean; /** Title text of error alert. */ errorTitle?: string; /** Description text of error alert. */ errorText?: string; }; declare const ResetPasswordForm: FC<ResetPasswordType>; type TConfirmation = { texts?: { checkYourPhone?: string; weSentCode?: string; didntGetCode?: string; resendCode?: string; resendCodeTimer?: string; codeRequiredText?: string; codeTooShort?: string; confirm?: string; cancel?: string; seconds?: string; }; showError?: any; errorTitle?: any; errorText?: any; phoneNumber?: string; confirmLoading?: boolean; handleConfirm?: any; handleResend?: any; codeLength?: number; }; declare const CodeConfirmation: FC<TConfirmation>; export { AppLanding, AuthButtons, CheckEmail, CodeConfirmation, LoginForm, NewPasswordForm, RegisterForm, ResetPasswordForm };