@situaction/traq-ui-ste 1.0.28 → 1.1.0
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 +1 -5
- package/dist/components/button/Button.js +45 -85
- package/dist/components/checkbox/Checkbox.js +32 -30
- package/dist/components/icon-button/IconButton.d.ts +1 -5
- package/dist/components/icon-button/IconButton.js +39 -79
- package/dist/components/input/Input.d.ts +1 -1
- package/dist/components/input/Input.js +55 -67
- package/dist/components/select/Select.js +30 -34
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/Tabs.js +58 -45
- package/dist/components/tag-counter/TagCounter.js +13 -16
- package/dist/components/theme/ThemeContext.d.ts +2 -0
- package/dist/components/theme/ThemeContext.js +27 -22
- package/dist/components/theme/primary.d.ts +229 -0
- package/dist/components/theme/primary.js +232 -0
- package/dist/components/theme/variables_dark.d.ts +216 -0
- package/dist/components/theme/variables_dark.js +219 -0
- package/dist/components/theme/variables_light.d.ts +216 -0
- package/dist/components/theme/variables_light.js +219 -0
- package/dist/components/tooltip/Tooltip.d.ts +0 -2
- package/dist/components/tooltip/Tooltip.js +23 -25
- package/dist/styles/Button.css +1 -1
- package/dist/styles/Checkbox.css +1 -1
- package/dist/styles/IconButton.css +1 -1
- package/dist/styles/Input.css +1 -1
- package/dist/styles/Select.css +1 -1
- package/dist/styles/Tabs.css +1 -1
- package/dist/styles/TagCounter.css +1 -1
- package/dist/styles/Tooltip.css +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, FC, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Size } from '../interface';
|
|
3
3
|
|
|
4
4
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
5
|
/** Is this the principal call to action on the page? */
|
|
6
6
|
mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'text';
|
|
7
|
-
/** What background color to use (blue, red, ...)*/
|
|
8
|
-
color?: Color;
|
|
9
|
-
/** what mode do you use for light or dark color **/
|
|
10
|
-
colorMode?: 'light' | 'dark';
|
|
11
7
|
/** How large should the button be? */
|
|
12
8
|
size?: Size | 'menu';
|
|
13
9
|
/** button contents */
|
|
@@ -1,96 +1,56 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
button:
|
|
5
|
-
"button-
|
|
6
|
-
"button-
|
|
7
|
-
"button-
|
|
8
|
-
"button-
|
|
9
|
-
"button-text": "_button-
|
|
10
|
-
"button-
|
|
11
|
-
"button-
|
|
12
|
-
"button-size-
|
|
13
|
-
"button-size-
|
|
14
|
-
"button-size-
|
|
15
|
-
"button-size-
|
|
16
|
-
"button-
|
|
17
|
-
"button-gap-
|
|
18
|
-
"button-gap-
|
|
19
|
-
"button-gap-
|
|
20
|
-
"button-gap-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
childrenLeft: c,
|
|
32
|
-
childrenRight: i,
|
|
33
|
-
...m
|
|
1
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import '../../styles/Button.css';const i = "_button_vdgnu_23", p = "_flexHorizontalCenter_vdgnu_184", t = {
|
|
3
|
+
button: i,
|
|
4
|
+
"button-primary": "_button-primary_vdgnu_47",
|
|
5
|
+
"button-secondary": "_button-secondary_vdgnu_61",
|
|
6
|
+
"button-tertiary": "_button-tertiary_vdgnu_77",
|
|
7
|
+
"button-ghost": "_button-ghost_vdgnu_93",
|
|
8
|
+
"button-text": "_button-text_vdgnu_109",
|
|
9
|
+
"button-text-selected": "_button-text-selected_vdgnu_122",
|
|
10
|
+
"button-error": "_button-error_vdgnu_128",
|
|
11
|
+
"button-size-xl": "_button-size-xl_vdgnu_141",
|
|
12
|
+
"button-size-l": "_button-size-l_vdgnu_147",
|
|
13
|
+
"button-size-m": "_button-size-m_vdgnu_153",
|
|
14
|
+
"button-size-s": "_button-size-s_vdgnu_159",
|
|
15
|
+
"button-size-menu": "_button-size-menu_vdgnu_165",
|
|
16
|
+
"button-gap-menu": "_button-gap-menu_vdgnu_171",
|
|
17
|
+
"button-gap-xl": "_button-gap-xl_vdgnu_174",
|
|
18
|
+
"button-gap-l": "_button-gap-l_vdgnu_177",
|
|
19
|
+
"button-gap-m": "_button-gap-m_vdgnu_171",
|
|
20
|
+
"button-gap-s": "_button-gap-s_vdgnu_180",
|
|
21
|
+
flexHorizontalCenter: p
|
|
22
|
+
}, x = ({
|
|
23
|
+
mode: o = "primary",
|
|
24
|
+
size: u = "m",
|
|
25
|
+
label: b,
|
|
26
|
+
error: s,
|
|
27
|
+
selected: r,
|
|
28
|
+
childrenLeft: e,
|
|
29
|
+
childrenRight: _,
|
|
30
|
+
...a
|
|
34
31
|
}) => {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
].filter(Boolean).join(" ")
|
|
43
|
-
|
|
44
|
-
"--dynamic-color-text": "var(--color-light-100)",
|
|
45
|
-
"--dynamic-color": t ? `var(--color-${t}-200)` : "var(--primary-color)",
|
|
46
|
-
"--dynamic-color-hover": t ? `var(--color-${t}-200)` : "var(--primary-color-100)",
|
|
47
|
-
"--dynamic-color-activated": t ? `var(--color-${t}-50)` : "var(--primary-color-50)",
|
|
48
|
-
"--dynamic-color-disabled": "var(--color-light-40)",
|
|
49
|
-
"--dynamic-border-disabled": "var(--color-light-10)",
|
|
50
|
-
"--dynamic-back-disabled": "var(--color-light-05)"
|
|
51
|
-
}, v = {
|
|
52
|
-
"--dynamic-color-primary-text": "var(--color-light-100)",
|
|
53
|
-
"--dynamic-color-text": t ? `var(--color-${t}-900)` : "var(--primary-color-900)",
|
|
54
|
-
"--dynamic-color": t ? `var(--color-${t}-900})` : "var(--primary-color)",
|
|
55
|
-
"--dynamic-color-hover": t ? `var(--color-${t}-800)` : "var(--primary-color-800)",
|
|
56
|
-
"--dynamic-color-activated": t ? `var(--color-${t}-700})` : "var(--primary-color-700)",
|
|
57
|
-
"--dynamic-color-disabled": "var(--color-dark-40)",
|
|
58
|
-
"--dynamic-border-disabled": "var(--color-dark-10)",
|
|
59
|
-
"--dynamic-back-disabled": "var(--color-dark-05)"
|
|
60
|
-
}, p = {
|
|
61
|
-
"--dynamic-color-primary-text": t ? `var(--color-${t}-900)` : "var(--primary-color-950)",
|
|
62
|
-
"--dynamic-color-text": "var(--color-light-100)",
|
|
63
|
-
"--dynamic-color": t ? `var(--color-${t}-200)` : "var(--primary-color-200)",
|
|
64
|
-
"--dynamic-color-hover": t ? `var(--color-${t}-200})` : "var(--primary-color-100)",
|
|
65
|
-
"--dynamic-color-activated": t ? `var(--color-${t}-50})` : "var(--primary-color-50)",
|
|
66
|
-
"--dynamic-color-disabled": "var(--color-light-40)",
|
|
67
|
-
"--dynamic-border-disabled": "var(--color-light-10)",
|
|
68
|
-
"--dynamic-back-disabled": "var(--color-light-05)"
|
|
69
|
-
}, x = {
|
|
70
|
-
"--dynamic-color-primary-text": "var(--color-light-100)",
|
|
71
|
-
"--dynamic-color-text": t ? `var(--color-${t}-900)` : "var(--secondary-color)",
|
|
72
|
-
"--dynamic-color": t ? `var(--color-${t}-900)` : "var(--secondary-color)",
|
|
73
|
-
"--dynamic-color-hover": t ? `var(--color-${t}-800)` : "var(--primary-color-800)",
|
|
74
|
-
"--dynamic-color-activated": t ? `var(--color-${t}-700)` : "var(--primary-color-700)",
|
|
75
|
-
"--dynamic-color-disabled": "var(--color-dark-40)",
|
|
76
|
-
"--dynamic-border-disabled": "var(--color-dark-10)",
|
|
77
|
-
"--dynamic-back-disabled": "var(--color-dark-05)"
|
|
78
|
-
};
|
|
79
|
-
return /* @__PURE__ */ g(
|
|
32
|
+
const l = () => s ? "error" : o, g = [
|
|
33
|
+
t.button,
|
|
34
|
+
t[`button-${l()}`],
|
|
35
|
+
t[`button-size-${u}`],
|
|
36
|
+
t[`button-gap-${u}`],
|
|
37
|
+
r && o === "text" && t["button-text-selected"],
|
|
38
|
+
t.flexHorizontalCenter
|
|
39
|
+
].filter(Boolean).join(" ");
|
|
40
|
+
return /* @__PURE__ */ d(
|
|
80
41
|
"button",
|
|
81
42
|
{
|
|
82
43
|
type: "button",
|
|
83
|
-
className:
|
|
84
|
-
|
|
85
|
-
...m,
|
|
44
|
+
className: g,
|
|
45
|
+
...a,
|
|
86
46
|
children: [
|
|
87
|
-
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
47
|
+
e && /* @__PURE__ */ n("span", { className: t.flexHorizontalCenter, children: e }),
|
|
48
|
+
/* @__PURE__ */ n("span", { children: b }),
|
|
49
|
+
_ && /* @__PURE__ */ n("span", { className: t.flexHorizontalCenter, children: _ })
|
|
90
50
|
]
|
|
91
51
|
}
|
|
92
52
|
);
|
|
93
53
|
};
|
|
94
54
|
export {
|
|
95
|
-
|
|
55
|
+
x as Button
|
|
96
56
|
};
|
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import '../../styles/Checkbox.css';const n = "_checkbox_hj8dh_23", r = "_checked_hj8dh_34", j = "_disabled_hj8dh_46", e = {
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useEffect as a } from "react";
|
|
3
|
+
import '../../styles/Checkbox.css';const n = "_checkbox_owci7_23", w = "_checked_owci7_31", r = "_disabled_owci7_37", c = {
|
|
5
4
|
checkbox: n,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"checkbox-size-s": "_checkbox-size-
|
|
10
|
-
"checkbox-size-m": "_checkbox-size-
|
|
11
|
-
"checkbox-size-l": "_checkbox-size-
|
|
12
|
-
"checkbox-size-xl": "_checkbox-size-
|
|
13
|
-
},
|
|
14
|
-
checked:
|
|
15
|
-
icon:
|
|
5
|
+
checked: w,
|
|
6
|
+
disabled: r,
|
|
7
|
+
"checkbox-size-xs": "_checkbox-size-xs_owci7_45",
|
|
8
|
+
"checkbox-size-s": "_checkbox-size-s_owci7_50",
|
|
9
|
+
"checkbox-size-m": "_checkbox-size-m_owci7_55",
|
|
10
|
+
"checkbox-size-l": "_checkbox-size-l_owci7_60",
|
|
11
|
+
"checkbox-size-xl": "_checkbox-size-xl_owci7_65"
|
|
12
|
+
}, f = ({
|
|
13
|
+
checked: e = !1,
|
|
14
|
+
icon: x = /* @__PURE__ */ o("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 256 256", children: /* @__PURE__ */ o(
|
|
16
15
|
"path",
|
|
17
16
|
{
|
|
18
17
|
d: "M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"
|
|
19
18
|
}
|
|
20
19
|
) }),
|
|
21
|
-
size:
|
|
22
|
-
disabled:
|
|
23
|
-
onChange:
|
|
20
|
+
size: k = "m",
|
|
21
|
+
disabled: _ = !1,
|
|
22
|
+
onChange: i
|
|
24
23
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
const [s, h] = d(e);
|
|
25
|
+
a(() => {
|
|
26
|
+
h(e);
|
|
27
|
+
}, [e]);
|
|
28
|
+
const l = () => {
|
|
29
|
+
const t = !s;
|
|
30
|
+
h(t), i && i(t);
|
|
31
|
+
}, b = [
|
|
32
|
+
c.checkbox,
|
|
33
|
+
c[`checkbox-size-${k}`],
|
|
34
|
+
s && c.checked,
|
|
35
|
+
_ && c.disabled
|
|
34
36
|
].filter(Boolean).join(" ");
|
|
35
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ o(
|
|
36
38
|
"div",
|
|
37
39
|
{
|
|
38
40
|
"data-testid": "checkbox",
|
|
39
|
-
className:
|
|
41
|
+
className: b,
|
|
40
42
|
onClick: l,
|
|
41
|
-
children:
|
|
43
|
+
children: s && x
|
|
42
44
|
}
|
|
43
45
|
);
|
|
44
46
|
};
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
f as Checkbox
|
|
47
49
|
};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { FC, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Size } from '../interface';
|
|
3
3
|
|
|
4
4
|
export interface IconButtonProps {
|
|
5
5
|
/** Specifies the visual style of the button. */
|
|
6
6
|
mode?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'icon';
|
|
7
|
-
/** What background color to use (blue, red, ...)*/
|
|
8
|
-
color?: Color;
|
|
9
|
-
/** what mode do you use for light or dark color **/
|
|
10
|
-
colorMode?: 'light' | 'dark';
|
|
11
7
|
/** How large should the button be? */
|
|
12
8
|
size?: Size | 'menu';
|
|
13
9
|
/** If true, the button will have rounded corners. */
|
|
@@ -1,88 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
button:
|
|
5
|
-
"button-
|
|
6
|
-
"button-
|
|
7
|
-
"button-
|
|
8
|
-
"button-
|
|
9
|
-
"button-
|
|
10
|
-
"button-icon": "_button-
|
|
11
|
-
"button-
|
|
12
|
-
"button-
|
|
13
|
-
"button-size-
|
|
14
|
-
"button-size-
|
|
15
|
-
"button-size-
|
|
16
|
-
"button-size-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
mode: t = "primary",
|
|
21
|
-
color: r,
|
|
22
|
-
colorMode: a,
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import '../../styles/IconButton.css';const c = "_button_kop64_23", a = "_flexHorizontalCenter_kop64_177", t = {
|
|
3
|
+
button: c,
|
|
4
|
+
"button-round": "_button-round_kop64_51",
|
|
5
|
+
"button-primary": "_button-primary_kop64_54",
|
|
6
|
+
"button-secondary": "_button-secondary_kop64_68",
|
|
7
|
+
"button-tertiary": "_button-tertiary_kop64_84",
|
|
8
|
+
"button-ghost": "_button-ghost_kop64_100",
|
|
9
|
+
"button-icon": "_button-icon_kop64_116",
|
|
10
|
+
"button-icon-selected": "_button-icon-selected_kop64_128",
|
|
11
|
+
"button-error": "_button-error_kop64_137",
|
|
12
|
+
"button-size-xl": "_button-size-xl_kop64_150",
|
|
13
|
+
"button-size-l": "_button-size-l_kop64_155",
|
|
14
|
+
"button-size-m": "_button-size-m_kop64_160",
|
|
15
|
+
"button-size-s": "_button-size-s_kop64_165",
|
|
16
|
+
"button-size-menu": "_button-size-menu_kop64_170",
|
|
17
|
+
flexHorizontalCenter: a
|
|
18
|
+
}, z = ({
|
|
19
|
+
mode: o = "primary",
|
|
23
20
|
size: n = "m",
|
|
24
|
-
error:
|
|
25
|
-
selected:
|
|
26
|
-
round:
|
|
27
|
-
disabled:
|
|
28
|
-
children:
|
|
29
|
-
onClick:
|
|
21
|
+
error: e,
|
|
22
|
+
selected: _,
|
|
23
|
+
round: u,
|
|
24
|
+
disabled: r,
|
|
25
|
+
children: b,
|
|
26
|
+
onClick: s
|
|
30
27
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
].filter(Boolean).join(" ")
|
|
39
|
-
|
|
40
|
-
"--dynamic-color-text": "var(--color-light-100)",
|
|
41
|
-
"--dynamic-color": r ? `var(--color-${r}-200)` : "var(--primary-color)",
|
|
42
|
-
"--dynamic-color-hover": r ? `var(--color-${r}-200)` : "var(--primary-color-100)",
|
|
43
|
-
"--dynamic-color-activated": r ? `var(--color-${r}-50)` : "var(--primary-color-50)",
|
|
44
|
-
"--dynamic-color-disabled": "var(--color-light-40)",
|
|
45
|
-
"--dynamic-border-disabled": "var(--color-light-10)",
|
|
46
|
-
"--dynamic-back-disabled": "var(--color-light-05)"
|
|
47
|
-
}, u = {
|
|
48
|
-
"--dynamic-color-primary-text": "var(--color-light-100)",
|
|
49
|
-
"--dynamic-color-text": r ? `var(--color-${r}-900)` : "var(--primary-color-900)",
|
|
50
|
-
"--dynamic-color": r ? `var(--color-${r}-900)` : "var(--primary-color)",
|
|
51
|
-
"--dynamic-color-hover": r ? `var(--color-${r}-800)` : "var(--primary-color-800)",
|
|
52
|
-
"--dynamic-color-activated": r ? `var(--color-${r}-700)` : "var(--primary-color-700)",
|
|
53
|
-
"--dynamic-color-disabled": "var(--color-dark-40)",
|
|
54
|
-
"--dynamic-border-disabled": "var(--color-dark-10)",
|
|
55
|
-
"--dynamic-back-disabled": "var(--color-dark-05)"
|
|
56
|
-
}, _ = {
|
|
57
|
-
"--dynamic-color-primary-text": r ? `var(--color-${r}-900)` : "var(--primary-color-950)",
|
|
58
|
-
"--dynamic-color-text": "var(--color-light-100)",
|
|
59
|
-
"--dynamic-color": r ? `var(--color-${r}-200)` : "var(--primary-color-200)",
|
|
60
|
-
"--dynamic-color-hover": r ? `var(--color-${r}-200)` : "var(--primary-color-100)",
|
|
61
|
-
"--dynamic-color-activated": r ? `var(--color-${r}-50)` : "var(--primary-color-50)",
|
|
62
|
-
"--dynamic-color-disabled": "var(--color-light-40)",
|
|
63
|
-
"--dynamic-border-disabled": "var(--color-light-10)",
|
|
64
|
-
"--dynamic-back-disabled": "var(--color-light-05)"
|
|
65
|
-
}, p = {
|
|
66
|
-
"--dynamic-color-primary-text": "var(--color-light-100)",
|
|
67
|
-
"--dynamic-color-text": r ? `var(--color-${r}-900)` : "var(--secondary-color)",
|
|
68
|
-
"--dynamic-color": r ? `var(--color-${r}-900})` : "var(--secondary-color)",
|
|
69
|
-
"--dynamic-color-hover": r ? `var(--color-${r}-800)` : "var(--primary-color-800)",
|
|
70
|
-
"--dynamic-color-activated": r ? `var(--color-${r}-700)` : "var(--primary-color-700)",
|
|
71
|
-
"--dynamic-color-disabled": "var(--color-dark-40)",
|
|
72
|
-
"--dynamic-border-disabled": "var(--color-dark-10)",
|
|
73
|
-
"--dynamic-back-disabled": "var(--color-dark-05)"
|
|
74
|
-
};
|
|
75
|
-
return /* @__PURE__ */ h(
|
|
28
|
+
const i = () => e ? "error" : o, l = [
|
|
29
|
+
t.button,
|
|
30
|
+
t[`button-${i()}`],
|
|
31
|
+
u && t["button-round"],
|
|
32
|
+
t[`button-size-${n}`],
|
|
33
|
+
_ && o === "icon" && t["button-icon-selected"],
|
|
34
|
+
t.flexHorizontalCenter
|
|
35
|
+
].filter(Boolean).join(" ");
|
|
36
|
+
return /* @__PURE__ */ p(
|
|
76
37
|
"button",
|
|
77
38
|
{
|
|
78
|
-
className:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
children: d
|
|
39
|
+
className: l,
|
|
40
|
+
onClick: s,
|
|
41
|
+
disabled: r,
|
|
42
|
+
children: b
|
|
83
43
|
}
|
|
84
44
|
);
|
|
85
45
|
};
|
|
86
46
|
export {
|
|
87
|
-
|
|
47
|
+
z as IconButton
|
|
88
48
|
};
|
|
@@ -5,7 +5,7 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
5
5
|
/** How large should the input be? **/
|
|
6
6
|
sizeStyle?: Size;
|
|
7
7
|
/** input status style **/
|
|
8
|
-
status?: 'default' | 'error' | '
|
|
8
|
+
status?: 'default' | 'error' | 'secondary' | 'ghost';
|
|
9
9
|
/** Optional unit or additional label to display next to the input **/
|
|
10
10
|
labelUnit?: string;
|
|
11
11
|
/** If true, the input will have rounded corners **/
|
|
@@ -1,94 +1,82 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
"input-style": "_input-
|
|
6
|
-
"input-style-
|
|
7
|
-
"input-style-
|
|
8
|
-
"input-style-
|
|
9
|
-
"input-style-
|
|
10
|
-
"input-
|
|
11
|
-
"input-style-
|
|
12
|
-
"input-
|
|
13
|
-
"input-style-size-
|
|
14
|
-
"input-style-size-
|
|
15
|
-
"input-style-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
sizeStyle: f = "m",
|
|
22
|
-
labelUnit: o,
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useRef as _ } from "react";
|
|
3
|
+
import '../../styles/Input.css';const j = "_flexHorizontalBetween_1og0n_145", N = "_flexHorizontal_1og0n_145", e = {
|
|
4
|
+
"input-style": "_input-style_1og0n_40",
|
|
5
|
+
"input-style-disabled": "_input-style-disabled_1og0n_52",
|
|
6
|
+
"input-style-focused": "_input-style-focused_1og0n_63",
|
|
7
|
+
"input-style-secondary": "_input-style-secondary_1og0n_70",
|
|
8
|
+
"input-style-ghost": "_input-style-ghost_1og0n_84",
|
|
9
|
+
"input-style-error": "_input-style-error_1og0n_87",
|
|
10
|
+
"input-container": "_input-container_1og0n_97",
|
|
11
|
+
"input-style-size-xl": "_input-style-size-xl_1og0n_101",
|
|
12
|
+
"input-style-size-l": "_input-style-size-l_1og0n_111",
|
|
13
|
+
"input-style-size-m": "_input-style-size-m_1og0n_121",
|
|
14
|
+
"input-style-size-s": "_input-style-size-s_1og0n_131",
|
|
15
|
+
"input-style-radius": "_input-style-radius_1og0n_141",
|
|
16
|
+
flexHorizontalBetween: j,
|
|
17
|
+
flexHorizontal: N
|
|
18
|
+
}, R = ({
|
|
19
|
+
sizeStyle: y = "m",
|
|
20
|
+
labelUnit: l,
|
|
23
21
|
status: n = "default",
|
|
24
|
-
childrenLeft:
|
|
25
|
-
childrenRight:
|
|
26
|
-
round:
|
|
27
|
-
disabled:
|
|
28
|
-
defaultValue:
|
|
29
|
-
...
|
|
22
|
+
childrenLeft: o,
|
|
23
|
+
childrenRight: i,
|
|
24
|
+
round: d,
|
|
25
|
+
disabled: u,
|
|
26
|
+
defaultValue: f,
|
|
27
|
+
...g
|
|
30
28
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
|
|
29
|
+
const [z, r] = p(!1), [h, x] = p(f || ""), m = _(null), s = _(null), B = () => r(!0), C = () => r(!1), H = (F) => {
|
|
30
|
+
x(F.target.value);
|
|
33
31
|
}, S = () => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, k = [
|
|
32
|
+
s.current && s.current.focus();
|
|
33
|
+
}, v = [
|
|
37
34
|
e["input-style"],
|
|
38
|
-
e[`input-style-size-${
|
|
39
|
-
|
|
35
|
+
e[`input-style-size-${y}`],
|
|
36
|
+
d && e["input-style-radius"],
|
|
40
37
|
e.flexHorizontalBetween
|
|
41
38
|
].filter(Boolean).join(" "), w = [
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
z && e["input-style-focused"],
|
|
40
|
+
u && e["input-style-disabled"],
|
|
44
41
|
n === "secondary" && e["input-style-secondary"],
|
|
45
42
|
n === "ghost" && e["input-style-ghost"]
|
|
46
|
-
].filter(Boolean).join(" ")
|
|
47
|
-
|
|
48
|
-
case "error":
|
|
49
|
-
return e["input-style-error"];
|
|
50
|
-
case "success":
|
|
51
|
-
return e["input-style-success"];
|
|
52
|
-
default:
|
|
53
|
-
return w;
|
|
54
|
-
}
|
|
55
|
-
}, j = {
|
|
56
|
-
"--dynamic-color": t === "light" ? "var(--color-blue-grey-400)" : "var(--color-blue-grey-200)",
|
|
57
|
-
"--dynamic-color-activated": t === "light" ? "var(--color-dark-100)" : "var(--color-light-100)",
|
|
58
|
-
"--dynamic-color-disabled": t === "light" ? "var(--color-dark-40)" : "var(--color-light-40)",
|
|
59
|
-
"--dynamic-color-border-disabled": t === "light" ? "var(--color-dark-10)" : "var(--color-light-10)",
|
|
60
|
-
"--dynamic-color-secondary": t === "light" ? "var(--color-blue-situaction-900)" : "var(--color-light-100)"
|
|
61
|
-
};
|
|
62
|
-
return /* @__PURE__ */ y(
|
|
43
|
+
].filter(Boolean).join(" ");
|
|
44
|
+
return /* @__PURE__ */ a(
|
|
63
45
|
"div",
|
|
64
46
|
{
|
|
65
|
-
ref:
|
|
66
|
-
className: `input-style ${
|
|
47
|
+
ref: m,
|
|
48
|
+
className: `input-style ${v} ${(() => {
|
|
49
|
+
switch (n) {
|
|
50
|
+
case "error":
|
|
51
|
+
return e["input-style-error"];
|
|
52
|
+
default:
|
|
53
|
+
return w;
|
|
54
|
+
}
|
|
55
|
+
})()}`,
|
|
67
56
|
onFocus: B,
|
|
68
57
|
onBlur: C,
|
|
69
58
|
onClick: S,
|
|
70
|
-
style: j,
|
|
71
59
|
children: [
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */
|
|
60
|
+
o && /* @__PURE__ */ t(c, { children: o }),
|
|
61
|
+
/* @__PURE__ */ t("div", { className: e["input-container"], children: /* @__PURE__ */ t(
|
|
74
62
|
"input",
|
|
75
63
|
{
|
|
76
64
|
autoCorrect: "false",
|
|
77
|
-
disabled:
|
|
78
|
-
value:
|
|
65
|
+
disabled: u,
|
|
66
|
+
value: h,
|
|
79
67
|
onChange: H,
|
|
80
|
-
ref:
|
|
81
|
-
...
|
|
68
|
+
ref: s,
|
|
69
|
+
...g
|
|
82
70
|
}
|
|
83
71
|
) }),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
72
|
+
/* @__PURE__ */ a(c, { children: [
|
|
73
|
+
l && /* @__PURE__ */ t("div", { children: l }),
|
|
74
|
+
i && /* @__PURE__ */ t("span", { className: e.flexHorizontal, children: i })
|
|
87
75
|
] })
|
|
88
76
|
]
|
|
89
77
|
}
|
|
90
78
|
);
|
|
91
79
|
};
|
|
92
80
|
export {
|
|
93
|
-
|
|
81
|
+
R as Input
|
|
94
82
|
};
|