@genai-fi/base 4.2.0 → 4.2.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 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._sidePanel_fhsa8_1{background:#fff;display:flex;z-index:2;flex-shrink:0;position:relative;transition:opacity .3s ease-in;opacity:0}._sidePanelHorizontal_fhsa8_14{flex-direction:column;width:100%}._sidePanel_fhsa8_1._closed_fhsa8_19{opacity:0;transition:width .3s cubic-bezier(.4,0,.2,1),height .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-out}._sidePanel_fhsa8_1._opening_fhsa8_24{opacity:1;transition:width .3s cubic-bezier(.4,0,.2,1),height .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-in}._sidePanel_fhsa8_1._open_fhsa8_24{opacity:1}._resizer_fhsa8_33{background-color:transparent;box-sizing:border-box;position:absolute;opacity:1;touch-action:none;-webkit-user-select:none;user-select:none;z-index:2}._resizerHorizontal_fhsa8_44{height:30px;width:100%;cursor:ns-resize;left:0;top:-8px;right:0}._resizerVertical_fhsa8_53{width:30px;cursor:ew-resize;left:-8px;top:0;bottom:0}._noSelect_fhsa8_61{-webkit-user-select:none;user-select:none}._resizerBar_fhsa8_65{position:absolute;top:0;left:7px;width:2px;height:100%;background-color:#ddd;touch-action:none;-webkit-user-select:none;user-select:none}._resizerHorizontal_fhsa8_44 ._resizerBar_fhsa8_65{top:7px;left:0;width:100%;height:2px}._resizer_fhsa8_33:hover ._resizerBar_fhsa8_65{background-color:#75a4e288}._resizer_fhsa8_33._resizing_fhsa8_87 ._resizerBar_fhsa8_65{background-color:#75a4e2}._resizerHandle_fhsa8_91{position:absolute;top:50%;left:2px;width:10px;height:60px;transform:translateY(-50%);background-color:#fff;border-radius:3px;border:2px solid #ddd;box-shadow:0 0 4px #ccc;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-user-select:none;user-select:none}._resizerHorizontal_fhsa8_44 ._resizerHandle_fhsa8_91{top:2px;left:50%;width:60px;height:10px;transform:translate(-50%)}._resizerHandle_fhsa8_91._minimised_fhsa8_117{left:-15px;width:20px}._resizerHorizontal_fhsa8_44 ._resizerHandle_fhsa8_91._minimised_fhsa8_117{top:-15px;height:20px;left:50%;width:60px;transform:translate(-50%)}._resizerHandle_fhsa8_91:focus{outline:2px solid #75a4e2;outline-offset:2px}._resizerVertical_fhsa8_53 ._resizerHandle_fhsa8_91:before{content:"";display:block;width:4px;height:20px;background:radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 2px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 8px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 14px;background-repeat:no-repeat;background-size:4px 4px}._resizerHorizontal_fhsa8_44 ._resizerHandle_fhsa8_91:before{content:"";display:block;width:20px;height:4px;background:radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 2px 0,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 8px 0,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 14px 0;background-repeat:no-repeat;background-size:4px 4px}._resizer_fhsa8_33:hover ._resizerHandle_fhsa8_91,._resizer_fhsa8_33._resizing_fhsa8_87 ._resizerHandle_fhsa8_91{border-color:#75a4e2}._expand_fhsa8_167{position:absolute;top:2rem;right:0;height:40px;width:30px;background-color:#fff;border-radius:3px;border:2px solid #ddd;cursor:pointer;display:flex;align-items:center;justify-content:center}._content_fhsa8_183{flex-grow:1;overflow:auto;min-width:300px!important;position:relative}._closeButton_fhsa8_190{position:absolute;top:.5rem;right:.5rem}
|
|
@@ -3,7 +3,7 @@ interface Props extends PropsWithChildren {
|
|
|
3
3
|
open?: boolean;
|
|
4
4
|
onClose?: () => void;
|
|
5
5
|
onOpen?: () => void;
|
|
6
|
-
position?: '
|
|
6
|
+
position?: 'right' | 'bottom';
|
|
7
7
|
}
|
|
8
8
|
export default function SidePanel({ children, open, onClose, onOpen, position }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,103 +1,109 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { C as
|
|
4
|
-
import { IconButton as
|
|
5
|
-
import '../../assets/SidePanel.css';const L = "
|
|
1
|
+
import { jsxs as g, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useRef as B, useEffect as w } from "react";
|
|
3
|
+
import { C as A } from "../../Close-BGAFHd7i.js";
|
|
4
|
+
import { IconButton as D } from "@mui/material";
|
|
5
|
+
import '../../assets/SidePanel.css';const L = "_sidePanel_fhsa8_1", T = "_sidePanelHorizontal_fhsa8_14", C = "_closed_fhsa8_19", k = "_opening_fhsa8_24", V = "_open_fhsa8_24", W = "_resizer_fhsa8_33", Z = "_resizerHorizontal_fhsa8_44", U = "_resizerVertical_fhsa8_53", X = "_noSelect_fhsa8_61", j = "_resizerBar_fhsa8_65", K = "_resizing_fhsa8_87", O = "_resizerHandle_fhsa8_91", Y = "_minimised_fhsa8_117", F = "_content_fhsa8_183", G = "_closeButton_fhsa8_190", e = {
|
|
6
6
|
sidePanel: L,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
sidePanelHorizontal: T,
|
|
8
|
+
closed: C,
|
|
9
|
+
opening: k,
|
|
10
|
+
open: V,
|
|
11
|
+
resizer: W,
|
|
12
|
+
resizerHorizontal: Z,
|
|
13
|
+
resizerVertical: U,
|
|
14
|
+
noSelect: X,
|
|
15
|
+
resizerBar: j,
|
|
16
|
+
resizing: K,
|
|
17
|
+
resizerHandle: O,
|
|
18
|
+
minimised: Y,
|
|
19
|
+
content: F,
|
|
20
|
+
closeButton: G
|
|
21
|
+
}, h = 30, N = 300, v = Math.max(N, Math.floor(window.innerWidth * 0.25)), M = "sidePanelWidth";
|
|
22
|
+
function ie({ children: R, open: r, onClose: S, onOpen: I, position: t = "right" }) {
|
|
23
|
+
const [l, s] = m(r ? v : 0), _ = B(null), [c, E] = m(!1), [f, H] = m(!1), [p, P] = m(!r), b = B(
|
|
24
|
+
window.sessionStorage.getItem(M) ? Number(window.sessionStorage.getItem(M)) : v
|
|
25
|
+
), o = Math.max(
|
|
26
|
+
N,
|
|
27
|
+
Math.floor(t === "right" ? window.innerWidth / 2 : window.innerHeight / 2)
|
|
28
|
+
);
|
|
23
29
|
w(() => {
|
|
24
|
-
if (
|
|
25
|
-
|
|
30
|
+
if (r)
|
|
31
|
+
H(!0), P(!1);
|
|
26
32
|
else {
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
33
|
+
s(0);
|
|
34
|
+
const i = setTimeout(() => {
|
|
35
|
+
P(!0);
|
|
30
36
|
}, 300);
|
|
31
|
-
return () => clearTimeout(
|
|
37
|
+
return () => clearTimeout(i);
|
|
32
38
|
}
|
|
33
|
-
}, [
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
39
|
+
}, [r]), w(() => {
|
|
40
|
+
if (f) {
|
|
41
|
+
s(b.current || v);
|
|
42
|
+
const i = setTimeout(() => {
|
|
43
|
+
H(!1);
|
|
38
44
|
}, 300);
|
|
39
|
-
return () => clearTimeout(
|
|
45
|
+
return () => clearTimeout(i);
|
|
40
46
|
}
|
|
41
|
-
}, [
|
|
42
|
-
if (
|
|
43
|
-
let
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
+
}, [f]), w(() => {
|
|
48
|
+
if (c) {
|
|
49
|
+
let i = function(u) {
|
|
50
|
+
if (c && _.current) {
|
|
51
|
+
const x = _.current.getBoundingClientRect(), y = t === "right" ? x.right - u.clientX : x.bottom - u.clientY, d = Math.max(Math.min(y, o), h);
|
|
52
|
+
d - y > 10 ? s(0) : (b.current = d, s(d), window.sessionStorage.setItem(M, d.toString())), u.preventDefault();
|
|
47
53
|
}
|
|
48
|
-
},
|
|
49
|
-
|
|
54
|
+
}, n = function() {
|
|
55
|
+
E(!1);
|
|
50
56
|
};
|
|
51
|
-
return window.addEventListener("pointermove",
|
|
52
|
-
window.removeEventListener("pointermove",
|
|
57
|
+
return window.addEventListener("pointermove", i, { passive: !1 }), window.addEventListener("pointerup", n), document.body.classList.add(e.noSelect), () => {
|
|
58
|
+
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", n), document.body.classList.remove(e.noSelect);
|
|
53
59
|
};
|
|
54
60
|
}
|
|
55
|
-
}, [
|
|
56
|
-
const
|
|
61
|
+
}, [c, t, o]);
|
|
62
|
+
const z = l === 0, $ = /* @__PURE__ */ g(
|
|
57
63
|
"div",
|
|
58
64
|
{
|
|
59
|
-
className: `${e.resizer} ${
|
|
65
|
+
className: `${e.resizer} ${c ? e.resizing : ""} ${t === "right" ? e.resizerVertical : e.resizerHorizontal}`,
|
|
60
66
|
onPointerDown: () => {
|
|
61
|
-
|
|
67
|
+
E(!0), I && I();
|
|
62
68
|
},
|
|
63
69
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
70
|
+
/* @__PURE__ */ a("div", { className: e.resizerBar }),
|
|
71
|
+
r && /* @__PURE__ */ a(
|
|
66
72
|
"div",
|
|
67
73
|
{
|
|
68
|
-
className: `${e.resizerHandle} ${
|
|
74
|
+
className: `${e.resizerHandle} ${z ? e.minimised : ""}`,
|
|
69
75
|
role: "separator",
|
|
70
|
-
"aria-orientation": "vertical",
|
|
76
|
+
"aria-orientation": t === "right" ? "vertical" : "horizontal",
|
|
71
77
|
"aria-label": "Resize sidebar",
|
|
72
78
|
tabIndex: 0,
|
|
73
|
-
"aria-valuenow":
|
|
74
|
-
"aria-valuemin":
|
|
79
|
+
"aria-valuenow": l,
|
|
80
|
+
"aria-valuemin": h,
|
|
75
81
|
"aria-valuemax": o,
|
|
76
|
-
onKeyDown: (
|
|
77
|
-
t.key === "ArrowRight" ?
|
|
82
|
+
onKeyDown: (i) => {
|
|
83
|
+
t === "right" ? i.key === "ArrowRight" ? s((n) => Math.min(o, Math.max(0, n - 50))) : i.key === "ArrowLeft" && s((n) => Math.max(h, Math.min(o, n + 50))) : i.key === "ArrowDown" ? s((n) => Math.min(o, Math.max(0, n - 50))) : i.key === "ArrowUp" && s((n) => Math.max(h, Math.min(o, n + 50)));
|
|
78
84
|
}
|
|
79
85
|
}
|
|
80
86
|
)
|
|
81
87
|
]
|
|
82
88
|
}
|
|
83
89
|
);
|
|
84
|
-
return /* @__PURE__ */
|
|
90
|
+
return /* @__PURE__ */ g(
|
|
85
91
|
"section",
|
|
86
92
|
{
|
|
87
|
-
className: `${e.sidePanel} ${
|
|
88
|
-
style: { width:
|
|
89
|
-
ref:
|
|
90
|
-
"aria-hidden": !
|
|
93
|
+
className: `${e.sidePanel} ${r ? e.open : e.closed} ${f ? e.opening : ""} ${t === "right" ? e.sidePanelVertical : e.sidePanelHorizontal}`,
|
|
94
|
+
style: t === "right" ? { width: z ? 0 : l, visibility: p ? "hidden" : void 0 } : { height: z ? 0 : l, visibility: p ? "hidden" : void 0 },
|
|
95
|
+
ref: _,
|
|
96
|
+
"aria-hidden": !r,
|
|
91
97
|
children: [
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
(t === "right" || t === "bottom") && $,
|
|
99
|
+
/* @__PURE__ */ g("div", { className: e.content, children: [
|
|
100
|
+
S && /* @__PURE__ */ a("div", { className: e.closeButton, children: /* @__PURE__ */ a(
|
|
101
|
+
D,
|
|
96
102
|
{
|
|
97
|
-
onClick:
|
|
103
|
+
onClick: S,
|
|
98
104
|
"data-testid": "sidepanel-close-button",
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
-
|
|
105
|
+
children: /* @__PURE__ */ a(
|
|
106
|
+
A,
|
|
101
107
|
{
|
|
102
108
|
fontSize: "medium",
|
|
103
109
|
htmlColor: "#444"
|
|
@@ -105,13 +111,12 @@ function Q({ children: y, open: n, onClose: p, onOpen: M, position: c = "right"
|
|
|
105
111
|
)
|
|
106
112
|
}
|
|
107
113
|
) }),
|
|
108
|
-
|
|
109
|
-
] })
|
|
110
|
-
c === "left" && R
|
|
114
|
+
R
|
|
115
|
+
] })
|
|
111
116
|
]
|
|
112
117
|
}
|
|
113
118
|
);
|
|
114
119
|
}
|
|
115
120
|
export {
|
|
116
|
-
|
|
121
|
+
ie as default
|
|
117
122
|
};
|