@streamlayer/react-ui 1.14.3 → 1.15.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 (64) hide show
  1. package/lib/app/app/Features/Gamification/Leaderboard.js +9 -8
  2. package/lib/app/app/InApp/index.d.ts +4 -0
  3. package/lib/app/app/InApp/index.js +31 -0
  4. package/lib/app/app/Notifications/Onboarding/index.js +78 -72
  5. package/lib/app/app/story/index.d.ts +0 -1
  6. package/lib/app/app/story/index.js +39 -50
  7. package/lib/app/app/story/styles.d.ts +1 -0
  8. package/lib/app/app/story/styles.js +9 -4
  9. package/lib/app/app/story/video.js +28 -25
  10. package/lib/app/masters/Features/Gamification/Leaderboard.js +3 -2
  11. package/lib/assets/style.css +1 -1
  12. package/lib/ui/close-btn/index.d.ts +1 -1
  13. package/lib/ui/gamification/constants.d.ts +1 -0
  14. package/lib/ui/gamification/constants.js +11 -2
  15. package/lib/ui/gamification/points/index.js +7 -7
  16. package/lib/ui/gamification/question/inapp/notification/NotificationMedia/index.d.ts +7 -0
  17. package/lib/ui/gamification/question/inapp/notification/NotificationMedia/index.js +61 -0
  18. package/lib/ui/gamification/question/inapp/notification/index.d.ts +6 -0
  19. package/lib/ui/gamification/question/inapp/notification/index.js +38 -0
  20. package/lib/ui/gamification/question/inapp/notification/styles.d.ts +7 -0
  21. package/lib/ui/gamification/question/inapp/notification/styles.js +40 -0
  22. package/lib/ui/gamification/question/inapp/notification/tweet/index.d.ts +2 -0
  23. package/lib/ui/gamification/question/inapp/notification/tweet/index.js +24 -0
  24. package/lib/ui/gamification/question/inapp/notification/tweet/styles.d.ts +4 -0
  25. package/lib/ui/gamification/question/inapp/notification/tweet/styles.js +24 -0
  26. package/lib/ui/gamification/question/inapp/onboarding/index.d.ts +5 -0
  27. package/lib/ui/gamification/question/inapp/onboarding/index.js +50 -0
  28. package/lib/ui/gamification/question/inapp/onboarding/styles.d.ts +9 -0
  29. package/lib/ui/gamification/question/inapp/onboarding/styles.js +51 -0
  30. package/lib/ui/gamification/question/inapp/prediction-result/frames/content.d.ts +6 -0
  31. package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +57 -0
  32. package/lib/ui/gamification/question/inapp/prediction-result/frames/index.d.ts +12 -0
  33. package/lib/ui/gamification/question/inapp/prediction-result/frames/index.js +59 -0
  34. package/lib/ui/gamification/question/inapp/prediction-result/frames/lines.d.ts +1 -0
  35. package/lib/ui/gamification/question/inapp/prediction-result/frames/lines.js +34 -0
  36. package/lib/ui/gamification/question/inapp/prediction-result/frames/step1.d.ts +1 -0
  37. package/lib/ui/gamification/question/inapp/prediction-result/frames/step1.js +19 -0
  38. package/lib/ui/gamification/question/inapp/prediction-result/frames/step2.d.ts +3 -0
  39. package/lib/ui/gamification/question/inapp/prediction-result/frames/step2.js +26 -0
  40. package/lib/ui/gamification/question/inapp/prediction-result/frames/step3.d.ts +4 -0
  41. package/lib/ui/gamification/question/inapp/prediction-result/frames/step3.js +38 -0
  42. package/lib/ui/gamification/question/inapp/prediction-result/frames/step4.d.ts +3 -0
  43. package/lib/ui/gamification/question/inapp/prediction-result/frames/step4.js +33 -0
  44. package/lib/ui/gamification/question/inapp/prediction-result/frames/styles.d.ts +3 -0
  45. package/lib/ui/gamification/question/inapp/prediction-result/frames/styles.js +20 -0
  46. package/lib/ui/gamification/question/inapp/prediction-result/index.d.ts +9 -0
  47. package/lib/ui/gamification/question/inapp/prediction-result/index.js +7 -0
  48. package/lib/ui/gamification/question/inapp/prediction-result/styles.d.ts +1 -0
  49. package/lib/ui/gamification/question/inapp/prediction-result/styles.js +9 -0
  50. package/lib/ui/gamification/question/index.d.ts +10 -1
  51. package/lib/ui/gamification/question/index.js +45 -36
  52. package/lib/ui/icons/index.d.ts +2 -3
  53. package/lib/ui/icons/index.js +72 -63
  54. package/lib/ui/questions/twitter/account/index.js +17 -17
  55. package/lib/ui/questions/twitter/index.d.ts +1 -0
  56. package/lib/ui/questions/twitter/index.js +2 -1
  57. package/lib/ui/theme/constants.d.ts +6 -0
  58. package/lib/ui/theme/constants.js +20 -14
  59. package/lib/ui/theme/index.d.ts +1 -0
  60. package/lib/ui/theme/index.js +4 -4
  61. package/lib/ui/theme/theme.js +2 -2
  62. package/lib/utils/decorators/container.js +10 -6
  63. package/lib/utils/decorators/styles.js +7 -2
  64. package/package.json +19 -14
