UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
fix: remove pointer json
Dillion Vermae5ae0b23c977
diff --git a/public/r/pointer-demo-1.json b/public/r/pointer-demo-1.jsondeleted file mode 100644index 7c8544e7..00000000--- a/public/r/pointer-demo-1.json+++ /dev/null@@ -1,19 +0,0 @@-{- "$schema": "https://ui.shadcn.com/schema/registry-item.json",- "name": "pointer-demo-1",- "type": "registry:example",- "title": "Pointer Demo 1",- "description": "Example showing a pointer effect component",- "registryDependencies": [- "https://magicui.design/r/dot-pattern",- "https://magicui.design/r/pointer"- ],- "files": [- {- "path": "registry/example/pointer-demo-1.tsx",- "content": "\"use client\";\n\nimport { PointerWrapper } from \"@/components/magicui/pointer\";\nimport { DotPattern } from \"@/components/magicui/dot-pattern\";\nimport { cn } from \"@/lib/utils\";\n\nexport default function PointerDemo1() {\n return (\n <PointerWrapper className=\"w-full\">\n <div className=\"relative h-[500px] w-full flex items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <p className=\"z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-white\">\n Pointer\n </p>\n <DotPattern\n className={cn(\n \"[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]\",\n )}\n />\n </div>\n </PointerWrapper>\n );\n}\n",- "type": "registry:example",- "target": "components/pointer-demo-1.tsx"- }- ]-}\ No newline at end of filediff --git a/public/r/pointer.json b/public/r/pointer.jsondeleted file mode 100644index a1b9baa9..00000000--- a/public/r/pointer.json+++ /dev/null@@ -1,18 +0,0 @@-{- "$schema": "https://ui.shadcn.com/schema/registry-item.json",- "name": "pointer",- "type": "registry:ui",- "title": "Pointer",- "description": "A component that displays a pointer when hovering over an element",- "dependencies": [- "motion"- ],- "files": [- {- "path": "registry/magicui/pointer.tsx",- "content": "\"use client\";\n\nimport React, { useState, useEffect, useRef } from \"react\";\n\nimport { AnimatePresence, motion, useMotionValue } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\n/**\n * @property {React.ReactNode} children - The child elements to be wrapped\n * @property {string} [className] - Optional CSS classes to be applied to the wrapper\n */\ninterface PointerWrapperProps {\n children: React.ReactNode;\n className?: string;\n}\n\n/**\n * A component that wraps content and adds a custom pointer animation when hovering\n * over the wrapped area. The pointer follows the mouse movement within the wrapped area.\n *\n * @component\n * @param {PointerWrapperProps} props - The component props\n */\nexport function PointerWrapper({ children, className }: PointerWrapperProps) {\n const x = useMotionValue(0);\n const y = useMotionValue(0);\n\n const ref = useRef<HTMLDivElement>(null);\n const [rect, setRect] = useState<DOMRect | null>(null);\n const [isInside, setIsInside] = useState<boolean>(false);\n\n useEffect(() => {\n if (ref.current) {\n setRect(ref.current.getBoundingClientRect());\n }\n }, []);\n\n function handleMouseMove(e: React.MouseEvent<HTMLDivElement>) {\n if (rect) {\n const scrollX = window.scrollX;\n const scrollY = window.scrollY;\n\n x.set(e.clientX - rect.left + scrollX);\n y.set(e.clientY - rect.top + scrollY);\n }\n }\n\n function handleMouseLeave() {\n setIsInside(false);\n }\n\n function handleMouseEnter() {\n setIsInside(true);\n }\n\n return (\n <div\n className={cn(\"relative\", className)}\n ref={ref}\n style={{\n cursor: \"none\",\n }}\n onMouseLeave={handleMouseLeave}\n onMouseEnter={handleMouseEnter}\n onMouseMove={handleMouseMove}\n >\n <AnimatePresence>{isInside && <Pointer x={x} y={y} />}</AnimatePresence>\n {children}\n </div>\n );\n}\n\n/**\n * @property {MotionValue<number>} x - The x-coordinate position of the pointer\n * @property {MotionValue<number>} y - The y-coordinate position of the pointer\n */\ninterface PointerProps {\n x: any;\n y: any;\n}\n\n/**\n * A custom pointer component that displays an animated arrow cursor\n *\n * @description Used internally by PointerWrapper to show the custom cursor\n *\n * @component\n * @param {PointerProps} props - The component props\n */\nfunction Pointer({ x, y }: PointerProps): JSX.Element {\n return (\n <motion.div\n className=\"h-4 w-4 rounded-full absolute z-50\"\n style={{\n top: y,\n left: x,\n pointerEvents: \"none\",\n }}\n initial={{\n scale: 1,\n opacity: 1,\n }}\n animate={{\n scale: 1,\n opacity: 1,\n }}\n exit={{\n scale: 0,\n opacity: 0,\n }}\n >\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"1\"\n viewBox=\"0 0 16 16\"\n className=\"h-6 w-6 text-black transform -rotate-[70deg] -translate-x-[12px] -translate-y-[10px] stroke-white\"\n height=\"1em\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M14.082 2.182a.5.5 0 0 1 .103.557L8.528 15.467a.5.5 0 0 1-.917-.007L5.57 10.694.803 8.652a.5.5 0 0 1-.006-.916l12.728-5.657a.5.5 0 0 1 .556.103z\"></path>\n </svg>\n </motion.div>\n );\n}\n",- "type": "registry:ui",- "target": "components/magicui/pointer.tsx"- }- ]-}\ No newline at end of file