@streamlayer/react-ui 0.47.0 → 0.48.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 (33) hide show
  1. package/lib/index.js +34 -32
  2. package/lib/ui/app/Features/Gamification/Question.js +22 -56
  3. package/lib/ui/app/Features/Gamification/index.js +12 -9
  4. package/lib/ui/app/Features/index.js +11 -8
  5. package/lib/ui/app/masters.js +11 -8
  6. package/lib/ui/demo/Gamification.js +6 -4
  7. package/lib/ui/demo/Highlights.js +6 -4
  8. package/lib/ui/demo/components/Question.js +22 -20
  9. package/lib/ui/demo/components/index.js +18 -16
  10. package/lib/ui/demo/index.js +6 -4
  11. package/lib/ui/gamification/detail/sponsor/index.d.ts +4 -0
  12. package/lib/ui/gamification/detail/sponsor/index.js +14 -0
  13. package/lib/ui/gamification/vote/feedback/index.d.ts +14 -0
  14. package/lib/ui/gamification/vote/feedback/index.js +33 -0
  15. package/lib/ui/gamification/vote/feedback/styles.d.ts +8 -0
  16. package/lib/ui/gamification/vote/feedback/styles.js +70 -0
  17. package/lib/ui/gamification/vote/index.d.ts +3 -8
  18. package/lib/ui/gamification/vote/index.js +62 -49
  19. package/lib/ui/gamification/vote/styles.d.ts +1 -5
  20. package/lib/ui/gamification/vote/styles.js +18 -53
  21. package/lib/ui/gamification/vote/vote-option/index.d.ts +9 -17
  22. package/lib/ui/gamification/vote/vote-option/index.js +53 -5
  23. package/lib/ui/gamification/vote/vote-option/styles.d.ts +12 -8
  24. package/lib/ui/gamification/vote/vote-option/styles.js +119 -66
  25. package/lib/ui/icons/index.d.ts +2 -0
  26. package/lib/ui/icons/index.js +22 -20
  27. package/package.json +10 -10
  28. package/lib/index-7f3361f2.js +0 -71
  29. package/lib/ui/gamification/vote/types.d.js +0 -1
  30. /package/lib/ui/gamification/{vote → detail}/header/index.d.ts +0 -0
  31. /package/lib/ui/gamification/{vote → detail}/header/index.js +0 -0
  32. /package/lib/ui/gamification/{vote → detail}/header/styles.d.ts +0 -0
  33. /package/lib/ui/gamification/{vote → detail}/header/styles.js +0 -0
package/lib/index.js CHANGED
@@ -1,16 +1,16 @@
1
- import { QuestionInApp as Uo } from "./ui/notifications/notification/question-inapp/index.js";
2
- import { Login as ko } from "./ui/login/index.js";
3
- import { Onboarding as wo } from "./ui/gamification/onboarding/index.js";
4
- import { ActivePages as Bo, Tab as Co, Tabs as Eo } from "./ui/gamification/tabs/index.js";
5
- import { LeaderboardItemDetail as Go } from "./ui/gamification/leaderboard-item-detail/index.js";
6
- import { Question as Jo } from "./ui/gamification/question/index.js";
7
- import { QuestionList as Mo } from "./ui/gamification/question/list/index.js";
8
- import { UserStatistics as Ro } from "./ui/gamification/user-statistics/index.js";
9
- import { Vote as Xo } from "./ui/gamification/vote/index.js";
10
- import { Demo as Zo } from "./ui/demo/index.js";
11
- import { Points as $o } from "./ui/gamification/points/index.js";
12
- import { StreamLayerThemeProvider as rr } from "./ui/theme/index.js";
13
- import { ThemeVariables as mr, theme as pr, themeStr as ir } from "./ui/theme/theme.js";
1
+ import { QuestionInApp as ko } from "./ui/notifications/notification/question-inapp/index.js";
2
+ import { Login as wo } from "./ui/login/index.js";
3
+ import { Onboarding as Bo } from "./ui/gamification/onboarding/index.js";
4
+ import { ActivePages as Eo, Tab as Fo, Tabs as Go } from "./ui/gamification/tabs/index.js";
5
+ import { LeaderboardItemDetail as Jo } from "./ui/gamification/leaderboard-item-detail/index.js";
6
+ import { Question as Mo } from "./ui/gamification/question/index.js";
7
+ import { QuestionList as Ro } from "./ui/gamification/question/list/index.js";
8
+ import { UserStatistics as Xo } from "./ui/gamification/user-statistics/index.js";
9
+ import { Vote as Zo } from "./ui/gamification/vote/index.js";
10
+ import { Demo as $o } from "./ui/demo/index.js";
11
+ import { Points as rr } from "./ui/gamification/points/index.js";
12
+ import { StreamLayerThemeProvider as mr } from "./ui/theme/index.js";
13
+ import { ThemeVariables as ir, theme as er, themeStr as fr } from "./ui/theme/theme.js";
14
14
  import "react/jsx-runtime";
