@cuemath/leap 3.5.41-link.2 → 3.5.41-m-1
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 +1 -3
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/apple-icon-white.js +42 -0
- package/dist/assets/line-icons/icons/apple-icon-white.js.map +1 -0
- package/dist/features/auth/auth-constants.js +4 -3
- package/dist/features/auth/auth-constants.js.map +1 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +12 -14
- 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 +43 -45
- 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 +15 -16
- 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 +12 -10
- package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +1 -1
- package/dist/features/auth/comps/otp-input/otp-input.js +20 -31
- package/dist/features/auth/comps/otp-input/otp-input.js.map +1 -1
- package/dist/features/auth/comps/pill-button/pill-button-styled.js +19 -22
- package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +1 -1
- package/dist/features/auth/comps/pill-button/pill-button.js +39 -42
- 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 +40 -42
- 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 +17 -19
- 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 +29 -34
- package/dist/features/auth/pla-signup/onboarding-guide/onboarding-guide.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +20 -18
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/pla-signup/signup-header/signup-header.js +29 -23
- 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 +46 -56
- package/dist/features/auth/pla-signup/signup-options/signup-options.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/constants.js +7 -4
- package/dist/features/circle-games/hooks/use-circle-sounds/constants.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js +51 -110
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js.map +1 -1
- package/dist/features/hooks/use-audio-player/use-audio-player.js +164 -0
- package/dist/features/hooks/use-audio-player/use-audio-player.js.map +1 -0
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js +17 -28
- package/dist/features/parent-dashboard/comps/compact-header/compact-header.js.map +1 -1
- package/dist/features/trial-session/trial-session-constants.js +8 -9
- package/dist/features/trial-session/trial-session-constants.js.map +1 -1
- package/dist/features/ui/tabs/tab-tem/tab-item.js +17 -21
- package/dist/features/ui/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/ui/tabs/tabs-styled.js +4 -9
- package/dist/features/ui/tabs/tabs-styled.js.map +1 -1
- package/dist/features/ui/tabs/tabs.js +13 -17
- package/dist/features/ui/tabs/tabs.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js +61 -57
- package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js +86 -82
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js.map +1 -1
- package/dist/index.d.ts +35 -37
- package/dist/index.js +247 -247
- package/dist/static/stripe-blurple.6abf422f.svg +1 -0
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/apple-icon2.js +0 -17
- package/dist/assets/line-icons/icons/apple-icon2.js.map +0 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/helper.js +0 -19
- package/dist/features/circle-games/hooks/use-circle-sounds/helper.js.map +0 -1
- package/dist/features/hooks/use-audio-player.js +0 -54
- package/dist/features/hooks/use-audio-player.js.map +0 -1
- package/dist/static/cuemath-logo-black.2961a145.svg +0 -1
- package/dist/static/stripe-blurple.7f233048.svg +0 -1
- package/dist/static/trustpilot-black.3878bb6f.svg +0 -1
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import r from "styled-components";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import t, { css as r } from "styled-components";
|
|
2
|
+
import n from "../../../ui/layout/flex-view.js";
|
|
3
|
+
const l = t(n)``, p = t.input`
|
|
4
4
|
width: 56px;
|
|
5
5
|
height: 56px;
|
|
6
6
|
font-size: 24px;
|
|
7
7
|
text-align: center;
|
|
8
8
|
font-family: 'Athletics-Light';
|
|
9
|
-
border: 2px solid ${o.colors
|
|
10
|
-
color: ${o.colors
|
|
11
|
-
background-color: ${o.colors
|
|
9
|
+
border: ${({ theme: o }) => `2px solid ${o.colors.BLACK_5}`};
|
|
10
|
+
color: ${({ theme: o }) => o.colors.WHITE};
|
|
11
|
+
background-color: ${({ theme: o }) => o.colors.BLACK_3};
|
|
12
12
|
outline: none;
|
|
13
13
|
transition: all 0.3s ease;
|
|
14
|
-
${
|
|
14
|
+
${({ $hasError: o }) => o && r`
|
|
15
|
+
border-color: ${({ theme: e }) => e.colors.ORANGE_4};
|
|
16
|
+
`}
|
|
15
17
|
&::-webkit-outer-spin-button,
|
|
16
18
|
&::-webkit-inner-spin-button {
|
|
17
19
|
-webkit-appearance: none;
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
);
|
|
21
|
+
`;
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
+
p as InputBox,
|
|
24
|
+
l as Wrapper
|
|
23
25
|
};
|
|
24
26
|
//# sourceMappingURL=otp-input-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-input-styled.js","sources":["../../../../../src/features/auth/comps/otp-input/otp-input-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const InputBox = styled.input<{ $hasError: boolean
|
|
1
|
+
{"version":3,"file":"otp-input-styled.js","sources":["../../../../../src/features/auth/comps/otp-input/otp-input-styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const Wrapper = styled(FlexView)``;\n\nexport const InputBox = styled.input<{ $hasError: boolean }>`\n width: 56px;\n height: 56px;\n font-size: 24px;\n text-align: center;\n font-family: 'Athletics-Light';\n border: ${({ theme }) => `2px solid ${theme.colors.BLACK_5}`};\n color: ${({ theme }) => theme.colors.WHITE};\n background-color: ${({ theme }) => theme.colors.BLACK_3};\n outline: none;\n transition: all 0.3s ease;\n ${({ $hasError }) =>\n $hasError &&\n css`\n border-color: ${({ theme }) => theme.colors.ORANGE_4};\n `}\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n`;\n"],"names":["Wrapper","styled","FlexView","InputBox","theme","$hasError","css"],"mappings":";;AAIa,MAAAA,IAAUC,EAAOC,CAAQ,KAEzBC,IAAWF,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAMnB,CAAC,EAAE,OAAAG,EAAM,MAAM,aAAaA,EAAM,OAAO,OAAO,EAAE;AAAA,WACnD,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA,sBACtB,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA,IAGrD,CAAC,EAAE,WAAAC,QACHA,KACAC;AAAA,sBACkB,CAAC,EAAE,OAAAF,EAAA,MAAYA,EAAM,OAAO,QAAQ;AAAA,KACrD;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -1,39 +1,29 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as w, useRef as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
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(
|
|
1
|
+
import { jsxs as I, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { memo as w, useRef as y, useCallback as a } from "react";
|
|
3
|
+
import { LOTTIE as D } from "../../../../assets/lottie/lottie.js";
|
|
4
|
+
import E from "../../../ui/lottie-animation/lottie-animation.js";
|
|
5
|
+
import { Wrapper as T, InputBox as $ } from "./otp-input-styled.js";
|
|
6
|
+
const j = ({ length: n = 4, value: e, onChange: c, error: m, isBusy: i = !1 }) => {
|
|
7
|
+
const s = y([]), l = a(
|
|
18
8
|
(r, t) => {
|
|
19
9
|
var u;
|
|
20
10
|
const o = t.replace(/\D/g, "").slice(-1), p = e.split("");
|
|
21
|
-
p[r] = o,
|
|
11
|
+
p[r] = o, c(p.join("")), o && r < n - 1 && ((u = s.current[r + 1]) == null || u.focus());
|
|
22
12
|
},
|
|
23
|
-
[
|
|
24
|
-
), g =
|
|
13
|
+
[n, c, e]
|
|
14
|
+
), g = a(
|
|
25
15
|
(r, t) => {
|
|
26
16
|
var o;
|
|
27
17
|
r.key === "Backspace" && !e[t] && t > 0 && ((o = s.current[t - 1]) == null || o.focus());
|
|
28
18
|
},
|
|
29
19
|
[e]
|
|
30
|
-
),
|
|
20
|
+
), h = a((r) => {
|
|
31
21
|
const t = r.target;
|
|
32
22
|
t.value.length > 1 && (t.value = t.value.slice(-1));
|
|
33
23
|
}, []);
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
Array.from({ length:
|
|
36
|
-
|
|
24
|
+
return /* @__PURE__ */ I(T, { $flexDirection: "row", $flexColumnGapX: 1, $alignItems: "center", children: [
|
|
25
|
+
Array.from({ length: n }).map((r, t) => /* @__PURE__ */ f(
|
|
26
|
+
$,
|
|
37
27
|
{
|
|
38
28
|
autoFocus: t === 0,
|
|
39
29
|
type: "text",
|
|
@@ -41,22 +31,21 @@ const O = ({
|
|
|
41
31
|
pattern: "[0-9]*",
|
|
42
32
|
maxLength: 1,
|
|
43
33
|
value: e[t] || "",
|
|
44
|
-
onChange: (o) =>
|
|
45
|
-
|
|
46
|
-
onInput: T,
|
|
34
|
+
onChange: (o) => l(t, o.target.value),
|
|
35
|
+
onInput: h,
|
|
47
36
|
onFocus: (o) => o.target.select(),
|
|
48
37
|
onKeyDown: (o) => g(o, t),
|
|
49
|
-
$hasError: !!
|
|
38
|
+
$hasError: !!m,
|
|
50
39
|
ref: (o) => {
|
|
51
40
|
o && (s.current[t] = o);
|
|
52
41
|
}
|
|
53
42
|
},
|
|
54
43
|
t
|
|
55
44
|
)),
|
|
56
|
-
|
|
45
|
+
i && /* @__PURE__ */ f(E, { src: D.SPINNER_WHITE, height: 24, width: 24 })
|
|
57
46
|
] });
|
|
58
|
-
},
|
|
47
|
+
}, B = w(j);
|
|
59
48
|
export {
|
|
60
|
-
|
|
49
|
+
B as default
|
|
61
50
|
};
|
|
62
51
|
//# 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 { LOTTIE } from '../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport * as styled from './otp-input-styled';\nimport type { IOTPInputProps } from './otp-input-types';\n\nconst OTPInput: FC<IOTPInputProps> = ({ length = 4, value, onChange, error, isBusy = false }) => {\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 <styled.Wrapper $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 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 && <LottieAnimation src={LOTTIE.SPINNER_WHITE} height={24} width={24} />}\n </styled.Wrapper>\n );\n};\n\nexport default memo(OTPInput);\n"],"names":["OTPInput","length","value","onChange","error","isBusy","inputsRef","useRef","handleChange","useCallback","index","val","digit","newValue","_a","handleKeyDown","e","handleInput","target","jsxs","styled.Wrapper","_","jsx","styled.InputBox","el","LottieAnimation","LOTTIE","otpInput","memo"],"mappings":";;;;;AAOA,MAAMA,IAA+B,CAAC,EAAE,QAAAC,IAAS,GAAG,OAAAC,GAAO,UAAAC,GAAU,OAAAC,GAAO,QAAAC,IAAS,SAAY;AACzF,QAAAC,IAAYC,EAA2B,CAAA,CAAE,GAEzCC,IAAeC;AAAA,IACnB,CAACC,GAAeC,MAAgB;;AAE9B,YAAMC,IAAQD,EAAI,QAAQ,OAAO,EAAE,EAAE,MAAM,EAAE,GAEvCE,IAAWX,EAAM,MAAM,EAAE;AAE/B,MAAAW,EAASH,CAAK,IAAIE,GACTT,EAAAU,EAAS,KAAK,EAAE,CAAC,GAEtBD,KAASF,IAAQT,IAAS,OAC5Ba,IAAAR,EAAU,QAAQI,IAAQ,CAAC,MAA3B,QAAAI,EAA8B;AAAA,IAElC;AAAA,IACA,CAACb,GAAQE,GAAUD,CAAK;AAAA,EAAA,GAGpBa,IAAgBN;AAAA,IACpB,CAACO,GAAoCN,MAAkB;;AACjD,MAAAM,EAAE,QAAQ,eAAe,CAACd,EAAMQ,CAAK,KAAKA,IAAQ,OACpDI,IAAAR,EAAU,QAAQI,IAAQ,CAAC,MAA3B,QAAAI,EAA8B;AAAA,IAElC;AAAA,IACA,CAACZ,CAAK;AAAA,EAAA,GAGFe,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;AAGH,SAAA,gBAAAC,EAACC,GAAA,EAAe,gBAAe,OAAM,iBAAiB,GAAG,aAAY,UAClE,UAAA;AAAA,IAAM,MAAA,KAAK,EAAE,QAAAnB,EAAQ,CAAA,EAAE,IAAI,CAACoB,GAAGX,MAC9B,gBAAAY;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,WAAWb,MAAU;AAAA,QAErB,MAAK;AAAA,QACL,WAAU;AAAA,QACV,SAAQ;AAAA,QACR,WAAW;AAAA,QACX,OAAOR,EAAMQ,CAAK,KAAK;AAAA,QACvB,UAAU,CAAKM,MAAAR,EAAaE,GAAOM,EAAE,OAAO,KAAK;AAAA,QACjD,SAASC;AAAA,QACT,SAAS,CAAAD,MAAKA,EAAE,OAAO,OAAO;AAAA,QAC9B,WAAW,CAAAA,MAAKD,EAAcC,GAAGN,CAAK;AAAA,QACtC,WAAW,CAAC,CAACN;AAAA,QACb,KAAK,CAAMoB,MAAA;AACT,UAAIA,MAAIlB,EAAU,QAAQI,CAAK,IAAIc;AAAA,QACrC;AAAA,MAAA;AAAA,MAbKd;AAAA,IAAA,CAeR;AAAA,IACAL,uBAAWoB,GAAgB,EAAA,KAAKC,EAAO,eAAe,QAAQ,IAAI,OAAO,GAAI,CAAA;AAAA,EAChF,EAAA,CAAA;AAEJ,GAEeC,IAAAC,EAAK5B,CAAQ;"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
${({ selected: o, disabled:
|
|
6
|
-
const
|
|
1
|
+
import l, { css as p } from "styled-components";
|
|
2
|
+
import $ from "../../../ui/layout/flex-view.js";
|
|
3
|
+
import u from "../../../ui/text/text.js";
|
|
4
|
+
const g = l.button`
|
|
5
|
+
${({ selected: o, disabled: r, width: t, height: n, borderColor: e, theme: i, isTransparent: s }) => {
|
|
6
|
+
const c = r ? i.colors.WHITE_T_10 : o ? i.colors.WHITE_1 : s ? i.colors.TRANSPARENT : i.colors.BLACK_1, a = r ? i.colors.WHITE_T_15 : e;
|
|
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: ${r ? "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: ${t ? `${t}` : "auto"}${typeof t == "number" ? "px" : ""};
|
|
18
|
+
height: ${n ? `${n}px` : "auto"};
|
|
19
19
|
min-height: 37px;
|
|
20
|
-
background-color: ${
|
|
20
|
+
background-color: ${c};
|
|
21
21
|
&:hover {
|
|
22
|
-
background-color: ${!o && !
|
|
22
|
+
background-color: ${!o && !r ? i.colors.WHITE_T_10 : void 0};
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
25
25
|
}}
|
|
26
|
-
`,
|
|
26
|
+
`, d = l($)`
|
|
27
27
|
visibility: ${({ $showLottie: o }) => o ? "visible" : "hidden"};
|
|
28
|
-
`,
|
|
28
|
+
`, b = l(u)`
|
|
29
29
|
transition:
|
|
30
30
|
color 0.3s ease,
|
|
31
31
|
left 0.3s ease,
|
|
@@ -38,16 +38,13 @@ const d = e.button`
|
|
|
38
38
|
left: ${o ? "0" : "-10px"};
|
|
39
39
|
`};
|
|
40
40
|
|
|
41
|
-
${({ selected: o, disabled:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
color: ${t ? r : o ? c : i};
|
|
45
|
-
`;
|
|
46
|
-
}};
|
|
41
|
+
${({ selected: o, disabled: r, theme: t, textColor: n }) => `
|
|
42
|
+
color: ${r ? t.colors.WHITE_T_38 : o ? t.colors.BLACK_1 : n};
|
|
43
|
+
`};
|
|
47
44
|
`;
|
|
48
45
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
d as IconWrapper,
|
|
47
|
+
b as Label,
|
|
48
|
+
g as Wrapper
|
|
52
49
|
};
|
|
53
50
|
//# 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
|
|
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.WHITE_T_10;\n\n if (selected) return theme.colors.WHITE_1;\n\n if (isTransparent) return theme.colors.TRANSPARENT;\n\n return theme.colors.BLACK_1;\n };\n\n const defaultBgColor = getDefaultBgColor();\n\n const borderColorVal = disabled ? theme.colors.WHITE_T_15 : 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 ? theme.colors.WHITE_T_10 : 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}>`\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 }) => `\n color: ${disabled ? theme.colors.WHITE_T_38 : selected ? theme.colors.BLACK_1 : textColor};\n `};\n`;\n"],"names":["Wrapper","styled","selected","disabled","width","height","borderColor","theme","isTransparent","defaultBgColor","borderColorVal","css","IconWrapper","FlexView","$showLottie","Label","Text","isVisible","shouldOffsetLabel","textColor"],"mappings":";;;AAKO,MAAMA,IAAUC,EAAO;AAAA,IAQ1B,CAAC,EAAE,UAAAC,GAAU,UAAAC,GAAU,OAAAC,GAAO,QAAAC,GAAQ,aAAAC,GAAa,OAAAC,GAAO,eAAAC,QAAoB;AAW9E,QAAMC,IATAN,IAAiBI,EAAM,OAAO,aAE9BL,IAAiBK,EAAM,OAAO,UAE9BC,IAAsBD,EAAM,OAAO,cAEhCA,EAAM,OAAO,SAKhBG,IAAiBP,IAAWI,EAAM,OAAO,aAAaD;AAErD,SAAAK;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKKR,IAAW,gBAAgB,SAAS;AAAA;AAAA;AAAA;AAAA,0BAI1BO,CAAc;AAAA,eACzBN,IAAQ,GAAGA,CAAK,KAAK,MAAM,GAAG,OAAOA,KAAU,WAAW,OAAO,EAAE;AAAA,gBAClEC,IAAS,GAAGA,CAAM,OAAO,MAAM;AAAA;AAAA,0BAErBI,CAAc;AAAA;AAAA,4BAEZ,CAACP,KAAY,CAACC,IAAWI,EAAM,OAAO,aAAa,MAAS;AAAA;AAAA;AAGtF,CAAC;AAAA,GAGUK,IAAcX,EAAOY,CAAQ;AAAA,gBAG1B,CAAC,EAAE,aAAAC,EAAA,MAAmBA,IAAc,YAAY,QAAS;AAAA,GAG5DC,IAAQd,EAAOe,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAa5B,CAAC,EAAE,OAAAZ,QAAYA,KAAS,cAAcA,CAAK,GAAG;AAAA,aACrC,CAAC,EAAE,WAAAa,EAAA,MAAiBA,IAAY,IAAI,CAAE;AAAA;AAAA,IAE/C,CAAC,EAAE,mBAAAC,EAAA,MAAwB;AAAA,YACnBA,IAAoB,MAAM,OAAO;AAAA,GAC1C;AAAA;AAAA,IAEC,CAAC,EAAE,UAAAhB,GAAU,UAAAC,GAAU,OAAAI,GAAO,WAAAY,EAAgB,MAAA;AAAA,aACrChB,IAAWI,EAAM,OAAO,aAAaL,IAAWK,EAAM,OAAO,UAAUY,CAAS;AAAA,GAC1F;AAAA;"}
|
|
@@ -1,74 +1,71 @@
|
|
|
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 k } from "react/jsx-runtime";
|
|
2
|
+
import { memo as y, useState as l, useCallback as c, useEffect as B } from "react";
|
|
3
|
+
import { useTheme as O } from "styled-components";
|
|
4
|
+
import S from "../../../ui/arrow-tooltip/arrow-tooltip.js";
|
|
5
|
+
import V from "../../../ui/hooks/use-click-handler.js";
|
|
6
|
+
import X from "../../../ui/layout/flex-view.js";
|
|
7
|
+
import Y from "../../../ui/lottie-animation/lottie-animation.js";
|
|
8
|
+
import { Wrapper as D, IconWrapper as F, Label as G } from "./pill-button-styled.js";
|
|
9
|
+
const q = {
|
|
10
10
|
autoplay: !0,
|
|
11
11
|
loop: !0,
|
|
12
12
|
renderer: "canvas"
|
|
13
|
-
},
|
|
14
|
-
id:
|
|
13
|
+
}, z = ({
|
|
14
|
+
id: a,
|
|
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: h,
|
|
22
22
|
width: w,
|
|
23
|
-
analyticsLabel:
|
|
24
|
-
analyticsProps:
|
|
25
|
-
isTransparent:
|
|
26
|
-
renderThemeAs: T = "dark"
|
|
23
|
+
analyticsLabel: A,
|
|
24
|
+
analyticsProps: C,
|
|
25
|
+
isTransparent: $ = !1
|
|
27
26
|
}) => {
|
|
28
|
-
const [
|
|
29
|
-
f(
|
|
30
|
-
}, [
|
|
31
|
-
|
|
27
|
+
const [g, m] = l(!1), [o, I] = l(!1), [E, p] = l(!0), [L, T] = l(n), { colors: d } = O(), i = !!u, b = c(() => {
|
|
28
|
+
f(a);
|
|
29
|
+
}, [a, f]), { handleClick: H } = V({ label: n, analyticsLabel: A, analyticsProps: C }, b);
|
|
30
|
+
B(() => {
|
|
32
31
|
if (!i || e) return;
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const _ = setInterval(() => {
|
|
33
|
+
p(!1), setTimeout(() => {
|
|
34
|
+
I((j) => !j), T(o ? n : u), p(!0);
|
|
36
35
|
}, 400);
|
|
37
36
|
}, 1500);
|
|
38
|
-
return () => clearInterval(
|
|
37
|
+
return () => clearInterval(_);
|
|
39
38
|
}, [u, e, o, n, i]);
|
|
40
|
-
const
|
|
41
|
-
|
|
39
|
+
const W = c(() => m(!0), []), M = c(() => m(!1), []), x = !!s && !e && (i || t || g), P = d[o ? "YELLOW_4" : "WHITE_1"], R = d[o && !t ? "YELLOW_4" : "WHITE_1"], v = /* @__PURE__ */ r(
|
|
40
|
+
D,
|
|
42
41
|
{
|
|
43
42
|
selected: t,
|
|
44
43
|
disabled: e,
|
|
45
|
-
onClick:
|
|
46
|
-
onMouseEnter:
|
|
47
|
-
onMouseLeave:
|
|
44
|
+
onClick: H,
|
|
45
|
+
onMouseEnter: W,
|
|
46
|
+
onMouseLeave: M,
|
|
48
47
|
width: w,
|
|
49
|
-
borderColor:
|
|
50
|
-
isTransparent:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
F,
|
|
48
|
+
borderColor: P,
|
|
49
|
+
isTransparent: $,
|
|
50
|
+
children: /* @__PURE__ */ k(
|
|
51
|
+
X,
|
|
54
52
|
{
|
|
55
53
|
$flexDirection: "row",
|
|
56
54
|
$alignItems: "center",
|
|
57
55
|
$justifyContent: "center",
|
|
58
56
|
$flexColumnGapX: 0.25,
|
|
59
57
|
children: [
|
|
60
|
-
s && /* @__PURE__ */ r(
|
|
58
|
+
s && /* @__PURE__ */ r(F, { $widthX: 1, $heightX: 1, $showLottie: x, children: /* @__PURE__ */ r(Y, { src: s, settings: q }) }),
|
|
61
59
|
/* @__PURE__ */ r(
|
|
62
|
-
|
|
60
|
+
G,
|
|
63
61
|
{
|
|
64
|
-
shouldOffsetLabel:
|
|
62
|
+
shouldOffsetLabel: x || !s,
|
|
65
63
|
selected: t,
|
|
66
64
|
disabled: e,
|
|
67
65
|
$renderAs: o ? t ? "ub3-bold" : "ub3" : t ? "ub2-bold" : "ub2",
|
|
68
|
-
textColor:
|
|
66
|
+
textColor: R,
|
|
69
67
|
isVisible: E,
|
|
70
68
|
width: i ? "85px" : void 0,
|
|
71
|
-
isDarkTheme: c,
|
|
72
69
|
children: L
|
|
73
70
|
},
|
|
74
71
|
L
|
|
@@ -78,9 +75,9 @@ const J = {
|
|
|
78
75
|
)
|
|
79
76
|
}
|
|
80
77
|
);
|
|
81
|
-
return e &&
|
|
82
|
-
},
|
|
78
|
+
return e && h ? /* @__PURE__ */ r(S, { renderAs: "primary", tooltipItem: h, position: "top", children: v }) : v;
|
|
79
|
+
}, st = y(z);
|
|
83
80
|
export {
|
|
84
|
-
|
|
81
|
+
st as default
|
|
85
82
|
};
|
|
86
83
|
//# 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
|
|
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' : 'WHITE_1'];\n const textColor = colors[highlightPhase && !selected ? 'YELLOW_4' : 'WHITE_1'];\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 >\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 >\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","isHovered","setHovered","useState","highlightPhase","setHighlightPhase","isVisible","setIsVisible","currentLabel","setCurrentLabel","colors","useTheme","shouldAnimate","handleSelect","useCallback","handleClick","useClickHandler","useEffect","interval","prev","handleMouseEnter","handleMouseLeave","showLottie","borderColor","textColor","ButtonContent","jsx","Styled.Wrapper","jsxs","FlexView","Styled.IconWrapper","LottieAnimation","Styled.Label","ArrowTooltip","PillButton$1","memo"],"mappings":"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"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
${({ selected: r, theme: o
|
|
1
|
+
import e from "styled-components";
|
|
2
|
+
import t from "../../../ui/layout/flex-view.js";
|
|
3
|
+
const l = e(t)`
|
|
4
|
+
${({ selected: r, theme: o }) => `
|
|
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.BLACK_5};
|
|
10
10
|
}
|
|
11
11
|
`}
|
|
12
12
|
`;
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
l 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';\
|
|
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 background-color: ${!selected ? theme.colors.BLACK_5 : undefined};\n }\n `;\n }}\n`;\n"],"names":["Wrapper","styled","FlexView","selected","theme"],"mappings":";;AAIa,MAAAA,IAAUC,EAAOC,CAAQ;AAAA,IAClC,CAAC,EAAE,UAAAC,GAAU,OAAAC,QACN;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKkBD,IAAkC,SAAvBC,EAAM,OAAO,OAAmB;AAAA;AAAA,GAGrE;AAAA;"}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as g, useRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { memo as g, useRef as x, useCallback as t, useMemo as I } from "react";
|
|
3
|
+
import T from "../../../ui/hooks/use-click-handler.js";
|
|
4
|
+
import _ from "../../../ui/layout/flex-view.js";
|
|
5
|
+
import A 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 L = ({
|
|
9
|
+
id: a,
|
|
10
|
+
title: l,
|
|
11
|
+
description: c,
|
|
12
|
+
icon: i,
|
|
13
13
|
selected: r,
|
|
14
|
-
onClick:
|
|
15
|
-
analyticsLabel:
|
|
16
|
-
analyticsProps:
|
|
17
|
-
renderThemeAs: h = "dark"
|
|
14
|
+
onClick: s,
|
|
15
|
+
analyticsLabel: f,
|
|
16
|
+
analyticsProps: p
|
|
18
17
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
{ label:
|
|
23
|
-
|
|
24
|
-
),
|
|
25
|
-
var
|
|
26
|
-
(
|
|
27
|
-
}, []),
|
|
28
|
-
var
|
|
29
|
-
r || (
|
|
30
|
-
}, [r]), b =
|
|
18
|
+
const e = x(null), d = t(() => {
|
|
19
|
+
s(a);
|
|
20
|
+
}, [a, s]), { handleClick: h } = T(
|
|
21
|
+
{ label: l, analyticsLabel: f, analyticsProps: p },
|
|
22
|
+
d
|
|
23
|
+
), $ = t(() => {
|
|
24
|
+
var o;
|
|
25
|
+
(o = e.current) == null || o.play();
|
|
26
|
+
}, []), C = t(() => {
|
|
27
|
+
var o;
|
|
28
|
+
r || (o = e.current) == null || o.stop();
|
|
29
|
+
}, [r]), b = I(
|
|
31
30
|
() => ({
|
|
32
31
|
autoplay: r,
|
|
33
32
|
loop: !0,
|
|
@@ -35,41 +34,40 @@ const B = ({
|
|
|
35
34
|
}),
|
|
36
35
|
[r]
|
|
37
36
|
);
|
|
38
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ m(
|
|
39
38
|
E,
|
|
40
39
|
{
|
|
41
40
|
$gutterX: 1,
|
|
42
41
|
$gapX: 1,
|
|
43
|
-
$borderColor:
|
|
42
|
+
$borderColor: "WHITE",
|
|
44
43
|
$flexDirection: "row",
|
|
45
|
-
$background: r
|
|
46
|
-
onMouseEnter:
|
|
47
|
-
onMouseLeave:
|
|
48
|
-
onClick:
|
|
44
|
+
$background: r ? "WHITE_1" : "BLACK_1",
|
|
45
|
+
onMouseEnter: $,
|
|
46
|
+
onMouseLeave: C,
|
|
47
|
+
onClick: h,
|
|
49
48
|
$flexColumnGapX: 0.5,
|
|
50
49
|
selected: r,
|
|
51
50
|
$alignItems: "center",
|
|
52
|
-
hoverBackground: o ? "BLACK_5" : "WHITE_5",
|
|
53
51
|
children: [
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
i && /* @__PURE__ */ n(
|
|
53
|
+
A,
|
|
56
54
|
{
|
|
57
|
-
src:
|
|
58
|
-
ref:
|
|
55
|
+
src: i,
|
|
56
|
+
ref: e,
|
|
59
57
|
settings: b,
|
|
60
58
|
width: 40,
|
|
61
59
|
height: 40
|
|
62
60
|
}
|
|
63
61
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ m(_, { children: [
|
|
63
|
+
/* @__PURE__ */ n(u, { $renderAs: "ab3", $color: r ? "BLACK_1" : "WHITE", children: l }),
|
|
64
|
+
/* @__PURE__ */ n(u, { $renderAs: "ub3", $color: r ? "BLACK_T_60" : "WHITE_T_60", children: c })
|
|
67
65
|
] })
|
|
68
66
|
]
|
|
69
67
|
}
|
|
70
68
|
);
|
|
71
|
-
},
|
|
69
|
+
}, K = g(L);
|
|
72
70
|
export {
|
|
73
|
-
|
|
71
|
+
K as default
|
|
74
72
|
};
|
|
75
73
|
//# 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
|
|
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=\"WHITE\"\n $flexDirection=\"row\"\n $background={selected ? 'WHITE_1' : 'BLACK_1'}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n onClick={handleClick}\n $flexColumnGapX={0.5}\n selected={selected}\n $alignItems=\"center\"\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 ? 'BLACK_1' : 'WHITE'}>\n {title}\n </Text>\n <Text $renderAs=\"ub3\" $color={selected ? 'BLACK_T_60' : 'WHITE_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","animationRef","useRef","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;AACF,MAAgC;AACxB,QAAAC,IAAeC,EAAmC,IAAI,GAEtDC,IAAeC,EAAY,MAAM;AACrC,IAAAN,EAAQL,CAAE;AAAA,EAAA,GACT,CAACA,GAAIK,CAAO,CAAC,GAEV,EAAE,aAAAO,MAAgBC;AAAA,IACtB,EAAE,OAAOZ,GAAO,gBAAAK,GAAgB,gBAAAC,EAAe;AAAA,IAC/CG;AAAA,EAAA,GAGII,IAAqBH,EAAY,MAAM;;AAC3C,KAAAI,IAAAP,EAAa,YAAb,QAAAO,EAAsB;AAAA,EACxB,GAAG,CAAE,CAAA,GAECC,IAAqBL,EAAY,MAAM;;AAC3C,IAAIP,MACJW,IAAAP,EAAa,YAAb,QAAAO,EAAsB;AAAA,EAAK,GAC1B,CAACX,CAAQ,CAAC,GAEPa,IAAiBC;AAAA,IACrB,OAAO;AAAA,MACL,UAAUd;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA,IAAA;AAAA,IAEZ,CAACA,CAAQ;AAAA,EAAA;AAIT,SAAA,gBAAAe;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,UAAU;AAAA,MACV,OAAO;AAAA,MACP,cAAa;AAAA,MACb,gBAAe;AAAA,MACf,aAAahB,IAAW,YAAY;AAAA,MACpC,cAAcU;AAAA,MACd,cAAcE;AAAA,MACd,SAASJ;AAAA,MACT,iBAAiB;AAAA,MACjB,UAAAR;AAAA,MACA,aAAY;AAAA,MAEX,UAAA;AAAA,QACCD,KAAA,gBAAAkB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,KAAKnB;AAAA,YACL,KAAKK;AAAA,YACL,UAAUS;AAAA,YACV,OAAO;AAAA,YACP,QAAQ;AAAA,UAAA;AAAA,QACV;AAAA,0BAGDM,GACC,EAAA,UAAA;AAAA,UAAA,gBAAAF,EAACG,KAAK,WAAU,OAAM,QAAQpB,IAAW,YAAY,SAClD,UACHH,EAAA,CAAA;AAAA,UACA,gBAAAoB,EAACG,KAAK,WAAU,OAAM,QAAQpB,IAAW,eAAe,cACrD,UACHF,EAAA,CAAA;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeuB,IAAAC,EAAK3B,CAAkB;"}
|