{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "speed-dial-create-menu",
  "title": "Speed Dial Create Menu",
  "description": "A create button that fans out Note, Photo and Scan actions, dims the page behind it, closes on Escape or a press outside and announces the chosen action. Use this when one screen can create several kinds of thing and the create button should stay a single control.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "@tealmac/speed-dial"
  ],
  "files": [
    {
      "path": "registry/patterns/speed-dial-create-menu/speed-dial-create-menu.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { CameraIcon, FileTextIcon, ScanLineIcon } from \"lucide-react\"\n\nimport { SpeedDial } from \"@/components/ui/speed-dial\"\n\nexport type CreateKind = \"note\" | \"photo\" | \"scan\"\n\nexport interface SpeedDialCreateMenuProps {\n  onCreate: (kind: CreateKind) => void\n}\n\nexport function SpeedDialCreateMenu({ onCreate }: SpeedDialCreateMenuProps) {\n  const [open, setOpen] = React.useState(false)\n  const [announce, setAnnounce] = React.useState(\"\")\n  const pick = (kind: CreateKind, text: string) => () => {\n    onCreate(kind)\n    setAnnounce(`Creating ${text}`)\n  }\n  return (\n    <div className=\"relative h-72 w-full max-w-sm overflow-hidden rounded-xl border\">\n      {open && (\n        <div\n          aria-hidden\n          className=\"absolute inset-0 z-10 bg-black/30\"\n          onClick={() => setOpen(false)}\n        />\n      )}\n      <div className=\"absolute end-4 bottom-4 z-20\">\n        <SpeedDial\n          label=\"Create\"\n          open={open}\n          onOpenChange={setOpen}\n          actions={[\n            {\n              id: \"note\",\n              label: \"Note\",\n              icon: <FileTextIcon />,\n              onSelect: pick(\"note\", \"a note\"),\n            },\n            {\n              id: \"photo\",\n              label: \"Photo\",\n              icon: <CameraIcon />,\n              onSelect: pick(\"photo\", \"a photo\"),\n            },\n            {\n              id: \"scan\",\n              label: \"Scan\",\n              icon: <ScanLineIcon />,\n              onSelect: pick(\"scan\", \"a scan\"),\n            },\n          ]}\n        />\n      </div>\n      <p role=\"status\" className=\"sr-only\">\n        {announce}\n      </p>\n    </div>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "type": "registry:block"
}