15
15
  import "react";
16
16
  import "./icon-exit-d3f9fc80.js";
@@ -50,9 +50,11 @@ import "./ui/gamification/user-statistics/components/rank/styles.js";
50
50
  import "./ui/gamification/user-statistics/components/statistic/index.js";
51
51
  import "./ui/gamification/user-statistics/components/statistic/styles.js";
52
52
  import "./ui/gamification/user-statistics/styles.js";
53
- import "./index-7f3361f2.js";
54
- import "./ui/gamification/vote/vote-option/styles.js";
53
+ import "./ui/gamification/vote/feedback/index.js";
54
+ import "./ui/gamification/vote/feedback/styles.js";
55
55
  import "./ui/gamification/vote/styles.js";
56
+ import "./ui/gamification/vote/vote-option/index.js";
57
+ import "./ui/gamification/vote/vote-option/styles.js";
56
58
  import "./ui/gamification/vote/win-bar/index.js";
57
59
  import "./ui/gamification/vote/win-bar/styles.js";
58
60
  import "@streamlayer/sdk-web-interfaces";
@@ -94,21 +96,21 @@ import "./ui/gamification/points/styles.js";
94
96
  import "./ui/theme/breakpoints.js";
95
97
  import "@linaria/core";
96
98
  export {
97
- Bo as ActivePages,
98
- Zo as Demo,
99
- Go as LeaderboardItemDetail,
100
- ko as Login,
101
- wo as Onboarding,
102
- $o as Points,
103
- Jo as Question,
104
- Uo as QuestionInApp,
105
- Mo as QuestionList,
106
- rr as StreamLayerThemeProvider,
107
- Co as Tab,
108
- Eo as Tabs,
109
- mr as ThemeVariables,
110
- Ro as UserStatistics,
111
- Xo as Vote,
112
- pr as theme,
113
- ir as themeStr
99
+ Eo as ActivePages,
100
+ $o as Demo,
101
+ Jo as LeaderboardItemDetail,
102
+ wo as Login,
103
+ Bo as Onboarding,
104
+ rr as Points,
105
+ Mo as Question,
106
+ ko as QuestionInApp,
107
+ Ro as QuestionList,
108
+ mr as StreamLayerThemeProvider,
109
+ Fo as Tab,
110
+ Go as Tabs,
111
+ ir as ThemeVariables,
112
+ Xo as UserStatistics,
113
+ Zo as Vote,
114
+ er as theme,
115
+ fr as themeStr
114
116
  };
@@ -1,21 +1,24 @@
1
- import { jsxs as y, jsx as o } from "react/jsx-runtime";
2
- import { styled as e } from "@linaria/react";
3
- import { useState as x, useCallback as g, useMemo as a } from "react";
4
- import { QuestionType as b } from "@streamlayer/sdk-web-types";
5
- import { Vote as h } from "../../../gamification/vote/index.js";
6
- import { VoteHeader as C } from "../../../gamification/vote/header/index.js";
7
- import "../../../../index-7f3361f2.js";
8
- import "../../../gamification/vote/vote-option/styles.js";
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import { styled as l } from "@linaria/react";
3
+ import { QuestionType as c } from "@streamlayer/sdk-web-types";
4
+ import { VoteHeader as f } from "../../../gamification/detail/header/index.js";
5
+ import { Sponsor as s } from "../../../gamification/detail/sponsor/index.js";
6
+ import { Vote as a } from "../../../gamification/vote/index.js";
7
+ import "../../../gamification/constants.js";
8
+ import "../../../gamification/detail/header/styles.js";
9
+ import "../../../icons/index.js";
10
+ import "react";
11
+ import "../../../gamification/vote/feedback/index.js";
12
+ import "../../../gamification/vote/feedback/styles.js";
9
13
  import "../../../gamification/vote/styles.js";
