{
  "name": "date-picker-with-presets",
  "type": "registry:example",
  "dependencies": [
    "date-fns"
  ],
  "registryDependencies": [
    "button",
    "calendar",
    "popover",
    "select"
  ],
  "files": [
    {
      "path": "example/date-picker-with-presets.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { CalendarIcon } from \"@radix-ui/react-icons\"\nimport { addDays, format } from \"date-fns\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/new-york/ui/button\"\nimport { Calendar } from \"@/registry/new-york/ui/calendar\"\nimport {\n  Popover,\n  PopoverContent,\n  PopoverTrigger,\n} from \"@/registry/new-york/ui/popover\"\nimport {\n  Select,\n  SelectContent,\n  SelectItem,\n  SelectTrigger,\n  SelectValue,\n} from \"@/registry/new-york/ui/select\"\n\nexport default function DatePickerWithPresets() {\n  const [date, setDate] = React.useState<Date>()\n\n  return (\n    <Popover>\n      <PopoverTrigger asChild>\n        <Button\n          variant={\"outline\"}\n          className={cn(\n            \"w-[240px] justify-start text-left font-normal\",\n            !date && \"text-muted-foreground\"\n          )}\n        >\n          <CalendarIcon />\n          {date ? format(date, \"PPP\") : <span>Pick a date</span>}\n        </Button>\n      </PopoverTrigger>\n      <PopoverContent\n        align=\"start\"\n        className=\"flex w-auto flex-col space-y-2 p-2\"\n      >\n        <Select\n          onValueChange={(value) =>\n            setDate(addDays(new Date(), parseInt(value)))\n          }\n        >\n          <SelectTrigger>\n            <SelectValue placeholder=\"Select\" />\n          </SelectTrigger>\n          <SelectContent position=\"popper\">\n            <SelectItem value=\"0\">Today</SelectItem>\n            <SelectItem value=\"1\">Tomorrow</SelectItem>\n            <SelectItem value=\"3\">In 3 days</SelectItem>\n            <SelectItem value=\"7\">In a week</SelectItem>\n          </SelectContent>\n        </Select>\n        <div className=\"rounded-md border\">\n          <Calendar mode=\"single\" selected={date} onSelect={setDate} />\n        </div>\n      </PopoverContent>\n    </Popover>\n  )\n}\n",
      "type": "registry:example",
      "target": ""
    }
  ]
}