@streamlayer/react-ui 0.62.0 → 0.64.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 (25) hide show
  1. package/lib/ui/app/Features/Gamification/Friends.d.ts +5 -0
  2. package/lib/ui/app/Features/Gamification/Friends.js +33 -0
  3. package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +1 -2
  4. package/lib/ui/app/Features/Gamification/Leaderboard.js +17 -7
  5. package/lib/ui/app/Features/Gamification/Tabs.js +15 -12
  6. package/lib/ui/app/Features/Gamification/index.js +6 -3
  7. package/lib/ui/app/Notifications/Onboarding/index.js +10 -10
  8. package/lib/ui/app/Notifications/index.js +6 -2
  9. package/lib/ui/app/Notifications/styles.js +3 -3
  10. package/lib/ui/app/masters.js +6 -2
  11. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +1 -0
  12. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +19 -18
  13. package/lib/ui/gamification/question/notification/index.js +20 -16
  14. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.d.ts +5 -0
  15. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +42 -0
  16. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/styles.d.ts +45 -0
  17. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/styles.js +165 -0
  18. package/lib/ui/gamification/question/notification/prediction-result/index.d.ts +4 -2
  19. package/lib/ui/gamification/question/notification/prediction-result/index.js +75 -4
  20. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +12 -1
  21. package/lib/ui/gamification/question/notification/prediction-result/styles.js +124 -4
  22. package/lib/ui/gamification/question/notification/styles.js +2 -2
  23. package/lib/ui/icons/index.d.ts +1 -0
  24. package/lib/ui/icons/index.js +51 -50
  25. package/package.json +6 -6
