@streamlayer/react-ui 0.1.0

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.
Files changed (122) hide show
  1. package/README.md +7 -0
  2. package/package.json +38 -0
  3. package/src/index.d.ts +10 -0
  4. package/src/index.js +11 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/demo/Gamification.d.ts +7 -0
  7. package/src/lib/demo/Gamification.js +21 -0
  8. package/src/lib/demo/Gamification.js.map +1 -0
  9. package/src/lib/demo/Login.d.ts +5 -0
  10. package/src/lib/demo/Login.js +9 -0
  11. package/src/lib/demo/Login.js.map +1 -0
  12. package/src/lib/demo/components/InPlayGame.d.ts +6 -0
  13. package/src/lib/demo/components/InPlayGame.js +6 -0
  14. package/src/lib/demo/components/InPlayGame.js.map +1 -0
  15. package/src/lib/demo/components/Notifications.d.ts +6 -0
  16. package/src/lib/demo/components/Notifications.js +37 -0
  17. package/src/lib/demo/components/Notifications.js.map +1 -0
  18. package/src/lib/demo/components/Question.d.ts +7 -0
  19. package/src/lib/demo/components/Question.js +61 -0
  20. package/src/lib/demo/components/Question.js.map +1 -0
  21. package/src/lib/demo/components/QuestionsList.d.ts +6 -0
  22. package/src/lib/demo/components/QuestionsList.js +13 -0
  23. package/src/lib/demo/components/QuestionsList.js.map +1 -0
  24. package/src/lib/demo/components/UserSummary.d.ts +5 -0
  25. package/src/lib/demo/components/UserSummary.js +11 -0
  26. package/src/lib/demo/components/UserSummary.js.map +1 -0
  27. package/src/lib/demo/components/index.d.ts +5 -0
  28. package/src/lib/demo/components/index.js +6 -0
  29. package/src/lib/demo/components/index.js.map +1 -0
  30. package/src/lib/demo/index.d.ts +5 -0
  31. package/src/lib/demo/index.js +19 -0
  32. package/src/lib/demo/index.js.map +1 -0
  33. package/src/lib/demo/styles.d.ts +13 -0
  34. package/src/lib/demo/styles.js +14 -0
  35. package/src/lib/demo/styles.js.map +1 -0
  36. package/src/lib/gamification/inapp/index.d.ts +13 -0
  37. package/src/lib/gamification/inapp/index.js +12 -0
  38. package/src/lib/gamification/inapp/index.js.map +1 -0
  39. package/src/lib/gamification/inapp/styles.d.ts +37 -0
  40. package/src/lib/gamification/inapp/styles.js +74 -0
  41. package/src/lib/gamification/inapp/styles.js.map +1 -0
  42. package/src/lib/gamification/login/index.d.ts +6 -0
  43. package/src/lib/gamification/login/index.js +49 -0
  44. package/src/lib/gamification/login/index.js.map +1 -0
  45. package/src/lib/gamification/login/styles.d.ts +29 -0
  46. package/src/lib/gamification/login/styles.js +67 -0
  47. package/src/lib/gamification/login/styles.js.map +1 -0
  48. package/src/lib/gamification/onboarding/index.d.ts +6 -0
  49. package/src/lib/gamification/onboarding/index.js +4 -0
  50. package/src/lib/gamification/onboarding/index.js.map +1 -0
  51. package/src/lib/gamification/onboarding/styles.d.ts +21 -0
  52. package/src/lib/gamification/onboarding/styles.js +41 -0
  53. package/src/lib/gamification/onboarding/styles.js.map +1 -0
  54. package/src/lib/gamification/question/index.d.ts +5 -0
  55. package/src/lib/gamification/question/index.js +28 -0
  56. package/src/lib/gamification/question/index.js.map +1 -0
  57. package/src/lib/gamification/question/styles.d.ts +45 -0
  58. package/src/lib/gamification/question/styles.js +80 -0
  59. package/src/lib/gamification/question/styles.js.map +1 -0
  60. package/src/lib/gamification/question-list/index.d.ts +8 -0
  61. package/src/lib/gamification/question-list/index.js +7 -0
  62. package/src/lib/gamification/question-list/index.js.map +1 -0
  63. package/src/lib/gamification/question-list/styles.d.ts +13 -0
  64. package/src/lib/gamification/question-list/styles.js +25 -0
  65. package/src/lib/gamification/question-list/styles.js.map +1 -0
  66. package/src/lib/gamification/user-statistics/components/rank/index.d.ts +7 -0
  67. package/src/lib/gamification/user-statistics/components/rank/index.js +4 -0
  68. package/src/lib/gamification/user-statistics/components/rank/index.js.map +1 -0
  69. package/src/lib/gamification/user-statistics/components/rank/styles.d.ts +13 -0
  70. package/src/lib/gamification/user-statistics/components/rank/styles.js +20 -0
  71. package/src/lib/gamification/user-statistics/components/rank/styles.js.map +1 -0
  72. package/src/lib/gamification/user-statistics/components/statistics/index.d.ts +7 -0
  73. package/src/lib/gamification/user-statistics/components/statistics/index.js +4 -0
  74. package/src/lib/gamification/user-statistics/components/statistics/index.js.map +1 -0
  75. package/src/lib/gamification/user-statistics/components/statistics/styles.d.ts +9 -0
  76. package/src/lib/gamification/user-statistics/components/statistics/styles.js +14 -0
  77. package/src/lib/gamification/user-statistics/components/statistics/styles.js.map +1 -0
  78. package/src/lib/gamification/user-statistics/index.d.ts +15 -0
  79. package/src/lib/gamification/user-statistics/index.js +14 -0
  80. package/src/lib/gamification/user-statistics/index.js.map +1 -0
  81. package/src/lib/gamification/user-statistics/styles.d.ts +57 -0
  82. package/src/lib/gamification/user-statistics/styles.js +98 -0
  83. package/src/lib/gamification/user-statistics/styles.js.map +1 -0
  84. package/src/lib/gamification/vote/components/voting-header/components/points/index.d.ts +6 -0
  85. package/src/lib/gamification/vote/components/voting-header/components/points/index.js +4 -0
  86. package/src/lib/gamification/vote/components/voting-header/components/points/index.js.map +1 -0
  87. package/src/lib/gamification/vote/components/voting-header/components/points/styles.d.ts +21 -0
  88. package/src/lib/gamification/vote/components/voting-header/components/points/styles.js +30 -0
  89. package/src/lib/gamification/vote/components/voting-header/components/points/styles.js.map +1 -0
  90. package/src/lib/gamification/vote/components/voting-header/components/timer/index.d.ts +8 -0
  91. package/src/lib/gamification/vote/components/voting-header/components/timer/index.js +19 -0
  92. package/src/lib/gamification/vote/components/voting-header/components/timer/index.js.map +1 -0
  93. package/src/lib/gamification/vote/components/voting-header/components/timer/styles.d.ts +7 -0
  94. package/src/lib/gamification/vote/components/voting-header/components/timer/styles.js +6 -0
  95. package/src/lib/gamification/vote/components/voting-header/components/timer/styles.js.map +1 -0
  96. package/src/lib/gamification/vote/components/voting-header/index.d.ts +12 -0
  97. package/src/lib/gamification/vote/components/voting-header/index.js +17 -0
  98. package/src/lib/gamification/vote/components/voting-header/index.js.map +1 -0
  99. package/src/lib/gamification/vote/components/voting-header/styles.d.ts +35 -0
  100. package/src/lib/gamification/vote/components/voting-header/styles.js +54 -0
  101. package/src/lib/gamification/vote/components/voting-header/styles.js.map +1 -0
  102. package/src/lib/gamification/vote/components/voting-option/index.d.ts +16 -0
  103. package/src/lib/gamification/vote/components/voting-option/index.js +11 -0
  104. package/src/lib/gamification/vote/components/voting-option/index.js.map +1 -0
  105. package/src/lib/gamification/vote/components/voting-option/styles.d.ts +49 -0
  106. package/src/lib/gamification/vote/components/voting-option/styles.js +85 -0
  107. package/src/lib/gamification/vote/components/voting-option/styles.js.map +1 -0
  108. package/src/lib/gamification/vote/index.d.ts +13 -0
  109. package/src/lib/gamification/vote/index.js +14 -0
  110. package/src/lib/gamification/vote/index.js.map +1 -0
  111. package/src/lib/gamification/vote/styles.d.ts +29 -0
  112. package/src/lib/gamification/vote/styles.js +50 -0
  113. package/src/lib/gamification/vote/styles.js.map +1 -0
  114. package/src/lib/theme/index.d.ts +4 -0
  115. package/src/lib/theme/index.js +5 -0
  116. package/src/lib/theme/index.js.map +1 -0
  117. package/src/lib/theme/theme.d.ts +41 -0
  118. package/src/lib/theme/theme.js +35 -0
  119. package/src/lib/theme/theme.js.map +1 -0
  120. package/src/utils/login.d.ts +2 -0
  121. package/src/utils/login.js +20 -0
  122. package/src/utils/login.js.map +1 -0
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import trophyIcon from '../../../assets/icons/icon-trophy.svg';
3
+ import { Statistics } from './components/statistics';
4
+ import { Rank } from './components/rank';
5
+ import { Container, TopInfo, BottomInfo, User, Avatar, UserInfo, UserName, UserRating, TrophyIcon, Rts, RtsIndicator, Top, Ranks, AvatarPlaceholder, } from './styles';
6
+ const abbreviate = (name) => name
7
+ .split(/\s+/)
8
+ .map((p) => p[0])
9
+ .join('')
10
+ .toUpperCase();
11
+ export const UserStatistics = ({ avatar, name, points, grade, friendsRank, globalRank, winStreak, correct, incorrect, successRate, }) => {
12
+ return (_jsxs(Container, { children: [_jsxs(TopInfo, { children: [_jsxs(User, { children: [avatar && _jsx(Avatar, { alt: "avatar", src: avatar }), !avatar && _jsx(AvatarPlaceholder, { children: abbreviate(name) }), _jsxs(UserInfo, { children: [_jsx(UserName, { children: name }), _jsxs(UserRating, { children: [_jsx(TrophyIcon, { alt: "rank-icon", src: trophyIcon }), _jsxs(Rts, { children: [_jsx(RtsIndicator, { children: points || '-' }), "RTS"] }), _jsxs(Top, { children: ["TOP ", grade, "%"] })] })] })] }), _jsxs(Ranks, { children: [_jsx(Rank, { title: "Friens rank", indicator: friendsRank || '-' }), _jsx(Rank, { title: "Global rank", indicator: globalRank || '-' })] })] }), _jsxs(BottomInfo, { children: [_jsx(Statistics, { indicator: winStreak || '-', title: "Win streak" }), _jsx(Statistics, { indicator: correct || '-', title: "Correct" }), _jsx(Statistics, { indicator: incorrect || '-', title: "Incorrect" }), _jsx(Statistics, { indicator: `${successRate || '-'}%`, title: "Success rate" })] })] }));
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/user-statistics/index.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,uCAAuC,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EACL,SAAS,EACT,OAAO,EACP,UAAU,EACV,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,GAAG,EACH,YAAY,EACZ,GAAG,EACH,KAAK,EACL,iBAAiB,GAClB,MAAM,UAAU,CAAA;AAejB,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE,CAClC,IAAI;KACD,KAAK,CAAC,KAAK,CAAC;KACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE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AAC,UAAU,IAAC,SAAS,EAAE,GAAG,WAAW,IAAI,GAAG,GAAG,EAAE,KAAK,EAAC,cAAc,GAAG,IAC7D,IACH,CACb,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,57 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const TopInfo: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const BottomInfo: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
+ export declare const User: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
+ export declare const Avatar: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any> | undefined;
21
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
22
+ export declare const UserInfo: import("@emotion/styled").StyledComponent<{
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ as?: import("react").ElementType<any> | undefined;
25
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const UserName: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any> | undefined;
29
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
30
+ export declare const UserRating: import("@emotion/styled").StyledComponent<{
31
+ theme?: import("@emotion/react").Theme | undefined;
32
+ as?: import("react").ElementType<any> | undefined;
33
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
34
+ export declare const TrophyIcon: import("@emotion/styled").StyledComponent<{
35
+ theme?: import("@emotion/react").Theme | undefined;
36
+ as?: import("react").ElementType<any> | undefined;
37
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
38
+ export declare const Rts: import("@emotion/styled").StyledComponent<{
39
+ theme?: import("@emotion/react").Theme | undefined;
40
+ as?: import("react").ElementType<any> | undefined;
41
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
42
+ export declare const RtsIndicator: import("@emotion/styled").StyledComponent<{
43
+ theme?: import("@emotion/react").Theme | undefined;
44
+ as?: import("react").ElementType<any> | undefined;
45
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
46
+ export declare const Top: import("@emotion/styled").StyledComponent<{
47
+ theme?: import("@emotion/react").Theme | undefined;
48
+ as?: import("react").ElementType<any> | undefined;
49
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
50
+ export declare const Ranks: import("@emotion/styled").StyledComponent<{
51
+ theme?: import("@emotion/react").Theme | undefined;
52
+ as?: import("react").ElementType<any> | undefined;
53
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
54
+ export declare const AvatarPlaceholder: import("@emotion/styled").StyledComponent<{
55
+ theme?: import("@emotion/react").Theme | undefined;
56
+ as?: import("react").ElementType<any> | undefined;
57
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,98 @@
1
+ import styled from '@emotion/styled';
2
+ export const Container = styled.div `
3
+ background-color: ${(props) => props.theme.COLORS.BG_TRANSPARENT_USER_CONTAINER};
4
+ border-radius: 12px;
5
+ color: ${(props) => props.theme.COLORS.GREY_PRIMARY};
6
+ font-size: 10px;
7
+ font-weight: 600;
8
+ `;
9
+ export const TopInfo = styled.div `
10
+ padding: 12px;
11
+ border-bottom: ${(props) => `1px solid ${props.theme.COLORS.DIVIDER_COLOR_PRIMARY}`};
12
+ display: flex;
13
+ justify-content: space-between;
14
+ align-items: center;
15
+ column-gap: 5px;
16
+ `;
17
+ export const BottomInfo = styled.div `
18
+ padding: 12px 16px;
19
+ text-transform: uppercase;
20
+ display: flex;
21
+ justify-content: space-between;
22
+ column-gap: 16px;
23
+ `;
24
+ export const User = styled.div `
25
+ display: flex;
26
+ column-gap: 8px;
27
+ flex: 1;
28
+ overflow: hidden;
29
+ `;
30
+ export const Avatar = styled.img `
31
+ width: 100%;
32
+ height: 100%;
33
+ max-width: 48px;
34
+ max-height: 48px;
35
+ border-radius: 50%;
36
+ object-fit: cover;
37
+ object-position: center;
38
+ flex-shrink: 0;
39
+ `;
40
+ export const UserInfo = styled.div `
41
+ padding-top: 4px;
42
+ display: flex;
43
+ flex-direction: column;
44
+ row-gap: 4px;
45
+ overflow: hidden;
46
+ `;
47
+ export const UserName = styled.div `
48
+ font-size: 18px;
49
+ color: ${(props) => props.theme.COLORS.WHITE};
50
+ overflow: hidden;
51
+ text-overflow: ellipsis;
52
+ white-space: nowrap;
53
+ `;
54
+ export const UserRating = styled.div `
55
+ text-transform: uppercase;
56
+ display: flex;
57
+ align-items: center;
58
+ `;
59
+ export const TrophyIcon = styled.img `
60
+ width: 12px;
61
+ height: 12px;
62
+ margin-right: 4px;
63
+ `;
64
+ export const Rts = styled.div `
65
+ display: flex;
66
+ align-items: center;
67
+ column-gap: 4px;
68
+ border-right: ${(props) => `1px solid ${props.theme.COLORS.DIVIDER_COLOR_SECONDARY}`};
69
+ padding-right: 5px;
70
+ `;
71
+ export const RtsIndicator = styled.div `
72
+ font-size: 14px;
73
+ color: ${(props) => props.theme.COLORS.WHITE};
74
+ `;
75
+ export const Top = styled.div `
76
+ padding-left: 5px;
77
+ `;
78
+ export const Ranks = styled.div `
79
+ text-transform: uppercase;
80
+ display: flex;
81
+ flex-direction: column;
82
+ row-gap: 4px;
83
+ `;
84
+ export const AvatarPlaceholder = styled.div `
85
+ background: #2d6ffd;
86
+ border-radius: 50%;
87
+ width: 48px;
88
+ height: 48px;
89
+ text-align: center;
90
+ text-transform: uppercase;
91
+ display: flex;
92
+ align-items: center;
93
+ justify-content: center;
94
+ color: #fff;
95
+ font-size: 18px;
96
+ flex-shrink: 0;
97
+ `;
98
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../packages/react-ui/src/lib/gamification/user-statistics/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;sBACb,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,6BAA6B;;WAEtE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY;;;CAGpD,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;mBAEd,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,EAAE;;;;;CAKpF,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMnC,CAAA;AAED,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
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { Container, Point, PointContainer, PointLabel, Title } from './styles';
3
+ export const Points = ({ points }) => (_jsxs(Container, { children: [_jsx(Title, { children: "YOU WON" }), _jsxs(PointContainer, { children: [_jsx(Point, { children: points }), _jsx(PointLabel, { children: "PTS" })] })] }));
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../../packages/react-ui/src/lib/gamification/vote/components/voting-header/components/points/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAM9E,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAC3D,MAAC,SAAS,eACR,KAAC,KAAK,0BAAgB,EACtB,MAAC,cAAc,eACb,KAAC,KAAK,cAAE,MAAM,GAAS,EACvB,KAAC,UAAU,sBAAiB,IACb,IACP,CACb,CAAA"}
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const Title: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const PointContainer: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
+ export declare const Point: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
18
+ export declare const PointLabel: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any> | undefined;
21
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -0,0 +1,30 @@
1
+ import styled from '@emotion/styled';
2
+ export const Container = styled.div `
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: flex-end;
6
+ margin-right: 10px;
7
+ font-weight: 700;
8
+ `;
9
+ export const Title = styled.div `
10
+ color: rgba(255, 255, 255, 0.8);
11
+ font-size: 8px;
12
+ line-height: 12px;
13
+ text-align: right;
14
+ `;
15
+ export const PointContainer = styled.div `
16
+ text-align: right;
17
+ `;
18
+ export const Point = styled.span `
19
+ color: rgba(255, 255, 255, 0.9);
20
+ font-size: 14px;
21
+ line-height: 16px;
22
+ margin-right: 2px;
23
+ `;
24
+ export const PointLabel = styled.span `
25
+ color: white;
26
+ font-size: 10px;
27
+ font-weight: 600;
28
+ line-height: 16px;
29
+ `;
30
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../../../../../packages/react-ui/src/lib/gamification/vote/components/voting-header/components/points/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMlC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAK9B,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;CAK/B,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;CAKpC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface TimerProps {
3
+ isPlaying?: boolean;
4
+ duration?: number;
5
+ setTimeToExpire: (flag: boolean) => void;
6
+ }
7
+ export declare const Timer: React.FC<TimerProps>;
8
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { useEffect } from 'react';
3
+ import { CountdownCircleTimer } from 'react-countdown-circle-timer';
4
+ import { theme } from '../../../../../../theme/theme';
5
+ import { RemainingTime } from './styles';
6
+ const TIMER_COLORS = [theme.COLORS.BLUE_PRIMARY, theme.COLORS.GREEN_1, theme.COLORS.RED_1];
7
+ const TIMER_COLORS_TIME = [10, 6, 0];
8
+ const DEFAULT_DURATION = 30;
9
+ const TIMER_SIZE = 32;
10
+ const STROKE_WIDTH = 4;
11
+ const TRAIL_STROKE_WIDTH = 0;
12
+ export const Timer = ({ isPlaying = true, duration = DEFAULT_DURATION, setTimeToExpire }) => {
13
+ const renderTime = ({ remainingTime }) => (_jsx(RemainingTime, { remainingTime: remainingTime, children: remainingTime }));
14
+ useEffect(() => {
15
+ setTimeToExpire(false);
16
+ }, [setTimeToExpire]);
17
+ return (_jsx(CountdownCircleTimer, { isPlaying: isPlaying, duration: duration, colors: TIMER_COLORS, colorsTime: TIMER_COLORS_TIME, size: TIMER_SIZE, strokeWidth: STROKE_WIDTH, trailStrokeWidth: TRAIL_STROKE_WIDTH, onComplete: () => setTimeToExpire(true), children: renderTime }));
18
+ };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../../packages/react-ui/src/lib/gamification/vote/components/voting-header/components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e,CAAC,IAAI,CAAC,YAEtC,UAAU,GACU,CACxB,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const RemainingTime: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ } & {
6
+ remainingTime: number;
7
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,6 @@
1
+ import styled from '@emotion/styled';
2
+ export const RemainingTime = styled.div `
3
+ color: ${(props) => (props.remainingTime ? 'inherit' : props.theme.COLORS.RED_2)};
4
+ font-size: 12px;
5
+ `;
6
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../../../../../packages/react-ui/src/lib/gamification/vote/components/voting-header/components/timer/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAA2B;WACvD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;;CAEjF,CAAA"}
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { QuestionType } from '@streamlayer/sdk-web-types';
3
+ export interface VotingHeaderProps {
4
+ points: number;
5
+ questionAnswered: boolean;
6
+ questionAnsweredCorrectly?: boolean;
7
+ logo: string;
8
+ questionType: QuestionType;
9
+ closeQuestion: () => void;
10
+ setTimeToExpire: (flag: boolean) => void;
11
+ }
12
+ export declare const VotingHeader: React.FC<VotingHeaderProps>;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { QuestionType } from '@streamlayer/sdk-web-types';
3
+ import iconTrophyGreen from '../../../../../assets/icons/icon-trophy-green.svg';
4
+ import iconThumbDown from '../../../../../assets/icons/icon-thumb-down.svg';
5
+ import iconExit from '../../../../../assets/icons/icon-exit.svg';
6
+ import { Timer } from '../../components/voting-header/components/timer';
7
+ import { Container, Logo, ReactionIconWrap, ReactionIcon, RightBlock, Interactive, ExitBtn, ExitIcon } from './styles';
8
+ import { Points } from './components/points';
9
+ export const VotingHeader = ({ logo, points, questionAnswered, questionAnsweredCorrectly, questionType, closeQuestion, setTimeToExpire, }) => {
10
+ const isShowTimer = !questionAnswered && questionType !== QuestionType.PREDICTION;
11
+ const isShowTriviaFeedback = questionAnswered && questionType === QuestionType.TRIVIA;
12
+ const successTriviaFeedback = isShowTriviaFeedback && questionAnsweredCorrectly;
13
+ const errorTriviaFeedback = isShowTriviaFeedback && !questionAnsweredCorrectly;
14
+ const isShowPredictionFeedback = questionAnswered && questionType === QuestionType.PREDICTION;
15
+ return (_jsxs(Container, { children: [_jsxs(RightBlock, { children: [_jsxs(Interactive, { children: [isShowTimer && _jsx(Timer, { setTimeToExpire: setTimeToExpire }), successTriviaFeedback && (_jsxs(_Fragment, { children: [_jsx(Points, { points: points }), _jsx(ReactionIconWrap, { isSuccess: true, children: _jsx(ReactionIcon, { alt: "reaction-icon", src: iconTrophyGreen }) })] })), errorTriviaFeedback && (_jsxs(_Fragment, { children: [_jsx(Points, { points: 0 }), _jsx(ReactionIconWrap, { isSuccess: false, children: _jsx(ReactionIcon, { alt: "reaction-icon", src: iconThumbDown }) })] })), isShowPredictionFeedback && _jsx(Points, { points: points })] }), _jsx(ExitBtn, { onClick: closeQuestion, children: _jsx(ExitIcon, { alt: "exit-icon", src: iconExit }) })] }), logo && _jsx(Logo, { src: logo })] }));
16
+ };
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-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G,EAAC,eAAe,EAAC,GAAG,EAAE,eAAe,GAAI,GACzC,IAClB,CACJ,EACA,mBAAmB,IAAI,CACtB,8BACE,KAAC,MAAM,IAAC,MAAM,EAAE,CAAC,GAAI,EACrB,KAAC,gBAAgB,IAAC,SAAS,EAAE,KAAK,YAChC,KAAC,YAAY,IAAC,GAAG,EAAC,eAAe,EAAC,GAAG,EAAE,aAAa,GAAI,GACvC,IAClB,CACJ,EACA,wBAAwB,IAAI,KAAC,MAAM,IAAC,MAAM,EAAE,MAAM,GAAI,IAC3C,EACd,KAAC,OAAO,IAAC,OAAO,EAAE,aAAa,YAC7B,KAAC,QAAQ,IAAC,GAAG,EAAC,WAAW,EAAC,GAAG,EAAE,QAAQ,GAAa,GAC5C,IACC,EACZ,IAAI,IAAI,KAAC,IAAI,IAAC,GAAG,EAAE,IAAI,GAAI,IAClB,CACb,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,35 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const Logo: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
10
+ export declare const RightBlock: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
+ export declare const ExitBtn: import("@emotion/styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any> | undefined;
17
+ }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
18
+ export declare const ExitIcon: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any> | undefined;
21
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
22
+ export declare const Interactive: import("@emotion/styled").StyledComponent<{
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ as?: import("react").ElementType<any> | undefined;
25
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const ReactionIconWrap: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any> | undefined;
29
+ } & {
30
+ isSuccess: boolean;
31
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
32
+ export declare const ReactionIcon: import("@emotion/styled").StyledComponent<{
33
+ theme?: import("@emotion/react").Theme | undefined;
34
+ as?: import("react").ElementType<any> | undefined;
35
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
@@ -0,0 +1,54 @@
1
+ import styled from '@emotion/styled';
2
+ export const Container = styled.div `
3
+ box-sizing: border-box;
4
+ background-color: transparent;
5
+ color: ${(props) => props.theme.COLORS.WHITE};
6
+ display: flex;
7
+ flex-direction: row-reverse;
8
+ justify-content: space-between;
9
+ padding: 0px 16px;
10
+ align-items: center;
11
+ `;
12
+ export const Logo = styled.img `
13
+ width: 60px;
14
+ height: 80%;
15
+ `;
16
+ export const RightBlock = styled.div `
17
+ display: flex;
18
+ align-items: center;
19
+ `;
20
+ export const ExitBtn = styled.button `
21
+ border: none;
22
+ outline: none;
23
+ background-color: transparent;
24
+ border-radius: 50%;
25
+ padding: 0px;
26
+ width: 24px;
27
+ height: 24px;
28
+ margin-left: 25px;
29
+ cursor: pointer;
30
+ `;
31
+ export const ExitIcon = styled.img `
32
+ width: 24px;
33
+ height: 24px;
34
+ `;
35
+ export const Interactive = styled.div `
36
+ display: flex;
37
+ align-items: center;
38
+ padding: 4px 0px;
39
+ margin-left: 10px;
40
+ `;
41
+ export const ReactionIconWrap = styled.div `
42
+ background-color: ${(props) => (props.isSuccess ? '#f1be1c' : '#da3732')};
43
+ width: 32px;
44
+ height: 32px;
45
+ border-radius: 50%;
46
+ display: flex;
47
+ justify-content: center;
48
+ align-items: center;
49
+ `;
50
+ export const ReactionIcon = styled.img `
51
+ width: 20px;
52
+ height: 20px;
53
+ `;
54
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-ui/src/lib/gamification/vote/components/voting-header/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;WAGxB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;;;CAM7C,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG7B,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGnC,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;;;;CAUnC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGjC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKpC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAwB;sBAC5C,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;;;;;;;CAOzE,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGrC,CAAA"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ interface VotingOptionProps {
3
+ icon: string;
4
+ title: string;
5
+ id: string;
6
+ questionId: string;
7
+ percentage: number;
8
+ disabled: boolean;
9
+ correct: boolean;
10
+ questionAnswered: boolean;
11
+ hasCorrectAnswer: boolean;
12
+ answered: boolean;
13
+ onVote: (questionId: string, answerId: string) => void;
14
+ }
15
+ export declare const VotingOption: React.FC<VotingOptionProps>;
16
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import checkIconGreen from '../../../../../assets/icons/icon-check.svg';
3
+ import checkIconWhite from '../../../../../assets/icons/icon-check-white.svg';
4
+ import { Container, AnsweredContainer, ButtonPct, Icon, Title, Percentage, Button, Indicators, CheckIconWrap, CheckIcon, } from './styles';
5
+ export const VotingOption = ({ icon, id, title, questionId, disabled, percentage, onVote, correct, questionAnswered, hasCorrectAnswer, answered, }) => {
6
+ if (questionAnswered && answered) {
7
+ return (_jsxs(AnsweredContainer, { answeredCorrect: !hasCorrectAnswer || correct, questionAnswered: false, children: [_jsx(ButtonPct, { style: { width: `${percentage}%` } }), _jsxs(Button, { disabled: disabled, onClick: () => onVote(questionId, id), children: [icon && _jsx(Icon, { alt: "option-icon", src: icon }), _jsx(Title, { children: title }), _jsxs(Indicators, { children: [hasCorrectAnswer && correct && (_jsx(CheckIconWrap, { children: _jsx(CheckIcon, { alt: "icon-correct", src: answered ? checkIconWhite : checkIconGreen }) })), _jsxs(Percentage, { children: [percentage, "%"] })] })] })] }));
8
+ }
9
+ return (_jsxs(Container, { questionAnswered: questionAnswered, children: [questionAnswered && _jsx(ButtonPct, { style: { width: `${percentage}%` } }), _jsxs(Button, { disabled: disabled, onClick: () => onVote(questionId, id), children: [icon && _jsx(Icon, { alt: "option-icon", src: icon }), _jsx(Title, { children: title }), questionAnswered && (_jsxs(Indicators, { children: [hasCorrectAnswer && correct && (_jsx(CheckIconWrap, { children: _jsx(CheckIcon, { alt: "icon-correct", src: answered ? checkIconWhite : checkIconGreen }) })), _jsxs(Percentage, { children: [percentage, "%"] })] }))] })] }));
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-ui/src/lib/gamification/vote/components/voting-option/index.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,MAAM,4CAA4C,CAAA;AACvE,OAAO,cAAc,MAAM,kDAAkD,CAAA;AAE7E,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,IAAI,EACJ,KAAK,EACL,UAAU,EACV,MAAM,EACN,UAAU,EACV,aAAa,EACb,SAAS,GACV,MAAM,UAAU,CAAA;AAgBjB,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EACxD,IAAI,EACJ,EAAE,EACF,KAAK,EACL,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,GACT,EAAE,EAAE;IACH,IAAI,gBAAgB,IAAI,QAAQ,EAAE;QAChC,OAAO,CACL,MAAC,iBAAiB,IAAC,eAAe,EAAE,CAAC,gBAAgB,IAAI,OAAO,EAAE,gBAAgB,EAAE,KAAK,aACvF,KAAC,SAAS,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,UAAU,GAAG,EAAE,GAAI,EACjD,MAAC,MAAM,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,aAC9D,IAAI,IAAI,KAAC,IAAI,IAAC,GAAG,EAAC,aAAa,EAAC,GAAG,EAAE,IAAI,GAAI,EAC9C,KAAC,KAAK,cAAE,KAAK,GAAS,EACtB,MAAC,UAAU,eACR,gBAAgB,IAAI,OAAO,IAAI,CAC9B,KAAC,aAAa,cACZ,KAAC,SAAS,IAAC,GAAG,EAAC,cAAc,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,GAAI,GACnE,CACjB,EACD,MAAC,UAAU,eAAE,UAAU,SAAe,IAC3B,IACN,IACS,CACrB,CAAA;KACF;IAED,OAAO,CACL,MAAC,SAAS,IAAC,gBAAgB,EAAE,gBAAgB,aAC1C,gBAAgB,IAAI,KAAC,SAAS,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,UAAU,GAAG,EAAE,GAAI,EACtE,MAAC,MAAM,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,aAC9D,IAAI,IAAI,KAAC,IAAI,IAAC,GAAG,EAAC,aAAa,EAAC,GAAG,EAAE,IAAI,GAAI,EAC9C,KAAC,KAAK,cAAE,KAAK,GAAS,EACrB,gBAAgB,IAAI,CACnB,MAAC,UAAU,eACR,gBAAgB,IAAI,OAAO,IAAI,CAC9B,KAAC,aAAa,cACZ,KAAC,SAAS,IAAC,GAAG,EAAC,cAAc,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,GAAI,GACnE,CACjB,EACD,MAAC,UAAU,eAAE,UAAU,SAAe,IAC3B,CACd,IACM,IACC,CACb,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,49 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ } & {
6
+ questionAnswered: boolean;
7
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
+ export declare const AnsweredContainer: import("@emotion/styled").StyledComponent<{
9
+ theme?: import("@emotion/react").Theme | undefined;
10
+ as?: import("react").ElementType<any> | undefined;
11
+ } & {
12
+ questionAnswered: boolean;
13
+ } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
14
+ theme?: import("@emotion/react").Theme | undefined;
15
+ } & {
16
+ answeredCorrect: boolean;
17
+ }, {}, {}>;
18
+ export declare const ButtonPct: import("@emotion/styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any> | undefined;
21
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
22
+ export declare const Button: import("@emotion/styled").StyledComponent<{
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ as?: import("react").ElementType<any> | undefined;
25
+ }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
26
+ export declare const Icon: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any> | undefined;
29
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
30
+ export declare const Title: import("@emotion/styled").StyledComponent<{
31
+ theme?: import("@emotion/react").Theme | undefined;
32
+ as?: import("react").ElementType<any> | undefined;
33
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
34
+ export declare const Indicators: import("@emotion/styled").StyledComponent<{
35
+ theme?: import("@emotion/react").Theme | undefined;
36
+ as?: import("react").ElementType<any> | undefined;
37
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
38
+ export declare const CheckIconWrap: import("@emotion/styled").StyledComponent<{
39
+ theme?: import("@emotion/react").Theme | undefined;
40
+ as?: import("react").ElementType<any> | undefined;
41
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
42
+ export declare const Percentage: import("@emotion/styled").StyledComponent<{
43
+ theme?: import("@emotion/react").Theme | undefined;
44
+ as?: import("react").ElementType<any> | undefined;
45
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
46
+ export declare const CheckIcon: import("@emotion/styled").StyledComponent<{
47
+ theme?: import("@emotion/react").Theme | undefined;
48
+ as?: import("react").ElementType<any> | undefined;
49
+ }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
@@ -0,0 +1,85 @@
1
+ import styled from '@emotion/styled';
2
+ export const Container = styled.div `
3
+ box-sizing: border-box;
4
+ border-radius: 4px;
5
+ height: 44px;
6
+ background-color: ${(props) => props.theme.COLORS.BG_TRANSPARENT_ITEM_VOTE};
7
+ border: 2px solid transparent;
8
+ position: relative;
9
+
10
+ ${(props) => !props.questionAnswered &&
11
+ `
12
+ &:hover {
13
+ border-color: inherit;
14
+ }
15
+ `}
16
+ `;
17
+ export const AnsweredContainer = styled(Container) `
18
+ background-color: ${({ answeredCorrect, theme }) => answeredCorrect ? theme.COLORS.BG_TRANSPARENT_ITEM_SUCCESS : theme.COLORS.BG_TRANSPARENT_ITEM_ERROR};
19
+ border: 2px solid;
20
+ border-color: ${({ answeredCorrect, theme }) => answeredCorrect ? theme.COLORS.BLUE_PRIMARY : theme.COLORS.RED_PRIMARY};
21
+
22
+ &:hover {
23
+ border-color: ${({ answeredCorrect, theme }) => answeredCorrect ? theme.COLORS.BLUE_PRIMARY : theme.COLORS.RED_PRIMARY};
24
+ }
25
+ `;
26
+ export const ButtonPct = styled.div `
27
+ position: absolute;
28
+ left: 0;
29
+ border-radius: 2px;
30
+ z-index: 0;
31
+ height: 100%;
32
+ background-color: inherit;
33
+ transition: all 1s ease-in;
34
+ `;
35
+ export const Button = styled.button `
36
+ border-radius: 20px;
37
+ position: relative;
38
+ background-color: transparent;
39
+ padding: 0px 16px;
40
+ display: flex;
41
+ align-items: center;
42
+ border: none;
43
+ outline: none;
44
+ width: 100%;
45
+ color: ${(props) => props.theme.COLORS.WHITE};
46
+ font-weight: 700;
47
+ font-size: 14px;
48
+ height: 100%;
49
+ border-radius: 2px;
50
+ cursor: pointer;
51
+
52
+ &:disabled {
53
+ cursor: default;
54
+ }
55
+ `;
56
+ export const Icon = styled.img `
57
+ width: 32px;
58
+ height: 32px;
59
+ border-radius: 50%;
60
+ margin-right: 8px;
61
+ `;
62
+ export const Title = styled.span `
63
+ overflow: hidden;
64
+ text-overflow: ellipsis;
65
+ white-space: nowrap;
66
+ padding: 8px 0px;
67
+ flex: 1;
68
+ text-align: left;
69
+ `;
70
+ export const Indicators = styled.span `
71
+ display: flex;
72
+ `;
73
+ export const CheckIconWrap = styled.div `
74
+ width: 16px;
75
+ height: 16px;
76
+ margin-left: 8px;
77
+ `;
78
+ export const Percentage = styled.div `
79
+ margin-left: 12px;
80
+ `;
81
+ export const CheckIcon = styled.img `
82
+ width: 16px;
83
+ height: 16px;
84
+ `;
85
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-ui/src/lib/gamification/vote/components/voting-option/styles.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAA+B;;;;sBAI5C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,wBAAwB;;;;IAIxE,CAAC,KAAK,EAAE,EAAE,CACV,CAAC,KAAK,CAAC,gBAAgB;IACvB;;;;GAID;CACF,CAAA;AAED,MAAM,CAAC,MAAM,iB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