@cuemath/leap 3.0.11-j5 → 3.0.11-j7

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,18 +1,19 @@
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 p, useCallback as l } 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";
5
+ import g from "../../comps/input-status-icon/input-status-icon.js";
6
+ import b from "../../comps/resend-otp/resend-otp.js";
7
7
  const h = ({
8
8
  onSubmit: a,
9
9
  onChange: r,
10
10
  value: i,
11
11
  error: t,
12
- isProcessing: s,
13
- isValid: n = !1
12
+ isProcessing: n,
13
+ isValid: s = !1,
14
+ helperText: m
14
15
  }) => {
15
- const m = l(
16
+ const u = l(
16
17
  (d) => {
17
18
  r("otp", d.target.value);
18
19
  },
@@ -27,37 +28,39 @@ 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
- renderAs: t ? "error-dark" : n ? "success-dark" : "primary-dark",
35
+ renderAs: t ? "error-dark" : s ? "success-dark" : "primary-dark",
35
36
  autoFocus: !0,
36
37
  label: "Verification code",
37
38
  value: i,
38
- onChange: m,
39
+ onChange: u,
39
40
  width: 330,
40
41
  required: !0,
41
42
  shape: "borderLess",
43
+ type: "number",
42
44
  errorMessage: t,
43
- siblingElement: /* @__PURE__ */ e(f, { isError: !!t, isValid: n, isLoading: s })
45
+ siblingElement: /* @__PURE__ */ e(g, { isError: !!t, isValid: s, isLoading: n }),
46
+ helperText: m
44
47
  }
45
48
  ),
46
49
  /* @__PURE__ */ e(
47
- g,
50
+ b,
48
51
  {
49
52
  renderAs: "submit",
50
53
  timerSeconds: 15,
51
54
  onResendOTP: a,
52
55
  width: 336,
53
- disabled: s
56
+ disabled: n
54
57
  }
55
58
  )
56
59
  ] })
57
60
  }
58
61
  );
59
- }, w = c(h);
62
+ }, y = p(h);
60
63
  export {
61
- w as default
64
+ y as default
62
65
  };
63
66
  //# 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 type=\"number\"\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"],"m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SubmitDisabled?: 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-j5",
3
+ "version": "3.0.11-j7",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"