@streamlayer/react-ui 0.30.0 → 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.
@@ -1,50 +1,53 @@
1
- import { jsx as s, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as d } from "react/jsx-runtime";
2
2
  import { useEffect as g } from "react";
3
- const f = ["SL-FONT1", "SL-FONT2"], w = () => {
4
- const p = (t) => {
5
- var r;
6
- const e = t.target.name, o = (r = t.target.files) == null ? void 0 : r[0];
7
- if (!o)
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)
8
24
  return;
9
- const a = new FileReader();
10
- a.onloadend = (d) => {
11
- var i, l;
12
- const n = (l = (i = d.target) == null ? void 0 : i.result) == null ? void 0 : l.toString();
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();
13
29
  if (n) {
14
- const c = window.document.styleSheets[0];
15
- c.insertRule(
30
+ const f = window.document.styleSheets[0];
31
+ f.insertRule(
16
32
  `
17
33
  @font-face {
18
34
  font-family: '${e}';
19
35
  src: url(data:application/octet-stream;base64,${n});
20
36
  }
21
37
  `,
22
- c.cssRules.length
38
+ f.cssRules.length
23
39
  ), window.localStorage.setItem(e, n);
24
40
  }
25
- }, a.readAsText(o);
41
+ }, r.readAsText(a);
26
42
  };
27
- return g(() => {
28
- const t = window.document.styleSheets[0];
29
- for (const e of f) {
30
- const o = window.localStorage.getItem(e);
31
- o && t.insertRule(
32
- `
33
- @font-face {
34
- font-family: '${e}';
35
- src: url(data:application/octet-stream;base64,${o});
36
- }
37
- `,
38
- t.cssRules.length
39
- );
40
- }
41
- }, []), /* @__PURE__ */ s("div", { children: f.map((t) => /* @__PURE__ */ m("p", { style: { fontSize: "32px", fontFamily: t, lineHeight: "45px" }, children: [
43
+ return u(), /* @__PURE__ */ s("div", { children: p.map((t) => /* @__PURE__ */ d("p", { style: { fontSize: "32px", fontFamily: t, lineHeight: "45px" }, children: [
42
44
  "[",
43
45
  t,
44
46
  "] Typography - Desktop/Mobile/App",
45
- !window.localStorage.getItem(t) && /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s("input", { type: "file", name: t, accept: ".txt", onChange: p }) })
47
+ !window.localStorage.getItem(t) && /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s("input", { type: "file", name: t, accept: ".txt", onChange: o }) })
46
48
  ] })) });
47
49
  };
48
50
  export {
49
- w as Typography
51
+ y as Typography,
52
+ u as useCustomFonts
50
53
  };
@@ -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.30.0",
3
+ "version": "0.30.1",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",