{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "booking-01",
  "title": "Booking Card",
  "author": "VenusUI",
  "description": "A stay booking page with a wall calendar range and a live price.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "https://venusui.com/r/wall-calendar.json"
  ],
  "files": [
    {
      "path": "registry/default/blocks/booking-01/components/booking-01.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { BedDouble, Check, Star, Waves, Wifi } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport { WallCalendar, type CalendarSelection } from \"@/registry/default/ui/wall-calendar\"\n\n// Photos: Unsplash (free under the Unsplash License). The hotel is made up.\nconst photo = (id: string, width: number, height: number) => `https://images.unsplash.com/photo-${id}?w=${width}&h=${height}&fit=crop&auto=format&q=75`\n\nconst RATE = 240\nconst CLEANING = 45\nconst BOOKED = new Set([\"2027-5-4\", \"2027-5-5\", \"2027-5-6\", \"2027-5-18\", \"2027-5-19\", \"2027-6-2\", \"2027-6-3\"])\nconst isBooked = (date: Date) => BOOKED.has(`${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`)\nconst amenities = [\n  { icon: BedDouble, text: \"King bed\" },\n  { icon: Waves, text: \"Pool access\" },\n  { icon: Wifi, text: \"Fast Wi-Fi\" },\n]\nconst short = new Intl.DateTimeFormat(\"en-US\", { month: \"short\", day: \"numeric\" })\n\n/** A stay booking card: photos, a date range on a wall calendar and a live price. */\nexport function Booking01() {\n  const [dates, setDates] = React.useState<CalendarSelection>({ from: new Date(2027, 5, 9), to: new Date(2027, 5, 13) })\n  const [reserved, setReserved] = React.useState(false)\n  const nights = dates.from && dates.to ? Math.round((dates.to.getTime() - dates.from.getTime()) / 86_400_000) : 0\n  const blocked = Boolean(\n    nights && Array.from({ length: nights }, (_, i) => new Date(dates.from!.getFullYear(), dates.from!.getMonth(), dates.from!.getDate() + i)).some(isBooked)\n  )\n\n  return (\n    <section aria-labelledby=\"booking-01-title\" className=\"py-24 sm:py-28\">\n      <div className=\"mx-auto grid max-w-6xl gap-12 px-4 sm:px-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,22rem)] lg:gap-14\">\n        <div className=\"min-w-0\">\n          <div className=\"grid grid-cols-3 grid-rows-2 gap-2 overflow-hidden rounded-2xl\">\n            <img src={photo(\"1566073771259-6a8506099945\", 900, 640)} alt=\"A thatched villa beside a pool at sunset\" className=\"col-span-2 row-span-2 size-full min-h-64 bg-muted object-cover\" />\n            <img src={photo(\"1582719478250-c89cae4dc85b\", 420, 320)} alt=\"A bright bedroom opening onto trees\" className=\"size-full bg-muted object-cover\" />\n            <img src={photo(\"1520250497591-112f2f40a3f4\", 420, 320)} alt=\"A turquoise pool among palm trees\" className=\"size-full bg-muted object-cover\" />\n          </div>\n          <div className=\"mt-7 flex flex-wrap items-start justify-between gap-3\">\n            <div>\n              <h2 id=\"booking-01-title\" className=\"text-3xl font-semibold tracking-tight\">\n                Pool Villa at Casa Palma\n              </h2>\n              <p className=\"mt-1 text-muted-foreground\">Two guests · Garden side</p>\n            </div>\n            <p className=\"flex items-center gap-1 text-sm font-medium\">\n              <Star aria-hidden=\"true\" className=\"size-4 fill-current\" />\n              4.9 <span className=\"font-normal text-muted-foreground\">(212 stays)</span>\n            </p>\n          </div>\n          <ul className=\"mt-5 flex flex-wrap gap-x-6 gap-y-2 text-sm text-muted-foreground\">\n            {amenities.map((item) => (\n              <li key={item.text} className=\"flex items-center gap-2\">\n                <item.icon aria-hidden=\"true\" className=\"size-4\" />\n                {item.text}\n              </li>\n            ))}\n          </ul>\n          <p className=\"mt-5 max-w-xl leading-7 text-muted-foreground\">\n            A quiet villa ten minutes from the beach, with morning shade on the terrace and the pool steps from your door.\n          </p>\n        </div>\n\n        <div className=\"space-y-5\">\n          <WallCalendar\n            mode=\"range\"\n            defaultMonth={new Date(2027, 5, 1)}\n            selected={dates}\n            onSelectedChange={(next) => {\n              setDates(next)\n              setReserved(false)\n            }}\n            isDateDisabled={isBooked}\n            className=\"mx-auto\"\n          />\n          <div className=\"rounded-xl border bg-card p-4 text-sm text-card-foreground\">\n            <p className=\"font-medium\">{dates.from && dates.to ? `${short.format(dates.from)} to ${short.format(dates.to)}` : \"Pick your check-out date\"}</p>\n            {nights > 0 ? (\n              <dl className=\"mt-3 space-y-1.5 text-muted-foreground\">\n                <div className=\"flex justify-between\">\n                  <dt>\n                    ${RATE} × {nights} {nights === 1 ? \"night\" : \"nights\"}\n                  </dt>\n                  <dd className=\"tabular-nums\">${RATE * nights}</dd>\n                </div>\n                <div className=\"flex justify-between\">\n                  <dt>Cleaning</dt>\n                  <dd className=\"tabular-nums\">${CLEANING}</dd>\n                </div>\n                <div className=\"flex justify-between border-t pt-2 font-medium text-foreground\">\n                  <dt>Total</dt>\n                  <dd className=\"tabular-nums\">${RATE * nights + CLEANING}</dd>\n                </div>\n              </dl>\n            ) : null}\n            {blocked ? <p className=\"mt-3 text-destructive\">Some of these nights are already booked.</p> : null}\n            <Button type=\"button\" className=\"mt-4 w-full\" disabled={!nights || blocked} onClick={() => setReserved(true)}>\n              {reserved ? <Check aria-hidden=\"true\" className=\"size-4\" /> : null}\n              {reserved ? \"Dates held\" : \"Reserve\"}\n            </Button>\n            <p role=\"status\" className=\"mt-2 min-h-4 text-center text-xs text-muted-foreground\">\n              {reserved ? \"We’ll hold these dates for 24 hours.\" : \"\"}\n            </p>\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "content"
  ],
  "type": "registry:block"
}