@@ -0,0 +1,165 @@
1
+ import { styled as s } from "@linaria/react";
2
+ const o = s.div`
3
+ height: 100%;
4
+ width: 100%;
5
+ position: absolute;
6
+ top: -1px;
7
+ left: 0;
8
+ z-index: 1;
9
+ display: none;
10
+
11
+ &[data-active='true'] {
12
+ display: block;
13
+
14
+ & > div {
15
+ &:nth-child(1) {
16
+ animation: showLines 1000ms 50ms ease-out forwards, hiddenLines 1500ms 4500ms ease-in forwards;
17
+ }
18
+
19
+ &:nth-child(2) {
20
+ animation: showLines 700ms 500ms ease-out forwards, hiddenLines 1000ms 5000ms ease-in forwards;
21
+ }
22
+
23
+ &:nth-child(3) {
24
+ animation: showLines 500ms 700ms ease-out forwards, hiddenLines 700ms 5300ms ease-in forwards;
25
+ }
26
+
27
+ &:nth-child(4) {
28
+ animation: showLines 400ms 1000ms ease-out forwards, hiddenLines 500ms 5500ms ease-in forwards;
29
+ }
30
+ }
31
+
32
+ &[data-first-screen='true'] {
33
+ & > div {
34
+ &:nth-child(1) {
35
+ animation: showLines 1000ms 1000ms ease-out forwards, hiddenLines 1500ms 4500ms ease-in forwards;
36
+ }
37
+
38
+ &:nth-child(2) {
39
+ animation: showLines 700ms 1400ms ease-out forwards, hiddenLines 1000ms 5000ms ease-in forwards;
40
+ }
41
+
42
+ &:nth-child(3) {
43
+ animation: showLines 500ms 1700ms ease-out forwards, hiddenLines 700ms 5300ms ease-in forwards;
44
+ }
45
+ }
46
+ }
47
+
48
+ &[data-last-screen='true'] {
49
+ & > div {
50
+ &:nth-child(1) {
51
+ animation: showLines 1000ms 50ms ease-out forwards;
52
+ }
53
+
54
+ &:nth-child(2) {
55
+ animation: showLines 700ms 500ms ease-out forwards;
56
+ }
57
+
58
+ &:nth-child(3) {
59
+ animation: showLines 500ms 700ms ease-out forwards;
60
+ }
61
+
62
+ &:nth-child(4) {
63
+ animation: showLines 400ms 1000ms ease-out forwards;
64
+ }
65
+ }
66
+ }
67
+ }
68
+
69
+ & > div {
70
+ background-color: var(--color-white);
71
+ }
72
+
73
+ &[data-correct='true'] {
74
+ & > div {
75
+ background-color: var(--color-primary-green2);
76
+ }
77
+ }
78
+
79
+ &[data-correct='false'] {
80
+ & > div {
81
+ background-color: var(--color-neutrals-gray6);
82
+ }
83
+ }
84
+
85
+ @keyframes showLines {
86
+ 0% {
87
+ transform: translateX(400px) rotate(137deg);
88
+ }
89
+
90
+ 100% {
91
+ transform: translateX(0px) rotate(137deg);
92
+ }
93
+ }
94
+
95
+ @keyframes hiddenLines {
96
+ 0% {
97
+ width: 1000px;
98
+ }
99
+
100
+ 100% {
101
+ width: 2000px;
102
+ opacity: 0;
103
+ }
104
+ }
105
+ `, e = s.div`
106
+ position: absolute;
107
+ opacity: 0.05;
108
+ height: 1000px;
109
+ width: 1000px;
110
+ bottom: -580px;
111
+ transform: translateX(400px) rotate(137deg);
112
+ `, n = s(e)`
113
+ right: -818px;
114
+ `, t = s(e)`
115
+ right: -902px;
116
+ `, r = s(e)`
117
+ right: -997px;
118
+ `, a = s(e)`
119
+ right: -891px;
120
+ `, h = s(e)`
121
+ right: -942px;
122
+ `, d = s(e)`
123
+ right: -996px;
124
+ `, m = s(e)`
125
+ right: -931px;
126
+ `, c = s(e)`
127
+ right: -981px;
128
+ opacity: 0.1;
129
+ `, w = s(e)`
130
+ right: -1035px;
131
+ opacity: 0.15;
132
+ `, p = s(e)`
133
+ right: -1088px;
134
+ opacity: 0.2;
135
+ `, L = s(e)`
136
+ right: -931px;
137
+ opacity: 0.1;
138
+ `, l = s(e)`
139
+ right: -981px;
140
+ opacity: 0.1;
141
+ `, f = s(e)`
142
+ right: -1035px;
143
+ opacity: 0.1;
144
+ `, u = s(e)`
145
+ right: -1088px;
146
+ opacity: 0.1;
147
+ `;
148
+ export {
149
+ u as BGFourLineFour,
150
+ L as BGFourLineOne,
151
+ f as BGFourLineThree,
152
+ l as BGFourLineTwo,
153
+ e as BGLineBase,
154
+ n as BGOneLineOne,
155
+ r as BGOneLineThree,
156
+ t as BGOneLineTwo,
157
+ p as BGThreeLineFour,
158
+ m as BGThreeLineOne,
159
+ w as BGThreeLineThree,
160
+ c as BGThreeLineTwo,
161
+ a as BGTwoLineOne,
162
+ d as BGTwoLineThree,
163
+ h as BGTwoLineTwo,
164
+ o as BGWrap
165
+ };
@@ -1,3 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { Notification as NotificationProps } from '@streamlayer/sdk-web-notifications';
3
- export declare const PredictionResult: React.FC<NotificationProps>;
2
+ import type { NotificationData } from '@streamlayer/sdk-web-notifications';
3
+ export declare const PredictionResult: React.FC<NotificationData['question'] & {
4
+ close?: () => void;
5
+ }>;
@@ -1,7 +1,78 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { PredictionResultContainer as t } from "./styles.js";
1
+ import { jsxs as c, jsx as i, Fragment as f } from "react/jsx-runtime";
2
+ import { useState as b, useEffect as g } from "react";
3
+ import { AnimationLines as S } from "./animation-lines/index.js";
4
+ import { Container as x, AnimateContent as E, Content as t, Title as n, SubtitleFG as d, Subtitle as a, AnswerText as h, FeedbackIcon as m, CloseButton as C, CloseIcon as p } from "./styles.js";
5
+ import "./animation-lines/styles.js";
3
6
  import "@linaria/react";