14
+ import "../../../gamification/vote/vote-option/index.js";
15
+ import "../../../gamification/vote/vote-option/styles.js";
10
16
  import "../../../gamification/vote/win-bar/index.js";
11
17
  import "../../../timer/index.js";
12
18
  import "react-countdown-circle-timer";
13
19
  import "../../../theme/constants.js";
14
20
  import "../../../gamification/vote/win-bar/styles.js";
15
- import "../../../icons/index.js";
16
- import "../../../gamification/constants.js";
17
- import "../../../gamification/vote/header/styles.js";
18
- const T = e.div`
21
+ const x = l.div`
19
22
  background: var(--color-transparent-item);
20
23
  width: 100%;
21
24
  height: 100%;
@@ -24,51 +27,14 @@ const T = e.div`
24
27
  align-items: center;
25
28
  justify-content: flex-start;
26
29
  flex-direction: column;
27
- `, D = ({ openedQuestion: r, closeQuestion: s, vote: l }) => {
28
- var c;
29
- const [f, m] = x(!1);
30
- g(
31
- (t) => {
32
- m(t);
33
- },
34
- [m]
35
- );
36
- const i = a(
37
- () => r == null ? void 0 : r.answers.find((t) => t.youVoted === !0),
38
- [r]
39
- ), p = a(
40
- () => !!(r != null && r.answers.find((t) => t.correct === !0)),
41
- [r]
42
- );
43
- return /* @__PURE__ */ y(T, { children: [
44
- /* @__PURE__ */ o(C, { close: s, type: (r == null ? void 0 : r.type) || b.UNSET }),
45
- r && /* @__PURE__ */ o(
46
- h,
47
- {
48
- title: r.subject,
49
- feedbackMessages: (c = r.options) == null ? void 0 : c.options.value,
50
- questionType: r.type,
51
- questionId: r.id,
52
- questionAnswered: !!i,
53
- questionAnsweredCorrectly: i == null ? void 0 : i.correct,
54
- options: r.answers.map((t) => ({
55
- id: t.id,
56
- title: t.text,
57
- icon: t.icon,
58
- type: r.type,
59
- correct: t.correct,
60
- percentage: t.percentage,
61
- answered: t.youVoted,
62
- disabled: !!i || r.marketClosed || f,
63
- questionAnswered: !!i,
64
- hasCorrectAnswer: p,
65
- points: t.points,
66
- onVote: l
67
- }))
68
- }
69
- )
30
+ `, B = ({ openedQuestion: r, closeQuestion: m, vote: i }) => {
31
+ var o;
32
+ return /* @__PURE__ */ p(x, { children: [
33
+ /* @__PURE__ */ t(f, { close: m, type: (r == null ? void 0 : r.type) || c.UNSET }),
34
+ r && /* @__PURE__ */ t(a, { vote: i, openedQuestion: r }),
35
+ /* @__PURE__ */ t(s, { sponsorLogo: (o = r == null ? void 0 : r.sponsorship) == null ? void 0 : o.logo })
70
36
  ] });
71
37
  };
72
38
  export {
73
- D as Question
39
+ B as Question
74
40
  };
@@ -5,21 +5,24 @@ import { SDKScrollContainer as s } from "../../styles.js";
5
5
  import { ShowIn as l } from "../../../show-in/index.js";
6
6
  import { Question as a } from "./Question.js";
7
7
  import { Tabs as d } from "./Tabs.js";
8
- import "react";
9
8
  import "@streamlayer/sdk-web-types";
9
+ import "../../../gamification/detail/header/index.js";
10
+ import "../../../gamification/constants.js";
11
+ import "../../../gamification/detail/header/styles.js";
12
+ import "../../../icons/index.js";
13
+ import "react";
14
+ import "../../../gamification/detail/sponsor/index.js";
10
15
  import "../../../gamification/vote/index.js";
11
- import "../../../../index-7f3361f2.js";
12
- import "../../../gamification/vote/vote-option/styles.js";
16
+ import "../../../gamification/vote/feedback/index.js";
17
+ import "../../../gamification/vote/feedback/styles.js";
13
18
  import "../../../gamification/vote/styles.js";
19
+ import "../../../gamification/vote/vote-option/index.js";
20
+ import "../../../gamification/vote/vote-option/styles.js";
14
21
  import "../../../gamification/vote/win-bar/index.js";
15
22
  import "../../../timer/index.js";
16
23
  import "react-countdown-circle-timer";
17
24
  import "../../../theme/constants.js";
18
25
  import "../../../gamification/vote/win-bar/styles.js";
19
- import "../../../icons/index.js";
20
- import "../../../gamification/vote/header/index.js";
21
- import "../../../gamification/constants.js";
22
- import "../../../gamification/vote/header/styles.js";
23
26
  import "../../../gamification/tabs/index.js";
24
27
  import "../../../gamification/tabs/styles.js";
25
28
  import "./Leaderboard.js";
@@ -55,7 +58,7 @@ const u = e(l)`
55
58
  top: var(--header-height);
56
59
  background: var(--color-neutrals-white);
57
60
  z-index: 3;
58
- `, ao = ({
61
+ `, ho = ({
59
62
  gamification: o
60
63
  }) => {
61
64
  const { loading: i, data: t } = n(o.openedQuestion);
@@ -72,5 +75,5 @@ const u = e(l)`
72
75
  ] });
73
76
  };
74
77
  export {
75
- ao as GamificationOverlay
78
+ ho as GamificationOverlay
76
79
  };
@@ -10,19 +10,22 @@ import "@linaria/react";
10
10
  import "../styles.js";
11
11
  import "../../show-in/index.js";
12
12
  import "./Gamification/Question.js";
13
+ import "../../gamification/detail/header/index.js";
14
+ import "../../gamification/constants.js";
15
+ import "../../gamification/detail/header/styles.js";
16
+ import "../../icons/index.js";
17
+ import "../../gamification/detail/sponsor/index.js";
13
18
  import "../../gamification/vote/index.js";
14
- import "../../../index-7f3361f2.js";
15
- import "../../gamification/vote/vote-option/styles.js";
19
+ import "../../gamification/vote/feedback/index.js";
20
+ import "../../gamification/vote/feedback/styles.js";
16
21
  import "../../gamification/vote/styles.js";
22
+ import "../../gamification/vote/vote-option/index.js";
23
+ import "../../gamification/vote/vote-option/styles.js";
17
24
  import "../../gamification/vote/win-bar/index.js";
18
25
  import "../../timer/index.js";
19
26
  import "react-countdown-circle-timer";
20
27
  import "../../theme/constants.js";
21
28
  import "../../gamification/vote/win-bar/styles.js";
22
- import "../../icons/index.js";
23
- import "../../gamification/vote/header/index.js";
24
- import "../../gamification/constants.js";
25
- import "../../gamification/vote/header/styles.js";
26
29
  import "./Gamification/Tabs.js";
27
30
  import "../../gamification/tabs/index.js";
28
31
  import "../../gamification/tabs/styles.js";
@@ -61,7 +64,7 @@ import "../../gamification/insight-list/index.js";
61
64
  import "../../gamification/insight/index.js";
62
65
  import "../../gamification/insight/styles.js";
63
66
  import "../../gamification/insight-list/styles.js";
64
- const Gr = ({ sdk: i, feature: r }) => p(() => r ? r.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ t(m, { sdk: i, feature: r, children: /* @__PURE__ */ t(e, { gamification: r, sdk: i }) }) : r.featureConfig.get().type === o.HIGHLIGHTS ? /* @__PURE__ */ t(m, { sdk: i, feature: r, children: /* @__PURE__ */ t(n, { highlights: r, sdk: i }) }) : null : null, [i, r]);
67
+ const xr = ({ sdk: i, feature: r }) => p(() => r ? r.featureConfig.get().type === o.GAMES ? /* @__PURE__ */ t(m, { sdk: i, feature: r, children: /* @__PURE__ */ t(e, { gamification: r, sdk: i }) }) : r.featureConfig.get().type === o.HIGHLIGHTS ? /* @__PURE__ */ t(m, { sdk: i, feature: r, children: /* @__PURE__ */ t(n, { highlights: r, sdk: i }) }) : null : null, [i, r]);
65
68
  export {
66
- Gr as ActiveFeature
69
+ xr as ActiveFeature
67
70
  };
@@ -21,18 +21,21 @@ import "./Features/Gamification/index.js";
21
21
  import "@linaria/react";
22
22
  import "../show-in/index.js";
23
23
  import "./Features/Gamification/Question.js";
24
+ import "../gamification/detail/header/index.js";
25
+ import "../gamification/constants.js";
26
+ import "../gamification/detail/header/styles.js";
27
+ import "../icons/index.js";
28
+ import "../gamification/detail/sponsor/index.js";
24
29
  import "../gamification/vote/index.js";
25
- import "../../index-7f3361f2.js";
26
- import "../gamification/vote/vote-option/styles.js";
30
+ import "../gamification/vote/feedback/index.js";
31
+ import "../gamification/vote/feedback/styles.js";
27
32
  import "../gamification/vote/styles.js";
33
+ import "../gamification/vote/vote-option/index.js";
34
+ import "../gamification/vote/vote-option/styles.js";
28
35
  import "../gamification/vote/win-bar/index.js";
29
36
  import "../timer/index.js";
30
37
  import "react-countdown-circle-timer";
31
38
  import "../gamification/vote/win-bar/styles.js";
32
- import "../icons/index.js";
33
- import "../gamification/vote/header/index.js";
34
- import "../gamification/constants.js";
35
- import "../gamification/vote/header/styles.js";
36
39
  import "./Features/Gamification/Tabs.js";
37
40
  import "../gamification/tabs/index.js";
38
41
  import "../gamification/tabs/styles.js";
@@ -79,7 +82,7 @@ import "../navigation/button/styles.js";
79
82
  const B = ({ sdk: o }) => {
80
83
  const [, m] = k(o);
81
84
  return /* @__PURE__ */ t(S, { feature: m, sdk: o });
82
- }, Wr = ({ sdk: o, overlays: m, children: p, event: n }) => {
85
+ }, Zr = ({ sdk: o, overlays: m, children: p, event: n }) => {
83
86
  const { sdkEnabled: i, sdkReady: s, activeOverlay: r, activateAndLoadOverlay: d, enableSdk: l, disableSdk: c } = b(
84
87
  o,
85
88
  n
@@ -113,5 +116,5 @@ const B = ({ sdk: o }) => {
113
116
  ] }) });
114
117
  };
115
118
  export {
116
- Wr as MastersApp
119
+ Zr as MastersApp
117
120
  };
@@ -32,9 +32,11 @@ import "../gamification/question/styles.js";
32
32
  import "../icons/index.js";
33
33
  import "../gamification/question/list/styles.js";
34
34
  import "../gamification/vote/index.js";
35
- import "../../index-7f3361f2.js";
36
- import "../gamification/vote/vote-option/styles.js";
35
+ import "../gamification/vote/feedback/index.js";
36
+ import "../gamification/vote/feedback/styles.js";
37
37
  import "../gamification/vote/styles.js";
38
+ import "../gamification/vote/vote-option/index.js";
39
+ import "../gamification/vote/vote-option/styles.js";
38
40
  import "../gamification/vote/win-bar/index.js";
39
41
  import "../timer/index.js";
40
42
  import "react-countdown-circle-timer";
@@ -57,7 +59,7 @@ import "react-window";
57
59
  import "react-window-infinite-loader";
58
60
  import "../gamification/leaderboard-item/index.js";
59
61
  import "../gamification/leaderboard-item/styles.js";
60
- const pt = ({
62
+ const nt = ({
61
63
  gamification: r,
62
64
  sdk: u
63
65
  }) => {
@@ -109,5 +111,5 @@ const pt = ({
109
111
  ] });
110
112
  };
111
113
  export {
112
- pt as GamificationComponent
114
+ nt as GamificationComponent
113
115
  };
@@ -29,9 +29,11 @@ import "../gamification/constants.js";
29
29
  import "../gamification/question/styles.js";
30
30
  import "../icons/index.js";
31
31
  import "../gamification/vote/index.js";
32
- import "../../index-7f3361f2.js";
33
- import "../gamification/vote/vote-option/styles.js";
32
+ import "../gamification/vote/feedback/index.js";
33
+ import "../gamification/vote/feedback/styles.js";
34
34
  import "../gamification/vote/styles.js";
35
+ import "../gamification/vote/vote-option/index.js";
36
+ import "../gamification/vote/vote-option/styles.js";
35
37
  import "../gamification/vote/win-bar/index.js";
36
38
  import "../timer/index.js";
37
39
  import "react-countdown-circle-timer";
@@ -45,7 +47,7 @@ import "../gamification/detailed-insight/index.js";
45
47
  import "../gamification/common-header/index.js";
46
48
  import "../../icon-exit-d3f9fc80.js";
47
49
  import "../gamification/detailed-insight/styles.js";
48
- const pt = ({ highlights: i, sdk: e }) => {
50
+ const nt = ({ highlights: i, sdk: e }) => {
49
51
  const n = m(i.status), r = m(i.openedInsight), { slStreamId: o } = m(e.sdkStore);
50
52
  return n !== d.Ready ? /* @__PURE__ */ t("div", { children: "wait..." }) : o != null && o.loading ? /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t("div", { children: "Event is loading" }) }) : o != null && o.data ? i.insights === void 0 ? /* @__PURE__ */ t("div", { children: "wait insights..." }) : /* @__PURE__ */ s(p, { children: [
51
53
  !r && /* @__PURE__ */ t(c, { highlights: i, store: i.insights.getStore() }),
@@ -60,5 +62,5 @@ const pt = ({ highlights: i, sdk: e }) => {
60
62
  ] }) : /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t("div", { children: "Event is forbidden" }) });
61
63
  };
62
64
  export {
63
- pt as HighlightsComponent
65
+ nt as HighlightsComponent
64
66
  };
@@ -1,17 +1,19 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { styled as f } from "@linaria/react";
3
- import { useState as n, useCallback as d, useMemo as a } from "react";
4
- import { Vote as p } from "../../gamification/vote/index.js";
3
+ import { useState as p, useCallback as n, useMemo as s } from "react";
4
+ import { Vote as d } from "../../gamification/vote/index.js";
5
+ import "../../gamification/vote/feedback/index.js";
5
6
  import "@streamlayer/sdk-web-types";
6
- import "../../../index-7f3361f2.js";
7
- import "../../gamification/vote/vote-option/styles.js";
7
+ import "../../icons/index.js";
8
+ import "../../gamification/vote/feedback/styles.js";
8
9
  import "../../gamification/vote/styles.js";
10
+ import "../../gamification/vote/vote-option/index.js";
11
+ import "../../gamification/vote/vote-option/styles.js";
9
12
  import "../../gamification/vote/win-bar/index.js";
10
13
  import "../../timer/index.js";
11
14
  import "react-countdown-circle-timer";
12
15
  import "../../theme/constants.js";
13
16
  import "../../gamification/vote/win-bar/styles.js";
14
- import "../../icons/index.js";
15
17
  const y = f.div`
16
18
  position: absolute;
17
19
  top: 0;
@@ -39,31 +41,31 @@ const y = f.div`
39
41
  transform: translateX(0);
40
42
  }
41
43
  }
42
- `, M = ({ openedQuestion: t, closeQuestion: h, vote: m }) => {
43
- var c;
44
- const [e, s] = n(!1);
45
- d(
44
+ `, I = ({ openedQuestion: t, closeQuestion: h, vote: a }) => {
45
+ var m;
46
+ const [e, c] = p(!1);
47
+ n(
46
48
  (r) => {
47
- s(r);
49
+ c(r);
48
50
  },
49
- [s]
51
+ [c]
50
52
  );
51
- const i = a(
53
+ const i = s(
52
54
  () => t == null ? void 0 : t.answers.find((r) => r.youVoted === !0),
53
55
  [t]
54
- ), l = a(
56
+ ), l = s(
55
57
  () => !!(t != null && t.answers.find((r) => r.correct === !0)),
56
58
  [t]
57
59
  );
58
60
  return t ? /* @__PURE__ */ o(y, { children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
59
- p,
61
+ d,
60
62
  {
61
63
  title: t.subject,
62
- feedbackMessages: (c = t.options) == null ? void 0 : c.options.value,
64
+ feedbackMessages: (m = t.options) == null ? void 0 : m.options.value,
63
65
  questionType: t.type,
64
66
  questionId: t.id,
65
- questionAnswered: !!i,
66
- questionAnsweredCorrectly: i == null ? void 0 : i.correct,
67
+ questionVoted: !!i,
68
+ questionVotedCorrectly: i == null ? void 0 : i.correct,
67
69
  options: t.answers.map((r) => ({
68
70
  id: r.id,
69
71
  title: r.text,
@@ -73,14 +75,14 @@ const y = f.div`
73
75
  percentage: r.percentage,
74
76
  answered: r.youVoted,
75
77
  disabled: !!i || t.marketClosed || e,
76
- questionAnswered: !!i,
78
+ questionVoted: !!i,
77
79
  hasCorrectAnswer: l,
78
80
  points: r.points,
79
- onVote: m
81
+ onVote: a
80
82
  }))
81
83
  }
82
84
  ) }) }) }) : null;
