meticulous-ui 3.6.3 → 3.6.4
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,92 +1,91 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as F, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useState as J, useRef as K } from "react";
|
|
3
3
|
import { Wrapper as M, TextareaBox as Q, Parent as U, Label as V, HelperText as X } from "./styles.js";
|
|
4
4
|
import { LeftIconWrapper as Y, RightIconWrapper as Z } from "../Input/styles.js";
|
|
5
|
-
import { getColor as _, getIcon as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
5
|
+
import { getColor as _, getIcon as v } from "./helpers.js";
|
|
6
|
+
import tt from "../../../colors/white.js";
|
|
7
|
+
import ot from "../../../colors/grey.js";
|
|
8
|
+
import w from "./SvgIcon.js";
|
|
9
|
+
const dt = ({
|
|
10
10
|
label: s,
|
|
11
|
-
onChange:
|
|
12
|
-
value:
|
|
13
|
-
type:
|
|
14
|
-
hasError:
|
|
15
|
-
name:
|
|
16
|
-
color:
|
|
11
|
+
onChange: C,
|
|
12
|
+
value: r,
|
|
13
|
+
type: b,
|
|
14
|
+
hasError: B,
|
|
15
|
+
name: u = "textarea",
|
|
16
|
+
color: H = "blue",
|
|
17
17
|
helperText: c = "",
|
|
18
|
-
background:
|
|
19
|
-
outerBackground:
|
|
20
|
-
isDynamic:
|
|
21
|
-
isResizeNone:
|
|
22
|
-
rows:
|
|
23
|
-
cols:
|
|
24
|
-
leftIcon:
|
|
25
|
-
rightIcon:
|
|
26
|
-
placeholder:
|
|
27
|
-
...
|
|
18
|
+
background: g = "transparent",
|
|
19
|
+
outerBackground: S = tt,
|
|
20
|
+
isDynamic: m,
|
|
21
|
+
isResizeNone: j,
|
|
22
|
+
rows: z = "2",
|
|
23
|
+
cols: L = "20",
|
|
24
|
+
leftIcon: W,
|
|
25
|
+
rightIcon: P,
|
|
26
|
+
placeholder: i,
|
|
27
|
+
...T
|
|
28
28
|
}) => {
|
|
29
|
-
const [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
n.style.height = `${G}px`;
|
|
36
|
-
}
|
|
29
|
+
const [e, $] = J(!1), a = _(H), h = K(null), k = (t) => {
|
|
30
|
+
t.style.height = "";
|
|
31
|
+
const R = t.scrollHeight - t.clientHeight;
|
|
32
|
+
if (R > 0) {
|
|
33
|
+
const G = parseFloat(window.getComputedStyle(t).height);
|
|
34
|
+
t.style.height = `${G + R}px`;
|
|
37
35
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
}, A = () => $(!0), E = () => $(!1), N = (t) => {
|
|
37
|
+
m && h.current && k(h.current), C(t);
|
|
38
|
+
}, I = { color: ot.m500, size: 20 }, d = v(W), f = v(P), l = !!d, x = !!f, n = B, O = m, q = g, D = { rows: z }, p = `textarea-${u}`, y = c ? `${p}-helper` : void 0;
|
|
39
|
+
return /* @__PURE__ */ F(M, { children: [
|
|
40
|
+
/* @__PURE__ */ o(
|
|
42
41
|
Q,
|
|
43
42
|
{
|
|
44
|
-
type:
|
|
45
|
-
name:
|
|
46
|
-
$hasError:
|
|
47
|
-
value:
|
|
48
|
-
$isFocused:
|
|
49
|
-
$shade:
|
|
50
|
-
$isDynamic:
|
|
51
|
-
$background:
|
|
52
|
-
cols:
|
|
53
|
-
$hasLeftIcon:
|
|
43
|
+
type: b,
|
|
44
|
+
name: u,
|
|
45
|
+
$hasError: n,
|
|
46
|
+
value: r,
|
|
47
|
+
$isFocused: e,
|
|
48
|
+
$shade: a,
|
|
49
|
+
$isDynamic: O,
|
|
50
|
+
$background: q,
|
|
51
|
+
cols: L,
|
|
52
|
+
$hasLeftIcon: l,
|
|
54
53
|
$hasRightIcon: x,
|
|
55
|
-
$isResizeNone:
|
|
56
|
-
...
|
|
57
|
-
id:
|
|
58
|
-
"aria-invalid":
|
|
54
|
+
$isResizeNone: j,
|
|
55
|
+
...D,
|
|
56
|
+
id: p,
|
|
57
|
+
"aria-invalid": n ? !0 : void 0,
|
|
59
58
|
"aria-describedby": y,
|
|
60
|
-
ref:
|
|
61
|
-
onFocus:
|
|
62
|
-
onBlur:
|
|
63
|
-
onChange:
|
|
64
|
-
...
|
|
59
|
+
ref: h,
|
|
60
|
+
onFocus: A,
|
|
61
|
+
onBlur: E,
|
|
62
|
+
onChange: N,
|
|
63
|
+
...T
|
|
65
64
|
}
|
|
66
65
|
),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
(s ||
|
|
66
|
+
d && /* @__PURE__ */ o(Y, { "aria-hidden": "true", style: { top: "1.2rem", transform: "none" }, children: /* @__PURE__ */ o(w, { svgIcon: d, iconStyles: I }) }),
|
|
67
|
+
f && /* @__PURE__ */ o(Z, { "aria-hidden": "true", style: { top: "1.2rem", transform: "none" }, children: /* @__PURE__ */ o(w, { svgIcon: f, iconStyles: I }) }),
|
|
68
|
+
/* @__PURE__ */ F(U, { children: [
|
|
69
|
+
(s || i && !r) && /* @__PURE__ */ o(
|
|
71
70
|
V,
|
|
72
71
|
{
|
|
73
72
|
as: "label",
|
|
74
|
-
htmlFor:
|
|
75
|
-
$hasError:
|
|
76
|
-
$isFocused:
|
|
77
|
-
$shade:
|
|
78
|
-
$value:
|
|
79
|
-
$outerBackground:
|
|
80
|
-
$hasLeftIcon:
|
|
73
|
+
htmlFor: p,
|
|
74
|
+
$hasError: n,
|
|
75
|
+
$isFocused: e,
|
|
76
|
+
$shade: a,
|
|
77
|
+
$value: r,
|
|
78
|
+
$outerBackground: e || r ? S : g,
|
|
79
|
+
$hasLeftIcon: l,
|
|
81
80
|
$hasRightIcon: x,
|
|
82
|
-
$onlyPh:
|
|
83
|
-
children: s ||
|
|
81
|
+
$onlyPh: i && !s,
|
|
82
|
+
children: s || i
|
|
84
83
|
}
|
|
85
84
|
),
|
|
86
|
-
c && /* @__PURE__ */
|
|
85
|
+
c && /* @__PURE__ */ o(X, { id: y, $hasError: n, $isFocused: e, $shade: a, $hasLeftIcon: l, children: c })
|
|
87
86
|
] })
|
|
88
87
|
] });
|
|
89
88
|
};
|
|
90
89
|
export {
|
|
91
|
-
|
|
90
|
+
dt as default
|
|
92
91
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import o, { css as r } from "styled-components";
|
|
2
2
|
import { black as a } from "../../../colors/black.js";
|
|
3
3
|
import l from "../../../colors/grey.js";
|
|
4
|
-
import
|
|
4
|
+
import m from "../../../colors/red.js";
|
|
5
5
|
import { getCssShade as i } from "./helpers.js";
|
|
6
6
|
const b = o.textarea`
|
|
7
7
|
border-radius: 0.64rem;
|
|
8
8
|
font-size: 2.24rem;
|
|
9
|
-
border: 2px solid ${({ $hasError: e }) => e ?
|
|
9
|
+
border: 2px solid ${({ $hasError: e }) => e ? m.m400 : a.m200};
|
|
10
10
|
padding: 0.96rem;
|
|
11
11
|
font-weight: 400;
|
|
12
12
|
transition: border-color 0.3s ease;
|
|
@@ -20,8 +20,6 @@ const b = o.textarea`
|
|
|
20
20
|
|
|
21
21
|
${({ $isDynamic: e }) => e && r`
|
|
22
22
|
resize: none;
|
|
23
|
-
display: block;
|
|
24
|
-
overflow: hidden;
|
|
25
23
|
`}
|
|
26
24
|
|
|
27
25
|
&:-webkit-autofill,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meticulous-ui",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
|
|
6
6
|
"types": "./index.d.ts",
|