@uniai-fe/uds-primitives 0.0.13 → 0.0.14
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniai-fe/uds-primitives",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "UNIAI Design System; Primitives Components Package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"@uniai-fe/util-functions": "workspace:*",
|
|
92
92
|
"eslint": "^9.39.2",
|
|
93
93
|
"prettier": "^3.7.4",
|
|
94
|
-
"react-hook-form": "^7.
|
|
95
|
-
"sass": "^1.97.
|
|
94
|
+
"react-hook-form": "^7.69.0",
|
|
95
|
+
"sass": "^1.97.1",
|
|
96
96
|
"typescript": "~5.9.3"
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -79,9 +79,9 @@ const Text = forwardRef<HTMLInputElement, InputProps>(
|
|
|
79
79
|
block = false,
|
|
80
80
|
left,
|
|
81
81
|
right,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
clear,
|
|
83
|
+
success,
|
|
84
|
+
error,
|
|
85
85
|
label,
|
|
86
86
|
helper,
|
|
87
87
|
hideHelper,
|
|
@@ -167,13 +167,13 @@ const Text = forwardRef<HTMLInputElement, InputProps>(
|
|
|
167
167
|
|
|
168
168
|
const statusSlot = useMemo(() => {
|
|
169
169
|
if (resolvedState === "success") {
|
|
170
|
-
return
|
|
170
|
+
return success ?? defaultStatusIcon;
|
|
171
171
|
}
|
|
172
172
|
if (resolvedState === "error") {
|
|
173
|
-
return
|
|
173
|
+
return error ?? defaultStatusIcon;
|
|
174
174
|
}
|
|
175
175
|
return null;
|
|
176
|
-
}, [defaultStatusIcon,
|
|
176
|
+
}, [defaultStatusIcon, error, resolvedState, success]);
|
|
177
177
|
|
|
178
178
|
const defaultClearIcon = useMemo(() => {
|
|
179
179
|
if (visualState === "active") {
|
|
@@ -182,7 +182,7 @@ const Text = forwardRef<HTMLInputElement, InputProps>(
|
|
|
182
182
|
return null;
|
|
183
183
|
}, [visualState]);
|
|
184
184
|
|
|
185
|
-
const effectiveClearIcon =
|
|
185
|
+
const effectiveClearIcon = clear ?? defaultClearIcon;
|
|
186
186
|
const showClearIcon = Boolean(
|
|
187
187
|
effectiveClearIcon && hasValue && resolvedState !== "disabled",
|
|
188
188
|
);
|
|
@@ -30,12 +30,12 @@ type NativeInputProps = ComponentPropsWithoutRef<"input">;
|
|
|
30
30
|
/**
|
|
31
31
|
* 좌우 슬롯과 status 아이콘 정의.
|
|
32
32
|
*/
|
|
33
|
-
export interface
|
|
33
|
+
export interface InputIcon {
|
|
34
34
|
left?: ReactNode;
|
|
35
35
|
right?: ReactNode;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
clear?: ReactNode;
|
|
37
|
+
success?: ReactNode;
|
|
38
|
+
error?: ReactNode;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -51,7 +51,7 @@ export interface InputFeedback {
|
|
|
51
51
|
* 텍스트 입력의 핵심 props. native input 속성에서 size는 제외하고 left/right 등 슬롯을 별도로 정의한다.
|
|
52
52
|
*/
|
|
53
53
|
export interface InputProps
|
|
54
|
-
extends Omit<NativeInputProps, "size">,
|
|
54
|
+
extends Omit<NativeInputProps, "size">, InputIcon, InputFeedback {
|
|
55
55
|
/** semantic color/token 세트 */
|
|
56
56
|
priority?: InputPriority;
|
|
57
57
|
/** 높이/타이포 세트 */
|