xtreme-ui 0.0.107 → 0.0.108
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/Textfield.tsx"],"names":[],"mappings":"AAMA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/Textfield.tsx"],"names":[],"mappings":"AAMA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,SAAS,8GAgHpB,CAAC"}
|
|
@@ -1,102 +1,104 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
import { Icon as
|
|
2
|
+
import { jsxs as I, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as D, useId as L, useMemo as f } from "react";
|
|
4
|
+
import U from "clsx";
|
|
5
|
+
import { Icon as B } from "../Icon/Icon.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
const
|
|
7
|
+
const M = D((m, T) => {
|
|
8
8
|
const {
|
|
9
|
-
className:
|
|
10
|
-
style:
|
|
9
|
+
className: v,
|
|
10
|
+
style: C,
|
|
11
11
|
type: e = "text",
|
|
12
|
-
textarea:
|
|
12
|
+
textarea: t,
|
|
13
13
|
placeholder: n,
|
|
14
|
-
autoComplete:
|
|
15
|
-
active:
|
|
16
|
-
autoFocus:
|
|
14
|
+
autoComplete: h = "off",
|
|
15
|
+
active: E,
|
|
16
|
+
autoFocus: x,
|
|
17
17
|
icon: a,
|
|
18
|
-
iconType:
|
|
18
|
+
iconType: F = "regular",
|
|
19
19
|
value: l,
|
|
20
|
-
onChange:
|
|
21
|
-
onFocus:
|
|
22
|
-
onBlur:
|
|
23
|
-
onKeyUp:
|
|
24
|
-
onKeyDown:
|
|
20
|
+
onChange: y,
|
|
21
|
+
onFocus: b,
|
|
22
|
+
onBlur: N,
|
|
23
|
+
onKeyUp: c,
|
|
24
|
+
onKeyDown: s,
|
|
25
25
|
onEnterKey: i
|
|
26
|
-
} =
|
|
27
|
-
if (
|
|
26
|
+
} = m, K = L(), u = m.id ?? K, p = f(() => {
|
|
27
|
+
if (t === !0) return null;
|
|
28
28
|
if (a) return a;
|
|
29
29
|
if (e === "number") return "23";
|
|
30
30
|
if (e === "search") return "f002";
|
|
31
31
|
if (e === "password") return "f30d";
|
|
32
|
-
}, [
|
|
32
|
+
}, [t, a, e]), d = f(() => {
|
|
33
33
|
if (n) return n;
|
|
34
34
|
if (e === "number") return "Enter a number";
|
|
35
35
|
if (e === "search") return "Search";
|
|
36
36
|
if (e === "password") return "Enter password";
|
|
37
37
|
if (e === "phone") return "Enter phone number";
|
|
38
|
-
}, [n, e]),
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
},
|
|
38
|
+
}, [n, e]), j = f(() => e === "phone" ? "number" : e, [e]), g = (o) => {
|
|
39
|
+
c == null || c(o);
|
|
40
|
+
}, w = (o) => {
|
|
41
|
+
o.key === "Enter" && (i == null || i(o)), s == null || s(o);
|
|
42
|
+
}, k = U(
|
|
43
43
|
"xtrTextfield",
|
|
44
44
|
p && "withIcon",
|
|
45
|
-
|
|
45
|
+
t && "textarea",
|
|
46
46
|
l && "hasValue",
|
|
47
47
|
e === "phone" && "phone",
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
E && "active",
|
|
49
|
+
v
|
|
50
50
|
);
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ I(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
54
|
ref: T,
|
|
55
|
-
className:
|
|
55
|
+
className: k,
|
|
56
56
|
role: "textbox",
|
|
57
|
-
style:
|
|
57
|
+
style: C,
|
|
58
58
|
children: [
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
/* @__PURE__ */ r("label", { className: "placeholder", htmlFor: u, children: d }),
|
|
60
|
+
p && !t && /* @__PURE__ */ r(B, { code: p, type: F }),
|
|
61
|
+
e === "phone" && /* @__PURE__ */ I("div", { className: "dialCode", children: [
|
|
61
62
|
/* @__PURE__ */ r("span", { style: { backgroundImage: "url(https://flagcdn.com/in.svg)" } }),
|
|
62
63
|
/* @__PURE__ */ r("p", { children: "+91" })
|
|
63
64
|
] }),
|
|
64
|
-
|
|
65
|
+
t ? /* @__PURE__ */ r(
|
|
65
66
|
"textarea",
|
|
66
67
|
{
|
|
67
68
|
className: "input",
|
|
68
69
|
id: u,
|
|
69
|
-
autoFocus:
|
|
70
|
-
autoComplete:
|
|
70
|
+
autoFocus: x,
|
|
71
|
+
autoComplete: h,
|
|
71
72
|
value: l,
|
|
72
|
-
onChange:
|
|
73
|
-
onFocus:
|
|
74
|
-
onBlur:
|
|
75
|
-
onKeyUp:
|
|
76
|
-
onKeyDown:
|
|
73
|
+
onChange: y,
|
|
74
|
+
onFocus: b,
|
|
75
|
+
onBlur: N,
|
|
76
|
+
onKeyUp: g,
|
|
77
|
+
onKeyDown: w,
|
|
78
|
+
"aria-label": d
|
|
77
79
|
}
|
|
78
80
|
) : /* @__PURE__ */ r(
|
|
79
81
|
"input",
|
|
80
82
|
{
|
|
81
83
|
className: "input",
|
|
82
84
|
id: u,
|
|
83
|
-
type:
|
|
84
|
-
autoFocus:
|
|
85
|
-
autoComplete:
|
|
85
|
+
type: j,
|
|
86
|
+
autoFocus: x,
|
|
87
|
+
autoComplete: h,
|
|
86
88
|
value: l,
|
|
87
|
-
onChange:
|
|
88
|
-
onFocus:
|
|
89
|
-
onBlur:
|
|
90
|
-
onKeyUp:
|
|
91
|
-
onKeyDown:
|
|
89
|
+
onChange: y,
|
|
90
|
+
onFocus: b,
|
|
91
|
+
onBlur: N,
|
|
92
|
+
onKeyUp: g,
|
|
93
|
+
onKeyDown: w,
|
|
94
|
+
"aria-label": d
|
|
92
95
|
}
|
|
93
|
-
)
|
|
94
|
-
/* @__PURE__ */ r("label", { className: "placeholder", htmlFor: u, children: F })
|
|
96
|
+
)
|
|
95
97
|
]
|
|
96
98
|
}
|
|
97
99
|
);
|
|
98
100
|
});
|
|
99
|
-
|
|
101
|
+
M.displayName = "Textfield";
|
|
100
102
|
export {
|
|
101
|
-
|
|
103
|
+
M as Textfield
|
|
102
104
|
};
|
|
@@ -12,6 +12,7 @@ export type TTextfieldProps = {
|
|
|
12
12
|
icon?: string;
|
|
13
13
|
iconType?: keyof typeof EIconType;
|
|
14
14
|
value?: string;
|
|
15
|
+
id?: string;
|
|
15
16
|
onChange?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
16
17
|
onFocus?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
17
18
|
onBlur?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/Textfield/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,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