@situaction/traq-ui-ste 1.0.13 → 1.0.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/components/button/Button.d.ts +8 -8
- package/dist/components/button/Button.js +53 -50
- package/dist/components/colors/Colors.d.ts +8 -0
- package/dist/components/colors/Colors.js +24 -0
- package/dist/components/icon-button/IconButton.d.ts +7 -5
- package/dist/components/icon-button/IconButton.js +48 -40
- package/dist/components/input/Input.d.ts +14 -11
- package/dist/components/input/Input.js +99 -121
- package/dist/components/tabs/Tabs.d.ts +4 -4
- package/dist/components/tabs/Tabs.js +31 -35
- package/dist/components/tag/Tag.d.ts +7 -8
- package/dist/components/tag/Tag.js +50 -28
- package/dist/components/theme/ThemeContext.js +2 -9
- package/dist/components/title/Title.d.ts +7 -0
- package/dist/components/title/Title.js +13 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +16 -15
- package/dist/styles/Button.css +1 -1
- package/dist/styles/Colors.css +1 -0
- package/dist/styles/IconButton.css +1 -1
- package/dist/styles/Input.css +1 -1
- package/dist/styles/Tabs.css +1 -1
- package/dist/styles/Tag.css +1 -1
- package/dist/styles/ThemeContext.css +1 -0
- package/dist/styles/Title.css +1 -0
- package/dist/styles/main.css +1 -1
- package/package.json +13 -12
- package/dist/styles/index.css +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { ButtonHTMLAttributes, FC, ReactNode } from 'react';
|
|
2
2
|
import { Color } from '../interface';
|
|
3
3
|
|
|
4
|
-
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
-
mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost'; /** Is this the principal call to action on the page? */
|
|
4
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'text'; /** Is this the principal call to action on the page? */
|
|
6
6
|
color?: Color; /** What background color to use (blue, red, ...)*/
|
|
7
7
|
colorMode?: 'light' | 'dark'; /** what mode do you use for light or dark color **/
|
|
8
8
|
size?: 's' | 'm' | 'l' | 'xl'; /** How large should the button be? */
|
|
9
9
|
label: string; /** button contents */
|
|
10
|
-
error?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
error?: boolean; /** If true, the button will be styled to indicate an error state. */
|
|
11
|
+
selected?: boolean; /** If true, the button is activated */
|
|
12
|
+
childrenLeft?: ReactNode; /** Additional content inside the input */
|
|
13
|
+
childrenRight?: ReactNode; /** Additional content inside the input */
|
|
13
14
|
onClick?: () => void; /** Optional click handler */
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Primary UI component for user interaction
|
|
17
18
|
*/
|
|
18
|
-
export declare const Button:
|
|
19
|
-
export {};
|
|
19
|
+
export declare const Button: FC<ButtonProps>;
|
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
button:
|
|
6
|
-
"button-
|
|
7
|
-
"button-
|
|
8
|
-
"button-
|
|
9
|
-
"button-
|
|
10
|
-
"button-
|
|
11
|
-
"button-
|
|
12
|
-
"button-size-
|
|
13
|
-
"button-size-
|
|
14
|
-
"button-size-
|
|
15
|
-
"button-
|
|
16
|
-
"button-gap-
|
|
17
|
-
"button-gap-
|
|
18
|
-
"button-gap-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsxs as x, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as y } from "react";
|
|
3
|
+
import '../../styles/Button.css';const j = "_button_1mr6j_38", d = "_flexHorizontalCenter_1mr6j_180", r = {
|
|
4
|
+
button: j,
|
|
5
|
+
"button-primary": "_button-primary_1mr6j_60",
|
|
6
|
+
"button-secondary": "_button-secondary_1mr6j_74",
|
|
7
|
+
"button-tertiary": "_button-tertiary_1mr6j_88",
|
|
8
|
+
"button-ghost": "_button-ghost_1mr6j_102",
|
|
9
|
+
"button-text": "_button-text_1mr6j_118",
|
|
10
|
+
"button-text-selected": "_button-text-selected_1mr6j_131",
|
|
11
|
+
"button-error": "_button-error_1mr6j_137",
|
|
12
|
+
"button-size-xl": "_button-size-xl_1mr6j_150",
|
|
13
|
+
"button-size-l": "_button-size-l_1mr6j_155",
|
|
14
|
+
"button-size-m": "_button-size-m_1mr6j_160",
|
|
15
|
+
"button-size-s": "_button-size-s_1mr6j_165",
|
|
16
|
+
"button-gap-xl": "_button-gap-xl_1mr6j_170",
|
|
17
|
+
"button-gap-l": "_button-gap-l_1mr6j_173",
|
|
18
|
+
"button-gap-m": "_button-gap-m_1mr6j_176",
|
|
19
|
+
"button-gap-s": "_button-gap-s_1mr6j_176",
|
|
20
|
+
flexHorizontalCenter: d
|
|
21
|
+
}, z = ({
|
|
22
|
+
mode: o = "primary",
|
|
23
|
+
size: a = "m",
|
|
22
24
|
color: t,
|
|
23
|
-
colorMode:
|
|
24
|
-
label:
|
|
25
|
-
error:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
colorMode: n,
|
|
26
|
+
label: u,
|
|
27
|
+
error: b,
|
|
28
|
+
selected: i,
|
|
29
|
+
childrenLeft: s,
|
|
30
|
+
childrenRight: _,
|
|
31
|
+
...m
|
|
29
32
|
}) => {
|
|
30
|
-
const l = () =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
const l = () => b ? "error" : o;
|
|
34
|
+
y(() => {
|
|
35
|
+
n && !t && console.warn("`colorMode` is defined but `color` is missing. `colorMode` will be ignored.");
|
|
33
36
|
}, [t]);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"--dynamic-color": t ? `var(--color-${t}
|
|
43
|
-
"--dynamic-color
|
|
44
|
-
"--dynamic-color-
|
|
45
|
-
"--dynamic-color-
|
|
37
|
+
const c = [
|
|
38
|
+
r.button,
|
|
39
|
+
r[`button-${l()}`],
|
|
40
|
+
r[`button-size-${a}`],
|
|
41
|
+
r[`button-gap-${a}`],
|
|
42
|
+
i && o === "text" && r["button-text-selected"],
|
|
43
|
+
r.flexHorizontalCenter
|
|
44
|
+
].join(" "), p = {
|
|
45
|
+
"--dynamic-color-text": t ? n === "dark" ? `var(--color-${t}-900)` : "var(--color-light-100)" : "var(--btn-primary-color-text)",
|
|
46
|
+
"--dynamic-color": t ? `var(--color-${t}-${n === "dark" ? "200" : "900"})` : "var(--btn-primary-color)",
|
|
47
|
+
"--dynamic-color-hover": t ? `var(--color-${t}-${n === "dark" ? "100" : "800"})` : "var(--btn-primary-color-hover)",
|
|
48
|
+
"--dynamic-color-activated": t ? `var(--color-${t}-${n === "dark" ? "50" : "700"})` : "var(--btn-primary-color-activated)"
|
|
46
49
|
};
|
|
47
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ x(
|
|
48
51
|
"button",
|
|
49
52
|
{
|
|
50
53
|
type: "button",
|
|
51
|
-
className:
|
|
52
|
-
style:
|
|
53
|
-
...
|
|
54
|
+
className: c,
|
|
55
|
+
style: o === "primary" ? p : void 0,
|
|
56
|
+
...m,
|
|
54
57
|
children: [
|
|
55
|
-
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
58
|
+
s && /* @__PURE__ */ e("span", { className: r.flexHorizontalCenter, children: s }),
|
|
59
|
+
/* @__PURE__ */ e("span", { children: u }),
|
|
60
|
+
_ && /* @__PURE__ */ e("span", { className: r.flexHorizontalCenter, children: _ })
|
|
58
61
|
]
|
|
59
62
|
}
|
|
60
63
|
);
|
|
61
64
|
};
|
|
62
65
|
export {
|
|
63
|
-
|
|
66
|
+
z as Button
|
|
64
67
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import '../../styles/Colors.css';const n = "_palette_l21ra_6", d = "_colors_l21ra_13", i = "_desc_l21ra_26", h = "_hex_l21ra_35", s = {
|
|
3
|
+
palette: n,
|
|
4
|
+
colors: d,
|
|
5
|
+
desc: i,
|
|
6
|
+
hex: h
|
|
7
|
+
}, v = ({ color: t, hex: o }) => {
|
|
8
|
+
const r = t === "light" ? ["05", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"] : ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
|
|
9
|
+
return /* @__PURE__ */ e("div", { className: s.palette, children: o.map((c, a) => /* @__PURE__ */ l("div", { className: s.colors, children: [
|
|
10
|
+
/* @__PURE__ */ e("div", { style: { backgroundColor: c } }),
|
|
11
|
+
/* @__PURE__ */ l("div", { className: s.desc, children: [
|
|
12
|
+
/* @__PURE__ */ l("div", { children: [
|
|
13
|
+
"color-",
|
|
14
|
+
t,
|
|
15
|
+
"-",
|
|
16
|
+
r[a]
|
|
17
|
+
] }),
|
|
18
|
+
/* @__PURE__ */ e("div", { className: s.hex, children: c })
|
|
19
|
+
] })
|
|
20
|
+
] })) });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
v as default
|
|
24
|
+
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { FC, ReactElement } from 'react';
|
|
2
2
|
import { Color } from '../interface';
|
|
3
3
|
|
|
4
|
-
interface IconButtonProps {
|
|
5
|
-
mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost';
|
|
4
|
+
export interface IconButtonProps {
|
|
5
|
+
mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'icon'; /** Specifies the visual style of the button. */
|
|
6
6
|
color?: Color; /** What background color to use (blue, red, ...)*/
|
|
7
7
|
colorMode?: 'light' | 'dark'; /** what mode do you use for light or dark color **/
|
|
8
|
-
size?: '
|
|
9
|
-
|
|
8
|
+
size?: 's' | 'm' | 'l' | 'xl'; /** How large should the button be? */
|
|
9
|
+
round?: boolean; /** If true, the button will have rounded corners. */
|
|
10
|
+
error?: boolean; /** If true, the button will be styled to indicate an error state. */
|
|
11
|
+
selected?: boolean; /** If true, the button is activated */
|
|
12
|
+
disabled?: boolean; /** If true, the button will be disabled and non-interactive. */
|
|
10
13
|
children: ReactElement; /** Only icons (React elements) allowed inside the button */
|
|
11
14
|
onClick?: () => void; /** Optional click handler */
|
|
12
15
|
}
|
|
13
16
|
export declare const IconButton: FC<IconButtonProps>;
|
|
14
|
-
export {};
|
|
@@ -1,52 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import '../../styles/IconButton.css';const
|
|
4
|
-
button:
|
|
5
|
-
"button-
|
|
6
|
-
"button-
|
|
7
|
-
"button-
|
|
8
|
-
"button-
|
|
9
|
-
"button-
|
|
10
|
-
"button-
|
|
11
|
-
"button-
|
|
12
|
-
"button-
|
|
13
|
-
"button-size-
|
|
14
|
-
"button-size-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as y } from "react";
|
|
3
|
+
import '../../styles/IconButton.css';const k = "_button_7dkt1_38", x = "_flexHorizontalCenter_7dkt1_175", o = {
|
|
4
|
+
button: k,
|
|
5
|
+
"button-round": "_button-round_7dkt1_66",
|
|
6
|
+
"button-primary": "_button-primary_7dkt1_69",
|
|
7
|
+
"button-secondary": "_button-secondary_7dkt1_82",
|
|
8
|
+
"button-tertiary": "_button-tertiary_7dkt1_96",
|
|
9
|
+
"button-ghost": "_button-ghost_7dkt1_110",
|
|
10
|
+
"button-text": "_button-text_7dkt1_123",
|
|
11
|
+
"button-text-selected": "_button-text-selected_7dkt1_135",
|
|
12
|
+
"button-error": "_button-error_7dkt1_141",
|
|
13
|
+
"button-size-xl": "_button-size-xl_7dkt1_154",
|
|
14
|
+
"button-size-l": "_button-size-l_7dkt1_159",
|
|
15
|
+
"button-size-m": "_button-size-m_7dkt1_164",
|
|
16
|
+
"button-size-s": "_button-size-s_7dkt1_169",
|
|
17
|
+
flexHorizontalCenter: x
|
|
18
|
+
}, f = ({
|
|
19
|
+
mode: r = "primary",
|
|
17
20
|
color: t,
|
|
18
|
-
colorMode:
|
|
19
|
-
size:
|
|
20
|
-
error:
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
colorMode: n,
|
|
22
|
+
size: e = "m",
|
|
23
|
+
error: u,
|
|
24
|
+
selected: i,
|
|
25
|
+
round: a,
|
|
26
|
+
disabled: _,
|
|
27
|
+
children: b,
|
|
28
|
+
onClick: s
|
|
23
29
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
const d = () => u ? "error" : r;
|
|
31
|
+
y(() => {
|
|
32
|
+
n && !t && console.warn("`colorMode` is defined but `color` is missing. `colorMode` will be ignored.");
|
|
27
33
|
}, [t]);
|
|
28
|
-
const
|
|
34
|
+
const l = [
|
|
29
35
|
o.button,
|
|
30
|
-
o[`button-${
|
|
31
|
-
o[
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"--dynamic-color-
|
|
37
|
-
"--dynamic-color
|
|
38
|
-
"--dynamic-color-
|
|
36
|
+
o[`button-${d()}`],
|
|
37
|
+
a && o["button-round"],
|
|
38
|
+
o[`button-size-${e}`],
|
|
39
|
+
i && r === "icon" && o["button-text-selected"],
|
|
40
|
+
o.flexHorizontalCenter
|
|
41
|
+
].join(" "), c = {
|
|
42
|
+
"--dynamic-color-text": t ? n === "dark" ? "var(--primary-color-900)" : "var(--color-light-100)" : "var(--btn-primary-color-text)",
|
|
43
|
+
"--dynamic-color": t ? `var(--color-${t}-${n === "dark" ? "200" : "900"})` : "var(--btn-primary-color)",
|
|
44
|
+
"--dynamic-color-hover": t ? `var(--color-${t}-${n === "dark" ? "100" : "800"})` : "var(--btn-primary-color-hover)",
|
|
45
|
+
"--dynamic-color-activated": t ? `var(--color-${t}-${n === "dark" ? "50" : "700"})` : "var(--btn-primary-color-activated)"
|
|
39
46
|
};
|
|
40
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ m(
|
|
41
48
|
"button",
|
|
42
49
|
{
|
|
43
|
-
className:
|
|
44
|
-
style:
|
|
45
|
-
onClick:
|
|
46
|
-
|
|
50
|
+
className: l,
|
|
51
|
+
style: c,
|
|
52
|
+
onClick: s,
|
|
53
|
+
disabled: _,
|
|
54
|
+
children: b
|
|
47
55
|
}
|
|
48
56
|
);
|
|
49
57
|
};
|
|
50
58
|
export {
|
|
51
|
-
|
|
59
|
+
f as IconButton
|
|
52
60
|
};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { FC, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
4
|
sizeStyle?: 's' | 'm' | 'l' | 'xl'; /** How large should the input be? */
|
|
5
|
-
label: string; /** input
|
|
6
|
-
labelUnit?: string;
|
|
5
|
+
label: string; /** The label or placeholder text for the input field */
|
|
6
|
+
labelUnit?: string; /** Optional unit or additional label to display next to the input */
|
|
7
|
+
dark?: boolean; /** Toggle for dark mode styling */
|
|
7
8
|
color?: string; /** red, green, blue, pink **/
|
|
9
|
+
classNames?: string; /** class names for parent div due to general input props (input elem takes every other props in <Input/> component) **/
|
|
10
|
+
focusBackground?: boolean; /** Whether to change the background color when the input is focused */
|
|
8
11
|
status?: 'default' | 'error' | 'success' | 'ternary'; /** input status style **/
|
|
9
|
-
ghost?: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
ghost?: boolean; /** Whether to apply a ghost style (transparent background) */
|
|
13
|
+
round?: boolean; /** If true, the input will have rounded corners */
|
|
14
|
+
iconLeft?: ReactNode; /** Icon or element to display on the left side of the input */
|
|
15
|
+
iconRight?: ReactNode; /** Icon or element to display on the right side of the input */
|
|
16
|
+
defaultValue?: string; /** Default value for the input field */
|
|
17
|
+
disabled?: boolean; /** Disable the input field */
|
|
14
18
|
}
|
|
15
|
-
export declare const Input:
|
|
16
|
-
export {};
|
|
19
|
+
export declare const Input: FC<InputProps>;
|
|
@@ -1,132 +1,110 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import '../../styles/Input.css';const A = "
|
|
4
|
-
"input-style": "_input-
|
|
5
|
-
"input-style-ghost": "_input-style-
|
|
6
|
-
"input-style-disabled": "_input-style-
|
|
7
|
-
"input-style-focused": "_input-style-
|
|
8
|
-
"input-
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"input-style-error": "_input-style-
|
|
12
|
-
"input-style-
|
|
13
|
-
"input-style-
|
|
14
|
-
"input-style-success": "_input-style-
|
|
15
|
-
"input-style-success-
|
|
16
|
-
"input-
|
|
17
|
-
"floating-
|
|
18
|
-
"floating-
|
|
19
|
-
"floating-
|
|
20
|
-
"floating-
|
|
21
|
-
"floating-input-size-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"input-style-size-l": "_input-style-size-l_1in9x_488",
|
|
30
|
-
"input-style-size-m": "_input-style-size-m_1in9x_494",
|
|
31
|
-
"input-style-size-s": "_input-style-size-s_1in9x_500"
|
|
1
|
+
import { jsxs as _, jsx as s, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useRef as q } from "react";
|
|
3
|
+
import '../../styles/Input.css';const A = "_flexHorizontalBetween_dkt9v_197", E = "_flexHorizontal_dkt9v_197", t = {
|
|
4
|
+
"input-style": "_input-style_dkt9v_65",
|
|
5
|
+
"input-style-ghost": "_input-style-ghost_dkt9v_76",
|
|
6
|
+
"input-style-disabled": "_input-style-disabled_dkt9v_81",
|
|
7
|
+
"input-style-focused": "_input-style-focused_dkt9v_90",
|
|
8
|
+
"input-style-error": "_input-style-error_dkt9v_95",
|
|
9
|
+
"input-style-error-focused": "_input-style-error-focused_dkt9v_102",
|
|
10
|
+
"input-style-error-focus-background": "_input-style-error-focus-background_dkt9v_108",
|
|
11
|
+
"input-style-error-disabled": "_input-style-error-disabled_dkt9v_111",
|
|
12
|
+
"input-style-success": "_input-style-success_dkt9v_119",
|
|
13
|
+
"input-style-success-focused": "_input-style-success-focused_dkt9v_126",
|
|
14
|
+
"input-style-success-focus-background": "_input-style-success-focus-background_dkt9v_132",
|
|
15
|
+
"input-style-success-disabled": "_input-style-success-disabled_dkt9v_135",
|
|
16
|
+
"input-container": "_input-container_dkt9v_143",
|
|
17
|
+
"floating-input": "_floating-input_dkt9v_147",
|
|
18
|
+
"floating-input-size-xl": "_floating-input-size-xl_dkt9v_153",
|
|
19
|
+
"floating-input-size-l": "_floating-input-size-l_dkt9v_157",
|
|
20
|
+
"floating-input-size-m": "_floating-input-size-m_dkt9v_161",
|
|
21
|
+
"floating-input-size-s": "_floating-input-size-s_dkt9v_165",
|
|
22
|
+
"input-style-size-xl": "_input-style-size-xl_dkt9v_169",
|
|
23
|
+
"input-style-size-l": "_input-style-size-l_dkt9v_175",
|
|
24
|
+
"input-style-size-m": "_input-style-size-m_dkt9v_181",
|
|
25
|
+
"input-style-size-s": "_input-style-size-s_dkt9v_187",
|
|
26
|
+
"input-style-radius": "_input-style-radius_dkt9v_193",
|
|
27
|
+
flexHorizontalBetween: A,
|
|
28
|
+
flexHorizontal: E
|
|
32
29
|
}, K = ({
|
|
33
|
-
sizeStyle:
|
|
34
|
-
label:
|
|
35
|
-
labelUnit:
|
|
30
|
+
sizeStyle: u = "m",
|
|
31
|
+
label: f,
|
|
32
|
+
labelUnit: o,
|
|
36
33
|
color: n,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
dark: r,
|
|
35
|
+
focusBackground: l,
|
|
36
|
+
status: a = "default",
|
|
37
|
+
ghost: v = !1,
|
|
38
|
+
iconLeft: c,
|
|
39
|
+
iconRight: p,
|
|
40
|
+
round: k,
|
|
41
|
+
classNames: g,
|
|
42
|
+
disabled: i,
|
|
43
|
+
defaultValue: m,
|
|
44
|
+
...z
|
|
44
45
|
}) => {
|
|
45
|
-
const [
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
e["input-style-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
46
|
+
const [e, d] = y(!1), [b, h] = y(m || ""), x = q(null), $ = () => d(!0), H = () => d(!1), S = (D) => {
|
|
47
|
+
h(D.target.value);
|
|
48
|
+
}, j = [
|
|
49
|
+
t["input-style"],
|
|
50
|
+
t[`input-style-size-${u}`],
|
|
51
|
+
t[`input-style-gap-${a}`],
|
|
52
|
+
k && t["input-style-radius"],
|
|
53
|
+
t.flexHorizontalBetween,
|
|
54
|
+
"gap4",
|
|
55
|
+
v && t["input-style-ghost"]
|
|
56
|
+
].filter(Boolean).join(" "), B = [
|
|
57
|
+
e && t["input-style-focused"],
|
|
58
|
+
i && t["input-style-disabled"]
|
|
59
|
+
].filter(Boolean).join(" "), N = [
|
|
60
|
+
t["input-style-error"],
|
|
61
|
+
i && t["input-style-error-disabled"],
|
|
62
|
+
e && t["input-style-error-focused"],
|
|
63
|
+
e && l && t["input-style-error-focus-background"]
|
|
64
|
+
].filter(Boolean).join(" "), C = [
|
|
65
|
+
t["input-style-success"],
|
|
66
|
+
i && t["input-style-success-disabled"],
|
|
67
|
+
e && t["input-style-success-focused"],
|
|
68
|
+
e && l && t["input-style-success-focus-background"]
|
|
69
|
+
].filter(Boolean).join(" "), w = () => {
|
|
70
|
+
switch (a) {
|
|
66
71
|
case "error":
|
|
67
|
-
return
|
|
72
|
+
return N;
|
|
68
73
|
case "success":
|
|
69
|
-
return
|
|
74
|
+
return C;
|
|
70
75
|
default:
|
|
71
|
-
return
|
|
76
|
+
return B;
|
|
72
77
|
}
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
].join(" "),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"--dynamic-color": `${n}`,
|
|
81
|
-
"--dynamic-color-border": `$color-${n}-300`,
|
|
82
|
-
"--dynamic-background-color": `$color-${n}-50`
|
|
78
|
+
}, F = [
|
|
79
|
+
t["floating-input"],
|
|
80
|
+
t[`floating-input-size-${u}`]
|
|
81
|
+
].join(" "), I = {
|
|
82
|
+
"--dynamic-color": `var(--color-${n}-${r ? "800" : "300"})`,
|
|
83
|
+
"--dynamic-color-border": `var(--color-${n}-${r ? "800" : "300"})`,
|
|
84
|
+
"--dynamic-background-color": `${l ? `var(--color-${n}-50)` : "transparent"}`
|
|
83
85
|
}, V = {
|
|
84
|
-
"--dynamic-color": "var(--
|
|
85
|
-
"--dynamic-color-border": "
|
|
86
|
-
"--dynamic-background-color": "
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
className:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
style: n ? w : V,
|
|
107
|
-
children: [
|
|
108
|
-
r && /* @__PURE__ */ t("div", { className: W, ref: u }),
|
|
109
|
-
l && (o === "left" || o === "both") && /* @__PURE__ */ t("span", { className: "flexHorizontal", children: l }),
|
|
110
|
-
/* @__PURE__ */ f("div", { className: e["input-container"], children: [
|
|
111
|
-
/* @__PURE__ */ t(
|
|
112
|
-
"input",
|
|
113
|
-
{
|
|
114
|
-
className: k,
|
|
115
|
-
placeholder: " ",
|
|
116
|
-
value: r,
|
|
117
|
-
onChange: j,
|
|
118
|
-
...B
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
/* @__PURE__ */ t("label", { className: I, ref: s, children: b })
|
|
122
|
-
] }),
|
|
123
|
-
l && (o === "right" || o === "both") && /* @__PURE__ */ f(O, { children: [
|
|
124
|
-
/* @__PURE__ */ t("div", { children: m }),
|
|
125
|
-
/* @__PURE__ */ t("span", { className: "flexHorizontal", children: l })
|
|
126
|
-
] })
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
);
|
|
86
|
+
"--dynamic-color": "var(--color-blue-situaction-800)",
|
|
87
|
+
"--dynamic-color-border": "var(--color-blue-situaction-800)",
|
|
88
|
+
"--dynamic-background-color": `${l ? "var(--color-blue-situaction-50)" : "transparent"}`
|
|
89
|
+
};
|
|
90
|
+
return /* @__PURE__ */ _("div", { ref: x, className: `input-style ${j} ${g} ${w()} gap-xs-2`, onFocus: $, onBlur: H, style: n ? I : V, children: [
|
|
91
|
+
c && /* @__PURE__ */ s("span", { className: "", children: c }),
|
|
92
|
+
/* @__PURE__ */ s("div", { className: t["input-container"], children: /* @__PURE__ */ s(
|
|
93
|
+
"input",
|
|
94
|
+
{
|
|
95
|
+
autoCorrect: "false",
|
|
96
|
+
className: F,
|
|
97
|
+
placeholder: f,
|
|
98
|
+
value: b,
|
|
99
|
+
onChange: S,
|
|
100
|
+
...z
|
|
101
|
+
}
|
|
102
|
+
) }),
|
|
103
|
+
/* @__PURE__ */ _(R, { children: [
|
|
104
|
+
o && /* @__PURE__ */ s("div", { children: o }),
|
|
105
|
+
p && /* @__PURE__ */ s("span", { className: t.flexHorizontal, children: p })
|
|
106
|
+
] })
|
|
107
|
+
] });
|
|
130
108
|
};
|
|
131
109
|
export {
|
|
132
110
|
K as Input
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
|
|
3
|
-
interface TabsProps {
|
|
4
|
-
listItems: string[];
|
|
5
|
-
|
|
3
|
+
export interface TabsProps {
|
|
4
|
+
listItems: string[]; /** Array of strings representing the labels of the tabs */
|
|
5
|
+
defaultActiveTab?: number; /** Index of the tab that should be active by default */
|
|
6
|
+
onTabSelect: (selectedItem: string) => void; /** Callback function to handle tab selection, receiving the selected tab's label */
|
|
6
7
|
}
|
|
7
8
|
export declare const Tabs: FC<TabsProps>;
|
|
8
|
-
export {};
|