UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
Update import statement for ComponentPropsWithoutRef (#892)
ᖇᗩᑎᒎᗩᗰ ᗩ.780840b0d748
diff --git a/apps/www/public/llms-full.txt b/apps/www/public/llms-full.txtindex d7b30bec..12c40454 100644--- a/apps/www/public/llms-full.txt+++ b/apps/www/public/llms-full.txt@@ -2233,7 +2233,7 @@ Title: Animated Gradient TextDescription: An animated gradient background which transitions between colors for text.--- file: magicui/animated-gradient-text.tsx ----import { ComponentPropsWithoutRef } from "react"+import { type ComponentPropsWithoutRef } from "react"import { cn } from "@/lib/utils"@@ -2336,12 +2336,12 @@ Description: A animated background grid pattern made with SVGs, fully customizab"use client"import {- ComponentPropsWithoutRef,useCallback,useEffect,useId,useRef,useState,+ type ComponentPropsWithoutRef,} from "react"import { motion } from "motion/react"@@ -2542,10 +2542,10 @@ Description: A list that animates each item in sequence with a delay. Used to sh"use client"import React, {- ComponentPropsWithoutRef,useEffect,useMemo,useState,+ type ComponentPropsWithoutRef,} from "react"import { AnimatePresence, motion, type MotionProps } from "motion/react"@@ -2732,7 +2732,11 @@ Title: Animated Shiny TextDescription: A light glare effect which pans across text making it appear as if it is shimmering.--- file: magicui/animated-shiny-text.tsx ----import { ComponentPropsWithoutRef, CSSProperties, FC } from "react"+import {+ type ComponentPropsWithoutRef,+ type CSSProperties,+ type FC,+} from "react"import { cn } from "@/lib/utils"@@ -3070,7 +3074,7 @@ Title: Bento GridDescription: Bento grid is a layout used to showcase the features of a product in a simple and elegant way.--- file: magicui/bento-grid.tsx ----import { ComponentPropsWithoutRef, ReactNode } from "react"+import { type ComponentPropsWithoutRef, type ReactNode } from "react"import { ArrowRightIcon } from "@radix-ui/react-icons"import { cn } from "@/lib/utils"@@ -9485,7 +9489,7 @@ Title: MarqueeDescription: An infinite scrolling component that can be used to display text, images, or videos.--- file: magicui/marquee.tsx ----import { ComponentPropsWithoutRef } from "react"+import { type ComponentPropsWithoutRef } from "react"import { cn } from "@/lib/utils"@@ -10490,7 +10494,7 @@ Description: Animate numbers to count up or down to a target number--- file: magicui/number-ticker.tsx ---"use client"-import { ComponentPropsWithoutRef, useEffect, useRef } from "react"+import { useEffect, useRef, type ComponentPropsWithoutRef } from "react"import { useInView, useMotionValue, useSpring } from "motion/react"import { cn } from "@/lib/utils"@@ -10851,10 +10855,10 @@ Description: Particles are a fun way to add some visual flair to your website. T"use client"import React, {- ComponentPropsWithoutRef,useEffect,useRef,useState,+ type ComponentPropsWithoutRef,} from "react"import { cn } from "@/lib/utils"@@ -11990,7 +11994,7 @@ Title: RippleDescription: An animated ripple effect typically used behind elements to emphasize them.--- file: magicui/ripple.tsx ----import React, { ComponentPropsWithoutRef, CSSProperties } from "react"+import React, { type ComponentPropsWithoutRef, type CSSProperties } from "react"import { cn } from "@/lib/utils"@@ -12859,7 +12863,7 @@ Title: Shimmer ButtonDescription: A button with a shimmering light which travels around the perimeter.--- file: magicui/shimmer-button.tsx ----import React, { ComponentPropsWithoutRef, CSSProperties } from "react"+import React, { type ComponentPropsWithoutRef, type CSSProperties } from "react"import { cn } from "@/lib/utils"@@ -13651,7 +13655,7 @@ Description: The Spinning Text component animates text in a circular motion with--- file: magicui/spinning-text.tsx ---"use client"-import React, { ComponentPropsWithoutRef } from "react"+import React, { type ComponentPropsWithoutRef } from "react"import { motion, Transition, Variants } from "motion/react"import { cn } from "@/lib/utils"@@ -14877,7 +14881,12 @@ Description: Fade in text as you scroll down the page.--- file: magicui/text-reveal.tsx ---"use client"-import { ComponentPropsWithoutRef, FC, ReactNode, useRef } from "react"+import {+ useRef,+ type ComponentPropsWithoutRef,+ type FC,+ type ReactNode,+} from "react"import { motion, MotionValue, useScroll, useTransform } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/public/r/animated-gradient-text.json b/apps/www/public/r/animated-gradient-text.jsonindex 21c35376..01a9f25f 100644--- a/apps/www/public/r/animated-gradient-text.json+++ b/apps/www/public/r/animated-gradient-text.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/animated-gradient-text.tsx",- "content": "import { ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGradientTextProps extends ComponentPropsWithoutRef<\"div\"> {\n speed?: number\n colorFrom?: string\n colorTo?: string\n}\n\nexport function AnimatedGradientText({\n children,\n className,\n speed = 1,\n colorFrom = \"#ffaa40\",\n colorTo = \"#9c40ff\",\n ...props\n}: AnimatedGradientTextProps) {\n return (\n <span\n style={\n {\n \"--bg-size\": `${speed * 300}%`,\n \"--color-from\": colorFrom,\n \"--color-to\": colorTo,\n } as React.CSSProperties\n }\n className={cn(\n `animate-gradient inline bg-gradient-to-r from-[var(--color-from)] via-[var(--color-to)] to-[var(--color-from)] bg-[length:var(--bg-size)_100%] bg-clip-text text-transparent`,\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n}\n",+ "content": "import { type ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGradientTextProps extends ComponentPropsWithoutRef<\"div\"> {\n speed?: number\n colorFrom?: string\n colorTo?: string\n}\n\nexport function AnimatedGradientText({\n children,\n className,\n speed = 1,\n colorFrom = \"#ffaa40\",\n colorTo = \"#9c40ff\",\n ...props\n}: AnimatedGradientTextProps) {\n return (\n <span\n style={\n {\n \"--bg-size\": `${speed * 300}%`,\n \"--color-from\": colorFrom,\n \"--color-to\": colorTo,\n } as React.CSSProperties\n }\n className={cn(\n `animate-gradient inline bg-gradient-to-r from-[var(--color-from)] via-[var(--color-to)] to-[var(--color-from)] bg-[length:var(--bg-size)_100%] bg-clip-text text-transparent`,\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n}\n","type": "registry:ui"}],diff --git a/apps/www/public/r/animated-grid-pattern.json b/apps/www/public/r/animated-grid-pattern.jsonindex 2743c629..51ec70c8 100644--- a/apps/www/public/r/animated-grid-pattern.json+++ b/apps/www/public/r/animated-grid-pattern.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/animated-grid-pattern.tsx",- "content": "\"use client\"\n\nimport {\n ComponentPropsWithoutRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGridPatternProps extends ComponentPropsWithoutRef<\"svg\"> {\n width?: number\n height?: number\n x?: number\n y?: number\n strokeDasharray?: number\n numSquares?: number\n maxOpacity?: number\n duration?: number\n repeatDelay?: number\n}\n\ntype Square = {\n id: number\n pos: [number, number]\n iteration: number\n}\n\nexport function AnimatedGridPattern({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n numSquares = 50,\n className,\n maxOpacity = 0.5,\n duration = 4,\n repeatDelay = 0.5,\n ...props\n}: AnimatedGridPatternProps) {\n const id = useId()\n const containerRef = useRef<SVGSVGElement | null>(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n const [squares, setSquares] = useState<Array<Square>>([])\n\n const getPos = useCallback((): [number, number] => {\n return [\n Math.floor((Math.random() * dimensions.width) / width),\n Math.floor((Math.random() * dimensions.height) / height),\n ]\n }, [dimensions.height, dimensions.width, height, width])\n\n const generateSquares = useCallback(\n (count: number) => {\n return Array.from({ length: count }, (_, i) => ({\n id: i,\n pos: getPos(),\n iteration: 0,\n }))\n },\n [getPos]\n )\n\n const updateSquarePosition = useCallback(\n (squareId: number) => {\n setSquares((currentSquares) => {\n const current = currentSquares[squareId]\n if (!current || current.id !== squareId) return currentSquares\n\n const nextSquares = currentSquares.slice()\n nextSquares[squareId] = {\n ...current,\n pos: getPos(),\n iteration: current.iteration + 1,\n }\n\n return nextSquares\n })\n },\n [getPos]\n )\n\n useEffect(() => {\n if (dimensions.width && dimensions.height) {\n setSquares(generateSquares(numSquares))\n }\n }, [dimensions.width, dimensions.height, generateSquares, numSquares])\n\n useEffect(() => {\n const element = containerRef.current\n if (!element) return\n\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setDimensions((currentDimensions) => {\n const nextWidth = entry.contentRect.width\n const nextHeight = entry.contentRect.height\n if (\n currentDimensions.width === nextWidth &&\n currentDimensions.height === nextHeight\n ) {\n return currentDimensions\n }\n return { width: nextWidth, height: nextHeight }\n })\n }\n })\n\n resizeObserver.observe(element)\n\n return () => {\n resizeObserver.disconnect()\n }\n }, [])\n\n return (\n <svg\n ref={containerRef}\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30\",\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" fill={`url(#${id})`} />\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(({ pos: [squareX, squareY], id, iteration }, index) => (\n <motion.rect\n initial={{ opacity: 0 }}\n animate={{ opacity: maxOpacity }}\n transition={{\n duration,\n repeat: 1,\n delay: index * 0.1,\n repeatType: \"reverse\",\n repeatDelay,\n }}\n onAnimationComplete={() => updateSquarePosition(id)}\n key={`${id}-${iteration}`}\n width={width - 1}\n height={height - 1}\n x={squareX * width + 1}\n y={squareY * height + 1}\n fill=\"currentColor\"\n strokeWidth=\"0\"\n />\n ))}\n </svg>\n </svg>\n )\n}\n",+ "content": "\"use client\"\n\nimport {\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGridPatternProps extends ComponentPropsWithoutRef<\"svg\"> {\n width?: number\n height?: number\n x?: number\n y?: number\n strokeDasharray?: number\n numSquares?: number\n maxOpacity?: number\n duration?: number\n repeatDelay?: number\n}\n\ntype Square = {\n id: number\n pos: [number, number]\n iteration: number\n}\n\nexport function AnimatedGridPattern({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n numSquares = 50,\n className,\n maxOpacity = 0.5,\n duration = 4,\n repeatDelay = 0.5,\n ...props\n}: AnimatedGridPatternProps) {\n const id = useId()\n const containerRef = useRef<SVGSVGElement | null>(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n const [squares, setSquares] = useState<Array<Square>>([])\n\n const getPos = useCallback((): [number, number] => {\n return [\n Math.floor((Math.random() * dimensions.width) / width),\n Math.floor((Math.random() * dimensions.height) / height),\n ]\n }, [dimensions.height, dimensions.width, height, width])\n\n const generateSquares = useCallback(\n (count: number) => {\n return Array.from({ length: count }, (_, i) => ({\n id: i,\n pos: getPos(),\n iteration: 0,\n }))\n },\n [getPos]\n )\n\n const updateSquarePosition = useCallback(\n (squareId: number) => {\n setSquares((currentSquares) => {\n const current = currentSquares[squareId]\n if (!current || current.id !== squareId) return currentSquares\n\n const nextSquares = currentSquares.slice()\n nextSquares[squareId] = {\n ...current,\n pos: getPos(),\n iteration: current.iteration + 1,\n }\n\n return nextSquares\n })\n },\n [getPos]\n )\n\n useEffect(() => {\n if (dimensions.width && dimensions.height) {\n setSquares(generateSquares(numSquares))\n }\n }, [dimensions.width, dimensions.height, generateSquares, numSquares])\n\n useEffect(() => {\n const element = containerRef.current\n if (!element) return\n\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setDimensions((currentDimensions) => {\n const nextWidth = entry.contentRect.width\n const nextHeight = entry.contentRect.height\n if (\n currentDimensions.width === nextWidth &&\n currentDimensions.height === nextHeight\n ) {\n return currentDimensions\n }\n return { width: nextWidth, height: nextHeight }\n })\n }\n })\n\n resizeObserver.observe(element)\n\n return () => {\n resizeObserver.disconnect()\n }\n }, [])\n\n return (\n <svg\n ref={containerRef}\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30\",\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" fill={`url(#${id})`} />\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(({ pos: [squareX, squareY], id, iteration }, index) => (\n <motion.rect\n initial={{ opacity: 0 }}\n animate={{ opacity: maxOpacity }}\n transition={{\n duration,\n repeat: 1,\n delay: index * 0.1,\n repeatType: \"reverse\",\n repeatDelay,\n }}\n onAnimationComplete={() => updateSquarePosition(id)}\n key={`${id}-${iteration}`}\n width={width - 1}\n height={height - 1}\n x={squareX * width + 1}\n y={squareY * height + 1}\n fill=\"currentColor\"\n strokeWidth=\"0\"\n />\n ))}\n </svg>\n </svg>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/animated-list.json b/apps/www/public/r/animated-list.jsonindex dd301b5e..0c7ac391 100644--- a/apps/www/public/r/animated-list.json+++ b/apps/www/public/r/animated-list.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/animated-list.tsx",- "content": "\"use client\"\n\nimport React, {\n ComponentPropsWithoutRef,\n useEffect,\n useMemo,\n useState,\n} from \"react\"\nimport { AnimatePresence, motion, type MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport function AnimatedListItem({ children }: { children: React.ReactNode }) {\n const animations: MotionProps = {\n initial: { scale: 0, opacity: 0 },\n animate: { scale: 1, opacity: 1, originY: 0 },\n exit: { scale: 0, opacity: 0 },\n transition: { type: \"spring\", stiffness: 350, damping: 40 },\n }\n\n return (\n <motion.div {...animations} layout className=\"mx-auto w-full\">\n {children}\n </motion.div>\n )\n}\n\nexport interface AnimatedListProps extends ComponentPropsWithoutRef<\"div\"> {\n children: React.ReactNode\n delay?: number\n}\n\nexport const AnimatedList = React.memo(\n ({ children, className, delay = 1000, ...props }: AnimatedListProps) => {\n const [index, setIndex] = useState(0)\n const childrenArray = useMemo(\n () => React.Children.toArray(children),\n [children]\n )\n\n useEffect(() => {\n if (index < childrenArray.length - 1) {\n const timeout = setTimeout(() => {\n setIndex((prevIndex) => (prevIndex + 1) % childrenArray.length)\n }, delay)\n\n return () => clearTimeout(timeout)\n }\n }, [index, delay, childrenArray.length])\n\n const itemsToShow = useMemo(() => {\n const result = childrenArray.slice(0, index + 1).reverse()\n return result\n }, [index, childrenArray])\n\n return (\n <div\n className={cn(`flex flex-col items-center gap-4`, className)}\n {...props}\n >\n <AnimatePresence>\n {itemsToShow.map((item) => (\n <AnimatedListItem key={(item as React.ReactElement).key}>\n {item}\n </AnimatedListItem>\n ))}\n </AnimatePresence>\n </div>\n )\n }\n)\n\nAnimatedList.displayName = \"AnimatedList\"\n",+ "content": "\"use client\"\n\nimport React, {\n useEffect,\n useMemo,\n useState,\n type ComponentPropsWithoutRef,\n} from \"react\"\nimport { AnimatePresence, motion, type MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport function AnimatedListItem({ children }: { children: React.ReactNode }) {\n const animations: MotionProps = {\n initial: { scale: 0, opacity: 0 },\n animate: { scale: 1, opacity: 1, originY: 0 },\n exit: { scale: 0, opacity: 0 },\n transition: { type: \"spring\", stiffness: 350, damping: 40 },\n }\n\n return (\n <motion.div {...animations} layout className=\"mx-auto w-full\">\n {children}\n </motion.div>\n )\n}\n\nexport interface AnimatedListProps extends ComponentPropsWithoutRef<\"div\"> {\n children: React.ReactNode\n delay?: number\n}\n\nexport const AnimatedList = React.memo(\n ({ children, className, delay = 1000, ...props }: AnimatedListProps) => {\n const [index, setIndex] = useState(0)\n const childrenArray = useMemo(\n () => React.Children.toArray(children),\n [children]\n )\n\n useEffect(() => {\n if (index < childrenArray.length - 1) {\n const timeout = setTimeout(() => {\n setIndex((prevIndex) => (prevIndex + 1) % childrenArray.length)\n }, delay)\n\n return () => clearTimeout(timeout)\n }\n }, [index, delay, childrenArray.length])\n\n const itemsToShow = useMemo(() => {\n const result = childrenArray.slice(0, index + 1).reverse()\n return result\n }, [index, childrenArray])\n\n return (\n <div\n className={cn(`flex flex-col items-center gap-4`, className)}\n {...props}\n >\n <AnimatePresence>\n {itemsToShow.map((item) => (\n <AnimatedListItem key={(item as React.ReactElement).key}>\n {item}\n </AnimatedListItem>\n ))}\n </AnimatePresence>\n </div>\n )\n }\n)\n\nAnimatedList.displayName = \"AnimatedList\"\n","type": "registry:ui"}]diff --git a/apps/www/public/r/animated-shiny-text.json b/apps/www/public/r/animated-shiny-text.jsonindex 3571e585..551353b8 100644--- a/apps/www/public/r/animated-shiny-text.json+++ b/apps/www/public/r/animated-shiny-text.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/animated-shiny-text.tsx",- "content": "import { ComponentPropsWithoutRef, CSSProperties, FC } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedShinyTextProps extends ComponentPropsWithoutRef<\"span\"> {\n shimmerWidth?: number\n}\n\nexport const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({\n children,\n className,\n shimmerWidth = 100,\n ...props\n}) => {\n return (\n <span\n style={\n {\n \"--shiny-width\": `${shimmerWidth}px`,\n } as CSSProperties\n }\n className={cn(\n \"mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70\",\n\n // Shine effect\n \"animate-shiny-text [background-size:var(--shiny-width)_100%] bg-clip-text [background-position:0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]\",\n\n // Shine gradient\n \"bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80\",\n\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n}\n",+ "content": "import {\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type FC,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedShinyTextProps extends ComponentPropsWithoutRef<\"span\"> {\n shimmerWidth?: number\n}\n\nexport const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({\n children,\n className,\n shimmerWidth = 100,\n ...props\n}) => {\n return (\n <span\n style={\n {\n \"--shiny-width\": `${shimmerWidth}px`,\n } as CSSProperties\n }\n className={cn(\n \"mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70\",\n\n // Shine effect\n \"animate-shiny-text [background-size:var(--shiny-width)_100%] bg-clip-text [background-position:0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]\",\n\n // Shine gradient\n \"bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80\",\n\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n}\n","type": "registry:ui"}],diff --git a/apps/www/public/r/bento-grid.json b/apps/www/public/r/bento-grid.jsonindex 16f1c9f9..da9bf103 100644--- a/apps/www/public/r/bento-grid.json+++ b/apps/www/public/r/bento-grid.json@@ -13,7 +13,7 @@"files": [{"path": "registry/magicui/bento-grid.tsx",- "content": "import { ComponentPropsWithoutRef, ReactNode } from \"react\"\nimport { ArrowRightIcon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ninterface BentoGridProps extends ComponentPropsWithoutRef<\"div\"> {\n children: ReactNode\n className?: string\n}\n\ninterface BentoCardProps extends ComponentPropsWithoutRef<\"div\"> {\n name: string\n className: string\n background: ReactNode\n Icon: React.ElementType\n description: string\n href: string\n cta: string\n}\n\nconst BentoGrid = ({ children, className, ...props }: BentoGridProps) => {\n return (\n <div\n className={cn(\n \"grid w-full auto-rows-[22rem] grid-cols-3 gap-4\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nconst BentoCard = ({\n name,\n className,\n background,\n Icon,\n description,\n href,\n cta,\n ...props\n}: BentoCardProps) => (\n <div\n key={name}\n className={cn(\n \"group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl\",\n // light styles\n \"bg-background [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]\",\n // dark styles\n \"dark:bg-background transform-gpu dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] dark:[border:1px_solid_rgba(255,255,255,.1)]\",\n className\n )}\n {...props}\n >\n <div>{background}</div>\n <div className=\"p-4\">\n <div className=\"pointer-events-none z-10 flex transform-gpu flex-col gap-1 transition-all duration-300 lg:group-hover:-translate-y-10\">\n <Icon className=\"h-12 w-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75\" />\n <h3 className=\"text-xl font-semibold text-neutral-700 dark:text-neutral-300\">\n {name}\n </h3>\n <p className=\"max-w-lg text-neutral-400\">{description}</p>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none flex w-full translate-y-0 transform-gpu flex-row items-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:hidden\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none absolute bottom-0 hidden w-full translate-y-10 transform-gpu flex-row items-center p-4 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:flex\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n\n <div className=\"pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10\" />\n </div>\n)\n\nexport { BentoCard, BentoGrid }\n",+ "content": "import { type ComponentPropsWithoutRef, type ReactNode } from \"react\"\nimport { ArrowRightIcon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ninterface BentoGridProps extends ComponentPropsWithoutRef<\"div\"> {\n children: ReactNode\n className?: string\n}\n\ninterface BentoCardProps extends ComponentPropsWithoutRef<\"div\"> {\n name: string\n className: string\n background: ReactNode\n Icon: React.ElementType\n description: string\n href: string\n cta: string\n}\n\nconst BentoGrid = ({ children, className, ...props }: BentoGridProps) => {\n return (\n <div\n className={cn(\n \"grid w-full auto-rows-[22rem] grid-cols-3 gap-4\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nconst BentoCard = ({\n name,\n className,\n background,\n Icon,\n description,\n href,\n cta,\n ...props\n}: BentoCardProps) => (\n <div\n key={name}\n className={cn(\n \"group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl\",\n // light styles\n \"bg-background [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]\",\n // dark styles\n \"dark:bg-background transform-gpu dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] dark:[border:1px_solid_rgba(255,255,255,.1)]\",\n className\n )}\n {...props}\n >\n <div>{background}</div>\n <div className=\"p-4\">\n <div className=\"pointer-events-none z-10 flex transform-gpu flex-col gap-1 transition-all duration-300 lg:group-hover:-translate-y-10\">\n <Icon className=\"h-12 w-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75\" />\n <h3 className=\"text-xl font-semibold text-neutral-700 dark:text-neutral-300\">\n {name}\n </h3>\n <p className=\"max-w-lg text-neutral-400\">{description}</p>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none flex w-full translate-y-0 transform-gpu flex-row items-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:hidden\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none absolute bottom-0 hidden w-full translate-y-10 transform-gpu flex-row items-center p-4 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:flex\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n\n <div className=\"pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10\" />\n </div>\n)\n\nexport { BentoCard, BentoGrid }\n","type": "registry:ui"}]diff --git a/apps/www/public/r/marquee.json b/apps/www/public/r/marquee.jsonindex f83f6e70..c26823e1 100644--- a/apps/www/public/r/marquee.json+++ b/apps/www/public/r/marquee.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/marquee.tsx",- "content": "import { ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MarqueeProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number\n}\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n ...props\n}: MarqueeProps) {\n return (\n <div\n {...props}\n className={cn(\n \"group flex [gap:var(--gap)] overflow-hidden p-2 [--duration:40s] [--gap:1rem]\",\n {\n \"flex-row\": !vertical,\n \"flex-col\": vertical,\n },\n className\n )}\n >\n {Array(repeat)\n .fill(0)\n .map((_, i) => (\n <div\n key={i}\n className={cn(\"flex shrink-0 justify-around [gap:var(--gap)]\", {\n \"animate-marquee flex-row\": !vertical,\n \"animate-marquee-vertical flex-col\": vertical,\n \"group-hover:[animation-play-state:paused]\": pauseOnHover,\n \"[animation-direction:reverse]\": reverse,\n })}\n >\n {children}\n </div>\n ))}\n </div>\n )\n}\n",+ "content": "import { type ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MarqueeProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number\n}\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n ...props\n}: MarqueeProps) {\n return (\n <div\n {...props}\n className={cn(\n \"group flex [gap:var(--gap)] overflow-hidden p-2 [--duration:40s] [--gap:1rem]\",\n {\n \"flex-row\": !vertical,\n \"flex-col\": vertical,\n },\n className\n )}\n >\n {Array(repeat)\n .fill(0)\n .map((_, i) => (\n <div\n key={i}\n className={cn(\"flex shrink-0 justify-around [gap:var(--gap)]\", {\n \"animate-marquee flex-row\": !vertical,\n \"animate-marquee-vertical flex-col\": vertical,\n \"group-hover:[animation-play-state:paused]\": pauseOnHover,\n \"[animation-direction:reverse]\": reverse,\n })}\n >\n {children}\n </div>\n ))}\n </div>\n )\n}\n","type": "registry:ui"}],diff --git a/apps/www/public/r/number-ticker.json b/apps/www/public/r/number-ticker.jsonindex b0af0b47..c2962ae9 100644--- a/apps/www/public/r/number-ticker.json+++ b/apps/www/public/r/number-ticker.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/number-ticker.tsx",- "content": "\"use client\"\n\nimport { ComponentPropsWithoutRef, useEffect, useRef } from \"react\"\nimport { useInView, useMotionValue, useSpring } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface NumberTickerProps extends ComponentPropsWithoutRef<\"span\"> {\n value: number\n startValue?: number\n direction?: \"up\" | \"down\"\n delay?: number\n decimalPlaces?: number\n}\n\nexport function NumberTicker({\n value,\n startValue = 0,\n direction = \"up\",\n delay = 0,\n className,\n decimalPlaces = 0,\n ...props\n}: NumberTickerProps) {\n const ref = useRef<HTMLSpanElement>(null)\n const motionValue = useMotionValue(direction === \"down\" ? value : startValue)\n const springValue = useSpring(motionValue, {\n damping: 60,\n stiffness: 100,\n })\n const isInView = useInView(ref, { once: true, margin: \"0px\" })\n\n useEffect(() => {\n if (isInView) {\n const timer = setTimeout(() => {\n motionValue.set(direction === \"down\" ? startValue : value)\n }, delay * 1000)\n return () => clearTimeout(timer)\n }\n }, [motionValue, isInView, delay, value, direction, startValue])\n\n useEffect(\n () =>\n springValue.on(\"change\", (latest) => {\n if (ref.current) {\n ref.current.textContent = Intl.NumberFormat(\"en-US\", {\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces,\n }).format(Number(latest.toFixed(decimalPlaces)))\n }\n }),\n [springValue, decimalPlaces]\n )\n\n return (\n <span\n ref={ref}\n className={cn(\n \"inline-block tracking-wider text-black tabular-nums dark:text-white\",\n className\n )}\n {...props}\n >\n {startValue}\n </span>\n )\n}\n",+ "content": "\"use client\"\n\nimport { useEffect, useRef, type ComponentPropsWithoutRef } from \"react\"\nimport { useInView, useMotionValue, useSpring } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface NumberTickerProps extends ComponentPropsWithoutRef<\"span\"> {\n value: number\n startValue?: number\n direction?: \"up\" | \"down\"\n delay?: number\n decimalPlaces?: number\n}\n\nexport function NumberTicker({\n value,\n startValue = 0,\n direction = \"up\",\n delay = 0,\n className,\n decimalPlaces = 0,\n ...props\n}: NumberTickerProps) {\n const ref = useRef<HTMLSpanElement>(null)\n const motionValue = useMotionValue(direction === \"down\" ? value : startValue)\n const springValue = useSpring(motionValue, {\n damping: 60,\n stiffness: 100,\n })\n const isInView = useInView(ref, { once: true, margin: \"0px\" })\n\n useEffect(() => {\n if (isInView) {\n const timer = setTimeout(() => {\n motionValue.set(direction === \"down\" ? startValue : value)\n }, delay * 1000)\n return () => clearTimeout(timer)\n }\n }, [motionValue, isInView, delay, value, direction, startValue])\n\n useEffect(\n () =>\n springValue.on(\"change\", (latest) => {\n if (ref.current) {\n ref.current.textContent = Intl.NumberFormat(\"en-US\", {\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces,\n }).format(Number(latest.toFixed(decimalPlaces)))\n }\n }),\n [springValue, decimalPlaces]\n )\n\n return (\n <span\n ref={ref}\n className={cn(\n \"inline-block tracking-wider text-black tabular-nums dark:text-white\",\n className\n )}\n {...props}\n >\n {startValue}\n </span>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/particles.json b/apps/www/public/r/particles.jsonindex b089e537..0450f0c3 100644--- a/apps/www/public/r/particles.json+++ b/apps/www/public/r/particles.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/particles.tsx",- "content": "\"use client\"\n\nimport React, {\n ComponentPropsWithoutRef,\n useEffect,\n useRef,\n useState,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MousePosition {\n x: number\n y: number\n}\n\nfunction MousePosition(): MousePosition {\n const [mousePosition, setMousePosition] = useState<MousePosition>({\n x: 0,\n y: 0,\n })\n\n useEffect(() => {\n const handleMouseMove = (event: MouseEvent) => {\n setMousePosition({ x: event.clientX, y: event.clientY })\n }\n\n window.addEventListener(\"mousemove\", handleMouseMove)\n\n return () => {\n window.removeEventListener(\"mousemove\", handleMouseMove)\n }\n }, [])\n\n return mousePosition\n}\n\ninterface ParticlesProps extends ComponentPropsWithoutRef<\"div\"> {\n className?: string\n quantity?: number\n staticity?: number\n ease?: number\n size?: number\n refresh?: boolean\n color?: string\n vx?: number\n vy?: number\n}\n\nfunction hexToRgb(hex: string): number[] {\n hex = hex.replace(\"#\", \"\")\n\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\")\n }\n\n const hexInt = parseInt(hex, 16)\n const red = (hexInt >> 16) & 255\n const green = (hexInt >> 8) & 255\n const blue = hexInt & 255\n return [red, green, blue]\n}\n\ntype Circle = {\n x: number\n y: number\n translateX: number\n translateY: number\n size: number\n alpha: number\n targetAlpha: number\n dx: number\n dy: number\n magnetism: number\n}\n\nexport const Particles: React.FC<ParticlesProps> = ({\n className = \"\",\n quantity = 100,\n staticity = 50,\n ease = 50,\n size = 0.4,\n refresh = false,\n color = \"#ffffff\",\n vx = 0,\n vy = 0,\n ...props\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const canvasContainerRef = useRef<HTMLDivElement>(null)\n const context = useRef<CanvasRenderingContext2D | null>(null)\n const circles = useRef<Circle[]>([])\n const mousePosition = MousePosition()\n const mouse = useRef<{ x: number; y: number }>({ x: 0, y: 0 })\n const canvasSize = useRef<{ w: number; h: number }>({ w: 0, h: 0 })\n const dpr = typeof window !== \"undefined\" ? window.devicePixelRatio : 1\n const rafID = useRef<number | null>(null)\n const resizeTimeout = useRef<NodeJS.Timeout | null>(null)\n\n useEffect(() => {\n if (canvasRef.current) {\n context.current = canvasRef.current.getContext(\"2d\")\n }\n initCanvas()\n animate()\n\n const handleResize = () => {\n if (resizeTimeout.current) {\n clearTimeout(resizeTimeout.current)\n }\n resizeTimeout.current = setTimeout(() => {\n initCanvas()\n }, 200)\n }\n\n window.addEventListener(\"resize\", handleResize)\n\n return () => {\n if (rafID.current != null) {\n window.cancelAnimationFrame(rafID.current)\n }\n if (resizeTimeout.current) {\n clearTimeout(resizeTimeout.current)\n }\n window.removeEventListener(\"resize\", handleResize)\n }\n }, [color])\n\n useEffect(() => {\n onMouseMove()\n }, [mousePosition.x, mousePosition.y])\n\n useEffect(() => {\n initCanvas()\n }, [refresh])\n\n const initCanvas = () => {\n resizeCanvas()\n drawParticles()\n }\n\n const onMouseMove = () => {\n if (canvasRef.current) {\n const rect = canvasRef.current.getBoundingClientRect()\n const { w, h } = canvasSize.current\n const x = mousePosition.x - rect.left - w / 2\n const y = mousePosition.y - rect.top - h / 2\n const inside = x < w / 2 && x > -w / 2 && y < h / 2 && y > -h / 2\n if (inside) {\n mouse.current.x = x\n mouse.current.y = y\n }\n }\n }\n\n const resizeCanvas = () => {\n if (canvasContainerRef.current && canvasRef.current && context.current) {\n canvasSize.current.w = canvasContainerRef.current.offsetWidth\n canvasSize.current.h = canvasContainerRef.current.offsetHeight\n\n canvasRef.current.width = canvasSize.current.w * dpr\n canvasRef.current.height = canvasSize.current.h * dpr\n canvasRef.current.style.width = `${canvasSize.current.w}px`\n canvasRef.current.style.height = `${canvasSize.current.h}px`\n context.current.scale(dpr, dpr)\n\n // Clear existing particles and create new ones with exact quantity\n circles.current = []\n for (let i = 0; i < quantity; i++) {\n const circle = circleParams()\n drawCircle(circle)\n }\n }\n }\n\n const circleParams = (): Circle => {\n const x = Math.floor(Math.random() * canvasSize.current.w)\n const y = Math.floor(Math.random() * canvasSize.current.h)\n const translateX = 0\n const translateY = 0\n const pSize = Math.floor(Math.random() * 2) + size\n const alpha = 0\n const targetAlpha = parseFloat((Math.random() * 0.6 + 0.1).toFixed(1))\n const dx = (Math.random() - 0.5) * 0.1\n const dy = (Math.random() - 0.5) * 0.1\n const magnetism = 0.1 + Math.random() * 4\n return {\n x,\n y,\n translateX,\n translateY,\n size: pSize,\n alpha,\n targetAlpha,\n dx,\n dy,\n magnetism,\n }\n }\n\n const rgb = hexToRgb(color)\n\n const drawCircle = (circle: Circle, update = false) => {\n if (context.current) {\n const { x, y, translateX, translateY, size, alpha } = circle\n context.current.translate(translateX, translateY)\n context.current.beginPath()\n context.current.arc(x, y, size, 0, 2 * Math.PI)\n context.current.fillStyle = `rgba(${rgb.join(\", \")}, ${alpha})`\n context.current.fill()\n context.current.setTransform(dpr, 0, 0, dpr, 0, 0)\n\n if (!update) {\n circles.current.push(circle)\n }\n }\n }\n\n const clearContext = () => {\n if (context.current) {\n context.current.clearRect(\n 0,\n 0,\n canvasSize.current.w,\n canvasSize.current.h\n )\n }\n }\n\n const drawParticles = () => {\n clearContext()\n const particleCount = quantity\n for (let i = 0; i < particleCount; i++) {\n const circle = circleParams()\n drawCircle(circle)\n }\n }\n\n const remapValue = (\n value: number,\n start1: number,\n end1: number,\n start2: number,\n end2: number\n ): number => {\n const remapped =\n ((value - start1) * (end2 - start2)) / (end1 - start1) + start2\n return remapped > 0 ? remapped : 0\n }\n\n const animate = () => {\n clearContext()\n circles.current.forEach((circle: Circle, i: number) => {\n // Handle the alpha value\n const edge = [\n circle.x + circle.translateX - circle.size, // distance from left edge\n canvasSize.current.w - circle.x - circle.translateX - circle.size, // distance from right edge\n circle.y + circle.translateY - circle.size, // distance from top edge\n canvasSize.current.h - circle.y - circle.translateY - circle.size, // distance from bottom edge\n ]\n const closestEdge = edge.reduce((a, b) => Math.min(a, b))\n const remapClosestEdge = parseFloat(\n remapValue(closestEdge, 0, 20, 0, 1).toFixed(2)\n )\n if (remapClosestEdge > 1) {\n circle.alpha += 0.02\n if (circle.alpha > circle.targetAlpha) {\n circle.alpha = circle.targetAlpha\n }\n } else {\n circle.alpha = circle.targetAlpha * remapClosestEdge\n }\n circle.x += circle.dx + vx\n circle.y += circle.dy + vy\n circle.translateX +=\n (mouse.current.x / (staticity / circle.magnetism) - circle.translateX) /\n ease\n circle.translateY +=\n (mouse.current.y / (staticity / circle.magnetism) - circle.translateY) /\n ease\n\n drawCircle(circle, true)\n\n // circle gets out of the canvas\n if (\n circle.x < -circle.size ||\n circle.x > canvasSize.current.w + circle.size ||\n circle.y < -circle.size ||\n circle.y > canvasSize.current.h + circle.size\n ) {\n // remove the circle from the array\n circles.current.splice(i, 1)\n // create a new circle\n const newCircle = circleParams()\n drawCircle(newCircle)\n }\n })\n rafID.current = window.requestAnimationFrame(animate)\n }\n\n return (\n <div\n className={cn(\"pointer-events-none\", className)}\n ref={canvasContainerRef}\n aria-hidden=\"true\"\n {...props}\n >\n <canvas ref={canvasRef} className=\"size-full\" />\n </div>\n )\n}\n",+ "content": "\"use client\"\n\nimport React, {\n useEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MousePosition {\n x: number\n y: number\n}\n\nfunction MousePosition(): MousePosition {\n const [mousePosition, setMousePosition] = useState<MousePosition>({\n x: 0,\n y: 0,\n })\n\n useEffect(() => {\n const handleMouseMove = (event: MouseEvent) => {\n setMousePosition({ x: event.clientX, y: event.clientY })\n }\n\n window.addEventListener(\"mousemove\", handleMouseMove)\n\n return () => {\n window.removeEventListener(\"mousemove\", handleMouseMove)\n }\n }, [])\n\n return mousePosition\n}\n\ninterface ParticlesProps extends ComponentPropsWithoutRef<\"div\"> {\n className?: string\n quantity?: number\n staticity?: number\n ease?: number\n size?: number\n refresh?: boolean\n color?: string\n vx?: number\n vy?: number\n}\n\nfunction hexToRgb(hex: string): number[] {\n hex = hex.replace(\"#\", \"\")\n\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\")\n }\n\n const hexInt = parseInt(hex, 16)\n const red = (hexInt >> 16) & 255\n const green = (hexInt >> 8) & 255\n const blue = hexInt & 255\n return [red, green, blue]\n}\n\ntype Circle = {\n x: number\n y: number\n translateX: number\n translateY: number\n size: number\n alpha: number\n targetAlpha: number\n dx: number\n dy: number\n magnetism: number\n}\n\nexport const Particles: React.FC<ParticlesProps> = ({\n className = \"\",\n quantity = 100,\n staticity = 50,\n ease = 50,\n size = 0.4,\n refresh = false,\n color = \"#ffffff\",\n vx = 0,\n vy = 0,\n ...props\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const canvasContainerRef = useRef<HTMLDivElement>(null)\n const context = useRef<CanvasRenderingContext2D | null>(null)\n const circles = useRef<Circle[]>([])\n const mousePosition = MousePosition()\n const mouse = useRef<{ x: number; y: number }>({ x: 0, y: 0 })\n const canvasSize = useRef<{ w: number; h: number }>({ w: 0, h: 0 })\n const dpr = typeof window !== \"undefined\" ? window.devicePixelRatio : 1\n const rafID = useRef<number | null>(null)\n const resizeTimeout = useRef<NodeJS.Timeout | null>(null)\n\n useEffect(() => {\n if (canvasRef.current) {\n context.current = canvasRef.current.getContext(\"2d\")\n }\n initCanvas()\n animate()\n\n const handleResize = () => {\n if (resizeTimeout.current) {\n clearTimeout(resizeTimeout.current)\n }\n resizeTimeout.current = setTimeout(() => {\n initCanvas()\n }, 200)\n }\n\n window.addEventListener(\"resize\", handleResize)\n\n return () => {\n if (rafID.current != null) {\n window.cancelAnimationFrame(rafID.current)\n }\n if (resizeTimeout.current) {\n clearTimeout(resizeTimeout.current)\n }\n window.removeEventListener(\"resize\", handleResize)\n }\n }, [color])\n\n useEffect(() => {\n onMouseMove()\n }, [mousePosition.x, mousePosition.y])\n\n useEffect(() => {\n initCanvas()\n }, [refresh])\n\n const initCanvas = () => {\n resizeCanvas()\n drawParticles()\n }\n\n const onMouseMove = () => {\n if (canvasRef.current) {\n const rect = canvasRef.current.getBoundingClientRect()\n const { w, h } = canvasSize.current\n const x = mousePosition.x - rect.left - w / 2\n const y = mousePosition.y - rect.top - h / 2\n const inside = x < w / 2 && x > -w / 2 && y < h / 2 && y > -h / 2\n if (inside) {\n mouse.current.x = x\n mouse.current.y = y\n }\n }\n }\n\n const resizeCanvas = () => {\n if (canvasContainerRef.current && canvasRef.current && context.current) {\n canvasSize.current.w = canvasContainerRef.current.offsetWidth\n canvasSize.current.h = canvasContainerRef.current.offsetHeight\n\n canvasRef.current.width = canvasSize.current.w * dpr\n canvasRef.current.height = canvasSize.current.h * dpr\n canvasRef.current.style.width = `${canvasSize.current.w}px`\n canvasRef.current.style.height = `${canvasSize.current.h}px`\n context.current.scale(dpr, dpr)\n\n // Clear existing particles and create new ones with exact quantity\n circles.current = []\n for (let i = 0; i < quantity; i++) {\n const circle = circleParams()\n drawCircle(circle)\n }\n }\n }\n\n const circleParams = (): Circle => {\n const x = Math.floor(Math.random() * canvasSize.current.w)\n const y = Math.floor(Math.random() * canvasSize.current.h)\n const translateX = 0\n const translateY = 0\n const pSize = Math.floor(Math.random() * 2) + size\n const alpha = 0\n const targetAlpha = parseFloat((Math.random() * 0.6 + 0.1).toFixed(1))\n const dx = (Math.random() - 0.5) * 0.1\n const dy = (Math.random() - 0.5) * 0.1\n const magnetism = 0.1 + Math.random() * 4\n return {\n x,\n y,\n translateX,\n translateY,\n size: pSize,\n alpha,\n targetAlpha,\n dx,\n dy,\n magnetism,\n }\n }\n\n const rgb = hexToRgb(color)\n\n const drawCircle = (circle: Circle, update = false) => {\n if (context.current) {\n const { x, y, translateX, translateY, size, alpha } = circle\n context.current.translate(translateX, translateY)\n context.current.beginPath()\n context.current.arc(x, y, size, 0, 2 * Math.PI)\n context.current.fillStyle = `rgba(${rgb.join(\", \")}, ${alpha})`\n context.current.fill()\n context.current.setTransform(dpr, 0, 0, dpr, 0, 0)\n\n if (!update) {\n circles.current.push(circle)\n }\n }\n }\n\n const clearContext = () => {\n if (context.current) {\n context.current.clearRect(\n 0,\n 0,\n canvasSize.current.w,\n canvasSize.current.h\n )\n }\n }\n\n const drawParticles = () => {\n clearContext()\n const particleCount = quantity\n for (let i = 0; i < particleCount; i++) {\n const circle = circleParams()\n drawCircle(circle)\n }\n }\n\n const remapValue = (\n value: number,\n start1: number,\n end1: number,\n start2: number,\n end2: number\n ): number => {\n const remapped =\n ((value - start1) * (end2 - start2)) / (end1 - start1) + start2\n return remapped > 0 ? remapped : 0\n }\n\n const animate = () => {\n clearContext()\n circles.current.forEach((circle: Circle, i: number) => {\n // Handle the alpha value\n const edge = [\n circle.x + circle.translateX - circle.size, // distance from left edge\n canvasSize.current.w - circle.x - circle.translateX - circle.size, // distance from right edge\n circle.y + circle.translateY - circle.size, // distance from top edge\n canvasSize.current.h - circle.y - circle.translateY - circle.size, // distance from bottom edge\n ]\n const closestEdge = edge.reduce((a, b) => Math.min(a, b))\n const remapClosestEdge = parseFloat(\n remapValue(closestEdge, 0, 20, 0, 1).toFixed(2)\n )\n if (remapClosestEdge > 1) {\n circle.alpha += 0.02\n if (circle.alpha > circle.targetAlpha) {\n circle.alpha = circle.targetAlpha\n }\n } else {\n circle.alpha = circle.targetAlpha * remapClosestEdge\n }\n circle.x += circle.dx + vx\n circle.y += circle.dy + vy\n circle.translateX +=\n (mouse.current.x / (staticity / circle.magnetism) - circle.translateX) /\n ease\n circle.translateY +=\n (mouse.current.y / (staticity / circle.magnetism) - circle.translateY) /\n ease\n\n drawCircle(circle, true)\n\n // circle gets out of the canvas\n if (\n circle.x < -circle.size ||\n circle.x > canvasSize.current.w + circle.size ||\n circle.y < -circle.size ||\n circle.y > canvasSize.current.h + circle.size\n ) {\n // remove the circle from the array\n circles.current.splice(i, 1)\n // create a new circle\n const newCircle = circleParams()\n drawCircle(newCircle)\n }\n })\n rafID.current = window.requestAnimationFrame(animate)\n }\n\n return (\n <div\n className={cn(\"pointer-events-none\", className)}\n ref={canvasContainerRef}\n aria-hidden=\"true\"\n {...props}\n >\n <canvas ref={canvasRef} className=\"size-full\" />\n </div>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/ripple.json b/apps/www/public/r/ripple.jsonindex e6ba0188..90116d6e 100644--- a/apps/www/public/r/ripple.json+++ b/apps/www/public/r/ripple.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/ripple.tsx",- "content": "import React, { ComponentPropsWithoutRef, CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RippleProps extends ComponentPropsWithoutRef<\"div\"> {\n mainCircleSize?: number\n mainCircleOpacity?: number\n numCircles?: number\n}\n\nexport const Ripple = React.memo(function Ripple({\n mainCircleSize = 210,\n mainCircleOpacity = 0.24,\n numCircles = 8,\n className,\n ...props\n}: RippleProps) {\n return (\n <div\n className={cn(\n \"pointer-events-none absolute inset-0 [mask-image:linear-gradient(to_bottom,white,transparent)] select-none\",\n className\n )}\n {...props}\n >\n {Array.from({ length: numCircles }, (_, i) => {\n const size = mainCircleSize + i * 70\n const opacity = mainCircleOpacity - i * 0.03\n const animationDelay = `${i * 0.06}s`\n const borderStyle = \"solid\"\n\n return (\n <div\n key={i}\n className={`animate-ripple bg-foreground/25 absolute rounded-full border shadow-xl`}\n style={\n {\n \"--i\": i,\n width: `${size}px`,\n height: `${size}px`,\n opacity,\n animationDelay,\n borderStyle,\n borderWidth: \"1px\",\n borderColor: `var(--foreground)`,\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%) scale(1)\",\n } as CSSProperties\n }\n />\n )\n })}\n </div>\n )\n})\n\nRipple.displayName = \"Ripple\"\n",+ "content": "import React, { type ComponentPropsWithoutRef, type CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RippleProps extends ComponentPropsWithoutRef<\"div\"> {\n mainCircleSize?: number\n mainCircleOpacity?: number\n numCircles?: number\n}\n\nexport const Ripple = React.memo(function Ripple({\n mainCircleSize = 210,\n mainCircleOpacity = 0.24,\n numCircles = 8,\n className,\n ...props\n}: RippleProps) {\n return (\n <div\n className={cn(\n \"pointer-events-none absolute inset-0 [mask-image:linear-gradient(to_bottom,white,transparent)] select-none\",\n className\n )}\n {...props}\n >\n {Array.from({ length: numCircles }, (_, i) => {\n const size = mainCircleSize + i * 70\n const opacity = mainCircleOpacity - i * 0.03\n const animationDelay = `${i * 0.06}s`\n const borderStyle = \"solid\"\n\n return (\n <div\n key={i}\n className={`animate-ripple bg-foreground/25 absolute rounded-full border shadow-xl`}\n style={\n {\n \"--i\": i,\n width: `${size}px`,\n height: `${size}px`,\n opacity,\n animationDelay,\n borderStyle,\n borderWidth: \"1px\",\n borderColor: `var(--foreground)`,\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%) scale(1)\",\n } as CSSProperties\n }\n />\n )\n })}\n </div>\n )\n})\n\nRipple.displayName = \"Ripple\"\n","type": "registry:ui"}],diff --git a/apps/www/public/r/shimmer-button.json b/apps/www/public/r/shimmer-button.jsonindex 07583cb0..186a7750 100644--- a/apps/www/public/r/shimmer-button.json+++ b/apps/www/public/r/shimmer-button.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/shimmer-button.tsx",- "content": "import React, { ComponentPropsWithoutRef, CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface ShimmerButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n shimmerColor?: string\n shimmerSize?: string\n borderRadius?: string\n shimmerDuration?: string\n background?: string\n className?: string\n children?: React.ReactNode\n}\n\nexport const ShimmerButton = React.forwardRef<\n HTMLButtonElement,\n ShimmerButtonProps\n>(\n (\n {\n shimmerColor = \"#ffffff\",\n shimmerSize = \"0.05em\",\n shimmerDuration = \"3s\",\n borderRadius = \"100px\",\n background = \"rgba(0, 0, 0, 1)\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n return (\n <button\n style={\n {\n \"--spread\": \"90deg\",\n \"--shimmer-color\": shimmerColor,\n \"--radius\": borderRadius,\n \"--speed\": shimmerDuration,\n \"--cut\": shimmerSize,\n \"--bg\": background,\n } as CSSProperties\n }\n className={cn(\n \"group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden [border-radius:var(--radius)] border border-white/10 px-6 py-3 whitespace-nowrap text-white [background:var(--bg)]\",\n \"transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px\",\n className\n )}\n ref={ref}\n {...props}\n >\n {/* spark container */}\n <div\n className={cn(\n \"-z-30 blur-[2px]\",\n \"[container-type:size] absolute inset-0 overflow-visible\"\n )}\n >\n {/* spark */}\n <div className=\"animate-shimmer-slide absolute inset-0 [aspect-ratio:1] h-[100cqh] [border-radius:0] [mask:none]\">\n {/* spark before */}\n <div className=\"animate-spin-around absolute -inset-full w-auto [translate:0_0] rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))]\" />\n </div>\n </div>\n {children}\n\n {/* Highlight */}\n <div\n className={cn(\n \"absolute inset-0 size-full\",\n\n \"rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f]\",\n\n // transition\n \"transform-gpu transition-all duration-300 ease-in-out\",\n\n // on hover\n \"group-hover:shadow-[inset_0_-6px_10px_#ffffff3f]\",\n\n // on click\n \"group-active:shadow-[inset_0_-10px_10px_#ffffff3f]\"\n )}\n />\n\n {/* backdrop */}\n <div\n className={cn(\n \"absolute [inset:var(--cut)] -z-20 [border-radius:var(--radius)] [background:var(--bg)]\"\n )}\n />\n </button>\n )\n }\n)\n\nShimmerButton.displayName = \"ShimmerButton\"\n",+ "content": "import React, { type ComponentPropsWithoutRef, type CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface ShimmerButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n shimmerColor?: string\n shimmerSize?: string\n borderRadius?: string\n shimmerDuration?: string\n background?: string\n className?: string\n children?: React.ReactNode\n}\n\nexport const ShimmerButton = React.forwardRef<\n HTMLButtonElement,\n ShimmerButtonProps\n>(\n (\n {\n shimmerColor = \"#ffffff\",\n shimmerSize = \"0.05em\",\n shimmerDuration = \"3s\",\n borderRadius = \"100px\",\n background = \"rgba(0, 0, 0, 1)\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n return (\n <button\n style={\n {\n \"--spread\": \"90deg\",\n \"--shimmer-color\": shimmerColor,\n \"--radius\": borderRadius,\n \"--speed\": shimmerDuration,\n \"--cut\": shimmerSize,\n \"--bg\": background,\n } as CSSProperties\n }\n className={cn(\n \"group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden [border-radius:var(--radius)] border border-white/10 px-6 py-3 whitespace-nowrap text-white [background:var(--bg)]\",\n \"transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px\",\n className\n )}\n ref={ref}\n {...props}\n >\n {/* spark container */}\n <div\n className={cn(\n \"-z-30 blur-[2px]\",\n \"[container-type:size] absolute inset-0 overflow-visible\"\n )}\n >\n {/* spark */}\n <div className=\"animate-shimmer-slide absolute inset-0 [aspect-ratio:1] h-[100cqh] [border-radius:0] [mask:none]\">\n {/* spark before */}\n <div className=\"animate-spin-around absolute -inset-full w-auto [translate:0_0] rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))]\" />\n </div>\n </div>\n {children}\n\n {/* Highlight */}\n <div\n className={cn(\n \"absolute inset-0 size-full\",\n\n \"rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f]\",\n\n // transition\n \"transform-gpu transition-all duration-300 ease-in-out\",\n\n // on hover\n \"group-hover:shadow-[inset_0_-6px_10px_#ffffff3f]\",\n\n // on click\n \"group-active:shadow-[inset_0_-10px_10px_#ffffff3f]\"\n )}\n />\n\n {/* backdrop */}\n <div\n className={cn(\n \"absolute [inset:var(--cut)] -z-20 [border-radius:var(--radius)] [background:var(--bg)]\"\n )}\n />\n </button>\n )\n }\n)\n\nShimmerButton.displayName = \"ShimmerButton\"\n","type": "registry:ui"}],diff --git a/apps/www/public/r/spinning-text.json b/apps/www/public/r/spinning-text.jsonindex 46dbdb36..ab0317cc 100644--- a/apps/www/public/r/spinning-text.json+++ b/apps/www/public/r/spinning-text.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/spinning-text.tsx",- "content": "\"use client\"\n\nimport React, { ComponentPropsWithoutRef } from \"react\"\nimport { motion, Transition, Variants } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface SpinningTextProps extends ComponentPropsWithoutRef<\"div\"> {\n children: string | string[]\n duration?: number\n reverse?: boolean\n radius?: number\n transition?: Transition\n variants?: {\n container?: Variants\n item?: Variants\n }\n}\n\nconst BASE_TRANSITION: Transition = {\n repeat: Infinity,\n ease: \"linear\",\n}\n\nconst BASE_ITEM_VARIANTS: Variants = {\n hidden: {\n opacity: 1,\n },\n visible: {\n opacity: 1,\n },\n}\n\nexport function SpinningText({\n children,\n duration = 10,\n reverse = false,\n radius = 5,\n transition,\n variants,\n className,\n style,\n}: SpinningTextProps) {\n if (typeof children !== \"string\" && !Array.isArray(children)) {\n throw new Error(\"children must be a string or an array of strings\")\n }\n\n if (Array.isArray(children)) {\n // Validate all elements are strings\n if (!children.every((child) => typeof child === \"string\")) {\n throw new Error(\"all elements in children array must be strings\")\n }\n children = children.join(\"\")\n }\n\n const letters = children.split(\"\")\n letters.push(\" \")\n\n const finalTransition: Transition = {\n ...BASE_TRANSITION,\n ...transition,\n duration: (transition as { duration?: number })?.duration ?? duration,\n }\n\n const containerVariants: Variants = {\n visible: { rotate: reverse ? -360 : 360 },\n ...variants?.container,\n }\n\n const itemVariants: Variants = {\n ...BASE_ITEM_VARIANTS,\n ...variants?.item,\n }\n\n return (\n <motion.div\n className={cn(\"relative\", className)}\n style={{\n ...style,\n }}\n initial=\"hidden\"\n animate=\"visible\"\n variants={containerVariants}\n transition={finalTransition}\n >\n {letters.map((letter, index) => (\n <motion.span\n aria-hidden=\"true\"\n key={`${index}-${letter}`}\n variants={itemVariants}\n className=\"absolute top-1/2 left-1/2 inline-block\"\n style={\n {\n \"--index\": index,\n \"--total\": letters.length,\n \"--radius\": radius,\n transform: `\n translate(-50%, -50%)\n rotate(calc(360deg / var(--total) * var(--index)))\n translateY(calc(var(--radius, 5) * -1ch))\n `,\n transformOrigin: \"center\",\n } as React.CSSProperties\n }\n >\n {letter}\n </motion.span>\n ))}\n <span className=\"sr-only\">{children}</span>\n </motion.div>\n )\n}\n",+ "content": "\"use client\"\n\nimport React, { type ComponentPropsWithoutRef } from \"react\"\nimport { motion, Transition, Variants } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface SpinningTextProps extends ComponentPropsWithoutRef<\"div\"> {\n children: string | string[]\n duration?: number\n reverse?: boolean\n radius?: number\n transition?: Transition\n variants?: {\n container?: Variants\n item?: Variants\n }\n}\n\nconst BASE_TRANSITION: Transition = {\n repeat: Infinity,\n ease: \"linear\",\n}\n\nconst BASE_ITEM_VARIANTS: Variants = {\n hidden: {\n opacity: 1,\n },\n visible: {\n opacity: 1,\n },\n}\n\nexport function SpinningText({\n children,\n duration = 10,\n reverse = false,\n radius = 5,\n transition,\n variants,\n className,\n style,\n}: SpinningTextProps) {\n if (typeof children !== \"string\" && !Array.isArray(children)) {\n throw new Error(\"children must be a string or an array of strings\")\n }\n\n if (Array.isArray(children)) {\n // Validate all elements are strings\n if (!children.every((child) => typeof child === \"string\")) {\n throw new Error(\"all elements in children array must be strings\")\n }\n children = children.join(\"\")\n }\n\n const letters = children.split(\"\")\n letters.push(\" \")\n\n const finalTransition: Transition = {\n ...BASE_TRANSITION,\n ...transition,\n duration: (transition as { duration?: number })?.duration ?? duration,\n }\n\n const containerVariants: Variants = {\n visible: { rotate: reverse ? -360 : 360 },\n ...variants?.container,\n }\n\n const itemVariants: Variants = {\n ...BASE_ITEM_VARIANTS,\n ...variants?.item,\n }\n\n return (\n <motion.div\n className={cn(\"relative\", className)}\n style={{\n ...style,\n }}\n initial=\"hidden\"\n animate=\"visible\"\n variants={containerVariants}\n transition={finalTransition}\n >\n {letters.map((letter, index) => (\n <motion.span\n aria-hidden=\"true\"\n key={`${index}-${letter}`}\n variants={itemVariants}\n className=\"absolute top-1/2 left-1/2 inline-block\"\n style={\n {\n \"--index\": index,\n \"--total\": letters.length,\n \"--radius\": radius,\n transform: `\n translate(-50%, -50%)\n rotate(calc(360deg / var(--total) * var(--index)))\n translateY(calc(var(--radius, 5) * -1ch))\n `,\n transformOrigin: \"center\",\n } as React.CSSProperties\n }\n >\n {letter}\n </motion.span>\n ))}\n <span className=\"sr-only\">{children}</span>\n </motion.div>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/text-reveal.json b/apps/www/public/r/text-reveal.jsonindex 404ea203..e575bd4c 100644--- a/apps/www/public/r/text-reveal.json+++ b/apps/www/public/r/text-reveal.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/text-reveal.tsx",- "content": "\"use client\"\n\nimport { ComponentPropsWithoutRef, FC, ReactNode, useRef } from \"react\"\nimport { motion, MotionValue, useScroll, useTransform } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface TextRevealProps extends ComponentPropsWithoutRef<\"div\"> {\n children: string\n}\n\nexport const TextReveal: FC<TextRevealProps> = ({ children, className }) => {\n const targetRef = useRef<HTMLDivElement | null>(null)\n const { scrollYProgress } = useScroll({\n target: targetRef,\n })\n\n if (typeof children !== \"string\") {\n throw new Error(\"TextReveal: children must be a string\")\n }\n\n const words = children.split(\" \")\n\n return (\n <div ref={targetRef} className={cn(\"relative z-0 h-[200vh]\", className)}>\n <div\n className={\n \"sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-[1rem] py-[5rem]\"\n }\n >\n <span\n ref={targetRef}\n className={\n \"flex flex-wrap p-5 text-2xl font-bold text-black/20 md:p-8 md:text-3xl lg:p-10 lg:text-4xl xl:text-5xl dark:text-white/20\"\n }\n >\n {words.map((word, i) => {\n const start = i / words.length\n const end = start + 1 / words.length\n return (\n <Word key={i} progress={scrollYProgress} range={[start, end]}>\n {word}\n </Word>\n )\n })}\n </span>\n </div>\n </div>\n )\n}\n\ninterface WordProps {\n children: ReactNode\n progress: MotionValue<number>\n range: [number, number]\n}\n\nconst Word: FC<WordProps> = ({ children, progress, range }) => {\n const opacity = useTransform(progress, range, [0, 1])\n return (\n <span className=\"xl:lg-3 relative mx-1 lg:mx-1.5\">\n <span className=\"absolute opacity-30\">{children}</span>\n <motion.span\n style={{ opacity: opacity }}\n className={\"text-black dark:text-white\"}\n >\n {children}\n </motion.span>\n </span>\n )\n}\n",+ "content": "\"use client\"\n\nimport {\n useRef,\n type ComponentPropsWithoutRef,\n type FC,\n type ReactNode,\n} from \"react\"\nimport { motion, MotionValue, useScroll, useTransform } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface TextRevealProps extends ComponentPropsWithoutRef<\"div\"> {\n children: string\n}\n\nexport const TextReveal: FC<TextRevealProps> = ({ children, className }) => {\n const targetRef = useRef<HTMLDivElement | null>(null)\n const { scrollYProgress } = useScroll({\n target: targetRef,\n })\n\n if (typeof children !== \"string\") {\n throw new Error(\"TextReveal: children must be a string\")\n }\n\n const words = children.split(\" \")\n\n return (\n <div ref={targetRef} className={cn(\"relative z-0 h-[200vh]\", className)}>\n <div\n className={\n \"sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-[1rem] py-[5rem]\"\n }\n >\n <span\n ref={targetRef}\n className={\n \"flex flex-wrap p-5 text-2xl font-bold text-black/20 md:p-8 md:text-3xl lg:p-10 lg:text-4xl xl:text-5xl dark:text-white/20\"\n }\n >\n {words.map((word, i) => {\n const start = i / words.length\n const end = start + 1 / words.length\n return (\n <Word key={i} progress={scrollYProgress} range={[start, end]}>\n {word}\n </Word>\n )\n })}\n </span>\n </div>\n </div>\n )\n}\n\ninterface WordProps {\n children: ReactNode\n progress: MotionValue<number>\n range: [number, number]\n}\n\nconst Word: FC<WordProps> = ({ children, progress, range }) => {\n const opacity = useTransform(progress, range, [0, 1])\n return (\n <span className=\"xl:lg-3 relative mx-1 lg:mx-1.5\">\n <span className=\"absolute opacity-30\">{children}</span>\n <motion.span\n style={{ opacity: opacity }}\n className={\"text-black dark:text-white\"}\n >\n {children}\n </motion.span>\n </span>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/registry/magicui/animated-gradient-text.tsx b/apps/www/registry/magicui/animated-gradient-text.tsxindex b77b87ce..c814eb3b 100644--- a/apps/www/registry/magicui/animated-gradient-text.tsx+++ b/apps/www/registry/magicui/animated-gradient-text.tsx@@ -1,4 +1,4 @@-import { ComponentPropsWithoutRef } from "react"+import { type ComponentPropsWithoutRef } from "react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/animated-grid-pattern.tsx b/apps/www/registry/magicui/animated-grid-pattern.tsxindex f4a519cb..ca1ecc4f 100644--- a/apps/www/registry/magicui/animated-grid-pattern.tsx+++ b/apps/www/registry/magicui/animated-grid-pattern.tsx@@ -1,12 +1,12 @@"use client"import {- ComponentPropsWithoutRef,useCallback,useEffect,useId,useRef,useState,+ type ComponentPropsWithoutRef,} from "react"import { motion } from "motion/react"diff --git a/apps/www/registry/magicui/animated-list.tsx b/apps/www/registry/magicui/animated-list.tsxindex 1396b65b..1cd5ab0d 100644--- a/apps/www/registry/magicui/animated-list.tsx+++ b/apps/www/registry/magicui/animated-list.tsx@@ -1,10 +1,10 @@"use client"import React, {- ComponentPropsWithoutRef,useEffect,useMemo,useState,+ type ComponentPropsWithoutRef,} from "react"import { AnimatePresence, motion, type MotionProps } from "motion/react"diff --git a/apps/www/registry/magicui/animated-shiny-text.tsx b/apps/www/registry/magicui/animated-shiny-text.tsxindex 6b04856c..60d23d69 100644--- a/apps/www/registry/magicui/animated-shiny-text.tsx+++ b/apps/www/registry/magicui/animated-shiny-text.tsx@@ -1,4 +1,8 @@-import { ComponentPropsWithoutRef, CSSProperties, FC } from "react"+import {+ type ComponentPropsWithoutRef,+ type CSSProperties,+ type FC,+} from "react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/bento-grid.tsx b/apps/www/registry/magicui/bento-grid.tsxindex ff9acb49..f602e5bf 100644--- a/apps/www/registry/magicui/bento-grid.tsx+++ b/apps/www/registry/magicui/bento-grid.tsx@@ -1,4 +1,4 @@-import { ComponentPropsWithoutRef, ReactNode } from "react"+import { type ComponentPropsWithoutRef, type ReactNode } from "react"import { ArrowRightIcon } from "@radix-ui/react-icons"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/marquee.tsx b/apps/www/registry/magicui/marquee.tsxindex b04836ec..214c13ce 100644--- a/apps/www/registry/magicui/marquee.tsx+++ b/apps/www/registry/magicui/marquee.tsx@@ -1,4 +1,4 @@-import { ComponentPropsWithoutRef } from "react"+import { type ComponentPropsWithoutRef } from "react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/number-ticker.tsx b/apps/www/registry/magicui/number-ticker.tsxindex 0f12b4fe..8a383aa0 100644--- a/apps/www/registry/magicui/number-ticker.tsx+++ b/apps/www/registry/magicui/number-ticker.tsx@@ -1,6 +1,6 @@"use client"-import { ComponentPropsWithoutRef, useEffect, useRef } from "react"+import { useEffect, useRef, type ComponentPropsWithoutRef } from "react"import { useInView, useMotionValue, useSpring } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/particles.tsx b/apps/www/registry/magicui/particles.tsxindex 5b9da79a..0768c34b 100644--- a/apps/www/registry/magicui/particles.tsx+++ b/apps/www/registry/magicui/particles.tsx@@ -1,10 +1,10 @@"use client"import React, {- ComponentPropsWithoutRef,useEffect,useRef,useState,+ type ComponentPropsWithoutRef,} from "react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/ripple.tsx b/apps/www/registry/magicui/ripple.tsxindex 6d914648..fa5aa897 100644--- a/apps/www/registry/magicui/ripple.tsx+++ b/apps/www/registry/magicui/ripple.tsx@@ -1,4 +1,4 @@-import React, { ComponentPropsWithoutRef, CSSProperties } from "react"+import React, { type ComponentPropsWithoutRef, type CSSProperties } from "react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/shimmer-button.tsx b/apps/www/registry/magicui/shimmer-button.tsxindex 131f73c8..84be85fb 100644--- a/apps/www/registry/magicui/shimmer-button.tsx+++ b/apps/www/registry/magicui/shimmer-button.tsx@@ -1,4 +1,4 @@-import React, { ComponentPropsWithoutRef, CSSProperties } from "react"+import React, { type ComponentPropsWithoutRef, type CSSProperties } from "react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/spinning-text.tsx b/apps/www/registry/magicui/spinning-text.tsxindex ce96f109..0a55d27f 100644--- a/apps/www/registry/magicui/spinning-text.tsx+++ b/apps/www/registry/magicui/spinning-text.tsx@@ -1,6 +1,6 @@"use client"-import React, { ComponentPropsWithoutRef } from "react"+import React, { type ComponentPropsWithoutRef } from "react"import { motion, Transition, Variants } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/text-reveal.tsx b/apps/www/registry/magicui/text-reveal.tsxindex 599631f8..401f9403 100644--- a/apps/www/registry/magicui/text-reveal.tsx+++ b/apps/www/registry/magicui/text-reveal.tsx@@ -1,6 +1,11 @@"use client"-import { ComponentPropsWithoutRef, FC, ReactNode, useRef } from "react"+import {+ useRef,+ type ComponentPropsWithoutRef,+ type FC,+ type ReactNode,+} from "react"import { motion, MotionValue, useScroll, useTransform } from "motion/react"import { cn } from "@/lib/utils"