83
85
  };
84
86
  export {
85
- M as Question
87
+ I as Question
86
88
  };
@@ -1,10 +1,10 @@
1
- import { UserSummary as or } from "./UserSummary.js";
2
- import { QuestionsList as mr } from "./QuestionsList.js";
3
- import { Question as ir } from "./Question.js";
4
- import { Onboarding as sr } from "../../gamification/onboarding/index.js";
5
- import { Insights as xr } from "./Insights.js";
6
- import { Insight as ar } from "./Insight.js";
7
- import { Leaderboard as gr } from "./Leaderboard.js";
1
+ import { UserSummary as mr } from "./UserSummary.js";
2
+ import { QuestionsList as ir } from "./QuestionsList.js";
3
+ import { Question as sr } from "./Question.js";
4
+ import { Onboarding as xr } from "../../gamification/onboarding/index.js";
5
+ import { Insights as ar } from "./Insights.js";
6
+ import { Insight as gr } from "./Insight.js";
7
+ import { Leaderboard as br } from "./Leaderboard.js";
8
8
  import "react/jsx-runtime";
9
9
  import "@nanostores/react";
10
10
  import "../../gamification/user-statistics/index.js";
@@ -26,9 +26,11 @@ import "../../icons/index.js";
26
26
  import "react";
