@versini/ui-textarea 5.0.0 → 5.0.1

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,523 +1,331 @@
1
- import { jsx as A, jsxs as ue } from "react/jsx-runtime";
2
- import de, { useRef as f, useCallback as fe, useEffect as S, useMemo as B, useState as v, useId as pe, useReducer as ye, useLayoutEffect as E } from "react";
3
- import c from "clsx";
4
- const W = "av-text-area", xe = "av-text-area-wrapper", w = "av-text-area-helper-text", me = "av-text-area__control--right", he = "av-text-area__control--left";
5
- function Ae() {
6
- const e = f(!1);
7
- return S(() => (e.current = !0, () => {
8
- e.current = !1;
9
- }), []), fe(() => e.current, []);
10
- }
11
- function ge(e) {
12
- return B(() => e.every((r) => r == null) ? () => {
13
- } : (r) => {
14
- e.forEach((t) => {
15
- typeof t == "function" ? t(r) : t != null && (t.current = r);
16
- });
17
- }, [...e]);
18
- }
19
- const Te = {
20
- x: 0,
21
- y: 0,
22
- width: 0,
23
- height: 0,
24
- top: 0,
25
- left: 0,
26
- bottom: 0,
27
- right: 0
28
- };
29
- function G(e) {
30
- const r = Ae(), t = f(0), n = f(null), [a, o] = v(Te), s = B(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((l) => {
31
- const i = l[0];
32
- i && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
33
- n.current && r() && o(i.contentRect);
34
- }));
35
- }), [r]);
36
- return S(() => (n.current && s?.observe(n.current, e), () => {
37
- s?.disconnect(), t.current && cancelAnimationFrame(t.current);
38
- }), [s, e]), [n, a];
39
- }
40
- function be({
41
- value: e,
42
- defaultValue: r,
43
- finalValue: t,
44
- onChange: n = () => {
45
- },
46
- initialControlledDelay: a = 0
47
- }) {
48
- const [o, s] = v(!1), [l, i] = v(
49
- r !== void 0 ? r : t
50
- ), p = (y) => {
51
- i(y), n?.(y);
52
- };
53
- return S(() => {
54
- (async () => e !== void 0 && !o && a > 0 && (await new Promise(
55
- (y) => setTimeout(y, a)
56
- ), s(!0)))();
57
- }, [e, a, o]), e !== void 0 ? !o && a > 0 ? ["", n, !0] : [e, n, !0] : [l, p, !1];
58
- }
59
- function Re(e) {
60
- const r = pe();
61
- if (!e)
62
- return r;
63
- if (typeof e == "number" || typeof e == "string")
64
- return `${e}${r}`;
65
- if (typeof e == "object") {
66
- const { id: t, prefix: n = "" } = e;
67
- return typeof t == "number" || typeof t == "string" ? `${n}${t}` : `${n}${r}`;
68
- }
69
- }
70
- const q = "SET_ANNOUNCEMENT", J = "CLEAR_ANNOUNCEMENT", ke = {
71
- alert: null,
72
- alertdialog: null,
73
- log: "polite",
74
- marquee: null,
75
- progressbar: null,
76
- status: "polite",
77
- timer: "assertive"
78
- }, ve = (e, r) => {
79
- switch (r?.type) {
80
- case q:
81
- return {
82
- ...e,
83
- announcement: r.payload
84
- };
85
- case J:
86
- return {
87
- ...e,
88
- announcement: null
89
- };
90
- default:
91
- return e;
92
- }
93
- }, _e = ({
94
- onAnnouncementClear: e,
95
- dispatch: r
96
- }) => {
97
- r({
98
- type: J
99
- }), typeof e == "function" && e();
100
- }, z = ({
101
- children: e,
102
- clearAnnouncementDelay: r,
103
- clearAnnouncementTimeoutRef: t,
104
- onAnnouncementClear: n,
105
- dispatch: a
106
- }) => {
107
- clearTimeout(t.current), e !== null && a({
108
- type: q,
109
- payload: e
110
- }), r && (t.current = setTimeout(
111
- () => _e({
112
- onAnnouncementClear: n,
113
- dispatch: a
114
- }),
115
- r
116
- ));
117
- }, Ne = ({
118
- children: e,
119
- announcementTimeoutRef: r,
120
- announcementDelay: t,
121
- clearAnnouncementDelay: n,
122
- clearAnnouncementTimeoutRef: a,
123
- onAnnouncementClear: o,
124
- dispatch: s
125
- }) => {
126
- clearTimeout(r.current), t ? r.current = setTimeout(z, t, {
127
- children: e,
128
- clearAnnouncementDelay: n,
129
- clearAnnouncementTimeoutRef: a,
130
- onAnnouncementClear: o,
131
- dispatch: s
132
- }) : z({
133
- children: e,
134
- clearAnnouncementDelay: n,
135
- clearAnnouncementTimeoutRef: a,
136
- onAnnouncementClear: o,
137
- dispatch: s
138
- });
139
- };
140
- function Ce({
141
- children: e,
142
- className: r,
143
- politeness: t,
144
- role: n = null,
145
- announcementDelay: a,
146
- clearAnnouncementDelay: o,
147
- onAnnouncementClear: s,
148
- visible: l,
149
- ...i
150
- }) {
151
- const p = f(null), y = f(null), [b, _] = ye(ve, {
152
- announcement: null
153
- });
154
- let g = t;
155
- typeof g > "u" && (g = n ? ke[n] : "assertive"), S(() => {
156
- Ne({
157
- announcementTimeoutRef: p,
158
- announcementDelay: a,
159
- children: e,
160
- clearAnnouncementDelay: o,
161
- clearAnnouncementTimeoutRef: y,
162
- onAnnouncementClear: s,
163
- dispatch: _
164
- });
165
- }, [
166
- e,
167
- a,
168
- o,
169
- s
170
- ]);
171
- const u = c(r, {
172
- "sr-only": !l
173
- });
174
- return /* @__PURE__ */ A(
175
- "div",
176
- {
177
- "aria-live": g,
178
- ...n && { role: n },
179
- className: u,
180
- ...i,
181
- children: b.announcement
182
- }
183
- );
184
- }
185
- /*!
186
- @versini/ui-liveregion v3.0.0
187
- © 2025 gizmette.com
188
- */
189
- try {
190
- window.__VERSINI_UI_LIVEREGION__ || (window.__VERSINI_UI_LIVEREGION__ = {
191
- version: "3.0.0",
192
- buildTime: "09/01/2025 03:17 PM EDT",
193
- homepage: "https://github.com/aversini/ui-components",
194
- license: "MIT"
195
- });
196
- } catch {
197
- }
198
- const Ee = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", Le = ({ mode: e }) => c({
1
+ import { jsxs as oe, jsx as h } from "react/jsx-runtime";
2
+ import { useMergeRefs as ce, useResizeObserver as U, useUniqueId as le, useUncontrolled as ne } from "@versini/ui-hooks";
3
+ import { LiveRegion as ie } from "@versini/ui-liveregion";
4
+ import ue, { useRef as T, useState as H, useLayoutEffect as R } from "react";
5
+ import o from "clsx";
6
+ const W = "av-text-area", de = "av-text-area-wrapper", P = "av-text-area-helper-text", fe = "av-text-area__control--right", xe = "av-text-area__control--left", pe = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", ye = ({ mode: e }) => o({
199
7
  "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