@@ -0,0 +1,38 @@
1
+ import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
+ import { styled as e } from "@linaria/react";
3
+ import { SvgIcon as a } from "../../../../../icons/index.js";
4
+ const n = /* @__PURE__ */ e("div")({
5
+ name: "Container",
6
+ class: "c181a1as",
7
+ propsAsIs: !1
8
+ }), c = /* @__PURE__ */ e("div")({
9
+ name: "Title",
10
+ class: "t1cduox6",
11
+ propsAsIs: !1
12
+ }), i = () => a, s = /* @__PURE__ */ e(i())({
13
+ name: "CorrectIcon",
14
+ class: "c1onrv6j",
15
+ propsAsIs: !0
16
+ }), l = () => s, p = /* @__PURE__ */ e(l())({
17
+ name: "InCorrectIcon",
18
+ class: "i17n9o7e",
19
+ propsAsIs: !0
20
+ }), d = () => /* @__PURE__ */ r(n, {
21
+ children: [/* @__PURE__ */ r(c, {
22
+ children: ["Congratulations!", /* @__PURE__ */ o("br", {}), "You answered correctly."]
23
+ }), /* @__PURE__ */ o(s, {
24
+ name: "icon-check"
25
+ })]
26
+ }), u = ({
27
+ title: t
28
+ }) => /* @__PURE__ */ r(n, {
29
+ children: [/* @__PURE__ */ r(c, {
30
+ children: ["Better luck next time!", /* @__PURE__ */ o("br", {}), "Correct: ", t]
31
+ }), /* @__PURE__ */ o(p, {
32
+ name: "icon-cross"
33
+ })]
34
+ });
35
+ export {
36
+ d as CorrectStep,
37
+ u as InCorrectStep
38
+ };
@@ -0,0 +1,3 @@
1
+ export declare const Step4: React.FC<{
2
+ points: number;
3
+ }>;
@@ -0,0 +1,33 @@
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { styled as s } from "@linaria/react";
3
+ import { AnimatedCounter as t } from "../../../../../animated-counter/index.js";
4
+ import { SvgIcon as r } from "../../../../../icons/index.js";
5
+ const c = /* @__PURE__ */ s("div")({
6
+ name: "Container",
7
+ class: "cnxgcs2",
8
+ propsAsIs: !1
9
+ }), i = /* @__PURE__ */ s("div")({
10
+ name: "Title",
11
+ class: "t903f8n",
12
+ propsAsIs: !1
13
+ }), p = () => r, a = /* @__PURE__ */ s(p())({
14
+ name: "CheckIcon",
15
+ class: "ceyu3qj",
16
+ propsAsIs: !0
17
+ }), u = ({
18
+ points: n
19
+ }) => /* @__PURE__ */ o(c, {
20
+ children: [/* @__PURE__ */ o(i, {
21
+ children: ["You won ", /* @__PURE__ */ e(t, {
22
+ delay: 0.5,
23
+ prefix: "+",
24
+ suffix: " points",
25
+ value: n
26
+ })]
27
+ }), /* @__PURE__ */ e(a, {
28
+ name: "icon-trophy-solid"
29
+ })]
30
+ });
31
+ export {
32
+ u as Step4
33
+ };
@@ -0,0 +1,3 @@
1
+ export declare const Container: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
+ export declare const Body: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const FeedbackIcon: any;
@@ -0,0 +1,20 @@
1
+ import { styled as s } from "@linaria/react";
2
+ import { SvgIcon as o } from "../../../../../icons/index.js";
3
+ const a = /* @__PURE__ */ s("div")({
4
+ name: "Container",
5
+ class: "cq3agu2",
6
+ propsAsIs: !1
7
+ }), r = /* @__PURE__ */ s("div")({
8
+ name: "Body",
9
+ class: "b16qj0do",
10
+ propsAsIs: !1
11
+ }), e = () => o, t = /* @__PURE__ */ s(e())({
12
+ name: "FeedbackIcon",
13
+ class: "f9m7c89",
14
+ propsAsIs: !0
15
+ });
16
+ export {
17
+ r as Body,
18
+ a as Container,
19
+ t as FeedbackIcon
20
+ };
@@ -0,0 +1,9 @@
1
+ import { Notification as NotificationProps } from '@streamlayer/sdk-web-notifications';
2
+ type InAppProps = NotificationProps['data'] & {
3
+ action: NotificationProps['action'];
4
+ };
5
+ export declare const InAppPredictionResult: React.FC<Exclude<InAppProps['question'], undefined> & {
6
+ action?: () => void;
7
+ close?: () => void;
8
+ }>;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { PredictionResult as t } from "./frames/index.js";
3
+ import { NotificationContainer as i } from "./styles.js";
4
+ const p = (r) => /* @__PURE__ */ o(i, { children: /* @__PURE__ */ o(t, { ...r }) });
5
+ export {
6
+ p as InAppPredictionResult
7
+ };
@@ -0,0 +1 @@
1
+ export declare const NotificationContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -0,0 +1,9 @@
1
+ import { styled as i } from "@linaria/react";
2
+ const t = /* @__PURE__ */ i("div")({
3
+ name: "NotificationContainer",
4
+ class: "n1i4h28u",
5
+ propsAsIs: !1
6
+ });
7
+ export {
8
+ t as NotificationContainer
9
+ };
@@ -1,3 +1,12 @@
1
- import { PickHistory } from '@streamlayer/sdk-web-types';
1
+ import { QuestionType, QuestionStatus, PickHistory } from '@streamlayer/sdk-web-types';
2
+ import { icons } from '../../icons';
2
3
  export declare const QuestionSkeleton: React.FC;
