karsten-design-system 1.0.13 → 1.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.
|
@@ -9,7 +9,7 @@ const variants = {
|
|
|
9
9
|
green: 'text-green',
|
|
10
10
|
gray: 'text-gray',
|
|
11
11
|
};
|
|
12
|
-
function Input({ onChange, placeholder, disabled = false, error, icon, onClickIcon, iconColor = 'green', label, ...props }) {
|
|
12
|
+
function Input({ onChange, placeholder, disabled = false, error, icon, iconClassName, onClickIcon, iconColor = 'green', label, ...props }) {
|
|
13
13
|
const [isOnFocus, setIsOnFocus] = useState(false);
|
|
14
14
|
const inputId = useId();
|
|
15
15
|
const handleChange = (e) => {
|
|
@@ -17,7 +17,7 @@ function Input({ onChange, placeholder, disabled = false, error, icon, onClickIc
|
|
|
17
17
|
};
|
|
18
18
|
const hasError = (props.value && error && !disabled) ||
|
|
19
19
|
(!!error && !disabled && props.value?.length === 0);
|
|
20
|
-
return (jsxRuntimeExports.jsxs("div", { className: "relative flex flex-col w-100", children: [jsxRuntimeExports.jsxs(IconField, { className: "w-100", children: [jsxRuntimeExports.jsx(InputIcon, { className: clsx(`pi ${icon} px-2 cursor-pointer`, hasError
|
|
20
|
+
return (jsxRuntimeExports.jsxs("div", { className: "relative flex flex-col w-100", children: [jsxRuntimeExports.jsxs(IconField, { className: "w-100", children: [jsxRuntimeExports.jsx(InputIcon, { className: clsx(`pi ${icon} px-2 cursor-pointer`, iconClassName, hasError
|
|
21
21
|
? 'text-redError'
|
|
22
22
|
: disabled
|
|
23
23
|
? 'text-stone'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sources":["../../../../src/stories/components/input.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"input.js","sources":["../../../../src/stories/components/input.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAkBA,MAAM,QA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YAAY,CAAC,IAAI,CAAC,EACjC,MAAM,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,EACjC,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,IAAI,CACb,4DAA4D,EAC5D,QAAQ,GAAG,iBAAiB,GAAG,kCAAkC,CAClE,KACG,KAAK,EAAA,CACT,IACQ,EACZA,qBAAA,CAAA,OAAA,EAAA,EACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,IAAI,CACb,+GAA+G,EAC/G,SAAS,IAAI,KAAK,CAAC;AACjB,sBAAE;AACF,sBAAE;AACA,0BAAE;0BACA,qBAAqB,EAC3B;AACE,sBAAE;AACF,sBAAE;AACA,0BAAE;AACF,0BAAE,SAAS,IAAI,KAAK,CAAC;AACnB,8BAAE;AACF,8BAAE,WAAW,CACpB,YAEA,KAAK,EAAA,CACA,EACP,QAAQ,IAAIA,qBAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,4BAA4B,EAAA,QAAA,EAAE,KAAK,EAAQ,CAAA,CAAA,EAAA,CACpE;AAEV;;;;"}
|
|
@@ -6,6 +6,7 @@ export type InputProps = {
|
|
|
6
6
|
error?: string;
|
|
7
7
|
onClickIcon?: () => void;
|
|
8
8
|
icon?: string;
|
|
9
|
+
iconClassName?: string;
|
|
9
10
|
iconColor?: keyof typeof variants;
|
|
10
11
|
label?: string;
|
|
11
12
|
} & Omit<InputTextProps, 'onChange'>;
|
|
@@ -13,5 +14,5 @@ declare const variants: {
|
|
|
13
14
|
green: string;
|
|
14
15
|
gray: string;
|
|
15
16
|
};
|
|
16
|
-
export declare function Input({ onChange, placeholder, disabled, error, icon, onClickIcon, iconColor, label, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function Input({ onChange, placeholder, disabled, error, icon, iconClassName, onClickIcon, iconColor, label, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|