@streamlayer/react-ui 0.32.0 → 0.33.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.
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { ChannelsButton as u, ChannelsButtonId as i } from "../../navigation/button/Channels.js";
|
|
3
|
+
import { FeaturedGroupsButton as a, FeaturedGroupsButtonId as n } from "../../navigation/button/FeaturedGroups.js";
|
|
4
|
+
import { LeaderBoardButton as d, LeaderBoardButtonId as m } from "../../navigation/button/LeaderBoard.js";
|
|
5
|
+
import { Navigation as s } from "../../navigation/masters.js";
|
|
6
6
|
import "@linaria/react";
|
|
7
7
|
import "../../icons/index.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "../../navigation/button/index.js";
|
|
10
10
|
import "../../navigation/button/styles.js";
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
import "../../navigation/index.js";
|
|
12
|
+
const l = ({ activeOverlay: o, setActiveOverlay: t }) => /* @__PURE__ */ p(s, { children: [
|
|
13
|
+
/* @__PURE__ */ r(u, { active: o === i, onClick: () => t(i) }),
|
|
13
14
|
/* @__PURE__ */ r(
|
|
14
|
-
|
|
15
|
+
a,
|
|
15
16
|
{
|
|
16
|
-
active: o ===
|
|
17
|
+
active: o === n,
|
|
17
18
|
onClick: () => {
|
|
18
|
-
t(
|
|
19
|
+
t(n);
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
),
|
|
22
23
|
/* @__PURE__ */ r(
|
|
23
|
-
|
|
24
|
+
d,
|
|
24
25
|
{
|
|
25
26
|
active: o === m,
|
|
26
27
|
onClick: () => t(m)
|
|
@@ -28,8 +29,8 @@ const j = ({ activeOverlay: o, setActiveOverlay: t }) => /* @__PURE__ */ p(u, {
|
|
|
28
29
|
)
|
|
29
30
|
] });
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
i as ChannelsButtonId,
|
|
33
|
+
n as FeaturedGroupsButtonId,
|
|
33
34
|
m as LeaderBoardButtonId,
|
|
34
|
-
|
|
35
|
+
l as MastersNavigation
|
|
35
36
|
};
|
package/lib/ui/app/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as c } from "@nanostores/react";
|
|
3
|
+
import { useState as f } from "react";
|
|
4
4
|
import { FeatureType as u } from "@streamlayer/sdk-web-types";
|
|
5
|
-
import { StreamLayerThemeProvider as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { StreamLayerThemeProvider as S } from "../theme/index.js";
|
|
6
|
+
import { mastersVariables as b } from "../theme/masters.js";
|
|
7
|
+
import { ActiveFeature as v } from "./Features/index.js";
|
|
8
|
+
import { MastersNavigation as h } from "./MastersNavigation/index.js";
|
|
9
|
+
import { SDKContainer as y, SDKScrollContainer as A } from "./styles.js";
|
|
10
|
+
import { useSdkFeature as F } from "./useSdkFeature.js";
|
|
10
11
|
import { FeaturedGroupsButtonId as m } from "../navigation/button/FeaturedGroups.js";
|
|
11
|
-
import { ChannelsButtonId as
|
|
12
|
+
import { ChannelsButtonId as B } from "../navigation/button/Channels.js";
|
|
12
13
|
import { LeaderBoardButtonId as l } from "../navigation/button/LeaderBoard.js";
|
|
13
14
|
import "../theme/theme.js";
|
|
14
15
|
import "@linaria/core";
|
|
@@ -68,25 +69,26 @@ import "../gamification/insight-list/index.js";
|
|
|
68
69
|
import "../gamification/insight/index.js";
|
|
69
70
|
import "../gamification/insight/styles.js";
|
|
70
71
|
import "../gamification/insight-list/styles.js";
|
|
72
|
+
import "../navigation/masters.js";
|
|
71
73
|
import "../navigation/index.js";
|
|
72
74
|
import "../icons/index.js";
|
|
73
75
|
import "../navigation/button/index.js";
|
|
74
76
|
import "../navigation/button/styles.js";
|
|
75
|
-
const
|
|
76
|
-
const [t,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, disableSdk: r.disableApp }) }),
|
|
77
|
+
const Rr = ({ sdk: r, overlays: p, children: e }) => {
|
|
78
|
+
const [t, a] = f(m), i = c(r.enabled) === "on", [, s] = F(r), d = () => {
|
|
79
|
+
r.initializeApp().then(() => {
|
|
80
|
+
a(m), r.openFeature(u.GAMES);
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
return /* @__PURE__ */ o(S, { style: { height: "100%" }, children: /* @__PURE__ */ n(y, { className: b, children: [
|
|
84
|
+
i && /* @__PURE__ */ o(h, { activeOverlay: t, setActiveOverlay: a }),
|
|
85
|
+
/* @__PURE__ */ n(A, { "data-nav": i.toString(), children: [
|
|
86
|
+
/* @__PURE__ */ o("div", { style: { display: !i || t === B ? "block" : "none" }, children: e && e({ enableSdk: d, disableSdk: r.disableApp }) }),
|
|
85
87
|
/* @__PURE__ */ o("div", { style: { display: t === l ? "block" : "none" }, children: p && t === l && p[t] }),
|
|
86
|
-
i && t === m && /* @__PURE__ */ o(
|
|
88
|
+
i && t === m && /* @__PURE__ */ o(v, { feature: s, sdk: r })
|
|
87
89
|
] })
|
|
88
90
|
] }) });
|
|
89
91
|
};
|
|
90
92
|
export {
|
|
91
|
-
|
|
93
|
+
Rr as App
|
|
92
94
|
};
|
package/lib/ui/app/styles.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const
|
|
1
|
+
import { styled as t } from "@linaria/react";
|
|
2
|
+
const n = t.div`
|
|
3
3
|
height: 100%;
|
|
4
4
|
background: #fff;
|
|
5
5
|
font-family: var(--font-regular);
|
|
6
|
-
|
|
6
|
+
position: relative;
|
|
7
|
+
`, i = t.div`
|
|
7
8
|
overflow-y: auto;
|
|
8
|
-
height: 100
|
|
9
|
+
height: calc(100% - var(--header-height));
|
|
10
|
+
transition: transform;
|
|
11
|
+
transition-duration: var(--animation-duration);
|
|
12
|
+
transition-timing-function: var(--animation-function);
|
|
13
|
+
|
|
14
|
+
&[data-nav='true'] {
|
|
15
|
+
transform: translateY(var(--header-height));
|
|
16
|
+
}
|
|
9
17
|
`;
|
|
10
18
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
19
|
+
n as SDKContainer,
|
|
20
|
+
i as SDKScrollContainer
|
|
13
21
|
};
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { styled as
|
|
3
|
-
const
|
|
2
|
+
import { styled as o } from "@linaria/react";
|
|
3
|
+
const i = o.div`
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: space-between;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
& > button:not(:last-child) {
|
|
10
|
-
margin-right: 8px;
|
|
11
|
-
}
|
|
12
|
-
`, s = ({ children: t }) => /* @__PURE__ */ n(e, { children: t });
|
|
7
|
+
`, a = ({ children: t, className: e }) => /* @__PURE__ */ n(i, { className: e, children: t });
|
|
13
8
|
export {
|
|
14
|
-
|
|
9
|
+
a as Navigation
|
|
15
10
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { styled as o } from "@linaria/react";
|
|
2
|
+
import { Navigation as i } from "./index.js";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
const r = o(i)`
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
opacity: 0;
|
|
13
|
+
|
|
14
|
+
animation: show-nav 0.5s ease;
|
|
15
|
+
animation-fill-mode: forwards;
|
|
16
|
+
|
|
17
|
+
padding: 16px;
|
|
18
|
+
|
|
19
|
+
& > button:not(:last-child) {
|
|
20
|
+
margin-right: 8px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes show-nav {
|
|
24
|
+
90% {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
100% {
|
|
29
|
+
height: 68px;
|
|
30
|
+
opacity: 1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
export {
|
|
35
|
+
r as Navigation
|
|
36
|
+
};
|