@arthurzakharov/ui-kit 3.18.0 → 3.19.0
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
|
+
._TextArea_15g66_1{display:flex;flex-direction:column}._Input_15g66_6{resize:none;outline:none;box-sizing:border-box;width:100%;border:none;border-radius:10px;padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm);font-weight:var(--rm-ui-font-weight-medium);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-primary)}._Input_15g66_6:hover{cursor:pointer}._Input_15g66_6:disabled{opacity:.33}._ErrorMessage_15g66_28{padding-top:var(--rm-ui-padding-xxs)}._FieldGroup_15g66_32{display:flex;flex-direction:column;gap:var(--rm-ui-padding-xs);width:100%}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Interactive } from '../../utils';
|
|
2
2
|
import { Base } from '../../../utils/types';
|
|
3
|
+
export type TextAreaPlaceholderPosition = 'inside' | 'outside';
|
|
3
4
|
export interface TextAreaProps extends Base, Interactive<string> {
|
|
4
5
|
placeholder?: string;
|
|
6
|
+
placeholderPosition?: TextAreaPlaceholderPosition;
|
|
5
7
|
rows?: number;
|
|
6
8
|
message?: string;
|
|
7
9
|
}
|
|
8
|
-
export declare const TextArea: ({ id, value, disabled, state, onChange, onFocus, onBlur, placeholder, rows, message, ...base }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const TextArea: ({ id, value, disabled, state, onChange, onFocus, onBlur, placeholder, placeholderPosition, rows, message, ...base }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,64 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { baseProps as
|
|
3
|
-
import { FadeSlide as
|
|
4
|
-
import { Box as
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { baseProps as s, clsx as B } from "../../../utils/functions/functions.util.js";
|
|
3
|
+
import { FadeSlide as C } from "../../../animations/fade-slide/fade-slide.component.js";
|
|
4
|
+
import { Box as G } from "../../primitives/box/box.component.js";
|
|
5
5
|
import "../../../utils/content/content.component.js";
|
|
6
6
|
import "lucide-react";
|
|
7
|
-
import { ErrorMessage as
|
|
7
|
+
import { ErrorMessage as y } from "../../primitives/error-message/error-message.component.js";
|
|
8
8
|
import "usehooks-ts";
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { Text as b } from "../../../components/text/text.component.js";
|
|
10
|
+
import { useControlInteraction as j } from "../../utils/hooks/use-control-interaction/use-control-interaction.hook.js";
|
|
11
|
+
import '../../../assets/text-area-aZwGK7CT.css';const O = "_Input_15g66_6", T = "_ErrorMessage_15g66_28", $ = "_FieldGroup_15g66_32", t = {
|
|
12
|
+
Input: O,
|
|
13
|
+
ErrorMessage: T,
|
|
14
|
+
FieldGroup: $
|
|
15
|
+
}, J = ({
|
|
14
16
|
// Interactive props
|
|
15
|
-
id:
|
|
16
|
-
value:
|
|
17
|
-
disabled:
|
|
17
|
+
id: a,
|
|
18
|
+
value: u,
|
|
19
|
+
disabled: i = !1,
|
|
18
20
|
state: n = "idle",
|
|
19
|
-
onChange:
|
|
20
|
-
onFocus:
|
|
21
|
-
onBlur:
|
|
21
|
+
onChange: g,
|
|
22
|
+
onFocus: x,
|
|
23
|
+
onBlur: f,
|
|
22
24
|
// TextArea props
|
|
23
|
-
placeholder:
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
placeholder: r = "",
|
|
26
|
+
placeholderPosition: h = "inside",
|
|
27
|
+
rows: _ = 5,
|
|
28
|
+
message: d = "",
|
|
26
29
|
// Base props
|
|
27
|
-
...
|
|
30
|
+
...o
|
|
28
31
|
}) => {
|
|
29
|
-
const { focused:
|
|
30
|
-
id:
|
|
31
|
-
disabled:
|
|
32
|
-
onChange:
|
|
33
|
-
onFocus:
|
|
34
|
-
onBlur:
|
|
35
|
-
})
|
|
36
|
-
|
|
32
|
+
const { focused: F, emitChange: N, handleFocus: E, handleBlur: I } = j({
|
|
33
|
+
id: a,
|
|
34
|
+
disabled: i,
|
|
35
|
+
onChange: g,
|
|
36
|
+
onFocus: x,
|
|
37
|
+
onBlur: f
|
|
38
|
+
}), m = s(o, "data-testid", "textarea"), c = h === "outside", M = c && !!r, l = /* @__PURE__ */ e(G, { state: n, focused: F, className: s(o, "className"), children: /* @__PURE__ */ e(
|
|
39
|
+
"textarea",
|
|
40
|
+
{
|
|
41
|
+
"data-testid": "textarea-input",
|
|
42
|
+
disabled: i,
|
|
43
|
+
id: a,
|
|
44
|
+
rows: _,
|
|
45
|
+
placeholder: c ? "" : r,
|
|
46
|
+
value: u,
|
|
47
|
+
className: t.Input,
|
|
48
|
+
onChange: (v) => N(v.target.value, "keyboard"),
|
|
49
|
+
onFocus: () => E(),
|
|
50
|
+
onBlur: () => I()
|
|
51
|
+
}
|
|
52
|
+
) });
|
|
53
|
+
return /* @__PURE__ */ p(
|
|
37
54
|
"div",
|
|
38
55
|
{
|
|
39
|
-
"data-testid":
|
|
40
|
-
className:
|
|
56
|
+
"data-testid": m,
|
|
57
|
+
className: B(t.Container, s(o, "className")),
|
|
41
58
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
id: o,
|
|
48
|
-
rows: u,
|
|
49
|
-
placeholder: p,
|
|
50
|
-
value: c,
|
|
51
|
-
className: a.Input,
|
|
52
|
-
onChange: (E) => x(E.target.value, "keyboard"),
|
|
53
|
-
onFocus: () => f(),
|
|
54
|
-
onBlur: () => h()
|
|
55
|
-
}
|
|
56
|
-
) }),
|
|
57
|
-
/* @__PURE__ */ r(_, { name: "text-message", condition: n === "error" && !!m, children: /* @__PURE__ */ r(C, { "data-testid": "textarea-error-message", text: m, className: a.ErrorMessage }) })
|
|
59
|
+
M ? /* @__PURE__ */ p("div", { className: t.FieldGroup, children: [
|
|
60
|
+
/* @__PURE__ */ e(b, { tag: "div", weight: "medium", size: "body", color: "text-primary", "data-testid": `${m}-label`, children: r }),
|
|
61
|
+
l
|
|
62
|
+
] }) : l,
|
|
63
|
+
/* @__PURE__ */ e(C, { name: "text-message", condition: n === "error" && !!d, children: /* @__PURE__ */ e(y, { "data-testid": "textarea-error-message", text: d, className: t.ErrorMessage }) })
|
|
58
64
|
]
|
|
59
65
|
}
|
|
60
66
|
);
|
|
61
67
|
};
|
|
62
68
|
export {
|
|
63
|
-
|
|
69
|
+
J as TextArea
|
|
64
70
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._TextArea_11gck_1{display:flex;flex-direction:column}._Input_11gck_6{resize:none;outline:none;box-sizing:border-box;width:100%;border:none;border-radius:10px;padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm);font-weight:var(--rm-ui-font-weight-medium);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-primary)}._Input_11gck_6:hover{cursor:pointer}._Input_11gck_6:disabled{opacity:.33}._ErrorMessage_11gck_28{padding-top:var(--rm-ui-padding-xxs)}
|