200
8
  "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
201
9
  "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
202
10
  "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
203
- }), Oe = ({
11
+ }), he = ({
204
12
  focusMode: e
205
- }) => c("focus:outline focus:outline-2 focus:outline-offset-2", {
13
+ }) => o("focus:outline focus:outline-2 focus:outline-offset-2", {
206
14
  "focus:outline-focus-dark": e === "dark",
207
15
  "focus:outline-focus-light": e === "light",
208
16
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
209
17
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
210
- }), Ie = ({
18
+ }), ge = ({
211
19
  noBorder: e,
212
- error: r
213
- }) => c("border-2", {
214
- "border-border-dark": !e && !r,
215
- "focus:border-border-dark": !e && r,
216
- "border-border-error-dark": !e && r,
20
+ error: a
21
+ }) => o("border-2", {
22
+ "border-border-dark": !e && !a,
23
+ "focus:border-border-dark": !e && a,
24
+ "border-border-error-dark": !e && a,
217
25
  "border-transparent": e
218
- }), Se = ({
26
+ }), ke = ({
219
27
  disabled: e,
220
- raw: r,
28
+ raw: a,
221
29
  error: t,
222
- mode: n,
223
- leftElement: a,
224
- rightElement: o
30
+ mode: s,
31
+ leftElement: r,
32
+ rightElement: c
225
33
  }) => {
226
- if (r)
34
+ if (a)
227
35
  return "";
228
36
  if (e)
229
- return c(
37
+ return o(
230
38
  "transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
231
39
  {
232
- "translate-x-[12px]": o === !0 && !a || !o && !a
40
+ "translate-x-[12px]": c === !0 && !r || !c && !r
233
41
  }
234
42
  );
235
43
  if (!t)
236
- return c(
44
+ return o(
237
45
  "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
238
46
  {
239
- "translate-x-[12px]": o === !0 && !a || !o && !a,
240
- "text-copy-medium": n === "dark",
241
- "text-copy-dark": n === "light",
242
- "text-copy-dark dark:text-copy-medium": n === "system",
243
- "text-copy-medium dark:text-copy-dark": n === "alt-system"
47
+ "translate-x-[12px]": c === !0 && !r || !c && !r,
48
+ "text-copy-medium": s === "dark",
49
+ "text-copy-dark": s === "light",
50
+ "text-copy-dark dark:text-copy-medium": s === "system",
51
+ "text-copy-medium dark:text-copy-dark": s === "alt-system"
244
52
  }
245
53
  );
246
54
  if (t)
247
- return c(
55
+ return o(
248
56
  "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
249
57
  {
250
- "translate-x-[12px]": o === !0 && !a || !o && !a,
251
- "text-copy-medium": n === "dark",
252
- "text-copy-error-dark": n === "light",
253
- "text-copy-error-dark dark:text-copy-error-light": n === "system",
254
- "text-copy-medium dark:text-copy-error-dark": n === "alt-system"
58
+ "translate-x-[12px]": c === !0 && !r || !c && !r,
59
+ "text-copy-medium": s === "dark",
60
+ "text-copy-error-dark": s === "light",
61
+ "text-copy-error-dark dark:text-copy-error-light": s === "system",
62
+ "text-copy-medium dark:text-copy-error-dark": s === "alt-system"
255
63
  }
256
64
  );
257
- }, $e = ({
65
+ }, Ae = ({
258
66
  error: e,
259
- raw: r,
67
+ raw: a,
260
68
  mode: t,
261
- disabled: n
69
+ disabled: s
262
70
  }) => {
263
- if (r)
71
+ if (a)
264
72
  return "";
265
- if (n)
266
- return c(
267
- w,
73
+ if (s)
74
+ return o(
75
+ P,
268
76
  "absolute px-2 cursor-not-allowed opacity-50 font-medium"
269
77
  );
270
78
  if (!e)
271
- return c(w, "absolute px-2 font-medium", {
79
+ return o(P, "absolute px-2 font-medium", {
272
80
  "text-copy-medium": t === "dark",
273
81
  "text-copy-dark": t === "light",
274
82
  "text-copy-dark dark:text-copy-medium": t === "system",
275
83
  "text-copy-medium dark:text-copy-dark": t === "alt-system"
276
84
  });
277
85
  if (e)
278
- return c(w, "absolute px-2 font-medium", {
86
+ return o(P, "absolute px-2 font-medium", {
279
87
  "text-copy-error-light": t === "dark",
280
88
  "text-copy-error-dark": t === "light",
281
89
  "text-copy-error-dark dark:text-copy-error-light": t === "system",
282
90
  "dark:text-copy-error-dark text-copy-error-light": t === "alt-system"
283
91
  });
284
- }, we = ({
92
+ }, Te = ({
285
93
  className: e,
286
- textAreaClassName: r,
94
+ textAreaClassName: a,
287
95
  raw: t,
288
- focusMode: n,
289
- disabled: a,
290
- noBorder: o,
291
- error: s,
292
- mode: l,
293
- leftElement: i,
294
- rightElement: p
96
+ focusMode: s,
97
+ disabled: r,
98
+ noBorder: c,
99
+ error: u,
100
+ mode: d,
101
+ leftElement: p,
102
+ rightElement: g
295
103
  }) => {
296
- const y = t ? e : c(
104
+ const N = t ? e : o(
297
105
  "relative flex w-full flex-col justify-center",
298
- xe,
106
+ de,
299
107
  e
300
- ), b = t ? c(r) : c(
108
+ ), v = t ? o(a) : o(
301
109
  W,
302
- r,
303
- Ee(),
304
- Le({ mode: l }),
305
- Oe({ focusMode: n }),
306
- Ie({
307
- noBorder: o,
308
- error: s
110
+ a,
111
+ pe(),
112
+ ye({ mode: d }),
113
+ he({ focusMode: s }),
114
+ ge({
115
+ noBorder: c,
116
+ error: u
309
117
  }),
310
118
  {
311
- "disabled:cursor-not-allowed disabled:opacity-50": a
119
+ "disabled:cursor-not-allowed disabled:opacity-50": r
312
120
  }
313
- ), _ = t ? void 0 : "sr-only", g = Se({
314
- disabled: a,
121
+ ), O = t ? void 0 : "sr-only", S = ke({
122
+ disabled: r,
315
123
  raw: t,
316
- error: s,
317
- mode: l,
318
- rightElement: p,
319
- leftElement: i
320
- }), u = $e({
321
- error: s,
124
+ error: u,
125
+ mode: d,
126
+ rightElement: g,
127
+ leftElement: p
128
+ }), n = Ae({
129
+ error: u,
322
130
  raw: t,
323
- mode: l,
324
- disabled: a
325
- }), N = t ? void 0 : c(me, "absolute"), m = t ? void 0 : c(he, "absolute");
131
+ mode: d,
132
+ disabled: r
133
+ }), b = t ? void 0 : o(fe, "absolute"), f = t ? void 0 : o(xe, "absolute");
326
134
  return {
327
- wrapper: y,
328
- textArea: b,
329
- accessibleLabel: _,
330
- visibleLabel: g,
331
- helperText: u,
332
- rightElement: N,
333
- leftElement: m
135
+ wrapper: N,
136
+ textArea: v,
137
+ accessibleLabel: O,
138
+ visibleLabel: S,
139
+ helperText: n,
140
+ rightElement: b,
141
+ leftElement: f
334
142
  };
335
- }, De = ({
143
+ }, be = ({
336
144
  scrollHeight: e,
337
- currentHeight: r,
145
+ currentHeight: a,
338
146
  currentLabelOffset: t = 0,
339
- currentHelperTextOffset: n = 0
147
+ currentHelperTextOffset: s = 0
340
148
  }) => {
341
- let s, l;
342
- if (e > 0 && e !== r) {
343
- const i = e - r, p = Math.abs(i / 24);
344
- s = t + -1 * Math.sign(i) * (12 * p), l = n + Math.sign(i) * (12 * p);
149
+ let u, d;
150
+ if (e > 0 && e !== a) {
151
+ const p = e - a, g = Math.abs(p / 24);
152
+ u = t + -1 * Math.sign(p) * (12 * g), d = s + Math.sign(p) * (12 * g);
345
153
  }
346
154
  return {
347
- labelOffset: s,
348
- helperTextOffset: l,
155
+ labelOffset: u,
156
+ helperTextOffset: d,
349
157
  scrollHeight: e
350
158
  };
351
- }, He = de.forwardRef(
159
+ }, me = ue.forwardRef(
352
160
  ({
353
161
  id: e,
354
- name: r,
162
+ name: a,
355
163
  label: t,
356
- error: n = !1,
357
- raw: a = !1,
358
- className: o,
359
- textAreaClassName: s,
360
- mode: l = "system",
361
- focusMode: i = "system",
362
- value: p,
363
- defaultValue: y,
364
- disabled: b = !1,
365
- noBorder: _ = !1,
366
- labelId: g,
367
- helperText: u = "",
368
- helperTextOnFocus: N = !1,
369
- rightElement: m,
370
- leftElement: R,
371
- onChange: D,
372
- onFocus: H,
373
- onBlur: P,
374
- ...K
375
- }, Q) => {
376
- const x = f(null), Y = ge([Q, x]), [Z, L] = G(), [ee, k] = G(), $ = f(80), F = f(-25), O = f(null), M = f(30), U = f(null), C = Re({ id: e, prefix: `${W}-` }), [V, te] = v(0), [X, re] = v(0), [ne, j] = v(
377
- !!(!N && u)
378
- ), ae = `${r} error, ${u}`, T = we({
379
- className: o,
380
- textAreaClassName: s,
381
- error: n,
382
- raw: a,
383
- focusMode: i,
384
- disabled: b,
385
- noBorder: _,
386
- mode: l,
387
- rightElement: !!m,
388
- leftElement: !!R
389
- }), [h, oe] = be({
390
- value: p,
164
+ error: s = !1,
165
+ raw: r = !1,
166
+ className: c,
167
+ textAreaClassName: u,
168
+ mode: d = "system",
169
+ focusMode: p = "system",
170
+ value: g,
171
+ defaultValue: N,
172
+ disabled: v = !1,
173
+ noBorder: O = !1,
174
+ labelId: S,
175
+ helperText: n = "",
176
+ helperTextOnFocus: b = !1,
177
+ rightElement: f,
178
+ leftElement: k,
179
+ onChange: I,
180
+ onFocus: F,
181
+ onBlur: $,
182
+ ...z
183
+ }, D) => {
184
+ const i = T(null), q = ce([D, i]), [J, _] = U(), [K, A] = U(), E = T(80), M = T(-25), L = T(null), X = T(30), j = T(null), m = le({ id: e, prefix: `${W}-` }), [w, Q] = H(0), [B, V] = H(0), [Y, G] = H(
185
+ !!(!b && n)
186
+ ), Z = `${a} error, ${n}`, y = Te({
187
+ className: c,
188
+ textAreaClassName: u,
189
+ error: s,
190
+ raw: r,
191
+ focusMode: p,
192
+ disabled: v,
193
+ noBorder: O,
194
+ mode: d,
195
+ rightElement: !!f,
196
+ leftElement: !!k
197
+ }), [x, ee] = ne({
198
+ value: g,
391
199
  initialControlledDelay: 20,
392
- defaultValue: y,
393
- onChange: (d) => {
394
- D && D({
200
+ defaultValue: N,
201
+ onChange: (l) => {
202
+ I && I({
395
203
  target: {
396
- value: d
204
+ value: l
397
205
  }
398
206
  });
399
207
  }
400
- }), se = (d) => {
401
- oe(d.target.value);
402
- }, ce = (d) => {
403
- N && u && j(!0), H && H(d);
404
- }, le = (d) => {
405
- N && u && !h && j(!1), P && P(d);
208
+ }), te = (l) => {
209
+ ee(l.target.value);
210
+ }, re = (l) => {
211
+ b && n && G(!0), F && F(l);
212
+ }, se = (l) => {
213
+ b && n && !x && G(!1), $ && $(l);
406
214
  };
407
- return E(() => {
408
- L && L.width && te(L.width + 18 + 10);
409
- }, [L]), E(() => {
410
- k && k.width && re(k.width + 18 + 10);
411
- }, [k]), E(() => {
412
- a || x && x.current && h !== void 0 && (x.current.style.height = "inherit", x.current.style.height = x.current.scrollHeight + "px");
413
- }, [h, a]), E(() => {
414
- a || setTimeout(() => {
415
- O?.current?.style.setProperty(
215
+ return R(() => {
216
+ _ && _.width && Q(_.width + 18 + 10);
217
+ }, [_]), R(() => {
218
+ A && A.width && V(A.width + 18 + 10);
219
+ }, [A]), R(() => {
220
+ r || i && i.current && x !== void 0 && (i.current.style.height = "inherit", i.current.style.height = i.current.scrollHeight + "px");
221
+ }, [x, r]), R(() => {
222
+ r || setTimeout(() => {
223
+ L?.current?.style.setProperty(
416
224
  "--av-text-area-wrapper-transition",
417
- h ? "none" : "all 0.2s ease-out"
225
+ x ? "none" : "all 0.2s ease-out"
418
226
  );
419
227
  }, 0);
420
- }, [h, a]), E(() => {
421
- if (!a && x && x.current && h !== void 0) {
422
- const { labelOffset: d, helperTextOffset: I, scrollHeight: ie } = De({
423
- scrollHeight: x.current.scrollHeight,
424
- currentHeight: $.current,
425
- currentLabelOffset: F.current,
426
- currentHelperTextOffset: M.current
228
+ }, [x, r]), R(() => {
229
+ if (!r && i && i.current && x !== void 0) {
230
+ const { labelOffset: l, helperTextOffset: C, scrollHeight: ae } = be({
231
+ scrollHeight: i.current.scrollHeight,
232
+ currentHeight: E.current,
233
+ currentLabelOffset: M.current,
234
+ currentHelperTextOffset: X.current
427
235
  });
428
- d && (F.current = d, O?.current?.style.setProperty(
236
+ l && (M.current = l, L?.current?.style.setProperty(
429
237
  "--av-text-area-label",
430
- `${d}px`
431
- )), I && (M.current = I, U?.current?.style.setProperty(
238
+ `${l}px`
239
+ )), C && (X.current = C, j?.current?.style.setProperty(
432
240
  "--av-text-area-helper-text",
433
- `${I}px`
434
- )), $.current = ie || $.current;
241
+ `${C}px`
242
+ )), E.current = ae || E.current;
435
243
  }
436
- }, [h, a]), k.width > 0 && O?.current?.style.setProperty(
244
+ }, [x, r]), A.width > 0 && L?.current?.style.setProperty(
437
245
  "--tw-translate-x",
438
- `${12 + k.width + 5}px`
439
- ), /* @__PURE__ */ ue("div", { className: T.wrapper, children: [
440
- /* @__PURE__ */ A(
246
+ `${12 + A.width + 5}px`
247
+ ), /* @__PURE__ */ oe("div", { className: y.wrapper, children: [
248
+ /* @__PURE__ */ h(
441
249
  "label",
442
250
  {
443
- htmlFor: C,
444
- id: g,
445
- className: T.accessibleLabel,
251
+ htmlFor: m,
252
+ id: S,
253
+ className: y.accessibleLabel,
446
254
  children: t
447
255
  }
448
256
  ),
449
- R && /* @__PURE__ */ A(
257
+ k && /* @__PURE__ */ h(
450
258
  "div",
451
259
  {
452
- ref: ee,
453
- className: T.leftElement,
454
- children: R
260
+ ref: K,
261
+ className: y.leftElement,
262
+ children: k
455
263
  }
456
264
  ),
457
- /* @__PURE__ */ A(
265
+ /* @__PURE__ */ h(
458
266
  "textarea",
459
267
  {
460
- ref: Y,
461
- id: C,
462
- name: r,
463
- disabled: b,
464
- placeholder: a ? void 0 : " ",
465
- className: T.textArea,
268
+ ref: q,
269
+ id: m,
270
+ name: a,
271
+ disabled: v,
272
+ placeholder: r ? void 0 : " ",
273
+ className: y.textArea,
466
274
  rows: 1,
467
- ...u && { "aria-describedby": `${C}-helper` },
468
- ...n && { "aria-invalid": "true" },
469
- ...m && !R && !a && { style: { paddingRight: V } },
470
- ...R && !m && !a && { style: { paddingLeft: X } },
471
- ...m && R && !a && {
275
+ ...n && { "aria-describedby": `${m}-helper` },
276
+ ...s && { "aria-invalid": "true" },
277
+ ...f && !k && !r && { style: { paddingRight: w } },
278
+ ...k && !f && !r && { style: { paddingLeft: B } },
279
+ ...f && k && !r && {
472
280
  style: {
473
- paddingRight: V,
474
- paddingLeft: X
281
+ paddingRight: w,
282
+ paddingLeft: B
475
283
  }
476
284
  },
477
- value: h,
478
- onChange: se,
479
- onFocus: ce,
480
- onBlur: le,
481
- ...K
285
+ value: x,
286
+ onChange: te,
287
+ onFocus: re,
288
+ onBlur: se,
289
+ ...z
482
290
  }
483
291
  ),
484
- !a && /* @__PURE__ */ A(
292
+ !r && /* @__PURE__ */ h(
485
293
  "label",
486
294
  {
487
- ref: O,
295
+ ref: L,
488
296
  "aria-hidden": !0,
489
- htmlFor: C,
490
- className: `${T.visibleLabel}`,
297
+ htmlFor: m,
298
+ className: `${y.visibleLabel}`,
491
299
  children: t
492
300
  }
493
301
  ),
494
- ne && /* @__PURE__ */ A(
302
+ Y && /* @__PURE__ */ h(
495
303
  "div",
496
304
  {
497
- ref: U,
498
- id: `${C}-helper`,
499
- className: T.helperText,
500
- children: u
305
+ ref: j,
306
+ id: `${m}-helper`,
307
+ className: y.helperText,
308
+ children: n
501
309
  }
502
310
  ),
503
- m && /* @__PURE__ */ A(
311
+ f && /* @__PURE__ */ h(
504
312
  "div",
505
313
  {
506
- ref: Z,
507
- className: T.rightElement,
508
- children: m
314
+ ref: J,
315
+ className: y.rightElement,
316
+ children: f
509
317
  }
510
318
  ),
511
- n && u && /* @__PURE__ */ A(Ce, { politeness: "polite", clearAnnouncementDelay: 500, children: ae })
319
+ s && n && /* @__PURE__ */ h(ie, { politeness: "polite", clearAnnouncementDelay: 500, children: Z })
512
320
  ] });
513
321
  }
514
322
  );
515
- He.displayName = "TextArea";
323
+ me.displayName = "TextArea";
516
324
  export {
517
325
  W as TEXT_AREA_CLASSNAME,
518
- he as TEXT_AREA_CONTROL_LEFT_CLASSNAME,
519
- me as TEXT_AREA_CONTROL_RIGHT_CLASSNAME,
520
- w as TEXT_AREA_HELPER_TEXT_CLASSNAME,
521
- xe as TEXT_AREA_WRAPPER_CLASSNAME,
522
- He as TextArea
326
+ xe as TEXT_AREA_CONTROL_LEFT_CLASSNAME,
327
+ fe as TEXT_AREA_CONTROL_RIGHT_CLASSNAME,
328
+ P as TEXT_AREA_HELPER_TEXT_CLASSNAME,
329
+ de as TEXT_AREA_WRAPPER_CLASSNAME,
330
+ me as TextArea
523
331
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { TEXT_AREA_CLASSNAME as T, TEXT_AREA_CONTROL_LEFT_CLASSNAME as R, TEXT_AREA_CONTROL_RIGHT_CLASSNAME as e, TEXT_AREA_HELPER_TEXT_CLASSNAME as S, TEXT_AREA_WRAPPER_CLASSNAME as i, TextArea as o } from "./components/TextArea/TextArea.js";
2
2
  /*!
3
- @versini/ui-textarea v5.0.0
3
+ @versini/ui-textarea v5.0.1
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
8
- version: "5.0.0",
9
- buildTime: "09/01/2025 03:17 PM EDT",
8
+ version: "5.0.1",
9
+ buildTime: "09/01/2025 04:01 PM EDT",
10
10
  homepage: "https://github.com/aversini/ui-components",
11
11
  license: "MIT"
12
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-textarea",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -37,22 +37,22 @@
37
37
  "test": "vitest run"
38
38
  },
39
39
  "peerDependencies": {
40
- "react": "^19.0.0",
41
- "react-dom": "^19.0.0"
40
+ "react": "^19.1.0",
41
+ "react-dom": "^19.1.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@testing-library/jest-dom": "6.8.0",
45
- "@versini/ui-types": "6.0.0"
45
+ "@versini/ui-types": "6.0.1"
46
46
  },
47
47
  "dependencies": {
48
48
  "@tailwindcss/typography": "0.5.16",
49
- "@versini/ui-hooks": "5.0.0",
50
- "@versini/ui-liveregion": "3.0.0",
49
+ "@versini/ui-hooks": "5.0.1",
50
+ "@versini/ui-liveregion": "3.0.1",
51
51
  "clsx": "2.1.1",
52
52
  "tailwindcss": "4.1.12"
53
53
  },
54
54
  "sideEffects": [
55
55
  "**/*.css"
56
56
  ],
57
- "gitHead": "70a47e9e30172dbb7b36306773fe9511e437fba6"
57
+ "gitHead": "dcc216644c8c3e7d43a49ea655a22aed21fa4b83"
58
58
  }