'use client'; import * as React from 'react'; import { Calendar as CalendarIcon } from 'lucide-react'; import { format } from 'date-fns'; import { Button, type ButtonProps } from '@/components/ui/button'; import { Calendar } from '@/components/ui/calendar'; import { Input } from '@/components/ui/input'; import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; import { useIsMobile } from '@/hooks/use-is-mobile'; import { cn } from '@/lib/utils'; export interface DatePickerProps { /** ISO-date string (YYYY-MM-DD) or empty for unset. */ value?: string; onChange: (next: string) => void; placeholder?: string; /** Disable the entire control. */ disabled?: boolean; /** Limit selectable range — same shape react-day-picker accepts. */ fromDate?: Date; toDate?: Date; /** Optional className on the trigger Button (desktop) / Input (mobile). */ className?: string; /** Tooltip text shown via `title` on the trigger. */ title?: string; /** Trigger Button size on desktop. */ size?: ButtonProps['size']; /** Optional id (forwarded to the trigger/input for `