@versini/ui-textinput 1.5.0 → 1.6.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,7 +1,7 @@
|
|
|
1
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
|
|
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
3
|
import a from "clsx";
|
|
4
|
-
const
|
|
4
|
+
const w = "av-text-input", be = "av-text-input-simple", Z = "av-text-input-wrapper", N = "av-text-input-helper-text";
|
|
5
5
|
function B() {
|
|
6
6
|
const e = y(!1);
|
|
7
7
|
return R(() => (e.current = !0, () => {
|
|
@@ -19,7 +19,7 @@ const ee = {
|
|
|
19
19
|
right: 0
|
|
20
20
|
};
|
|
21
21
|
function te(e) {
|
|
22
|
-
const r = B(), t = y(0), n = y(null), [l, o] =
|
|
22
|
+
const r = B(), t = y(0), n = y(null), [l, o] = L(ee), c = K(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((i) => {
|
|
23
23
|
const p = i[0];
|
|
24
24
|
p && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
|
|
25
25
|
n.current && r() && o(p.contentRect);
|
|
@@ -70,7 +70,7 @@ const U = "SET_ANNOUNCEMENT", D = "CLEAR_ANNOUNCEMENT", ne = {
|
|
|
70
70
|
r({
|
|
71
71
|
type: D
|
|
72
72
|
}), typeof e == "function" && e();
|
|
73
|
-
},
|
|
73
|
+
}, P = ({
|
|
74
74
|
children: e,
|
|
75
75
|
clearAnnouncementDelay: r,
|
|
76
76
|
clearAnnouncementTimeoutRef: t,
|
|
@@ -96,13 +96,13 @@ const U = "SET_ANNOUNCEMENT", D = "CLEAR_ANNOUNCEMENT", ne = {
|
|
|
96
96
|
onAnnouncementClear: o,
|
|
97
97
|
dispatch: c
|
|
98
98
|
}) => {
|
|
99
|
-
clearTimeout(r.current), t ? r.current = setTimeout(
|
|
99
|
+
clearTimeout(r.current), t ? r.current = setTimeout(P, t, {
|
|
100
100
|
children: e,
|
|
101
101
|
clearAnnouncementDelay: n,
|
|
102
102
|
clearAnnouncementTimeoutRef: l,
|
|
103
103
|
onAnnouncementClear: o,
|
|
104
104
|
dispatch: c
|
|
105
|
-
}) :
|
|
105
|
+
}) : P({
|
|
106
106
|
children: e,
|
|
107
107
|
clearAnnouncementDelay: n,
|
|
108
108
|
clearAnnouncementTimeoutRef: l,
|
|
@@ -156,26 +156,26 @@ function oe({
|
|
|
156
156
|
);
|
|
157
157
|
}
|
|
158
158
|
/*!
|
|
159
|
-
@versini/ui-liveregion v1.
|
|
159
|
+
@versini/ui-liveregion v1.2.0
|
|
160
160
|
© 2024 gizmette.com
|
|
161
161
|
*/
|
|
162
162
|
try {
|
|
163
163
|
window.__VERSINI_UI_LIVEREGION__ || (window.__VERSINI_UI_LIVEREGION__ = {
|
|
164
|
-
version: "1.
|
|
165
|
-
buildTime: "12/
|
|
164
|
+
version: "1.2.0",
|
|
165
|
+
buildTime: "12/26/2024 06:05 PM EST",
|
|
166
166
|
homepage: "https://github.com/aversini/ui-components",
|
|
167
167
|
license: "MIT"
|
|
168
168
|
});
|
|
169
169
|
} catch {
|
|
170
170
|
}
|
|
171
171
|
/*!
|
|
172
|
-
@versini/ui-spacing v1.
|
|
172
|
+
@versini/ui-spacing v1.1.0
|
|
173
173
|
© 2024 gizmette.com
|
|
174
174
|
*/
|
|
175
175
|
try {
|
|
176
176
|
window.__VERSINI_UI_SPACING__ || (window.__VERSINI_UI_SPACING__ = {
|
|
177
|
-
version: "1.
|
|
178
|
-
buildTime: "12/
|
|
177
|
+
version: "1.1.0",
|
|
178
|
+
buildTime: "12/26/2024 06:05 PM EST",
|
|
179
179
|
homepage: "https://github.com/aversini/ui-components",
|
|
180
180
|
license: "MIT"
|
|
181
181
|
});
|
|
@@ -301,7 +301,7 @@ const se = (e) => {
|
|
|
301
301
|
break;
|
|
302
302
|
}
|
|
303
303
|
const d = t ? a(r) : a(
|
|
304
|
-
|
|
304
|
+
w,
|
|
305
305
|
r,
|
|
306
306
|
s,
|
|
307
307
|
"rounded-md text-base px-4",
|
|
@@ -316,7 +316,7 @@ const se = (e) => {
|
|
|
316
316
|
raw: t,
|
|
317
317
|
error: o,
|
|
318
318
|
mode: i
|
|
319
|
-
}),
|
|
319
|
+
}), A = me({
|
|
320
320
|
error: o,
|
|
321
321
|
raw: t,
|
|
322
322
|
mode: i,
|
|
@@ -327,7 +327,7 @@ const se = (e) => {
|
|
|
327
327
|
input: d,
|
|
328
328
|
accessibleLabel: u,
|
|
329
329
|
visibleLabel: b,
|
|
330
|
-
helperText:
|
|
330
|
+
helperText: A,
|
|
331
331
|
rightElement: I
|
|
332
332
|
};
|
|
333
333
|
}, fe = W.forwardRef(
|
|
@@ -348,12 +348,12 @@ const se = (e) => {
|
|
|
348
348
|
type: d = "text",
|
|
349
349
|
helperText: u = "",
|
|
350
350
|
rightElement: b,
|
|
351
|
-
rightElementClassName:
|
|
351
|
+
rightElementClassName: A,
|
|
352
352
|
spacing: I,
|
|
353
353
|
size: E = "md",
|
|
354
354
|
...M
|
|
355
355
|
}, F) => {
|
|
356
|
-
const [O, T] = te(), [V, j] =
|
|
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
357
|
xs: { label: "-25px", helperText: "30px" },
|
|
358
358
|
sm: { label: "-29px", helperText: "34px" },
|
|
359
359
|
md: { label: "-33px", helperText: "38px" },
|
|
@@ -370,14 +370,14 @@ const se = (e) => {
|
|
|
370
370
|
spacing: I,
|
|
371
371
|
mode: i,
|
|
372
372
|
size: E,
|
|
373
|
-
rightElementClassName:
|
|
373
|
+
rightElementClassName: A
|
|
374
374
|
});
|
|
375
375
|
return $(() => {
|
|
376
376
|
T && T.width && j(T.width + 18 + 10);
|
|
377
377
|
}, [T]), $(() => {
|
|
378
378
|
var C, S;
|
|
379
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 =
|
|
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
381
|
"--av-text-input-helper-text",
|
|
382
382
|
H
|
|
383
383
|
);
|
|
@@ -420,7 +420,7 @@ const se = (e) => {
|
|
|
420
420
|
u && /* @__PURE__ */ m(
|
|
421
421
|
"div",
|
|
422
422
|
{
|
|
423
|
-
ref:
|
|
423
|
+
ref: _,
|
|
424
424
|
id: `${k}-helper`,
|
|
425
425
|
className: h.helperText,
|
|
426
426
|
children: u
|
|
@@ -440,7 +440,7 @@ const se = (e) => {
|
|
|
440
440
|
);
|
|
441
441
|
fe.displayName = "TextInput";
|
|
442
442
|
export {
|
|
443
|
-
|
|
443
|
+
w as TEXT_INPUT_CLASSNAME,
|
|
444
444
|
N as TEXT_INPUT_HELPER_TEXT_CLASSNAME,
|
|
445
445
|
be as TEXT_INPUT_SIMPLE_CLASSNAME,
|
|
446
446
|
Z as TEXT_INPUT_WRAPPER_CLASSNAME,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextInput as H, x as L } from "../../chunks/TextInput.
|
|
1
|
+
import { TextInput as H, x as L } from "../../chunks/TextInput.B-kPw6-N.js";
|
|
2
2
|
import { jsxs as B, Fragment as j, jsx as x } from "react/jsx-runtime";
|
|
3
3
|
import A, { useMemo as b, useState as _, useRef as m, useEffect as $ } from "react";
|
|
4
4
|
function q(r) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _versini_ui_types from '@versini/ui-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
declare const TEXT_INPUT_CLASSNAME = "av-text-input";
|
|
@@ -24,7 +24,7 @@ declare const TextInput: React.ForwardRefExoticComponent<{
|
|
|
24
24
|
noBorder?: boolean;
|
|
25
25
|
raw?: boolean;
|
|
26
26
|
size?: Size;
|
|
27
|
-
} &
|
|
27
|
+
} & _versini_ui_types.SpacingTypes.Props & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
28
28
|
|
|
29
29
|
declare const TextInputMask: React.ForwardRefExoticComponent<{
|
|
30
30
|
rightElement: React.ReactElement;
|
|
@@ -43,6 +43,6 @@ declare const TextInputMask: React.ForwardRefExoticComponent<{
|
|
|
43
43
|
noBorder?: boolean;
|
|
44
44
|
raw?: boolean;
|
|
45
45
|
size?: Size;
|
|
46
|
-
} &
|
|
46
|
+
} & _versini_ui_types.SpacingTypes.Props & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
47
47
|
|
|
48
48
|
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.B-kPw6-N.js";
|
|
2
2
|
import { TextInputMask as i } from "./components/TextInput/TextInputMask.js";
|
|
3
3
|
/*!
|
|
4
|
-
@versini/ui-textinput v1.
|
|
4
|
+
@versini/ui-textinput v1.6.0
|
|
5
5
|
© 2024 gizmette.com
|
|
6
6
|
*/
|
|
7
7
|
try {
|
|
8
8
|
window.__VERSINI_UI_TEXTINPUT__ || (window.__VERSINI_UI_TEXTINPUT__ = {
|
|
9
|
-
version: "1.
|
|
10
|
-
buildTime: "12/
|
|
9
|
+
version: "1.6.0",
|
|
10
|
+
buildTime: "12/26/2024 06:05 PM EST",
|
|
11
11
|
homepage: "https://github.com/aversini/ui-components",
|
|
12
12
|
license: "MIT"
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-textinput",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@tailwindcss/typography": "0.5.15",
|
|
42
42
|
"@versini/ui-hooks": "4.3.0",
|
|
43
|
-
"@versini/ui-liveregion": "1.
|
|
44
|
-
"@versini/ui-spacing": "1.
|
|
45
|
-
"@versini/ui-
|
|
43
|
+
"@versini/ui-liveregion": "1.2.0",
|
|
44
|
+
"@versini/ui-spacing": "1.1.0",
|
|
45
|
+
"@versini/ui-types": "1.0.0",
|
|
46
46
|
"clsx": "2.1.1",
|
|
47
47
|
"tailwindcss": "3.4.17"
|
|
48
48
|
},
|
|
49
49
|
"sideEffects": [
|
|
50
50
|
"**/*.css"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "abbb7b1770a9130157721d514fe20267fd15f35e"
|
|
53
53
|
}
|