4
- const c = ({ close: r }) => /* @__PURE__ */ o(t, { children: /* @__PURE__ */ o("button", { onClick: r, children: "close" }) });
7
+ import "../../../../icons/index.js";
8
+ const j = ({
9
+ close: u,
10
+ votedAnswer: l,
11
+ correct: r,
12
+ correctAnswerTitle: k
13
+ }) => {
14
+ const [o, s] = b(1);
15
+ return g(() => {
16
+ const P = setInterval(() => {
17
+ s((e) => r && e > 4 || !r && e > 3 ? e : ++e);
18
+ }, 6e3);
19
+ return () => clearInterval(P);
20
+ }, [r]), /* @__PURE__ */ c(x, { "data-bg-color-white": o > 3, children: [
21
+ /* @__PURE__ */ i(S, { step: o, correct: r }),
22
+ /* @__PURE__ */ c(E, { "data-active-number": o, children: [
23
+ /* @__PURE__ */ c(t, { children: [
24
+ /* @__PURE__ */ i(n, { children: "Master" }),
25
+ /* @__PURE__ */ i(d, { children: "FEATURED GROUPS +" })
26
+ ] }),
27
+ /* @__PURE__ */ c(t, { children: [
28
+ /* @__PURE__ */ i(n, { children: "Prediction results are in!" }),
29
+ /* @__PURE__ */ i(d, { children: "FEATURED GROUPS +" })
30
+ ] }),
31
+ /* @__PURE__ */ c(t, { children: [
32
+ /* @__PURE__ */ i(n, { children: "Who holds the most birdies in golf?" }),
33
+ /* @__PURE__ */ c(a, { children: [
34
+ "Your Pick: ",
35
+ /* @__PURE__ */ i(h, { children: l == null ? void 0 : l.title })
36
+ ] })
37
+ ] }),
38
+ r ? /* @__PURE__ */ c(f, { children: [
39
+ /* @__PURE__ */ c(t, { "data-color-green": "true", children: [
40
+ /* @__PURE__ */ i(n, { children: "Congratulations! You answered correctly." }),
41
+ /* @__PURE__ */ c(a, { children: [
42
+ /* @__PURE__ */ i(m, { name: "selected" }),
43
+ "Your Pick: ",
44
+ /* @__PURE__ */ i(h, { children: l == null ? void 0 : l.title })
45
+ ] })
46
+ ] }),
47
+ /* @__PURE__ */ c(t, { "data-color-green": "true", children: [
48
+ /* @__PURE__ */ i(C, { onClick: u, children: /* @__PURE__ */ i(p, { name: "icon-cross" }) }),
49
+ /* @__PURE__ */ c(n, { children: [
50
+ "+",
51
+ l == null ? void 0 : l.points,
52
+ " points"
53
+ ] }),
54
+ /* @__PURE__ */ c(a, { children: [
55
+ /* @__PURE__ */ i(m, { name: "selected" }),
56
+ "Your Pick: ",
57
+ /* @__PURE__ */ i(h, { children: l == null ? void 0 : l.title })
58
+ ] })
59
+ ] })
60
+ ] }) : /* @__PURE__ */ c(t, { children: [
61
+ /* @__PURE__ */ i(C, { onClick: u, children: /* @__PURE__ */ i(p, { name: "icon-cross" }) }),
62
+ /* @__PURE__ */ c(n, { "data-incorrect": "true", children: [
63
+ "Better luck next time! Correct: ",
64
+ k,
65
+ "."
66
+ ] }),
67
+ /* @__PURE__ */ c(a, { "data-incorrect": "true", children: [
68
+ /* @__PURE__ */ i(m, { name: "circleClose" }),
69
+ "Your Pick: ",
70
+ /* @__PURE__ */ i(h, { children: l == null ? void 0 : l.title })
71
+ ] })
72
+ ] })
73
+ ] })
74
+ ] });
75
+ };
5
76
  export {
6
- c as PredictionResult
77
+ j as PredictionResult
7
78
  };
@@ -1,2 +1,13 @@
1
1
  /// <reference types="react" />
2
- export declare const PredictionResultContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
+ export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const AnimateContent: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const Subtitle: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
+ export declare const SubtitleFG: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
8
+ as?: import("react").ElementType<any> | undefined;
9
+ }>;
10
+ export declare const AnswerText: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
11
+ export declare const FeedbackIcon: any;
12
+ export declare const CloseButton: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
13
+ export declare const CloseIcon: any;
@@ -1,12 +1,132 @@
1
- import { styled as r } from "@linaria/react";
2
- const i = r.div`
1
+ import { styled as t } from "@linaria/react";
2
+ import { SvgIcon as r } from "../../../../icons/index.js";
3
+ import "react/jsx-runtime";
4
+ import "react";
5
+ const c = t.div`
3
6
  box-sizing: border-box;
4
7
  width: 100%;
5
8
  height: 118px;
