@cuemath/leap 3.1.13-akm-1 → 3.1.13-akm-3
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/lottie/lottie.js +2 -0
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/constants/country.js.map +1 -1
- package/dist/features/auth/account-selector/account-selector.js +1 -1
- package/dist/features/auth/account-selector/account-selector.js.map +1 -1
- package/dist/features/auth/auth-constants.js +13 -0
- package/dist/features/auth/auth-constants.js.map +1 -0
- package/dist/features/auth/{user-list → comps/user-list}/user-item/user-item-styled.js +1 -1
- package/dist/features/auth/comps/user-list/user-item/user-item-styled.js.map +1 -0
- package/dist/features/auth/{user-list → comps/user-list}/user-item/user-item.js +4 -4
- package/dist/features/auth/comps/user-list/user-item/user-item.js.map +1 -0
- package/dist/features/auth/comps/user-list/user-list-constants.js.map +1 -0
- package/dist/features/auth/comps/user-list/user-list-styled.js.map +1 -0
- package/dist/features/auth/{user-list → comps/user-list}/user-list.js +3 -3
- package/dist/features/auth/comps/user-list/user-list.js.map +1 -0
- package/dist/features/auth/signup/claim-user-account/claim-user-account.js +1 -1
- package/dist/features/auth/signup/claim-user-account/claim-user-account.js.map +1 -1
- package/dist/features/auth/signup/signup-constants.js +1 -10
- package/dist/features/auth/signup/signup-constants.js.map +1 -1
- package/dist/features/post-game-stats/enums/post-game-stats-enum.js +1 -1
- package/dist/features/post-game-stats/enums/post-game-stats-enum.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats.js +45 -33
- package/dist/features/post-game-stats/post-game-stats.js.map +1 -1
- package/dist/features/post-game-stats/score/constants.js +10 -0
- package/dist/features/post-game-stats/score/constants.js.map +1 -0
- package/dist/features/post-game-stats/score/score-styled.js +63 -0
- package/dist/features/post-game-stats/score/score-styled.js.map +1 -0
- package/dist/features/post-game-stats/score/score.js +76 -0
- package/dist/features/post-game-stats/score/score.js.map +1 -0
- package/dist/features/ui/inputs/text-input/text-input-styled.js +18 -13
- package/dist/features/ui/inputs/text-input/text-input-styled.js.map +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +84 -82
- package/dist/index.js.map +1 -1
- package/dist/robots.txt +2 -0
- package/dist/static/high-score-confetti.9cc15d0a.json +1 -0
- package/dist/static/high-score-text.b7e35580.json +1 -0
- package/package.json +1 -1
- package/dist/features/auth/user-list/user-item/user-item-styled.js.map +0 -1
- package/dist/features/auth/user-list/user-item/user-item.js.map +0 -1
- package/dist/features/auth/user-list/user-list-constants.js.map +0 -1
- package/dist/features/auth/user-list/user-list-styled.js.map +0 -1
- package/dist/features/auth/user-list/user-list.js.map +0 -1
- /package/dist/features/auth/{user-list → comps/user-list}/user-list-constants.js +0 -0
- /package/dist/features/auth/{user-list → comps/user-list}/user-list-styled.js +0 -0
@@ -1,44 +1,56 @@
|
|
1
1
|
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
2
|
-
import { memo as y, forwardRef as
|
3
|
-
import { Accuracy as
|
4
|
-
import { Clock as
|
5
|
-
import { DigitalMeter as
|
6
|
-
import { EPostGameStat as
|
7
|
-
import { Points as
|
8
|
-
import { StatsWrapper as
|
9
|
-
import {
|
10
|
-
|
11
|
-
|
12
|
-
|
2
|
+
import { memo as y, forwardRef as S, useState as d, useMemo as u, useCallback as s, useImperativeHandle as C } from "react";
|
3
|
+
import { Accuracy as v } from "./accuracy/accuracy.js";
|
4
|
+
import { Clock as g } from "./clock/clock.js";
|
5
|
+
import { DigitalMeter as A } from "./digital-meter/digital-meter.js";
|
6
|
+
import { EPostGameStat as t } from "./enums/post-game-stats-enum.js";
|
7
|
+
import { Points as R } from "./points/points.js";
|
8
|
+
import { StatsWrapper as I, BlackBg as P } from "./post-game-stats-styled.js";
|
9
|
+
import { Score as w } from "./score/score.js";
|
10
|
+
import { Streak as E } from "./streak/streak.js";
|
11
|
+
const $ = y(
|
12
|
+
S(({ stats: p, show: h, onComplete: m }, T) => {
|
13
|
+
const [o, c] = d(0), e = u(() => p[o], [o, p]), a = s(() => {
|
13
14
|
var r;
|
14
|
-
if ((r = e == null ? void 0 : e.onComplete) == null || r.call(e),
|
15
|
+
if ((r = e == null ? void 0 : e.onComplete) == null || r.call(e), o === p.length - 1) {
|
15
16
|
m == null || m();
|
16
17
|
return;
|
17
18
|
}
|
18
|
-
|
19
|
-
}, [
|
19
|
+
c((i) => i + 1);
|
20
|
+
}, [o, m, p.length, e]), l = s(() => {
|
20
21
|
e != null && e.stopAtEnd || a();
|
21
22
|
}, [e, a]);
|
22
|
-
C(
|
23
|
+
C(T, () => ({
|
23
24
|
moveToNextAndPlay: a
|
24
25
|
}));
|
25
|
-
const
|
26
|
+
const x = u(() => {
|
26
27
|
if (!e)
|
27
28
|
return null;
|
28
|
-
const r = `${e.type}-${
|
29
|
+
const r = `${e.type}-${o}`;
|
29
30
|
return {
|
30
|
-
[
|
31
|
-
|
31
|
+
[t.SCORE]: /* @__PURE__ */ n(
|
32
|
+
w,
|
33
|
+
{
|
34
|
+
currentScore: e.value,
|
35
|
+
highScore: e.maxValue ?? 0,
|
36
|
+
show: e.type === t.SCORE,
|
37
|
+
onComplete: l,
|
38
|
+
helperText: e.helperText
|
39
|
+
},
|
40
|
+
r
|
41
|
+
),
|
42
|
+
[t.POINT]: /* @__PURE__ */ n(
|
43
|
+
R,
|
32
44
|
{
|
33
45
|
point: e.value,
|
34
|
-
show: e.type ===
|
46
|
+
show: e.type === t.POINT,
|
35
47
|
onComplete: l,
|
36
48
|
onReveal: e.onReveal
|
37
49
|
},
|
38
50
|
r
|
39
51
|
),
|
40
|
-
[
|
41
|
-
|
52
|
+
[t.DIGITAL_METER]: /* @__PURE__ */ n(
|
53
|
+
A,
|
42
54
|
{
|
43
55
|
value: e.value,
|
44
56
|
maxValue: e.maxValue ?? 1,
|
@@ -53,8 +65,8 @@ const K = y(
|
|
53
65
|
},
|
54
66
|
r
|
55
67
|
),
|
56
|
-
[
|
57
|
-
|
68
|
+
[t.STREAK]: /* @__PURE__ */ n(
|
69
|
+
E,
|
58
70
|
{
|
59
71
|
currStreak: e.value,
|
60
72
|
show: !0,
|
@@ -64,8 +76,8 @@ const K = y(
|
|
64
76
|
},
|
65
77
|
r
|
66
78
|
),
|
67
|
-
[
|
68
|
-
|
79
|
+
[t.ACCURACY]: /* @__PURE__ */ n(
|
80
|
+
v,
|
69
81
|
{
|
70
82
|
accuracy: e.value,
|
71
83
|
show: !0,
|
@@ -74,8 +86,8 @@ const K = y(
|
|
74
86
|
},
|
75
87
|
r
|
76
88
|
),
|
77
|
-
[
|
78
|
-
|
89
|
+
[t.CLOCK]: /* @__PURE__ */ n(
|
90
|
+
g,
|
79
91
|
{
|
80
92
|
timeInMs: e.value,
|
81
93
|
show: !0,
|
@@ -85,14 +97,14 @@ const K = y(
|
|
85
97
|
r
|
86
98
|
)
|
87
99
|
}[e.type] ?? null;
|
88
|
-
}, [e,
|
89
|
-
return !
|
90
|
-
/* @__PURE__ */ n(
|
91
|
-
|
100
|
+
}, [e, o, l]);
|
101
|
+
return !h || p.length === 0 || o >= p.length ? null : /* @__PURE__ */ f(I, { children: [
|
102
|
+
/* @__PURE__ */ n(P, {}),
|
103
|
+
x
|
92
104
|
] });
|
93
105
|
})
|
94
106
|
);
|
95
107
|
export {
|
96
|
-
|
108
|
+
$ as PostGameStats
|
97
109
|
};
|
98
110
|
//# sourceMappingURL=post-game-stats.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"post-game-stats.js","sources":["../../../src/features/post-game-stats/post-game-stats.tsx"],"sourcesContent":["import type { IPostGameStatsProps, IPostGameStatsRef } from './post-game-stats-types';\n\nimport { useState, memo, useCallback, forwardRef, useImperativeHandle, useMemo } from 'react';\n\nimport { Accuracy } from './accuracy/accuracy';\nimport { Clock } from './clock/clock';\nimport { DigitalMeter } from './digital-meter/digital-meter';\nimport { EPostGameStat } from './enums/post-game-stats-enum';\nimport { Points } from './points/points';\nimport * as Styled from './post-game-stats-styled';\nimport { Streak } from './streak/streak';\n\nexport const PostGameStats = memo(\n forwardRef<IPostGameStatsRef, IPostGameStatsProps>(({ stats, show, onComplete }, ref) => {\n const [currStatIndex, setCurrentStatIndex] = useState(0);\n const currStatData = useMemo(() => stats[currStatIndex], [currStatIndex, stats]);\n\n const moveToNextAndPlay = useCallback(() => {\n currStatData?.onComplete?.();\n\n if (currStatIndex === stats.length - 1) {\n onComplete?.();\n\n return;\n }\n setCurrentStatIndex(prev => prev + 1);\n }, [currStatIndex, onComplete, stats.length, currStatData]);\n\n const onStatAnimationComplete = useCallback(() => {\n if (currStatData?.stopAtEnd) {\n return;\n }\n moveToNextAndPlay(); // Autoplay since stopAtEnd is false\n }, [currStatData, moveToNextAndPlay]);\n\n useImperativeHandle(ref, () => ({\n moveToNextAndPlay,\n }));\n\n const renderCurrentStat = useMemo(() => {\n if (!currStatData) {\n return null;\n }\n\n const key = `${currStatData.type}-${currStatIndex}`;\n\n const renderStat = {\n [EPostGameStat.POINT]: (\n <Points\n key={key}\n point={currStatData.value}\n show={currStatData.type === EPostGameStat.POINT}\n onComplete={onStatAnimationComplete}\n onReveal={currStatData.onReveal}\n />\n ),\n [EPostGameStat.DIGITAL_METER]: (\n <DigitalMeter\n key={key}\n value={currStatData.value}\n maxValue={currStatData.maxValue ?? 1}\n targetValue={currStatData.targetValue}\n displayText={currStatData.displayText ?? ''}\n progressType={currStatData.progressType ?? 'linear'}\n helperTextPrimary={currStatData.helperTextPrimary ?? ''}\n helperTextSecondary={currStatData.helperTextSecondary ?? ''}\n actAsTimer={currStatData.actAsTimer}\n show={true}\n onComplete={onStatAnimationComplete}\n />\n ),\n [EPostGameStat.STREAK]: (\n <Streak\n key={key}\n currStreak={currStatData.value}\n show={true}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n onReveal={currStatData.onReveal}\n />\n ),\n [EPostGameStat.ACCURACY]: (\n <Accuracy\n key={key}\n accuracy={currStatData.value}\n show={true}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n />\n ),\n [EPostGameStat.CLOCK]: (\n <Clock\n key={key}\n timeInMs={currStatData.value}\n show={true}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n />\n ),\n };\n\n return renderStat[currStatData.type] ?? null;\n }, [currStatData,
|
1
|
+
{"version":3,"file":"post-game-stats.js","sources":["../../../src/features/post-game-stats/post-game-stats.tsx"],"sourcesContent":["import type { IPostGameStatsProps, IPostGameStatsRef } from './post-game-stats-types';\n\nimport { useState, memo, useCallback, forwardRef, useImperativeHandle, useMemo } from 'react';\n\nimport { Accuracy } from './accuracy/accuracy';\nimport { Clock } from './clock/clock';\nimport { DigitalMeter } from './digital-meter/digital-meter';\nimport { EPostGameStat } from './enums/post-game-stats-enum';\nimport { Points } from './points/points';\nimport * as Styled from './post-game-stats-styled';\nimport { Score } from './score/score';\nimport { Streak } from './streak/streak';\n\nexport const PostGameStats = memo(\n forwardRef<IPostGameStatsRef, IPostGameStatsProps>(({ stats, show, onComplete }, ref) => {\n const [currStatIndex, setCurrentStatIndex] = useState(0);\n const currStatData = useMemo(() => stats[currStatIndex], [currStatIndex, stats]);\n\n const moveToNextAndPlay = useCallback(() => {\n currStatData?.onComplete?.();\n\n if (currStatIndex === stats.length - 1) {\n onComplete?.();\n\n return;\n }\n setCurrentStatIndex(prev => prev + 1);\n }, [currStatIndex, onComplete, stats.length, currStatData]);\n\n const onStatAnimationComplete = useCallback(() => {\n if (currStatData?.stopAtEnd) {\n return;\n }\n moveToNextAndPlay(); // Autoplay since stopAtEnd is false\n }, [currStatData, moveToNextAndPlay]);\n\n useImperativeHandle(ref, () => ({\n moveToNextAndPlay,\n }));\n\n const renderCurrentStat = useMemo(() => {\n if (!currStatData) {\n return null;\n }\n\n const key = `${currStatData.type}-${currStatIndex}`;\n\n const renderStat = {\n [EPostGameStat.SCORE]: (\n <Score\n key={key}\n currentScore={currStatData.value}\n highScore={currStatData.maxValue ?? 0}\n show={currStatData.type === EPostGameStat.SCORE}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n />\n ),\n\n [EPostGameStat.POINT]: (\n <Points\n key={key}\n point={currStatData.value}\n show={currStatData.type === EPostGameStat.POINT}\n onComplete={onStatAnimationComplete}\n onReveal={currStatData.onReveal}\n />\n ),\n [EPostGameStat.DIGITAL_METER]: (\n <DigitalMeter\n key={key}\n value={currStatData.value}\n maxValue={currStatData.maxValue ?? 1}\n targetValue={currStatData.targetValue}\n displayText={currStatData.displayText ?? ''}\n progressType={currStatData.progressType ?? 'linear'}\n helperTextPrimary={currStatData.helperTextPrimary ?? ''}\n helperTextSecondary={currStatData.helperTextSecondary ?? ''}\n actAsTimer={currStatData.actAsTimer}\n show={true}\n onComplete={onStatAnimationComplete}\n />\n ),\n [EPostGameStat.STREAK]: (\n <Streak\n key={key}\n currStreak={currStatData.value}\n show={true}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n onReveal={currStatData.onReveal}\n />\n ),\n [EPostGameStat.ACCURACY]: (\n <Accuracy\n key={key}\n accuracy={currStatData.value}\n show={true}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n />\n ),\n [EPostGameStat.CLOCK]: (\n <Clock\n key={key}\n timeInMs={currStatData.value}\n show={true}\n onComplete={onStatAnimationComplete}\n helperText={currStatData.helperText}\n />\n ),\n };\n\n return renderStat[currStatData.type] ?? null;\n }, [currStatData, currStatIndex, onStatAnimationComplete]);\n\n if (!show || stats.length === 0 || currStatIndex >= stats.length) {\n return null;\n }\n\n return (\n <Styled.StatsWrapper>\n <Styled.BlackBg />\n\n {renderCurrentStat}\n </Styled.StatsWrapper>\n );\n }),\n);\n"],"names":["PostGameStats","memo","forwardRef","stats","show","onComplete","ref","currStatIndex","setCurrentStatIndex","useState","currStatData","useMemo","moveToNextAndPlay","useCallback","_a","prev","onStatAnimationComplete","useImperativeHandle","renderCurrentStat","key","EPostGameStat","jsx","Score","Points","DigitalMeter","Streak","Accuracy","Clock","jsxs","Styled.StatsWrapper","Styled.BlackBg"],"mappings":";;;;;;;;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,gBAAAyB,EAACC,GAAA,EACC,UAAA;AAAA,MAAC,gBAAAR,EAAAS,GAAA,EAAe;AAAA,MAEfZ;AAAA,IACH,EAAA,CAAA;AAAA,EAAA,CAEH;AACH;"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
const A = 900, _ = 1800, E = 1500, I = 500, T = 500, N = 500;
|
2
|
+
export {
|
3
|
+
E as ANIMATE_HIGH_SCORE_CONFETTI_AFTER_DELAY,
|
4
|
+
I as ANIMATE_HIGH_SCORE_TEXT_AFTER_DELAY,
|
5
|
+
_ as ANIMATE_SCORE_DURATION,
|
6
|
+
A as ANIMATE_SCORE_DURATION_15_POINTS,
|
7
|
+
N as SCORE_APPEAR_ANIMATION_DURATION,
|
8
|
+
T as SCORE_DISAPPEAR_ANIMATION_DURATION
|
9
|
+
};
|
10
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/features/post-game-stats/score/constants.ts"],"sourcesContent":["export const ANIMATE_SCORE_DURATION_15_POINTS = 900;\nexport const ANIMATE_HIGH_SCORE_CONFETTI_AFTER_DELAY_15_POINTS =\n ANIMATE_SCORE_DURATION_15_POINTS - 200;\n\nexport const ANIMATE_SCORE_DURATION = 1800;\nexport const ANIMATE_HIGH_SCORE_CONFETTI_AFTER_DELAY = ANIMATE_SCORE_DURATION - 300;\nexport const ANIMATE_HIGH_SCORE_TEXT_AFTER_DELAY = 500;\nexport const SCORE_DISAPPEAR_ANIMATION_DURATION = 500;\nexport const SCORE_APPEAR_ANIMATION_DURATION = 500;\n"],"names":["ANIMATE_SCORE_DURATION_15_POINTS","ANIMATE_SCORE_DURATION","ANIMATE_HIGH_SCORE_CONFETTI_AFTER_DELAY","ANIMATE_HIGH_SCORE_TEXT_AFTER_DELAY","SCORE_DISAPPEAR_ANIMATION_DURATION","SCORE_APPEAR_ANIMATION_DURATION"],"mappings":"AAAO,MAAMA,IAAmC,KAInCC,IAAyB,MACzBC,IAA0C,MAC1CC,IAAsC,KACtCC,IAAqC,KACrCC,IAAkC;"}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import o, { keyframes as r, css as a } from "styled-components";
|
2
|
+
import { GAME_LAUNCHER_SIZE as t } from "../../circle-games/game-launcher/comps/card-container/constants.js";
|
3
|
+
import { GAME_LAUNCHER_ASSET_PADDING as e } from "../../circle-games/game-launcher/comps/segmented-game-card/constants.js";
|
4
|
+
import s from "../../ui/text/text.js";
|
5
|
+
const p = r`
|
6
|
+
0%{
|
7
|
+
opacity: 0;
|
8
|
+
}
|
9
|
+
100%{
|
10
|
+
opacity: 1;
|
11
|
+
}
|
12
|
+
`, c = r`
|
13
|
+
0%{
|
14
|
+
opacity: 1;
|
15
|
+
}
|
16
|
+
100%{
|
17
|
+
opacity: 0;
|
18
|
+
}
|
19
|
+
`, x = o.div`
|
20
|
+
height: ${t}px;
|
21
|
+
width: ${t}px;
|
22
|
+
border: 2px solid #fff;
|
23
|
+
border-radius: 50%;
|
24
|
+
background: transparent;
|
25
|
+
display: flex;
|
26
|
+
justify-content: center;
|
27
|
+
align-items: center;
|
28
|
+
position: relative;
|
29
|
+
`, h = o.div`
|
30
|
+
height: ${t + e}px;
|
31
|
+
width: ${t + e}px;
|
32
|
+
position: absolute;
|
33
|
+
transform: scale(1.13);
|
34
|
+
z-index: 0;
|
35
|
+
`, g = o.div`
|
36
|
+
z-index: 2;
|
37
|
+
opacity: ${({ opacity: i }) => i};
|
38
|
+
position: absolute;
|
39
|
+
margin: 0 auto;
|
40
|
+
top: calc(100% - 35px);
|
41
|
+
width: ${t}px;
|
42
|
+
`, u = o.div`
|
43
|
+
z-index: 2;
|
44
|
+
animation: ${({ $animationType: i, $duration: n }) => a`
|
45
|
+
${i === "fadein" ? p : c} ${n}ms linear forwards
|
46
|
+
`};
|
47
|
+
overflow: hidden;
|
48
|
+
display: flex;
|
49
|
+
flex-direction: column;
|
50
|
+
align-items: center;
|
51
|
+
`, y = o(s)`
|
52
|
+
position: absolute;
|
53
|
+
top: 50%;
|
54
|
+
transform: translateY(32px);
|
55
|
+
`;
|
56
|
+
export {
|
57
|
+
x as HighScore,
|
58
|
+
h as HighScoreConfetti,
|
59
|
+
g as HighScoreTextAnimation,
|
60
|
+
u as HighScoreValueWrapper,
|
61
|
+
y as ScoreText
|
62
|
+
};
|
63
|
+
//# sourceMappingURL=score-styled.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"score-styled.js","sources":["../../../../src/features/post-game-stats/score/score-styled.tsx"],"sourcesContent":["import styled, { css, keyframes } from 'styled-components';\n\nimport { GAME_LAUNCHER_SIZE } from '../../circle-games/game-launcher/comps/card-container/constants';\nimport { GAME_LAUNCHER_ASSET_PADDING } from '../../circle-games/game-launcher/comps/segmented-game-card/constants';\nimport Text from '../../ui/text/text';\n\nconst fadeIn = keyframes`\n 0%{\n opacity: 0;\n }\n 100%{\n opacity: 1;\n }\n`;\n\nconst fadeOut = keyframes`\n 0%{\n opacity: 1;\n }\n 100%{\n opacity: 0;\n }\n`;\n\nexport const HighScore = styled.div`\n height: ${GAME_LAUNCHER_SIZE}px;\n width: ${GAME_LAUNCHER_SIZE}px;\n border: 2px solid #fff;\n border-radius: 50%;\n background: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n`;\n\nexport const HighScoreConfetti = styled.div`\n height: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n width: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n position: absolute;\n transform: scale(1.13);\n z-index: 0;\n`;\n\nexport const HighScoreTextAnimation = styled.div<{ opacity: number }>`\n z-index: 2;\n opacity: ${({ opacity }) => opacity};\n position: absolute;\n margin: 0 auto;\n top: calc(100% - 35px);\n width: ${GAME_LAUNCHER_SIZE}px;\n`;\n\nexport const HighScoreValueWrapper = styled.div<{\n $duration: number;\n $animationType: 'fadein' | 'fadeout';\n}>`\n z-index: 2;\n animation: ${({ $animationType, $duration }) => css`\n ${$animationType === 'fadein' ? fadeIn : fadeOut} ${$duration}ms linear forwards\n `};\n overflow: hidden;\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nexport const ScoreText = styled(Text)`\n position: absolute;\n top: 50%;\n transform: translateY(32px);\n`;\n"],"names":["fadeIn","keyframes","fadeOut","HighScore","styled","GAME_LAUNCHER_SIZE","HighScoreConfetti","GAME_LAUNCHER_ASSET_PADDING","HighScoreTextAnimation","opacity","HighScoreValueWrapper","$animationType","$duration","css","ScoreText","Text"],"mappings":";;;;AAMA,MAAMA,IAASC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASTC,IAAUD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASHE,IAAYC,EAAO;AAAA,YACpBC,CAAkB;AAAA,WACnBA,CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUhBC,IAAoBF,EAAO;AAAA,YAC5BC,IAAqBE,CAA2B;AAAA,WACjDF,IAAqBE,CAA2B;AAAA;AAAA;AAAA;AAAA,GAM9CC,IAAyBJ,EAAO;AAAA;AAAA,aAEhC,CAAC,EAAE,SAAAK,EAAQ,MAAMA,CAAO;AAAA;AAAA;AAAA;AAAA,WAI1BJ,CAAkB;AAAA,GAGhBK,IAAwBN,EAAO;AAAA;AAAA,eAK7B,CAAC,EAAE,gBAAAO,GAAgB,WAAAC,EAAA,MAAgBC;AAAA,MAC5CF,MAAmB,WAAWX,IAASE,CAAO,IAAIU,CAAS;AAAA,GAC9D;AAAA;AAAA;AAAA;AAAA;AAAA,GAOUE,IAAYV,EAAOW,CAAI;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
2
|
+
import { memo as b, useState as s, useRef as I, useMemo as c, useCallback as R, useEffect as k } from "react";
|
3
|
+
import { LOTTIE as O } from "../../../assets/lottie/lottie.js";
|
4
|
+
import H from "../../ui/lottie-animation/lottie-animation.js";
|
5
|
+
import v from "../../ui/text/text.js";
|
6
|
+
import { delay as C } from "../../utils/utils.js";
|
7
|
+
import { ANIMATE_SCORE_DURATION_15_POINTS as g, ANIMATE_SCORE_DURATION as w, SCORE_DISAPPEAR_ANIMATION_DURATION as G, SCORE_APPEAR_ANIMATION_DURATION as W, ANIMATE_HIGH_SCORE_CONFETTI_AFTER_DELAY as j, ANIMATE_HIGH_SCORE_TEXT_AFTER_DELAY as q } from "./constants.js";
|
8
|
+
import { HighScore as X, HighScoreConfetti as Y, HighScoreValueWrapper as B, ScoreText as V, HighScoreTextAnimation as z } from "./score-styled.js";
|
9
|
+
const ne = b((N) => {
|
10
|
+
const { currentScore: e, highScore: y, show: a, onComplete: n } = N, l = e > y, [x, f] = s(0), [T, D] = s(!1), [F, m] = s(!1), u = I(null), A = I(null), S = c(() => e <= 15 ? g : w, [e]), h = R(() => {
|
11
|
+
D(!0), m(!1), n == null || n();
|
12
|
+
}, [n]), E = R(async () => {
|
13
|
+
var t, r;
|
14
|
+
l && (await C(
|
15
|
+
e <= 15 ? g : j
|
16
|
+
), (t = u.current) == null || t.play(), await C(q), m(!0), (r = A.current) == null || r.play());
|
17
|
+
}, [e, l]), M = c(
|
18
|
+
() => /* @__PURE__ */ o(
|
19
|
+
H,
|
20
|
+
{
|
21
|
+
ref: u,
|
22
|
+
src: O.HIGH_SCORE_CONFETTI,
|
23
|
+
settings: {
|
24
|
+
autoplay: !1,
|
25
|
+
loop: !1,
|
26
|
+
renderer: "canvas"
|
27
|
+
},
|
28
|
+
onRender: E
|
29
|
+
}
|
30
|
+
),
|
31
|
+
[E]
|
32
|
+
), L = c(
|
33
|
+
() => /* @__PURE__ */ o(
|
34
|
+
H,
|
35
|
+
{
|
36
|
+
ref: A,
|
37
|
+
src: O.HIGH_SCORE_TEXT,
|
38
|
+
settings: {
|
39
|
+
autoplay: !1,
|
40
|
+
loop: !1,
|
41
|
+
renderer: "canvas"
|
42
|
+
},
|
43
|
+
eventListener: { name: "complete", callback: h }
|
44
|
+
}
|
45
|
+
),
|
46
|
+
[h]
|
47
|
+
);
|
48
|
+
return k(() => {
|
49
|
+
if (!a) return;
|
50
|
+
let t, r = null;
|
51
|
+
const P = (i) => 1 - Math.pow(1 - i, 2), _ = (i) => {
|
52
|
+
r === null && (r = i);
|
53
|
+
const $ = i - r, d = Math.min($ / S, 1), U = P(d);
|
54
|
+
f(Math.floor(U * e)), d < 1 ? t = requestAnimationFrame(_) : f(e);
|
55
|
+
};
|
56
|
+
return t = requestAnimationFrame(_), () => cancelAnimationFrame(t);
|
57
|
+
}, [e, S, a]), a ? /* @__PURE__ */ p(X, { children: [
|
58
|
+
/* @__PURE__ */ o(Y, { children: M }),
|
59
|
+
/* @__PURE__ */ p(
|
60
|
+
B,
|
61
|
+
{
|
62
|
+
$animationType: T ? "fadeout" : "fadein",
|
63
|
+
$duration: T ? G : W,
|
64
|
+
children: [
|
65
|
+
/* @__PURE__ */ o(v, { $renderAs: "ah2", $color: "WHITE", children: x }),
|
66
|
+
/* @__PURE__ */ o(V, { $renderAs: "ac4-black", $color: "WHITE_T_60", children: "SCORE" })
|
67
|
+
]
|
68
|
+
}
|
69
|
+
),
|
70
|
+
/* @__PURE__ */ o(z, { opacity: F ? 1 : 0, children: L })
|
71
|
+
] }) : null;
|
72
|
+
});
|
73
|
+
export {
|
74
|
+
ne as Score
|
75
|
+
};
|
76
|
+
//# sourceMappingURL=score.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"score.js","sources":["../../../../src/features/post-game-stats/score/score.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../ui/lottie-animation/types';\nimport type { IHighScoreProps } from './score-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { LOTTIE } from '../../../assets/lottie/lottie';\nimport LottieAnimation from '../../ui/lottie-animation/lottie-animation';\nimport Text from '../../ui/text/text';\nimport { delay } from '../../utils/utils';\nimport {\n ANIMATE_HIGH_SCORE_CONFETTI_AFTER_DELAY,\n ANIMATE_HIGH_SCORE_TEXT_AFTER_DELAY,\n ANIMATE_SCORE_DURATION,\n ANIMATE_SCORE_DURATION_15_POINTS,\n SCORE_APPEAR_ANIMATION_DURATION,\n SCORE_DISAPPEAR_ANIMATION_DURATION,\n} from './constants';\nimport * as Styled from './score-styled';\n\nexport const Score: FC<IHighScoreProps> = memo(props => {\n const { currentScore, highScore, show, onComplete } = props;\n const hasUserBrokenCurrentHighScore = currentScore > highScore;\n\n const [displayScore, setDisplayScore] = useState(0);\n const [fadeOut, setFadeout] = useState(false);\n const [displayHighScoreTxt, setDisplayHighScoreText] = useState(false);\n\n const highScoreConfettiRef = useRef<ILottieAnimationRef>(null);\n const highScoreTextRef = useRef<ILottieAnimationRef>(null);\n\n const scoreAnimationDuration = useMemo(() => {\n if (currentScore <= 15) {\n return ANIMATE_SCORE_DURATION_15_POINTS;\n }\n\n return ANIMATE_SCORE_DURATION;\n }, [currentScore]);\n\n const onEndAnimationFinished = useCallback(() => {\n setFadeout(true);\n setDisplayHighScoreText(false);\n onComplete?.();\n }, [onComplete]);\n\n const onConfettiAnimationReadyToPlay = useCallback(async () => {\n if (!hasUserBrokenCurrentHighScore) {\n return undefined;\n }\n\n await delay(\n currentScore <= 15\n ? ANIMATE_SCORE_DURATION_15_POINTS\n : ANIMATE_HIGH_SCORE_CONFETTI_AFTER_DELAY,\n );\n highScoreConfettiRef.current?.play();\n await delay(ANIMATE_HIGH_SCORE_TEXT_AFTER_DELAY);\n setDisplayHighScoreText(true);\n highScoreTextRef.current?.play();\n }, [currentScore, hasUserBrokenCurrentHighScore]);\n\n const HighScoreConfettiLottie = useMemo(\n () => (\n <LottieAnimation\n ref={highScoreConfettiRef}\n src={LOTTIE.HIGH_SCORE_CONFETTI}\n settings={{\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n }}\n onRender={onConfettiAnimationReadyToPlay}\n />\n ),\n [onConfettiAnimationReadyToPlay],\n );\n\n const HighScoreTextLottie = useMemo(\n () => (\n <LottieAnimation\n ref={highScoreTextRef}\n src={LOTTIE.HIGH_SCORE_TEXT}\n settings={{\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n }}\n eventListener={{ name: 'complete', callback: onEndAnimationFinished }}\n />\n ),\n [onEndAnimationFinished],\n );\n\n // Animate the score from 0 to the current score\n useEffect(() => {\n if (!show) return;\n\n let animationFrameId: number;\n let startTime: number | null = null;\n\n const easeOutCubic = (t: number) => 1 - Math.pow(1 - t, 2);\n\n const animate = (timestamp: number) => {\n if (startTime === null) startTime = timestamp;\n\n const elapsed = timestamp - startTime;\n const progress = Math.min(elapsed / scoreAnimationDuration, 1);\n const eased = easeOutCubic(progress);\n\n setDisplayScore(Math.floor(eased * currentScore));\n\n if (progress < 1) {\n animationFrameId = requestAnimationFrame(animate);\n } else {\n setDisplayScore(currentScore);\n }\n };\n\n animationFrameId = requestAnimationFrame(animate);\n\n return () => cancelAnimationFrame(animationFrameId);\n }, [currentScore, scoreAnimationDuration, show]);\n\n if (show) {\n return (\n <Styled.HighScore>\n <Styled.HighScoreConfetti>{HighScoreConfettiLottie}</Styled.HighScoreConfetti>\n <Styled.HighScoreValueWrapper\n $animationType={fadeOut ? 'fadeout' : 'fadein'}\n $duration={fadeOut ? SCORE_DISAPPEAR_ANIMATION_DURATION : SCORE_APPEAR_ANIMATION_DURATION}\n >\n <Text $renderAs=\"ah2\" $color=\"WHITE\">\n {displayScore}\n </Text>\n <Styled.ScoreText $renderAs=\"ac4-black\" $color=\"WHITE_T_60\">\n SCORE\n </Styled.ScoreText>\n </Styled.HighScoreValueWrapper>\n <Styled.HighScoreTextAnimation opacity={displayHighScoreTxt ? 1 : 0}>\n {HighScoreTextLottie}\n </Styled.HighScoreTextAnimation>\n </Styled.HighScore>\n );\n }\n\n return null;\n});\n"],"names":["Score","memo","props","currentScore","highScore","show","onComplete","hasUserBrokenCurrentHighScore","displayScore","setDisplayScore","useState","fadeOut","setFadeout","displayHighScoreTxt","setDisplayHighScoreText","highScoreConfettiRef","useRef","highScoreTextRef","scoreAnimationDuration","useMemo","ANIMATE_SCORE_DURATION_15_POINTS","ANIMATE_SCORE_DURATION","onEndAnimationFinished","useCallback","onConfettiAnimationReadyToPlay","delay","ANIMATE_HIGH_SCORE_CONFETTI_AFTER_DELAY","_a","ANIMATE_HIGH_SCORE_TEXT_AFTER_DELAY","_b","HighScoreConfettiLottie","jsx","LottieAnimation","LOTTIE","HighScoreTextLottie","useEffect","animationFrameId","startTime","easeOutCubic","t","animate","timestamp","elapsed","progress","eased","jsxs","Styled.HighScore","Styled.HighScoreConfetti","Styled.HighScoreValueWrapper","SCORE_DISAPPEAR_ANIMATION_DURATION","SCORE_APPEAR_ANIMATION_DURATION","Text","Styled.ScoreText","Styled.HighScoreTextAnimation"],"mappings":";;;;;;;;AAoBa,MAAAA,KAA6BC,EAAK,CAASC,MAAA;AACtD,QAAM,EAAE,cAAAC,GAAc,WAAAC,GAAW,MAAAC,GAAM,YAAAC,MAAeJ,GAChDK,IAAgCJ,IAAeC,GAE/C,CAACI,GAAcC,CAAe,IAAIC,EAAS,CAAC,GAC5C,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GACtC,CAACG,GAAqBC,CAAuB,IAAIJ,EAAS,EAAK,GAE/DK,IAAuBC,EAA4B,IAAI,GACvDC,IAAmBD,EAA4B,IAAI,GAEnDE,IAAyBC,EAAQ,MACjChB,KAAgB,KACXiB,IAGFC,GACN,CAAClB,CAAY,CAAC,GAEXmB,IAAyBC,EAAY,MAAM;AAC/C,IAAAX,EAAW,EAAI,GACfE,EAAwB,EAAK,GAChBR,KAAA,QAAAA;AAAA,EAAA,GACZ,CAACA,CAAU,CAAC,GAETkB,IAAiCD,EAAY,YAAY;;AAC7D,IAAKhB,MAIC,MAAAkB;AAAA,MACJtB,KAAgB,KACZiB,IACAM;AAAA,IAAA,IAENC,IAAAZ,EAAqB,YAArB,QAAAY,EA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MAAM,qBAAqBJ,CAAgB;AAAA,EACjD,GAAA,CAACjC,GAAce,GAAwBb,CAAI,CAAC,GAE3CA,IAEA,gBAAAwC,EAACC,GAAA,EACC,UAAA;AAAA,IAAC,gBAAAf,EAAAgB,GAAA,EAA0B,UAAwBjB,EAAA,CAAA;AAAA,IACnD,gBAAAe;AAAA,MAACG;AAAAA,MAAA;AAAA,QACC,gBAAgBrC,IAAU,YAAY;AAAA,QACtC,WAAWA,IAAUsC,IAAqCC;AAAA,QAE1D,UAAA;AAAA,UAAA,gBAAAnB,EAACoB,GAAK,EAAA,WAAU,OAAM,QAAO,SAC1B,UACH3C,GAAA;AAAA,UACA,gBAAAuB,EAACqB,GAAA,EAAiB,WAAU,aAAY,QAAO,cAAa,UAE5D,SAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,IACA,gBAAArB,EAACsB,GAAA,EAA8B,SAASxC,IAAsB,IAAI,GAC/D,UACHqB,GAAA;AAAA,EACF,EAAA,CAAA,IAIG;AACT,CAAC;"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import
|
2
|
-
const m =
|
3
|
-
const { colors: e, input: r, text: u } = c, { valueColorName:
|
1
|
+
import h from "styled-components";
|
2
|
+
const m = h.input(({ theme: c, $size: p, $renderAs: s, $isTransparent: d }) => {
|
3
|
+
const { colors: e, input: r, text: u } = c, { valueColorName: o, labelColorName: n, backgroundColorName: b } = r.variants[s], { inputTextVariant: $ } = r.sizes[p], { fontFamily: i, fontSize: l, lineHeight: a, letterSpacing: t } = u[$], f = d ? "transparent" : e[b ?? "WHITE"];
|
4
4
|
return `
|
5
5
|
position: relative;
|
6
6
|
width: 100%;
|
@@ -10,24 +10,24 @@ const m = f.input(({ theme: c, $size: p, $renderAs: s, $isTransparent: d }) => {
|
|
10
10
|
outline: none;
|
11
11
|
|
12
12
|
font-family: ${i};
|
13
|
-
font-size: ${
|
14
|
-
line-height: ${
|
15
|
-
${typeof
|
13
|
+
font-size: ${l}px;
|
14
|
+
line-height: ${a}px;
|
15
|
+
${typeof t == "number" ? `letter-spacing: ${t}px;` : ""}
|
16
16
|
|
17
17
|
|
18
|
-
background-color: ${
|
19
|
-
color: ${e[
|
18
|
+
background-color: ${f};
|
19
|
+
color: ${e[o.inactive]};
|
20
20
|
|
21
21
|
&::placeholder {
|
22
22
|
color: ${e[n.inactive]};
|
23
23
|
font-family: ${i};
|
24
|
-
font-size: ${
|
25
|
-
line-height: ${
|
26
|
-
${typeof
|
24
|
+
font-size: ${l}px;
|
25
|
+
line-height: ${a}px;
|
26
|
+
${typeof t == "number" ? `letter-spacing: ${t}px;` : ""}
|
27
27
|
}
|
28
28
|
|
29
29
|
&:hover, &:focus {
|
30
|
-
color: ${e[
|
30
|
+
color: ${e[o.active]};
|
31
31
|
}
|
32
32
|
|
33
33
|
&:read-only {
|
@@ -35,7 +35,7 @@ const m = f.input(({ theme: c, $size: p, $renderAs: s, $isTransparent: d }) => {
|
|
35
35
|
}
|
36
36
|
|
37
37
|
&:disabled {
|
38
|
-
color: ${e[
|
38
|
+
color: ${e[o.disabled]};
|
39
39
|
cursor: not-allowed;
|
40
40
|
|
41
41
|
&::placeholder {
|
@@ -60,6 +60,11 @@ const m = f.input(({ theme: c, $size: p, $renderAs: s, $isTransparent: d }) => {
|
|
60
60
|
color: ${e.BLACK_T_60};
|
61
61
|
text-transform: uppercase;
|
62
62
|
}
|
63
|
+
|
64
|
+
&:-webkit-autofill {
|
65
|
+
-webkit-text-fill-color: ${e[o.inactive]} !important;
|
66
|
+
-webkit-background-clip: text;
|
67
|
+
}
|
63
68
|
`;
|
64
69
|
});
|
65
70
|
export {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"text-input-styled.js","sources":["../../../../../src/features/ui/inputs/text-input/text-input-styled.ts"],"sourcesContent":["import type { IBaseInputProps } from '../base-input/base-input-types';\nimport type { ITextInputProps } from './text-input-types';\n\nimport styled from 'styled-components';\n\ninterface IInputProps {\n $renderAs: ITextInputProps['renderAs'];\n $size: IBaseInputProps['size'];\n $isTransparent?: IBaseInputProps['isTransparent'];\n}\n\nconst Input = styled.input<IInputProps>(({ theme, $size, $renderAs, $isTransparent }) => {\n const { colors, input, text } = theme;\n const { valueColorName, labelColorName, backgroundColorName } = input.variants[$renderAs];\n const { inputTextVariant } = input.sizes[$size];\n const { fontFamily, fontSize, lineHeight, letterSpacing } = text[inputTextVariant];\n const background = $isTransparent ? 'transparent' : colors[backgroundColorName ?? 'WHITE'];\n\n return `\n position: relative;\n width: 100%;\n height: 100%;\n border: 0;\n padding: 0;\n outline: none;\n\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n line-height: ${lineHeight}px;\n ${typeof letterSpacing === 'number' ? `letter-spacing: ${letterSpacing}px;` : ''}\n\n \n background-color: ${background};\n color: ${colors[valueColorName.inactive]};\n \n &::placeholder {\n color: ${colors[labelColorName.inactive]};\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n line-height: ${lineHeight}px;\n ${typeof letterSpacing === 'number' ? `letter-spacing: ${letterSpacing}px;` : ''}\n }\n\n &:hover, &:focus {\n color: ${colors[valueColorName.active]};\n }\n\n &:read-only {\n cursor: pointer;\n }\n \n &:disabled {\n color: ${colors[valueColorName.disabled]};\n cursor: not-allowed;\n\n &::placeholder {\n color: ${colors[labelColorName.disabled]};\n }\n }\n \n &:hover:not([disabled, focused])::placeholder {\n color: ${colors[labelColorName.active]};\n }\n\n &:focus::placeholder {\n color: transparent;\n }\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &[type=\"date\"]:not(:placeholder-shown){\n color: ${colors.BLACK_T_60};\n text-transform: uppercase;\n }\n `;\n});\n\nexport { Input };\n"],"names":["Input","styled","theme","$size","$renderAs","$isTransparent","colors","input","text","valueColorName","labelColorName","backgroundColorName","inputTextVariant","fontFamily","fontSize","lineHeight","letterSpacing","background"],"mappings":";AAWM,MAAAA,IAAQC,EAAO,MAAmB,CAAC,EAAE,OAA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styled.js","sources":["../../../../../src/features/ui/inputs/text-input/text-input-styled.ts"],"sourcesContent":["import type { IBaseInputProps } from '../base-input/base-input-types';\nimport type { ITextInputProps } from './text-input-types';\n\nimport styled from 'styled-components';\n\ninterface IInputProps {\n $renderAs: ITextInputProps['renderAs'];\n $size: IBaseInputProps['size'];\n $isTransparent?: IBaseInputProps['isTransparent'];\n}\n\nconst Input = styled.input<IInputProps>(({ theme, $size, $renderAs, $isTransparent }) => {\n const { colors, input, text } = theme;\n const { valueColorName, labelColorName, backgroundColorName } = input.variants[$renderAs];\n const { inputTextVariant } = input.sizes[$size];\n const { fontFamily, fontSize, lineHeight, letterSpacing } = text[inputTextVariant];\n const background = $isTransparent ? 'transparent' : colors[backgroundColorName ?? 'WHITE'];\n\n return `\n position: relative;\n width: 100%;\n height: 100%;\n border: 0;\n padding: 0;\n outline: none;\n\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n line-height: ${lineHeight}px;\n ${typeof letterSpacing === 'number' ? `letter-spacing: ${letterSpacing}px;` : ''}\n\n \n background-color: ${background};\n color: ${colors[valueColorName.inactive]};\n \n &::placeholder {\n color: ${colors[labelColorName.inactive]};\n font-family: ${fontFamily};\n font-size: ${fontSize}px;\n line-height: ${lineHeight}px;\n ${typeof letterSpacing === 'number' ? `letter-spacing: ${letterSpacing}px;` : ''}\n }\n\n &:hover, &:focus {\n color: ${colors[valueColorName.active]};\n }\n\n &:read-only {\n cursor: pointer;\n }\n \n &:disabled {\n color: ${colors[valueColorName.disabled]};\n cursor: not-allowed;\n\n &::placeholder {\n color: ${colors[labelColorName.disabled]};\n }\n }\n \n &:hover:not([disabled, focused])::placeholder {\n color: ${colors[labelColorName.active]};\n }\n\n &:focus::placeholder {\n color: transparent;\n }\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &[type=\"date\"]:not(:placeholder-shown){\n color: ${colors.BLACK_T_60};\n text-transform: uppercase;\n }\n \n &:-webkit-autofill { \n -webkit-text-fill-color: ${colors[valueColorName.inactive]} !important;\n -webkit-background-clip: text;\n }\n `;\n});\n\nexport { Input };\n"],"names":["Input","styled","theme","$size","$renderAs","$isTransparent","colors","input","text","valueColorName","labelColorName","backgroundColorName","inputTextVariant","fontFamily","fontSize","lineHeight","letterSpacing","background"],"mappings":";AAWM,MAAAA,IAAQC,EAAO,MAAmB,CAAC,EAAE,OAAAC,GAAO,OAAAC,GAAO,WAAAC,GAAW,gBAAAC,QAAqB;AACvF,QAAM,EAAE,QAAAC,GAAQ,OAAAC,GAAO,MAAAC,EAAA,IAASN,GAC1B,EAAE,gBAAAO,GAAgB,gBAAAC,GAAgB,qBAAAC,EAAwB,IAAAJ,EAAM,SAASH,CAAS,GAClF,EAAE,kBAAAQ,EAAqB,IAAAL,EAAM,MAAMJ,CAAK,GACxC,EAAE,YAAAU,GAAY,UAAAC,GAAU,YAAAC,GAAY,eAAAC,MAAkBR,EAAKI,CAAgB,GAC3EK,IAAaZ,IAAiB,gBAAgBC,EAAOK,KAAuB,OAAO;AAElF,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAQUE,CAAU;AAAA,iBACZC,CAAQ;AAAA,mBACNC,CAAU;AAAA,MACvB,OAAOC,KAAkB,WAAW,mBAAmBA,CAAa,QAAQ,EAAE;AAAA;AAAA;AAAA,wBAG5DC,CAAU;AAAA,aACrBX,EAAOG,EAAe,QAAQ,CAAC;AAAA;AAAA;AAAA,eAG7BH,EAAOI,EAAe,QAAQ,CAAC;AAAA,qBACzBG,CAAU;AAAA,mBACZC,CAAQ;AAAA,qBACNC,CAAU;AAAA,QACvB,OAAOC,KAAkB,WAAW,mBAAmBA,CAAa,QAAQ,EAAE;AAAA;AAAA;AAAA;AAAA,eAIvEV,EAAOG,EAAe,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAQ7BH,EAAOG,EAAe,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA,iBAI7BH,EAAOI,EAAe,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,eAKjCJ,EAAOI,EAAe,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAa7BJ,EAAO,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,iCAKCA,EAAOG,EAAe,QAAQ,CAAC;AAAA;AAAA;AAAA;AAIhE,CAAC;"}
|
package/dist/index.d.ts
CHANGED
@@ -277,6 +277,16 @@ export declare const CopyIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
277
277
|
|
278
278
|
export declare const CountdownTimer: FC<ICountdownTimer>;
|
279
279
|
|
280
|
+
export declare const COUNTRY_CODE_MAP: {
|
281
|
+
id: string;
|
282
|
+
code: string;
|
283
|
+
label: string;
|
284
|
+
value: string;
|
285
|
+
icon: string;
|
286
|
+
url: string;
|
287
|
+
geoIPCountryCode: string;
|
288
|
+
}[];
|
289
|
+
|
280
290
|
declare const COURSE_STREAMS: {
|
281
291
|
readonly SAT_DEMO: "SAT-DEMO";
|
282
292
|
readonly SAT_MATH: "SAT-MATH";
|
@@ -359,6 +369,7 @@ declare const ENROLLMENT_TYPES: {
|
|
359
369
|
|
360
370
|
export declare enum EPostGameStat {
|
361
371
|
STREAK = "streak",
|
372
|
+
SCORE = "score",
|
362
373
|
ACCURACY = "accuracy",
|
363
374
|
CLOCK = "clock",
|
364
375
|
POINT = "point",
|
@@ -2625,12 +2636,12 @@ export declare interface IPointsLeaderboardDetails extends IBaseLeaderboardDetai
|
|
2625
2636
|
export declare interface IPostGameStat {
|
2626
2637
|
type: EPostGameStat;
|
2627
2638
|
value: number;
|
2639
|
+
maxValue?: number;
|
2628
2640
|
onReveal?: () => void;
|
2629
2641
|
onComplete?: () => void;
|
2630
2642
|
helperText?: ReactNode;
|
2631
2643
|
stopAtEnd?: boolean;
|
2632
2644
|
targetValue?: number;
|
2633
|
-
maxValue?: number;
|
2634
2645
|
helperTextPrimary?: string;
|
2635
2646
|
helperTextSecondary?: string;
|
2636
2647
|
progressType?: 'linear' | 'stepper';
|
@@ -4076,6 +4087,8 @@ export declare const LOTTIE: {
|
|
4076
4087
|
GOLD_1: string;
|
4077
4088
|
GOLD_2: string;
|
4078
4089
|
GOLD_3: string;
|
4090
|
+
HIGH_SCORE_CONFETTI: string;
|
4091
|
+
HIGH_SCORE_TEXT: string;
|
4079
4092
|
GRADE: string;
|
4080
4093
|
INFINITE_BUTTON_BG: string;
|
4081
4094
|
INFINITE_BUTTON_SYMBOL: string;
|