3.0.2 • Published 8 months ago

@licuido-ui/ui_login v3.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Login

The Login component is a reusable React component designed to provide a login interface with various login options. It offers three login options: 'emailWithPasswordLogin', socialMediaLogin', 'mobileNumberLogin','metanasSigninup' and 'metanasResetpassword'.

Author

Link

Story Book Link ErrorPage

PlayGround

Try it have a fun codeBox

Author

Link

Story Book Link Login

PlayGround

Try it have a fun codeBox

Installation

npm i @licuido-ui/ui_login

Import component

import { Login } from '@licuido-ui/ui_login';

Usage

<Login
  variant='mobileNumberLogin'
  mainArea={{
    layout: {
      breakpoints: { xs: 12, md: 12, sm: 12, lg: 12 },
    },
  }}
  onSubmit={() => {
    console.log('submit');
  }}
  alt='logo'
  logoSrc={<Logo />}
  logoHeight='100%'
  logoWidth='100%'
  rootStyle={{}}
  title='Welcome!'
  description='One positive feedback per day or week can make us grow exponentially'
  titleStyle={{}}
  buttonText='Login'
  actionText="Don't have an account?"
  actionLink='Sign in'
  cardStyle={{ p: 3 }}
  onSignUpClick={() => {
    console.log('signup');
  }}
  actionStyle={{ fontSize: { xs: '12px', md: '14px', sm: '14px', lg: '14px' } }}
  actionLinkStyle={{ fontSize: { xs: '12px', md: '14px', sm: '14px', lg: '14px' } }}
  btnStyle={{}}
  mobileLabelText='Mobile Number'
  labelStyle={{}}
  mobileFieldstyle={{}}
  dropDownStyle={{}}
  numberFontSize=''
  countryCodeFontWeight=''
  contryCodefontSize=''
  divider={true}
  dividerTextStyle={{}}
  dividerStyle={{}}
  dividerText='or'
  workMailInputVariant='outlined'
  workMailLabelStyle={{}}
  workMailLabel='Work Email'
  workMailInput={true}
  footerText='Forgot Password?'
  onForgotClick={() => {
    console.log('forgot');
  }}
  footerStyle={{}}
  socialMediaList={[
    {
      label: 'SignUp with google',
      icon: <Google />,
      onSocialmediaLogin: () => {
        console.log('SignUp with google');
      },
      style: {
        textAlign: 'center',
        width: '100%',
        color: '#3B3B3B',
        fontSize: '14px',
      },
      // SocialMediaButtonStyle: { p: 1 },
    },
  ]}
  loginFieldStyle={{}}
  emailInputvariant='outlined'
  emailLabelStyle={{}}
  emailLabel='Email'
  passwordLabelStyle={{}}
  passwordLabel='Password'
  pwdInputVariant='outlined'
  invisibleIcon={<VisibilityOffOutlinedIcon />}
  visbleIcon={<VisibilityOutlinedIcon />}
  pwdFieldstyle={{}}
  variantContainerSx={{}}
  cardHeight='auto'
  cardWidth='400px'
  cardBoxShadow='0px 8px 20px #0000000A'
  cardBgColor=''
  openDialog={false}
  dialogTitle=''
  maxWidth='xs'
  dialogTitleStyle={}
  dialogSectionStyle={}
  dialogContent={<></>}
  handleAgreeClick={() => {
    console.log('agree');
  }}
  dialogButtonText=''
  handleDialogClose={() => {
    console.log('close');
  }}
  agreeButtonStyle={}
  bodyTextStyle={}
  dialogButtonVariant='outlined'
  handleOpenDialog={() => {
    console.log('open');
  }}
  handleCheckbox={() => {
    console.log('active');
  }}
  checkedValue={false}
  checkboxText=''
/>

Image

login img

Props

