@streamlayer/react-ui 0.27.1 → 0.27.3
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.
- package/lib/index.js +10 -8
- package/lib/ui/theme/ThemeColors.js +15 -0
- package/lib/ui/theme/ThemeTypography.js +5 -0
- package/lib/ui/theme/constants.js +33 -5
- package/lib/ui/theme/theme.js +25 -27
- package/lib/utils/components/developer.js +27 -21
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QuestionInApp as
|
|
2
|
-
import { Login as
|
|
3
|
-
import { Onboarding as
|
|
1
|
+
import { QuestionInApp as Vo } from "./ui/notifications/notification/question-inapp/index.js";
|
|
2
|
+
import { Login as No } from "./ui/login/index.js";
|
|
3
|
+
import { Onboarding as Uo } from "./ui/gamification/onboarding/index.js";
|
|
4
4
|
import { ActivePages as ko, Navigation as qo } from "./ui/gamification/navigation/index.js";
|
|
5
5
|
import { LeaderboardItemDetail as zo } from "./ui/gamification/leaderboard-item-detail/index.js";
|
|
6
6
|
import { Question as Co } from "./ui/gamification/question/index.js";
|
|
@@ -10,7 +10,7 @@ import { Vote as Ko } from "./ui/gamification/vote/index.js";
|
|
|
10
10
|
import { Demo as Ro } from "./ui/demo/index.js";
|
|
11
11
|
import { Points as Xo } from "./ui/gamification/points/index.js";
|
|
12
12
|
import { StreamLayerThemeProvider as Zo } from "./ui/theme/index.js";
|
|
13
|
-
import {
|
|
13
|
+
import { ThemeVariables as $o, theme as or, themeStr as rr } from "./ui/theme/theme.js";
|
|
14
14
|
import "react/jsx-runtime";
|
|
15
15
|
import "react";
|
|
16
16
|
import "./icon-exit-6a55bb8f.js";
|
|
@@ -94,15 +94,17 @@ export {
|
|
|
94
94
|
ko as ActivePages,
|
|
95
95
|
Ro as Demo,
|
|
96
96
|
zo as LeaderboardItemDetail,
|
|
97
|
-
|
|
97
|
+
No as Login,
|
|
98
98
|
qo as Navigation,
|
|
99
|
-
|
|
99
|
+
Uo as Onboarding,
|
|
100
100
|
Xo as Points,
|
|
101
101
|
Co as Question,
|
|
102
|
-
|
|
102
|
+
Vo as QuestionInApp,
|
|
103
103
|
Fo as QuestionList,
|
|
104
104
|
Zo as StreamLayerThemeProvider,
|
|
105
|
+
$o as ThemeVariables,
|
|
105
106
|
Ho as UserStatistics,
|
|
106
107
|
Ko as Vote,
|
|
107
|
-
|
|
108
|
+
or as theme,
|
|
109
|
+
rr as themeStr
|
|
108
110
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { ColorItem as e } from "@storybook/blocks";
|
|
3
|
+
import { MASTERS_COLORS as r } from "./constants.js";
|
|
4
|
+
const l = Object.keys(r), p = () => l.map((o) => /* @__PURE__ */ t(
|
|
5
|
+
e,
|
|
6
|
+
{
|
|
7
|
+
title: o,
|
|
8
|
+
subtitle: `--color-${o.toLowerCase().replaceAll("_", "-")}`,
|
|
9
|
+
colors: [r[o]]
|
|
10
|
+
},
|
|
11
|
+
o
|
|
12
|
+
));
|
|
13
|
+
export {
|
|
14
|
+
p as ThemeColors
|
|
15
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const N = {
|
|
2
2
|
BG_TRANSPARENT: "rgba(0,0,0, .8)",
|
|
3
3
|
BG_TRANSPARENT_VOTE_CONTAINER: "rgba(10, 14, 19, 0.8)",
|
|
4
4
|
BG_TRANSPARENT_ITEM: "rgba(0, 0, 0, 0.7)",
|
|
@@ -29,11 +29,39 @@ const R = {
|
|
|
29
29
|
DIVIDER_COLOR_PRIMARY: "#2d3135",
|
|
30
30
|
DIVIDER_COLOR_SECONDARY: "#53565a",
|
|
31
31
|
GREEN_PRIMARY_BTN: "#009B77"
|
|
32
|
-
},
|
|
32
|
+
}, T = {
|
|
33
|
+
PRIMARY_GREEN1: "#107D57",
|
|
34
|
+
PRIMARY_GREEN2: "#006747",
|
|
35
|
+
PRIMARY_GREEN3: "#1C4932",
|
|
36
|
+
PRIMARY_GREEN4: "#193526",
|
|
37
|
+
SECONDARY_RED1: "#DF2F3B",
|
|
38
|
+
SECONDARY_RED2: "#BA0C2F",
|
|
39
|
+
SECONDARY_YELLOW: "#fce300",
|
|
40
|
+
SECONDARY_GREEN5: "#C0DC8F",
|
|
41
|
+
NEUTRALS_WHITE: "#FFFFFF",
|
|
42
|
+
NEUTRALS_GRAY1: "#F7F7F7",
|
|
43
|
+
NEUTRALS_GRAY2: "#F2F2F1",
|
|
44
|
+
NEUTRALS_GRAY3: "#E8E8E8",
|
|
45
|
+
NEUTRALS_GRAY4: "#D9D9D6",
|
|
46
|
+
NEUTRALS_GRAY5: "#B1B3B3",
|
|
47
|
+
NEUTRALS_GRAY6: "#888B8D",
|
|
48
|
+
NEUTRALS_GRAY7: "#6B6F73",
|
|
49
|
+
NEUTRALS_GRAY8: "#53565A",
|
|
50
|
+
NEUTRALS_GRAY9: "#25282A",
|
|
51
|
+
NEUTRALS_BLACK: "#000000"
|
|
52
|
+
}, E = Object.assign({}, N, T), S = {
|
|
33
53
|
FAMILY: "Roboto, sans-serif",
|
|
34
54
|
COLOR: "#fff"
|
|
35
|
-
}
|
|
55
|
+
}, O = Object.keys(E).reduce((_, R) => {
|
|
56
|
+
const A = E[R];
|
|
57
|
+
return `
|
|
58
|
+
${_}
|
|
59
|
+
--color-${R.toLowerCase().replaceAll("_", "-")}: ${A};
|
|
60
|
+
`;
|
|
61
|
+
}, "");
|
|
36
62
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
63
|
+
E as COLORS,
|
|
64
|
+
S as FONT,
|
|
65
|
+
T as MASTERS_COLORS,
|
|
66
|
+
O as colors
|
|
39
67
|
};
|
package/lib/ui/theme/theme.js
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
--
|
|
7
|
-
--color
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
--color-green-primary-btn: ${r.GREEN_PRIMARY_BTN};
|
|
24
|
-
--font-family: ${o.FAMILY};
|
|
25
|
-
--font-color: ${o.COLOR};
|
|
26
|
-
`;
|
|
1
|
+
import { jsx as t, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { css as h } from "@linaria/core";
|
|
3
|
+
import { colors as d, FONT as n } from "./constants.js";
|
|
4
|
+
const l = `
|
|
5
|
+
${d}
|
|
6
|
+
--font-family: ${n.FAMILY};
|
|
7
|
+
--font-color: ${n.COLOR};
|
|
8
|
+
`, p = h`
|
|
9
|
+
${l}
|
|
10
|
+
`, f = () => /* @__PURE__ */ t("table", { children: /* @__PURE__ */ e("table", { children: [
|
|
11
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ e("tr", { children: [
|
|
12
|
+
/* @__PURE__ */ t("th", { children: "name" }),
|
|
13
|
+
/* @__PURE__ */ t("th", { children: "value" })
|
|
14
|
+
] }) }),
|
|
15
|
+
/* @__PURE__ */ t("tbody", { children: l.split(";").map((o) => {
|
|
16
|
+
const r = o.trim(), [c, i] = r.split(":");
|
|
17
|
+
return /* @__PURE__ */ e("tr", { children: [
|
|
18
|
+
/* @__PURE__ */ t("td", { children: c }),
|
|
19
|
+
/* @__PURE__ */ t("td", { children: i })
|
|
20
|
+
] }, r);
|
|
21
|
+
}) })
|
|
22
|
+
] }) });
|
|
27
23
|
export {
|
|
28
|
-
|
|
24
|
+
f as ThemeVariables,
|
|
25
|
+
p as theme,
|
|
26
|
+
l as themeStr
|
|
29
27
|
};
|
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as c, useState as
|
|
3
|
-
import { styled as
|
|
2
|
+
import { useMemo as c, useState as f } from "react";
|
|
3
|
+
import { styled as i } from "@linaria/react";
|
|
4
|
+
import { DeveloperStorage as x } from "../storage.js";
|
|
4
5
|
import { EventInput as g } from "./eventInput.js";
|
|
5
|
-
import { BypassLogin as
|
|
6
|
-
import { SdkKey as
|
|
7
|
-
import { EnvToggle as
|
|
8
|
-
import
|
|
6
|
+
import { BypassLogin as h } from "./bypassLogin.js";
|
|
7
|
+
import { SdkKey as u } from "./sdkKey.js";
|
|
8
|
+
import { EnvToggle as b } from "./envToggle.js";
|
|
9
|
+
import "@streamlayer/sdk-web-storage";
|
|
9
10
|
import "@streamlayer/sdk-web-core";
|
|
10
11
|
import "@nanostores/react";
|
|
11
12
|
import "./styles.js";
|
|
12
|
-
|
|
13
|
-
const v = n.div`
|
|
13
|
+
const v = i.div`
|
|
14
14
|
position: fixed;
|
|
15
15
|
bottom: 0;
|
|
16
16
|
right: 0;
|
|
17
17
|
max-width: 600px;
|
|
18
|
-
`, y =
|
|
18
|
+
`, y = i.div`
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
gap: 10px;
|
|
21
21
|
margin-right: 60px;
|
|
22
22
|
display: flex;
|
|
23
|
-
|
|
23
|
+
animation: show-dev-items 0.3s ease-in-out;
|
|
24
24
|
transform-origin: bottom right;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
@keyframes show-dev-items {
|
|
27
|
+
from {
|
|
28
|
+
transform: scale(0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
to {
|
|
32
|
+
transform: scale(1);
|
|
33
|
+
}
|
|
28
34
|
}
|
|
29
|
-
`, w =
|
|
35
|
+
`, w = i.button`
|
|
30
36
|
position: absolute;
|
|
31
37
|
z-index: 10000;
|
|
32
38
|
bottom: 10px;
|
|
@@ -65,22 +71,22 @@ const v = n.div`
|
|
|
65
71
|
width: 100%;
|
|
66
72
|
height: 4px;
|
|
67
73
|
}
|
|
68
|
-
`,
|
|
69
|
-
const r = c(() => new
|
|
74
|
+
`, T = ({ sdk: t, sdkKey: s, setSdkKey: n, env: m, setEnv: p }) => {
|
|
75
|
+
const r = c(() => new x(), []), [a, d] = f(!1);
|
|
70
76
|
return /* @__PURE__ */ e(v, { children: [
|
|
71
|
-
/* @__PURE__ */ e(w, { "data-opened": a.toString(), onClick: () =>
|
|
77
|
+
/* @__PURE__ */ e(w, { "data-opened": a.toString(), onClick: () => d((l) => !l), children: [
|
|
72
78
|
/* @__PURE__ */ o("span", {}),
|
|
73
79
|
/* @__PURE__ */ o("span", {}),
|
|
74
80
|
/* @__PURE__ */ o("span", {})
|
|
75
81
|
] }),
|
|
76
|
-
/* @__PURE__ */ e(y, {
|
|
77
|
-
p && /* @__PURE__ */ o(
|
|
78
|
-
|
|
82
|
+
a && /* @__PURE__ */ e(y, { children: [
|
|
83
|
+
p && /* @__PURE__ */ o(b, { env: m, setEnv: p, storage: r }),
|
|
84
|
+
n && /* @__PURE__ */ o(u, { sdkKey: s, setSdkKey: n, storage: r }),
|
|
79
85
|
t && /* @__PURE__ */ o(g, { sdk: t, storage: r }),
|
|
80
|
-
t && /* @__PURE__ */ o(
|
|
86
|
+
t && /* @__PURE__ */ o(h, { sdk: t, storage: r })
|
|
81
87
|
] })
|
|
82
88
|
] });
|
|
83
89
|
};
|
|
84
90
|
export {
|
|
85
|
-
|
|
91
|
+
T as Developer
|
|
86
92
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@streamlayer/sdk-web-api": "^0.0.2",
|
|
29
29
|
"@streamlayer/sdk-web-core": "^0.12.0",
|
|
30
30
|
"@streamlayer/sdk-web-features": "^0.9.5",
|
|
31
|
-
"@streamlayer/sdk-web-notifications": "^0.9.4",
|
|
32
31
|
"@streamlayer/sdk-web-interfaces": "^0.18.0",
|
|
32
|
+
"@streamlayer/sdk-web-notifications": "^0.9.4",
|
|
33
33
|
"@streamlayer/sdk-web-storage": "^0.3.2",
|
|
34
34
|
"@streamlayer/sdk-web-types": "^0.16.0"
|
|
35
35
|
},
|