@streamlayer/react-ui 0.54.1 → 0.56.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 (81) hide show
  1. package/lib/index.d.ts +5 -12
  2. package/lib/index.js +6 -111
  3. package/lib/ui/app/Features/Gamification/Question.js +9 -9
  4. package/lib/ui/app/Features/Gamification/QuestionsList.js +8 -6
  5. package/lib/ui/app/Features/Gamification/Tabs.js +7 -5
  6. package/lib/ui/app/Features/Gamification/index.d.ts +0 -2
  7. package/lib/ui/app/Features/Gamification/index.js +6 -5
  8. package/lib/ui/app/Notifications/index.js +21 -15
  9. package/lib/ui/app/Notifications/styles.d.ts +1 -0
  10. package/lib/ui/app/Notifications/styles.js +17 -0
  11. package/lib/ui/app/masters.js +43 -31
  12. package/lib/ui/gamification/question/insight/index.d.ts +5 -0
  13. package/lib/ui/gamification/question/insight/index.js +35 -0
  14. package/lib/ui/gamification/question/insight/styles.d.ts +7 -0
  15. package/lib/ui/gamification/question/insight/styles.js +66 -0
  16. package/lib/ui/gamification/question/list/index.js +13 -11
  17. package/lib/ui/gamification/question/notification/index.d.ts +3 -0
  18. package/lib/ui/gamification/question/notification/index.js +30 -0
  19. package/lib/ui/gamification/question/notification/insight/index.d.ts +6 -0
  20. package/lib/ui/gamification/question/notification/insight/index.js +23 -0
  21. package/lib/ui/gamification/question/notification/insight/styles.d.ts +6 -0
  22. package/lib/ui/gamification/question/notification/insight/styles.js +60 -0
  23. package/lib/ui/gamification/question/notification/prediction-result/index.d.ts +3 -0
  24. package/lib/ui/gamification/question/notification/prediction-result/index.js +7 -0
  25. package/lib/ui/gamification/question/notification/prediction-result/styles.d.ts +2 -0
  26. package/lib/ui/gamification/question/notification/prediction-result/styles.js +12 -0
  27. package/lib/ui/gamification/question/notification/styles.d.ts +9 -0
  28. package/lib/ui/gamification/question/notification/styles.js +87 -0
  29. package/lib/ui/gamification/vote/insight-details/index.d.ts +4 -2
  30. package/lib/ui/gamification/vote/insight-details/index.js +31 -15
  31. package/lib/ui/gamification/vote/insight-details/styles.d.ts +1 -0
  32. package/lib/ui/gamification/vote/insight-details/styles.js +8 -2
  33. package/lib/ui/show-in/index.d.ts +1 -0
  34. package/lib/ui/show-in/index.js +35 -6
  35. package/package.json +17 -12
  36. package/lib/ui/demo/DemoPoints.d.ts +0 -5
  37. package/lib/ui/demo/DemoPoints.js +0 -28
  38. package/lib/ui/demo/Gamification.d.ts +0 -7
  39. package/lib/ui/demo/Gamification.js +0 -114
  40. package/lib/ui/demo/Highlights.d.ts +0 -7
  41. package/lib/ui/demo/Highlights.js +0 -66
  42. package/lib/ui/demo/Login.d.ts +0 -5
  43. package/lib/ui/demo/Login.js +0 -26
  44. package/lib/ui/demo/components/EventProvider.d.ts +0 -2
  45. package/lib/ui/demo/components/EventProvider.js +0 -5
  46. package/lib/ui/demo/components/Insight.d.ts +0 -8
  47. package/lib/ui/demo/components/Insight.js +0 -32
  48. package/lib/ui/demo/components/Insights.d.ts +0 -7
  49. package/lib/ui/demo/components/Insights.js +0 -15
  50. package/lib/ui/demo/components/Leaderboard.d.ts +0 -5
  51. package/lib/ui/demo/components/Leaderboard.js +0 -35
  52. package/lib/ui/demo/components/Question.d.ts +0 -7
  53. package/lib/ui/demo/components/Question.js +0 -89
  54. package/lib/ui/demo/components/QuestionsList.d.ts +0 -6
  55. package/lib/ui/demo/components/QuestionsList.js +0 -22
  56. package/lib/ui/demo/components/UserSummary.d.ts +0 -5
  57. package/lib/ui/demo/components/UserSummary.js +0 -17
  58. package/lib/ui/demo/components/index.d.ts +0 -7
  59. package/lib/ui/demo/components/index.js +0 -70
  60. package/lib/ui/demo/index.d.ts +0 -5
  61. package/lib/ui/demo/index.js +0 -180
  62. package/lib/ui/demo/styles.d.ts +0 -6
  63. package/lib/ui/demo/styles.js +0 -58
  64. package/lib/ui/notifications/decorator.d.ts +0 -4
  65. package/lib/ui/notifications/decorator.js +0 -64
  66. package/lib/ui/notifications/index.d.ts +0 -5
  67. package/lib/ui/notifications/index.js +0 -28
  68. package/lib/ui/notifications/notification/index.d.ts +0 -6
  69. package/lib/ui/notifications/notification/index.js +0 -36
  70. package/lib/ui/notifications/notification/onboarding-inapp/index.d.ts +0 -3
  71. package/lib/ui/notifications/notification/onboarding-inapp/index.js +0 -25
  72. package/lib/ui/notifications/notification/onboarding-inapp/styles.d.ts +0 -12
  73. package/lib/ui/notifications/notification/onboarding-inapp/styles.js +0 -77
  74. package/lib/ui/notifications/notification/question-inapp/index.d.ts +0 -3
  75. package/lib/ui/notifications/notification/question-inapp/index.js +0 -23
  76. package/lib/ui/notifications/notification/question-inapp/styles.d.ts +0 -10
  77. package/lib/ui/notifications/notification/question-inapp/styles.js +0 -61
  78. package/lib/ui/notifications/notification/styles.d.ts +0 -2
  79. package/lib/ui/notifications/notification/styles.js +0 -32
  80. package/lib/ui/notifications/styles.d.ts +0 -2
  81. package/lib/ui/notifications/styles.js +0 -15
