@cuemath/leap 3.0.11-j3 → 3.0.11-j4
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/features/auth/comps/resend-otp/resend-otp.js +44 -30
- package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
- package/dist/features/auth/forgot-password/otp-form/otp-form.js +31 -38
- package/dist/features/auth/forgot-password/otp-form/otp-form.js.map +1 -1
- package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js +33 -34
- package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js.map +1 -1
- package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js +6 -6
- package/dist/index.d.ts +3 -2
- package/package.json +1 -1
@@ -1,51 +1,65 @@
|
|
1
|
-
import { jsx as r, jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
|
1
|
+
import { jsx as r, jsxs as n, Fragment as _ } from "react/jsx-runtime";
|
2
|
+
import { memo as x, useCallback as a } from "react";
|
3
|
+
import k from "../../../ui/buttons/button/button.js";
|
4
|
+
import u from "../../../ui/buttons/text-button/text-button.js";
|
5
|
+
import i from "../../../ui/layout/flex-view.js";
|
6
|
+
import c from "../../../ui/text/text.js";
|
7
|
+
import { useResendTimer as C } from "./hooks/use-resend-timer.js";
|
8
|
+
const I = ({
|
8
9
|
onResendOTP: e,
|
9
10
|
onResendVoiceOTP: l,
|
10
|
-
timerSeconds:
|
11
|
-
showVoiceOTP:
|
12
|
-
disabled:
|
11
|
+
timerSeconds: f = 15,
|
12
|
+
showVoiceOTP: $ = !1,
|
13
|
+
disabled: m,
|
14
|
+
renderAs: h = "submit",
|
15
|
+
width: b
|
13
16
|
}) => {
|
14
|
-
const { canResend:
|
15
|
-
initialSeconds:
|
16
|
-
}),
|
17
|
-
e == null || e(),
|
18
|
-
}, [e,
|
19
|
-
l == null || l(),
|
20
|
-
}, [l,
|
21
|
-
return
|
17
|
+
const { canResend: o, resetTimer: t, timeLeft: s } = C({
|
18
|
+
initialSeconds: f
|
19
|
+
}), d = a(() => {
|
20
|
+
e == null || e(), t();
|
21
|
+
}, [e, t]), p = a(() => {
|
22
|
+
l == null || l(), t();
|
23
|
+
}, [l, t]);
|
24
|
+
return h === "submit" ? /* @__PURE__ */ r(
|
25
|
+
k,
|
26
|
+
{
|
27
|
+
size: "small",
|
28
|
+
renderAs: "secondary-dark",
|
29
|
+
type: "submit",
|
30
|
+
label: o ? "Resend" : `Resend in ${s}`,
|
31
|
+
width: b,
|
32
|
+
onClick: d,
|
33
|
+
disabled: !o || m
|
34
|
+
}
|
35
|
+
) : /* @__PURE__ */ r(i, { children: o ? /* @__PURE__ */ n(i, { $flexDirection: "row", $alignItems: "center", $flexColumnGapX: 0.5, children: [
|
22
36
|
/* @__PURE__ */ r(
|
23
|
-
|
37
|
+
u,
|
24
38
|
{
|
25
|
-
disabled:
|
39
|
+
disabled: m,
|
26
40
|
label: "Resend",
|
27
41
|
color: "WHITE_T_60",
|
28
|
-
onClick:
|
42
|
+
onClick: d
|
29
43
|
}
|
30
44
|
),
|
31
|
-
|
32
|
-
/* @__PURE__ */ r(
|
33
|
-
/* @__PURE__ */ r(
|
34
|
-
|
45
|
+
$ && /* @__PURE__ */ n(_, { children: [
|
46
|
+
/* @__PURE__ */ r(c, { $renderAs: "ub2", $color: "WHITE_T_60", children: "or" }),
|
47
|
+
/* @__PURE__ */ r(i, { $width: 116, children: /* @__PURE__ */ r(
|
48
|
+
u,
|
35
49
|
{
|
36
50
|
label: "Get code via call",
|
37
51
|
color: "WHITE_T_60",
|
38
|
-
onClick:
|
52
|
+
onClick: p
|
39
53
|
}
|
40
54
|
) })
|
41
55
|
] })
|
42
|
-
] }) : /* @__PURE__ */ r(
|
56
|
+
] }) : /* @__PURE__ */ r(i, { $width: 105, children: /* @__PURE__ */ n(c, { $renderAs: "ub2", $color: "WHITE_T_60", children: [
|
43
57
|
"Resend in",
|
44
58
|
" ",
|
45
|
-
/* @__PURE__ */ r(
|
59
|
+
/* @__PURE__ */ r(c, { $renderAs: "ub2-bold", $inline: !0, $color: "WHITE_T_60", children: s })
|
46
60
|
] }) }) });
|
47
|
-
},
|
61
|
+
}, j = x(I);
|
48
62
|
export {
|
49
|
-
|
63
|
+
j as default
|
50
64
|
};
|
51
65
|
//# sourceMappingURL=resend-otp.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resend-otp.js","sources":["../../../../../src/features/auth/comps/resend-otp/resend-otp.tsx"],"sourcesContent":["import type { IOTPResendProps } from './resend-otp-types';\n\nimport { useCallback, memo } from 'react';\n\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { useResendTimer } from './hooks/use-resend-timer';\n\nconst ResendOTP: React.FC<IOTPResendProps> = ({\n onResendOTP,\n onResendVoiceOTP,\n timerSeconds = 15,\n showVoiceOTP = false,\n disabled,\n}) => {\n const { canResend, resetTimer, timeLeft } = useResendTimer({\n initialSeconds: timerSeconds,\n });\n\n const handleResendClick = useCallback(() => {\n onResendOTP?.();\n resetTimer();\n }, [onResendOTP, resetTimer]);\n\n const handleVoiceResendClick = useCallback(() => {\n onResendVoiceOTP?.();\n resetTimer();\n }, [onResendVoiceOTP, resetTimer]);\n\n return (\n <FlexView>\n {!canResend ? (\n <FlexView $width={105}>\n <Text $renderAs=\"ub2\" $color=\"WHITE_T_60\">\n Resend in{' '}\n <Text $renderAs=\"ub2-bold\" $inline $color=\"WHITE_T_60\">\n {timeLeft}\n </Text>\n </Text>\n </FlexView>\n ) : (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexColumnGapX={0.5}>\n <TextButton\n disabled={disabled}\n label=\"Resend\"\n color=\"WHITE_T_60\"\n onClick={handleResendClick}\n />\n {showVoiceOTP && (\n <>\n <Text $renderAs=\"ub2\" $color=\"WHITE_T_60\">\n or\n </Text>\n <FlexView $width={116}>\n <TextButton\n label=\"Get code via call\"\n color=\"WHITE_T_60\"\n onClick={handleVoiceResendClick}\n />\n </FlexView>\n </>\n )}\n </FlexView>\n )}\n </FlexView>\n );\n};\n\nexport default memo(ResendOTP);\n"],"names":["ResendOTP","onResendOTP","onResendVoiceOTP","timerSeconds","showVoiceOTP","disabled","canResend","resetTimer","timeLeft","useResendTimer","handleResendClick","useCallback","handleVoiceResendClick","jsx","FlexView","jsxs","TextButton","Fragment","Text","
|
1
|
+
{"version":3,"file":"resend-otp.js","sources":["../../../../../src/features/auth/comps/resend-otp/resend-otp.tsx"],"sourcesContent":["import type { IOTPResendProps } from './resend-otp-types';\n\nimport { useCallback, memo } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\nimport { useResendTimer } from './hooks/use-resend-timer';\n\nconst ResendOTP: React.FC<IOTPResendProps> = ({\n onResendOTP,\n onResendVoiceOTP,\n timerSeconds = 15,\n showVoiceOTP = false,\n disabled,\n renderAs = 'submit',\n width,\n}) => {\n const { canResend, resetTimer, timeLeft } = useResendTimer({\n initialSeconds: timerSeconds,\n });\n\n const handleResendClick = useCallback(() => {\n onResendOTP?.();\n resetTimer();\n }, [onResendOTP, resetTimer]);\n\n const handleVoiceResendClick = useCallback(() => {\n onResendVoiceOTP?.();\n resetTimer();\n }, [onResendVoiceOTP, resetTimer]);\n\n if (renderAs === 'submit') {\n return (\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label={canResend ? 'Resend' : `Resend in ${timeLeft}`}\n width={width}\n onClick={handleResendClick}\n disabled={!canResend || disabled}\n />\n );\n }\n\n return (\n <FlexView>\n {!canResend ? (\n <FlexView $width={105}>\n <Text $renderAs=\"ub2\" $color=\"WHITE_T_60\">\n Resend in{' '}\n <Text $renderAs=\"ub2-bold\" $inline $color=\"WHITE_T_60\">\n {timeLeft}\n </Text>\n </Text>\n </FlexView>\n ) : (\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexColumnGapX={0.5}>\n <TextButton\n disabled={disabled}\n label=\"Resend\"\n color=\"WHITE_T_60\"\n onClick={handleResendClick}\n />\n {showVoiceOTP && (\n <>\n <Text $renderAs=\"ub2\" $color=\"WHITE_T_60\">\n or\n </Text>\n <FlexView $width={116}>\n <TextButton\n label=\"Get code via call\"\n color=\"WHITE_T_60\"\n onClick={handleVoiceResendClick}\n />\n </FlexView>\n </>\n )}\n </FlexView>\n )}\n </FlexView>\n );\n};\n\nexport default memo(ResendOTP);\n"],"names":["ResendOTP","onResendOTP","onResendVoiceOTP","timerSeconds","showVoiceOTP","disabled","renderAs","width","canResend","resetTimer","timeLeft","useResendTimer","handleResendClick","useCallback","handleVoiceResendClick","jsx","Button","FlexView","jsxs","TextButton","Fragment","Text","ResendOtp","memo"],"mappings":";;;;;;;AAUA,MAAMA,IAAuC,CAAC;AAAA,EAC5C,aAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,OAAAC;AACF,MAAM;AACJ,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,UAAAC,EAAA,IAAaC,EAAe;AAAA,IACzD,gBAAgBR;AAAA,EAAA,CACjB,GAEKS,IAAoBC,EAAY,MAAM;AAC5B,IAAAZ,KAAA,QAAAA,KACHQ;EAAA,GACV,CAACR,GAAaQ,CAAU,CAAC,GAEtBK,IAAyBD,EAAY,MAAM;AAC5B,IAAAX,KAAA,QAAAA,KACRO;EAAA,GACV,CAACP,GAAkBO,CAAU,CAAC;AAEjC,SAAIH,MAAa,WAEb,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,UAAS;AAAA,MACT,MAAK;AAAA,MACL,OAAOR,IAAY,WAAW,aAAaE,CAAQ;AAAA,MACnD,OAAAH;AAAA,MACA,SAASK;AAAA,MACT,UAAU,CAACJ,KAAaH;AAAA,IAAA;AAAA,EAAA,IAM3B,gBAAAU,EAAAE,GAAA,EACE,UAACT,IAUC,gBAAAU,EAAAD,GAAA,EAAS,gBAAe,OAAM,aAAY,UAAS,iBAAiB,KACnE,UAAA;AAAA,IAAA,gBAAAF;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,UAAAd;AAAA,QACA,OAAM;AAAA,QACN,OAAM;AAAA,QACN,SAASO;AAAA,MAAA;AAAA,IACX;AAAA,IACCR,KAEG,gBAAAc,EAAAE,GAAA,EAAA,UAAA;AAAA,MAAA,gBAAAL,EAACM,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,MAAA;AAAA,MACA,gBAAAN,EAACE,GAAS,EAAA,QAAQ,KAChB,UAAA,gBAAAF;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,OAAM;AAAA,UACN,SAASL;AAAA,QAAA;AAAA,MAAA,GAEb;AAAA,IAAA,GACF;AAAA,EAAA,EAEJ,CAAA,IA9BC,gBAAAC,EAAAE,GAAA,EAAS,QAAQ,KAChB,UAAC,gBAAAC,EAAAG,GAAA,EAAK,WAAU,OAAM,QAAO,cAAa,UAAA;AAAA,IAAA;AAAA,IAC9B;AAAA,IACV,gBAAAN,EAACM,KAAK,WAAU,YAAW,SAAO,IAAC,QAAO,cACvC,UACHX,EAAA,CAAA;AAAA,EACF,EAAA,CAAA,EACF,CAAA,EAyBJ,CAAA;AAEJ,GAEeY,IAAAC,EAAKvB,CAAS;"}
|
@@ -1,30 +1,25 @@
|
|
1
|
-
import { jsx as e, jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
isProcessing: m,
|
1
|
+
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
2
|
+
import { memo as c, useCallback as l } from "react";
|
3
|
+
import p from "../../../ui/inputs/text-input/text-input.js";
|
4
|
+
import o from "../../../ui/layout/flex-view.js";
|
5
|
+
import f from "../../comps/input-status-icon/input-status-icon.js";
|
6
|
+
import g from "../../comps/resend-otp/resend-otp.js";
|
7
|
+
const h = ({
|
8
|
+
onSubmit: a,
|
9
|
+
onChange: r,
|
10
|
+
value: i,
|
11
|
+
error: t,
|
12
|
+
isProcessing: s,
|
14
13
|
isValid: n = !1
|
15
14
|
}) => {
|
16
|
-
const
|
17
|
-
|
18
|
-
|
19
|
-
i(), d();
|
20
|
-
}, u = h(
|
21
|
-
(p) => {
|
22
|
-
t("username", p.target.value);
|
15
|
+
const m = l(
|
16
|
+
(d) => {
|
17
|
+
r("otp", d.target.value);
|
23
18
|
},
|
24
|
-
[
|
19
|
+
[r]
|
25
20
|
);
|
26
21
|
return /* @__PURE__ */ e(
|
27
|
-
|
22
|
+
o,
|
28
23
|
{
|
29
24
|
$gutterX: 2,
|
30
25
|
$gapX: 1.5,
|
@@ -32,39 +27,37 @@ const x = ({
|
|
32
27
|
$justifyContent: "center",
|
33
28
|
$background: "BLACK_2",
|
34
29
|
$height: 308,
|
35
|
-
children: /* @__PURE__ */
|
30
|
+
children: /* @__PURE__ */ u(o, { $alignItems: "center", $justifyContent: "space-between", $flex: 1, children: [
|
36
31
|
/* @__PURE__ */ e(
|
37
|
-
|
32
|
+
p,
|
38
33
|
{
|
39
|
-
renderAs:
|
34
|
+
renderAs: t ? "error-dark" : n ? "success-dark" : "primary-dark",
|
40
35
|
autoFocus: !0,
|
41
36
|
label: "Verification code",
|
42
|
-
value:
|
43
|
-
onChange:
|
37
|
+
value: i,
|
38
|
+
onChange: m,
|
44
39
|
width: 330,
|
45
40
|
required: !0,
|
46
41
|
shape: "borderLess",
|
47
|
-
errorMessage:
|
48
|
-
siblingElement: /* @__PURE__ */ e(
|
42
|
+
errorMessage: t,
|
43
|
+
siblingElement: /* @__PURE__ */ e(f, { isError: !!t, isValid: n, isLoading: s })
|
49
44
|
}
|
50
45
|
),
|
51
46
|
/* @__PURE__ */ e(
|
52
|
-
|
47
|
+
g,
|
53
48
|
{
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
label: o ? "Resend" : `Resend in ${c}`,
|
49
|
+
renderAs: "submit",
|
50
|
+
timerSeconds: 15,
|
51
|
+
onResendOTP: a,
|
58
52
|
width: 336,
|
59
|
-
|
60
|
-
disabled: !o
|
53
|
+
disabled: s
|
61
54
|
}
|
62
55
|
)
|
63
56
|
] })
|
64
57
|
}
|
65
58
|
);
|
66
|
-
},
|
59
|
+
}, w = c(h);
|
67
60
|
export {
|
68
|
-
|
61
|
+
w as default
|
69
62
|
};
|
70
63
|
//# sourceMappingURL=otp-form.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"otp-form.js","sources":["../../../../../src/features/auth/forgot-password/otp-form/otp-form.tsx"],"sourcesContent":["import type { ISingleFieldFormProps } from '../forgot-password-types';\n\nimport { type ChangeEvent, memo, useCallback } from 'react';\n\nimport
|
1
|
+
{"version":3,"file":"otp-form.js","sources":["../../../../../src/features/auth/forgot-password/otp-form/otp-form.tsx"],"sourcesContent":["import type { ISingleFieldFormProps } from '../forgot-password-types';\n\nimport { type ChangeEvent, memo, useCallback } from 'react';\n\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\nimport ResendOtp from '../../comps/resend-otp/resend-otp';\n\nconst OTPForm = ({\n onSubmit,\n onChange,\n value,\n error,\n isProcessing,\n isValid = false,\n}: ISingleFieldFormProps) => {\n const handleOTPChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('otp', e.target.value);\n },\n [onChange],\n );\n\n const statusVariant = isValid ? 'success-dark' : 'primary-dark';\n\n return (\n <FlexView\n $gutterX={2}\n $gapX={1.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"BLACK_2\"\n $height={308}\n >\n <FlexView $alignItems=\"center\" $justifyContent=\"space-between\" $flex={1}>\n <TextInput\n renderAs={error ? 'error-dark' : statusVariant}\n autoFocus\n label=\"Verification code\"\n value={value}\n onChange={handleOTPChange}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={error}\n siblingElement={\n <InputStatusIcon isError={!!error} isValid={isValid} isLoading={isProcessing} />\n }\n />\n <ResendOtp\n renderAs=\"submit\"\n timerSeconds={15}\n onResendOTP={onSubmit}\n width={336}\n disabled={isProcessing}\n />\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(OTPForm);\n"],"names":["OTPForm","onSubmit","onChange","value","error","isProcessing","isValid","handleOTPChange","useCallback","e","jsx","FlexView","TextInput","InputStatusIcon","ResendOtp","otpForm","memo"],"mappings":";;;;;;AASA,MAAMA,IAAU,CAAC;AAAA,EACf,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC,IAAU;AACZ,MAA6B;AAC3B,QAAMC,IAAkBC;AAAA,IACtB,CAACC,MAAqC;AAC3B,MAAAP,EAAA,OAAOO,EAAE,OAAO,KAAK;AAAA,IAChC;AAAA,IACA,CAACP,CAAQ;AAAA,EAAA;AAMT,SAAA,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,aAAY;AAAA,MACZ,SAAS;AAAA,MAET,4BAACA,GAAS,EAAA,aAAY,UAAS,iBAAgB,iBAAgB,OAAO,GACpE,UAAA;AAAA,QAAA,gBAAAD;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,UAAUR,IAAQ,eAbJE,IAAU,iBAAiB;AAAA,YAczC,WAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAAH;AAAA,YACA,UAAUI;AAAA,YACV,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,cAAcH;AAAA,YACd,kCACGS,GAAgB,EAAA,SAAS,CAAC,CAACT,GAAO,SAAAE,GAAkB,WAAWD,GAAc;AAAA,UAAA;AAAA,QAElF;AAAA,QACA,gBAAAK;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,cAAc;AAAA,YACd,aAAab;AAAA,YACb,OAAO;AAAA,YACP,UAAUI;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeU,IAAAC,EAAKhB,CAAO;"}
|
@@ -1,29 +1,28 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import { FormWrapper as
|
8
|
-
const
|
9
|
-
onSubmit:
|
10
|
-
onChange:
|
11
|
-
value:
|
12
|
-
error:
|
13
|
-
isSubmitDisabled:
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
2
|
+
import { memo as p, useCallback as f } from "react";
|
3
|
+
import c from "../../../ui/buttons/button/button.js";
|
4
|
+
import g from "../../../ui/inputs/text-input/text-input.js";
|
5
|
+
import h from "../../../ui/layout/flex-view.js";
|
6
|
+
import b from "../../comps/input-status-icon/input-status-icon.js";
|
7
|
+
import { FormWrapper as I } from "../forgot-password-styled.js";
|
8
|
+
const $ = ({
|
9
|
+
onSubmit: i,
|
10
|
+
onChange: t,
|
11
|
+
value: o,
|
12
|
+
error: r,
|
13
|
+
isSubmitDisabled: s,
|
14
14
|
isProcessing: n,
|
15
|
-
isValid:
|
16
|
-
label:
|
17
|
-
field: t
|
15
|
+
isValid: a = !1,
|
16
|
+
label: m
|
18
17
|
}) => {
|
19
18
|
const d = f(
|
20
|
-
(
|
21
|
-
t
|
19
|
+
(u) => {
|
20
|
+
t("identifier", u.target.value);
|
22
21
|
},
|
23
|
-
[
|
22
|
+
[t]
|
24
23
|
);
|
25
|
-
return /* @__PURE__ */
|
26
|
-
|
24
|
+
return /* @__PURE__ */ e(
|
25
|
+
h,
|
27
26
|
{
|
28
27
|
$gutterX: 2,
|
29
28
|
$gapX: 1.5,
|
@@ -31,24 +30,24 @@ const k = ({
|
|
31
30
|
$justifyContent: "center",
|
32
31
|
$background: "BLACK_2",
|
33
32
|
$height: 308,
|
34
|
-
children: /* @__PURE__ */ l(
|
35
|
-
/* @__PURE__ */
|
36
|
-
|
33
|
+
children: /* @__PURE__ */ l(I, { onSubmit: i, children: [
|
34
|
+
/* @__PURE__ */ e(
|
35
|
+
g,
|
37
36
|
{
|
38
|
-
renderAs:
|
37
|
+
renderAs: r ? "error-dark" : "primary-dark",
|
39
38
|
autoFocus: !0,
|
40
|
-
label:
|
41
|
-
value:
|
39
|
+
label: m,
|
40
|
+
value: o,
|
42
41
|
onChange: d,
|
43
42
|
width: 330,
|
44
43
|
required: !0,
|
45
44
|
shape: "borderLess",
|
46
|
-
errorMessage:
|
47
|
-
siblingElement: /* @__PURE__ */
|
45
|
+
errorMessage: r,
|
46
|
+
siblingElement: /* @__PURE__ */ e(b, { isError: !!r, isValid: a, isLoading: !1 })
|
48
47
|
}
|
49
48
|
),
|
50
|
-
/* @__PURE__ */
|
51
|
-
|
49
|
+
/* @__PURE__ */ e(
|
50
|
+
c,
|
52
51
|
{
|
53
52
|
size: "small",
|
54
53
|
renderAs: "secondary-dark",
|
@@ -56,14 +55,14 @@ const k = ({
|
|
56
55
|
label: "Get Verification Code",
|
57
56
|
width: 336,
|
58
57
|
busy: n,
|
59
|
-
disabled:
|
58
|
+
disabled: s
|
60
59
|
}
|
61
60
|
)
|
62
61
|
] })
|
63
62
|
}
|
64
63
|
);
|
65
|
-
},
|
64
|
+
}, A = p($);
|
66
65
|
export {
|
67
|
-
|
66
|
+
A as default
|
68
67
|
};
|
69
68
|
//# sourceMappingURL=user-identifier-form.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"user-identifier-form.js","sources":["../../../../../src/features/auth/forgot-password/user-identifier-form/user-identifier-form.tsx"],"sourcesContent":["import type { ISingleFieldFormProps } from '../forgot-password-types';\n\nimport { memo, useCallback, type ChangeEvent } 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 InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\nimport * as Styled from '../forgot-password-styled';\n\nconst UserIdentifierForm = ({\n onSubmit,\n onChange,\n value,\n error,\n isSubmitDisabled,\n isProcessing,\n isValid = false,\n label,\n
|
1
|
+
{"version":3,"file":"user-identifier-form.js","sources":["../../../../../src/features/auth/forgot-password/user-identifier-form/user-identifier-form.tsx"],"sourcesContent":["import type { ISingleFieldFormProps } from '../forgot-password-types';\n\nimport { memo, useCallback, type ChangeEvent } 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 InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\nimport * as Styled from '../forgot-password-styled';\n\nconst UserIdentifierForm = ({\n onSubmit,\n onChange,\n value,\n error,\n isSubmitDisabled,\n isProcessing,\n isValid = false,\n label,\n}: ISingleFieldFormProps) => {\n const handleInputChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('identifier', e.target.value);\n },\n [onChange],\n );\n\n return (\n <FlexView\n $gutterX={2}\n $gapX={1.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"BLACK_2\"\n $height={308}\n >\n <Styled.FormWrapper onSubmit={onSubmit}>\n <TextInput\n renderAs={error ? 'error-dark' : 'primary-dark'}\n autoFocus\n label={label}\n value={value}\n onChange={handleInputChange}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={error}\n siblingElement={<InputStatusIcon isError={!!error} isValid={isValid} isLoading={false} />}\n />\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label=\"Get Verification Code\"\n width={336}\n busy={isProcessing}\n disabled={isSubmitDisabled}\n />\n </Styled.FormWrapper>\n </FlexView>\n );\n};\n\nexport default memo(UserIdentifierForm);\n"],"names":["UserIdentifierForm","onSubmit","onChange","value","error","isSubmitDisabled","isProcessing","isValid","label","handleInputChange","useCallback","e","jsx","FlexView","jsxs","Styled.FormWrapper","TextInput","InputStatusIcon","Button","userIdentifierForm","memo"],"mappings":";;;;;;;AAUA,MAAMA,IAAqB,CAAC;AAAA,EAC1B,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,OAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAoBC;AAAA,IACxB,CAACC,MAAqC;AAC3B,MAAAT,EAAA,cAAcS,EAAE,OAAO,KAAK;AAAA,IACvC;AAAA,IACA,CAACT,CAAQ;AAAA,EAAA;AAIT,SAAA,gBAAAU;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAY;AAAA,MACZ,iBAAgB;AAAA,MAChB,aAAY;AAAA,MACZ,SAAS;AAAA,MAET,UAAC,gBAAAC,EAAAC,GAAA,EAAmB,UAAAd,GAClB,UAAA;AAAA,QAAA,gBAAAW;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,UAAUZ,IAAQ,eAAe;AAAA,YACjC,WAAS;AAAA,YACT,OAAAI;AAAA,YACA,OAAAL;AAAA,YACA,UAAUM;AAAA,YACV,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,cAAcL;AAAA,YACd,kCAAiBa,GAAgB,EAAA,SAAS,CAAC,CAACb,GAAO,SAAAG,GAAkB,WAAW,IAAO;AAAA,UAAA;AAAA,QACzF;AAAA,QACA,gBAAAK;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAS;AAAA,YACT,MAAK;AAAA,YACL,OAAM;AAAA,YACN,OAAO;AAAA,YACP,MAAMZ;AAAA,YACN,UAAUD;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEec,IAAAC,EAAKpB,CAAkB;"}
|
@@ -8,12 +8,12 @@ import u from "../../comps/input-status-icon/input-status-icon.js";
|
|
8
8
|
import F from "../../comps/resend-otp/resend-otp.js";
|
9
9
|
import { FormWrapper as C } from "./identifier-otp-form-styled.js";
|
10
10
|
const E = ({
|
11
|
-
identifier:
|
11
|
+
identifier: p,
|
12
12
|
otp: l,
|
13
13
|
errors: r,
|
14
14
|
isOtpVerified: i,
|
15
15
|
isLoading: a,
|
16
|
-
isSubmitDisabled:
|
16
|
+
isSubmitDisabled: f,
|
17
17
|
showOtpInput: t,
|
18
18
|
onChange: m,
|
19
19
|
onSubmit: g,
|
@@ -28,7 +28,7 @@ const E = ({
|
|
28
28
|
renderAs: r.identifier ? "error-dark" : b,
|
29
29
|
autoFocus: !0,
|
30
30
|
label: "Email or Phone",
|
31
|
-
value:
|
31
|
+
value: p,
|
32
32
|
onChange: (o) => m("identifier", o.target.value),
|
33
33
|
width: 330,
|
34
34
|
required: !0,
|
@@ -78,12 +78,12 @@ const E = ({
|
|
78
78
|
label: t ? "Log In" : "Get Verification Code",
|
79
79
|
width: 336,
|
80
80
|
busy: !t && a,
|
81
|
-
disabled:
|
81
|
+
disabled: f
|
82
82
|
}
|
83
83
|
)
|
84
84
|
] }) });
|
85
|
-
},
|
85
|
+
}, I = y(E);
|
86
86
|
export {
|
87
|
-
|
87
|
+
I as default
|
88
88
|
};
|
89
89
|
//# sourceMappingURL=identifier-otp-form.js.map
|
package/dist/index.d.ts
CHANGED
@@ -2452,6 +2452,8 @@ declare interface IOTPResendProps {
|
|
2452
2452
|
timerSeconds?: number;
|
2453
2453
|
showVoiceOTP?: boolean;
|
2454
2454
|
disabled?: boolean;
|
2455
|
+
renderAs?: 'submit' | 'text';
|
2456
|
+
width?: number;
|
2455
2457
|
}
|
2456
2458
|
|
2457
2459
|
declare interface IOutcomeConfig {
|
@@ -2992,7 +2994,6 @@ declare interface ISingleFieldFormProps {
|
|
2992
2994
|
isProcessing: boolean;
|
2993
2995
|
isSubmitDisabled?: boolean;
|
2994
2996
|
isValid?: boolean;
|
2995
|
-
field?: string;
|
2996
2997
|
label?: string;
|
2997
2998
|
}
|
2998
2999
|
|
@@ -5732,7 +5733,7 @@ export declare const User2Icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
5732
5733
|
|
5733
5734
|
export declare const UserIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
5734
5735
|
|
5735
|
-
export declare const UserIdentifierForm: MemoExoticComponent<({ onSubmit, onChange, value, error, isSubmitDisabled, isProcessing, isValid, label,
|
5736
|
+
export declare const UserIdentifierForm: MemoExoticComponent<({ onSubmit, onChange, value, error, isSubmitDisabled, isProcessing, isValid, label, }: ISingleFieldFormProps) => JSX_2.Element>;
|
5736
5737
|
|
5737
5738
|
export declare const UsernamePasswordForm: NamedExoticComponent<IUsernamePasswordFormProps>;
|
5738
5739
|
|