@streamlayer/react-ui 0.97.1 → 0.98.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,60 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
- import { cx as d } from "@linaria/core";
3
- import { styled as a } from "@linaria/react";
4
- import { useState as m, useCallback as f, useEffect as l } from "react";
5
- import { r as i } from "../../index-jRXrW6ie.js";
1
+ import { jsxs as p, jsx as u } from "react/jsx-runtime";
2
+ import { styled as h } from "@linaria/react";
3
+ import { useState as w, useEffect as m } from "react";
4
+ import { r as a } from "../../index-jRXrW6ie.js";
5
+ import { BREAKPOINTS as n } from "../theme/constants.js";
6
6
  import "../../index-uEuzH3jr.js";
7
- const u = /* @__PURE__ */ a("div")({
7
+ const y = /* @__PURE__ */ h("div")({
8
8
  name: "StaticContainer",
9
9
  class: "svm502q",
10
10
  propsAsIs: !1
11
- }), p = "fd3gza8", y = `
12
- body {
13
- overflow: hidden !important;
14
- }
15
- `, v = `
11
+ }), g = `
16
12
  .sl-hide-on-modal {
17
- display: none !important;
13
+ height: 0 !important;
14
+ opacity: 0 !important;
15
+ overflow: hidden !important;
18
16
  }
19
- `, x = `
17
+ `, O = `
20
18
  .sl-pill-button {
21
- display: none;
19
+ display: none !important;
22
20
  }
23
- `, h = (o) => {
24
- const [e, r] = m(o), t = f(() => r(!1), []);
25
- return l(() => (o && document.addEventListener("scroll", t), () => {
26
- document.removeEventListener("scroll", t);
27
- }), [o, t]), l(() => {
28
- e === !1 && document.removeEventListener("scroll", t);
29
- }, [e, t]), [e];
30
- }, P = ({
31
- children: o,
32
- container: e,
33
- fixedView: r,
34
- useContainer: t
21
+ `, k = ({
22
+ children: i,
23
+ container: t,
24
+ useContainer: f
35
25
  }) => {
36
- const [s] = h(r);
37
- return e.current ? t ? i.createPortal(/* @__PURE__ */ c(u, {
38
- className: d(s && p),
39
- children: [o, s && /* @__PURE__ */ n("style", {
40
- children: y
41
- }), !s && /* @__PURE__ */ n("style", {
42
- children: v
43
- }), /* @__PURE__ */ n("style", {
44
- children: x
26
+ const [l] = w(() => {
27
+ var r;
28
+ const e = window.innerWidth >= n.lg && window.innerWidth < n.xl ? 75 : 52;
29
+ return (((r = t.current) == null ? void 0 : r.getBoundingClientRect().y) || 0) - e < 0;
30
+ }), [o, s] = w(!1);
31
+ return m(() => {
32
+ if (!t.current || !l)
33
+ return s(!0), () => {
34
+ };
35
+ const e = window.scrollY;
36
+ return s(!0), () => {
37
+ var c;
38
+ const d = window.innerWidth >= n.lg && window.innerWidth < n.xl ? 75 : 52;
39
+ (((c = t.current) == null ? void 0 : c.getBoundingClientRect().y) || 0) - d < 0 && window.scrollTo({
40
+ top: e
41
+ });
42
+ };
43
+ }, []), m(() => {
44
+ if (o && t.current && l) {
45
+ const e = window.innerWidth >= n.lg && window.innerWidth < n.xl ? 75 : 52;
46
+ window.scrollTo({
47
+ top: t.current.offsetTop - e
48
+ });
49
+ }
50
+ }, [o]), !t.current || !o ? null : f ? a.createPortal(/* @__PURE__ */ p(y, {
51
+ children: [i, /* @__PURE__ */ u("style", {
52
+ children: g
53
+ }), /* @__PURE__ */ u("style", {
54
+ children: O
45
55
  })]
46
- }), e.current, "modal-node") : i.createPortal(o, e.current, "modal-node") : null;
56
+ }), t.current, "modal-node") : a.createPortal(i, t.current, "modal-node");
47
57
  };
48
58
  export {
49
- P as ModalPortal
59
+ k as ModalPortal
50
60
  };
@@ -1,9 +1,13 @@
1
- /// <reference types="react" />
2
- export declare const ShowIn: React.FC<{
1
+ import React from 'react';
2
+ type ShowInProps = {
3
3
  children: React.ReactNode | React.ReactNode[];
4
4
  style?: React.CSSProperties;
5
5
  className?: string;
6
6
  enabled?: boolean;
7
- replayKey?: unknown;
8
7
  hiding?: boolean;
8
+ };
9
+ export declare const ShowIn: React.FC<ShowInProps>;
10
+ export declare const GrowingShowIn: React.FC<ShowInProps & {
11
+ animate?: boolean;
9
12
  }>;
13
+ export {};
@@ -1,30 +1,52 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { cx as u } from "@linaria/core";
3
- import { styled as g } from "@linaria/react";
4
- import { useState as p, useEffect as h } from "react";
5
- const w = /* @__PURE__ */ g("div")({
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { cx as h } from "@linaria/core";
3
+ import { styled as p } from "@linaria/react";
4
+ import { useRef as l, useMemo as a } from "react";
5
+ const w = /* @__PURE__ */ p("div")({
6
6
  name: "Container",
7
7
  class: "c1pgyo67",
8
8
  propsAsIs: !1
9
- }), S = "sx17qu6", d = "h1692c5m", v = ({
10
- children: i,
11
- style: n,
12
- className: r,
9
+ }), f = "sx17qu6", d = "h1692c5m", x = ({
10
+ children: r,
11
+ style: e,
12
+ className: t,
13
13
  enabled: o = !0,
14
- replayKey: t,
15
- hiding: e
14
+ hiding: s
15
+ }) => /* @__PURE__ */ c(w, {
16
+ style: e,
17
+ className: h(t, o && f, o && s && d),
18
+ children: r
19
+ }), y = () => x, C = /* @__PURE__ */ p(y())({
20
+ name: "GrowingContainer",
21
+ class: "gck55ev",
22
+ propsAsIs: !0
23
+ }), G = ({
24
+ children: r,
25
+ style: e,
26
+ enabled: t,
27
+ animate: o,
28
+ ...s
16
29
  }) => {
17
- const [m, s] = p(!0), c = o && m, a = o && e;
18
- return h(() => {
19
- t !== void 0 && (s(!1), requestAnimationFrame(() => {
20
- s(!0);
21
- }));
22
- }, [t]), /* @__PURE__ */ f(w, {
23
- style: n,
24
- className: u(r, c && S, a && d),
25
- children: i
30
+ const n = l(null), u = a(() => {
31
+ const m = n == null ? void 0 : n.current, i = m && window.getComputedStyle(m), g = i == null ? void 0 : i.getPropertyValue("height");
32
+ return t ? {
33
+ height: o ? g : 0
34
+ } : {};
35
+ }, [t, o]);
36
+ return /* @__PURE__ */ c(C, {
37
+ ...s,
38
+ enabled: t && o,
39
+ style: {
40
+ ...e,
41
+ ...u
42
+ },
43
+ children: /* @__PURE__ */ c("div", {
44
+ ref: n,
45
+ children: r
46
+ })
26
47
  });
27
48
  };
28
49
  export {
29
- v as ShowIn
50
+ G as GrowingShowIn,
51
+ x as ShowIn
30
52
  };
@@ -59,7 +59,7 @@ const N = {
59
59
  sm: 576,
60
60
  md: 768,
61
61
  lg: 992,
62
- xl: 1215,
62
+ xl: 1200,
63
63
  xxl: 1440
64
64
  }, G = {
65
65
  landscape: "landscape",
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
- import { breakpoints as i } from "./breakpoints.js";
3
- import { colors as l, FONT as t } from "./constants.js";
4
- const s = `
5
- ${l}
2
+ import { breakpoints as n } from "./breakpoints.js";
3
+ import { colors as h, FONT as t } from "./constants.js";
4
+ const l = `
5
+ ${h}
6
6
  --font-family: ${t.REGULAR};
7
7
  --font-regular: ${t.REGULAR};
8
8
  --font-color: ${t.COLOR};
@@ -11,6 +11,7 @@ const s = `
11
11
 
12
12
  --header-offset: 0px;
13
13
  --header-height: 68px;
14
+ --watch-live-header: 0px;
14
15
  --animation-duration: 0.5s;
15
16
  --animation-function: ease;
16
17
  --container-padding: 16px;
@@ -19,14 +20,15 @@ const s = `
19
20
  --max-width: 600px;
20
21
  --max-notifications-width: 400px;
21
22
 
22
- ${i.down("xl")`
23
+ ${n.down("xl")`
23
24
  --header-offset: 56px;
25
+ --watch-live-header: 46px;
24
26
  `}
25
27
 
26
- ${i.intermediate("xl", "lg")`
28
+ ${n.intermediate("xl", "lg")`
27
29
  --header-offset: 76px;
28
30
  `}
29
- `, m = "StreamLayerCSSReset", p = "ttkj0ah", x = () => /* @__PURE__ */ e("table", {
31
+ `, p = "StreamLayerCSSReset", m = "ttkj0ah", x = () => /* @__PURE__ */ e("table", {
30
32
  children: /* @__PURE__ */ r("table", {
31
33
  children: [/* @__PURE__ */ e("thead", {
32
34
  children: /* @__PURE__ */ r("tr", {
@@ -37,22 +39,22 @@ const s = `
37
39
  })]
38
40
  })
39
41
  }), /* @__PURE__ */ e("tbody", {
40
- children: s.split(";").map((o) => {
41
- const n = o.trim(), [a, d] = n.split(":");
42
+ children: l.split(";").map((a) => {
43
+ const i = a.trim(), [o, d] = i.split(":");
42
44
  return /* @__PURE__ */ r("tr", {
43
45
  children: [/* @__PURE__ */ e("td", {
44
- children: a
46
+ children: o
45
47
  }), /* @__PURE__ */ e("td", {
46
48
  children: d
47
49
  })]
48
- }, n);
50
+ }, i);
49
51
  })
50
52
  })]
51
53
  })
52
54
  });
53
55
  export {
54
56
  x as ThemeVariables,
55
- m as resetCss,
56
- p as theme,
57
- s as themeStr
57
+ p as resetCss,
58
+ m as theme,
59
+ l as themeStr
58
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.97.1",
3
+ "version": "0.98.1",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -44,16 +44,16 @@
44
44
  "react-virtualized-auto-sizer": "^1.0.21",
45
45
  "react-window": "^1.8.10",
46
46
  "react-window-infinite-loader": "^1.0.9",
47
- "@streamlayer/feature-gamification": "^0.39.0",
48
- "@streamlayer/sdk-web": "^0.33.0",
49
- "@streamlayer/sdk-web-analytics": "^0.1.0",
50
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.42",
51
- "@streamlayer/sdk-web-api": "^0.24.0",
52
- "@streamlayer/sdk-web-features": "^0.11.24",
47
+ "@streamlayer/feature-gamification": "^0.40.0",
48
+ "@streamlayer/sdk-web": "^0.33.2",
49
+ "@streamlayer/sdk-web-analytics": "^0.1.2",
50
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.44",
51
+ "@streamlayer/sdk-web-api": "^0.24.2",
52
+ "@streamlayer/sdk-web-core": "^0.22.2",
53
+ "@streamlayer/sdk-web-features": "^0.11.26",
53
54
  "@streamlayer/sdk-web-interfaces": "^0.21.0",
54
55
  "@streamlayer/sdk-web-logger": "^0.5.18",
55
- "@streamlayer/sdk-web-notifications": "^0.15.0",
56
- "@streamlayer/sdk-web-core": "^0.22.0",
56
+ "@streamlayer/sdk-web-notifications": "^0.15.1",
57
57
  "@streamlayer/sdk-web-storage": "^0.4.5",
58
58
  "@streamlayer/sdk-web-types": "^0.23.0"
59
59
  },
@@ -96,6 +96,6 @@
96
96
  "vite-plugin-svgr": "^4.2.0",
97
97
  "vite-svg-loader": "^5.1.0",
98
98
  "vite-tsconfig-paths": "^4.3.1",
99
- "@streamlayer/react": "^0.41.1"
99
+ "@streamlayer/react": "^0.41.3"
100
100
  }
101
101
  }