@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.
- package/dist/features/auth/signup/custom-input-field/{phone-input/country-selector → country-selector}/country-code-button.js +4 -4
- package/dist/features/auth/signup/custom-input-field/country-selector/country-code-button.js.map +1 -0
- package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js +29 -0
- package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js.map +1 -0
- package/dist/features/auth/signup/custom-input-field/{phone-input/phone-input-styled.js → country-selector/country-selector-styled.js} +2 -2
- package/dist/features/auth/signup/custom-input-field/country-selector/country-selector-styled.js.map +1 -0
- package/dist/features/auth/signup/custom-input-field/country-selector/country-selector.js +26 -0
- package/dist/features/auth/signup/custom-input-field/country-selector/country-selector.js.map +1 -0
- package/dist/features/auth/signup/custom-input-field/custom-input-field-styled.js +2 -10
- package/dist/features/auth/signup/custom-input-field/custom-input-field-styled.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js +60 -64
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/password-toggle/password-toggle.js +9 -0
- package/dist/features/auth/signup/custom-input-field/password-toggle/password-toggle.js.map +1 -0
- package/dist/index.d.ts +3 -8
- package/dist/index.js +253 -255
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/auth/signup/custom-input-field/phone-input/country-selector/country-code-button.js.map +0 -1
- package/dist/features/auth/signup/custom-input-field/phone-input/country-selector/country-list-menu.js +0 -28
- package/dist/features/auth/signup/custom-input-field/phone-input/country-selector/country-list-menu.js.map +0 -1
- package/dist/features/auth/signup/custom-input-field/phone-input/phone-input-styled.js.map +0 -1
- package/dist/features/auth/signup/custom-input-field/phone-input/phone-input.js +0 -67
- 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 "
|
3
|
-
import i from "
|
4
|
-
import d from "
|
5
|
-
import { CountryCodeButton as $ } from "
|
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
|
package/dist/features/auth/signup/custom-input-field/country-selector/country-code-button.js.map
ADDED
@@ -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
|
package/dist/features/auth/signup/custom-input-field/country-selector/country-list-menu.js.map
ADDED
@@ -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;"}
|
package/dist/features/auth/signup/custom-input-field/country-selector/country-selector-styled.js.map
ADDED
@@ -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
|
-
|
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
|
-
|
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\
|
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
|
2
|
-
import { useState as
|
3
|
-
import { useTheme as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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:
|
17
|
-
isValid:
|
18
|
-
type:
|
19
|
-
placeholder:
|
20
|
-
actionElement:
|
21
|
-
maxLength:
|
22
|
-
width:
|
23
|
-
textTransform:
|
24
|
-
textAlign:
|
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
|
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
|
-
),
|
32
|
-
|
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:
|
64
|
-
isLoading:
|
65
|
-
actionElement:
|
66
|
-
children:
|
67
|
-
|
36
|
+
helperText: n || p,
|
37
|
+
isLoading: c,
|
38
|
+
actionElement: d,
|
39
|
+
children: /* @__PURE__ */ F(
|
40
|
+
k,
|
68
41
|
{
|
69
|
-
$width:
|
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__ */
|
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
|
-
)
|
74
|
+
)
|
79
75
|
}
|
80
76
|
);
|
81
|
-
},
|
77
|
+
}, q = S;
|
82
78
|
export {
|
83
|
-
|
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
|
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,YACNnB,KAAA,QAAAA;AAAA,IAEd;AAAA,IACA,CAACA,CAAO;AAAA,EAAA,GAGJoB,IAAYC,EAAQ,MACpBlB,MAAS,aAAmBW,IAAoB,SAAS,aAEzDX,MAAS,UAAgB,WAEtBA,GACN,CAACA,GAAMW,CAAiB,CAAC,GAEtBQ,IAAaD,EAAQ,MACrBvB,IAAcc,EAAM,OAAO,MAE3BV,IAAgBU,EAAM,OAAO,UAE1BA,EAAM,OAAO,OACnB,CAACd,GAAOI,GAASU,EAAM,MAAM,CAAC;AAG/B,SAAA,gBAAAW;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAY1B,KAASC;AAAA,MACrB,WAAAE;AAAA,MACA,eAAAI;AAAA,MAEA,UAAA,gBAAAoB;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,QAAQnB,KAAS;AAAA,UACjB,OAAO;AAAA,UACP,aAAY;AAAA,UACZ,gBAAe;AAAA,UACf,WAAW;AAAA,UAEV,UAAA;AAAA,YAAAJ,MAAS,WACP,gBAAAoB,EAAAI,GAAA,EAAqB,UAAUhB,GAAiB,OAAOD,GAAiB;AAAA,YAE3E,gBAAAa;AAAA,cAACK;AAAAA,cAAA;AAAA,gBACC,OAAAhC;AAAA,gBACA,UAAU,CAAAuB,MAAStB,EAASsB,EAAM,OAAO,KAAK;AAAA,gBAC9C,WAAS;AAAA,gBACT,aAAAf;AAAA,gBACA,OAAOkB;AAAA,gBACP,gBAAe;AAAA,gBACf,eAAAd;AAAA,gBACA,MAAMY;AAAA,gBACN,WAAWH;AAAA,gBACX,WAAAX;AAAA,gBACA,OAAOG;AAAA,cAAA;AAAA,YACT;AAAA,YACCN,MAAS,cACR,gBAAAoB;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,WAAWf;AAAA,gBACX,UAAU,MAAMC,EAAqB,CAAAe,MAAQ,CAACA,CAAI;AAAA,cAAA;AAAA,YACpD;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;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
|