@cuemath/leap 2.9.12-j5 → 2.9.12-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.
Files changed (24) hide show
  1. package/dist/features/auth/signup/custom-input-field/{phone-input/country-selector → country-selector}/country-code-button.js +4 -4
  2. package/dist/features/auth/signup/custom-input-field/country-selector/country-code-button.js.map +1 -0
  3. package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js +29 -0
  4. package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js.map +1 -0
  5. package/dist/features/auth/signup/custom-input-field/{phone-input/phone-input-styled.js → country-selector/country-selector-styled.js} +2 -2
  6. package/dist/features/auth/signup/custom-input-field/country-selector/country-selector-styled.js.map +1 -0
  7. package/dist/features/auth/signup/custom-input-field/country-selector/country-selector.js +26 -0
  8. package/dist/features/auth/signup/custom-input-field/country-selector/country-selector.js.map +1 -0
  9. package/dist/features/auth/signup/custom-input-field/custom-input-field-styled.js +2 -10
  10. package/dist/features/auth/signup/custom-input-field/custom-input-field-styled.js.map +1 -1
  11. package/dist/features/auth/signup/custom-input-field/custom-input-field.js +60 -64
  12. package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
  13. package/dist/features/auth/signup/custom-input-field/password-toggle/password-toggle.js +9 -0
  14. package/dist/features/auth/signup/custom-input-field/password-toggle/password-toggle.js.map +1 -0
  15. package/dist/index.d.ts +3 -8
  16. package/dist/index.js +253 -255
  17. package/dist/index.js.map +1 -1
  18. package/package.json +1 -1
  19. package/dist/features/auth/signup/custom-input-field/phone-input/country-selector/country-code-button.js.map +0 -1
  20. package/dist/features/auth/signup/custom-input-field/phone-input/country-selector/country-list-menu.js +0 -28
  21. package/dist/features/auth/signup/custom-input-field/phone-input/country-selector/country-list-menu.js.map +0 -1
  22. package/dist/features/auth/signup/custom-input-field/phone-input/phone-input-styled.js.map +0 -1
  23. package/dist/features/auth/signup/custom-input-field/phone-input/phone-input.js +0 -67
  24. package/dist/features/auth/signup/custom-input-field/phone-input/phone-input.js.map +0 -1