6
- border-radius: 10px;
9
+ border-radius: 8px;
10
+ overflow: hidden;
11
+ position: relative;
7
12
  background-color: var(--color-primary-green2);
13
+
14
+ &[data-bg-color-white='true'] {
15
+ background-color: var(--color-white);
16
+ }
17
+
18
+ transition: background-color 700ms ease-in;
19
+ `, s = t.div`
20
+ width: 100%;
21
+ background-color: transparent;
22
+ transform: translateY(0px);
23
+ transition: transform 1s ease-in;
24
+ position: absolute;
25
+ top: 0;
26
+ right: 0;
27
+ z-index: 2;
28
+
29
+ &[data-active-number='2'] {
30
+ transform: translateY(-118px);
31
+ }
32
+
33
+ &[data-active-number='3'] {
34
+ transform: translateY(-236px);
35
+ }
36
+
37
+ &[data-active-number='4'] {
38
+ transform: translateY(-354px);
39
+ }
40
+
41
+ &[data-active-number='5'] {
42
+ transform: translateY(-472px);
43
+ }
44
+ `, l = t.div`
45
+ width: 100%;
46
+ height: 118px;
47
+ border-radius: 8px;
48
+ background-color: transparent;
8
49
  position: relative;
50
+ padding: 22px 16px;
51
+ color: var(--color-white);
52
+ font-family: var(--font-serif);
53
+ display: flex;
54
+ flex-direction: column;
55
+ align-items: center;
56
+ justify-content: center;
57
+
58
+ &[data-color-green='true'] {
59
+ color: var(--color-primary-green1);
60
+ }
61
+ `, p = t.div`
62
+ margin-bottom: 10px;
63
+ font-size: 20px;
64
+ font-weight: var(--font-weight-default);
65
+ display: flex;
66
+ justify-content: center;
67
+ text-align: center;
68
+
69
+ &[data-incorrect='true'] {
70
+ color: var(--color-neutrals-gray9);
71
+ }
72
+ `, o = t.div`
73
+ font-size: 12px;
74
+ font-weight: 500;
75
+ display: flex;
76
+ justify-content: center;
77
+ text-align: center;
78
+ align-items: center;
79
+ font-family: var(--font-regular);
80
+
81
+ &[data-incorrect='true'] {
82
+ color: var(--color-secondary-red1);
83
+ }
84
+ `, d = t(o)`
85
+ font-family: var(--font-serif);
86
+ `, f = t.div`
87
+ font-weight: 400px;
88
+ margin-left: 5px;
89
+ `, g = t(r)`
90
+ width: 14px;
91
+ height: 14px;
92
+ margin-right: 6px;
93
+ `, x = t.button`
94
+ width: 30px;
95
+ height: 30px;
96
+ border: none;
97
+ border-radius: 50%;
98
+ outline: none;
99
+ background-color: transparent;
100
+ display: flex;
101
+ justify-content: center;
102
+ align-items: center;
103
+ position: absolute;
104
+ right: 8px;
105
+ top: 8px;
106
+ cursor: pointer;
107
+ `, u = t(r)`
108
+ width: 20px;
109
+ height: 20px;
110
+
111
+ path {
112
+ stroke: var(--color-neutrals-gray7);
113
+ }
114
+
115
+ &:hover {
116
+ path {
117
+ stroke: var(--color-primary-green2);
118
+ }
119
+ }
9
120
  `;
10
121
  export {
11
- i as PredictionResultContainer
122
+ s as AnimateContent,
123
+ f as AnswerText,
124
+ x as CloseButton,
125
+ u as CloseIcon,
126
+ c as Container,
127
+ l as Content,
128
+ g as FeedbackIcon,
129
+ o as Subtitle,
130
+ d as SubtitleFG,
131
+ p as Title
12
132
  };
@@ -35,8 +35,8 @@ const p = o.div`
35
35
  display: flex;
36
36
  align-items: center;
37
37
  `, l = o(r)`
38
- width: 20px;
39
- height: 20px;
38
+ width: 13px;
39
+ height: 13px;
40
40
  margin-right: 4px;
41
41
 
42
42
  path {
@@ -42,6 +42,7 @@ export declare const icons: {
42
42
  incorrect: any;
43
43
  questionExpired: any;
44
44
  selected: any;
45
+ circleClose: any;
45
46
  };
46
47
  export declare const Icon: React.FC<{
47
48
  name: keyof typeof icons;