Prop NameTypeDefault ValueDescription
loginIdstring'login'Unique ID for the component.
classNamestring''CSS class name for the component.
sxSxProps<Theme>{}Styling props using MUI's sx prop.
onSubmit(details: object) => void() => undefinedFunction to handle form submission.
variant'emailWithPasswordLogin' or 'socialMediaLogin'or 'mobileNumberLogin'or'metanasResetpassword' or'metanasSigninup''emailWithPasswordLogin' or 'socialMediaLogin'or 'mobileNumberLogin' or'metanasSigninup' 0r 'metanasResetpassword'Type of login variant.
rootStyleSxProps{}Styling props for the root component.
imageSectionobjectSee belowConfiguration for the image section.
mainAreaobjectSee belowConfiguration for the main area.
altstring'Logo'Alt text for the logo image.
logoSrcstring \| ReactNode''Source URL or ReactNode for the logo image.
logoHeightstring \| number'auto'Height of the logo image.
logoWidthstring \| number'10px'Width of the logo image.
logoStyleSxProps{}Styling props for the logo image.
titlestring \| any'Login'Title or JSX element for the card.
descriptionstring \| any''Description or JSX element for the card.
actionTextstring"Don't have an account?"Text for the action link or button.
buttonTextstring'Login'Text for the login button.
actionLinkstring'Sign Up'URL for the action link.
onSignUpClick() => void() => undefinedFunction to handle sign-up link click.
titleStyleCSSProperties{}Inline styles for the title.
btnStyleSxProps{}Styling props for the login button.
cardStyleSxProps{}Styling props for the card component.
actionStyleSxProps{}Styling props for the action link.
actionLinkStyleSxProps{}Styling props for the action link.
mobileLabelTextstring'Mobile Number'Label text for the mobile number input.
labelStyleSxProps{}Styling props for labels.
mobileFieldstyleSxProps{}Styling props for the mobile number input field.
dropDownStyleSxProps{}Styling props for the dropdown in mobile input.
contryCodefontSizestring \| number'16px'Font size for the country code.
countryCodeFontWeightstring \| number'bold'Font weight for the country code.
numberFontSizestring \| number'16px'Font size for the mobile number input.
dividerStyleSxProps{}Styling props for the divider.
dividerTextstring'OR'Text for the divider.
dividerTextStyleSxProps{}Styling props for the divider text.
dividertrue \| falsetrueWhether to show a divider.
workMailInputtrue \| falsetrueWhether to show the email input.
workMailLabelstring'Email'Label for the email input.
workMailLabelStyleSxProps{}Styling props for the email input label.
footerStyleSxProps{}Styling props for the "Forgot password?" text.
onForgotClick() => any() => undefinedFunction to handle "Forgot password?" click.
footerTextstring'Forgot password?'Text for the "Forgot password?" link.
workMailInputVariant'outlined' \| 'standard' \| 'filled''outlined'Variant for the email input.
loginFieldStyleSxProps{}Styling props for login input fields.
socialMediaListArray[]List of social media buttons.
emailInputvariant'outlined' \| 'standard' \| 'filled''outlined'Variant for the email input.
emailLabelStyleSxProps{}Styling props for the email input label.
emailLabelstring'Email'Label for the email input.
passwordLabelStyleSxProps{}Styling props for the password input label.
passwordLabelstring'Password'Label for the password input.
pwdInputVariant'outlined' \| 'standard' \| 'filled''outlined'Variant for the password input.
invisibleIconReactNode<VisibilityOffOutlinedIcon />Icon for the password visibility toggle (invisible).
visbleIconReactNode<VisibilityOutlinedIcon />Icon for the password visibility toggle (visible).
pwdFieldstyleSxProps{}Styling props for the password input field.
variantContainerSxSxProps{}Styling props for the variant container.
cardWidthnumber \| string'auto'Width of the card.
cardHeightnumber \| string'auto'Height of the card.
cardBgColorstring'white'Background color of the card.
cardBoxShadowstring'0px 4px 4px rgba(0, 0, 0, 0.25)'Box shadow for the card.
conFirmPasswordStylesxPropssxPropssxProp
conFirmPasswordLabelstringstringstring
metanasPasswordTestRegexstringstringstring
disableDefaultValidationbooleanbooleanboolean
newPasswordOnChange()=>{}()=>{}()=>{}
confirmPasswordOnChange()=>{}()=>{}()=>{}
passwordVisbleIconReactNodeReactNodeReactNode
passwordInVisbleIconReactNodeReactNodeReactNode
confirmPasswordVisbleIconReactNodeReactNodeReactNode
confirmPasswordInVisbleIconReactNodeReactNodeReactNode
newPasswordErrorMsgstringstringstring
confirmPasswordErrorMsgstringstringstring
errorEmailMsgstringstringEnter valid email
errorPasswordMsgstringstringEnter valid password
handleCheckbox() => voidFunction to handle checkbox change in the component
checkboxTextstringText for the checkbox in the component
checkedValuebooleanValue of the checkbox
Prop NameTypeDefault ValueDescription
----------------------------------------------------------------------------------------------------------------------------------------------------
loginIdstring'login'Unique ID for the component.
classNamestring''CSS class name for the component.
sxSxProps<Theme>{}Styling props using MUI's sx prop.
onSubmit(details: object) => void() => undefinedFunction to handle form submission.
variant'emailWithPasswordLogin' or 'socialMediaLogin'or 'mobileNumberLogin'or'metanasResetpassword' or'metanasSigninup''emailWithPasswordLogin' or 'socialMediaLogin'or 'mobileNumberLogin' or'metanasSigninup' 0r 'metanasResetpassword'Type of login variant.
rootStyleSxProps{}Styling props for the root component.
imageSectionobjectSee belowConfiguration for the image section.
mainAreaobjectSee belowConfiguration for the main area.
altstring'Logo'Alt text for the logo image.
logoSrcstring \| ReactNode''Source URL or ReactNode for the logo image.
logoHeightstring \| number'auto'Height of the logo image.
logoWidthstring \| number'10px'Width of the logo image.
logoStyleSxProps{}Styling props for the logo image.
titlestring \| any'Login'Title or JSX element for the card.
descriptionstring \| any''Description or JSX element for the card.
actionTextstring"Don't have an account?"Text for the action link or button.
buttonTextstring'Login'Text for the login button.
actionLinkstring'Sign Up'URL for the action link.
onSignUpClick() => void() => undefinedFunction to handle sign-up link click.
titleStyleCSSProperties{}Inline styles for the title.
btnStyleSxProps{}Styling props for the login button.
cardStyleSxProps{}Styling props for the card component.
actionStyleSxProps{}Styling props for the action link.
actionLinkStyleSxProps{}Styling props for the action link.
mobileLabelTextstring'Mobile Number'Label text for the mobile number input.
labelStyleSxProps{}Styling props for labels.
mobileFieldstyleSxProps{}Styling props for the mobile number input field.
dropDownStyleSxProps{}Styling props for the dropdown in mobile input.
contryCodefontSizestring \| number'16px'Font size for the country code.
countryCodeFontWeightstring \| number'bold'Font weight for the country code.
numberFontSizestring \| number'16px'Font size for the mobile number input.
dividerStyleSxProps{}Styling props for the divider.
dividerTextstring'OR'Text for the divider.
dividerTextStyleSxProps{}Styling props for the divider text.
dividertrue \| falsetrueWhether to show a divider.
workMailInputtrue \| falsetrueWhether to show the email input.
workMailLabelstring'Email'Label for the email input.
workMailLabelStyleSxProps{}Styling props for the email input label.
footerStyleSxProps{}Styling props for the "Forgot password?" text.
onForgotClick() => any() => undefinedFunction to handle "Forgot password?" click.
footerTextstring'Forgot password?'Text for the "Forgot password?" link.
workMailInputVariant'outlined' \| 'standard' \| 'filled''outlined'Variant for the email input.
loginFieldStyleSxProps{}Styling props for login input fields.
socialMediaListArray[]List of social media buttons.
emailInputvariant'outlined' \| 'standard' \| 'filled''outlined'Variant for the email input.
emailLabelStyleSxProps{}Styling props for the email input label.
emailLabelstring'Email'Label for the email input.
passwordLabelStyleSxProps{}Styling props for the password input label.
passwordLabelstring'Password'Label for the password input.
pwdInputVariant'outlined' \| 'standard' \| 'filled''outlined'Variant for the password input.
invisibleIconReactNode<VisibilityOffOutlinedIcon />Icon for the password visibility toggle (invisible).
visbleIconReactNode<VisibilityOutlinedIcon />Icon for the password visibility toggle (visible).
pwdFieldstyleSxProps{}Styling props for the password input field.
variantContainerSxSxProps{}Styling props for the variant container.
cardWidthnumber \| string'auto'Width of the card.
cardHeightnumber \| string'auto'Height of the card.
cardBgColorstring'white'Background color of the card.
cardBoxShadowstring'0px 4px 4px rgba(0, 0, 0, 0.25)'Box shadow for the card.
conFirmPasswordStylesxPropssxPropssxProp
conFirmPasswordLabelstringstringstring
metanasPasswordTestRegexstringstringstring
disableDefaultValidationbooleanbooleanboolean
newPasswordOnChange()=>{}()=>{}()=>{}
confirmPasswordOnChange()=>{}()=>{}()=>{}
passwordVisbleIconReactNodeReactNodeReactNode
passwordInVisbleIconReactNodeReactNodeReactNode
confirmPasswordVisbleIconReactNodeReactNodeReactNode
confirmPasswordInVisbleIconReactNodeReactNodeReactNode
newPasswordErrorMsgstringstringstring
confirmPasswordErrorMsgstringstringstring
errorEmailMsgstringstringEnter valid email
errorPasswordMsgstringstringEnter valid password
buttonEndIconReactNodeReactNodeReactNode
buttonEndIconStyleSxPropsSxPropsSxProps
errorStyleSxPropsSxPropsSxProps
passwordOnChange()=>{}()=>{}()=>{}
emailOnChange()=>{}()=>{}()=>{}
  1. imagesection contains ,
