opus-toolkit-components 0.3.7 → 0.3.9
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.
|
@@ -788,7 +788,7 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
|
788
788
|
// Add animation class when focused
|
|
789
789
|
required = false // Required field indicator
|
|
790
790
|
} = _ref;
|
|
791
|
-
const inputClasses = `${className} flex items-center rounded-md bg-white border ${isValid ? 'border-greyLight500' : 'border-utilRed1000'} p-2 text-md font-normal text-gray-900
|
|
791
|
+
const inputClasses = `${className} flex items-center rounded-md bg-white border ${isValid ? 'border-greyLight500' : 'border-utilRed1000'} p-2 text-md font-normal text-gray-900`;
|
|
792
792
|
const iconClasses = `h-5 w-5 ${isAnimated ? 'transition-transform duration-200 group-focus-within:scale-125' : ''} text-gray-400`;
|
|
793
793
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
794
794
|
className: "flex flex-col mb-4"
|
|
@@ -804,7 +804,7 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
|
804
804
|
className: iconClasses
|
|
805
805
|
})), /*#__PURE__*/external_react_default().createElement("input", {
|
|
806
806
|
ref: ref,
|
|
807
|
-
className: `w-full ${Icon ? iconPosition === 'left' ? 'pl-10' : 'pr-10' : ''} bg-transparent border-none focus:ring-0`,
|
|
807
|
+
className: `w-full ${Icon ? iconPosition === 'left' ? 'pl-10' : 'pr-10' : ''} bg-transparent border-none focus:ring-0 focus:outline-none`,
|
|
808
808
|
type: type,
|
|
809
809
|
name: name,
|
|
810
810
|
placeholder: placeholder,
|
|
@@ -832,7 +832,9 @@ function DatePicker(_ref) {
|
|
|
832
832
|
// Add name prop for form identification
|
|
833
833
|
onChange,
|
|
834
834
|
// Add onChange prop for passing event to parent
|
|
835
|
-
value
|
|
835
|
+
value,
|
|
836
|
+
className = '',
|
|
837
|
+
required = false // Add the required prop
|
|
836
838
|
} = _ref;
|
|
837
839
|
const [selectedDate, setSelectedDate] = (0,external_react_.useState)(value || initialDate);
|
|
838
840
|
(0,external_react_.useEffect)(() => {
|
|
@@ -848,21 +850,24 @@ function DatePicker(_ref) {
|
|
|
848
850
|
onChange(e); // Pass the full event object to the parent component
|
|
849
851
|
}
|
|
850
852
|
};
|
|
851
|
-
const inputClasses =
|
|
853
|
+
const inputClasses = `${className} flex items-center rounded-md bg-white border ${isValid ? 'border-greyLight500' : 'border-utilRed1000'} p-2 text-md font-normal text-gray-900`;
|
|
852
854
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
853
855
|
className: "flex flex-col mb-4"
|
|
854
856
|
}, /*#__PURE__*/external_react_default().createElement("label", {
|
|
855
857
|
htmlFor: "date"
|
|
856
|
-
}, label
|
|
858
|
+
}, label, required && /*#__PURE__*/external_react_default().createElement("span", {
|
|
859
|
+
className: "text-utilRed1000 ml-1"
|
|
860
|
+
}, "*")), /*#__PURE__*/external_react_default().createElement("input", {
|
|
857
861
|
type: "date",
|
|
858
862
|
id: "date",
|
|
859
863
|
name: name // Pass the name to identify the input in the event
|
|
860
864
|
,
|
|
861
865
|
value: selectedDate,
|
|
862
866
|
onChange: handleDateChange,
|
|
863
|
-
className: inputClasses
|
|
867
|
+
className: inputClasses,
|
|
868
|
+
required: required // Apply the required attribute to the input
|
|
864
869
|
}), !isValid && /*#__PURE__*/external_react_default().createElement("span", {
|
|
865
|
-
className: "text-
|
|
870
|
+
className: "text-utilRed1000 text-sm"
|
|
866
871
|
}, errorMessage));
|
|
867
872
|
}
|
|
868
873
|
;// ./src/components/Forms/Radios/RadioButton.js
|
|
@@ -9175,4 +9180,4 @@ function Dropdown(_ref) {
|
|
|
9175
9180
|
/******/ })()
|
|
9176
9181
|
;
|
|
9177
9182
|
});
|
|
9178
|
-
//# sourceMappingURL=main.
|
|
9183
|
+
//# sourceMappingURL=main.55da4336968183da1c19.js.map
|