{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "native-dialog-baseui",
  "type": "registry:component",
  "title": "Native Dialog",
  "description": "A glassmorphism-styled dialog component with backdrop blur and smooth animations, inspired by native OS modals. (Base UI)",
  "registryDependencies": [
    "button"
  ],
  "dependencies": [
    "framer-motion",
    "react"
  ],
  "files": [
    {
      "path": "@uitripled/react-baseui/src/components/native/native-dialog-baseui.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Dialog } from \"@base-ui/react/dialog\";\nimport { motion, MotionConfig } from \"framer-motion\";\nimport { X } from \"lucide-react\";\nimport * as React from \"react\";\n\nconst NativeDialog = Dialog.Root;\n\nconst NativeDialogTrigger = React.forwardRef<\n  HTMLButtonElement,\n  React.ComponentPropsWithoutRef<typeof Dialog.Trigger> & { asChild?: boolean }\n>(({ asChild, children, ...props }, ref) => {\n  if (asChild && React.isValidElement(children)) {\n    return (\n      <Dialog.Trigger\n        ref={ref}\n        {...props}\n        render={children as React.ReactElement<Record<string, unknown>>}\n      />\n    );\n  }\n  return (\n    <Dialog.Trigger ref={ref} {...props}>\n      {children}\n    </Dialog.Trigger>\n  );\n});\nNativeDialogTrigger.displayName = \"NativeDialogTrigger\";\n\nconst NativeDialogPortal = Dialog.Portal;\n\nconst NativeDialogClose = Dialog.Close;\n\nconst NativeDialogOverlay = React.forwardRef<\n  HTMLDivElement,\n  React.ComponentPropsWithoutRef<typeof Dialog.Backdrop>\n>(({ className, ...props }, ref) => (\n  <Dialog.Backdrop\n    ref={ref}\n    className={cn(\"fixed inset-0 z-50 bg-black/20 backdrop-blur-sm\", className)}\n    render={(backdropProps, state) => {\n      const {\n        onDrag,\n        onDragStart,\n        onDragEnd,\n        onAnimationStart,\n        onAnimationEnd,\n        onTransitionEnd,\n        ...motionProps\n      } = backdropProps;\n      return (\n        <motion.div\n          {...(motionProps as any)}\n          initial={{ opacity: 0 }}\n          animate={{ opacity: state.open ? 1 : 0 }}\n          exit={{ opacity: 0 }}\n        />\n      );\n    }}\n    {...props}\n  />\n));\nNativeDialogOverlay.displayName = \"NativeDialogOverlay\";\n\nconst NativeDialogContent = React.forwardRef<\n  HTMLDivElement,\n  React.ComponentPropsWithoutRef<typeof Dialog.Popup>\n>(({ className, children, ...props }, ref) => (\n  <NativeDialogPortal>\n    <MotionConfig reducedMotion=\"user\">\n      <NativeDialogOverlay />\n      <Dialog.Popup\n        ref={ref}\n        className={cn(\n          \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-black/10 dark:border-white/10 bg-white/70 dark:bg-neutral-900/70 backdrop-blur-xl p-6 shadow-2xl sm:rounded-2xl\",\n          className\n        )}\n        render={(popupProps, state) => {\n          const {\n            onDrag,\n            onDragStart,\n            onDragEnd,\n            onAnimationStart,\n            onAnimationEnd,\n            onTransitionEnd,\n            ...motionProps\n          } = popupProps;\n          return (\n            <motion.div\n              {...(motionProps as any)}\n              initial={{ opacity: 0, scale: 0.95, filter: \"blur(10px)\" }}\n              animate={{\n                opacity: state.open ? 1 : 0,\n                scale: state.open ? 1 : 0.95,\n                filter: state.open ? \"blur(0px)\" : \"blur(10px)\",\n              }}\n              exit={{ opacity: 0, scale: 0.95, filter: \"blur(10px)\" }}\n              transition={{ type: \"spring\", duration: 0.4, bounce: 0 }}\n            >\n              {children}\n              <Dialog.Close className=\"absolute right-4 top-4 rounded-full p-1 opacity-70 ring-offset-background transition-[opacity,background-color,scale] duration-150 hover:opacity-100 hover:bg-black/5 dark:hover:bg-white/10 active:scale-[0.96] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none after:absolute after:-inset-2\">\n                <X aria-hidden=\"true\" className=\"h-4 w-4\" />\n                <span className=\"sr-only\">Close</span>\n              </Dialog.Close>\n            </motion.div>\n          );\n        }}\n        {...props}\n      />\n    </MotionConfig>\n  </NativeDialogPortal>\n));\nNativeDialogContent.displayName = \"NativeDialogContent\";\n\nconst NativeDialogHeader = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col space-y-1.5 text-center sm:text-left\",\n      className\n    )}\n    {...props}\n  />\n);\nNativeDialogHeader.displayName = \"NativeDialogHeader\";\n\nconst NativeDialogFooter = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n      className\n    )}\n    {...props}\n  />\n);\nNativeDialogFooter.displayName = \"NativeDialogFooter\";\n\nconst NativeDialogTitle = React.forwardRef<\n  HTMLHeadingElement,\n  React.ComponentPropsWithoutRef<typeof Dialog.Title>\n>(({ className, ...props }, ref) => (\n  <Dialog.Title\n    ref={ref}\n    className={cn(\n      \"text-lg font-semibold leading-none tracking-tight\",\n      className\n    )}\n    {...props}\n  />\n));\nNativeDialogTitle.displayName = \"NativeDialogTitle\";\n\nconst NativeDialogDescription = React.forwardRef<\n  HTMLParagraphElement,\n  React.ComponentPropsWithoutRef<typeof Dialog.Description>\n>(({ className, ...props }, ref) => (\n  <Dialog.Description\n    ref={ref}\n    className={cn(\"text-sm text-muted-foreground\", className)}\n    {...props}\n  />\n));\nNativeDialogDescription.displayName = \"NativeDialogDescription\";\n\nexport {\n  NativeDialog,\n  NativeDialogClose,\n  NativeDialogContent,\n  NativeDialogDescription,\n  NativeDialogFooter,\n  NativeDialogHeader,\n  NativeDialogOverlay,\n  NativeDialogPortal,\n  NativeDialogTitle,\n  NativeDialogTrigger,\n};\n",
      "type": "registry:component",
      "target": "components/uitripled/native-dialog-baseui.tsx"
    }
  ]
}