diff --git a/components/calendar.tsx b/components/calendar.tsx new file mode 100644 index 0000000..8d4f6f5 --- /dev/null +++ b/components/calendar.tsx @@ -0,0 +1,64 @@ +"use client"; + +import * as React from "react"; +import { DayPicker } from "react-day-picker"; +import { CaretLeft, CaretRight } from "~/icons"; + +import { cn } from "~/cn"; +import { buttonVariants } from "~/button"; + +export type CalendarProps = React.ComponentProps; + +function Calendar({ + className, + classNames, + showOutsideDays = true, + ...props +}: CalendarProps) { + return ( + , + IconRight: ({ ...props }) => , + }} + {...props} + /> + ); +} +Calendar.displayName = "Calendar"; + +export { Calendar }; diff --git a/components/datepicker.tsx b/components/datepicker.tsx new file mode 100644 index 0000000..bbd6095 --- /dev/null +++ b/components/datepicker.tsx @@ -0,0 +1,46 @@ +"use client"; + +import * as React from "react"; +import { format } from "date-fns"; +import { Calendar as CalendarIcon } from "~/icons"; + +import { cn } from "~/cn"; +import { Button } from "~/button"; +import { Calendar } from "~/calendar"; +import { Popover, PopoverContent, PopoverTrigger } from "~/popover"; +import { DayPickerSingleProps } from "react-day-picker"; + +export type DatePickerProps = Omit; + +function DatePicker({ ...props }: DatePickerProps) { + const [date, setDate] = React.useState(); + + return ( + + + + + + + + + ); +} +DatePicker.displayName = "DatePicker"; + +export { DatePicker }; diff --git a/components/icons.tsx b/components/icons.tsx index ddd8d61..067bd28 100644 --- a/components/icons.tsx +++ b/components/icons.tsx @@ -1,6 +1,7 @@ "use client"; export { + CaretLeft, CaretRight, ArrowSquareOut, ArrowsClockwise, @@ -10,5 +11,6 @@ export { HardDrives, ShieldCheck, List, + Calendar, X, } from "@phosphor-icons/react";