@streamlayer/react-ui 0.99.0 → 0.100.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.
Files changed (42) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/hooks/showIn.js +45 -0
  3. package/lib/ui/app/Features/Gamification/Leaderboard.d.ts +1 -2
  4. package/lib/ui/app/Features/Gamification/Leaderboard.js +24 -26
  5. package/lib/ui/app/Features/Gamification/Question.js +19 -19
  6. package/lib/ui/app/Features/Gamification/Tabs.d.ts +1 -2
  7. package/lib/ui/app/Features/Gamification/Tabs.js +27 -37
  8. package/lib/ui/app/Features/Gamification/index.d.ts +1 -2
  9. package/lib/ui/app/Features/Gamification/index.js +46 -40
  10. package/lib/ui/app/Features/index.d.ts +1 -2
  11. package/lib/ui/app/Features/index.js +16 -17
  12. package/lib/ui/app/Notifications/Onboarding/index.js +33 -33
  13. package/lib/ui/app/masters.js +42 -42
  14. package/lib/ui/app/useSdkScroll.js +30 -27
  15. package/lib/ui/gamification/leaderboard/list-item/index.d.ts +0 -1
  16. package/lib/ui/gamification/leaderboard/list-item/index.js +16 -16
  17. package/lib/ui/gamification/leaderboard/static.js +31 -24
  18. package/lib/ui/gamification/question/index.d.ts +1 -3
  19. package/lib/ui/gamification/question/index.js +25 -26
  20. package/lib/ui/gamification/question/insight/index.d.ts +0 -1
  21. package/lib/ui/gamification/question/insight/index.js +7 -7
  22. package/lib/ui/gamification/question/list/index.js +19 -35
  23. package/lib/ui/gamification/question/twitter/index.d.ts +0 -1
  24. package/lib/ui/gamification/question/twitter/index.js +8 -8
  25. package/lib/ui/gamification/vote/alert/index.d.ts +8 -0
  26. package/lib/ui/gamification/vote/alert/index.js +11 -0
  27. package/lib/ui/gamification/vote/{expired-alert → alert}/styles.js +7 -7
  28. package/lib/ui/gamification/vote/feedback/index.js +31 -31
  29. package/lib/ui/gamification/vote/index.d.ts +1 -0
  30. package/lib/ui/gamification/vote/index.js +109 -89
  31. package/lib/ui/gamification/vote/styles.d.ts +1 -0
  32. package/lib/ui/gamification/vote/styles.js +14 -8
  33. package/lib/ui/gamification/vote/vote-option/index.js +28 -28
  34. package/lib/ui/gamification/vote/vote-option/styles.d.ts +1 -0
  35. package/lib/ui/gamification/vote/vote-option/styles.js +34 -29
  36. package/lib/ui/modal/index.js +31 -31
  37. package/lib/ui/show-in/index.d.ts +1 -0
  38. package/lib/ui/show-in/index.js +12 -10
  39. package/package.json +19 -20
  40. package/lib/ui/gamification/vote/expired-alert/index.d.ts +0 -7
  41. package/lib/ui/gamification/vote/expired-alert/index.js +0 -11
  42. /package/lib/ui/gamification/vote/{expired-alert → alert}/styles.d.ts +0 -0