@@ -1,8 +1,8 @@
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 "../phone-input-styled.js";
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
6
  const C = ({
7
7
  value: t,
8
8
  menuVisible: e
@@ -0,0 +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;"}
@@ -0,0 +1,29 @@
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import $ from "../../../../ui/text/text.js";
3
+ import { COUNTRY_CODE_MAP as a } from "../../signup-constants.js";
4
+ import { MenuWrapper as m, MenuItem as p, FlagIcon as s } from "./country-selector-styled.js";
5
+ const x = ({ selectedCountry: o, onChange: t }) => /* @__PURE__ */ e(m, { $widthX: 10, $gapX: 0.5, $background: "BLACK_2", $borderColor: "BLACK_5", children: a.map((n) => {
6
+ const { id: r, value: i, icon: c, code: d } = n;
7
+ return /* @__PURE__ */ l(
8
+ p,
9
+ {
10
+ $gutterX: 0.5,
11
+ $gapX: 0.75,
12
+ onClick: () => t({ code: d, id: r }),
13
+ $width: "100%",
14
+ $flexDirection: "row",
15
+ $alignItems: "center",
16
+ $flexGap: 8,
17
+ $isSelected: o.id === r,
18
+ children: [
19
+ /* @__PURE__ */ e(s, { src: c }),
20
+ /* @__PURE__ */ e($, { $renderAs: "ab3", $color: "WHITE", children: i })
21
+ ]
22
+ },
23
+ r
24
+ );
25
+ }) });
26
+ export {
27
+ x as default
28
+ };
29
+ //# sourceMappingURL=country-list-menu.js.map
@@ -0,0 +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 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 }) => {\n return (\n <Styled.MenuWrapper $widthX={10} $gapX={0.5} $background={'BLACK_2'} $borderColor={'BLACK_5'}>\n {COUNTRY_CODE_MAP.map(option => {\n const { id, value, icon, code } = option;\n\n return (\n <Styled.MenuItem\n key={id}\n $gutterX={0.5}\n $gapX={0.75}\n onClick={() => onChange({ code, id })}\n $width=\"100%\"\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $flexGap={8}\n $isSelected={selectedCountry.id === id}\n >\n <Styled.FlagIcon src={icon} />\n <Text $renderAs=\"ab3\" $color={'WHITE'}>\n {value}\n </Text>\n </Styled.MenuItem>\n );\n })}\n </Styled.MenuWrapper>\n );\n};\n\nexport default CountryListMenu;\n"],"names":["CountryListMenu","selectedCountry","onChange","jsx","Styled.MenuWrapper","COUNTRY_CODE_MAP","option","id","value","icon","code","jsxs","Styled.MenuItem","Styled.FlagIcon","Text"],"mappings":";;;;AAOA,MAAMA,IAA6C,CAAC,EAAE,iBAAAC,GAAiB,UAAAC,QAElE,gBAAAC,EAAAC,GAAA,EAAmB,SAAS,IAAI,OAAO,KAAK,aAAa,WAAW,cAAc,WAChF,UAAAC,EAAiB,IAAI,CAAUC,MAAA;AAC9B,QAAM,EAAE,IAAAC,GAAI,OAAAC,GAAO,MAAAC,GAAM,MAAAC,MAASJ;AAGhC,SAAA,gBAAAK;AAAA,IAACC;AAAAA,IAAA;AAAA,MAEC,UAAU;AAAA,MACV,OAAO;AAAA,MACP,SAAS,MAAMV,EAAS,EAAE,MAAAQ,GAAM,IAAAH,GAAI;AAAA,MACpC,QAAO;AAAA,MACP,gBAAe;AAAA,MACf,aAAY;AAAA,MACZ,UAAU;AAAA,MACV,aAAaN,EAAgB,OAAOM;AAAA,MAEpC,UAAA;AAAA,QAAA,gBAAAJ,EAACU,GAAA,EAAgB,KAAKJ,EAAM,CAAA;AAAA,0BAC3BK,GAAK,EAAA,WAAU,OAAM,QAAQ,SAC3B,UACHN,GAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAbKD;AAAA,EAAA;AAgBV,CAAA,EACH,CAAA;"}
@@ -22,8 +22,8 @@ const i = r(o)`
22
22
  `;
23
23
  export {
24
24
  s as CountryCodeButton,
25
- d as Icon,
25
+ d as FlagIcon,
26
26
  c as MenuItem,
27
27
  i as MenuWrapper
28
28
  };
29
- //# sourceMappingURL=phone-input-styled.js.map
29
+ //# sourceMappingURL=country-selector-styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-selector-styled.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/country-selector/country-selector-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const MenuWrapper = styled(FlexView)`\n border-radius: 2px;\n max-height: 220px;\n overflow-y: scroll;\n width: 271px;\n`;\n\nexport const MenuItem = styled(FlexView)<{ $isSelected: boolean }>(({ theme, $isSelected }) => {\n return `\n cursor: pointer;\n background: ${$isSelected ? theme.colors.BLACK_5 : 'transparent'};\n &:hover {\n background: ${theme.colors.BLACK_5};\n }\n `;\n});\n\nexport const FlagIcon = styled.img`\n width: 20px;\n height: 20px;\n`;\n\nexport const CountryCodeButton = styled(FlexView)`\n cursor: pointer;\n padding-right: 4px;\n max-width: 100px;\n min-width: 80px;\n`;\n"],"names":["MenuWrapper","styled","FlexView","MenuItem","theme","$isSelected","FlagIcon","CountryCodeButton"],"mappings":";;AAIa,MAAAA,IAAcC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,GAO7BC,IAAWF,EAAOC,CAAQ,EAA4B,CAAC,EAAE,OAAAE,GAAO,aAAAC,QACpE;AAAA;AAAA,oBAEWA,IAAcD,EAAM,OAAO,UAAU,aAAa;AAAA;AAAA,0BAE5CA,EAAM,OAAO,OAAO;AAAA;AAAA,IAG7C,GAEYE,IAAWL,EAAO;AAAA;AAAA;AAAA,GAKlBM,IAAoBN,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -0,0 +1,26 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useState as s, useCallback as u } from "react";
3
+ import f from "../../../../ui/context-menu/context-menu.js";
4
+ import l from "../../../../ui/layout/flex-view.js";
5
+ import c from "./country-code-button.js";
6
+ import d from "./country-list-menu.js";
7
+ const V = ({ value: t, onChange: n }) => {
8
+ const [o, r] = s(!1), i = u((m) => {
9
+ r(m);
10
+ }, []);
11
+ return !t || !n ? null : /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(
12
+ f,
13
+ {
14
+ startLeft: !0,
15
+ targetElement: /* @__PURE__ */ e(c, { value: t == null ? void 0 : t.code, menuVisible: o }),
16
+ menuElement: /* @__PURE__ */ e(d, { onChange: n, selectedCountry: t }),
17
+ menuOffset: 5,
18
+ menuZIndex: 1,
19
+ onMenuVisibilityChange: i
20
+ }
21
+ ) });
22
+ };
23
+ export {
24
+ V as default
25
+ };
26
+ //# sourceMappingURL=country-selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-selector.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/country-selector/country-selector.tsx"],"sourcesContent":["import type { IPhoneCountrySelectorProps } from './country-selector-types';\n\nimport { useCallback, useState, type FC } from 'react';\n\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport CountryCodeButton from './country-code-button';\nimport CountryListMenu from './country-list-menu';\n\nconst PhoneCountrySelector: FC<IPhoneCountrySelectorProps> = ({ value, onChange }) => {\n const [menuVisible, setMenuVisible] = useState(false);\n\n const handleMenuVisibility = useCallback((visible: boolean) => {\n setMenuVisible(visible);\n }, []);\n\n if (!value || !onChange) return null;\n\n return (\n <FlexView>\n <ContextMenu\n startLeft\n targetElement={<CountryCodeButton value={value?.code} menuVisible={menuVisible} />}\n menuElement={<CountryListMenu onChange={onChange} selectedCountry={value} />}\n menuOffset={5}\n menuZIndex={1}\n onMenuVisibilityChange={handleMenuVisibility}\n />\n </FlexView>\n );\n};\n\nexport default PhoneCountrySelector;\n"],"names":["PhoneCountrySelector","value","onChange","menuVisible","setMenuVisible","useState","handleMenuVisibility","useCallback","visible","FlexView","jsx","ContextMenu","CountryCodeButton","CountryListMenu"],"mappings":";;;;;;AASA,MAAMA,IAAuD,CAAC,EAAE,OAAAC,GAAO,UAAAC,QAAe;AACpF,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAAuBC,EAAY,CAACC,MAAqB;AAC7D,IAAAJ,EAAeI,CAAO;AAAA,EACxB,GAAG,CAAE,CAAA;AAEL,SAAI,CAACP,KAAS,CAACC,IAAiB,yBAG7BO,GACC,EAAA,UAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAS;AAAA,MACT,eAAgB,gBAAAD,EAAAE,GAAA,EAAkB,OAAOX,KAAA,gBAAAA,EAAO,MAAM,aAAAE,GAA0B;AAAA,MAChF,aAAa,gBAAAO,EAACG,GAAgB,EAAA,UAAAX,GAAoB,iBAAiBD,GAAO;AAAA,MAC1E,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,wBAAwBK;AAAA,IAAA;AAAA,EAE5B,EAAA,CAAA;AAEJ;"}
@@ -1,6 +1,5 @@
1
1
  import o from "styled-components";
2
- import e from "../../../ui/layout/flex-view.js";
3
- const r = o.input`
2
+ const e = o.input`
4
3
  width: 100%;
5
4
  max-width: 330px;
6
5
  padding: 0;
@@ -25,14 +24,7 @@ const r = o.input`
25
24
  -webkit-appearance: none;
26
25
  }
27
26
  `;
28
- o(e)`
29
- width: 100%;
30
- `;
31
- const p = o(e)`
32
- position: relative;
33
- `;
34
27
  export {
35
- r as CustomInput,
36
- p as PasswordInputWrapper
28
+ e as CustomInput
37
29
  };
38
30
  //# sourceMappingURL=custom-input-field-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-input-field-styled.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const CustomInput = styled.input<{ color: string; align?: string; textTransform?: string }>`\n width: 100%;\n max-width: 330px;\n padding: 0;\n line-height: 40px;\n text-transform: ${({ textTransform }) => textTransform || 'none'};\n border: none;\n outline: none;\n background-color: transparent;\n font-size: 32px;\n text-align: ${({ align }) => align ?? 'center'};\n caret-color: ${({ theme }) => theme.colors.WHITE};\n color: ${({ theme }) => theme.colors.WHITE};\n font-family: 'Athletics-Light';\n color: ${({ color }) => color};\n\n &::placeholder {\n font-family: 'Athletics-Light';\n font-size: 32px;\n }\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n`;\n\nexport const CountryCodeSelector = styled(FlexView)`\n width: 100%;\n`;\n\nexport const PasswordInputWrapper = styled(FlexView)`\n position: relative;\n`;\n"],"names":["CustomInput","styled","textTransform","align","theme","color","FlexView","PasswordInputWrapper"],"mappings":";;AAIO,MAAMA,IAAcC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKd,CAAC,EAAE,eAAAC,QAAoBA,KAAiB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKlD,CAAC,EAAE,OAAAC,QAAYA,KAAS,QAAQ;AAAA,iBAC/B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA,WACvC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,WAEjC,CAAC,EAAE,OAAAC,EAAM,MAAMA,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYIJ,EAAOK,CAAQ;AAAA;AAAA;AAIrC,MAAAC,IAAuBN,EAAOK,CAAQ;AAAA;AAAA;"}
1
+ {"version":3,"file":"custom-input-field-styled.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const CustomInput = styled.input<{ color: string; align?: string; textTransform?: string }>`\n width: 100%;\n max-width: 330px;\n padding: 0;\n line-height: 40px;\n text-transform: ${({ textTransform }) => textTransform || 'none'};\n border: none;\n outline: none;\n background-color: transparent;\n font-size: 32px;\n text-align: ${({ align }) => align ?? 'center'};\n caret-color: ${({ theme }) => theme.colors.WHITE};\n color: ${({ theme }) => theme.colors.WHITE};\n font-family: 'Athletics-Light';\n color: ${({ color }) => color};\n\n &::placeholder {\n font-family: 'Athletics-Light';\n font-size: 32px;\n }\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n`;\n"],"names":["CustomInput","styled","textTransform","align","theme","color"],"mappings":";AAEO,MAAMA,IAAcC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKd,CAAC,EAAE,eAAAC,QAAoBA,KAAiB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKlD,CAAC,EAAE,OAAAC,QAAYA,KAAS,QAAQ;AAAA,iBAC/B,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA,WACvC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,WAEjC,CAAC,EAAE,OAAAC,EAAM,MAAMA,CAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,85 +1,81 @@
1
- import { jsx as o, jsxs as W } from "react/jsx-runtime";
2
- import { useState as y, useCallback as x, useMemo as $ } from "react";
3
- import { useTheme as D } from "styled-components";
4
- import E from "../../../../assets/line-icons/icons/eye.js";
5
- import F from "../../../../assets/line-icons/icons/striked-eye.js";
6
- import H from "../../../ui/buttons/clickable/clickable.js";
7
- import P from "../../../ui/layout/flex-view.js";
8
- import { CustomInput as j, PasswordInputWrapper as G } from "./custom-input-field-styled.js";
1
+ import { jsx as s, jsxs as F } from "react/jsx-runtime";
2
+ import { useState as P, useCallback as V, useMemo as u } from "react";
3
+ import { useTheme as j } from "styled-components";
4
+ import k from "../../../ui/layout/flex-view.js";
5
+ import v from "./country-selector/country-selector.js";
6
+ import { CustomInput as G } from "./custom-input-field-styled.js";
9
7
  import { InputWrapper as K } from "./input-wrapper/input-wrapper.js";
10
- const R = ({
11
- value: n,
12
- onChange: c,
13
- error: i,
14
- helperText: b,
8
+ import R from "./password-toggle/password-toggle.js";
9
+ const S = ({
10
+ value: a,
11
+ onChange: m,
12
+ error: n,
13
+ helperText: p,
15
14
  onEnter: r,
16
- isLoading: g,
17
- isValid: p,
18
- type: t = "text",
19
- placeholder: u,
20
- actionElement: k,
21
- maxLength: m,
22
- width: a,
23
- textTransform: d,
24
- textAlign: f = "center"
15
+ isLoading: c,
16
+ isValid: l,
17
+ type: o = "text",
18
+ placeholder: f,
19
+ actionElement: d,
20
+ maxLength: h,
21
+ width: w,
22
+ textTransform: x,
23
+ textAlign: g = "center",
24
+ selectedCountry: C,
25
+ onCountryChange: I
25
26
  }) => {
26
- const s = D(), [l, T] = y(!1), w = x(
27
+ const t = j(), [i, T] = P(!1), $ = V(
27
28
  (e) => {
28
29
  e.key === "Enter" && (r == null || r());
29
30
  },
30
31
  [r]
31
- ), h = $(() => t === "password" ? l ? "text" : "password" : t, [t, l]), I = $(() => i ? s.colors.RED : p ? s.colors.GREEN_4 : s.colors.WHITE, [i, p, s.colors]), C = x(
32
- () => /* @__PURE__ */ o(
33
- j,
34
- {
35
- value: n,
36
- onChange: (e) => c(e.target.value),
37
- autoFocus: !0,
38
- placeholder: u,
39
- color: I,
40
- autoCapitalize: "none",
41
- textTransform: d,
42
- type: h,
43
- onKeyDown: w,
44
- maxLength: m,
45
- align: f
46
- }
47
- ),
48
- [
49
- w,
50
- I,
51
- h,
52
- m,
53
- c,
54
- u,
55
- f,
56
- d,
57
- n
58
- ]
59
- );
60
- return /* @__PURE__ */ o(
32
+ ), b = u(() => o === "password" ? i ? "text" : "password" : o === "phone" ? "number" : o, [o, i]), D = u(() => n ? t.colors.RED : l ? t.colors.GREEN_4 : t.colors.WHITE, [n, l, t.colors]);
33
+ return /* @__PURE__ */ s(
61
34
  K,
62
35
  {
63
- helperText: i || b,
64
- isLoading: g,
65
- actionElement: k,
66
- children: t === "password" ? /* @__PURE__ */ W(
67
- G,
36
+ helperText: n || p,
37
+ isLoading: c,
38
+ actionElement: d,
39
+ children: /* @__PURE__ */ F(
40
+ k,
68
41
  {
69
- $width: a ?? 220,
42
+ $width: w ?? "100%",
43
+ $flex: 1,
70
44
  $alignItems: "center",
71
45
  $flexDirection: "row",
72
46
  $flexGapX: 0.5,
73
47
  children: [
74
- C(),
75
- /* @__PURE__ */ o(H, { label: "password-toggle", onClick: () => T((e) => !e), children: l ? /* @__PURE__ */ o(E, { color: "WHITE", width: 24, height: 24 }) : /* @__PURE__ */ o(F, { color: "WHITE", width: 24, height: 24 }) })
48
+ o === "phone" && /* @__PURE__ */ s(v, { onChange: I, value: C }),
49
+ /* @__PURE__ */ s(
50
+ G,
51
+ {
52
+ value: a,
53
+ onChange: (e) => m(e.target.value),
54
+ autoFocus: !0,
55
+ placeholder: f,
56
+ color: D,
57
+ autoCapitalize: "none",
58
+ textTransform: x,
59
+ type: b,
60
+ onKeyDown: $,
61
+ maxLength: h,
62
+ align: g
63
+ }
64
+ ),
65
+ o === "password" && /* @__PURE__ */ s(
66
+ R,
67
+ {
68
+ isVisible: i,
69
+ onToggle: () => T((e) => !e)
70
+ }
71
+ )
76
72
  ]
77
73
  }
78
- ) : /* @__PURE__ */ o(P, { $width: a ?? "100%", $flex: 1, children: C() })
74
+ )
79
75
  }
80
76
  );
81
- }, B = R;
77
+ }, q = S;
82
78
  export {
83
- B as default
79
+ q as default
84
80
  };
85
81
  //# 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 { useCallback, useMemo, useState, type FC, type KeyboardEvent } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport EyeIcon from '../../../../assets/line-icons/icons/eye';\nimport StrikedEyeIcon from '../../../../assets/line-icons/icons/striked-eye';\nimport Clickable from '../../../ui/buttons/clickable/clickable';\nimport FlexView from '../../../ui/layout/flex-view';\nimport * as Styled from './custom-input-field-styled';\nimport { InputWrapper } from './input-wrapper/input-wrapper';\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}) => {\n const theme = useTheme();\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\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 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 renderInput = useCallback(\n () => (\n <Styled.CustomInput\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 />\n ),\n [\n handleKeyDown,\n inputColor,\n inputType,\n maxLength,\n onChange,\n placeholder,\n textAlign,\n textTransform,\n value,\n ],\n );\n\n return (\n <InputWrapper\n helperText={error || helperText}\n isLoading={isLoading}\n actionElement={actionElement}\n >\n {type === 'password' ? (\n <Styled.PasswordInputWrapper\n $width={width ?? 220}\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n >\n {renderInput()}\n <Clickable label=\"password-toggle\" onClick={() => setIsPasswordVisible(prev => !prev)}>\n {isPasswordVisible ? (\n <EyeIcon color=\"WHITE\" width={24} height={24} />\n ) : (\n <StrikedEyeIcon color=\"WHITE\" width={24} height={24} />\n )}\n </Clickable>\n </Styled.PasswordInputWrapper>\n ) : (\n <FlexView $width={width ?? '100%'} $flex={1}>\n {renderInput()}\n </FlexView>\n )}\n </InputWrapper>\n );\n};\n\nexport default CustomInputField;\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","theme","useTheme","isPasswordVisible","setIsPasswordVisible","useState","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","renderInput","jsx","Styled.CustomInput","InputWrapper","jsxs","Styled.PasswordInputWrapper","Clickable","prev","EyeIcon","StrikedEyeIcon","FlexView","CustomInputField$1"],"mappings":";;;;;;;;;AAYA,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;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAM;AACJ,QAAMC,IAAQC,KACR,CAACC,GAAmBC,CAAoB,IAAIC,EAAS,EAAK,GAE1DC,IAAgBC;AAAA,IACpB,CAACC,MAA2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,EAAAO,GAAA,EAAQ,OAAM,SAAQ,OAAO,IAAI,QAAQ,GAAI,CAAA,IAE9C,gBAAAP,EAACQ,GAAe,EAAA,OAAM,SAAQ,OAAO,IAAI,QAAQ,GAAI,CAAA,GAEzD;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,sBAECC,GAAS,EAAA,QAAQxB,KAAS,QAAQ,OAAO,GACvC,UAAAc,EACH,EAAA,CAAA;AAAA,IAAA;AAAA,EAAA;AAIR,GAEAW,IAAerC;"}
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 { useCallback, useMemo, useState, type FC, type KeyboardEvent } 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}) => {\n const theme = useTheme();\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\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 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 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 />\n {type === 'password' && (\n <PasswordToggleIcon\n isVisible={isPasswordVisible}\n onToggle={() => setIsPasswordVisible(prev => !prev)}\n />\n )}\n </FlexView>\n </InputWrapper>\n );\n};\n\nexport default CustomInputField;\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","selectedCountry","onCountryChange","theme","useTheme","isPasswordVisible","setIsPasswordVisible","useState","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","jsx","InputWrapper","jsxs","FlexView","PhoneCountrySelector","Styled.CustomInput","PasswordToggleIcon","prev","CustomInputField$1"],"mappings":";;;;;;;;AAWA,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;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,iBAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACJ,QAAMC,IAAQC,KACR,CAACC,GAAmBC,CAAoB,IAAIC,EAAS,EAAK,GAE1DC,IAAgBC;AAAA,IACpB,CAACC,MAA2C;AACtC,MAAAA,EAAM,QAAQ,YACN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;AAGN,GAEAC,IAAepC;"}
@@ -0,0 +1,9 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import t from "../../../../../assets/line-icons/icons/eye.js";
3
+ import e from "../../../../../assets/line-icons/icons/striked-eye.js";
4
+ import l from "../../../../ui/buttons/clickable/clickable.js";
5
+ const h = ({ isVisible: i, onToggle: r }) => /* @__PURE__ */ o(l, { label: "toggle-password-visibility", onClick: r, children: i ? /* @__PURE__ */ o(t, { color: "WHITE", width: 24, height: 24 }) : /* @__PURE__ */ o(e, { color: "WHITE", width: 24, height: 24 }) });
6
+ export {
7
+ h as default
8
+ };
9
+ //# sourceMappingURL=password-toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-toggle.js","sources":["../../../../../../src/features/auth/signup/custom-input-field/password-toggle/password-toggle.tsx"],"sourcesContent":["import type { IPasswordToggleProps } from './password-toggle-types';\nimport type { FC } from 'react';\n\nimport EyeIcon from '../../../../../assets/line-icons/icons/eye';\nimport StrikedEyeIcon from '../../../../../assets/line-icons/icons/striked-eye';\nimport Clickable from '../../../../ui/buttons/clickable/clickable';\n\nconst PasswordToggleIcon: FC<IPasswordToggleProps> = ({ isVisible, onToggle }) => (\n <Clickable label=\"toggle-password-visibility\" onClick={onToggle}>\n {isVisible ? (\n <EyeIcon color=\"WHITE\" width={24} height={24} />\n ) : (\n <StrikedEyeIcon color=\"WHITE\" width={24} height={24} />\n )}\n </Clickable>\n);\n\nexport default PasswordToggleIcon;\n"],"names":["PasswordToggleIcon","isVisible","onToggle","jsx","Clickable","EyeIcon","StrikedEyeIcon"],"mappings":";;;;AAOA,MAAMA,IAA+C,CAAC,EAAE,WAAAC,GAAW,UAAAC,EAAS,MACzE,gBAAAC,EAAAC,GAAA,EAAU,OAAM,8BAA6B,SAASF,GACpD,cACE,gBAAAC,EAAAE,GAAA,EAAQ,OAAM,SAAQ,OAAO,IAAI,QAAQ,GAAA,CAAI,IAE9C,gBAAAF,EAACG,GAAe,EAAA,OAAM,SAAQ,OAAO,IAAI,QAAQ,IAAI,EAEzD,CAAA;"}
package/dist/index.d.ts CHANGED
@@ -1117,12 +1117,14 @@ declare interface ICustomInputFieldProps {
1117
1117
  actionElement?: ReactNode;
1118
1118
  isLoading?: boolean;
1119
1119
  isValid?: boolean;
1120
- type?: 'text' | 'password' | 'number';
1120
+ type?: 'text' | 'password' | 'number' | 'phone';
1121
1121
  placeholder?: string;
1122
1122
  maxLength?: number;
1123
1123
  width?: number;
1124
1124
  textTransform?: string;
1125
1125
  textAlign?: string;
1126
+ onCountryChange?: (option: TSelectedCountry) => void;
1127
+ selectedCountry?: TSelectedCountry;
1126
1128
  }
1127
1129
 
1128
1130
  declare interface ICustomVideoProps extends React_2.DetailedHTMLProps<React_2.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement> {
@@ -2285,11 +2287,6 @@ declare interface IPerfectHitsProps {
2285
2287
  value: number;
2286
2288
  }
2287
2289
 
2288
- declare interface IPhoneInputProps extends ICustomInputFieldProps {
2289
- onCountryChange: (option: TSelectedCountry) => void;
2290
- selectedCountry: TSelectedCountry;
2291
- }
2292
-
2293
2290
  declare interface IPlaceholder {
2294
2291
  text?: string;
2295
2292
  marks?: string;
@@ -3976,8 +3973,6 @@ export declare const PercentileInput: React_2.ForwardRefExoticComponent<IPercent
3976
3973
 
3977
3974
  export declare const PerfectHits: NamedExoticComponent<IPerfectHitsProps>;
3978
3975
 
3979
- export declare const PhoneInput: FC<IPhoneInputProps>;
3980
-
3981
3976
  /**
3982
3977
  ** Global/Platform specific events that needs to be tracked goes here
3983
3978
  ** Naming convention needs to be snake_case