@cuemath/leap 3.5.41 → 3.5.42
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/assets/illustrations/illustrations.js +2 -1
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/apple-icon2.js +17 -0
- package/dist/assets/line-icons/icons/apple-icon2.js.map +1 -0
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +14 -12
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +45 -43
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js +14 -14
- package/dist/features/auth/comps/animated-avatar-message/animated-text/animated-text.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +16 -15
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/otp-input/otp-input-styled.js +10 -12
- package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +1 -1
- package/dist/features/auth/comps/otp-input/otp-input.js +31 -20
- package/dist/features/auth/comps/otp-input/otp-input.js.map +1 -1
- package/dist/features/auth/comps/pill-button/pill-button-styled.js +22 -19
- package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +1 -1
- package/dist/features/auth/comps/pill-button/pill-button.js +42 -39
- package/dist/features/auth/comps/pill-button/pill-button.js.map +1 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js +6 -6
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js.map +1 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +42 -40
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +1 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js +19 -17
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide-styled.js.map +1 -1
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js +34 -29
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +18 -20
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/pla-signup/signup-header/signup-header.js +18 -31
- package/dist/features/auth/pla-signup/signup-header/signup-header.js.map +1 -1
- package/dist/features/auth/pla-signup/signup-options/signup-options.js +56 -46
- package/dist/features/auth/pla-signup/signup-options/signup-options.js.map +1 -1
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js +19 -15
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js.map +1 -1
- package/dist/features/trial-session/trial-session-constants.js +9 -8
- package/dist/features/trial-session/trial-session-constants.js.map +1 -1
- package/dist/features/ui/tabs/tab-tem/tab-item.js +25 -22
- package/dist/features/ui/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/ui/tabs/tabs-styled.js +14 -18
- package/dist/features/ui/tabs/tabs-styled.js.map +1 -1
- package/dist/features/ui/tabs/tabs.js +17 -13
- package/dist/features/ui/tabs/tabs.js.map +1 -1
- package/dist/index.d.ts +33 -22
- package/dist/index.js +247 -247
- package/dist/static/stripe-blurple.7f233048.svg +1 -0
- package/dist/static/trustpilot-black.3878bb6f.svg +1 -0
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/apple-icon-white.js +0 -42
- package/dist/assets/line-icons/icons/apple-icon-white.js.map +0 -1
- package/dist/static/stripe-blurple.6abf422f.svg +0 -1
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as w, useRef as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsxs as k, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { memo as w, useRef as D, useCallback as c } from "react";
|
|
3
|
+
import { InputBox as L } from "./otp-input-styled.js";
|
|
4
|
+
import y from "../../../ui/layout/flex-view.js";
|
|
5
|
+
import E from "../../../ui/image/image.js";
|
|
6
|
+
import { ILLUSTRATIONS as R } from "../../../../assets/illustrations/illustrations.js";
|
|
7
|
+
import $ from "../../../ui/lottie-animation/lottie-animation.js";
|
|
8
|
+
import { LOTTIE as A } from "../../../../assets/lottie/lottie.js";
|
|
9
|
+
const O = ({
|
|
10
|
+
length: a = 4,
|
|
11
|
+
value: e,
|
|
12
|
+
onChange: m,
|
|
13
|
+
error: f,
|
|
14
|
+
isBusy: l = !1,
|
|
15
|
+
renderThemeAs: h = "dark"
|
|
16
|
+
}) => {
|
|
17
|
+
const i = h === "dark", s = D([]), I = c(
|
|
8
18
|
(r, t) => {
|
|
9
19
|
var u;
|
|
10
20
|
const o = t.replace(/\D/g, "").slice(-1), p = e.split("");
|
|
11
|
-
p[r] = o,
|
|
21
|
+
p[r] = o, m(p.join("")), o && r < a - 1 && ((u = s.current[r + 1]) == null || u.focus());
|
|
12
22
|
},
|
|
13
|
-
[
|
|
14
|
-
), g =
|
|
23
|
+
[a, m, e]
|
|
24
|
+
), g = c(
|
|
15
25
|
(r, t) => {
|
|
16
26
|
var o;
|
|
17
27
|
r.key === "Backspace" && !e[t] && t > 0 && ((o = s.current[t - 1]) == null || o.focus());
|
|
18
28
|
},
|
|
19
29
|
[e]
|
|
20
|
-
),
|
|
30
|
+
), T = c((r) => {
|
|
21
31
|
const t = r.target;
|
|
22
32
|
t.value.length > 1 && (t.value = t.value.slice(-1));
|
|
23
33
|
}, []);
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
Array.from({ length:
|
|
26
|
-
|
|
34
|
+
return /* @__PURE__ */ k(y, { $flexDirection: "row", $flexColumnGapX: 1, $alignItems: "center", children: [
|
|
35
|
+
Array.from({ length: a }).map((r, t) => /* @__PURE__ */ n(
|
|
36
|
+
L,
|
|
27
37
|
{
|
|
28
38
|
autoFocus: t === 0,
|
|
29
39
|
type: "text",
|
|
@@ -31,21 +41,22 @@ const j = ({ length: n = 4, value: e, onChange: c, error: m, isBusy: i = !1 }) =
|
|
|
31
41
|
pattern: "[0-9]*",
|
|
32
42
|
maxLength: 1,
|
|
33
43
|
value: e[t] || "",
|
|
34
|
-
onChange: (o) =>
|
|
35
|
-
|
|
44
|
+
onChange: (o) => I(t, o.target.value),
|
|
45
|
+
$isDarkTheme: i,
|
|
46
|
+
onInput: T,
|
|
36
47
|
onFocus: (o) => o.target.select(),
|
|
37
48
|
onKeyDown: (o) => g(o, t),
|
|
38
|
-
$hasError: !!
|
|
49
|
+
$hasError: !!f,
|
|
39
50
|
ref: (o) => {
|
|
40
51
|
o && (s.current[t] = o);
|
|
41
52
|
}
|
|
42
53
|
},
|
|
43
54
|
t
|
|
44
55
|
)),
|
|
45
|
-
|
|
56
|
+
l && (i ? /* @__PURE__ */ n($, { src: A.SPINNER_WHITE, height: 24, width: 24 }) : /* @__PURE__ */ n(E, { src: R.LOADER, height: 40, width: 40, alt: "loader" }))
|
|
46
57
|
] });
|
|
47
|
-
},
|
|
58
|
+
}, P = w(O);
|
|
48
59
|
export {
|
|
49
|
-
|
|
60
|
+
P as default
|
|
50
61
|
};
|
|
51
62
|
//# sourceMappingURL=otp-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-input.js","sources":["../../../../../src/features/auth/comps/otp-input/otp-input.tsx"],"sourcesContent":["import { useCallback, useRef, memo, type FC, type KeyboardEvent, type FormEvent } from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"otp-input.js","sources":["../../../../../src/features/auth/comps/otp-input/otp-input.tsx"],"sourcesContent":["import { useCallback, useRef, memo, type FC, type KeyboardEvent, type FormEvent } from 'react';\n\nimport * as Styled from './otp-input-styled';\nimport type { IOTPInputProps } from './otp-input-types';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Image from '../../../ui/image/image';\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport { LOTTIE } from '../../../../assets/lottie/lottie';\n\nconst OTPInput: FC<IOTPInputProps> = ({\n length = 4,\n value,\n onChange,\n error,\n isBusy = false,\n renderThemeAs = 'dark',\n}) => {\n const isDarkTheme = renderThemeAs === 'dark';\n const inputsRef = useRef<HTMLInputElement[]>([]);\n\n const handleChange = useCallback(\n (index: number, val: string) => {\n // Only allow single digit numbers\n const digit = val.replace(/\\D/g, '').slice(-1);\n\n const newValue = value.split('');\n\n newValue[index] = digit;\n onChange(newValue.join(''));\n\n if (digit && index < length - 1) {\n inputsRef.current[index + 1]?.focus();\n }\n },\n [length, onChange, value],\n );\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>, index: number) => {\n if (e.key === 'Backspace' && !value[index] && index > 0) {\n inputsRef.current[index - 1]?.focus();\n }\n },\n [value],\n );\n\n const handleInput = useCallback((e: FormEvent<HTMLInputElement>) => {\n // Prevent more than 1 character\n const target = e.target as HTMLInputElement;\n\n if (target.value.length > 1) {\n target.value = target.value.slice(-1);\n }\n }, []);\n\n return (\n <FlexView $flexDirection=\"row\" $flexColumnGapX={1} $alignItems=\"center\">\n {Array.from({ length }).map((_, index) => (\n <Styled.InputBox\n autoFocus={index === 0}\n key={index}\n type=\"text\"\n inputMode=\"numeric\"\n pattern=\"[0-9]*\"\n maxLength={1}\n value={value[index] || ''}\n onChange={e => handleChange(index, e.target.value)}\n $isDarkTheme={isDarkTheme}\n onInput={handleInput}\n onFocus={e => e.target.select()}\n onKeyDown={e => handleKeyDown(e, index)}\n $hasError={!!error}\n ref={el => {\n if (el) inputsRef.current[index] = el;\n }}\n />\n ))}\n {isBusy &&\n (isDarkTheme ? (\n <LottieAnimation src={LOTTIE.SPINNER_WHITE} height={24} width={24} />\n ) : (\n <Image src={ILLUSTRATIONS.LOADER} height={40} width={40} alt=\"loader\" />\n ))}\n </FlexView>\n );\n};\n\nexport default memo(OTPInput);\n"],"names":["OTPInput","length","value","onChange","error","isBusy","renderThemeAs","isDarkTheme","inputsRef","useRef","handleChange","useCallback","index","val","digit","newValue","_a","handleKeyDown","e","handleInput","target","FlexView","_","jsx","Styled.InputBox","el","LottieAnimation","LOTTIE","Image","ILLUSTRATIONS","otpInput","memo"],"mappings":";;;;;;;;AAUA,MAAMA,IAA+B,CAAC;AAAA,EACpC,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,eAAAC,IAAgB;AAClB,MAAM;AACJ,QAAMC,IAAcD,MAAkB,QAChCE,IAAYC,EAA2B,CAAA,CAAE,GAEzCC,IAAeC;AAAA,IACnB,CAACC,GAAeC,MAAgB;;AAE9B,YAAMC,IAAQD,EAAI,QAAQ,OAAO,EAAE,EAAE,MAAM,EAAE,GAEvCE,IAAWb,EAAM,MAAM,EAAE;AAE/B,MAAAa,EAASH,CAAK,IAAIE,GACTX,EAAAY,EAAS,KAAK,EAAE,CAAC,GAEtBD,KAASF,IAAQX,IAAS,OAC5Be,IAAAR,EAAU,QAAQI,IAAQ,CAAC,MAA3B,QAAAI,EAA8B;AAAA,IAElC;AAAA,IACA,CAACf,GAAQE,GAAUD,CAAK;AAAA,EAAA,GAGpBe,IAAgBN;AAAA,IACpB,CAACO,GAAoCN,MAAkB;;AACjD,MAAAM,EAAE,QAAQ,eAAe,CAAChB,EAAMU,CAAK,KAAKA,IAAQ,OACpDI,IAAAR,EAAU,QAAQI,IAAQ,CAAC,MAA3B,QAAAI,EAA8B;AAAA,IAElC;AAAA,IACA,CAACd,CAAK;AAAA,EAAA,GAGFiB,IAAcR,EAAY,CAACO,MAAmC;AAElE,UAAME,IAASF,EAAE;AAEb,IAAAE,EAAO,MAAM,SAAS,MACxBA,EAAO,QAAQA,EAAO,MAAM,MAAM,EAAE;AAAA,EAExC,GAAG,CAAE,CAAA;AAEL,2BACGC,GAAS,EAAA,gBAAe,OAAM,iBAAiB,GAAG,aAAY,UAC5D,UAAA;AAAA,IAAM,MAAA,KAAK,EAAE,QAAApB,EAAQ,CAAA,EAAE,IAAI,CAACqB,GAAGV,MAC9B,gBAAAW;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,WAAWZ,MAAU;AAAA,QAErB,MAAK;AAAA,QACL,WAAU;AAAA,QACV,SAAQ;AAAA,QACR,WAAW;AAAA,QACX,OAAOV,EAAMU,CAAK,KAAK;AAAA,QACvB,UAAU,CAAKM,MAAAR,EAAaE,GAAOM,EAAE,OAAO,KAAK;AAAA,QACjD,cAAcX;AAAA,QACd,SAASY;AAAA,QACT,SAAS,CAAAD,MAAKA,EAAE,OAAO,OAAO;AAAA,QAC9B,WAAW,CAAAA,MAAKD,EAAcC,GAAGN,CAAK;AAAA,QACtC,WAAW,CAAC,CAACR;AAAA,QACb,KAAK,CAAMqB,MAAA;AACT,UAAIA,MAAIjB,EAAU,QAAQI,CAAK,IAAIa;AAAA,QACrC;AAAA,MAAA;AAAA,MAdKb;AAAA,IAAA,CAgBR;AAAA,IACAP,MACEE,IACE,gBAAAgB,EAAAG,GAAA,EAAgB,KAAKC,EAAO,eAAe,QAAQ,IAAI,OAAO,GAAI,CAAA,IAElE,gBAAAJ,EAAAK,GAAA,EAAM,KAAKC,EAAc,QAAQ,QAAQ,IAAI,OAAO,IAAI,KAAI,SAAS,CAAA;AAAA,EAE5E,EAAA,CAAA;AAEJ,GAEeC,IAAAC,EAAK/B,CAAQ;"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
${({ selected: o, disabled:
|
|
6
|
-
const
|
|
1
|
+
import e, { css as p } from "styled-components";
|
|
2
|
+
import u from "../../../ui/layout/flex-view.js";
|
|
3
|
+
import $ from "../../../ui/text/text.js";
|
|
4
|
+
const d = e.button`
|
|
5
|
+
${({ selected: o, disabled: t, width: l, height: i, borderColor: s, theme: r, isTransparent: c, isDarkTheme: n }) => {
|
|
6
|
+
const _ = t ? r.colors[n ? "WHITE_T_10" : "REAL_BLACK_10"] : o ? r.colors[n ? "WHITE_1" : "BLACK_1"] : c ? r.colors.TRANSPARENT : r.colors[n ? "BLACK_1" : "WHITE_1"], a = t ? r.colors[n ? "WHITE_T_15" : "REAL_BLACK_15"] : s;
|
|
7
7
|
return p`
|
|
8
8
|
position: relative;
|
|
9
9
|
display: inline-flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: center;
|
|
12
|
-
cursor: ${
|
|
12
|
+
cursor: ${t ? "not-allowed" : "pointer"};
|
|
13
13
|
transition: all 0.3s ease;
|
|
14
14
|
padding: 7.5px 16px;
|
|
15
15
|
border-radius: 40px;
|
|
16
16
|
border: 1px solid ${a};
|
|
17
|
-
width: ${
|
|
18
|
-
height: ${
|
|
17
|
+
width: ${l ? `${l}` : "auto"}${typeof l == "number" ? "px" : ""};
|
|
18
|
+
height: ${i ? `${i}px` : "auto"};
|
|
19
19
|
min-height: 37px;
|
|
20
|
-
background-color: ${
|
|
20
|
+
background-color: ${_};
|
|
21
21
|
&:hover {
|
|
22
|
-
background-color: ${!o && !
|
|
22
|
+
background-color: ${!o && !t ? r.colors[n ? "WHITE_T_10" : "REAL_BLACK_10"] : void 0};
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
25
25
|
}}
|
|
26
|
-
`,
|
|
26
|
+
`, E = e(u)`
|
|
27
27
|
visibility: ${({ $showLottie: o }) => o ? "visible" : "hidden"};
|
|
28
|
-
`,
|
|
28
|
+
`, L = e($)`
|
|
29
29
|
transition:
|
|
30
30
|
color 0.3s ease,
|
|
31
31
|
left 0.3s ease,
|
|
@@ -38,13 +38,16 @@ const g = l.button`
|
|
|
38
38
|
left: ${o ? "0" : "-10px"};
|
|
39
39
|
`};
|
|
40
40
|
|
|
41
|
-
${({ selected: o, disabled:
|
|
42
|
-
|
|
43
|
-
`
|
|
41
|
+
${({ selected: o, disabled: t, theme: l, textColor: i, isDarkTheme: s }) => {
|
|
42
|
+
const r = l.colors[s ? "WHITE_T_38" : "BLACK_T_38"], c = l.colors[s ? "BLACK_1" : "WHITE_1"];
|
|
43
|
+
return p`
|
|
44
|
+
color: ${t ? r : o ? c : i};
|
|
45
|
+
`;
|
|
46
|
+
}};
|
|
44
47
|
`;
|
|
45
48
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
E as IconWrapper,
|
|
50
|
+
L as Label,
|
|
51
|
+
d as Wrapper
|
|
49
52
|
};
|
|
50
53
|
//# sourceMappingURL=pill-button-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pill-button-styled.js","sources":["../../../../../src/features/auth/comps/pill-button/pill-button-styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\nexport const Wrapper = styled.button<{\n selected: boolean;\n disabled: boolean;\n width?: number | string;\n height?: number;\n borderColor?: string;\n isTransparent?: boolean;\n}>`\n ${({ selected, disabled, width, height, borderColor, theme, isTransparent }) => {\n const getDefaultBgColor = () => {\n if (disabled) return theme.colors
|
|
1
|
+
{"version":3,"file":"pill-button-styled.js","sources":["../../../../../src/features/auth/comps/pill-button/pill-button-styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\nexport const Wrapper = styled.button<{\n selected: boolean;\n disabled: boolean;\n width?: number | string;\n height?: number;\n borderColor?: string;\n isTransparent?: boolean;\n isDarkTheme?: boolean;\n}>`\n ${({ selected, disabled, width, height, borderColor, theme, isTransparent, isDarkTheme }) => {\n const getDefaultBgColor = () => {\n if (disabled) return theme.colors[isDarkTheme ? 'WHITE_T_10' : 'REAL_BLACK_10'];\n\n if (selected) return theme.colors[isDarkTheme ? 'WHITE_1' : 'BLACK_1'];\n\n if (isTransparent) return theme.colors.TRANSPARENT;\n\n return theme.colors[isDarkTheme ? 'BLACK_1' : 'WHITE_1'];\n };\n\n const defaultBgColor = getDefaultBgColor();\n\n const borderColorVal = disabled\n ? theme.colors[isDarkTheme ? 'WHITE_T_15' : 'REAL_BLACK_15']\n : borderColor;\n\n return css`\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: ${disabled ? 'not-allowed' : 'pointer'};\n transition: all 0.3s ease;\n padding: 7.5px 16px;\n border-radius: 40px;\n border: 1px solid ${borderColorVal};\n width: ${width ? `${width}` : 'auto'}${typeof width === 'number' ? 'px' : ''};\n height: ${height ? `${height}px` : 'auto'};\n min-height: 37px;\n background-color: ${defaultBgColor};\n &:hover {\n background-color: ${!selected && !disabled\n ? theme.colors[isDarkTheme ? 'WHITE_T_10' : 'REAL_BLACK_10']\n : undefined};\n }\n `;\n }}\n`;\n\nexport const IconWrapper = styled(FlexView)<{\n $showLottie: boolean;\n}>`\n visibility: ${({ $showLottie }) => ($showLottie ? 'visible' : 'hidden')};\n`;\n\nexport const Label = styled(Text)<{\n selected: boolean;\n disabled: boolean;\n shouldOffsetLabel: boolean;\n textColor: string;\n isVisible: boolean;\n width?: string;\n isDarkTheme?: boolean;\n}>`\n transition:\n color 0.3s ease,\n left 0.3s ease,\n opacity 0.8s ease;\n position: relative;\n ${({ width }) => width && `min-width: ${width};`}\n opacity: ${({ isVisible }) => (isVisible ? 1 : 0)};\n\n ${({ shouldOffsetLabel }) => `\n left: ${shouldOffsetLabel ? '0' : '-10px'};\n `};\n\n ${({ selected, disabled, theme, textColor, isDarkTheme }) => {\n const disabledColor = theme.colors[isDarkTheme ? 'WHITE_T_38' : 'BLACK_T_38'];\n const selectedColor = theme.colors[isDarkTheme ? 'BLACK_1' : 'WHITE_1'];\n\n return css`\n color: ${disabled ? disabledColor : selected ? selectedColor : textColor};\n `;\n }};\n`;\n"],"names":["Wrapper","styled","selected","disabled","width","height","borderColor","theme","isTransparent","isDarkTheme","defaultBgColor","borderColorVal","css","IconWrap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AAO;AAAA,GAC1C;AAAA;AAAA,IAEC,CAAC,EAAE,UAAAjB,GAAU,UAAAC,GAAU,OAAAI,GAAO,WAAAa,GAAW,aAAAX,QAAkB;AAC3D,QAAMY,IAAgBd,EAAM,OAAOE,IAAc,eAAe,YAAY,GACtEa,IAAgBf,EAAM,OAAOE,IAAc,YAAY,SAAS;AAE/D,SAAAG;AAAA,eACIT,IAAWkB,IAAgBnB,IAAWoB,IAAgBF,CAAS;AAAA;AAE5E,CAAC;AAAA;"}
|
|
@@ -1,71 +1,74 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Wrapper as
|
|
9
|
-
const
|
|
1
|
+
import { jsx as r, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { memo as S, useState as l, useCallback as a, useEffect as V } from "react";
|
|
3
|
+
import { useTheme as X } from "styled-components";
|
|
4
|
+
import D from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
5
|
+
import Y from "../../../ui/hooks/use-click-handler.js";
|
|
6
|
+
import F from "../../../ui/layout/flex-view.js";
|
|
7
|
+
import G from "../../../ui/lottie-animation/lottie-animation.js";
|
|
8
|
+
import { Wrapper as K, IconWrapper as q, Label as z } from "./pill-button-styled.js";
|
|
9
|
+
const J = {
|
|
10
10
|
autoplay: !0,
|
|
11
11
|
loop: !0,
|
|
12
12
|
renderer: "canvas"
|
|
13
|
-
},
|
|
14
|
-
id:
|
|
13
|
+
}, N = ({
|
|
14
|
+
id: h,
|
|
15
15
|
label: n,
|
|
16
16
|
selected: t = !1,
|
|
17
17
|
disabled: e = !1,
|
|
18
18
|
animatedLabel: u = "",
|
|
19
19
|
icon: s,
|
|
20
20
|
onClick: f,
|
|
21
|
-
tooltip:
|
|
21
|
+
tooltip: m,
|
|
22
22
|
width: w,
|
|
23
|
-
analyticsLabel:
|
|
24
|
-
analyticsProps:
|
|
25
|
-
isTransparent:
|
|
23
|
+
analyticsLabel: $,
|
|
24
|
+
analyticsProps: g,
|
|
25
|
+
isTransparent: I = !1,
|
|
26
|
+
renderThemeAs: T = "dark"
|
|
26
27
|
}) => {
|
|
27
|
-
const [
|
|
28
|
-
f(
|
|
29
|
-
}, [
|
|
30
|
-
|
|
28
|
+
const [b, p] = l(!1), [o, k] = l(!1), [E, d] = l(!0), [L, H] = l(n), { colors: x } = X(), i = !!u, c = T === "dark", W = a(() => {
|
|
29
|
+
f(h);
|
|
30
|
+
}, [h, f]), { handleClick: B } = Y({ label: n, analyticsLabel: $, analyticsProps: g }, W);
|
|
31
|
+
V(() => {
|
|
31
32
|
if (!i || e) return;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const j = setInterval(() => {
|
|
34
|
+
d(!1), setTimeout(() => {
|
|
35
|
+
k((y) => !y), H(o ? n : u), d(!0);
|
|
35
36
|
}, 400);
|
|
36
37
|
}, 1500);
|
|
37
|
-
return () => clearInterval(
|
|
38
|
+
return () => clearInterval(j);
|
|
38
39
|
}, [u, e, o, n, i]);
|
|
39
|
-
const
|
|
40
|
-
|
|
40
|
+
const M = a(() => p(!0), []), P = a(() => p(!1), []), C = !!s && !e && (i || t || b), A = c ? "WHITE_1" : "BLACK_1", R = x[o ? "YELLOW_4" : A], _ = x[o && !t ? "YELLOW_4" : A], v = /* @__PURE__ */ r(
|
|
41
|
+
K,
|
|
41
42
|
{
|
|
42
43
|
selected: t,
|
|
43
44
|
disabled: e,
|
|
44
|
-
onClick:
|
|
45
|
-
onMouseEnter:
|
|
46
|
-
onMouseLeave:
|
|
45
|
+
onClick: B,
|
|
46
|
+
onMouseEnter: M,
|
|
47
|
+
onMouseLeave: P,
|
|
47
48
|
width: w,
|
|
48
|
-
borderColor:
|
|
49
|
-
isTransparent:
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
borderColor: R,
|
|
50
|
+
isTransparent: I,
|
|
51
|
+
isDarkTheme: c,
|
|
52
|
+
children: /* @__PURE__ */ O(
|
|
53
|
+
F,
|
|
52
54
|
{
|
|
53
55
|
$flexDirection: "row",
|
|
54
56
|
$alignItems: "center",
|
|
55
57
|
$justifyContent: "center",
|
|
56
58
|
$flexColumnGapX: 0.25,
|
|
57
59
|
children: [
|
|
58
|
-
s && /* @__PURE__ */ r(
|
|
60
|
+
s && /* @__PURE__ */ r(q, { $widthX: 1, $heightX: 1, $showLottie: C, children: /* @__PURE__ */ r(G, { src: s, settings: J }) }),
|
|
59
61
|
/* @__PURE__ */ r(
|
|
60
|
-
|
|
62
|
+
z,
|
|
61
63
|
{
|
|
62
|
-
shouldOffsetLabel:
|
|
64
|
+
shouldOffsetLabel: C || !s,
|
|
63
65
|
selected: t,
|
|
64
66
|
disabled: e,
|
|
65
67
|
$renderAs: o ? t ? "ub3-bold" : "ub3" : t ? "ub2-bold" : "ub2",
|
|
66
|
-
textColor:
|
|
68
|
+
textColor: _,
|
|
67
69
|
isVisible: E,
|
|
68
70
|
width: i ? "85px" : void 0,
|
|
71
|
+
isDarkTheme: c,
|
|
69
72
|
children: L
|
|
70
73
|
},
|
|
71
74
|
L
|
|
@@ -75,9 +78,9 @@ const q = {
|
|
|
75
78
|
)
|
|
76
79
|
}
|
|
77
80
|
);
|
|
78
|
-
return e &&
|
|
79
|
-
},
|
|
81
|
+
return e && m ? /* @__PURE__ */ r(D, { renderAs: "primary", tooltipItem: m, position: "top", children: v }) : v;
|
|
82
|
+
}, ut = S(N);
|
|
80
83
|
export {
|
|
81
|
-
|
|
84
|
+
ut as default
|
|
82
85
|
};
|
|
83
86
|
//# sourceMappingURL=pill-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pill-button.js","sources":["../../../../../src/features/auth/comps/pill-button/pill-button.tsx"],"sourcesContent":["import { useCallback, useEffect, useState, type FC, memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport useClickHandler from '../../../ui/hooks/use-click-handler';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport * as Styled from './pill-button-styled';\nimport type { IPillButtonProps } from './pill-button-types';\n\nconst lottieSettings = {\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PillButton: FC<IPillButtonProps> = ({\n id,\n label,\n selected = false,\n disabled = false,\n animatedLabel = '',\n icon,\n onClick,\n tooltip,\n width,\n analyticsLabel,\n analyticsProps,\n isTransparent = false,\n}) => {\n const [isHovered, setHovered] = useState(false);\n const [highlightPhase, setHighlightPhase] = useState(false);\n const [isVisible, setIsVisible] = useState(true);\n const [currentLabel, setCurrentLabel] = useState(label);\n const { colors } = useTheme();\n const shouldAnimate = !!animatedLabel;\n\n const handleSelect = useCallback(() => {\n onClick(id);\n }, [id, onClick]);\n\n const { handleClick } = useClickHandler({ label, analyticsLabel, analyticsProps }, handleSelect);\n\n useEffect(() => {\n if (!shouldAnimate || disabled) return;\n\n const interval = setInterval(() => {\n setIsVisible(false);\n\n setTimeout(() => {\n setHighlightPhase(prev => !prev);\n const newLabel = !highlightPhase ? animatedLabel : label;\n\n setCurrentLabel(newLabel);\n setIsVisible(true);\n }, 400);\n }, 1500);\n\n return () => clearInterval(interval);\n }, [animatedLabel, disabled, highlightPhase, label, shouldAnimate]);\n\n const handleMouseEnter = useCallback(() => setHovered(true), []);\n const handleMouseLeave = useCallback(() => setHovered(false), []);\n\n const showLottie = !!icon && !disabled && (shouldAnimate || selected || isHovered);\n\n const borderColor = colors[highlightPhase ? 'YELLOW_4' :
|
|
1
|
+
{"version":3,"file":"pill-button.js","sources":["../../../../../src/features/auth/comps/pill-button/pill-button.tsx"],"sourcesContent":["import { useCallback, useEffect, useState, type FC, memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport useClickHandler from '../../../ui/hooks/use-click-handler';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport * as Styled from './pill-button-styled';\nimport type { IPillButtonProps } from './pill-button-types';\n\nconst lottieSettings = {\n autoplay: true,\n loop: true,\n renderer: 'canvas',\n};\n\nconst PillButton: FC<IPillButtonProps> = ({\n id,\n label,\n selected = false,\n disabled = false,\n animatedLabel = '',\n icon,\n onClick,\n tooltip,\n width,\n analyticsLabel,\n analyticsProps,\n isTransparent = false,\n renderThemeAs = 'dark',\n}) => {\n const [isHovered, setHovered] = useState(false);\n const [highlightPhase, setHighlightPhase] = useState(false);\n const [isVisible, setIsVisible] = useState(true);\n const [currentLabel, setCurrentLabel] = useState(label);\n const { colors } = useTheme();\n const shouldAnimate = !!animatedLabel;\n const isDarkTheme = renderThemeAs === 'dark';\n\n const handleSelect = useCallback(() => {\n onClick(id);\n }, [id, onClick]);\n\n const { handleClick } = useClickHandler({ label, analyticsLabel, analyticsProps }, handleSelect);\n\n useEffect(() => {\n if (!shouldAnimate || disabled) return;\n\n const interval = setInterval(() => {\n setIsVisible(false);\n\n setTimeout(() => {\n setHighlightPhase(prev => !prev);\n const newLabel = !highlightPhase ? animatedLabel : label;\n\n setCurrentLabel(newLabel);\n setIsVisible(true);\n }, 400);\n }, 1500);\n\n return () => clearInterval(interval);\n }, [animatedLabel, disabled, highlightPhase, label, shouldAnimate]);\n\n const handleMouseEnter = useCallback(() => setHovered(true), []);\n const handleMouseLeave = useCallback(() => setHovered(false), []);\n\n const showLottie = !!icon && !disabled && (shouldAnimate || selected || isHovered);\n\n const themeColor = isDarkTheme ? 'WHITE_1' : 'BLACK_1';\n const borderColor = colors[highlightPhase ? 'YELLOW_4' : themeColor];\n const textColor = colors[highlightPhase && !selected ? 'YELLOW_4' : themeColor];\n const defaultTextRenderAs = selected ? 'ub2-bold' : 'ub2';\n const textRenderAs = highlightPhase ? (selected ? 'ub3-bold' : 'ub3') : defaultTextRenderAs;\n\n const ButtonContent = (\n <Styled.Wrapper\n selected={selected}\n disabled={disabled}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n width={width}\n borderColor={borderColor}\n isTransparent={isTransparent}\n isDarkTheme={isDarkTheme}\n >\n <FlexView\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $flexColumnGapX={0.25}\n >\n {icon && (\n <Styled.IconWrapper $widthX={1} $heightX={1} $showLottie={showLottie}>\n <LottieAnimation src={icon} settings={lottieSettings} />\n </Styled.IconWrapper>\n )}\n <Styled.Label\n key={currentLabel}\n shouldOffsetLabel={showLottie || !icon}\n selected={selected}\n disabled={disabled}\n $renderAs={textRenderAs}\n textColor={textColor}\n isVisible={isVisible}\n width={shouldAnimate ? '85px' : undefined}\n isDarkTheme={isDarkTheme}\n >\n {currentLabel}\n </Styled.Label>\n </FlexView>\n </Styled.Wrapper>\n );\n\n return disabled && tooltip ? (\n <ArrowTooltip renderAs=\"primary\" tooltipItem={tooltip} position=\"top\">\n {ButtonContent}\n </ArrowTooltip>\n ) : (\n ButtonContent\n );\n};\n\nexport default memo(PillButton);\n"],"names":["lottieSettings","PillButton","id","label","selected","disabled","animatedLabel","icon","onClick","tooltip","width","analyticsLabel","analyticsProps","isTransparent","renderThemeAs","isHovered","setHovered","useState","highlightPhase","setHighlightPhase","isVisible","setIsVisible","currentLabel","setCurrentLabel","colors","useTheme","shouldAnimate","isDarkTheme","handleSelect","useCallback","handleClick","useClickHandler","useEffect","interval","prev","handleMouseEnter","handleMouseLeave","showLottie","themeColor","borderColor","textColor","ButtonContent","jsx","Styled.Wrapper","jsxs","FlexView","Styled.IconWrapper","LottieAnimation","Styled.Label","ArrowTooltip","PillButton$1","memo"],"mappings":";;;;;;;;AAUA,MAAMA,IAAiB;AAAA,EACrB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AACZ,GAEMC,IAAmC,CAAC;AAAA,EACxC,IAAAC;AAAA,EAC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,CAAU;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
${({ selected: r, theme: o }) => `
|
|
1
|
+
import t from "styled-components";
|
|
2
|
+
import i from "../../../ui/layout/flex-view.js";
|
|
3
|
+
const n = t(i)`
|
|
4
|
+
${({ selected: r, theme: o, hoverBackground: e }) => `
|
|
5
5
|
cursor: pointer;
|
|
6
6
|
transition: all 0.3s ease;
|
|
7
7
|
|
|
8
8
|
&:hover {
|
|
9
|
-
|
|
9
|
+
background-color: ${r ? void 0 : o.colors[e]};
|
|
10
10
|
}
|
|
11
11
|
`}
|
|
12
12
|
`;
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
n as Wrapper
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=selectable-info-card-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectable-info-card-styled.js","sources":["../../../../../src/features/auth/comps/selectable-info-card/selectable-info-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const Wrapper = styled(FlexView)<{ selected: boolean }>`\n ${({ selected, theme }) => {\n return `\n cursor: pointer;\n transition: all 0.3s ease;\n\n &:hover {\n
|
|
1
|
+
{"version":3,"file":"selectable-info-card-styled.js","sources":["../../../../../src/features/auth/comps/selectable-info-card/selectable-info-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport type { TColorNames } from '../../../ui/types';\n\nexport const Wrapper = styled(FlexView)<{ selected: boolean; hoverBackground: TColorNames }>`\n ${({ selected, theme, hoverBackground }) => {\n return `\n cursor: pointer;\n transition: all 0.3s ease;\n\n &:hover {\n background-color: ${!selected ? theme.colors[hoverBackground] : undefined};\n }\n `;\n }}\n`;\n"],"names":["Wrapper","styled","FlexView","selected","theme","hoverBackground"],"mappings":";;AAKa,MAAAA,IAAUC,EAAOC,CAAQ;AAAA,IAClC,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,iBAAAC,QACb;AAAA;AAAA;AAAA;AAAA;AAAA,0BAKgBF,IAA2C,SAAhCC,EAAM,OAAOC,CAAe,CAAa;AAAA;AAAA,GAG5E;AAAA;"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as g, useRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { memo as g, useRef as k, useCallback as a, useMemo as A } from "react";
|
|
3
|
+
import I from "../../../ui/hooks/use-click-handler.js";
|
|
4
|
+
import L from "../../../ui/layout/flex-view.js";
|
|
5
|
+
import x from "../../../ui/lottie-animation/lottie-animation.js";
|
|
6
6
|
import u from "../../../ui/text/text.js";
|
|
7
7
|
import { Wrapper as E } from "./selectable-info-card-styled.js";
|
|
8
|
-
const
|
|
9
|
-
id:
|
|
10
|
-
title:
|
|
11
|
-
description:
|
|
12
|
-
icon:
|
|
8
|
+
const B = ({
|
|
9
|
+
id: l,
|
|
10
|
+
title: i,
|
|
11
|
+
description: f,
|
|
12
|
+
icon: s,
|
|
13
13
|
selected: r,
|
|
14
|
-
onClick:
|
|
15
|
-
analyticsLabel:
|
|
16
|
-
analyticsProps:
|
|
14
|
+
onClick: m,
|
|
15
|
+
analyticsLabel: p,
|
|
16
|
+
analyticsProps: d,
|
|
17
|
+
renderThemeAs: h = "dark"
|
|
17
18
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
}, [
|
|
21
|
-
{ label:
|
|
22
|
-
|
|
23
|
-
),
|
|
24
|
-
var
|
|
25
|
-
(
|
|
26
|
-
}, []),
|
|
27
|
-
var
|
|
28
|
-
r || (
|
|
29
|
-
}, [r]), b =
|
|
19
|
+
const n = k(null), o = h === "dark", C = a(() => {
|
|
20
|
+
m(l);
|
|
21
|
+
}, [l, m]), { handleClick: $ } = I(
|
|
22
|
+
{ label: i, analyticsLabel: p, analyticsProps: d },
|
|
23
|
+
C
|
|
24
|
+
), T = a(() => {
|
|
25
|
+
var e;
|
|
26
|
+
(e = n.current) == null || e.play();
|
|
27
|
+
}, []), _ = a(() => {
|
|
28
|
+
var e;
|
|
29
|
+
r || (e = n.current) == null || e.stop();
|
|
30
|
+
}, [r]), b = A(
|
|
30
31
|
() => ({
|
|
31
32
|
autoplay: r,
|
|
32
33
|
loop: !0,
|
|
@@ -34,40 +35,41 @@ const L = ({
|
|
|
34
35
|
}),
|
|
35
36
|
[r]
|
|
36
37
|
);
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ c(
|
|
38
39
|
E,
|
|
39
40
|
{
|
|
40
41
|
$gutterX: 1,
|
|
41
42
|
$gapX: 1,
|
|
42
|
-
$borderColor: "WHITE",
|
|
43
|
+
$borderColor: o ? "WHITE" : "BLACK",
|
|
43
44
|
$flexDirection: "row",
|
|
44
|
-
$background: r ? "
|
|
45
|
-
onMouseEnter:
|
|
46
|
-
onMouseLeave:
|
|
47
|
-
onClick:
|
|
45
|
+
$background: r && !o ? "BLACK_1" : "WHITE_1",
|
|
46
|
+
onMouseEnter: T,
|
|
47
|
+
onMouseLeave: _,
|
|
48
|
+
onClick: $,
|
|
48
49
|
$flexColumnGapX: 0.5,
|
|
49
50
|
selected: r,
|
|
50
51
|
$alignItems: "center",
|
|
52
|
+
hoverBackground: o ? "BLACK_5" : "WHITE_5",
|
|
51
53
|
children: [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
s && /* @__PURE__ */ t(
|
|
55
|
+
x,
|
|
54
56
|
{
|
|
55
|
-
src:
|
|
56
|
-
ref:
|
|
57
|
+
src: s,
|
|
58
|
+
ref: n,
|
|
57
59
|
settings: b,
|
|
58
60
|
width: 40,
|
|
59
61
|
height: 40
|
|
60
62
|
}
|
|
61
63
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ c(L, { children: [
|
|
65
|
+
/* @__PURE__ */ t(u, { $renderAs: "ab3", $color: r && !o ? "WHITE" : "BLACK_1", children: i }),
|
|
66
|
+
/* @__PURE__ */ t(u, { $renderAs: "ub3", $color: r && !o ? "WHITE_T_60" : "BLACK_T_60", children: f })
|
|
65
67
|
] })
|
|
66
68
|
]
|
|
67
69
|
}
|
|
68
70
|
);
|
|
69
|
-
},
|
|
71
|
+
}, X = g(B);
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
X as default
|
|
72
74
|
};
|
|
73
75
|
//# sourceMappingURL=selectable-info-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectable-info-card.js","sources":["../../../../../src/features/auth/comps/selectable-info-card/selectable-info-card.tsx"],"sourcesContent":["import { useCallback, useMemo, useRef, memo } from 'react';\n\nimport useClickHandler from '../../../ui/hooks/use-click-handler';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport type { ILottieAnimationRef } from '../../../ui/lottie-animation/types';\nimport Text from '../../../ui/text/text';\nimport * as Styled from './selectable-info-card-styled';\nimport type { ISelectableInfoCardProps } from './selectable-info-card-types';\n\nconst SelectableInfoCard = ({\n id,\n title,\n description,\n icon,\n selected,\n onClick,\n analyticsLabel,\n analyticsProps,\n}: ISelectableInfoCardProps) => {\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n\n const handleSelect = useCallback(() => {\n onClick(id);\n }, [id, onClick]);\n\n const { handleClick } = useClickHandler(\n { label: title, analyticsLabel, analyticsProps },\n handleSelect,\n );\n\n const handleOnMouseEnter = useCallback(() => {\n animationRef.current?.play();\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n if (selected) return;\n animationRef.current?.stop();\n }, [selected]);\n\n const renderSettings = useMemo(\n () => ({\n autoplay: selected,\n loop: true,\n renderer: 'canvas',\n }),\n [selected],\n );\n\n return (\n <Styled.Wrapper\n $gutterX={1}\n $gapX={1}\n $borderColor
|
|
1
|
+
{"version":3,"file":"selectable-info-card.js","sources":["../../../../../src/features/auth/comps/selectable-info-card/selectable-info-card.tsx"],"sourcesContent":["import { useCallback, useMemo, useRef, memo } from 'react';\n\nimport useClickHandler from '../../../ui/hooks/use-click-handler';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport type { ILottieAnimationRef } from '../../../ui/lottie-animation/types';\nimport Text from '../../../ui/text/text';\nimport * as Styled from './selectable-info-card-styled';\nimport type { ISelectableInfoCardProps } from './selectable-info-card-types';\n\nconst SelectableInfoCard = ({\n id,\n title,\n description,\n icon,\n selected,\n onClick,\n analyticsLabel,\n analyticsProps,\n renderThemeAs = 'dark',\n}: ISelectableInfoCardProps) => {\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const isDarkTheme = renderThemeAs === 'dark';\n\n const handleSelect = useCallback(() => {\n onClick(id);\n }, [id, onClick]);\n\n const { handleClick } = useClickHandler(\n { label: title, analyticsLabel, analyticsProps },\n handleSelect,\n );\n\n const handleOnMouseEnter = useCallback(() => {\n animationRef.current?.play();\n }, []);\n\n const handleOnMouseLeave = useCallback(() => {\n if (selected) return;\n animationRef.current?.stop();\n }, [selected]);\n\n const renderSettings = useMemo(\n () => ({\n autoplay: selected,\n loop: true,\n renderer: 'canvas',\n }),\n [selected],\n );\n\n return (\n <Styled.Wrapper\n $gutterX={1}\n $gapX={1}\n $borderColor={isDarkTheme ? 'WHITE' : 'BLACK'}\n $flexDirection=\"row\"\n $background={selected && !isDarkTheme ? 'BLACK_1' : 'WHITE_1'}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n onClick={handleClick}\n $flexColumnGapX={0.5}\n selected={selected}\n $alignItems=\"center\"\n hoverBackground={isDarkTheme ? 'BLACK_5' : 'WHITE_5'}\n >\n {icon && (\n <LottieAnimation\n src={icon}\n ref={animationRef}\n settings={renderSettings}\n width={40}\n height={40}\n />\n )}\n\n <FlexView>\n <Text $renderAs=\"ab3\" $color={selected && !isDarkTheme ? 'WHITE' : 'BLACK_1'}>\n {title}\n </Text>\n <Text $renderAs=\"ub3\" $color={selected && !isDarkTheme ? 'WHITE_T_60' : 'BLACK_T_60'}>\n {description}\n </Text>\n </FlexView>\n </Styled.Wrapper>\n );\n};\n\nexport default memo(SelectableInfoCard);\n"],"names":["SelectableInfoCard","id","title","description","icon","selected","onClick","analyticsLabel","analyticsProps","renderThemeAs","animationRef","useRef","isDarkTheme","handleSelect","useCallback","handleClick","useClickHandler","handleOnMouseEnter","_a","handleOnMouseLeave","renderSettings","useMemo","jsxs","Styled.Wrapper","jsx","LottieAnimation","FlexView","Text","selectableInfoCard","memo"],"mappings":";;;;;;;AAUA,MAAMA,IAAqB,CAAC;AAAA,EAC1B,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,eAAAC,IAAgB;AAClB,MAAgC;AACxB,QAAAC,IAAeC,EAAmC,IAAI,GACtDC,IAAcH,MAAkB,QAEhCI,IAAeC,EAAY,MAAM;AACrC,IAAAR,EAAQL,CAAE;AAAA,EAAA,GACT,CAACA,GAAIK,CAAO,CAAC,GAEV,EAAE,aAAAS,MAAgBC;AAAA,IACtB,EAAE,OAAOd,GAAO,gBAAAK,GAAgB,gBAAAC,EAAe;AAAA,IAC/CK;AAAA,EAAA,GAGII,IAAqBH,EAAY,MAAM;;AAC3C,KAAAI,IAAAR,EAAa,YAAb,QAAAQ,EAAsB;AAAA,EACxB,GAAG,CAAE,CAAA,GAECC,IAAqBL,EAAY,MAAM;;AAC3C,IAAIT,MACJa,IAAAR,EAAa,YAAb,QAAAQ,EAAsB;AAAA,EAAK,GAC1B,CAACb,CAAQ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