prometeo-design-system 4.7.1 → 4.7.3
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/Chip.es.js +1 -1
- package/dist/Header.es.js +6 -6
- package/dist/IconButton.es.js +1 -1
- package/dist/Input.es.js +3 -3
- package/dist/PyrionLayout.es.js +181 -178
- package/dist/Select.es.js +159 -163
- package/dist/TextArea.es.js +84 -60
- package/package.json +1 -1
package/dist/TextArea.es.js
CHANGED
|
@@ -1,84 +1,106 @@
|
|
|
1
1
|
import { j as r } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
2
|
import { c as a } from "./cn-B6yFEsav.js";
|
|
3
3
|
import * as o from "react";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { c as
|
|
4
|
+
import { forwardRef as $, Children as q, isValidElement as B } from "react";
|
|
5
|
+
import { c as y } from "./index-BOQuZ0gG.js";
|
|
6
6
|
import { H as D } from "./HelperComponent-ljsn0xD6.js";
|
|
7
|
-
const F =
|
|
7
|
+
const F = y(
|
|
8
8
|
"transition-all duration-300 ease-in-out border px-3 rounded-lg flex gap-1 items-stretch relative overflow-auto prometeo-scrollbar-thin-weak",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default: "border-neutral-default-default focus-within:border-primary-default-default",
|
|
13
|
-
error: "border-error-default-default focus-within:border-error-default",
|
|
14
|
-
success: "border-success-default-default focus-within:border-success-default"
|
|
12
|
+
default: "border-neutral-default-default hover:border-primary-default-default focus-within:border-primary-default-default focus-within:ring-1 focus-within:ring-primary-default-default focus-within:hover:border-primary-default-default",
|
|
13
|
+
error: "border-error-default-default hover:border-error-strong-default focus-within:border-error-default focus-within:ring-1 focus-within:ring-error-default-default focus-within:hover:border-error-default",
|
|
14
|
+
success: "border-success-default-default hover:border-success-strong-default focus-within:border-success-default focus-within:ring-1 focus-within:ring-success-default-default focus-within:hover:border-success-default"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: {
|
|
18
18
|
variant: "default"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
),
|
|
21
|
+
), G = y(
|
|
22
|
+
"",
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
disabled: {
|
|
26
|
+
true: "border-neutral-strong-default hover:border-neutral-strong-default "
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
), J = y(
|
|
31
|
+
"",
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
disabled: {
|
|
35
|
+
true: "placeholder:text-neutral-medium-disabled text-neutral-medium-disabled"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
), j = $(
|
|
22
40
|
({
|
|
23
41
|
className: t,
|
|
24
42
|
autoResize: s = !0,
|
|
25
|
-
userResize:
|
|
26
|
-
minRows:
|
|
43
|
+
userResize: c = !1,
|
|
44
|
+
minRows: d = 1,
|
|
27
45
|
maxRows: i,
|
|
28
|
-
placeholder:
|
|
29
|
-
onChange:
|
|
30
|
-
value:
|
|
31
|
-
rows:
|
|
32
|
-
disabled:
|
|
33
|
-
children:
|
|
34
|
-
variant:
|
|
35
|
-
helperComponent:
|
|
46
|
+
placeholder: A,
|
|
47
|
+
onChange: S,
|
|
48
|
+
value: k,
|
|
49
|
+
rows: n,
|
|
50
|
+
disabled: u = !1,
|
|
51
|
+
children: m,
|
|
52
|
+
variant: v = "default",
|
|
53
|
+
helperComponent: h,
|
|
36
54
|
...R
|
|
37
55
|
// ← Para pasar las props nativas
|
|
38
|
-
},
|
|
39
|
-
const
|
|
56
|
+
}, l) => {
|
|
57
|
+
const N = o.useRef(null), V = o.useRef(null), E = o.useCallback(
|
|
40
58
|
(e) => {
|
|
41
|
-
|
|
59
|
+
N.current = e, typeof l == "function" ? l(e) : l && (l.current = e);
|
|
42
60
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
const e =
|
|
61
|
+
[l]
|
|
62
|
+
), g = o.useCallback(() => {
|
|
63
|
+
const e = N.current;
|
|
46
64
|
if (!e || !s) return;
|
|
47
65
|
e.style.height = "auto";
|
|
48
|
-
const
|
|
49
|
-
let
|
|
50
|
-
if (i ||
|
|
51
|
-
const
|
|
52
|
-
|
|
66
|
+
const L = e.scrollHeight, p = Number.parseInt(getComputedStyle(e).lineHeight) || 16, O = Math.min((n ?? d) * p, V.current?.clientHeight || 0);
|
|
67
|
+
let f = Math.max(L, O);
|
|
68
|
+
if (i || n) {
|
|
69
|
+
const _ = (i || n || 1) * p;
|
|
70
|
+
f = Math.min(f, _);
|
|
53
71
|
}
|
|
54
|
-
e.style.height = `${
|
|
55
|
-
}, [s,
|
|
56
|
-
|
|
72
|
+
e.style.height = `${f}px`, f > p + 12 && (e.style.alignContent = "start");
|
|
73
|
+
}, [s, d, i]), T = (e) => {
|
|
74
|
+
S?.(e), g();
|
|
57
75
|
};
|
|
58
76
|
o.useEffect(() => {
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
const
|
|
62
|
-
let x = null,
|
|
63
|
-
return
|
|
64
|
-
if (
|
|
65
|
-
if (e.type ===
|
|
77
|
+
g();
|
|
78
|
+
}, [g]);
|
|
79
|
+
const z = () => c ? s ? "resize-x" : "resize" : "resize-none", M = typeof m == "function" ? m() : m, I = q.toArray(M);
|
|
80
|
+
let x = null, b = null;
|
|
81
|
+
return I.forEach((e) => {
|
|
82
|
+
if (B(e)) {
|
|
83
|
+
if (e.type === w && !x) {
|
|
66
84
|
x = e;
|
|
67
85
|
return;
|
|
68
86
|
}
|
|
69
|
-
if (e.type ===
|
|
70
|
-
|
|
87
|
+
if (e.type === C && !b) {
|
|
88
|
+
b = e;
|
|
71
89
|
return;
|
|
72
90
|
}
|
|
73
91
|
}
|
|
74
|
-
}), /* @__PURE__ */ r.jsxs("div", { className: a("relative",
|
|
75
|
-
/* @__PURE__ */ r.jsxs("div", { className: a(
|
|
92
|
+
}), /* @__PURE__ */ r.jsxs("div", { className: a("relative", h && "mb-6"), children: [
|
|
93
|
+
/* @__PURE__ */ r.jsxs("div", { className: a(
|
|
94
|
+
F({ variant: v, className: t }),
|
|
95
|
+
G({ disabled: u })
|
|
96
|
+
), children: [
|
|
76
97
|
x,
|
|
77
98
|
/* @__PURE__ */ r.jsx(
|
|
78
99
|
"textarea",
|
|
79
100
|
{
|
|
80
|
-
ref:
|
|
101
|
+
ref: E,
|
|
81
102
|
"data-slot": "textarea",
|
|
103
|
+
"aria-disabled": u,
|
|
82
104
|
className: a(
|
|
83
105
|
// 'border border-amber-400/30',
|
|
84
106
|
"flex-2 shrink-0 min-w-min h-fit my-3 ",
|
|
@@ -87,30 +109,32 @@ const F = B(
|
|
|
87
109
|
"content-center",
|
|
88
110
|
"outline-none",
|
|
89
111
|
"prometeo-scrollbar-thin-weak",
|
|
90
|
-
|
|
112
|
+
"disabled:text-neutral-medium-disabled",
|
|
113
|
+
z(),
|
|
114
|
+
J({ disabled: u })
|
|
91
115
|
),
|
|
92
|
-
onChange:
|
|
93
|
-
rows:
|
|
94
|
-
value:
|
|
95
|
-
placeholder:
|
|
96
|
-
disabled:
|
|
116
|
+
onChange: T,
|
|
117
|
+
rows: n ?? d,
|
|
118
|
+
value: k,
|
|
119
|
+
placeholder: A,
|
|
120
|
+
disabled: u,
|
|
97
121
|
...R
|
|
98
122
|
}
|
|
99
123
|
),
|
|
100
|
-
|
|
124
|
+
b
|
|
101
125
|
] }),
|
|
102
|
-
|
|
126
|
+
h && /* @__PURE__ */ r.jsx(D, { className: "absolute -bottom-1 left-0 translate-y-full", variant: v, children: h })
|
|
103
127
|
] });
|
|
104
128
|
}
|
|
105
|
-
),
|
|
106
|
-
const { children: s, className:
|
|
107
|
-
return /* @__PURE__ */ r.jsx("div", { className: a("slot",
|
|
108
|
-
},
|
|
109
|
-
Root:
|
|
110
|
-
LeftSlot:
|
|
111
|
-
RightSlot:
|
|
129
|
+
), H = (t) => {
|
|
130
|
+
const { children: s, className: c } = t;
|
|
131
|
+
return /* @__PURE__ */ r.jsx("div", { className: a("slot", c), children: s });
|
|
132
|
+
}, w = (t) => /* @__PURE__ */ r.jsx(H, { ...t, className: a("left-slot flex gap-1 items-center py-3", t?.className) }), C = (t) => /* @__PURE__ */ r.jsx(H, { ...t, className: a("right-slot flex gap-1 items-end py-3", t?.className) }), K = Object.assign(j, {
|
|
133
|
+
Root: j,
|
|
134
|
+
LeftSlot: w,
|
|
135
|
+
RightSlot: C
|
|
112
136
|
});
|
|
113
|
-
|
|
137
|
+
K.displayName = "TextArea";
|
|
114
138
|
export {
|
|
115
|
-
|
|
139
|
+
K as default
|
|
116
140
|
};
|