{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "recipe-01",
  "title": "Recipe Page",
  "author": "VenusUI",
  "description": "A recipe whose servings rescale the ingredients, with tick-off lists for cooking.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "registry/default/blocks/recipe-01/components/recipe-01.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Clock, Flame, Minus, Plus, Users } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport { cn } from \"@/lib/utils\"\n\n// Photo: Unsplash (free under the Unsplash License).\nconst PHOTO = \"https://images.unsplash.com/photo-1476718406336-bb5a9690ee2a?w=1000&h=1000&fit=crop&auto=format&q=80\"\nconst BASE_SERVINGS = 4\n\nconst ingredients = [\n  { amount: 1.2, unit: \"kg\", name: \"butternut squash, cubed\" },\n  { amount: 2, unit: \"tbsp\", name: \"olive oil\" },\n  { amount: 1, unit: \"\", name: \"large onion, sliced\" },\n  { amount: 3, unit: \"cloves\", name: \"garlic\" },\n  { amount: 1, unit: \"litre\", name: \"vegetable stock\" },\n  { amount: 60, unit: \"g\", name: \"butter\" },\n  { amount: 4, unit: \"tbsp\", name: \"sour cream, to serve\" },\n  { amount: 3, unit: \"tbsp\", name: \"pumpkin seeds, toasted\" },\n]\nconst steps = [\n  { title: \"Roast\", text: \"Toss the squash with the oil and salt. Roast at 200°C for 35 minutes, until the edges catch.\" },\n  { title: \"Soften\", text: \"Cook the onion in half the butter over a low heat for 10 minutes. Add the garlic for the last minute.\" },\n  { title: \"Simmer\", text: \"Add the squash and stock. Simmer for 10 minutes, then blend until completely smooth.\" },\n  { title: \"Finish\", text: \"Brown the remaining butter until it smells nutty. Serve the soup with sour cream, seeds and the butter.\" },\n]\nconst facts = [\n  { icon: Clock, text: \"55 min\" },\n  { icon: Flame, text: \"Easy\" },\n]\n\nfunction formatAmount(value: number) {\n  if (value >= 10) return String(Math.round(value))\n  const rounded = Math.round(value * 4) / 4\n  const whole = Math.floor(rounded)\n  const fraction = { 0.25: \"¼\", 0.5: \"½\", 0.75: \"¾\" }[rounded - whole] ?? \"\"\n  return `${whole || (fraction ? \"\" : \"0\")}${fraction}`\n}\n\n/** A recipe page: servings that rescale the ingredients, with tick-off lists for cooking. */\nexport function Recipe01() {\n  const [servings, setServings] = React.useState(BASE_SERVINGS)\n  const [got, setGot] = React.useState<string[]>([])\n  const [done, setDone] = React.useState<string[]>([])\n  const toggle = (list: string[], item: string) => (list.includes(item) ? list.filter((value) => value !== item) : [...list, item])\n\n  return (\n    <section aria-labelledby=\"recipe-01-title\" className=\"py-24 sm:py-28\">\n      <div className=\"mx-auto max-w-6xl px-4 sm:px-6\">\n        <div className=\"grid items-center gap-8 lg:grid-cols-2 lg:gap-14\">\n          <div>\n            <p className=\"text-sm text-muted-foreground\">Autumn suppers</p>\n            <h2 id=\"recipe-01-title\" className=\"mt-2 font-serif text-4xl font-semibold tracking-tight text-balance sm:text-5xl\">\n              Roast squash soup with brown butter\n            </h2>\n            <p className=\"mt-4 max-w-lg text-lg leading-8 text-muted-foreground\">Sweet from the oven, nutty from the pan, and better the next day.</p>\n            <ul className=\"mt-5 flex gap-5 text-sm text-muted-foreground\">\n              {facts.map((fact) => (\n                <li key={fact.text} className=\"flex items-center gap-1.5\">\n                  <fact.icon aria-hidden=\"true\" className=\"size-4\" />\n                  {fact.text}\n                </li>\n              ))}\n            </ul>\n          </div>\n          <img src={PHOTO} alt=\"A bowl of orange soup topped with sour cream and seeds\" className=\"aspect-[4/3] w-full rounded-2xl bg-muted object-cover\" />\n        </div>\n\n        <div className=\"mt-14 grid gap-12 lg:grid-cols-[minmax(0,22rem)_minmax(0,1fr)] lg:gap-16\">\n          <div>\n            <div className=\"flex items-center justify-between gap-3\">\n              <h3 className=\"text-xl font-semibold\">Ingredients</h3>\n              <div role=\"group\" aria-label=\"Servings\" className=\"flex items-center gap-1\">\n                <Button type=\"button\" variant=\"outline\" size=\"icon-sm\" aria-label=\"Fewer servings\" disabled={servings === 1} onClick={() => setServings(servings - 1)}>\n                  <Minus aria-hidden=\"true\" className=\"size-3.5\" />\n                </Button>\n                <output aria-live=\"polite\" className=\"flex w-12 items-center justify-center gap-1 text-sm tabular-nums\">\n                  <Users aria-hidden=\"true\" className=\"size-3.5 text-muted-foreground\" />\n                  <span className=\"sr-only\">Servings: </span>\n                  {servings}\n                </output>\n                <Button type=\"button\" variant=\"outline\" size=\"icon-sm\" aria-label=\"More servings\" disabled={servings === 12} onClick={() => setServings(servings + 1)}>\n                  <Plus aria-hidden=\"true\" className=\"size-3.5\" />\n                </Button>\n              </div>\n            </div>\n            <ul className=\"mt-4 divide-y border-y\">\n              {ingredients.map((item) => {\n                const checked = got.includes(item.name)\n                return (\n                  <li key={item.name}>\n                    <label className=\"flex cursor-pointer items-baseline gap-3 py-2.5 text-sm\">\n                      <input type=\"checkbox\" checked={checked} onChange={() => setGot(toggle(got, item.name))} className=\"size-4 translate-y-0.5 accent-primary\" />\n                      <span className={cn(checked && \"text-muted-foreground line-through\")}>\n                        <span className=\"font-medium tabular-nums\">\n                          {formatAmount((item.amount * servings) / BASE_SERVINGS)}\n                          {item.unit ? ` ${item.unit}` : \"\"}\n                        </span>{\" \"}\n                        {item.name}\n                      </span>\n                    </label>\n                  </li>\n                )\n              })}\n            </ul>\n          </div>\n          <div>\n            <div className=\"flex items-baseline justify-between gap-3\">\n              <h3 className=\"text-xl font-semibold\">Method</h3>\n              <p aria-live=\"polite\" className=\"font-mono text-xs text-muted-foreground tabular-nums\">\n                {done.length}/{steps.length} done\n              </p>\n            </div>\n            <ol className=\"mt-4 space-y-3\">\n              {steps.map((step, i) => {\n                const checked = done.includes(step.title)\n                return (\n                  <li key={step.title}>\n                    <label className={cn(\"flex cursor-pointer gap-4 rounded-xl border p-4 transition-colors has-focus-visible:ring-3 has-focus-visible:ring-ring/50\", checked && \"bg-muted/60\")}>\n                      <input type=\"checkbox\" className=\"peer sr-only\" checked={checked} onChange={() => setDone(toggle(done, step.title))} />\n                      <span aria-hidden=\"true\" className=\"grid size-7 shrink-0 place-items-center rounded-full border font-mono text-xs peer-checked:border-foreground peer-checked:bg-foreground peer-checked:text-background\">\n                        {i + 1}\n                      </span>\n                      <span>\n                        <span className={cn(\"block font-medium\", checked && \"text-muted-foreground line-through\")}>{step.title}</span>\n                        <span className=\"mt-1 block text-sm leading-6 text-muted-foreground\">{step.text}</span>\n                      </span>\n                    </label>\n                  </li>\n                )\n              })}\n            </ol>\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "content"
  ],
  "type": "registry:block"
}