@@ -0,0 +1,30 @@
1
+ import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
+ import { QuestionType as m } from "@streamlayer/sdk-web-types";
3
+ import { QuestionTypeData as l } from "../../constants.js";
4
+ import { Insight as a } from "./insight/index.js";
5
+ import { Container as s, CloseIconWrap as d, CloseIcon as f, Header as h, TypeIcon as C, TypeName as I, Question as T, AnswerButton as A } from "./styles.js";
6
+ import "../../../video-player/index.js";
7
+ import "react";
8
+ import "../../../icons/index.js";
9
+ import "@linaria/react";
10
+ import "../../../video-player/styles.js";
11
+ import "./insight/styles.js";
12
+ const b = ({
13
+ close: c,
14
+ action: t,
15
+ data: { questionType: o, question: i, insight: p }
16
+ }) => {
17
+ const n = l[o];
18
+ return n ? /* @__PURE__ */ e(s, { children: [
19
+ /* @__PURE__ */ r(d, { onClick: c, children: /* @__PURE__ */ r(f, { name: "icon-cross" }) }),
20
+ /* @__PURE__ */ e(h, { children: [
21
+ /* @__PURE__ */ r(C, { name: n.iconName }),
22
+ /* @__PURE__ */ r(I, { children: n.label })
23
+ ] }),
24
+ o === m.FACTOID ? /* @__PURE__ */ r(a, { ...p, action: t }) : /* @__PURE__ */ r(T, { children: i == null ? void 0 : i.title }),
25
+ o !== m.FACTOID && /* @__PURE__ */ r(A, { onClick: t, children: "Answer" })
26
+ ] }) : null;
27
+ };
28
+ export {
29
+ b as Notification
30
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { Notification } from '@streamlayer/sdk-web-notifications';
3
+ import { InstantView } from '@streamlayer/sdk-web-types';
4
+ export declare const Insight: React.FC<InstantView & {
5
+ action: Notification['action'];
6
+ }>;
@@ -0,0 +1,23 @@
1
+ import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
+ import { VideoPlayer as l } from "../../../../video-player/index.js";
3
+ import { InsightContainer as m, InsightContent as s, Title as h, Description as p, ActionBtn as c } from "./styles.js";
4
+ import "react";
5
+ import "../../../../icons/index.js";
6
+ import "@linaria/react";
7
+ import "../../../../video-player/styles.js";
8
+ const a = ({
9
+ video: i,
10
+ heading: o,
11
+ body: e,
12
+ action: t
13
+ }) => /* @__PURE__ */ n(m, { children: [
14
+ i && /* @__PURE__ */ r(l, { source: i.url, poster: i.thumbnailUrl }),
15
+ /* @__PURE__ */ n(s, { children: [
16
+ /* @__PURE__ */ r(h, { children: o }),
17
+ /* @__PURE__ */ r(p, { children: e }),
18
+ t && /* @__PURE__ */ r(c, { onClick: t, children: "View Insight" })
19
+ ] })
20
+ ] });
21
+ export {
22
+ a as Insight
23
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const InsightContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
+ export declare const InsightContent: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & Record<never, unknown>>;
5
+ export declare const Description: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const ActionBtn: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
@@ -0,0 +1,60 @@
1
+ import { styled as o } from "@linaria/react";
2
+ const r = o.div`
3
+ box-sizing: border-box;
4
+ display: flex;
5
+ flex-direction: column;
6
+ row-gap: 16px;
7
+ background-color: var(--color-neutrals-white);
8
+ border-radius: 8px;
9
+ width: 100%;
10
+ `, t = o.div`
11
+ display: flex;
12
+ flex-direction: column;
13
+ row-gap: 12px;
14
+ `, i = o.h3`
15
+ color: var(--color-primary-green2);
16
+ font-size: 16px;
17
+ line-height: 26px;
18
+ font-weight: 400;
19
+ font-family: var(--font-serif);
20
+ font-weight: var(--font-weight-default);
21
+ `, n = o.div`
22
+ color: var(--color-neutrals-gray9);
23
+ font-size: 12px;
24
+ line-height: 24px;
25
+ font-weight: 550;
26
+ font-weight: var(--font-weight-default);
27
+ display: -webkit-box;
28
+ -webkit-box-orient: vertical;
29
+ -webkit-line-clamp: 2;
30
+ overflow: hidden;
31
+ word-break: break-all;
32
+ text-overflow: ellipsis;
33
+ max-height: 50px;
34
+ `, l = o.button`
35
+ border: none;
36
+ outline: none;
37
+ background-color: var(--color-primary-green1);
38
+ color: var(--color-white);
39
+ border-radius: 40px;
40
+ display: flex;
41
+ justify-content: center;
42
+ align-items: center;
43
+ font-size: 14px;
44
+ font-weight: 550;
45
+ width: 100%;
46
+ padding: 0px 16px;
47
+ height: 44px;
48
+
49
+ &:hover {
50
+ background-color: var(--color-primary-green2);
51
+ cursor: pointer;
52
+ }
53
+ `;
54
+ export {
55
+ l as ActionBtn,
56
+ n as Description,
57
+ r as InsightContainer,
58
+ t as InsightContent,
59
+ i as Title
60
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { Notification as NotificationProps } from '@streamlayer/sdk-web-notifications';
3
+ export declare const PredictionResult: React.FC<NotificationProps>;
@@ -0,0 +1,7 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { PredictionResultContainer as t } from "./styles.js";
3
+ import "@linaria/react";
4
+ const c = ({ close: r }) => /* @__PURE__ */ o(t, { children: /* @__PURE__ */ o("button", { onClick: r, children: "close" }) });
5
+ export {
6
+ c as PredictionResult
7
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const PredictionResultContainer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -0,0 +1,12 @@
1
+ import { styled as r } from "@linaria/react";
2
+ const i = r.div`
3
+ box-sizing: border-box;
4
+ width: 100%;
5
+ height: 118px;
6
+ border-radius: 10px;
7
+ background-color: var(--color-primary-green2);
8
+ position: relative;
9
+ `;
10
+ export {
11
+ i as PredictionResultContainer
12
+ };
@@ -0,0 +1,9 @@
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 CloseIconWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const CloseIcon: any;
5
+ export declare const Header: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const TypeIcon: any;
7
+ export declare const TypeName: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
8
+ export declare const Question: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
9
+ export declare const AnswerButton: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
@@ -0,0 +1,87 @@
1
+ import { styled as o } from "@linaria/react";
2
+ import { SvgIcon as r } from "../../../icons/index.js";
3
+ import "react/jsx-runtime";
4
+ import "react";
5
+ const p = o.div`
6
+ box-sizing: border-box;
7
+ overflow: hidden;
8
+ border-radius: 8px;
9
+ background: #fff;
10
+ width: 100%;
11
+ padding: 16px;
12
+ position: relative;
13
+ `, a = o.div`
14
+ position: absolute;
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ width: 20px;
19
+ height: 20px;
20
+ right: 11px;
21
+ top: 11px;
22
+ cursor: pointer;
23
+ `, c = o(r)`
24
+ g > path {
25
+ stroke: var(--color-neutrals-gray7);
26
+ }
27
+
28
+ &:hover {
29
+ path {
30
+ stroke: var(--color-primary-green2);
31
+ }
32
+ }
33
+ `, s = o.div`
34
+ margin-bottom: 12px;
35
+ display: flex;
36
+ align-items: center;
37
+ `, l = o(r)`
38
+ width: 20px;
39
+ height: 20px;
40
+ margin-right: 4px;
41
+
42
+ path {
43
+ fill: var(--color-primary-green1);
44
+ fill-opacity: 1;
45
+ }
46
+ `, g = o.span`
47
+ color: var(--color-neutrals-gray7);
48
+ font-weight: 550;
49
+ font-size: 12px;
50
+ `, d = o.div`
51
+ font-weight: 400;
52
+ font-size: 16px;
53
+ color: var(--color-primary-green2);
54
+ margin-bottom: 12px;
55
+ padding-right: 10px;
56
+ font-family: var(--font-serif);
57
+ `, x = o.button`
58
+ background-color: var(--color-primary-green1);
59
+ color: var(--color-white);
60
+ border-radius: 40px;
61
+ border: none;
62
+ outline: none;
63
+ cursor: pointer;
64
+ width: 100%;
65
+ display: flex;
66
+ justify-content: center;
67
+ align-items: center;
68
+ font-size: 14px;
69
+ font-weight: 550;
70
+ padding: 0px 16px;
71
+ height: 44px;
72
+
73
+ &:hover {
74
+ background-color: var(--color-primary-green2);
75
+ cursor: pointer;
76
+ }
77
+ `;
78
+ export {
79
+ x as AnswerButton,
80
+ c as CloseIcon,
81
+ a as CloseIconWrap,
82
+ p as Container,
83
+ s as Header,
84
+ d as Question,
85
+ l as TypeIcon,
86
+ g as TypeName
87
+ };
@@ -1,3 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { InsightHistory } from '@streamlayer/sdk-web-types';
3
- export declare const InsightDetails: React.FC<InsightHistory>;
2
+ import { InsightHistory, FeedItem } from '@streamlayer/sdk-web-types';
3
+ export declare const InsightDetails: React.FC<InsightHistory & {
4
+ created: FeedItem['created'];
5
+ }>;
@@ -1,21 +1,37 @@
1
- import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
- import { SvgIcon as d } from "../../../icons/index.js";
3
- import { VideoPlayer as e } from "../../../video-player/index.js";
4
- import { Container as p, Content as c, Title as h, Description as b, WebLinkBtn as f } from "./styles.js";
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { SvgIcon as p } from "../../../icons/index.js";
3
+ import { VideoPlayer as g } from "../../../video-player/index.js";
4
+ import { Container as u, DateWrap as S, Content as b, Title as f, Description as k, WebLinkBtn as D } from "./styles.js";
5
5
  import "@linaria/react";
6
6
  import "react";
7
7
  import "../../../video-player/styles.js";
8
- const j = ({ title: m, instantView: r }) => /* @__PURE__ */ l(p, { children: [
9
- (r == null ? void 0 : r.video) && /* @__PURE__ */ o(e, { source: r.video.url, poster: r.video.thumbnailUrl }),
10
- /* @__PURE__ */ l(c, { children: [
11
- /* @__PURE__ */ o(h, { children: (r == null ? void 0 : r.heading) || m }),
12
- /* @__PURE__ */ o(b, { children: r == null ? void 0 : r.body }),
13
- (r == null ? void 0 : r.webLink) && /* @__PURE__ */ l(f, { href: "webLink", target: "_blank", children: [
14
- "Explore more of the Masters History",
15
- /* @__PURE__ */ o(d, { name: "icon-external-link" })
8
+ const C = ({
9
+ created: m,
10
+ title: c,
11
+ instantView: o
12
+ }) => {
13
+ const l = new Date(m), d = l.toLocaleDateString("en-US", {
14
+ weekday: "short",
15
+ month: "short",
16
+ day: "numeric"
17
+ }), h = l.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" });
18
+ return /* @__PURE__ */ r(u, { children: [
19
+ /* @__PURE__ */ r(S, { children: [
20
+ d,
21
+ "・",
22
+ h
23
+ ] }),
24
+ (o == null ? void 0 : o.video) && /* @__PURE__ */ e(g, { source: o.video.url, poster: o.video.thumbnailUrl }),
25
+ /* @__PURE__ */ r(b, { children: [
26
+ /* @__PURE__ */ e(f, { children: (o == null ? void 0 : o.heading) || c }),
27
+ /* @__PURE__ */ e(k, { children: o == null ? void 0 : o.body }),
28
+ (o == null ? void 0 : o.webLink) && /* @__PURE__ */ r(D, { href: o == null ? void 0 : o.webLink.url, target: "_blank", children: [
29
+ "Explore more of the Masters History",
30
+ /* @__PURE__ */ e(p, { name: "icon-external-link" })
31
+ ] })
16
32
  ] })
17
- ] })
18
- ] });
33
+ ] });
34
+ };
19
35
  export {
20
- j as InsightDetails
36
+ C as InsightDetails
21
37
  };
@@ -4,3 +4,4 @@ export declare const Content: import("@linaria/react").StyledComponent<import("r
4
4
  export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & Record<never, unknown>>;
5
5
  export declare const Description: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
6
  export declare const WebLinkBtn: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLAnchorElement> & import("react").AnchorHTMLAttributes<HTMLAnchorElement> & Record<never, unknown>>;
7
+ export declare const DateWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -1,10 +1,11 @@
1
1
  import { styled as o } from "@linaria/react";
2
- const t = o.div`
2
+ const e = o.div`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  row-gap: 16px;
6
6
  padding: var(--container-padding);
7
7
  background-color: var(--color-neutrals-white);
8
+ width: 100%;
8
9
  `, r = o.div`
9
10
  display: flex;
10
11
  flex-direction: column;
@@ -33,10 +34,15 @@ const t = o.div`
33
34
  border-radius: 40px;
34
35
  border: 1px solid var(--color-primary-green1);
35
36
  text-decoration: none;
37
+ `, l = o.div`
38
+ font-size: 12px;
39
+ font-weight: 550;
40
+ color: var(--color-neutrals-gray7);
36
41
  `;
37
42
  export {
38
- t as Container,
43
+ e as Container,
39
44
  r as Content,
45
+ l as DateWrap,
40
46
  i as Description,
41
47
  n as Title,
42
48
  a as WebLinkBtn
@@ -3,4 +3,5 @@ export declare const ShowIn: React.FC<{
3
3
  children: React.ReactNode | React.ReactNode[];
4
4
  style?: React.CSSProperties;
5
5
  className?: string;
6
+ hiding?: boolean;
6
7
  }>;
@@ -1,13 +1,15 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { styled as r } from "@linaria/react";
3
- const n = r.div`
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { css as r, cx as e } from "@linaria/core";
3
+ import { styled as m } from "@linaria/react";
4
+ const s = m.div`
4
5
  overflow: hidden;
5
6
  width: 100%;
6
7
  transform: scale(1);
7
8
  opacity: 1;
8
9
  max-height: 500px;
9
10
 
10
- animation: containerShowIn 0.1s ease-out;
11
+ animation: containerShowIn ease-out;
12
+ animation-duration: var(--animation-duration);
11
13
 
12
14
  @keyframes containerShowIn {
13
15
  0% {
@@ -30,7 +32,34 @@ const n = r.div`
30
32
  max-height: 500px;
31
33
  }
32
34
  }
33
- `, m = ({ children: t, style: a, className: o }) => /* @__PURE__ */ e(n, { style: a, className: o, children: t });
35
+ `, c = r`
36
+ animation: containerHide ease-out;
37
+ animation-duration: var(--animation-duration);
38
+ animation-direction: reverse;
39
+ animation-fill-mode: forwards;
40
+
41
+ @keyframes containerHide {
42
+ 0% {
43
+ transform: scale(0);
44
+ opacity: 0;
45
+ max-height: 0;
46
+ }
47
+ 80% {
48
+ opacity: 0;
49
+ transform: scale(0.9);
50
+ max-height: 500px;
51
+ }
52
+ 85% {
53
+ transform: scale(0.9);
54
+ max-height: 500px;
55
+ }
56
+ 100% {
57
+ transform: scale(1);
58
+ opacity: 1;
59
+ max-height: 500px;
60
+ }
61
+ }
62
+ `, f = ({ children: a, style: i, className: t, hiding: o }) => /* @__PURE__ */ n(s, { style: i, className: e(t, o && c), children: a });
34
63
  export {
35
- m as ShowIn
64
+ f as ShowIn
36
65
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.54.1",
3
+ "version": "0.56.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -15,6 +15,11 @@
15
15
  "default": "./lib/ui/app/masters.js",
16
16
  "types": "./lib/ui/app/masters.d.js"
17
17
  },
18
+ "./points": {
19
+ "import": "./lib/ui/gamification/points/index.js",
20
+ "default": "./lib/ui/gamification/points/index.js",
21
+ "types": "./lib/ui/gamification/points/index.d.js"
22
+ },
18
23
  "./*": {
19
24
  "import": "./lib/*/index.js",
20
25
  "default": "./lib/*/index.js",
@@ -26,20 +31,20 @@
26
31
  "package.json"
27
32
  ],
28
33
  "peerDependencies": {
29
- "@streamlayer/sl-eslib": "^5.53.5",
34
+ "@streamlayer/sl-eslib": "^5.53.6",
30
35
  "react-virtualized-auto-sizer": "^1.0.20",
31
36
  "react-window": "^1.8.9",
32
37
  "react-window-infinite-loader": "^1.0.9",
33
- "@streamlayer/feature-gamification": "^0.21.1",
34
- "@streamlayer/sdk-web": "^0.28.15",
35
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.10",
38
+ "@streamlayer/feature-gamification": "^0.22.0",
39
+ "@streamlayer/sdk-web": "^0.28.17",
40
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.12",
36
41
  "@streamlayer/sdk-web-api": "^0.0.1",
37
- "@streamlayer/sdk-web-core": "^0.17.4",
38
- "@streamlayer/sdk-web-features": "^0.10.18",
39
- "@streamlayer/sdk-web-interfaces": "^0.18.11",
40
- "@streamlayer/sdk-web-notifications": "^0.10.10",
41
- "@streamlayer/sdk-web-storage": "^0.0.1",
42
- "@streamlayer/sdk-web-types": "^0.18.1"
42
+ "@streamlayer/sdk-web-core": "^0.17.6",
43
+ "@streamlayer/sdk-web-features": "^0.10.20",
44
+ "@streamlayer/sdk-web-interfaces": "^0.18.13",
45
+ "@streamlayer/sdk-web-notifications": "^0.11.0",
46
+ "@streamlayer/sdk-web-storage": "^0.0.2",
47
+ "@streamlayer/sdk-web-types": "^0.19.0"
43
48
  },
44
49
  "nx": {
45
50
  "implicitDependencies": [
@@ -78,6 +83,6 @@
78
83
  "vite-plugin-svgr": "^4.1.0",
79
84
  "vite-svg-loader": "^4.0.0",
80
85
  "vite-tsconfig-paths": "^4.2.1",
81
- "@streamlayer/react": "^0.27.1"
86
+ "@streamlayer/react": "^0.28.0"
82
87
  }
83
88
  }
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
- export declare const DemoPoints: React.FC<{
4
- sdk: StreamLayerSDK;
5
- }>;
@@ -1,28 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { FeatureType as s } from "@streamlayer/sdk-web-types";
3
- import { useStore as p } from "@nanostores/react";
4
- import { styled as u } from "@linaria/react";
5
- import { Points as a } from "../gamification/points/index.js";
6
- import "../theme/theme.js";
7
- import "@linaria/core";
8
- import "../theme/constants.js";
9
- import "../../utils/common.js";
10
- import "../gamification/points/styles.js";
11
- import "../icons/index.js";
12
- import "react";
13
- import "../theme/breakpoints.js";
14
- const d = u.div`
15
- position: fixed;
16
- top: 0;
17
- right: 0;
18
- `, f = ({ store: o }) => {
19
- var m, i, e, n;
20
- const t = p(o);
21
- return ((i = (m = t.data) == null ? void 0 : m.summary) == null ? void 0 : i.points) === void 0 ? null : /* @__PURE__ */ r(d, { children: ((n = (e = t.data) == null ? void 0 : e.summary) == null ? void 0 : n.points) && /* @__PURE__ */ r(a, { points: t.data.summary.points }) });
22
- }, A = ({ sdk: o }) => {
23
- const t = o.getFeature(s.GAMES);
24
- return t != null && t.userSummary ? /* @__PURE__ */ r(f, { store: t.userSummary.getStore() }) : null;
25
- };
26
- export {
27
- A as DemoPoints
28
- };
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
- import type { Gamification } from '@streamlayer/feature-gamification';
4
- export declare const GamificationComponent: React.FC<{
5
- gamification: Gamification;
6
- sdk: StreamLayerSDK;
7
- }>;
@@ -1,114 +0,0 @@
1
- import { jsx as t, jsxs as s, Fragment as z } from "react/jsx-runtime";
2
- import { FeatureStatus as J } from "@streamlayer/sdk-web-interfaces";
3
- import { useStore as p } from "@nanostores/react";
4
- import { useState as K } from "react";
5
- import { ActivePages as a, Tabs as N } from "../gamification/tabs/index.js";
6
- import { UserSummary as V } from "./components/UserSummary.js";
7
- import { QuestionsList as W } from "./components/QuestionsList.js";
8
- import { Question as X } from "./components/Question.js";
9
- import { Onboarding as Y } from "../gamification/onboarding/index.js";
10
- import "@streamlayer/sdk-web-types";
11
- import "../gamification/insight/styles.js";
12
- import "../gamification/insight-list/styles.js";
13
- import "../gamification/common-header/styles.js";
14
- import "../gamification/detailed-insight/styles.js";
15
- import { Leaderboard as Z } from "./components/Leaderboard.js";
16
- import { DemoContainer as m, UserStatisticsContainer as _, QuestionsContainer as $ } from "./styles.js";
17
- import "../gamification/tabs/styles.js";
18
- import "@linaria/react";
19
- import "../gamification/user-statistics/index.js";
20
- import "../../utils/common.js";
21
- import "../gamification/user-statistics/components/rank/index.js";
22
- import "../gamification/user-statistics/components/rank/styles.js";
23
- import "../gamification/user-statistics/components/statistic/index.js";
24
- import "../gamification/user-statistics/components/statistic/styles.js";
25
- import "../gamification/user-statistics/styles.js";
26
- import "../gamification/question/list/index.js";
27
- import "../gamification/insight/index.js";
28
- import "../gamification/question/index.js";
29
- import "../button/index.js";
30
- import "../button/styles.js";
31
- import "../gamification/constants.js";
32
- import "../gamification/question/styles.js";
33
- import "../icons/index.js";
34
- import "../gamification/question/list/styles.js";
35
- import "../gamification/vote/index.js";
36
- import "../app/styles.js";
37
- import "../gamification/vote/feedback/index.js";
38
- import "../gamification/vote/feedback/styles.js";
39
- import "../gamification/vote/styles.js";
40
- import "../gamification/vote/vote-option/index.js";
41
- import "../gamification/vote/vote-option/styles.js";
42
- import "../gamification/vote/win-bar/index.js";
43
- import "../timer/index.js";
44
- import "react-countdown-circle-timer";
45
- import "../theme/constants.js";
46
- import "../gamification/vote/win-bar/styles.js";
47
- import "../../icon-exit-d3f9fc80.js";
48
- import "../gamification/onboarding/components/onboarding-slides/onboarding-instructions/index.js";
49
- import "../gamification/onboarding/components/onboarding-slides/onboarding-instructions/styles.js";
50
- import "../gamification/onboarding/components/onboarding-slides/onboarding-invite-card/index.js";
51
- import "../gamification/onboarding/components/onboarding-slides/onboarding-invite-card/styles.js";
52
- import "../gamification/onboarding/components/onboarding-slides/onboarding-rules/index.js";
53
- import "../gamification/onboarding/components/onboarding-slides/onboarding-rules/styles.js";
54
- import "../gamification/onboarding/styles.js";
55
- import "../gamification/leaderboard/index.js";
56
- import "react-virtualized-auto-sizer";
57
- import "react-window";
58
- import "react-window-infinite-loader";
59
- import "../gamification/leaderboard/list-item/index.js";
60
- import "../gamification/leaderboard/list-item/styles.js";
61
- const mt = ({
62
- gamification: r,
63
- sdk: u
64
- }) => {
65
- var d, v, c, b, y, g, S, h, C, G, L, Q, A, E, f, w, x, P, F, O, B, D, R;
66
- const T = p(r.status), j = p(r.onboardingStatus), l = p(r.openedQuestion), { slStreamId: o } = p(u.sdkStore), e = p(r.featureSettings), [n, q] = K(a.HOME);
67
- if (T !== J.Ready)
68
- return /* @__PURE__ */ t("div", { children: "wait..." });
69
- if (o != null && o.loading)
70
- return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("div", { children: "Event is loading" }) });
71
- if (!(o != null && o.data))
72
- return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t("div", { children: "Event is forbidden" }) });
73
- if (!j)
74
- return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(
75
- Y,
76
- {
77
- closeFeature: u.closeFeature,
78
- gamification: r,
79
- steps: (v = (d = e.inplayGame) == null ? void 0 : d.onboarding) == null ? void 0 : v.steps,
80
- gameIcon: (y = (b = (c = e.inplayGame) == null ? void 0 : c.overview) == null ? void 0 : b.media) == null ? void 0 : y.gameIcon,
81
- sponsorLogo: (h = (S = (g = e.inplayGame) == null ? void 0 : g.overview) == null ? void 0 : S.media) == null ? void 0 : h.sponsorLogo,
82
- rules: (G = (C = e.inplayGame) == null ? void 0 : C.rules) == null ? void 0 : G.rules,
83
- rulesBtnLabel: (Q = (L = e.inplayGame) == null ? void 0 : L.rules) == null ? void 0 : Q.buttonLabel,
84
- rulesTitle: (E = (A = e.inplayGame) == null ? void 0 : A.rules) == null ? void 0 : E.heading,
85
- primaryColor: (x = (w = (f = e.inplayGame) == null ? void 0 : f.overview) == null ? void 0 : w.appearance) == null ? void 0 : x.primaryColor,
86
- inviteCardTitle: (F = (P = e.inplayGame) == null ? void 0 : P.inviteCard) == null ? void 0 : F.heading,
87
- inviteCardSubtext: (B = (O = e.inplayGame) == null ? void 0 : O.inviteCard) == null ? void 0 : B.subtext,
88
- inviteCardBtnLabel: (R = (D = e.inplayGame) == null ? void 0 : D.inviteCard) == null ? void 0 : R.buttonLabel
89
- }
90
- ) });
91
- const H = (i) => {
92
- r.openQuestion(i);
93
- }, M = () => {
94
- r.closeQuestion();
95
- }, U = (i, k) => {
96
- r.submitAnswer(i, k);
97
- };
98
- return /* @__PURE__ */ s(m, { children: [
99
- /* @__PURE__ */ t(N, { activePage: n, toggleActivePage: (i) => {
100
- q(i);
101
- } }),
102
- n === a.HOME && /* @__PURE__ */ s(z, { children: [
103
- /* @__PURE__ */ t(_, { children: r.userSummary && /* @__PURE__ */ t(V, { store: r.userSummary.getStore() }) }),
104
- /* @__PURE__ */ s($, { children: [
105
- r.questions && /* @__PURE__ */ t(W, { openQuestion: H, store: r.questions.getStore() }),
106
- l && /* @__PURE__ */ t(X, { closeQuestion: M, vote: U, openedQuestion: l })
107
- ] })
108
- ] }),
109
- n === a.LEADERBOARD && r.leaderboardList && /* @__PURE__ */ t(Z, { store: r.leaderboardList.getStore() })
110
- ] });
111
- };
112
- export {
113
- mt as GamificationComponent
114
- };
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { type StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
3
- import type { Highlights } from '@streamlayer/feature-gamification';
4
- export declare const HighlightsComponent: React.FC<{
5
- highlights: Highlights;
6
- sdk: StreamLayerSDK;
7
- }>;