@liujip0/components 0.2.1 → 0.2.2
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.
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
type InputProps = {
|
|
2
2
|
value: string | number;
|
|
3
|
-
onChange?: (
|
|
3
|
+
onChange?: (value: string) => void;
|
|
4
4
|
type?: "text" | "password" | "email" | "number" | "search";
|
|
5
5
|
id: string;
|
|
6
|
-
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
7
6
|
startIcon?: React.ReactNode;
|
|
8
7
|
endIcon?: React.ReactNode;
|
|
9
|
-
placeholder?: string;
|
|
10
8
|
label?: string;
|
|
11
9
|
error?: boolean;
|
|
12
10
|
helperText?: string;
|
|
13
11
|
disabled?: boolean;
|
|
14
12
|
className?: string;
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
outlineClassName?: string;
|
|
14
|
+
labelClassName?: string;
|
|
15
|
+
helperTextClassName?: string;
|
|
16
|
+
inputClassName?: string;
|
|
17
|
+
} & React.InputHTMLAttributes<HTMLInputElement>;
|
|
18
|
+
export declare function Input({ value, onChange, type, id, startIcon, endIcon, label, error, helperText, disabled, className, outlineClassName, labelClassName, helperTextClassName, inputClassName, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export {};
|
|
@@ -1,63 +1,65 @@
|
|
|
1
1
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { s as e } from "../../Input.module-C7oR_KDs.js";
|
|
3
|
-
function
|
|
3
|
+
function g({
|
|
4
4
|
value: m,
|
|
5
5
|
onChange: t,
|
|
6
6
|
type: o = "text",
|
|
7
7
|
id: l,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
endIcon: h,
|
|
11
|
-
placeholder: x,
|
|
8
|
+
startIcon: u,
|
|
9
|
+
endIcon: p,
|
|
12
10
|
label: s,
|
|
13
11
|
error: n,
|
|
14
12
|
helperText: a,
|
|
15
13
|
disabled: i,
|
|
16
|
-
className:
|
|
14
|
+
className: h,
|
|
15
|
+
outlineClassName: x,
|
|
16
|
+
labelClassName: N,
|
|
17
|
+
helperTextClassName: d,
|
|
18
|
+
inputClassName: f,
|
|
19
|
+
...v
|
|
17
20
|
}) {
|
|
18
|
-
return /* @__PURE__ */ c("div", { className: e.container + " " + (
|
|
21
|
+
return /* @__PURE__ */ c("div", { className: e.container + " " + (h || ""), children: [
|
|
19
22
|
s && /* @__PURE__ */ r(
|
|
20
23
|
"label",
|
|
21
24
|
{
|
|
22
25
|
htmlFor: l,
|
|
23
|
-
className: e.label,
|
|
26
|
+
className: e.label + " " + (N || ""),
|
|
24
27
|
children: s
|
|
25
28
|
}
|
|
26
29
|
),
|
|
27
30
|
/* @__PURE__ */ c(
|
|
28
31
|
"div",
|
|
29
32
|
{
|
|
30
|
-
className: e.outline + " " + (n ? e.errorOutline : ""),
|
|
33
|
+
className: e.outline + " " + (x || "") + " " + (n ? e.errorOutline : ""),
|
|
31
34
|
children: [
|
|
32
|
-
|
|
35
|
+
u,
|
|
33
36
|
/* @__PURE__ */ r(
|
|
34
37
|
"input",
|
|
35
38
|
{
|
|
36
|
-
className: e.input + " " + (i ? e.inputDisabled : ""),
|
|
39
|
+
className: e.input + " " + (f || "") + " " + (i ? e.inputDisabled : ""),
|
|
37
40
|
value: m,
|
|
38
|
-
onChange: (
|
|
39
|
-
t && t(
|
|
41
|
+
onChange: (j) => {
|
|
42
|
+
t && t(j.currentTarget.value);
|
|
40
43
|
},
|
|
41
44
|
type: o,
|
|
42
45
|
id: l,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
disabled: i
|
|
46
|
+
disabled: i,
|
|
47
|
+
...v
|
|
46
48
|
}
|
|
47
49
|
),
|
|
48
|
-
|
|
50
|
+
p
|
|
49
51
|
]
|
|
50
52
|
}
|
|
51
53
|
),
|
|
52
54
|
a && /* @__PURE__ */ r(
|
|
53
55
|
"p",
|
|
54
56
|
{
|
|
55
|
-
className: e.helperText + " " + (n ? e.helperTextError : ""),
|
|
57
|
+
className: e.helperText + " " + (d || "") + " " + (n ? e.helperTextError : ""),
|
|
56
58
|
children: a
|
|
57
59
|
}
|
|
58
60
|
)
|
|
59
61
|
] });
|
|
60
62
|
}
|
|
61
63
|
export {
|
|
62
|
-
|
|
64
|
+
g as Input
|
|
63
65
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
type TextAreaProps = {
|
|
2
2
|
value: string | number;
|
|
3
|
-
onChange?: (
|
|
3
|
+
onChange?: (value: string) => void;
|
|
4
4
|
id: string;
|
|
5
|
-
onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
6
|
-
placeholder?: string;
|
|
7
5
|
label?: string;
|
|
8
6
|
error?: boolean;
|
|
9
7
|
helperText?: string;
|
|
10
8
|
disabled?: boolean;
|
|
11
9
|
className?: string;
|
|
12
10
|
outlineClassName?: string;
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
labelClassName?: string;
|
|
12
|
+
helperTextClassName?: string;
|
|
13
|
+
textAreaClassName?: string;
|
|
14
|
+
} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
15
|
+
export declare function TextArea({ value, onChange, id, label, error, helperText, disabled, className, outlineClassName, labelClassName, helperTextClassName, textAreaClassName, ...props }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export {};
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { s as e } from "../../Input.module-C7oR_KDs.js";
|
|
3
|
-
function
|
|
3
|
+
function T({
|
|
4
4
|
value: c,
|
|
5
5
|
onChange: a,
|
|
6
6
|
id: t,
|
|
7
|
-
onKeyDown: m,
|
|
8
|
-
placeholder: o,
|
|
9
7
|
label: l,
|
|
10
8
|
error: s,
|
|
11
9
|
helperText: i,
|
|
12
10
|
disabled: n,
|
|
13
|
-
className:
|
|
14
|
-
outlineClassName:
|
|
11
|
+
className: m,
|
|
12
|
+
outlineClassName: o,
|
|
13
|
+
labelClassName: u,
|
|
14
|
+
helperTextClassName: p,
|
|
15
|
+
textAreaClassName: h,
|
|
16
|
+
...x
|
|
15
17
|
}) {
|
|
16
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ d("div", { className: e.container + " " + (m || ""), children: [
|
|
17
19
|
l && /* @__PURE__ */ r(
|
|
18
20
|
"label",
|
|
19
21
|
{
|
|
20
22
|
htmlFor: t,
|
|
21
|
-
className: e.label,
|
|
23
|
+
className: e.label + " " + (u || ""),
|
|
22
24
|
children: l
|
|
23
25
|
}
|
|
24
26
|
),
|
|
25
27
|
/* @__PURE__ */ r(
|
|
26
28
|
"div",
|
|
27
29
|
{
|
|
28
|
-
className: e.outline + " " + (s ? e.errorOutline : "") + " " + (
|
|
30
|
+
className: e.outline + " " + (s ? e.errorOutline : "") + " " + (o || ""),
|
|
29
31
|
children: /* @__PURE__ */ r(
|
|
30
32
|
"textarea",
|
|
31
33
|
{
|
|
32
|
-
className: e.input + " " + (n ? e.inputDisabled : ""),
|
|
34
|
+
className: e.input + " " + (h || "") + " " + (n ? e.inputDisabled : ""),
|
|
33
35
|
value: c,
|
|
34
|
-
onChange: (
|
|
35
|
-
a && a(
|
|
36
|
+
onChange: (N) => {
|
|
37
|
+
a && a(N.currentTarget.value);
|
|
36
38
|
},
|
|
37
39
|
id: t,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
disabled: n
|
|
40
|
+
disabled: n,
|
|
41
|
+
...x
|
|
41
42
|
}
|
|
42
43
|
)
|
|
43
44
|
}
|
|
@@ -45,12 +46,12 @@ function f({
|
|
|
45
46
|
i && /* @__PURE__ */ r(
|
|
46
47
|
"p",
|
|
47
48
|
{
|
|
48
|
-
className: e.helperText + " " + (s ? e.helperTextError : ""),
|
|
49
|
+
className: e.helperText + " " + (p || "") + " " + (s ? e.helperTextError : ""),
|
|
49
50
|
children: i
|
|
50
51
|
}
|
|
51
52
|
)
|
|
52
53
|
] });
|
|
53
54
|
}
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
+
T as TextArea
|
|
56
57
|
};
|