@versini/ui-textinput 1.6.1 → 2.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.
- package/dist/chunks/TextInput.nuA_J14_.js +423 -0
- package/dist/components/TextInput/TextInput.js +1 -1
- package/dist/components/TextInput/TextInputMask.js +28 -30
- package/dist/index.d.ts +2 -3
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +4 -5
- package/dist/chunks/TextInput.BAOtC6RE.js +0 -449
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { jsx as y, jsxs as H } from "react/jsx-runtime";
|
|
2
|
+
import z, { useRef as f, useEffect as _, useCallback as W, useState as $, useMemo as J, useId as K, useReducer as Q, useLayoutEffect as L } from "react";
|
|
3
|
+
import c from "clsx";
|
|
4
|
+
const P = "av-text-input", me = "av-text-input-simple", Y = "av-text-input-wrapper", I = "av-text-input-helper-text";
|
|
5
|
+
function Z() {
|
|
6
|
+
const e = f(!1);
|
|
7
|
+
return _(() => (e.current = !0, () => {
|
|
8
|
+
e.current = !1;
|
|
9
|
+
}), []), W(() => e.current, []);
|
|
10
|
+
}
|
|
11
|
+
const B = {
|
|
12
|
+
x: 0,
|
|
13
|
+
y: 0,
|
|
14
|
+
width: 0,
|
|
15
|
+
height: 0,
|
|
16
|
+
top: 0,
|
|
17
|
+
left: 0,
|
|
18
|
+
bottom: 0,
|
|
19
|
+
right: 0
|
|
20
|
+
};
|
|
21
|
+
function ee(e) {
|
|
22
|
+
const n = Z(), t = f(0), r = f(null), [a, o] = $(B), l = J(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((p) => {
|
|
23
|
+
const i = p[0];
|
|
24
|
+
i && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
|
|
25
|
+
r.current && n() && o(i.contentRect);
|
|
26
|
+
}));
|
|
27
|
+
}), [n]);
|
|
28
|
+
return _(() => (r.current && (l == null || l.observe(r.current, e)), () => {
|
|
29
|
+
l == null || l.disconnect(), t.current && cancelAnimationFrame(t.current);
|
|
30
|
+
}), [l, e]), [r, a];
|
|
31
|
+
}
|
|
32
|
+
function te(e) {
|
|
33
|
+
const n = K();
|
|
34
|
+
if (!e)
|
|
35
|
+
return n;
|
|
36
|
+
if (typeof e == "number" || typeof e == "string")
|
|
37
|
+
return `${e}${n}`;
|
|
38
|
+
if (typeof e == "object") {
|
|
39
|
+
const { id: t, prefix: r = "" } = e;
|
|
40
|
+
return typeof t == "number" || typeof t == "string" ? `${r}${t}` : `${r}${n}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const w = "SET_ANNOUNCEMENT", D = "CLEAR_ANNOUNCEMENT", re = {
|
|
44
|
+
alert: null,
|
|
45
|
+
alertdialog: null,
|
|
46
|
+
log: "polite",
|
|
47
|
+
marquee: null,
|
|
48
|
+
progressbar: null,
|
|
49
|
+
status: "polite",
|
|
50
|
+
timer: "assertive"
|
|
51
|
+
}, ne = (e, n) => {
|
|
52
|
+
switch (n == null ? void 0 : n.type) {
|
|
53
|
+
case w:
|
|
54
|
+
return {
|
|
55
|
+
...e,
|
|
56
|
+
announcement: n.payload
|
|
57
|
+
};
|
|
58
|
+
case D:
|
|
59
|
+
return {
|
|
60
|
+
...e,
|
|
61
|
+
announcement: null
|
|
62
|
+
};
|
|
63
|
+
default:
|
|
64
|
+
return e;
|
|
65
|
+
}
|
|
66
|
+
}, ae = ({
|
|
67
|
+
onAnnouncementClear: e,
|
|
68
|
+
dispatch: n
|
|
69
|
+
}) => {
|
|
70
|
+
n({
|
|
71
|
+
type: D
|
|
72
|
+
}), typeof e == "function" && e();
|
|
73
|
+
}, S = ({
|
|
74
|
+
children: e,
|
|
75
|
+
clearAnnouncementDelay: n,
|
|
76
|
+
clearAnnouncementTimeoutRef: t,
|
|
77
|
+
onAnnouncementClear: r,
|
|
78
|
+
dispatch: a
|
|
79
|
+
}) => {
|
|
80
|
+
clearTimeout(t.current), e !== null && a({
|
|
81
|
+
type: w,
|
|
82
|
+
payload: e
|
|
83
|
+
}), n && (t.current = setTimeout(
|
|
84
|
+
() => ae({
|
|
85
|
+
onAnnouncementClear: r,
|
|
86
|
+
dispatch: a
|
|
87
|
+
}),
|
|
88
|
+
n
|
|
89
|
+
));
|
|
90
|
+
}, le = ({
|
|
91
|
+
children: e,
|
|
92
|
+
announcementTimeoutRef: n,
|
|
93
|
+
announcementDelay: t,
|
|
94
|
+
clearAnnouncementDelay: r,
|
|
95
|
+
clearAnnouncementTimeoutRef: a,
|
|
96
|
+
onAnnouncementClear: o,
|
|
97
|
+
dispatch: l
|
|
98
|
+
}) => {
|
|
99
|
+
clearTimeout(n.current), t ? n.current = setTimeout(S, t, {
|
|
100
|
+
children: e,
|
|
101
|
+
clearAnnouncementDelay: r,
|
|
102
|
+
clearAnnouncementTimeoutRef: a,
|
|
103
|
+
onAnnouncementClear: o,
|
|
104
|
+
dispatch: l
|
|
105
|
+
}) : S({
|
|
106
|
+
children: e,
|
|
107
|
+
clearAnnouncementDelay: r,
|
|
108
|
+
clearAnnouncementTimeoutRef: a,
|
|
109
|
+
onAnnouncementClear: o,
|
|
110
|
+
dispatch: l
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
function ce({
|
|
114
|
+
children: e,
|
|
115
|
+
className: n,
|
|
116
|
+
politeness: t,
|
|
117
|
+
role: r = null,
|
|
118
|
+
announcementDelay: a,
|
|
119
|
+
clearAnnouncementDelay: o,
|
|
120
|
+
onAnnouncementClear: l,
|
|
121
|
+
visible: p,
|
|
122
|
+
...i
|
|
123
|
+
}) {
|
|
124
|
+
const x = f(null), m = f(null), [s, g] = Q(ne, {
|
|
125
|
+
announcement: null
|
|
126
|
+
});
|
|
127
|
+
let d = t;
|
|
128
|
+
typeof d > "u" && (d = r ? re[r] : "assertive"), _(() => {
|
|
129
|
+
le({
|
|
130
|
+
announcementTimeoutRef: x,
|
|
131
|
+
announcementDelay: a,
|
|
132
|
+
children: e,
|
|
133
|
+
clearAnnouncementDelay: o,
|
|
134
|
+
clearAnnouncementTimeoutRef: m,
|
|
135
|
+
onAnnouncementClear: l,
|
|
136
|
+
dispatch: g
|
|
137
|
+
});
|
|
138
|
+
}, [
|
|
139
|
+
e,
|
|
140
|
+
a,
|
|
141
|
+
o,
|
|
142
|
+
l
|
|
143
|
+
]);
|
|
144
|
+
const u = c(n, {
|
|
145
|
+
"sr-only": !p
|
|
146
|
+
});
|
|
147
|
+
return /* @__PURE__ */ y(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
"aria-live": d,
|
|
151
|
+
...r && { role: r },
|
|
152
|
+
className: u,
|
|
153
|
+
...i,
|
|
154
|
+
children: s.announcement
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
/*!
|
|
159
|
+
@versini/ui-liveregion v1.2.3
|
|
160
|
+
© 2024 gizmette.com
|
|
161
|
+
*/
|
|
162
|
+
try {
|
|
163
|
+
window.__VERSINI_UI_LIVEREGION__ || (window.__VERSINI_UI_LIVEREGION__ = {
|
|
164
|
+
version: "1.2.3",
|
|
165
|
+
buildTime: "12/30/2024 11:40 AM EST",
|
|
166
|
+
homepage: "https://github.com/aversini/ui-components",
|
|
167
|
+
license: "MIT"
|
|
168
|
+
});
|
|
169
|
+
} catch {
|
|
170
|
+
}
|
|
171
|
+
const oe = ({
|
|
172
|
+
mode: e
|
|
173
|
+
}) => c({
|
|
174
|
+
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
|
175
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
|
|
176
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
|
|
177
|
+
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
|
|
178
|
+
}), se = ({
|
|
179
|
+
focusMode: e
|
|
180
|
+
}) => c("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
181
|
+
"focus:outline-focus-dark": e === "dark",
|
|
182
|
+
"focus:outline-focus-light": e === "light",
|
|
183
|
+
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
184
|
+
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
185
|
+
}), ue = ({
|
|
186
|
+
noBorder: e,
|
|
187
|
+
error: n
|
|
188
|
+
}) => c("border-2", {
|
|
189
|
+
"border-border-dark": !e && !n,
|
|
190
|
+
"focus:border-border-dark": !e && n,
|
|
191
|
+
"border-border-error-dark": !e && n,
|
|
192
|
+
"border-transparent": e
|
|
193
|
+
}), ie = ({
|
|
194
|
+
disabled: e,
|
|
195
|
+
raw: n,
|
|
196
|
+
error: t,
|
|
197
|
+
mode: r
|
|
198
|
+
}) => {
|
|
199
|
+
if (n)
|
|
200
|
+
return "";
|
|
201
|
+
if (e)
|
|
202
|
+
return c("absolute px-2 cursor-not-allowed opacity-50 font-medium");
|
|
203
|
+
if (!t)
|
|
204
|
+
return c("absolute px-2 cursor-text font-medium", {
|
|
205
|
+
"text-copy-lighter": r === "dark",
|
|
206
|
+
"text-copy-dark": r === "light",
|
|
207
|
+
"text-copy-dark dark:text-copy-lighter": r === "system",
|
|
208
|
+
"text-copy-lighter dark:text-copy-dark": r === "alt-system"
|
|
209
|
+
});
|
|
210
|
+
if (t)
|
|
211
|
+
return c("absolute px-2 cursor-text font-medium", {
|
|
212
|
+
"text-copy-lighter": r === "dark",
|
|
213
|
+
"text-copy-error-dark": r === "light",
|
|
214
|
+
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
|
|
215
|
+
"text-copy-lighter dark:text-copy-error-dark": r === "alt-system"
|
|
216
|
+
});
|
|
217
|
+
}, pe = ({
|
|
218
|
+
error: e,
|
|
219
|
+
raw: n,
|
|
220
|
+
mode: t,
|
|
221
|
+
disabled: r
|
|
222
|
+
}) => {
|
|
223
|
+
if (n)
|
|
224
|
+
return "";
|
|
225
|
+
if (r)
|
|
226
|
+
return c(
|
|
227
|
+
I,
|
|
228
|
+
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
229
|
+
);
|
|
230
|
+
if (!e)
|
|
231
|
+
return c(I, "absolute px-2 font-medium", {
|
|
232
|
+
"text-copy-lighter": t === "dark",
|
|
233
|
+
"text-copy-dark": t === "light",
|
|
234
|
+
"text-copy-dark dark:text-copy-lighter": t === "system",
|
|
235
|
+
"text-copy-lighter dark:text-copy-dark": t === "alt-system"
|
|
236
|
+
});
|
|
237
|
+
if (e)
|
|
238
|
+
return c(I, "absolute px-2 font-medium", {
|
|
239
|
+
"text-copy-error-light bg-surface-darker": t === "dark",
|
|
240
|
+
"text-copy-error-dark": t === "light",
|
|
241
|
+
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": t === "system",
|
|
242
|
+
"dark:text-copy-error-dark text-copy-error-light bg-surface-darker": t === "alt-system"
|
|
243
|
+
});
|
|
244
|
+
}, de = ({
|
|
245
|
+
className: e,
|
|
246
|
+
inputClassName: n,
|
|
247
|
+
raw: t,
|
|
248
|
+
disabled: r,
|
|
249
|
+
noBorder: a,
|
|
250
|
+
error: o,
|
|
251
|
+
mode: l,
|
|
252
|
+
focusMode: p,
|
|
253
|
+
size: i,
|
|
254
|
+
rightElementClassName: x
|
|
255
|
+
}) => {
|
|
256
|
+
const m = t ? e : c(
|
|
257
|
+
"relative flex w-full flex-col justify-center",
|
|
258
|
+
Y,
|
|
259
|
+
e
|
|
260
|
+
);
|
|
261
|
+
let s = "";
|
|
262
|
+
switch (i) {
|
|
263
|
+
case "xs":
|
|
264
|
+
s = "h-8";
|
|
265
|
+
break;
|
|
266
|
+
case "sm":
|
|
267
|
+
s = "h-10";
|
|
268
|
+
break;
|
|
269
|
+
case "lg":
|
|
270
|
+
s = "h-14";
|
|
271
|
+
break;
|
|
272
|
+
case "xl":
|
|
273
|
+
s = "h-16";
|
|
274
|
+
break;
|
|
275
|
+
default:
|
|
276
|
+
s = "h-12";
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
const g = t ? c(n) : c(
|
|
280
|
+
P,
|
|
281
|
+
s,
|
|
282
|
+
"rounded-md text-base px-4",
|
|
283
|
+
oe({ mode: l }),
|
|
284
|
+
se({ focusMode: p }),
|
|
285
|
+
ue({ noBorder: a, error: o }),
|
|
286
|
+
{
|
|
287
|
+
"disabled:cursor-not-allowed disabled:opacity-50": r
|
|
288
|
+
},
|
|
289
|
+
n
|
|
290
|
+
), d = t ? void 0 : "sr-only", u = ie({
|
|
291
|
+
disabled: r,
|
|
292
|
+
raw: t,
|
|
293
|
+
error: o,
|
|
294
|
+
mode: l
|
|
295
|
+
}), b = pe({
|
|
296
|
+
error: o,
|
|
297
|
+
raw: t,
|
|
298
|
+
mode: l,
|
|
299
|
+
disabled: r
|
|
300
|
+
}), v = t ? void 0 : c("absolute right-3", x);
|
|
301
|
+
return {
|
|
302
|
+
wrapper: m,
|
|
303
|
+
input: g,
|
|
304
|
+
accessibleLabel: d,
|
|
305
|
+
visibleLabel: u,
|
|
306
|
+
helperText: b,
|
|
307
|
+
rightElement: v
|
|
308
|
+
};
|
|
309
|
+
}, ye = z.forwardRef(
|
|
310
|
+
({
|
|
311
|
+
id: e,
|
|
312
|
+
name: n,
|
|
313
|
+
label: t,
|
|
314
|
+
error: r = !1,
|
|
315
|
+
raw: a = !1,
|
|
316
|
+
className: o,
|
|
317
|
+
inputClassName: l,
|
|
318
|
+
mode: p = "system",
|
|
319
|
+
focusMode: i = "system",
|
|
320
|
+
disabled: x = !1,
|
|
321
|
+
noBorder: m = !1,
|
|
322
|
+
labelId: s,
|
|
323
|
+
labelHidden: g = !1,
|
|
324
|
+
type: d = "text",
|
|
325
|
+
helperText: u = "",
|
|
326
|
+
rightElement: b,
|
|
327
|
+
rightElementClassName: v,
|
|
328
|
+
size: N = "md",
|
|
329
|
+
...U
|
|
330
|
+
}, M) => {
|
|
331
|
+
const [F, T] = ee(), [O, X] = $(0), k = te({ id: e, prefix: `${P}-` }), j = `${n} error, ${u}`, A = f(null), E = f(null), V = {
|
|
332
|
+
xs: { label: "-25px", helperText: "30px" },
|
|
333
|
+
sm: { label: "-29px", helperText: "34px" },
|
|
334
|
+
md: { label: "-33px", helperText: "38px" },
|
|
335
|
+
lg: { label: "-15px", helperText: "22px" },
|
|
336
|
+
xl: { label: "-19px", helperText: "25px" }
|
|
337
|
+
}, h = de({
|
|
338
|
+
className: o,
|
|
339
|
+
inputClassName: l,
|
|
340
|
+
error: r,
|
|
341
|
+
raw: a,
|
|
342
|
+
focusMode: i,
|
|
343
|
+
disabled: x,
|
|
344
|
+
noBorder: m,
|
|
345
|
+
mode: p,
|
|
346
|
+
size: N,
|
|
347
|
+
rightElementClassName: v
|
|
348
|
+
});
|
|
349
|
+
return L(() => {
|
|
350
|
+
T && T.width && X(T.width + 18 + 10);
|
|
351
|
+
}, [T]), L(() => {
|
|
352
|
+
var R, C;
|
|
353
|
+
const { label: q, helperText: G } = V[N];
|
|
354
|
+
(R = A == null ? void 0 : A.current) == null || R.style.setProperty("--av-text-input-label", q), (C = E == null ? void 0 : E.current) == null || C.style.setProperty(
|
|
355
|
+
"--av-text-input-helper-text",
|
|
356
|
+
G
|
|
357
|
+
);
|
|
358
|
+
}, [N]), /* @__PURE__ */ H("div", { className: h.wrapper, children: [
|
|
359
|
+
/* @__PURE__ */ y(
|
|
360
|
+
"label",
|
|
361
|
+
{
|
|
362
|
+
htmlFor: k,
|
|
363
|
+
id: s,
|
|
364
|
+
className: h.accessibleLabel,
|
|
365
|
+
children: t
|
|
366
|
+
}
|
|
367
|
+
),
|
|
368
|
+
/* @__PURE__ */ y(
|
|
369
|
+
"input",
|
|
370
|
+
{
|
|
371
|
+
ref: M,
|
|
372
|
+
id: k,
|
|
373
|
+
name: n,
|
|
374
|
+
type: d,
|
|
375
|
+
disabled: x,
|
|
376
|
+
placeholder: a ? void 0 : " ",
|
|
377
|
+
className: h.input,
|
|
378
|
+
...u && { "aria-describedby": `${k}-helper` },
|
|
379
|
+
...r && { "aria-invalid": "true" },
|
|
380
|
+
...b && !a && { style: { paddingRight: O } },
|
|
381
|
+
...U
|
|
382
|
+
}
|
|
383
|
+
),
|
|
384
|
+
!a && !g && /* @__PURE__ */ y(
|
|
385
|
+
"label",
|
|
386
|
+
{
|
|
387
|
+
ref: A,
|
|
388
|
+
"aria-hidden": !0,
|
|
389
|
+
htmlFor: k,
|
|
390
|
+
className: h.visibleLabel,
|
|
391
|
+
children: t
|
|
392
|
+
}
|
|
393
|
+
),
|
|
394
|
+
u && /* @__PURE__ */ y(
|
|
395
|
+
"div",
|
|
396
|
+
{
|
|
397
|
+
ref: E,
|
|
398
|
+
id: `${k}-helper`,
|
|
399
|
+
className: h.helperText,
|
|
400
|
+
children: u
|
|
401
|
+
}
|
|
402
|
+
),
|
|
403
|
+
b && /* @__PURE__ */ y(
|
|
404
|
+
"div",
|
|
405
|
+
{
|
|
406
|
+
ref: F,
|
|
407
|
+
className: h.rightElement,
|
|
408
|
+
children: b
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
r && u && /* @__PURE__ */ y(ce, { politeness: "polite", clearAnnouncementDelay: 500, children: j })
|
|
412
|
+
] });
|
|
413
|
+
}
|
|
414
|
+
);
|
|
415
|
+
ye.displayName = "TextInput";
|
|
416
|
+
export {
|
|
417
|
+
P as TEXT_INPUT_CLASSNAME,
|
|
418
|
+
I as TEXT_INPUT_HELPER_TEXT_CLASSNAME,
|
|
419
|
+
me as TEXT_INPUT_SIMPLE_CLASSNAME,
|
|
420
|
+
Y as TEXT_INPUT_WRAPPER_CLASSNAME,
|
|
421
|
+
ye as TextInput,
|
|
422
|
+
ce as x
|
|
423
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { TextInput as
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import A, { useMemo as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { TextInput as F, x as H } from "../../chunks/TextInput.nuA_J14_.js";
|
|
2
|
+
import { jsxs as L, Fragment as B, jsx as x } from "react/jsx-runtime";
|
|
3
|
+
import A, { useMemo as j, useState as _, useRef as m, useEffect as b } from "react";
|
|
4
|
+
function $(r) {
|
|
5
|
+
return j(() => r.every((t) => t == null) ? () => {
|
|
6
6
|
} : (t) => {
|
|
7
7
|
r.forEach((n) => {
|
|
8
8
|
typeof n == "function" ? n(t) : n != null && (n.current = t);
|
|
9
9
|
});
|
|
10
10
|
}, r);
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const q = 500, z = 5e3, G = 2e4, J = A.forwardRef(
|
|
13
13
|
({
|
|
14
14
|
name: r,
|
|
15
15
|
disabled: t,
|
|
@@ -21,25 +21,24 @@ const z = 500, G = 5e3, J = 2e4, K = A.forwardRef(
|
|
|
21
21
|
onFocus: p,
|
|
22
22
|
onTextInputMaskBlur: f,
|
|
23
23
|
rightElement: O,
|
|
24
|
-
|
|
25
|
-
...w
|
|
24
|
+
...U
|
|
26
25
|
}, E) => {
|
|
27
26
|
const [h, R] = _(!0), [l, g] = _({
|
|
28
27
|
message: null,
|
|
29
28
|
politeness: null
|
|
30
|
-
}), c = m(!0), o = m(null), I = m(null),
|
|
29
|
+
}), c = m(!0), o = m(null), I = m(null), w = $([E, I]), C = h ? "Show" : "Hide", a = () => {
|
|
31
30
|
o.current && clearTimeout(o.current), c.current || (o.current = setTimeout(() => {
|
|
32
31
|
c.current = !0, R(!0), g({
|
|
33
|
-
announcementTimeout:
|
|
32
|
+
announcementTimeout: z,
|
|
34
33
|
politeness: "polite",
|
|
35
34
|
message: `${n} hiding characters`
|
|
36
35
|
}), u && u(!0);
|
|
37
|
-
},
|
|
38
|
-
},
|
|
36
|
+
}, G));
|
|
37
|
+
}, S = (e) => {
|
|
39
38
|
e.preventDefault();
|
|
40
39
|
const s = !c.current;
|
|
41
40
|
c.current = s, a(), R(s), g({
|
|
42
|
-
announcementTimeout:
|
|
41
|
+
announcementTimeout: q,
|
|
43
42
|
politeness: "assertive",
|
|
44
43
|
message: s ? "Characters hidden" : "Characters showing"
|
|
45
44
|
}), u && u(s);
|
|
@@ -47,41 +46,40 @@ const z = 500, G = 5e3, J = 2e4, K = A.forwardRef(
|
|
|
47
46
|
var N;
|
|
48
47
|
const { relatedTarget: s } = e, i = (N = I.current) == null ? void 0 : N.parentElement;
|
|
49
48
|
i != null && i.contains(s) || f && f();
|
|
50
|
-
},
|
|
49
|
+
}, v = (e) => {
|
|
51
50
|
a(), d && d(e), M(e);
|
|
52
|
-
},
|
|
51
|
+
}, y = (e) => {
|
|
53
52
|
a(), p && p(e);
|
|
54
|
-
},
|
|
53
|
+
}, D = (e) => {
|
|
55
54
|
a(), T && T(e);
|
|
56
55
|
};
|
|
57
|
-
return
|
|
56
|
+
return b(() => () => {
|
|
58
57
|
o.current && clearTimeout(o.current);
|
|
59
|
-
}, []), /* @__PURE__ */ B
|
|
58
|
+
}, []), /* @__PURE__ */ L(B, { children: [
|
|
60
59
|
/* @__PURE__ */ x(
|
|
61
|
-
|
|
60
|
+
F,
|
|
62
61
|
{
|
|
63
|
-
ref:
|
|
62
|
+
ref: w,
|
|
64
63
|
name: r,
|
|
65
64
|
label: n,
|
|
66
65
|
labelHidden: k,
|
|
67
66
|
type: h ? "password" : "text",
|
|
68
67
|
disabled: t,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
onChange: F,
|
|
68
|
+
onBlur: v,
|
|
69
|
+
onFocus: y,
|
|
70
|
+
onChange: D,
|
|
73
71
|
rightElement: A.cloneElement(O, {
|
|
74
72
|
ref: E,
|
|
75
|
-
label:
|
|
76
|
-
onClick:
|
|
73
|
+
label: C,
|
|
74
|
+
onClick: S,
|
|
77
75
|
onBlur: M,
|
|
78
76
|
disabled: t
|
|
79
77
|
}),
|
|
80
|
-
...
|
|
78
|
+
...U
|
|
81
79
|
}
|
|
82
80
|
),
|
|
83
81
|
/* @__PURE__ */ x(
|
|
84
|
-
|
|
82
|
+
H,
|
|
85
83
|
{
|
|
86
84
|
role: "status",
|
|
87
85
|
politeness: l.politeness,
|
|
@@ -92,7 +90,7 @@ const z = 500, G = 5e3, J = 2e4, K = A.forwardRef(
|
|
|
92
90
|
] });
|
|
93
91
|
}
|
|
94
92
|
);
|
|
95
|
-
|
|
93
|
+
J.displayName = "TextInputMask";
|
|
96
94
|
export {
|
|
97
|
-
|
|
95
|
+
J as TextInputMask
|
|
98
96
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _versini_ui_types from '@versini/ui-types';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
declare const TEXT_INPUT_CLASSNAME = "av-text-input";
|
|
@@ -24,7 +23,7 @@ declare const TextInput: React.ForwardRefExoticComponent<{
|
|
|
24
23
|
noBorder?: boolean;
|
|
25
24
|
raw?: boolean;
|
|
26
25
|
size?: Size;
|
|
27
|
-
} &
|
|
26
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
28
27
|
|
|
29
28
|
declare const TextInputMask: React.ForwardRefExoticComponent<{
|
|
30
29
|
rightElement: React.ReactElement;
|
|
@@ -43,6 +42,6 @@ declare const TextInputMask: React.ForwardRefExoticComponent<{
|
|
|
43
42
|
noBorder?: boolean;
|
|
44
43
|
raw?: boolean;
|
|
45
44
|
size?: Size;
|
|
46
|
-
} &
|
|
45
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
47
46
|
|
|
48
47
|
export { TEXT_INPUT_CLASSNAME, TEXT_INPUT_HELPER_TEXT_CLASSNAME, TEXT_INPUT_SIMPLE_CLASSNAME, TEXT_INPUT_WRAPPER_CLASSNAME, TextInput, TextInputMask };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TEXT_INPUT_CLASSNAME as I, TEXT_INPUT_HELPER_TEXT_CLASSNAME as e, TEXT_INPUT_SIMPLE_CLASSNAME as o, TEXT_INPUT_WRAPPER_CLASSNAME as t, TextInput as N } from "./chunks/TextInput.
|
|
1
|
+
import { TEXT_INPUT_CLASSNAME as I, TEXT_INPUT_HELPER_TEXT_CLASSNAME as e, TEXT_INPUT_SIMPLE_CLASSNAME as o, TEXT_INPUT_WRAPPER_CLASSNAME as t, TextInput as N } from "./chunks/TextInput.nuA_J14_.js";
|
|
2
2
|
import { TextInputMask as i } from "./components/TextInput/TextInputMask.js";
|
|
3
3
|
/*!
|
|
4
|
-
@versini/ui-textinput
|
|
4
|
+
@versini/ui-textinput v2.0.1
|
|
5
5
|
© 2024 gizmette.com
|
|
6
6
|
*/
|
|
7
7
|
try {
|
|
8
8
|
window.__VERSINI_UI_TEXTINPUT__ || (window.__VERSINI_UI_TEXTINPUT__ = {
|
|
9
|
-
version: "
|
|
10
|
-
buildTime: "12/
|
|
9
|
+
version: "2.0.1",
|
|
10
|
+
buildTime: "12/30/2024 11:40 AM EST",
|
|
11
11
|
homepage: "https://github.com/aversini/ui-components",
|
|
12
12
|
license: "MIT"
|
|
13
13
|
});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::-ms-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-ms-input-placeholder,textarea::-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.av-text-input-wrapper label[aria-hidden=true]{transform:translate(12px) scale(1);transform-origin:top left;transition:var(--av-text-input-wrapper-transition, all .2s ease-out)}.av-text-input:focus+label[aria-hidden=true],.av-text-input:not(:placeholder-shown)+label[aria-hidden=true]{transform:translate(12px,var(--av-text-input-label, -33px)) scale(.75)}.av-text-input-helper-text{transform:translate(12px,var(--av-text-input-helper-text, 38px)) scale(.75);transform-origin:top left}@keyframes blink{50%{fill:transparent}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.right-3{right:.75rem}.m-0{margin:0}.m-1{margin:.25rem}.m-10{margin:2.5rem}.m-11{margin:2.75rem}.m-12{margin:3rem}.m-14{margin:3.5rem}.m-16{margin:4rem}.m-2{margin:.5rem}.m-20{margin:5rem}.m-24{margin:6rem}.m-28{margin:7rem}.m-3{margin:.75rem}.m-32{margin:8rem}.m-36{margin:9rem}.m-4{margin:1rem}.m-44{margin:11rem}.m-48{margin:12rem}.m-5{margin:1.25rem}.m-52{margin:13rem}.m-56{margin:14rem}.m-6{margin:1.5rem}.m-60{margin:15rem}.m-64{margin:16rem}.m-7{margin:1.75rem}.m-72{margin:18rem}.m-8{margin:2rem}.m-80{margin:20rem}.m-9{margin:2.25rem}.m-96{margin:24rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-11{margin-bottom:2.75rem}.mb-12{margin-bottom:3rem}.mb-14{margin-bottom:3.5rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-28{margin-bottom:7rem}.mb-3{margin-bottom:.75rem}.mb-32{margin-bottom:8rem}.mb-36{margin-bottom:9rem}.mb-4{margin-bottom:1rem}.mb-44{margin-bottom:11rem}.mb-48{margin-bottom:12rem}.mb-5{margin-bottom:1.25rem}.mb-52{margin-bottom:13rem}.mb-56{margin-bottom:14rem}.mb-6{margin-bottom:1.5rem}.mb-60{margin-bottom:15rem}.mb-64{margin-bottom:16rem}.mb-7{margin-bottom:1.75rem}.mb-72{margin-bottom:18rem}.mb-8{margin-bottom:2rem}.mb-80{margin-bottom:20rem}.mb-9{margin-bottom:2.25rem}.mb-96{margin-bottom:24rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-10{margin-left:2.5rem}.ml-11{margin-left:2.75rem}.ml-12{margin-left:3rem}.ml-14{margin-left:3.5rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.ml-24{margin-left:6rem}.ml-28{margin-left:7rem}.ml-3{margin-left:.75rem}.ml-32{margin-left:8rem}.ml-36{margin-left:9rem}.ml-4{margin-left:1rem}.ml-44{margin-left:11rem}.ml-48{margin-left:12rem}.ml-5{margin-left:1.25rem}.ml-52{margin-left:13rem}.ml-56{margin-left:14rem}.ml-6{margin-left:1.5rem}.ml-60{margin-left:15rem}.ml-64{margin-left:16rem}.ml-7{margin-left:1.75rem}.ml-72{margin-left:18rem}.ml-8{margin-left:2rem}.ml-80{margin-left:20rem}.ml-9{margin-left:2.25rem}.ml-96{margin-left:24rem}.mr-0{margin-right:0}.mr-1{margin-right:.25rem}.mr-10{margin-right:2.5rem}.mr-11{margin-right:2.75rem}.mr-12{margin-right:3rem}.mr-14{margin-right:3.5rem}.mr-16{margin-right:4rem}.mr-2{margin-right:.5rem}.mr-20{margin-right:5rem}.mr-24{margin-right:6rem}.mr-28{margin-right:7rem}.mr-3{margin-right:.75rem}.mr-32{margin-right:8rem}.mr-36{margin-right:9rem}.mr-4{margin-right:1rem}.mr-44{margin-right:11rem}.mr-48{margin-right:12rem}.mr-5{margin-right:1.25rem}.mr-52{margin-right:13rem}.mr-56{margin-right:14rem}.mr-6{margin-right:1.5rem}.mr-60{margin-right:15rem}.mr-64{margin-right:16rem}.mr-7{margin-right:1.75rem}.mr-72{margin-right:18rem}.mr-8{margin-right:2rem}.mr-80{margin-right:20rem}.mr-9{margin-right:2.25rem}.mr-96{margin-right:24rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-11{margin-top:2.75rem}.mt-12{margin-top:3rem}.mt-14{margin-top:3.5rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-24{margin-top:6rem}.mt-28{margin-top:7rem}.mt-3{margin-top:.75rem}.mt-32{margin-top:8rem}.mt-36{margin-top:9rem}.mt-4{margin-top:1rem}.mt-44{margin-top:11rem}.mt-48{margin-top:12rem}.mt-5{margin-top:1.25rem}.mt-52{margin-top:13rem}.mt-56{margin-top:14rem}.mt-6{margin-top:1.5rem}.mt-60{margin-top:15rem}.mt-64{margin-top:16rem}.mt-7{margin-top:1.75rem}.mt-72{margin-top:18rem}.mt-8{margin-top:2rem}.mt-80{margin-top:20rem}.mt-9{margin-top:2.25rem}.mt-96{margin-top:24rem}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-8{height:2rem}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-text{cursor:text}.flex-col{flex-direction:column}.justify-center{justify-content:center}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-border-dark{--tw-border-opacity: 1;border-color:var(--av-border-dark, rgb(15 23 42 / var(--tw-border-opacity, 1)))}.border-border-error-dark{--tw-border-opacity: 1;border-color:var(--av-border-error-dark, rgb(185 28 28 / var(--tw-border-opacity, 1)))}.border-transparent{border-color:transparent}.bg-surface-darker{--tw-bg-opacity: 1;background-color:var(--av-surface-darker, rgb(15 23 42 / var(--tw-bg-opacity, 1)))}.bg-surface-lighter{--tw-bg-opacity: 1;background-color:var(--av-surface-lighter, rgb(226 232 240 / var(--tw-bg-opacity, 1)))}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.text-base{font-size:1rem;line-height:1.5rem}.font-medium{font-weight:500}.text-copy-dark{--tw-text-opacity: 1;color:var(--av-copy-dark, rgb(15 23 42 / var(--tw-text-opacity, 1)))}.text-copy-error-dark{--tw-text-opacity: 1;color:var(--av-copy-error-dark, rgb(185 28 28 / var(--tw-text-opacity, 1)))}.text-copy-error-light{--tw-text-opacity: 1;color:var(--av-copy-error-light, rgb(239 68 68 / var(--tw-text-opacity, 1)))}.text-copy-lighter{--tw-text-opacity: 1;color:var(--av-copy-lighter, rgb(255 255 255 / var(--tw-text-opacity, 1)))}.caret-copy-dark{caret-color:var(--av-copy-dark, rgb(15 23 42 / 1))}.caret-copy-light{caret-color:var(--av-copy-light, rgb(226 232 240 / 1))}.opacity-50{opacity:.5}.outline-focus-dark{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.outline-focus-light{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-border-dark:focus{--tw-border-opacity: 1;border-color:var(--av-border-dark, rgb(15 23 42 / var(--tw-border-opacity, 1)))}.focus\:outline:focus{outline-style:solid}.focus\:outline-2:focus{outline-width:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:outline-focus-dark:focus{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.focus\:outline-focus-light:focus{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (prefers-color-scheme: dark){.dark\:bg-surface-darker{--tw-bg-opacity: 1;background-color:var(--av-surface-darker, rgb(15 23 42 / var(--tw-bg-opacity, 1)))}.dark\:bg-surface-lighter{--tw-bg-opacity: 1;background-color:var(--av-surface-lighter, rgb(226 232 240 / var(--tw-bg-opacity, 1)))}.dark\:text-copy-dark{--tw-text-opacity: 1;color:var(--av-copy-dark, rgb(15 23 42 / var(--tw-text-opacity, 1)))}.dark\:text-copy-error-dark{--tw-text-opacity: 1;color:var(--av-copy-error-dark, rgb(185 28 28 / var(--tw-text-opacity, 1)))}.dark\:text-copy-error-light{--tw-text-opacity: 1;color:var(--av-copy-error-light, rgb(239 68 68 / var(--tw-text-opacity, 1)))}.dark\:text-copy-lighter{--tw-text-opacity: 1;color:var(--av-copy-lighter, rgb(255 255 255 / var(--tw-text-opacity, 1)))}.dark\:caret-copy-dark{caret-color:var(--av-copy-dark, rgb(15 23 42 / 1))}.dark\:caret-copy-light{caret-color:var(--av-copy-light, rgb(226 232 240 / 1))}.dark\:focus\:outline-focus-dark:focus{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.dark\:focus\:outline-focus-light:focus{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}}
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::-ms-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-ms-input-placeholder,textarea::-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.av-text-input-wrapper label[aria-hidden=true]{transform:translate(12px) scale(1);transform-origin:top left;transition:var(--av-text-input-wrapper-transition, all .2s ease-out)}.av-text-input:focus+label[aria-hidden=true],.av-text-input:not(:placeholder-shown)+label[aria-hidden=true]{transform:translate(12px,var(--av-text-input-label, -33px)) scale(.75)}.av-text-input-helper-text{transform:translate(12px,var(--av-text-input-helper-text, 38px)) scale(.75);transform-origin:top left}@keyframes blink{50%{fill:transparent}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.right-3{right:.75rem}.mr-2{margin-right:.5rem}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-8{height:2rem}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-text{cursor:text}.flex-col{flex-direction:column}.justify-center{justify-content:center}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-border-dark{--tw-border-opacity: 1;border-color:var(--av-border-dark, rgb(15 23 42 / var(--tw-border-opacity, 1)))}.border-border-error-dark{--tw-border-opacity: 1;border-color:var(--av-border-error-dark, rgb(185 28 28 / var(--tw-border-opacity, 1)))}.border-transparent{border-color:transparent}.bg-surface-darker{--tw-bg-opacity: 1;background-color:var(--av-surface-darker, rgb(15 23 42 / var(--tw-bg-opacity, 1)))}.bg-surface-lighter{--tw-bg-opacity: 1;background-color:var(--av-surface-lighter, rgb(226 232 240 / var(--tw-bg-opacity, 1)))}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.text-base{font-size:1rem;line-height:1.5rem}.font-medium{font-weight:500}.text-copy-dark{--tw-text-opacity: 1;color:var(--av-copy-dark, rgb(15 23 42 / var(--tw-text-opacity, 1)))}.text-copy-error-dark{--tw-text-opacity: 1;color:var(--av-copy-error-dark, rgb(185 28 28 / var(--tw-text-opacity, 1)))}.text-copy-error-light{--tw-text-opacity: 1;color:var(--av-copy-error-light, rgb(239 68 68 / var(--tw-text-opacity, 1)))}.text-copy-lighter{--tw-text-opacity: 1;color:var(--av-copy-lighter, rgb(255 255 255 / var(--tw-text-opacity, 1)))}.caret-copy-dark{caret-color:var(--av-copy-dark, rgb(15 23 42 / 1))}.caret-copy-light{caret-color:var(--av-copy-light, rgb(226 232 240 / 1))}.opacity-50{opacity:.5}.outline-focus-dark{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.outline-focus-light{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-border-dark:focus{--tw-border-opacity: 1;border-color:var(--av-border-dark, rgb(15 23 42 / var(--tw-border-opacity, 1)))}.focus\:outline:focus{outline-style:solid}.focus\:outline-2:focus{outline-width:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:outline-focus-dark:focus{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.focus\:outline-focus-light:focus{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (prefers-color-scheme: dark){.dark\:bg-surface-darker{--tw-bg-opacity: 1;background-color:var(--av-surface-darker, rgb(15 23 42 / var(--tw-bg-opacity, 1)))}.dark\:bg-surface-lighter{--tw-bg-opacity: 1;background-color:var(--av-surface-lighter, rgb(226 232 240 / var(--tw-bg-opacity, 1)))}.dark\:text-copy-dark{--tw-text-opacity: 1;color:var(--av-copy-dark, rgb(15 23 42 / var(--tw-text-opacity, 1)))}.dark\:text-copy-error-dark{--tw-text-opacity: 1;color:var(--av-copy-error-dark, rgb(185 28 28 / var(--tw-text-opacity, 1)))}.dark\:text-copy-error-light{--tw-text-opacity: 1;color:var(--av-copy-error-light, rgb(239 68 68 / var(--tw-text-opacity, 1)))}.dark\:text-copy-lighter{--tw-text-opacity: 1;color:var(--av-copy-lighter, rgb(255 255 255 / var(--tw-text-opacity, 1)))}.dark\:caret-copy-dark{caret-color:var(--av-copy-dark, rgb(15 23 42 / 1))}.dark\:caret-copy-light{caret-color:var(--av-copy-light, rgb(226 232 240 / 1))}.dark\:focus\:outline-focus-dark:focus{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.dark\:focus\:outline-focus-light:focus{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-textinput",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -40,14 +40,13 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@tailwindcss/typography": "0.5.15",
|
|
42
42
|
"@versini/ui-hooks": "4.3.0",
|
|
43
|
-
"@versini/ui-liveregion": "1.2.
|
|
44
|
-
"@versini/ui-
|
|
45
|
-
"@versini/ui-types": "1.1.0",
|
|
43
|
+
"@versini/ui-liveregion": "1.2.3",
|
|
44
|
+
"@versini/ui-types": "2.1.0",
|
|
46
45
|
"clsx": "2.1.1",
|
|
47
46
|
"tailwindcss": "3.4.17"
|
|
48
47
|
},
|
|
49
48
|
"sideEffects": [
|
|
50
49
|
"**/*.css"
|
|
51
50
|
],
|
|
52
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "1221c66705bd1e8a31981a21a9566c8db647ab5c"
|
|
53
52
|
}
|
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
import { jsx as m, jsxs as z } from "react/jsx-runtime";
|
|
2
|
-
import W, { useRef as y, useEffect as R, useCallback as J, useState as L, useMemo as K, useId as Q, useReducer as Y, useLayoutEffect as $ } from "react";
|
|
3
|
-
import a from "clsx";
|
|
4
|
-
const w = "av-text-input", be = "av-text-input-simple", Z = "av-text-input-wrapper", N = "av-text-input-helper-text";
|
|
5
|
-
function B() {
|
|
6
|
-
const e = y(!1);
|
|
7
|
-
return R(() => (e.current = !0, () => {
|
|
8
|
-
e.current = !1;
|
|
9
|
-
}), []), J(() => e.current, []);
|
|
10
|
-
}
|
|
11
|
-
const ee = {
|
|
12
|
-
x: 0,
|
|
13
|
-
y: 0,
|
|
14
|
-
width: 0,
|
|
15
|
-
height: 0,
|
|
16
|
-
top: 0,
|
|
17
|
-
left: 0,
|
|
18
|
-
bottom: 0,
|
|
19
|
-
right: 0
|
|
20
|
-
};
|
|
21
|
-
function te(e) {
|
|
22
|
-
const r = B(), t = y(0), n = y(null), [l, o] = L(ee), c = K(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((i) => {
|
|
23
|
-
const p = i[0];
|
|
24
|
-
p && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
|
|
25
|
-
n.current && r() && o(p.contentRect);
|
|
26
|
-
}));
|
|
27
|
-
}), [r]);
|
|
28
|
-
return R(() => (n.current && (c == null || c.observe(n.current, e)), () => {
|
|
29
|
-
c == null || c.disconnect(), t.current && cancelAnimationFrame(t.current);
|
|
30
|
-
}), [c, e]), [n, l];
|
|
31
|
-
}
|
|
32
|
-
function re(e) {
|
|
33
|
-
const r = Q();
|
|
34
|
-
if (!e)
|
|
35
|
-
return r;
|
|
36
|
-
if (typeof e == "number" || typeof e == "string")
|
|
37
|
-
return `${e}${r}`;
|
|
38
|
-
if (typeof e == "object") {
|
|
39
|
-
const { id: t, prefix: n = "" } = e;
|
|
40
|
-
return typeof t == "number" || typeof t == "string" ? `${n}${t}` : `${n}${r}`;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const U = "SET_ANNOUNCEMENT", D = "CLEAR_ANNOUNCEMENT", ne = {
|
|
44
|
-
alert: null,
|
|
45
|
-
alertdialog: null,
|
|
46
|
-
log: "polite",
|
|
47
|
-
marquee: null,
|
|
48
|
-
progressbar: null,
|
|
49
|
-
status: "polite",
|
|
50
|
-
timer: "assertive"
|
|
51
|
-
}, le = (e, r) => {
|
|
52
|
-
switch (r == null ? void 0 : r.type) {
|
|
53
|
-
case U:
|
|
54
|
-
return {
|
|
55
|
-
...e,
|
|
56
|
-
announcement: r.payload
|
|
57
|
-
};
|
|
58
|
-
case D:
|
|
59
|
-
return {
|
|
60
|
-
...e,
|
|
61
|
-
announcement: null
|
|
62
|
-
};
|
|
63
|
-
default:
|
|
64
|
-
return e;
|
|
65
|
-
}
|
|
66
|
-
}, ce = ({
|
|
67
|
-
onAnnouncementClear: e,
|
|
68
|
-
dispatch: r
|
|
69
|
-
}) => {
|
|
70
|
-
r({
|
|
71
|
-
type: D
|
|
72
|
-
}), typeof e == "function" && e();
|
|
73
|
-
}, P = ({
|
|
74
|
-
children: e,
|
|
75
|
-
clearAnnouncementDelay: r,
|
|
76
|
-
clearAnnouncementTimeoutRef: t,
|
|
77
|
-
onAnnouncementClear: n,
|
|
78
|
-
dispatch: l
|
|
79
|
-
}) => {
|
|
80
|
-
clearTimeout(t.current), e !== null && l({
|
|
81
|
-
type: U,
|
|
82
|
-
payload: e
|
|
83
|
-
}), r && (t.current = setTimeout(
|
|
84
|
-
() => ce({
|
|
85
|
-
onAnnouncementClear: n,
|
|
86
|
-
dispatch: l
|
|
87
|
-
}),
|
|
88
|
-
r
|
|
89
|
-
));
|
|
90
|
-
}, ae = ({
|
|
91
|
-
children: e,
|
|
92
|
-
announcementTimeoutRef: r,
|
|
93
|
-
announcementDelay: t,
|
|
94
|
-
clearAnnouncementDelay: n,
|
|
95
|
-
clearAnnouncementTimeoutRef: l,
|
|
96
|
-
onAnnouncementClear: o,
|
|
97
|
-
dispatch: c
|
|
98
|
-
}) => {
|
|
99
|
-
clearTimeout(r.current), t ? r.current = setTimeout(P, t, {
|
|
100
|
-
children: e,
|
|
101
|
-
clearAnnouncementDelay: n,
|
|
102
|
-
clearAnnouncementTimeoutRef: l,
|
|
103
|
-
onAnnouncementClear: o,
|
|
104
|
-
dispatch: c
|
|
105
|
-
}) : P({
|
|
106
|
-
children: e,
|
|
107
|
-
clearAnnouncementDelay: n,
|
|
108
|
-
clearAnnouncementTimeoutRef: l,
|
|
109
|
-
onAnnouncementClear: o,
|
|
110
|
-
dispatch: c
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
function oe({
|
|
114
|
-
children: e,
|
|
115
|
-
className: r,
|
|
116
|
-
politeness: t,
|
|
117
|
-
role: n = null,
|
|
118
|
-
announcementDelay: l,
|
|
119
|
-
clearAnnouncementDelay: o,
|
|
120
|
-
onAnnouncementClear: c,
|
|
121
|
-
visible: i,
|
|
122
|
-
...p
|
|
123
|
-
}) {
|
|
124
|
-
const f = y(null), x = y(null), [g, s] = Y(le, {
|
|
125
|
-
announcement: null
|
|
126
|
-
});
|
|
127
|
-
let d = t;
|
|
128
|
-
typeof d > "u" && (d = n ? ne[n] : "assertive"), R(() => {
|
|
129
|
-
ae({
|
|
130
|
-
announcementTimeoutRef: f,
|
|
131
|
-
announcementDelay: l,
|
|
132
|
-
children: e,
|
|
133
|
-
clearAnnouncementDelay: o,
|
|
134
|
-
clearAnnouncementTimeoutRef: x,
|
|
135
|
-
onAnnouncementClear: c,
|
|
136
|
-
dispatch: s
|
|
137
|
-
});
|
|
138
|
-
}, [
|
|
139
|
-
e,
|
|
140
|
-
l,
|
|
141
|
-
o,
|
|
142
|
-
c
|
|
143
|
-
]);
|
|
144
|
-
const u = a(r, {
|
|
145
|
-
"sr-only": !i
|
|
146
|
-
});
|
|
147
|
-
return /* @__PURE__ */ m(
|
|
148
|
-
"div",
|
|
149
|
-
{
|
|
150
|
-
"aria-live": d,
|
|
151
|
-
...n && { role: n },
|
|
152
|
-
className: u,
|
|
153
|
-
...p,
|
|
154
|
-
children: g.announcement
|
|
155
|
-
}
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
/*!
|
|
159
|
-
@versini/ui-liveregion v1.2.1
|
|
160
|
-
© 2024 gizmette.com
|
|
161
|
-
*/
|
|
162
|
-
try {
|
|
163
|
-
window.__VERSINI_UI_LIVEREGION__ || (window.__VERSINI_UI_LIVEREGION__ = {
|
|
164
|
-
version: "1.2.1",
|
|
165
|
-
buildTime: "12/28/2024 05:53 PM EST",
|
|
166
|
-
homepage: "https://github.com/aversini/ui-components",
|
|
167
|
-
license: "MIT"
|
|
168
|
-
});
|
|
169
|
-
} catch {
|
|
170
|
-
}
|
|
171
|
-
/*!
|
|
172
|
-
@versini/ui-spacing v1.1.1
|
|
173
|
-
© 2024 gizmette.com
|
|
174
|
-
*/
|
|
175
|
-
try {
|
|
176
|
-
window.__VERSINI_UI_SPACING__ || (window.__VERSINI_UI_SPACING__ = {
|
|
177
|
-
version: "1.1.1",
|
|
178
|
-
buildTime: "12/28/2024 05:53 PM EST",
|
|
179
|
-
homepage: "https://github.com/aversini/ui-components",
|
|
180
|
-
license: "MIT"
|
|
181
|
-
});
|
|
182
|
-
} catch {
|
|
183
|
-
}
|
|
184
|
-
const se = (e) => {
|
|
185
|
-
let r = "";
|
|
186
|
-
if (typeof e == "number" || typeof e == "string")
|
|
187
|
-
r = "m-" + e;
|
|
188
|
-
else {
|
|
189
|
-
const t = [];
|
|
190
|
-
(e == null ? void 0 : e.t) !== void 0 && t.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && t.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && t.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && t.push(`ml-${e.l}`), r = t.join(" ");
|
|
191
|
-
}
|
|
192
|
-
return r;
|
|
193
|
-
}, ie = ({
|
|
194
|
-
mode: e
|
|
195
|
-
}) => a({
|
|
196
|
-
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
|
197
|
-
"bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
|
|
198
|
-
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
|
|
199
|
-
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
|
|
200
|
-
}), ue = ({
|
|
201
|
-
focusMode: e
|
|
202
|
-
}) => a("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
203
|
-
"focus:outline-focus-dark": e === "dark",
|
|
204
|
-
"focus:outline-focus-light": e === "light",
|
|
205
|
-
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
206
|
-
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
207
|
-
}), pe = ({
|
|
208
|
-
noBorder: e,
|
|
209
|
-
error: r
|
|
210
|
-
}) => a("border-2", {
|
|
211
|
-
"border-border-dark": !e && !r,
|
|
212
|
-
"focus:border-border-dark": !e && r,
|
|
213
|
-
"border-border-error-dark": !e && r,
|
|
214
|
-
"border-transparent": e
|
|
215
|
-
}), de = ({
|
|
216
|
-
disabled: e,
|
|
217
|
-
raw: r,
|
|
218
|
-
error: t,
|
|
219
|
-
mode: n
|
|
220
|
-
}) => {
|
|
221
|
-
if (r)
|
|
222
|
-
return "";
|
|
223
|
-
if (e)
|
|
224
|
-
return a("absolute px-2 cursor-not-allowed opacity-50 font-medium");
|
|
225
|
-
if (!t)
|
|
226
|
-
return a("absolute px-2 cursor-text font-medium", {
|
|
227
|
-
"text-copy-lighter": n === "dark",
|
|
228
|
-
"text-copy-dark": n === "light",
|
|
229
|
-
"text-copy-dark dark:text-copy-lighter": n === "system",
|
|
230
|
-
"text-copy-lighter dark:text-copy-dark": n === "alt-system"
|
|
231
|
-
});
|
|
232
|
-
if (t)
|
|
233
|
-
return a("absolute px-2 cursor-text font-medium", {
|
|
234
|
-
"text-copy-lighter": n === "dark",
|
|
235
|
-
"text-copy-error-dark": n === "light",
|
|
236
|
-
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": n === "system",
|
|
237
|
-
"text-copy-lighter dark:text-copy-error-dark": n === "alt-system"
|
|
238
|
-
});
|
|
239
|
-
}, me = ({
|
|
240
|
-
error: e,
|
|
241
|
-
raw: r,
|
|
242
|
-
mode: t,
|
|
243
|
-
disabled: n
|
|
244
|
-
}) => {
|
|
245
|
-
if (r)
|
|
246
|
-
return "";
|
|
247
|
-
if (n)
|
|
248
|
-
return a(
|
|
249
|
-
N,
|
|
250
|
-
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
251
|
-
);
|
|
252
|
-
if (!e)
|
|
253
|
-
return a(N, "absolute px-2 font-medium", {
|
|
254
|
-
"text-copy-lighter": t === "dark",
|
|
255
|
-
"text-copy-dark": t === "light",
|
|
256
|
-
"text-copy-dark dark:text-copy-lighter": t === "system",
|
|
257
|
-
"text-copy-lighter dark:text-copy-dark": t === "alt-system"
|
|
258
|
-
});
|
|
259
|
-
if (e)
|
|
260
|
-
return a(N, "absolute px-2 font-medium", {
|
|
261
|
-
"text-copy-error-light bg-surface-darker": t === "dark",
|
|
262
|
-
"text-copy-error-dark": t === "light",
|
|
263
|
-
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": t === "system",
|
|
264
|
-
"dark:text-copy-error-dark text-copy-error-light bg-surface-darker": t === "alt-system"
|
|
265
|
-
});
|
|
266
|
-
}, ye = ({
|
|
267
|
-
className: e,
|
|
268
|
-
inputClassName: r,
|
|
269
|
-
raw: t,
|
|
270
|
-
disabled: n,
|
|
271
|
-
noBorder: l,
|
|
272
|
-
error: o,
|
|
273
|
-
spacing: c,
|
|
274
|
-
mode: i,
|
|
275
|
-
focusMode: p,
|
|
276
|
-
size: f,
|
|
277
|
-
rightElementClassName: x
|
|
278
|
-
}) => {
|
|
279
|
-
const g = t ? e : a(
|
|
280
|
-
"relative flex w-full flex-col justify-center",
|
|
281
|
-
Z,
|
|
282
|
-
e,
|
|
283
|
-
se(c)
|
|
284
|
-
);
|
|
285
|
-
let s = "";
|
|
286
|
-
switch (f) {
|
|
287
|
-
case "xs":
|
|
288
|
-
s = "h-8";
|
|
289
|
-
break;
|
|
290
|
-
case "sm":
|
|
291
|
-
s = "h-10";
|
|
292
|
-
break;
|
|
293
|
-
case "lg":
|
|
294
|
-
s = "h-14";
|
|
295
|
-
break;
|
|
296
|
-
case "xl":
|
|
297
|
-
s = "h-16";
|
|
298
|
-
break;
|
|
299
|
-
default:
|
|
300
|
-
s = "h-12";
|
|
301
|
-
break;
|
|
302
|
-
}
|
|
303
|
-
const d = t ? a(r) : a(
|
|
304
|
-
w,
|
|
305
|
-
r,
|
|
306
|
-
s,
|
|
307
|
-
"rounded-md text-base px-4",
|
|
308
|
-
ie({ mode: i }),
|
|
309
|
-
ue({ focusMode: p }),
|
|
310
|
-
pe({ noBorder: l, error: o }),
|
|
311
|
-
{
|
|
312
|
-
"disabled:cursor-not-allowed disabled:opacity-50": n
|
|
313
|
-
}
|
|
314
|
-
), u = t ? void 0 : "sr-only", b = de({
|
|
315
|
-
disabled: n,
|
|
316
|
-
raw: t,
|
|
317
|
-
error: o,
|
|
318
|
-
mode: i
|
|
319
|
-
}), A = me({
|
|
320
|
-
error: o,
|
|
321
|
-
raw: t,
|
|
322
|
-
mode: i,
|
|
323
|
-
disabled: n
|
|
324
|
-
}), I = t ? void 0 : a("absolute right-3", x);
|
|
325
|
-
return {
|
|
326
|
-
wrapper: g,
|
|
327
|
-
input: d,
|
|
328
|
-
accessibleLabel: u,
|
|
329
|
-
visibleLabel: b,
|
|
330
|
-
helperText: A,
|
|
331
|
-
rightElement: I
|
|
332
|
-
};
|
|
333
|
-
}, fe = W.forwardRef(
|
|
334
|
-
({
|
|
335
|
-
id: e,
|
|
336
|
-
name: r,
|
|
337
|
-
label: t,
|
|
338
|
-
error: n = !1,
|
|
339
|
-
raw: l = !1,
|
|
340
|
-
className: o,
|
|
341
|
-
inputClassName: c,
|
|
342
|
-
mode: i = "system",
|
|
343
|
-
focusMode: p = "system",
|
|
344
|
-
disabled: f = !1,
|
|
345
|
-
noBorder: x = !1,
|
|
346
|
-
labelId: g,
|
|
347
|
-
labelHidden: s = !1,
|
|
348
|
-
type: d = "text",
|
|
349
|
-
helperText: u = "",
|
|
350
|
-
rightElement: b,
|
|
351
|
-
rightElementClassName: A,
|
|
352
|
-
spacing: I,
|
|
353
|
-
size: E = "md",
|
|
354
|
-
...M
|
|
355
|
-
}, F) => {
|
|
356
|
-
const [O, T] = te(), [V, j] = L(0), k = re({ id: e, prefix: `${w}-` }), X = `${r} error, ${u}`, v = y(null), _ = y(null), G = {
|
|
357
|
-
xs: { label: "-25px", helperText: "30px" },
|
|
358
|
-
sm: { label: "-29px", helperText: "34px" },
|
|
359
|
-
md: { label: "-33px", helperText: "38px" },
|
|
360
|
-
lg: { label: "-15px", helperText: "22px" },
|
|
361
|
-
xl: { label: "-19px", helperText: "25px" }
|
|
362
|
-
}, h = ye({
|
|
363
|
-
className: o,
|
|
364
|
-
inputClassName: c,
|
|
365
|
-
error: n,
|
|
366
|
-
raw: l,
|
|
367
|
-
focusMode: p,
|
|
368
|
-
disabled: f,
|
|
369
|
-
noBorder: x,
|
|
370
|
-
spacing: I,
|
|
371
|
-
mode: i,
|
|
372
|
-
size: E,
|
|
373
|
-
rightElementClassName: A
|
|
374
|
-
});
|
|
375
|
-
return $(() => {
|
|
376
|
-
T && T.width && j(T.width + 18 + 10);
|
|
377
|
-
}, [T]), $(() => {
|
|
378
|
-
var C, S;
|
|
379
|
-
const { label: q, helperText: H } = G[E];
|
|
380
|
-
(C = v == null ? void 0 : v.current) == null || C.style.setProperty("--av-text-input-label", q), (S = _ == null ? void 0 : _.current) == null || S.style.setProperty(
|
|
381
|
-
"--av-text-input-helper-text",
|
|
382
|
-
H
|
|
383
|
-
);
|
|
384
|
-
}, [E]), /* @__PURE__ */ z("div", { className: h.wrapper, children: [
|
|
385
|
-
/* @__PURE__ */ m(
|
|
386
|
-
"label",
|
|
387
|
-
{
|
|
388
|
-
htmlFor: k,
|
|
389
|
-
id: g,
|
|
390
|
-
className: h.accessibleLabel,
|
|
391
|
-
children: t
|
|
392
|
-
}
|
|
393
|
-
),
|
|
394
|
-
/* @__PURE__ */ m(
|
|
395
|
-
"input",
|
|
396
|
-
{
|
|
397
|
-
ref: F,
|
|
398
|
-
id: k,
|
|
399
|
-
name: r,
|
|
400
|
-
type: d,
|
|
401
|
-
disabled: f,
|
|
402
|
-
placeholder: l ? void 0 : " ",
|
|
403
|
-
className: h.input,
|
|
404
|
-
...u && { "aria-describedby": `${k}-helper` },
|
|
405
|
-
...n && { "aria-invalid": "true" },
|
|
406
|
-
...b && !l && { style: { paddingRight: V } },
|
|
407
|
-
...M
|
|
408
|
-
}
|
|
409
|
-
),
|
|
410
|
-
!l && !s && /* @__PURE__ */ m(
|
|
411
|
-
"label",
|
|
412
|
-
{
|
|
413
|
-
ref: v,
|
|
414
|
-
"aria-hidden": !0,
|
|
415
|
-
htmlFor: k,
|
|
416
|
-
className: h.visibleLabel,
|
|
417
|
-
children: t
|
|
418
|
-
}
|
|
419
|
-
),
|
|
420
|
-
u && /* @__PURE__ */ m(
|
|
421
|
-
"div",
|
|
422
|
-
{
|
|
423
|
-
ref: _,
|
|
424
|
-
id: `${k}-helper`,
|
|
425
|
-
className: h.helperText,
|
|
426
|
-
children: u
|
|
427
|
-
}
|
|
428
|
-
),
|
|
429
|
-
b && /* @__PURE__ */ m(
|
|
430
|
-
"div",
|
|
431
|
-
{
|
|
432
|
-
ref: O,
|
|
433
|
-
className: h.rightElement,
|
|
434
|
-
children: b
|
|
435
|
-
}
|
|
436
|
-
),
|
|
437
|
-
n && u && /* @__PURE__ */ m(oe, { politeness: "polite", clearAnnouncementDelay: 500, children: X })
|
|
438
|
-
] });
|
|
439
|
-
}
|
|
440
|
-
);
|
|
441
|
-
fe.displayName = "TextInput";
|
|
442
|
-
export {
|
|
443
|
-
w as TEXT_INPUT_CLASSNAME,
|
|
444
|
-
N as TEXT_INPUT_HELPER_TEXT_CLASSNAME,
|
|
445
|
-
be as TEXT_INPUT_SIMPLE_CLASSNAME,
|
|
446
|
-
Z as TEXT_INPUT_WRAPPER_CLASSNAME,
|
|
447
|
-
fe as TextInput,
|
|
448
|
-
oe as x
|
|
449
|
-
};
|