@streamlayer/react-ui 0.59.2 → 0.60.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 (35) hide show
  1. package/lib/ui/app/Features/Gamification/Question.js +5 -2
  2. package/lib/ui/app/Features/Gamification/QuestionsList.js +5 -2
  3. package/lib/ui/app/Features/Gamification/Tabs.js +4 -2
  4. package/lib/ui/app/Features/Gamification/index.js +10 -8
  5. package/lib/ui/gamification/question/insight/index.d.ts +2 -2
  6. package/lib/ui/gamification/question/insight/index.js +15 -29
  7. package/lib/ui/gamification/question/insight/styles.d.ts +0 -4
  8. package/lib/ui/gamification/question/insight/styles.js +24 -41
  9. package/lib/ui/gamification/question/list/index.js +8 -5
  10. package/lib/ui/gamification/question/twitter/index.d.ts +2 -9
  11. package/lib/ui/gamification/question/twitter/index.js +10 -14
  12. package/lib/ui/gamification/question/twitter/styles.d.ts +0 -6
  13. package/lib/ui/gamification/question/twitter/styles.js +10 -47
  14. package/lib/ui/gamification/vote/insight-details/index.d.ts +2 -4
  15. package/lib/ui/gamification/vote/insight-details/index.js +15 -32
  16. package/lib/ui/gamification/vote/insight-details/styles.d.ts +0 -4
  17. package/lib/ui/gamification/vote/insight-details/styles.js +6 -30
  18. package/lib/ui/gamification/vote/twitter-details/index.d.ts +3 -0
  19. package/lib/ui/gamification/vote/twitter-details/index.js +13 -0
  20. package/lib/ui/gamification/vote/twitter-details/styles.d.ts +2 -0
  21. package/lib/ui/gamification/vote/twitter-details/styles.js +11 -0
  22. package/lib/ui/questions/insight/index.d.ts +6 -0
  23. package/lib/ui/questions/insight/index.js +36 -0
  24. package/lib/ui/questions/insight/styles.d.ts +6 -0
  25. package/lib/ui/questions/insight/styles.js +33 -0
  26. package/lib/ui/{gamification/question → questions}/twitter/account/index.js +1 -1
  27. package/lib/ui/questions/twitter/index.d.ts +9 -0
  28. package/lib/ui/questions/twitter/index.js +19 -0
  29. package/lib/ui/questions/twitter/styles.d.ts +7 -0
  30. package/lib/ui/questions/twitter/styles.js +45 -0
  31. package/lib/utils/common.js +13 -3
  32. package/package.json +3 -3
  33. /package/lib/ui/{gamification/question → questions}/twitter/account/index.d.ts +0 -0
  34. /package/lib/ui/{gamification/question → questions}/twitter/account/styles.d.ts +0 -0
  35. /package/lib/ui/{gamification/question → questions}/twitter/account/styles.js +0 -0
@@ -20,8 +20,11 @@ import "../../../timer/index.js";
20
20
  import "react-countdown-circle-timer";
21
21
  import "../../../theme/constants.js";
22
22
  import "../../../gamification/vote/win-bar/styles.js";
23
+ import "../../../questions/insight/index.js";
23
24
  import "../../../video-player/index.js";
24
25
  import "../../../video-player/styles.js";
26
+ import "../../../../utils/common.js";
27
+ import "../../../questions/insight/styles.js";
25
28
  import "../../../gamification/vote/insight-details/styles.js";
