@genai-fi/base 4.3.4 → 4.3.6

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
- ._lang_1mspu_3{display:flex;align-items:center;gap:.3rem;color:#aaa}
1
+ ._lang_qnljl_1{display:flex;align-items:center;gap:.3rem;color:#666}._dark_qnljl_8,._dark_qnljl_8 div{color:#fff}._dark_qnljl_8 svg{color:#fff}._dark_qnljl_8 option{color:#000}._darkSelect_qnljl_24:before{border-bottom:1px solid rgba(255,255,255,.42)}._darkSelect_qnljl_24:hover:before{border-bottom:2px solid rgba(255,255,255,.42)!important}
@@ -1 +1 @@
1
- ._policy_12v8a_1{color:#444;background:#fff;position:fixed;align-items:center;gap:1rem;max-width:200px;display:flex;font-size:.7rem;box-sizing:border-box;box-shadow:0 0 6px #ddd;overflow:hidden}._bottomLeft_12v8a_15{bottom:0;left:0;border-top-right-radius:20px;padding-right:15px}._topRight_12v8a_22{top:0;right:0;border-bottom-left-radius:20px;padding-left:15px}._policy_12v8a_1 a,._policy_12v8a_1 a:visited{color:#444}._versionBox_12v8a_37{font-size:6pt;height:40px;display:flex;align-items:center;justify-content:center;padding-left:5px;padding-right:8px;background:#444;box-sizing:border-box}._bottomLeft_12v8a_15 ._versionBox_12v8a_37{border-top-right-radius:20px}._topRight_12v8a_22 ._versionBox_12v8a_37{border-bottom-left-radius:20px}
1
+ ._policy_10293_1{color:#fff;background:#444;position:fixed;align-items:center;gap:1rem;max-width:200px;display:flex;font-size:.7rem;box-sizing:border-box;box-shadow:2px 2px 4px #a4acbb;overflow:hidden}._bottomLeft_10293_15{bottom:0;left:0;border-top-right-radius:20px;padding-right:15px}._topRight_10293_22{top:0;right:0;border-bottom-left-radius:20px;padding-left:15px}._policy_10293_1 a,._policy_10293_1 a:visited{color:#fff}._versionBox_10293_37{font-size:6pt;height:40px;display:flex;align-items:center;justify-content:center;padding-left:5px;padding-right:8px;background:#444;box-sizing:border-box}
@@ -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}
1
+ ._sidePanel_g53a4_1{background:#fff;display:flex;z-index:2;flex-shrink:0;position:relative;transition:opacity .3s ease-in;opacity:0}._sidePanelHorizontal_g53a4_14{flex-direction:column;width:100%}._sidePanel_g53a4_1._closed_g53a4_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_g53a4_1._opening_g53a4_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_g53a4_1,._sidePanel_g53a4_1._closed_g53a4_19,._sidePanel_g53a4_1._opening_g53a4_27{transition:none}}._sidePanel_g53a4_1._open_g53a4_27{opacity:1}._resizer_g53a4_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_g53a4_58{height:30px;width:100%;cursor:ns-resize;left:0;top:-8px;right:0}._resizerVertical_g53a4_67{width:30px;cursor:ew-resize;left:-8px;top:0;bottom:0}._noSelect_g53a4_75{-webkit-user-select:none;user-select:none}._resizerBar_g53a4_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_g53a4_58 ._resizerBar_g53a4_79{top:7px;left:0;width:100%;height:2px}._resizer_g53a4_47:hover ._resizerBar_g53a4_79{background-color:#75a4e288}._resizer_g53a4_47._resizing_g53a4_101 ._resizerBar_g53a4_79{background-color:#75a4e2}._resizerHandle_g53a4_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_g53a4_58 ._resizerHandle_g53a4_105{top:2px;left:50%;width:60px;height:10px;transform:translate(-50%)}._resizerHandle_g53a4_105._minimised_g53a4_131{left:-15px;width:20px}._resizerHorizontal_g53a4_58 ._resizerHandle_g53a4_105._minimised_g53a4_131{top:-15px;height:20px;left:50%;width:60px;transform:translate(-50%)}._resizerHandle_g53a4_105:focus{outline:2px solid #75a4e2;outline-offset:2px}._resizerVertical_g53a4_67 ._resizerHandle_g53a4_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_g53a4_58 ._resizerHandle_g53a4_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_g53a4_47:hover ._resizerHandle_g53a4_105,._resizer_g53a4_47._resizing_g53a4_101 ._resizerHandle_g53a4_105{border-color:#75a4e2}._expand_g53a4_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_g53a4_199{flex-grow:1;overflow:auto}._closeButton_g53a4_205{position:sticky;top:.5rem;margin-left:auto;width:min-content;z-index:100}
@@ -7,6 +7,8 @@ interface Props {
7
7
  name: string;
8
8
  label: string;
9
9
  }[];
10
+ ns?: string;
11
+ dark?: boolean;
10
12
  }
11
- export default function LangSelect({ languages }: Props): import("react/jsx-runtime").JSX.Element;
13
+ export default function LangSelect({ languages, ns, dark }: Props): import("react/jsx-runtime").JSX.Element;
12
14
  export {};
@@ -1,33 +1,36 @@
1
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import { NativeSelect as s } from "@mui/material";
3
- import { useTranslation as m } from "react-i18next";
4
- import { useCallback as g } from "react";
5
- import { c as i } from "../../createSvgIcon-BM4dw4Lw.js";
6
- import '../../assets/LangSelect.css';const r = "_lang_1mspu_3", u = {
7
- lang: r
8
- }, h = i(/* @__PURE__ */ e("path", {
1
+ import { jsx as n, jsxs as m } from "react/jsx-runtime";
2
+ import { NativeSelect as g } from "@mui/material";
3
+ import { useTranslation as i } from "react-i18next";
4
+ import { useCallback as d } from "react";
5
+ import { c as u } from "../../createSvgIcon-BM4dw4Lw.js";
6
+ import '../../assets/LangSelect.css';const h = "_lang_qnljl_1", p = "_dark_qnljl_8", S = "_darkSelect_qnljl_24", e = {
7
+ lang: h,
8
+ dark: p,
9
+ darkSelect: S
10
+ }, f = u(/* @__PURE__ */ n("path", {
9
11
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2s.07-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"
10
- }), "Language"), p = [
12
+ }), "Language"), _ = [
11
13
  { name: "en", label: "English" },
12
14
  { name: "fi", label: "Suomi" }
13
15
  ];
14
- function M({ languages: c = p }) {
15
- const { t, i18n: n } = m(), l = g(
16
+ function b({ languages: t = _, ns: s = "common", dark: l = !1 }) {
17
+ const { t: o, i18n: c } = i(), r = d(
16
18
  (a) => {
17
- n.changeLanguage(a.target.value || "en");
19
+ c.changeLanguage(a.target.value || "en");
18
20
  },
19
- [n]
21
+ [c]
20
22
  );
21
- return /* @__PURE__ */ o("div", { className: u.lang, children: [
22
- /* @__PURE__ */ e(
23
- s,
23
+ return /* @__PURE__ */ m("div", { className: `${e.lang} ${l ? e.dark : ""}`, children: [
24
+ /* @__PURE__ */ n(
25
+ g,
24
26
  {
25
- value: n.language,
26
- onChange: l,
27
+ value: c.language,
28
+ onChange: r,
27
29
  variant: "outlined",
28
30
  "data-testid": "select-lang",
29
- inputProps: { "aria-label": t("app.language", { ns: "common" }) },
30
- children: c.map((a) => /* @__PURE__ */ e(
31
+ inputProps: { "aria-label": o("app.language", { ns: s }) },
32
+ className: `${e.select} ${l ? e.darkSelect : ""}`,
33
+ children: t.map((a) => /* @__PURE__ */ n(
31
34
  "option",
32
35
  {
33
36
  value: a.name,
@@ -37,10 +40,10 @@ function M({ languages: c = p }) {
37
40
  ))
38
41
  }
39
42
  ),
40
- /* @__PURE__ */ e(h, {})
43
+ /* @__PURE__ */ n(f, {})
41
44
  ] });
42
45
  }
43
46
  export {
44
- p as LANGS,
45
- M as default
47
+ _ as LANGS,
48
+ b as default
46
49
  };
@@ -1,7 +1,9 @@
1
+ import { CSSProperties } from 'react';
1
2
  interface Props {
2
3
  position?: 'bottomLeft' | 'topRight';
3
4
  tag: string;
4
5
  appName: string;
6
+ style?: CSSProperties;
5
7
  }
6
- export default function Privacy({ tag, appName, position }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export default function Privacy({ tag, appName, position, style: customStyle }: Props): import("react/jsx-runtime").JSX.Element;
7
9
  export {};
@@ -1,57 +1,64 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as c } from "react-i18next";
3
- import '../../assets/Privacy.css';const l = "_policy_12v8a_1", n = "_bottomLeft_12v8a_15", h = "_topRight_12v8a_22", g = "_versionBox_12v8a_37", o = {
4
- policy: l,
5
- bottomLeft: n,
6
- topRight: h,
7
- versionBox: g
8
- }, d = "data:image/svg+xml,%3csvg%20width='98'%20height='96'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M48.854%200C21.839%200%200%2022%200%2049.217c0%2021.756%2013.993%2040.172%2033.405%2046.69%202.427.49%203.316-1.059%203.316-2.362%200-1.141-.08-5.052-.08-9.127-13.59%202.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015%204.934.326%207.523%205.052%207.523%205.052%204.367%207.496%2011.404%205.378%2014.235%204.074.404-3.178%201.699-5.378%203.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283%200-5.378%201.94-9.778%205.014-13.2-.485-1.222-2.184-6.275.486-13.038%200%200%204.125-1.304%2013.426%205.052a46.97%2046.97%200%200%201%2012.214-1.63c4.125%200%208.33.571%2012.213%201.63%209.302-6.356%2013.427-5.052%2013.427-5.052%202.67%206.763.97%2011.816.485%2013.038%203.155%203.422%205.015%207.822%205.015%2013.2%200%2018.905-11.404%2023.06-22.324%2024.283%201.78%201.548%203.316%204.481%203.316%209.126%200%206.6-.08%2011.897-.08%2013.526%200%201.304.89%202.853%203.316%202.364%2019.412-6.52%2033.405-24.935%2033.405-46.691C97.707%2022%2075.788%200%2048.854%200z'%20fill='%23fff'/%3e%3c/svg%3e";
9
- function m({ tag: a, appName: r, position: e = "bottomLeft" }) {
3
+ import '../../assets/Privacy.css';const n = "_policy_10293_1", h = "_bottomLeft_10293_15", g = "_topRight_10293_22", d = "_versionBox_10293_37", o = {
4
+ policy: n,
5
+ bottomLeft: h,
6
+ topRight: g,
7
+ versionBox: d
8
+ }, f = "data:image/svg+xml,%3csvg%20width='98'%20height='96'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M48.854%200C21.839%200%200%2022%200%2049.217c0%2021.756%2013.993%2040.172%2033.405%2046.69%202.427.49%203.316-1.059%203.316-2.362%200-1.141-.08-5.052-.08-9.127-13.59%202.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015%204.934.326%207.523%205.052%207.523%205.052%204.367%207.496%2011.404%205.378%2014.235%204.074.404-3.178%201.699-5.378%203.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283%200-5.378%201.94-9.778%205.014-13.2-.485-1.222-2.184-6.275.486-13.038%200%200%204.125-1.304%2013.426%205.052a46.97%2046.97%200%200%201%2012.214-1.63c4.125%200%208.33.571%2012.213%201.63%209.302-6.356%2013.427-5.052%2013.427-5.052%202.67%206.763.97%2011.816.485%2013.038%203.155%203.422%205.015%207.822%205.015%2013.2%200%2018.905-11.404%2023.06-22.324%2024.283%201.78%201.548%203.316%204.481%203.316%209.126%200%206.6-.08%2011.897-.08%2013.526%200%201.304.89%202.853%203.316%202.364%2019.412-6.52%2033.405-24.935%2033.405-46.691C97.707%2022%2075.788%200%2048.854%200z'%20fill='%23fff'/%3e%3c/svg%3e";
9
+ function v({ tag: r, appName: a, position: e = "bottomLeft", style: s }) {
10
10
  const { t: i } = c();
11
- return /* @__PURE__ */ s("section", { className: `${o.policy} ${o[e]}`, children: [
12
- e === "topRight" && /* @__PURE__ */ t(
13
- "a",
14
- {
15
- href: "/about",
16
- target: "_blank",
17
- children: i("about.privacyTitle")
18
- }
19
- ),
20
- /* @__PURE__ */ t(
21
- "div",
22
- {
23
- "aria-hidden": !0,
24
- className: o.versionBox,
25
- children: /* @__PURE__ */ t(
11
+ return /* @__PURE__ */ l(
12
+ "section",
13
+ {
14
+ className: `${o.policy} ${o[e]}`,
15
+ style: s,
16
+ children: [
17
+ e === "topRight" && /* @__PURE__ */ t(
26
18
  "a",
27
19
  {
28
- href: `https://github.com/knicos/genai-${r}/releases/tag/${a}`,
20
+ href: "/about",
29
21
  target: "_blank",
30
- rel: "noreferrer",
31
- "data-testid": "versionlink",
22
+ children: i("about.privacyTitle")
23
+ }
24
+ ),
25
+ /* @__PURE__ */ t(
26
+ "div",
27
+ {
28
+ "aria-hidden": !0,
29
+ className: o.versionBox,
32
30
  children: /* @__PURE__ */ t(
33
- "img",
31
+ "a",
34
32
  {
35
- src: d,
36
- width: 24,
37
- height: 24,
38
- alt: "Github source"
33
+ href: `https://github.com/knicos/genai-${a}/releases/tag/${r}`,
34
+ target: "_blank",
35
+ rel: "noreferrer",
36
+ "data-testid": "versionlink",
37
+ children: /* @__PURE__ */ t(
38
+ "img",
39
+ {
40
+ src: f,
41
+ width: 24,
42
+ height: 24,
43
+ alt: "Github source"
44
+ }
45
+ )
39
46
  }
40
47
  )
41
48
  }
49
+ ),
50
+ e === "bottomLeft" && /* @__PURE__ */ t(
51
+ "a",
52
+ {
53
+ href: "/about",
54
+ target: "_blank",
55
+ children: i("about.privacyTitle")
56
+ }
42
57
  )
43
- }
44
- ),
45
- e === "bottomLeft" && /* @__PURE__ */ t(
46
- "a",
47
- {
48
- href: "/about",
49
- target: "_blank",
50
- children: i("about.privacyTitle")
51
- }
52
- )
53
- ] });
58
+ ]
59
+ }
60
+ );
54
61
  }
55
62
  export {
56
- m as default
63
+ v as default
57
64
  };
@@ -1,97 +1,97 @@
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,
1
+ import { jsxs as p, jsx as u } from "react/jsx-runtime";
2
+ import { useState as h, useRef as w, useEffect as E } from "react";
3
+ import { C as T } from "../../Close-Cv_QwhIN.js";
4
+ import { IconButton as k } from "@mui/material";
5
+ import '../../assets/SidePanel.css';const V = "_sidePanel_g53a4_1", W = "_sidePanelHorizontal_g53a4_14", Z = "_closed_g53a4_19", C = "_opening_g53a4_27", K = "_open_g53a4_27", U = "_resizer_g53a4_47", X = "_resizerHorizontal_g53a4_58", j = "_resizerVertical_g53a4_67", F = "_noSelect_g53a4_75", O = "_resizerBar_g53a4_79", Y = "_resizing_g53a4_101", G = "_resizerHandle_g53a4_105", q = "_minimised_g53a4_131", J = "_content_g53a4_199", Q = "_closeButton_g53a4_205", t = {
6
+ sidePanel: V,
7
+ sidePanelHorizontal: W,
8
+ closed: Z,
9
+ opening: C,
10
+ open: K,
11
+ resizer: U,
12
+ resizerHorizontal: X,
13
+ resizerVertical: j,
14
+ noSelect: F,
15
+ resizerBar: O,
16
+ resizing: Y,
17
+ resizerHandle: G,
18
+ minimised: q,
19
19
  content: J,
20
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
21
+ }, H = 30, b = 300, P = Math.max(b, Math.floor(window.innerWidth * 0.25)), c = "sidePanelWidth";
22
+ function re({ children: $, open: o, onClose: d, onOpen: y, closeLabel: A, position: i = "right" }) {
23
+ const [m, s] = h(o ? P : 0), S = w(null), [g, x] = h(!1), [v, R] = h(!1), [M, B] = h(!o), I = w(null), _ = w(null), l = w(
24
+ window.sessionStorage.getItem(c) ? Number(window.sessionStorage.getItem(c)) : P
25
25
  ), a = Math.max(
26
- N,
26
+ b,
27
27
  Math.floor(i === "right" ? window.innerWidth * 0.9 : window.innerHeight * 0.9)
28
28
  );
29
- I(() => {
29
+ E(() => {
30
30
  if (o)
31
- P(!0), y(!1), z.current = document.activeElement ? document.activeElement : null;
31
+ R(!0), B(!1), _.current = document.activeElement ? document.activeElement : null;
32
32
  else {
33
33
  s(0);
34
34
  const n = setTimeout(() => {
35
- y(!0), z.current && document.contains(z.current) && z.current.focus();
35
+ B(!0), _.current && document.contains(_.current) && _.current.focus();
36
36
  }, 300);
37
37
  return () => clearTimeout(n);
38
38
  }
39
- }, [o]), I(() => {
40
- if (g) {
41
- S.current && S.current.focus(), s(l.current || E);
39
+ }, [o]), E(() => {
40
+ if (v) {
41
+ I.current && I.current.focus(), s(l.current || P);
42
42
  const n = setTimeout(() => {
43
- P(!1);
43
+ R(!1);
44
44
  }, 300);
45
45
  return () => clearTimeout(n);
46
46
  }
47
- }, [g]), I(() => {
48
- if (_) {
47
+ }, [v]), E(() => {
48
+ if (g) {
49
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();
50
+ if (g && S.current) {
51
+ const N = S.current.getBoundingClientRect(), D = i === "right" ? N.right - e.clientX : N.bottom - e.clientY, f = Math.max(Math.min(D, a), H);
52
+ f - D > 10 ? s(0) : (l.current = f, s(f), window.sessionStorage.setItem(c, f.toString())), e.preventDefault();
53
53
  }
54
54
  }, r = function() {
55
- H(!1);
55
+ x(!1);
56
56
  };
57
57
  return window.addEventListener("pointermove", n, { passive: !1 }), window.addEventListener("pointerup", r), document.body.classList.add(t.noSelect), () => {
58
58
  window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", r), document.body.classList.remove(t.noSelect);
59
59
  };
60
60
  }
61
- }, [_, i, a]);
62
- const x = u === 0, A = /* @__PURE__ */ M(
61
+ }, [g, i, a]);
62
+ const z = m === 0 || M, L = /* @__PURE__ */ p(
63
63
  "div",
64
64
  {
65
- className: `${t.resizer} ${_ ? t.resizing : ""} ${i === "right" ? t.resizerVertical : t.resizerHorizontal}`,
65
+ className: `${t.resizer} ${g ? t.resizing : ""} ${i === "right" ? t.resizerVertical : t.resizerHorizontal}`,
66
66
  onPointerDown: () => {
67
- H(!0), q && q();
67
+ x(!0), y && y();
68
68
  },
69
69
  children: [
70
- /* @__PURE__ */ m("div", { className: t.resizerBar }),
71
- o && /* @__PURE__ */ m(
70
+ /* @__PURE__ */ u("div", { className: t.resizerBar }),
71
+ o && /* @__PURE__ */ u(
72
72
  "div",
73
73
  {
74
- className: `${t.resizerHandle} ${x ? t.minimised : ""}`,
74
+ className: `${t.resizerHandle} ${z ? t.minimised : ""}`,
75
75
  role: "separator",
76
76
  "aria-orientation": i === "right" ? "vertical" : "horizontal",
77
77
  "aria-label": "Resize sidebar",
78
78
  tabIndex: 0,
79
- "aria-valuenow": u,
79
+ "aria-valuenow": m,
80
80
  "aria-valuemin": 0,
81
81
  "aria-valuemax": a,
82
- ref: S,
82
+ ref: I,
83
83
  onKeyDown: (n) => {
84
84
  i === "right" ? n.key === "ArrowRight" ? s((r) => {
85
85
  const e = Math.min(a, Math.max(0, r - 50));
86
86
  return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
87
87
  }) : n.key === "ArrowLeft" && s((r) => {
88
- const e = Math.max(p, Math.min(a, r + 50));
88
+ const e = Math.max(H, Math.min(a, r + 50));
89
89
  return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
90
90
  }) : n.key === "ArrowDown" ? s((r) => {
91
91
  const e = Math.min(a, Math.max(0, r - 50));
92
92
  return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
93
93
  }) : n.key === "ArrowUp" && s((r) => {
94
- const e = Math.max(p, Math.min(a, r + 50));
94
+ const e = Math.max(H, Math.min(a, r + 50));
95
95
  return l.current = e, window.sessionStorage.setItem(c, e.toString()), e;
96
96
  });
97
97
  }
@@ -100,27 +100,27 @@ function re({ children: D, open: o, onClose: d, onOpen: q, closeLabel: $, positi
100
100
  ]
101
101
  }
102
102
  );
103
- return /* @__PURE__ */ M(
103
+ return /* @__PURE__ */ p(
104
104
  "aside",
105
105
  {
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,
106
+ className: `${t.sidePanel} ${o ? t.open : t.closed} ${v ? t.opening : ""} ${i === "right" ? t.sidePanelVertical : t.sidePanelHorizontal}`,
107
+ style: i === "right" ? { width: z ? 0 : m, visibility: M ? "hidden" : void 0 } : { height: z ? 0 : m, visibility: M ? "hidden" : void 0 },
108
+ ref: S,
109
109
  "aria-hidden": !o,
110
110
  onKeyDownCapture: (n) => {
111
111
  n.key === "Escape" && (n.stopPropagation(), d == null || d());
112
112
  },
113
113
  children: [
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,
114
+ (i === "right" || i === "bottom") && L,
115
+ /* @__PURE__ */ p("div", { className: t.content, children: [
116
+ d && /* @__PURE__ */ u("div", { className: t.closeButton, children: /* @__PURE__ */ u(
117
+ k,
118
118
  {
119
119
  onClick: d,
120
120
  "data-testid": "sidepanel-close-button",
121
- "aria-label": $ ?? "Close side panel",
122
- children: /* @__PURE__ */ m(
123
- L,
121
+ "aria-label": A ?? "Close side panel",
122
+ children: /* @__PURE__ */ u(
123
+ T,
124
124
  {
125
125
  fontSize: "medium",
126
126
  htmlColor: "#444"
@@ -128,7 +128,7 @@ function re({ children: D, open: o, onClose: d, onOpen: q, closeLabel: $, positi
128
128
  )
129
129
  }
130
130
  ) }),
131
- D
131
+ z || m < b ? null : $
132
132
  ] })
133
133
  ]
134
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/base",
3
- "version": "4.3.4",
3
+ "version": "4.3.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",