@versini/ui-textinput 5.1.8 → 6.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/index.js +17 -10
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-textinput
|
|
2
|
+
@versini/ui-textinput v6.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_TEXTINPUT__) {
|
|
7
7
|
window.__VERSINI_UI_TEXTINPUT__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "6.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:20 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-textinput",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -16,10 +16,12 @@ try {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
import {
|
|
19
|
+
import { useResizeObserver } from "@versini/ui-hooks/use-resize-observer";
|
|
20
|
+
import { useUniqueId } from "@versini/ui-hooks/use-unique-id";
|
|
20
21
|
import { LiveRegion } from "@versini/ui-liveregion";
|
|
21
22
|
import react, { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
22
23
|
import clsx from "clsx";
|
|
24
|
+
import { useMergeRefs } from "@versini/ui-hooks/use-merge-refs";
|
|
23
25
|
|
|
24
26
|
;// CONCATENATED MODULE: ./src/common/constants.ts
|
|
25
27
|
const TEXT_INPUT_CLASSNAME = "av-text-input";
|
|
@@ -29,7 +31,9 @@ const TEXT_INPUT_HELPER_TEXT_CLASSNAME = "av-text-input-helper-text";
|
|
|
29
31
|
|
|
30
32
|
;// CONCATENATED MODULE: external "react/jsx-runtime"
|
|
31
33
|
|
|
32
|
-
;// CONCATENATED MODULE: external "@versini/ui-hooks"
|
|
34
|
+
;// CONCATENATED MODULE: external "@versini/ui-hooks/use-resize-observer"
|
|
35
|
+
|
|
36
|
+
;// CONCATENATED MODULE: external "@versini/ui-hooks/use-unique-id"
|
|
33
37
|
|
|
34
38
|
;// CONCATENATED MODULE: external "@versini/ui-liveregion"
|
|
35
39
|
|
|
@@ -49,7 +53,7 @@ const getTextInputColorClasses = ({ mode })=>{
|
|
|
49
53
|
});
|
|
50
54
|
};
|
|
51
55
|
const getTextInputFocusClasses = ({ focusMode })=>{
|
|
52
|
-
return clsx("focus:outline
|
|
56
|
+
return clsx("focus:outline-2 focus:outline-offset-2", {
|
|
53
57
|
"focus:outline-focus-dark": focusMode === "dark",
|
|
54
58
|
"focus:outline-focus-light": focusMode === "light",
|
|
55
59
|
"focus:outline-focus-light dark:focus:outline-focus-dark": focusMode === "alt-system",
|
|
@@ -79,7 +83,7 @@ const getTextInputLabelClasses = ({ disabled, raw, error, mode })=>{
|
|
|
79
83
|
"text-copy-lighter dark:text-copy-dark": mode === "alt-system"
|
|
80
84
|
});
|
|
81
85
|
}
|
|
82
|
-
if (error) {
|
|
86
|
+
/* v8 ignore start - error state edge case */ if (error) {
|
|
83
87
|
return clsx("absolute px-2 cursor-text font-medium", {
|
|
84
88
|
"text-copy-lighter": mode === "dark",
|
|
85
89
|
"text-copy-error-dark": mode === "light",
|
|
@@ -87,7 +91,7 @@ const getTextInputLabelClasses = ({ disabled, raw, error, mode })=>{
|
|
|
87
91
|
"text-copy-lighter dark:text-copy-error-dark": mode === "alt-system"
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
|
-
};
|
|
94
|
+
/* v8 ignore stop */ };
|
|
91
95
|
const getTextInputHelperTextClasses = ({ error, raw, mode, disabled })=>{
|
|
92
96
|
if (raw) {
|
|
93
97
|
return "";
|
|
@@ -103,7 +107,7 @@ const getTextInputHelperTextClasses = ({ error, raw, mode, disabled })=>{
|
|
|
103
107
|
"text-copy-lighter dark:text-copy-dark": mode === "alt-system"
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
|
-
if (error) {
|
|
110
|
+
/* v8 ignore start - error state edge case */ if (error) {
|
|
107
111
|
return clsx(TEXT_INPUT_HELPER_TEXT_CLASSNAME, "absolute px-2 font-medium", {
|
|
108
112
|
"text-copy-error-light bg-surface-darker": mode === "dark",
|
|
109
113
|
"text-copy-error-dark": mode === "light",
|
|
@@ -111,7 +115,7 @@ const getTextInputHelperTextClasses = ({ error, raw, mode, disabled })=>{
|
|
|
111
115
|
"dark:text-copy-error-dark text-copy-error-light bg-surface-darker": mode === "alt-system"
|
|
112
116
|
});
|
|
113
117
|
}
|
|
114
|
-
};
|
|
118
|
+
/* v8 ignore stop */ };
|
|
115
119
|
const getTextInputClasses = ({ className, inputClassName, raw, disabled, noBorder, error, mode, focusMode, size, rightElementClassName })=>{
|
|
116
120
|
const wrapper = raw ? className : clsx("relative flex w-full flex-col justify-center", TEXT_INPUT_WRAPPER_CLASSNAME, className);
|
|
117
121
|
let heightClass = "";
|
|
@@ -173,6 +177,7 @@ const getTextInputClasses = ({ className, inputClassName, raw, disabled, noBorde
|
|
|
173
177
|
|
|
174
178
|
|
|
175
179
|
|
|
180
|
+
|
|
176
181
|
const TextInput = /*#__PURE__*/ react.forwardRef(({ id, name, label, error = false, raw = false, className, inputClassName, mode = "system", focusMode = "system", disabled = false, noBorder = false, labelId, labelHidden = false, type = "text", helperText = "", rightElement, rightElementClassName, size = "md", ...extraProps }, ref)=>{
|
|
177
182
|
const [rightElementRef, rect] = useResizeObserver();
|
|
178
183
|
const [inputPaddingRight, setInputPaddingRight] = useState(0);
|
|
@@ -298,6 +303,8 @@ const TextInput = /*#__PURE__*/ react.forwardRef(({ id, name, label, error = fal
|
|
|
298
303
|
});
|
|
299
304
|
TextInput.displayName = "TextInput";
|
|
300
305
|
|
|
306
|
+
;// CONCATENATED MODULE: external "@versini/ui-hooks/use-merge-refs"
|
|
307
|
+
|
|
301
308
|
;// CONCATENATED MODULE: ./src/components/TextInput/TextInputMask.tsx
|
|
302
309
|
|
|
303
310
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-textinput",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@tailwindcss/typography": "0.5.19",
|
|
45
|
-
"@versini/ui-hooks": "
|
|
46
|
-
"@versini/ui-liveregion": "3.1.
|
|
45
|
+
"@versini/ui-hooks": "6.0.1",
|
|
46
|
+
"@versini/ui-liveregion": "3.1.4",
|
|
47
47
|
"clsx": "2.1.1",
|
|
48
48
|
"tailwindcss": "4.1.18"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": [
|
|
51
51
|
"**/*.css"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "7b2640a0650a4c3aa6ca078888f765cb400f9f13"
|
|
54
54
|
}
|