@streamlayer/react-ui 0.92.0 → 0.94.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 (88) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/{useClipboardCopy-E5rEe6It.js → index-jRXrW6ie.js} +1513 -1537
  3. package/lib/index.js +5 -4
  4. package/lib/ui/app/Features/Gamification/Friends.js +6 -5
  5. package/lib/ui/app/Features/Gamification/Leaderboard.js +4 -3
  6. package/lib/ui/app/Features/Gamification/Question.js +19 -21
  7. package/lib/ui/app/Features/Gamification/QuestionsList.js +1 -1
  8. package/lib/ui/app/Features/Gamification/Tabs.js +42 -39
  9. package/lib/ui/app/Features/Gamification/gamification-feature.js +11 -6
  10. package/lib/ui/app/Features/Gamification/index.js +72 -84
  11. package/lib/ui/app/Navigation/MastersNavigation/index.d.ts +2 -0
  12. package/lib/ui/app/Navigation/MastersNavigation/index.js +43 -35
  13. package/lib/ui/app/Notifications/Onboarding/index.d.ts +3 -2
  14. package/lib/ui/app/Notifications/Onboarding/index.js +114 -86
  15. package/lib/ui/app/Notifications/index.js +115 -108
  16. package/lib/ui/app/Points/index.js +6 -5
  17. package/lib/ui/app/masters.js +41 -31
  18. package/lib/ui/app/styles.d.ts +1 -0
  19. package/lib/ui/app/styles.js +6 -1
  20. package/lib/ui/app/useClipboardCopy.js +26 -5
  21. package/lib/ui/app/useImagesPreload.d.ts +4 -0
  22. package/lib/ui/app/useImagesPreload.js +23 -0
  23. package/lib/ui/app/useMastersApp.js +42 -35
  24. package/lib/ui/app/useSdkResponsive.d.ts +1 -1
  25. package/lib/ui/app/useSdkResponsive.js +23 -23
  26. package/lib/ui/app/useSdkScroll.d.ts +1 -0
  27. package/lib/ui/app/useSdkScroll.js +32 -23
  28. package/lib/ui/gamification/detail/header/index.js +11 -11
  29. package/lib/ui/gamification/detail/header/styles.d.ts +1 -1
  30. package/lib/ui/gamification/detail/header/styles.js +11 -11
  31. package/lib/ui/gamification/onboarding/index.d.ts +2 -1
  32. package/lib/ui/gamification/onboarding/index.js +55 -43
  33. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +1 -1
  34. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +15 -13
  35. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -1
  36. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +9 -9
  37. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +14 -13
  38. package/lib/ui/gamification/points/index.js +5 -4
  39. package/lib/ui/gamification/question/insight/index.js +4 -5
  40. package/lib/ui/gamification/question/list/index.js +14 -14
  41. package/lib/ui/gamification/question/notification/index.js +3 -2
  42. package/lib/ui/gamification/question/notification/prediction-result/animation-lines/index.js +17 -17
  43. package/lib/ui/gamification/question/notification/prediction-result/index.js +37 -39
  44. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +1 -1
  45. package/lib/ui/gamification/question/notification/prediction-result/styles.js +12 -12
  46. package/lib/ui/gamification/question/notification/tweet/index.js +10 -7
  47. package/lib/ui/gamification/question/twitter/index.js +16 -33
  48. package/lib/ui/gamification/question/twitter/styles.d.ts +0 -1
  49. package/lib/ui/gamification/question/twitter/styles.js +7 -12
  50. package/lib/ui/gamification/vote/index.js +57 -56
  51. package/lib/ui/gamification/vote/insight-details/index.js +5 -6
  52. package/lib/ui/gamification/vote/twitter-details/index.js +13 -29
  53. package/lib/ui/gamification/vote/twitter-details/styles.d.ts +0 -1
  54. package/lib/ui/gamification/vote/twitter-details/styles.js +3 -8
  55. package/lib/ui/gamification/vote/vote-option/index.js +61 -57
  56. package/lib/ui/gamification/vote/win-bar/index.d.ts +1 -0
  57. package/lib/ui/gamification/vote/win-bar/index.js +21 -20
  58. package/lib/ui/modal/index.d.ts +9 -0
  59. package/lib/ui/modal/index.js +34 -0
  60. package/lib/ui/navigation/button/FeaturedGroups.d.ts +3 -1
  61. package/lib/ui/navigation/button/FeaturedGroups.js +11 -11
  62. package/lib/ui/navigation/masters.d.ts +2 -1
  63. package/lib/ui/navigation/masters.js +9 -4
  64. package/lib/ui/questions/insight/index.d.ts +2 -3
  65. package/lib/ui/questions/insight/index.js +13 -35
  66. package/lib/ui/questions/insight/styles.d.ts +0 -1
  67. package/lib/ui/questions/insight/styles.js +9 -14
  68. package/lib/ui/questions/twitter/account/index.d.ts +2 -1
  69. package/lib/ui/questions/twitter/account/index.js +24 -18
  70. package/lib/ui/questions/twitter/account/styles.d.ts +1 -1
  71. package/lib/ui/questions/twitter/account/styles.js +2 -2
  72. package/lib/ui/questions/twitter/index.d.ts +2 -2
  73. package/lib/ui/questions/twitter/index.js +31 -9
  74. package/lib/ui/questions/twitter/styles.d.ts +1 -0
  75. package/lib/ui/questions/twitter/styles.js +8 -3
  76. package/lib/ui/skeleton/index.d.ts +7 -0
  77. package/lib/ui/skeleton/index.js +7 -0
  78. package/lib/ui/skeleton/styles.d.ts +2 -0
  79. package/lib/ui/skeleton/styles.js +9 -0
  80. package/lib/ui/theme/breakpoints.d.ts +4 -1
  81. package/lib/ui/theme/breakpoints.js +24 -12
  82. package/lib/ui/theme/constants.d.ts +4 -0
  83. package/lib/ui/theme/constants.js +6 -2
  84. package/lib/ui/theme/index.js +4 -3
  85. package/lib/ui/theme/theme.js +29 -21
  86. package/lib/utils/common.js +22 -8
  87. package/lib/utils/decorators/container.js +4 -3
  88. package/package.json +18 -18
