@streamlayer/react-ui 0.29.1 → 0.30.1

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.
@@ -0,0 +1,53 @@
1
+ import { jsx as s, jsxs as d } from "react/jsx-runtime";
2
+ import { useEffect as g } from "react";
3
+ const p = ["SL-FONT1", "SL-FONT2"], u = () => {
4
+ g(() => {
5
+ const o = window.document.styleSheets[0];
6
+ for (const t of p) {
7
+ const e = window.localStorage.getItem(t);
8
+ e && o.insertRule(
9
+ `
10
+ @font-face {
11
+ font-family: '${t}';
12
+ src: url(data:application/octet-stream;base64,${e});
13
+ }
14
+ `,
15
+ o.cssRules.length
16
+ );
17
+ }
18
+ }, []);
19
+ }, y = () => {
20
+ const o = (t) => {
21
+ var i;
22
+ const e = t.target.name, a = (i = t.target.files) == null ? void 0 : i[0];
23
+ if (!a)
24
+ return;
25
+ const r = new FileReader();
26
+ r.onloadend = (m) => {
27
+ var c, l;
28
+ const n = (l = (c = m.target) == null ? void 0 : c.result) == null ? void 0 : l.toString();
29
+ if (n) {
30
+ const f = window.document.styleSheets[0];
31
+ f.insertRule(
32
+ `
33
+ @font-face {
34
+ font-family: '${e}';
35
+ src: url(data:application/octet-stream;base64,${n});
36
+ }
37
+ `,
38
+ f.cssRules.length
39
+ ), window.localStorage.setItem(e, n);
40
+ }
41
+ }, r.readAsText(a);
42
+ };
43
+ return u(), /* @__PURE__ */ s("div", { children: p.map((t) => /* @__PURE__ */ d("p", { style: { fontSize: "32px", fontFamily: t, lineHeight: "45px" }, children: [
44
+ "[",
45
+ t,
46
+ "] Typography - Desktop/Mobile/App",
47
+ !window.localStorage.getItem(t) && /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s("input", { type: "file", name: t, accept: ".txt", onChange: o }) })
48
+ ] })) });
49
+ };
50
+ export {
51
+ y as Typography,
52
+ u as useCustomFonts
53
+ };
@@ -50,8 +50,8 @@ const N = {
50
50
  NEUTRALS_GRAY9: "#25282A",
51
51
  NEUTRALS_BLACK: "#000000"
52
52
  }, E = Object.assign({}, N, T), S = {
53
- REGULAR: "'Benton Sans', BentonSans, Arial, Helvetica, sans-serif",
54
- SERIF: "'Tiempos', 'Tiempos Text', Times New Roman, serif",
53
+ REGULAR: "'Benton Sans', BentonSans, SL-FONT1, Arial, Helvetica, sans-serif",
54
+ SERIF: "'Tiempos', 'Tiempos Text', SL-FONT2, Times New Roman, serif",
55
55
  COLOR: "#fff"
56
56
  }, O = Object.keys(E).reduce((_, R) => {
57
57
  const A = E[R];
@@ -1,11 +1,13 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { StreamLayerThemeProvider as i } from "../../ui/theme/index.js";
2
+ import { StreamLayerThemeProvider as t } from "../../ui/theme/index.js";
3
+ import { useCustomFonts as i } from "../../ui/theme/Typography.js";
3
4
  import { AppContainer as m } from "./styles.js";
4
5
  import "../../ui/theme/theme.js";
5
6
  import "@linaria/core";
6
7
  import "../../ui/theme/constants.js";
8
+ import "react";
7
9
  import "@linaria/react";
8
- const h = (o) => /* @__PURE__ */ r(i, { children: /* @__PURE__ */ r(m, { children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(o, {}) }) }) });
10
+ const l = (o) => (i(), /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(m, { children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(o, {}) }) }) }));
9
11
  export {
10
- h as container
12
+ l as container
11
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.29.1",
3
+ "version": "0.30.1",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -22,16 +22,16 @@
22
22
  ],
23
23
  "peerDependencies": {
24
24
  "@streamlayer/sl-eslib": "^5.45.1",
25
- "@streamlayer/feature-gamification": "^0.17.1",
26
- "@streamlayer/sdk-web": "^0.27.2",
27
- "@streamlayer/sdk-web-anonymous-auth": "^0.10.7",
28
- "@streamlayer/sdk-web-api": "^0.0.3",
29
- "@streamlayer/sdk-web-core": "^0.13.1",
30
- "@streamlayer/sdk-web-features": "^0.10.1",
31
- "@streamlayer/sdk-web-interfaces": "^0.18.1",
32
- "@streamlayer/sdk-web-notifications": "^0.10.0",
33
- "@streamlayer/sdk-web-storage": "^0.3.3",
34
- "@streamlayer/sdk-web-types": "^0.16.1"
25
+ "@streamlayer/feature-gamification": "^0.17.2",
26
+ "@streamlayer/sdk-web": "^0.27.3",
27
+ "@streamlayer/sdk-web-anonymous-auth": "^0.10.8",
28
+ "@streamlayer/sdk-web-api": "^0.0.4",
29
+ "@streamlayer/sdk-web-core": "^0.13.2",
30
+ "@streamlayer/sdk-web-features": "^0.10.2",
31
+ "@streamlayer/sdk-web-interfaces": "^0.18.2",
32
+ "@streamlayer/sdk-web-notifications": "^0.10.1",
33
+ "@streamlayer/sdk-web-storage": "^0.3.4",
34
+ "@streamlayer/sdk-web-types": "^0.16.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@connectrpc/connect": "^1.1.3",
@@ -1,15 +0,0 @@
1
- import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
- import { styled as e } from "@linaria/react";
3
- const n = e.p`
4
- font-family: var(--font-serif);
5
- font-size: 32px;
6
- `, i = e.p`
7
- font-family: var(--font-regular);
8
- font-size: 32px;
9
- `, s = () => /* @__PURE__ */ o("div", { children: [
10
- /* @__PURE__ */ r(i, { children: "Regular (Benton Sans Serif)" }),
11
- /* @__PURE__ */ r(n, { children: "Serif (Tiempos)" })
12
- ] });
13
- export {
14
- s as ThemeTypography
15
- };