@genai-fi/base 4.3.1 → 4.3.3

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 +1 @@
1
- ._helpButton_p1m35_1{position:absolute;z-index:10;left:-3rem;top:.5rem;color:#0a4bd6;background:#fff6;transition:opacity .3s ease-out;opacity:0}._helpButtonInplace_p1m35_12{color:#0a4bd6;margin-left:8px;transition:opacity .3s ease-out;opacity:.2}._helpButton_p1m35_1:hover{background:#fff}._container_p1m35_23{position:relative;border-radius:6px}._container_p1m35_23:hover ._helpButton_p1m35_1{opacity:1}._inplaceContainer_p1m35_32{display:flex;align-items:center}._inplaceContainer_p1m35_32:hover ._helpButtonInplace_p1m35_12{opacity:1}._active_p1m35_41{box-shadow:0 0 10px #0a4bd6}._helpButtonInside_p1m35_45{left:1rem}
1
+ ._helpButton_cw98j_1{position:absolute;z-index:10;color:#0a4bd6;background:#fff6;transition:opacity .3s ease-out;opacity:0}._helpButton_cw98j_1._left_cw98j_10{left:-3rem;top:.5rem}._helpButton_cw98j_1._right_cw98j_15{right:-3rem;top:.5rem}._helpButton_cw98j_1._top_cw98j_20{top:-3rem;right:.5rem}._helpButton_cw98j_1._bottom_cw98j_25{bottom:-3rem;right:.5rem}._helpButtonInplace_cw98j_30{color:#0a4bd6;margin-left:8px;transition:opacity .3s ease-out;opacity:.2}._helpButton_cw98j_1:hover{background:#fff}._container_cw98j_41{position:relative;border-radius:6px}._container_cw98j_41:hover ._helpButton_cw98j_1{opacity:1}._helpButton_cw98j_1:focus{opacity:1;background:#fff}._inplaceContainer_cw98j_55{display:flex;align-items:center}._inplaceContainer_cw98j_55:hover ._helpButtonInplace_cw98j_30{opacity:1}._helpButtonInplace_cw98j_30:focus{opacity:1;background:#fff}._active_cw98j_69{box-shadow:0 0 10px #0a4bd6}._helpButtonInside_cw98j_73{left:1rem}._closeButton_cw98j_77{margin-top:.5rem;align-self:flex-end;font-size:.75rem;padding:3px 8px}
@@ -1 +1 @@
1
- ._popper_35oif_1{display:flex;flex-direction:column;padding:1rem 1.5rem;border-radius:6px;box-shadow:2px 2px 4px #a4acbb;font-family:Andika,sans-serif;animation:_fadeIn_35oif_1 .3s ease-out;max-width:250px}._dark_35oif_12{background:#0a4bd6;color:#fff}._light_35oif_17{background:#fff;color:#444}._popper_35oif_1._bottom_35oif_22,._popper_35oif_1._top_35oif_27{margin-top:10px;margin-bottom:10px}._popper_35oif_1._right_35oif_32{margin-left:5px;margin-right:5px}._popper_35oif_1._left_35oif_37{margin-right:5px;margin-left:5px}@keyframes _fadeIn_35oif_1{0%{opacity:0}to{opacity:1}}._popper_35oif_1._right_35oif_32:before{content:"";position:absolute;width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-right:10px solid #0a4bd6;left:0;top:calc(50% - 10px)}._popper_35oif_1._left_35oif_37:before{content:"";position:absolute;width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:10px solid #0a4bd6;right:0;top:calc(50% - 10px)}._popper_35oif_1._bottom_35oif_22:before{content:"";position:absolute;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:10px solid #0a4bd6;top:0;left:calc(50% - 8px)}._popper_35oif_1._top_35oif_27:before{content:"";position:absolute;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #0a4bd6;bottom:0;left:calc(50% - 8px)}._popper_35oif_1 h2{margin:0;font-size:1.2rem}._popper_35oif_1 p{margin:0;font-size:.9rem}
1
+ ._popper_19um0_1{position:relative;display:flex;flex-direction:column;padding:1rem 1.5rem;border-radius:6px;font-family:Andika,sans-serif;animation:_fadeIn_19um0_1 .3s ease-out;max-width:250px;--infopop-bg: #0a4bd6}._dark_19um0_13{--infopop-bg: #0a4bd6;background:var(--infopop-bg);color:#fff}._light_19um0_19{--infopop-bg: white;background:var(--infopop-bg);color:#444}._arrow_19um0_25{position:absolute;width:0;height:0;background:none;transform:rotate(45deg)}._root_19um0_34[data-popper-placement^=bottom] ._arrow_19um0_25{top:-10px;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:10px solid #0a4bd6}._root_19um0_34[data-popper-placement^=top] ._arrow_19um0_25{bottom:-10px;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #0a4bd6}._root_19um0_34[data-popper-placement^=right] ._arrow_19um0_25{left:-10px;border-top:10px solid transparent;border-bottom:10px solid transparent;border-right:10px solid #0a4bd6}._root_19um0_34[data-popper-placement^=left] ._arrow_19um0_25{right:-10px;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:10px solid #0a4bd6}._popper_19um0_1._right_19um0_60:before{content:"";position:absolute;width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-right:10px solid #0a4bd6;left:0;top:calc(50% - 10px)}._popper_19um0_1._left_19um0_72:before{content:"";position:absolute;width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:10px solid #0a4bd6;right:0;top:calc(50% - 10px)}._popper_19um0_1._bottom_19um0_84:before{content:"";position:absolute;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-bottom:10px solid #0a4bd6;top:0;left:calc(50% - 8px)}._popper_19um0_1._top_19um0_96:before{content:"";position:absolute;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #0a4bd6;bottom:0;left:calc(50% - 8px)}._popper_19um0_1 h2{margin:0;font-size:1.2rem}._popper_19um0_1 p{margin:0;font-size:.9rem}._root_19um0_34[data-popper-placement^=bottom] ._popper_19um0_1{margin-top:10px}._root_19um0_34[data-popper-placement^=top] ._popper_19um0_1{margin-bottom:10px}._root_19um0_34[data-popper-placement^=right] ._popper_19um0_1{margin-left:5px}._root_19um0_34[data-popper-placement^=left] ._popper_19um0_1{margin-right:5px}@keyframes _fadeIn_19um0_1{0%{opacity:0}to{opacity:1}}
@@ -1,4 +1,4 @@
1
- import { jsx as t, jsxs as S, Fragment as T } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as S, Fragment as T } from "react/jsx-runtime";
2
2
  import "../../state/webrtcState.js";
3
3
  import { useState as r, useEffect as g } from "react";
4
4
  import { useTranslation as w } from "react-i18next";
@@ -18,16 +18,16 @@ import "../IconMenu/context.js";
18
18
  import "@emotion/react";
19
19
  import I from "./FeedbackForm.js";
20
20
  import { c as v } from "../../createSvgIcon-BM4dw4Lw.js";
21
- const j = v(/* @__PURE__ */ t("path", {
21
+ const j = v(/* @__PURE__ */ o("path", {
22
22
  d: "M12 6c0-.55-.45-1-1-1H5.82l.66-3.18.02-.23c0-.31-.13-.59-.33-.8L5.38 0 .44 4.94C.17 5.21 0 5.59 0 6v6.5c0 .83.67 1.5 1.5 1.5h6.75c.62 0 1.15-.38 1.38-.91l2.26-5.29c.07-.17.11-.36.11-.55zm10.5 4h-6.75c-.62 0-1.15.38-1.38.91l-2.26 5.29c-.07.17-.11.36-.11.55V18c0 .55.45 1 1 1h5.18l-.66 3.18-.02.24c0 .31.13.59.33.8l.79.78 4.94-4.94c.27-.27.44-.65.44-1.06v-6.5c0-.83-.67-1.5-1.5-1.5"
23
23
  }), "ThumbsUpDown");
24
- function R({ application: s, apiUrl: o, delay: n, className: a, style: p, variant: u }) {
24
+ function R({ application: s, apiUrl: t, delay: n, className: a, style: p, variant: u }) {
25
25
  const { t: f } = w(), [l, c] = r(!1), [d, h] = r(""), [b, m] = r(!1), i = localStorage.getItem("feedbackSubmitted") === "true";
26
26
  return g(() => {
27
27
  if (!i) {
28
28
  const k = setTimeout(
29
29
  () => {
30
- o && fetch(`${o}`).then((e) => e.json()).then((e) => {
30
+ t && fetch(`${t}`).then((e) => e.json()).then((e) => {
31
31
  h(e.token), c(!0);
32
32
  }).catch(() => {
33
33
  console.warn("Feedback denied");
@@ -37,22 +37,23 @@ function R({ application: s, apiUrl: o, delay: n, className: a, style: p, varian
37
37
  );
38
38
  return () => clearTimeout(k);
39
39
  }
40
- }, [i, n, o]), /* @__PURE__ */ S(T, { children: [
41
- l && /* @__PURE__ */ t(
40
+ }, [i, n, t]), /* @__PURE__ */ S(T, { children: [
41
+ l && /* @__PURE__ */ o(
42
42
  F,
43
43
  {
44
44
  variant: u ?? "contained",
45
45
  onClick: () => m(!0),
46
46
  className: a,
47
47
  style: p,
48
- startIcon: /* @__PURE__ */ t(j, {}),
48
+ startIcon: /* @__PURE__ */ o(j, {}),
49
49
  children: f("feedback.button")
50
50
  }
51
51
  ),
52
- /* @__PURE__ */ t(
52
+ /* @__PURE__ */ o(
53
53
  I,
54
54
  {
55
55
  open: b,
56
+ apiUrl: t,
56
57
  onClose: () => m(!1),
57
58
  onDone: () => {
58
59
  localStorage.setItem("feedbackSubmitted", "true"), c(!1);
@@ -2,8 +2,9 @@ interface Props {
2
2
  token: string;
3
3
  application: string;
4
4
  open?: boolean;
5
+ apiUrl: string;
5
6
  onClose?: () => void;
6
7
  onDone?: () => void;
7
8
  }
8
- export default function FeedbackForm({ application, open, onClose, token, onDone }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export default function FeedbackForm({ application, open, onClose, token, onDone, apiUrl }: Props): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -1,88 +1,107 @@
1
- import { jsxs as o, Fragment as N, jsx as e } from "react/jsx-runtime";
2
- import { Dialog as T, DialogContent as Y, DialogActions as _ } from "@mui/material";
3
- import { s as l } from "../../Feedback.module-C2gI6YmB.js";
4
- import { useState as r, useRef as j, useEffect as A } from "react";
5
- import { Button as b } from "../Button/Button.js";
6
- import B from "./Rating.js";
7
- import F from "./Recommend.js";
8
- import y from "./Experience.js";
9
- import { useTranslation as I } from "react-i18next";
10
- const x = "https://store.gen-ai.fi/common/thank_you_graphic.jpg";
11
- function M(c, n, a) {
12
- return !(c <= 0 || c > 5 || n <= 0 || n > 5 || a.length > 1e3);
1
+ import { jsxs as r, Fragment as F, jsx as e } from "react/jsx-runtime";
2
+ import { Dialog as S, DialogContent as Y, DialogActions as _ } from "@mui/material";
3
+ import { s as h } from "../../Feedback.module-C2gI6YmB.js";
4
+ import { useState as o, useRef as A, useEffect as B } from "react";
5
+ import { Button as T } from "../Button/Button.js";
6
+ import D from "./Rating.js";
7
+ import O from "./Recommend.js";
8
+ import I from "./Experience.js";
9
+ import { useTranslation as M } from "react-i18next";
10
+ const y = "https://store.gen-ai.fi/common/thank_you_graphic.jpg";
11
+ function P(a, t, s) {
12
+ return !(a <= 0 || a > 5 || t <= 0 || t > 5 || s.length > 1e3);
13
13
  }
14
- function L({ application: c, open: n, onClose: a, token: S, onDone: w }) {
15
- const { t } = I(), [d, f] = r(0), [m, u] = r(0), [h, g] = r(""), [i, C] = r(!1), [s, v] = r(!1), p = j(!1);
16
- A(() => {
17
- if (!n || p.current) return;
18
- const E = new Image();
19
- E.src = x, p.current = !0;
20
- }, [n]);
21
- const R = M(d, m, h), D = () => {
22
- }, k = () => {
23
- a && a(), setTimeout(() => {
24
- C(!1), v(!1), f(0), u(0), g("");
14
+ function Q({ application: a, open: t, onClose: s, token: E, onDone: g, apiUrl: p }) {
15
+ const { t: n } = M(), [l, k] = o(0), [f, b] = o(0), [d, x] = o(""), [i, C] = o(!1), [c, m] = o(!1), v = A(!1);
16
+ B(() => {
17
+ if (!t || v.current) return;
18
+ const u = new Image();
19
+ u.src = y, v.current = !0;
20
+ }, [t]);
21
+ const N = P(l, f, d), j = () => {
22
+ p && fetch(`${p}`, {
23
+ method: "POST",
24
+ headers: {
25
+ "Content-Type": "application/json"
26
+ },
27
+ body: JSON.stringify({
28
+ token: E,
29
+ application: a,
30
+ rating: l,
31
+ recommend: f,
32
+ describe: d,
33
+ valuableFeature: "",
34
+ suggestions: ""
35
+ })
36
+ }).then((u) => {
37
+ u.ok ? (C(!0), g && g()) : m(!0);
38
+ }).catch(() => {
39
+ m(!0);
40
+ });
41
+ }, R = () => {
42
+ s && s(), setTimeout(() => {
43
+ C(!1), m(!1), k(0), b(0), x("");
25
44
  }, 500);
26
45
  };
27
- return /* @__PURE__ */ o(
28
- T,
46
+ return /* @__PURE__ */ r(
47
+ S,
29
48
  {
30
- open: n ?? !1,
31
- onClose: k,
49
+ open: t ?? !1,
50
+ onClose: R,
32
51
  children: [
33
- /* @__PURE__ */ o(Y, { className: l.feedback, children: [
34
- !i && !s && /* @__PURE__ */ o(N, { children: [
35
- /* @__PURE__ */ e("h1", { children: t("feedback.title") }),
52
+ /* @__PURE__ */ r(Y, { className: h.feedback, children: [
53
+ !i && !c && /* @__PURE__ */ r(F, { children: [
54
+ /* @__PURE__ */ e("h1", { children: n("feedback.title") }),
36
55
  /* @__PURE__ */ e(
37
- B,
56
+ D,
38
57
  {
39
- rating: d,
40
- onChange: f
58
+ rating: l,
59
+ onChange: k
41
60
  }
42
61
  ),
43
62
  /* @__PURE__ */ e(
44
- F,
63
+ O,
45
64
  {
46
- rating: m,
47
- onChange: u
65
+ rating: f,
66
+ onChange: b
48
67
  }
49
68
  ),
50
69
  /* @__PURE__ */ e(
51
- y,
70
+ I,
52
71
  {
53
- experience: h,
54
- onChange: g
72
+ experience: d,
73
+ onChange: x
55
74
  }
56
75
  )
57
76
  ] }),
58
- i && /* @__PURE__ */ e("div", { className: l.thankYouBox, children: /* @__PURE__ */ e(
77
+ i && /* @__PURE__ */ e("div", { className: h.thankYouBox, children: /* @__PURE__ */ e(
59
78
  "img",
60
79
  {
61
- src: x,
62
- alt: t("feedback.thankYou")
80
+ src: y,
81
+ alt: n("feedback.thankYou")
63
82
  }
64
83
  ) }),
65
- s && /* @__PURE__ */ o("div", { className: l.messageBox, children: [
66
- /* @__PURE__ */ e("h1", { children: t("feedback.error") }),
67
- /* @__PURE__ */ e("p", { children: t("feedback.errorMessage") })
84
+ c && /* @__PURE__ */ r("div", { className: h.messageBox, children: [
85
+ /* @__PURE__ */ e("h1", { children: n("feedback.error") }),
86
+ /* @__PURE__ */ e("p", { children: n("feedback.errorMessage") })
68
87
  ] })
69
88
  ] }),
70
- /* @__PURE__ */ o(_, { children: [
89
+ /* @__PURE__ */ r(_, { children: [
71
90
  /* @__PURE__ */ e(
72
- b,
91
+ T,
73
92
  {
74
- variant: !i && !s ? "outlined" : "contained",
75
- onClick: k,
76
- children: t("feedback.close")
93
+ variant: !i && !c ? "outlined" : "contained",
94
+ onClick: R,
95
+ children: n("feedback.close")
77
96
  }
78
97
  ),
79
- !i && !s && /* @__PURE__ */ e(
80
- b,
98
+ !i && !c && /* @__PURE__ */ e(
99
+ T,
81
100
  {
82
101
  variant: "contained",
83
- onClick: D,
84
- disabled: !R,
85
- children: t("feedback.send")
102
+ onClick: j,
103
+ disabled: !N,
104
+ children: n("feedback.send")
86
105
  }
87
106
  )
88
107
  ] })
@@ -91,5 +110,5 @@ function L({ application: c, open: n, onClose: a, token: S, onDone: w }) {
91
110
  );
92
111
  }
93
112
  export {
94
- L as default
113
+ Q as default
95
114
  };
@@ -5,8 +5,11 @@ interface Props extends PropsWithChildren {
5
5
  active?: boolean;
6
6
  style?: CSSProperties;
7
7
  placement?: 'top' | 'bottom' | 'left' | 'right';
8
+ buttonPlacement?: 'top' | 'bottom' | 'left' | 'right';
8
9
  inplace?: boolean;
9
10
  inside?: boolean;
11
+ keepOpen?: boolean;
12
+ closeLabel?: string;
10
13
  }
11
- export default function Help({ message, children, widget, style: customStyle, active, placement, inplace, inside, }: Props): import("react/jsx-runtime").JSX.Element;
14
+ export default function Help({ message, children, widget, style: customStyle, active, placement, inplace, inside, keepOpen, closeLabel, buttonPlacement, }: Props): import("react/jsx-runtime").JSX.Element;
12
15
  export {};
@@ -1,69 +1,108 @@
1
- import { jsx as e, jsxs as I } from "react/jsx-runtime";
2
- import { IconButton as s } from "@mui/material";
3
- import f from "../InfoPop/InfoPop.js";
4
- import { c as v } from "../../createSvgIcon-BM4dw4Lw.js";
5
- import { useState as C } from "react";
6
- import '../../assets/Help.css';const p = v(/* @__PURE__ */ e("path", {
1
+ import { jsx as o, jsxs as m } from "react/jsx-runtime";
2
+ import { IconButton as p } from "@mui/material";
3
+ import w from "../InfoPop/InfoPop.js";
4
+ import { c as g } from "../../createSvgIcon-BM4dw4Lw.js";
5
+ import { useState as S } from "react";
6
+ import { C as $ } from "../../Close-Cv_QwhIN.js";
7
+ import "../../state/webrtcState.js";
8
+ import "react-i18next";
9
+ import "../../hooks/peer.js";
10
+ import { Button as z } from "../Button/Button.js";
11
+ import "../../index-SOhdqzHq.js";
12
+ import "../../style/theme.js";
13
+ import "../../util/canvas.js";
14
+ import "../../FileSaver.min-DhePf63e.js";
15
+ import "../BusyButton/BusyButton.js";
16
+ import "../../browser-HW-wgeM2.js";
17
+ import "../WorkflowLayout/lines.js";
18
+ import "../WorkflowLayout/svgContext.js";
19
+ import "../WorkflowLayout/Widget.js";
20
+ import "../IconMenu/context.js";
21
+ import "@emotion/react";
22
+ import '../../assets/Help.css';const u = g(/* @__PURE__ */ o("path", {
7
23
  d: "M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"
8
- }), "HelpOutline"), S = "_helpButton_p1m35_1", g = "_helpButtonInplace_p1m35_12", $ = "_container_p1m35_23", k = "_inplaceContainer_p1m35_32", x = "_active_p1m35_41", y = "_helpButtonInside_p1m35_45", t = {
9
- helpButton: S,
10
- helpButtonInplace: g,
11
- container: $,
24
+ }), "HelpOutline"), N = "_helpButton_cw98j_1", b = "_left_cw98j_10", x = "_right_cw98j_15", y = "_top_cw98j_20", E = "_bottom_cw98j_25", H = "_helpButtonInplace_cw98j_30", M = "_container_cw98j_41", k = "_inplaceContainer_cw98j_55", L = "_active_cw98j_69", T = "_helpButtonInside_cw98j_73", A = "_closeButton_cw98j_77", t = {
25
+ helpButton: N,
26
+ left: b,
27
+ right: x,
28
+ top: y,
29
+ bottom: E,
30
+ helpButtonInplace: H,
31
+ container: M,
12
32
  inplaceContainer: k,
13
- active: x,
14
- helpButtonInside: y
33
+ active: L,
34
+ helpButtonInside: T,
35
+ closeButton: A
15
36
  };
16
- function j({
17
- message: u,
37
+ function lt({
38
+ message: _,
18
39
  children: h,
19
- widget: m,
20
- style: _,
21
- active: d,
22
- placement: B,
40
+ widget: d,
41
+ style: f,
42
+ active: B,
43
+ placement: I,
23
44
  inplace: n,
24
- inside: o
45
+ inside: e,
46
+ keepOpen: c,
47
+ closeLabel: j,
48
+ buttonPlacement: C = "left"
25
49
  }) {
26
- const [c, l] = C(null), a = (i) => {
27
- l(n || o ? i.currentTarget : i.currentTarget.parentElement);
28
- }, r = () => {
29
- l(null);
50
+ const [l, r] = S(null), s = (a) => {
51
+ r(
52
+ (v) => v ? null : n || e ? a.currentTarget : a.currentTarget.parentElement
53
+ );
54
+ }, i = () => {
55
+ r(null);
30
56
  };
31
- return /* @__PURE__ */ I(
57
+ return /* @__PURE__ */ m(
32
58
  "div",
33
59
  {
34
- className: `${n ? t.inplaceContainer : t.container} ${c && !n && !o ? t.active : ""}`,
35
- "data-widget": m,
36
- "data-active": d ? "true" : "false",
37
- style: _,
60
+ className: `${n ? t.inplaceContainer : t.container} ${l && !n && !e ? t.active : ""}`,
61
+ "data-widget": d,
62
+ "data-active": B ? "true" : "false",
63
+ style: f,
38
64
  children: [
39
- !n && /* @__PURE__ */ e(
40
- s,
65
+ !n && /* @__PURE__ */ o(
66
+ p,
41
67
  {
42
- onClick: a,
43
- onMouseLeave: r,
44
- className: `${t.helpButton} ${o ? t.helpButtonInside : ""}`,
68
+ onClick: s,
69
+ onMouseLeave: c ? void 0 : i,
70
+ className: `${t.helpButton} ${e ? t.helpButtonInside : ""} ${t[C]}`,
45
71
  color: "inherit",
46
- children: /* @__PURE__ */ e(p, { fontSize: "medium" })
72
+ children: /* @__PURE__ */ o(u, { fontSize: "medium" })
47
73
  }
48
74
  ),
49
75
  h,
50
- n && /* @__PURE__ */ e(
51
- s,
76
+ n && /* @__PURE__ */ o(
77
+ p,
52
78
  {
53
- onClick: a,
54
- onMouseLeave: r,
79
+ onClick: s,
80
+ onMouseLeave: c ? void 0 : i,
55
81
  className: t.helpButtonInplace,
56
82
  color: "inherit",
57
- children: /* @__PURE__ */ e(p, { fontSize: "medium" })
83
+ children: /* @__PURE__ */ o(u, { fontSize: "medium" })
58
84
  }
59
85
  ),
60
- /* @__PURE__ */ e(
61
- f,
86
+ /* @__PURE__ */ m(
87
+ w,
62
88
  {
63
- anchorEl: c,
64
- open: !!c,
65
- placement: B,
66
- children: u
89
+ anchorEl: l,
90
+ open: !!l,
91
+ placement: I,
92
+ children: [
93
+ _,
94
+ c && /* @__PURE__ */ o(
95
+ z,
96
+ {
97
+ onClick: i,
98
+ className: t.closeButton,
99
+ color: "inherit",
100
+ startIcon: /* @__PURE__ */ o($, { fontSize: "small" }),
101
+ variant: "outlined",
102
+ children: j || "Close"
103
+ }
104
+ )
105
+ ]
67
106
  }
68
107
  )
69
108
  ]
@@ -71,5 +110,5 @@ function j({
71
110
  );
72
111
  }
73
112
  export {
74
- j as default
113
+ lt as default
75
114
  };
@@ -6,5 +6,5 @@ interface Props extends Omit<PopperProps, 'children'>, PropsWithChildren {
6
6
  offsetX?: number;
7
7
  delay?: number;
8
8
  }
9
- export default function InfoPop({ open, delay, children, offsetY, offsetX, ...props }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export default function InfoPop({ open, delay, children, offsetY, offsetX, modifiers: userModifiers, theme, ...props }: Props): import("react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -1,48 +1,75 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { Popper as u } from "@mui/material";
3
- import { useState as d, useRef as h, useEffect as g } from "react";
4
- import '../../assets/InfoPop.css';const I = "_popper_35oif_1", b = "_fadeIn_35oif_1", k = "_dark_35oif_12", x = "_light_35oif_17", O = "_bottom_35oif_22", $ = "_top_35oif_27", v = "_right_35oif_32", P = "_left_35oif_37", i = {
5
- popper: I,
6
- fadeIn: b,
7
- dark: k,
8
- light: x,
9
- bottom: O,
10
- top: $,
11
- right: v,
12
- left: P
1
+ import { jsx as f, jsxs as E } from "react/jsx-runtime";
2
+ import { Popper as N } from "@mui/material";
3
+ import { useState as d, useRef as O, useEffect as j, useMemo as v } from "react";
4
+ import '../../assets/InfoPop.css';const P = "_popper_19um0_1", R = "_fadeIn_19um0_1", T = "_dark_19um0_13", $ = "_light_19um0_19", z = "_arrow_19um0_25", A = "_root_19um0_34", S = "_right_19um0_60", q = "_left_19um0_72", B = "_bottom_19um0_84", C = "_top_19um0_96", e = {
5
+ popper: P,
6
+ fadeIn: R,
7
+ dark: T,
8
+ light: $,
9
+ arrow: z,
10
+ root: A,
11
+ right: S,
12
+ left: q,
13
+ bottom: B,
14
+ top: C
13
15
  };
14
- function z({ open: t, delay: o, children: m, offsetY: f = 0, offsetX: r = 0, ...e }) {
15
- const [p, s] = d(t), n = h(t);
16
- n.current = t, g(() => {
16
+ function H({
17
+ open: t,
18
+ delay: r,
19
+ children: h,
20
+ offsetY: s = 0,
21
+ offsetX: n = 0,
22
+ modifiers: c,
23
+ theme: w = "dark",
24
+ ...x
25
+ }) {
26
+ const [g, i] = d(t), p = O(t), [a, I] = d(null);
27
+ p.current = t, j(() => {
17
28
  if (t) {
18
- const _ = o ? setTimeout(() => {
19
- n.current && s(t);
20
- }, o) : void 0;
29
+ const o = r ? setTimeout(() => {
30
+ p.current && i(t);
31
+ }, r) : void 0;
21
32
  return () => {
22
- _ && clearTimeout(_);
33
+ o && clearTimeout(o);
23
34
  };
24
35
  } else
25
- s(!1);
26
- }, [t, o]);
27
- const a = e.placement || "bottom", l = r || f ? [
28
- {
36
+ i(!1);
37
+ }, [t, r]);
38
+ const k = v(() => {
39
+ const o = [...c ?? []], m = (b, u) => {
40
+ const l = o.findIndex((_) => (_ == null ? void 0 : _.name) === b);
41
+ l >= 0 ? o[l] = u : o.push(u);
42
+ };
43
+ return (n || s) && m("offset", {
29
44
  name: "offset",
30
- options: {
31
- offset: [r, f]
32
- }
33
- }
34
- ] : e.modifiers;
35
- return /* @__PURE__ */ c(
36
- u,
45
+ options: { offset: [n, s] }
46
+ }), a && m("arrow", {
47
+ name: "arrow",
48
+ options: { element: a, padding: 8 }
49
+ }), o;
50
+ }, [c, n, s, a]);
51
+ return /* @__PURE__ */ f(
52
+ N,
37
53
  {
38
- open: o ? p : t,
39
- ...e,
40
- modifiers: l,
54
+ open: r ? g : t,
55
+ ...x,
56
+ className: e.root,
57
+ modifiers: k,
41
58
  sx: { zIndex: 10 },
42
- children: /* @__PURE__ */ c("div", { className: `${i.popper} ${i[a]} ${i[e.theme || "dark"]}`, children: m })
59
+ children: /* @__PURE__ */ E("div", { className: `${e.popper} ${e[w]}`, children: [
60
+ /* @__PURE__ */ f(
61
+ "span",
62
+ {
63
+ ref: I,
64
+ className: e.arrow,
65
+ "data-popper-arrow": !0
66
+ }
67
+ ),
68
+ h
69
+ ] })
43
70
  }
44
71
  );
45
72
  }
46
73
  export {
47
- z as default
74
+ H as default
48
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/base",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",