@@ -5,66 +5,71 @@ const r = /* @__PURE__ */ s("button")({
5
5
  class: "b1b6dl8t",
6
6
  propsAsIs: !1
7
7
  }), l = /* @__PURE__ */ s("div")({
8
- name: "ButtonPct",
8
+ name: "ButtonPctWrap",
9
9
  class: "b4iik8i",
10
10
  propsAsIs: !1
11
- }), I = /* @__PURE__ */ s("span")({
12
- name: "ButtonBody",
11
+ }), I = /* @__PURE__ */ s("div")({
12
+ name: "ButtonPct",
13
13
  class: "b1gq1lnf",
14
14
  propsAsIs: !1
15
- }), i = /* @__PURE__ */ s("div")({
16
- name: "IconContainer",
17
- class: "i1j65z51",
15
+ }), i = /* @__PURE__ */ s("span")({
16
+ name: "ButtonBody",
17
+ class: "b1j65z51",
18
18
  propsAsIs: !1
19
19
  }), m = /* @__PURE__ */ s("div")({
20
- name: "IconWrap",
20
+ name: "IconContainer",
21
21
  class: "i19tpfua",
22
22
  propsAsIs: !1
23
+ }), u = /* @__PURE__ */ s("div")({
24
+ name: "IconWrap",
25
+ class: "i1tubmma",
26
+ propsAsIs: !1
23
27
  }), n = /* @__PURE__ */ s("img")({
24
28
  name: "Icon",
25
- class: "i1tubmma",
29
+ class: "i1grrgwj",
26
30
  propsAsIs: !1
27
31
  }), t = () => n, f = /* @__PURE__ */ s(t())({
28
32
  name: "IconDefault",
29
- class: "i1grrgwj",
33
+ class: "ibemyq8",
30
34
  propsAsIs: !0
31
- }), a = () => n, u = /* @__PURE__ */ s(a())({
35
+ }), a = () => n, A = /* @__PURE__ */ s(a())({
32
36
  name: "IconCircle",
33
- class: "ibemyq8",
37
+ class: "i1dceht",
34
38
  propsAsIs: !0
35
- }), A = /* @__PURE__ */ s("span")({
39
+ }), d = /* @__PURE__ */ s("span")({
36
40
  name: "Title",
37
- class: "t1dceht",
41
+ class: "t116q4vq",
38
42
  propsAsIs: !1
39
- }), d = /* @__PURE__ */ s("span")({
43
+ }), B = /* @__PURE__ */ s("span")({
40
44
  name: "Indicators",
41
- class: "i116q4vq",
45
+ class: "i17ajcu2",
42
46
  propsAsIs: !1
43
47
  }), b = /* @__PURE__ */ s("span")({
44
48
  name: "Pts",
45
- class: "p17ajcu2",
49
+ class: "pu9kmlb",
46
50
  propsAsIs: !1
47
- }), B = /* @__PURE__ */ s("span")({
51
+ }), C = /* @__PURE__ */ s("span")({
48
52
  name: "Percentage",
49
- class: "pu9kmlb",
53
+ class: "p1j2j0s0",
50
54
  propsAsIs: !1
51
- }), c = () => o, C = /* @__PURE__ */ s(c())({
55
+ }), c = () => o, P = /* @__PURE__ */ s(c())({
52
56
  name: "CheckIcon",
53
- class: "c1j2j0s0",
57
+ class: "c1mzj1sj",
54
58
  propsAsIs: !0
55
59
  });
56
60
  export {
57
- I as ButtonBody,
61
+ i as ButtonBody,
58
62
  r as ButtonContainer,
59
- l as ButtonPct,
60
- C as CheckIcon,
63
+ I as ButtonPct,
64
+ l as ButtonPctWrap,
65
+ P as CheckIcon,
61
66
  n as Icon,
62
- u as IconCircle,
63
- i as IconContainer,
67
+ A as IconCircle,
68
+ m as IconContainer,
64
69
  f as IconDefault,
65
- m as IconWrap,
66
- d as Indicators,
67
- B as Percentage,
70
+ u as IconWrap,
71
+ B as Indicators,
72
+ C as Percentage,
68
73
  b as Pts,
69
- A as Title
74
+ d as Title
70
75
  };
