@cuemath/leap 3.0.11-j4 → 3.0.11-j6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,21 @@
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";
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { memo as l, useCallback as p } from "react";
3
+ import f from "../../../ui/inputs/text-input/text-input.js";
4
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 = ({
5
+ import g from "../../comps/input-status-icon/input-status-icon.js";
6
+ import h from "../../comps/resend-otp/resend-otp.js";
7
+ const $ = ({
8
8
  onSubmit: a,
9
9
  onChange: r,
10
10
  value: i,
11
11
  error: t,
12
12
  isProcessing: s,
13
- isValid: n = !1
13
+ isValid: n = !1,
14
+ helperText: m
14
15
  }) => {
15
- const m = l(
16
- (d) => {
17
- r("otp", d.target.value);
16
+ const d = p(
17
+ (u) => {
18
+ r("otp", u.target.value);
18
19
  },
19
20
  [r]
20
21
  );
@@ -27,24 +28,25 @@ const h = ({
27
28
  $justifyContent: "center",
28
29
  $background: "BLACK_2",
29
30
  $height: 308,
30
- children: /* @__PURE__ */ u(o, { $alignItems: "center", $justifyContent: "space-between", $flex: 1, children: [
31
+ children: /* @__PURE__ */ c(o, { $alignItems: "center", $justifyContent: "space-between", $flex: 1, children: [
31
32
  /* @__PURE__ */ e(
32
- p,
33
+ f,
33
34
  {
34
35
  renderAs: t ? "error-dark" : n ? "success-dark" : "primary-dark",
35
36
  autoFocus: !0,
36
37
  label: "Verification code",
37
38
  value: i,
38
- onChange: m,
39
+ onChange: d,
39
40
  width: 330,
40
41
  required: !0,
41
42
  shape: "borderLess",
42
43
  errorMessage: t,
43
- siblingElement: /* @__PURE__ */ e(f, { isError: !!t, isValid: n, isLoading: s })
44
+ siblingElement: /* @__PURE__ */ e(g, { isError: !!t, isValid: n, isLoading: s }),
45
+ helperText: m
44
46
  }
45
47
  ),
46
48
  /* @__PURE__ */ e(
47
- g,
49
+ h,
48
50
  {
49
51
  renderAs: "submit",
50
52
  timerSeconds: 15,
@@ -56,8 +58,8 @@ const h = ({
56
58
  ] })
57
59
  }
58
60
  );
59
- }, w = c(h);
61
+ }, F = l($);
60
62
  export {
61
- w as default
63
+ F as default
62
64
  };
63
65
  //# 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 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
+ {"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 helperText,\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 helperText={helperText}\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","helperText","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;AAAA,EACV,YAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAkBC;AAAA,IACtB,CAACC,MAAqC;AAC3B,MAAAR,EAAA,OAAOQ,EAAE,OAAO,KAAK;AAAA,IAChC;AAAA,IACA,CAACR,CAAQ;AAAA,EAAA;AAMT,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,UAAUT,IAAQ,eAbJE,IAAU,iBAAiB;AAAA,YAczC,WAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAAH;AAAA,YACA,UAAUK;AAAA,YACV,OAAO;AAAA,YACP,UAAQ;AAAA,YACR,OAAM;AAAA,YACN,cAAcJ;AAAA,YACd,kCACGU,GAAgB,EAAA,SAAS,CAAC,CAACV,GAAO,SAAAE,GAAkB,WAAWD,GAAc;AAAA,YAEhF,YAAAE;AAAA,UAAA;AAAA,QACF;AAAA,QACA,gBAAAI;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,cAAc;AAAA,YACd,aAAad;AAAA,YACb,OAAO;AAAA,YACP,UAAUI;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeW,IAAAC,EAAKjB,CAAO;"}
@@ -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 = ({
11
- identifier: p,
12
- otp: l,
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
+ identifier: f,
12
+ otp: m,
13
13
  errors: r,
14
14
  isOtpVerified: i,
15
- isLoading: a,
16
- isSubmitDisabled: f,
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
- value: p,
32
- onChange: (o) => m("identifier", o.target.value),
41
+ value: f,
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: f
90
+ busy: !t && d,
91
+ disabled: h
82
92
  }
83
93
  )
84
94
  ] }) });
85
- }, I = y(E);
95
+ }, P = F(S);
86
96
  export {
87
- I 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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ACP,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,U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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;"}
@@ -1,23 +1,33 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { memo as c } from "react";
3
- import g from "../../../ui/buttons/button/button.js";
4
- import f from "../../../ui/buttons/text-button/text-button.js";
5
- import l from "../../../ui/inputs/text-input/text-input.js";
6
- import t from "../../../ui/layout/flex-view.js";
7
- import o from "../../../ui/separator/separator.js";
8
- import b from "../../comps/input-status-icon/input-status-icon.js";
9
- const w = ({
10
- username: n,
11
- password: i,
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { memo as f, useCallback as l } from "react";
3
+ import w from "../../../ui/buttons/button/button.js";
4
+ import $ from "../../../ui/buttons/text-button/text-button.js";
5
+ import u from "../../../ui/inputs/text-input/text-input.js";
6
+ import s from "../../../ui/layout/flex-view.js";
7
+ import a from "../../../ui/separator/separator.js";
8
+ import y from "../../comps/input-status-icon/input-status-icon.js";
9
+ const C = ({
10
+ username: i,
11
+ password: m,
12
12
  errors: r,
13
- isLoading: m,
14
- onChange: d,
15
- onSubmit: u,
16
- onForgotPassword: p
13
+ isLoading: d,
14
+ onChange: t,
15
+ onSubmit: p,
16
+ onForgotPassword: h
17
17
  }) => {
18
- const h = m || !n.trim() || !i.trim();
19
- return /* @__PURE__ */ a(
20
- t,
18
+ const c = d || !i.trim() || !m.trim(), g = l(
19
+ (o) => {
20
+ t("username", o.target.value);
21
+ },
22
+ [t]
23
+ ), b = l(
24
+ (o) => {
25
+ t("password", o.target.value);
26
+ },
27
+ [t]
28
+ );
29
+ return /* @__PURE__ */ n(
30
+ s,
21
31
  {
22
32
  $gutterX: 2,
23
33
  $gapX: 1.5,
@@ -26,63 +36,63 @@ const w = ({
26
36
  $background: "BLACK_2",
27
37
  $height: 308,
28
38
  children: [
29
- /* @__PURE__ */ e(o, { heightX: 0.5 }),
30
- /* @__PURE__ */ a("form", { onSubmit: u, children: [
31
- /* @__PURE__ */ a(t, { $alignItems: "center", $justifyContent: "center", children: [
39
+ /* @__PURE__ */ e(a, { heightX: 0.5 }),
40
+ /* @__PURE__ */ n("form", { onSubmit: p, children: [
41
+ /* @__PURE__ */ n(s, { $alignItems: "center", $justifyContent: "center", children: [
32
42
  /* @__PURE__ */ e(
33
- l,
43
+ u,
34
44
  {
35
45
  renderAs: r.username ? "error-dark" : "primary-dark",
36
46
  autoFocus: !0,
37
47
  autoComplete: "username",
38
48
  label: "Username",
39
- value: n,
40
- onChange: (s) => d("username", s.target.value),
49
+ value: i,
50
+ onChange: g,
41
51
  width: 330,
42
52
  required: !0,
43
53
  shape: "borderLess",
44
54
  errorMessage: r.username
45
55
  }
46
56
  ),
47
- /* @__PURE__ */ e(o, { height: 36 }),
57
+ /* @__PURE__ */ e(a, { height: 36 }),
48
58
  /* @__PURE__ */ e(
49
- l,
59
+ u,
50
60
  {
51
61
  type: "password",
52
62
  renderAs: r.password ? "error-dark" : "primary-dark",
53
63
  autoComplete: "password",
54
64
  label: "Password",
55
- value: i,
56
- onChange: (s) => d("password", s.target.value),
65
+ value: m,
66
+ onChange: b,
57
67
  width: 330,
58
68
  required: !0,
59
69
  shape: "borderLess",
60
70
  errorMessage: r.password,
61
- siblingElement: /* @__PURE__ */ e(b, { isError: !!r.password })
71
+ siblingElement: /* @__PURE__ */ e(y, { isError: !!r.password })
62
72
  }
63
73
  )
64
74
  ] }),
65
- /* @__PURE__ */ e(o, { heightX: 1.25 }),
66
- /* @__PURE__ */ e(t, { $alignItems: "flex-end", children: /* @__PURE__ */ e(f, { label: "Forgot Password?", onClick: p, color: "WHITE_T_60" }) }),
67
- /* @__PURE__ */ e(o, { heightX: 2 }),
68
- /* @__PURE__ */ e(t, { $justifyContent: "center", children: /* @__PURE__ */ e(
69
- g,
75
+ /* @__PURE__ */ e(a, { heightX: 1.25 }),
76
+ /* @__PURE__ */ e(s, { $alignItems: "flex-end", children: /* @__PURE__ */ e($, { label: "Forgot Password?", onClick: h, color: "WHITE_T_60" }) }),
77
+ /* @__PURE__ */ e(a, { heightX: 2 }),
78
+ /* @__PURE__ */ e(s, { $justifyContent: "center", children: /* @__PURE__ */ e(
79
+ w,
70
80
  {
71
81
  size: "small",
72
82
  renderAs: "secondary-dark",
73
83
  type: "submit",
74
84
  label: "Log in",
75
85
  width: 336,
76
- busy: m,
77
- disabled: h
86
+ busy: d,
87
+ disabled: c
78
88
  }
79
89
  ) })
80
90
  ] })
81
91
  ]
82
92
  }
83
93
  );
84
- }, X = c(w);
94
+ }, A = f(C);
85
95
  export {
86
- X as default
96
+ A as default
87
97
  };
88
98
  //# sourceMappingURL=username-password-form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"username-password-form.js","sources":["../../../../../src/features/auth/login/username-password-form/username-password-form.tsx"],"sourcesContent":["import type { IUsernamePasswordFormProps } from './username-password-form-types';\n\nimport { type ChangeEvent, type FC, memo } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport TextButton from '../../../ui/buttons/text-button/text-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';\n\nconst UsernamePasswordForm: FC<IUsernamePasswordFormProps> = ({\n username,\n password,\n errors,\n isLoading,\n onChange,\n onSubmit,\n onForgotPassword,\n}) => {\n const isSubmitDisabled = isLoading || !username.trim() || !password.trim();\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 <Separator heightX={0.5} />\n <form onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.username ? 'error-dark' : 'primary-dark'}\n autoFocus\n autoComplete=\"username\"\n label=\"Username\"\n value={username}\n onChange={(e: ChangeEvent<HTMLInputElement>) => onChange('username', e.target.value)}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={errors.username}\n />\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.password ? 'error-dark' : 'primary-dark'}\n autoComplete=\"password\"\n label=\"Password\"\n value={password}\n onChange={(e: ChangeEvent<HTMLInputElement>) => onChange('password', e.target.value)}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={errors.password}\n siblingElement={<InputStatusIcon isError={!!errors.password} />}\n />\n </FlexView>\n <Separator heightX={1.25} />\n <FlexView $alignItems=\"flex-end\">\n <TextButton label=\"Forgot Password?\" onClick={onForgotPassword} color=\"WHITE_T_60\" />\n </FlexView>\n <Separator heightX={2} />\n <FlexView $justifyContent=\"center\">\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label=\"Log in\"\n width={336}\n busy={isLoading}\n disabled={isSubmitDisabled}\n />\n </FlexView>\n </form>\n </FlexView>\n );\n};\n\nexport default memo(UsernamePasswordForm);\n"],"names":["UsernamePasswordForm","username","password","errors","isLoading","onChange","onSubmit","onForgotPassword","isSubmitDisabled","jsxs","FlexView","jsx","Separator","TextInput","e","InputStatusIcon","TextButton","Button","usernamePasswordForm","memo"],"mappings":";;;;;;;;AAWA,MAAMA,IAAuD,CAAC;AAAA,EAC5D,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACE,QAAAC,IAAmBJ,KAAa,CAACH,EAAS,UAAU,CAACC,EAAS;AAGlE,SAAA,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAU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,GAAA,EAAW,OAAM,oBAAmB,SAAST,GAAkB,OAAM,aAAa,CAAA,GACrF;AAAA,UACA,gBAAAI,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,UACvB,gBAAAD,EAACD,GAAS,EAAA,iBAAgB,UACxB,UAAA,gBAAAC;AAAA,YAACM;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAS;AAAA,cACT,MAAK;AAAA,cACL,OAAM;AAAA,cACN,OAAO;AAAA,cACP,MAAMb;AAAA,cACN,UAAUI;AAAA,YAAA;AAAA,UAAA,GAEd;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeU,IAAAC,EAAKnB,CAAoB;"}
1
+ {"version":3,"file":"username-password-form.js","sources":["../../../../../src/features/auth/login/username-password-form/username-password-form.tsx"],"sourcesContent":["import type { IUsernamePasswordFormProps } from './username-password-form-types';\n\nimport { type ChangeEvent, type FC, memo, useCallback } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport TextButton from '../../../ui/buttons/text-button/text-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';\n\nconst UsernamePasswordForm: FC<IUsernamePasswordFormProps> = ({\n username,\n password,\n errors,\n isLoading,\n onChange,\n onSubmit,\n onForgotPassword,\n}) => {\n const isSubmitDisabled = isLoading || !username.trim() || !password.trim();\n\n const handleUsernameChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('username', e.target.value);\n },\n [onChange],\n );\n\n const handlePasswordChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('password', 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 <Separator heightX={0.5} />\n <form onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.username ? 'error-dark' : 'primary-dark'}\n autoFocus\n autoComplete=\"username\"\n label=\"Username\"\n value={username}\n onChange={handleUsernameChange}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={errors.username}\n />\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.password ? 'error-dark' : 'primary-dark'}\n autoComplete=\"password\"\n label=\"Password\"\n value={password}\n onChange={handlePasswordChange}\n width={330}\n required\n shape=\"borderLess\"\n errorMessage={errors.password}\n siblingElement={<InputStatusIcon isError={!!errors.password} />}\n />\n </FlexView>\n <Separator heightX={1.25} />\n <FlexView $alignItems=\"flex-end\">\n <TextButton label=\"Forgot Password?\" onClick={onForgotPassword} color=\"WHITE_T_60\" />\n </FlexView>\n <Separator heightX={2} />\n <FlexView $justifyContent=\"center\">\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label=\"Log in\"\n width={336}\n busy={isLoading}\n disabled={isSubmitDisabled}\n />\n </FlexView>\n </form>\n </FlexView>\n );\n};\n\nexport default memo(UsernamePasswordForm);\n"],"names":["UsernamePasswordForm","username","password","errors","isLoading","onChange","onSubmit","onForgotPassword","isSubmitDisabled","handleUsernameChange","useCallback","e","handlePasswordChange","jsxs","FlexView","jsx","Separator","TextInput","InputStatusIcon","TextButton","Button","usernamePasswordForm","memo"],"mappings":";;;;;;;;AAWA,MAAMA,IAAuD,CAAC;AAAA,EAC5D,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACE,QAAAC,IAAmBJ,KAAa,CAACH,EAAS,UAAU,CAACC,EAAS,QAE9DO,IAAuBC;AAAA,IAC3B,CAACC,MAAqC;AAC3B,MAAAN,EAAA,YAAYM,EAAE,OAAO,KAAK;AAAA,I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AAA,UAAA,GACF;AAAA,UACA,gBAAAY,EAACC,GAAU,EAAA,SAAS,KAAM,CAAA;AAAA,UACzB,gBAAAD,EAAAD,GAAA,EAAS,aAAY,YACpB,UAAC,gBAAAC,EAAAI,GAAA,EAAW,OAAM,oBAAmB,SAASZ,GAAkB,OAAM,aAAa,CAAA,GACrF;AAAA,UACA,gBAAAQ,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,UACvB,gBAAAD,EAACD,GAAS,EAAA,iBAAgB,UACxB,UAAA,gBAAAC;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAS;AAAA,cACT,MAAK;AAAA,cACL,OAAM;AAAA,cACN,OAAO;AAAA,cACP,MAAMhB;AAAA,cACN,UAAUI;AAAA,YAAA;AAAA,UAAA,GAEd;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEea,IAAAC,EAAKtB,CAAoB;"}
@@ -1,13 +1,14 @@
1
1
  import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
- import n from "../../../../../assets/line-icons/icons/chevron-down.js";
3
- import i from "../../../../ui/layout/flex-view.js";
4
- import d from "../../../../ui/text/text.js";
5
- import { CountryCodeButton as $ } from "./country-selector-styled.js";
6
- const C = ({
2
+ import { memo as n } from "react";
3
+ import i from "../../../../../assets/line-icons/icons/chevron-down.js";
4
+ import d from "../../../../ui/layout/flex-view.js";
5
+ import m from "../../../../ui/text/text.js";
6
+ import { CountryCodeButton as u } from "./country-selector-styled.js";
7
+ const $ = ({
7
8
  value: t,
8
9
  menuVisible: e
9
10
  }) => /* @__PURE__ */ o(
10
- $,
11
+ u,
11
12
  {
12
13
  $background: "BLACK_5",
13
14
  $borderRadius: 4,
@@ -19,15 +20,15 @@ const C = ({
19
20
  $flexDirection: "row",
20
21
  $flexGap: 2,
21
22
  children: [
22
- /* @__PURE__ */ o(d, { $renderAs: "ab1", $color: "WHITE", children: [
23
+ /* @__PURE__ */ o(m, { $renderAs: "ab1", $color: "WHITE", children: [
23
24
  "+",
24
25
  t
25
26
  ] }),
26
- /* @__PURE__ */ r(i, { $width: 20, children: /* @__PURE__ */ r(n, { width: 20, height: 20, color: "WHITE" }) })
27
+ /* @__PURE__ */ r(d, { $width: 20, children: /* @__PURE__ */ r(i, { width: 20, height: 20, color: "WHITE" }) })
27
28
  ]
28
29
  }
29
- );
30
+ ), p = n($);
30
31
  export {
31
- C as default
32
+ p as default
32
33
  };
33
34
  //# sourceMappingURL=country-code-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"country-code-button.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/country-selector/country-code-button.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport ChevronDownIcon from '../../../../../assets/line-icons/icons/chevron-down';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './country-selector-styled';\n\nconst CountryCodeButton: FC<{ value?: string; menuVisible?: boolean }> = ({\n value,\n menuVisible,\n}) => {\n return (\n <Styled.CountryCodeButton\n $background=\"BLACK_5\"\n $borderRadius={4}\n $gutterX={0.5}\n $gap={5}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $borderColor={menuVisible ? 'WHITE_T_38' : 'BLACK_5'}\n $flexDirection=\"row\"\n $flexGap={2}\n >\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n +{value}\n </Text>\n <FlexView $width={20}>\n <ChevronDownIcon width={20} height={20} color=\"WHITE\" />\n </FlexView>\n </Styled.CountryCodeButton>\n );\n};\n\nexport default CountryCodeButton;\n"],"names":["CountryCodeButton","value","menuVisible","jsxs","Styled.CountryCodeButton","Text","jsx","FlexView","ChevronDownIcon"],"mappings":";;;;;AAOA,MAAMA,IAAmE,CAAC;AAAA,EACxE,OAAAC;AAAA,EACA,aAAAC;AACF,MAEI,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,aAAY;AAAA,IACZ,eAAe;AAAA,IACf,UAAU;AAAA,IACV,MAAM;AAAA,IACN,aAAY;AAAA,IACZ,iBAAgB;AAAA,IAChB,cAAcF,IAAc,eAAe;AAAA,IAC3C,gBAAe;AAAA,IACf,UAAU;AAAA,IAEV,UAAA;AAAA,MAAA,gBAAAC,EAACE,GAAK,EAAA,WAAU,OAAM,QAAO,SAAQ,UAAA;AAAA,QAAA;AAAA,QACjCJ;AAAA,MAAA,GACJ;AAAA,MACC,gBAAAK,EAAAC,GAAA,EAAS,QAAQ,IAChB,UAAC,gBAAAD,EAAAE,GAAA,EAAgB,OAAO,IAAI,QAAQ,IAAI,OAAM,QAAQ,CAAA,GACxD;AAAA,IAAA;AAAA,EAAA;AAAA;"}
1
+ {"version":3,"file":"country-code-button.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/country-selector/country-code-button.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport { memo } from 'react';\n\nimport ChevronDownIcon from '../../../../../assets/line-icons/icons/chevron-down';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport * as Styled from './country-selector-styled';\n\nconst CountryCodeButton: FC<{ value?: string; menuVisible?: boolean }> = ({\n value,\n menuVisible,\n}) => {\n return (\n <Styled.CountryCodeButton\n $background=\"BLACK_5\"\n $borderRadius={4}\n $gutterX={0.5}\n $gap={5}\n $alignItems=\"center\"\n $justifyContent=\"space-between\"\n $borderColor={menuVisible ? 'WHITE_T_38' : 'BLACK_5'}\n $flexDirection=\"row\"\n $flexGap={2}\n >\n <Text $renderAs=\"ab1\" $color=\"WHITE\">\n +{value}\n </Text>\n <FlexView $width={20}>\n <ChevronDownIcon width={20} height={20} color=\"WHITE\" />\n </FlexView>\n </Styled.CountryCodeButton>\n );\n};\n\nexport default memo(CountryCodeButton);\n"],"names":["CountryCodeButton","value","menuVisible","jsxs","Styled.CountryCodeButton","Text","jsx","FlexView","ChevronDownIcon","CountryCodeButton$1","memo"],"mappings":";;;;;;AASA,MAAMA,IAAmE,CAAC;AAAA,EACxE,OAAAC;AAAA,EACA,aAAAC;AACF,MAEI,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,aAAY;AAAA,IACZ,eAAe;AAAA,IACf,UAAU;AAAA,IACV,MAAM;AAAA,IACN,aAAY;AAAA,IACZ,iBAAgB;AAAA,IAChB,cAAcF,IAAc,eAAe;AAAA,IAC3C,gBAAe;AAAA,IACf,UAAU;AAAA,IAEV,UAAA;AAAA,MAAA,gBAAAC,EAACE,GAAK,EAAA,WAAU,OAAM,QAAO,SAAQ,UAAA;AAAA,QAAA;AAAA,QACjCJ;AAAA,MAAA,GACJ;AAAA,MACC,gBAAAK,EAAAC,GAAA,EAAS,QAAQ,IAChB,UAAC,gBAAAD,EAAAE,GAAA,EAAgB,OAAO,IAAI,QAAQ,IAAI,OAAM,QAAQ,CAAA,GACxD;AAAA,IAAA;AAAA,EAAA;AAAA,GAKSC,IAAAC,EAAKV,CAAiB;"}
@@ -1,18 +1,18 @@
1
1
  import { jsxs as h, jsx as a } from "react/jsx-runtime";
2
- import { useState as I, useRef as p, useEffect as g, useCallback as C } from "react";
3
- import L from "../../../../ui/separator/separator.js";
2
+ import { memo as k, useState as I, useRef as p, useEffect as $, useCallback as A } from "react";
3
+ import b from "../../../../ui/separator/separator.js";
4
4
  import T from "../../../../ui/text/text.js";
5
5
  import { COUNTRY_CODE_MAP as i } from "../../signup-constants.js";
6
- import { MenuWrapper as b, MenuItem as y, FlagIcon as X, Instructions as D } from "./country-selector-styled.js";
7
- const _ = ({ selectedCountry: $, onChange: u, menuVisible: w }) => {
6
+ import { MenuWrapper as y, MenuItem as X, FlagIcon as D, Instructions as M } from "./country-selector-styled.js";
7
+ const R = ({ selectedCountry: g, onChange: u, menuVisible: w }) => {
8
8
  const [s, d] = I(""), [o, l] = I(-1), c = p(null), f = p(null), E = p([]);
9
- g(() => {
9
+ $(() => {
10
10
  var e;
11
11
  o >= 0 && ((e = E.current[o]) == null || e.scrollIntoView({
12
12
  behavior: "smooth",
13
13
  block: "nearest"
14
14
  }));
15
- }, [o]), g(() => {
15
+ }, [o]), $(() => {
16
16
  if (s) {
17
17
  const e = i.findIndex(
18
18
  (t) => t.value.toLowerCase().includes(s.toLowerCase()) || t.code.startsWith(s)
@@ -25,7 +25,7 @@ const _ = ({ selectedCountry: $, onChange: u, menuVisible: w }) => {
25
25
  c.current && clearTimeout(c.current);
26
26
  };
27
27
  }, [s]);
28
- const m = C(
28
+ const m = A(
29
29
  (e) => {
30
30
  var n;
31
31
  const { key: t } = e;
@@ -44,14 +44,14 @@ const _ = ({ selectedCountry: $, onChange: u, menuVisible: w }) => {
44
44
  },
45
45
  [o, u]
46
46
  );
47
- return g(() => {
47
+ return $(() => {
48
48
  const e = f.current;
49
49
  if (!(!e || !w))
50
50
  return e.focus(), e.addEventListener("keydown", m), () => {
51
51
  e.removeEventListener("keydown", m);
52
52
  };
53
- }, [w, m, $.id]), /* @__PURE__ */ h(
54
- b,
53
+ }, [w, m, g.id]), /* @__PURE__ */ h(
54
+ y,
55
55
  {
56
56
  ref: f,
57
57
  tabIndex: 0,
@@ -61,38 +61,38 @@ const _ = ({ selectedCountry: $, onChange: u, menuVisible: w }) => {
61
61
  $borderColor: "BLACK_5",
62
62
  children: [
63
63
  i.map((e, t) => {
64
- const { id: n, value: r, icon: x, code: k } = e;
64
+ const { id: n, value: r, icon: x, code: C } = e;
65
65
  return /* @__PURE__ */ h(
66
- y,
66
+ X,
67
67
  {
68
- ref: (A) => E.current[t] = A,
68
+ ref: (L) => E.current[t] = L,
69
69
  "data-country-id": n,
70
- onClick: () => u({ code: k, id: n }),
70
+ onClick: () => u({ code: C, id: n }),
71
71
  $gutterX: 0.5,
72
72
  $gapX: 0.75,
73
73
  $width: "100%",
74
74
  $flexDirection: "row",
75
75
  $alignItems: "center",
76
76
  $flexGap: 8,
77
- $isSelected: $.id === n,
77
+ $isSelected: g.id === n,
78
78
  $isHighlighted: o === t,
79
79
  children: [
80
- /* @__PURE__ */ a(X, { src: x }),
80
+ /* @__PURE__ */ a(D, { src: x }),
81
81
  /* @__PURE__ */ a(T, { $renderAs: "ab3", $color: "WHITE", children: r })
82
82
  ]
83
83
  },
84
84
  n
85
85
  );
86
86
  }),
87
- /* @__PURE__ */ h(D, { $gutterX: 0.5, children: [
88
- /* @__PURE__ */ a(L, { heightX: 0.5 }),
87
+ /* @__PURE__ */ h(M, { $gutterX: 0.5, children: [
88
+ /* @__PURE__ */ a(b, { heightX: 0.5 }),
89
89
  /* @__PURE__ */ a(T, { $renderAs: "ab3", $color: "WHITE", children: "Type to search • ↑↓ to navigate • Enter to select • Esc to clear" })
90
90
  ] })
91
91
  ]
92
92
  }
93
93
  );
94
- };
94
+ }, O = k(R);
95
95
  export {
96
- _ as default
96
+ O as default
97
97
  };
98
98
  //# sourceMappingURL=country-list-menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"country-list-menu.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/country-selector/country-list-menu.tsx"],"sourcesContent":["import type { ICountryListMenuProps } from './country-selector-types';\nimport type { FC } from 'react';\n\nimport { useState, useEffect, useRef, useCallback } from 'react';\n\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { COUNTRY_CODE_MAP } from '../../signup-constants';\nimport * as Styled from './country-selector-styled';\n\nconst CountryListMenu: FC<ICountryListMenuProps> = ({ selectedCountry, onChange, menuVisible }) => {\n const [searchTerm, setSearchTerm] = useState('');\n const [highlightedIndex, setHighlightedIndex] = useState(-1);\n const searchTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const itemRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n useEffect(() => {\n if (highlightedIndex >= 0) {\n itemRefs.current[highlightedIndex]?.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }\n }, [highlightedIndex]);\n\n useEffect(() => {\n if (searchTerm) {\n const index = COUNTRY_CODE_MAP.findIndex(\n c =>\n c.value.toLowerCase().includes(searchTerm.toLowerCase()) || c.code.startsWith(searchTerm),\n );\n\n setHighlightedIndex(index);\n if (searchTimeoutRef.current) clearTimeout(searchTimeoutRef.current);\n searchTimeoutRef.current = setTimeout(() => {\n setSearchTerm('');\n }, 1000);\n }\n\n return () => {\n if (searchTimeoutRef.current) clearTimeout(searchTimeoutRef.current);\n };\n }, [searchTerm]);\n\n const handleKeyDown = useCallback(\n (event: globalThis.KeyboardEvent) => {\n const { key } = event;\n\n event.preventDefault();\n event.stopPropagation();\n if (key.length === 1 && /[a-zA-Z0-9\\s]/.test(key)) {\n setSearchTerm(prev => prev + key.toLowerCase());\n\n return;\n }\n\n if (key === 'ArrowDown') {\n setHighlightedIndex(prev => (prev < COUNTRY_CODE_MAP.length - 1 ? prev + 1 : 0));\n } else if (key === 'ArrowUp') {\n setHighlightedIndex(prev => (prev > 0 ? prev - 1 : COUNTRY_CODE_MAP.length - 1));\n } else if (key === 'Enter' && highlightedIndex >= 0) {\n const selectedOption = COUNTRY_CODE_MAP[highlightedIndex];\n\n selectedOption && onChange({ code: selectedOption.code, id: selectedOption.id });\n menuRef.current?.click();\n } else if (key === 'Escape') {\n setSearchTerm('');\n setHighlightedIndex(-1);\n }\n },\n [highlightedIndex, onChange],\n );\n\n useEffect(() => {\n const menuElement = menuRef.current;\n\n if (!menuElement || !menuVisible) return;\n\n menuElement.focus();\n menuElement.addEventListener('keydown', handleKeyDown);\n\n return () => {\n menuElement.removeEventListener('keydown', handleKeyDown);\n };\n }, [menuVisible, handleKeyDown, selectedCountry.id]);\n\n return (\n <Styled.MenuWrapper\n ref={menuRef}\n tabIndex={0}\n $widthX={10}\n $gapX={0.5}\n $background=\"BLACK_2\"\n $borderColor=\"BLACK_5\"\n >\n {COUNTRY_CODE_MAP.map((option, index) => {\n const { id, value, icon, code } = option;\n\n return (\n <Styled.MenuItem\n key={id}\n ref={el => (itemRefs.current[index] = el)}\n data-country-id={id}\n onClick={() => onChange({ code, id })}\n $gutterX={0.5}\n $gapX={0.75}\n $width=\"100%\"\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={8}\n $isSelected={selectedCountry.id === id}\n $isHighlighted={highlightedIndex === index}\n >\n <Styled.FlagIcon src={icon} />\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n {value}\n </Text>\n </Styled.MenuItem>\n );\n })}\n\n <Styled.Instructions $gutterX={0.5}>\n <Separator heightX={0.5} />\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n Type to search • ↑↓ to navigate • Enter to select • Esc to clear\n </Text>\n </Styled.Instructions>\n </Styled.MenuWrapper>\n );\n};\n\nexport default CountryListMenu;\n"],"names":["CountryListMenu","selectedCountry","onChange","menuVisible","searchTerm","setSearchTerm","useState","highlightedIndex","setHighlightedIndex","searchTimeoutRef","useRef","menuRef","itemRefs","useEffect","_a","index","COUNTRY_CODE_MAP","c","handleKeyDown","useCallback","event","key","prev","selectedOption","menuElement","jsxs","Styled.MenuWrapper","option","id","value","icon","code","Styled.MenuItem","el","jsx","Styled.FlagIcon","Text","Styled.Instructions","Separator"],"mappings":";;;;;;AAUA,MAAMA,IAA6C,CAAC,EAAE,iBAAAC,GAAiB,UAAAC,GAAU,aAAAC,QAAkB;AACjG,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAE,GACzC,CAACC,GAAkBC,CAAmB,IAAIF,EAAS,EAAE,GACrDG,IAAmBC,EAA8B,IAAI,GACrDC,IAAUD,EAAuB,IAAI,GACrCE,IAAWF,EAAkC,CAAA,CAAE;AAErD,EAAAG,EAAU,MAAM;;AACd,IAAIN,KAAoB,OACbO,IAAAF,EAAA,QAAQL,CAAgB,MAAxB,QAAAO,EAA2B,eAAe;AAAA,MACjD,UAAU;AAAA,MACV,OAAO;AAAA,IAAA;AAAA,EAEX,GACC,CAACP,CAAgB,CAAC,GAErBM,EAAU,MAAM;AACd,QAAIT,GAAY;AACd,YAAMW,IAAQC,EAAiB;AAAA,QAC7B,CACEC,MAAAA,EAAE,MAAM,YAA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AA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"country-list-menu.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/country-selector/country-list-menu.tsx"],"sourcesContent":["import type { ICountryListMenuProps } from './country-selector-types';\nimport type { FC } from 'react';\n\nimport { useState, useEffect, useRef, useCallback, memo } from 'react';\n\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport { COUNTRY_CODE_MAP } from '../../signup-constants';\nimport * as Styled from './country-selector-styled';\n\nconst CountryListMenu: FC<ICountryListMenuProps> = ({ selectedCountry, onChange, menuVisible }) => {\n const [searchTerm, setSearchTerm] = useState('');\n const [highlightedIndex, setHighlightedIndex] = useState(-1);\n const searchTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const itemRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n useEffect(() => {\n if (highlightedIndex >= 0) {\n itemRefs.current[highlightedIndex]?.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }\n }, [highlightedIndex]);\n\n useEffect(() => {\n if (searchTerm) {\n const index = COUNTRY_CODE_MAP.findIndex(\n c =>\n c.value.toLowerCase().includes(searchTerm.toLowerCase()) || c.code.startsWith(searchTerm),\n );\n\n setHighlightedIndex(index);\n if (searchTimeoutRef.current) clearTimeout(searchTimeoutRef.current);\n searchTimeoutRef.current = setTimeout(() => {\n setSearchTerm('');\n }, 1000);\n }\n\n return () => {\n if (searchTimeoutRef.current) clearTimeout(searchTimeoutRef.current);\n };\n }, [searchTerm]);\n\n const handleKeyDown = useCallback(\n (event: globalThis.KeyboardEvent) => {\n const { key } = event;\n\n event.preventDefault();\n event.stopPropagation();\n if (key.length === 1 && /[a-zA-Z0-9\\s]/.test(key)) {\n setSearchTerm(prev => prev + key.toLowerCase());\n\n return;\n }\n\n if (key === 'ArrowDown') {\n setHighlightedIndex(prev => (prev < COUNTRY_CODE_MAP.length - 1 ? prev + 1 : 0));\n } else if (key === 'ArrowUp') {\n setHighlightedIndex(prev => (prev > 0 ? prev - 1 : COUNTRY_CODE_MAP.length - 1));\n } else if (key === 'Enter' && highlightedIndex >= 0) {\n const selectedOption = COUNTRY_CODE_MAP[highlightedIndex];\n\n selectedOption && onChange({ code: selectedOption.code, id: selectedOption.id });\n menuRef.current?.click();\n } else if (key === 'Escape') {\n setSearchTerm('');\n setHighlightedIndex(-1);\n }\n },\n [highlightedIndex, onChange],\n );\n\n useEffect(() => {\n const menuElement = menuRef.current;\n\n if (!menuElement || !menuVisible) return;\n\n menuElement.focus();\n menuElement.addEventListener('keydown', handleKeyDown);\n\n return () => {\n menuElement.removeEventListener('keydown', handleKeyDown);\n };\n }, [menuVisible, handleKeyDown, selectedCountry.id]);\n\n return (\n <Styled.MenuWrapper\n ref={menuRef}\n tabIndex={0}\n $widthX={10}\n $gapX={0.5}\n $background=\"BLACK_2\"\n $borderColor=\"BLACK_5\"\n >\n {COUNTRY_CODE_MAP.map((option, index) => {\n const { id, value, icon, code } = option;\n\n return (\n <Styled.MenuItem\n key={id}\n ref={el => (itemRefs.current[index] = el)}\n data-country-id={id}\n onClick={() => onChange({ code, id })}\n $gutterX={0.5}\n $gapX={0.75}\n $width=\"100%\"\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={8}\n $isSelected={selectedCountry.id === id}\n $isHighlighted={highlightedIndex === index}\n >\n <Styled.FlagIcon src={icon} />\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n {value}\n </Text>\n </Styled.MenuItem>\n );\n })}\n\n <Styled.Instructions $gutterX={0.5}>\n <Separator heightX={0.5} />\n <Text $renderAs=\"ab3\" $color=\"WHITE\">\n Type to search • ↑↓ to navigate • Enter to select • Esc to clear\n </Text>\n </Styled.Instructions>\n </Styled.MenuWrapper>\n );\n};\n\nexport default memo(CountryListMenu);\n"],"names":["CountryListMenu","selectedCountry","onChange","menuVisible","searchTerm","setSearchTerm","useState","highlightedIndex","setHighlightedIndex","searchTimeoutRef","useRef","menuRef","itemRefs","useEffect","_a","index","COUNTRY_CODE_MAP","c","handleKeyDown","useCallback","event","key","prev","selectedOption","menuElement","jsxs","Styled.MenuWrapper","option","id","value","icon","code","Styled.MenuItem","el","jsx","Styled.FlagIcon","Text","Styled.Instructions","Separator","CountryListMenu$1","memo"],"mappings":";;;;;;AAUA,MAAMA,IAA6C,CAAC,EAAE,iBAAAC,GAAiB,UAAAC,GAAU,aAAAC,QAAkB;AACjG,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAE,GACzC,CAACC,GAAkBC,CAAmB,IAAIF,EAAS,EAAE,GACrDG,IAAmBC,EAA8B,IAAI,GACrDC,IAAUD,EAAuB,IAAI,GACrCE,IAAWF,EAAkC,CAAA,CAAE;AAErD,EAAAG,EAAU,MAAM;;AACd,IAAIN,KAAoB,OACbO,IAAAF,EAAA,QAAQL,CAAgB,MAAxB,QAAAO,EAA2B,eAAe;AAAA,MACjD,UAAU;AAAA,MACV,OAAO;AAAA,IAAA;AAAA,EAEX,GACC,CAACP,CAAgB,CAAC,GAErBM,EAAU,MAAM;AACd,QAAIT,GAAY;AACd,YAAMW,IAAQC,EAAiB;AAAA,QAC7B,CACEC,MAAAA,EAAE,MAAM,YAAc,EAAA,SAASb,EAAW,YAAa,CAAA,KAAKa,EAAE,KAAK,WAAWb,CAAU;AAAA,MAAA;AAG5F,MAAAI,EAAoBO,CAAK,GACrBN,EAAiB,WAAsB,aAAAA,EAAiB,OAAO,GAClDA,EAAA,UAAU,WAAW,MAAM;AAC1C,QAAAJ,EAAc,EAAE;AAAA,SACf,GAAI;AAAA,IACT;AAEA,WAAO,MAAM;AACX,MAAII,EAAiB,WAAsB,aAAAA,EAAiB,OAAO;AAAA,IAAA;AAAA,EACrE,GACC,CAACL,CAAU,CAAC;AAEf,QAAMc,IAAgBC;AAAA,IACpB,CAACC,MAAoC;;AAC7B,YAAA,EAAE,KAAAC,EAAQ,IAAAD;AAIhB,UAFAA,EAAM,eAAe,G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;AAAA,YAACO;AAAAA,YAAA;AAAA,cAEC,KAAK,CAAAC,MAAOrB,EAAS,QAAQG,CAAK,IAAIkB;AAAA,cACtC,mBAAiBL;AAAA,cACjB,SAAS,MAAM1B,EAAS,EAAE,MAAA6B,GAAM,IAAAH,GAAI;AAAA,cACpC,UAAU;AAAA,cACV,OAAO;AAAA,cACP,QAAO;AAAA,cACP,gBAAe;AAAA,cACf,aAAY;AAAA,cACZ,UAAU;AAAA,cACV,aAAa3B,EAAgB,OAAO2B;AAAA,cACpC,gBAAgBrB,MAAqBQ;AAAA,cAErC,UAAA;AAAA,gBAAA,gBAAAmB,EAACC,GAAA,EAAgB,KAAKL,EAAM,CAAA;AAAA,kCAC3BM,GAAK,EAAA,WAAU,OAAM,QAAO,SAC1B,UACHP,GAAA;AAAA,cAAA;AAAA,YAAA;AAAA,YAhBKD;AAAA,UAAA;AAAA,QAiBP,CAEH;AAAA,QAEA,gBAAAH,EAAAY,GAAA,EAAoB,UAAU,KAC7B,UAAA;AAAA,UAAC,gBAAAH,EAAAI,GAAA,EAAU,SAAS,IAAK,CAAA;AAAA,4BACxBF,GAAK,EAAA,WAAU,OAAM,QAAO,SAAQ,UAErC,oEAAA;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeG,IAAAC,EAAKxC,CAAe;"}
@@ -1,19 +1,19 @@
1
- import { jsx as u, jsxs as v } from "react/jsx-runtime";
2
- import { memo as y, useState as x, useRef as w, useCallback as g, useMemo as C, useEffect as I } from "react";
3
- import { useTheme as A } from "styled-components";
4
- import H from "../../../ui/layout/flex-view.js";
5
- import L from "./country-selector/country-selector.js";
6
- import { CustomInput as M } from "./custom-input-field-styled.js";
7
- import N from "./input-wrapper/input-wrapper.js";
8
- import X from "./password-toggle/password-toggle.js";
9
- const _ = ({
1
+ import { jsx as c, jsxs as y } from "react/jsx-runtime";
2
+ import { memo as A, useState as g, useRef as C, useCallback as a, useMemo as I, useEffect as T } from "react";
3
+ import { useTheme as H } from "styled-components";
4
+ import L from "../../../ui/layout/flex-view.js";
5
+ import M from "./country-selector/country-selector.js";
6
+ import { CustomInput as N } from "./custom-input-field-styled.js";
7
+ import X from "./input-wrapper/input-wrapper.js";
8
+ import _ from "./password-toggle/password-toggle.js";
9
+ const q = ({
10
10
  value: o,
11
- onChange: T,
12
- error: c,
11
+ onChange: m,
12
+ error: u,
13
13
  helperText: W,
14
- onEnter: r,
14
+ onEnter: n,
15
15
  isLoading: b,
16
- isValid: m,
16
+ isValid: p,
17
17
  type: e = "text",
18
18
  placeholder: F,
19
19
  actionElement: R,
@@ -23,33 +23,38 @@ const _ = ({
23
23
  textAlign: S = "center",
24
24
  selectedCountry: V,
25
25
  onCountryChange: j,
26
- autoSize: a = !1
26
+ autoSize: d = !1
27
27
  }) => {
28
- const n = A(), [l, k] = x(!1), [z, p] = x(32), f = w(null), s = w(null), E = g(
28
+ const r = H(), [l, k] = g(!1), [z, h] = g(32), f = C(null), s = C(null), E = a(
29
29
  (t) => {
30
- t.key === "Enter" && (r == null || r());
30
+ t.key === "Enter" && (n == null || n());
31
31
  },
32
- [r]
33
- ), G = C(() => e === "password" ? l ? "text" : "password" : e === "phone" ? "number" : e, [e, l]), K = C(() => c ? n.colors.RED : m ? n.colors.GREEN_4 : n.colors.WHITE, [c, m, n.colors]), d = g((t, h) => {
32
+ [n]
33
+ ), G = I(() => e === "password" ? l ? "text" : "password" : e === "phone" ? "number" : e, [e, l]), K = I(() => u ? r.colors.RED : p ? r.colors.GREEN_4 : r.colors.WHITE, [u, p, r.colors]), x = a((t, w) => {
34
34
  s.current || (s.current = document.createElement("canvas"));
35
35
  const i = s.current.getContext("2d");
36
- return i ? (i.font = h, i.measureText(t).width) : 0;
36
+ return i ? (i.font = w, i.measureText(t).width) : 0;
37
37
  }, []);
38
- return I(() => {
39
- if (!f.current || !o || !a)
38
+ T(() => {
39
+ if (!f.current || !o || !d)
40
40
  return;
41
41
  const t = f.current.clientWidth;
42
- d(o, "32px 'Athletics-Light'") > t ? p(24) : p(32);
43
- }, [o, d, a]), I(() => () => {
42
+ x(o, "32px 'Athletics-Light'") > t ? h(24) : h(32);
43
+ }, [o, x, d]), T(() => () => {
44
44
  s.current = null;
45
- }, []), /* @__PURE__ */ u(
46
- N,
45
+ }, []);
46
+ const v = a(
47
+ (t) => m(t.target.value),
48
+ [m]
49
+ );
50
+ return /* @__PURE__ */ c(
51
+ X,
47
52
  {
48
- helperText: c || W,
53
+ helperText: u || W,
49
54
  isLoading: b,
50
55
  actionElement: R,
51
- children: /* @__PURE__ */ v(
52
- H,
56
+ children: /* @__PURE__ */ y(
57
+ L,
53
58
  {
54
59
  $width: D ?? "100%",
55
60
  $flex: 1,
@@ -57,13 +62,13 @@ const _ = ({
57
62
  $flexDirection: "row",
58
63
  $flexGapX: 0.5,
59
64
  children: [
60
- e === "phone" && /* @__PURE__ */ u(L, { onChange: j, value: V }),
61
- /* @__PURE__ */ u(
62
- M,
65
+ e === "phone" && /* @__PURE__ */ c(M, { onChange: j, value: V }),
66
+ /* @__PURE__ */ c(
67
+ N,
63
68
  {
64
69
  ref: f,
65
70
  value: o,
66
- onChange: (t) => T(t.target.value),
71
+ onChange: v,
67
72
  autoFocus: !0,
68
73
  placeholder: F,
69
74
  color: K,
@@ -76,8 +81,8 @@ const _ = ({
76
81
  fontSize: z
77
82
  }
78
83
  ),
79
- e === "password" && /* @__PURE__ */ u(
80
- X,
84
+ e === "password" && /* @__PURE__ */ c(
85
+ _,
81
86
  {
82
87
  isVisible: l,
83
88
  onToggle: () => k((t) => !t)
@@ -88,8 +93,8 @@ const _ = ({
88
93
  )
89
94
  }
90
95
  );
91
- }, tt = y(_);
96
+ }, et = A(q);
92
97
  export {
93
- tt as default
98
+ et as default
94
99
  };
95
100
  //# sourceMappingURL=custom-input-field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-input-field.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field.tsx"],"sourcesContent":["import type { ICustomInputFieldProps } from './custom-input-field-types';\n\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n memo,\n type FC,\n type KeyboardEvent,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport PhoneCountrySelector from './country-selector/country-selector';\nimport * as Styled from './custom-input-field-styled';\nimport InputWrapper from './input-wrapper/input-wrapper';\nimport PasswordToggleIcon from './password-toggle/password-toggle';\n\nconst CustomInputField: FC<ICustomInputFieldProps> = ({\n value,\n onChange,\n error,\n helperText,\n onEnter,\n isLoading,\n isValid,\n type = 'text',\n placeholder,\n actionElement,\n maxLength,\n width,\n textTransform,\n textAlign = 'center',\n selectedCountry,\n onCountryChange,\n autoSize = false,\n}) => {\n const theme = useTheme();\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n const [fontSize, setFontSize] = useState(32);\n const inputRef = useRef<HTMLInputElement>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n onEnter?.();\n }\n },\n [onEnter],\n );\n\n const inputType = useMemo(() => {\n if (type === 'password') return isPasswordVisible ? 'text' : 'password';\n\n if (type === 'phone') return 'number';\n\n return type;\n }, [type, isPasswordVisible]);\n\n const inputColor = useMemo(() => {\n if (error) return theme.colors.RED;\n\n if (isValid) return theme.colors.GREEN_4;\n\n return theme.colors.WHITE;\n }, [error, isValid, theme.colors]);\n\n const measureTextWidth = useCallback((text: string, font: string): number => {\n if (!canvasRef.current) {\n canvasRef.current = document.createElement('canvas');\n }\n\n const context = canvasRef.current.getContext('2d');\n\n if (!context) return 0;\n\n context.font = font;\n\n return context.measureText(text).width;\n }, []);\n\n useEffect(() => {\n if (!inputRef.current || !value || !autoSize) {\n return;\n }\n\n const inputWidth = inputRef.current.clientWidth;\n\n const font32 = \"32px 'Athletics-Light'\";\n\n const textWidth32 = measureTextWidth(value, font32);\n\n if (textWidth32 > inputWidth) {\n setFontSize(24);\n } else {\n setFontSize(32);\n }\n }, [value, measureTextWidth, autoSize]);\n\n useEffect(() => {\n return () => {\n canvasRef.current = null;\n };\n }, []);\n\n return (\n <InputWrapper\n helperText={error || helperText}\n isLoading={isLoading}\n actionElement={actionElement}\n >\n <FlexView\n $width={width ?? '100%'}\n $flex={1}\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n >\n {type === 'phone' && (\n <PhoneCountrySelector onChange={onCountryChange} value={selectedCountry} />\n )}\n <Styled.CustomInput\n ref={inputRef}\n value={value}\n onChange={event => onChange(event.target.value)}\n autoFocus\n placeholder={placeholder}\n color={inputColor}\n autoCapitalize=\"none\"\n textTransform={textTransform}\n type={inputType}\n onKeyDown={handleKeyDown}\n maxLength={maxLength}\n align={textAlign}\n fontSize={fontSize}\n />\n {type === 'password' && (\n <PasswordToggleIcon\n isVisible={isPasswordVisible}\n onToggle={() => setIsPasswordVisible(prev => !prev)}\n />\n )}\n </FlexView>\n </InputWrapper>\n );\n};\n\nexport default memo(CustomInputField);\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","selectedCountry","onCountryChange","autoSize","theme","useTheme","isPasswordVisible","setIsPasswordVisible","useState","fontSize","setFontSize","inputRef","useRef","canvasRef","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","measureTextWidth","text","font","context","useEffect","inputWidth","jsx","InputWrapper","jsxs","FlexView","PhoneCountrySelector","Styled.CustomInput","PasswordToggleIcon","prev","customInputField","memo"],"mappings":";;;;;;;;AAoBA,MAAMA,IAA+C,CAAC;AAAA,EACpD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAA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MACD,MAAM;AACX,IAAAX,EAAU,UAAU;AAAA,EAAA,GAErB,CAAE,CAAA,GAGH,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAYtC,KAASC;AAAA,MACrB,WAAAE;AAAA,MACA,eAAAI;AAAA,MAEA,UAAA,gBAAAgC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,QAAQ/B,KAAS;AAAA,UACjB,OAAO;AAAA,UACP,aAAY;AAAA,UACZ,gBAAe;AAAA,UACf,WAAW;AAAA,UAEV,UAAA;AAAA,YAAAJ,MAAS,WACP,gBAAAgC,EAAAI,GAAA,EAAqB,UAAU5B,GAAiB,OAAOD,GAAiB;AAAA,YAE3E,gBAAAyB;AAAA,cAACK;AAAAA,cAAA;AAAA,gBACC,KAAKpB;AAAA,gBACL,OAAAxB;AAAA,gBACA,UAAU,CAAA6B,MAAS5B,EAAS4B,EAAM,OAAO,KAAK;AAAA,gBAC9C,WAAS;AAAA,gBACT,aAAArB;AAAA,gBACA,OAAOwB;AAAA,gBACP,gBAAe;AAAA,gBACf,eAAApB;AAAA,gBACA,MAAMkB;AAAA,gBACN,WAAWH;AAAA,gBACX,WAAAjB;AAAA,gBACA,OAAOG;AAAA,gBACP,UAAAS;AAAA,cAAA;AAAA,YACF;AAAA,YACCf,MAAS,cACR,gBAAAgC;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,WAAW1B;AAAA,gBACX,UAAU,MAAMC,EAAqB,CAAA0B,MAAQ,CAACA,CAAI;AAAA,cAAA;AAAA,YACpD;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeC,KAAAC,EAAKjD,CAAgB;"}
1
+ {"version":3,"file":"custom-input-field.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field.tsx"],"sourcesContent":["import type { ICustomInputFieldProps } from './custom-input-field-types';\n\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n memo,\n type FC,\n type KeyboardEvent,\n type ChangeEvent,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport PhoneCountrySelector from './country-selector/country-selector';\nimport * as Styled from './custom-input-field-styled';\nimport InputWrapper from './input-wrapper/input-wrapper';\nimport PasswordToggleIcon from './password-toggle/password-toggle';\n\nconst CustomInputField: FC<ICustomInputFieldProps> = ({\n value,\n onChange,\n error,\n helperText,\n onEnter,\n isLoading,\n isValid,\n type = 'text',\n placeholder,\n actionElement,\n maxLength,\n width,\n textTransform,\n textAlign = 'center',\n selectedCountry,\n onCountryChange,\n autoSize = false,\n}) => {\n const theme = useTheme();\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n const [fontSize, setFontSize] = useState(32);\n const inputRef = useRef<HTMLInputElement>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n onEnter?.();\n }\n },\n [onEnter],\n );\n\n const inputType = useMemo(() => {\n if (type === 'password') return isPasswordVisible ? 'text' : 'password';\n\n if (type === 'phone') return 'number';\n\n return type;\n }, [type, isPasswordVisible]);\n\n const inputColor = useMemo(() => {\n if (error) return theme.colors.RED;\n\n if (isValid) return theme.colors.GREEN_4;\n\n return theme.colors.WHITE;\n }, [error, isValid, theme.colors]);\n\n const measureTextWidth = useCallback((text: string, font: string): number => {\n if (!canvasRef.current) {\n canvasRef.current = document.createElement('canvas');\n }\n\n const context = canvasRef.current.getContext('2d');\n\n if (!context) return 0;\n\n context.font = font;\n\n return context.measureText(text).width;\n }, []);\n\n useEffect(() => {\n if (!inputRef.current || !value || !autoSize) {\n return;\n }\n\n const inputWidth = inputRef.current.clientWidth;\n\n const font32 = \"32px 'Athletics-Light'\";\n\n const textWidth32 = measureTextWidth(value, font32);\n\n if (textWidth32 > inputWidth) {\n setFontSize(24);\n } else {\n setFontSize(32);\n }\n }, [value, measureTextWidth, autoSize]);\n\n useEffect(() => {\n return () => {\n canvasRef.current = null;\n };\n }, []);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value),\n [onChange],\n );\n\n return (\n <InputWrapper\n helperText={error || helperText}\n isLoading={isLoading}\n actionElement={actionElement}\n >\n <FlexView\n $width={width ?? '100%'}\n $flex={1}\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n >\n {type === 'phone' && (\n <PhoneCountrySelector onChange={onCountryChange} value={selectedCountry} />\n )}\n <Styled.CustomInput\n ref={inputRef}\n value={value}\n onChange={handleChange}\n autoFocus\n placeholder={placeholder}\n color={inputColor}\n autoCapitalize=\"none\"\n textTransform={textTransform}\n type={inputType}\n onKeyDown={handleKeyDown}\n maxLength={maxLength}\n align={textAlign}\n fontSize={fontSize}\n />\n {type === 'password' && (\n <PasswordToggleIcon\n isVisible={isPasswordVisible}\n onToggle={() => setIsPasswordVisible(prev => !prev)}\n />\n )}\n </FlexView>\n </InputWrapper>\n );\n};\n\nexport default memo(CustomInputField);\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","selectedCountry","onCountryChange","autoSize","theme","useTheme","isPasswordVisible","setIsPasswordVisible","useState","fontSize","setFontSize","inputRef","useRef","canvasRef","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","measureTextWidth","text","font","context","useEffect","inputWidth","handleChange","jsx","InputWrapper","jsxs","FlexView","PhoneCountrySelector","Styled.CustomInput","PasswordToggleIcon","prev","customInputField","memo"],"mappings":";;;;;;;;AAqBA,MAAMA,IAA+C,CAAC;AAAA,EACpD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AA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MAAM;AACX,IAAAX,EAAU,UAAU;AAAA,EAAA,GAErB,CAAE,CAAA;AAEL,QAAMa,IAAeX;AAAA,IACnB,CAACC,MAAyC5B,EAAS4B,EAAM,OAAO,KAAK;AAAA,IACrE,CAAC5B,CAAQ;AAAA,EAAA;AAIT,SAAA,gBAAAuC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAYvC,KAASC;AAAA,MACrB,WAAAE;AAAA,MACA,eAAAI;AAAA,MAEA,UAAA,gBAAAiC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,QAAQhC,KAAS;AAAA,UACjB,OAAO;AAAA,UACP,aAAY;AAAA,UACZ,gBAAe;AAAA,UACf,WAAW;AAAA,UAEV,UAAA;AAAA,YAAAJ,MAAS,WACP,gBAAAiC,EAAAI,GAAA,EAAqB,UAAU7B,GAAiB,OAAOD,GAAiB;AAAA,YAE3E,gBAAA0B;AAAA,cAACK;AAAAA,cAAA;AAAA,gBACC,KAAKrB;AAAA,gBACL,OAAAxB;AAAA,gBACA,UAAUuC;AAAA,gBACV,WAAS;AAAA,gBACT,aAAA/B;AAAA,gBACA,OAAOwB;AAAA,gBACP,gBAAe;AAAA,gBACf,eAAApB;AAAA,gBACA,MAAMkB;AAAA,gBACN,WAAWH;AAAA,gBACX,WAAAjB;AAAA,gBACA,OAAOG;AAAA,gBACP,UAAAS;AAAA,cAAA;AAAA,YACF;AAAA,YACCf,MAAS,cACR,gBAAAiC;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,WAAW3B;AAAA,gBACX,UAAU,MAAMC,EAAqB,CAAA2B,MAAQ,CAACA,CAAI;AAAA,cAAA;AAAA,YACpD;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeC,KAAAC,EAAKlD,CAAgB;"}
@@ -1,59 +1,43 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { memo as f } from "react";
3
- import h from "../../../../../node_modules/react-datepicker/dist/index.es.js";
4
- import { useTheme as I } from "styled-components";
5
- import T from "../../../../../assets/line-icons/icons/left.js";
6
- import u from "../../../../../assets/line-icons/icons/right.js";
7
- import m from "../../../../ui/buttons/clickable/clickable.js";
1
+ import { jsxs as b, jsx as e } from "react/jsx-runtime";
2
+ import { memo as D, useCallback as l } from "react";
3
+ import I from "../../../../../node_modules/react-datepicker/dist/index.es.js";
4
+ import { useTheme as T } from "styled-components";
5
+ import Y from "../../../../../assets/line-icons/icons/left.js";
6
+ import x from "../../../../../assets/line-icons/icons/right.js";
7
+ import i from "../../../../ui/buttons/clickable/clickable.js";
8
8
  import k from "../../../../ui/layout/flex-view.js";
9
9
  import w from "../../../../ui/text/text.js";
10
- import x from "../input-wrapper/input-wrapper.js";
11
- import { StyledDatePickerWrapper as y } from "./date-picker-input-styled.js";
12
- import { subYears as l } from "../../../../../node_modules/date-fns/subYears.js";
13
- const b = ({ value: c, onChange: a, error: n }) => {
14
- const o = I();
15
- return /* @__PURE__ */ e(x, { helperText: n, children: /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
16
- h,
10
+ import y from "../input-wrapper/input-wrapper.js";
11
+ import { StyledDatePickerWrapper as C } from "./date-picker-input-styled.js";
12
+ import { subYears as c } from "../../../../../node_modules/date-fns/subYears.js";
13
+ const H = ({ value: s, onChange: t, error: m }) => {
14
+ const r = T(), d = l((o) => t(o), [t]), p = l(
15
+ (o) => {
16
+ const { date: f, decreaseYear: h, increaseYear: u, prevYearButtonDisabled: a, nextYearButtonDisabled: n } = o;
17
+ return /* @__PURE__ */ b(k, { $alignItems: "center", $flexDirection: "row", $justifyContent: "space-between", children: [
18
+ /* @__PURE__ */ e(i, { onClick: h, label: "increase-year", disabled: a, children: /* @__PURE__ */ e(Y, { color: r.colors[a ? "WHITE_T_10" : "WHITE"] }) }),
19
+ /* @__PURE__ */ e(w, { $renderAs: "ub2-bold", $color: "WHITE", children: f.getFullYear() }),
20
+ /* @__PURE__ */ e(i, { onClick: u, label: "decrease-year", disabled: n, children: /* @__PURE__ */ e(x, { color: r.colors[n ? "WHITE_T_10" : "WHITE"] }) })
21
+ ] });
22
+ },
23
+ [r.colors]
24
+ );
25
+ return /* @__PURE__ */ e(y, { helperText: m, children: /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(
26
+ I,
17
27
  {
18
- selected: c,
28
+ selected: s,
19
29
  showMonthYearPicker: !0,
20
30
  showPopperArrow: !1,
21
31
  dateFormat: "MM/yyyy",
22
32
  placeholderText: "MM / YYYY",
23
- onChange: (r) => a(r),
24
- minDate: l(/* @__PURE__ */ new Date(), 22),
25
- maxDate: l(/* @__PURE__ */ new Date(), 2),
26
- renderCustomHeader: ({
27
- date: r,
28
- decreaseYear: p,
29
- increaseYear: s,
30
- prevYearButtonDisabled: t,
31
- nextYearButtonDisabled: i
32
- }) => /* @__PURE__ */ d(k, { $alignItems: "center", $flexDirection: "row", $justifyContent: "space-between", children: [
33
- /* @__PURE__ */ e(
34
- m,
35
- {
36
- onClick: p,
37
- label: "increase-year",
38
- disabled: t,
39
- children: /* @__PURE__ */ e(T, { color: o.colors[t ? "WHITE_T_10" : "WHITE"] })
40
- }
41
- ),
42
- /* @__PURE__ */ e(w, { $renderAs: "ub2-bold", $color: "WHITE", children: r.getFullYear() }),
43
- /* @__PURE__ */ e(
44
- m,
45
- {
46
- onClick: s,
47
- label: "decrease-year",
48
- disabled: i,
49
- children: /* @__PURE__ */ e(u, { color: o.colors[i ? "WHITE_T_10" : "WHITE"] })
50
- }
51
- )
52
- ] })
33
+ onChange: d,
34
+ minDate: c(/* @__PURE__ */ new Date(), 22),
35
+ maxDate: c(/* @__PURE__ */ new Date(), 2),
36
+ renderCustomHeader: p
53
37
  }
54
38
  ) }) });
55
- }, F = f(b);
39
+ }, L = D(H);
56
40
  export {
57
- F as default
41
+ L as default
58
42
  };
59
43
  //# sourceMappingURL=date-picker-input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker-input.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/date-picker-input/date-picker-input.tsx"],"sourcesContent":["import type { IDatePickerInputProps } from './date-picker-input-types';\n\nimport { subYears } from 'date-fns';\nimport { type FC, memo } from 'react';\nimport DatePicker from 'react-datepicker';\nimport { useTheme } from 'styled-components';\n\nimport LeftIcon from '../../../../../assets/line-icons/icons/left';\nimport RightIcon from '../../../../../assets/line-icons/icons/right';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport InputWrapper from '../input-wrapper/input-wrapper';\nimport * as Styled from './date-picker-input-styled';\n\nconst DatePickerInput: FC<IDatePickerInputProps> = ({ value, onChange, error }) => {\n const theme = useTheme();\n\n return (\n <InputWrapper helperText={error}>\n <Styled.StyledDatePickerWrapper>\n <DatePicker\n selected={value}\n showMonthYearPicker\n showPopperArrow={false}\n dateFormat=\"MM/yyyy\"\n placeholderText=\"MM / YYYY\"\n onChange={date => onChange(date)}\n minDate={subYears(new Date(), 22)}\n maxDate={subYears(new Date(), 2)}\n renderCustomHeader={({\n date,\n decreaseYear,\n increaseYear,\n prevYearButtonDisabled,\n nextYearButtonDisabled,\n }) => (\n <FlexView $alignItems=\"center\" $flexDirection=\"row\" $justifyContent=\"space-between\">\n <Clickable\n onClick={decreaseYear}\n label=\"increase-year\"\n disabled={prevYearButtonDisabled}\n >\n <LeftIcon color={theme.colors[prevYearButtonDisabled ? 'WHITE_T_10' : 'WHITE']} />\n </Clickable>\n <Text $renderAs=\"ub2-bold\" $color=\"WHITE\">\n {date.getFullYear()}\n </Text>\n <Clickable\n onClick={increaseYear}\n label=\"decrease-year\"\n disabled={nextYearButtonDisabled}\n >\n <RightIcon color={theme.colors[nextYearButtonDisabled ? 'WHITE_T_10' : 'WHITE']} />\n </Clickable>\n </FlexView>\n )}\n />\n </Styled.StyledDatePickerWrapper>\n </InputWrapper>\n );\n};\n\nexport default memo(DatePickerInput);\n"],"names":["DatePickerInput","value","onChange","error","theme","useTheme","InputWrapper","jsx","Styled.StyledDatePickerWrapper","DatePicker","date","subYears","decreaseYear","increaseYear","prevYearButtonDisabled","nextYearButtonDisabled","FlexView","Clickable","LeftIcon","Text","RightIcon","datePickerInput","memo"],"mappings":";;;;;;;;;;;;AAeA,MAAMA,IAA6C,CAAC,EAAE,OAAAC,GAAO,UAAAC,GAAU,OAAAC,QAAY;AACjF,QAAMC,IAAQC;AAEd,2BACGC,GAAa,EAAA,YAAYH,GACxB,UAAC,gBAAAI,EAAAC,GAAA,EACC,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAUR;AAAA,MACV,qBAAmB;AAAA,MACnB,iBAAiB;AAAA,MACjB,YAAW;AAAA,MACX,iBAAgB;AAAA,MAChB,UAAU,CAAQS,MAAAR,EAASQ,CAAI;AAAA,MAC/B,SAASC,EAAa,oBAAA,KAAA,GAAQ,EAAE;AAAA,MAChC,SAASA,EAAa,oBAAA,KAAA,GAAQ,CAAC;AAAA,MAC/B,oBAAoB,CAAC;AAAA,QACnB,MAAAD;AAAA,QACA,cAAAE;AAAA,QACA,cAAAC;AAAA,QACA,wBAAAC;AAAA,QACA,wBAAAC;AAAA,MAAA,wBAECC,GAAS,EAAA,aAAY,UAAS,gBAAe,OAAM,iBAAgB,iBAClE,UAAA;AAAA,QAAA,gBAAAT;AAAA,UAACU;AAAA,UAAA;AAAA,YACC,SAASL;AAAA,YACT,OAAM;AAAA,YACN,UAAUE;AAAA,YAEV,UAAA,gBAAAP,EAACW,KAAS,OAAOd,EAAM,OAAOU,IAAyB,eAAe,OAAO,GAAG;AAAA,UAAA;AAAA,QAClF;AAAA,QACA,gBAAAP,EAACY,KAAK,WAAU,YAAW,QAAO,SAC/B,UAAAT,EAAK,eACR;AAAA,QACA,gBAAAH;AAAA,UAACU;AAAA,UAAA;AAAA,YACC,SAASJ;AAAA,YACT,OAAM;AAAA,YACN,UAAUE;AAAA,YAEV,UAAA,gBAAAR,EAACa,KAAU,OAAOhB,EAAM,OAAOW,IAAyB,eAAe,OAAO,GAAG;AAAA,UAAA;AAAA,QACnF;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA,EAGN,CAAA,EACF,CAAA;AAEJ,GAEeM,IAAAC,EAAKtB,CAAe;"}
1
+ {"version":3,"file":"date-picker-input.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/date-picker-input/date-picker-input.tsx"],"sourcesContent":["import type { IDatePickerInputProps } from './date-picker-input-types';\nimport type { ReactDatePickerCustomHeaderProps } from 'react-datepicker';\n\nimport { subYears } from 'date-fns';\nimport { type FC, memo, useCallback } from 'react';\nimport DatePicker from 'react-datepicker';\nimport { useTheme } from 'styled-components';\n\nimport LeftIcon from '../../../../../assets/line-icons/icons/left';\nimport RightIcon from '../../../../../assets/line-icons/icons/right';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport InputWrapper from '../input-wrapper/input-wrapper';\nimport * as Styled from './date-picker-input-styled';\n\nconst DatePickerInput: FC<IDatePickerInputProps> = ({ value, onChange, error }) => {\n const theme = useTheme();\n\n const handleChangeDate = useCallback((date: Date | null) => onChange(date), [onChange]);\n\n const renderHeader = useCallback(\n (props: ReactDatePickerCustomHeaderProps) => {\n const { date, decreaseYear, increaseYear, prevYearButtonDisabled, nextYearButtonDisabled } =\n props;\n\n return (\n <FlexView $alignItems=\"center\" $flexDirection=\"row\" $justifyContent=\"space-between\">\n <Clickable onClick={decreaseYear} label=\"increase-year\" disabled={prevYearButtonDisabled}>\n <LeftIcon color={theme.colors[prevYearButtonDisabled ? 'WHITE_T_10' : 'WHITE']} />\n </Clickable>\n <Text $renderAs=\"ub2-bold\" $color=\"WHITE\">\n {date.getFullYear()}\n </Text>\n <Clickable onClick={increaseYear} label=\"decrease-year\" disabled={nextYearButtonDisabled}>\n <RightIcon color={theme.colors[nextYearButtonDisabled ? 'WHITE_T_10' : 'WHITE']} />\n </Clickable>\n </FlexView>\n );\n },\n\n [theme.colors],\n );\n\n return (\n <InputWrapper helperText={error}>\n <Styled.StyledDatePickerWrapper>\n <DatePicker\n selected={value}\n showMonthYearPicker\n showPopperArrow={false}\n dateFormat=\"MM/yyyy\"\n placeholderText=\"MM / YYYY\"\n onChange={handleChangeDate}\n minDate={subYears(new Date(), 22)}\n maxDate={subYears(new Date(), 2)}\n renderCustomHeader={renderHeader}\n />\n </Styled.StyledDatePickerWrapper>\n </InputWrapper>\n );\n};\n\nexport default memo(DatePickerInput);\n"],"names":["DatePickerInput","value","onChange","error","theme","useTheme","handleChangeDate","useCallback","date","renderHeader","props","decreaseYear","increaseYear","prevYearButtonDisabled","nextYearButtonDisabled","FlexView","jsx","Clickable","LeftIcon","Text","RightIcon","InputWrapper","Styled.StyledDatePickerWrapper","DatePicker","subYears","datePickerInput","memo"],"mappings":";;;;;;;;;;;;AAgBA,MAAMA,IAA6C,CAAC,EAAE,OAAAC,GAAO,UAAAC,GAAU,OAAAC,QAAY;AACjF,QAAMC,IAAQC,KAERC,IAAmBC,EAAY,CAACC,MAAsBN,EAASM,CAAI,GAAG,CAACN,CAAQ,CAAC,GAEhFO,IAAeF;AAAA,IACnB,CAACG,MAA4C;AAC3C,YAAM,EAAE,MAAAF,GAAM,cAAAG,GAAc,cAAAC,GAAc,wBAAAC,GAAwB,wBAAAC,EAChE,IAAAJ;AAEF,+BACGK,GAAS,EAAA,aAAY,UAAS,gBAAe,OAAM,iBAAgB,iBAClE,UAAA;AAAA,QAAA,gBAAAC,EAACC,KAAU,SAASN,GAAc,OAAM,iBAAgB,UAAUE,GAChE,UAAA,gBAAAG,EAACE,GAAS,EAAA,OAAOd,EAAM,OAAOS,IAAyB,eAAe,OAAO,EAAG,CAAA,GAClF;AAAA,QACA,gBAAAG,EAACG,KAAK,WAAU,YAAW,QAAO,SAC/B,UAAAX,EAAK,eACR;AAAA,0BACCS,GAAU,EAAA,SAASL,GAAc,OAAM,iBAAgB,UAAUE,GAChE,UAAC,gBAAAE,EAAAI,GAAA,EAAU,OAAOhB,EAAM,OAAOU,IAAyB,eAAe,OAAO,EAAG,CAAA,GACnF;AAAA,MACF,EAAA,CAAA;AAAA,IAEJ;AAAA,IAEA,CAACV,EAAM,MAAM;AAAA,EAAA;AAGf,2BACGiB,GAAa,EAAA,YAAYlB,GACxB,UAAC,gBAAAa,EAAAM,GAAA,EACC,UAAA,gBAAAN;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,UAAUtB;AAAA,MACV,qBAAmB;AAAA,MACnB,iBAAiB;AAAA,MACjB,YAAW;AAAA,MACX,iBAAgB;AAAA,MAChB,UAAUK;AAAA,MACV,SAASkB,EAAa,oBAAA,KAAA,GAAQ,EAAE;AAAA,MAChC,SAASA,EAAa,oBAAA,KAAA,GAAQ,CAAC;AAAA,MAC/B,oBAAoBf;AAAA,IAAA;AAAA,EAAA,EAExB,CAAA,EACF,CAAA;AAEJ,GAEegB,IAAAC,EAAK1B,CAAe;"}
package/dist/index.d.ts CHANGED
@@ -2995,6 +2995,7 @@ declare interface ISingleFieldFormProps {
2995
2995
  isSubmitDisabled?: boolean;
2996
2996
  isValid?: boolean;
2997
2997
  label?: string;
2998
+ helperText?: string;
2998
2999
  }
2999
3000
 
3000
3001
  declare interface ISocialAccountNotFoundProps {
@@ -4206,7 +4207,7 @@ declare interface NumRangeInputProps {
4206
4207
  endPlaceholder?: string;
4207
4208
  }
4208
4209
 
4209
- export declare const OTPForm: MemoExoticComponent<({ onSubmit, onChange, value, error, isProcessing, isValid, }: ISingleFieldFormProps) => JSX_2.Element>;
4210
+ export declare const OTPForm: MemoExoticComponent<({ onSubmit, onChange, value, error, isProcessing, isValid, helperText, }: ISingleFieldFormProps) => JSX_2.Element>;
4210
4211
 
4211
4212
  export declare type OutcomeStage = keyof typeof STAGES;
4212
4213
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.0.11-j4",
3
+ "version": "3.0.11-j6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"