4
+ export declare const QuestionTypeHeader: React.FC<{
5
+ questionTypeData: {
6
+ label: string;
7
+ iconName: keyof typeof icons;
8
+ };
9
+ questionType: QuestionType;
10
+ questionStatus: QuestionStatus;
11
+ }>;
3
12
  export declare const Question: React.FC<PickHistory>;
@@ -1,49 +1,58 @@
1
1
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import { PickHistoryStatus as e, QuestionType as r, QuestionStatus as p } from "@streamlayer/sdk-web-types";
3
- import { QuestionTypeData as h } from "../constants.js";
4
- import { Skeleton as a } from "../../skeleton/index.js";
5
- import { QuestionActionIcon as c, QuestionCheckIcon as y, SkeletonContainer as I, SkeletonButton as S, QuestionItem as k, QuestionContent as f, QuestionCaption as A, QuestionTypeIcon as T, QuestionTypeLabel as L, QuestionBody as P, QuestionAction as w, PlayButton as x } from "./styles.js";
6
- const C = {
7
- [e.LOST]: /* @__PURE__ */ t(c, { name: "incorrectVoted" }),
8
- [e.WON]: /* @__PURE__ */ t(y, { name: "icon-check" }),
9
- [e.UNSET]: /* @__PURE__ */ t(c, { name: "icon-arrow" }),
10
- [e.DNP]: /* @__PURE__ */ t(c, { name: "icon-arrow" })
11
- }, B = () => /* @__PURE__ */ n(I, { children: [
12
- /* @__PURE__ */ t(a, { loading: !0, style: { width: "35%" } }),
13
- /* @__PURE__ */ t(a, { loading: !0, style: { width: "70%" } }),
14
- /* @__PURE__ */ t(S, {})
2
+ import { PickHistoryStatus as i, QuestionType as s, QuestionStatus as p } from "@streamlayer/sdk-web-types";
3
+ import { QuestionTypeData as y } from "../constants.js";
4
+ import { Skeleton as l } from "../../skeleton/index.js";
5
+ import { QuestionActionIcon as a, QuestionCheckIcon as h, SkeletonContainer as S, SkeletonButton as I, QuestionCaption as L, QuestionTypeIcon as T, QuestionTypeLabel as k, QuestionItem as N, QuestionContent as f, QuestionBody as A, QuestionAction as C, PlayButton as P } from "./styles.js";
6
+ const w = {
7
+ [i.LOST]: /* @__PURE__ */ t(a, { name: "incorrectVoted" }),
8
+ [i.WON]: /* @__PURE__ */ t(h, { name: "icon-check" }),
9
+ [i.UNSET]: /* @__PURE__ */ t(a, { name: "icon-arrow" }),
10
+ [i.DNP]: /* @__PURE__ */ t(a, { name: "icon-arrow" })
11
+ }, D = () => /* @__PURE__ */ n(S, { children: [
12
+ /* @__PURE__ */ t(l, { loading: !0, style: { width: "35%" } }),
13
+ /* @__PURE__ */ t(l, { loading: !0, style: { width: "70%" } }),
14
+ /* @__PURE__ */ t(I, {})
15
+ ] }), x = ({ questionTypeData: o, questionType: e, questionStatus: r }) => /* @__PURE__ */ n(L, { className: "SL_QuestionCaption", children: [
16
+ /* @__PURE__ */ t(
17
+ T,
18
+ {
19
+ className: "SL_QuestionTypeIcon",
20
+ "data-testid": "question-type-icon",
21
+ "data-type-trivia": e === s.TRIVIA,
22
+ "data-type-poll": e === s.POLL,
23
+ name: o.iconName
24
+ }
25
+ ),
26
+ /* @__PURE__ */ n(k, { className: "SL_QuestionTypeLabel", children: [
27
+ o.label,
28
+ e === s.TRIVIA && r === p.RESOLVED && " • Expired"
29
+ ] })
15
30
  ] }), R = ({
16
- questionId: s,
17
- questionType: o,
18
- questionStatus: l,
31
+ questionId: o,
32
+ questionType: e,
33
+ questionStatus: r,
19
34
  subject: u,
20
35
  openForVoting: d,
21
36
  status: m
22
37
  }) => {
23
- const i = h[o], Q = C[m];
24
- return i ? /* @__PURE__ */ n(k, { "data-name": s, children: [
38
+ const c = y[e], Q = w[m];
39
+ return c ? /* @__PURE__ */ n(N, { "data-name": o, children: [
25
40
  /* @__PURE__ */ n(f, { children: [
26
- /* @__PURE__ */ n(A, { children: [
27
- /* @__PURE__ */ t(
28
- T,
29
- {
30
- "data-testid": "question-type-icon",
31
- "data-type-trivia": o === r.TRIVIA,
32
- "data-type-poll": o === r.POLL,
33
- name: i.iconName
34
- }
35
- ),
36
- /* @__PURE__ */ n(L, { children: [
37
- i.label,
38
- o === r.TRIVIA && l === p.RESOLVED && " • Expired"
39
- ] })
40
- ] }),
41
- /* @__PURE__ */ t(P, { children: u || "" })
41
+ /* @__PURE__ */ t(
42
+ x,
43
+ {
44
+ questionTypeData: c,
45
+ questionType: e,
46
+ questionStatus: r
47
+ }
48
+ ),
49
+ /* @__PURE__ */ t(A, { children: u || "" })
42
50
  ] }),
43
- /* @__PURE__ */ t(w, { children: d ? /* @__PURE__ */ t(x, { children: "Play" }) : Q })
51
+ /* @__PURE__ */ t(C, { children: d ? /* @__PURE__ */ t(P, { children: "Play" }) : Q })
44
52
  ] }) : null;
45
53
  };
46
54
  export {
47
55
  R as Question,
48
- B as QuestionSkeleton
56
+ D as QuestionSkeleton,
57
+ x as QuestionTypeHeader
49
58
  };
@@ -2,6 +2,7 @@ export declare const icons: {
2
2
  'invite-game-icon': any;
3
3
  'icon-trophy': any;
4
4
  'icon-trophy-green': any;
5
+ 'icon-trophy-solid': any;
5
6
  'icon-trivia': any;
6
7
  'icon-thumb-down': any;
7
8
  'icon-thumb-up': any;
@@ -52,9 +53,7 @@ export declare const icons: {
52
53
  chevronRight: any;
53
54
  noImageIcon: any;
54
55
  };
55
- export declare const Icon: React.FC<{
56
- name: keyof typeof icons;
57
- }>;
56
+ export declare const IconsLibrary: () => import("react/jsx-runtime").JSX.Element;
58
57
  type SvgIconProps = {
59
58
  name: keyof typeof icons;
60
59
  style?: React.CSSProperties;