27
27
  import "../../gamification/question/list/styles.js";
28
28
  import "../../gamification/vote/index.js";
29
- import "../../../index-7f3361f2.js";
30
- import "../../gamification/vote/vote-option/styles.js";
29
+ import "../../gamification/vote/feedback/index.js";
30
+ import "../../gamification/vote/feedback/styles.js";
31
31
  import "../../gamification/vote/styles.js";
32
+ import "../../gamification/vote/vote-option/index.js";
33
+ import "../../gamification/vote/vote-option/styles.js";
32
34
  import "../../gamification/vote/win-bar/index.js";
33
35
  import "../../timer/index.js";
34
36
  import "react-countdown-circle-timer";
@@ -59,11 +61,11 @@ import "react-window-infinite-loader";
59
61
  import "../../gamification/leaderboard-item/index.js";
60
62
  import "../../gamification/leaderboard-item/styles.js";
61
63
  export {
62
- ar as Insight,
63
- xr as Insights,
64
- gr as Leaderboard,
65
- sr as Onboarding,
66
- ir as Question,
67
- mr as QuestionsList,
68
- or as UserSummary
64
+ gr as Insight,
65
+ ar as Insights,
66
+ br as Leaderboard,
67
+ xr as Onboarding,
68
+ sr as Question,
69
+ ir as QuestionsList,
70
+ mr as UserSummary
69
71
  };
