Merge branch 'iipbs/common/main' into iipbs/sn/ii

This commit is contained in:
swcho
2025-07-10 10:04:54 +09:00
9 changed files with 114 additions and 38 deletions
@@ -2,7 +2,7 @@ import "./date-picker.css";
import { format } from "date-fns";
import { CalendarIcon } from "lucide-react";
import type { DayPicker } from "react-day-picker";
import type { DayPickerSingleProps } from "react-day-picker";
import { cn } from "../../lib/utils";
import { Button } from "../button";
@@ -12,15 +12,12 @@ import { Popover, PopoverContent, PopoverTrigger } from "../popover";
type DatePickerProps = {
placeholder?: string;
disabled?: boolean;
selected?: Date;
zIndex?: number; // z-index prop 추가
} & React.ComponentProps<typeof DayPicker>;
} & DayPickerSingleProps;
export function DatePicker({
className,
placeholder = "날짜 선택",
disabled,
zIndex, // zIndex prop 받기
...props
}: DatePickerProps) {
return (
@@ -39,11 +36,8 @@ export function DatePicker({
)}
</Button>
</PopoverTrigger>
<PopoverContent
className="w-auto p-0"
style={{ zIndex: zIndex || 'auto' }}
>
<Calendar classNames={{ cell: "rounded-md" }} {...props} />
<PopoverContent className="w-auto p-0">
<Calendar initialFocus classNames={{ cell: "rounded-md" }} {...props} />
</PopoverContent>
</Popover>
);