mcr-design-systems 1.0.11 → 1.0.13
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/Icon/helper/index.d.ts +1 -1
- package/dist/components/InputBase/index.js +85 -79
- package/dist/components/InputPassword/index.js +23 -23
- package/dist/components/PIN/index.js +83 -83
- package/dist/components/PhoneInput/helper/variants.d.ts +9 -0
- package/dist/components/PhoneInput/helper/variants.js +10 -7
- package/dist/components/PhoneInput/index.js +43 -43
- package/dist/components/TextField/HelperText.js +45 -39
- package/dist/components/TextField/index.js +22 -22
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export type IconName = 'activity' | 'activity-heart' | 'alarm-clock' | 'alarm-clock-check' | 'alert-circle' | 'alert-octagon' | 'alert-triangle' | 'align-left' | 'align-right' | 'bell-01' | 'calendar' | 'camera-01' | 'check' | 'check-circle' | 'chevron-down' | 'chevron-left' | 'chevron-left-double' | 'chevron-right' | 'chevron-right-double' | 'chevron-up' | 'circle' | 'download-01' | 'eye' | 'eye-off' | 'filter-funnel-01' | 'help-circle' | 'info-circle' | 'loading-01' | 'minus' | 'plus' | 'search-lg' | 'search-md' | 'user-03' | 'x-circle' | 'x-close';
|
|
1
|
+
export type IconName = 'activity' | 'activity-heart' | 'alarm-clock' | 'alarm-clock-check' | 'alert-circle' | 'alert-octagon' | 'alert-triangle' | 'align-left' | 'align-right' | 'bell-01' | 'calendar' | 'camera-01' | 'check' | 'check-circle' | 'chevron-down' | 'chevron-left' | 'chevron-left-double' | 'chevron-right' | 'chevron-right-double' | 'chevron-up' | 'circle' | 'download-01' | 'eye' | 'eye-off' | 'filter-funnel-01' | 'help-circle' | 'info-circle' | 'loading-01' | 'minus' | 'plus' | 'search-lg' | 'search-md' | 'user-03' | 'x-circle' | 'x-close' | 'refresh-cw_01';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { inputBaseVariants as
|
|
4
|
-
import
|
|
5
|
-
import { cn as
|
|
6
|
-
import { dataTestId as
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import r, { forwardRef as D, useState as H, useMemo as B, useEffect as R, memo as _ } from "react";
|
|
3
|
+
import { inputBaseVariants as F, textAreaVariants as K } from "./variants.js";
|
|
4
|
+
import W from "../Icon/Icon.js";
|
|
5
|
+
import { cn as f } from "../../shared/utils/cn.js";
|
|
6
|
+
import { dataTestId as q } from "../../shared/utils/dataTestId.js";
|
|
7
|
+
const A = (n) => {
|
|
8
8
|
switch (n) {
|
|
9
9
|
case "sm":
|
|
10
10
|
return 16;
|
|
@@ -15,127 +15,134 @@ const q = (n) => {
|
|
|
15
15
|
default:
|
|
16
16
|
return 20;
|
|
17
17
|
}
|
|
18
|
-
}, N =
|
|
18
|
+
}, N = D(
|
|
19
19
|
({
|
|
20
20
|
disabled: n,
|
|
21
21
|
readOnly: a,
|
|
22
|
-
endAdornment:
|
|
23
|
-
className:
|
|
24
|
-
color:
|
|
25
|
-
sizeVariant:
|
|
26
|
-
startAdornment:
|
|
27
|
-
InputComponent:
|
|
22
|
+
endAdornment: l,
|
|
23
|
+
className: V,
|
|
24
|
+
color: w,
|
|
25
|
+
sizeVariant: v = "md",
|
|
26
|
+
startAdornment: b,
|
|
27
|
+
InputComponent: y,
|
|
28
28
|
containerProps: z,
|
|
29
|
-
containerRef:
|
|
30
|
-
width:
|
|
31
|
-
iconsSize:
|
|
29
|
+
containerRef: T,
|
|
30
|
+
width: C,
|
|
31
|
+
iconsSize: S,
|
|
32
32
|
error: j,
|
|
33
33
|
clearText: M,
|
|
34
34
|
optionalProps: h,
|
|
35
35
|
// inputSize,
|
|
36
36
|
...e
|
|
37
37
|
}, k) => {
|
|
38
|
-
const [L,
|
|
38
|
+
const [L, g] = H(!1), o = S || A(v), m = B(
|
|
39
39
|
() => `inputbase-input-${Math.random().toString(36).substring(2, 9)}`,
|
|
40
40
|
[]
|
|
41
|
-
),
|
|
41
|
+
), p = B(
|
|
42
42
|
() => `inputbase-textarea-${Math.random().toString(36).substring(2, 9)}`,
|
|
43
43
|
[]
|
|
44
44
|
);
|
|
45
|
-
|
|
45
|
+
R(() => {
|
|
46
46
|
const t = e.value;
|
|
47
47
|
if (t !== void 0) {
|
|
48
|
-
|
|
48
|
+
g(String(t).length > 0);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
55
|
-
|
|
51
|
+
const i = () => {
|
|
52
|
+
const c = e.type === "textarea" ? document.getElementById(p) : document.getElementById(m);
|
|
53
|
+
if (c) {
|
|
54
|
+
const x = () => {
|
|
55
|
+
g(c.value.length > 0);
|
|
56
56
|
};
|
|
57
|
-
return
|
|
58
|
-
|
|
57
|
+
return x(), c.addEventListener("input", x), () => {
|
|
58
|
+
c.removeEventListener("input", x);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
},
|
|
62
|
-
if (!
|
|
63
|
-
const
|
|
64
|
-
|
|
61
|
+
}, d = i();
|
|
62
|
+
if (!d) {
|
|
63
|
+
const c = setTimeout(() => {
|
|
64
|
+
i();
|
|
65
65
|
}, 100);
|
|
66
|
-
return () => clearTimeout(
|
|
66
|
+
return () => clearTimeout(c);
|
|
67
67
|
}
|
|
68
|
-
return
|
|
69
|
-
}, [e.type, e.value,
|
|
70
|
-
const
|
|
71
|
-
|
|
68
|
+
return d;
|
|
69
|
+
}, [e.type, e.value, m, p]);
|
|
70
|
+
const E = M && L ? /* @__PURE__ */ u(
|
|
71
|
+
W,
|
|
72
72
|
{
|
|
73
73
|
name: "x-circle",
|
|
74
74
|
variant: "solid",
|
|
75
|
-
size:
|
|
76
|
-
className: "cursor-pointer
|
|
75
|
+
size: o,
|
|
76
|
+
className: "cursor-pointer text-fg-neutral-subtle",
|
|
77
77
|
onClick: () => {
|
|
78
|
-
|
|
79
|
-
const t = e.type === "textarea" ? document.getElementById(
|
|
80
|
-
if (t)
|
|
78
|
+
g(!1);
|
|
79
|
+
const t = e.type === "textarea" ? document.getElementById(p) : document.getElementById(m);
|
|
80
|
+
if (t) {
|
|
81
81
|
if (t.value = "", e.onChange) {
|
|
82
|
-
const
|
|
82
|
+
const i = {
|
|
83
83
|
target: t,
|
|
84
84
|
currentTarget: t,
|
|
85
85
|
type: "change",
|
|
86
86
|
bubbles: !0
|
|
87
87
|
};
|
|
88
|
-
e.onChange(
|
|
88
|
+
e.onChange(i);
|
|
89
89
|
} else {
|
|
90
|
-
const
|
|
91
|
-
t.dispatchEvent(
|
|
90
|
+
const i = new Event("input", { bubbles: !0 }), d = new Event("change", { bubbles: !0 });
|
|
91
|
+
t.dispatchEvent(i), t.dispatchEvent(d);
|
|
92
92
|
}
|
|
93
|
+
t?.focus();
|
|
94
|
+
}
|
|
93
95
|
},
|
|
94
96
|
"aria-label": "Clear text"
|
|
95
97
|
}
|
|
96
|
-
) : null,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
) : null, s = E && l ? /* @__PURE__ */ I("div", { className: "flex items-center gap-2", children: [
|
|
99
|
+
E,
|
|
100
|
+
r.isValidElement(l) ? r.cloneElement(
|
|
101
|
+
l,
|
|
102
|
+
{
|
|
103
|
+
size: o
|
|
104
|
+
}
|
|
105
|
+
) : l
|
|
106
|
+
] }) : E || l, $ = {
|
|
100
107
|
sm: "h-4",
|
|
101
108
|
md: "h-5",
|
|
102
109
|
lg: "h-6"
|
|
103
110
|
};
|
|
104
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ u("div", { className: "relative justify-center items-center", children: /* @__PURE__ */ I(
|
|
105
112
|
"div",
|
|
106
113
|
{
|
|
107
|
-
...
|
|
108
|
-
ref:
|
|
114
|
+
...q("InputBase"),
|
|
115
|
+
ref: T,
|
|
109
116
|
...z,
|
|
110
|
-
className:
|
|
117
|
+
className: F({
|
|
111
118
|
disabled: !!n,
|
|
112
|
-
className:
|
|
113
|
-
color:
|
|
114
|
-
size: e?.type === "textarea" ? void 0 :
|
|
119
|
+
className: V,
|
|
120
|
+
color: w,
|
|
121
|
+
size: e?.type === "textarea" ? void 0 : v,
|
|
115
122
|
readOnly: !!a,
|
|
116
123
|
error: !!j
|
|
117
124
|
}),
|
|
118
|
-
style: { minWidth:
|
|
125
|
+
style: { minWidth: C ?? "100%" },
|
|
119
126
|
children: [
|
|
120
|
-
|
|
127
|
+
b && /* @__PURE__ */ u(
|
|
121
128
|
"div",
|
|
122
129
|
{
|
|
123
|
-
className:
|
|
130
|
+
className: f("flex cursor-pointer items-center justify-center", {
|
|
124
131
|
"color-icon-disabled": n || a,
|
|
125
132
|
"cursor-pointer": !n || a
|
|
126
133
|
}),
|
|
127
|
-
children:
|
|
134
|
+
children: r.cloneElement(b, {
|
|
128
135
|
// color: disabled || readOnly ? 'disabled' : 'currentColor',
|
|
129
|
-
size:
|
|
136
|
+
size: o
|
|
130
137
|
})
|
|
131
138
|
}
|
|
132
139
|
),
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
y ? r.cloneElement(
|
|
141
|
+
y,
|
|
135
142
|
{
|
|
136
|
-
id: e?.type === "textarea" ?
|
|
137
|
-
className:
|
|
138
|
-
e?.type === "textarea" ?
|
|
143
|
+
id: e?.type === "textarea" ? p : void 0,
|
|
144
|
+
className: f(
|
|
145
|
+
e?.type === "textarea" ? K({
|
|
139
146
|
size: h?.sizeTextArea,
|
|
140
147
|
disabled: !!n,
|
|
141
148
|
readOnly: !!a
|
|
@@ -147,13 +154,13 @@ const q = (n) => {
|
|
|
147
154
|
...e
|
|
148
155
|
},
|
|
149
156
|
null
|
|
150
|
-
) : /* @__PURE__ */
|
|
157
|
+
) : /* @__PURE__ */ u(
|
|
151
158
|
"input",
|
|
152
159
|
{
|
|
153
|
-
id: e.type === "textarea" ? void 0 :
|
|
154
|
-
className:
|
|
160
|
+
id: e.type === "textarea" ? void 0 : m,
|
|
161
|
+
className: f(
|
|
155
162
|
"w-full appearance-none bg-transparent font-sans outline-none",
|
|
156
|
-
$[
|
|
163
|
+
$[v || "md"]
|
|
157
164
|
),
|
|
158
165
|
ref: k,
|
|
159
166
|
disabled: n || a,
|
|
@@ -163,20 +170,19 @@ const q = (n) => {
|
|
|
163
170
|
}
|
|
164
171
|
}
|
|
165
172
|
),
|
|
166
|
-
|
|
173
|
+
s && /* @__PURE__ */ u(
|
|
167
174
|
"div",
|
|
168
175
|
{
|
|
169
|
-
className:
|
|
176
|
+
className: f("max-h flex items-center justify-center", {
|
|
170
177
|
"color-icon-disabled": n || a,
|
|
171
178
|
"cursor-pointer": !n || a
|
|
172
179
|
}),
|
|
173
|
-
children:
|
|
174
|
-
|
|
180
|
+
children: r.isValidElement(s) && s.type === "div" ? s : r.isValidElement(s) ? r.cloneElement(
|
|
181
|
+
s,
|
|
175
182
|
{
|
|
176
|
-
|
|
177
|
-
size: g
|
|
183
|
+
size: o
|
|
178
184
|
}
|
|
179
|
-
) :
|
|
185
|
+
) : s
|
|
180
186
|
}
|
|
181
187
|
)
|
|
182
188
|
]
|
|
@@ -185,7 +191,7 @@ const q = (n) => {
|
|
|
185
191
|
}
|
|
186
192
|
);
|
|
187
193
|
N.displayName = "InputBase";
|
|
188
|
-
const P =
|
|
194
|
+
const P = _(N);
|
|
189
195
|
export {
|
|
190
196
|
P as default
|
|
191
197
|
};
|
|
@@ -5,49 +5,49 @@ import I from "../TextField/HelperText.js";
|
|
|
5
5
|
import v from "../Icon/Icon.js";
|
|
6
6
|
const N = y(
|
|
7
7
|
({
|
|
8
|
-
helperText:
|
|
9
|
-
error:
|
|
10
|
-
showHelperIcon:
|
|
8
|
+
helperText: r,
|
|
9
|
+
error: a = !1,
|
|
10
|
+
showHelperIcon: n = !0,
|
|
11
11
|
helperIconCustom: l,
|
|
12
12
|
helperTextClassName: d,
|
|
13
13
|
defaultVisible: m = !1,
|
|
14
|
-
visible:
|
|
14
|
+
visible: t,
|
|
15
15
|
onVisibilityChange: c,
|
|
16
|
-
className:
|
|
17
|
-
...
|
|
18
|
-
},
|
|
19
|
-
const [p, w] = g(m),
|
|
20
|
-
if (
|
|
16
|
+
className: u,
|
|
17
|
+
...s
|
|
18
|
+
}, f) => {
|
|
19
|
+
const [p, w] = g(m), o = t !== void 0 ? t : p, b = () => {
|
|
20
|
+
if (s.disabled)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const i = !o;
|
|
23
|
+
t === void 0 && w(i), c?.(i);
|
|
24
24
|
};
|
|
25
25
|
return /* @__PURE__ */ x("div", { className: "w-full [&_input[type='password']::-ms-reveal]:hidden [&_input[type='password']::-ms-clear]:hidden", children: [
|
|
26
26
|
/* @__PURE__ */ e(
|
|
27
27
|
h,
|
|
28
28
|
{
|
|
29
|
-
...
|
|
30
|
-
ref:
|
|
31
|
-
type:
|
|
32
|
-
error:
|
|
33
|
-
className:
|
|
29
|
+
...s,
|
|
30
|
+
ref: f,
|
|
31
|
+
type: o ? "text" : "password",
|
|
32
|
+
error: a,
|
|
33
|
+
className: u,
|
|
34
|
+
clearText: !0,
|
|
34
35
|
endAdornment: /* @__PURE__ */ e(
|
|
35
36
|
v,
|
|
36
37
|
{
|
|
37
|
-
name:
|
|
38
|
-
|
|
39
|
-
className: `transition-colors ${t.disabled ? "bg-bg-input-disabled cursor-not-allowed" : "cursor-pointer hover:text-fg-neutral-rest text-fg-neutral-rest"}`,
|
|
38
|
+
name: o ? "eye" : "eye-off",
|
|
39
|
+
className: `transition-colors ${s.disabled ? "bg-bg-input-disabled cursor-not-allowed" : "cursor-pointer hover:text-fg-neutral-rest text-fg-neutral-rest"}`,
|
|
40
40
|
onClick: b
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
|
-
|
|
45
|
+
r && /* @__PURE__ */ e("div", { className: "mt-1", children: /* @__PURE__ */ e(
|
|
46
46
|
I,
|
|
47
47
|
{
|
|
48
|
-
text:
|
|
49
|
-
error:
|
|
50
|
-
haveIcon:
|
|
48
|
+
text: r,
|
|
49
|
+
error: a,
|
|
50
|
+
haveIcon: n,
|
|
51
51
|
iconsCustom: l,
|
|
52
52
|
className: d
|
|
53
53
|
}
|
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { pinInputVariants as
|
|
4
|
-
import { Typography as
|
|
5
|
-
import
|
|
6
|
-
import { cn as
|
|
7
|
-
import { dataTestId as
|
|
8
|
-
const
|
|
1
|
+
import { jsxs as z, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as B, useState as E, useRef as F, useEffect as d, useCallback as y } from "react";
|
|
3
|
+
import { pinInputVariants as H, pinVariants as S } from "./variants.js";
|
|
4
|
+
import { Typography as $ } from "../Typography/index.js";
|
|
5
|
+
import g from "../TextField/HelperText.js";
|
|
6
|
+
import { cn as j } from "../../shared/utils/cn.js";
|
|
7
|
+
import { dataTestId as q } from "../../shared/utils/dataTestId.js";
|
|
8
|
+
const C = B(
|
|
9
9
|
({
|
|
10
|
-
length:
|
|
11
|
-
mask:
|
|
12
|
-
error:
|
|
13
|
-
loading:
|
|
10
|
+
length: r = 4,
|
|
11
|
+
mask: v = !1,
|
|
12
|
+
error: u,
|
|
13
|
+
loading: w = !1,
|
|
14
14
|
disabled: n = !1,
|
|
15
|
-
onChange:
|
|
16
|
-
onComplete:
|
|
17
|
-
value:
|
|
18
|
-
autoFocus:
|
|
19
|
-
className:
|
|
20
|
-
label:
|
|
21
|
-
helperText:
|
|
22
|
-
size:
|
|
23
|
-
...
|
|
24
|
-
},
|
|
25
|
-
const [
|
|
26
|
-
Array.from({ length:
|
|
27
|
-
),
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
l(
|
|
31
|
-
}, [
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
const
|
|
35
|
-
(
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
15
|
+
onChange: c,
|
|
16
|
+
onComplete: G,
|
|
17
|
+
value: p = "",
|
|
18
|
+
autoFocus: I = !0,
|
|
19
|
+
className: k,
|
|
20
|
+
label: N,
|
|
21
|
+
helperText: V,
|
|
22
|
+
size: A = "medium",
|
|
23
|
+
...D
|
|
24
|
+
}, P) => {
|
|
25
|
+
const [o, l] = E(
|
|
26
|
+
Array.from({ length: r }, (t, s) => p[s] || "")
|
|
27
|
+
), a = F([]);
|
|
28
|
+
d(() => {
|
|
29
|
+
const t = Array.from({ length: r }, (s, e) => p[e] || "");
|
|
30
|
+
l(t);
|
|
31
|
+
}, [p, r]), d(() => {
|
|
32
|
+
I && !n && a.current[0] && a.current[0].focus();
|
|
33
|
+
}, [I, n]);
|
|
34
|
+
const b = y(
|
|
35
|
+
(t, s) => {
|
|
36
|
+
const e = s.replace(/\D/g, "").slice(-1), f = [...o];
|
|
37
|
+
f[t] = e, l(f);
|
|
38
|
+
const i = f.join("");
|
|
39
|
+
c?.(i), e && t < r - 1 && a.current[t + 1]?.focus();
|
|
40
40
|
},
|
|
41
|
-
[
|
|
42
|
-
),
|
|
43
|
-
(
|
|
44
|
-
if (
|
|
45
|
-
if (!
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
} else if (
|
|
49
|
-
const
|
|
50
|
-
|
|
41
|
+
[o, r, c]
|
|
42
|
+
), K = y(
|
|
43
|
+
(t, s) => {
|
|
44
|
+
if (s.key === "Backspace") {
|
|
45
|
+
if (!o[t] && t > 0) {
|
|
46
|
+
const e = [...o];
|
|
47
|
+
e[t - 1] = "", l(e), a.current[t - 1]?.focus(), c?.(e.join(""));
|
|
48
|
+
} else if (o[t]) {
|
|
49
|
+
const e = [...o];
|
|
50
|
+
e[t] = "", l(e), c?.(e.join(""));
|
|
51
51
|
}
|
|
52
|
-
} else
|
|
53
|
-
const
|
|
54
|
-
l(
|
|
55
|
-
const
|
|
56
|
-
|
|
52
|
+
} else s.key === "ArrowLeft" && t > 0 ? a.current[t - 1]?.focus() : s.key === "ArrowRight" && t < r - 1 ? a.current[t + 1]?.focus() : s.key === "v" && (s.metaKey || s.ctrlKey) && (s.preventDefault(), navigator.clipboard.readText().then((e) => {
|
|
53
|
+
const f = e.replace(/\D/g, "").slice(0, r), i = Array.from({ length: r }, (J, M) => f[M] || "");
|
|
54
|
+
l(i), c?.(i.join(""));
|
|
55
|
+
const L = Math.min(f.length, r - 1);
|
|
56
|
+
a.current[L]?.focus();
|
|
57
57
|
}));
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
),
|
|
61
|
-
|
|
62
|
-
}, []), { id:
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
[o, r, c]
|
|
60
|
+
), R = y((t) => {
|
|
61
|
+
a.current[t]?.select();
|
|
62
|
+
}, []), { id: _ } = q("PIN"), T = u ? "error" : n ? "disabled" : w ? "loading" : "default";
|
|
63
|
+
return /* @__PURE__ */ z("div", { ref: P, className: j(S({ className: k })), ...D, children: [
|
|
64
|
+
N && /* @__PURE__ */ m(
|
|
65
|
+
$,
|
|
66
66
|
{
|
|
67
67
|
variants: "label",
|
|
68
68
|
size: "sm",
|
|
69
69
|
color: "fg-neutral-subtle",
|
|
70
70
|
className: "mb-xs",
|
|
71
|
-
children:
|
|
71
|
+
children: N
|
|
72
72
|
}
|
|
73
73
|
),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ m("div", { className: "flex gap-xs", "data-test-id": _, children: Array.from({ length: r }).map((t, s) => /* @__PURE__ */ m(
|
|
75
75
|
"input",
|
|
76
76
|
{
|
|
77
|
-
ref: (
|
|
78
|
-
|
|
77
|
+
ref: (e) => {
|
|
78
|
+
a.current[s] = e;
|
|
79
79
|
},
|
|
80
|
-
type:
|
|
80
|
+
type: v ? "password" : "text",
|
|
81
81
|
inputMode: "numeric",
|
|
82
82
|
pattern: "[0-9]*",
|
|
83
83
|
maxLength: 1,
|
|
84
|
-
value:
|
|
85
|
-
disabled: n ||
|
|
86
|
-
className:
|
|
87
|
-
|
|
88
|
-
size:
|
|
89
|
-
state:
|
|
84
|
+
value: o[s],
|
|
85
|
+
disabled: n || w,
|
|
86
|
+
className: j(
|
|
87
|
+
H({
|
|
88
|
+
size: A,
|
|
89
|
+
state: T
|
|
90
90
|
})
|
|
91
91
|
),
|
|
92
|
-
onChange: (
|
|
93
|
-
onKeyDown: (
|
|
94
|
-
onFocus: () =>
|
|
95
|
-
"aria-label": `PIN digit ${
|
|
92
|
+
onChange: (e) => b(s, e.target.value),
|
|
93
|
+
onKeyDown: (e) => K(s, e),
|
|
94
|
+
onFocus: () => R(s),
|
|
95
|
+
"aria-label": `PIN digit ${s + 1}`,
|
|
96
96
|
autoComplete: "off"
|
|
97
97
|
},
|
|
98
|
-
|
|
98
|
+
s
|
|
99
99
|
)) }),
|
|
100
|
-
(
|
|
101
|
-
|
|
100
|
+
(V || u) && /* @__PURE__ */ m(
|
|
101
|
+
g,
|
|
102
102
|
{
|
|
103
|
-
text:
|
|
104
|
-
error: !!
|
|
105
|
-
haveIcon: !
|
|
103
|
+
text: u || V,
|
|
104
|
+
error: !!u,
|
|
105
|
+
haveIcon: !u,
|
|
106
106
|
className: "justify-start"
|
|
107
107
|
}
|
|
108
108
|
)
|
|
109
109
|
] });
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
|
-
|
|
112
|
+
C.displayName = "PIN";
|
|
113
113
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
C as PIN,
|
|
115
|
+
C as default
|
|
116
116
|
};
|
|
@@ -4,14 +4,17 @@ export declare const phoneInputVariants: import('tailwind-variants').TVReturnTyp
|
|
|
4
4
|
sm: {
|
|
5
5
|
countryButton: string;
|
|
6
6
|
inputContainer: string;
|
|
7
|
+
input: string;
|
|
7
8
|
};
|
|
8
9
|
md: {
|
|
9
10
|
countryButton: string;
|
|
10
11
|
inputContainer: string;
|
|
12
|
+
input: string;
|
|
11
13
|
};
|
|
12
14
|
lg: {
|
|
13
15
|
countryButton: string;
|
|
14
16
|
inputContainer: string;
|
|
17
|
+
input: string;
|
|
15
18
|
};
|
|
16
19
|
};
|
|
17
20
|
opened: {
|
|
@@ -43,14 +46,17 @@ export declare const phoneInputVariants: import('tailwind-variants').TVReturnTyp
|
|
|
43
46
|
sm: {
|
|
44
47
|
countryButton: string;
|
|
45
48
|
inputContainer: string;
|
|
49
|
+
input: string;
|
|
46
50
|
};
|
|
47
51
|
md: {
|
|
48
52
|
countryButton: string;
|
|
49
53
|
inputContainer: string;
|
|
54
|
+
input: string;
|
|
50
55
|
};
|
|
51
56
|
lg: {
|
|
52
57
|
countryButton: string;
|
|
53
58
|
inputContainer: string;
|
|
59
|
+
input: string;
|
|
54
60
|
};
|
|
55
61
|
};
|
|
56
62
|
opened: {
|
|
@@ -82,14 +88,17 @@ export declare const phoneInputVariants: import('tailwind-variants').TVReturnTyp
|
|
|
82
88
|
sm: {
|
|
83
89
|
countryButton: string;
|
|
84
90
|
inputContainer: string;
|
|
91
|
+
input: string;
|
|
85
92
|
};
|
|
86
93
|
md: {
|
|
87
94
|
countryButton: string;
|
|
88
95
|
inputContainer: string;
|
|
96
|
+
input: string;
|
|
89
97
|
};
|
|
90
98
|
lg: {
|
|
91
99
|
countryButton: string;
|
|
92
100
|
inputContainer: string;
|
|
101
|
+
input: string;
|
|
93
102
|
};
|
|
94
103
|
};
|
|
95
104
|
opened: {
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { tv as
|
|
2
|
-
const
|
|
1
|
+
import { tv as e } from "../../../node_modules/tailwind-variants/dist/index.js";
|
|
2
|
+
const t = e({
|
|
3
3
|
slots: {
|
|
4
4
|
countryButton: "border border-input bg-bg-input flex items-center hover:cursor-pointer border-r-0",
|
|
5
5
|
inputContainer: "min-w-[177px] flex-1 border border-input bg-bg-input hover:border-input-active focus-within:border-input-active focus-within:border-2 flex items-center",
|
|
6
|
-
input: "bg-transparent outline-none w-full h-full font-primary text-
|
|
6
|
+
input: "bg-transparent outline-none w-full h-full font-primary text-fg-neutral-main placeholder:text-fg-neutral-subtlest"
|
|
7
7
|
},
|
|
8
8
|
variants: {
|
|
9
9
|
size: {
|
|
10
10
|
sm: {
|
|
11
11
|
countryButton: "h-lg rounded-l-lg rounded-bl-lg py-none px-xs-2 gap-xs-3",
|
|
12
|
-
inputContainer: "h-lg rounded-r-lg rounded-br-lg px-sm py-sm-2 "
|
|
12
|
+
inputContainer: "h-lg rounded-r-lg rounded-br-lg px-sm py-sm-2 ",
|
|
13
|
+
input: "text-base-md font-normal leading-base-md placeholder:text-base-md"
|
|
13
14
|
},
|
|
14
15
|
md: {
|
|
15
16
|
countryButton: "h-xl rounded-l-lg rounded-bl-lg py-none px-xs gap-xs-3",
|
|
16
|
-
inputContainer: "h-xl rounded-r-lg rounded-br-lg px-sm-2 py-[10px]"
|
|
17
|
+
inputContainer: "h-xl rounded-r-lg rounded-br-lg px-sm-2 py-[10px]",
|
|
18
|
+
input: "text-base-md font-normal leading-base-md placeholder:text-base-md"
|
|
17
19
|
},
|
|
18
20
|
lg: {
|
|
19
21
|
countryButton: "h-xl-2 rounded-l-lg rounded-bl-lg py-none px-sm-2 gap-xs-3",
|
|
20
|
-
inputContainer: "h-xl-2 rounded-r-lg rounded-br-lg py-xs-2 px-xs"
|
|
22
|
+
inputContainer: "h-xl-2 rounded-r-lg rounded-br-lg py-xs-2 px-xs",
|
|
23
|
+
input: "text-base-lg font-normal leading-base-lg placeholder:text-base-lg"
|
|
21
24
|
}
|
|
22
25
|
},
|
|
23
26
|
opened: {
|
|
@@ -48,5 +51,5 @@ const n = r({
|
|
|
48
51
|
}
|
|
49
52
|
});
|
|
50
53
|
export {
|
|
51
|
-
|
|
54
|
+
t as phoneInputVariants
|
|
52
55
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import G from "../../node_modules/libphonenumber-js/examples.mobile.json.js";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as b } from "../../shared/utils/cn.js";
|
|
5
5
|
import { COUNTRIES_DATA as Q } from "../../shared/flags/countries-data.js";
|
|
6
6
|
import { FLAG_POSITIONS as W } from "../../shared/flags/flag-positions.js";
|
|
7
7
|
import { FLAG_BASE64 as Y } from "../../shared/flags/base64.js";
|
|
8
8
|
import { phoneInputVariants as q } from "./helper/variants.js";
|
|
9
9
|
import { Dropdown as H } from "../Dropdown/index.js";
|
|
10
|
-
import { Typography as
|
|
10
|
+
import { Typography as v } from "../Typography/index.js";
|
|
11
11
|
import J from "../Icon/Icon.js";
|
|
12
12
|
import K from "./FagDefault.js";
|
|
13
13
|
import { getExampleNumber as X } from "../../node_modules/libphonenumber-js/min/exports/getExampleNumber.js";
|
|
14
14
|
import { AsYouType as Z } from "../../node_modules/libphonenumber-js/min/exports/AsYouType.js";
|
|
15
|
-
const
|
|
15
|
+
const F = ({
|
|
16
16
|
countryCode: o
|
|
17
17
|
}) => {
|
|
18
18
|
const t = W[o];
|
|
19
19
|
return /* @__PURE__ */ s("div", { className: "w-[30px] h-[20px] overflow-hidden rounded-xs", children: t === void 0 ? /* @__PURE__ */ s(K, {}) : /* @__PURE__ */ s(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
|
-
className:
|
|
22
|
+
className: b(),
|
|
23
23
|
style: {
|
|
24
24
|
backgroundImage: `url('${Y}')`,
|
|
25
25
|
backgroundPosition: `${t.x}px ${t.y}px`,
|
|
@@ -44,7 +44,7 @@ const v = ({
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
return "Enter phone number";
|
|
47
|
-
},
|
|
47
|
+
}, P = (o, t) => {
|
|
48
48
|
if (!o || !o.trim()) return "";
|
|
49
49
|
try {
|
|
50
50
|
const c = new Z(t.toUpperCase()), d = o.replace(/[^\d]/g, "");
|
|
@@ -64,29 +64,29 @@ const v = ({
|
|
|
64
64
|
placeholder: d,
|
|
65
65
|
countries: a = Q,
|
|
66
66
|
showSearch: f = !1,
|
|
67
|
-
searchPlaceholder:
|
|
68
|
-
className:
|
|
69
|
-
size:
|
|
70
|
-
"data-testid":
|
|
71
|
-
error:
|
|
67
|
+
searchPlaceholder: O = "Search countries",
|
|
68
|
+
className: D,
|
|
69
|
+
size: h = "md",
|
|
70
|
+
"data-testid": R,
|
|
71
|
+
error: k,
|
|
72
72
|
// placeholder = 'Enter phone number',
|
|
73
|
-
...
|
|
74
|
-
},
|
|
75
|
-
const [
|
|
73
|
+
...A
|
|
74
|
+
}, L) => {
|
|
75
|
+
const [y, z] = n.useState(!1), [T, w] = n.useState(!1), [i, V] = n.useState(
|
|
76
76
|
t || a[0]?.code || "us"
|
|
77
|
-
), [
|
|
78
|
-
|
|
77
|
+
), [g, S] = n.useState(""), I = n.useRef(null), N = y, x = n.useCallback((e) => {
|
|
78
|
+
z(e), e || S("");
|
|
79
79
|
}, []), m = n.useMemo(
|
|
80
80
|
() => a.find((e) => e.code === i) || a[0],
|
|
81
81
|
[a, i]
|
|
82
|
-
), _ = n.useMemo(() => d || ee(i), [i, d]),
|
|
83
|
-
size:
|
|
84
|
-
opened:
|
|
82
|
+
), _ = n.useMemo(() => d || ee(i), [i, d]), C = q({
|
|
83
|
+
size: h,
|
|
84
|
+
opened: N,
|
|
85
85
|
inputFocused: T
|
|
86
86
|
}), $ = n.useCallback(
|
|
87
87
|
(e) => {
|
|
88
|
-
if (o?.(e),
|
|
89
|
-
const r =
|
|
88
|
+
if (o?.(e), x(!1), V(e.code), t && t.trim()) {
|
|
89
|
+
const r = P(
|
|
90
90
|
t,
|
|
91
91
|
e.code
|
|
92
92
|
);
|
|
@@ -97,20 +97,20 @@ const v = ({
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
[o,
|
|
100
|
+
[o, x, t, c]
|
|
101
101
|
), E = n.useMemo(() => a.filter(
|
|
102
|
-
(e) => e.name.toLowerCase().includes(
|
|
102
|
+
(e) => e.name.toLowerCase().includes(g.toLowerCase()) || e.code.toLowerCase().includes(g.toLowerCase())
|
|
103
103
|
).map((e) => ({
|
|
104
104
|
label: e.name,
|
|
105
105
|
value: e.code,
|
|
106
|
-
icon: /* @__PURE__ */ s(
|
|
106
|
+
icon: /* @__PURE__ */ s(F, { countryCode: e.code }),
|
|
107
107
|
startIconSize: "auto",
|
|
108
108
|
endIconSize: "auto",
|
|
109
|
-
endIcon: /* @__PURE__ */ l(
|
|
109
|
+
endIcon: /* @__PURE__ */ l(v, { variants: "body", size: "sm", color: "fg-neutral-subtle", children: [
|
|
110
110
|
"+",
|
|
111
111
|
e.dial_code
|
|
112
112
|
] })
|
|
113
|
-
})), [a,
|
|
113
|
+
})), [a, g]), B = n.useCallback(
|
|
114
114
|
(e) => {
|
|
115
115
|
const r = e.target.value, p = t, M = r.length < p.length;
|
|
116
116
|
if (r.length > 20) {
|
|
@@ -127,7 +127,7 @@ const v = ({
|
|
|
127
127
|
});
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
const j = u ?
|
|
130
|
+
const j = u ? P(u, i) : "";
|
|
131
131
|
c?.({
|
|
132
132
|
formatted: j,
|
|
133
133
|
raw: u,
|
|
@@ -137,12 +137,12 @@ const v = ({
|
|
|
137
137
|
},
|
|
138
138
|
[m, c, i, t]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */ l("div", { className:
|
|
140
|
+
return /* @__PURE__ */ l("div", { className: b("flex items-center", D), ref: I, children: [
|
|
141
141
|
/* @__PURE__ */ s(
|
|
142
142
|
H,
|
|
143
143
|
{
|
|
144
|
-
open:
|
|
145
|
-
onOpenChange:
|
|
144
|
+
open: y,
|
|
145
|
+
onOpenChange: x,
|
|
146
146
|
items: E,
|
|
147
147
|
value: i,
|
|
148
148
|
onValueChange: (e) => {
|
|
@@ -154,36 +154,36 @@ const v = ({
|
|
|
154
154
|
align: "start",
|
|
155
155
|
"data-testid": "align-start-dropdown",
|
|
156
156
|
search: f,
|
|
157
|
-
searchPlaceholder:
|
|
157
|
+
searchPlaceholder: O,
|
|
158
158
|
enableVirtualization: !0,
|
|
159
159
|
onSearchChange: (e) => {
|
|
160
|
-
|
|
160
|
+
S(e);
|
|
161
161
|
},
|
|
162
|
-
width:
|
|
163
|
-
children: /* @__PURE__ */ l("div", { className:
|
|
164
|
-
/* @__PURE__ */ s(
|
|
162
|
+
width: I.current?.clientWidth || "auto",
|
|
163
|
+
children: /* @__PURE__ */ l("div", { className: C.countryButton(), children: [
|
|
164
|
+
/* @__PURE__ */ s(F, { countryCode: i }),
|
|
165
165
|
/* @__PURE__ */ l("div", { className: "flex gap-xs-4", children: [
|
|
166
|
-
/* @__PURE__ */ l(
|
|
166
|
+
/* @__PURE__ */ l(v, { variants: "body", size: "md", children: [
|
|
167
167
|
"+",
|
|
168
168
|
m.dial_code
|
|
169
169
|
] }),
|
|
170
|
-
/* @__PURE__ */ s(J, { name:
|
|
170
|
+
/* @__PURE__ */ s(J, { name: N ? "chevron-up" : "chevron-down", size: 16 })
|
|
171
171
|
] })
|
|
172
172
|
] })
|
|
173
173
|
}
|
|
174
174
|
),
|
|
175
|
-
/* @__PURE__ */ s("div", { className:
|
|
175
|
+
/* @__PURE__ */ s("div", { className: C.inputContainer({ error: k, size: h }), children: /* @__PURE__ */ s(
|
|
176
176
|
"input",
|
|
177
177
|
{
|
|
178
|
-
...
|
|
179
|
-
ref:
|
|
180
|
-
className: C
|
|
178
|
+
...A,
|
|
179
|
+
ref: L,
|
|
180
|
+
className: b(C.input({ size: h })),
|
|
181
181
|
placeholder: _,
|
|
182
182
|
value: t,
|
|
183
183
|
onChange: B,
|
|
184
|
-
onFocus: () =>
|
|
185
|
-
onBlur: () =>
|
|
186
|
-
"data-testid":
|
|
184
|
+
onFocus: () => w(!0),
|
|
185
|
+
onBlur: () => w(!1),
|
|
186
|
+
"data-testid": R
|
|
187
187
|
}
|
|
188
188
|
) })
|
|
189
189
|
] });
|
|
@@ -1,44 +1,50 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { Typography as f } from "../Typography/index.js";
|
|
4
4
|
import s from "../Icon/Icon.js";
|
|
5
|
-
const
|
|
6
|
-
text:
|
|
7
|
-
error:
|
|
8
|
-
haveIcon:
|
|
9
|
-
iconsCustom:
|
|
10
|
-
className:
|
|
11
|
-
iconsSize:
|
|
12
|
-
}) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
className: "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
5
|
+
const p = ({
|
|
6
|
+
text: l,
|
|
7
|
+
error: a = !1,
|
|
8
|
+
haveIcon: i = !0,
|
|
9
|
+
iconsCustom: r,
|
|
10
|
+
className: n,
|
|
11
|
+
iconsSize: t = 16
|
|
12
|
+
}) => l ? /* @__PURE__ */ e(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: `self-stretch inline-flex flex-col justify-start items-start ${n || ""}`,
|
|
16
|
+
children: /* @__PURE__ */ c("div", { className: "self-stretch inline-flex justify-start items-start gap-1", children: [
|
|
17
|
+
a && (r ? /* @__PURE__ */ e("div", { className: "w-5 h-5 relative", children: r }) : /* @__PURE__ */ e("div", { className: "w-5 h-5 relative", children: /* @__PURE__ */ e(
|
|
18
|
+
s,
|
|
19
|
+
{
|
|
20
|
+
name: "alert-octagon",
|
|
21
|
+
className: "text-fg-accent-error",
|
|
22
|
+
variant: "solid",
|
|
23
|
+
size: typeof t == "number" ? t : 16
|
|
24
|
+
}
|
|
25
|
+
) })),
|
|
26
|
+
i && !a && /* @__PURE__ */ e("div", { className: "w-5 h-5 relative", children: /* @__PURE__ */ e(
|
|
27
|
+
s,
|
|
28
|
+
{
|
|
29
|
+
name: "help-circle",
|
|
30
|
+
variant: "line",
|
|
31
|
+
className: "text-fg-neutral-subtle",
|
|
32
|
+
size: typeof t == "number" ? t : 16
|
|
33
|
+
}
|
|
34
|
+
) }),
|
|
35
|
+
/* @__PURE__ */ e("div", { className: "flex-1 justify-start text-left flex flex-wrap items-center gap-0", children: /* @__PURE__ */ e(
|
|
36
|
+
f,
|
|
37
|
+
{
|
|
38
|
+
variants: "body",
|
|
39
|
+
size: "md",
|
|
40
|
+
color: a ? "fg-accent-error-strong" : "fg-neutral-subtle",
|
|
41
|
+
className: "inline",
|
|
42
|
+
children: l
|
|
43
|
+
}
|
|
44
|
+
) })
|
|
45
|
+
] })
|
|
46
|
+
}
|
|
47
|
+
) : null;
|
|
42
48
|
export {
|
|
43
|
-
|
|
49
|
+
p as default
|
|
44
50
|
};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as b, memo as p } from "react";
|
|
3
3
|
import I from "../InputBase/index.js";
|
|
4
|
-
import { Typography as
|
|
4
|
+
import { Typography as m } from "../Typography/index.js";
|
|
5
5
|
import H from "./HelperText.js";
|
|
6
6
|
import "clsx";
|
|
7
7
|
import "tailwind-merge";
|
|
8
8
|
import { dataTestId as A } from "../../shared/utils/dataTestId.js";
|
|
9
|
-
const d =
|
|
9
|
+
const d = b(
|
|
10
10
|
({
|
|
11
|
-
label:
|
|
11
|
+
label: n,
|
|
12
12
|
helpText: x,
|
|
13
|
-
error:
|
|
13
|
+
error: s,
|
|
14
14
|
color: f,
|
|
15
15
|
disabled: o,
|
|
16
16
|
readOnly: u,
|
|
17
|
-
width:
|
|
17
|
+
width: l,
|
|
18
18
|
type: i,
|
|
19
19
|
iconsCustom: g,
|
|
20
|
-
iconsSize:
|
|
20
|
+
iconsSize: c,
|
|
21
21
|
fontSize: h,
|
|
22
22
|
optionalProps: e,
|
|
23
23
|
indicatorLength: v,
|
|
24
24
|
haveIcon: y,
|
|
25
25
|
// inputSize = 'md',
|
|
26
|
-
clearText:
|
|
26
|
+
clearText: N,
|
|
27
27
|
...t
|
|
28
|
-
},
|
|
28
|
+
}, T) => /* @__PURE__ */ r(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
31
|
style: {
|
|
32
|
-
width:
|
|
32
|
+
width: l
|
|
33
33
|
},
|
|
34
34
|
...A("TextField"),
|
|
35
35
|
children: [
|
|
36
36
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
37
|
-
|
|
37
|
+
n && /* @__PURE__ */ r("div", { className: "mb-1 flex items-center gap-[2px]", children: [
|
|
38
38
|
/* @__PURE__ */ a(
|
|
39
|
-
|
|
39
|
+
m,
|
|
40
40
|
{
|
|
41
41
|
variants: "action",
|
|
42
42
|
size: "sm",
|
|
43
43
|
color: "fg-neutral-subtle",
|
|
44
|
-
children:
|
|
44
|
+
children: n
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
47
|
t.required && /* @__PURE__ */ a(
|
|
48
|
-
|
|
48
|
+
m,
|
|
49
49
|
{
|
|
50
50
|
variants: "action",
|
|
51
51
|
size: "sm",
|
|
@@ -56,7 +56,7 @@ const d = T(
|
|
|
56
56
|
)
|
|
57
57
|
] }),
|
|
58
58
|
i === "textarea" && e?.showIndicator && /* @__PURE__ */ r(
|
|
59
|
-
|
|
59
|
+
m,
|
|
60
60
|
{
|
|
61
61
|
variants: "action",
|
|
62
62
|
size: "sm",
|
|
@@ -74,15 +74,15 @@ const d = T(
|
|
|
74
74
|
/* @__PURE__ */ a(
|
|
75
75
|
I,
|
|
76
76
|
{
|
|
77
|
-
ref:
|
|
77
|
+
ref: T,
|
|
78
78
|
disabled: o,
|
|
79
79
|
readOnly: u,
|
|
80
|
-
width:
|
|
80
|
+
width: l,
|
|
81
81
|
type: i,
|
|
82
82
|
fontSize: h,
|
|
83
|
-
iconsSize:
|
|
83
|
+
iconsSize: c,
|
|
84
84
|
optionalProps: e,
|
|
85
|
-
clearText:
|
|
85
|
+
clearText: N,
|
|
86
86
|
InputComponent: i === "textarea" ? /* @__PURE__ */ a(
|
|
87
87
|
"textarea",
|
|
88
88
|
{
|
|
@@ -96,7 +96,7 @@ const d = T(
|
|
|
96
96
|
}
|
|
97
97
|
) : void 0,
|
|
98
98
|
...t,
|
|
99
|
-
color:
|
|
99
|
+
color: s ? "error" : f || "primary"
|
|
100
100
|
}
|
|
101
101
|
),
|
|
102
102
|
/* @__PURE__ */ a(
|
|
@@ -104,9 +104,9 @@ const d = T(
|
|
|
104
104
|
{
|
|
105
105
|
className: "mt-1",
|
|
106
106
|
text: x,
|
|
107
|
-
error:
|
|
107
|
+
error: s,
|
|
108
108
|
haveIcon: y,
|
|
109
|
-
iconsSize:
|
|
109
|
+
iconsSize: c,
|
|
110
110
|
iconsCustom: g
|
|
111
111
|
}
|
|
112
112
|
)
|