@streamlayer/react-ui 0.97.0 → 0.98.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,42 +1,49 @@
1
1
  import { styled as s } from "@linaria/react";
2
2
  import { SvgIcon as n } from "../../../icons/index.js";
3
+ import { GrowingShowIn as o } from "../../../show-in/index.js";
3
4
  import "react/jsx-runtime";
4
5
  import "react";
5
- const e = /* @__PURE__ */ s("div")({
6
+ import "@linaria/core";
7
+ const t = () => o, m = /* @__PURE__ */ s(t())({
8
+ name: "ShowInContainer",
9
+ class: "sie6cqo",
10
+ propsAsIs: !0
11
+ }), I = /* @__PURE__ */ s("div")({
6
12
  name: "WinBarContainer",
7
- class: "wie6cqo",
13
+ class: "wgizw4u",
8
14
  propsAsIs: !1
9
- }), c = /* @__PURE__ */ s("div")({
15
+ }), f = /* @__PURE__ */ s("div")({
10
16
  name: "Content",
11
- class: "cgizw4u",
17
+ class: "c1l3ucjp",
12
18
  propsAsIs: !1
13
- }), r = /* @__PURE__ */ s("div")({
19
+ }), w = /* @__PURE__ */ s("div")({
14
20
  name: "Title",
15
- class: "t1l3ucjp",
21
+ class: "tx7j799",
16
22
  propsAsIs: !1
17
- }), o = () => n, l = /* @__PURE__ */ s(o())({
23
+ }), i = () => n, A = /* @__PURE__ */ s(i())({
18
24
  name: "WinIcon",
19
- class: "wx7j799",
25
+ class: "w4lwuj0",
20
26
  propsAsIs: !0
21
- }), m = /* @__PURE__ */ s("div")({
27
+ }), C = /* @__PURE__ */ s("div")({
22
28
  name: "Points",
23
- class: "p4lwuj0",
29
+ class: "po9i64o",
24
30
  propsAsIs: !1
25
- }), I = /* @__PURE__ */ s("span")({
31
+ }), u = /* @__PURE__ */ s("span")({
26
32
  name: "PointsCount",
27
- class: "po9i64o",
33
+ class: "pe5g05h",
28
34
  propsAsIs: !1
29
- }), f = /* @__PURE__ */ s("span")({
35
+ }), d = /* @__PURE__ */ s("span")({
30
36
  name: "PointsUnits",
31
- class: "pe5g05h",
37
+ class: "p1hdtpmb",
32
38
  propsAsIs: !1
33
39
  });
34
40
  export {
35
- c as Content,
36
- m as Points,
37
- I as PointsCount,
38
- f as PointsUnits,
39
- r as Title,
40
- e as WinBarContainer,
41
- l as WinIcon
41
+ f as Content,
42
+ C as Points,
43
+ u as PointsCount,
44
+ d as PointsUnits,
45
+ m as ShowInContainer,
46
+ w as Title,
47
+ I as WinBarContainer,
48
+ A as WinIcon
42
49
  };
@@ -1,50 +1,52 @@
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 a, jsx as s } from "react/jsx-runtime";
2
+ import { cx as m } from "@linaria/core";
3
+ import { styled as f } from "@linaria/react";
4
+ import { useState as u, useCallback as i, useEffect as c } from "react";
5
+ import { r as d } from "../../index-jRXrW6ie.js";
6
6
  import "../../index-uEuzH3jr.js";
7
- const u = /* @__PURE__ */ a("div")({
7
+ const p = /* @__PURE__ */ f("div")({
8
8
  name: "StaticContainer",
9
9
  class: "svm502q",
10
10
  propsAsIs: !1
11
- }), p = "fd3gza8", y = `
11
+ }), v = "fd3gza8", x = `
12
12
  body {
13
13
  overflow: hidden !important;
14
14
  }
15
- `, v = `
15
+ `, y = `
16
16
  .sl-hide-on-modal {
17
17
  display: none !important;
18
18
  }
19
- `, x = `
19
+ `, h = `
20
20
  .sl-pill-button {
21
- display: none;
21
+ display: none !important;
22
22
  }
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
23
+ `, E = (r) => {
24
+ const [t, n] = u(r), o = i((l) => {
25
+ l.target instanceof HTMLAnchorElement && l.target.href.slice(-1) === "#" && n(!1);
26
+ }, []), e = i(() => n(!1), []);
27
+ return c(() => (r && (document.addEventListener("scroll", e), document.addEventListener("click", o)), () => {
28
+ document.removeEventListener("scroll", e), document.removeEventListener("click", o);
29
+ }), [r, e, o]), c(() => {
30
+ t === !1 && (document.removeEventListener("scroll", e), document.removeEventListener("click", o));
31
+ }, [t, e, o]), [t];
32
+ }, V = ({
33
+ children: r,
34
+ container: t,
35
+ fixedView: n,
36
+ useContainer: o
35
37
  }) => {
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", {
38
+ const [e] = E(n);
39
+ return t.current ? o ? d.createPortal(/* @__PURE__ */ a(p, {
40
+ className: m(e && v),
41
+ children: [r, e && /* @__PURE__ */ s("style", {
44
42
  children: x
43
+ }), !e && /* @__PURE__ */ s("style", {
44
+ children: y
45
+ }), /* @__PURE__ */ s("style", {
46
+ children: h
45
47
  })]
46
- }), e.current, "modal-node") : i.createPortal(o, e.current, "modal-node") : null;
48
+ }), t.current, "modal-node") : d.createPortal(r, t.current, "modal-node") : null;
47
49
  };
48
50
  export {
49
- P as ModalPortal
51
+ V as ModalPortal
50
52
  };
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.97.0",
3
+ "version": "0.98.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -44,15 +44,15 @@
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-analytics": "^0.1.0",
49
- "@streamlayer/sdk-web": "^0.33.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",
53
- "@streamlayer/sdk-web-logger": "^0.5.18",
54
- "@streamlayer/sdk-web-core": "^0.22.0",
47
+ "@streamlayer/feature-gamification": "^0.39.1",
48
+ "@streamlayer/sdk-web": "^0.33.1",
49
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.43",
50
+ "@streamlayer/sdk-web-analytics": "^0.1.1",
51
+ "@streamlayer/sdk-web-api": "^0.24.1",
52
+ "@streamlayer/sdk-web-core": "^0.22.1",
53
+ "@streamlayer/sdk-web-features": "^0.11.25",
55
54
  "@streamlayer/sdk-web-interfaces": "^0.21.0",
55
+ "@streamlayer/sdk-web-logger": "^0.5.18",
56
56
  "@streamlayer/sdk-web-notifications": "^0.15.0",
57
57
  "@streamlayer/sdk-web-storage": "^0.4.5",
58
58
  "@streamlayer/sdk-web-types": "^0.23.0"
@@ -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.0"
99
+ "@streamlayer/react": "^0.41.2"
100
100
  }
101
101
  }