PropTypeDefault ValueDescription
backgroundWrapStyleobject{}Styling props for the background wrap of the image section.
srcstring''Image source URL.
styleCSSProperties{}Inline styles for the image section.
heightstring''Height of the image section.
widthstring''Width of the image section.
componentReact.ReactNode<>Custom React component for the image section.
layoutobjectbreakpoints:{xs: 0, md: 0, sm: 0, lg: 0}Layout breakpoints for responsiveness.
  1. mainArea contains ,
PropTypeDefault ValueDescription
layoutobjectbreakpoints:{ xs: 12, md: 12, sm: 12, lg: 12 }Layout breakpoints for responsiveness.
WraperStyleobject{}Styling props for the main area wrapper.
cardParentStyleobject{}Additional styling props for the card parent.
  1. Dialog section
PropTypeDescription
openDialogbooleanOpen/close state of the dialog
dialogTitlestringTitle of the dialog
maxWidthstringMaximum width of the dialog
dialogTitleStyleSxPropsStyling props for the dialog title
dialogSectionStyleSxPropsStyling props for the dialog section
agreeButtonStyleSxPropsStyling props for the agree button in the dialog
bodyTextStyleSxPropsStyling props for the body text in the dialog
dialogContentReactNodeContent of the dialog
dialogButtonTextstringText for the button in the dialog
dialogButtonVariant'text' | 'outlined' | 'contained' | undefinedVariant for the button in the dialog
handleAgreeClick() => voidFunction to handle agree button click in the dialog
handleDialogClose() => voidFunction to handle dialog close
handleOpenDialog() => voidFunction to handle dialog open