@@ -45,9 +45,11 @@ import "../icons/index.js";
45
45
  import "../gamification/question/list/styles.js";
46
46
  import "./components/Question.js";
47
47
  import "../gamification/vote/index.js";
48
- import "../../index-7f3361f2.js";
49
- import "../gamification/vote/vote-option/styles.js";
48
+ import "../gamification/vote/feedback/index.js";
49
+ import "../gamification/vote/feedback/styles.js";
50
50
  import "../gamification/vote/styles.js";
51
+ import "../gamification/vote/vote-option/index.js";
52
+ import "../gamification/vote/vote-option/styles.js";
51
53
  import "../gamification/vote/win-bar/index.js";
52
54
  import "../timer/index.js";
53
55
  import "react-countdown-circle-timer";
@@ -167,7 +169,7 @@ const R = ({ activeFeature: o, sdk: r }) => {
167
169
  ] }),
168
170
  h
169
171
  ] });
170
- }, dr = ({ sdk: o }) => {
172
+ }, gr = ({ sdk: o }) => {
171
173
  const r = f(o.organizationStore()), t = f(o.getUserStore()), a = f(o.getActiveFeature());
172
174
  return r.loading ? /* @__PURE__ */ e("div", { children: "authentication..." }) : r.data ? t.loading ? /* @__PURE__ */ e("div", { children: "authentication..." }) : t.data ? /* @__PURE__ */ l(T, { children: [
173
175
  /* @__PURE__ */ e(x, { notificationsStore: o.getNotificationsStore() }),
@@ -175,5 +177,5 @@ const R = ({ activeFeature: o, sdk: r }) => {
175
177
  ] }) : /* @__PURE__ */ e(H, { sdk: o }) : /* @__PURE__ */ e("div", { children: "wrong sdk key..." });
176
178
  };
177
179
  export {
178
- dr as Demo
180
+ gr as Demo
179
181
  };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const Sponsor: React.FC<{
3
+ sponsorLogo?: string;
4
+ }>;
@@ -0,0 +1,14 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { styled as p } from "@linaria/react";
3
+ const r = p.div`
4
+ width: 100%;
5
+ height: 53px;
6
+ display: flex;
7
+ padding: 16px 0px;
8
+ justify-content: center;
9
+ `, i = p.img`
10
+ max-width: 20px;
11
+ `, d = ({ sponsorLogo: o }) => o && /* @__PURE__ */ t(r, { children: /* @__PURE__ */ t(i, { alt: "sponsor-logo", src: o }) });
12
+ export {
13
+ d as Sponsor
14
+ };
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { QuestionType } from '@streamlayer/sdk-web-types';
3
+ interface FeedbackProps {
4
+ feedbackMessages: Partial<Record<'correctFeedback' | 'incorrectFeedback', {
5
+ description: string;
6
+ title: string;
7
+ }>>;
8
+ questionType: QuestionType;
9
+ questionVoted?: boolean;
10
+ questionVotedCorrectly?: boolean;
11
+ hasCorrectAnswer: boolean;
12
+ }
13
+ export declare const Feedback: React.FC<FeedbackProps>;
14
+ export {};
@@ -0,0 +1,33 @@
1
+ import { jsxs as r, Fragment as m, jsx as e } from "react/jsx-runtime";
2
+ import { QuestionType as n } from "@streamlayer/sdk-web-types";
3
+ import { SvgIcon as b } from "../../../icons/index.js";
4
+ import { Container as h, IconPrediction as k, FeedbackDescription as l, FeedbackIconWrap as I, FeedbackHeader as T, FeedbackTitle as f } from "./styles.js";
5
+ import "@linaria/react";
6
+ import "react";
7
+ const R = ({
8
+ feedbackMessages: t,
9
+ questionVotedCorrectly: o,
10
+ questionVoted: F,
11
+ questionType: i,
12
+ hasCorrectAnswer: a
13
+ }) => {
14
+ if (!(F && (i === n.TRIVIA || i === n.PREDICTION)))
15
+ return null;
16
+ const p = i === n.PREDICTION && !a, d = o ? "correct" : "incorrect", c = o ? t.correctFeedback : t.incorrectFeedback;
17
+ return /* @__PURE__ */ r(h, { "data-isPrediction": p, children: [
18
+ p && /* @__PURE__ */ r(m, { children: [
19
+ /* @__PURE__ */ e(k, { name: "icon-prediction" }),
20
+ /* @__PURE__ */ e(l, { children: "Stay tuned to see if your prediction was correct." })
21
+ ] }),
22
+ a && /* @__PURE__ */ r(m, { children: [
23
+ /* @__PURE__ */ e(I, { "data-feedbackType": d, children: /* @__PURE__ */ e(b, { name: d }) }),
24
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ r(T, { children: [
25
+ /* @__PURE__ */ e(f, { "data-feedbackType": d, children: c == null ? void 0 : c.title }),
26
+ /* @__PURE__ */ e(l, { children: c == null ? void 0 : c.description })
27
+ ] }) })
28
+ ] })
29
+ ] });
30
+ };
31
+ export {
32
+ R as Feedback
33
+ };
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const IconPrediction: any;
4
+ export declare const FeedbackIconWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const FeedbackHeader: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const FeedbackTitle: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
7
+ export declare const FeedbackDescription: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
8
+ export declare const FeedbackText: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;