@cuemath/leap 3.0.11-j3 → 3.0.11-j5

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.
Files changed (20) hide show
  1. package/dist/features/auth/comps/resend-otp/resend-otp.js +44 -30
  2. package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
  3. package/dist/features/auth/forgot-password/otp-form/otp-form.js +31 -38
  4. package/dist/features/auth/forgot-password/otp-form/otp-form.js.map +1 -1
  5. package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js +33 -34
  6. package/dist/features/auth/forgot-password/user-identifier-form/user-identifier-form.js.map +1 -1
  7. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js +49 -39
  8. package/dist/features/auth/login/identifier-otp-form/identifier-otp-form.js.map +1 -1
  9. package/dist/features/auth/login/username-password-form/username-password-form.js +48 -38
  10. package/dist/features/auth/login/username-password-form/username-password-form.js.map +1 -1
  11. package/dist/features/auth/signup/custom-input-field/country-selector/country-code-button.js +11 -10
  12. package/dist/features/auth/signup/custom-input-field/country-selector/country-code-button.js.map +1 -1
  13. package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js +20 -20
  14. package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js.map +1 -1
  15. package/dist/features/auth/signup/custom-input-field/custom-input-field.js +41 -36
  16. package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
  17. package/dist/features/auth/signup/custom-input-field/date-picker-input/date-picker-input.js +31 -47
  18. package/dist/features/auth/signup/custom-input-field/date-picker-input/date-picker-input.js.map +1 -1
  19. package/dist/index.d.ts +3 -2
  20. package/package.json +1 -1
@@ -1,51 +1,65 @@
1
- import { jsx as r, jsxs as c, Fragment as _ } from "react/jsx-runtime";
2
- import { memo as p, useCallback as n } from "react";
3
- import m from "../../../ui/buttons/text-button/text-button.js";
4
- import t from "../../../ui/layout/flex-view.js";
5
- import o from "../../../ui/text/text.js";
6
- import { useResendTimer as x } from "./hooks/use-resend-timer.js";
7
- const b = ({
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: d = 15,
11
- showVoiceOTP: a = !1,
12
- disabled: s
11
+ timerSeconds: f = 15,
12
+ showVoiceOTP: $ = !1,
13
+ disabled: m,
14
+ renderAs: h = "submit",
15
+ width: b
13
16
  }) => {
14
- const { canResend: $, resetTimer: i, timeLeft: h } = x({
15
- initialSeconds: d
16
- }), f = n(() => {
17
- e == null || e(), i();
18
- }, [e, i]), u = n(() => {
19
- l == null || l(), i();
20
- }, [l, i]);
21
- return /* @__PURE__ */ r(t, { children: $ ? /* @__PURE__ */ c(t, { $flexDirection: "row", $alignItems: "center", $flexColumnGapX: 0.5, children: [
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
- m,
37
+ u,
24
38
  {
25
- disabled: s,
39
+ disabled: m,
26
40
  label: "Resend",
27
41
  color: "WHITE_T_60",
28
- onClick: f
42
+ onClick: d
29
43
  }
30
44
  ),
31
- a && /* @__PURE__ */ c(_, { children: [
32
- /* @__PURE__ */ r(o, { $renderAs: "ub2", $color: "WHITE_T_60", children: "or" }),
33
- /* @__PURE__ */ r(t, { $width: 116, children: /* @__PURE__ */ r(
34
- m,
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: u
52
+ onClick: p
39
53
  }
40
54
  ) })
41
55
  ] })
42
- ] }) : /* @__PURE__ */ r(t, { $width: 105, children: /* @__PURE__ */ c(o, { $renderAs: "ub2", $color: "WHITE_T_60", children: [
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(o, { $renderAs: "ub2-bold", $inline: !0, $color: "WHITE_T_60", children: h })
59
+ /* @__PURE__ */ r(c, { $renderAs: "ub2-bold", $inline: !0, $color: "WHITE_T_60", children: s })
46
60
  ] }) }) });
