@situaction/traq-ui-ste 1.1.16 → 1.1.18
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/accordion/Accordion.d.ts +3 -0
- package/dist/components/accordion/Accordion.js +6 -5
- package/dist/components/accordion/item/AccordionItem.d.ts +3 -0
- package/dist/components/accordion/item/AccordionItem.js +34 -30
- 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 +59 -0
- package/dist/components/menu/Menu.js +121 -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 +15 -4
- package/dist/main.js +58 -34
- package/dist/styles/AccordionItem.css +1 -1
- 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/Size.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 +0 -1
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { Size } from '../interface';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
label
|
|
6
|
-
|
|
4
|
+
import * as PhosphorIcons from "@phosphor-icons/react";
|
|
5
|
+
export type SelectItem = {
|
|
6
|
+
label?: string;
|
|
7
|
+
icon?: keyof typeof PhosphorIcons;
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
7
10
|
export interface SelectProps {
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
/** The currently selected item. If not provided, the first item from `listItem` will be used. */
|
|
12
|
+
selected?: SelectItem;
|
|
13
|
+
/** The size of the select button ('s', 'm', 'l', 'xl'). Default is 'm'. */
|
|
14
|
+
size?: Size | 'menu';
|
|
15
|
+
/** The list of selectable items, each with a label, an optional icon, and a value. */
|
|
16
|
+
listItem: SelectItem[];
|
|
17
|
+
/** Determines how the selected item is displayed:
|
|
18
|
+
* - 'all' (icon + text if both exist),
|
|
19
|
+
* - 'icon' (only the icon),
|
|
20
|
+
* - 'text' (only the text).
|
|
21
|
+
* Default is 'all'.
|
|
22
|
+
*/
|
|
23
|
+
modeDisplay?: 'icon' | 'text' | 'all';
|
|
24
|
+
/** Callback function triggered when an item is selected, returning the selected object. */
|
|
25
|
+
onSelect?: (selected: SelectItem) => void;
|
|
26
|
+
/** Position personnalized*/
|
|
27
|
+
positionOverride?: {
|
|
28
|
+
top?: string;
|
|
29
|
+
left?: string;
|
|
30
|
+
right?: string;
|
|
31
|
+
bottom?: string;
|
|
32
|
+
};
|
|
18
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Select component that allows users to choose an option from a list.
|
|
36
|
+
* It supports three display modes: 'all' (icon + text), 'icon' (only icon), and 'text' (only text).
|
|
37
|
+
* The selected value is displayed in a button, and a modal opens to show the list of options.
|
|
38
|
+
*/
|
|
19
39
|
export declare const Select: FC<SelectProps>;
|
|
20
|
-
export {};
|
|
@@ -1,72 +1,87 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Button as
|
|
4
|
-
import '../../styles/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}) => {
|
|
20
|
-
const [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
t
|
|
31
|
-
|
|
32
|
-
u(e), n(!1), l && l(e.value);
|
|
33
|
-
};
|
|
34
|
-
return /* @__PURE__ */ b("div", { className: `${t.customSelect}`, children: [
|
|
35
|
-
/* @__PURE__ */ s(
|
|
36
|
-
h,
|
|
1
|
+
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useRef as N, useEffect as C } from "react";
|
|
3
|
+
import { Button as _ } from "../button/Button.js";
|
|
4
|
+
import '../../styles/Size.css';import '../../styles/index.css';import '../../styles/Select.css';/* empty css */
|
|
5
|
+
import { IconButton as S } from "../icon-button/IconButton.js";
|
|
6
|
+
import { Icon as a } from "../icon/Icon.js";
|
|
7
|
+
import { Modal as g } from "../modal/Modal.js";
|
|
8
|
+
import "../theme/ThemeContext.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
const R = "_selectContainer_ak06l_40", y = "_selected_ak06l_43", z = "_children_ak06l_47", B = "_active_ak06l_62", F = "_selectList_ak06l_66", j = "_modal_ak06l_75", U = "_dropdownFadeIn_ak06l_1", $ = "_itemLabel_ak06l_81", c = {
|
|
11
|
+
selectContainer: R,
|
|
12
|
+
selected: y,
|
|
13
|
+
children: z,
|
|
14
|
+
active: B,
|
|
15
|
+
selectList: F,
|
|
16
|
+
modal: j,
|
|
17
|
+
dropdownFadeIn: U,
|
|
18
|
+
itemLabel: $
|
|
19
|
+
}, K = ({ selected: i, size: s = "m", listItem: h, modeDisplay: r = "all", onSelect: p, positionOverride: d }) => {
|
|
20
|
+
const [n, o] = f(!1), k = N(null), [L, v] = f({ top: "calc(100% + 6px)" }), I = i ?? h[0], [t, b] = f(I);
|
|
21
|
+
C(() => {
|
|
22
|
+
i && b(i);
|
|
23
|
+
}, [i]), C(() => {
|
|
24
|
+
d && v(d);
|
|
25
|
+
}, [d]);
|
|
26
|
+
const w = (e) => {
|
|
27
|
+
b(e), o(!1), p && p(e);
|
|
28
|
+
}, x = () => {
|
|
29
|
+
const e = !!t.icon, m = !!t.label;
|
|
30
|
+
return t.icon && r === "icon" && e ? /* @__PURE__ */ l(S, { mode: "tertiary", size: s ?? "m", onClick: () => o(!n), children: /* @__PURE__ */ l(a, { icon: t.icon }) }) : t.label && r === "text" && m ? /* @__PURE__ */ l(
|
|
31
|
+
_,
|
|
37
32
|
{
|
|
38
|
-
onClick: () => n(!o),
|
|
39
|
-
disabled: m,
|
|
40
|
-
size: "s",
|
|
41
33
|
mode: "tertiary",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
),
|
|
55
|
-
|
|
34
|
+
label: t.label,
|
|
35
|
+
childrenRight: /* @__PURE__ */ l(a, { icon: n ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
|
|
36
|
+
size: s ?? "m",
|
|
37
|
+
onClick: () => o(!n)
|
|
38
|
+
}
|
|
39
|
+
) : t.label && t.icon && r === "all" && (e || m) ? /* @__PURE__ */ l(
|
|
40
|
+
_,
|
|
41
|
+
{
|
|
42
|
+
mode: "tertiary",
|
|
43
|
+
label: m ? t.label : "",
|
|
44
|
+
size: s ?? "m",
|
|
45
|
+
childrenLeft: e && /* @__PURE__ */ l(a, { icon: t.icon }),
|
|
46
|
+
childrenRight: /* @__PURE__ */ l(a, { icon: n ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
|
|
47
|
+
onClick: () => o(!n)
|
|
56
48
|
}
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
"div",
|
|
49
|
+
) : /* @__PURE__ */ l(
|
|
50
|
+
_,
|
|
60
51
|
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
mode: "tertiary",
|
|
53
|
+
label: "Sélectionner",
|
|
54
|
+
size: s ?? "m",
|
|
55
|
+
onClick: () => o(!n)
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ u("div", { className: c.selectContainer, children: [
|
|
60
|
+
x(),
|
|
61
|
+
/* @__PURE__ */ l(
|
|
62
|
+
g,
|
|
63
|
+
{
|
|
64
|
+
ref: k,
|
|
65
|
+
open: n,
|
|
66
|
+
onClose: () => o(!1),
|
|
67
|
+
className: c.modal,
|
|
68
|
+
position: L,
|
|
69
|
+
children: /* @__PURE__ */ l("div", { className: c.selectList, children: h.map((e) => /* @__PURE__ */ u(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: `${c.children} ${e.value === t.value ? c.active : ""}`,
|
|
73
|
+
onClick: () => w(e),
|
|
74
|
+
children: [
|
|
75
|
+
e.icon && /* @__PURE__ */ l(a, { icon: e.icon }),
|
|
76
|
+
e.label && /* @__PURE__ */ l("div", { className: c.itemLabel, children: e.label })
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
e.value
|
|
80
|
+
)) })
|
|
81
|
+
}
|
|
82
|
+
)
|
|
68
83
|
] });
|
|
69
84
|
};
|
|
70
85
|
export {
|
|
71
|
-
|
|
86
|
+
K as Select
|
|
72
87
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { KeyboardEvent, FC, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SelectFilterInputTagsProps {
|
|
4
|
+
/** Elements to display before the input (usually selected tags) */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** The current value of the input field */
|
|
7
|
+
inputValue: string;
|
|
8
|
+
/** Callback triggered when the input value changes */
|
|
9
|
+
handleInputChange: (value: string) => void;
|
|
10
|
+
/** Optional handler for key down events (e.g., Enter to submit) */
|
|
11
|
+
handleKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A component that wraps an input field for filtering and tagging functionality,
|
|
15
|
+
* allowing children to be displayed alongside the input (e.g., selected tags).
|
|
16
|
+
*/
|
|
17
|
+
export declare const SelectFilterInputTags: FC<SelectFilterInputTagsProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import '../../styles/Size.css';import '../../styles/index.css';import '../../styles/SelectFilterInputTags.css';/* empty css */
|
|
3
|
+
import "react";
|
|
4
|
+
import { Input as c } from "../input/Input.js";
|
|
5
|
+
import "../modal/Modal.js";
|
|
6
|
+
import "../theme/ThemeContext.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
const a = "_listTagSelect_2v3fb_6", u = "_flexAutoSize_2v3fb_24", n = {
|
|
9
|
+
listTagSelect: a,
|
|
10
|
+
flexAutoSize: u
|
|
11
|
+
}, v = ({ children: l, inputValue: o, handleInputChange: s, handleKeyDown: i }) => /* @__PURE__ */ e("div", { className: n.listTagSelect, children: /* @__PURE__ */ r("div", { children: [
|
|
12
|
+
l,
|
|
13
|
+
/* @__PURE__ */ e("div", { className: "flexAutoSize", children: /* @__PURE__ */ e(
|
|
14
|
+
c,
|
|
15
|
+
{
|
|
16
|
+
type: "text",
|
|
17
|
+
value: o,
|
|
18
|
+
onKeyDown: (t) => {
|
|
19
|
+
t.key === "Enter" && i && i(t);
|
|
20
|
+
},
|
|
21
|
+
onChange: (t) => s(t.target.value),
|
|
22
|
+
autoFocus: !0,
|
|
23
|
+
placeholder: "",
|
|
24
|
+
status: "ghost",
|
|
25
|
+
sizeStyle: "s"
|
|
26
|
+
}
|
|
27
|
+
) })
|
|
28
|
+
] }) });
|
|
29
|
+
export {
|
|
30
|
+
v as SelectFilterInputTags
|
|
31
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Props for the SelectMultiItems component */
|
|
4
|
+
export interface SelectMultiItemsProps {
|
|
5
|
+
/** Label displayed on the button */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Optional icon displayed on the left of the button */
|
|
8
|
+
iconButton?: ReactNode;
|
|
9
|
+
/** Number of selected items to display */
|
|
10
|
+
selectedCount?: number;
|
|
11
|
+
/** Callback to clear the current selection */
|
|
12
|
+
onClearSelection?: () => void;
|
|
13
|
+
/** Content displayed inside the modal */
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/** Size of the button */
|
|
16
|
+
size?: 's' | 'm' | 'l' | 'xl';
|
|
17
|
+
/** Modal alignment relative to the button */
|
|
18
|
+
align?: "left" | "right";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A button component that toggles a modal to select multiple items.
|
|
22
|
+
* Displays the number of selected items and an icon to clear the selection.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SelectMultiItems: FC<SelectMultiItemsProps>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useRef as h } from "react";
|
|
3
|
+
import { R as v, I as C, D as x } from "../../X-Bd1VjKAF.mjs";
|
|
4
|
+
import { Button as M } from "../button/Button.js";
|
|
5
|
+
import '../../styles/Size.css';import '../../styles/index.css';import '../../styles/SelectMultiItems.css';/* empty css */
|
|
6
|
+
import { TagCounter as R } from "../tag-counter/TagCounter.js";
|
|
7
|
+
import { Modal as w } from "../modal/Modal.js";
|
|
8
|
+
import "../theme/ThemeContext.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
const y = "_relative_w7e9a_6", I = "_tagCounter_w7e9a_10", N = "_modal_w7e9a_18", r = {
|
|
11
|
+
relative: y,
|
|
12
|
+
tagCounter: I,
|
|
13
|
+
modal: N
|
|
14
|
+
}, T = ({
|
|
15
|
+
label: s,
|
|
16
|
+
iconButton: l,
|
|
17
|
+
selectedCount: t = 0,
|
|
18
|
+
onClearSelection: n,
|
|
19
|
+
children: m,
|
|
20
|
+
size: c = "m",
|
|
21
|
+
align: p = "right"
|
|
22
|
+
}) => {
|
|
23
|
+
const [e, a] = _(!1), d = h(null), f = () => a(!1), g = t > 0 ? /* @__PURE__ */ o(v, { onClick: n }) : e ? /* @__PURE__ */ o(C, {}) : /* @__PURE__ */ o(x, {}), u = t > 0 ? "secondary" : "tertiary";
|
|
24
|
+
return /* @__PURE__ */ i("div", { className: r.relative, children: [
|
|
25
|
+
/* @__PURE__ */ o(
|
|
26
|
+
M,
|
|
27
|
+
{
|
|
28
|
+
label: s,
|
|
29
|
+
mode: u,
|
|
30
|
+
size: c,
|
|
31
|
+
childrenLeft: l,
|
|
32
|
+
childrenRight: /* @__PURE__ */ i("div", { className: r.tagCounter, children: [
|
|
33
|
+
t > 0 && /* @__PURE__ */ o(R, { size: "s", label: t }),
|
|
34
|
+
g
|
|
35
|
+
] }),
|
|
36
|
+
onClick: () => a(!e)
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ o(w, { ref: d, open: e, onClose: f, className: r.modal, position: { top: "calc(100% + 6px)", ...p === "right" ? { left: "0" } : { right: "0" } }, children: m })
|
|
40
|
+
] });
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
T as SelectMultiItems
|
|
44
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { Size } from '../interface';
|
|
3
|
+
|
|
4
|
+
import * as PhosphorIcons from "@phosphor-icons/react";
|
|
5
|
+
/**
|
|
6
|
+
* A customizable toggle switch component with support for controlled and uncontrolled usage.
|
|
7
|
+
* You can pass a default value, retrieve its state through `onChange`, or control it manually via `checked`.
|
|
8
|
+
*/
|
|
9
|
+
export interface SwitchProps {
|
|
10
|
+
/** Optional size of the switch (e.g., 's', 'm', 'l', 'xl') */
|
|
11
|
+
size?: Size;
|
|
12
|
+
/** Controls the checked state of the switch (controlled mode) */
|
|
13
|
+
checked?: boolean;
|
|
14
|
+
/** Sets the default checked state of the switch (uncontrolled mode) */
|
|
15
|
+
defaultChecked?: boolean;
|
|
16
|
+
/** Callback triggered when the switch value changes */
|
|
17
|
+
onChange?: (checked: boolean) => void;
|
|
18
|
+
/** Optional content to display next to the switch */
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/** Disables the switch if true */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Optional variant of the switch (classic, icon) */
|
|
23
|
+
variant?: 'classic' | 'icon';
|
|
24
|
+
/** Optional icons of the IconButton */
|
|
25
|
+
icons?: {
|
|
26
|
+
left: keyof typeof PhosphorIcons;
|
|
27
|
+
right: keyof typeof PhosphorIcons;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare const Switch: FC<SwitchProps>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsxs as m, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useEffect as b } from "react";
|
|
3
|
+
import '../../styles/Size.css';import '../../styles/index.css';import '../../styles/Switch.css';/* empty css */
|
|
4
|
+
import { IconButton as k } from "../icon-button/IconButton.js";
|
|
5
|
+
import { Icon as g } from "../icon/Icon.js";
|
|
6
|
+
import "../modal/Modal.js";
|
|
7
|
+
import "../theme/ThemeContext.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
const y = "_slider_1mxgk_21", I = "_s_1mxgk_6", N = "_m_1mxgk_58", S = "_l_1mxgk_75", j = "_xl_1mxgk_92", B = "_disabled_1mxgk_110", E = "_wrapper_1mxgk_121", R = "_button_1mxgk_136", T = "_active_1mxgk_145", t = {
|
|
10
|
+
switch: "_switch_1mxgk_6",
|
|
11
|
+
slider: y,
|
|
12
|
+
s: I,
|
|
13
|
+
m: N,
|
|
14
|
+
l: S,
|
|
15
|
+
xl: j,
|
|
16
|
+
disabled: B,
|
|
17
|
+
wrapper: E,
|
|
18
|
+
button: R,
|
|
19
|
+
active: T
|
|
20
|
+
}, K = ({
|
|
21
|
+
size: i = "m",
|
|
22
|
+
variant: w = "classic",
|
|
23
|
+
checked: l,
|
|
24
|
+
onChange: s,
|
|
25
|
+
children: _,
|
|
26
|
+
disabled: r = !1,
|
|
27
|
+
defaultChecked: h = !1,
|
|
28
|
+
icons: a = { left: "Table", right: "Rows" }
|
|
29
|
+
}) => {
|
|
30
|
+
const o = l !== void 0, [p, n] = $(h), u = o ? l : p, d = (e) => {
|
|
31
|
+
o || n(e), s == null || s(e);
|
|
32
|
+
}, v = (e) => {
|
|
33
|
+
const f = e.target.checked;
|
|
34
|
+
r || (o || n(f), s == null || s(f));
|
|
35
|
+
};
|
|
36
|
+
b(() => {
|
|
37
|
+
o && n(l);
|
|
38
|
+
}, [l, o]);
|
|
39
|
+
const x = () => {
|
|
40
|
+
switch (i) {
|
|
41
|
+
case "s":
|
|
42
|
+
return 18;
|
|
43
|
+
case "m":
|
|
44
|
+
return 18;
|
|
45
|
+
case "l":
|
|
46
|
+
return 22;
|
|
47
|
+
case "xl":
|
|
48
|
+
return 26;
|
|
49
|
+
default:
|
|
50
|
+
return 18;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return w === "icon" ? /* @__PURE__ */ m("div", { className: `${t.switch} ${t[i]}`, children: [
|
|
54
|
+
/* @__PURE__ */ m("div", { className: `${t.wrapper} ${r ? t.disabled : ""}`, children: [
|
|
55
|
+
/* @__PURE__ */ c(
|
|
56
|
+
k,
|
|
57
|
+
{
|
|
58
|
+
mode: u ? "ghost" : "tertiary",
|
|
59
|
+
size: i,
|
|
60
|
+
onClick: () => d(!1),
|
|
61
|
+
disabled: r,
|
|
62
|
+
children: /* @__PURE__ */ c(g, { icon: a.left, size: x() })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ c(
|
|
66
|
+
k,
|
|
67
|
+
{
|
|
68
|
+
mode: u ? "tertiary" : "ghost",
|
|
69
|
+
size: i,
|
|
70
|
+
onClick: () => d(!0),
|
|
71
|
+
disabled: r,
|
|
72
|
+
children: /* @__PURE__ */ c(g, { icon: a.right, size: x() })
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] }),
|
|
76
|
+
_
|
|
77
|
+
] }) : /* @__PURE__ */ m("div", { className: `${t.switch} ${t[i]} ${r ? t.disabled : ""}`, children: [
|
|
78
|
+
/* @__PURE__ */ c(
|
|
79
|
+
"input",
|
|
80
|
+
{
|
|
81
|
+
type: "checkbox",
|
|
82
|
+
checked: p,
|
|
83
|
+
onChange: (e) => v(e),
|
|
84
|
+
disabled: r
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ c("span", { className: t.slider }),
|
|
88
|
+
_
|
|
89
|
+
] });
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
K as Switch
|
|
93
|
+
};
|
|
@@ -12,4 +12,8 @@ export interface TabsProps {
|
|
|
12
12
|
/** Callback function to handle tab selection, receiving the selected tab's label */
|
|
13
13
|
onTabSelect: (selectedItem: string | ReactNode) => void;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Tabs component that allows tab navigation with text, icons, or buttons.
|
|
17
|
+
* It includes a dynamic underline to show the active tab.
|
|
18
|
+
*/
|
|
15
19
|
export declare const Tabs: FC<TabsProps>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsxs as H, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as f, useRef as u, useLayoutEffect as C, useEffect as $ } from "react";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import '../../styles/index.css';import '../../styles/Tabs.css';/* empty css */
|
|
4
|
+
import { Button as p } from "../button/Button.js";
|
|
5
|
+
import { IconButton as B } from "../icon-button/IconButton.js";
|
|
6
|
+
const N = "_underline_udv7v_50", n = {
|
|
6
7
|
"tab-container": "_tab-container_udv7v_23",
|
|
7
8
|
"tab-container-button": "_tab-container-button_udv7v_27",
|
|
8
9
|
"tab-container-icon": "_tab-container-icon_udv7v_32",
|
|
@@ -10,16 +11,16 @@ import '../../styles/Tabs.css';const p = "_underline_udv7v_50", n = {
|
|
|
10
11
|
"tab-items": "_tab-items_udv7v_35",
|
|
11
12
|
"tab-items-button": "_tab-items-button_udv7v_39",
|
|
12
13
|
"selected-button": "_selected-button_udv7v_44",
|
|
13
|
-
underline:
|
|
14
|
+
underline: N,
|
|
14
15
|
"flexHorizontal-center": "_flexHorizontal-center_udv7v_58",
|
|
15
16
|
"flexHorizontal-left": "_flexHorizontal-left_udv7v_64",
|
|
16
17
|
"flexHorizontal-right": "_flexHorizontal-right_udv7v_70"
|
|
17
|
-
},
|
|
18
|
-
const [l, b] = f(
|
|
18
|
+
}, E = ({ listItems: c, type: o, onTabSelect: v, defaultActiveTab: i = 0, position: m = "left" }) => {
|
|
19
|
+
const [l, b] = f(i), [x, h] = f({}), a = u(null), g = u(null), _ = u(new Array(c.length).fill(null)), d = (t) => {
|
|
19
20
|
b(t), v(c[t]);
|
|
20
21
|
}, z = (t) => {
|
|
21
|
-
if (
|
|
22
|
-
const e = t.getBoundingClientRect(), s =
|
|
22
|
+
if (a.current && t) {
|
|
23
|
+
const e = t.getBoundingClientRect(), s = a.current.getBoundingClientRect();
|
|
23
24
|
h({
|
|
24
25
|
left: `${e.left - s.left}px`,
|
|
25
26
|
width: `${e.width}px`
|
|
@@ -33,15 +34,15 @@ import '../../styles/Tabs.css';const p = "_underline_udv7v_50", n = {
|
|
|
33
34
|
const t = _.current[l];
|
|
34
35
|
t && z(t);
|
|
35
36
|
}, [l]), $(() => {
|
|
36
|
-
b(
|
|
37
|
-
}, [
|
|
37
|
+
b(i);
|
|
38
|
+
}, [i]), /* @__PURE__ */ H("div", { className: `tab ${n["tab-container"]} ${n[`tab-container-${o}`]}`, ref: a, children: [
|
|
38
39
|
/* @__PURE__ */ r("div", { className: R, children: c.map((t, e) => /* @__PURE__ */ r(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
42
|
ref: (s) => _.current[e] = s,
|
|
42
43
|
className: o === "button" && e === l ? n["selected-button"] : "",
|
|
43
44
|
children: o === "icon" ? /* @__PURE__ */ r(
|
|
44
|
-
|
|
45
|
+
B,
|
|
45
46
|
{
|
|
46
47
|
mode: "icon",
|
|
47
48
|
size: "s",
|
|
@@ -50,7 +51,7 @@ import '../../styles/Tabs.css';const p = "_underline_udv7v_50", n = {
|
|
|
50
51
|
children: t
|
|
51
52
|
}
|
|
52
53
|
) : /* @__PURE__ */ r(
|
|
53
|
-
|
|
54
|
+
p,
|
|
54
55
|
{
|
|
55
56
|
size: "s",
|
|
56
57
|
label: t,
|
|
@@ -66,5 +67,5 @@ import '../../styles/Tabs.css';const p = "_underline_udv7v_50", n = {
|
|
|
66
67
|
] });
|
|
67
68
|
};
|
|
68
69
|
export {
|
|
69
|
-
|
|
70
|
+
E as Tabs
|
|
70
71
|
};
|
|
@@ -15,4 +15,8 @@ export interface TagProps {
|
|
|
15
15
|
/** A callback function to be called when the tag is clicked. */
|
|
16
16
|
onClick?: () => void;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Tag component to display a label with customizable color, size, and content.
|
|
20
|
+
* It can also display a delete icon if `deletable` is true.
|
|
21
|
+
*/
|
|
18
22
|
export declare const Tag: FC<TagProps>;
|
|
@@ -2,7 +2,12 @@ import { FC } from 'react';
|
|
|
2
2
|
import { Size } from '../interface.ts';
|
|
3
3
|
|
|
4
4
|
export interface TagCounterProps {
|
|
5
|
+
/** The number label to be displayed inside the counter */
|
|
5
6
|
label: number;
|
|
7
|
+
/** The size of the tag counter, which affects its styling. */
|
|
6
8
|
size?: Size;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* TagCounter component to display a counter label with customizable size.
|
|
12
|
+
*/
|
|
8
13
|
export declare const TagCounter: FC<TagCounterProps>;
|
|
@@ -213,4 +213,13 @@ export declare const variables_dark: {
|
|
|
213
213
|
'--marker-cluster-background': string;
|
|
214
214
|
'--marker-cluster-icon-text': string;
|
|
215
215
|
'--marker-cluster-caret': string;
|
|
216
|
+
'--switch-diasbled-bullet': string;
|
|
217
|
+
'--switch-diasbled-background': string;
|
|
218
|
+
'--switch-default-off-bullet': string;
|
|
219
|
+
'--switch-default-off-background': string;
|
|
220
|
+
'--switch-default-on-bullet': string;
|
|
221
|
+
'--switch-default-on-background': string;
|
|
222
|
+
'--archive-background-tab': string;
|
|
223
|
+
'--archive-border': string;
|
|
224
|
+
'--archive-icon-text-tab': string;
|
|
216
225
|
};
|
|
@@ -212,7 +212,16 @@ const r = {
|
|
|
212
212
|
"--marker-cluster-border": "var(--color-purple-trans-50)",
|
|
213
213
|
"--marker-cluster-background": "var(--color-purple-dark-900)",
|
|
214
214
|
"--marker-cluster-icon-text": "var(--color-light-100)",
|
|
215
|
-
"--marker-cluster-caret": "var(--color-purple-dark-900)"
|
|
215
|
+
"--marker-cluster-caret": "var(--color-purple-dark-900)",
|
|
216
|
+
"--switch-diasbled-bullet": "var(--color-purple-dark-950)",
|
|
217
|
+
"--switch-diasbled-background": "var(--color-light-20)",
|
|
218
|
+
"--switch-default-off-bullet": "var(--color-purple-dark-950)",
|
|
219
|
+
"--switch-default-off-background": "var(--color-purple-trans-40)",
|
|
220
|
+
"--switch-default-on-bullet": "var(--color-purple-dark-950)",
|
|
221
|
+
"--switch-default-on-background": "var(--color-light-100)",
|
|
222
|
+
"--archive-background-tab": "var(--color-purple-dark-100)",
|
|
223
|
+
"--archive-border": "var(--color-purple-dark-100)",
|
|
224
|
+
"--archive-icon-text-tab": "var(--color-purple-dark-950)"
|
|
216
225
|
};
|
|
217
226
|
export {
|
|
218
227
|
r as variables_dark
|
|
@@ -213,4 +213,13 @@ export declare const variables_light: {
|
|
|
213
213
|
'--marker-cluster-background': string;
|
|
214
214
|
'--marker-cluster-icon-text': string;
|
|
215
215
|
'--marker-cluster-caret': string;
|
|
216
|
+
'--switch-diasbled-bullet': string;
|
|
217
|
+
'--switch-diasbled-background': string;
|
|
218
|
+
'--switch-default-off-bullet': string;
|
|
219
|
+
'--switch-default-off-background': string;
|
|
220
|
+
'--switch-default-on-bullet': string;
|
|
221
|
+
'--switch-default-on-background': string;
|
|
222
|
+
'--archive-background-tab': string;
|
|
223
|
+
'--archive-border': string;
|
|
224
|
+
'--archive-icon-text-tab': string;
|
|
216
225
|
};
|
|
@@ -212,7 +212,16 @@ const r = {
|
|
|
212
212
|
"--marker-cluster-border": "var(--color-sable-900)",
|
|
213
213
|
"--marker-cluster-background": "var(--color-sable-950)",
|
|
214
214
|
"--marker-cluster-icon-text": "var(--color-light-100)",
|
|
215
|
-
"--marker-cluster-caret": "var(--color-sable-950)"
|
|
215
|
+
"--marker-cluster-caret": "var(--color-sable-950)",
|
|
216
|
+
"--switch-diasbled-bullet": "var(--color-light-100)",
|
|
217
|
+
"--switch-diasbled-background": "var(--color-dark-20)",
|
|
218
|
+
"--switch-default-off-bullet": "var(--color-light-100)",
|
|
219
|
+
"--switch-default-off-background": "var(--color-sable-trans-40)",
|
|
220
|
+
"--switch-default-on-bullet": "var(--color-light-100)",
|
|
221
|
+
"--switch-default-on-background": "var(--color-purple-dark-950)",
|
|
222
|
+
"--archive-background-tab": "var(--color-purple-dark-950)",
|
|
223
|
+
"--archive-border": "var(--color-purple-dark-950)",
|
|
224
|
+
"--archive-icon-text-tab": "var(--color-light-100)"
|
|
216
225
|
};
|
|
217
226
|
export {
|
|
218
227
|
r as variables_light
|
|
@@ -6,4 +6,7 @@ export interface TitleProps {
|
|
|
6
6
|
/** Optional additional content to be displayed alongside the title, such as icons or other elements. */
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Title component to display a main title with optional additional content.
|
|
11
|
+
*/
|
|
9
12
|
export declare const Title: FC<TitleProps>;
|
|
@@ -13,5 +13,10 @@ export type TooltipProps = {
|
|
|
13
13
|
/** How large padding is. */
|
|
14
14
|
padding?: SizeTooltip;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Tooltip component that shows additional information when hovering over an element.
|
|
18
|
+
* The tooltip can be positioned in various ways relative to the element, and its content
|
|
19
|
+
* can be customized. It also allows control over the gap and padding around the tooltip.
|
|
20
|
+
*/
|
|
16
21
|
export declare const Tooltip: FC<TooltipProps>;
|
|
17
22
|
export default Tooltip;
|