{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "fab",
  "type": "registry:block",
  "title": "Fab",
  "description": "Fab",
  "files": [
    {
      "path": "components/usages/fabusage.tsx",
      "content": "import FloatingActionMenu from \"@/registry/open-source/fab\";\n\nexport default function Usage() {\n    return (\n        <div className=\"h-screen w-full flex items-center justify-center relative overflow-hidden bg-background\">\n            <FloatingActionMenu options={[\n                {\n                    label: \"Home\",\n                    onClick: () => {\n                        console.log(\"Home\");\n                    },\n                },\n            ]} />\n        </div>\n    );\n}",
      "type": "registry:block",
      "target": "~/example.tsx"
    },
    {
      "path": "components/usages/fabusage.tsx",
      "content": "import FloatingActionMenu from \"@/registry/open-source/fab\";\n\nexport default function Usage() {\n    return (\n        <div className=\"h-screen w-full flex items-center justify-center relative overflow-hidden bg-background\">\n            <FloatingActionMenu options={[\n                {\n                    label: \"Home\",\n                    onClick: () => {\n                        console.log(\"Home\");\n                    },\n                },\n            ]} />\n        </div>\n    );\n}",
      "type": "registry:ui"
    },
    {
      "path": "registry/open-source/fab.tsx",
      "content": "\n\"use client\";\n\nimport React, { useState } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Plus } from \"lucide-react\";\nimport { cn } from \"@/registry/utilities/cn\";\n\n// Credit:\n// https://ui.chetanverma.com/components/floating-action-menu\n\ntype FloatingActionMenuProps = {\n    options: {\n        label: string;\n        onClick: () => void;\n        Icon?: React.ReactNode;\n    }[];\n    className?: string;\n};\n\nconst FloatingActionMenu = ({\n    options,\n    className,\n}: FloatingActionMenuProps) => {\n    const [isOpen, setIsOpen] = useState(false);\n\n    const toggleMenu = () => {\n        setIsOpen(!isOpen);\n    };\n\n    return (\n        <div className={cn(\"fixed bottom-8 right-8\", className)}>\n            <Button\n                onClick={toggleMenu}\n                className=\"w-10 h-10 rounded-full bg-[#11111198] hover:bg-[#111111d1] shadow-[0_0_20px_rgba(0,0,0,0.2)] \"\n            >\n                <motion.div\n                    animate={{ rotate: isOpen ? 45 : 0 }}\n                    transition={{\n                        duration: 0.3,\n                        ease: \"easeInOut\",\n                        type: \"spring\",\n                        stiffness: 300,\n                        damping: 20,\n                    }}\n                >\n                    <Plus className=\"w-6 h-6\" />\n                </motion.div>\n            </Button>\n\n            <AnimatePresence>\n                {isOpen && (\n                    <motion.div\n                        initial={{ opacity: 0, x: 10, y: 10, filter: \"blur(10px)\" }}\n                        animate={{ opacity: 1, x: 0, y: 0, filter: \"blur(0px)\" }}\n                        exit={{ opacity: 0, x: 10, y: 10, filter: \"blur(10px)\" }}\n                        transition={{\n                            duration: 0.6,\n                            type: \"spring\",\n                            stiffness: 300,\n                            damping: 20,\n                            delay: 0.1,\n                        }}\n                        className=\"absolute bottom-10 right-0 mb-2\"\n                    >\n                        <div className=\"flex flex-col items-end gap-2\">\n                            {options.map((option, index) => (\n                                <motion.div\n                                    key={index}\n                                    initial={{ opacity: 0, x: 20 }}\n                                    animate={{ opacity: 1, x: 0 }}\n                                    exit={{ opacity: 0, x: 20 }}\n                                    transition={{\n                                        duration: 0.3,\n                                        delay: index * 0.05,\n                                    }}\n                                >\n                                    <Button\n                                        onClick={option.onClick}\n                                        size=\"sm\"\n                                        className=\"flex items-center gap-2 bg-[#11111198] hover:bg-[#111111d1] shadow-[0_0_20px_rgba(0,0,0,0.2)] border-none rounded-xl backdrop-blur-sm\"\n                                    >\n                                        {option.Icon}\n                                        <span>{option.label}</span>\n                                    </Button>\n                                </motion.div>\n                            ))}\n                        </div>\n                    </motion.div>\n                )}\n            </AnimatePresence>\n        </div>\n    );\n};\n\nexport default FloatingActionMenu;\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/button.tsx",
      "content": "import * as React from \"react\";\r\n\r\nimport { cn } from \"@/registry/utilities/cn\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nconst buttonVariants = cva(\r\n\t\"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm text-white hover:text-gray-400 font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\r\n\t{\r\n\t\tvariants: {\r\n\t\t\tvariant: {\r\n\t\t\t\tsimple:\r\n\t\t\t\t\t\"bg-secondary relative z-10 bg-transparent hover:border-secondary hover:bg-secondary/50  border border-transparent dark:text-white text-sm md:text-sm transition font-medium duration-200  rounded-md px-4 py-2  flex items-center justify-center\",\r\n\t\t\t\tdefault: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n\t\t\t\tdestructive:\r\n\t\t\t\t\t\"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n\t\t\t\toutline:\r\n\t\t\t\t\t\"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\r\n\t\t\t\tsecondary:\r\n\t\t\t\t\t\"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n\t\t\t\tghost: \"hover:bg-accent hover:text-black hover:stroke-black dark:text-white text-black\",\r\n\t\t\t\tlink: \"text-primary underline-offset-4 hover:underline\",\r\n\t\t\t},\r\n\t\t\tsize: {\r\n\t\t\t\tdefault: \"h-10 px-4 py-2\",\r\n\t\t\t\tsm: \"h-9 rounded-md px-3\",\r\n\t\t\t\tlg: \"h-11 rounded-md px-8\",\r\n\t\t\t\ticon: \"h-10 w-10\",\r\n\t\t\t},\r\n\t\t},\r\n\t\tdefaultVariants: {\r\n\t\t\tvariant: \"default\",\r\n\t\t\tsize: \"default\",\r\n\t\t},\r\n\t}\r\n);\r\n\r\nexport interface ButtonProps\r\n\textends React.ButtonHTMLAttributes<HTMLButtonElement>,\r\n\t\tVariantProps<typeof buttonVariants> {\r\n\tasChild?: boolean;\r\n}\r\n\r\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n\t({ className, variant, size, asChild = false, ...props }, ref) => {\r\n\t\tconst Comp = asChild ? Slot : \"button\";\r\n\t\treturn (\r\n\t\t\t<Comp\r\n\t\t\t\tclassName={cn(buttonVariants({ variant, size, className }))}\r\n\t\t\t\tref={ref}\r\n\t\t\t\t{...props}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\nButton.displayName = \"Button\";\r\n\r\nexport { Button, buttonVariants };\r\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/utilities/cn.ts",
      "content": "import { ClassValue, clsx } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n\treturn twMerge(clsx(inputs));\r\n}\r\n",
      "type": "registry:ui"
    }
  ]
}