47
- }, W = p(b);
61
+ }, j = x(I);
48
62
  export {
49
- W as default
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","ResendOTP$1","memo"],"mappings":";;;;;;AASA,MAAMA,IAAuC,CAAC;AAAA,EAC5C,aAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,cAAAC,IAAe;AAAA,EACf,UAAAC;AACF,MAAM;AACJ,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,UAAAC,EAAA,IAAaC,EAAe;AAAA,IACzD,gBAAgBN;AAAA,EAAA,CACjB,GAEKO,IAAoBC,EAAY,MAAM;AAC5B,IAAAV,KAAA,QAAAA,KACHM;EAAA,GACV,CAACN,GAAaM,CAAU,CAAC,GAEtBK,IAAyBD,EAAY,MAAM;AAC5B,IAAAT,KAAA,QAAAA,KACRK;EAAA,GACV,CAACL,GAAkBK,CAAU,CAAC;AAEjC,SACG,gBAAAM,EAAAC,GAAA,EACE,UAACR,IAUC,gBAAAS,EAAAD,GAAA,EAAS,gBAAe,OAAM,aAAY,UAAS,iBAAiB,KACnE,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,UAAAX;AAAA,QACA,OAAM;AAAA,QACN,OAAM;AAAA,QACN,SAASK;AAAA,MAAA;AAAA,IACX;AAAA,IACCN,KAEG,gBAAAW,EAAAE,GAAA,EAAA,UAAA;AAAA,MAAA,gBAAAJ,EAACK,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,MAAA;AAAA,MACA,gBAAAL,EAACC,GAAS,EAAA,QAAQ,KAChB,UAAA,gBAAAD;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,OAAM;AAAA,UACN,SAASJ;AAAA,QAAA;AAAA,MAAA,GAEb;AAAA,IAAA,GACF;AAAA,EAAA,EAEJ,CAAA,IA9BC,gBAAAC,EAAAC,GAAA,EAAS,QAAQ,KAChB,UAAC,gBAAAC,EAAAG,GAAA,EAAK,WAAU,OAAM,QAAO,cAAa,UAAA;AAAA,IAAA;AAAA,IAC9B;AAAA,IACV,gBAAAL,EAACK,KAAK,WAAU,YAAW,SAAO,IAAC,QAAO,cACvC,UACHV,EAAA,CAAA;AAAA,EACF,EAAA,CAAA,EACF,CAAA,EAyBJ,CAAA;AAEJ,GAEeW,IAAAC,EAAKpB,CAAS;"}
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 f } from "react/jsx-runtime";
2
- import { memo as g, useCallback as h } from "react";
3
- import $ from "../../../ui/buttons/button/button.js";
4
- import b from "../../../ui/inputs/text-input/text-input.js";
5
- import a from "../../../ui/layout/flex-view.js";
6
- import k from "../../comps/input-status-icon/input-status-icon.js";
7
- import { useResendTimer as C } from "../../comps/resend-otp/hooks/use-resend-timer.js";
8
- const x = ({
9
- onSubmit: i,
10
- onChange: t,
11
- value: r,
12
- error: s,
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 { canResend: o, resetTimer: d, timeLeft: c } = C({
17
- initialSeconds: 30
18
- }), l = () => {
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
- [t]
19
+ [r]
25
20
  );
26
21
  return /* @__PURE__ */ e(
27
- a,
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__ */ f(a, { $alignItems: "center", $justifyContent: "space-between", $flex: 1, children: [
30
+ children: /* @__PURE__ */ u(o, { $alignItems: "center", $justifyContent: "space-between", $flex: 1, children: [
36
31
  /* @__PURE__ */ e(
37
- b,
32
+ p,
38
33
  {
39
- renderAs: s ? "error-dark" : n ? "success-dark" : "primary-dark",
34
+ renderAs: t ? "error-dark" : n ? "success-dark" : "primary-dark",
40
35
  autoFocus: !0,
41
36
  label: "Verification code",
42
- value: r,
43
- onChange: u,
37
+ value: i,
38
+ onChange: m,
44
39
  width: 330,
45
40
  required: !0,
46
41
  shape: "borderLess",
47
- errorMessage: r,
48
- siblingElement: /* @__PURE__ */ e(k, { isError: !!s, isValid: n, isLoading: m })
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
- size: "small",
55
- renderAs: "secondary-dark",
56
- type: "submit",
57
- label: o ? "Resend" : `Resend in ${c}`,
49
+ renderAs: "submit",
50
+ timerSeconds: 15,
51
+ onResendOTP: a,
58
52
  width: 336,
59
- onClick: l,
60
- disabled: !o
53
+ disabled: s
61
54
  }
62
55
  )
63
56
  ] })
64
57
  }
65
58
  );
66
- }, A = g(x);
59
+ }, w = c(h);
67
60
  export {
68
- A as default
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 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 { useResendTimer } from '../../comps/resend-otp/hooks/use-resend-timer';\n\nconst OTPForm = ({\n onSubmit,\n onChange,\n value,\n error,\n isProcessing,\n isValid = false,\n}: ISingleFieldFormProps) => {\n const { canResend, resetTimer, timeLeft } = useResendTimer({\n initialSeconds: 30,\n });\n\n const handleResendClick = () => {\n onSubmit();\n resetTimer();\n };\n\n const handleUsernameChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('username', 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={handleUsernameChange}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={value}\n siblingElement={\n <InputStatusIcon isError={!!error} isValid={isValid} isLoading={isProcessing} />\n }\n />\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label={canResend ? 'Resend' : `Resend in ${timeLeft}`}\n width={336}\n onClick={handleResendClick}\n disabled={!canResend}\n />\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(OTPForm);\n"],"names":["OTPForm","onSubmit","onChange","value","error","isProcessing","isValid","canResend","resetTimer","timeLeft","useResendTimer","handleResendClick","handleUsernameChange","useCallback","e","jsx","FlexView","TextInput","InputStatusIcon","Button","otpForm","memo"],"mappings":";;;;;;;AAUA,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,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,UAAAC,EAAA,IAAaC,EAAe;AAAA,IACzD,gBAAgB;AAAA,EAAA,CACjB,GAEKC,IAAoB,MAAM;AACrB,IAAAV,KACEO;EAAA,GAGPI,IAAuBC;AAAA,IAC3B,CAACC,MAAqC;AAC3B,MAAAZ,EAAA,YAAYY,EAAE,OAAO,KAAK;AAAA,IACrC;AAAA,IACA,CAACZ,CAAQ;AAAA,EAAA;AAMT,SAAA,gBAAAa;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,UAAUb,IAAQ,eAbJE,IAAU,iBAAiB;AAAA,YAczC,WAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAAH;AAAA,YACA,UAAUS;AAAA,YACV,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,cAAcT;AAAA,YACd,kCACGe,GAAgB,EAAA,SAAS,CAAC,CAACd,GAAO,SAAAE,GAAkB,WAAWD,GAAc;AAAA,UAAA;AAAA,QAElF;AAAA,QACA,gBAAAU;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAS;AAAA,YACT,MAAK;AAAA,YACL,OAAOZ,IAAY,WAAW,aAAaE,CAAQ;AAAA,YACnD,OAAO;AAAA,YACP,SAASE;AAAA,YACT,UAAU,CAACJ;AAAA,UAAA;AAAA,QACb;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEea,IAAAC,EAAKrB,CAAO;"}
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 r, jsxs as l } from "react/jsx-runtime";
2
- import { memo as c, useCallback as f } from "react";
3
- import g from "../../../ui/buttons/button/button.js";
4
- import h from "../../../ui/inputs/text-input/text-input.js";
5
- import b from "../../../ui/layout/flex-view.js";
6
- import I from "../../comps/input-status-icon/input-status-icon.js";
7
- import { FormWrapper as $ } from "../forgot-password-styled.js";
8
- const k = ({
9
- onSubmit: s,
10
- onChange: o,
11
- value: i,
12
- error: e,
13
- isSubmitDisabled: a,
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: m = !1,
16
- label: u,
17
- field: t
15
+ isValid: a = !1,
16
+ label: m
18
17
  }) => {
19
18
  const d = f(
20
- (p) => {
21
- t && o(t, p.target.value);
19
+ (u) => {
20
+ t("identifier", u.target.value);
22
21
  },
23
- [o, t]
22
+ [t]
24
23
  );
25
- return /* @__PURE__ */ r(
26
- b,
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($, { onSubmit: s, children: [
35
- /* @__PURE__ */ r(
36
- h,
33
+ children: /* @__PURE__ */ l(I, { onSubmit: i, children: [
34
+ /* @__PURE__ */ e(
35
+ g,
37
36
  {
38
- renderAs: e ? "error-dark" : "primary-dark",
37
+ renderAs: r ? "error-dark" : "primary-dark",
39
38
  autoFocus: !0,
40
- label: u,
41
- value: i,
39
+ label: m,
40
+ value: o,
42
41
  onChange: d,
43
42
  width: 330,
44
43
  required: !0,
45
44
  shape: "borderLess",
46
- errorMessage: e,
47
- siblingElement: /* @__PURE__ */ r(I, { isError: !!e, isValid: m, isLoading: !1 })
45
+ errorMessage: r,
46
+ siblingElement: /* @__PURE__ */ e(b, { isError: !!r, isValid: a, isLoading: !1 })
48
47
  }
49
48
  ),
50
- /* @__PURE__ */ r(
51
- g,
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: a
58
+ disabled: s
60
59
  }
61
60
  )
62
61
  ] })
63
62
  }
64
63
  );
65
- }, L = c(k);
64
+ }, A = p($);
66
65
  export {
67
- L as default
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 field,\n}: ISingleFieldFormProps) => {\n const handleInputChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n field && onChange(field, e.target.value);\n },\n [onChange, field],\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","field","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;AAAA,EACA,OAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAoBC;AAAA,IACxB,CAACC,MAAqC;AACpC,MAAAH,KAASP,EAASO,GAAOG,EAAE,OAAO,KAAK;AAAA,IACzC;AAAA,IACA,CAACV,GAAUO,CAAK;AAAA,EAAA;AAIhB,SAAA,gBAAAI;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,UAAAf,GAClB,UAAA;AAAA,QAAA,gBAAAY;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,UAAUb,IAAQ,eAAe;AAAA,YACjC,WAAS;AAAA,YACT,OAAAI;AAAA,YACA,OAAAL;AAAA,YACA,UAAUO;AAAA,YACV,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,cAAcN;AAAA,YACd,kCAAiBc,GAAgB,EAAA,SAAS,CAAC,CAACd,GAAO,SAAAG,GAAkB,WAAW,IAAO;AAAA,UAAA;AAAA,QACzF;AAAA,QACA,gBAAAM;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAS;AAAA,YACT,MAAK;AAAA,YACL,OAAM;AAAA,YACN,OAAO;AAAA,YACP,MAAMb;AAAA,YACN,UAAUD;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEee,IAAAC,EAAKrB,CAAkB;"}
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;"}
@@ -1,89 +1,99 @@
1
- import { jsx as e, jsxs as d, Fragment as $ } from "react/jsx-runtime";
2
- import { memo as y } from "react";
3
- import x from "../../../ui/buttons/button/button.js";
4
- import c from "../../../ui/inputs/text-input/text-input.js";
5
- import n from "../../../ui/layout/flex-view.js";
6
- import s from "../../../ui/separator/separator.js";
7
- import u from "../../comps/input-status-icon/input-status-icon.js";
8
- import F from "../../comps/resend-otp/resend-otp.js";
9
- import { FormWrapper as C } from "./identifier-otp-form-styled.js";
10
- const E = ({
1
+ import { jsx as e, jsxs as n, Fragment as C } from "react/jsx-runtime";
2
+ import { memo as F, useCallback as c } from "react";
3
+ import E from "../../../ui/buttons/button/button.js";
4
+ import u from "../../../ui/inputs/text-input/text-input.js";
5
+ import s from "../../../ui/layout/flex-view.js";
6
+ import l from "../../../ui/separator/separator.js";
7
+ import p from "../../comps/input-status-icon/input-status-icon.js";
8
+ import v from "../../comps/resend-otp/resend-otp.js";
9
+ import { FormWrapper as A } from "./identifier-otp-form-styled.js";
10
+ const S = ({
11
11
  identifier: f,
12
- otp: l,
12
+ otp: m,
13
13
  errors: r,
14
14
  isOtpVerified: i,
15
- isLoading: a,
16
- isSubmitDisabled: p,
15
+ isLoading: d,
16
+ isSubmitDisabled: h,
17
17
  showOtpInput: t,
18
- onChange: m,
18
+ onChange: a,
19
19
  onSubmit: g,
20
- onSendOtp: h
20
+ onSendOtp: b
21
21
  }) => {
22
- const b = t ? "success-dark" : "primary-dark", k = i ? "success-dark" : "primary-dark";
23
- return /* @__PURE__ */ e(n, { $gutterX: 2, $gapX: 1.5, $background: "BLACK_2", $height: 308, children: /* @__PURE__ */ d(C, { onSubmit: g, children: [
24
- /* @__PURE__ */ d(n, { $alignItems: "center", $justifyContent: "center", children: [
22
+ const k = t ? "success-dark" : "primary-dark", $ = i ? "success-dark" : "primary-dark", y = c(
23
+ (o) => {
24
+ a("identifier", o.target.value);
25
+ },
26
+ [a]
27
+ ), x = c(
28
+ (o) => {
29
+ a("otp", o.target.value);
30
+ },
31
+ [a]
32
+ );
33
+ return /* @__PURE__ */ e(s, { $gutterX: 2, $gapX: 1.5, $background: "BLACK_2", $height: 308, children: /* @__PURE__ */ n(A, { onSubmit: g, children: [
34
+ /* @__PURE__ */ n(s, { $alignItems: "center", $justifyContent: "center", children: [
25
35
  /* @__PURE__ */ e(
26
- c,
36
+ u,
27
37
  {
28
- renderAs: r.identifier ? "error-dark" : b,
38
+ renderAs: r.identifier ? "error-dark" : k,
29
39
  autoFocus: !0,
30
40
  label: "Email or Phone",
31
41
  value: f,
32
- onChange: (o) => m("identifier", o.target.value),
42
+ onChange: y,
33
43
  width: 330,
34
44
  required: !0,
35
45
  shape: "borderLess",
36
46
  errorMessage: r.identifier,
37
47
  disabled: t,
38
- siblingElement: /* @__PURE__ */ e(u, { isValid: t, isError: !!r.identifier })
48
+ siblingElement: /* @__PURE__ */ e(p, { isValid: t, isError: !!r.identifier })
39
49
  }
40
50
  ),
41
- t && /* @__PURE__ */ d($, { children: [
42
- /* @__PURE__ */ e(s, { height: 36 }),
51
+ t && /* @__PURE__ */ n(C, { children: [
52
+ /* @__PURE__ */ e(l, { height: 36 }),
43
53
  /* @__PURE__ */ e(
44
- c,
54
+ u,
45
55
  {
46
56
  type: "password",
47
- renderAs: r.otp ? "error-dark" : k,
57
+ renderAs: r.otp ? "error-dark" : $,
48
58
  autoComplete: "password",
49
59
  label: "Verification code",
50
- value: l,
51
- onChange: (o) => m("otp", o.target.value),
60
+ value: m,
61
+ onChange: x,
52
62
  width: 330,
53
63
  required: !0,
54
64
  shape: "borderLess",
55
65
  errorMessage: r.otp,
56
- disabled: i || l.length === 4 && a,
66
+ disabled: i || m.length === 4 && d,
57
67
  siblingElement: /* @__PURE__ */ e(
58
- u,
68
+ p,
59
69
  {
60
- isLoading: a,
70
+ isLoading: d,
61
71
  isValid: i,
62
72
  isError: !!r.otp
63
73
  }
64
74
  )
65
75
  }
66
76
  ),
67
- /* @__PURE__ */ e(s, { heightX: 1.25 }),
68
- /* @__PURE__ */ e(n, { $alignItems: "flex-end", $width: "100%", children: /* @__PURE__ */ e(F, { onResendOTP: h, disabled: i }) }),
69
- /* @__PURE__ */ e(s, { heightX: 2 })
77
+ /* @__PURE__ */ e(l, { heightX: 1.25 }),
78
+ /* @__PURE__ */ e(s, { $alignItems: "flex-end", $width: "100%", children: /* @__PURE__ */ e(v, { onResendOTP: b, disabled: i }) }),
79
+ /* @__PURE__ */ e(l, { heightX: 2 })
70
80
  ] })
71
81
  ] }),
72
82
  /* @__PURE__ */ e(
73
- x,
83
+ E,
74
84
  {
75
85
  size: "small",
76
86
  renderAs: "secondary-dark",
77
87
  type: "submit",
78
88
  label: t ? "Log In" : "Get Verification Code",
79
89
  width: 336,
80
- busy: !t && a,
81
- disabled: p
90
+ busy: !t && d,
91
+ disabled: h
82
92
  }
83
93
  )
84
94
  ] }) });
85
- }, w = y(E);
95
+ }, P = F(S);
86
96
  export {
87
- w as default
97
+ P as default
88
98
  };
89
99
  //# sourceMappingURL=identifier-otp-form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"identifier-otp-form.js","sources":["../../../../../src/features/auth/login/identifier-otp-form/identifier-otp-form.tsx"],"sourcesContent":["// In @cuemath/leap/src/components/IdentifierOtpForm.tsx\n\nimport type { IIdentifierOtpFormProps } from './identifier-otp-form-types';\n\nimport React, { type ChangeEvent, memo } 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 onChange,\n onSubmit,\n onSendOtp,\n}) => {\n const identifierStatusVariant = showOtpInput ? 'success-dark' : 'primary-dark';\n const otpStatusVariant = isOtpVerified ? 'success-dark' : 'primary-dark';\n\n return (\n <FlexView $gutterX={2} $gapX={1.5} $background=\"BLACK_2\" $height={308}>\n <Styled.FormWrapper onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.identifier ? 'error-dark' : identifierStatusVariant}\n autoFocus\n label=\"Email or Phone\"\n value={identifier}\n onChange={(e: ChangeEvent<HTMLInputElement>) => onChange('identifier', e.target.value)}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={errors.identifier}\n disabled={showOtpInput}\n siblingElement={\n <InputStatusIcon isValid={showOtpInput} isError={!!errors.identifier} />\n }\n />\n {showOtpInput && (\n <>\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.otp ? 'error-dark' : otpStatusVariant}\n autoComplete=\"password\"\n label=\"Verification code\"\n value={otp}\n onChange={(e: ChangeEvent<HTMLInputElement>) => onChange('otp', e.target.value)}\n width={330}\n required\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={336}\n busy={!showOtpInput && isLoading}\n disabled={isSubmitDisabled}\n />\n </Styled.FormWrapper>\n </FlexView>\n );\n};\n\nexport default memo(IdentifierOtpForm);\n"],"names":["IdentifierOtpForm","identifier","otp","errors","isOtpVerified","isLoading","isSubmitDisabled","showOtpInput","onChange","onSubmit","onSendOtp","identifierStatusVariant","otpStatusVariant","jsx","FlexView","jsxs","Styled.FormWrapper","TextInput","e","InputStatusIcon","Fragment","Separator","ResendOTP","Button","identifierOtpForm","memo"],"mappings":";;;;;;;;;AAcA,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,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,MAAM;AACE,QAAAC,IAA0BJ,IAAe,iBAAiB,gBAC1DK,IAAmBR,IAAgB,iBAAiB;AAE1D,SACG,gBAAAS,EAAAC,GAAA,EAAS,UAAU,GAAG,OAAO,KAAK,aAAY,WAAU,SAAS,KAChE,UAAA,gBAAAC,EAACC,GAAA,EAAmB,UAAAP,GAClB,UAAA;AAAA,IAAA,gBAAAM,EAACD,GAAS,EAAA,aAAY,UAAS,iBAAgB,UAC7C,UAAA;AAAA,MAAA,gBAAAD;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,UAAUd,EAAO,aAAa,eAAeQ;AAAA,UAC7C,WAAS;AAAA,UACT,OAAM;AAAA,UACN,OAAOV;AAAA,UACP,UAAU,CAACiB,MAAqCV,EAAS,cAAcU,EAAE,OAAO,KAAK;AAAA,UACrF,OAAO;AAAA,UACP,UAAQ;AAAA,UACR,OAAM;AAAA,UACN,cAAcf,EAAO;AAAA,UACrB,UAAUI;AAAA,UACV,kCACGY,GAAgB,EAAA,SAASZ,GAAc,SAAS,CAAC,CAACJ,EAAO,YAAY;AAAA,QAAA;AAAA,MAE1E;AAAA,MACCI,KAEG,gBAAAQ,EAAAK,GAAA,EAAA,UAAA;AAAA,QAAC,gBAAAP,EAAAQ,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,QACvB,gBAAAR;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAUd,EAAO,MAAM,eAAeS;AAAA,YACtC,cAAa;AAAA,YACb,OAAM;AAAA,YACN,OAAOV;AAAA,YACP,UAAU,CAACgB,MAAqCV,EAAS,OAAOU,EAAE,OAAO,KAAK;AAAA,YAC9E,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,cAAcf,EAAO;AAAA,YACrB,UAAUC,KAAkBF,EAAI,WAAW,KAAKG;AAAA,YAChD,gBACE,gBAAAQ;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,WAAAd;AAAA,gBACA,SAASD;AAAA,gBACT,SAAS,CAAC,CAACD,EAAO;AAAA,cAAA;AAAA,YACpB;AAAA,UAAA;AAAA,QAEJ;AAAA,QACA,gBAAAU,EAACQ,GAAU,EAAA,SAAS,KAAM,CAAA;AAAA,QACzB,gBAAAR,EAAAC,GAAA,EAAS,aAAY,YAAW,QAAO,QACtC,UAAC,gBAAAD,EAAAS,GAAA,EAAU,aAAaZ,GAAW,UAAUN,EAAe,CAAA,GAC9D;AAAA,QACA,gBAAAS,EAACQ,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,MAAA,GACzB;AAAA,IAAA,GAEJ;AAAA,IACA,gBAAAR;AAAA,MAACU;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAS;AAAA,QACT,MAAK;AAAA,QACL,OAAOhB,IAAe,WAAW;AAAA,QACjC,OAAO;AAAA,QACP,MAAM,CAACA,KAAgBF;AAAA,QACvB,UAAUC;AAAA,MAAA;AAAA,IACZ;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,GAEekB,IAAAC,EAAKzB,CAAiB;"}
1
+ {"version":3,"file":"identifier-otp-form.js","sources":["../../../../../src/features/auth/login/identifier-otp-form/identifier-otp-form.tsx"],"sourcesContent":["// In @cuemath/leap/src/components/IdentifierOtpForm.tsx\n\nimport 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 onChange,\n onSubmit,\n onSendOtp,\n}) => {\n const identifierStatusVariant = showOtpInput ? 'success-dark' : 'primary-dark';\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 <FlexView $gutterX={2} $gapX={1.5} $background=\"BLACK_2\" $height={308}>\n <Styled.FormWrapper onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.identifier ? 'error-dark' : identifierStatusVariant}\n autoFocus\n label=\"Email or Phone\"\n value={identifier}\n onChange={handleIdentifierChange}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={errors.identifier}\n disabled={showOtpInput}\n siblingElement={\n <InputStatusIcon isValid={showOtpInput} isError={!!errors.identifier} />\n }\n />\n {showOtpInput && (\n <>\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.otp ? 'error-dark' : otpStatusVariant}\n autoComplete=\"password\"\n label=\"Verification code\"\n value={otp}\n onChange={handleOtpChange}\n width={330}\n required\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={336}\n busy={!showOtpInput && isLoading}\n disabled={isSubmitDisabled}\n />\n </Styled.FormWrapper>\n </FlexView>\n );\n};\n\nexport default memo(IdentifierOtpForm);\n"],"names":["IdentifierOtpForm","identifier","otp","errors","isOtpVerified","isLoading","isSubmitDisabled","showOtpInput","onChange","onSubmit","onSendOtp","identifierStatusVariant","otpStatusVariant","handleIdentifierChange","useCallback","e","handleOtpChange","jsx","FlexView","jsxs","Styled.FormWrapper","TextInput","InputStatusIcon","Fragment","Separator","ResendOTP","Button","identifierOtpForm","memo"],"mappings":";;;;;;;;;AAcA,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,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,MAAM;AACE,QAAAC,IAA0BJ,IAAe,iBAAiB,gBAC1DK,IAAmBR,IAAgB,iBAAiB,gBAEpDS,IAAyBC;AAAA,IAC7B,CAACC,MAAqC;AAC3B,MAAAP,EAAA,cAAcO,EAAE,OAAO,KAAK;AAAA,IACvC;AAAA,IACA,CAACP,CAAQ;AAAA,EAAA,GAGLQ,IAAkBF;AAAA,IACtB,CAACC,MAAqC;AAC3B,MAAAP,EAAA,OAAOO,EAAE,OAAO,KAAK;AAAA,IAChC;AAAA,IACA,CAACP,CAAQ;AAAA,EAAA;AAGX,SACG,gBAAAS,EAAAC,GAAA,EAAS,UAAU,GAAG,OAAO,KAAK,aAAY,WAAU,SAAS,KAChE,UAAA,gBAAAC,EAACC,GAAA,EAAmB,UAAAX,GAClB,UAAA;AAAA,IAAA,gBAAAU,EAACD,GAAS,EAAA,aAAY,UAAS,iBAAgB,UAC7C,UAAA;AAAA,MAAA,gBAAAD;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,UAAUlB,EAAO,aAAa,eAAeQ;AAAA,UAC7C,WAAS;AAAA,UACT,OAAM;AAAA,UACN,OAAOV;AAAA,UACP,UAAUY;AAAA,UACV,OAAO;AAAA,UACP,UAAQ;AAAA,UACR,OAAM;AAAA,UACN,cAAcV,EAAO;AAAA,UACrB,UAAUI;AAAA,UACV,kCACGe,GAAgB,EAAA,SAASf,GAAc,SAAS,CAAC,CAACJ,EAAO,YAAY;AAAA,QAAA;AAAA,MAE1E;AAAA,MACCI,KAEG,gBAAAY,EAAAI,GAAA,EAAA,UAAA;AAAA,QAAC,gBAAAN,EAAAO,GAAA,EAAU,QAAQ,GAAI,CAAA;AAAA,QACvB,gBAAAP;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAUlB,EAAO,MAAM,eAAeS;AAAA,YACtC,cAAa;AAAA,YACb,OAAM;AAAA,YACN,OAAOV;AAAA,YACP,UAAUc;AAAA,YACV,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,cAAcb,EAAO;AAAA,YACrB,UAAUC,KAAkBF,EAAI,WAAW,KAAKG;AAAA,YAChD,gBACE,gBAAAY;AAAA,cAACK;AAAA,cAAA;AAAA,gBACC,WAAAjB;AAAA,gBACA,SAASD;AAAA,gBACT,SAAS,CAAC,CAACD,EAAO;AAAA,cAAA;AAAA,YACpB;AAAA,UAAA;AAAA,QAEJ;AAAA,QACA,gBAAAc,EAACO,GAAU,EAAA,SAAS,KAAM,CAAA;AAAA,QACzB,gBAAAP,EAAAC,GAAA,EAAS,aAAY,YAAW,QAAO,QACtC,UAAC,gBAAAD,EAAAQ,GAAA,EAAU,aAAaf,GAAW,UAAUN,EAAe,CAAA,GAC9D;AAAA,QACA,gBAAAa,EAACO,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,MAAA,GACzB;AAAA,IAAA,GAEJ;AAAA,IACA,gBAAAP;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAS;AAAA,QACT,MAAK;AAAA,QACL,OAAOnB,IAAe,WAAW;AAAA,QACjC,OAAO;AAAA,QACP,MAAM,CAACA,KAAgBF;AAAA,QACvB,UAAUC;AAAA,MAAA;AAAA,IACZ;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,GAEeqB,IAAAC,EAAK5B,CAAiB;"}