@cuemath/leap 3.4.4 → 3.4.5-akm-2
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 +7 -0
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/lottie/lottie.js +1 -0
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +31 -16
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs.js +22 -5
- package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/pla-signup/signup-options/signup-options.js +46 -37
- package/dist/features/auth/pla-signup/signup-options/signup-options.js.map +1 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/constants.js +1 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/constants.js.map +1 -1
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js +4 -4
- package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js +84 -21
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel-styled.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js +46 -73
- package/dist/features/circle-games/game-launcher/comps/carousel/carousel.js.map +1 -1
- package/dist/features/circle-games/game-launcher/comps/carousel-badge/carousel-badge-style.js +20 -0
- package/dist/features/circle-games/game-launcher/comps/carousel-badge/carousel-badge-style.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/carousel-badge/carousel-badge.js +17 -0
- package/dist/features/circle-games/game-launcher/comps/carousel-badge/carousel-badge.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/carousel-badge/carousel-single-badge.js +20 -0
- package/dist/features/circle-games/game-launcher/comps/carousel-badge/carousel-single-badge.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/circular-game-card/circular-game-card-styled.js +68 -0
- package/dist/features/circle-games/game-launcher/comps/circular-game-card/circular-game-card-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/circular-game-card/circular-game-card.js +87 -0
- package/dist/features/circle-games/game-launcher/comps/circular-game-card/circular-game-card.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/circular-game-card/constants.js +7 -0
- package/dist/features/circle-games/game-launcher/comps/circular-game-card/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/game-card-content/constants.js +6 -0
- package/dist/features/circle-games/game-launcher/comps/game-card-content/constants.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/game-card-content/game-card-content-styled.js +62 -0
- package/dist/features/circle-games/game-launcher/comps/game-card-content/game-card-content-styled.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/game-card-content/game-card-content.js +13 -0
- package/dist/features/circle-games/game-launcher/comps/game-card-content/game-card-content.js.map +1 -0
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js +2 -7
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/constants.js.map +1 -1
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js +80 -59
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/helper.js.map +1 -1
- package/dist/features/circle-games/game-launcher/game-launcher-v2.js +246 -0
- package/dist/features/circle-games/game-launcher/game-launcher-v2.js.map +1 -0
- package/dist/features/circle-games/game-launcher/helpers.js +8 -0
- package/dist/features/circle-games/game-launcher/helpers.js.map +1 -0
- package/dist/features/milestone/create/milestone-create-helpers.js +6 -2
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js +1 -1
- package/dist/features/post-game-stats/accuracy/accuracy-styled.js.map +1 -1
- package/dist/features/post-game-stats/clock/clock-styled.js +1 -1
- package/dist/features/post-game-stats/clock/clock-styled.js.map +1 -1
- package/dist/features/post-game-stats/points/points.js +4 -3
- package/dist/features/post-game-stats/points/points.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats-styled.js +9 -8
- package/dist/features/post-game-stats/post-game-stats-styled.js.map +1 -1
- package/dist/features/post-game-stats/post-game-stats.js +107 -105
- package/dist/features/post-game-stats/post-game-stats.js.map +1 -1
- package/dist/features/post-game-stats/score/score-styled.js +1 -1
- package/dist/features/post-game-stats/score/score-styled.js.map +1 -1
- package/dist/features/post-game-stats/streak/streak-styled.js +1 -1
- package/dist/features/post-game-stats/streak/streak-styled.js.map +1 -1
- package/dist/index.d.ts +90 -7
- package/dist/index.js +271 -264
- package/dist/index.js.map +1 -1
- package/dist/static/accuracy-badge.2e161f00.svg +1 -0
- package/dist/static/clock-badge.0adb4ba6.svg +1 -0
- package/dist/static/down-arrow-badge.f462f615.svg +1 -0
- package/dist/static/green-tick.43b94c3a.svg +1 -0
- package/dist/static/pill-tick.c06f606d.json +1 -0
- package/dist/static/points-badge.96bdecc9.svg +1 -0
- package/dist/static/star-badge.5450c267.svg +1 -0
- package/dist/static/up-arrow-badge.71fe7ad1.svg +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/dist/assets/line-icons/icons/carat-left.js +0 -26
- package/dist/assets/line-icons/icons/carat-left.js.map +0 -1
- package/dist/assets/line-icons/icons/carat-right.js +0 -26
- package/dist/assets/line-icons/icons/carat-right.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js +0 -138
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js +0 -105
- package/dist/features/circle-games/game-launcher/comps/segmented-game-card/segmented-game-card.js.map +0 -1
- package/dist/features/circle-games/game-launcher/game-launcher.js +0 -219
- package/dist/features/circle-games/game-launcher/game-launcher.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js +0 -8
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js +0 -286
- package/dist/features/circle-games/game-launcher/hooks/use-game-launcher-journey/use-game-launcher-journey.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js +0 -10
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js +0 -13
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js +0 -137
- package/dist/features/circle-games/game-launcher/hooks/use-table-infinite-launcher-journey/use-table-infinite-launcher-journey.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js +0 -14
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/constants.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js +0 -13
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey-styled.js.map +0 -1
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js +0 -230
- package/dist/features/circle-games/game-launcher/hooks/use-table-launcher-journey/use-table-launcher-journey.js.map +0 -1
|
@@ -1,39 +1,102 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import t, { css as o } from "styled-components";
|
|
2
|
+
import n from "../../../../ui/layout/flex-view.js";
|
|
3
|
+
import { GAME_LAUNCHER_SIZE as r } from "../card-container/constants.js";
|
|
4
|
+
const l = t.div`
|
|
4
5
|
width: 100%;
|
|
6
|
+
height: 100%;
|
|
5
7
|
position: relative;
|
|
6
8
|
display: flex;
|
|
7
9
|
justify-content: center;
|
|
8
|
-
`,
|
|
10
|
+
`, d = t.div`
|
|
9
11
|
display: flex;
|
|
10
12
|
width: 100%;
|
|
11
13
|
flex-grow: 1;
|
|
12
|
-
transform: ${({ $translate:
|
|
13
|
-
transition: ${({ $translateDuration:
|
|
14
|
-
`,
|
|
14
|
+
transform: ${({ $translate: e = 0 }) => `translateX(${-e}%)`};
|
|
15
|
+
transition: ${({ $translateDuration: e }) => `all ${e}ms ease-in`};
|
|
16
|
+
`, c = t.div`
|
|
15
17
|
width: 100%;
|
|
16
18
|
display: flex;
|
|
17
19
|
align-items: center;
|
|
18
20
|
justify-content: center;
|
|
19
21
|
flex-grow: 1;
|
|
20
22
|
flex-shrink: 0;
|
|
21
|
-
`,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
background: ${({ theme:
|
|
23
|
+
`, x = t.div`
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding: 2px;
|
|
28
|
+
gap: 4px;
|
|
29
|
+
background: ${({ theme: e }) => e.colors.BLACK_5 || "#313131"};
|
|
30
|
+
border-radius: 24px;
|
|
31
|
+
margin-top: 20px;
|
|
32
|
+
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
33
|
+
padding: 8px;
|
|
34
|
+
gap: 8px;
|
|
35
|
+
margin-top: 16px;
|
|
36
|
+
}
|
|
37
|
+
`, f = t.div`
|
|
38
|
+
width: 28px;
|
|
39
|
+
height: 28px;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
flex-shrink: 0;
|
|
28
44
|
cursor: pointer;
|
|
29
|
-
`,
|
|
30
|
-
|
|
45
|
+
`, u = t.img`
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
object-fit: contain;
|
|
49
|
+
`, g = t.div`
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
position: absolute;
|
|
52
|
+
|
|
53
|
+
/* ------ MOBILE FIRST STYLES ------ */
|
|
54
|
+
width: 20px;
|
|
55
|
+
height: 20px;
|
|
56
|
+
border-radius: 13.33px;
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
color: ${({ $isCompleted: e }) => e ? "transparent" : "#0D0D0D"};
|
|
61
|
+
background: ${({ $isSelected: e, $isCompleted: i }) => i && e ? "#00E573" : i ? "#007038" : e ? "#FFFFFF" : "#313131"};
|
|
62
|
+
|
|
63
|
+
/* ------ DESKTOP OVERRIDES ------ */
|
|
64
|
+
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
65
|
+
width: 28px;
|
|
66
|
+
height: 28px;
|
|
67
|
+
border-radius: 16px;
|
|
68
|
+
line-height: 50px;
|
|
69
|
+
border: ${({ $isCompleted: e }) => e ? "none" : "1px solid rgba(255, 255, 255, 0.38)"};
|
|
70
|
+
${({ $isCompleted: e, $isSelected: i }) => !i && !e && o`
|
|
71
|
+
&:hover {
|
|
72
|
+
background: rgba(255, 255, 255, 0.38);
|
|
73
|
+
border: 1px solid #ffffff;
|
|
74
|
+
color: #ffffff;
|
|
75
|
+
}
|
|
76
|
+
`}
|
|
77
|
+
}
|
|
78
|
+
`, h = t(n)`
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: calc(50% + ${r / 2}px);
|
|
81
|
+
`, m = t(n)`
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: calc(50% + ${56 + r / 2}px);
|
|
84
|
+
justify-content: center;
|
|
85
|
+
align-items: center;
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
88
|
+
top: calc(50% + ${66 + r / 2}px);
|
|
89
|
+
}
|
|
31
90
|
`;
|
|
32
91
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
92
|
+
l as Carousel,
|
|
93
|
+
x as CarouselContainer,
|
|
94
|
+
g as CarouselItem,
|
|
95
|
+
c as CarouselItemContainer,
|
|
96
|
+
f as CarouselItemWrapper,
|
|
97
|
+
d as CarouselWrapper,
|
|
98
|
+
h as ExtendedFlexView,
|
|
99
|
+
m as StyledCarouselBadgeWrapper,
|
|
100
|
+
u as TickIcon
|
|
38
101
|
};
|
|
39
102
|
//# sourceMappingURL=carousel-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel-styled.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const Carousel = styled.div`\n width: 100%;\n position: relative;\n display: flex;\n justify-content: center;\n`;\nexport const CarouselWrapper = styled.div<{ $translate
|
|
1
|
+
{"version":3,"file":"carousel-styled.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel-styled.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { GAME_LAUNCHER_SIZE } from '../card-container/constants';\n\nexport const Carousel = styled.div`\n width: 100%;\n height: 100%;\n position: relative;\n display: flex;\n justify-content: center;\n`;\nexport const CarouselWrapper = styled.div<{ $translate?: number; $translateDuration?: number }>`\n display: flex;\n width: 100%;\n flex-grow: 1;\n transform: ${({ $translate = 0 }) => `translateX(${-$translate}%)`};\n transition: ${({ $translateDuration }) => `all ${$translateDuration}ms ease-in`};\n`;\n\nexport const CarouselItemContainer = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-grow: 1;\n flex-shrink: 0;\n`;\n\n// StyledComponents.ts\n\nexport const CarouselContainer = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 2px;\n gap: 4px;\n background: ${({ theme }) => theme.colors.BLACK_5 || '#313131'};\n border-radius: 24px;\n margin-top: 20px;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n padding: 8px;\n gap: 8px;\n margin-top: 16px;\n }\n`;\n\ninterface CarouselItemProps {\n $isSelected?: boolean;\n $isCompleted?: boolean;\n $isHovered?: boolean; // Optional, most hover styling should use :hover pseudo-class\n}\n\nexport const CarouselItemWrapper = styled.div`\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n cursor: pointer;\n`;\n\nexport const TickIcon = styled.img`\n width: 100%;\n height: 100%;\n object-fit: contain;\n`;\n\nexport const CarouselItem = styled.div<CarouselItemProps>`\n box-sizing: border-box;\n position: absolute;\n\n /* ------ MOBILE FIRST STYLES ------ */\n width: 20px;\n height: 20px;\n border-radius: 13.33px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${({ $isCompleted }) => ($isCompleted ? 'transparent' : '#0D0D0D')};\n background: ${({ $isSelected, $isCompleted }) => {\n if ($isCompleted && $isSelected) return '#00E573';\n\n if ($isCompleted) return '#007038';\n\n if ($isSelected) return '#FFFFFF';\n\n return '#313131';\n }};\n\n /* ------ DESKTOP OVERRIDES ------ */\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n width: 28px;\n height: 28px;\n border-radius: 16px;\n line-height: 50px;\n border: ${({ $isCompleted }) =>\n $isCompleted ? 'none' : '1px solid rgba(255, 255, 255, 0.38)'};\n ${({ $isCompleted, $isSelected }) =>\n !$isSelected &&\n !$isCompleted &&\n css`\n &:hover {\n background: rgba(255, 255, 255, 0.38);\n border: 1px solid #ffffff;\n color: #ffffff;\n }\n `}\n }\n`;\n\nexport const ExtendedFlexView = styled(FlexView)`\n position: absolute;\n top: calc(50% + ${GAME_LAUNCHER_SIZE / 2}px);\n`;\n\nexport const StyledCarouselBadgeWrapper = styled(FlexView)`\n position: absolute;\n top: calc(50% + ${56 + GAME_LAUNCHER_SIZE / 2}px);\n justify-content: center;\n align-items: center;\n pointer-events: none;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n top: calc(50% + ${66 + GAME_LAUNCHER_SIZE / 2}px);\n }\n`;\n"],"names":["Carousel","styled","CarouselWrapper","$translate","$translateDuration","CarouselItemContainer","CarouselContainer","theme","CarouselItemWrapper","TickIcon","CarouselItem","$isCompleted","$isSelected","css","ExtendedFlexView","FlexView","GAME_LAUNCHER_SIZE","StyledCarouselBadgeWrapper"],"mappings":";;;AAKO,MAAMA,IAAWC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOlBC,IAAkBD,EAAO;AAAA;AAAA;AAAA;AAAA,eAIvB,CAAC,EAAE,YAAAE,IAAa,QAAQ,cAAc,CAACA,CAAU,IAAI;AAAA,gBACpD,CAAC,EAAE,oBAAAC,EAAyB,MAAA,OAAOA,CAAkB,YAAY;AAAA,GAGpEC,IAAwBJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAW/BK,IAAoBL,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAMxB,CAAC,EAAE,OAAAM,QAAYA,EAAM,OAAO,WAAW,SAAS;AAAA;AAAA;AAAA,IAG5D,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,GAavCC,IAAsBP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAU7BQ,IAAWR,EAAO;AAAA;AAAA;AAAA;AAAA,GAMlBS,IAAeT,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAWxB,CAAC,EAAE,cAAAU,EAAA,MAAoBA,IAAe,gBAAgB,SAAU;AAAA,gBAC3D,CAAC,EAAE,aAAAC,GAAa,cAAAD,QACxBA,KAAgBC,IAAoB,YAEpCD,IAAqB,YAErBC,IAAoB,YAEjB,SACR;AAAA;AAAA;AAAA,IAGC,CAAC,EAAE,OAAAL,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,cAKtC,CAAC,EAAE,cAAAI,EAAA,MACXA,IAAe,SAAS,qCAAqC;AAAA,MAC7D,CAAC,EAAE,cAAAA,GAAc,aAAAC,EAAA,MACjB,CAACA,KACD,CAACD,KACDE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAMC;AAAA;AAAA,GAIMC,IAAmBb,EAAOc,CAAQ;AAAA;AAAA,oBAE3BC,IAAqB,CAAC;AAAA,GAG7BC,IAA6BhB,EAAOc,CAAQ;AAAA;AAAA,oBAErC,KAAKC,IAAqB,CAAC;AAAA;AAAA;AAAA;AAAA,IAI3C,CAAC,EAAE,OAAAT,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA,sBAC9B,KAAKS,IAAqB,CAAC;AAAA;AAAA;"}
|
|
@@ -1,85 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { Carousel as
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
s == null || s(), n((r) => r + 1);
|
|
13
|
-
}, [s]), L = d((r) => {
|
|
14
|
-
n(r);
|
|
1
|
+
import { jsxs as I, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { memo as T, forwardRef as g, useRef as u, useState as $, useMemo as B, createRef as E, useCallback as R, useImperativeHandle as k, useEffect as i } from "react";
|
|
3
|
+
import { useTheme as S } from "styled-components";
|
|
4
|
+
import { ILLUSTRATIONS as x } from "../../../../../assets/illustrations/illustrations.js";
|
|
5
|
+
import A from "../../../../ui/text/text.js";
|
|
6
|
+
import { EDeviceType as L } from "../../../../ui/theme/constants.js";
|
|
7
|
+
import { Carousel as W, CarouselWrapper as b, CarouselItemContainer as j, ExtendedFlexView as v, CarouselContainer as w, CarouselItemWrapper as y, CarouselItem as D, TickIcon as F, StyledCarouselBadgeWrapper as _ } from "./carousel-styled.js";
|
|
8
|
+
const H = ({ items: e, defaultIndex: l = 0 }, m) => {
|
|
9
|
+
var s;
|
|
10
|
+
const { device: p } = S(), C = p <= L.TABLET, d = u(null), a = u(!0), [n, c] = $(l), f = B(() => e.map(() => E()), [e]), h = R((r) => {
|
|
11
|
+
c(r);
|
|
15
12
|
}, []);
|
|
16
|
-
return
|
|
17
|
-
nextBtnRef:
|
|
18
|
-
indicatorRefs:
|
|
19
|
-
currentIndex:
|
|
13
|
+
return k(m, () => ({
|
|
14
|
+
nextBtnRef: d,
|
|
15
|
+
indicatorRefs: f,
|
|
16
|
+
currentIndex: n,
|
|
20
17
|
goToIndex: (r) => {
|
|
21
|
-
|
|
18
|
+
c(r);
|
|
22
19
|
}
|
|
23
|
-
})),
|
|
24
|
-
|
|
25
|
-
}, []),
|
|
26
|
-
|
|
27
|
-
}, [l]), /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
20
|
+
})), i(() => {
|
|
21
|
+
a.current && (a.current = !1);
|
|
22
|
+
}, []), i(() => {
|
|
23
|
+
c((r) => e.length <= 1 || r >= e.length ? 0 : l);
|
|
24
|
+
}, [l, e.length]), /* @__PURE__ */ I(W, { children: [
|
|
25
|
+
/* @__PURE__ */ o(
|
|
26
|
+
b,
|
|
30
27
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
...e.length > 1 && {
|
|
29
|
+
$translate: n * 100,
|
|
30
|
+
$translateDuration: a.current ? 0 : 300
|
|
31
|
+
},
|
|
32
|
+
children: e.map((r, t) => /* @__PURE__ */ o(j, { children: r.element }, t))
|
|
34
33
|
}
|
|
35
34
|
),
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
e.length > 1 && /* @__PURE__ */ o(v, { $flexDirection: "row", $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ o(w, { children: e.map((r, t) => /* @__PURE__ */ o(y, { children: /* @__PURE__ */ o(
|
|
36
|
+
D,
|
|
38
37
|
{
|
|
39
|
-
$
|
|
40
|
-
$
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
analyticsProps: f.analyticsProps,
|
|
52
|
-
disabled: o === 0
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
/* @__PURE__ */ e(g, { width: 48 }),
|
|
56
|
-
t.map((r, a) => /* @__PURE__ */ e(
|
|
57
|
-
V,
|
|
58
|
-
{
|
|
59
|
-
ref: I[a],
|
|
60
|
-
$isActive: a === o,
|
|
61
|
-
onClick: () => L(a)
|
|
62
|
-
},
|
|
63
|
-
a
|
|
64
|
-
)),
|
|
65
|
-
/* @__PURE__ */ e(g, { width: 48 }),
|
|
66
|
-
/* @__PURE__ */ e("div", { ref: h, children: /* @__PURE__ */ e(
|
|
67
|
-
R,
|
|
68
|
-
{
|
|
69
|
-
renderAs: "secondary",
|
|
70
|
-
Icon: F,
|
|
71
|
-
onClick: A,
|
|
72
|
-
analyticsLabel: C.analyticsLabel,
|
|
73
|
-
analyticsProps: C.analyticsProps,
|
|
74
|
-
disabled: o === t.length - 1
|
|
75
|
-
}
|
|
76
|
-
) })
|
|
77
|
-
]
|
|
38
|
+
$isSelected: t === n,
|
|
39
|
+
$isCompleted: r.isCompleted,
|
|
40
|
+
onClick: () => h(t),
|
|
41
|
+
children: r.isCompleted && t !== n ? /* @__PURE__ */ o(F, { src: x.GREEN_TICK, alt: "completed" }) : /* @__PURE__ */ o(
|
|
42
|
+
A,
|
|
43
|
+
{
|
|
44
|
+
$renderAs: C ? "ac4-black" : "ac3-black",
|
|
45
|
+
$color: t === n ? "BLACK" : "WHITE_T_60",
|
|
46
|
+
$marginBottom: 0,
|
|
47
|
+
children: t + 1
|
|
48
|
+
}
|
|
49
|
+
)
|
|
78
50
|
}
|
|
79
|
-
)
|
|
51
|
+
) }, t)) }) }),
|
|
52
|
+
((s = e[n]) == null ? void 0 : s.carouselBadge) && /* @__PURE__ */ o(_, { children: e[n].carouselBadge })
|
|
80
53
|
] });
|
|
81
|
-
},
|
|
54
|
+
}, q = T(g(H));
|
|
82
55
|
export {
|
|
83
|
-
|
|
56
|
+
q as Carousel
|
|
84
57
|
};
|
|
85
58
|
//# sourceMappingURL=carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel.tsx"],"sourcesContent":["import type { ForwardRefRenderFunction } from 'react';\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n createRef,\n} from 'react';\
|
|
1
|
+
{"version":3,"file":"carousel.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel/carousel.tsx"],"sourcesContent":["import type { ForwardRefRenderFunction } from 'react';\nimport {\n memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n forwardRef,\n useImperativeHandle,\n createRef,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { ILLUSTRATIONS } from '../../../../../assets/illustrations/illustrations';\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport * as Styled from './carousel-styled';\nimport {\n CarouselItem,\n CarouselItemWrapper,\n TickIcon,\n StyledCarouselBadgeWrapper,\n} from './carousel-styled';\nimport type { ICarouselProps, ICarouselRefs } from './carousel-types';\n\nconst CarouselComponent: ForwardRefRenderFunction<ICarouselRefs, ICarouselProps> = (\n { items, defaultIndex = 0 },\n ref,\n) => {\n const { device } = useTheme();\n const useSmallFont = device <= EDeviceType.TABLET;\n // const memoizedAnalyticsPrev = useMemo(() => analyticsPrev, [analyticsPrev]);\n // const memoizedAnalyticsNext = useMemo(() => analyticsNext, [analyticsNext]);\n\n const nextBtnRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const isFirstMount = useRef(true);\n const [currIndex, setCurrIndex] = useState(defaultIndex);\n\n // Create a stable array of refs for indicators\n const indicatorRefs = useMemo(() => items.map(() => createRef<HTMLDivElement>()), [items]);\n\n // const handleCarouselPrev = useCallback(() => {\n // onPrev?.();\n // setCurrIndex(prev => prev - 1);\n // }, [onPrev]);\n\n // const handleCarouselNext = useCallback(() => {\n // onNext?.();\n // setCurrIndex(prev => prev + 1);\n // }, [onNext]);\n\n const handleCarouselIndicatorClick = useCallback((index: number) => {\n setCurrIndex(index);\n }, []);\n\n useImperativeHandle(ref, () => ({\n nextBtnRef,\n indicatorRefs,\n currentIndex: currIndex,\n goToIndex: (index: number) => {\n setCurrIndex(index);\n },\n }));\n\n useEffect(() => {\n if (isFirstMount.current) {\n isFirstMount.current = false;\n }\n }, []);\n\n // Change index from parent\n useEffect(() => {\n setCurrIndex(prev => {\n if (items.length <= 1) return 0;\n\n if (prev >= items.length) return 0;\n\n return defaultIndex;\n });\n }, [defaultIndex, items.length]);\n\n return (\n <Styled.Carousel>\n <Styled.CarouselWrapper\n {...(items.length > 1 && {\n $translate: currIndex * 100,\n $translateDuration: isFirstMount.current ? 0 : 300,\n })}\n >\n {items.map((item, index) => (\n <Styled.CarouselItemContainer key={index}>{item.element}</Styled.CarouselItemContainer>\n ))}\n </Styled.CarouselWrapper>\n\n {/* 👇 Will come below the carousel content */}\n {items.length > 1 && (\n <Styled.ExtendedFlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"center\">\n <Styled.CarouselContainer>\n {items.map((item, index) => (\n <CarouselItemWrapper key={index}>\n <CarouselItem\n $isSelected={index === currIndex}\n $isCompleted={item.isCompleted}\n onClick={() => handleCarouselIndicatorClick(index)}\n >\n {item.isCompleted && index !== currIndex ? (\n <TickIcon src={ILLUSTRATIONS.GREEN_TICK} alt=\"completed\" />\n ) : (\n <Text\n $renderAs={useSmallFont ? 'ac4-black' : 'ac3-black'}\n $color={index === currIndex ? 'BLACK' : 'WHITE_T_60'}\n $marginBottom={0}\n >\n {index + 1}\n </Text>\n )}\n </CarouselItem>\n </CarouselItemWrapper>\n ))}\n </Styled.CarouselContainer>\n </Styled.ExtendedFlexView>\n )}\n\n {/* 👇 Will come below indicators */}\n {items[currIndex]?.carouselBadge && (\n <StyledCarouselBadgeWrapper>{items[currIndex].carouselBadge}</StyledCarouselBadgeWrapper>\n )}\n </Styled.Carousel>\n );\n};\n\nexport const Carousel = memo(forwardRef(CarouselComponent));\n"],"names":["CarouselComponent","items","defaultIndex","ref","device","useTheme","useSmallFont","EDeviceType","nextBtnRef","useRef","isFirstMount","currIndex","setCurrIndex","useState","indicatorRefs","useMemo","createRef","handleCarouselIndicatorClick","useCallback","index","useImperativeHandle","useEffect","prev","jsxs","Styled.Carousel","jsx","Styled.CarouselWrapper","item","Styled.CarouselItemContainer","Styled.ExtendedFlexView","Styled.CarouselContainer","CarouselItemWrapper","CarouselItem","TickIcon","ILLUSTRATIONS","Text","_a","StyledCarouselBadgeWrapper","Carousel","memo","forwardRef"],"mappings":";;;;;;;AA0BA,MAAMA,IAA6E,CACjF,EAAE,OAAAC,GAAO,cAAAC,IAAe,EAAA,GACxBC,MACG;;AACG,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAeF,KAAUG,EAAY,QAIrCC,IAAaC,EAAuB,IAAI,GACxCC,IAAeD,EAAO,EAAI,GAC1B,CAACE,GAAWC,CAAY,IAAIC,EAASX,CAAY,GAGjDY,IAAgBC,EAAQ,MAAMd,EAAM,IAAI,MAAMe,GAA2B,GAAG,CAACf,CAAK,CAAC,GAYnFgB,IAA+BC,EAAY,CAACC,MAAkB;AAClE,IAAAP,EAAaO,CAAK;AAAA,EACpB,GAAG,CAAE,CAAA;AAEL,SAAAC,EAAoBjB,GAAK,OAAO;AAAA,IAC9B,YAAAK;AAAA,IACA,eAAAM;AAAA,IACA,cAAcH;AAAA,IACd,WAAW,CAACQ,MAAkB;AAC5B,MAAAP,EAAaO,CAAK;AAAA,IACpB;AAAA,EACA,EAAA,GAEFE,EAAU,MAAM;AACd,IAAIX,EAAa,YACfA,EAAa,UAAU;AAAA,EAE3B,GAAG,CAAE,CAAA,GAGLW,EAAU,MAAM;AACd,IAAAT,EAAa,CAAQU,MACfrB,EAAM,UAAU,KAEhBqB,KAAQrB,EAAM,SAAe,IAE1BC,CACR;AAAA,EACA,GAAA,CAACA,GAAcD,EAAM,MAAM,CAAC,GAG7B,gBAAAsB,EAACC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAAA,MAAA;AAAA,QACE,GAAIzB,EAAM,SAAS,KAAK;AAAA,UACvB,YAAYU,IAAY;AAAA,UACxB,oBAAoBD,EAAa,UAAU,IAAI;AAAA,QACjD;AAAA,QAEC,UAAMT,EAAA,IAAI,CAAC0B,GAAMR,MAChB,gBAAAM,EAACG,GAAA,EAA0C,UAAAD,EAAK,QAAb,GAAAR,CAAqB,CACzD;AAAA,MAAA;AAAA,IACH;AAAA,IAGClB,EAAM,SAAS,KACd,gBAAAwB,EAACI,GAAA,EAAwB,gBAAe,OAAM,aAAY,UAAS,iBAAgB,UACjF,UAAA,gBAAAJ,EAACK,GAAA,EACE,UAAA7B,EAAM,IAAI,CAAC0B,GAAMR,MAChB,gBAAAM,EAACM,GACC,EAAA,UAAA,gBAAAN;AAAA,MAACO;AAAA,MAAA;AAAA,QACC,aAAab,MAAUR;AAAA,QACvB,cAAcgB,EAAK;AAAA,QACnB,SAAS,MAAMV,EAA6BE,CAAK;AAAA,QAEhD,UAAAQ,EAAK,eAAeR,MAAUR,IAC7B,gBAAAc,EAACQ,GAAS,EAAA,KAAKC,EAAc,YAAY,KAAI,YAAA,CAAY,IAEzD,gBAAAT;AAAA,UAACU;AAAA,UAAA;AAAA,YACC,WAAW7B,IAAe,cAAc;AAAA,YACxC,QAAQa,MAAUR,IAAY,UAAU;AAAA,YACxC,eAAe;AAAA,YAEd,UAAQQ,IAAA;AAAA,UAAA;AAAA,QACX;AAAA,MAAA;AAAA,IAfoB,EAAA,GAAAA,CAkB1B,CACD,EACH,CAAA,GACF;AAAA,MAIDiB,IAAAnC,EAAMU,CAAS,MAAf,gBAAAyB,EAAkB,oCAChBC,GAA4B,EAAA,UAAApC,EAAMU,CAAS,EAAE,cAAc,CAAA;AAAA,EAEhE,EAAA,CAAA;AAEJ,GAEa2B,IAAWC,EAAKC,EAAWxC,CAAiB,CAAC;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import e from "styled-components";
|
|
2
|
+
const t = e.div`
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 16px;
|
|
5
|
+
height: 24px;
|
|
6
|
+
`, p = e.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
height: 24px;
|
|
10
|
+
`, d = e.img`
|
|
11
|
+
width: 24px;
|
|
12
|
+
height: 24px;
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
`;
|
|
15
|
+
export {
|
|
16
|
+
p as Badge,
|
|
17
|
+
t as BadgeContainer,
|
|
18
|
+
d as StyledIcon
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=carousel-badge-style.js.map
|
package/dist/features/circle-games/game-launcher/comps/carousel-badge/carousel-badge-style.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-badge-style.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel-badge/carousel-badge-style.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const BadgeContainer = styled.div`\n display: flex;\n gap: 16px;\n height: 24px;\n`;\n\nexport const Badge = styled.div`\n display: flex;\n align-items: center;\n height: 24px;\n`;\n\nexport const StyledIcon = styled.img`\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n`;\n"],"names":["BadgeContainer","styled","Badge","StyledIcon"],"mappings":";AAEO,MAAMA,IAAiBC,EAAO;AAAA;AAAA;AAAA;AAAA,GAMxBC,IAAQD,EAAO;AAAA;AAAA;AAAA;AAAA,GAMfE,IAAaF,EAAO;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { BadgeContainer as e } from "./carousel-badge-style.js";
|
|
3
|
+
import { SingleBadge as a } from "./carousel-single-badge.js";
|
|
4
|
+
const u = ({ badges: l, style: t }) => /* @__PURE__ */ r(e, { style: t, children: l.map((o, i) => /* @__PURE__ */ r(
|
|
5
|
+
a,
|
|
6
|
+
{
|
|
7
|
+
illustration: o.illustration,
|
|
8
|
+
value: o.value,
|
|
9
|
+
color: o.color,
|
|
10
|
+
label: o.label
|
|
11
|
+
},
|
|
12
|
+
i
|
|
13
|
+
)) });
|
|
14
|
+
export {
|
|
15
|
+
u as BadgesGroup
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=carousel-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-badge.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel-badge/carousel-badge.tsx"],"sourcesContent":["import { BadgeContainer } from './carousel-badge-style';\nimport type { IBadgeData } from './carousel-badge-type';\nimport { SingleBadge } from './carousel-single-badge';\n\ninterface BadgesGroupProps {\n badges: IBadgeData[];\n style?: React.CSSProperties;\n}\n\nexport const BadgesGroup: React.FC<BadgesGroupProps> = ({ badges, style }) => {\n return (\n <BadgeContainer style={style}>\n {badges.map((badge, index) => (\n <SingleBadge\n key={index}\n illustration={badge.illustration}\n value={badge.value}\n color={badge.color}\n label={badge.label}\n />\n ))}\n </BadgeContainer>\n );\n};\n"],"names":["BadgesGroup","badges","style","BadgeContainer","badge","index","jsx","SingleBadge"],"mappings":";;;AASO,MAAMA,IAA0C,CAAC,EAAE,QAAAC,GAAQ,OAAAC,0BAE7DC,GAAe,EAAA,OAAAD,GACb,YAAO,IAAI,CAACE,GAAOC,MAClB,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IAEC,cAAcH,EAAM;AAAA,IACpB,OAAOA,EAAM;AAAA,IACb,OAAOA,EAAM;AAAA,IACb,OAAOA,EAAM;AAAA,EAAA;AAAA,EAJRC;AAMR,CAAA,EACH,CAAA;"}
|
package/dist/features/circle-games/game-launcher/comps/carousel-badge/carousel-single-badge.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs as r, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme as s } from "styled-components";
|
|
3
|
+
import d from "../../../../ui/text/text.js";
|
|
4
|
+
import { EDeviceType as p } from "../../../../ui/theme/constants.js";
|
|
5
|
+
import { Badge as l, StyledIcon as f } from "./carousel-badge-style.js";
|
|
6
|
+
const h = ({ illustration: o, value: t, color: m, label: e }) => {
|
|
7
|
+
const { device: c } = s(), i = c <= p.TABLET;
|
|
8
|
+
return /* @__PURE__ */ r(l, { children: [
|
|
9
|
+
/* @__PURE__ */ n(f, { src: o, alt: e || "badge" }),
|
|
10
|
+
/* @__PURE__ */ r(d, { $renderAs: i ? "ub3" : "ub2", $color: m, children: [
|
|
11
|
+
t,
|
|
12
|
+
" ",
|
|
13
|
+
e
|
|
14
|
+
] })
|
|
15
|
+
] });
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
h as SingleBadge
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=carousel-single-badge.js.map
|
package/dist/features/circle-games/game-launcher/comps/carousel-badge/carousel-single-badge.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-single-badge.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/carousel-badge/carousel-single-badge.tsx"],"sourcesContent":["import { useTheme } from 'styled-components';\n\nimport Text from '../../../../ui/text/text';\nimport { EDeviceType } from '../../../../ui/theme/constants';\nimport type { TColorNames } from '../../../../ui/types';\nimport { Badge, StyledIcon } from './carousel-badge-style';\n\nexport interface SingleBadgeProps {\n illustration: string;\n value: number | string;\n color: TColorNames;\n label?: string;\n}\n\nexport const SingleBadge: React.FC<SingleBadgeProps> = ({ illustration, value, color, label }) => {\n const { device } = useTheme();\n const useSmallFont = device <= EDeviceType.TABLET;\n\n return (\n <Badge>\n <StyledIcon src={illustration} alt={label || 'badge'} />\n <Text $renderAs={useSmallFont ? 'ub3' : 'ub2'} $color={color}>\n {value} {label}\n </Text>\n </Badge>\n );\n};\n"],"names":["SingleBadge","illustration","value","color","label","device","useTheme","useSmallFont","EDeviceType","Badge","jsx","StyledIcon","Text"],"mappings":";;;;;AAcO,MAAMA,IAA0C,CAAC,EAAE,cAAAC,GAAc,OAAAC,GAAO,OAAAC,GAAO,OAAAC,QAAY;AAC1F,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAeF,KAAUG,EAAY;AAE3C,2BACGC,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAW,EAAA,KAAKV,GAAc,KAAKG,KAAS,SAAS;AAAA,sBACrDQ,GAAK,EAAA,WAAWL,IAAe,QAAQ,OAAO,QAAQJ,GACpD,UAAA;AAAA,MAAAD;AAAA,MAAM;AAAA,MAAEE;AAAA,IAAA,GACX;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import t from "styled-components";
|
|
2
|
+
import r from "../../../../ui/layout/flex-view.js";
|
|
3
|
+
import { GAME_LAUNCHER_SIZE as e } from "../card-container/constants.js";
|
|
4
|
+
import { BORDER_WIDTH as o, GAME_LAUNCHER_ASSET_PADDING as i } from "./constants.js";
|
|
5
|
+
const a = t.div`
|
|
6
|
+
position: absolute;
|
|
7
|
+
z-index: 5;
|
|
8
|
+
height: ${e}px;
|
|
9
|
+
width: ${e}px;
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
border: ${o}px solid #fff;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
`, l = t.div`
|
|
14
|
+
position: absolute;
|
|
15
|
+
height: ${e + i}px;
|
|
16
|
+
width: ${e + i}px;
|
|
17
|
+
border-radius: 50%;
|
|
18
|
+
top: ${-i / 2 - o}px;
|
|
19
|
+
left: ${-i / 2 - o}px;
|
|
20
|
+
z-index: 4;
|
|
21
|
+
`, x = t.div`
|
|
22
|
+
height: ${52}px;
|
|
23
|
+
width: ${60}px;
|
|
24
|
+
top: ${-30}px;
|
|
25
|
+
left: ${e / 2 - 30}px;
|
|
26
|
+
z-index: 6;
|
|
27
|
+
overflow: visible;
|
|
28
|
+
`;
|
|
29
|
+
t.div`
|
|
30
|
+
position: absolute;
|
|
31
|
+
width: ${e}px;
|
|
32
|
+
height: ${e}px;
|
|
33
|
+
border-radius: 50%;
|
|
34
|
+
background: transparent;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
flex: 1;
|
|
41
|
+
|
|
42
|
+
transform-origin: center;
|
|
43
|
+
transform: rotate(0deg); // change dynamically if needed
|
|
44
|
+
`;
|
|
45
|
+
const c = t.img`
|
|
46
|
+
position: absolute;
|
|
47
|
+
width: 100%;
|
|
48
|
+
object-fit: contain;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
`, f = t.div`
|
|
51
|
+
position: relative;
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
`, h = t(r)`
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: -28px;
|
|
57
|
+
display: flex;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
`;
|
|
60
|
+
export {
|
|
61
|
+
f as CardWithTickWrapper,
|
|
62
|
+
a as CircularGameCardWrapper,
|
|
63
|
+
c as DisplayNameImage,
|
|
64
|
+
h as ExtendedFlexView,
|
|
65
|
+
x as PillTickContainer,
|
|
66
|
+
l as ProgressRingLottieContainer
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=circular-game-card-styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circular-game-card-styled.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/circular-game-card/circular-game-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport { GAME_LAUNCHER_SIZE } from '../card-container/constants';\nimport { GAME_LAUNCHER_ASSET_PADDING, BORDER_WIDTH } from './constants';\n\nexport const CircularGameCardWrapper = styled.div`\n position: absolute;\n z-index: 5;\n height: ${GAME_LAUNCHER_SIZE}px;\n width: ${GAME_LAUNCHER_SIZE}px;\n border-radius: 50%;\n border: ${BORDER_WIDTH}px solid #fff;\n cursor: pointer;\n`;\n\nexport const ProgressRingLottieContainer = styled.div`\n position: absolute;\n height: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n width: ${GAME_LAUNCHER_SIZE + GAME_LAUNCHER_ASSET_PADDING}px;\n border-radius: 50%;\n top: ${-GAME_LAUNCHER_ASSET_PADDING / 2 - BORDER_WIDTH}px;\n left: ${-GAME_LAUNCHER_ASSET_PADDING / 2 - BORDER_WIDTH}px;\n z-index: 4;\n`;\n\nexport const PillTickContainer = styled.div`\n height: ${52}px;\n width: ${60}px;\n top: ${-30}px;\n left: ${GAME_LAUNCHER_SIZE / 2 - 30}px;\n z-index: 6;\n overflow: visible;\n`;\n\nexport const GameCardSegmentWrapper = styled.div`\n position: absolute;\n width: ${GAME_LAUNCHER_SIZE}px;\n height: ${GAME_LAUNCHER_SIZE}px;\n border-radius: 50%;\n background: transparent;\n overflow: hidden;\n\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n\n transform-origin: center;\n transform: rotate(0deg); // change dynamically if needed\n`;\n\nexport const DisplayNameImage = styled.img`\n position: absolute;\n width: 100%;\n object-fit: contain;\n pointer-events: none;\n`;\n\nexport const CardWithTickWrapper = styled.div`\n position: relative;\n display: flex;\n justify-content: center;\n`;\n\nexport const ExtendedFlexView = styled(FlexView)`\n position: absolute;\n top: -28px;\n display: flex;\n justify-content: center;\n`;\n"],"names":["CircularGameCardWrapper","styled","GAME_LAUNCHER_SIZE","BORDER_WIDTH","ProgressRingLottieContainer","GAME_LAUNCHER_ASSET_PADDING","PillTickContainer","DisplayNameImage","CardWithTickWrapper","ExtendedFlexView","FlexView"],"mappings":";;;;AAMO,MAAMA,IAA0BC,EAAO;AAAA;AAAA;AAAA,YAGlCC,CAAkB;AAAA,WACnBA,CAAkB;AAAA;AAAA,YAEjBC,CAAY;AAAA;AAAA,GAIXC,IAA8BH,EAAO;AAAA;AAAA,YAEtCC,IAAqBG,CAA2B;AAAA,WACjDH,IAAqBG,CAA2B;AAAA;AAAA,SAElD,CAACA,IAA8B,IAAIF,CAAY;AAAA,UAC9C,CAACE,IAA8B,IAAIF,CAAY;AAAA;AAAA,GAI5CG,IAAoBL,EAAO;AAAA,YAC5B,EAAE;AAAA,WACH,EAAE;AAAA,SACJ,GAAG;AAAA,UACFC,IAAqB,IAAI,EAAE;AAAA;AAAA;AAAA;AAKCD,EAAO;AAAA;AAAA,WAElCC,CAAkB;AAAA,YACjBA,CAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcvB,MAAMK,IAAmBN,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAO1BO,IAAsBP,EAAO;AAAA;AAAA;AAAA;AAAA,GAM7BQ,IAAmBR,EAAOS,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
package/dist/features/circle-games/game-launcher/comps/circular-game-card/circular-game-card.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { memo as _, forwardRef as G, useRef as i, useState as d, useCallback as u, useImperativeHandle as v, useMemo as T } from "react";
|
|
3
|
+
import { LOTTIE as g } from "../../../../../assets/lottie/lottie.js";
|
|
4
|
+
import I from "../../../../ui/lottie-animation/lottie-animation.js";
|
|
5
|
+
import { CardContainer as F } from "../card-container/card-container.js";
|
|
6
|
+
import { GameCardContent as x } from "../game-card-content/game-card-content.js";
|
|
7
|
+
import { CardWithTickWrapper as H, CircularGameCardWrapper as M, ProgressRingLottieContainer as N, DisplayNameImage as j, ExtendedFlexView as w, PillTickContainer as O } from "./circular-game-card-styled.js";
|
|
8
|
+
const U = ({ data: r, label: L, initialValue: l = 0, value: t, maxValue: o = 1 }, h) => {
|
|
9
|
+
const s = i(null), a = i(null), m = i(null), [c, b] = d(!1), [k, P] = d("WHITE_T_87"), R = u(() => {
|
|
10
|
+
var e;
|
|
11
|
+
(e = r == null ? void 0 : r.onPress) == null || e.call(r);
|
|
12
|
+
}, [r]), y = u((e) => {
|
|
13
|
+
b(!0), P(e);
|
|
14
|
+
}, []);
|
|
15
|
+
v(h, () => ({
|
|
16
|
+
labelRef: s,
|
|
17
|
+
circularCardWrapperRef: a,
|
|
18
|
+
startLabelAnimation: y
|
|
19
|
+
}));
|
|
20
|
+
const p = T(() => {
|
|
21
|
+
if (o <= 0)
|
|
22
|
+
return;
|
|
23
|
+
const e = 92, C = e / o, E = Math.min(C * l, e), S = Math.min(C * t + 1, e);
|
|
24
|
+
return [E, S];
|
|
25
|
+
}, [l, o, t]), A = T(
|
|
26
|
+
() => ({
|
|
27
|
+
renderer: "canvas",
|
|
28
|
+
autoplay: !0,
|
|
29
|
+
loop: !1,
|
|
30
|
+
initialSegment: p
|
|
31
|
+
}),
|
|
32
|
+
[p]
|
|
33
|
+
), W = {
|
|
34
|
+
autoplay: !1,
|
|
35
|
+
loop: !1,
|
|
36
|
+
renderer: "canvas"
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ f(H, { children: [
|
|
39
|
+
/* @__PURE__ */ n(
|
|
40
|
+
F,
|
|
41
|
+
{
|
|
42
|
+
ref: a,
|
|
43
|
+
labelRef: s,
|
|
44
|
+
label: L,
|
|
45
|
+
isAnimated: c,
|
|
46
|
+
labelColor: c ? k : "WHITE_T_60",
|
|
47
|
+
children: /* @__PURE__ */ f(M, { onClick: R, children: [
|
|
48
|
+
t && /* @__PURE__ */ n(N, { children: /* @__PURE__ */ n(
|
|
49
|
+
I,
|
|
50
|
+
{
|
|
51
|
+
src: g.LEVELUP_RINGS,
|
|
52
|
+
settings: A,
|
|
53
|
+
animateOnIntersect: !0,
|
|
54
|
+
eventListener: {
|
|
55
|
+
name: "complete",
|
|
56
|
+
callback: () => {
|
|
57
|
+
var e;
|
|
58
|
+
(e = m.current) == null || e.play();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
) }),
|
|
63
|
+
/* @__PURE__ */ n(x, { card: r.card, isCompleted: r.isCompleted }),
|
|
64
|
+
/* @__PURE__ */ n(
|
|
65
|
+
j,
|
|
66
|
+
{
|
|
67
|
+
src: r.displayNameImage || void 0,
|
|
68
|
+
alt: `${r.name} label`
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] })
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ n(w, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(
|
|
75
|
+
I,
|
|
76
|
+
{
|
|
77
|
+
ref: m,
|
|
78
|
+
src: g.PILL_TICK,
|
|
79
|
+
settings: W
|
|
80
|
+
}
|
|
81
|
+
) }) })
|
|
82
|
+
] });
|
|
83
|
+
}, Q = _(G(U));
|
|
84
|
+
export {
|
|
85
|
+
Q as CircularGameCard
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=circular-game-card.js.map
|
package/dist/features/circle-games/game-launcher/comps/circular-game-card/circular-game-card.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circular-game-card.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/circular-game-card/circular-game-card.tsx"],"sourcesContent":["import type { ForwardRefRenderFunction } from 'react';\nimport React, {\n forwardRef,\n memo,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { LOTTIE } from '../../../../../assets/lottie/lottie';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport { type ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { TColorNames } from '../../../../ui/types';\nimport { CardContainer } from '../card-container/card-container';\nimport { GameCardContent } from '../game-card-content/game-card-content';\nimport * as Styled from './circular-game-card-styled';\nimport type { ICircularGameCardProps, ICircularGameCardRefs } from './circular-game-card-types';\n\nconst CircularGameCardComponent: ForwardRefRenderFunction<\n ICircularGameCardRefs,\n ICircularGameCardProps\n> = ({ data, label: gameCategoryLabel, initialValue = 0, value, maxValue = 1 }, ref) => {\n const labelRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const cardWrapperRef = useRef<HTMLDivElement>(null) as React.RefObject<HTMLDivElement>;\n const greenTickLottieRef = useRef<ILottieAnimationRef>(null);\n const [isAnimated, setIsAnimated] = useState(false);\n const [animatedColor, setAnimatedColor] = useState<TColorNames>('WHITE_T_87');\n\n const onCardClick = useCallback(() => {\n data?.onPress?.();\n }, [data]);\n\n const startLabelAnimation = useCallback((color: TColorNames) => {\n setIsAnimated(true);\n setAnimatedColor(color);\n }, []);\n\n useImperativeHandle(ref, () => ({\n labelRef,\n circularCardWrapperRef: cardWrapperRef,\n startLabelAnimation,\n }));\n\n const animationSegments: [number, number] | undefined = useMemo(() => {\n if (maxValue <= 0) {\n return;\n }\n\n const totalFrames = 92;\n const framesPerValue = totalFrames / maxValue;\n\n const initialFrameToPlay = Math.min(framesPerValue * initialValue, totalFrames);\n const finalFrameToPlay = Math.min(framesPerValue * value + 1, totalFrames);\n\n return [initialFrameToPlay, finalFrameToPlay];\n }, [initialValue, maxValue, value]);\n\n const levelUpAnimationSettings = useMemo(\n () => ({\n renderer: 'canvas',\n autoplay: true,\n loop: false,\n initialSegment: animationSegments,\n }),\n [animationSegments],\n );\n\n const greenTickAnimationSettings = {\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n };\n\n return (\n <Styled.CardWithTickWrapper>\n <CardContainer\n ref={cardWrapperRef}\n labelRef={labelRef}\n label={gameCategoryLabel}\n isAnimated={isAnimated}\n labelColor={isAnimated ? animatedColor : 'WHITE_T_60'}\n >\n <Styled.CircularGameCardWrapper onClick={onCardClick}>\n {value && (\n <Styled.ProgressRingLottieContainer>\n <LottieAnimation\n src={LOTTIE.LEVELUP_RINGS}\n settings={levelUpAnimationSettings}\n animateOnIntersect\n eventListener={{\n name: 'complete',\n callback: () => {\n greenTickLottieRef.current?.play();\n },\n }}\n />\n </Styled.ProgressRingLottieContainer>\n )}\n <GameCardContent card={data.card} isCompleted={data.isCompleted} />\n\n <Styled.DisplayNameImage\n src={data.displayNameImage || undefined}\n alt={`${data.name} label`}\n />\n </Styled.CircularGameCardWrapper>\n </CardContainer>\n <Styled.ExtendedFlexView>\n <Styled.PillTickContainer>\n <LottieAnimation\n ref={greenTickLottieRef}\n src={LOTTIE.PILL_TICK}\n settings={greenTickAnimationSettings}\n />\n </Styled.PillTickContainer>\n </Styled.ExtendedFlexView>\n </Styled.CardWithTickWrapper>\n );\n};\n\nexport const CircularGameCard = memo(forwardRef(CircularGameCardComponent));\n"],"names":["CircularGameCardComponent","data","gameCategoryLabel","initialValue","value","maxValue","ref","labelRef","useRef","cardWrapperRef","greenTickLottieRef","isAnimated","setIsAnimated","useState","animatedColor","setAnimatedColor","onCardClick","useCallback","_a","startLabelAnimation","color","useImperativeHandle","animationSegments","useMemo","totalFrames","framesPerValue","initialFrameToPlay","finalFrameToPlay","levelUpAnimationSettings","greenTickAnimationSettings","jsxs","Styled.CardWithTickWrapper","jsx","CardContainer","Styled.CircularGameCardWrapper","Styled.ProgressRingLottieContainer","LottieAnimation","LOTTIE","GameCardContent","Styled.DisplayNameImage","Styled.ExtendedFlexView","Styled.PillTickContainer","CircularGameCard","memo","forwardRef"],"mappings":";;;;;;;AAoBA,MAAMA,IAGF,CAAC,EAAE,MAAAC,GAAM,OAAOC,GAAmB,cAAAC,IAAe,GAAG,OAAAC,GAAO,UAAAC,IAAW,EAAE,GAAGC,MAAQ;AAChF,QAAAC,IAAWC,EAAuB,IAAI,GACtCC,IAAiBD,EAAuB,IAAI,GAC5CE,IAAqBF,EAA4B,IAAI,GACrD,CAACG,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5C,CAACC,GAAeC,CAAgB,IAAIF,EAAsB,YAAY,GAEtEG,IAAcC,EAAY,MAAM;;AACpC,KAAAC,IAAAjB,KAAA,gBAAAA,EAAM,YAAN,QAAAiB,EAAA,KAAAjB;AAAA,EAAgB,GACf,CAACA,CAAI,CAAC,GAEHkB,IAAsBF,EAAY,CAACG,MAAuB;AAC9D,IAAAR,EAAc,EAAI,GAClBG,EAAiBK,CAAK;AAAA,EACxB,GAAG,CAAE,CAAA;AAEL,EAAAC,EAAoBf,GAAK,OAAO;AAAA,IAC9B,UAAAC;AAAA,IACA,wBAAwBE;AAAA,IACxB,qBAAAU;AAAA,EACA,EAAA;AAEI,QAAAG,IAAkDC,EAAQ,MAAM;AACpE,QAAIlB,KAAY;AACd;AAGF,UAAMmB,IAAc,IACdC,IAAiBD,IAAcnB,GAE/BqB,IAAqB,KAAK,IAAID,IAAiBtB,GAAcqB,CAAW,GACxEG,IAAmB,KAAK,IAAIF,IAAiBrB,IAAQ,GAAGoB,CAAW;AAElE,WAAA,CAACE,GAAoBC,CAAgB;AAAA,EAC3C,GAAA,CAACxB,GAAcE,GAAUD,CAAK,CAAC,GAE5BwB,IAA2BL;AAAA,IAC/B,OAAO;AAAA,MACL,UAAU;AAAA,MACV,UAAU;AAAA,MACV,MAAM;AAAA,MACN,gBAAgBD;AAAA,IAAA;AAAA,IAElB,CAACA,CAAiB;AAAA,EAAA,GAGdO,IAA6B;AAAA,IACjC,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EAAA;AAIV,SAAA,gBAAAC,EAACC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAKxB;AAAA,QACL,UAAAF;AAAA,QACA,OAAOL;AAAA,QACP,YAAAS;AAAA,QACA,YAAYA,IAAaG,IAAgB;AAAA,QAEzC,UAAC,gBAAAgB,EAAAI,GAAA,EAA+B,SAASlB,GACtC,UAAA;AAAA,UACCZ,KAAA,gBAAA4B,EAACG,GAAA,EACC,UAAA,gBAAAH;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,KAAKC,EAAO;AAAA,cACZ,UAAUT;AAAA,cACV,oBAAkB;AAAA,cAClB,eAAe;AAAA,gBACb,MAAM;AAAA,gBACN,UAAU,MAAM;;AACd,mBAAAV,IAAAR,EAAmB,YAAnB,QAAAQ,EAA4B;AAAA,gBAC9B;AAAA,cACF;AAAA,YAAA;AAAA,UAAA,GAEJ;AAAA,4BAEDoB,GAAgB,EAAA,MAAMrC,EAAK,MAAM,aAAaA,EAAK,aAAa;AAAA,UAEjE,gBAAA+B;AAAA,YAACO;AAAAA,YAAA;AAAA,cACC,KAAKtC,EAAK,oBAAoB;AAAA,cAC9B,KAAK,GAAGA,EAAK,IAAI;AAAA,YAAA;AAAA,UACnB;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IACF;AAAA,sBACCuC,GAAA,EACC,UAAC,gBAAAR,EAAAS,GAAA,EACC,UAAA,gBAAAT;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,KAAK1B;AAAA,QACL,KAAK2B,EAAO;AAAA,QACZ,UAAUR;AAAA,MAAA;AAAA,OAEd,EACF,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ,GAEaa,IAAmBC,EAAKC,EAAW5C,CAAyB,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/circular-game-card/constants.ts"],"sourcesContent":["import { GAME_LAUNCHER_SIZE } from '../card-container/constants';\n\nexport const GAME_LAUNCHER_ASSET_PADDING = (GAME_LAUNCHER_SIZE * 17.5) / 100;\n\nexport const BORDER_WIDTH = 2;\n"],"names":["GAME_LAUNCHER_ASSET_PADDING","GAME_LAUNCHER_SIZE","BORDER_WIDTH"],"mappings":";AAEa,MAAAA,IAA+BC,IAAqB,OAAQ,KAE5DC,IAAe;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/game-launcher/comps/game-card-content/constants.ts"],"sourcesContent":["import { GAME_LAUNCHER_SIZE } from '../card-container/constants';\n\nexport const ASSET_CONTAINER_SIZE = Math.ceil((GAME_LAUNCHER_SIZE * 120) / 100);\n"],"names":["ASSET_CONTAINER_SIZE","GAME_LAUNCHER_SIZE"],"mappings":";AAEO,MAAMA,IAAuB,KAAK,KAAMC,IAAqB,MAAO,GAAG;"}
|