mcr-design-systems 1.0.10 → 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/Button/index.js +27 -34
- package/dist/components/CheckBox/index.js +33 -33
- 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/Loading/index.d.ts +2 -1
- package/dist/components/Loading/index.js +12 -10
- 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/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/package.json +1 -1
|
@@ -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
|
};
|