{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "date-picker", "title": "Integrated Date Picker", "description": "Single, multiple, and range date picker built on shadcn Popover + the Integrated Calendar, with an optional inline-input mode.", "dependencies": [ "date-fns", "react-day-picker" ], "registryDependencies": [ "popover", "button", "input", "@easy-shadcn/calendar" ], "files": [ { "path": "registry/ui/date-picker.tsx", "content": "\"use client\";\n\nimport { Calendar03Icon } from \"@hugeicons/core-free-icons\";\nimport { HugeiconsIcon } from \"@hugeicons/react\";\nimport type { ClassValue } from \"clsx\";\nimport type { Locale } from \"date-fns\";\nimport { format as formatDate, isValid, parse } from \"date-fns\";\nimport type React from \"react\";\nimport type { AriaAttributes } from \"react\";\nimport { useId, useRef, useState } from \"react\";\nimport type { DateRange, Matcher } from \"react-day-picker\";\nimport { dateMatchModifiers } from \"react-day-picker\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils\";\nimport { Calendar } from \"@/registry/ui/calendar\";\n\n// ---------- Types ----------\n\ntype DatePickerBaseProps = {\n /** Forwarded to the trigger (button or input) for screen-reader descriptions. */\n \"aria-describedby\"?: string;\n /** Forwarded to the trigger (button or input) for invalid-state semantics. */\n \"aria-invalid\"?: AriaAttributes[\"aria-invalid\"];\n /**\n * `date-fns` format string applied to the displayed value and used to parse\n * input back into a `Date` when `withInput` is enabled.\n * @default \"PPP\"\n */\n format?: string;\n /**\n * Id applied to the trigger (button or input), so a `