@cuemath/leap 2.9.5-j12 → 2.9.5-j13
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/input-status-icon/input-status-icon.js +13 -13
- package/dist/features/auth/comps/input-status-icon/input-status-icon.js.map +1 -1
- package/dist/features/auth/forgot-password/forgot-password-styled.js +12 -0
- package/dist/features/auth/forgot-password/forgot-password-styled.js.map +1 -0
- package/dist/features/auth/forgot-password/identifier-form/identifier-form.js +59 -0
- package/dist/features/auth/forgot-password/identifier-form/identifier-form.js.map +1 -0
- package/dist/features/auth/forgot-password/otp-form/otp-form.js +71 -0
- package/dist/features/auth/forgot-password/otp-form/otp-form.js.map +1 -0
- package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js +88 -0
- package/dist/features/auth/forgot-password/reset-password-form/reset-password-form.js.map +1 -0
- package/dist/features/auth/forgot-password/username-form/username-form.js +60 -0
- package/dist/features/auth/forgot-password/username-form/username-form.js.map +1 -0
- package/dist/features/auth/login/login-constants.js +12 -0
- package/dist/features/auth/login/login-constants.js.map +1 -0
- package/dist/index.d.ts +26 -3
- package/dist/index.js +362 -352
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
@@ -1,19 +1,19 @@
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
2
|
-
import { useTheme as
|
3
|
-
import { ReactComponent as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
const
|
7
|
-
isLoading: n,
|
8
|
-
isValid:
|
9
|
-
isError:
|
2
|
+
import { useTheme as h } from "styled-components";
|
3
|
+
import { ReactComponent as u } from "../../../../assets/illustrations/loader-1.svg.js";
|
4
|
+
import a from "../../../../assets/line-icons/icons/check2.js";
|
5
|
+
import s from "../../../../assets/line-icons/icons/cross.js";
|
6
|
+
const i = ({
|
7
|
+
isLoading: n = !1,
|
8
|
+
isValid: e = !1,
|
9
|
+
isError: c = !1,
|
10
10
|
size: o = 24,
|
11
|
-
successColor:
|
12
|
-
errorColor:
|
11
|
+
successColor: f = "GREEN_4",
|
12
|
+
errorColor: m = "ORANGE_4"
|
13
13
|
}) => {
|
14
|
-
const { colors: r } =
|
15
|
-
return n ? /* @__PURE__ */ t(
|
16
|
-
}, w =
|
14
|
+
const { colors: r } = h();
|
15
|
+
return n ? /* @__PURE__ */ t(u, { width: o, height: o }) : c ? /* @__PURE__ */ t(s, { color: r[m], width: o, height: o }) : e ? /* @__PURE__ */ t(a, { color: r[f], width: o, height: o }) : null;
|
16
|
+
}, w = i;
|
17
17
|
export {
|
18
18
|
w as default
|
19
19
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input-status-icon.js","sources":["../../../../../src/features/auth/comps/input-status-icon/input-status-icon.tsx"],"sourcesContent":["import type { IInputStatusIconProps } from './input-status-icon-types';\n\nimport { useTheme } from 'styled-components';\n\nimport { ReactComponent as LoaderSVG } from '../../../../assets/illustrations/loader-1.svg';\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\n\nconst InputStatusIcon: React.FC<IInputStatusIconProps> = ({\n isLoading,\n isValid,\n isError,\n size = 24,\n successColor = 'GREEN_4',\n errorColor = 'ORANGE_4',\n}) => {\n const { colors } = useTheme();\n\n if (isLoading) {\n return <LoaderSVG width={size} height={size} />;\n }\n\n if (isError) {\n return <CrossIcon color={colors[errorColor]} width={size} height={size} />;\n }\n\n if (isValid) {\n return <Check2Icon color={colors[successColor]} width={size} height={size} />;\n }\n\n return null;\n};\n\nexport default InputStatusIcon;\n"],"names":["InputStatusIcon","isLoading","isValid","isError","size","successColor","errorColor","colors","useTheme","jsx","LoaderSVG","CrossIcon","Check2Icon","InputStatusIcon$1"],"mappings":";;;;;AAQA,MAAMA,IAAmD,CAAC;AAAA,EACxD,WAAAC;AAAA,
|
1
|
+
{"version":3,"file":"input-status-icon.js","sources":["../../../../../src/features/auth/comps/input-status-icon/input-status-icon.tsx"],"sourcesContent":["import type { IInputStatusIconProps } from './input-status-icon-types';\n\nimport { useTheme } from 'styled-components';\n\nimport { ReactComponent as LoaderSVG } from '../../../../assets/illustrations/loader-1.svg';\nimport Check2Icon from '../../../../assets/line-icons/icons/check2';\nimport CrossIcon from '../../../../assets/line-icons/icons/cross';\n\nconst InputStatusIcon: React.FC<IInputStatusIconProps> = ({\n isLoading = false,\n isValid = false,\n isError = false,\n size = 24,\n successColor = 'GREEN_4',\n errorColor = 'ORANGE_4',\n}) => {\n const { colors } = useTheme();\n\n if (isLoading) {\n return <LoaderSVG width={size} height={size} />;\n }\n\n if (isError) {\n return <CrossIcon color={colors[errorColor]} width={size} height={size} />;\n }\n\n if (isValid) {\n return <Check2Icon color={colors[successColor]} width={size} height={size} />;\n }\n\n return null;\n};\n\nexport default InputStatusIcon;\n"],"names":["InputStatusIcon","isLoading","isValid","isError","size","successColor","errorColor","colors","useTheme","jsx","LoaderSVG","CrossIcon","Check2Icon","InputStatusIcon$1"],"mappings":";;;;;AAQA,MAAMA,IAAmD,CAAC;AAAA,EACxD,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,cAAAC,IAAe;AAAA,EACf,YAAAC,IAAa;AACf,MAAM;AACE,QAAA,EAAE,QAAAC,MAAWC;AAEnB,SAAIP,IACM,gBAAAQ,EAAAC,GAAA,EAAU,OAAON,GAAM,QAAQA,EAAM,CAAA,IAG3CD,IACK,gBAAAM,EAACE,KAAU,OAAOJ,EAAOD,CAAU,GAAG,OAAOF,GAAM,QAAQA,EAAM,CAAA,IAGtEF,IACK,gBAAAO,EAACG,KAAW,OAAOL,EAAOF,CAAY,GAAG,OAAOD,GAAM,QAAQA,EAAM,CAAA,IAGtE;AACT,GAEAS,IAAeb;"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { styled as e } from "styled-components";
|
2
|
+
const t = e.form`
|
3
|
+
display: flex;
|
4
|
+
flex: 1;
|
5
|
+
margin-top: 8px;
|
6
|
+
flex-direction: column;
|
7
|
+
justify-content: space-between;
|
8
|
+
`;
|
9
|
+
export {
|
10
|
+
t as FormWrapper
|
11
|
+
};
|
12
|
+
//# sourceMappingURL=forgot-password-styled.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"forgot-password-styled.js","sources":["../../../../src/features/auth/forgot-password/forgot-password-styled.tsx"],"sourcesContent":["import { styled } from 'styled-components';\n\nexport const FormWrapper = styled.form`\n display: flex;\n flex: 1;\n margin-top: 8px;\n flex-direction: column;\n justify-content: space-between;\n`;\n"],"names":["FormWrapper","styled"],"mappings":";AAEO,MAAMA,IAAcC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
2
|
+
import l from "../../../ui/buttons/button/button.js";
|
3
|
+
import u from "../../../ui/inputs/text-input/text-input.js";
|
4
|
+
import f from "../../../ui/layout/flex-view.js";
|
5
|
+
import p from "../../comps/input-status-icon/input-status-icon.js";
|
6
|
+
import { FormWrapper as c } from "../forgot-password-styled.js";
|
7
|
+
const g = ({
|
8
|
+
onSubmit: i,
|
9
|
+
onChange: t,
|
10
|
+
formData: o,
|
11
|
+
errors: r,
|
12
|
+
isSubmitDisabled: n,
|
13
|
+
isProcessing: a,
|
14
|
+
isValid: s = !1
|
15
|
+
}) => /* @__PURE__ */ e(
|
16
|
+
f,
|
17
|
+
{
|
18
|
+
$gutterX: 2,
|
19
|
+
$gapX: 1.5,
|
20
|
+
$alignItems: "center",
|
21
|
+
$justifyContent: "center",
|
22
|
+
$background: "BLACK_2",
|
23
|
+
$height: 308,
|
24
|
+
children: /* @__PURE__ */ m(c, { onSubmit: i, children: [
|
25
|
+
/* @__PURE__ */ e(
|
26
|
+
u,
|
27
|
+
{
|
28
|
+
renderAs: r.identifier ? "error" : "primary",
|
29
|
+
autoFocus: !0,
|
30
|
+
label: "Email or Phone number",
|
31
|
+
value: o.identifier,
|
32
|
+
onChange: (d) => t("identifier", d.target.value),
|
33
|
+
width: 330,
|
34
|
+
required: !0,
|
35
|
+
shape: "borderLess",
|
36
|
+
colorTheme: "dark",
|
37
|
+
errorMessage: r.identifier,
|
38
|
+
siblingElement: /* @__PURE__ */ e(p, { isError: !!r.identifier, isValid: s, isLoading: !1 })
|
39
|
+
}
|
40
|
+
),
|
41
|
+
/* @__PURE__ */ e(
|
42
|
+
l,
|
43
|
+
{
|
44
|
+
size: "small",
|
45
|
+
renderAs: "secondary",
|
46
|
+
type: "submit",
|
47
|
+
label: "Get Verification Code",
|
48
|
+
width: 336,
|
49
|
+
busy: a,
|
50
|
+
disabled: n
|
51
|
+
}
|
52
|
+
)
|
53
|
+
] })
|
54
|
+
}
|
55
|
+
), F = g;
|
56
|
+
export {
|
57
|
+
F as default
|
58
|
+
};
|
59
|
+
//# sourceMappingURL=identifier-form.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"identifier-form.js","sources":["../../../../../src/features/auth/forgot-password/identifier-form/identifier-form.tsx"],"sourcesContent":["import type { IFormProps } from '../forgot-password-types';\nimport 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 IdentifierForm = ({\n onSubmit,\n onChange,\n formData,\n errors,\n isSubmitDisabled,\n isProcessing,\n isValid = false,\n}: IFormProps) => {\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={errors.identifier ? 'error' : 'primary'}\n autoFocus\n label=\"Email or Phone number\"\n value={formData.identifier}\n onChange={(e: ChangeEvent<HTMLInputElement>) => onChange('identifier', e.target.value)}\n width={330}\n required\n shape=\"borderLess\"\n colorTheme=\"dark\"\n errorMessage={errors.identifier}\n siblingElement={\n <InputStatusIcon isError={!!errors.identifier} isValid={isValid} isLoading={false} />\n }\n />\n <Button\n size=\"small\"\n renderAs=\"secondary\"\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 IdentifierForm;\n"],"names":["IdentifierForm","onSubmit","onChange","formData","errors","isSubmitDisabled","isProcessing","isValid","jsx","FlexView","jsxs","Styled.FormWrapper","TextInput","e","InputStatusIcon","Button","IdentifierForm$1"],"mappings":";;;;;;AASA,MAAMA,IAAiB,CAAC;AAAA,EACtB,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC,IAAU;AACZ,MAEI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,UAAU;AAAA,IACV,OAAO;AAAA,IACP,aAAY;AAAA,IACZ,iBAAgB;AAAA,IAChB,aAAY;AAAA,IACZ,SAAS;AAAA,IAET,UAAC,gBAAAC,EAAAC,GAAA,EAAmB,UAAAV,GAClB,UAAA;AAAA,MAAA,gBAAAO;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,UAAUR,EAAO,aAAa,UAAU;AAAA,UACxC,WAAS;AAAA,UACT,OAAM;AAAA,UACN,OAAOD,EAAS;AAAA,UAChB,UAAU,CAACU,MAAqCX,EAAS,cAAcW,EAAE,OAAO,KAAK;AAAA,UACrF,OAAO;AAAA,UACP,UAAQ;AAAA,UACR,OAAM;AAAA,UACN,YAAW;AAAA,UACX,cAAcT,EAAO;AAAA,UACrB,gBACG,gBAAAI,EAAAM,GAAA,EAAgB,SAAS,CAAC,CAACV,EAAO,YAAY,SAAAG,GAAkB,WAAW,GAAO,CAAA;AAAA,QAAA;AAAA,MAEvF;AAAA,MACA,gBAAAC;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAS;AAAA,UACT,MAAK;AAAA,UACL,OAAM;AAAA,UACN,OAAO;AAAA,UACP,MAAMT;AAAA,UACN,UAAUD;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GACF;AAAA,EAAA;AAAA,GAKNW,IAAehB;"}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
2
|
+
import { useState as a, useEffect as h } from "react";
|
3
|
+
import b from "../../../ui/buttons/button/button.js";
|
4
|
+
import C from "../../../ui/inputs/text-input/text-input.js";
|
5
|
+
import i from "../../../ui/layout/flex-view.js";
|
6
|
+
import x from "../../comps/input-status-icon/input-status-icon.js";
|
7
|
+
const I = ({
|
8
|
+
onSubmit: u,
|
9
|
+
onChange: m,
|
10
|
+
formData: c,
|
11
|
+
errors: r,
|
12
|
+
isSubmitDisabled: l,
|
13
|
+
isProcessing: d,
|
14
|
+
isValid: s = !1
|
15
|
+
}) => {
|
16
|
+
const [o, f] = a(!1), [e, p] = a(30);
|
17
|
+
h(() => {
|
18
|
+
if (e <= 0) {
|
19
|
+
f(!0);
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
const n = setTimeout(() => p(e - 1), 1e3);
|
23
|
+
return () => clearTimeout(n);
|
24
|
+
}, [e]);
|
25
|
+
const $ = s ? "success" : "primary";
|
26
|
+
return /* @__PURE__ */ t(
|
27
|
+
i,
|
28
|
+
{
|
29
|
+
$gutterX: 2,
|
30
|
+
$gapX: 1.5,
|
31
|
+
$alignItems: "center",
|
32
|
+
$justifyContent: "center",
|
33
|
+
$background: "BLACK_2",
|
34
|
+
$height: 308,
|
35
|
+
children: /* @__PURE__ */ g(i, { $alignItems: "center", $justifyContent: "space-between", $flex: 1, children: [
|
36
|
+
/* @__PURE__ */ t(
|
37
|
+
C,
|
38
|
+
{
|
39
|
+
renderAs: r.otp ? "error" : $,
|
40
|
+
autoFocus: !0,
|
41
|
+
label: "Verification code",
|
42
|
+
value: c.username,
|
43
|
+
onChange: (n) => m("username", n.target.value),
|
44
|
+
width: 330,
|
45
|
+
required: !0,
|
46
|
+
shape: "borderLess",
|
47
|
+
colorTheme: "dark",
|
48
|
+
errorMessage: r.username,
|
49
|
+
siblingElement: /* @__PURE__ */ t(x, { isError: !!r.otp, isValid: s, isLoading: d })
|
50
|
+
}
|
51
|
+
),
|
52
|
+
/* @__PURE__ */ t(
|
53
|
+
b,
|
54
|
+
{
|
55
|
+
size: "small",
|
56
|
+
renderAs: "secondary",
|
57
|
+
type: "submit",
|
58
|
+
label: o ? "Resend" : `Resend in 0:${e < 10 ? "0" : ""}${e}`,
|
59
|
+
width: 336,
|
60
|
+
onClick: u,
|
61
|
+
disabled: l || !o
|
62
|
+
}
|
63
|
+
)
|
64
|
+
] })
|
65
|
+
}
|
66
|
+
);
|
67
|
+
}, k = I;
|
68
|
+
export {
|
69
|
+
k as default
|
70
|
+
};
|
71
|
+
//# sourceMappingURL=otp-form.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"otp-form.js","sources":["../../../../../src/features/auth/forgot-password/otp-form/otp-form.tsx"],"sourcesContent":["import type { IFormProps } from '../forgot-password-types';\n\nimport { useEffect, useState, 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';\n\nconst OTPForm = ({\n onSubmit,\n onChange,\n formData,\n errors,\n isSubmitDisabled,\n isProcessing,\n isValid = false,\n}: IFormProps) => {\n const [canResend, setCanResend] = useState(false);\n const [count, setCount] = useState(30);\n\n useEffect(() => {\n if (count <= 0) {\n setCanResend(true);\n\n return;\n }\n\n const timeoutId = setTimeout(() => setCount(count - 1), 1000);\n\n return () => clearTimeout(timeoutId);\n }, [count]);\n\n const statusVariant = isValid ? 'success' : 'primary';\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={errors.otp ? 'error' : statusVariant}\n autoFocus\n label=\"Verification code\"\n value={formData.username}\n onChange={(e: ChangeEvent<HTMLInputElement>) => onChange('username', e.target.value)}\n width={330}\n required\n shape=\"borderLess\"\n colorTheme=\"dark\"\n errorMessage={errors.username}\n siblingElement={\n <InputStatusIcon isError={!!errors.otp} isValid={isValid} isLoading={isProcessing} />\n }\n />\n <Button\n size=\"small\"\n renderAs=\"secondary\"\n type=\"submit\"\n label={canResend ? 'Resend' : `Resend in 0:${count < 10 ? '0' : ''}${count}`}\n width={336}\n onClick={onSubmit}\n disabled={isSubmitDisabled || !canResend}\n />\n </FlexView>\n </FlexView>\n );\n};\n\nexport default OTPForm;\n"],"names":["OTPForm","onSubmit","onChange","formData","errors","isSubmitDisabled","isProcessing","isValid","canResend","setCanResend","useState","count","setCount","useEffect","timeoutId","statusVariant","jsx","FlexView","TextInput","e","InputStatusIcon","Button","OTPForm$1"],"mappings":";;;;;;AASA,MAAMA,IAAU,CAAC;AAAA,EACf,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC,IAAU;AACZ,MAAkB;AAChB,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAOC,CAAQ,IAAIF,EAAS,EAAE;AAErC,EAAAG,EAAU,MAAM;AACd,QAAIF,KAAS,GAAG;AACd,MAAAF,EAAa,EAAI;AAEjB;AAAA,IACF;AAEA,UAAMK,IAAY,WAAW,MAAMF,EAASD,IAAQ,CAAC,GAAG,GAAI;AAErD,WAAA,MAAM,aAAaG,CAAS;AAAA,EAAA,GAClC,CAACH,CAAK,CAAC;AAEJ,QAAAI,IAAgBR,IAAU,YAAY;AAG1C,SAAA,gBAAAS;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,UAAUd,EAAO,MAAM,UAAUW;AAAA,YACjC,WAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAOZ,EAAS;AAAA,YAChB,UAAU,CAACgB,MAAqCjB,EAAS,YAAYiB,EAAE,OAAO,KAAK;AAAA,YACnF,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,YAAW;AAAA,YACX,cAAcf,EAAO;AAAA,YACrB,gBACG,gBAAAY,EAAAI,GAAA,EAAgB,SAAS,CAAC,CAAChB,EAAO,KAAK,SAAAG,GAAkB,WAAWD,EAAc,CAAA;AAAA,UAAA;AAAA,QAEvF;AAAA,QACA,gBAAAU;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAS;AAAA,YACT,MAAK;AAAA,YACL,OAAOb,IAAY,WAAW,eAAeG,IAAQ,KAAK,MAAM,EAAE,GAAGA,CAAK;AAAA,YAC1E,OAAO;AAAA,YACP,SAASV;AAAA,YACT,UAAUI,KAAoB,CAACG;AAAA,UAAA;AAAA,QACjC;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEAc,IAAetB;"}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
2
|
+
import u from "../../../ui/buttons/button/button.js";
|
3
|
+
import i from "../../../ui/inputs/text-input/text-input.js";
|
4
|
+
import d from "../../../ui/layout/flex-view.js";
|
5
|
+
import c from "../../../ui/separator/separator.js";
|
6
|
+
import n from "../../comps/input-status-icon/input-status-icon.js";
|
7
|
+
import { FormWrapper as f } from "../forgot-password-styled.js";
|
8
|
+
const g = ({
|
9
|
+
onSubmit: p,
|
10
|
+
onChange: a,
|
11
|
+
formData: s,
|
12
|
+
errors: e,
|
13
|
+
isSubmitDisabled: l,
|
14
|
+
isProcessing: m,
|
15
|
+
isValid: w = !1
|
16
|
+
}) => /* @__PURE__ */ r(
|
17
|
+
d,
|
18
|
+
{
|
19
|
+
$gutterX: 2,
|
20
|
+
$gapX: 1.5,
|
21
|
+
$alignItems: "center",
|
22
|
+
$justifyContent: "center",
|
23
|
+
$background: "BLACK_2",
|
24
|
+
$height: 308,
|
25
|
+
children: /* @__PURE__ */ t(f, { onSubmit: p, children: [
|
26
|
+
/* @__PURE__ */ t(d, { children: [
|
27
|
+
/* @__PURE__ */ r(
|
28
|
+
i,
|
29
|
+
{
|
30
|
+
type: "password",
|
31
|
+
renderAs: e.password ? "error" : "primary",
|
32
|
+
autoComplete: "password",
|
33
|
+
label: "New Password",
|
34
|
+
value: s.password,
|
35
|
+
onChange: (o) => a("password", o.target.value),
|
36
|
+
width: 330,
|
37
|
+
required: !0,
|
38
|
+
shape: "borderLess",
|
39
|
+
colorTheme: "dark",
|
40
|
+
errorMessage: e.password,
|
41
|
+
siblingElement: /* @__PURE__ */ r(n, { isError: !!e.password, isValid: w, isLoading: !1 })
|
42
|
+
}
|
43
|
+
),
|
44
|
+
/* @__PURE__ */ r(c, { height: 36 }),
|
45
|
+
/* @__PURE__ */ r(
|
46
|
+
i,
|
47
|
+
{
|
48
|
+
type: "password",
|
49
|
+
renderAs: e.confirmPassword ? "error" : "primary",
|
50
|
+
autoComplete: "password",
|
51
|
+
label: "Re-enter Password",
|
52
|
+
value: s.confirmPassword,
|
53
|
+
onChange: (o) => a("confirmPassword", o.target.value),
|
54
|
+
width: 330,
|
55
|
+
required: !0,
|
56
|
+
shape: "borderLess",
|
57
|
+
colorTheme: "dark",
|
58
|
+
errorMessage: e.confirmPassword,
|
59
|
+
siblingElement: /* @__PURE__ */ r(
|
60
|
+
n,
|
61
|
+
{
|
62
|
+
isError: !!e.confirmPassword,
|
63
|
+
isValid: !!s.confirmPassword && s.password === s.confirmPassword,
|
64
|
+
isLoading: !1
|
65
|
+
}
|
66
|
+
)
|
67
|
+
}
|
68
|
+
)
|
69
|
+
] }),
|
70
|
+
/* @__PURE__ */ r(
|
71
|
+
u,
|
72
|
+
{
|
73
|
+
size: "small",
|
74
|
+
renderAs: "secondary",
|
75
|
+
type: "submit",
|
76
|
+
label: "Continue",
|
77
|
+
width: 336,
|
78
|
+
busy: m,
|
79
|
+
disabled: l
|
80
|
+
}
|
81
|
+
)
|
82
|
+
] })
|
83
|
+
}
|
84
|
+
), L = g;
|
85
|
+
export {
|
86
|
+
L as default
|
87
|
+
};
|
88
|
+
//# sourceMappingURL=reset-password-form.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"reset-password-form.js","sources":["../../../../../src/features/auth/forgot-password/reset-password-form/reset-password-form.tsx"],"sourcesContent":["import type { IFormProps } from '../forgot-password-types';\n\nimport { 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 Separator from '../../../ui/separator/separator';\nimport InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\nimport * as Styled from '../forgot-password-styled';\n\nconst ResetPasswordForm = ({\n onSubmit,\n onChange,\n formData,\n errors,\n isSubmitDisabled,\n isProcessing,\n isValid = false,\n}: IFormProps) => {\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 <FlexView>\n <TextInput\n type={'password'}\n renderAs={errors.password ? 'error' : 'primary'}\n autoComplete=\"password\"\n label=\"New Password\"\n value={formData.password}\n onChange={(e: ChangeEvent<HTMLInputElement>) => onChange('password', e.target.value)}\n width={330}\n required\n shape=\"borderLess\"\n colorTheme=\"dark\"\n errorMessage={errors.password}\n siblingElement={\n <InputStatusIcon isError={!!errors.password} isValid={isValid} isLoading={false} />\n }\n />\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.confirmPassword ? 'error' : 'primary'}\n autoComplete=\"password\"\n label=\"Re-enter Password\"\n value={formData.confirmPassword}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n onChange('confirmPassword', e.target.value)\n }\n width={330}\n required\n shape=\"borderLess\"\n colorTheme=\"dark\"\n errorMessage={errors.confirmPassword}\n siblingElement={\n <InputStatusIcon\n isError={!!errors.confirmPassword}\n isValid={\n !!formData.confirmPassword && formData.password === formData.confirmPassword\n }\n isLoading={false}\n />\n }\n />\n </FlexView>\n <Button\n size=\"small\"\n renderAs=\"secondary\"\n type=\"submit\"\n label=\"Continue\"\n width={336}\n busy={isProcessing}\n disabled={isSubmitDisabled}\n />\n </Styled.FormWrapper>\n </FlexView>\n );\n};\n\nexport default ResetPasswordForm;\n"],"names":["ResetPasswordForm","onSubmit","onChange","formData","errors","isSubmitDisabled","isProcessing","isValid","jsx","FlexView","jsxs","Styled.FormWrapper","TextInput","e","InputStatusIcon","Separator","Button","ResetPasswordForm$1"],"mappings":";;;;;;;AAWA,MAAMA,IAAoB,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC,IAAU;AACZ,MAEI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,UAAU;AAAA,IACV,OAAO;AAAA,IACP,aAAY;AAAA,IACZ,iBAAgB;AAAA,IAChB,aAAY;AAAA,IACZ,SAAS;AAAA,IAET,UAAC,gBAAAC,EAAAC,GAAA,EAAmB,UAAAV,GAClB,UAAA;AAAA,MAAA,gBAAAS,EAACD,GACC,EAAA,UAAA;AAAA,QAAA,gBAAAD;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,MAAM;AAAA,YACN,UAAUR,EAAO,WAAW,UAAU;AAAA,YACtC,cAAa;AAAA,YACb,OAAM;AAAA,YACN,OAAOD,EAAS;AAAA,YAChB,UAAU,CAACU,MAAqCX,EAAS,YAAYW,EAAE,OAAO,KAAK;AAAA,YACnF,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,YAAW;AAAA,YACX,cAAcT,EAAO;AAAA,YACrB,gBACG,gBAAAI,EAAAM,GAAA,EAAgB,SAAS,CAAC,CAACV,EAAO,UAAU,SAAAG,GAAkB,WAAW,GAAO,CAAA;AAAA,UAAA;AAAA,QAErF;AAAA,QACA,gBAAAC,EAACO,GAAU,EAAA,QAAQ,GAAI,CAAA;AAAA,QACvB,gBAAAP;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAUR,EAAO,kBAAkB,UAAU;AAAA,YAC7C,cAAa;AAAA,YACb,OAAM;AAAA,YACN,OAAOD,EAAS;AAAA,YAChB,UAAU,CAACU,MACTX,EAAS,mBAAmBW,EAAE,OAAO,KAAK;AAAA,YAE5C,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,YAAW;AAAA,YACX,cAAcT,EAAO;AAAA,YACrB,gBACE,gBAAAI;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,SAAS,CAAC,CAACV,EAAO;AAAA,gBAClB,SACE,CAAC,CAACD,EAAS,mBAAmBA,EAAS,aAAaA,EAAS;AAAA,gBAE/D,WAAW;AAAA,cAAA;AAAA,YACb;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA,GACF;AAAA,MACA,gBAAAK;AAAA,QAACQ;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAS;AAAA,UACT,MAAK;AAAA,UACL,OAAM;AAAA,UACN,OAAO;AAAA,UACP,MAAMV;AAAA,UACN,UAAUD;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GACF;AAAA,EAAA;AAAA,GAKNY,IAAejB;"}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
2
|
+
import l from "../../../ui/buttons/button/button.js";
|
3
|
+
import d from "../../../ui/inputs/text-input/text-input.js";
|
4
|
+
import p from "../../../ui/layout/flex-view.js";
|
5
|
+
import f from "../../comps/input-status-icon/input-status-icon.js";
|
6
|
+
import { FormWrapper as c } from "../forgot-password-styled.js";
|
7
|
+
const g = ({
|
8
|
+
onSubmit: t,
|
9
|
+
onChange: a,
|
10
|
+
formData: s,
|
11
|
+
errors: r,
|
12
|
+
isSubmitDisabled: o,
|
13
|
+
isProcessing: n,
|
14
|
+
isValid: m = !1
|
15
|
+
}) => /* @__PURE__ */ e(
|
16
|
+
p,
|
17
|
+
{
|
18
|
+
$gutterX: 2,
|
19
|
+
$gapX: 1.5,
|
20
|
+
$alignItems: "center",
|
21
|
+
$justifyContent: "flex-start",
|
22
|
+
$background: "BLACK_2",
|
23
|
+
$height: 308,
|
24
|
+
children: /* @__PURE__ */ u(c, { onSubmit: t, children: [
|
25
|
+
/* @__PURE__ */ e(
|
26
|
+
d,
|
27
|
+
{
|
28
|
+
renderAs: r.username ? "error" : "primary",
|
29
|
+
autoFocus: !0,
|
30
|
+
autoComplete: "username",
|
31
|
+
label: "Username",
|
32
|
+
value: s.username,
|
33
|
+
onChange: (i) => a("username", i.target.value),
|
34
|
+
width: 330,
|
35
|
+
required: !0,
|
36
|
+
shape: "borderLess",
|
37
|
+
colorTheme: "dark",
|
38
|
+
errorMessage: r.username,
|
39
|
+
siblingElement: /* @__PURE__ */ e(f, { isError: !!r.username, isValid: m, isLoading: !1 })
|
40
|
+
}
|
41
|
+
),
|
42
|
+
/* @__PURE__ */ e(
|
43
|
+
l,
|
44
|
+
{
|
45
|
+
size: "small",
|
46
|
+
renderAs: "secondary",
|
47
|
+
type: "submit",
|
48
|
+
label: "Get Verification Code",
|
49
|
+
width: 336,
|
50
|
+
busy: n,
|
51
|
+
disabled: o
|
52
|
+
}
|
53
|
+
)
|
54
|
+
] })
|
55
|
+
}
|
56
|
+
), F = g;
|
57
|
+
export {
|
58
|
+
F as default
|
59
|
+
};
|
60
|
+
//# sourceMappingURL=username-form.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"username-form.js","sources":["../../../../../src/features/auth/forgot-password/username-form/username-form.tsx"],"sourcesContent":["import type { IFormProps } from '../forgot-password-types';\nimport 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 UsernameForm = ({\n onSubmit,\n onChange,\n formData,\n errors,\n isSubmitDisabled,\n isProcessing,\n isValid = false,\n}: IFormProps) => {\n return (\n <FlexView\n $gutterX={2}\n $gapX={1.5}\n $alignItems=\"center\"\n $justifyContent=\"flex-start\"\n $background=\"BLACK_2\"\n $height={308}\n >\n <Styled.FormWrapper onSubmit={onSubmit}>\n <TextInput\n renderAs={errors.username ? 'error' : 'primary'}\n autoFocus\n autoComplete=\"username\"\n label=\"Username\"\n value={formData.username}\n onChange={(e: ChangeEvent<HTMLInputElement>) => onChange('username', e.target.value)}\n width={330}\n required\n shape=\"borderLess\"\n colorTheme=\"dark\"\n errorMessage={errors.username}\n siblingElement={\n <InputStatusIcon isError={!!errors.username} isValid={isValid} isLoading={false} />\n }\n />\n <Button\n size=\"small\"\n renderAs=\"secondary\"\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 UsernameForm;\n"],"names":["UsernameForm","onSubmit","onChange","formData","errors","isSubmitDisabled","isProcessing","isValid","jsx","FlexView","jsxs","Styled.FormWrapper","TextInput","e","InputStatusIcon","Button","UsernameForm$1"],"mappings":";;;;;;AASA,MAAMA,IAAe,CAAC;AAAA,EACpB,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC,IAAU;AACZ,MAEI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,UAAU;AAAA,IACV,OAAO;AAAA,IACP,aAAY;AAAA,IACZ,iBAAgB;AAAA,IAChB,aAAY;AAAA,IACZ,SAAS;AAAA,IAET,UAAC,gBAAAC,EAAAC,GAAA,EAAmB,UAAAV,GAClB,UAAA;AAAA,MAAA,gBAAAO;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,UAAUR,EAAO,WAAW,UAAU;AAAA,UACtC,WAAS;AAAA,UACT,cAAa;AAAA,UACb,OAAM;AAAA,UACN,OAAOD,EAAS;AAAA,UAChB,UAAU,CAACU,MAAqCX,EAAS,YAAYW,EAAE,OAAO,KAAK;AAAA,UACnF,OAAO;AAAA,UACP,UAAQ;AAAA,UACR,OAAM;AAAA,UACN,YAAW;AAAA,UACX,cAAcT,EAAO;AAAA,UACrB,gBACG,gBAAAI,EAAAM,GAAA,EAAgB,SAAS,CAAC,CAACV,EAAO,UAAU,SAAAG,GAAkB,WAAW,GAAO,CAAA;AAAA,QAAA;AAAA,MAErF;AAAA,MACA,gBAAAC;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAS;AAAA,UACT,MAAK;AAAA,UACL,OAAM;AAAA,UACN,OAAO;AAAA,UACP,MAAMT;AAAA,UACN,UAAUD;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GACF;AAAA,EAAA;AAAA,GAKNW,IAAehB;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"login-constants.js","sources":["../../../../src/features/auth/login/login-constants.ts"],"sourcesContent":["import type { ITabConfig } from '../comps/tabs/tabs-types';\nimport type { TAuthTabKeys } from './login-types';\n\nexport const AUTH_TABS: ITabConfig<TAuthTabKeys> = {\n username: {\n label: 'Username',\n },\n identifier: {\n label: 'Email/Phone',\n },\n};\n"],"names":["AUTH_TABS"],"mappings":"AAGO,MAAMA,IAAsC;AAAA,EACjD,UAAU;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,YAAY;AAAA,IACV,OAAO;AAAA,EACT;AACF;"}
|
package/dist/index.d.ts
CHANGED
@@ -7,6 +7,7 @@ import type { DefaultTheme } from 'styled-components';
|
|
7
7
|
import { DetailedHTMLProps } from 'react';
|
8
8
|
import type { Dispatch } from 'react';
|
9
9
|
import { FC } from 'react';
|
10
|
+
import type { FormEvent } from 'react';
|
10
11
|
import { ForwardRefExoticComponent } from 'react';
|
11
12
|
import { HTMLAttributes } from 'react';
|
12
13
|
import { IChannelMessage } from '@cuemath/cue-message-broker';
|
@@ -61,6 +62,8 @@ export declare const ArcButton: MemoExoticComponent<ForwardRefExoticComponent<IA
|
|
61
62
|
|
62
63
|
export declare const ArrowTooltip: FC<IArrowTooltipProps>;
|
63
64
|
|
65
|
+
export declare const AUTH_TABS: ITabConfig<TAuthTabKeys>;
|
66
|
+
|
64
67
|
export declare const AuthPageLayout: FC<IAuthPageLayoutProps>;
|
65
68
|
|
66
69
|
export declare const AuthStaticPanel: FC<IAuthStaticPanelProps>;
|
@@ -1106,6 +1109,8 @@ declare interface IDatePickerInputProps extends Omit<ICustomInputProps, 'value'
|
|
1106
1109
|
onChange: (date: Date | null) => void;
|
1107
1110
|
}
|
1108
1111
|
|
1112
|
+
export declare const IdentifierForm: ({ onSubmit, onChange, formData, errors, isSubmitDisabled, isProcessing, isValid, }: IFormProps) => JSX_2.Element;
|
1113
|
+
|
1109
1114
|
declare interface IDesmosCalculatorProps {
|
1110
1115
|
onClose: () => void;
|
1111
1116
|
height?: string | number;
|
@@ -1195,6 +1200,16 @@ declare interface IFile {
|
|
1195
1200
|
url: string;
|
1196
1201
|
}
|
1197
1202
|
|
1203
|
+
declare interface IFormProps {
|
1204
|
+
onSubmit: (e?: FormEvent<HTMLFormElement>) => void;
|
1205
|
+
onChange: (key: string, value: string) => void;
|
1206
|
+
formData: Record<string, string>;
|
1207
|
+
errors: Record<string, string>;
|
1208
|
+
isProcessing: boolean;
|
1209
|
+
isSubmitDisabled: boolean;
|
1210
|
+
isValid?: boolean;
|
1211
|
+
}
|
1212
|
+
|
1198
1213
|
declare interface IGame extends IBaseProject {
|
1199
1214
|
played: boolean;
|
1200
1215
|
}
|
@@ -1351,9 +1366,9 @@ export declare interface IInputSizeConfig {
|
|
1351
1366
|
}
|
1352
1367
|
|
1353
1368
|
declare interface IInputStatusIconProps {
|
1354
|
-
isLoading
|
1355
|
-
isValid
|
1356
|
-
isError
|
1369
|
+
isLoading?: boolean;
|
1370
|
+
isValid?: boolean;
|
1371
|
+
isError?: boolean;
|
1357
1372
|
size?: number;
|
1358
1373
|
successColor?: TColorNames;
|
1359
1374
|
errorColor?: TColorNames;
|
@@ -3878,6 +3893,8 @@ declare interface NumRangeInputProps {
|
|
3878
3893
|
endPlaceholder?: string;
|
3879
3894
|
}
|
3880
3895
|
|
3896
|
+
export declare const OTPForm: ({ onSubmit, onChange, formData, errors, isSubmitDisabled, isProcessing, isValid, }: IFormProps) => JSX_2.Element;
|
3897
|
+
|
3881
3898
|
export declare const OTPInput: FC<IOTPInputProps>;
|
3882
3899
|
|
3883
3900
|
export declare type OutcomeStage = keyof typeof STAGES;
|
@@ -4016,6 +4033,8 @@ export declare const RemotePeerPointer: MemoExoticComponent<({ containerRef, onP
|
|
4016
4033
|
|
4017
4034
|
export declare const ResendOTP: React.FC<IOTPResendProps>;
|
4018
4035
|
|
4036
|
+
export declare const ResetPasswordForm: ({ onSubmit, onChange, formData, errors, isSubmitDisabled, isProcessing, isValid, }: IFormProps) => JSX_2.Element;
|
4037
|
+
|
4019
4038
|
export declare const REWARDS_LIST: string[];
|
4020
4039
|
|
4021
4040
|
export declare const RightIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
@@ -4202,6 +4221,8 @@ export declare type TArrowTooltipVariants = 'primary' | 'secondary';
|
|
4202
4221
|
|
4203
4222
|
export declare type TAuthProvider = 'email' | 'phone';
|
4204
4223
|
|
4224
|
+
export declare type TAuthTabKeys = 'identifier' | 'username';
|
4225
|
+
|
4205
4226
|
export declare type TAuthUserType = 'student' | 'parent';
|
4206
4227
|
|
4207
4228
|
declare type TBadgeData = {
|
@@ -5314,6 +5335,8 @@ export declare const User2Icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
5314
5335
|
|
5315
5336
|
export declare const UserIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
5316
5337
|
|
5338
|
+
export declare const UsernameForm: ({ onSubmit, onChange, formData, errors, isSubmitDisabled, isProcessing, isValid, }: IFormProps) => JSX_2.Element;
|
5339
|
+
|
5317
5340
|
export declare const UserTypeSelector: NamedExoticComponent<IUserTypeSelectorProps>;
|
5318
5341
|
|
5319
5342
|
export declare const useTrackingContext: (commonAnalyticsProps: Record<string, unknown>, overrides?: Record<string, unknown>) => {
|