@situaction/traq-ui-ste 1.1.29 → 1.1.31
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/components/button/Button.d.ts +2 -2
- package/dist/components/button/Button.js +41 -38
- package/dist/components/editable-field/EditableField.js +3 -3
- package/dist/components/editable-select/EditableSelect.d.ts +14 -0
- package/dist/components/editable-select/EditableSelect.js +26 -0
- package/dist/components/icon-button/IconButton.d.ts +2 -2
- package/dist/components/icon-button/IconButton.js +39 -33
- package/dist/components/list/list-controls/ListControls.js +2 -2
- package/dist/components/list/nested-list/NestedList.js +2 -2
- package/dist/components/list/nested-list/item/NestedListItem.js +13 -12
- package/dist/components/menu/Menu.js +3 -4
- package/dist/components/modal/Modal.d.ts +5 -2
- package/dist/components/modal/Modal.js +50 -20
- package/dist/components/panel/side-panel-header/SidePanelHeader.js +50 -34
- package/dist/components/select/Select.d.ts +7 -3
- package/dist/components/select/Select.js +151 -59
- package/dist/components/select-filter-input-tags/SelectFilterInputTags.js +9 -8
- package/dist/components/select-multi-items/SelectMultiItems.js +2 -2
- package/dist/components/switch/Switch.js +2 -2
- package/dist/components/tabs/Tabs.d.ts +3 -0
- package/dist/components/tabs/Tabs.js +74 -58
- package/dist/main.d.ts +1 -0
- package/dist/main.js +60 -59
- package/dist/styles/Button.css +1 -1
- package/dist/styles/EditableField.css +1 -1
- package/dist/styles/EditableSelect.css +1 -0
- package/package.json +1 -1
- package/dist/styles/index.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes,
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode, MouseEvent } from 'react';
|
|
2
2
|
import { Size } from '../interface';
|
|
3
3
|
|
|
4
4
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -22,4 +22,4 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
22
22
|
/**
|
|
23
23
|
* Primary UI component for user interaction
|
|
24
24
|
*/
|
|
25
|
-
export declare const Button:
|
|
25
|
+
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
button:
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import '../../styles/Button.css';const v = "_button_mzv5s_30", x = "_flexHorizontalCenter_mzv5s_191", t = {
|
|
4
|
+
button: v,
|
|
5
5
|
"button-primary": "_button-primary_mzv5s_54",
|
|
6
6
|
"button-secondary": "_button-secondary_mzv5s_68",
|
|
7
7
|
"button-tertiary": "_button-tertiary_mzv5s_84",
|
|
@@ -19,39 +19,42 @@ const i = "_button_mzv5s_30", p = "_flexHorizontalCenter_mzv5s_191", t = {
|
|
|
19
19
|
"button-gap-l": "_button-gap-l_mzv5s_184",
|
|
20
20
|
"button-gap-m": "_button-gap-m_mzv5s_178",
|
|
21
21
|
"button-gap-s": "_button-gap-s_mzv5s_187",
|
|
22
|
-
flexHorizontalCenter:
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
22
|
+
flexHorizontalCenter: x
|
|
23
|
+
}, f = p(
|
|
24
|
+
({
|
|
25
|
+
mode: n = "primary",
|
|
26
|
+
size: e = "m",
|
|
27
|
+
label: u,
|
|
28
|
+
error: b,
|
|
29
|
+
selected: r,
|
|
30
|
+
childrenLeft: s,
|
|
31
|
+
childrenRight: _,
|
|
32
|
+
...m
|
|
33
|
+
}, a) => {
|
|
34
|
+
const z = () => b ? "error" : n, l = [
|
|
35
|
+
t.button,
|
|
36
|
+
t[`button-${z()}`],
|
|
37
|
+
t[`button-size-${e}`],
|
|
38
|
+
t[`button-gap-${e}`],
|
|
39
|
+
r && n === "text" && t["button-text-selected"],
|
|
40
|
+
t.flexHorizontalCenter
|
|
41
|
+
].filter(Boolean).join(" ");
|
|
42
|
+
return /* @__PURE__ */ i(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
ref: a,
|
|
46
|
+
type: "button",
|
|
47
|
+
className: l,
|
|
48
|
+
...m,
|
|
49
|
+
children: [
|
|
50
|
+
s && /* @__PURE__ */ o("span", { className: t.flexHorizontalCenter, children: s }),
|
|
51
|
+
/* @__PURE__ */ o("span", { children: u }),
|
|
52
|
+
_ && /* @__PURE__ */ o("span", { className: t.flexHorizontalCenter, children: _ })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
55
58
|
export {
|
|
56
|
-
|
|
59
|
+
f as Button
|
|
57
60
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { InputLabel as c } from "../input-label/InputLabel.js";
|
|
3
|
-
import '../../styles/EditableField.css';const m = "
|
|
3
|
+
import '../../styles/EditableField.css';const m = "_editableField_12vkl_30", o = "_statiqueField_12vkl_40", l = {
|
|
4
4
|
editableField: m,
|
|
5
5
|
statiqueField: o
|
|
6
|
-
},
|
|
6
|
+
}, p = ({
|
|
7
7
|
label: i,
|
|
8
8
|
value: e,
|
|
9
9
|
placeholder: d,
|
|
@@ -26,5 +26,5 @@ import '../../styles/EditableField.css';const m = "_editableField_1lhi9_30", o =
|
|
|
26
26
|
/* @__PURE__ */ t("div", { className: `${l.statiqueField} textSmall`, children: (e == null ? void 0 : e.trim()) || " " })
|
|
27
27
|
] });
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
p as EditableField
|
|
30
30
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SelectItem } from '../select/Select';
|
|
2
|
+
|
|
3
|
+
interface EditableSelectProps {
|
|
4
|
+
label: string;
|
|
5
|
+
listItems: SelectItem[];
|
|
6
|
+
value?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
edit: boolean;
|
|
9
|
+
onSelect?: (selected: SelectItem) => void;
|
|
10
|
+
selected?: SelectItem;
|
|
11
|
+
autoCloseCondition: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const EditableSelect: ({ label, listItems, value, placeholder, edit, onSelect, selected, autoCloseCondition }: EditableSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as i, Fragment as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Select as S } from "../select/Select.js";
|
|
3
|
+
import '../../styles/EditableSelect.css';const x = "_editableSelect_6vsm4_30", p = "_statiqueField_6vsm4_40", l = {
|
|
4
|
+
editableSelect: x,
|
|
5
|
+
statiqueField: p
|
|
6
|
+
}, F = ({ label: s, listItems: a, value: t, placeholder: c, edit: d, onSelect: m, selected: r, autoCloseCondition: n }) => d ? /* @__PURE__ */ i(o, { children: [
|
|
7
|
+
/* @__PURE__ */ e("span", { className: "textSmall", children: s }),
|
|
8
|
+
/* @__PURE__ */ e(
|
|
9
|
+
S,
|
|
10
|
+
{
|
|
11
|
+
size: "s",
|
|
12
|
+
listItem: a,
|
|
13
|
+
placeholder: c,
|
|
14
|
+
modeDisplay: "text",
|
|
15
|
+
onSelect: m,
|
|
16
|
+
selected: r,
|
|
17
|
+
autoCloseCondition: n
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
] }) : /* @__PURE__ */ i("div", { className: l.editableSelect, children: [
|
|
21
|
+
/* @__PURE__ */ e("span", { className: "textSmall", children: s }),
|
|
22
|
+
/* @__PURE__ */ e("div", { className: `${l.statiqueField} textSmall`, children: (t == null ? void 0 : t.trim()) || "-" })
|
|
23
|
+
] });
|
|
24
|
+
export {
|
|
25
|
+
F as EditableSelect
|
|
26
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes,
|
|
1
|
+
import { ButtonHTMLAttributes, MouseEvent, ReactElement } from 'react';
|
|
2
2
|
import { Size } from '../interface';
|
|
3
3
|
|
|
4
4
|
export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -24,4 +24,4 @@ export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
24
24
|
* It supports customization such as size, style mode, and error state.
|
|
25
25
|
* The button can also be disabled or selected based on props.
|
|
26
26
|
*/
|
|
27
|
-
export declare const IconButton:
|
|
27
|
+
export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as k } from "react";
|
|
3
|
+
import '../../styles/IconButton.css';const z = "_button_kvvl4_30", m = "_flexHorizontalCenter_kvvl4_184", t = {
|
|
4
|
+
button: z,
|
|
4
5
|
"button-round": "_button-round_kvvl4_58",
|
|
5
6
|
"button-primary": "_button-primary_kvvl4_61",
|
|
6
7
|
"button-secondary": "_button-secondary_kvvl4_75",
|
|
@@ -14,35 +15,40 @@ import '../../styles/IconButton.css';const c = "_button_kvvl4_30", a = "_flexHor
|
|
|
14
15
|
"button-size-m": "_button-size-m_kvvl4_167",
|
|
15
16
|
"button-size-s": "_button-size-s_kvvl4_172",
|
|
16
17
|
"button-size-menu": "_button-size-menu_kvvl4_177",
|
|
17
|
-
flexHorizontalCenter:
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
18
|
+
flexHorizontalCenter: m
|
|
19
|
+
}, d = k(
|
|
20
|
+
({
|
|
21
|
+
mode: o = "primary",
|
|
22
|
+
size: n = "m",
|
|
23
|
+
error: e,
|
|
24
|
+
selected: _,
|
|
25
|
+
round: u,
|
|
26
|
+
disabled: r,
|
|
27
|
+
children: b,
|
|
28
|
+
onClick: l,
|
|
29
|
+
...s
|
|
30
|
+
}, i) => {
|
|
31
|
+
const v = () => e ? "error" : o, c = [
|
|
32
|
+
t.button,
|
|
33
|
+
t[`button-${v()}`],
|
|
34
|
+
u && t["button-round"],
|
|
35
|
+
t[`button-size-${n}`],
|
|
36
|
+
_ && o === "icon" && t["button-icon-selected"],
|
|
37
|
+
t.flexHorizontalCenter
|
|
38
|
+
].filter(Boolean).join(" ");
|
|
39
|
+
return /* @__PURE__ */ a(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
ref: i,
|
|
43
|
+
className: c,
|
|
44
|
+
onClick: l,
|
|
45
|
+
disabled: r,
|
|
46
|
+
...s,
|
|
47
|
+
children: b
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
46
52
|
export {
|
|
47
|
-
|
|
53
|
+
d as IconButton
|
|
48
54
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Button as p } from "../../button/Button.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import
|
|
4
|
+
import "../../icon-button/IconButton.js";
|
|
5
5
|
import { Checkbox as _ } from "../../checkbox/Checkbox.js";
|
|
6
6
|
import { Icon as a } from "../../icon/Icon.js";
|
|
7
7
|
import "../../modal/Modal.js";
|
|
8
8
|
import "../../theme/ThemeContext.js";
|
|
9
|
-
|
|
9
|
+
import '../../../styles/Size.css';import '../../../styles/ListControls.css';/* empty css */
|
|
10
10
|
const u = "_list_1nihg_6", f = "_children_1nihg_29", g = "_selected_1nihg_43", k = "_reset_1nihg_47", i = {
|
|
11
11
|
list: u,
|
|
12
12
|
children: f,
|
|
@@ -2,11 +2,11 @@ import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { NestedListItem as c } from "./item/NestedListItem.js";
|
|
3
3
|
import { Button as p } from "../../button/Button.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import
|
|
5
|
+
import "../../icon-button/IconButton.js";
|
|
6
6
|
import { Icon as a } from "../../icon/Icon.js";
|
|
7
7
|
import "../../modal/Modal.js";
|
|
8
8
|
import "../../theme/ThemeContext.js";
|
|
9
|
-
|
|
9
|
+
import '../../../styles/Size.css';import '../../../styles/NestedList.css';/* empty css */
|
|
10
10
|
const h = "_nestedlist_7rnd3_6", _ = "_reset_7rnd3_18", r = {
|
|
11
11
|
nestedlist: h,
|
|
12
12
|
reset: _
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, Fragment as w, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as g, useRef as u, useLayoutEffect as z } from "react";
|
|
3
|
-
import
|
|
3
|
+
import "../../../button/Button.js";
|
|
4
|
+
import "../../../icon-button/IconButton.js";
|
|
4
5
|
import { TagCounter as B } from "../../../tag-counter/TagCounter.js";
|
|
5
6
|
import { Icon as l } from "../../../icon/Icon.js";
|
|
6
7
|
import { Modal as L } from "../../../modal/Modal.js";
|
|
7
8
|
import "../../../theme/ThemeContext.js";
|
|
8
|
-
|
|
9
|
+
import '../../../../styles/Size.css';import '../../../../styles/NestedListItem.css';/* empty css */
|
|
9
10
|
const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28", v = "_modal_2r2ga_34", s = {
|
|
10
11
|
nestedlist: S,
|
|
11
12
|
items: $,
|
|
12
13
|
textSmall: j,
|
|
13
14
|
modal: v
|
|
14
|
-
},
|
|
15
|
+
}, W = ({
|
|
15
16
|
icon: a,
|
|
16
17
|
title: h,
|
|
17
18
|
numberSelect: i,
|
|
@@ -19,13 +20,13 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
|
|
|
19
20
|
onClick: m,
|
|
20
21
|
align: e = "right"
|
|
21
22
|
}) => {
|
|
22
|
-
const [c, d] = g(!1),
|
|
23
|
+
const [c, d] = g(!1), r = u(null), o = u(null), [x, C] = g({
|
|
23
24
|
top: "0px"
|
|
24
25
|
});
|
|
25
26
|
z(() => {
|
|
26
27
|
var p;
|
|
27
|
-
if (
|
|
28
|
-
const N = o.current.getBoundingClientRect(), f =
|
|
28
|
+
if (r.current && o.current) {
|
|
29
|
+
const N = o.current.getBoundingClientRect(), f = r.current.getBoundingClientRect().width, M = ((p = o.current.parentElement) == null ? void 0 : p.getBoundingClientRect().top) || 0;
|
|
29
30
|
C({
|
|
30
31
|
top: `${N.top - M}px`,
|
|
31
32
|
...e === "right" ? { right: `-${f + 6}px` } : { left: `-${f + 6}px` }
|
|
@@ -35,8 +36,8 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
|
|
|
35
36
|
const R = () => {
|
|
36
37
|
d(!0), m && m();
|
|
37
38
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ n(w, { children: [
|
|
40
|
+
/* @__PURE__ */ n(
|
|
40
41
|
"div",
|
|
41
42
|
{
|
|
42
43
|
ref: o,
|
|
@@ -44,7 +45,7 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
|
|
|
44
45
|
onClick: R,
|
|
45
46
|
children: [
|
|
46
47
|
e === "left" && /* @__PURE__ */ t(l, { icon: "CaretLeft", size: 14, weight: "regular" }),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ n("div", { className: s.items, children: [
|
|
48
49
|
a && /* @__PURE__ */ t(l, { icon: a }),
|
|
49
50
|
/* @__PURE__ */ t("span", { className: s.textSmall, children: h }),
|
|
50
51
|
i && i > 0 && /* @__PURE__ */ t(B, { size: "s", label: i ?? 0 })
|
|
@@ -56,7 +57,7 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
|
|
|
56
57
|
/* @__PURE__ */ t(
|
|
57
58
|
L,
|
|
58
59
|
{
|
|
59
|
-
ref:
|
|
60
|
+
ref: r,
|
|
60
61
|
className: s.modal,
|
|
61
62
|
open: c,
|
|
62
63
|
onClose: () => d(!1),
|
|
@@ -67,5 +68,5 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
|
|
|
67
68
|
] });
|
|
68
69
|
};
|
|
69
70
|
export {
|
|
70
|
-
|
|
71
|
+
W as NestedListItem
|
|
71
72
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as l, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import { useState as c, useRef as M, useEffect as $ } from "react";
|
|
3
3
|
import { Button as b } from "../button/Button.js";
|
|
4
|
-
import '../../styles/Size.css';import '../../styles/index.css';import '../../styles/Menu.css';/* empty css */
|
|
5
4
|
import { IconButton as u } from "../icon-button/IconButton.js";
|
|
6
5
|
import { Icon as w } from "../icon/Icon.js";
|
|
7
6
|
import { Modal as W } from "../modal/Modal.js";
|
|
8
7
|
import "../theme/ThemeContext.js";
|
|
9
|
-
|
|
8
|
+
import '../../styles/Size.css';import '../../styles/Menu.css';/* empty css */
|
|
10
9
|
const y = "_fullHeight_o2xi7_15", O = "_fullWidth_o2xi7_18", j = "_open_o2xi7_21", D = "_close_o2xi7_25", q = "_menuButton_o2xi7_29", A = "_closeIcon_o2xi7_37", F = "_label_o2xi7_42", G = "_textEllipsis_o2xi7_46", J = "_pointer_o2xi7_51", K = "_fullImg_o2xi7_54", Q = "_menuParams_o2xi7_60", T = "_line_o2xi7_66", U = "_borderRadiusM_o2xi7_73", X = "_menuItem_o2xi7_77", Y = "_flexVerticalBetweenStart_o2xi7_86", Z = "_flexHorizontalBetween_o2xi7_93", ee = "_flexVertical_o2xi7_86", oe = "_flexVerticalBetweenCenter_o2xi7_107", e = {
|
|
11
10
|
fullHeight: y,
|
|
12
11
|
fullWidth: O,
|
|
@@ -26,7 +25,7 @@ const y = "_fullHeight_o2xi7_15", O = "_fullWidth_o2xi7_18", j = "_open_o2xi7_21
|
|
|
26
25
|
flexHorizontalBetween: Z,
|
|
27
26
|
flexVertical: ee,
|
|
28
27
|
flexVerticalBetweenCenter: oe
|
|
29
|
-
},
|
|
28
|
+
}, de = ({ menuItems: s = [], menuParams: r = [], shortLogo: x, logo: m, isOpen: h, defaultOpen: N = !1, selectedId: d }) => {
|
|
30
29
|
const [t, p] = c(N ?? !1), [g, B] = c(d ?? (s.length > 0 ? s[0].id : null)), I = M(null), [V, _] = c(!1), [H, C] = c(!1), [k, E] = c(null), [z, R] = c({}), L = M(null);
|
|
31
30
|
$(() => {
|
|
32
31
|
d != null && B(d);
|
|
@@ -117,5 +116,5 @@ const y = "_fullHeight_o2xi7_15", O = "_fullWidth_o2xi7_18", j = "_open_o2xi7_21
|
|
|
117
116
|
] }) });
|
|
118
117
|
};
|
|
119
118
|
export {
|
|
120
|
-
|
|
119
|
+
de as Menu
|
|
121
120
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface ModalProps {
|
|
4
4
|
/** Determines whether the modal is open or closed.
|
|
@@ -23,10 +23,13 @@ export interface ModalProps {
|
|
|
23
23
|
className?: string;
|
|
24
24
|
/** Option to disable the overlay and the blocking of events outside the modal */
|
|
25
25
|
disableOverlay?: boolean;
|
|
26
|
+
/** Condition to close the modal */
|
|
27
|
+
autoCloseCondition?: boolean;
|
|
28
|
+
anchorRef?: RefObject<HTMLElement>;
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
28
31
|
* Modal component that renders content in a floating layer above the main UI.
|
|
29
32
|
* It supports custom positioning and closes when clicking outside of its content area.
|
|
30
33
|
* The component uses a ref to detect clicks outside the modal.
|
|
31
34
|
*/
|
|
32
|
-
export declare const Modal:
|
|
35
|
+
export declare const Modal: import('react').ForwardRefExoticComponent<ModalProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,24 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import '../../styles/Modal.css';const
|
|
4
|
-
overlay:
|
|
5
|
-
modalContent:
|
|
6
|
-
},
|
|
7
|
-
({ open:
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as N, Fragment as S, jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as W, useRef as k, useState as w, useEffect as g, useLayoutEffect as n } from "react";
|
|
3
|
+
import '../../styles/Modal.css';const q = "_overlay_lv2n7_2", A = "_modalContent_lv2n7_12", y = {
|
|
4
|
+
overlay: q,
|
|
5
|
+
modalContent: A
|
|
6
|
+
}, D = W(
|
|
7
|
+
({ open: l, onClose: a, children: x, position: e, className: _, disableOverlay: b = !1, autoCloseCondition: m, anchorRef: d }, E) => {
|
|
8
|
+
const $ = k(null), c = E || $, [r, h] = w(), [L, j] = w();
|
|
9
|
+
return g(() => {
|
|
10
|
+
!m && m !== void 0 && l && a();
|
|
11
|
+
}, [m, l, a]), n(() => {
|
|
12
|
+
if (d != null && d.current && l && !e) {
|
|
13
|
+
const t = d.current.getBoundingClientRect();
|
|
14
|
+
h({
|
|
15
|
+
top: `${t.bottom + window.scrollY}px`,
|
|
16
|
+
left: `${t.left + window.scrollX}px`
|
|
17
|
+
}), j(`${t.width}px`);
|
|
12
18
|
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
}, [d, l, e]), g(() => {
|
|
20
|
+
const t = (u) => {
|
|
21
|
+
const f = c.current;
|
|
22
|
+
f && !f.contains(u.target) && l && ![...document.querySelectorAll(".dialog")].some(
|
|
23
|
+
(M) => M.contains(u.target)
|
|
24
|
+
) && a();
|
|
25
|
+
};
|
|
26
|
+
return document.addEventListener("mousedown", t), () => {
|
|
27
|
+
document.removeEventListener("mousedown", t);
|
|
28
|
+
};
|
|
29
|
+
}, [a, l, c]), l ? /* @__PURE__ */ N(S, { children: [
|
|
30
|
+
!b && /* @__PURE__ */ v("div", { className: y.overlay }),
|
|
31
|
+
/* @__PURE__ */ v(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
ref: c,
|
|
35
|
+
className: `${y.modalContent} ${_ || ""}`,
|
|
36
|
+
onMouseDown: (t) => t.stopPropagation(),
|
|
37
|
+
style: {
|
|
38
|
+
position: "absolute",
|
|
39
|
+
top: (e == null ? void 0 : e.top) ?? (r == null ? void 0 : r.top) ?? "50%",
|
|
40
|
+
left: (e == null ? void 0 : e.left) ?? (r == null ? void 0 : r.left) ?? "50%",
|
|
41
|
+
right: e == null ? void 0 : e.right,
|
|
42
|
+
bottom: e == null ? void 0 : e.bottom,
|
|
43
|
+
width: (e == null ? void 0 : e.width) ?? L ?? "auto",
|
|
44
|
+
transform: !(e != null && e.top) && !(e != null && e.left) && !r ? "translate(-50%, -50%)" : void 0
|
|
45
|
+
},
|
|
46
|
+
children: x
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] }) : null;
|
|
50
|
+
}
|
|
21
51
|
);
|
|
22
52
|
export {
|
|
23
|
-
|
|
53
|
+
D as Modal
|
|
24
54
|
};
|
|
@@ -1,60 +1,76 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as C, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "../../button/Button.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { IconButton as
|
|
5
|
-
import { Icon as
|
|
4
|
+
import { IconButton as i } from "../../icon-button/IconButton.js";
|
|
5
|
+
import { Icon as t } from "../../icon/Icon.js";
|
|
6
6
|
import "../../modal/Modal.js";
|
|
7
7
|
import "../../theme/ThemeContext.js";
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
sidePanelHeader:
|
|
11
|
-
buttonArrow:
|
|
12
|
-
title:
|
|
13
|
-
},
|
|
14
|
-
title:
|
|
15
|
-
icon:
|
|
16
|
-
onClickBack:
|
|
17
|
-
onClickForward:
|
|
18
|
-
onClickClose:
|
|
19
|
-
disabledBack:
|
|
20
|
-
disabledForward:
|
|
21
|
-
}) => /* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
8
|
+
import '../../../styles/Size.css';import '../../../styles/SidePanelHeader.css';/* empty css */
|
|
9
|
+
const c = "_sidePanelHeader_72g7b_6", m = "_buttonArrow_72g7b_13", h = "_title_72g7b_20", r = {
|
|
10
|
+
sidePanelHeader: c,
|
|
11
|
+
buttonArrow: m,
|
|
12
|
+
title: h
|
|
13
|
+
}, v = ({
|
|
14
|
+
title: s,
|
|
15
|
+
icon: o,
|
|
16
|
+
onClickBack: L,
|
|
17
|
+
onClickForward: l,
|
|
18
|
+
onClickClose: n,
|
|
19
|
+
disabledBack: d = !1,
|
|
20
|
+
disabledForward: a = !1
|
|
21
|
+
}) => /* @__PURE__ */ C("div", { className: r.sidePanelHeader, children: [
|
|
22
|
+
/* @__PURE__ */ C("div", { className: r.buttonArrow, children: [
|
|
23
23
|
/* @__PURE__ */ e(
|
|
24
|
-
|
|
24
|
+
i,
|
|
25
25
|
{
|
|
26
|
-
disabled:
|
|
26
|
+
disabled: d,
|
|
27
27
|
mode: "tertiary",
|
|
28
28
|
size: "s",
|
|
29
|
-
onClick:
|
|
30
|
-
children: /* @__PURE__ */ e(
|
|
29
|
+
onClick: L,
|
|
30
|
+
children: /* @__PURE__ */ e(t, { icon: "CaretLeft", size: 18 })
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
33
|
/* @__PURE__ */ e(
|
|
34
|
-
|
|
34
|
+
i,
|
|
35
35
|
{
|
|
36
|
-
disabled:
|
|
36
|
+
disabled: a,
|
|
37
37
|
mode: "tertiary",
|
|
38
38
|
size: "s",
|
|
39
|
-
onClick:
|
|
40
|
-
children: /* @__PURE__ */ e(
|
|
39
|
+
onClick: l,
|
|
40
|
+
children: /* @__PURE__ */ e(t, { icon: "CaretRight", size: 18 })
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
] }),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */ e("h3", { children:
|
|
44
|
+
/* @__PURE__ */ C("div", { className: r.title, children: [
|
|
45
|
+
o && /* @__PURE__ */ e(t, { icon: o, size: 22 }),
|
|
46
|
+
/* @__PURE__ */ e("h3", { children: s })
|
|
47
47
|
] }),
|
|
48
48
|
/* @__PURE__ */ e(
|
|
49
|
-
|
|
49
|
+
i,
|
|
50
50
|
{
|
|
51
51
|
size: "s",
|
|
52
52
|
mode: "tertiary",
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
-
|
|
53
|
+
children: /* @__PURE__ */ C("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 16 16", fill: "none", children: [
|
|
54
|
+
/* @__PURE__ */ e(
|
|
55
|
+
"path",
|
|
56
|
+
{
|
|
57
|
+
opacity: "0.2",
|
|
58
|
+
d: "M3 2.5L10 2.5L10 4.79312C9.99995 4.85881 10.0128 4.92385 10.0379 4.98455C10.063 5.04525 10.0998 5.10041 10.1462 5.14688L9.88 6.35375C9.92642 6.40022 9.96322 6.45538 9.98832 6.51608C10.0134 6.57677 10.0263 6.64182 10.0262 6.7075L10.0262 9.29312C10.0263 9.3588 10.0134 9.42385 9.98832 9.48455C9.96322 9.54525 9.92642 9.60041 9.88 9.64687L10.1462 10.8538C10.0998 10.9002 10.063 10.9554 10.0379 11.0161C10.0128 11.0768 9.99995 11.1418 10 11.2075L10 13.5L3 13.5C2.86739 13.5 2.74021 13.4473 2.64645 13.3536C2.55268 13.2598 2.5 13.1326 2.5 13L2.5 3C2.5 2.86739 2.55268 2.74022 2.64645 2.64645C2.74021 2.55268 2.86739 2.5 3 2.5Z",
|
|
59
|
+
fill: "#FFFFFF"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ e(
|
|
63
|
+
"path",
|
|
64
|
+
{
|
|
65
|
+
d: "M2 3L2 13C2 13.2652 2.10536 13.5196 2.29289 13.7071C2.48043 13.8946 2.73478 14 3 14L13 14C13.2652 14 13.5196 13.8946 13.7071 13.7071C13.8946 13.5196 14 13.2652 14 13L14 3C14 2.73478 13.8946 2.48043 13.7071 2.29289C13.5196 2.10536 13.2652 2 13 2L3 2C2.73478 2 2.48043 2.10536 2.29289 2.29289C2.10536 2.48043 2 2.73479 2 3ZM3 3L9.5 3L9.5 4.79375C9.49966 4.92502 9.5 5.02 9.5 5.16C9.5 5.3 9.5 5.58 9.5 5.73L9.5 6.70688L9.5 8L9.5 9.29313L9.5 10.43C9.5 10.59 9.5 10.69 9.5 10.85C9.5 10.98 9.49958 11.0755 9.5 11.2069L9.5 13L3 13L3 3ZM13 3L13 13L10.5 13L10.5 11.2069L10.5 10.69C10.5 10.5 10.5 9.87401 10.5 9.73C10.5 9.66401 10.5004 9.4245 10.5 9.29313L10.5 6.70688C10.5004 6.57551 10.5 6.41 10.5 6.28C10.5 6.13 10.5 6 10.5 5.89L10.5 4.79313L10.5 3L13 3ZM6.85375 10.3538C6.80731 10.4002 6.75217 10.4371 6.69147 10.4623C6.63077 10.4874 6.56571 10.5004 6.5 10.5004C6.43429 10.5004 6.36923 10.4874 6.30853 10.4623C6.24783 10.4371 6.19269 10.4002 6.14625 10.3538L4.14625 8.35375C4.09976 8.30731 4.06288 8.25217 4.03772 8.19147C4.01256 8.13077 3.99961 8.06571 3.99961 8C3.99961 7.93429 4.01256 7.86923 4.03772 7.80853C4.06288 7.74783 4.09976 7.69269 4.14625 7.64625L6.14625 5.64625C6.1927 5.5998 6.24785 5.56295 6.30855 5.5378C6.36925 5.51266 6.4343 5.49972 6.5 5.49972C6.5657 5.49972 6.63075 5.51266 6.69145 5.5378C6.75214 5.56295 6.80729 5.5998 6.85375 5.64625C6.9002 5.69271 6.93705 5.74786 6.9622 5.80855C6.98734 5.86925 7.00028 5.9343 7.00028 6C7.00028 6.0657 6.98734 6.13075 6.9622 6.19145C6.93705 6.25215 6.9002 6.3073 6.85375 6.35375L5.70687 7.5L9.5 7.5C9.5 7.54 9.5 7.58 9.5 7.64645C9.5 7.7 9.5 7.86739 9.5 8C9.5 8.13261 9.5 8.25 9.5 8.35355C9.5 8.41 9.5 8.45 9.5 8.5L5.70687 8.5L6.85375 9.64625C6.90024 9.69269 6.93712 9.74783 6.96228 9.80853C6.98744 9.86923 7.00039 9.93429 7.00039 10C7.00039 10.0657 6.98744 10.1308 6.96228 10.1915C6.93712 10.2522 6.90024 10.3073 6.85375 10.3538Z",
|
|
66
|
+
fill: "#FFFFFF"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] }),
|
|
70
|
+
onClick: n
|
|
55
71
|
}
|
|
56
72
|
)
|
|
57
73
|
] });
|
|
58
74
|
export {
|
|
59
|
-
|
|
75
|
+
v as SidePanelHeader
|
|
60
76
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
1
|
import { Size } from '../interface';
|
|
3
2
|
|
|
4
3
|
import * as PhosphorIcons from "@phosphor-icons/react";
|
|
5
4
|
export type SelectItem = {
|
|
6
5
|
label?: string;
|
|
7
|
-
icon?: keyof typeof PhosphorIcons;
|
|
6
|
+
icon?: keyof typeof PhosphorIcons | null;
|
|
8
7
|
value: string;
|
|
9
8
|
};
|
|
10
9
|
export interface SelectProps {
|
|
@@ -29,11 +28,16 @@ export interface SelectProps {
|
|
|
29
28
|
left?: string;
|
|
30
29
|
right?: string;
|
|
31
30
|
bottom?: string;
|
|
31
|
+
width?: string;
|
|
32
32
|
};
|
|
33
|
+
/** Text displayed when no item is selected */
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/** Condition to close the modal */
|
|
36
|
+
autoCloseCondition: boolean;
|
|
33
37
|
}
|
|
34
38
|
/**
|
|
35
39
|
* Select component that allows users to choose an option from a list.
|
|
36
40
|
* It supports three display modes: 'all' (icon + text), 'icon' (only icon), and 'text' (only text).
|
|
37
41
|
* The selected value is displayed in a button, and a modal opens to show the list of options.
|
|
38
42
|
*/
|
|
39
|
-
export declare const Select:
|
|
43
|
+
export declare const Select: ({ selected, size, listItem, modeDisplay, onSelect, positionOverride, placeholder, autoCloseCondition }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|