{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ds-floating-card",
  "title": "FloatingCard",
  "description": "Card com tilt 3D sutil ao seguir o ponteiro, para exibir screenshots/mockups em heroes.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "components/ds/ds-floating-card.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n// ── Types ──\n\nexport interface FloatingCardProps extends React.HTMLAttributes<HTMLDivElement> {\n  /** Maximum tilt rotation in degrees. */\n  intensity?: number\n}\n\n// ── Component ──\n\n/**\n * A card that tilts subtly in 3D toward the pointer — for showcasing a\n * product screenshot or UI mockup in a hero. Writes the transform directly\n * to the DOM node (no re-render per pointermove). Disabled entirely under\n * `prefers-reduced-motion`.\n */\nexport const FloatingCard = React.forwardRef<HTMLDivElement, FloatingCardProps>(\n  ({ intensity = 8, className, style, children, ...props }, ref) => {\n    const innerRef = React.useRef<HTMLDivElement>(null)\n    const reducedMotionRef = React.useRef(false)\n\n    React.useEffect(() => {\n      reducedMotionRef.current = window.matchMedia(\n        \"(prefers-reduced-motion: reduce)\"\n      ).matches\n    }, [])\n\n    const setRefs = React.useCallback(\n      (node: HTMLDivElement | null) => {\n        innerRef.current = node\n        if (typeof ref === \"function\") ref(node)\n        else if (ref)\n          (ref as React.RefObject<HTMLDivElement | null>).current = node\n      },\n      [ref]\n    )\n\n    const handlePointerMove = React.useCallback(\n      (event: React.PointerEvent<HTMLDivElement>) => {\n        if (reducedMotionRef.current) return\n        const node = innerRef.current\n        if (!node) return\n        node.style.willChange = \"transform\"\n        const rect = node.getBoundingClientRect()\n        const px = (event.clientX - rect.left) / rect.width - 0.5\n        const py = (event.clientY - rect.top) / rect.height - 0.5\n        node.style.transform = `perspective(1000px) rotateX(${(-py * intensity).toFixed(2)}deg) rotateY(${(px * intensity).toFixed(2)}deg) scale3d(1.02, 1.02, 1.02)`\n      },\n      [intensity]\n    )\n\n    const handlePointerLeave = React.useCallback(() => {\n      if (innerRef.current) {\n        innerRef.current.style.willChange = \"auto\"\n        innerRef.current.style.transform = \"\"\n      }\n    }, [])\n\n    return (\n      <div\n        ref={setRefs}\n        onPointerMove={handlePointerMove}\n        onPointerLeave={handlePointerLeave}\n        className={cn(\n          \"rounded-2xl border border-border bg-card shadow-2xl transition-transform duration-300 ease-out hover:will-change-transform motion-reduce:transform-none motion-reduce:transition-none\",\n          className\n        )}\n        style={style}\n        data-slot=\"floating-card\"\n        {...props}\n      >\n        {children}\n      </div>\n    )\n  }\n)\nFloatingCard.displayName = \"FloatingCard\"\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}
