@versini/ui-textarea 3.0.0 → 3.0.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/index.js +30 -30
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -2,19 +2,19 @@ import { jsx as T, jsxs as pe } from "react/jsx-runtime";
|
|
|
2
2
|
import ye, { useRef as f, useEffect as O, useCallback as me, useMemo as J, useState as v, useId as xe, useReducer as he, useLayoutEffect as I } from "react";
|
|
3
3
|
import c from "clsx";
|
|
4
4
|
/*!
|
|
5
|
-
@versini/ui-textarea v3.0.
|
|
5
|
+
@versini/ui-textarea v3.0.2
|
|
6
6
|
© 2025 gizmette.com
|
|
7
7
|
*/
|
|
8
8
|
try {
|
|
9
9
|
window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
|
|
10
|
-
version: "3.0.
|
|
11
|
-
buildTime: "01/
|
|
10
|
+
version: "3.0.2",
|
|
11
|
+
buildTime: "01/13/2025 01:15 PM EST",
|
|
12
12
|
homepage: "https://github.com/aversini/ui-components",
|
|
13
13
|
license: "MIT"
|
|
14
14
|
});
|
|
15
15
|
} catch {
|
|
16
16
|
}
|
|
17
|
-
const K = "av-text-area", Ae = "av-text-area-wrapper",
|
|
17
|
+
const K = "av-text-area", Ae = "av-text-area-wrapper", M = "av-text-area-helper-text", Te = "av-text-area__control--right", ge = "av-text-area__control--left";
|
|
18
18
|
function _e() {
|
|
19
19
|
const e = f(!1);
|
|
20
20
|
return O(() => (e.current = !0, () => {
|
|
@@ -196,13 +196,13 @@ function Le({
|
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
198
|
/*!
|
|
199
|
-
@versini/ui-liveregion v1.3.
|
|
199
|
+
@versini/ui-liveregion v1.3.2
|
|
200
200
|
© 2025 gizmette.com
|
|
201
201
|
*/
|
|
202
202
|
try {
|
|
203
203
|
window.__VERSINI_UI_LIVEREGION__ || (window.__VERSINI_UI_LIVEREGION__ = {
|
|
204
|
-
version: "1.3.
|
|
205
|
-
buildTime: "01/
|
|
204
|
+
version: "1.3.2",
|
|
205
|
+
buildTime: "01/13/2025 01:15 PM EST",
|
|
206
206
|
homepage: "https://github.com/aversini/ui-components",
|
|
207
207
|
license: "MIT"
|
|
208
208
|
});
|
|
@@ -228,7 +228,7 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
228
228
|
"focus:border-border-dark": !e && r,
|
|
229
229
|
"border-border-error-dark": !e && r,
|
|
230
230
|
"border-transparent": e
|
|
231
|
-
}),
|
|
231
|
+
}), Pe = ({
|
|
232
232
|
disabled: e,
|
|
233
233
|
raw: r,
|
|
234
234
|
error: t,
|
|
@@ -267,7 +267,7 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
267
267
|
"text-copy-medium dark:text-copy-error-dark": n === "alt-system"
|
|
268
268
|
}
|
|
269
269
|
);
|
|
270
|
-
},
|
|
270
|
+
}, He = ({
|
|
271
271
|
error: e,
|
|
272
272
|
raw: r,
|
|
273
273
|
mode: t,
|
|
@@ -277,24 +277,24 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
277
277
|
return "";
|
|
278
278
|
if (n)
|
|
279
279
|
return c(
|
|
280
|
-
|
|
280
|
+
M,
|
|
281
281
|
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
282
282
|
);
|
|
283
283
|
if (!e)
|
|
284
|
-
return c(
|
|
284
|
+
return c(M, "absolute px-2 font-medium", {
|
|
285
285
|
"text-copy-medium": t === "dark",
|
|
286
286
|
"text-copy-dark": t === "light",
|
|
287
287
|
"text-copy-dark dark:text-copy-medium": t === "system",
|
|
288
288
|
"text-copy-medium dark:text-copy-dark": t === "alt-system"
|
|
289
289
|
});
|
|
290
290
|
if (e)
|
|
291
|
-
return c(
|
|
291
|
+
return c(M, "absolute px-2 font-medium", {
|
|
292
292
|
"text-copy-error-light": t === "dark",
|
|
293
293
|
"text-copy-error-dark": t === "light",
|
|
294
294
|
"text-copy-error-dark dark:text-copy-error-light": t === "system",
|
|
295
295
|
"dark:text-copy-error-dark text-copy-error-light": t === "alt-system"
|
|
296
296
|
});
|
|
297
|
-
},
|
|
297
|
+
}, Me = ({
|
|
298
298
|
className: e,
|
|
299
299
|
textAreaClassName: r,
|
|
300
300
|
raw: t,
|
|
@@ -323,14 +323,14 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
323
323
|
{
|
|
324
324
|
"disabled:cursor-not-allowed disabled:opacity-50": a
|
|
325
325
|
}
|
|
326
|
-
), E = t ? void 0 : "sr-only", g =
|
|
326
|
+
), E = t ? void 0 : "sr-only", g = Pe({
|
|
327
327
|
disabled: a,
|
|
328
328
|
raw: t,
|
|
329
329
|
error: s,
|
|
330
330
|
mode: l,
|
|
331
331
|
rightElement: p,
|
|
332
332
|
leftElement: i
|
|
333
|
-
}), d =
|
|
333
|
+
}), d = He({
|
|
334
334
|
error: s,
|
|
335
335
|
raw: t,
|
|
336
336
|
mode: l,
|
|
@@ -345,7 +345,7 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
345
345
|
rightElement: N,
|
|
346
346
|
leftElement: h
|
|
347
347
|
};
|
|
348
|
-
},
|
|
348
|
+
}, De = ({
|
|
349
349
|
scrollHeight: e,
|
|
350
350
|
currentHeight: r,
|
|
351
351
|
currentLabelOffset: t = 0,
|
|
@@ -361,7 +361,7 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
361
361
|
helperTextOffset: l,
|
|
362
362
|
scrollHeight: e
|
|
363
363
|
};
|
|
364
|
-
},
|
|
364
|
+
}, Fe = ye.forwardRef(
|
|
365
365
|
({
|
|
366
366
|
id: e,
|
|
367
367
|
name: r,
|
|
@@ -381,15 +381,15 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
381
381
|
helperTextOnFocus: N = !1,
|
|
382
382
|
rightElement: h,
|
|
383
383
|
leftElement: k,
|
|
384
|
-
onChange:
|
|
385
|
-
onFocus:
|
|
384
|
+
onChange: D,
|
|
385
|
+
onFocus: F,
|
|
386
386
|
onBlur: U,
|
|
387
387
|
...Z
|
|
388
388
|
}, ee) => {
|
|
389
389
|
var B;
|
|
390
390
|
const x = f(null), te = be([ee, x]), [re, L] = W(), [ne, R] = W(), w = f(80), V = f(-25), m = f(null), X = f(30), S = f(null), C = ve({ id: e, prefix: `${K}-` }), [j, ae] = v(0), [G, oe] = v(0), [se, z] = v(
|
|
391
391
|
!!(!N && d)
|
|
392
|
-
), ce = `${r} error, ${d}`, _ =
|
|
392
|
+
), ce = `${r} error, ${d}`, _ = Me({
|
|
393
393
|
className: o,
|
|
394
394
|
textAreaClassName: s,
|
|
395
395
|
error: n,
|
|
@@ -405,7 +405,7 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
405
405
|
initialControlledDelay: 20,
|
|
406
406
|
defaultValue: y,
|
|
407
407
|
onChange: (u) => {
|
|
408
|
-
|
|
408
|
+
D && D({
|
|
409
409
|
target: {
|
|
410
410
|
value: u
|
|
411
411
|
}
|
|
@@ -414,7 +414,7 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
414
414
|
}), ie = (u) => {
|
|
415
415
|
le(u.target.value);
|
|
416
416
|
}, ue = (u) => {
|
|
417
|
-
N && d && z(!0),
|
|
417
|
+
N && d && z(!0), F && F(u);
|
|
418
418
|
}, de = (u) => {
|
|
419
419
|
N && d && !A && z(!1), U && U(u);
|
|
420
420
|
};
|
|
@@ -435,18 +435,18 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
435
435
|
}, [A, a]), I(() => {
|
|
436
436
|
var u, $;
|
|
437
437
|
if (!a && x && x.current && A !== void 0) {
|
|
438
|
-
const { labelOffset:
|
|
438
|
+
const { labelOffset: P, helperTextOffset: H, scrollHeight: fe } = De({
|
|
439
439
|
scrollHeight: x.current.scrollHeight,
|
|
440
440
|
currentHeight: w.current,
|
|
441
441
|
currentLabelOffset: V.current,
|
|
442
442
|
currentHelperTextOffset: X.current
|
|
443
443
|
});
|
|
444
|
-
|
|
444
|
+
P && (V.current = P, (u = m == null ? void 0 : m.current) == null || u.style.setProperty(
|
|
445
445
|
"--av-text-area-label",
|
|
446
|
-
`${
|
|
447
|
-
)),
|
|
446
|
+
`${P}px`
|
|
447
|
+
)), H && (X.current = H, ($ = S == null ? void 0 : S.current) == null || $.style.setProperty(
|
|
448
448
|
"--av-text-area-helper-text",
|
|
449
|
-
`${
|
|
449
|
+
`${H}px`
|
|
450
450
|
)), w.current = fe || w.current;
|
|
451
451
|
}
|
|
452
452
|
}, [A, a]), R.width > 0 && ((B = m == null ? void 0 : m.current) == null || B.style.setProperty(
|
|
@@ -528,12 +528,12 @@ const Se = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
528
528
|
] });
|
|
529
529
|
}
|
|
530
530
|
);
|
|
531
|
-
|
|
531
|
+
Fe.displayName = "TextArea";
|
|
532
532
|
export {
|
|
533
533
|
K as TEXT_AREA_CLASSNAME,
|
|
534
534
|
ge as TEXT_AREA_CONTROL_LEFT_CLASSNAME,
|
|
535
535
|
Te as TEXT_AREA_CONTROL_RIGHT_CLASSNAME,
|
|
536
|
-
|
|
536
|
+
M as TEXT_AREA_HELPER_TEXT_CLASSNAME,
|
|
537
537
|
Ae as TEXT_AREA_WRAPPER_CLASSNAME,
|
|
538
|
-
|
|
538
|
+
Fe as TextArea
|
|
539
539
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-textarea",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,16 +37,18 @@
|
|
|
37
37
|
"react": "^18.3.1 || ^19.0.0",
|
|
38
38
|
"react-dom": "^18.3.1 || ^19.0.0"
|
|
39
39
|
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@versini/ui-types": "4.0.1"
|
|
42
|
+
},
|
|
40
43
|
"dependencies": {
|
|
41
44
|
"@tailwindcss/typography": "0.5.15",
|
|
42
45
|
"@versini/ui-hooks": "4.3.0",
|
|
43
|
-
"@versini/ui-liveregion": "1.3.
|
|
44
|
-
"@versini/ui-types": "4.0.0",
|
|
46
|
+
"@versini/ui-liveregion": "1.3.2",
|
|
45
47
|
"clsx": "2.1.1",
|
|
46
48
|
"tailwindcss": "3.4.17"
|
|
47
49
|
},
|
|
48
50
|
"sideEffects": [
|
|
49
51
|
"**/*.css"
|
|
50
52
|
],
|
|
51
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "ad21cab4bf6b5fc26fc8bf9b61fb5f00ef0f66f6"
|
|
52
54
|
}
|