* chore: Add ./components/[name]/index.ts map to package.json * fix: Clarify Popover exports * fix: re-add dropdown to calcom/ui barrel * chore: Add icon barrel file re-export * Fix all calcom/ui imports of its own barrel * Never say 'fix all remaining..' it's never true * Some type fixeS * Linking fixes * Rename sheet.tsx to Sheet.tsx Done through UI, console does NOT like this. * Fixed some test failures
35 lines
968 B
TypeScript
35 lines
968 B
TypeScript
import "react-calendar/dist/Calendar.css";
|
|
import "react-date-picker/dist/DatePicker.css";
|
|
import PrimitiveDatePicker from "react-date-picker/dist/entry.nostyle";
|
|
|
|
import classNames from "@calcom/lib/classNames";
|
|
|
|
import { Icon } from "../../icon";
|
|
|
|
type Props = {
|
|
date: Date;
|
|
onDatesChange?: ((date: Date) => void) | undefined;
|
|
className?: string;
|
|
disabled?: boolean;
|
|
minDate?: Date;
|
|
};
|
|
|
|
const DatePicker = ({ minDate, disabled, date, onDatesChange, className }: Props) => {
|
|
return (
|
|
<PrimitiveDatePicker
|
|
className={classNames(
|
|
"focus:ring-primary-500 focus:border-primary-500 border-default rounded-md border p-1 pl-2 shadow-sm sm:text-sm",
|
|
className
|
|
)}
|
|
calendarClassName="rounded-md"
|
|
clearIcon={null}
|
|
calendarIcon={<Icon name="calendar" className="text-subtle h-5 w-5 rounded-md" />}
|
|
value={date}
|
|
disabled={disabled}
|
|
onChange={onDatesChange}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default DatePicker;
|