@cuemath/leap 3.1.14 → 3.1.15
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.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"identifier-otp-form.js","sources":["../../../../../src/features/auth/login/identifier-otp-form/identifier-otp-form.tsx"],"sourcesContent":["import type { IIdentifierOtpFormProps } from './identifier-otp-form-types';\n\nimport React, { type ChangeEvent, memo, useCallback } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\nimport ResendOTP from '../../comps/resend-otp/resend-otp';\nimport * as Styled from './identifier-otp-form-styled';\n\nconst IdentifierOtpForm: React.FC<IIdentifierOtpFormProps> = ({\n identifier,\n otp,\n errors,\n isOtpVerified,\n isLoading,\n isSubmitDisabled,\n showOtpInput,\n isAuthRedirecting,\n onChange,\n onSubmit,\n onSendOtp,\n}) => {\n const otpStatusVariant = isOtpVerified ? 'success-dark' : 'primary-dark';\n\n const handleIdentifierChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('identifier', e.target.value);\n },\n [onChange],\n );\n\n const handleOtpChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('otp', e.target.value);\n },\n [onChange],\n );\n\n return (\n <Styled.Container\n $gutterX={1.5}\n $gapX={1.5}\n $background=\"BLACK_2\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <Styled.FormWrapper onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.identifier ? 'error-dark' : 'primary-dark'}\n autoFocus\n label=\"Email or Phone\"\n value={identifier}\n onChange={handleIdentifierChange}\n required\n width=\"100%\"\n shape=\"borderLess\"\n errorMessage={errors.identifier}\n disabled={showOtpInput}\n siblingElement={<InputStatusIcon isError={!!errors.identifier} />}\n />\n {showOtpInput && (\n <>\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.otp ? 'error-dark' : otpStatusVariant}\n label=\"Verification code\"\n value={otp}\n onChange={handleOtpChange}\n width=\"100%\"\n required\n autoFocus\n shape=\"borderLess\"\n errorMessage={errors.otp}\n disabled={isOtpVerified || (otp.length === 4 && isLoading)}\n siblingElement={\n <InputStatusIcon\n isLoading={isLoading}\n isValid={isOtpVerified}\n isError={!!errors.otp}\n />\n }\n />\n <Separator heightX={1.25} />\n <FlexView $alignItems=\"flex-end\" $width=\"100%\">\n <ResendOTP onResendOTP={onSendOtp} disabled={isOtpVerified} />\n </FlexView>\n <Separator heightX={2} />\n </>\n )}\n </FlexView>\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label={showOtpInput ? 'Log In' : 'Get Verification Code'}\n width=\"100%\"\n busy={showOtpInput ? isAuthRedirecting : isLoading}\n disabled={isSubmitDisabled}\n />\n </Styled.FormWrapper>\n </Styled.Container>\n );\n};\n\nexport default memo(IdentifierOtpForm);\n"],"names":["IdentifierOtpForm","identifier","otp","errors","isOtpVerified","isLoading","isSubmitDisabled","showOtpInput","isAuthRedirecting","onChange","onSubmit","onSendOtp","otpStatusVariant","handleIdentifierChange","useCallback","e","handleOtpChange","jsx","Styled.Container","jsxs","Styled.FormWrapper","FlexView","TextInput","InputStatusIcon","Fragment","Separator","ResendOTP","Button","identifierOtpForm","memo"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAuD,CAAC;AAAA,EAC5D,YAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,mBAAAC;AAAA,
|
1
|
+
{"version":3,"file":"identifier-otp-form.js","sources":["../../../../../src/features/auth/login/identifier-otp-form/identifier-otp-form.tsx"],"sourcesContent":["import type { IIdentifierOtpFormProps } from './identifier-otp-form-types';\n\nimport React, { type ChangeEvent, memo, useCallback } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\nimport ResendOTP from '../../comps/resend-otp/resend-otp';\nimport * as Styled from './identifier-otp-form-styled';\n\nconst IdentifierOtpForm: React.FC<IIdentifierOtpFormProps> = ({\n identifier,\n otp,\n errors,\n isOtpVerified,\n isLoading,\n isSubmitDisabled,\n showOtpInput,\n isAuthRedirecting = false,\n onChange,\n onSubmit,\n onSendOtp,\n}) => {\n const otpStatusVariant = isOtpVerified ? 'success-dark' : 'primary-dark';\n\n const handleIdentifierChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('identifier', e.target.value);\n },\n [onChange],\n );\n\n const handleOtpChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('otp', e.target.value);\n },\n [onChange],\n );\n\n return (\n <Styled.Container\n $gutterX={1.5}\n $gapX={1.5}\n $background=\"BLACK_2\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <Styled.FormWrapper onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.identifier ? 'error-dark' : 'primary-dark'}\n autoFocus\n label=\"Email or Phone\"\n value={identifier}\n onChange={handleIdentifierChange}\n required\n width=\"100%\"\n shape=\"borderLess\"\n errorMessage={errors.identifier}\n disabled={showOtpInput}\n siblingElement={<InputStatusIcon isError={!!errors.identifier} />}\n />\n {showOtpInput && (\n <>\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.otp ? 'error-dark' : otpStatusVariant}\n label=\"Verification code\"\n value={otp}\n onChange={handleOtpChange}\n width=\"100%\"\n required\n autoFocus\n shape=\"borderLess\"\n errorMessage={errors.otp}\n disabled={isOtpVerified || (otp.length === 4 && isLoading)}\n siblingElement={\n <InputStatusIcon\n isLoading={isLoading}\n isValid={isOtpVerified}\n isError={!!errors.otp}\n />\n }\n />\n <Separator heightX={1.25} />\n <FlexView $alignItems=\"flex-end\" $width=\"100%\">\n <ResendOTP onResendOTP={onSendOtp} disabled={isOtpVerified} />\n </FlexView>\n <Separator heightX={2} />\n </>\n )}\n </FlexView>\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label={showOtpInput ? 'Log In' : 'Get Verification Code'}\n width=\"100%\"\n busy={showOtpInput ? isAuthRedirecting : isLoading}\n disabled={isSubmitDisabled}\n />\n </Styled.FormWrapper>\n </Styled.Container>\n );\n};\n\nexport default memo(IdentifierOtpForm);\n"],"names":["IdentifierOtpForm","identifier","otp","errors","isOtpVerified","isLoading","isSubmitDisabled","showOtpInput","isAuthRedirecting","onChange","onSubmit","onSendOtp","otpStatusVariant","handleIdentifierChange","useCallback","e","handleOtpChange","jsx","Styled.Container","jsxs","Styled.FormWrapper","FlexView","TextInput","InputStatusIcon","Fragment","Separator","ResendOTP","Button","identifierOtpForm","memo"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAuD,CAAC;AAAA,EAC5D,YAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,mBAAAC,IAAoB;AAAA,EACpB,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,MAAM;AACE,QAAAC,IAAmBR,IAAgB,iBAAiB,gBAEpDS,IAAyBC;AAAA,IAC7B,CAACC,MAAqC;AAC3B,MAAAN,EAAA,cAAcM,EAAE,OAAO,KAAK;AAAA,IACvC;AAAA,IACA,CAACN,CAAQ;AAAA,EAAA,GAGLO,IAAkBF;AAAA,IACtB,CAACC,MAAqC;AAC3B,MAAAN,EAAA,OAAOM,EAAE,OAAO,K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AA,kBAAA;AAAA,gBACpB;AAAA,cAAA;AAAA,YAEJ;AAAA,YACA,gBAAAc,EAACQ,GAAU,EAAA,SAAS,KAAM,CAAA;AAAA,YACzB,gBAAAR,EAAAI,GAAA,EAAS,aAAY,YAAW,QAAO,QACtC,UAAC,gBAAAJ,EAAAS,GAAA,EAAU,aAAaf,GAAW,UAAUP,EAAe,CAAA,GAC9D;AAAA,YACA,gBAAAa,EAACQ,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,UAAA,GACzB;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAR;AAAA,UAACU;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAS;AAAA,YACT,MAAK;AAAA,YACL,OAAOpB,IAAe,WAAW;AAAA,YACjC,OAAM;AAAA,YACN,MAAMA,IAAeC,IAAoBH;AAAA,YACzC,UAAUC;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEesB,IAAAC,EAAK7B,CAAiB;"}
|
package/dist/index.d.ts
CHANGED
@@ -1531,7 +1531,7 @@ declare interface IIdentifierOtpFormProps {
|
|
1531
1531
|
isOtpVerified: boolean;
|
1532
1532
|
isLoading: boolean;
|
1533
1533
|
isSubmitDisabled: boolean;
|
1534
|
-
isAuthRedirecting
|
1534
|
+
isAuthRedirecting?: boolean;
|
1535
1535
|
showOtpInput: boolean;
|
1536
1536
|
onChange: (key: 'identifier' | 'otp', value: string) => void;
|
1537
1537
|
onSubmit: (e: FormEvent<HTMLFormElement>) => void;
|