@pittorica/text-area-react 0.23.0 → 0.23.2
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/TextArea.d.ts +5 -4
- package/dist/TextArea.d.ts.map +1 -1
- package/dist/index.js +136 -122
- package/package.json +6 -6
package/dist/TextArea.d.ts
CHANGED
|
@@ -8,13 +8,14 @@ export interface TextAreaRootProps extends BoxProps {
|
|
|
8
8
|
error?: boolean;
|
|
9
9
|
color?: PittoricaColor;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
name?: string;
|
|
11
12
|
/** @default 'sm' */
|
|
12
13
|
size?: TextAreaSize;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Radix-like Outlined TextArea Root with support for multiple sizes.
|
|
16
17
|
*/
|
|
17
|
-
export declare const TextAreaRoot: ({ children, label, helperText, error, color, disabled, size, className, style, ...props }: TextAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const TextAreaRoot: ({ children, label, helperText, error, color, disabled, name, size, className, style, ...props }: TextAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export interface TextAreaContentProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
19
20
|
/** Enables automatic vertical resizing based on content */
|
|
20
21
|
autoResize?: boolean;
|
|
@@ -22,10 +23,10 @@ export interface TextAreaContentProps extends React.TextareaHTMLAttributes<HTMLT
|
|
|
22
23
|
/**
|
|
23
24
|
* Textarea element optimized for SSR and fluid interactions.
|
|
24
25
|
*/
|
|
25
|
-
export declare const TextAreaContent: ({ className, autoResize, onChange, value, defaultValue, ...props }: TextAreaContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const TextAreaContent: ({ className, autoResize, onChange, value, defaultValue, name: propsName, ...props }: TextAreaContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
export declare const TextArea: {
|
|
27
|
-
Root: ({ children, label, helperText, error, color, disabled, size, className, style, ...props }: TextAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
Content: ({ className, autoResize, onChange, value, defaultValue, ...props }: TextAreaContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
Root: ({ children, label, helperText, error, color, disabled, name, size, className, style, ...props }: TextAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
Content: ({ className, autoResize, onChange, value, defaultValue, name: propsName, ...props }: TextAreaContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
};
|
|
30
31
|
export {};
|
|
31
32
|
//# sourceMappingURL=TextArea.d.ts.map
|
package/dist/TextArea.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../src/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../src/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAoBrD,MAAM,WAAW,iBAAkB,SAAQ,QAAQ;IACjD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,iGAY1B,iBAAiB,4CAwDnB,CAAC;AAGF,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC;IAC7F,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,qFAQ7B,oBAAoB,4CAkDtB,CAAC;AAEF,eAAO,MAAM,QAAQ;4GA/HlB,iBAAiB;mGA2EjB,oBAAoB;CAuDtB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,177 +1,182 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
function
|
|
1
|
+
import { jsx as u, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as G, useRef as J, useEffect as K, useId as C, use as M } from "react";
|
|
3
|
+
function I(t) {
|
|
4
4
|
var i, r, e = "";
|
|
5
5
|
if (typeof t == "string" || typeof t == "number") e += t;
|
|
6
6
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
7
7
|
var a = t.length;
|
|
8
|
-
for (i = 0; i < a; i++) t[i] && (r =
|
|
8
|
+
for (i = 0; i < a; i++) t[i] && (r = I(t[i])) && (e && (e += " "), e += r);
|
|
9
9
|
} else for (r in t) t[r] && (e && (e += " "), e += r);
|
|
10
10
|
return e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i =
|
|
12
|
+
function L() {
|
|
13
|
+
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i = I(t)) && (e && (e += " "), e += i);
|
|
14
14
|
return e;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function S(t) {
|
|
17
17
|
var i, r, e = "";
|
|
18
18
|
if (typeof t == "string" || typeof t == "number") e += t;
|
|
19
19
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
20
20
|
var a = t.length;
|
|
21
|
-
for (i = 0; i < a; i++) t[i] && (r =
|
|
21
|
+
for (i = 0; i < a; i++) t[i] && (r = S(t[i])) && (e && (e += " "), e += r);
|
|
22
22
|
} else for (r in t) t[r] && (e && (e += " "), e += r);
|
|
23
23
|
return e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i =
|
|
25
|
+
function O() {
|
|
26
|
+
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i = S(t)) && (e && (e += " "), e += i);
|
|
27
27
|
return e;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const W = ({
|
|
30
30
|
ref: t,
|
|
31
31
|
as: i = "div",
|
|
32
32
|
children: r,
|
|
33
33
|
display: e,
|
|
34
34
|
m: a,
|
|
35
35
|
mt: s,
|
|
36
|
-
mr:
|
|
36
|
+
mr: l,
|
|
37
37
|
mb: d,
|
|
38
|
-
ml:
|
|
39
|
-
p:
|
|
40
|
-
pt:
|
|
41
|
-
pr:
|
|
42
|
-
pb:
|
|
38
|
+
ml: m,
|
|
39
|
+
p: f,
|
|
40
|
+
pt: h,
|
|
41
|
+
pr: p,
|
|
42
|
+
pb: c,
|
|
43
43
|
pl: g,
|
|
44
|
-
width:
|
|
44
|
+
width: o,
|
|
45
45
|
height: v,
|
|
46
46
|
position: y,
|
|
47
47
|
style: x,
|
|
48
48
|
className: b,
|
|
49
49
|
href: $,
|
|
50
|
-
target:
|
|
51
|
-
rel:
|
|
50
|
+
target: w,
|
|
51
|
+
rel: A,
|
|
52
52
|
htmlFor: N,
|
|
53
53
|
type: T,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
name: j,
|
|
55
|
+
disabled: B,
|
|
56
|
+
...F
|
|
56
57
|
}) => {
|
|
57
58
|
const n = {};
|
|
58
|
-
e && (n.display = e),
|
|
59
|
-
const
|
|
59
|
+
e && (n.display = e), o && (n.width = o), v && (n.height = v), y && (n.position = y), a && (n.margin = `var(--pittorica-space-${a})`), s && (n.marginTop = `var(--pittorica-space-${s})`), l && (n.marginRight = `var(--pittorica-space-${l})`), d && (n.marginBottom = `var(--pittorica-space-${d})`), m && (n.marginLeft = `var(--pittorica-space-${m})`), f && (n.padding = `var(--pittorica-space-${f})`), h && (n.paddingTop = `var(--pittorica-space-${h})`), p && (n.paddingRight = `var(--pittorica-space-${p})`), c && (n.paddingBottom = `var(--pittorica-space-${c})`), g && (n.paddingLeft = `var(--pittorica-space-${g})`);
|
|
60
|
+
const R = {
|
|
60
61
|
...x,
|
|
61
62
|
...n
|
|
62
63
|
};
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ u(
|
|
64
65
|
i,
|
|
65
66
|
{
|
|
66
67
|
ref: t,
|
|
67
|
-
className:
|
|
68
|
-
style:
|
|
68
|
+
className: O("pittorica-box", b),
|
|
69
|
+
style: R,
|
|
69
70
|
href: $,
|
|
70
|
-
target:
|
|
71
|
-
rel:
|
|
71
|
+
target: w,
|
|
72
|
+
rel: A,
|
|
72
73
|
htmlFor: N,
|
|
73
74
|
type: T,
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
name: j,
|
|
76
|
+
disabled: B,
|
|
77
|
+
...F,
|
|
76
78
|
children: r
|
|
77
79
|
}
|
|
78
80
|
);
|
|
79
81
|
};
|
|
80
|
-
|
|
81
|
-
function
|
|
82
|
+
W.displayName = "Box";
|
|
83
|
+
function k(t) {
|
|
82
84
|
var i, r, e = "";
|
|
83
85
|
if (typeof t == "string" || typeof t == "number") e += t;
|
|
84
86
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
85
87
|
var a = t.length;
|
|
86
|
-
for (i = 0; i < a; i++) t[i] && (r =
|
|
88
|
+
for (i = 0; i < a; i++) t[i] && (r = k(t[i])) && (e && (e += " "), e += r);
|
|
87
89
|
} else for (r in t) t[r] && (e && (e += " "), e += r);
|
|
88
90
|
return e;
|
|
89
91
|
}
|
|
90
|
-
function
|
|
91
|
-
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i =
|
|
92
|
+
function P() {
|
|
93
|
+
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i = k(t)) && (e && (e += " "), e += i);
|
|
92
94
|
return e;
|
|
93
95
|
}
|
|
94
|
-
function
|
|
96
|
+
function q(t) {
|
|
95
97
|
var i, r, e = "";
|
|
96
98
|
if (typeof t == "string" || typeof t == "number") e += t;
|
|
97
99
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
98
100
|
var a = t.length;
|
|
99
|
-
for (i = 0; i < a; i++) t[i] && (r =
|
|
101
|
+
for (i = 0; i < a; i++) t[i] && (r = q(t[i])) && (e && (e += " "), e += r);
|
|
100
102
|
} else for (r in t) t[r] && (e && (e += " "), e += r);
|
|
101
103
|
return e;
|
|
102
104
|
}
|
|
103
|
-
function
|
|
104
|
-
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i =
|
|
105
|
+
function Q() {
|
|
106
|
+
for (var t, i, r = 0, e = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (i = q(t)) && (e && (e += " "), e += i);
|
|
105
107
|
return e;
|
|
106
108
|
}
|
|
107
|
-
const
|
|
109
|
+
const E = ({
|
|
108
110
|
ref: t,
|
|
109
111
|
as: i = "div",
|
|
110
112
|
children: r,
|
|
111
113
|
display: e,
|
|
112
114
|
m: a,
|
|
113
115
|
mt: s,
|
|
114
|
-
mr:
|
|
116
|
+
mr: l,
|
|
115
117
|
mb: d,
|
|
116
|
-
ml:
|
|
117
|
-
p:
|
|
118
|
-
pt:
|
|
119
|
-
pr:
|
|
120
|
-
pb:
|
|
118
|
+
ml: m,
|
|
119
|
+
p: f,
|
|
120
|
+
pt: h,
|
|
121
|
+
pr: p,
|
|
122
|
+
pb: c,
|
|
121
123
|
pl: g,
|
|
122
|
-
width:
|
|
124
|
+
width: o,
|
|
123
125
|
height: v,
|
|
124
126
|
position: y,
|
|
125
127
|
style: x,
|
|
126
128
|
className: b,
|
|
127
129
|
href: $,
|
|
128
|
-
target:
|
|
129
|
-
rel:
|
|
130
|
+
target: w,
|
|
131
|
+
rel: A,
|
|
130
132
|
htmlFor: N,
|
|
131
133
|
type: T,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
name: j,
|
|
135
|
+
disabled: B,
|
|
136
|
+
...F
|
|
134
137
|
}) => {
|
|
135
138
|
const n = {};
|
|
136
|
-
e && (n.display = e),
|
|
137
|
-
const
|
|
139
|
+
e && (n.display = e), o && (n.width = o), v && (n.height = v), y && (n.position = y), a && (n.margin = `var(--pittorica-space-${a})`), s && (n.marginTop = `var(--pittorica-space-${s})`), l && (n.marginRight = `var(--pittorica-space-${l})`), d && (n.marginBottom = `var(--pittorica-space-${d})`), m && (n.marginLeft = `var(--pittorica-space-${m})`), f && (n.padding = `var(--pittorica-space-${f})`), h && (n.paddingTop = `var(--pittorica-space-${h})`), p && (n.paddingRight = `var(--pittorica-space-${p})`), c && (n.paddingBottom = `var(--pittorica-space-${c})`), g && (n.paddingLeft = `var(--pittorica-space-${g})`);
|
|
140
|
+
const R = {
|
|
138
141
|
...x,
|
|
139
142
|
...n
|
|
140
143
|
};
|
|
141
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ u(
|
|
142
145
|
i,
|
|
143
146
|
{
|
|
144
147
|
ref: t,
|
|
145
|
-
className:
|
|
146
|
-
style:
|
|
148
|
+
className: Q("pittorica-box", b),
|
|
149
|
+
style: R,
|
|
147
150
|
href: $,
|
|
148
|
-
target:
|
|
149
|
-
rel:
|
|
151
|
+
target: w,
|
|
152
|
+
rel: A,
|
|
150
153
|
htmlFor: N,
|
|
151
154
|
type: T,
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
name: j,
|
|
156
|
+
disabled: B,
|
|
157
|
+
...F,
|
|
154
158
|
children: r
|
|
155
159
|
}
|
|
156
160
|
);
|
|
157
161
|
};
|
|
158
|
-
|
|
159
|
-
const
|
|
162
|
+
E.displayName = "Box";
|
|
163
|
+
const U = ({
|
|
160
164
|
children: t,
|
|
161
165
|
as: i = "span",
|
|
162
166
|
weight: r = "regular",
|
|
163
167
|
align: e,
|
|
164
168
|
truncate: a = !1,
|
|
165
169
|
color: s,
|
|
166
|
-
className:
|
|
170
|
+
className: l,
|
|
167
171
|
style: d,
|
|
168
|
-
href:
|
|
169
|
-
target:
|
|
170
|
-
rel:
|
|
171
|
-
htmlFor:
|
|
172
|
-
|
|
172
|
+
href: m,
|
|
173
|
+
target: f,
|
|
174
|
+
rel: h,
|
|
175
|
+
htmlFor: p,
|
|
176
|
+
name: c,
|
|
177
|
+
...g
|
|
173
178
|
}) => {
|
|
174
|
-
const
|
|
179
|
+
const o = (s == null ? void 0 : s.startsWith("#")) || (s == null ? void 0 : s.startsWith("rgb")) || (s == null ? void 0 : s.startsWith("hsl")), v = /* @__PURE__ */ new Set([
|
|
175
180
|
"danger",
|
|
176
181
|
"success",
|
|
177
182
|
"error",
|
|
@@ -183,64 +188,66 @@ const Q = ({
|
|
|
183
188
|
"slate",
|
|
184
189
|
"blue",
|
|
185
190
|
"red"
|
|
186
|
-
]),
|
|
191
|
+
]), y = (() => {
|
|
187
192
|
if (s)
|
|
188
|
-
return s === "inherit" ? "inherit" :
|
|
189
|
-
})(),
|
|
193
|
+
return s === "inherit" ? "inherit" : o ? s : v.has(s) ? `var(--pittorica-${s}-9)` : s;
|
|
194
|
+
})(), x = {
|
|
190
195
|
...d,
|
|
191
196
|
textAlign: e,
|
|
192
|
-
color:
|
|
197
|
+
color: y
|
|
193
198
|
};
|
|
194
|
-
return /* @__PURE__ */
|
|
195
|
-
|
|
199
|
+
return /* @__PURE__ */ u(
|
|
200
|
+
E,
|
|
196
201
|
{
|
|
197
202
|
as: i,
|
|
198
|
-
className:
|
|
203
|
+
className: P(
|
|
199
204
|
"pittorica-text",
|
|
200
205
|
{ "pittorica-text--truncate": a },
|
|
201
|
-
|
|
206
|
+
l
|
|
202
207
|
),
|
|
203
208
|
"data-weight": r,
|
|
204
|
-
style:
|
|
205
|
-
href:
|
|
206
|
-
target:
|
|
207
|
-
rel:
|
|
208
|
-
htmlFor:
|
|
209
|
-
|
|
209
|
+
style: x,
|
|
210
|
+
href: m,
|
|
211
|
+
target: f,
|
|
212
|
+
rel: h,
|
|
213
|
+
htmlFor: p,
|
|
214
|
+
name: c,
|
|
215
|
+
...g,
|
|
210
216
|
children: t
|
|
211
217
|
}
|
|
212
218
|
);
|
|
213
|
-
},
|
|
214
|
-
const t =
|
|
219
|
+
}, H = G(null), X = () => {
|
|
220
|
+
const t = M(H);
|
|
215
221
|
if (!t)
|
|
216
222
|
throw new Error("TextArea components must be wrapped in <TextArea.Root />");
|
|
217
223
|
return t;
|
|
218
|
-
},
|
|
224
|
+
}, Y = ({
|
|
219
225
|
children: t,
|
|
220
226
|
label: i,
|
|
221
227
|
helperText: r,
|
|
222
228
|
error: e,
|
|
223
229
|
color: a = "indigo",
|
|
224
230
|
disabled: s,
|
|
225
|
-
|
|
226
|
-
|
|
231
|
+
name: l,
|
|
232
|
+
size: d = "sm",
|
|
233
|
+
className: m,
|
|
227
234
|
style: f,
|
|
228
|
-
...
|
|
235
|
+
...h
|
|
229
236
|
}) => {
|
|
230
|
-
const p =
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
|
|
237
|
+
const p = C(), c = C(), o = a !== "inherit" && !(a != null && a.startsWith("#")) && !(a != null && a.startsWith("rgb")) ? `var(--pittorica-${a}-9)` : a;
|
|
238
|
+
return /* @__PURE__ */ u(H, { value: { inputId: p, helperId: c, disabled: s, size: d, name: l }, children: /* @__PURE__ */ D(
|
|
239
|
+
W,
|
|
233
240
|
{
|
|
234
|
-
...
|
|
235
|
-
className:
|
|
241
|
+
...h,
|
|
242
|
+
className: L(
|
|
236
243
|
"pittorica-textarea-root",
|
|
237
|
-
`pittorica-textarea--${
|
|
238
|
-
|
|
244
|
+
`pittorica-textarea--${d}`,
|
|
245
|
+
m
|
|
239
246
|
),
|
|
240
247
|
"data-error": e,
|
|
241
248
|
children: [
|
|
242
|
-
i && /* @__PURE__ */
|
|
243
|
-
|
|
249
|
+
i && /* @__PURE__ */ u(
|
|
250
|
+
U,
|
|
244
251
|
{
|
|
245
252
|
as: "label",
|
|
246
253
|
htmlFor: p,
|
|
@@ -254,63 +261,70 @@ const Q = ({
|
|
|
254
261
|
children: i
|
|
255
262
|
}
|
|
256
263
|
),
|
|
257
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ u(
|
|
258
265
|
"div",
|
|
259
266
|
{
|
|
260
267
|
className: "pittorica-textarea-wrapper",
|
|
261
268
|
"data-disabled": s,
|
|
262
269
|
style: {
|
|
263
|
-
"--pittorica-source-color":
|
|
270
|
+
"--pittorica-source-color": o,
|
|
264
271
|
...f
|
|
265
272
|
},
|
|
266
273
|
children: t
|
|
267
274
|
}
|
|
268
275
|
),
|
|
269
|
-
r && /* @__PURE__ */
|
|
276
|
+
r && /* @__PURE__ */ u("div", { id: c, className: "pittorica-textarea-helper", children: r })
|
|
270
277
|
]
|
|
271
278
|
}
|
|
272
279
|
) });
|
|
273
|
-
},
|
|
280
|
+
}, Z = ({
|
|
274
281
|
className: t,
|
|
275
282
|
autoResize: i = !1,
|
|
276
283
|
onChange: r,
|
|
277
284
|
value: e,
|
|
278
285
|
defaultValue: a,
|
|
279
|
-
|
|
286
|
+
name: s,
|
|
287
|
+
...l
|
|
280
288
|
}) => {
|
|
281
|
-
const {
|
|
289
|
+
const {
|
|
290
|
+
inputId: d,
|
|
291
|
+
helperId: m,
|
|
292
|
+
disabled: f,
|
|
293
|
+
name: h
|
|
294
|
+
} = X(), p = J(null), c = () => {
|
|
282
295
|
if (globalThis.window === void 0) return;
|
|
283
|
-
const o =
|
|
296
|
+
const o = p.current;
|
|
284
297
|
!o || !i || (o.style.height = "auto", o.style.height = `${o.scrollHeight}px`);
|
|
285
298
|
};
|
|
286
|
-
return
|
|
287
|
-
i &&
|
|
288
|
-
}, [e, a, i]), /* @__PURE__ */
|
|
299
|
+
return K(() => {
|
|
300
|
+
i && c();
|
|
301
|
+
}, [e, a, i]), /* @__PURE__ */ u(
|
|
289
302
|
"textarea",
|
|
290
303
|
{
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
304
|
+
name: s ?? h,
|
|
305
|
+
...l,
|
|
306
|
+
id: d,
|
|
307
|
+
ref: p,
|
|
294
308
|
value: e,
|
|
295
309
|
defaultValue: a,
|
|
296
310
|
disabled: f,
|
|
297
|
-
"aria-describedby":
|
|
311
|
+
"aria-describedby": m,
|
|
298
312
|
onChange: (o) => {
|
|
299
|
-
i &&
|
|
313
|
+
i && c(), r == null || r(o);
|
|
300
314
|
},
|
|
301
|
-
className:
|
|
315
|
+
className: L("pittorica-textarea-input", t),
|
|
302
316
|
style: {
|
|
303
317
|
overflow: i ? "hidden" : void 0,
|
|
304
|
-
...
|
|
318
|
+
...l.style
|
|
305
319
|
}
|
|
306
320
|
}
|
|
307
321
|
);
|
|
308
|
-
},
|
|
309
|
-
Root:
|
|
310
|
-
Content:
|
|
322
|
+
}, z = {
|
|
323
|
+
Root: Y,
|
|
324
|
+
Content: Z
|
|
311
325
|
};
|
|
312
326
|
export {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
327
|
+
z as TextArea,
|
|
328
|
+
Z as TextAreaContent,
|
|
329
|
+
Y as TextAreaRoot
|
|
316
330
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pittorica/text-area-react",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"clsx": "^2.1.1",
|
|
13
|
-
"@pittorica/box-react": "0.23.
|
|
14
|
-
"@pittorica/text-react": "0.23.
|
|
13
|
+
"@pittorica/box-react": "0.23.2",
|
|
14
|
+
"@pittorica/text-react": "0.23.2"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"typescript": "^5.0.0",
|
|
24
24
|
"vite": "^5.0.0",
|
|
25
25
|
"vitest": "^2.1.9",
|
|
26
|
-
"@pittorica/flex-react": "0.23.
|
|
27
|
-
"pittorica": "0.23.
|
|
28
|
-
"
|
|
26
|
+
"@pittorica/flex-react": "0.23.2",
|
|
27
|
+
"@pittorica/theme-react": "0.23.2",
|
|
28
|
+
"pittorica": "0.23.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": ">=19",
|