@@ -1,27 +1,22 @@
1
- import { styled as s } from "@linaria/react";
2
- import { Button as o } from "../../../button/index.js";
1
+ import { styled as o } from "@linaria/react";
2
+ import { Button as t } from "../../../button/index.js";
3
3
  import "react/jsx-runtime";
4
4
  import "../../../button/styles.js";
5
- const r = /* @__PURE__ */ s("div")({
5
+ const a = /* @__PURE__ */ o("div")({
6
6
  name: "Container",
7
7
  class: "cl56x6b",
8
8
  propsAsIs: !1
9
- }), t = () => o, c = /* @__PURE__ */ s(t())({
9
+ }), s = () => t, c = /* @__PURE__ */ o(s())({
10
10
  name: "ActionButton",
11
11
  class: "a11pzf92",
12
12
  propsAsIs: !0
13
- }), m = /* @__PURE__ */ s("div")({
14
- name: "DateTime",
15
- class: "d1hbaleq",
16
- propsAsIs: !1
17
- }), i = /* @__PURE__ */ s("blockquote")({
13
+ }), i = /* @__PURE__ */ o("blockquote")({
18
14
  name: "Quote",
19
- class: "qvvgqjm",
15
+ class: "q1hbaleq",
20
16
  propsAsIs: !1
21
17
  });
22
18
  export {
23
19
  c as ActionButton,
24
- r as Container,
25
- m as DateTime,
20
+ a as Container,
26
21
  i as Quote
27
22
  };
@@ -1,11 +1,11 @@
1
- import { jsx as m, jsxs as N, Fragment as G } from "react/jsx-runtime";
2
- import { useState as E, useEffect as J, useCallback as p, useMemo as f } from "react";
3
- import { QuestionType as c, QuestionStatus as C } from "@streamlayer/sdk-web-types";
4
- import { ExpiredAlert as K } from "./expired-alert/index.js";
5
- import { Feedback as U } from "./feedback/index.js";
6
- import { QuestionScrollContainer as X, Container as Z, Content as _, Title as $, Options as Q } from "./styles.js";
7
- import { VotingOption as tt } from "./vote-option/index.js";
8
- import { WinBar as rt } from "./win-bar/index.js";
1
+ import { jsx as n, jsxs as k, Fragment as J } from "react/jsx-runtime";
2
+ import { useState as I, useEffect as K, useCallback as R, useMemo as f } from "react";
3
+ import { QuestionType as o, QuestionStatus as E } from "@streamlayer/sdk-web-types";
4
+ import { ExpiredAlert as U } from "./expired-alert/index.js";
5
+ import { Feedback as X } from "./feedback/index.js";
6
+ import { QuestionScrollContainer as Z, Container as _, Content as $, Title as Q, Options as tt } from "./styles.js";
7
+ import { VotingOption as rt } from "./vote-option/index.js";
8
+ import { WinBar as it } from "./win-bar/index.js";
9
9
  import "../../icons/index.js";
10
10
  import "@linaria/react";
11
11
  import "./expired-alert/styles.js";
@@ -18,28 +18,28 @@ import "../../timer/index.js";
18
18
  import "react-countdown-circle-timer";
19
19
  import "../../theme/constants.js";
20
20
  import "./win-bar/styles.js";
21
- const wt = ({ openedQuestion: t, isLoading: I, vote: w, close: v }) => {
22
- var g, k;
23
- const P = t.subject, s = t.type, o = t.status, V = (g = t.options) == null ? void 0 : g.options, d = t.marketClosed, [R, b] = E(!1), [y, L] = E(!1), [T, O] = E(!0), [n, M] = E(!1), [x, q] = E(""), h = t == null ? void 0 : t.id;
24
- J(() => {
25
- s === c.PREDICTION ? d && O(!1) : o === C.RESOLVED && O(!1);
21
+ const vt = ({ openedQuestion: t, isLoading: C, vote: p, close: v }) => {
22
+ var P, g;
23
+ const A = t.subject, a = t.type, m = t.status, V = (P = t.options) == null ? void 0 : P.options, d = t.marketClosed, [O, b] = I(!1), [y, L] = I(!1), [T, w] = I(!0), [c, M] = I(!1), [x, D] = I(""), h = t == null ? void 0 : t.id;
24
+ K(() => {
25
+ a === o.PREDICTION ? d && w(!1) : m === E.RESOLVED && w(!1);
26
26
  }, []);
27
- const j = p((e) => {
27
+ const j = R((e) => {
28
28
  L(e), b(!0);
29
- }, []), D = p(
29
+ }, []), q = R(
30
30
  async (e) => {
31
31
  if (h) {
32
32
  const u = e.currentTarget.value;
33
- q(u), await w(h, u);
33
+ D(u), await p(h, u);
34
34
  }
35
35
  },
36
- [h, q, w]
37
- ), B = p(() => {
36
+ [h, D, p]
37
+ ), B = R(() => {
38
38
  M(!0), setTimeout(v, 3e3);
39
39
  }, [v]), r = f(
40
40
  () => t == null ? void 0 : t.answers.find((e) => e.youVoted === !0),
41
41
  [t]
42
- ), a = f(
42
+ ), s = f(
43
43
  () => !!(t != null && t.answers.find((e) => e.correct === !0)),
44
44
  [t]
45
45
  ), i = f(
@@ -51,77 +51,78 @@ const wt = ({ openedQuestion: t, isLoading: I, vote: w, close: v }) => {
51
51
  ...e,
52
52
  questionVoted: !!r,
53
53
  youSelected: x === e.id,
54
- isLoading: I,
55
- hasCorrectAnswer: a,
54
+ isLoading: C,
55
+ hasCorrectAnswer: s,
56
56
  questionType: t.type,
57
- answerTimeExpired: n,
58
- questionStatus: o,
57
+ answerTimeExpired: c,
58
+ questionStatus: m,
59
59
  imageMode: (u = t.appearance) == null ? void 0 : u.images,
60
- onVote: D
60
+ onVote: q
61
61
  };
62
62
  }) : [], [
63
- a,
64
- n,
65
- I,
63
+ s,
64
+ c,
65
+ C,
66
66
  t,
67
67
  r,
68
- o,
69
- D,
68
+ m,
69
+ q,
70
70
  x
71
- ]), F = V && (V.case === "trivia" || V.case === "prediction") ? V.value : void 0, l = o === C.RESOLVED && s === c.TRIVIA && !r && !T, S = s === c.TRIVIA && y && R && T, A = f(() => s === c.PREDICTION ? !!(r && !a || r && a && (i != null && i.youVoted)) : !0, [s, r, a, i]), Y = f(() => {
72
- if (s === c.PREDICTION && r && (!a || a && (i != null && i.youVoted)))
71
+ ]), F = V && (V.case === "trivia" || V.case === "prediction") ? V.value : void 0, l = m === E.RESOLVED && a === o.TRIVIA && !r && !T, S = a === o.TRIVIA && y && O && T, N = f(() => a === o.PREDICTION ? !!(r && !s || r && s && (i != null && i.youVoted)) : !0, [a, r, s, i]), Y = f(() => {
72
+ if (a === o.PREDICTION && r && (!s || s && (i != null && i.youVoted)))
73
73
  return r.points;
74
- if (!(l || n))
75
- return o === C.RESOLVED ? 0 : r ? r.correct ? r.points : 0 : i == null ? void 0 : i.points;
74
+ if (!(l || c))
75
+ return m === E.RESOLVED ? 0 : r ? r.correct ? r.points : 0 : i == null ? void 0 : i.points;
76
76
  }, [
77
- n,
77
+ c,
78
78
  r,
79
79
  i,
80
- o,
80
+ m,
81
81
  l,
82
- s,
83
- a
84
- ]), H = f(() => s === c.PREDICTION && r ? a ? a && (i != null && i.youVoted) ? "You won" : "" : "To win" : l || n ? "Time expired" : s === c.POLL ? "Time remaining" : r ? "You won" : "To win", [n, s, r, l, a, i]), z = r || l || S || s === c.TRIVIA && o === C.RESOLVED && T;
85
- return /* @__PURE__ */ m(X, { children: /* @__PURE__ */ m(Z, { children: /* @__PURE__ */ N(_, { children: [
86
- /* @__PURE__ */ m(
87
- U,
82
+ a,
83
+ s
84
+ ]), H = f(() => a === o.PREDICTION && r ? s ? s && (i != null && i.youVoted) ? "You won" : "" : "To win" : l || c ? "Time expired" : a === o.POLL ? "Time remaining" : r ? "You won" : "To win", [c, a, r, l, s, i]), z = (a === o.TRIVIA || a === o.PREDICTION) && r && s && (i == null ? void 0 : i.youVoted), G = r || l || S || a === o.TRIVIA && m === E.RESOLVED && T;
85
+ return /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n(_, { children: /* @__PURE__ */ k($, { children: [
86
+ /* @__PURE__ */ n(
87
+ X,
88
88
  {
89
89
  feedbackMessages: F,
90
90
  questionVoted: !!r,
91
91
  questionVotedCorrectly: r == null ? void 0 : r.correct,
92
- questionType: s,
93
- hasCorrectAnswer: a,
94
- questionStatus: o,
92
+ questionType: a,
93
+ hasCorrectAnswer: s,
94
+ questionStatus: m,
95
95
  showExpiredNotification: l,
96
96
  showClosedNotificationTrivia: S,
97
- votedInCurrentRender: R,
97
+ votedInCurrentRender: O,
98
98
  votedAfterQuestionClosed: y,
99
99
  enteredAnActiveQuestion: T,
100
100
  marketClosed: d
101
101
  }
102
102
  ),
103
- A && /* @__PURE__ */ m(
104
- rt,
103
+ N && /* @__PURE__ */ n(
104
+ it,
105
105
  {
106
106
  title: H,
107
107
  points: Y,
108
108
  onTimerExpired: B,
109
109
  questionType: t.type,
110
- isTimer: !I,
110
+ isTimer: !C,
111
111
  isPlayingTimer: !r,
112
- timerDuration: z ? 0 : Number(((k = t == null ? void 0 : t.appearance) == null ? void 0 : k.autoHideInterval) || "30")
112
+ animatePoints: z,
113
+ timerDuration: G ? 0 : Number(((g = t == null ? void 0 : t.appearance) == null ? void 0 : g.autoHideInterval) || "30")
113
114
  }
114
115
  ),
115
- n ? /* @__PURE__ */ m(
116
- K,
116
+ c ? /* @__PURE__ */ n(
117
+ U,
117
118
  {
118
119
  title: "More to come...",
119
120
  description: "Watch for additional enhanced stream interactive experience."
120
121
  }
121
- ) : /* @__PURE__ */ N(G, { children: [
122
- /* @__PURE__ */ m($, { style: A ? {} : { marginTop: 0 }, children: P }),
123
- /* @__PURE__ */ m(Q, { children: W.map((e) => /* @__PURE__ */ m(
124
- tt,
122
+ ) : /* @__PURE__ */ k(J, { children: [
123
+ /* @__PURE__ */ n(Q, { style: N ? {} : { marginTop: 0 }, children: A }),
124
+ /* @__PURE__ */ n(tt, { children: W.map((e) => /* @__PURE__ */ n(
125
+ rt,
125
126
  {
126
127
  ...e,
127
128
  markThatVoted: j,
@@ -135,5 +136,5 @@ const wt = ({ openedQuestion: t, isLoading: I, vote: w, close: v }) => {
135
136
  ] }) }) });
136
137
  };
137
138
  export {
138
- wt as Vote
139
+ vt as Vote
139
140
  };
@@ -1,20 +1,19 @@
1
1
  import { jsxs as o, jsx as m } from "react/jsx-runtime";
2
- import { SvgIcon as l } from "../../../icons/index.js";
2
+ import { SvgIcon as p } from "../../../icons/index.js";
3
3
  import { InsightContent as b } from "../../../questions/insight/index.js";
4
4
  import { Container as k, WebLinkBtn as c } from "./styles.js";
5
5
  import "@linaria/react";
6
6
  import "react";
7
7
  import "../../../video-player/index.js";
8
8
  import "../../../video-player/styles.js";
9
- import "../../../../utils/common.js";
10
9
  import "../../../questions/insight/styles.js";
11
- const C = ({ instantView: r, ...p }) => /* @__PURE__ */ o(k, { children: [
12
- /* @__PURE__ */ m(b, { instantView: r, ...p }),
10
+ const j = ({ instantView: r, ...l }) => /* @__PURE__ */ o(k, { children: [
11
+ /* @__PURE__ */ m(b, { instantView: r, ...l, isDetail: !0 }),
13
12
  (r == null ? void 0 : r.webLink) && /* @__PURE__ */ o(c, { href: r == null ? void 0 : r.webLink.url, target: "_blank", children: [
14
13
  r == null ? void 0 : r.webLink.label,
15
- /* @__PURE__ */ m(l, { name: "icon-external-link" })
14
+ /* @__PURE__ */ m(p, { name: "icon-external-link" })
16
15
  ] })
17
16
  ] });
18
17
  export {
19
- C as InsightDetails
18
+ j as InsightDetails
20
19
  };
@@ -1,35 +1,19 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { useMemo as n } from "react";
3
- import { TwitterContent as a } from "../../../questions/twitter/index.js";
4
- import { isValidDate as f, formatDate as l, formatTime as p } from "../../../../utils/common.js";
5
- import { Container as s, DateTime as d, Quote as u } from "./styles.js";
6
- import "../../../questions/twitter/account/index.js";
1
+ import { jsxs as r, jsx as i } from "react/jsx-runtime";
2
+ import { TwitterContent as o } from "../../../questions/twitter/index.js";
3
+ import { Container as m, Quote as e } from "./styles.js";
4
+ import "../../../video-player/index.js";
5
+ import "react";
7
6
  import "../../../icons/index.js";
8
7
  import "@linaria/react";
8
+ import "../../../video-player/styles.js";
9
+ import "../../../questions/twitter/account/index.js";
10
+ import "../../../../utils/common.js";
9
11
  import "../../../questions/twitter/account/styles.js";
10
12
  import "../../../questions/twitter/styles.js";
11
- const V = ({ created: t, ...i }) => {
12
- const e = n(() => {
13
- if (t) {
14
- const r = new Date(t);
15
- if (f(r))
16
- return {
17
- date: l(r),
18
- time: p(r)
19
- };
20
- }
21
- return null;
22
- }, [t]);
23
- return /* @__PURE__ */ m(s, { children: [
24
- e && /* @__PURE__ */ m(d, { children: [
25
- e.date,
26
- " · ",
27
- e.time
28
- ] }),
29
- i.title && /* @__PURE__ */ o(u, { children: i.title }),
30
- /* @__PURE__ */ o(a, { ...i })
31
- ] });
32
- };
13
+ const w = (t) => /* @__PURE__ */ r(m, { children: [
14
+ t.title && /* @__PURE__ */ i(e, { children: t.title }),
15
+ /* @__PURE__ */ i(o, { ...t, isDetail: !0 })
16
+ ] });
33
17
  export {
34
- V as TwitterDetails
18
+ w as TwitterDetails
35
19
  };
@@ -1,4 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
- export declare const DateTime: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
3
  export declare const Quote: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLQuoteElement> & import("react").BlockquoteHTMLAttributes<HTMLQuoteElement> & Record<never, unknown>>;
@@ -1,19 +1,14 @@
1
1
  import { styled as s } from "@linaria/react";
2
- const o = /* @__PURE__ */ s("div")({
2
+ const e = /* @__PURE__ */ s("div")({
3
3
  name: "Container",
4
4
  class: "c1dcxmvf",
5
5
  propsAsIs: !1
6
- }), a = /* @__PURE__ */ s("div")({
7
- name: "DateTime",
8
- class: "db4q22c",
9
- propsAsIs: !1
10
6
  }), t = /* @__PURE__ */ s("blockquote")({
11
7
  name: "Quote",
12
- class: "q111mmic",
8
+ class: "qb4q22c",
13
9
  propsAsIs: !1
14
10
  });
15
11
  export {
16
- o as Container,
17
- a as DateTime,
12
+ e as Container,
18
13
  t as Quote
19
14
  };
@@ -1,83 +1,87 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { QuestionImages as a, QuestionType as i, QuestionStatus as T } from "@streamlayer/sdk-web-types";
3
- import { AnimatedCounter as P } from "../../../animated-counter/index.js";
4
- import { IconDefault as B, IconContainer as V, IconWrap as b, IconCircle as j, ButtonContainer as U, ButtonPct as $, ButtonBody as M, Title as W, Pts as y, Indicators as z, CheckIcon as F, Percentage as G } from "./styles.js";
1
+ import { jsx as n, jsxs as u } from "react/jsx-runtime";
2
+ import { useState as b, useLayoutEffect as j } from "react";
3
+ import { QuestionImages as a, QuestionType as o, QuestionStatus as S } from "@streamlayer/sdk-web-types";
4
+ import { AnimatedCounter as U } from "../../../animated-counter/index.js";
5
+ import { IconDefault as $, IconContainer as y, IconWrap as F, IconCircle as M, ButtonContainer as W, ButtonPct as z, ButtonBody as G, Title as H, Pts as J, Indicators as K, CheckIcon as X, Percentage as Y } from "./styles.js";
5
6
  import "react-countup";
6
7
  import "@linaria/react";
7
8
  import "../../../icons/index.js";
8
- import "react";
9
- const f = {
10
- [a.CENTERED]: (t) => /* @__PURE__ */ e(B, { alt: "option-icon", src: t }),
11
- [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(b, { style: { backgroundImage: `url(${t})` } }) }),
12
- [a.ROUNDED]: (t) => /* @__PURE__ */ e(j, { alt: "option-icon", src: t }),
9
+ const I = {
10
+ [a.CENTERED]: (t) => /* @__PURE__ */ n($, { alt: "option-icon", src: t }),
11
+ [a.TRANSPARENT]: (t) => /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n(F, { style: { backgroundImage: `url(${t})` } }) }),
12
+ [a.ROUNDED]: (t) => /* @__PURE__ */ n(M, { alt: "option-icon", src: t }),
13
13
  [a.NONE]: () => null,
14
14
  [a.UNSET]: () => null
15
- }, H = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: o }) => {
16
- if (t === i.POLL && r)
15
+ }, Z = ({ questionType: t, hasCorrectAnswer: c, correct: r, youVoted: i, questionVoted: e }) => {
16
+ if (t === o.POLL && i)
17
17
  return "correct";
18
- if (t === i.PREDICTION) {
19
- if (c && o)
20
- return r ? n ? "correct" : "incorrect" : "unset";
21
- if (r)
18
+ if (t === o.PREDICTION) {
19
+ if (c && e)
20
+ return i ? r ? "correct" : "incorrect" : "unset";
21
+ if (i)
22
22
  return "correct";
23
23
  }
24
- return t === i.TRIVIA && o && r ? n ? "correct" : "incorrect" : "unset";
25
- }, J = ({
24
+ return t === o.TRIVIA && e && i ? r ? "correct" : "incorrect" : "unset";
25
+ }, _ = ({
26
26
  questionType: t,
27
27
  questionVoted: c,
28
- correct: n,
29
- hasCorrectAnswer: r,
30
- questionStatus: o
31
- }) => t === i.TRIVIA ? c && n : t === i.PREDICTION ? c && n && r || o === T.RESOLVED && n : !1, rt = (t) => {
32
- var R;
28
+ correct: r,
29
+ hasCorrectAnswer: i,
30
+ questionStatus: e
31
+ }) => t === o.TRIVIA ? c && r : t === o.PREDICTION ? c && r && i || e === S.RESOLVED && r : !1, st = (t) => {
32
+ var N;
33
33
  const {
34
34
  // option props
35
35
  id: c,
36
- icon: n,
37
- text: r,
38
- percentageDecimal: o,
39
- points: D,
36
+ icon: r,
37
+ text: i,
38
+ percentageDecimal: e,
39
+ points: T,
40
40
  // extra props
41
- onVote: S,
42
- markThatVoted: w,
41
+ onVote: A,
42
+ markThatVoted: D,
43
43
  youSelected: h,
44
44
  questionVoted: s,
45
- imageMode: C,
46
- answerTimeExpired: O,
47
- questionStatus: E,
48
- isLoading: g,
45
+ imageMode: E,
46
+ answerTimeExpired: w,
47
+ questionStatus: C,
48
+ isLoading: O,
49
49
  questionType: d,
50
- correct: A,
50
+ correct: g,
51
51
  hasCorrectAnswer: k,
52
- votedAfterQuestionClosed: v,
53
- enteredAnActiveQuestion: p,
54
- marketClosed: u
55
- } = t, I = H(t), x = J({ questionType: d, questionVoted: s, correct: A, hasCorrectAnswer: k, questionStatus: E }), m = u && d === i.PREDICTION, N = s || m, L = d === i.PREDICTION && !s && !u;
56
- return /* @__PURE__ */ l(
57
- U,
52
+ votedAfterQuestionClosed: x,
53
+ enteredAnActiveQuestion: P,
54
+ marketClosed: l
55
+ } = t, [L, p] = b(e), m = Z(t), v = _({ questionType: d, questionVoted: s, correct: g, hasCorrectAnswer: k, questionStatus: C }), f = l && d === o.PREDICTION, R = s || f, Q = d === o.PREDICTION && !s && !l, B = s && !h && m !== "incorrect";
56
+ return j(() => {
57
+ e > 0 && (p(0), requestAnimationFrame(() => {
58
+ p(e);
59
+ }));
60
+ }, [e]), /* @__PURE__ */ u(
61
+ W,
58
62
  {
59
63
  value: c,
60
64
  "data-selected": h,
61
- "data-answer-state": I,
62
- disabled: s || g || O || m && !p || m && p && v,
63
- "data-is-not-checked": s && !h && I !== "incorrect",
64
- onClick: (Q) => {
65
- w(
66
- d === i.PREDICTION ? u : E === T.RESOLVED
67
- ), S(Q);
65
+ "data-answer-state": m,
66
+ disabled: s || O || w || f && !P || f && P && x,
67
+ "data-is-not-checked": B,
68
+ onClick: (V) => {
69
+ D(
70
+ d === o.PREDICTION ? l : C === S.RESOLVED
71
+ ), A(V);
68
72
  },
69
73
  children: [
70
- /* @__PURE__ */ e($, { "data-answer-state": I, style: { width: `${N ? o : 0}%` } }),
71
- /* @__PURE__ */ l(M, { children: [
72
- n && C && ((R = f[C]) == null ? void 0 : R.call(f, n)),
73
- /* @__PURE__ */ e(W, { children: r }),
74
- L && /* @__PURE__ */ l("div", { children: [
75
- /* @__PURE__ */ e(P, { value: D }),
76
- /* @__PURE__ */ e(y, { children: "pts" })
74
+ /* @__PURE__ */ n(z, { "data-answer-state": m, style: { width: `${R ? L : 0}%` } }),
75
+ /* @__PURE__ */ u(G, { children: [
76
+ r && E && ((N = I[E]) == null ? void 0 : N.call(I, r)),
77
+ /* @__PURE__ */ n(H, { children: i }),
78
+ Q && /* @__PURE__ */ u("div", { children: [
79
+ T,
80
+ /* @__PURE__ */ n(J, { children: "pts" })
77
81
  ] }),
78
- N && /* @__PURE__ */ l(z, { children: [
79
- x && /* @__PURE__ */ e(F, { name: "selected" }),
80
- /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(P, { value: o, suffix: "%" }) })
82
+ R && /* @__PURE__ */ u(K, { children: [
83
+ v && /* @__PURE__ */ n(X, { name: "selected" }),
84
+ /* @__PURE__ */ n(Y, { children: /* @__PURE__ */ n(U, { value: e, suffix: "%" }) })
81
85
  ] })
82
86
  ] })
83
87
  ]
@@ -85,5 +89,5 @@ const f = {
85
89
  );
86
90
  };
87
91
  export {
88
- rt as VotingOption
92
+ st as VotingOption
89
93
  };
@@ -5,6 +5,7 @@ interface WinBarProps {
5
5
  points?: number;
6
6
  isPlayingTimer?: boolean;
7
7
  isTimer?: boolean;
8
+ animatePoints?: boolean;
8
9
  questionType?: QuestionType;
9
10
  timerDuration?: number;
10
11
  onTimerExpired?: () => void;
@@ -1,35 +1,36 @@
1
- import { jsxs as i, jsx as r, Fragment as d } from "react/jsx-runtime";
2
- import { QuestionType as t } from "@streamlayer/sdk-web-types";
3
- import { AnimatedCounter as l } from "../../../animated-counter/index.js";
4
- import { Timer as s } from "../../../timer/index.js";
5
- import { WinBarContainer as h, Content as P, Title as C, WinIcon as f, Points as u, PointsCount as I, PointsUnits as T } from "./styles.js";
1
+ import { jsxs as i, jsx as r, Fragment as p } from "react/jsx-runtime";
2
+ import { QuestionType as o } from "@streamlayer/sdk-web-types";
3
+ import { AnimatedCounter as s } from "../../../animated-counter/index.js";
4
+ import { Timer as h } from "../../../timer/index.js";
5
+ import { WinBarContainer as P, Content as C, Title as f, WinIcon as u, Points as I, PointsCount as y, PointsUnits as T } from "./styles.js";
6
6
  import "react-countup";
7
7
  import "@linaria/react";
8
8
  import "react";
9
9
  import "react-countdown-circle-timer";
10
10
  import "../../../theme/constants.js";
11
11
  import "../../../icons/index.js";
12
- const N = ({
13
- title: o,
14
- points: e,
12
+ const R = ({
13
+ title: e,
14
+ points: n,
15
15
  isPlayingTimer: m,
16
16
  isTimer: c,
17
- questionType: n,
18
- timerDuration: p,
19
- onTimerExpired: a
20
- }) => /* @__PURE__ */ i(h, { style: { justifyContent: n === t.PREDICTION ? "center" : "space-between" }, children: [
21
- /* @__PURE__ */ i(P, { children: [
22
- o && /* @__PURE__ */ r(C, { children: o }),
23
- e !== void 0 && n !== t.POLL && /* @__PURE__ */ i(d, { children: [
24
- /* @__PURE__ */ r(f, { name: "icon-trophy" }),
25
- /* @__PURE__ */ i(u, { children: [
26
- /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(l, { value: e }) }),
17
+ animatePoints: a,
18
+ questionType: t,
19
+ timerDuration: d,
20
+ onTimerExpired: l
21
+ }) => /* @__PURE__ */ i(P, { style: { justifyContent: t === o.PREDICTION ? "center" : "space-between" }, children: [
22
+ /* @__PURE__ */ i(C, { children: [
23
+ e && /* @__PURE__ */ r(f, { children: e }),
24
+ n !== void 0 && t !== o.POLL && /* @__PURE__ */ i(p, { children: [
25
+ /* @__PURE__ */ r(u, { name: "icon-trophy" }),
26
+ /* @__PURE__ */ i(I, { children: [
27
+ /* @__PURE__ */ r(y, { children: a ? /* @__PURE__ */ r(s, { value: n, delay: 0.3 }) : n }),
27
28
  /* @__PURE__ */ r(T, { children: "PTS" })
28
29
  ] })
29
30
  ] })
30
31
  ] }),
31
- c && n !== t.PREDICTION && /* @__PURE__ */ r(s, { isPlaying: m, onTimerExpired: a, duration: p })
32
+ c && t !== o.PREDICTION && /* @__PURE__ */ r(h, { isPlaying: m, onTimerExpired: l, duration: d })
32
33
  ] });
33
34
  export {
34
- N as WinBar
35
+ R as WinBar
35
36
  };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type ModalProps = {
3
+ Modal: React.ReactNode;
4
+ container: React.MutableRefObject<HTMLDivElement | null>;
5
+ fixedView: boolean;
6
+ useContainer: boolean;
7
+ };
8
+ export declare const createModal: ({ Modal, container, fixedView, useContainer }: ModalProps) => import("react").ReactPortal | null;
9
+ export {};
@@ -0,0 +1,34 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { cx as l } from "@linaria/core";
3
+ import { styled as m } from "@linaria/react";
4
+ import { r as n } from "../../index-jRXrW6ie.js";
5
+ import "../../index-uEuzH3jr.js";
6
+ import "react";
7
+ const c = /* @__PURE__ */ m("div")({
8
+ name: "StaticContainer",
9
+ class: "svm502q",
10
+ propsAsIs: !1
11
+ }), i = "fd3gza8", d = `
12
+ body {
13
+ overflow: hidden !important;
14
+ }
15
+ `, p = `
16
+ .sl-hide-on-modal {
17
+ display: none !important;
18
+ }
19
+ `, C = ({
20
+ Modal: o,
21
+ container: t,
22
+ fixedView: r,
23
+ useContainer: s
24
+ }) => t.current ? s ? n.createPortal(/* @__PURE__ */ a(c, {
25
+ className: l(r && i),
26
+ children: [o, r && /* @__PURE__ */ e("style", {
27
+ children: d
28
+ }), !r && /* @__PURE__ */ e("style", {
29
+ children: p
30
+ })]
31
+ }), t.current, "modal-node") : n.createPortal(o, t.current, "modal-node") : null;
32
+ export {
33
+ C as createModal
34
+ };
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonProps } from '.';
3
3
  export declare const FeaturedGroupsButtonId = "featuredGroups";
4
- export declare const FeaturedGroupsButton: React.FC<Omit<ButtonProps, 'label' | 'id' | 'icon'>>;
4
+ export declare const FeaturedGroupsButton: React.FC<Omit<ButtonProps, 'label' | 'id' | 'icon'> & {
5
+ labelFull: boolean;
6
+ }>;
@@ -1,26 +1,26 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { styled as e } from "@linaria/react";
3
- import { SvgIcon as n } from "../../icons/index.js";
4
- import { Button as s } from "./index.js";
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { styled as r } from "@linaria/react";
3
+ import { SvgIcon as u } from "../../icons/index.js";
4
+ import { Button as n } from "./index.js";
5
5
  import "react";
6
6
  import "./styles.js";
7
- const u = () => n, c = /* @__PURE__ */ e(u())({
7
+ const s = () => u, a = /* @__PURE__ */ r(s())({
8
8
  name: "ButtonIcon",
9
9
  class: "b11des7c",
10
10
  propsAsIs: !0
11
- }), l = "featuredGroups", B = (t) => {
11
+ }), f = "featuredGroups", G = (t) => {
12
12
  var o;
13
- return /* @__PURE__ */ r(s, {
13
+ return /* @__PURE__ */ e(n, {
14
14
  ...t,
15
- label: "FG+",
15
+ label: t.labelFull ? "Featured Groups +" : "FG+",
16
16
  id: "featuredGroups",
17
- icon: /* @__PURE__ */ r(c, {
17
+ icon: /* @__PURE__ */ e(a, {
18
18
  name: "icon-btn-feature-groups",
19
19
  "data-selected": (o = t.active) == null ? void 0 : o.toString()
20
20
  })
21
21
  });
22
22
  };
23
23
  export {
24
- B as FeaturedGroupsButton,
25
- l as FeaturedGroupsButtonId
24
+ G as FeaturedGroupsButton,
25
+ f as FeaturedGroupsButtonId
26
26
  };