@genai-fi/base 4.3.3 → 4.3.4
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_aqxrv_1{background:#fff;display:flex;z-index:2;flex-shrink:0;position:relative;transition:opacity .3s ease-in;opacity:0}._sidePanelHorizontal_aqxrv_14{flex-direction:column;width:100%}._sidePanel_aqxrv_1._closed_aqxrv_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_aqxrv_1._opening_aqxrv_27{opacity:1;transition:width .3s cubic-bezier(.4,0,.2,1),height .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-in}@media (prefers-reduced-motion: reduce){._sidePanel_aqxrv_1,._sidePanel_aqxrv_1._closed_aqxrv_19,._sidePanel_aqxrv_1._opening_aqxrv_27{transition:none}}._sidePanel_aqxrv_1._open_aqxrv_27{opacity:1}._resizer_aqxrv_47{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_aqxrv_58{height:30px;width:100%;cursor:ns-resize;left:0;top:-8px;right:0}._resizerVertical_aqxrv_67{width:30px;cursor:ew-resize;left:-8px;top:0;bottom:0}._noSelect_aqxrv_75{-webkit-user-select:none;user-select:none}._resizerBar_aqxrv_79{position:absolute;top:0;left:7px;width:2px;height:100%;background-color:#bbb;touch-action:none;-webkit-user-select:none;user-select:none}._resizerHorizontal_aqxrv_58 ._resizerBar_aqxrv_79{top:7px;left:0;width:100%;height:2px}._resizer_aqxrv_47:hover ._resizerBar_aqxrv_79{background-color:#75a4e288}._resizer_aqxrv_47._resizing_aqxrv_101 ._resizerBar_aqxrv_79{background-color:#75a4e2}._resizerHandle_aqxrv_105{position:absolute;top:50%;left:2px;width:10px;height:60px;transform:translateY(-50%);background-color:#fff;border-radius:3px;border:2px solid #bbb;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_aqxrv_58 ._resizerHandle_aqxrv_105{top:2px;left:50%;width:60px;height:10px;transform:translate(-50%)}._resizerHandle_aqxrv_105._minimised_aqxrv_131{left:-15px;width:20px}._resizerHorizontal_aqxrv_58 ._resizerHandle_aqxrv_105._minimised_aqxrv_131{top:-15px;height:20px;left:50%;width:60px;transform:translate(-50%)}._resizerHandle_aqxrv_105:focus{outline:2px solid #75a4e2;outline-offset:2px}._resizerVertical_aqxrv_67 ._resizerHandle_aqxrv_105: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_aqxrv_58 ._resizerHandle_aqxrv_105: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_aqxrv_47:hover ._resizerHandle_aqxrv_105,._resizer_aqxrv_47._resizing_aqxrv_101 ._resizerHandle_aqxrv_105{border-color:#75a4e2}._expand_aqxrv_183{position:absolute;top:2rem;right:0;height:40px;width:30px;background-color:#fff;border-radius:3px;border:2px solid #aaa;cursor:pointer;display:flex;align-items:center;justify-content:center}._content_aqxrv_199{flex-grow:1;overflow:auto;min-width:300px!important}._closeButton_aqxrv_206{position:sticky;top:.5rem;margin-left:auto;width:min-content;z-index:100}
|
|
@@ -4,6 +4,7 @@ interface Props extends PropsWithChildren {
|
|
|
4
4
|
onClose?: () => void;
|
|
5
5
|
onOpen?: () => void;
|
|
6
6
|
position?: 'right' | 'bottom';
|
|
7
|
+
closeLabel?: string;
|
|
7
8
|
}
|
|
8
|
-
export default function SidePanel({ children, open, onClose, onOpen, position }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function SidePanel({ children, open, onClose, onOpen, closeLabel, position }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,109 +1,126 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { C as
|
|
4
|
-
import { IconButton as
|
|
5
|
-
import '../../assets/SidePanel.css';const
|
|
6
|
-
sidePanel:
|
|
7
|
-
sidePanelHorizontal:
|
|
8
|
-
closed:
|
|
9
|
-
opening:
|
|
10
|
-
open:
|
|
11
|
-
resizer:
|
|
12
|
-
resizerHorizontal:
|
|
13
|
-
resizerVertical:
|
|
14
|
-
noSelect:
|
|
15
|
-
resizerBar:
|
|
16
|
-
resizing:
|
|
17
|
-
resizerHandle:
|
|
18
|
-
minimised:
|
|
19
|
-
content:
|
|
20
|
-
closeButton:
|
|
21
|
-
},
|
|
22
|
-
function
|
|
23
|
-
const [
|
|
24
|
-
window.sessionStorage.getItem(
|
|
25
|
-
),
|
|
1
|
+
import { jsxs as M, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useRef as v, useEffect as I } from "react";
|
|
3
|
+
import { C as L } from "../../Close-Cv_QwhIN.js";
|
|
4
|
+
import { IconButton as T } from "@mui/material";
|
|
5
|
+
import '../../assets/SidePanel.css';const k = "_sidePanel_aqxrv_1", V = "_sidePanelHorizontal_aqxrv_14", W = "_closed_aqxrv_19", Z = "_opening_aqxrv_27", C = "_open_aqxrv_27", K = "_resizer_aqxrv_47", U = "_resizerHorizontal_aqxrv_58", X = "_resizerVertical_aqxrv_67", j = "_noSelect_aqxrv_75", F = "_resizerBar_aqxrv_79", O = "_resizing_aqxrv_101", Y = "_resizerHandle_aqxrv_105", G = "_minimised_aqxrv_131", J = "_content_aqxrv_199", Q = "_closeButton_aqxrv_206", t = {
|
|
6
|
+
sidePanel: k,
|
|
7
|
+
sidePanelHorizontal: V,
|
|
8
|
+
closed: W,
|
|
9
|
+
opening: Z,
|
|
10
|
+
open: C,
|
|
11
|
+
resizer: K,
|
|
12
|
+
resizerHorizontal: U,
|
|
13
|
+
resizerVertical: X,
|
|
14
|
+
noSelect: j,
|
|
15
|
+
resizerBar: F,
|
|
16
|
+
resizing: O,
|
|
17
|
+
resizerHandle: Y,
|
|
18
|
+
minimised: G,
|
|
19
|
+
content: J,
|
|
20
|
+
closeButton: Q
|
|
21
|
+
}, p = 30, N = 300, E = Math.max(N, Math.floor(window.innerWidth * 0.25)), c = "sidePanelWidth";
|
|
22
|
+
function re({ children: D, open: o, onClose: d, onOpen: q, closeLabel: $, position: i = "right" }) {
|
|
23
|
+
const [u, s] = h(o ? E : 0), w = v(null), [_, H] = h(!1), [g, P] = h(!1), [b, y] = h(!o), S = v(null), z = v(null), l = v(
|
|
24
|
+
window.sessionStorage.getItem(c) ? Number(window.sessionStorage.getItem(c)) : E
|
|
25
|
+
), a = Math.max(
|
|
26
26
|
N,
|
|
27
|
-
Math.floor(
|
|
27
|
+
Math.floor(i === "right" ? window.innerWidth * 0.9 : window.innerHeight * 0.9)
|
|
28
28
|
);
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
29
|
+
I(() => {
|
|
30
|
+
if (o)
|
|
31
|
+
P(!0), y(!1), z.current = document.activeElement ? document.activeElement : null;
|
|
32
32
|
else {
|
|
33
33
|
s(0);
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const n = setTimeout(() => {
|
|
35
|
+
y(!0), z.current && document.contains(z.current) && z.current.focus();
|
|
36
36
|
}, 300);
|
|
37
|
-
return () => clearTimeout(
|
|
37
|
+
return () => clearTimeout(n);
|
|
38
38
|
}
|
|
39
|
-
}, [
|
|
40
|
-
if (
|
|
41
|
-
s(
|
|
42
|
-
const
|
|
43
|
-
|
|
39
|
+
}, [o]), I(() => {
|
|
40
|
+
if (g) {
|
|
41
|
+
S.current && S.current.focus(), s(l.current || E);
|
|
42
|
+
const n = setTimeout(() => {
|
|
43
|
+
P(!1);
|
|
44
44
|
}, 300);
|
|
45
|
-
return () => clearTimeout(
|
|
45
|
+
return () => clearTimeout(n);
|
|
46
46
|
}
|
|
47
|
-
}, [
|
|
48
|
-
if (
|
|
49
|
-
let
|
|
50
|
-
if (
|
|
51
|
-
const
|
|
52
|
-
|
|
47
|
+
}, [g]), I(() => {
|
|
48
|
+
if (_) {
|
|
49
|
+
let n = function(e) {
|
|
50
|
+
if (_ && w.current) {
|
|
51
|
+
const R = w.current.getBoundingClientRect(), B = i === "right" ? R.right - e.clientX : R.bottom - e.clientY, f = Math.max(Math.min(B, a), p);
|
|
52
|
+
f - B > 10 ? s(0) : (l.current = f, s(f), window.sessionStorage.setItem(c, f.toString())), e.preventDefault();
|
|
53
53
|
}
|
|
54
|
-
},
|
|
55
|
-
|
|
54
|
+
}, r = function() {
|
|
55
|
+
H(!1);
|
|
56
56
|
};
|
|
57
|
-
return window.addEventListener("pointermove",
|
|
58
|
-
window.removeEventListener("pointermove",
|
|
57
|
+
return window.addEventListener("pointermove", n, { passive: !1 }), window.addEventListener("pointerup", r), document.body.classList.add(t.noSelect), () => {
|
|
58
|
+
window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", r), document.body.classList.remove(t.noSelect);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
}, [
|
|
62
|
-
const
|
|
61
|
+
}, [_, i, a]);
|
|
62
|
+
const x = u === 0, A = /* @__PURE__ */ M(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
className: `${
|
|
65
|
+
className: `${t.resizer} ${_ ? t.resizing : ""} ${i === "right" ? t.resizerVertical : t.resizerHorizontal}`,
|
|
66
66
|
onPointerDown: () => {
|
|
67
|
-
|
|
67
|
+
H(!0), q && q();
|
|
68
68
|
},
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
70
|
+
/* @__PURE__ */ m("div", { className: t.resizerBar }),
|
|
71
|
+
o && /* @__PURE__ */ m(
|
|
72
72
|
"div",
|
|
73
73
|
{
|
|
74
|
-
className: `${
|
|
74
|
+
className: `${t.resizerHandle} ${x ? t.minimised : ""}`,
|
|
75
75
|
role: "separator",
|
|
76
|
-
"aria-orientation":
|
|
76
|
+
"aria-orientation": i === "right" ? "vertical" : "horizontal",
|
|
77
77
|
"aria-label": "Resize sidebar",
|
|
78
78
|
tabIndex: 0,
|
|
79
|
-
"aria-valuenow":
|
|
80
|
-
"aria-valuemin":
|
|
81
|
-
"aria-valuemax":
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
"aria-valuenow": u,
|
|
80
|
+
"aria-valuemin": 0,
|
|
81
|
+
"aria-valuemax": a,
|
|
82
|
+
ref: S,
|
|
83
|
+
onKeyDown: (n) => {
|
|
84
|
+
i === "right" ? n.key === "ArrowRight" ? s((r) => {
|
|
85
|
+
const e = Math.min(a, Math.max(0, r - 50));
|
|
86
|
+
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
87
|
+
}) : n.key === "ArrowLeft" && s((r) => {
|
|
88
|
+
const e = Math.max(p, Math.min(a, r + 50));
|
|
89
|
+
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
90
|
+
}) : n.key === "ArrowDown" ? s((r) => {
|
|
91
|
+
const e = Math.min(a, Math.max(0, r - 50));
|
|
92
|
+
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
93
|
+
}) : n.key === "ArrowUp" && s((r) => {
|
|
94
|
+
const e = Math.max(p, Math.min(a, r + 50));
|
|
95
|
+
return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
|
|
96
|
+
});
|
|
84
97
|
}
|
|
85
98
|
}
|
|
86
99
|
)
|
|
87
100
|
]
|
|
88
101
|
}
|
|
89
102
|
);
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
"
|
|
103
|
+
return /* @__PURE__ */ M(
|
|
104
|
+
"aside",
|
|
92
105
|
{
|
|
93
|
-
className: `${
|
|
94
|
-
style:
|
|
95
|
-
ref:
|
|
96
|
-
"aria-hidden": !
|
|
106
|
+
className: `${t.sidePanel} ${o ? t.open : t.closed} ${g ? t.opening : ""} ${i === "right" ? t.sidePanelVertical : t.sidePanelHorizontal}`,
|
|
107
|
+
style: i === "right" ? { width: x ? 0 : u, visibility: b ? "hidden" : void 0 } : { height: x ? 0 : u, visibility: b ? "hidden" : void 0 },
|
|
108
|
+
ref: w,
|
|
109
|
+
"aria-hidden": !o,
|
|
110
|
+
onKeyDownCapture: (n) => {
|
|
111
|
+
n.key === "Escape" && (n.stopPropagation(), d == null || d());
|
|
112
|
+
},
|
|
97
113
|
children: [
|
|
98
|
-
(
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
101
|
-
|
|
114
|
+
(i === "right" || i === "bottom") && A,
|
|
115
|
+
/* @__PURE__ */ M("div", { className: t.content, children: [
|
|
116
|
+
d && /* @__PURE__ */ m("div", { className: t.closeButton, children: /* @__PURE__ */ m(
|
|
117
|
+
T,
|
|
102
118
|
{
|
|
103
|
-
onClick:
|
|
119
|
+
onClick: d,
|
|
104
120
|
"data-testid": "sidepanel-close-button",
|
|
105
|
-
|
|
106
|
-
|
|
121
|
+
"aria-label": $ ?? "Close side panel",
|
|
122
|
+
children: /* @__PURE__ */ m(
|
|
123
|
+
L,
|
|
107
124
|
{
|
|
108
125
|
fontSize: "medium",
|
|
109
126
|
htmlColor: "#444"
|
|
@@ -111,12 +128,12 @@ function ie({ children: R, open: r, onClose: S, onOpen: I, position: t = "right"
|
|
|
111
128
|
)
|
|
112
129
|
}
|
|
113
130
|
) }),
|
|
114
|
-
|
|
131
|
+
D
|
|
115
132
|
] })
|
|
116
133
|
]
|
|
117
134
|
}
|
|
118
135
|
);
|
|
119
136
|
}
|
|
120
137
|
export {
|
|
121
|
-
|
|
138
|
+
re as default
|
|
122
139
|
};
|