@arthurzakharov/ui-kit 1.8.5 → 1.8.6
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._TextField_diews_1{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;gap:var(--rm-ui-padding-xxs)}._Box_diews_10{position:relative}._Content_diews_14{box-sizing:border-box;position:relative;flex-grow:1;height:58px;padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm) calc(var(--rm-ui-padding-xs) - 2px) var(--rm-ui-padding-sm);display:flex;flex-direction:row;justify-content:stretch;align-items:flex-end}._Content_diews_14:hover{cursor:pointer}._Label_diews_30{position:absolute;left:var(--rm-ui-padding-sm);transition:top var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Label_diews_30:hover{cursor:pointer}._Idle_diews_40{top:50%;transform:translateY(-50%)}._Active_diews_45{top:var(--rm-ui-padding-xs);transform:translateY(0)}._Placeholder_diews_50{position:absolute;z-index:1;bottom:var(--rm-ui-padding-xs);left:var(--rm-ui-padding-sm)}._PlaceholderText_diews_57{opacity:.75;font-weight:var(--rm-ui-font-weight-regular);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-secondary)}._ErrorMessage_diews_65{padding-left:var(--rm-ui-padding-sm)}._Input_diews_69{flex-grow:1}._MaskStart_diews_73{opacity:0}
|
|
@@ -1,104 +1,105 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import c from "clsx";
|
|
3
|
-
import { useBoolean as
|
|
4
|
-
import { FadeScale as
|
|
5
|
-
import { FadeSlide as
|
|
6
|
-
import { Box as
|
|
3
|
+
import { useBoolean as f } from "usehooks-ts";
|
|
4
|
+
import { FadeScale as v } from "../../../animations/fade-scale/fade-scale.component.js";
|
|
5
|
+
import { FadeSlide as L } from "../../../animations/fade-slide/fade-slide.component.js";
|
|
6
|
+
import { Box as $ } from "../../primitives/box/box.component.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import { baseProps as
|
|
8
|
+
import { baseProps as u } from "../../../utils/functions/functions.util.js";
|
|
9
9
|
import "lucide-react";
|
|
10
|
-
import { ErrorMessage as
|
|
11
|
-
import { Label as
|
|
12
|
-
import { Input as
|
|
13
|
-
import '../../../assets/text-field-
|
|
10
|
+
import { ErrorMessage as k } from "../../primitives/error-message/error-message.component.js";
|
|
11
|
+
import { Label as C } from "../../primitives/label/label.component.js";
|
|
12
|
+
import { Input as j } from "../input/input.component.js";
|
|
13
|
+
import '../../../assets/text-field-ycFvAkxr.css';const D = "_TextField_diews_1", O = "_Box_diews_10", q = "_Content_diews_14", y = "_Label_diews_30", z = "_Idle_diews_40", G = "_Active_diews_45", H = "_Placeholder_diews_50", J = "_PlaceholderText_diews_57", K = "_ErrorMessage_diews_65", Q = "_Input_diews_69", R = "_MaskStart_diews_73", e = {
|
|
14
14
|
TextField: D,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
Box: O,
|
|
16
|
+
Content: q,
|
|
17
|
+
Label: y,
|
|
18
|
+
Idle: z,
|
|
19
|
+
Active: G,
|
|
20
|
+
Placeholder: H,
|
|
21
|
+
PlaceholderText: J,
|
|
22
|
+
ErrorMessage: K,
|
|
23
|
+
Input: Q,
|
|
24
|
+
MaskStart: R
|
|
25
|
+
}, le = ({
|
|
25
26
|
// Interactive props
|
|
26
27
|
id: d,
|
|
27
|
-
value:
|
|
28
|
+
value: s = "",
|
|
28
29
|
disabled: h = !1,
|
|
29
30
|
state: l = "idle",
|
|
30
|
-
onChange:
|
|
31
|
-
onFocus:
|
|
31
|
+
onChange: w,
|
|
32
|
+
onFocus: I,
|
|
32
33
|
onBlur: F,
|
|
33
34
|
// Text props
|
|
34
|
-
mask:
|
|
35
|
+
mask: i,
|
|
35
36
|
maxLength: M = -1,
|
|
36
37
|
label: P = "",
|
|
37
38
|
message: m = "",
|
|
38
39
|
placeholder: _ = "",
|
|
39
40
|
// Base props
|
|
40
|
-
...
|
|
41
|
+
...x
|
|
41
42
|
}) => {
|
|
42
|
-
const { value:
|
|
43
|
-
S(),
|
|
44
|
-
},
|
|
43
|
+
const { value: p, setTrue: T, setFalse: A } = f(!1), { value: a, setTrue: S, setFalse: b } = f(!1), r = a || !!s || p, B = !i && !!_ && a && !s && !p, N = !!m && l === "error", g = (o) => {
|
|
44
|
+
S(), I?.(o);
|
|
45
|
+
}, E = (o) => {
|
|
45
46
|
b(), F?.(o);
|
|
46
47
|
};
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ n(
|
|
48
49
|
"div",
|
|
49
50
|
{
|
|
50
|
-
"data-testid": x
|
|
51
|
-
className: c(e.TextField, x
|
|
51
|
+
"data-testid": u(x, "data-testid", "text-field"),
|
|
52
|
+
className: c(e.TextField, u(x, "className")),
|
|
52
53
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ n($, { state: l, focused: a, className: e.Box, children: [
|
|
54
55
|
/* @__PURE__ */ t(
|
|
55
|
-
|
|
56
|
+
C,
|
|
56
57
|
{
|
|
57
58
|
"data-testid": "text-label",
|
|
58
59
|
text: P,
|
|
59
|
-
position:
|
|
60
|
-
state:
|
|
61
|
-
className: c(e.Label,
|
|
60
|
+
position: r ? "active" : "idle",
|
|
61
|
+
state: r ? l : "idle",
|
|
62
|
+
className: c(e.Label, r ? e.Active : e.Idle)
|
|
62
63
|
}
|
|
63
64
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ n(
|
|
65
66
|
"label",
|
|
66
67
|
{
|
|
67
68
|
htmlFor: d,
|
|
68
69
|
className: e.Content,
|
|
69
70
|
onPointerDown: (o) => {
|
|
70
|
-
|
|
71
|
+
a && o.preventDefault();
|
|
71
72
|
},
|
|
72
73
|
children: [
|
|
73
|
-
/* @__PURE__ */ t(
|
|
74
|
+
/* @__PURE__ */ t(v, { name: "text-placeholder", condition: B, className: e.Placeholder, children: /* @__PURE__ */ t("span", { "data-testid": "text-placeholder", className: e.PlaceholderText, children: _ }) }),
|
|
74
75
|
/* @__PURE__ */ t(
|
|
75
|
-
|
|
76
|
+
j,
|
|
76
77
|
{
|
|
77
78
|
"data-testid": "text-input",
|
|
78
|
-
mask:
|
|
79
|
+
mask: i,
|
|
79
80
|
maxLength: M,
|
|
80
81
|
disabled: h,
|
|
81
82
|
id: d,
|
|
82
|
-
value:
|
|
83
|
+
value: s,
|
|
83
84
|
className: c(e.Input, {
|
|
84
|
-
[e.MaskStart]:
|
|
85
|
+
[e.MaskStart]: i && s === "" && !r
|
|
85
86
|
}),
|
|
86
87
|
onAnimationStart: T,
|
|
87
88
|
onAnimationEnd: A,
|
|
88
|
-
onChange:
|
|
89
|
-
onFocus:
|
|
90
|
-
onBlur:
|
|
89
|
+
onChange: w,
|
|
90
|
+
onFocus: g,
|
|
91
|
+
onBlur: E
|
|
91
92
|
}
|
|
92
93
|
)
|
|
93
94
|
]
|
|
94
95
|
}
|
|
95
96
|
)
|
|
96
97
|
] }),
|
|
97
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ t(L, { name: "text-message", direction: "ltr", condition: N, children: /* @__PURE__ */ t(k, { "data-testid": "text-error-message", text: m, className: e.ErrorMessage }) })
|
|
98
99
|
]
|
|
99
100
|
}
|
|
100
101
|
);
|
|
101
102
|
};
|
|
102
103
|
export {
|
|
103
|
-
|
|
104
|
+
le as TextField
|
|
104
105
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._TextField_1jd9o_1{position:relative;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;gap:var(--rm-ui-padding-xxs)}._Content_1jd9o_11{box-sizing:border-box;position:relative;flex-grow:1;height:58px;padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm) calc(var(--rm-ui-padding-xs) - 2px) var(--rm-ui-padding-sm);display:flex;flex-direction:row;justify-content:stretch;align-items:flex-end}._Content_1jd9o_11:hover{cursor:pointer}._Label_1jd9o_27{position:absolute;left:var(--rm-ui-padding-sm);transition:top var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Label_1jd9o_27:hover{cursor:pointer}._Idle_1jd9o_37{top:50%;transform:translateY(-50%)}._Active_1jd9o_42{top:var(--rm-ui-padding-xs);transform:translateY(0)}._Placeholder_1jd9o_47{position:absolute;z-index:1;bottom:var(--rm-ui-padding-xs);left:var(--rm-ui-padding-sm)}._PlaceholderText_1jd9o_54{opacity:.75;font-weight:var(--rm-ui-font-weight-regular);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-secondary)}._ErrorMessage_1jd9o_62{padding-left:var(--rm-ui-padding-sm)}._Input_1jd9o_66{flex-grow:1}._MaskStart_1jd9o_70{opacity:0}
|