@@ -1,13 +1,13 @@
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 a } from "react";
4
- import { r as f } from "../../index-Bicco-Aq.js";
5
- import { BREAKPOINTS as n } from "../theme/constants.js";
6
- const y = /* @__PURE__ */ h("div")({
1
+ import { jsxs as p, jsx as i } from "react/jsx-runtime";
2
+ import { styled as w } from "@linaria/react";
3
+ import { useState as c, useEffect as d } from "react";
4
+ import { r as a } from "../../index-Bicco-Aq.js";
5
+ import { BREAKPOINTS as u } from "../theme/constants.js";
6
+ const h = /* @__PURE__ */ w("div")({
7
7
  name: "StaticContainer",
8
8
  class: "svm502q",
9
9
  propsAsIs: !1
10
- }), g = `
10
+ }), y = `
11
11
  .sl-hide-on-modal {
12
12
  height: 0 !important;
13
13
  opacity: 0 !important;
@@ -17,43 +17,43 @@ const y = /* @__PURE__ */ h("div")({
17
17
  .sl-pill-button {
18
18
  display: none !important;
19
19
  }
20
- `, W = ({
21
- children: i,
20
+ `, m = () => window.innerWidth >= u.lg && window.innerWidth < u.xl ? 76 : 53, f = (o) => {
21
+ var e;
22
+ const t = m();
23
+ return Math.round((((e = o.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) - t) <= 0;
24
+ }, x = ({
25
+ children: o,
22
26
  container: t,
23
- useContainer: m
27
+ useContainer: e
24
28
  }) => {
25
- const [l] = w(() => {
26
- var r;
27
- const e = window.innerWidth >= n.lg && window.innerWidth < n.xl ? 75 : 52;
28
- return (((r = t.current) == null ? void 0 : r.getBoundingClientRect().y) || 0) - e < 0;
29
- }), [o, s] = w(!1);
30
- return a(() => {
29
+ const [l] = c(() => f(t)), [n, s] = c(!1);
30
+ return d(() => {
31
31
  if (!t.current || !l)
32
32
  return s(!0), () => {
33
33
  };
34
- const e = window.scrollY;
34
+ const r = window.scrollY;
35
35
  return s(!0), () => {
36
- var c;
37
- const d = window.innerWidth >= n.lg && window.innerWidth < n.xl ? 75 : 52;
38
- (((c = t.current) == null ? void 0 : c.getBoundingClientRect().y) || 0) - d < 0 && window.scrollTo({
39
- top: e
36
+ f(t) && window.scrollTo({
37
+ top: r,
38
+ behavior: "instant"
40
39
  });
41
40
  };
42
- }, []), a(() => {
43
- if (o && t.current && l) {
44
- const e = window.innerWidth >= n.lg && window.innerWidth < n.xl ? 75 : 52;
41
+ }, []), d(() => {
42
+ if (n && t.current && l) {
43
+ const r = m();
45
44
  window.scrollTo({
46
- top: t.current.offsetTop - e
45
+ top: t.current.offsetTop - r,
46
+ behavior: "instant"
47
47
  });
48
48
  }
49
- }, [o]), !t.current || !o ? null : m ? f.createPortal(/* @__PURE__ */ p(y, {
50
- children: [i, /* @__PURE__ */ u("style", {
51
- children: g
52
- }), /* @__PURE__ */ u("style", {
49
+ }, [n]), !t.current || !n ? null : e ? a.createPortal(/* @__PURE__ */ p(h, {
50
+ children: [o, /* @__PURE__ */ i("style", {
51
+ children: y
52
+ }), /* @__PURE__ */ i("style", {
53
53
  children: O
54
54
  })]
55
- }), t.current, "modal-node") : f.createPortal(i, t.current, "modal-node");
55
+ }), t.current, "modal-node") : a.createPortal(o, t.current, "modal-node");
56
56
  };
57
57
  export {
58
- W as ModalPortal
58
+ x as ModalPortal
59
59
  };
@@ -5,6 +5,7 @@ type ShowInProps = {
5
5
  className?: string;
6
6
  enabled?: boolean;
7
7
  hiding?: boolean;
8
+ onAnimationEnd?: React.AnimationEventHandler;
8
9
  };
9
10
  export declare const ShowIn: React.FC<ShowInProps>;
10
11
  export declare const GrowingShowIn: React.FC<ShowInProps & {
@@ -9,12 +9,14 @@ const w = /* @__PURE__ */ p("div")({
9
9
  }), f = "sx17qu6", d = "h1692c5m", x = ({
10
10
  children: r,
11
11
  style: e,
12
- className: t,
12
+ className: n,
13
13
  enabled: o = !0,
14
- hiding: s
14
+ hiding: s,
15
+ onAnimationEnd: t
15
16
  }) => /* @__PURE__ */ c(w, {
16
17
  style: e,
17
- className: h(t, o && f, o && s && d),
18
+ className: h(n, o && f, o && s && d),
19
+ onAnimationEnd: t,
18
20
  children: r
19
21
  }), y = () => x, C = /* @__PURE__ */ p(y())({
20
22
  name: "GrowingContainer",
@@ -23,25 +25,25 @@ const w = /* @__PURE__ */ p("div")({
23
25
  }), G = ({
24
26
  children: r,
25
27
  style: e,
26
- enabled: t,
28
+ enabled: n,
27
29
  animate: o,
28
30
  ...s
29
31
  }) => {
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 ? {
32
+ const t = l(null), u = a(() => {
33
+ const m = t == null ? void 0 : t.current, i = m && window.getComputedStyle(m), g = i == null ? void 0 : i.getPropertyValue("height");
34
+ return n ? {
33
35
  height: o ? g : 0
34
36
  } : {};
35
- }, [t, o]);
37
+ }, [n, o]);
36
38
  return /* @__PURE__ */ c(C, {
37
39
  ...s,
38
- enabled: t && o,
40
+ enabled: n && o,
39
41
  style: {
40
42
  ...e,
41
43
  ...u
42
44
  },
43
45
  children: /* @__PURE__ */ c("div", {
44
- ref: n,
46
+ ref: t,
45
47
  children: r
46
48
  })
47
49
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.99.0",
3
+ "version": "0.100.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  ],
37
37
  "peerDependencies": {
38
38
  "@lottiefiles/react-lottie-player": "^3.5.3",
39
- "@streamlayer/sl-eslib": "^5.84.0",
39
+ "@streamlayer/sl-eslib": "^5.85.0",
40
40
  "@types/lodash.throttle": "^4.1.9",
41
41
  "lodash.throttle": "^4.1.1",
42
42
  "nanoid": "3.3.7",
@@ -44,18 +44,18 @@
44
44
  "react-virtualized-auto-sizer": "^1.0.24",
45
45
  "react-window": "^1.8.10",
46
46
  "react-window-infinite-loader": "^1.0.9",
47
- "@streamlayer/feature-gamification": "^0.40.1",
48
- "@streamlayer/sdk-web": "^0.33.3",
49
- "@streamlayer/sdk-web-analytics": "^0.1.3",
50
- "@streamlayer/sdk-web-anonymous-auth": "^0.11.45",
51
- "@streamlayer/sdk-web-api": "^0.24.3",
52
- "@streamlayer/sdk-web-core": "^0.22.3",
53
- "@streamlayer/sdk-web-features": "^0.11.27",
54
- "@streamlayer/sdk-web-interfaces": "^0.21.1",
55
- "@streamlayer/sdk-web-logger": "^0.5.19",
56
- "@streamlayer/sdk-web-notifications": "^0.15.2",
57
- "@streamlayer/sdk-web-storage": "^0.4.6",
58
- "@streamlayer/sdk-web-types": "^0.23.1"
47
+ "@streamlayer/feature-gamification": "^0.41.0",
48
+ "@streamlayer/sdk-web": "^0.33.4",
49
+ "@streamlayer/sdk-web-analytics": "^0.2.0",
50
+ "@streamlayer/sdk-web-anonymous-auth": "^0.11.46",
51
+ "@streamlayer/sdk-web-api": "^0.25.0",
52
+ "@streamlayer/sdk-web-core": "^0.23.0",
53
+ "@streamlayer/sdk-web-features": "^0.11.28",
54
+ "@streamlayer/sdk-web-interfaces": "^0.22.0",
55
+ "@streamlayer/sdk-web-logger": "^0.5.20",
56
+ "@streamlayer/sdk-web-notifications": "^0.16.0",
57
+ "@streamlayer/sdk-web-storage": "^0.4.7",
58
+ "@streamlayer/sdk-web-types": "^0.23.2"
59
59
  },
60
60
  "nx": {
61
61
  "implicitDependencies": [
@@ -71,12 +71,11 @@
71
71
  "@linaria/core": "^6.0.0",
72
72
  "@linaria/react": "^6.0.0",
73
73
  "@nanostores/react": "^0.7.2",
74
- "@storybook/addon-docs": "^8.0.0",
75
- "@storybook/addon-styling": "^1.3.7",
76
- "@storybook/addon-viewport": "^8.0.0",
77
- "@storybook/blocks": "^8.0.0",
74
+ "@storybook/addon-docs": "^8.0.1",
75
+ "@storybook/addon-viewport": "^8.0.1",
76
+ "@storybook/blocks": "^8.0.1",
78
77
  "@storybook/jest": "~0.2.3",
79
- "@storybook/react": "^8.0.0",
78
+ "@storybook/react": "^8.0.1",
80
79
  "@storybook/testing-library": "~0.2.2",
81
80
  "@types/react-infinite-scroller": "^1.2.5",
82
81
  "@types/react-window": "^1.8.8",
@@ -96,6 +95,6 @@
96
95
  "vite-plugin-svgr": "^4.2.0",
97
96
  "vite-svg-loader": "^5.1.0",
98
97
  "vite-tsconfig-paths": "^4.3.2",
99
- "@streamlayer/react": "^0.41.4"
98
+ "@streamlayer/react": "^0.41.5"
100
99
  }
101
100
  }
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- type ExpiredAlertProps = {
3
- title: string;
4
- description: string;
5
- };
6
- export declare const ExpiredAlert: React.FC<ExpiredAlertProps>;
7
- export {};
@@ -1,11 +0,0 @@
1
- import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
- import { SvgIcon as c } from "../../../icons/index.js";
3
- import { Container as n, Title as t, Description as m } from "./styles.js";
4
- const d = ({ title: e, description: i }) => /* @__PURE__ */ o(n, { children: [
5
- /* @__PURE__ */ r(c, { name: "icon-check-circle" }),
6
- /* @__PURE__ */ r(t, { children: e }),
7
- /* @__PURE__ */ r(m, { children: i })
8
- ] });
9
- export {
10
- d as ExpiredAlert
11
- };