@@ -7,27 +7,27 @@ import Flatpickr, { DateTimePickerProps } from "react-flatpickr";
77import "../../assets/themes/dark.css" ;
88import "../../assets/themes/light.css" ;
99
10- interface PropTypes extends Omit < DateTimePickerProps , "size" | "onChange" > {
10+ interface PropTypes extends Omit < DateTimePickerProps , "id" | " size" | "onChange" > {
1111 size ?: "sm" | "md" ;
1212 icon ?: React . ReactNode ;
1313 error ?: string ;
1414 onChange ?: ChangeEventHandler < HTMLInputElement > ;
1515}
1616
17- const DateField = ( { size = "md" , icon, error, className, value, onChange, onBlur, ...props } : PropTypes ) => {
17+ const DateField = ( { size = "md" , title , icon, error, className, value, onChange, onBlur, ...props } : PropTypes ) => {
1818 const id = useId ( ) ;
1919
2020 return (
2121 < div >
22- { props . title && (
22+ { title && (
2323 < label
2424 htmlFor = { id }
2525 className = { clsx ( "block font-medium text-gray-900 dark:text-white mb-1" , {
2626 "text-xs" : size === "sm" ,
2727 "text-sm" : size === "md" ,
2828 } ) }
2929 >
30- { props . title }
30+ { title }
3131 { props . required && < FontAwesomeIcon icon = { faAsterisk } size = "2xs" className = "text-red-600 ml-1" /> }
3232 </ label >
3333 ) }
@@ -55,7 +55,7 @@ const DateField = ({ size = "md", icon, error, className, value, onChange, onBlu
5555 className = { clsx (
5656 "text-sm rounded-lg block w-full" ,
5757 "bg-gray-50 border border-gray-300 text-gray-900 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white" ,
58- "focus:ring-2 focus:ring-primary-300 focus:outline-none dark:focus:ring-primary-600 " ,
58+ "focus:ring-2 focus:ring-primary-300 focus:outline-none dark:focus:ring-primary-800 " ,
5959 {
6060 "border-red-500 text-red-900 placeholder-red-700 dark:text-red-500 dark:placeholder-red-500 dark:border-red-500" : error !== undefined ,
6161 "pl-8" : ! ! icon ,
0 commit comments