@situaction/traq-ui-ste 1.1.16 → 1.1.17
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/README.md +42 -5
- package/dist/X-Bd1VjKAF.mjs +190 -0
- package/dist/components/button/Button.d.ts +2 -2
- package/dist/components/button/Button.js +4 -3
- package/dist/components/buttonControledScroll/ButtonControlledScroll.d.ts +11 -1
- package/dist/components/calendar/Calendar.d.ts +6 -0
- package/dist/components/calendar/Calendar.js +833 -509
- package/dist/components/card/Card.d.ts +7 -0
- package/dist/components/checkbox/Checkbox.d.ts +4 -0
- package/dist/components/icon/Icon.d.ts +18 -0
- package/dist/components/icon/Icon.js +78592 -0
- package/dist/components/icon-button/IconButton.d.ts +8 -3
- package/dist/components/input/Input.d.ts +5 -0
- package/dist/components/list/list-controls/ListControls.d.ts +19 -0
- package/dist/components/list/list-controls/ListControls.js +49 -0
- package/dist/components/list/nested-list/NestedList.d.ts +18 -0
- package/dist/components/list/nested-list/NestedList.js +19 -0
- package/dist/components/list/nested-list/item/NestedListItem.d.ts +23 -0
- package/dist/components/list/nested-list/item/NestedListItem.js +71 -0
- package/dist/components/menu/Menu.d.ts +57 -0
- package/dist/components/menu/Menu.js +117 -0
- package/dist/components/modal/Modal.d.ts +32 -0
- package/dist/components/modal/Modal.js +24 -0
- package/dist/components/panel/side-panel/SidePanel.d.ts +30 -0
- package/dist/components/panel/side-panel/SidePanel.js +47 -0
- package/dist/components/panel/side-panel-header/SidePanelHeader.d.ts +22 -0
- package/dist/components/panel/side-panel-header/SidePanelHeader.js +60 -0
- package/dist/components/select/Select.d.ts +34 -15
- package/dist/components/select/Select.js +79 -64
- package/dist/components/select-filter-input-tags/SelectFilterInputTags.d.ts +17 -0
- package/dist/components/select-filter-input-tags/SelectFilterInputTags.js +31 -0
- package/dist/components/select-multi-items/SelectMultiItems.d.ts +24 -0
- package/dist/components/select-multi-items/SelectMultiItems.js +44 -0
- package/dist/components/switch/Switch.d.ts +30 -0
- package/dist/components/switch/Switch.js +93 -0
- package/dist/components/tabs/Tabs.d.ts +4 -0
- package/dist/components/tabs/Tabs.js +14 -13
- package/dist/components/tag/Tag.d.ts +4 -0
- package/dist/components/tag-counter/TagCounter.d.ts +5 -0
- package/dist/components/theme/variables_dark.d.ts +9 -0
- package/dist/components/theme/variables_dark.js +10 -1
- package/dist/components/theme/variables_light.d.ts +9 -0
- package/dist/components/theme/variables_light.js +10 -1
- package/dist/components/title/Title.d.ts +3 -0
- package/dist/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/main.d.ts +11 -0
- package/dist/main.js +58 -34
- package/dist/styles/Button.css +1 -1
- package/dist/styles/ListControls.css +1 -0
- package/dist/styles/Menu.css +1 -0
- package/dist/styles/Modal.css +1 -0
- package/dist/styles/NestedList.css +1 -0
- package/dist/styles/NestedListItem.css +1 -0
- package/dist/styles/Select.css +1 -1
- package/dist/styles/SelectFilterInputTags.css +1 -0
- package/dist/styles/SelectMultiItems.css +1 -0
- package/dist/styles/SidePanel.css +1 -0
- package/dist/styles/SidePanelHeader.css +1 -0
- package/dist/styles/Switch.css +1 -0
- package/dist/styles/index.css +1 -0
- package/package.json +5 -4
- /package/dist/styles/{main.css → Size.css} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FC, ReactElement } from 'react';
|
|
1
|
+
import { ButtonHTMLAttributes, FC, MouseEvent, ReactElement } from 'react';
|
|
2
2
|
import { Size } from '../interface';
|
|
3
3
|
|
|
4
|
-
export interface IconButtonProps {
|
|
4
|
+
export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
5
|
/** Specifies the visual style of the button. */
|
|
6
6
|
mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'icon';
|
|
7
7
|
/** How large should the button be? */
|
|
@@ -17,6 +17,11 @@ export interface IconButtonProps {
|
|
|
17
17
|
/** Only icons (React elements) allowed inside the button */
|
|
18
18
|
children: ReactElement;
|
|
19
19
|
/** Optional click handler */
|
|
20
|
-
onClick?: () => void;
|
|
20
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* IconButton component renders a button with an icon inside.
|
|
24
|
+
* It supports customization such as size, style mode, and error state.
|
|
25
|
+
* The button can also be disabled or selected based on props.
|
|
26
|
+
*/
|
|
22
27
|
export declare const IconButton: FC<IconButtonProps>;
|
|
@@ -19,4 +19,9 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
19
19
|
/** Disable the input field **/
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* The Input component renders an input field with optional icons or labels on the left and right.
|
|
24
|
+
* It supports different input sizes, status styles, and focus handling.
|
|
25
|
+
* The input can also be disabled and have rounded corners.
|
|
26
|
+
*/
|
|
22
27
|
export declare const Input: FC<InputProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface FilterProps {
|
|
4
|
+
/** List of child components to display in the list-controls */
|
|
5
|
+
listChildren: ReactElement[];
|
|
6
|
+
/** Function to handle item click and update selection state */
|
|
7
|
+
handleItemClick: (id: string) => void;
|
|
8
|
+
/** Array of booleans representing the selected state of each item */
|
|
9
|
+
selectedItems: string[];
|
|
10
|
+
/** Optional function to reset the list-controls */
|
|
11
|
+
onReset?: () => void;
|
|
12
|
+
/** Name label button reset */
|
|
13
|
+
labelButtonReset?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A component that displays a list of items with checkboxes, allowing users to select or deselect items.
|
|
17
|
+
* It also includes an optional reset button to clear all selections.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ListControls: FC<FilterProps>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Button as p } from "../../button/Button.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import '../../../styles/Size.css';import '../../../styles/index.css';import '../../../styles/ListControls.css';/* empty css */
|
|
5
|
+
import { Checkbox as _ } from "../../checkbox/Checkbox.js";
|
|
6
|
+
import { Icon as a } from "../../icon/Icon.js";
|
|
7
|
+
import "../../modal/Modal.js";
|
|
8
|
+
import "../../theme/ThemeContext.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
const u = "_list_1nihg_6", f = "_children_1nihg_29", g = "_selected_1nihg_43", k = "_reset_1nihg_47", i = {
|
|
11
|
+
list: u,
|
|
12
|
+
children: f,
|
|
13
|
+
selected: g,
|
|
14
|
+
reset: k
|
|
15
|
+
}, F = ({ listChildren: o, handleItemClick: d, selectedItems: h, onReset: t, labelButtonReset: r }) => /* @__PURE__ */ l("div", { className: i.list, children: [
|
|
16
|
+
/* @__PURE__ */ e("div", { children: o.map((n, m) => {
|
|
17
|
+
if (n.key == null) return null;
|
|
18
|
+
const s = n.key, c = h.includes(s);
|
|
19
|
+
return /* @__PURE__ */ l(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: `${c ? i.selected : ""} ${i.children}`,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ e(
|
|
25
|
+
_,
|
|
26
|
+
{
|
|
27
|
+
checked: c,
|
|
28
|
+
onChange: () => d(s)
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ e("span", { children: n })
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
m
|
|
35
|
+
);
|
|
36
|
+
}) }),
|
|
37
|
+
t && r && /* @__PURE__ */ e("div", { className: i.reset, children: /* @__PURE__ */ e(
|
|
38
|
+
p,
|
|
39
|
+
{
|
|
40
|
+
mode: "ghost",
|
|
41
|
+
label: r,
|
|
42
|
+
onClick: t,
|
|
43
|
+
childrenLeft: /* @__PURE__ */ e(a, { icon: "FunnelX" })
|
|
44
|
+
}
|
|
45
|
+
) })
|
|
46
|
+
] });
|
|
47
|
+
export {
|
|
48
|
+
F as ListControls
|
|
49
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { FilterMenuItemProps } from './item/NestedListItem';
|
|
3
|
+
|
|
4
|
+
export interface NestedListProps {
|
|
5
|
+
/** List of menu items */
|
|
6
|
+
items: FilterMenuItemProps[];
|
|
7
|
+
align?: "left" | "right";
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/** Function to reset filters */
|
|
10
|
+
onReset?: () => void;
|
|
11
|
+
/** Name label button reset */
|
|
12
|
+
labelButtonReset?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The NestedList component renders a list of `NestedListItem` components with optional
|
|
16
|
+
* filtering functionality via a reset button.
|
|
17
|
+
*/
|
|
18
|
+
export declare const NestedList: FC<NestedListProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { NestedListItem as c } from "./item/NestedListItem.js";
|
|
3
|
+
import { Button as p } from "../../button/Button.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import '../../../styles/Size.css';import '../../../styles/index.css';import '../../../styles/NestedList.css';/* empty css */
|
|
6
|
+
import { Icon as a } from "../../icon/Icon.js";
|
|
7
|
+
import "../../modal/Modal.js";
|
|
8
|
+
import "../../theme/ThemeContext.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
const h = "_nestedlist_7rnd3_6", _ = "_reset_7rnd3_18", r = {
|
|
11
|
+
nestedlist: h,
|
|
12
|
+
reset: _
|
|
13
|
+
}, k = ({ items: i, align: o = "right", onReset: e, children: n, labelButtonReset: s }) => /* @__PURE__ */ l("div", { className: r.nestedlist, children: [
|
|
14
|
+
i.map((m, d) => /* @__PURE__ */ t(c, { ...m, align: o ?? "right", children: n }, d)),
|
|
15
|
+
e && s && /* @__PURE__ */ t("div", { className: r.reset, children: /* @__PURE__ */ t(p, { mode: "ghost", label: s, onClick: e, childrenLeft: /* @__PURE__ */ t(a, { icon: "FunnelX" }) }) })
|
|
16
|
+
] });
|
|
17
|
+
export {
|
|
18
|
+
k as NestedList
|
|
19
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as PhosphorIcons from "@phosphor-icons/react";
|
|
4
|
+
export interface FilterMenuItemProps {
|
|
5
|
+
/** Icon displayed on the left */
|
|
6
|
+
icon?: keyof typeof PhosphorIcons;
|
|
7
|
+
/** Text of the item */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Optional indicator (number, badge, etc.) */
|
|
10
|
+
numberSelect?: number;
|
|
11
|
+
/** Content to be displayed inside the modal */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** Function called on click */
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
/** Position modal */
|
|
16
|
+
align?: "left" | "right";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The NestedListItem component renders an item in a nested list, with an optional icon,
|
|
20
|
+
* title, and a number indicator. It opens a modal when clicked, positioning the modal
|
|
21
|
+
* relative to the item.
|
|
22
|
+
*/
|
|
23
|
+
export declare const NestedListItem: FC<FilterMenuItemProps>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs as r, Fragment as w, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useRef as u, useLayoutEffect as z } from "react";
|
|
3
|
+
import '../../../../styles/Size.css';import '../../../../styles/index.css';import '../../../../styles/NestedListItem.css';/* empty css */
|
|
4
|
+
import { TagCounter as B } from "../../../tag-counter/TagCounter.js";
|
|
5
|
+
import { Icon as l } from "../../../icon/Icon.js";
|
|
6
|
+
import { Modal as L } from "../../../modal/Modal.js";
|
|
7
|
+
import "../../../theme/ThemeContext.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28", v = "_modal_2r2ga_34", s = {
|
|
10
|
+
nestedlist: S,
|
|
11
|
+
items: $,
|
|
12
|
+
textSmall: j,
|
|
13
|
+
modal: v
|
|
14
|
+
}, T = ({
|
|
15
|
+
icon: a,
|
|
16
|
+
title: h,
|
|
17
|
+
numberSelect: i,
|
|
18
|
+
children: _,
|
|
19
|
+
onClick: m,
|
|
20
|
+
align: e = "right"
|
|
21
|
+
}) => {
|
|
22
|
+
const [c, d] = g(!1), n = u(null), o = u(null), [x, C] = g({
|
|
23
|
+
top: "0px"
|
|
24
|
+
});
|
|
25
|
+
z(() => {
|
|
26
|
+
var p;
|
|
27
|
+
if (n.current && o.current) {
|
|
28
|
+
const N = o.current.getBoundingClientRect(), f = n.current.getBoundingClientRect().width, M = ((p = o.current.parentElement) == null ? void 0 : p.getBoundingClientRect().top) || 0;
|
|
29
|
+
C({
|
|
30
|
+
top: `${N.top - M}px`,
|
|
31
|
+
...e === "right" ? { right: `-${f + 6}px` } : { left: `-${f + 6}px` }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}, [c, e]);
|
|
35
|
+
const R = () => {
|
|
36
|
+
d(!0), m && m();
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ r(w, { children: [
|
|
39
|
+
/* @__PURE__ */ r(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
ref: o,
|
|
43
|
+
className: s.nestedlist,
|
|
44
|
+
onClick: R,
|
|
45
|
+
children: [
|
|
46
|
+
e === "left" && /* @__PURE__ */ t(l, { icon: "CaretLeft", size: 14, weight: "regular" }),
|
|
47
|
+
/* @__PURE__ */ r("div", { className: s.items, children: [
|
|
48
|
+
a && /* @__PURE__ */ t(l, { icon: a }),
|
|
49
|
+
/* @__PURE__ */ t("span", { className: s.textSmall, children: h }),
|
|
50
|
+
i && i > 0 && /* @__PURE__ */ t(B, { size: "s", label: i ?? 0 })
|
|
51
|
+
] }),
|
|
52
|
+
e === "right" && /* @__PURE__ */ t(l, { icon: "CaretRight", size: 14, weight: "regular" })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ t(
|
|
57
|
+
L,
|
|
58
|
+
{
|
|
59
|
+
ref: n,
|
|
60
|
+
className: s.modal,
|
|
61
|
+
open: c,
|
|
62
|
+
onClose: () => d(!1),
|
|
63
|
+
position: x,
|
|
64
|
+
children: _
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
T as NestedListItem
|
|
71
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interface for a standard menu item that triggers an action on click.
|
|
5
|
+
*/
|
|
6
|
+
export interface MenuItem {
|
|
7
|
+
/** Unique identifier for the menu item */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Icon displayed for the menu item */
|
|
10
|
+
icon: ReactElement;
|
|
11
|
+
/** Text label for the menu item */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Callback function executed when the item is clicked */
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Interface for a parameterized menu item that can open a modal or execute a custom action.
|
|
18
|
+
*/
|
|
19
|
+
export interface MenuParam {
|
|
20
|
+
/** Unique identifier for the menu param */
|
|
21
|
+
id: string;
|
|
22
|
+
/** Icon displayed for the menu param */
|
|
23
|
+
icon: ReactElement;
|
|
24
|
+
/** Text label for the menu param */
|
|
25
|
+
label: string;
|
|
26
|
+
/** Optional content to display inside a modal */
|
|
27
|
+
content?: ReactElement;
|
|
28
|
+
/** Optional callback triggered when the param is clicked (if no content is provided) */
|
|
29
|
+
onClick?: () => void;
|
|
30
|
+
/** Position of the modal relative to the menu */
|
|
31
|
+
position: {
|
|
32
|
+
bottom: string;
|
|
33
|
+
left: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Props for the Menu component, which renders a vertical navigation menu with actions and optional modal parameters.
|
|
38
|
+
*/
|
|
39
|
+
export interface MenuProps {
|
|
40
|
+
/** List of clickable menu items */
|
|
41
|
+
menuItems?: MenuItem[];
|
|
42
|
+
/** List of parameter items with optional modal content */
|
|
43
|
+
menuParams?: MenuParam[];
|
|
44
|
+
/** Short version of the logo, shown when the menu is collapsed */
|
|
45
|
+
shortLogo?: string;
|
|
46
|
+
/** Full logo displayed when the menu is expanded */
|
|
47
|
+
logo?: string;
|
|
48
|
+
/** Callback function to notify when the menu open state changes */
|
|
49
|
+
isOpen?: (value: boolean) => void;
|
|
50
|
+
/** Whether the menu should be open by default */
|
|
51
|
+
defaultOpen?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Menu component renders a vertical navigation bar with collapsible state,
|
|
55
|
+
* supporting both simple actions and modal-based parameters.
|
|
56
|
+
*/
|
|
57
|
+
export declare const Menu: FC<MenuProps>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useRef as B, useEffect as S } from "react";
|
|
3
|
+
import { Button as C } from "../button/Button.js";
|
|
4
|
+
import '../../styles/Size.css';import '../../styles/index.css';import '../../styles/Menu.css';/* empty css */
|
|
5
|
+
import { IconButton as f } from "../icon-button/IconButton.js";
|
|
6
|
+
import { Icon as v } from "../icon/Icon.js";
|
|
7
|
+
import { Modal as P } from "../modal/Modal.js";
|
|
8
|
+
import "../theme/ThemeContext.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
const W = "_fullHeight_ikhx4_15", y = "_fullWidth_ikhx4_18", O = "_open_ikhx4_21", j = "_close_ikhx4_25", D = "_menuButton_ikhx4_29", q = "_closeIcon_ikhx4_37", A = "_label_ikhx4_42", F = "_textEllipsis_ikhx4_46", G = "_pointer_ikhx4_51", J = "_fullImg_ikhx4_54", K = "_menuParams_ikhx4_60", Q = "_line_ikhx4_66", T = "_borderRadiusM_ikhx4_73", U = "_menuItem_ikhx4_77", X = "_flexVerticalBetweenStart_ikhx4_86", Y = "_flexHorizontalBetween_ikhx4_93", Z = "_flexVertical_ikhx4_86", ee = "_flexVerticalBetweenCenter_ikhx4_107", e = {
|
|
11
|
+
fullHeight: W,
|
|
12
|
+
fullWidth: y,
|
|
13
|
+
open: O,
|
|
14
|
+
close: j,
|
|
15
|
+
menuButton: D,
|
|
16
|
+
closeIcon: q,
|
|
17
|
+
label: A,
|
|
18
|
+
textEllipsis: F,
|
|
19
|
+
pointer: G,
|
|
20
|
+
fullImg: J,
|
|
21
|
+
menuParams: K,
|
|
22
|
+
line: Q,
|
|
23
|
+
borderRadiusM: T,
|
|
24
|
+
menuItem: U,
|
|
25
|
+
flexVerticalBetweenStart: X,
|
|
26
|
+
flexHorizontalBetween: Y,
|
|
27
|
+
flexVertical: Z,
|
|
28
|
+
flexVerticalBetweenCenter: ee
|
|
29
|
+
}, de = ({ menuItems: s = [], menuParams: r = [], shortLogo: h, logo: _, isOpen: x, defaultOpen: M = !1 }) => {
|
|
30
|
+
const [o, m] = c(M ?? !1), [p, $] = c(s ? s[0].id : null), b = B(null), [w, u] = c(!1), [I, k] = c(!1), [N, V] = c(null), [H, E] = c({}), z = B(null), g = (l, i) => {
|
|
31
|
+
if (l.stopPropagation(), $(i), s) {
|
|
32
|
+
const n = s.find((a) => a.id === i);
|
|
33
|
+
n == null || n.onClick();
|
|
34
|
+
}
|
|
35
|
+
}, R = () => {
|
|
36
|
+
m(!o), u(!1);
|
|
37
|
+
}, L = (l) => {
|
|
38
|
+
var i;
|
|
39
|
+
if (r) {
|
|
40
|
+
const n = r.find((a) => a.id === l);
|
|
41
|
+
if (!n) return;
|
|
42
|
+
if (n.content) {
|
|
43
|
+
const a = o ? "200px" : "40px";
|
|
44
|
+
V(n.content), E({ ...n.position, left: a }), k(!0);
|
|
45
|
+
} else
|
|
46
|
+
(i = n.onClick) == null || i.call(n);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return S(() => {
|
|
50
|
+
x && x(o);
|
|
51
|
+
}, [o]), /* @__PURE__ */ t("nav", { ref: b, children: /* @__PURE__ */ d("div", { className: `${e.flexVerticalBetweenStart} ${e.fullHeight} ${o ? e.open : e.close}`, children: [
|
|
52
|
+
/* @__PURE__ */ d("div", { className: e.fullWidth, children: [
|
|
53
|
+
/* @__PURE__ */ t(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: `${e.flexHorizontalBetween} ${e.pointer} ${e.textEllipsis}`,
|
|
57
|
+
onClick: () => R(),
|
|
58
|
+
children: o ? /* @__PURE__ */ d("div", { className: e.fullImg, children: [
|
|
59
|
+
_ && /* @__PURE__ */ t("img", { src: _, alt: "Logo situaction" }),
|
|
60
|
+
/* @__PURE__ */ t(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ t(v, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
|
|
61
|
+
] }) : /* @__PURE__ */ t(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: e.closeIcon,
|
|
65
|
+
onMouseEnter: () => u(!0),
|
|
66
|
+
onMouseLeave: () => u(!1),
|
|
67
|
+
onClick: () => m(!o),
|
|
68
|
+
children: w || !h ? /* @__PURE__ */ t(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ t(v, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ t("img", { src: h, alt: "Logo situaction" })
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ t("div", { className: e.menuItem, children: s && s.map((l) => o ? /* @__PURE__ */ t("div", { className: `${e.textEllipsis} ${e.menuButton}`, children: /* @__PURE__ */ t(
|
|
74
|
+
C,
|
|
75
|
+
{
|
|
76
|
+
mode: p === l.id ? "secondary" : "ghost",
|
|
77
|
+
label: l.label,
|
|
78
|
+
onClick: (i) => g(i, l.id),
|
|
79
|
+
childrenLeft: l.icon
|
|
80
|
+
}
|
|
81
|
+
) }, `button-${l.id}`) : /* @__PURE__ */ t("div", { className: e.textEllipsis, children: /* @__PURE__ */ t(
|
|
82
|
+
f,
|
|
83
|
+
{
|
|
84
|
+
mode: p === l.id ? "secondary" : "ghost",
|
|
85
|
+
children: l.icon,
|
|
86
|
+
onClick: (i) => g(i, l.id)
|
|
87
|
+
}
|
|
88
|
+
) }, `icon-${l.id}`)) }),
|
|
89
|
+
/* @__PURE__ */ t("div", { className: e.line })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ d("div", { className: `${e.menuParams} ${e.flexVerticalBetweenCenter}`, children: [
|
|
92
|
+
r && r.map((l) => /* @__PURE__ */ t(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: `${e.fullWidth} ${e.textEllipsis}`,
|
|
96
|
+
onClick: () => L(l.id),
|
|
97
|
+
children: o ? /* @__PURE__ */ t("div", { className: e.menuButton, children: /* @__PURE__ */ t(C, { mode: "ghost", label: l.label, childrenLeft: l.icon }, l.id) }) : /* @__PURE__ */ t(f, { mode: "ghost", children: l.icon })
|
|
98
|
+
},
|
|
99
|
+
`param-icon-${l.id}`
|
|
100
|
+
)),
|
|
101
|
+
/* @__PURE__ */ t(
|
|
102
|
+
P,
|
|
103
|
+
{
|
|
104
|
+
ref: z,
|
|
105
|
+
className: e.borderRadiusM,
|
|
106
|
+
open: I,
|
|
107
|
+
onClose: () => k(!1),
|
|
108
|
+
position: H,
|
|
109
|
+
children: N
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
] })
|
|
113
|
+
] }) });
|
|
114
|
+
};
|
|
115
|
+
export {
|
|
116
|
+
de as Menu
|
|
117
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ModalProps {
|
|
4
|
+
/** Determines whether the modal is open or closed.
|
|
5
|
+
* If true, the modal is displayed; if false, it is hidden. */
|
|
6
|
+
open: boolean;
|
|
7
|
+
/** Callback function to handle closing the modal.
|
|
8
|
+
* Triggered when clicking outside the modal content. */
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/** Content to be displayed inside the modal.
|
|
11
|
+
* Typically includes child components or HTML elements. */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** Optional object to specify the positioning of the modal.
|
|
14
|
+
* Supports CSS properties such as top, left, right, bottom, and width. */
|
|
15
|
+
position?: {
|
|
16
|
+
top?: string;
|
|
17
|
+
left?: string;
|
|
18
|
+
right?: string;
|
|
19
|
+
bottom?: string;
|
|
20
|
+
width?: string;
|
|
21
|
+
};
|
|
22
|
+
/** Optional additional CSS class names to apply custom styles to the modal. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Option to disable the overlay and the blocking of events outside the modal */
|
|
25
|
+
disableOverlay?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Modal component that renders content in a floating layer above the main UI.
|
|
29
|
+
* It supports custom positioning and closes when clicking outside of its content area.
|
|
30
|
+
* The component uses a ref to detect clicks outside the modal.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs as v, Fragment as y, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f, useEffect as _ } from "react";
|
|
3
|
+
import '../../styles/Modal.css';const g = "_overlay_lv2n7_2", C = "_modalContent_lv2n7_12", s = {
|
|
4
|
+
overlay: g,
|
|
5
|
+
modalContent: C
|
|
6
|
+
}, x = f(
|
|
7
|
+
({ open: e, onClose: n, children: c, position: d, className: m, disableOverlay: i = !1 }, t) => (_(() => {
|
|
8
|
+
const o = (l) => {
|
|
9
|
+
if (t && t.current && e) {
|
|
10
|
+
const r = t.current;
|
|
11
|
+
r && !r.contains(l.target) && ![...document.querySelectorAll(".dialog")].some((u) => u.contains(l.target)) && n();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return document.addEventListener("mousedown", o), () => {
|
|
15
|
+
document.removeEventListener("mousedown", o);
|
|
16
|
+
};
|
|
17
|
+
}, [n, e, t]), e ? /* @__PURE__ */ v(y, { children: [
|
|
18
|
+
i && /* @__PURE__ */ a("div", { className: s.overlay, onClick: n }),
|
|
19
|
+
/* @__PURE__ */ a("div", { ref: t, className: `${s.modalContent} ${m}`, style: d, children: c })
|
|
20
|
+
] }) : null)
|
|
21
|
+
);
|
|
22
|
+
export {
|
|
23
|
+
x as Modal
|
|
24
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SidePanelProps {
|
|
4
|
+
/** Content to display inside the side panel */
|
|
5
|
+
children: ReactElement;
|
|
6
|
+
/** Width of the side panel (e.g. '300px') */
|
|
7
|
+
width: string;
|
|
8
|
+
/** Determines if the panel appears on the left side (true) or right side (false) */
|
|
9
|
+
left?: boolean;
|
|
10
|
+
/** Controls whether the panel is open (useful for controlled mode) */
|
|
11
|
+
opened?: boolean;
|
|
12
|
+
/** Callback triggered when the panel is toggled */
|
|
13
|
+
onToggle?: (isOpen: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* SidePanel is a sliding panel component that appears from either the left or right side of the screen.
|
|
17
|
+
* It is designed to display additional content or interactive elements without navigating away from the current page.
|
|
18
|
+
*
|
|
19
|
+
* The component supports both controlled and uncontrolled modes:
|
|
20
|
+
* - In controlled mode, the parent component controls the open/close state via the `opened` prop and `onToggle` callback.
|
|
21
|
+
* - In uncontrolled mode, the component manages its own internal state.
|
|
22
|
+
*
|
|
23
|
+
* Features:
|
|
24
|
+
* - Slide-in animation from left or right
|
|
25
|
+
* - Customizable width
|
|
26
|
+
* - Click outside to close (with optional `onClickOutside` callback)
|
|
27
|
+
* - Clean CSS-based transitions
|
|
28
|
+
* - Designed to be easily styled via CSS modules
|
|
29
|
+
*/
|
|
30
|
+
export declare const SidePanel: FC<SidePanelProps>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useRef as y, useEffect as f } from "react";
|
|
3
|
+
import '../../../styles/SidePanel.css';const x = "_panel_1d46d_1", v = "_openPanelBtn_1d46d_9", b = "_box_1d46d_18", B = "_panelLeft_1d46d_26", C = "_panelRight_1d46d_33", H = "_panelOpenedLeft_1d46d_40", S = "_panelOpenedRight_1d46d_44", E = "_panelHidden_1d46d_48", N = "_displayPanel_1d46d_52", g = "_hidePanel_1d46d_56", e = {
|
|
4
|
+
panel: x,
|
|
5
|
+
openPanelBtn: v,
|
|
6
|
+
box: b,
|
|
7
|
+
panelLeft: B,
|
|
8
|
+
panelRight: C,
|
|
9
|
+
panelOpenedLeft: H,
|
|
10
|
+
panelOpenedRight: S,
|
|
11
|
+
panelHidden: E,
|
|
12
|
+
displayPanel: N,
|
|
13
|
+
hidePanel: g
|
|
14
|
+
}, $ = ({
|
|
15
|
+
children: u,
|
|
16
|
+
width: s,
|
|
17
|
+
left: p = !0,
|
|
18
|
+
opened: n = !1,
|
|
19
|
+
onToggle: t
|
|
20
|
+
}) => {
|
|
21
|
+
const [a, l] = _(n), [m, d] = _(n), i = y(null), h = {
|
|
22
|
+
"--dynamic-left": `-${s}`,
|
|
23
|
+
"--dynamic-right": `-${s}`,
|
|
24
|
+
width: s
|
|
25
|
+
}, P = p ? e.panelLeft : e.panelRight, O = p ? e.panelOpenedLeft : e.panelOpenedRight, R = [
|
|
26
|
+
e.panel,
|
|
27
|
+
P,
|
|
28
|
+
!a && e.panelHidden,
|
|
29
|
+
a && O,
|
|
30
|
+
m ? e.displayPanel : e.hidePanel
|
|
31
|
+
].filter(Boolean).join(" ");
|
|
32
|
+
return f(() => {
|
|
33
|
+
n ? (d(!0), setTimeout(() => l(!0), 10)) : (l(!1), setTimeout(() => d(!1), 300));
|
|
34
|
+
}, [n]), f(() => {
|
|
35
|
+
const o = (L) => {
|
|
36
|
+
const c = L.target;
|
|
37
|
+
c.closest("[data-ignore-outside-click]") || i.current && !i.current.contains(c) && (l(!1), t == null || t(!1), setTimeout(() => d(!1), 300));
|
|
38
|
+
};
|
|
39
|
+
if (a)
|
|
40
|
+
return document.addEventListener("mousedown", o), () => {
|
|
41
|
+
document.removeEventListener("mousedown", o);
|
|
42
|
+
};
|
|
43
|
+
}, [a, t]), /* @__PURE__ */ r("div", { style: h, className: R, children: /* @__PURE__ */ r("div", { ref: i, className: e.box, children: u }) });
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
$ as SidePanel
|
|
47
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as PhosphorIcons from "@phosphor-icons/react";
|
|
4
|
+
export interface SidePanelHeaderProps {
|
|
5
|
+
/** Title text displayed in the panel header */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Icon displayed next to the title */
|
|
8
|
+
icon?: keyof typeof PhosphorIcons;
|
|
9
|
+
/** Triggered when the back navigation button is clicked */
|
|
10
|
+
onClickBack?: () => void;
|
|
11
|
+
/** Triggered when the forward navigation button is clicked */
|
|
12
|
+
onClickForward?: () => void;
|
|
13
|
+
/** Triggered when the close button is clicked */
|
|
14
|
+
onClickClose?: () => void;
|
|
15
|
+
/** Determines if the navigation buttons should be disabled */
|
|
16
|
+
disabledBack?: boolean;
|
|
17
|
+
disabledForward?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Header component for a SidePanel, with title, icon, navigation, and close actions.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SidePanelHeader: FC<SidePanelHeaderProps>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import '../../../styles/Size.css';import '../../../styles/index.css';import '../../../styles/SidePanelHeader.css';/* empty css */
|
|
3
|
+
import "react";
|
|
4
|
+
import { IconButton as r } from "../../icon-button/IconButton.js";
|
|
5
|
+
import { Icon as i } from "../../icon/Icon.js";
|
|
6
|
+
import "../../modal/Modal.js";
|
|
7
|
+
import "../../theme/ThemeContext.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
const b = "_sidePanelHeader_72g7b_6", h = "_buttonArrow_72g7b_13", p = "_title_72g7b_20", o = {
|
|
10
|
+
sidePanelHeader: b,
|
|
11
|
+
buttonArrow: h,
|
|
12
|
+
title: p
|
|
13
|
+
}, w = ({
|
|
14
|
+
title: n,
|
|
15
|
+
icon: s,
|
|
16
|
+
onClickBack: l,
|
|
17
|
+
onClickForward: a,
|
|
18
|
+
onClickClose: d,
|
|
19
|
+
disabledBack: c = !1,
|
|
20
|
+
disabledForward: m = !1
|
|
21
|
+
}) => /* @__PURE__ */ t("div", { className: o.sidePanelHeader, children: [
|
|
22
|
+
/* @__PURE__ */ t("div", { className: o.buttonArrow, children: [
|
|
23
|
+
/* @__PURE__ */ e(
|
|
24
|
+
r,
|
|
25
|
+
{
|
|
26
|
+
disabled: c,
|
|
27
|
+
mode: "tertiary",
|
|
28
|
+
size: "s",
|
|
29
|
+
onClick: l,
|
|
30
|
+
children: /* @__PURE__ */ e(i, { icon: "CaretLeft", size: 18 })
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ e(
|
|
34
|
+
r,
|
|
35
|
+
{
|
|
36
|
+
disabled: m,
|
|
37
|
+
mode: "tertiary",
|
|
38
|
+
size: "s",
|
|
39
|
+
onClick: a,
|
|
40
|
+
children: /* @__PURE__ */ e(i, { icon: "CaretRight", size: 18 })
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ t("div", { className: o.title, children: [
|
|
45
|
+
s && /* @__PURE__ */ e(i, { icon: s, size: 22 }),
|
|
46
|
+
/* @__PURE__ */ e("h3", { children: n })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
|
+
r,
|
|
50
|
+
{
|
|
51
|
+
size: "s",
|
|
52
|
+
mode: "tertiary",
|
|
53
|
+
children: /* @__PURE__ */ e(i, { icon: "SquareHalf", size: 18 }),
|
|
54
|
+
onClick: d
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] });
|
|
58
|
+
export {
|
|
59
|
+
w as SidePanelHeader
|
|
60
|
+
};
|