opus-toolkit-components 0.3.3 → 0.3.4
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.
|
@@ -779,22 +779,38 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
|
779
779
|
errorMessage = `${label} is required`,
|
|
780
780
|
onChange,
|
|
781
781
|
className = '',
|
|
782
|
-
value
|
|
782
|
+
value,
|
|
783
|
+
Icon,
|
|
784
|
+
// Icon component
|
|
785
|
+
iconPosition = 'left',
|
|
786
|
+
// Icon position: left or right
|
|
787
|
+
isAnimated = false // Add animation class when focused
|
|
783
788
|
} = _ref;
|
|
784
|
-
const inputClasses = `${className} rounded-md bg-white border border-greyLight500 px-4
|
|
789
|
+
const inputClasses = `${className} flex items-center rounded-md bg-white border ${isValid ? 'border-greyLight500' : 'border-utilRed1000'} px-4 text-md font-normal text-gray-900`;
|
|
790
|
+
const iconClasses = `h-5 w-5 ${isAnimated ? 'transition-transform duration-200 group-focus-within:scale-125' : ''} text-gray-400`;
|
|
785
791
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
786
792
|
className: "flex flex-col mb-4"
|
|
787
793
|
}, /*#__PURE__*/external_react_default().createElement("label", {
|
|
788
|
-
className: "text-greyLight1000"
|
|
789
|
-
}, label), /*#__PURE__*/external_react_default().createElement("
|
|
794
|
+
className: "text-greyLight1000 mb-1"
|
|
795
|
+
}, label), /*#__PURE__*/external_react_default().createElement("div", {
|
|
796
|
+
className: `${inputClasses} relative`
|
|
797
|
+
}, Icon && iconPosition === 'left' && /*#__PURE__*/external_react_default().createElement("span", {
|
|
798
|
+
className: "absolute left-3 flex items-center pointer-events-none"
|
|
799
|
+
}, /*#__PURE__*/external_react_default().createElement(Icon, {
|
|
800
|
+
className: iconClasses
|
|
801
|
+
})), /*#__PURE__*/external_react_default().createElement("input", {
|
|
790
802
|
ref: ref,
|
|
791
|
-
className:
|
|
803
|
+
className: `w-full ${Icon ? iconPosition === 'left' ? 'pl-10' : 'pr-10' : ''} bg-transparent border-none focus:ring-0`,
|
|
792
804
|
type: type,
|
|
793
805
|
name: name,
|
|
794
806
|
placeholder: placeholder,
|
|
795
807
|
onChange: onChange,
|
|
796
808
|
value: value
|
|
797
|
-
}),
|
|
809
|
+
}), Icon && iconPosition === 'right' && /*#__PURE__*/external_react_default().createElement("span", {
|
|
810
|
+
className: "absolute right-3 flex items-center pointer-events-none"
|
|
811
|
+
}, /*#__PURE__*/external_react_default().createElement(Icon, {
|
|
812
|
+
className: iconClasses
|
|
813
|
+
}))), !isValid && /*#__PURE__*/external_react_default().createElement("span", {
|
|
798
814
|
className: "text-utilRed1000 text-sm"
|
|
799
815
|
}, errorMessage));
|
|
800
816
|
});
|
|
@@ -9146,4 +9162,4 @@ function Dropdown(_ref) {
|
|
|
9146
9162
|
/******/ })()
|
|
9147
9163
|
;
|
|
9148
9164
|
});
|
|
9149
|
-
//# sourceMappingURL=main.
|
|
9165
|
+
//# sourceMappingURL=main.83972011c52c05c2a738.js.map
|