26
29
  const d = p.div`
27
30
  background: var(--color-transparent-item);
@@ -38,7 +41,7 @@ const d = p.div`
38
41
  }, b = ({ extendedQuestion: t, vote: r }) => {
39
42
  const { loading: i, data: e } = t;
40
43
  return !i && e ? /* @__PURE__ */ o(a, { vote: r, openedQuestion: e }) : null;
41
- }, F = ({ gamification: t }) => {
44
+ }, K = ({ gamification: t }) => {
42
45
  var s;
43
46
  const r = n(t.openedQuestion.$store), i = n(t.openedQuestion.$extendedStore);
44
47
  if (!r)
@@ -51,5 +54,5 @@ const d = p.div`
51
54
  ] });
52
55
  };
53
56
  export {
54
- F as Question
57
+ K as Question
55
58
  };
@@ -11,14 +11,17 @@ import "../../../gamification/question/styles.js";
11
11
  import "../../../icons/index.js";
12
12
  import "react";
13
13
  import "../../../gamification/question/insight/index.js";
14
+ import "../../../questions/insight/index.js";
14
15
  import "../../../video-player/index.js";
15
16
  import "../../../video-player/styles.js";
17
+ import "../../../../utils/common.js";
18
+ import "../../../questions/insight/styles.js";
16
19
  import "../../../gamification/question/insight/styles.js";
17
20
  import "../../../gamification/question/list/styles.js";
18
- const S = ({ store: r, openQuestion: i }) => {
21
+ const k = ({ store: r, openQuestion: i }) => {
19
22
  const t = m(r);
20
23
  return t != null && t.data ? /* @__PURE__ */ o(p, { openQuestion: i, questions: t.data }) : /* @__PURE__ */ o("div", { children: "wait questions..." });
21
24
  };
22
25
  export {
23
- S as QuestionsList
26
+ k as QuestionsList
24
27
  };
@@ -24,8 +24,10 @@ import "../../../button/styles.js";
24
24
  import "../../../gamification/constants.js";
25
25
  import "../../../gamification/question/styles.js";
26
26
  import "../../../gamification/question/insight/index.js";
27
+ import "../../../questions/insight/index.js";
27
28
  import "../../../video-player/index.js";
28
29
  import "../../../video-player/styles.js";
30
+ import "../../../questions/insight/styles.js";
29
31
  import "../../../gamification/question/insight/styles.js";
30
32
  import "../../../gamification/question/list/styles.js";
31
33
  import "../../../gamification/user-statistics/index.js";
@@ -34,7 +36,7 @@ import "../../../gamification/user-statistics/components/rank/styles.js";
34
36
  import "../../../gamification/user-statistics/components/statistic/index.js";
35
37
  import "../../../gamification/user-statistics/components/statistic/styles.js";
36
38
  import "../../../gamification/user-statistics/styles.js";
37
- const V = ({ gamification: t }) => {
39
+ const Y = ({ gamification: t }) => {
38
40
  const [o, p] = s(e.HOME);
39
41
  return /* @__PURE__ */ i("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
40
42
  /* @__PURE__ */ i(n, { children: [
@@ -46,5 +48,5 @@ const V = ({ gamification: t }) => {
46
48
  ] });
47
49
  };
48
50
  export {
49
- V as Tabs
51
+ Y as Tabs
50
52
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as p, Fragment as d, jsx as r } from "react/jsx-runtime";
2
2
  import { styled as n } from "@linaria/react";
3
- import { useStore as e } from "@nanostores/react";
3
+ import { useStore as m } from "@nanostores/react";
4
4
  import { SDKWhiteContainer as l, SDKScrollContainer as a } from "../../styles.js";
5
5
  import { VoteHeader as c } from "../../../gamification/detail/header/index.js";
6
6
  import { UserStatistics as h } from "../../../gamification/user-statistics/index.js";
@@ -31,8 +31,10 @@ import "react-countdown-circle-timer";
31
31
  import "../../../theme/constants.js";
32
32
  import "../../../gamification/vote/win-bar/styles.js";
33
33
  import "../../../gamification/vote/insight-details/index.js";
34
+ import "../../../questions/insight/index.js";
34
35
  import "../../../video-player/index.js";
35
36
  import "../../../video-player/styles.js";
37
+ import "../../../questions/insight/styles.js";
36
38
  import "../../../gamification/vote/insight-details/styles.js";
37
39
  import "../../../gamification/tabs/index.js";
38
40
  import "../../../gamification/tabs/styles.js";
@@ -53,7 +55,7 @@ import "../../../gamification/question/insight/index.js";
53
55
  import "../../../gamification/question/insight/styles.js";
54
56
  import "../../../gamification/question/list/styles.js";
55
57
  import "./UserSummary.js";
56
- const m = n(u)`
58
+ const e = n(u)`
57
59
  position: absolute;
58
60
  inset: 0;
59
61
  top: var(--header-height);
@@ -72,11 +74,11 @@ const m = n(u)`
72
74
  & > div {
73
75
  width: 100%;
74
76
  }
75
- `, br = ({ gamification: t, className: o }) => {
76
- const s = e(t.openedQuestion.$store), i = e(t.openedUser);
77
+ `, wr = ({ gamification: t, className: o }) => {
78
+ const s = m(t.openedQuestion.$store), i = m(t.openedUser);
77
79
  return /* @__PURE__ */ p(d, { children: [
78
- s && /* @__PURE__ */ r(m, { className: o, children: /* @__PURE__ */ r(f, { gamification: t }) }),
79
- i && /* @__PURE__ */ r(m, { className: o, children: /* @__PURE__ */ p(x, { children: [
80
+ s && /* @__PURE__ */ r(e, { className: o, children: /* @__PURE__ */ r(f, { gamification: t }) }),
81
+ i && /* @__PURE__ */ r(e, { className: o, children: /* @__PURE__ */ p(x, { children: [
80
82
  /* @__PURE__ */ r(c, { label: "Friend's Rank", close: t.closeUser }),
81
83
  /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(h, { ...i }) })
82
84
  ] }) }),
@@ -84,6 +86,6 @@ const m = n(u)`
84
86
  ] });
85
87
  };
86
88
  export {
87
- br as GamificationOverlay,
88
- br as default
89
+ wr as GamificationOverlay,
90
+ wr as default
89
91
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { InsightHistory } from '@streamlayer/sdk-web-types';
2
+ import { InsightContentProps } from '../../../questions/insight';
3
3
  export declare const Insight: React.FC<{
4
4
  openInsight?: (questionId: string) => void;
5
- } & InsightHistory>;
5
+ } & InsightContentProps>;
@@ -1,35 +1,21 @@
1
- import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import { VideoPlayer as t } from "../../../video-player/index.js";
3
- import { Container as u, DateWrap as g, Content as S, Title as i, Description as D, ActionBtn as y } from "./styles.js";
1
+ import { jsxs as m, jsx as i } from "react/jsx-runtime";
2
+ import { InsightContent as n } from "../../../questions/insight/index.js";
3
+ import { Container as p, ActionBtn as c } from "./styles.js";
4
4
  import "react";
5
+ import "../../../video-player/index.js";
5
6
  import "../../../icons/index.js";
6
7
  import "@linaria/react";
7
8
  import "../../../video-player/styles.js";
8
- const j = ({
9
- title: m,
10
- instantView: o,
11
- openInsight: c,
12
- questionId: h
13
- }) => {
14
- const d = /* @__PURE__ */ new Date(), l = d.toLocaleDateString("en-US", {
15
- weekday: "short",
16
- month: "short",
17
- day: "numeric"
18
- }), p = d.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" });
19
- return /* @__PURE__ */ e(u, { children: [
20
- /* @__PURE__ */ e(g, { children: [
21
- l,
22
- "・",
23
- p
24
- ] }),
25
- (o == null ? void 0 : o.video) && /* @__PURE__ */ r(t, { source: o.video.url, poster: o.video.thumbnailUrl }),
26
- /* @__PURE__ */ e(S, { children: [
27
- /* @__PURE__ */ r(i, { children: (o == null ? void 0 : o.heading) || m }),
28
- /* @__PURE__ */ r(D, { children: o == null ? void 0 : o.body }),
29
- c && /* @__PURE__ */ r(y, { onClick: () => c(h), children: "View Insight" })
30
- ] })
31
- ] });
32
- };
9
+ import "../../../../utils/common.js";
10
+ import "../../../questions/insight/styles.js";
11
+ const d = ({
12
+ openInsight: r,
13
+ questionId: t,
14
+ ...o
15
+ }) => /* @__PURE__ */ m(p, { children: [
16
+ /* @__PURE__ */ i(n, { questionId: t, ...o }),
17
+ r && /* @__PURE__ */ i(c, { onClick: () => r(t), children: "View Insight" })
18
+ ] });
33
19
  export {
34
- j as Insight
20
+ d as Insight
35
21
  };
@@ -1,7 +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 DateWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
- export declare const Content: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
- export declare const Title: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & Record<never, unknown>>;
6
- export declare const Description: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
3
  export declare const ActionBtn: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
@@ -1,47 +1,34 @@
1
- import { styled as o } from "@linaria/react";
2
- const e = o.div`
3
- box-sizing: border-box;
1
+ import { styled as r } from "@linaria/react";
2
+ import { Title as o, Description as e } from "../../../questions/insight/styles.js";
3
+ const n = r.div`
4
4
  display: flex;
5
5
  flex-direction: column;
6
- row-gap: 16px;
6
+ row-gap: 12px;
7
7
  padding: var(--container-padding);
8
- background-color: var(--color-neutrals-white);
9
- border-radius: 8px;
10
- width: 100%;
11
8
  border: 1px solid var(--color-neutrals-white);
9
+ border-radius: 8px;
10
+ background-color: var(--color-neutrals-white);
12
11
 
13
12
  &:hover {
14
13
  border-color: var(--color-neutrals-gray4);
15
14
  }
16
- `, t = o.div`
17
- font-size: 12px;
18
- font-weight: 550;
19
- color: var(--color-neutrals-gray7);
20
- `, i = o.div`
21
- display: flex;
22
- flex-direction: column;
23
- row-gap: 12px;
24
- `, n = o.h3`
25
- color: var(--color-primary-green2);
26
- font-size: 16px;
27
- line-height: 26px;
28
- font-weight: 400;
29
- font-family: var(--font-serif);
30
- font-weight: var(--font-weight-default);
31
- `, a = o.div`
32
- color: var(--color-neutrals-gray9);
33
- font-size: 12px;
34
- line-height: 24px;
35
- font-weight: 550;
36
- font-weight: var(--font-weight-default);
37
- display: -webkit-box;
38
- -webkit-box-orient: vertical;
39
- -webkit-line-clamp: 2;
40
- overflow: hidden;
41
- word-break: break-all;
42
- text-overflow: ellipsis;
43
- max-height: 50px;
44
- `, l = o.button`
15
+
16
+ ${o} {
17
+ font-weight: 400;
18
+ line-height: 24px;
19
+ }
20
+
21
+ ${e} {
22
+ display: -webkit-box;
23
+ font-size: 12px;
24
+ line-height: 18px;
25
+ text-overflow: ellipsis;
26
+ word-break: break-all;
27
+ overflow: hidden;
28
+ -webkit-box-orient: vertical;
29
+ -webkit-line-clamp: 2;
30
+ }
31
+ `, l = r.button`
45
32
  border: none;
46
33
  outline: none;
47
34
  background-color: var(--color-primary-green1);
@@ -63,9 +50,5 @@ const e = o.div`
63
50
  `;
64
51
  export {
65
52
  l as ActionBtn,
66
- e as Container,
67
- i as Content,
68
- t as DateWrap,
69
- a as Description,
70
- n as Title
53
+ n as Container
71
54
  };
@@ -1,4 +1,4 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as o } from "react/jsx-runtime";
2
2
  import { Question as u } from "../index.js";
3
3
  import { Insight as s } from "../insight/index.js";
4
4
  import { QuestionsContainer as a } from "./styles.js";
@@ -10,21 +10,24 @@ import "../../constants.js";
10
10
  import "../styles.js";
11
11
  import "../../../icons/index.js";
12
12
  import "react";
13
+ import "../../../questions/insight/index.js";
13
14
  import "../../../video-player/index.js";
14
15
  import "../../../video-player/styles.js";
16
+ import "../../../../utils/common.js";
17
+ import "../../../questions/insight/styles.js";
15
18
  import "../insight/styles.js";
16
- const C = ({ questions: r, openQuestion: o }) => /* @__PURE__ */ e(a, { children: r == null ? void 0 : r.map((t) => {
19
+ const w = ({ questions: r, openQuestion: e }) => /* @__PURE__ */ o(a, { children: r == null ? void 0 : r.map((t) => {
17
20
  var m, n;
18
21
  if (t.type === "question" && ((m = t.attributes) == null ? void 0 : m.attributes.case) === "question") {
19
22
  const i = t.attributes.attributes.value;
20
- return /* @__PURE__ */ e(u, { openQuestion: o, ...i }, i.questionId);
23
+ return /* @__PURE__ */ o(u, { openQuestion: e, ...i }, i.questionId);
21
24
  }
22
25
  if (t.type === "insight" && ((n = t.attributes) == null ? void 0 : n.attributes.case) === "insight") {
23
26
  const i = t.attributes.attributes.value;
24
- return /* @__PURE__ */ e(s, { openInsight: o, ...i }, i.questionId);
27
+ return /* @__PURE__ */ o(s, { openInsight: e, ...i }, i.questionId);
25
28
  }
26
29
  return null;
27
30
  }) });
28
31
  export {
29
- C as QuestionList
32
+ w as QuestionList
30
33
  };
@@ -1,10 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { AccountProps } from './account';
3
- type TwitterProps = {
4
- title: string;
5
- image: string;
6
- body: string;
7
- account: AccountProps;
8
- };
9
- export declare const Twitter: React.FC<TwitterProps>;
10
- export {};
2
+ import { TwitterContentProps } from '../../../questions/twitter';
3
+ export declare const Twitter: React.FC<TwitterContentProps>;
@@ -1,22 +1,18 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
- import { Account as m } from "./account/index.js";
3
- import { Container as c, DateTime as p, Quote as d, Details as h, Body as l, Image as s, Footer as u, ActionButton as a } from "./styles.js";
1
+ import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
+ import { TwitterContent as i } from "../../../questions/twitter/index.js";
3
+ import { Container as m, ActionButton as p } from "./styles.js";
4
+ import "../../../questions/twitter/account/index.js";
4
5
  import "../../../icons/index.js";
5
6
  import "@linaria/react";
6
7
  import "react";
7
- import "./account/styles.js";
8
+ import "../../../questions/twitter/account/styles.js";
9
+ import "../../../questions/twitter/styles.js";
8
10
  import "../../../button/index.js";
9
11
  import "../../../button/styles.js";
10
- const g = ({ title: o, image: t, body: e, account: n }) => /* @__PURE__ */ i(c, { children: [
11
- /* @__PURE__ */ r(p, { children: "Sun, Nov 14 · 3:52 PM" }),
12
- o && /* @__PURE__ */ r(d, { children: o }),
13
- /* @__PURE__ */ i(h, { children: [
14
- /* @__PURE__ */ r(m, { ...n }),
15
- /* @__PURE__ */ r(l, { children: e }),
16
- t && /* @__PURE__ */ r(s, { src: t })
17
- ] }),
18
- /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(a, { children: "View Insight" }) })
12
+ const u = (r) => /* @__PURE__ */ o(m, { children: [
13
+ /* @__PURE__ */ t(i, { ...r }),
14
+ /* @__PURE__ */ t(p, { children: "View Insight" })
19
15
  ] });
20
16
  export {
21
- g as Twitter
17
+ u as Twitter
22
18
  };
@@ -1,9 +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
- export declare const Quote: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLQuoteElement> & import("react").BlockquoteHTMLAttributes<HTMLQuoteElement> & Record<never, unknown>>;
5
- export declare const Details: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
- export declare const Body: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
- export declare const Image: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
8
- export declare const Footer: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
9
3
  export declare const ActionButton: any;
@@ -1,51 +1,20 @@
1
1
  import { styled as o } from "@linaria/react";
2
- import { Button as t } from "../../../button/index.js";
2
+ import { Button as r } from "../../../button/index.js";
3
3
  import "react/jsx-runtime";
4
4
  import "../../../button/styles.js";
5
- const p = o.div`
5
+ const n = o.div`
6
6
  display: flex;
7
7
  flex-direction: column;
8
- row-gap: 8px;
8
+ row-gap: 16px;
9
9
  padding: 12px 16px 16px 16px;
10
+ border: 1px solid var(--color-neutrals-white);
10
11
  border-radius: 8px;
11
- border-bottom: 1px solid var(--color-neutrals-gray3);
12
- background: var(--color-neutrals-white);
13
- `, a = o.div`
14
- color: var(--color-neutrals-gray7);
15
- font-size: 12px;
16
- font-weight: var(--font-weight-default);
17
- line-height: 18px;
18
- `, l = o.blockquote`
19
- display: flex;
20
- column-gap: 12px;
21
- padding: 4px 16px 8px 0;
22
- color: var(--color-primary-green2);
23
- font-size: 12px;
24
- font-family: var(--font-serif);
25
- font-weight: var(--font-weight-default);
12
+ background-color: var(--color-neutrals-white);
26
13
 
27
- &:before {
28
- content: '';
29
- width: 2px;
30
- background-color: var(--color-primary-green2);
14
+ &:hover {
15
+ border-color: var(--color-neutrals-gray4);
31
16
  }
32
- `, d = o.div`
33
- display: flex;
34
- flex-direction: column;
35
- row-gap: 12px;
36
- `, x = o.div`
37
- color: var(--color-neutrals-gray9);
38
- font-size: 12px;
39
- font-weight: var(--font-weight-default);
40
- line-height: 18px;
41
- `, c = o.img`
42
- max-width: 100%;
43
- border-radius: 8px;
44
- `, f = o.div`
45
- display: flex;
46
- flex-direction: column;
47
- padding-top: 8px;
48
- `, s = o(t)`
17
+ `, l = o(r)`
49
18
  height: 44px;
50
19
  padding: 0 16px;
51
20
  font-size: 14px;
@@ -53,12 +22,6 @@ const p = o.div`
53
22
  cursor: pointer;
54
23
  `;
55
24
  export {
56
- s as ActionButton,
57
- x as Body,
58
- p as Container,
59
- a as DateTime,
60
- d as Details,
61
- f as Footer,
62
- c as Image,
63
- l as Quote
25
+ l as ActionButton,
26
+ n as Container
64
27
  };
@@ -1,5 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { InsightHistory, FeedItem } from '@streamlayer/sdk-web-types';
3
- export declare const InsightDetails: React.FC<InsightHistory & {
4
- created: FeedItem['created'];
5
- }>;
2
+ import { InsightContentProps } from '../../../questions/insight';
3
+ export declare const InsightDetails: React.FC<InsightContentProps>;
@@ -1,37 +1,20 @@
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";
1
+ import { jsxs as o, jsx as m } from "react/jsx-runtime";
2
+ import { SvgIcon as e } from "../../../icons/index.js";
3
+ import { InsightContent as l } from "../../../questions/insight/index.js";
4
+ import { Container as f, WebLinkBtn as h } from "./styles.js";
5
5
  import "@linaria/react";
6
6
  import "react";
7
+ import "../../../video-player/index.js";
7
8
  import "../../../video-player/styles.js";
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
- ] })
32
- ] })
33
- ] });
34
- };
9
+ import "../../../../utils/common.js";
10
+ import "../../../questions/insight/styles.js";
11
+ const j = ({ instantView: r, ...p }) => /* @__PURE__ */ o(f, { children: [
12
+ /* @__PURE__ */ m(l, { instantView: r, ...p }),
13
+ (r == null ? void 0 : r.webLink) && /* @__PURE__ */ o(h, { href: r == null ? void 0 : r.webLink.url, target: "_blank", children: [
14
+ "Explore more of the Masters History",
15
+ /* @__PURE__ */ m(e, { name: "icon-external-link" })
16
+ ] })
17
+ ] });
35
18
  export {
36
- C as InsightDetails
19
+ j as InsightDetails
37
20
  };
@@ -1,7 +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 Content: 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
3
  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,27 +1,11 @@
1
- import { styled as o } from "@linaria/react";
2
- const e = o.div`
1
+ import { styled as r } from "@linaria/react";
2
+ const o = r.div`
3
3
  display: flex;
4
4
  flex-direction: column;
5
- row-gap: 16px;
5
+ row-gap: 12px;
6
6
  padding: var(--container-padding);
7
7
  background-color: var(--color-neutrals-white);
8
- width: 100%;
9
- `, r = o.div`
10
- display: flex;
11
- flex-direction: column;
12
- row-gap: 12px;
13
- `, n = o.h3`
14
- color: var(--color-primary-green1);
15
- font-size: 16px;
16
- line-height: 26px;
17
- font-family: var(--font-serif);
18
- font-weight: var(--font-weight-default);
19
- `, i = o.div`
20
- color: var(--color-neutrals-gray9);
21
- font-size: 14px;
22
- line-height: 24px;
23
- font-weight: var(--font-weight-default);
24
- `, a = o.a`
8
+ `, n = r.a`
25
9
  display: flex;
26
10
  align-items: center;
27
11
  justify-content: center;
@@ -34,16 +18,8 @@ const e = o.div`
34
18
  border-radius: 40px;
35
19
  border: 1px solid var(--color-primary-green1);
36
20
  text-decoration: none;
37
- `, l = o.div`
38
- font-size: 12px;
39
- font-weight: 550;
40
- color: var(--color-neutrals-gray7);
41
21
  `;
42
22
  export {
43
- e as Container,
44
- r as Content,
45
- l as DateWrap,
46
- i as Description,
47
- n as Title,
48
- a as WebLinkBtn
23
+ o as Container,
24
+ n as WebLinkBtn
49
25
  };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { TwitterContentProps } from '../../../questions/twitter';
3
+ export declare const TwitterDetails: React.FC<TwitterContentProps>;
@@ -0,0 +1,13 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { TwitterContent as o } from "../../../questions/twitter/index.js";
3
+ import { Container as i } from "./styles.js";
4
+ import "../../../questions/twitter/account/index.js";
5
+ import "../../../icons/index.js";
6
+ import "@linaria/react";
7
+ import "react";
8
+ import "../../../questions/twitter/account/styles.js";
9
+ import "../../../questions/twitter/styles.js";
10
+ const w = (r) => /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(o, { ...r }) });
11
+ export {
12
+ w as TwitterDetails
13
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -0,0 +1,11 @@
1
+ import { styled as o } from "@linaria/react";
2
+ const n = o.div`
3
+ display: flex;
4
+ flex-direction: column;
5
+ row-gap: 12px;
6
+ padding: var(--container-padding);
7
+ background-color: var(--color-neutrals-white);
8
+ `;
9
+ export {
10
+ n as Container
11
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { InsightHistory, FeedItem } from '@streamlayer/sdk-web-types';
3
+ export type InsightContentProps = InsightHistory & {
4
+ created?: FeedItem['created'];
5
+ };
6
+ export declare const InsightContent: React.FC<InsightContentProps>;
@@ -0,0 +1,36 @@
1
+ import { jsxs as d, jsx as l } from "react/jsx-runtime";
2
+ import { useMemo as f } from "react";
3
+ import { VideoPlayer as c } from "../../video-player/index.js";
4
+ import { isValidDate as h, formatDate as u, formatTime as D } from "../../../utils/common.js";
5
+ import { Container as t, DateWrap as v, Content as x, Title as C, Description as T } from "./styles.js";
6
+ import "../../icons/index.js";
7
+ import "@linaria/react";
8
+ import "../../video-player/styles.js";
9
+ const W = ({ created: o, title: p, instantView: r }) => {
10
+ const m = f(() => {
11
+ if (o) {
12
+ const e = new Date(o);
13
+ if (h(e))
14
+ return {
15
+ date: u(e),
16
+ time: D(e)
17
+ };
18
+ }
19
+ return null;
20
+ }, [o]);
21
+ return /* @__PURE__ */ d(t, { children: [
22
+ m && /* @__PURE__ */ d(v, { children: [
23
+ m.date,
24
+ " · ",
25
+ m.time
26
+ ] }),
27
+ (r == null ? void 0 : r.video) && /* @__PURE__ */ l(c, { source: r.video.url, poster: r.video.thumbnailUrl }),
28
+ /* @__PURE__ */ d(x, { children: [
29
+ /* @__PURE__ */ l(C, { children: (r == null ? void 0 : r.heading) || p }),
30
+ /* @__PURE__ */ l(T, { children: r == null ? void 0 : r.body })
31
+ ] })
32
+ ] });
33
+ };
34
+ export {
35
+ W as InsightContent
36
+ };
@@ -0,0 +1,6 @@
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 Content: 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 DateWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -0,0 +1,33 @@
1
+ import { styled as t } from "@linaria/react";
2
+ const e = t.div`
3
+ display: flex;
4
+ flex-direction: column;
5
+ row-gap: 16px;
6
+ `, i = t.div`
7
+ display: flex;
8
+ flex-direction: column;
9
+ row-gap: 12px;
10
+ `, n = t.h3`
11
+ color: var(--color-primary-green1);
12
+ font-size: 16px;
13
+ line-height: 26px;
14
+ font-family: var(--font-serif);
15
+ font-weight: var(--font-weight-default);
16
+ `, r = t.div`
17
+ color: var(--color-neutrals-gray9);
18
+ font-size: 14px;
19
+ line-height: 24px;
20
+ font-weight: var(--font-weight-default);
21
+ `, l = t.div`
22
+ color: var(--color-neutrals-gray7);
23
+ font-size: 12px;
24
+ font-weight: var(--font-weight-default);
25
+ line-height: 18px;
26
+ `;
27
+ export {
28
+ e as Container,
29
+ i as Content,
30
+ l as DateWrap,
31
+ r as Description,
32
+ n as Title
33
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import { SvgIcon as m } from "../../../../icons/index.js";
2
+ import { SvgIcon as m } from "../../../icons/index.js";
3
3
  import { Container as c, ImageContainer as a, Image as s, Details as d, Name as l, UserName as p } from "./styles.js";
4
4
  import "@linaria/react";
5
5
  import "react";
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { AccountProps } from './account';
3
+ export type TwitterContentProps = {
4
+ title: string;
5
+ image: string;
6
+ body: string;
7
+ account: AccountProps;
8
+ };
9
+ export declare const TwitterContent: React.FC<TwitterContentProps>;
@@ -0,0 +1,19 @@
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
+ import { Account as m } from "./account/index.js";
3
+ import { Container as c, DateTime as p, Quote as d, Details as s, Body as h, Image as l } from "./styles.js";
4
+ import "../../icons/index.js";
5
+ import "@linaria/react";
6
+ import "react";
7
+ import "./account/styles.js";
8
+ const T = ({ title: o, image: t, body: e, account: n }) => /* @__PURE__ */ i(c, { children: [
9
+ /* @__PURE__ */ r(p, { children: "Sun, Nov 14 · 3:52 PM" }),
10
+ o && /* @__PURE__ */ r(d, { children: o }),
11
+ /* @__PURE__ */ i(s, { children: [
12
+ /* @__PURE__ */ r(m, { ...n }),
13
+ /* @__PURE__ */ r(h, { children: e }),
14
+ t && /* @__PURE__ */ r(l, { src: t })
15
+ ] })
16
+ ] });
17
+ export {
18
+ T as TwitterContent
19
+ };
@@ -0,0 +1,7 @@
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 DateTime: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const Quote: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLQuoteElement> & import("react").BlockquoteHTMLAttributes<HTMLQuoteElement> & Record<never, unknown>>;
5
+ export declare const Details: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const Body: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
7
+ export declare const Image: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
@@ -0,0 +1,45 @@
1
+ import { styled as o } from "@linaria/react";
2
+ const e = o.div`
3
+ display: flex;
4
+ flex-direction: column;
5
+ row-gap: 8px;
6
+ `, r = o.div`
7
+ color: var(--color-neutrals-gray7);
8
+ font-size: 12px;
9
+ font-weight: var(--font-weight-default);
10
+ line-height: 18px;
11
+ `, i = o.blockquote`
12
+ display: flex;
13
+ column-gap: 12px;
14
+ padding: 4px 16px 8px 0;
15
+ color: var(--color-primary-green2);
16
+ font-size: 12px;
17
+ font-family: var(--font-serif);
18
+ font-weight: var(--font-weight-default);
19
+
20
+ &:before {
21
+ content: '';
22
+ width: 2px;
23
+ background-color: var(--color-primary-green2);
24
+ }
25
+ `, n = o.div`
26
+ display: flex;
27
+ flex-direction: column;
28
+ row-gap: 12px;
29
+ `, a = o.div`
30
+ color: var(--color-neutrals-gray9);
31
+ font-size: 12px;
32
+ font-weight: var(--font-weight-default);
33
+ line-height: 18px;
34
+ `, l = o.img`
35
+ max-width: 100%;
36
+ border-radius: 8px;
37
+ `;
38
+ export {
39
+ a as Body,
40
+ e as Container,
41
+ r as DateTime,
42
+ n as Details,
43
+ l as Image,
44
+ i as Quote
45
+ };
@@ -1,5 +1,15 @@
1
- const e = (t) => t.split(/\s+/).map((o) => o[0]).join("").toUpperCase(), a = (t) => t ? t.toLocaleString("en-US") : "0";
1
+ const o = (t) => t.split(/\s+/).map((e) => e[0]).join("").toUpperCase(), i = (t) => t ? t.toLocaleString("en-US") : "0", a = (t) => t.toLocaleDateString("en-US", {
2
+ weekday: "short",
3
+ month: "short",
4
+ day: "numeric"
5
+ }), n = (t) => t.toLocaleTimeString("en-US", {
6
+ hour: "2-digit",
7
+ minute: "2-digit"
8
+ }), r = (t) => !isNaN(t.getTime());
2
9
  export {
3
- e as abbreviate,
4
- a as formatDecimals
10
+ o as abbreviate,
11
+ a as formatDate,
12
+ i as formatDecimals,
13
+ n as formatTime,
14
+ r as isValidDate
5
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.59.2",
3
+ "version": "0.60.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -41,8 +41,8 @@
41
41
  "@streamlayer/sdk-web-anonymous-auth": "^0.11.14",
42
42
  "@streamlayer/sdk-web-api": "^0.0.1",
43
43
  "@streamlayer/sdk-web-core": "^0.17.8",
44
- "@streamlayer/sdk-web-features": "^0.10.22",
45
44
  "@streamlayer/sdk-web-interfaces": "^0.18.15",
45
+ "@streamlayer/sdk-web-features": "^0.10.22",
46
46
  "@streamlayer/sdk-web-notifications": "^0.12.1",
47
47
  "@streamlayer/sdk-web-storage": "^0.0.4",
48
48
  "@streamlayer/sdk-web-types": "^0.20.1"
@@ -84,6 +84,6 @@
84
84
  "vite-plugin-svgr": "^4.1.0",
85
85
  "vite-svg-loader": "^4.0.0",
86
86
  "vite-tsconfig-paths": "^4.2.1",
87
- "@streamlayer/react": "^0.28.5"
87
+ "@streamlayer/react": "^0.29.1"
88
88
  }
89
89
  }