@situaction/traq-ui-ste 1.2.13 → 1.2.15
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.
- package/dist/X.es-BEJ-zMPl.mjs +146 -0
- package/dist/components/button/Button.js +36 -36
- package/dist/components/calendar/Calendar.js +210 -214
- package/dist/components/drag-and-drop/DragAndDrop.d.ts +31 -0
- package/dist/components/drag-and-drop/DragAndDrop.js +143 -0
- package/dist/components/icon/Icon.js +23729 -46405
- package/dist/components/icon-button/IconButton.js +27 -27
- package/dist/components/input/Input.js +49 -49
- package/dist/components/loading/Loading.d.ts +38 -0
- package/dist/components/loading/Loading.js +87 -0
- package/dist/components/menu/Menu.js +60 -63
- package/dist/components/panel/side-panel/SidePanel.js +18 -19
- package/dist/components/select/Select.js +67 -69
- package/dist/components/select-filter-input-tags/SelectFilterInputTags.js +8 -9
- package/dist/components/select-multi-items/SelectMultiItems.js +18 -18
- package/dist/components/tag/Tag.js +25 -25
- package/dist/components/theme/variables_dark.d.ts +11 -0
- package/dist/components/theme/variables_dark.js +12 -1
- package/dist/components/theme/variables_light.d.ts +11 -0
- package/dist/components/theme/variables_light.js +12 -1
- package/dist/components/toast/Toast.js +38 -38
- package/dist/main.d.ts +2 -0
- package/dist/main.js +29 -25
- package/dist/styles/Button.css +1 -1
- package/dist/styles/DragAndDrop.css +1 -0
- package/dist/styles/IconButton.css +1 -1
- package/dist/styles/Input.css +1 -1
- package/dist/styles/Loading.css +1 -0
- package/dist/styles/Tag.css +1 -1
- package/dist/styles/Toast.css +1 -1
- package/package.json +1 -1
- package/dist/X-Bd1VjKAF.mjs +0 -190
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as w } from "react";
|
|
3
|
-
import '../../styles/IconButton.css';const z = "
|
|
3
|
+
import '../../styles/IconButton.css';const z = "_button_olxwb_30", m = "_flexHorizontalCenter_olxwb_187", t = {
|
|
4
4
|
button: z,
|
|
5
|
-
"button-round": "_button-
|
|
6
|
-
"button-primary": "_button-
|
|
7
|
-
"button-secondary": "_button-
|
|
8
|
-
"button-tertiary": "_button-
|
|
9
|
-
"button-ghost": "_button-
|
|
10
|
-
"button-icon": "_button-
|
|
11
|
-
"button-icon-selected": "_button-icon-
|
|
12
|
-
"button-error": "_button-
|
|
13
|
-
"button-size-xl": "_button-size-
|
|
14
|
-
"button-size-l": "_button-size-
|
|
15
|
-
"button-size-m": "_button-size-
|
|
16
|
-
"button-size-s": "_button-size-
|
|
17
|
-
"button-size-menu": "_button-size-
|
|
5
|
+
"button-round": "_button-round_olxwb_57",
|
|
6
|
+
"button-primary": "_button-primary_olxwb_60",
|
|
7
|
+
"button-secondary": "_button-secondary_olxwb_74",
|
|
8
|
+
"button-tertiary": "_button-tertiary_olxwb_90",
|
|
9
|
+
"button-ghost": "_button-ghost_olxwb_106",
|
|
10
|
+
"button-icon": "_button-icon_olxwb_123",
|
|
11
|
+
"button-icon-selected": "_button-icon-selected_olxwb_135",
|
|
12
|
+
"button-error": "_button-error_olxwb_144",
|
|
13
|
+
"button-size-xl": "_button-size-xl_olxwb_160",
|
|
14
|
+
"button-size-l": "_button-size-l_olxwb_165",
|
|
15
|
+
"button-size-m": "_button-size-m_olxwb_170",
|
|
16
|
+
"button-size-s": "_button-size-s_olxwb_175",
|
|
17
|
+
"button-size-menu": "_button-size-menu_olxwb_180",
|
|
18
18
|
flexHorizontalCenter: m
|
|
19
19
|
}, d = w(
|
|
20
20
|
({
|
|
21
21
|
mode: o = "primary",
|
|
22
22
|
size: n = "m",
|
|
23
|
-
error:
|
|
24
|
-
selected:
|
|
25
|
-
round:
|
|
26
|
-
disabled:
|
|
27
|
-
children:
|
|
28
|
-
onClick:
|
|
23
|
+
error: b,
|
|
24
|
+
selected: e,
|
|
25
|
+
round: _,
|
|
26
|
+
disabled: u,
|
|
27
|
+
children: r,
|
|
28
|
+
onClick: l,
|
|
29
29
|
...s
|
|
30
30
|
}, i) => {
|
|
31
|
-
const x = () =>
|
|
31
|
+
const x = () => b ? "error" : o, c = [
|
|
32
32
|
t.button,
|
|
33
33
|
t[`button-${x()}`],
|
|
34
|
-
|
|
34
|
+
_ && t["button-round"],
|
|
35
35
|
t[`button-size-${n}`],
|
|
36
|
-
|
|
36
|
+
e && o === "icon" && t["button-icon-selected"],
|
|
37
37
|
t.flexHorizontalCenter
|
|
38
38
|
].filter(Boolean).join(" ");
|
|
39
39
|
return /* @__PURE__ */ a(
|
|
40
40
|
"button",
|
|
41
41
|
{
|
|
42
42
|
ref: i,
|
|
43
|
-
className:
|
|
44
|
-
onClick:
|
|
45
|
-
disabled:
|
|
43
|
+
className: c,
|
|
44
|
+
onClick: l,
|
|
45
|
+
disabled: u,
|
|
46
46
|
...s,
|
|
47
|
-
children:
|
|
47
|
+
children: r
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
}
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import '../../styles/Input.css';const
|
|
4
|
-
"input-style": "_input-
|
|
5
|
-
"input-style-disabled": "_input-style-
|
|
6
|
-
"input-style-focused": "_input-style-
|
|
7
|
-
"input-style-secondary": "_input-style-
|
|
8
|
-
"input-style-ghost": "_input-style-
|
|
9
|
-
"input-style-error": "_input-style-
|
|
10
|
-
"input-container": "_input-
|
|
11
|
-
"input-style-size-xl": "_input-style-size-
|
|
12
|
-
"input-style-size-l": "_input-style-size-
|
|
13
|
-
"input-style-size-m": "_input-style-size-
|
|
14
|
-
"input-style-size-s": "_input-style-size-
|
|
15
|
-
"input-style-radius": "_input-style-
|
|
16
|
-
fullWidth:
|
|
17
|
-
flexHorizontalBetween:
|
|
18
|
-
flexHorizontal:
|
|
19
|
-
},
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useRef as p } from "react";
|
|
3
|
+
import '../../styles/Input.css';const N = "_fullWidth_1ch0x_143", W = "_flexHorizontalBetween_1ch0x_147", I = "_flexHorizontal_1ch0x_147", t = {
|
|
4
|
+
"input-style": "_input-style_1ch0x_30",
|
|
5
|
+
"input-style-disabled": "_input-style-disabled_1ch0x_59",
|
|
6
|
+
"input-style-focused": "_input-style-focused_1ch0x_70",
|
|
7
|
+
"input-style-secondary": "_input-style-secondary_1ch0x_77",
|
|
8
|
+
"input-style-ghost": "_input-style-ghost_1ch0x_91",
|
|
9
|
+
"input-style-error": "_input-style-error_1ch0x_94",
|
|
10
|
+
"input-container": "_input-container_1ch0x_104",
|
|
11
|
+
"input-style-size-xl": "_input-style-size-xl_1ch0x_111",
|
|
12
|
+
"input-style-size-l": "_input-style-size-l_1ch0x_118",
|
|
13
|
+
"input-style-size-m": "_input-style-size-m_1ch0x_125",
|
|
14
|
+
"input-style-size-s": "_input-style-size-s_1ch0x_132",
|
|
15
|
+
"input-style-radius": "_input-style-radius_1ch0x_139",
|
|
16
|
+
fullWidth: N,
|
|
17
|
+
flexHorizontalBetween: W,
|
|
18
|
+
flexHorizontal: I
|
|
19
|
+
}, V = ({
|
|
20
20
|
sizeStyle: y = "m",
|
|
21
21
|
labelUnit: l,
|
|
22
22
|
status: n = "default",
|
|
23
|
-
childrenLeft:
|
|
24
|
-
childrenRight:
|
|
25
|
-
round:
|
|
26
|
-
disabled:
|
|
27
|
-
defaultValue:
|
|
28
|
-
fullWidth:
|
|
29
|
-
...
|
|
23
|
+
childrenLeft: i,
|
|
24
|
+
childrenRight: o,
|
|
25
|
+
round: h,
|
|
26
|
+
disabled: u,
|
|
27
|
+
defaultValue: d,
|
|
28
|
+
fullWidth: f = !1,
|
|
29
|
+
...x
|
|
30
30
|
}) => {
|
|
31
|
-
const [z,
|
|
32
|
-
|
|
33
|
-
},
|
|
31
|
+
const [z, c] = _(!1), [m, g] = _(d || ""), B = p(null), s = p(null), C = () => c(!0), H = () => c(!1), S = (j) => {
|
|
32
|
+
g(j.target.value);
|
|
33
|
+
}, v = () => {
|
|
34
34
|
s.current && s.current.focus();
|
|
35
|
-
},
|
|
35
|
+
}, w = [
|
|
36
36
|
t["input-style"],
|
|
37
37
|
t[`input-style-size-${y}`],
|
|
38
|
-
|
|
38
|
+
h && t["input-style-radius"],
|
|
39
39
|
t.flexHorizontalBetween,
|
|
40
|
-
|
|
41
|
-
].filter(Boolean).join(" "),
|
|
40
|
+
f && t.fullWidth
|
|
41
|
+
].filter(Boolean).join(" "), F = [
|
|
42
42
|
z && t["input-style-focused"],
|
|
43
|
-
|
|
43
|
+
u && t["input-style-disabled"],
|
|
44
44
|
n === "secondary" && t["input-style-secondary"],
|
|
45
45
|
n === "ghost" && t["input-style-ghost"]
|
|
46
46
|
].filter(Boolean).join(" ");
|
|
47
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ r(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
50
|
-
ref:
|
|
51
|
-
className: `${
|
|
50
|
+
ref: B,
|
|
51
|
+
className: `${w} ${(() => {
|
|
52
52
|
switch (n) {
|
|
53
53
|
case "error":
|
|
54
54
|
return t["input-style-error"];
|
|
55
55
|
default:
|
|
56
|
-
return
|
|
56
|
+
return F;
|
|
57
57
|
}
|
|
58
58
|
})()}`,
|
|
59
|
-
onFocus:
|
|
60
|
-
onBlur:
|
|
61
|
-
onClick:
|
|
59
|
+
onFocus: C,
|
|
60
|
+
onBlur: H,
|
|
61
|
+
onClick: v,
|
|
62
62
|
children: [
|
|
63
|
-
|
|
63
|
+
i && /* @__PURE__ */ e(a, { children: i }),
|
|
64
64
|
/* @__PURE__ */ e("div", { className: t["input-container"], children: /* @__PURE__ */ e(
|
|
65
65
|
"input",
|
|
66
66
|
{
|
|
67
67
|
autoCorrect: "off",
|
|
68
|
-
disabled:
|
|
69
|
-
value:
|
|
70
|
-
onChange:
|
|
68
|
+
disabled: u,
|
|
69
|
+
value: m,
|
|
70
|
+
onChange: S,
|
|
71
71
|
ref: s,
|
|
72
|
-
...
|
|
72
|
+
...x
|
|
73
73
|
}
|
|
74
74
|
) }),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ r(a, { children: [
|
|
76
76
|
l && /* @__PURE__ */ e("div", { children: l }),
|
|
77
|
-
|
|
77
|
+
o && /* @__PURE__ */ e("span", { className: t.flexHorizontal, children: o })
|
|
78
78
|
] })
|
|
79
79
|
]
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
82
|
};
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
V as Input
|
|
85
85
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type LoadingSize = "s" | "m" | "l" | "xl";
|
|
2
|
+
export type LoadingStatus = "idle" | "loading" | "complete";
|
|
3
|
+
export interface LoadingHoverMeta {
|
|
4
|
+
status: LoadingStatus;
|
|
5
|
+
isHovering: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface LoadingClickMeta {
|
|
8
|
+
/** "clear" when complete is clearable */
|
|
9
|
+
intent: "clear";
|
|
10
|
+
/** true when the clear UI (X) is visible via hover/focus */
|
|
11
|
+
isHovering: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface LoadingProps {
|
|
14
|
+
/** Visual state */
|
|
15
|
+
status: LoadingStatus;
|
|
16
|
+
/** Size variant */
|
|
17
|
+
size?: LoadingSize;
|
|
18
|
+
/** Disable hover visuals + events */
|
|
19
|
+
disableHover?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* If provided, the "complete" state becomes clearable:
|
|
22
|
+
* - on hover/focus: shows an "X"
|
|
23
|
+
* - on click: calls onClear
|
|
24
|
+
*/
|
|
25
|
+
onClear?: () => void;
|
|
26
|
+
/** Optional click event when status === "complete" AND clearable */
|
|
27
|
+
onClick?: (meta: LoadingClickMeta) => void;
|
|
28
|
+
/** Hover change event for ALL statuses (idle/loading/complete) */
|
|
29
|
+
onHoverChange?: (meta: LoadingHoverMeta) => void;
|
|
30
|
+
/** Optional className for layout integration */
|
|
31
|
+
className?: string;
|
|
32
|
+
/** Accessibility labels */
|
|
33
|
+
ariaLabelIdle?: string;
|
|
34
|
+
ariaLabelLoading?: string;
|
|
35
|
+
ariaLabelComplete?: string;
|
|
36
|
+
ariaLabelClear?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare const Loading: ({ status, size, disableHover, onClear, onClick, onHoverChange, className, ariaLabelIdle, ariaLabelLoading, ariaLabelComplete, ariaLabelClear }: LoadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs as X, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useMemo as y } from "react";
|
|
3
|
+
import { Icon as r } from "../icon/Icon.js";
|
|
4
|
+
import '../../styles/Loading.css';const B = "_size_s_ljbi5_30", F = "_size_m_ljbi5_35", P = "_size_l_ljbi5_40", v = "_size_xl_ljbi5_45", S = "_root_ljbi5_50", E = "_idle_ljbi5_72", M = "_spinner_ljbi5_76", q = "_spin_ljbi5_76", A = "_complete_ljbi5_82", D = "_iconCheck_ljbi5_86", G = "_iconX_ljbi5_87", J = "_hovered_ljbi5_108", K = "_clearable_ljbi5_129", O = "_flexHorizontalCenter_ljbi5_146", i = {
|
|
5
|
+
size_s: B,
|
|
6
|
+
size_m: F,
|
|
7
|
+
size_l: P,
|
|
8
|
+
size_xl: v,
|
|
9
|
+
root: S,
|
|
10
|
+
idle: E,
|
|
11
|
+
spinner: M,
|
|
12
|
+
spin: q,
|
|
13
|
+
complete: A,
|
|
14
|
+
iconCheck: D,
|
|
15
|
+
iconX: G,
|
|
16
|
+
hovered: J,
|
|
17
|
+
clearable: K,
|
|
18
|
+
flexHorizontalCenter: O
|
|
19
|
+
}, k = (...e) => e.filter(Boolean).join(" "), Q = {
|
|
20
|
+
s: 10,
|
|
21
|
+
m: 14,
|
|
22
|
+
l: 18,
|
|
23
|
+
xl: 24
|
|
24
|
+
}, V = ({
|
|
25
|
+
status: e,
|
|
26
|
+
size: d = "m",
|
|
27
|
+
disableHover: o = !1,
|
|
28
|
+
onClear: l,
|
|
29
|
+
onClick: _,
|
|
30
|
+
onHoverChange: a,
|
|
31
|
+
className: H,
|
|
32
|
+
ariaLabelIdle: z = "Idle",
|
|
33
|
+
ariaLabelLoading: p = "Loading",
|
|
34
|
+
ariaLabelComplete: f = "Complete",
|
|
35
|
+
ariaLabelClear: h = "Clear"
|
|
36
|
+
}) => {
|
|
37
|
+
const m = e === "complete" && typeof l == "function", c = Q[d], [I, $] = C(!1), [u, s] = C(!1), t = o ? u : I || u, b = y(() => e === "idle" ? z : e === "loading" ? p : m && t ? h : f, [h, f, z, p, m, t, e]), j = k(
|
|
38
|
+
i.root,
|
|
39
|
+
i[`size_${d}`],
|
|
40
|
+
e === "idle" && i.idle,
|
|
41
|
+
e === "loading" && i.spinner,
|
|
42
|
+
e === "complete" && i.complete,
|
|
43
|
+
!o && t && i.hovered,
|
|
44
|
+
H
|
|
45
|
+
), x = (N) => {
|
|
46
|
+
o || ($(N), a == null || a({ status: e, isHovering: N }));
|
|
47
|
+
}, g = o ? {} : {
|
|
48
|
+
onPointerEnter: () => x(!0),
|
|
49
|
+
onPointerLeave: () => x(!1)
|
|
50
|
+
}, w = () => {
|
|
51
|
+
_ == null || _({ intent: "clear", isHovering: t }), l == null || l();
|
|
52
|
+
};
|
|
53
|
+
return m ? /* @__PURE__ */ X(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
type: "button",
|
|
57
|
+
className: k(j, i.clearable),
|
|
58
|
+
onClick: w,
|
|
59
|
+
onFocus: () => s(!0),
|
|
60
|
+
onBlur: () => s(!1),
|
|
61
|
+
"aria-label": b,
|
|
62
|
+
...g,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ n("span", { className: `flexHorizontalCenter ${i.iconCheck}`, "aria-hidden": "true", children: /* @__PURE__ */ n(r, { icon: "Check", weight: "regular", size: c }) }),
|
|
65
|
+
/* @__PURE__ */ n("span", { className: `flexHorizontalCenter ${i.iconX}`, "aria-hidden": "true", children: /* @__PURE__ */ n(r, { icon: "X", weight: "regular", size: c }) })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
) : /* @__PURE__ */ X(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: j,
|
|
72
|
+
role: "img",
|
|
73
|
+
"aria-label": b,
|
|
74
|
+
...g,
|
|
75
|
+
onFocus: () => s(!0),
|
|
76
|
+
onBlur: () => s(!1),
|
|
77
|
+
tabIndex: o ? -1 : 0,
|
|
78
|
+
children: [
|
|
79
|
+
e === "complete" ? /* @__PURE__ */ n("span", { className: `flexHorizontalCenter ${i.iconCheck}`, "aria-hidden": "true", children: /* @__PURE__ */ n(r, { icon: "Check", weight: "regular", size: c }) }) : null,
|
|
80
|
+
/* @__PURE__ */ n("span", { className: `flexHorizontalCenter ${i.iconX}`, "aria-hidden": "true", children: /* @__PURE__ */ n(r, { icon: "X", weight: "regular", size: c }) })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
V as Loading
|
|
87
|
+
};
|
|
@@ -1,122 +1,119 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as c, useRef as
|
|
1
|
+
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useRef as M, useEffect as B } from "react";
|
|
3
3
|
import { Button as $ } from "../button/Button.js";
|
|
4
4
|
import { IconButton as f } from "../icon-button/IconButton.js";
|
|
5
5
|
import { Icon as N } from "../icon/Icon.js";
|
|
6
6
|
import { Modal as W } from "../modal/Modal.js";
|
|
7
7
|
import "../theme/ThemeContext.js";
|
|
8
8
|
import '../../styles/Size.css';import '../../styles/Menu.css';/* empty css */
|
|
9
|
-
const y = "_fullHeight_11eub_15", O = "_fullWidth_11eub_18", j = "_open_11eub_21", D = "_close_11eub_25", q = "_menuButton_11eub_29", A = "_closeIcon_11eub_37", F = "
|
|
9
|
+
const y = "_fullHeight_11eub_15", O = "_fullWidth_11eub_18", j = "_open_11eub_21", D = "_close_11eub_25", q = "_menuButton_11eub_29", A = "_closeIcon_11eub_37", F = "_textEllipsis_11eub_47", G = "_pointer_11eub_52", J = "_fullImg_11eub_55", K = "_menuParams_11eub_61", Q = "_line_11eub_67", T = "_borderRadiusM_11eub_74", U = "_menuItem_11eub_78", X = "_longLogo_11eub_87", Y = "_flexVerticalBetweenStart_11eub_92", Z = "_flexHorizontalCenter_11eub_106", ee = "_flexVerticalBetweenCenter_11eub_121", e = {
|
|
10
10
|
fullHeight: y,
|
|
11
11
|
fullWidth: O,
|
|
12
12
|
open: j,
|
|
13
13
|
close: D,
|
|
14
14
|
menuButton: q,
|
|
15
15
|
closeIcon: A,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const [t, b] = c(w ?? !1), [x, g] = c(u ?? (s.length > 0 ? s[0].id : null)), H = v(null), [z, _] = c(!1), [I, C] = c(!1), [V, L] = c(null), [k, E] = c({}), R = v(null);
|
|
32
|
-
M(() => {
|
|
33
|
-
u != null && g(u);
|
|
16
|
+
textEllipsis: F,
|
|
17
|
+
pointer: G,
|
|
18
|
+
fullImg: J,
|
|
19
|
+
menuParams: K,
|
|
20
|
+
line: Q,
|
|
21
|
+
borderRadiusM: T,
|
|
22
|
+
menuItem: U,
|
|
23
|
+
longLogo: X,
|
|
24
|
+
flexVerticalBetweenStart: Y,
|
|
25
|
+
flexHorizontalCenter: Z,
|
|
26
|
+
flexVerticalBetweenCenter: ee
|
|
27
|
+
}, ae = ({ menuItems: s = [], menuParams: a = [], shortLogo: m, logo: h, isOpen: p, defaultOpen: I = !1, selectedId: u }) => {
|
|
28
|
+
const [t, g] = c(I ?? !1), [b, x] = c(u ?? (s.length > 0 ? s[0].id : null)), w = M(null), [H, _] = c(!1), [L, C] = c(!1), [k, E] = c(null), [z, R] = c({}), V = M(null);
|
|
29
|
+
B(() => {
|
|
30
|
+
u != null && x(u);
|
|
34
31
|
}, [u]);
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
|
|
32
|
+
const v = (o, i) => {
|
|
33
|
+
if (o.stopPropagation(), x(i), s) {
|
|
34
|
+
const l = s.find((r) => r.id === i);
|
|
35
|
+
l == null || l.onClick();
|
|
39
36
|
}
|
|
40
37
|
}, S = () => {
|
|
41
|
-
|
|
42
|
-
}, P = (
|
|
38
|
+
g(!t), _(!1);
|
|
39
|
+
}, P = (o) => {
|
|
43
40
|
var i;
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
41
|
+
if (a) {
|
|
42
|
+
const l = a.find((r) => r.id === o);
|
|
43
|
+
if (!l) return;
|
|
44
|
+
if (l.content) {
|
|
45
|
+
const r = t ? "200px" : "40px";
|
|
46
|
+
E(l.content), R({ ...l.position, left: r }), C(!0);
|
|
50
47
|
} else
|
|
51
|
-
(i =
|
|
48
|
+
(i = l.onClick) == null || i.call(l);
|
|
52
49
|
}
|
|
53
50
|
};
|
|
54
|
-
return
|
|
51
|
+
return B(() => {
|
|
55
52
|
p && p(t);
|
|
56
|
-
}, [t]), /* @__PURE__ */
|
|
53
|
+
}, [t]), /* @__PURE__ */ n("nav", { ref: w, children: /* @__PURE__ */ d("div", { className: `${e.flexVerticalBetweenStart} ${e.fullHeight} ${t ? e.open : e.close}`, children: [
|
|
57
54
|
/* @__PURE__ */ d("div", { className: e.fullWidth, children: [
|
|
58
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ n(
|
|
59
56
|
"div",
|
|
60
57
|
{
|
|
61
58
|
className: `${e.flexHorizontalCenter} ${e.pointer} ${e.textEllipsis}`,
|
|
62
59
|
onClick: () => S(),
|
|
63
60
|
children: t ? /* @__PURE__ */ d("div", { className: e.fullImg, children: [
|
|
64
|
-
h && /* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
] }) : /* @__PURE__ */
|
|
61
|
+
h && /* @__PURE__ */ n("img", { className: e.longLogo, src: h, alt: "Logo situaction" }),
|
|
62
|
+
/* @__PURE__ */ n(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ n(N, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
|
|
63
|
+
] }) : /* @__PURE__ */ n(
|
|
67
64
|
"div",
|
|
68
65
|
{
|
|
69
66
|
className: e.closeIcon,
|
|
70
67
|
onMouseEnter: () => _(!0),
|
|
71
68
|
onMouseLeave: () => _(!1),
|
|
72
|
-
onClick: () =>
|
|
73
|
-
children:
|
|
69
|
+
onClick: () => g(!t),
|
|
70
|
+
children: H || !m ? /* @__PURE__ */ n(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ n(N, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ n("img", { src: m, alt: "Logo situaction" })
|
|
74
71
|
}
|
|
75
72
|
)
|
|
76
73
|
}
|
|
77
74
|
),
|
|
78
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ n("div", { className: e.menuItem, children: s && s.map((o) => t ? /* @__PURE__ */ n("div", { className: `${e.textEllipsis} ${e.menuButton}`, children: /* @__PURE__ */ n(
|
|
79
76
|
$,
|
|
80
77
|
{
|
|
81
|
-
mode:
|
|
82
|
-
label:
|
|
83
|
-
onClick: (i) =>
|
|
84
|
-
childrenLeft:
|
|
78
|
+
mode: b === o.id ? "secondary" : "ghost",
|
|
79
|
+
label: o.label,
|
|
80
|
+
onClick: (i) => v(i, o.id),
|
|
81
|
+
childrenLeft: o.icon
|
|
85
82
|
}
|
|
86
|
-
) }, `button-${
|
|
83
|
+
) }, `button-${o.id}`) : /* @__PURE__ */ n("div", { className: e.textEllipsis, children: /* @__PURE__ */ n(
|
|
87
84
|
f,
|
|
88
85
|
{
|
|
89
|
-
mode:
|
|
90
|
-
children:
|
|
91
|
-
onClick: (i) =>
|
|
86
|
+
mode: b === o.id ? "secondary" : "ghost",
|
|
87
|
+
children: o.icon,
|
|
88
|
+
onClick: (i) => v(i, o.id)
|
|
92
89
|
}
|
|
93
|
-
) }, `icon-${
|
|
94
|
-
/* @__PURE__ */
|
|
90
|
+
) }, `icon-${o.id}`)) }),
|
|
91
|
+
/* @__PURE__ */ n("div", { className: e.line })
|
|
95
92
|
] }),
|
|
96
93
|
/* @__PURE__ */ d("div", { className: `${e.menuParams} ${e.flexVerticalBetweenCenter}`, children: [
|
|
97
|
-
|
|
94
|
+
a && a.map((o) => /* @__PURE__ */ n(
|
|
98
95
|
"div",
|
|
99
96
|
{
|
|
100
97
|
className: `${e.fullWidth} ${e.textEllipsis}`,
|
|
101
|
-
onClick: () => P(
|
|
102
|
-
children: t ? /* @__PURE__ */
|
|
98
|
+
onClick: () => P(o.id),
|
|
99
|
+
children: t ? /* @__PURE__ */ n("div", { className: e.menuButton, children: /* @__PURE__ */ n($, { mode: "ghost", label: o.label, childrenLeft: o.icon }, o.id) }) : /* @__PURE__ */ n(f, { mode: "ghost", children: o.icon })
|
|
103
100
|
},
|
|
104
|
-
`param-icon-${
|
|
101
|
+
`param-icon-${o.id}`
|
|
105
102
|
)),
|
|
106
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ n(
|
|
107
104
|
W,
|
|
108
105
|
{
|
|
109
|
-
ref:
|
|
106
|
+
ref: V,
|
|
110
107
|
className: e.borderRadiusM,
|
|
111
|
-
open:
|
|
108
|
+
open: L,
|
|
112
109
|
onClose: () => C(!1),
|
|
113
|
-
position:
|
|
114
|
-
children:
|
|
110
|
+
position: z,
|
|
111
|
+
children: k
|
|
115
112
|
}
|
|
116
113
|
)
|
|
117
114
|
] })
|
|
118
115
|
] }) });
|
|
119
116
|
};
|
|
120
117
|
export {
|
|
121
|
-
|
|
118
|
+
ae as Menu
|
|
122
119
|
};
|
|
@@ -1,46 +1,45 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as _, useRef as
|
|
3
|
-
import '../../../styles/SidePanel.css';const
|
|
4
|
-
panel:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
panelRight: B,
|
|
2
|
+
import { useState as _, useRef as L, useEffect as f } from "react";
|
|
3
|
+
import '../../../styles/SidePanel.css';const P = "_panel_lk5yy_1", x = "_box_lk5yy_18", v = "_panelLeft_lk5yy_29", b = "_panelRight_lk5yy_36", C = "_panelOpenedLeft_lk5yy_43", H = "_panelOpenedRight_lk5yy_47", S = "_panelHidden_lk5yy_51", E = "_displayPanel_lk5yy_55", N = "_hidePanel_lk5yy_59", e = {
|
|
4
|
+
panel: P,
|
|
5
|
+
box: x,
|
|
6
|
+
panelLeft: v,
|
|
7
|
+
panelRight: b,
|
|
9
8
|
panelOpenedLeft: C,
|
|
10
9
|
panelOpenedRight: H,
|
|
11
10
|
panelHidden: S,
|
|
12
11
|
displayPanel: E,
|
|
13
12
|
hidePanel: N
|
|
14
13
|
}, $ = ({
|
|
15
|
-
children:
|
|
14
|
+
children: y,
|
|
16
15
|
width: a,
|
|
17
|
-
left:
|
|
16
|
+
left: d = !0,
|
|
18
17
|
opened: n = !1,
|
|
19
18
|
onToggle: t
|
|
20
19
|
}) => {
|
|
21
|
-
const [l, s] = _(n), [u, i] = _(n), p =
|
|
20
|
+
const [l, s] = _(n), [u, i] = _(n), p = L(null), m = {
|
|
22
21
|
"--dynamic-left": `-${a}`,
|
|
23
22
|
"--dynamic-right": `-${a}`,
|
|
24
23
|
width: a
|
|
25
|
-
}, h =
|
|
24
|
+
}, h = d ? e.panelLeft : e.panelRight, O = d ? e.panelOpenedLeft : e.panelOpenedRight, R = [
|
|
26
25
|
e.panel,
|
|
27
26
|
h,
|
|
28
27
|
!l && e.panelHidden,
|
|
29
|
-
l &&
|
|
28
|
+
l && O,
|
|
30
29
|
u ? e.displayPanel : e.hidePanel
|
|
31
30
|
].filter(Boolean).join(" ");
|
|
32
|
-
return
|
|
31
|
+
return f(() => {
|
|
33
32
|
n ? (i(!0), setTimeout(() => s(!0), 10)) : (s(!1), setTimeout(() => i(!1), 300));
|
|
34
|
-
}, [n]),
|
|
35
|
-
const
|
|
36
|
-
const c =
|
|
33
|
+
}, [n]), f(() => {
|
|
34
|
+
const o = (k) => {
|
|
35
|
+
const c = k.target;
|
|
37
36
|
c.closest("[data-ignore-outside-click]") || p.current && !p.current.contains(c) && (s(!1), t == null || t(!1), setTimeout(() => i(!1), 300));
|
|
38
37
|
};
|
|
39
38
|
if (l)
|
|
40
|
-
return document.addEventListener("mousedown",
|
|
41
|
-
document.removeEventListener("mousedown",
|
|
39
|
+
return document.addEventListener("mousedown", o), () => {
|
|
40
|
+
document.removeEventListener("mousedown", o);
|
|
42
41
|
};
|
|
43
|
-
}, [l, t]), /* @__PURE__ */ r("div", { style: m, className:
|
|
42
|
+
}, [l, t]), /* @__PURE__ */ r("div", { style: m, className: R, children: /* @__PURE__ */ r("div", { ref: p, className: e.box, children: y }) });
|
|
44
43
|
};
|
|
45
44
|
export {
|
|
46
45
|
$ as SidePanel
|