@versini/ui-textarea 4.0.12 → 5.0.0

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,331 +1,523 @@
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({
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({
7
199
  "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
8
200
  "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
9
201
  "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
10
202
  "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
11
- }), he = ({
203
+ }), Oe = ({
12
204
  focusMode: e
13
- }) => o("focus:outline focus:outline-2 focus:outline-offset-2", {
205
+ }) => c("focus:outline focus:outline-2 focus:outline-offset-2", {
14
206
  "focus:outline-focus-dark": e === "dark",
15
207
  "focus:outline-focus-light": e === "light",
16
208
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
17
209
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
18
- }), ge = ({
210
+ }), Ie = ({
19
211
  noBorder: e,
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,
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,
25
217
  "border-transparent": e
26
- }), ke = ({
218
+ }), Se = ({
27
219
  disabled: e,
28
- raw: a,
220
+ raw: r,
29
221
  error: t,
30
- mode: s,
31
- leftElement: r,
32
- rightElement: c
222
+ mode: n,
223
+ leftElement: a,
224
+ rightElement: o
33
225
  }) => {
34
- if (a)
226
+ if (r)
35
227
  return "";
36
228
  if (e)
37
- return o(
229
+ return c(
38
230
  "transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
39
231
  {
40
- "translate-x-[12px]": c === !0 && !r || !c && !r
232
+ "translate-x-[12px]": o === !0 && !a || !o && !a
41
233
  }
42
234
  );
43
235
  if (!t)
44
- return o(
236
+ return c(
45
237
  "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
46
238
  {
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"
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"
52
244
  }
53
245
  );
54
246
  if (t)
55
- return o(
247
+ return c(
56
248
  "absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
57
249
  {
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"
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"
63
255
  }
64
256
  );
65
- }, Ae = ({
257
+ }, $e = ({
66
258
  error: e,
67
- raw: a,
259
+ raw: r,
68
260
  mode: t,
69
- disabled: s
261
+ disabled: n
70
262
  }) => {
71
- if (a)
263
+ if (r)
72
264
  return "";
73
- if (s)
74
- return o(
75
- P,
265
+ if (n)
266
+ return c(
267
+ w,
76
268
  "absolute px-2 cursor-not-allowed opacity-50 font-medium"
77
269
  );
78
270
  if (!e)
79
- return o(P, "absolute px-2 font-medium", {
271
+ return c(w, "absolute px-2 font-medium", {
80
272
  "text-copy-medium": t === "dark",
81
273
  "text-copy-dark": t === "light",
82
274
  "text-copy-dark dark:text-copy-medium": t === "system",
83
275
  "text-copy-medium dark:text-copy-dark": t === "alt-system"
84
276
  });
85
277
  if (e)
86
- return o(P, "absolute px-2 font-medium", {
278
+ return c(w, "absolute px-2 font-medium", {
87
279
  "text-copy-error-light": t === "dark",
88
280
  "text-copy-error-dark": t === "light",
89
281
  "text-copy-error-dark dark:text-copy-error-light": t === "system",
90
282
  "dark:text-copy-error-dark text-copy-error-light": t === "alt-system"
91
283
  });
92
- }, Te = ({
284
+ }, we = ({
93
285
  className: e,
94
- textAreaClassName: a,
286
+ textAreaClassName: r,
95
287
  raw: t,
96
- focusMode: s,
97
- disabled: r,
98
- noBorder: c,
99
- error: u,
100
- mode: d,
101
- leftElement: p,
102
- rightElement: g
288
+ focusMode: n,
289
+ disabled: a,
290
+ noBorder: o,
291
+ error: s,
292
+ mode: l,
293
+ leftElement: i,
294
+ rightElement: p
103
295
  }) => {
104
- const N = t ? e : o(
296
+ const y = t ? e : c(
105
297
  "relative flex w-full flex-col justify-center",
106
- de,
298
+ xe,
107
299
  e
108
- ), v = t ? o(a) : o(
300
+ ), b = t ? c(r) : c(
109
301
  W,
110
- a,
111
- pe(),
112
- ye({ mode: d }),
113
- he({ focusMode: s }),
114
- ge({
115
- noBorder: c,
116
- error: u
302
+ r,
303
+ Ee(),
304
+ Le({ mode: l }),
305
+ Oe({ focusMode: n }),
306
+ Ie({
307
+ noBorder: o,
308
+ error: s
117
309
  }),
118
310
  {
119
- "disabled:cursor-not-allowed disabled:opacity-50": r
311
+ "disabled:cursor-not-allowed disabled:opacity-50": a
120
312
  }
121
- ), O = t ? void 0 : "sr-only", S = ke({
122
- disabled: r,
313
+ ), _ = t ? void 0 : "sr-only", g = Se({
314
+ disabled: a,
123
315
  raw: t,
124
- error: u,
125
- mode: d,
126
- rightElement: g,
127
- leftElement: p
128
- }), n = Ae({
129
- error: u,
316
+ error: s,
317
+ mode: l,
318
+ rightElement: p,
319
+ leftElement: i
320
+ }), u = $e({
321
+ error: s,
130
322
  raw: t,
131
- mode: d,
132
- disabled: r
133
- }), b = t ? void 0 : o(fe, "absolute"), f = t ? void 0 : o(xe, "absolute");
323
+ mode: l,
324
+ disabled: a
325
+ }), N = t ? void 0 : c(me, "absolute"), m = t ? void 0 : c(he, "absolute");
134
326
  return {
135
- wrapper: N,
136
- textArea: v,
137
- accessibleLabel: O,
138
- visibleLabel: S,
139
- helperText: n,
140
- rightElement: b,
141
- leftElement: f
327
+ wrapper: y,
328
+ textArea: b,
329
+ accessibleLabel: _,
330
+ visibleLabel: g,
331
+ helperText: u,
332
+ rightElement: N,
333
+ leftElement: m
142
334
  };
143
- }, be = ({
335
+ }, De = ({
144
336
  scrollHeight: e,
145
- currentHeight: a,
337
+ currentHeight: r,
146
338
  currentLabelOffset: t = 0,
147
- currentHelperTextOffset: s = 0
339
+ currentHelperTextOffset: n = 0
148
340
  }) => {
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);
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);
153
345
  }
154
346
  return {
155
- labelOffset: u,
156
- helperTextOffset: d,
347
+ labelOffset: s,
348
+ helperTextOffset: l,
157
349
  scrollHeight: e
158
350
  };
159
- }, me = ue.forwardRef(
351
+ }, He = de.forwardRef(
160
352
  ({
161
353
  id: e,
162
- name: a,
354
+ name: r,
163
355
  label: t,
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,
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,
199
391
  initialControlledDelay: 20,
200
- defaultValue: N,
201
- onChange: (l) => {
202
- I && I({
392
+ defaultValue: y,
393
+ onChange: (d) => {
394
+ D && D({
203
395
  target: {
204
- value: l
396
+ value: d
205
397
  }
206
398
  });
207
399
  }
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);
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);
214
406
  };
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(
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(
224
416
  "--av-text-area-wrapper-transition",
225
- x ? "none" : "all 0.2s ease-out"
417
+ h ? "none" : "all 0.2s ease-out"
226
418
  );
227
419
  }, 0);
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
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
235
427
  });
236
- l && (M.current = l, L?.current?.style.setProperty(
428
+ d && (F.current = d, O?.current?.style.setProperty(
237
429
  "--av-text-area-label",
238
- `${l}px`
239
- )), C && (X.current = C, j?.current?.style.setProperty(
430
+ `${d}px`
431
+ )), I && (M.current = I, U?.current?.style.setProperty(
240
432
  "--av-text-area-helper-text",
241
- `${C}px`
242
- )), E.current = ae || E.current;
433
+ `${I}px`
434
+ )), $.current = ie || $.current;
243
435
  }
244
- }, [x, r]), A.width > 0 && L?.current?.style.setProperty(
436
+ }, [h, a]), k.width > 0 && O?.current?.style.setProperty(
245
437
  "--tw-translate-x",
246
- `${12 + A.width + 5}px`
247
- ), /* @__PURE__ */ oe("div", { className: y.wrapper, children: [
248
- /* @__PURE__ */ h(
438
+ `${12 + k.width + 5}px`
439
+ ), /* @__PURE__ */ ue("div", { className: T.wrapper, children: [
440
+ /* @__PURE__ */ A(
249
441
  "label",
250
442
  {
251
- htmlFor: m,
252
- id: S,
253
- className: y.accessibleLabel,
443
+ htmlFor: C,
444
+ id: g,
445
+ className: T.accessibleLabel,
254
446
  children: t
255
447
  }
256
448
  ),
257
- k && /* @__PURE__ */ h(
449
+ R && /* @__PURE__ */ A(
258
450
  "div",
259
451
  {
260
- ref: K,
261
- className: y.leftElement,
262
- children: k
452
+ ref: ee,
453
+ className: T.leftElement,
454
+ children: R
263
455
  }
264
456
  ),
265
- /* @__PURE__ */ h(
457
+ /* @__PURE__ */ A(
266
458
  "textarea",
267
459
  {
268
- ref: q,
269
- id: m,
270
- name: a,
271
- disabled: v,
272
- placeholder: r ? void 0 : " ",
273
- className: y.textArea,
460
+ ref: Y,
461
+ id: C,
462
+ name: r,
463
+ disabled: b,
464
+ placeholder: a ? void 0 : " ",
465
+ className: T.textArea,
274
466
  rows: 1,
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 && {
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 && {
280
472
  style: {
281
- paddingRight: w,
282
- paddingLeft: B
473
+ paddingRight: V,
474
+ paddingLeft: X
283
475
  }
284
476
  },
285
- value: x,
286
- onChange: te,
287
- onFocus: re,
288
- onBlur: se,
289
- ...z
477
+ value: h,
478
+ onChange: se,
479
+ onFocus: ce,
480
+ onBlur: le,
481
+ ...K
290
482
  }
291
483
  ),
292
- !r && /* @__PURE__ */ h(
484
+ !a && /* @__PURE__ */ A(
293
485
  "label",
294
486
  {
295
- ref: L,
487
+ ref: O,
296
488
  "aria-hidden": !0,
297
- htmlFor: m,
298
- className: `${y.visibleLabel}`,
489
+ htmlFor: C,
490
+ className: `${T.visibleLabel}`,
299
491
  children: t
300
492
  }
301
493
  ),
302
- Y && /* @__PURE__ */ h(
494
+ ne && /* @__PURE__ */ A(
303
495
  "div",
304
496
  {
305
- ref: j,
306
- id: `${m}-helper`,
307
- className: y.helperText,
308
- children: n
497
+ ref: U,
498
+ id: `${C}-helper`,
499
+ className: T.helperText,
500
+ children: u
309
501
  }
310
502
  ),
311
- f && /* @__PURE__ */ h(
503
+ m && /* @__PURE__ */ A(
312
504
  "div",
313
505
  {
314
- ref: J,
315
- className: y.rightElement,
316
- children: f
506
+ ref: Z,
507
+ className: T.rightElement,
508
+ children: m
317
509
  }
318
510
  ),
319
- s && n && /* @__PURE__ */ h(ie, { politeness: "polite", clearAnnouncementDelay: 500, children: Z })
511
+ n && u && /* @__PURE__ */ A(Ce, { politeness: "polite", clearAnnouncementDelay: 500, children: ae })
320
512
  ] });
321
513
  }
322
514
  );
323
- me.displayName = "TextArea";
515
+ He.displayName = "TextArea";
324
516
  export {
325
517
  W as TEXT_AREA_CLASSNAME,
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
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
331
523
  };
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 v4.0.12
3
+ @versini/ui-textarea v5.0.0
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
8
- version: "4.0.12",
9
- buildTime: "09/01/2025 02:19 PM EDT",
8
+ version: "5.0.0",
9
+ buildTime: "09/01/2025 03:17 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": "4.0.12",
3
+ "version": "5.0.0",
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": "^18.3.1 || ^19.0.0",
41
- "react-dom": "^18.3.1 || ^19.0.0"
40
+ "react": "^19.0.0",
41
+ "react-dom": "^19.0.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@testing-library/jest-dom": "6.8.0",
45
- "@versini/ui-types": "5.0.7"
45
+ "@versini/ui-types": "6.0.0"
46
46
  },
47
47
  "dependencies": {
48
48
  "@tailwindcss/typography": "0.5.16",
49
- "@versini/ui-hooks": "4.7.8",
50
- "@versini/ui-liveregion": "2.0.12",
49
+ "@versini/ui-hooks": "5.0.0",
50
+ "@versini/ui-liveregion": "3.0.0",
51
51
  "clsx": "2.1.1",
52
52
  "tailwindcss": "4.1.12"
53
53
  },
54
54
  "sideEffects": [
55
55
  "**/*.css"
56
56
  ],
57
- "gitHead": "c577149643ec36cad454587166e62410a77aed38"
57
+ "gitHead": "70a47e9e30172dbb7b36306773fe9511e437fba6"
58
58
  }