UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
fix(registry): use type-only imports (fixes TS1484 in stock Vite react-ts apps) (#993)
Lin Junrong58ee1feebc50
diff --git a/apps/www/app/(marketing)/showcase/[...slug]/page.tsx b/apps/www/app/(marketing)/showcase/[...slug]/page.tsxindex 68ca1e6b..7409a117 100644--- a/apps/www/app/(marketing)/showcase/[...slug]/page.tsx+++ b/apps/www/app/(marketing)/showcase/[...slug]/page.tsx@@ -1,4 +1,4 @@-import { Metadata } from "next"+import { type Metadata } from "next"import { notFound } from "next/navigation"import { showcaseSource } from "@/lib/source"diff --git a/apps/www/app/layout.tsx b/apps/www/app/layout.tsxindex c8b87fc2..e9f5421e 100644--- a/apps/www/app/layout.tsx+++ b/apps/www/app/layout.tsx@@ -1,5 +1,5 @@import type { Viewport } from "next"-import { Metadata } from "next"+import { type Metadata } from "next"import { Provider as JotaiProvider } from "jotai"import { fontVariables } from "@/lib/fonts"diff --git a/apps/www/app/robots.ts b/apps/www/app/robots.tsindex d0ec3f85..e7fdb4ef 100644--- a/apps/www/app/robots.ts+++ b/apps/www/app/robots.ts@@ -1,4 +1,4 @@-import { MetadataRoute } from "next"+import { type MetadataRoute } from "next"export default function robots(): MetadataRoute.Robots {return {diff --git a/apps/www/components/blur-image.tsx b/apps/www/components/blur-image.tsxindex 24c062f4..58e00efa 100644--- a/apps/www/components/blur-image.tsx+++ b/apps/www/components/blur-image.tsx@@ -1,7 +1,7 @@"use client"import { useEffect, useState } from "react"-import Image, { ImageProps } from "next/image"+import Image, { type ImageProps } from "next/image"export default function BlurImage(props: ImageProps) {const [loading, setLoading] = useState(true)diff --git a/apps/www/components/contribute.tsx b/apps/www/components/contribute.tsxindex 715e6b3e..a62e7366 100644--- a/apps/www/components/contribute.tsx+++ b/apps/www/components/contribute.tsx@@ -1,5 +1,5 @@import Link from "next/link"-import { Page, PageData } from "fumadocs-core/source"+import { type Page, type PageData } from "fumadocs-core/source"import { BugIcon, LightbulbIcon, PencilIcon } from "lucide-react"import { getGithubFileUrl, getGitHubIssueUrl } from "@/lib/github"diff --git a/apps/www/components/copy-button.tsx b/apps/www/components/copy-button.tsxindex 02067b39..4928d5a5 100644--- a/apps/www/components/copy-button.tsx+++ b/apps/www/components/copy-button.tsx@@ -3,7 +3,7 @@import * as React from "react"import { CheckIcon, ClipboardIcon } from "lucide-react"-import { Event, trackEvent } from "@/lib/events"+import { trackEvent, type Event } from "@/lib/events"import { cn } from "@/lib/utils"import { Button } from "@/components/ui/button"import {diff --git a/apps/www/components/docs-sidebar.tsx b/apps/www/components/docs-sidebar.tsxindex 917f3667..d460f008 100644--- a/apps/www/components/docs-sidebar.tsx+++ b/apps/www/components/docs-sidebar.tsx@@ -2,7 +2,7 @@import Link from "next/link"import { usePathname } from "next/navigation"-import { NavItemWithChildren } from "@/types"+import { type NavItemWithChildren } from "@/types"import { docsConfig } from "@/config/docs"import { trackEvent } from "@/lib/events"diff --git a/apps/www/components/main-nav.tsx b/apps/www/components/main-nav.tsxindex 930563d2..c8758f86 100644--- a/apps/www/components/main-nav.tsx+++ b/apps/www/components/main-nav.tsx@@ -2,7 +2,7 @@import Link from "next/link"import { usePathname } from "next/navigation"-import { NavItem } from "@/types"+import { type NavItem } from "@/types"import { trackEvent } from "@/lib/events"import { cn } from "@/lib/utils"diff --git a/apps/www/components/mobile-nav.tsx b/apps/www/components/mobile-nav.tsxindex cf9fc4ae..deca2899 100644--- a/apps/www/components/mobile-nav.tsx+++ b/apps/www/components/mobile-nav.tsx@@ -1,7 +1,7 @@"use client"import * as React from "react"-import Link, { LinkProps } from "next/link"+import Link, { type LinkProps } from "next/link"import { useRouter } from "next/navigation"import { docsConfig } from "@/config/docs"diff --git a/apps/www/components/template-preview.tsx b/apps/www/components/template-preview.tsxindex 91712f01..b52bbd39 100644--- a/apps/www/components/template-preview.tsx+++ b/apps/www/components/template-preview.tsx@@ -1,4 +1,4 @@-import { ReactNode } from "react"+import { type ReactNode } from "react"import Link from "next/link"import { ExternalLinkIcon } from "@radix-ui/react-icons"diff --git a/apps/www/components/theme-provider.tsx b/apps/www/components/theme-provider.tsxindex 880ced40..4c598461 100644--- a/apps/www/components/theme-provider.tsx+++ b/apps/www/components/theme-provider.tsx@@ -2,7 +2,7 @@import {ThemeProvider as NextThemesProvider,- ThemeProviderProps,+ type ThemeProviderProps,} from "next-themes"export function ThemeProvider({ children, ...props }: ThemeProviderProps) {diff --git a/apps/www/components/ui/sidebar.tsx b/apps/www/components/ui/sidebar.tsxindex 2d6708e5..02abdffe 100644--- a/apps/www/components/ui/sidebar.tsx+++ b/apps/www/components/ui/sidebar.tsx@@ -2,7 +2,7 @@import * as React from "react"import { Slot } from "@radix-ui/react-slot"-import { cva, VariantProps } from "class-variance-authority"+import { cva, type VariantProps } from "class-variance-authority"import { PanelLeftIcon } from "lucide-react"import { cn } from "@/lib/utils"diff --git a/apps/www/config/docs.ts b/apps/www/config/docs.tsindex 19e1ea20..ddb7c84f 100644--- a/apps/www/config/docs.ts+++ b/apps/www/config/docs.ts@@ -1,4 +1,4 @@-import { NavItem, NavItemWithChildren } from "@/types"+import { type NavItem, type NavItemWithChildren } from "@/types"interface DocsConfig {mainNav: NavItem[]diff --git a/apps/www/lib/rehype-component.ts b/apps/www/lib/rehype-component.tsindex 728edc72..219e3b4f 100644--- a/apps/www/lib/rehype-component.ts+++ b/apps/www/lib/rehype-component.ts@@ -1,6 +1,6 @@import fs from "fs"import path from "path"-import { UnistNode, UnistTree } from "types/unist"+import { type UnistNode, type UnistTree } from "types/unist"import { u } from "unist-builder"import { visit } from "unist-util-visit"diff --git a/apps/www/lib/rehype-npm-command.ts b/apps/www/lib/rehype-npm-command.tsindex b4f38e7b..55b46216 100644--- a/apps/www/lib/rehype-npm-command.ts+++ b/apps/www/lib/rehype-npm-command.ts@@ -1,4 +1,4 @@-import { UnistNode, UnistTree } from "types/unist"+import { type UnistNode, type UnistTree } from "types/unist"import { visit } from "unist-util-visit"export function rehypeNpmCommand() {diff --git a/apps/www/lib/utils.ts b/apps/www/lib/utils.tsindex f82cdebb..f610181c 100644--- a/apps/www/lib/utils.ts+++ b/apps/www/lib/utils.ts@@ -1,6 +1,6 @@import process from "process"import type { Metadata } from "next"-import clsx, { ClassValue } from "clsx"+import clsx, { type ClassValue } from "clsx"import { twMerge } from "tailwind-merge"import { siteConfig } from "@/config/site"diff --git a/apps/www/public/llms-full.txt b/apps/www/public/llms-full.txtindex 34536880..d8bda350 100644--- a/apps/www/public/llms-full.txt+++ b/apps/www/public/llms-full.txt@@ -3,7 +3,7 @@ Title: AndroidDescription: A mockup of an Android device.--- file: magicui/android.tsx ----import { SVGProps } from "react"+import { type SVGProps } from "react"export interface AndroidProps extends SVGProps<SVGSVGElement> {width?: number@@ -4427,7 +4427,7 @@ Description: An animated beam of light which travels along the border of its con--- file: magicui/border-beam.tsx ---"use client"-import { motion, MotionStyle, Transition } from "motion/react"+import { motion, type MotionStyle, type Transition } from "motion/react"import { cn } from "@/lib/utils"@@ -4745,7 +4745,7 @@ Description: A client-side version of the tweet card that displays a tweet with--- file: magicui/client-tweet-card.tsx ---"use client"-import { TweetProps, useTweet } from "react-tweet"+import { useTweet, type TweetProps } from "react-tweet"import {MagicTweet,@@ -5057,7 +5057,7 @@ Description: Comic text animation--- file: magicui/comic-text.tsx ---"use client"-import { CSSProperties } from "react"+import { type CSSProperties } from "react"import { motion } from "motion/react"import { cn } from "@/lib/utils"@@ -5638,7 +5638,7 @@ Description: Cool mode effect for buttons, links, and other DOMs--- file: magicui/cool-mode.tsx ---"use client"-import React, { ReactNode, useEffect, useRef } from "react"+import React, { useEffect, useRef, type ReactNode } from "react"export interface BaseParticle {element: HTMLElement | SVGSVGElement@@ -6333,7 +6333,7 @@ Description: An implementation of the MacOS dock using react + tailwindcss + mot--- file: magicui/dock.tsx ---"use client"-import React, { PropsWithChildren, useRef } from "react"+import React, { useRef, type PropsWithChildren } from "react"import { cva, type VariantProps } from "class-variance-authority"import {motion,@@ -13188,12 +13188,12 @@ Description: A beautiful neon card effect"use client"import {- CSSProperties,- ReactElement,- ReactNode,useEffect,useRef,useState,+ type CSSProperties,+ type ReactElement,+ type ReactNode,} from "react"import { cn } from "@/lib/utils"@@ -14992,7 +14992,7 @@ Description: An animated button with a rainbow effect.--- file: magicui/rainbow-button.tsx ---import React from "react"import { Slot } from "@radix-ui/react-slot"-import { cva, VariantProps } from "class-variance-authority"+import { cva, type VariantProps } from "class-variance-authority"import { cn } from "@/lib/utils"@@ -16062,7 +16062,7 @@ Description: An animated button with ripple useful for user engagement.--- file: magicui/ripple-button.tsx ---"use client"-import React, { MouseEvent, useEffect, useState } from "react"+import React, { useEffect, useState, type MouseEvent } from "react"import { cn } from "@/lib/utils"@@ -17257,7 +17257,7 @@ Description: A customizable, physics-based smooth cursor animation component wit--- file: magicui/smooth-cursor.tsx ---"use client"-import { FC, useEffect, useRef, useState } from "react"+import { useEffect, useRef, useState, type FC } from "react"import { motion, useSpring } from "motion/react"interface Position {@@ -17543,7 +17543,12 @@ Description: A dynamic text that generates continuous sparkles with smooth trans--- file: magicui/sparkles-text.tsx ---"use client"-import { CSSProperties, ReactElement, useEffect, useState } from "react"+import {+ useEffect,+ useState,+ type CSSProperties,+ type ReactElement,+} from "react"import { motion } from "motion/react"import { cn } from "@/lib/utils"@@ -17713,7 +17718,7 @@ Description: The Spinning Text component animates text in a circular motion with"use client"import React, { type ComponentPropsWithoutRef } from "react"-import { motion, Transition, Variants } from "motion/react"+import { motion, type Transition, type Variants } from "motion/react"import { cn } from "@/lib/utils"@@ -18694,9 +18699,9 @@ import { memo } from "react"import {AnimatePresence,motion,- Variants,type DOMMotionComponents,type MotionProps,+ type Variants,} from "motion/react"import { cn } from "@/lib/utils"@@ -20179,7 +20184,12 @@ Description: A component that displays text with a video playing in the backgrou--- file: magicui/video-text.tsx ---"use client"-import React, { ElementType, ReactNode, useEffect, useState } from "react"+import React, {+ useEffect,+ useState,+ type ElementType,+ type ReactNode,+} from "react"import { cn } from "@/lib/utils"@@ -20338,7 +20348,7 @@ Description: A card with a time warping background effect.--- file: magicui/warp-background.tsx ---"use client"-import React, { HTMLAttributes, useCallback, useMemo } from "react"+import React, { useCallback, useMemo, type HTMLAttributes } from "react"import { motion } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/public/r/android.json b/apps/www/public/r/android.jsonindex 3f4c19b9..f5e63c01 100644--- a/apps/www/public/r/android.json+++ b/apps/www/public/r/android.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/android.tsx",- "content": "import { SVGProps } from \"react\"\n\nexport interface AndroidProps extends SVGProps<SVGSVGElement> {\n width?: number\n height?: number\n src?: string\n videoSrc?: string\n}\n\nexport function Android({\n width = 433,\n height = 882,\n src,\n videoSrc,\n ...props\n}: AndroidProps) {\n return (\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M376 153H378C379.105 153 380 153.895 380 155V249C380 250.105 379.105 251 378 251H376V153Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M376 301H378C379.105 301 380 301.895 380 303V351C380 352.105 379.105 353 378 353H376V301Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M0 42C0 18.8041 18.804 0 42 0H336C359.196 0 378 18.804 378 42V788C378 811.196 359.196 830 336 830H42C18.804 830 0 811.196 0 788V42Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M2 43C2 22.0132 19.0132 5 40 5H338C358.987 5 376 22.0132 376 43V787C376 807.987 358.987 825 338 825H40C19.0132 825 2 807.987 2 787V43Z\"\n className=\"fill-white dark:fill-[#262626]\"\n />\n\n <g clipPath=\"url(#clip0_514_20855)\">\n <path\n d=\"M9.25 48C9.25 29.3604 24.3604 14.25 43 14.25H335C353.64 14.25 368.75 29.3604 368.75 48V780C368.75 798.64 353.64 813.75 335 813.75H43C24.3604 813.75 9.25 798.64 9.25 780V48Z\"\n className=\"fill-[#E5E5E5] stroke-[#E5E5E5] stroke-[0.5] dark:fill-[#404040] dark:stroke-[#404040]\"\n />\n </g>\n <circle\n cx=\"189\"\n cy=\"28\"\n r=\"9\"\n className=\"fill-white dark:fill-[#262626]\"\n />\n <circle\n cx=\"189\"\n cy=\"28\"\n r=\"4\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n {src && (\n <image\n href={src}\n width=\"360\"\n height=\"800\"\n className=\"size-full object-cover\"\n preserveAspectRatio=\"xMidYMid slice\"\n clipPath=\"url(#clip0_514_20855)\"\n />\n )}\n {videoSrc && (\n <foreignObject\n width=\"380\"\n height=\"820\"\n clipPath=\"url(#clip0_514_20855)\"\n preserveAspectRatio=\"xMidYMid slice\"\n >\n <video\n className=\"size-full object-cover\"\n src={videoSrc}\n autoPlay\n loop\n muted\n playsInline\n />\n </foreignObject>\n )}\n <defs>\n <clipPath id=\"clip0_514_20855\">\n <rect\n width=\"360\"\n height=\"800\"\n rx=\"33\"\n ry=\"25\"\n className=\"fill-white dark:fill-[#262626]\"\n transform=\"translate(9 14)\"\n />\n </clipPath>\n </defs>\n </svg>\n )\n}\n",+ "content": "import { type SVGProps } from \"react\"\n\nexport interface AndroidProps extends SVGProps<SVGSVGElement> {\n width?: number\n height?: number\n src?: string\n videoSrc?: string\n}\n\nexport function Android({\n width = 433,\n height = 882,\n src,\n videoSrc,\n ...props\n}: AndroidProps) {\n return (\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M376 153H378C379.105 153 380 153.895 380 155V249C380 250.105 379.105 251 378 251H376V153Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M376 301H378C379.105 301 380 301.895 380 303V351C380 352.105 379.105 353 378 353H376V301Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M0 42C0 18.8041 18.804 0 42 0H336C359.196 0 378 18.804 378 42V788C378 811.196 359.196 830 336 830H42C18.804 830 0 811.196 0 788V42Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M2 43C2 22.0132 19.0132 5 40 5H338C358.987 5 376 22.0132 376 43V787C376 807.987 358.987 825 338 825H40C19.0132 825 2 807.987 2 787V43Z\"\n className=\"fill-white dark:fill-[#262626]\"\n />\n\n <g clipPath=\"url(#clip0_514_20855)\">\n <path\n d=\"M9.25 48C9.25 29.3604 24.3604 14.25 43 14.25H335C353.64 14.25 368.75 29.3604 368.75 48V780C368.75 798.64 353.64 813.75 335 813.75H43C24.3604 813.75 9.25 798.64 9.25 780V48Z\"\n className=\"fill-[#E5E5E5] stroke-[#E5E5E5] stroke-[0.5] dark:fill-[#404040] dark:stroke-[#404040]\"\n />\n </g>\n <circle\n cx=\"189\"\n cy=\"28\"\n r=\"9\"\n className=\"fill-white dark:fill-[#262626]\"\n />\n <circle\n cx=\"189\"\n cy=\"28\"\n r=\"4\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n {src && (\n <image\n href={src}\n width=\"360\"\n height=\"800\"\n className=\"size-full object-cover\"\n preserveAspectRatio=\"xMidYMid slice\"\n clipPath=\"url(#clip0_514_20855)\"\n />\n )}\n {videoSrc && (\n <foreignObject\n width=\"380\"\n height=\"820\"\n clipPath=\"url(#clip0_514_20855)\"\n preserveAspectRatio=\"xMidYMid slice\"\n >\n <video\n className=\"size-full object-cover\"\n src={videoSrc}\n autoPlay\n loop\n muted\n playsInline\n />\n </foreignObject>\n )}\n <defs>\n <clipPath id=\"clip0_514_20855\">\n <rect\n width=\"360\"\n height=\"800\"\n rx=\"33\"\n ry=\"25\"\n className=\"fill-white dark:fill-[#262626]\"\n transform=\"translate(9 14)\"\n />\n </clipPath>\n </defs>\n </svg>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/border-beam.json b/apps/www/public/r/border-beam.jsonindex 6814fbe2..441a5846 100644--- a/apps/www/public/r/border-beam.json+++ b/apps/www/public/r/border-beam.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/border-beam.tsx",- "content": "\"use client\"\n\nimport { motion, MotionStyle, Transition } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface BorderBeamProps {\n /**\n * The size of the border beam.\n */\n size?: number\n /**\n * The duration of the border beam.\n */\n duration?: number\n /**\n * The delay of the border beam.\n */\n delay?: number\n /**\n * The color of the border beam from.\n */\n colorFrom?: string\n /**\n * The color of the border beam to.\n */\n colorTo?: string\n /**\n * The motion transition of the border beam.\n */\n transition?: Transition\n /**\n * The class name of the border beam.\n */\n className?: string\n /**\n * The style of the border beam.\n */\n style?: React.CSSProperties\n /**\n * Whether to reverse the animation direction.\n */\n reverse?: boolean\n /**\n * The initial offset position (0-100).\n */\n initialOffset?: number\n /**\n * The border width of the beam.\n */\n borderWidth?: number\n}\n\nexport const BorderBeam = ({\n className,\n size = 50,\n delay = 0,\n duration = 6,\n colorFrom = \"#ffaa40\",\n colorTo = \"#9c40ff\",\n transition,\n style,\n reverse = false,\n initialOffset = 0,\n borderWidth = 1,\n}: BorderBeamProps) => {\n return (\n <div\n className=\"pointer-events-none absolute inset-0 rounded-[inherit] border-(length:--border-beam-width) border-transparent mask-[linear-gradient(transparent,transparent),linear-gradient(#000,#000)] mask-intersect [mask-clip:padding-box,border-box]\"\n style={\n {\n \"--border-beam-width\": `${borderWidth}px`,\n } as React.CSSProperties\n }\n >\n <motion.div\n className={cn(\n \"absolute aspect-square\",\n \"bg-linear-to-l from-(--color-from) via-(--color-to) to-transparent\",\n className\n )}\n style={\n {\n width: size,\n offsetPath: `rect(0 auto auto 0 round ${size}px)`,\n \"--color-from\": colorFrom,\n \"--color-to\": colorTo,\n ...style,\n } as MotionStyle\n }\n initial={{ offsetDistance: `${initialOffset}%` }}\n animate={{\n offsetDistance: reverse\n ? [`${100 - initialOffset}%`, `${-initialOffset}%`]\n : [`${initialOffset}%`, `${100 + initialOffset}%`],\n }}\n transition={{\n repeat: Infinity,\n ease: \"linear\",\n duration,\n delay: -delay,\n ...transition,\n }}\n />\n </div>\n )\n}\n",+ "content": "\"use client\"\n\nimport { motion, type MotionStyle, type Transition } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface BorderBeamProps {\n /**\n * The size of the border beam.\n */\n size?: number\n /**\n * The duration of the border beam.\n */\n duration?: number\n /**\n * The delay of the border beam.\n */\n delay?: number\n /**\n * The color of the border beam from.\n */\n colorFrom?: string\n /**\n * The color of the border beam to.\n */\n colorTo?: string\n /**\n * The motion transition of the border beam.\n */\n transition?: Transition\n /**\n * The class name of the border beam.\n */\n className?: string\n /**\n * The style of the border beam.\n */\n style?: React.CSSProperties\n /**\n * Whether to reverse the animation direction.\n */\n reverse?: boolean\n /**\n * The initial offset position (0-100).\n */\n initialOffset?: number\n /**\n * The border width of the beam.\n */\n borderWidth?: number\n}\n\nexport const BorderBeam = ({\n className,\n size = 50,\n delay = 0,\n duration = 6,\n colorFrom = \"#ffaa40\",\n colorTo = \"#9c40ff\",\n transition,\n style,\n reverse = false,\n initialOffset = 0,\n borderWidth = 1,\n}: BorderBeamProps) => {\n return (\n <div\n className=\"pointer-events-none absolute inset-0 rounded-[inherit] border-(length:--border-beam-width) border-transparent mask-[linear-gradient(transparent,transparent),linear-gradient(#000,#000)] mask-intersect [mask-clip:padding-box,border-box]\"\n style={\n {\n \"--border-beam-width\": `${borderWidth}px`,\n } as React.CSSProperties\n }\n >\n <motion.div\n className={cn(\n \"absolute aspect-square\",\n \"bg-linear-to-l from-(--color-from) via-(--color-to) to-transparent\",\n className\n )}\n style={\n {\n width: size,\n offsetPath: `rect(0 auto auto 0 round ${size}px)`,\n \"--color-from\": colorFrom,\n \"--color-to\": colorTo,\n ...style,\n } as MotionStyle\n }\n initial={{ offsetDistance: `${initialOffset}%` }}\n animate={{\n offsetDistance: reverse\n ? [`${100 - initialOffset}%`, `${-initialOffset}%`]\n : [`${initialOffset}%`, `${100 + initialOffset}%`],\n }}\n transition={{\n repeat: Infinity,\n ease: \"linear\",\n duration,\n delay: -delay,\n ...transition,\n }}\n />\n </div>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/client-tweet-card.json b/apps/www/public/r/client-tweet-card.jsonindex 98ac10c1..c2abd520 100644--- a/apps/www/public/r/client-tweet-card.json+++ b/apps/www/public/r/client-tweet-card.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/client-tweet-card.tsx",- "content": "\"use client\"\n\nimport { TweetProps, useTweet } from \"react-tweet\"\n\nimport {\n MagicTweet,\n TweetNotFound,\n TweetSkeleton,\n} from \"@/registry/magicui/tweet-card\"\n\nexport const ClientTweetCard = ({\n id,\n apiUrl,\n fallback = <TweetSkeleton />,\n components,\n fetchOptions,\n onError,\n ...props\n}: TweetProps & { className?: string }) => {\n const { data, error, isLoading } = useTweet(id, apiUrl, fetchOptions)\n\n if (isLoading) return fallback\n if (error || !data) {\n const NotFound = components?.TweetNotFound ?? TweetNotFound\n return <NotFound error={onError ? onError(error) : error} />\n }\n\n return <MagicTweet tweet={data} {...props} />\n}\n",+ "content": "\"use client\"\n\nimport { useTweet, type TweetProps } from \"react-tweet\"\n\nimport {\n MagicTweet,\n TweetNotFound,\n TweetSkeleton,\n} from \"@/registry/magicui/tweet-card\"\n\nexport const ClientTweetCard = ({\n id,\n apiUrl,\n fallback = <TweetSkeleton />,\n components,\n fetchOptions,\n onError,\n ...props\n}: TweetProps & { className?: string }) => {\n const { data, error, isLoading } = useTweet(id, apiUrl, fetchOptions)\n\n if (isLoading) return fallback\n if (error || !data) {\n const NotFound = components?.TweetNotFound ?? TweetNotFound\n return <NotFound error={onError ? onError(error) : error} />\n }\n\n return <MagicTweet tweet={data} {...props} />\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/comic-text.json b/apps/www/public/r/comic-text.jsonindex 42b1728a..b0467cdf 100644--- a/apps/www/public/r/comic-text.json+++ b/apps/www/public/r/comic-text.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/comic-text.tsx",- "content": "\"use client\"\n\nimport { CSSProperties } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype ComicTextProps = {\n children: string\n className?: string\n style?: CSSProperties\n fontSize?: number\n}\n\nexport function ComicText({\n children,\n className,\n style,\n fontSize = 5,\n}: ComicTextProps) {\n if (typeof children !== \"string\") {\n throw new Error(\"children must be a string\")\n }\n\n const dotColor = \"#EF4444\"\n const backgroundColor = \"#FACC15\"\n\n return (\n <motion.div\n className={cn(\"text-center select-none\", className)}\n style={{\n fontSize: `${fontSize}rem`,\n fontFamily: \"'Bangers', 'Comic Sans MS', 'Impact', sans-serif\",\n fontWeight: \"900\",\n WebkitTextStroke: `${fontSize * 0.35}px #000000`, // Thick black outline\n transform: \"skewX(-10deg)\",\n textTransform: \"uppercase\",\n filter: `\n drop-shadow(5px 5px 0px #000000) \n drop-shadow(3px 3px 0px ${dotColor})\n `,\n backgroundColor: backgroundColor,\n backgroundImage: `radial-gradient(circle at 1px 1px, ${dotColor} 1px, transparent 0)`,\n backgroundSize: \"8px 8px\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n WebkitTextFillColor: \"transparent\",\n ...style,\n }}\n initial={{ opacity: 0, scale: 0.8, rotate: -2 }}\n animate={{ opacity: 1, scale: 1, rotate: 0 }}\n transition={{\n duration: 0.6,\n ease: [0.175, 0.885, 0.32, 1.275],\n type: \"spring\",\n }}\n >\n {children}\n </motion.div>\n )\n}\n",+ "content": "\"use client\"\n\nimport { type CSSProperties } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype ComicTextProps = {\n children: string\n className?: string\n style?: CSSProperties\n fontSize?: number\n}\n\nexport function ComicText({\n children,\n className,\n style,\n fontSize = 5,\n}: ComicTextProps) {\n if (typeof children !== \"string\") {\n throw new Error(\"children must be a string\")\n }\n\n const dotColor = \"#EF4444\"\n const backgroundColor = \"#FACC15\"\n\n return (\n <motion.div\n className={cn(\"text-center select-none\", className)}\n style={{\n fontSize: `${fontSize}rem`,\n fontFamily: \"'Bangers', 'Comic Sans MS', 'Impact', sans-serif\",\n fontWeight: \"900\",\n WebkitTextStroke: `${fontSize * 0.35}px #000000`, // Thick black outline\n transform: \"skewX(-10deg)\",\n textTransform: \"uppercase\",\n filter: `\n drop-shadow(5px 5px 0px #000000) \n drop-shadow(3px 3px 0px ${dotColor})\n `,\n backgroundColor: backgroundColor,\n backgroundImage: `radial-gradient(circle at 1px 1px, ${dotColor} 1px, transparent 0)`,\n backgroundSize: \"8px 8px\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n WebkitTextFillColor: \"transparent\",\n ...style,\n }}\n initial={{ opacity: 0, scale: 0.8, rotate: -2 }}\n animate={{ opacity: 1, scale: 1, rotate: 0 }}\n transition={{\n duration: 0.6,\n ease: [0.175, 0.885, 0.32, 1.275],\n type: \"spring\",\n }}\n >\n {children}\n </motion.div>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/cool-mode.json b/apps/www/public/r/cool-mode.jsonindex 8304a541..f3093676 100644--- a/apps/www/public/r/cool-mode.json+++ b/apps/www/public/r/cool-mode.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/cool-mode.tsx",- "content": "\"use client\"\n\nimport React, { ReactNode, useEffect, useRef } from \"react\"\n\nexport interface BaseParticle {\n element: HTMLElement | SVGSVGElement\n left: number\n size: number\n top: number\n}\n\nexport interface BaseParticleOptions {\n particle?: string\n size?: number\n}\n\nexport interface CoolParticle extends BaseParticle {\n direction: number\n speedHorz: number\n speedUp: number\n spinSpeed: number\n spinVal: number\n}\n\nexport interface CoolParticleOptions extends BaseParticleOptions {\n particleCount?: number\n speedHorz?: number\n speedUp?: number\n}\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\"\n\nconst getContainer = () => {\n const id = \"_coolMode_effect\"\n const existingContainer = document.getElementById(id)\n\n if (existingContainer) {\n return existingContainer\n }\n\n const container = document.createElement(\"div\")\n container.setAttribute(\"id\", id)\n container.setAttribute(\n \"style\",\n \"overflow:hidden; position:fixed; height:100%; top:0; left:0; right:0; bottom:0; pointer-events:none; z-index:2147483647\"\n )\n\n document.body.appendChild(container)\n\n return container\n}\n\nlet instanceCounter = 0\n\nconst applyParticleEffect = (\n element: HTMLElement,\n options?: CoolParticleOptions\n): (() => void) => {\n instanceCounter++\n\n const defaultParticle = \"circle\"\n const particleType = options?.particle || defaultParticle\n const sizes = [15, 20, 25, 35, 45]\n const limit = 45\n\n let particles: CoolParticle[] = []\n let autoAddParticle = false\n let mouseX = 0\n let mouseY = 0\n\n const container = getContainer()\n\n const appendCircleParticle = (particle: HTMLDivElement, size: number) => {\n const circleSVG = document.createElementNS(SVG_NS, \"svg\")\n const circle = document.createElementNS(SVG_NS, \"circle\")\n\n circle.setAttributeNS(null, \"cx\", (size / 2).toString())\n circle.setAttributeNS(null, \"cy\", (size / 2).toString())\n circle.setAttributeNS(null, \"r\", (size / 2).toString())\n circle.setAttributeNS(null, \"fill\", `hsl(${Math.random() * 360}, 70%, 50%)`)\n\n circleSVG.appendChild(circle)\n circleSVG.setAttribute(\"width\", size.toString())\n circleSVG.setAttribute(\"height\", size.toString())\n\n particle.appendChild(circleSVG)\n }\n\n const appendImageParticle = (\n particle: HTMLDivElement,\n imageSrc: string,\n size: number\n ) => {\n const image = document.createElement(\"img\")\n image.src = imageSrc\n image.width = size\n image.height = size\n image.alt = \"\"\n image.style.borderRadius = \"50%\"\n\n particle.appendChild(image)\n }\n\n const appendTextParticle = (\n particle: HTMLDivElement,\n particleContent: string,\n size: number\n ) => {\n const fontSizeMultiplier = 3\n const emojiSize = size * fontSizeMultiplier\n const content = document.createElement(\"div\")\n\n content.textContent = particleContent\n content.style.fontSize = `${emojiSize}px`\n content.style.lineHeight = \"1\"\n content.style.textAlign = \"center\"\n content.style.width = `${size}px`\n content.style.height = `${size}px`\n content.style.display = \"flex\"\n content.style.alignItems = \"center\"\n content.style.justifyContent = \"center\"\n content.style.transform = `scale(${fontSizeMultiplier})`\n content.style.transformOrigin = \"center\"\n\n particle.appendChild(content)\n }\n\n function generateParticle() {\n const size =\n options?.size || sizes[Math.floor(Math.random() * sizes.length)]\n const speedHorz = options?.speedHorz || Math.random() * 10\n const speedUp = options?.speedUp || Math.random() * 25\n const spinVal = Math.random() * 360\n const spinSpeed = Math.random() * 35 * (Math.random() <= 0.5 ? -1 : 1)\n const top = mouseY - size / 2\n const left = mouseX - size / 2\n const direction = Math.random() <= 0.5 ? -1 : 1\n\n const particle = document.createElement(\"div\")\n\n if (particleType === \"circle\") {\n appendCircleParticle(particle, size)\n } else if (\n particleType.startsWith(\"http\") ||\n particleType.startsWith(\"/\")\n ) {\n appendImageParticle(particle, particleType, size)\n } else {\n appendTextParticle(particle, particleType, size)\n }\n\n particle.style.position = \"absolute\"\n particle.style.transform = `translate3d(${left}px, ${top}px, 0px) rotate(${spinVal}deg)`\n\n container.appendChild(particle)\n\n particles.push({\n direction,\n element: particle,\n left,\n size,\n speedHorz,\n speedUp,\n spinSpeed,\n spinVal,\n top,\n })\n }\n\n function refreshParticles() {\n particles.forEach((p) => {\n p.left = p.left - p.speedHorz * p.direction\n p.top = p.top - p.speedUp\n p.speedUp = Math.min(p.size, p.speedUp - 1)\n p.spinVal = p.spinVal + p.spinSpeed\n\n if (\n p.top >=\n Math.max(window.innerHeight, document.body.clientHeight) + p.size\n ) {\n particles = particles.filter((o) => o !== p)\n p.element.remove()\n }\n\n p.element.setAttribute(\n \"style\",\n [\n \"position:absolute\",\n \"will-change:transform\",\n `top:${p.top}px`,\n `left:${p.left}px`,\n `transform:rotate(${p.spinVal}deg)`,\n ].join(\";\")\n )\n })\n }\n\n let animationFrame: number | undefined\n\n let lastParticleTimestamp = 0\n const particleGenerationDelay = 30\n\n function loop() {\n const currentTime = performance.now()\n if (\n autoAddParticle &&\n particles.length < limit &&\n currentTime - lastParticleTimestamp > particleGenerationDelay\n ) {\n generateParticle()\n lastParticleTimestamp = currentTime\n }\n\n refreshParticles()\n animationFrame = requestAnimationFrame(loop)\n }\n\n loop()\n\n const isTouchInteraction = \"ontouchstart\" in window\n\n const tap = isTouchInteraction ? \"touchstart\" : \"mousedown\"\n const tapEnd = isTouchInteraction ? \"touchend\" : \"mouseup\"\n const move = isTouchInteraction ? \"touchmove\" : \"mousemove\"\n\n const updateMousePosition = (e: MouseEvent | TouchEvent) => {\n if (\"touches\" in e) {\n mouseX = e.touches?.[0].clientX\n mouseY = e.touches?.[0].clientY\n } else {\n mouseX = e.clientX\n mouseY = e.clientY\n }\n }\n\n const tapHandler = (e: MouseEvent | TouchEvent) => {\n updateMousePosition(e)\n autoAddParticle = true\n }\n\n const disableAutoAddParticle = () => {\n autoAddParticle = false\n }\n\n element.addEventListener(move, updateMousePosition, { passive: true })\n element.addEventListener(tap, tapHandler, { passive: true })\n element.addEventListener(tapEnd, disableAutoAddParticle, { passive: true })\n element.addEventListener(\"mouseleave\", disableAutoAddParticle, {\n passive: true,\n })\n\n return () => {\n element.removeEventListener(move, updateMousePosition)\n element.removeEventListener(tap, tapHandler)\n element.removeEventListener(tapEnd, disableAutoAddParticle)\n element.removeEventListener(\"mouseleave\", disableAutoAddParticle)\n\n const interval = setInterval(() => {\n if (animationFrame && particles.length === 0) {\n cancelAnimationFrame(animationFrame)\n clearInterval(interval)\n\n if (--instanceCounter === 0) {\n container.remove()\n }\n }\n }, 500)\n }\n}\n\ninterface CoolModeProps {\n children: ReactNode\n options?: CoolParticleOptions\n}\n\nexport const CoolMode: React.FC<CoolModeProps> = ({ children, options }) => {\n const ref = useRef<HTMLSpanElement>(null)\n\n useEffect(() => {\n const element = ref.current\n let cleanup: (() => void) | null = null\n\n if (element) {\n cleanup = applyParticleEffect(element, options)\n }\n\n return () => {\n if (cleanup) {\n cleanup()\n }\n }\n }, [options])\n\n return <span ref={ref}>{children}</span>\n}\n",+ "content": "\"use client\"\n\nimport React, { useEffect, useRef, type ReactNode } from \"react\"\n\nexport interface BaseParticle {\n element: HTMLElement | SVGSVGElement\n left: number\n size: number\n top: number\n}\n\nexport interface BaseParticleOptions {\n particle?: string\n size?: number\n}\n\nexport interface CoolParticle extends BaseParticle {\n direction: number\n speedHorz: number\n speedUp: number\n spinSpeed: number\n spinVal: number\n}\n\nexport interface CoolParticleOptions extends BaseParticleOptions {\n particleCount?: number\n speedHorz?: number\n speedUp?: number\n}\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\"\n\nconst getContainer = () => {\n const id = \"_coolMode_effect\"\n const existingContainer = document.getElementById(id)\n\n if (existingContainer) {\n return existingContainer\n }\n\n const container = document.createElement(\"div\")\n container.setAttribute(\"id\", id)\n container.setAttribute(\n \"style\",\n \"overflow:hidden; position:fixed; height:100%; top:0; left:0; right:0; bottom:0; pointer-events:none; z-index:2147483647\"\n )\n\n document.body.appendChild(container)\n\n return container\n}\n\nlet instanceCounter = 0\n\nconst applyParticleEffect = (\n element: HTMLElement,\n options?: CoolParticleOptions\n): (() => void) => {\n instanceCounter++\n\n const defaultParticle = \"circle\"\n const particleType = options?.particle || defaultParticle\n const sizes = [15, 20, 25, 35, 45]\n const limit = 45\n\n let particles: CoolParticle[] = []\n let autoAddParticle = false\n let mouseX = 0\n let mouseY = 0\n\n const container = getContainer()\n\n const appendCircleParticle = (particle: HTMLDivElement, size: number) => {\n const circleSVG = document.createElementNS(SVG_NS, \"svg\")\n const circle = document.createElementNS(SVG_NS, \"circle\")\n\n circle.setAttributeNS(null, \"cx\", (size / 2).toString())\n circle.setAttributeNS(null, \"cy\", (size / 2).toString())\n circle.setAttributeNS(null, \"r\", (size / 2).toString())\n circle.setAttributeNS(null, \"fill\", `hsl(${Math.random() * 360}, 70%, 50%)`)\n\n circleSVG.appendChild(circle)\n circleSVG.setAttribute(\"width\", size.toString())\n circleSVG.setAttribute(\"height\", size.toString())\n\n particle.appendChild(circleSVG)\n }\n\n const appendImageParticle = (\n particle: HTMLDivElement,\n imageSrc: string,\n size: number\n ) => {\n const image = document.createElement(\"img\")\n image.src = imageSrc\n image.width = size\n image.height = size\n image.alt = \"\"\n image.style.borderRadius = \"50%\"\n\n particle.appendChild(image)\n }\n\n const appendTextParticle = (\n particle: HTMLDivElement,\n particleContent: string,\n size: number\n ) => {\n const fontSizeMultiplier = 3\n const emojiSize = size * fontSizeMultiplier\n const content = document.createElement(\"div\")\n\n content.textContent = particleContent\n content.style.fontSize = `${emojiSize}px`\n content.style.lineHeight = \"1\"\n content.style.textAlign = \"center\"\n content.style.width = `${size}px`\n content.style.height = `${size}px`\n content.style.display = \"flex\"\n content.style.alignItems = \"center\"\n content.style.justifyContent = \"center\"\n content.style.transform = `scale(${fontSizeMultiplier})`\n content.style.transformOrigin = \"center\"\n\n particle.appendChild(content)\n }\n\n function generateParticle() {\n const size =\n options?.size || sizes[Math.floor(Math.random() * sizes.length)]\n const speedHorz = options?.speedHorz || Math.random() * 10\n const speedUp = options?.speedUp || Math.random() * 25\n const spinVal = Math.random() * 360\n const spinSpeed = Math.random() * 35 * (Math.random() <= 0.5 ? -1 : 1)\n const top = mouseY - size / 2\n const left = mouseX - size / 2\n const direction = Math.random() <= 0.5 ? -1 : 1\n\n const particle = document.createElement(\"div\")\n\n if (particleType === \"circle\") {\n appendCircleParticle(particle, size)\n } else if (\n particleType.startsWith(\"http\") ||\n particleType.startsWith(\"/\")\n ) {\n appendImageParticle(particle, particleType, size)\n } else {\n appendTextParticle(particle, particleType, size)\n }\n\n particle.style.position = \"absolute\"\n particle.style.transform = `translate3d(${left}px, ${top}px, 0px) rotate(${spinVal}deg)`\n\n container.appendChild(particle)\n\n particles.push({\n direction,\n element: particle,\n left,\n size,\n speedHorz,\n speedUp,\n spinSpeed,\n spinVal,\n top,\n })\n }\n\n function refreshParticles() {\n particles.forEach((p) => {\n p.left = p.left - p.speedHorz * p.direction\n p.top = p.top - p.speedUp\n p.speedUp = Math.min(p.size, p.speedUp - 1)\n p.spinVal = p.spinVal + p.spinSpeed\n\n if (\n p.top >=\n Math.max(window.innerHeight, document.body.clientHeight) + p.size\n ) {\n particles = particles.filter((o) => o !== p)\n p.element.remove()\n }\n\n p.element.setAttribute(\n \"style\",\n [\n \"position:absolute\",\n \"will-change:transform\",\n `top:${p.top}px`,\n `left:${p.left}px`,\n `transform:rotate(${p.spinVal}deg)`,\n ].join(\";\")\n )\n })\n }\n\n let animationFrame: number | undefined\n\n let lastParticleTimestamp = 0\n const particleGenerationDelay = 30\n\n function loop() {\n const currentTime = performance.now()\n if (\n autoAddParticle &&\n particles.length < limit &&\n currentTime - lastParticleTimestamp > particleGenerationDelay\n ) {\n generateParticle()\n lastParticleTimestamp = currentTime\n }\n\n refreshParticles()\n animationFrame = requestAnimationFrame(loop)\n }\n\n loop()\n\n const isTouchInteraction = \"ontouchstart\" in window\n\n const tap = isTouchInteraction ? \"touchstart\" : \"mousedown\"\n const tapEnd = isTouchInteraction ? \"touchend\" : \"mouseup\"\n const move = isTouchInteraction ? \"touchmove\" : \"mousemove\"\n\n const updateMousePosition = (e: MouseEvent | TouchEvent) => {\n if (\"touches\" in e) {\n mouseX = e.touches?.[0].clientX\n mouseY = e.touches?.[0].clientY\n } else {\n mouseX = e.clientX\n mouseY = e.clientY\n }\n }\n\n const tapHandler = (e: MouseEvent | TouchEvent) => {\n updateMousePosition(e)\n autoAddParticle = true\n }\n\n const disableAutoAddParticle = () => {\n autoAddParticle = false\n }\n\n element.addEventListener(move, updateMousePosition, { passive: true })\n element.addEventListener(tap, tapHandler, { passive: true })\n element.addEventListener(tapEnd, disableAutoAddParticle, { passive: true })\n element.addEventListener(\"mouseleave\", disableAutoAddParticle, {\n passive: true,\n })\n\n return () => {\n element.removeEventListener(move, updateMousePosition)\n element.removeEventListener(tap, tapHandler)\n element.removeEventListener(tapEnd, disableAutoAddParticle)\n element.removeEventListener(\"mouseleave\", disableAutoAddParticle)\n\n const interval = setInterval(() => {\n if (animationFrame && particles.length === 0) {\n cancelAnimationFrame(animationFrame)\n clearInterval(interval)\n\n if (--instanceCounter === 0) {\n container.remove()\n }\n }\n }, 500)\n }\n}\n\ninterface CoolModeProps {\n children: ReactNode\n options?: CoolParticleOptions\n}\n\nexport const CoolMode: React.FC<CoolModeProps> = ({ children, options }) => {\n const ref = useRef<HTMLSpanElement>(null)\n\n useEffect(() => {\n const element = ref.current\n let cleanup: (() => void) | null = null\n\n if (element) {\n cleanup = applyParticleEffect(element, options)\n }\n\n return () => {\n if (cleanup) {\n cleanup()\n }\n }\n }, [options])\n\n return <span ref={ref}>{children}</span>\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/dock.json b/apps/www/public/r/dock.jsonindex b61481f6..3397b46a 100644--- a/apps/www/public/r/dock.json+++ b/apps/www/public/r/dock.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/dock.tsx",- "content": "\"use client\"\n\nimport React, { PropsWithChildren, useRef } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n motion,\n MotionValue,\n useMotionValue,\n useSpring,\n useTransform,\n} from \"motion/react\"\nimport type { MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface DockProps extends VariantProps<typeof dockVariants> {\n className?: string\n iconSize?: number\n iconMagnification?: number\n disableMagnification?: boolean\n iconDistance?: number\n direction?: \"top\" | \"middle\" | \"bottom\"\n children: React.ReactNode\n}\n\nconst DEFAULT_SIZE = 40\nconst DEFAULT_MAGNIFICATION = 60\nconst DEFAULT_DISTANCE = 140\nconst DEFAULT_DISABLEMAGNIFICATION = false\n\nconst dockVariants = cva(\n \"supports-backdrop-blur:bg-white/10 supports-backdrop-blur:dark:bg-black/10 mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl border p-2 backdrop-blur-md\"\n)\n\nconst Dock = React.forwardRef<HTMLDivElement, DockProps>(\n (\n {\n className,\n children,\n iconSize = DEFAULT_SIZE,\n iconMagnification = DEFAULT_MAGNIFICATION,\n disableMagnification = DEFAULT_DISABLEMAGNIFICATION,\n iconDistance = DEFAULT_DISTANCE,\n direction = \"middle\",\n ...props\n },\n ref\n ) => {\n const mouseX = useMotionValue(Infinity)\n\n const renderChildren = () => {\n return React.Children.map(children, (child) => {\n if (\n React.isValidElement<DockIconProps>(child) &&\n child.type === DockIcon\n ) {\n return React.cloneElement(child, {\n ...child.props,\n mouseX: mouseX,\n size: iconSize,\n magnification: iconMagnification,\n disableMagnification: disableMagnification,\n distance: iconDistance,\n })\n }\n return child\n })\n }\n\n return (\n <motion.div\n ref={ref}\n onMouseMove={(e) => mouseX.set(e.pageX)}\n onMouseLeave={() => mouseX.set(Infinity)}\n {...props}\n className={cn(dockVariants({ className }), {\n \"items-start\": direction === \"top\",\n \"items-center\": direction === \"middle\",\n \"items-end\": direction === \"bottom\",\n })}\n >\n {renderChildren()}\n </motion.div>\n )\n }\n)\n\nDock.displayName = \"Dock\"\n\nexport interface DockIconProps extends Omit<\n MotionProps & React.HTMLAttributes<HTMLDivElement>,\n \"children\"\n> {\n size?: number\n magnification?: number\n disableMagnification?: boolean\n distance?: number\n mouseX?: MotionValue<number>\n className?: string\n children?: React.ReactNode\n props?: PropsWithChildren\n}\n\nconst DockIcon = ({\n size = DEFAULT_SIZE,\n magnification = DEFAULT_MAGNIFICATION,\n disableMagnification,\n distance = DEFAULT_DISTANCE,\n mouseX,\n className,\n children,\n ...props\n}: DockIconProps) => {\n const ref = useRef<HTMLDivElement>(null)\n const padding = Math.max(6, size * 0.2)\n const defaultMouseX = useMotionValue(Infinity)\n\n const distanceCalc = useTransform(mouseX ?? defaultMouseX, (val: number) => {\n const bounds = ref.current?.getBoundingClientRect() ?? { x: 0, width: 0 }\n return val - bounds.x - bounds.width / 2\n })\n\n const targetSize = disableMagnification ? size : magnification\n\n const sizeTransform = useTransform(\n distanceCalc,\n [-distance, 0, distance],\n [size, targetSize, size]\n )\n\n const scaleSize = useSpring(sizeTransform, {\n mass: 0.1,\n stiffness: 150,\n damping: 12,\n })\n\n return (\n <motion.div\n ref={ref}\n style={{ width: scaleSize, height: scaleSize, padding }}\n className={cn(\n \"flex aspect-square cursor-pointer items-center justify-center rounded-full\",\n disableMagnification && \"hover:bg-muted-foreground transition-colors\",\n className\n )}\n {...props}\n >\n <div>{children}</div>\n </motion.div>\n )\n}\n\nDockIcon.displayName = \"DockIcon\"\n\nexport { Dock, DockIcon, dockVariants }\n",+ "content": "\"use client\"\n\nimport React, { useRef, type PropsWithChildren } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n motion,\n MotionValue,\n useMotionValue,\n useSpring,\n useTransform,\n} from \"motion/react\"\nimport type { MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface DockProps extends VariantProps<typeof dockVariants> {\n className?: string\n iconSize?: number\n iconMagnification?: number\n disableMagnification?: boolean\n iconDistance?: number\n direction?: \"top\" | \"middle\" | \"bottom\"\n children: React.ReactNode\n}\n\nconst DEFAULT_SIZE = 40\nconst DEFAULT_MAGNIFICATION = 60\nconst DEFAULT_DISTANCE = 140\nconst DEFAULT_DISABLEMAGNIFICATION = false\n\nconst dockVariants = cva(\n \"supports-backdrop-blur:bg-white/10 supports-backdrop-blur:dark:bg-black/10 mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl border p-2 backdrop-blur-md\"\n)\n\nconst Dock = React.forwardRef<HTMLDivElement, DockProps>(\n (\n {\n className,\n children,\n iconSize = DEFAULT_SIZE,\n iconMagnification = DEFAULT_MAGNIFICATION,\n disableMagnification = DEFAULT_DISABLEMAGNIFICATION,\n iconDistance = DEFAULT_DISTANCE,\n direction = \"middle\",\n ...props\n },\n ref\n ) => {\n const mouseX = useMotionValue(Infinity)\n\n const renderChildren = () => {\n return React.Children.map(children, (child) => {\n if (\n React.isValidElement<DockIconProps>(child) &&\n child.type === DockIcon\n ) {\n return React.cloneElement(child, {\n ...child.props,\n mouseX: mouseX,\n size: iconSize,\n magnification: iconMagnification,\n disableMagnification: disableMagnification,\n distance: iconDistance,\n })\n }\n return child\n })\n }\n\n return (\n <motion.div\n ref={ref}\n onMouseMove={(e) => mouseX.set(e.pageX)}\n onMouseLeave={() => mouseX.set(Infinity)}\n {...props}\n className={cn(dockVariants({ className }), {\n \"items-start\": direction === \"top\",\n \"items-center\": direction === \"middle\",\n \"items-end\": direction === \"bottom\",\n })}\n >\n {renderChildren()}\n </motion.div>\n )\n }\n)\n\nDock.displayName = \"Dock\"\n\nexport interface DockIconProps extends Omit<\n MotionProps & React.HTMLAttributes<HTMLDivElement>,\n \"children\"\n> {\n size?: number\n magnification?: number\n disableMagnification?: boolean\n distance?: number\n mouseX?: MotionValue<number>\n className?: string\n children?: React.ReactNode\n props?: PropsWithChildren\n}\n\nconst DockIcon = ({\n size = DEFAULT_SIZE,\n magnification = DEFAULT_MAGNIFICATION,\n disableMagnification,\n distance = DEFAULT_DISTANCE,\n mouseX,\n className,\n children,\n ...props\n}: DockIconProps) => {\n const ref = useRef<HTMLDivElement>(null)\n const padding = Math.max(6, size * 0.2)\n const defaultMouseX = useMotionValue(Infinity)\n\n const distanceCalc = useTransform(mouseX ?? defaultMouseX, (val: number) => {\n const bounds = ref.current?.getBoundingClientRect() ?? { x: 0, width: 0 }\n return val - bounds.x - bounds.width / 2\n })\n\n const targetSize = disableMagnification ? size : magnification\n\n const sizeTransform = useTransform(\n distanceCalc,\n [-distance, 0, distance],\n [size, targetSize, size]\n )\n\n const scaleSize = useSpring(sizeTransform, {\n mass: 0.1,\n stiffness: 150,\n damping: 12,\n })\n\n return (\n <motion.div\n ref={ref}\n style={{ width: scaleSize, height: scaleSize, padding }}\n className={cn(\n \"flex aspect-square cursor-pointer items-center justify-center rounded-full\",\n disableMagnification && \"hover:bg-muted-foreground transition-colors\",\n className\n )}\n {...props}\n >\n <div>{children}</div>\n </motion.div>\n )\n}\n\nDockIcon.displayName = \"DockIcon\"\n\nexport { Dock, DockIcon, dockVariants }\n","type": "registry:ui"}]diff --git a/apps/www/public/r/neon-gradient-card.json b/apps/www/public/r/neon-gradient-card.jsonindex 9ffdf5be..16ed0982 100644--- a/apps/www/public/r/neon-gradient-card.json+++ b/apps/www/public/r/neon-gradient-card.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/neon-gradient-card.tsx",- "content": "\"use client\"\n\nimport {\n CSSProperties,\n ReactElement,\n ReactNode,\n useEffect,\n useRef,\n useState,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface NeonColorsProps {\n firstColor: string\n secondColor: string\n}\n\ninterface NeonGradientCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @default <div />\n * @type ReactElement\n * @description\n * The component to be rendered as the card\n * */\n as?: ReactElement\n /**\n * @default \"\"\n * @type string\n * @description\n * The className of the card\n */\n className?: string\n\n /**\n * @default \"\"\n * @type ReactNode\n * @description\n * The children of the card\n * */\n children?: ReactNode\n\n /**\n * @default 5\n * @type number\n * @description\n * The size of the border in pixels\n * */\n borderSize?: number\n\n /**\n * @default 20\n * @type number\n * @description\n * The size of the radius in pixels\n * */\n borderRadius?: number\n\n /**\n * @default \"{ firstColor: '#ff00aa', secondColor: '#00FFF1' }\"\n * @type string\n * @description\n * The colors of the neon gradient\n * */\n neonColors?: NeonColorsProps\n}\n\nexport const NeonGradientCard: React.FC<NeonGradientCardProps> = ({\n className,\n children,\n borderSize = 2,\n borderRadius = 20,\n neonColors = {\n firstColor: \"#ff00aa\",\n secondColor: \"#00FFF1\",\n },\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }\n\n updateDimensions()\n window.addEventListener(\"resize\", updateDimensions)\n\n return () => {\n window.removeEventListener(\"resize\", updateDimensions)\n }\n }, [])\n\n useEffect(() => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }, [children])\n\n return (\n <div\n ref={containerRef}\n style={\n {\n \"--border-size\": `${borderSize}px`,\n \"--border-radius\": `${borderRadius}px`,\n \"--neon-first-color\": neonColors.firstColor,\n \"--neon-second-color\": neonColors.secondColor,\n \"--card-width\": `${dimensions.width}px`,\n \"--card-height\": `${dimensions.height}px`,\n \"--card-content-radius\": `${borderRadius - borderSize}px`,\n \"--pseudo-element-background-image\": `linear-gradient(0deg, ${neonColors.firstColor}, ${neonColors.secondColor})`,\n \"--pseudo-element-width\": `${dimensions.width + borderSize * 2}px`,\n \"--pseudo-element-height\": `${dimensions.height + borderSize * 2}px`,\n \"--after-blur\": `${dimensions.width / 3}px`,\n } as CSSProperties\n }\n className={cn(\n \"relative z-10 size-full rounded-(--border-radius)\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"relative size-full min-h-[inherit] rounded-(--card-content-radius) bg-gray-100 p-6\",\n \"before:absolute before:-top-(--border-size) before:-left-(--border-size) before:-z-10 before:block\",\n \"before:h-(--pseudo-element-height) before:w-(--pseudo-element-width) before:rounded-(--border-radius) before:content-['']\",\n \"before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-size-[100%_200%]\",\n \"before:animate-background-position-spin\",\n \"after:absolute after:-top-(--border-size) after:-left-(--border-size) after:-z-10 after:block\",\n \"after:h-(--pseudo-element-height) after:w-(--pseudo-element-width) after:rounded-(--border-radius) after:blur-(--after-blur) after:content-['']\",\n \"after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-size-[100%_200%] after:opacity-80\",\n \"after:animate-background-position-spin\",\n \"dark:bg-neutral-900\",\n \"wrap-break-word\"\n )}\n >\n {children}\n </div>\n </div>\n )\n}\n",+ "content": "\"use client\"\n\nimport {\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface NeonColorsProps {\n firstColor: string\n secondColor: string\n}\n\ninterface NeonGradientCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @default <div />\n * @type ReactElement\n * @description\n * The component to be rendered as the card\n * */\n as?: ReactElement\n /**\n * @default \"\"\n * @type string\n * @description\n * The className of the card\n */\n className?: string\n\n /**\n * @default \"\"\n * @type ReactNode\n * @description\n * The children of the card\n * */\n children?: ReactNode\n\n /**\n * @default 5\n * @type number\n * @description\n * The size of the border in pixels\n * */\n borderSize?: number\n\n /**\n * @default 20\n * @type number\n * @description\n * The size of the radius in pixels\n * */\n borderRadius?: number\n\n /**\n * @default \"{ firstColor: '#ff00aa', secondColor: '#00FFF1' }\"\n * @type string\n * @description\n * The colors of the neon gradient\n * */\n neonColors?: NeonColorsProps\n}\n\nexport const NeonGradientCard: React.FC<NeonGradientCardProps> = ({\n className,\n children,\n borderSize = 2,\n borderRadius = 20,\n neonColors = {\n firstColor: \"#ff00aa\",\n secondColor: \"#00FFF1\",\n },\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }\n\n updateDimensions()\n window.addEventListener(\"resize\", updateDimensions)\n\n return () => {\n window.removeEventListener(\"resize\", updateDimensions)\n }\n }, [])\n\n useEffect(() => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }, [children])\n\n return (\n <div\n ref={containerRef}\n style={\n {\n \"--border-size\": `${borderSize}px`,\n \"--border-radius\": `${borderRadius}px`,\n \"--neon-first-color\": neonColors.firstColor,\n \"--neon-second-color\": neonColors.secondColor,\n \"--card-width\": `${dimensions.width}px`,\n \"--card-height\": `${dimensions.height}px`,\n \"--card-content-radius\": `${borderRadius - borderSize}px`,\n \"--pseudo-element-background-image\": `linear-gradient(0deg, ${neonColors.firstColor}, ${neonColors.secondColor})`,\n \"--pseudo-element-width\": `${dimensions.width + borderSize * 2}px`,\n \"--pseudo-element-height\": `${dimensions.height + borderSize * 2}px`,\n \"--after-blur\": `${dimensions.width / 3}px`,\n } as CSSProperties\n }\n className={cn(\n \"relative z-10 size-full rounded-(--border-radius)\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"relative size-full min-h-[inherit] rounded-(--card-content-radius) bg-gray-100 p-6\",\n \"before:absolute before:-top-(--border-size) before:-left-(--border-size) before:-z-10 before:block\",\n \"before:h-(--pseudo-element-height) before:w-(--pseudo-element-width) before:rounded-(--border-radius) before:content-['']\",\n \"before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-size-[100%_200%]\",\n \"before:animate-background-position-spin\",\n \"after:absolute after:-top-(--border-size) after:-left-(--border-size) after:-z-10 after:block\",\n \"after:h-(--pseudo-element-height) after:w-(--pseudo-element-width) after:rounded-(--border-radius) after:blur-(--after-blur) after:content-['']\",\n \"after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-size-[100%_200%] after:opacity-80\",\n \"after:animate-background-position-spin\",\n \"dark:bg-neutral-900\",\n \"wrap-break-word\"\n )}\n >\n {children}\n </div>\n </div>\n )\n}\n","type": "registry:ui"}],diff --git a/apps/www/public/r/rainbow-button.json b/apps/www/public/r/rainbow-button.jsonindex b22a6cf1..1650c731 100644--- a/apps/www/public/r/rainbow-button.json+++ b/apps/www/public/r/rainbow-button.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/rainbow-button.tsx",- "content": "import React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst rainbowButtonVariants = cva(\n cn(\n \"relative cursor-pointer group transition-all animate-rainbow\",\n \"inline-flex items-center justify-center gap-2 shrink-0\",\n \"rounded-sm outline-none focus-visible:ring-[3px] aria-invalid:border-destructive\",\n \"text-sm font-medium whitespace-nowrap\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0\"\n ),\n {\n variants: {\n variant: {\n default:\n \"border-0 bg-[linear-gradient(#121213,#121213),linear-gradient(#121213_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-primary-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] [border:calc(0.125rem)_solid_transparent] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#fff,#fff),linear-gradient(#fff_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))]\",\n outline:\n \"border border-input border-b-transparent bg-[linear-gradient(#ffffff,#ffffff),linear-gradient(#ffffff_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-accent-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#0a0a0a,#0a0a0a),linear-gradient(#0a0a0a_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))]\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-xl px-3 text-xs\",\n lg: \"h-11 rounded-xl px-8\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\ninterface RainbowButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof rainbowButtonVariants> {\n asChild?: boolean\n}\n\nconst RainbowButton = React.forwardRef<HTMLButtonElement, RainbowButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n data-slot=\"button\"\n className={cn(rainbowButtonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nRainbowButton.displayName = \"RainbowButton\"\n\nexport { RainbowButton, rainbowButtonVariants, type RainbowButtonProps }\n",+ "content": "import React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst rainbowButtonVariants = cva(\n cn(\n \"relative cursor-pointer group transition-all animate-rainbow\",\n \"inline-flex items-center justify-center gap-2 shrink-0\",\n \"rounded-sm outline-none focus-visible:ring-[3px] aria-invalid:border-destructive\",\n \"text-sm font-medium whitespace-nowrap\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0\"\n ),\n {\n variants: {\n variant: {\n default:\n \"border-0 bg-[linear-gradient(#121213,#121213),linear-gradient(#121213_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-primary-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] [border:calc(0.125rem)_solid_transparent] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#fff,#fff),linear-gradient(#fff_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))]\",\n outline:\n \"border border-input border-b-transparent bg-[linear-gradient(#ffffff,#ffffff),linear-gradient(#ffffff_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-accent-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#0a0a0a,#0a0a0a),linear-gradient(#0a0a0a_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))]\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-xl px-3 text-xs\",\n lg: \"h-11 rounded-xl px-8\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\ninterface RainbowButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof rainbowButtonVariants> {\n asChild?: boolean\n}\n\nconst RainbowButton = React.forwardRef<HTMLButtonElement, RainbowButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n data-slot=\"button\"\n className={cn(rainbowButtonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nRainbowButton.displayName = \"RainbowButton\"\n\nexport { RainbowButton, rainbowButtonVariants, type RainbowButtonProps }\n","type": "registry:ui"}],diff --git a/apps/www/public/r/ripple-button.json b/apps/www/public/r/ripple-button.jsonindex 2731cb25..cd88d83d 100644--- a/apps/www/public/r/ripple-button.json+++ b/apps/www/public/r/ripple-button.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/ripple-button.tsx",- "content": "\"use client\"\n\nimport React, { MouseEvent, useEffect, useState } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RippleButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n rippleColor?: string\n duration?: string\n}\n\nexport const RippleButton = React.forwardRef<\n HTMLButtonElement,\n RippleButtonProps\n>(\n (\n {\n className,\n children,\n rippleColor = \"#ffffff\",\n duration = \"600ms\",\n onClick,\n ...props\n },\n ref\n ) => {\n const [buttonRipples, setButtonRipples] = useState<\n Array<{ x: number; y: number; size: number; key: number }>\n >([])\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n createRipple(event)\n onClick?.(event)\n }\n\n const createRipple = (event: MouseEvent<HTMLButtonElement>) => {\n const button = event.currentTarget\n const rect = button.getBoundingClientRect()\n const size = Math.max(rect.width, rect.height)\n const x = event.clientX - rect.left - size / 2\n const y = event.clientY - rect.top - size / 2\n\n const newRipple = { x, y, size, key: Date.now() }\n setButtonRipples((prevRipples) => [...prevRipples, newRipple])\n }\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | null = null\n\n if (buttonRipples.length > 0) {\n const lastRipple = buttonRipples[buttonRipples.length - 1]\n timeout = setTimeout(() => {\n setButtonRipples((prevRipples) =>\n prevRipples.filter((ripple) => ripple.key !== lastRipple.key)\n )\n }, parseInt(duration))\n }\n\n return () => {\n if (timeout !== null) {\n clearTimeout(timeout)\n }\n }\n }, [buttonRipples, duration])\n\n return (\n <button\n className={cn(\n \"bg-background text-primary relative flex cursor-pointer items-center justify-center overflow-hidden rounded-lg border-2 px-4 py-2 text-center\",\n className\n )}\n onClick={handleClick}\n ref={ref}\n {...props}\n >\n <div className=\"relative z-10\">{children}</div>\n <span className=\"pointer-events-none absolute inset-0\">\n {buttonRipples.map((ripple) => (\n <span\n className=\"animate-rippling bg-background absolute rounded-full opacity-30\"\n key={ripple.key}\n style={\n {\n width: `${ripple.size}px`,\n height: `${ripple.size}px`,\n top: `${ripple.y}px`,\n left: `${ripple.x}px`,\n backgroundColor: rippleColor,\n transform: `scale(0)`,\n \"--duration\": duration,\n } as React.CSSProperties\n }\n />\n ))}\n </span>\n </button>\n )\n }\n)\n\nRippleButton.displayName = \"RippleButton\"\n",+ "content": "\"use client\"\n\nimport React, { useEffect, useState, type MouseEvent } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RippleButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n rippleColor?: string\n duration?: string\n}\n\nexport const RippleButton = React.forwardRef<\n HTMLButtonElement,\n RippleButtonProps\n>(\n (\n {\n className,\n children,\n rippleColor = \"#ffffff\",\n duration = \"600ms\",\n onClick,\n ...props\n },\n ref\n ) => {\n const [buttonRipples, setButtonRipples] = useState<\n Array<{ x: number; y: number; size: number; key: number }>\n >([])\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n createRipple(event)\n onClick?.(event)\n }\n\n const createRipple = (event: MouseEvent<HTMLButtonElement>) => {\n const button = event.currentTarget\n const rect = button.getBoundingClientRect()\n const size = Math.max(rect.width, rect.height)\n const x = event.clientX - rect.left - size / 2\n const y = event.clientY - rect.top - size / 2\n\n const newRipple = { x, y, size, key: Date.now() }\n setButtonRipples((prevRipples) => [...prevRipples, newRipple])\n }\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | null = null\n\n if (buttonRipples.length > 0) {\n const lastRipple = buttonRipples[buttonRipples.length - 1]\n timeout = setTimeout(() => {\n setButtonRipples((prevRipples) =>\n prevRipples.filter((ripple) => ripple.key !== lastRipple.key)\n )\n }, parseInt(duration))\n }\n\n return () => {\n if (timeout !== null) {\n clearTimeout(timeout)\n }\n }\n }, [buttonRipples, duration])\n\n return (\n <button\n className={cn(\n \"bg-background text-primary relative flex cursor-pointer items-center justify-center overflow-hidden rounded-lg border-2 px-4 py-2 text-center\",\n className\n )}\n onClick={handleClick}\n ref={ref}\n {...props}\n >\n <div className=\"relative z-10\">{children}</div>\n <span className=\"pointer-events-none absolute inset-0\">\n {buttonRipples.map((ripple) => (\n <span\n className=\"animate-rippling bg-background absolute rounded-full opacity-30\"\n key={ripple.key}\n style={\n {\n width: `${ripple.size}px`,\n height: `${ripple.size}px`,\n top: `${ripple.y}px`,\n left: `${ripple.x}px`,\n backgroundColor: rippleColor,\n transform: `scale(0)`,\n \"--duration\": duration,\n } as React.CSSProperties\n }\n />\n ))}\n </span>\n </button>\n )\n }\n)\n\nRippleButton.displayName = \"RippleButton\"\n","type": "registry:ui"}],diff --git a/apps/www/public/r/smooth-cursor.json b/apps/www/public/r/smooth-cursor.jsonindex bc763536..95432d24 100644--- a/apps/www/public/r/smooth-cursor.json+++ b/apps/www/public/r/smooth-cursor.json@@ -9,7 +9,7 @@"files": [{"path": "registry/magicui/smooth-cursor.tsx",- "content": "\"use client\"\n\nimport { FC, useEffect, useRef, useState } from \"react\"\nimport { motion, useSpring } from \"motion/react\"\n\ninterface Position {\n x: number\n y: number\n}\n\nexport interface SmoothCursorProps {\n cursor?: React.ReactNode\n springConfig?: {\n damping: number\n stiffness: number\n mass: number\n restDelta: number\n }\n}\n\nconst DESKTOP_POINTER_QUERY = \"(any-hover: hover) and (any-pointer: fine)\"\n\nfunction isTrackablePointer(pointerType: string) {\n return pointerType !== \"touch\"\n}\n\nconst DefaultCursorSVG: FC = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={50}\n height={54}\n viewBox=\"0 0 50 54\"\n fill=\"none\"\n style={{ scale: 0.5 }}\n >\n <g filter=\"url(#filter0_d_91_7928)\">\n <path\n d=\"M42.6817 41.1495L27.5103 6.79925C26.7269 5.02557 24.2082 5.02558 23.3927 6.79925L7.59814 41.1495C6.75833 42.9759 8.52712 44.8902 10.4125 44.1954L24.3757 39.0496C24.8829 38.8627 25.4385 38.8627 25.9422 39.0496L39.8121 44.1954C41.6849 44.8902 43.4884 42.9759 42.6817 41.1495Z\"\n fill=\"black\"\n />\n <path\n d=\"M43.7146 40.6933L28.5431 6.34306C27.3556 3.65428 23.5772 3.69516 22.3668 6.32755L6.57226 40.6778C5.3134 43.4156 7.97238 46.298 10.803 45.2549L24.7662 40.109C25.0221 40.0147 25.2999 40.0156 25.5494 40.1082L39.4193 45.254C42.2261 46.2953 44.9254 43.4347 43.7146 40.6933Z\"\n stroke=\"white\"\n strokeWidth={2.25825}\n />\n </g>\n <defs>\n <filter\n id=\"filter0_d_91_7928\"\n x={0.602397}\n y={0.952444}\n width={49.0584}\n height={52.428}\n filterUnits=\"userSpaceOnUse\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feFlood floodOpacity={0} result=\"BackgroundImageFix\" />\n <feColorMatrix\n in=\"SourceAlpha\"\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\n result=\"hardAlpha\"\n />\n <feOffset dy={2.25825} />\n <feGaussianBlur stdDeviation={2.25825} />\n <feComposite in2=\"hardAlpha\" operator=\"out\" />\n <feColorMatrix\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0\"\n />\n <feBlend\n mode=\"normal\"\n in2=\"BackgroundImageFix\"\n result=\"effect1_dropShadow_91_7928\"\n />\n <feBlend\n mode=\"normal\"\n in=\"SourceGraphic\"\n in2=\"effect1_dropShadow_91_7928\"\n result=\"shape\"\n />\n </filter>\n </defs>\n </svg>\n )\n}\n\nexport function SmoothCursor({\n cursor = <DefaultCursorSVG />,\n springConfig = {\n damping: 45,\n stiffness: 400,\n mass: 1,\n restDelta: 0.001,\n },\n}: SmoothCursorProps) {\n const lastMousePos = useRef<Position>({ x: 0, y: 0 })\n const velocity = useRef<Position>({ x: 0, y: 0 })\n const lastUpdateTime = useRef(Date.now())\n const previousAngle = useRef(0)\n const accumulatedRotation = useRef(0)\n const [isEnabled, setIsEnabled] = useState(false)\n const [isVisible, setIsVisible] = useState(false)\n\n const cursorX = useSpring(0, springConfig)\n const cursorY = useSpring(0, springConfig)\n const rotation = useSpring(0, {\n ...springConfig,\n damping: 60,\n stiffness: 300,\n })\n const scale = useSpring(1, {\n ...springConfig,\n stiffness: 500,\n damping: 35,\n })\n\n useEffect(() => {\n const mediaQuery = window.matchMedia(DESKTOP_POINTER_QUERY)\n\n const updateEnabled = () => {\n const nextIsEnabled = mediaQuery.matches\n setIsEnabled(nextIsEnabled)\n\n if (!nextIsEnabled) {\n setIsVisible(false)\n }\n }\n\n updateEnabled()\n mediaQuery.addEventListener(\"change\", updateEnabled)\n\n return () => {\n mediaQuery.removeEventListener(\"change\", updateEnabled)\n }\n }, [])\n\n useEffect(() => {\n if (!isEnabled) {\n return\n }\n\n let timeout: ReturnType<typeof setTimeout> | null = null\n\n const updateVelocity = (currentPos: Position) => {\n const currentTime = Date.now()\n const deltaTime = currentTime - lastUpdateTime.current\n\n if (deltaTime > 0) {\n velocity.current = {\n x: (currentPos.x - lastMousePos.current.x) / deltaTime,\n y: (currentPos.y - lastMousePos.current.y) / deltaTime,\n }\n }\n\n lastUpdateTime.current = currentTime\n lastMousePos.current = currentPos\n }\n\n const smoothPointerMove = (e: PointerEvent) => {\n if (!isTrackablePointer(e.pointerType)) {\n return\n }\n\n setIsVisible(true)\n\n const currentPos = { x: e.clientX, y: e.clientY }\n updateVelocity(currentPos)\n\n const speed = Math.sqrt(\n Math.pow(velocity.current.x, 2) + Math.pow(velocity.current.y, 2)\n )\n\n cursorX.set(currentPos.x)\n cursorY.set(currentPos.y)\n\n if (speed > 0.1) {\n const currentAngle =\n Math.atan2(velocity.current.y, velocity.current.x) * (180 / Math.PI) +\n 90\n\n let angleDiff = currentAngle - previousAngle.current\n if (angleDiff > 180) angleDiff -= 360\n if (angleDiff < -180) angleDiff += 360\n accumulatedRotation.current += angleDiff\n rotation.set(accumulatedRotation.current)\n previousAngle.current = currentAngle\n\n scale.set(0.95)\n\n if (timeout !== null) {\n clearTimeout(timeout)\n }\n\n timeout = setTimeout(() => {\n scale.set(1)\n }, 150)\n }\n }\n\n let rafId = 0\n const throttledPointerMove = (e: PointerEvent) => {\n if (!isTrackablePointer(e.pointerType)) {\n return\n }\n\n if (rafId) return\n\n rafId = requestAnimationFrame(() => {\n smoothPointerMove(e)\n rafId = 0\n })\n }\n\n document.body.style.cursor = \"none\"\n window.addEventListener(\"pointermove\", throttledPointerMove, {\n passive: true,\n })\n\n return () => {\n window.removeEventListener(\"pointermove\", throttledPointerMove)\n document.body.style.cursor = \"auto\"\n if (rafId) cancelAnimationFrame(rafId)\n if (timeout !== null) {\n clearTimeout(timeout)\n }\n }\n }, [cursorX, cursorY, rotation, scale, isEnabled])\n\n if (!isEnabled) {\n return null\n }\n\n return (\n <motion.div\n style={{\n position: \"fixed\",\n left: cursorX,\n top: cursorY,\n translateX: \"-50%\",\n translateY: \"-50%\",\n rotate: rotation,\n scale: scale,\n zIndex: 100,\n pointerEvents: \"none\",\n willChange: \"transform\",\n opacity: isVisible ? 1 : 0,\n }}\n initial={false}\n animate={{ opacity: isVisible ? 1 : 0 }}\n transition={{\n duration: 0.15,\n }}\n >\n {cursor}\n </motion.div>\n )\n}\n",+ "content": "\"use client\"\n\nimport { useEffect, useRef, useState, type FC } from \"react\"\nimport { motion, useSpring } from \"motion/react\"\n\ninterface Position {\n x: number\n y: number\n}\n\nexport interface SmoothCursorProps {\n cursor?: React.ReactNode\n springConfig?: {\n damping: number\n stiffness: number\n mass: number\n restDelta: number\n }\n}\n\nconst DESKTOP_POINTER_QUERY = \"(any-hover: hover) and (any-pointer: fine)\"\n\nfunction isTrackablePointer(pointerType: string) {\n return pointerType !== \"touch\"\n}\n\nconst DefaultCursorSVG: FC = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={50}\n height={54}\n viewBox=\"0 0 50 54\"\n fill=\"none\"\n style={{ scale: 0.5 }}\n >\n <g filter=\"url(#filter0_d_91_7928)\">\n <path\n d=\"M42.6817 41.1495L27.5103 6.79925C26.7269 5.02557 24.2082 5.02558 23.3927 6.79925L7.59814 41.1495C6.75833 42.9759 8.52712 44.8902 10.4125 44.1954L24.3757 39.0496C24.8829 38.8627 25.4385 38.8627 25.9422 39.0496L39.8121 44.1954C41.6849 44.8902 43.4884 42.9759 42.6817 41.1495Z\"\n fill=\"black\"\n />\n <path\n d=\"M43.7146 40.6933L28.5431 6.34306C27.3556 3.65428 23.5772 3.69516 22.3668 6.32755L6.57226 40.6778C5.3134 43.4156 7.97238 46.298 10.803 45.2549L24.7662 40.109C25.0221 40.0147 25.2999 40.0156 25.5494 40.1082L39.4193 45.254C42.2261 46.2953 44.9254 43.4347 43.7146 40.6933Z\"\n stroke=\"white\"\n strokeWidth={2.25825}\n />\n </g>\n <defs>\n <filter\n id=\"filter0_d_91_7928\"\n x={0.602397}\n y={0.952444}\n width={49.0584}\n height={52.428}\n filterUnits=\"userSpaceOnUse\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feFlood floodOpacity={0} result=\"BackgroundImageFix\" />\n <feColorMatrix\n in=\"SourceAlpha\"\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\n result=\"hardAlpha\"\n />\n <feOffset dy={2.25825} />\n <feGaussianBlur stdDeviation={2.25825} />\n <feComposite in2=\"hardAlpha\" operator=\"out\" />\n <feColorMatrix\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0\"\n />\n <feBlend\n mode=\"normal\"\n in2=\"BackgroundImageFix\"\n result=\"effect1_dropShadow_91_7928\"\n />\n <feBlend\n mode=\"normal\"\n in=\"SourceGraphic\"\n in2=\"effect1_dropShadow_91_7928\"\n result=\"shape\"\n />\n </filter>\n </defs>\n </svg>\n )\n}\n\nexport function SmoothCursor({\n cursor = <DefaultCursorSVG />,\n springConfig = {\n damping: 45,\n stiffness: 400,\n mass: 1,\n restDelta: 0.001,\n },\n}: SmoothCursorProps) {\n const lastMousePos = useRef<Position>({ x: 0, y: 0 })\n const velocity = useRef<Position>({ x: 0, y: 0 })\n const lastUpdateTime = useRef(Date.now())\n const previousAngle = useRef(0)\n const accumulatedRotation = useRef(0)\n const [isEnabled, setIsEnabled] = useState(false)\n const [isVisible, setIsVisible] = useState(false)\n\n const cursorX = useSpring(0, springConfig)\n const cursorY = useSpring(0, springConfig)\n const rotation = useSpring(0, {\n ...springConfig,\n damping: 60,\n stiffness: 300,\n })\n const scale = useSpring(1, {\n ...springConfig,\n stiffness: 500,\n damping: 35,\n })\n\n useEffect(() => {\n const mediaQuery = window.matchMedia(DESKTOP_POINTER_QUERY)\n\n const updateEnabled = () => {\n const nextIsEnabled = mediaQuery.matches\n setIsEnabled(nextIsEnabled)\n\n if (!nextIsEnabled) {\n setIsVisible(false)\n }\n }\n\n updateEnabled()\n mediaQuery.addEventListener(\"change\", updateEnabled)\n\n return () => {\n mediaQuery.removeEventListener(\"change\", updateEnabled)\n }\n }, [])\n\n useEffect(() => {\n if (!isEnabled) {\n return\n }\n\n let timeout: ReturnType<typeof setTimeout> | null = null\n\n const updateVelocity = (currentPos: Position) => {\n const currentTime = Date.now()\n const deltaTime = currentTime - lastUpdateTime.current\n\n if (deltaTime > 0) {\n velocity.current = {\n x: (currentPos.x - lastMousePos.current.x) / deltaTime,\n y: (currentPos.y - lastMousePos.current.y) / deltaTime,\n }\n }\n\n lastUpdateTime.current = currentTime\n lastMousePos.current = currentPos\n }\n\n const smoothPointerMove = (e: PointerEvent) => {\n if (!isTrackablePointer(e.pointerType)) {\n return\n }\n\n setIsVisible(true)\n\n const currentPos = { x: e.clientX, y: e.clientY }\n updateVelocity(currentPos)\n\n const speed = Math.sqrt(\n Math.pow(velocity.current.x, 2) + Math.pow(velocity.current.y, 2)\n )\n\n cursorX.set(currentPos.x)\n cursorY.set(currentPos.y)\n\n if (speed > 0.1) {\n const currentAngle =\n Math.atan2(velocity.current.y, velocity.current.x) * (180 / Math.PI) +\n 90\n\n let angleDiff = currentAngle - previousAngle.current\n if (angleDiff > 180) angleDiff -= 360\n if (angleDiff < -180) angleDiff += 360\n accumulatedRotation.current += angleDiff\n rotation.set(accumulatedRotation.current)\n previousAngle.current = currentAngle\n\n scale.set(0.95)\n\n if (timeout !== null) {\n clearTimeout(timeout)\n }\n\n timeout = setTimeout(() => {\n scale.set(1)\n }, 150)\n }\n }\n\n let rafId = 0\n const throttledPointerMove = (e: PointerEvent) => {\n if (!isTrackablePointer(e.pointerType)) {\n return\n }\n\n if (rafId) return\n\n rafId = requestAnimationFrame(() => {\n smoothPointerMove(e)\n rafId = 0\n })\n }\n\n document.body.style.cursor = \"none\"\n window.addEventListener(\"pointermove\", throttledPointerMove, {\n passive: true,\n })\n\n return () => {\n window.removeEventListener(\"pointermove\", throttledPointerMove)\n document.body.style.cursor = \"auto\"\n if (rafId) cancelAnimationFrame(rafId)\n if (timeout !== null) {\n clearTimeout(timeout)\n }\n }\n }, [cursorX, cursorY, rotation, scale, isEnabled])\n\n if (!isEnabled) {\n return null\n }\n\n return (\n <motion.div\n style={{\n position: \"fixed\",\n left: cursorX,\n top: cursorY,\n translateX: \"-50%\",\n translateY: \"-50%\",\n rotate: rotation,\n scale: scale,\n zIndex: 100,\n pointerEvents: \"none\",\n willChange: \"transform\",\n opacity: isVisible ? 1 : 0,\n }}\n initial={false}\n animate={{ opacity: isVisible ? 1 : 0 }}\n transition={{\n duration: 0.15,\n }}\n >\n {cursor}\n </motion.div>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/sparkles-text.json b/apps/www/public/r/sparkles-text.jsonindex 22a08ec5..67d1fcd3 100644--- a/apps/www/public/r/sparkles-text.json+++ b/apps/www/public/r/sparkles-text.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/sparkles-text.tsx",- "content": "\"use client\"\n\nimport { CSSProperties, ReactElement, useEffect, useState } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface Sparkle {\n id: string\n x: string\n y: string\n color: string\n delay: number\n scale: number\n lifespan: number\n}\n\nconst Sparkle: React.FC<Sparkle> = ({ id, x, y, color, delay, scale }) => {\n return (\n <motion.svg\n key={id}\n className=\"pointer-events-none absolute z-20\"\n initial={{ opacity: 0, left: x, top: y }}\n animate={{\n opacity: [0, 1, 0],\n scale: [0, scale, 0],\n rotate: [75, 120, 150],\n }}\n transition={{ duration: 0.8, repeat: Infinity, delay }}\n width=\"21\"\n height=\"21\"\n viewBox=\"0 0 21 21\"\n >\n <path\n d=\"M9.82531 0.843845C10.0553 0.215178 10.9446 0.215178 11.1746 0.843845L11.8618 2.72026C12.4006 4.19229 12.3916 6.39157 13.5 7.5C14.6084 8.60843 16.8077 8.59935 18.2797 9.13822L20.1561 9.82534C20.7858 10.0553 20.7858 10.9447 20.1561 11.1747L18.2797 11.8618C16.8077 12.4007 14.6084 12.3916 13.5 13.5C12.3916 14.6084 12.4006 16.8077 11.8618 18.2798L11.1746 20.1562C10.9446 20.7858 10.0553 20.7858 9.82531 20.1562L9.13819 18.2798C8.59932 16.8077 8.60843 14.6084 7.5 13.5C6.39157 12.3916 4.19225 12.4007 2.72023 11.8618L0.843814 11.1747C0.215148 10.9447 0.215148 10.0553 0.843814 9.82534L2.72023 9.13822C4.19225 8.59935 6.39157 8.60843 7.5 7.5C8.60843 6.39157 8.59932 4.19229 9.13819 2.72026L9.82531 0.843845Z\"\n fill={color}\n />\n </motion.svg>\n )\n}\n\ninterface SparklesTextProps {\n /**\n * @default <div />\n * @type ReactElement\n * @description\n * The component to be rendered as the text\n * */\n as?: ReactElement\n\n /**\n * @default \"\"\n * @type string\n * @description\n * The className of the text\n */\n className?: string\n\n /**\n * @required\n * @type ReactNode\n * @description\n * The content to be displayed\n * */\n children: React.ReactNode\n\n /**\n * @default 10\n * @type number\n * @description\n * The count of sparkles\n * */\n sparklesCount?: number\n\n /**\n * @default \"{first: '#9E7AFF', second: '#FE8BBB'}\"\n * @type string\n * @description\n * The colors of the sparkles\n * */\n colors?: {\n first: string\n second: string\n }\n}\n\nexport const SparklesText: React.FC<SparklesTextProps> = ({\n children,\n colors = { first: \"#9E7AFF\", second: \"#FE8BBB\" },\n className,\n sparklesCount = 10,\n ...props\n}) => {\n const [sparkles, setSparkles] = useState<Sparkle[]>([])\n\n useEffect(() => {\n const generateStar = (): Sparkle => {\n const starX = `${Math.random() * 100}%`\n const starY = `${Math.random() * 100}%`\n const color = Math.random() > 0.5 ? colors.first : colors.second\n const delay = Math.random() * 2\n const scale = Math.random() * 1 + 0.3\n const lifespan = Math.random() * 10 + 5\n const id = `${starX}-${starY}-${Date.now()}`\n return { id, x: starX, y: starY, color, delay, scale, lifespan }\n }\n\n const initializeStars = () => {\n const newSparkles = Array.from({ length: sparklesCount }, generateStar)\n setSparkles(newSparkles)\n }\n\n const updateStars = () => {\n setSparkles((currentSparkles) =>\n currentSparkles.map((star) => {\n if (star.lifespan <= 0) {\n return generateStar()\n } else {\n return { ...star, lifespan: star.lifespan - 0.1 }\n }\n })\n )\n }\n\n initializeStars()\n const interval = setInterval(updateStars, 100)\n\n return () => clearInterval(interval)\n }, [colors.first, colors.second, sparklesCount])\n\n return (\n <div\n className={cn(\"text-6xl font-bold\", className)}\n {...props}\n style={\n {\n \"--sparkles-first-color\": `${colors.first}`,\n \"--sparkles-second-color\": `${colors.second}`,\n } as CSSProperties\n }\n >\n <span className=\"relative inline-block\">\n {sparkles.map((sparkle) => (\n <Sparkle key={sparkle.id} {...sparkle} />\n ))}\n <strong>{children}</strong>\n </span>\n </div>\n )\n}\n",+ "content": "\"use client\"\n\nimport {\n useEffect,\n useState,\n type CSSProperties,\n type ReactElement,\n} from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface Sparkle {\n id: string\n x: string\n y: string\n color: string\n delay: number\n scale: number\n lifespan: number\n}\n\nconst Sparkle: React.FC<Sparkle> = ({ id, x, y, color, delay, scale }) => {\n return (\n <motion.svg\n key={id}\n className=\"pointer-events-none absolute z-20\"\n initial={{ opacity: 0, left: x, top: y }}\n animate={{\n opacity: [0, 1, 0],\n scale: [0, scale, 0],\n rotate: [75, 120, 150],\n }}\n transition={{ duration: 0.8, repeat: Infinity, delay }}\n width=\"21\"\n height=\"21\"\n viewBox=\"0 0 21 21\"\n >\n <path\n d=\"M9.82531 0.843845C10.0553 0.215178 10.9446 0.215178 11.1746 0.843845L11.8618 2.72026C12.4006 4.19229 12.3916 6.39157 13.5 7.5C14.6084 8.60843 16.8077 8.59935 18.2797 9.13822L20.1561 9.82534C20.7858 10.0553 20.7858 10.9447 20.1561 11.1747L18.2797 11.8618C16.8077 12.4007 14.6084 12.3916 13.5 13.5C12.3916 14.6084 12.4006 16.8077 11.8618 18.2798L11.1746 20.1562C10.9446 20.7858 10.0553 20.7858 9.82531 20.1562L9.13819 18.2798C8.59932 16.8077 8.60843 14.6084 7.5 13.5C6.39157 12.3916 4.19225 12.4007 2.72023 11.8618L0.843814 11.1747C0.215148 10.9447 0.215148 10.0553 0.843814 9.82534L2.72023 9.13822C4.19225 8.59935 6.39157 8.60843 7.5 7.5C8.60843 6.39157 8.59932 4.19229 9.13819 2.72026L9.82531 0.843845Z\"\n fill={color}\n />\n </motion.svg>\n )\n}\n\ninterface SparklesTextProps {\n /**\n * @default <div />\n * @type ReactElement\n * @description\n * The component to be rendered as the text\n * */\n as?: ReactElement\n\n /**\n * @default \"\"\n * @type string\n * @description\n * The className of the text\n */\n className?: string\n\n /**\n * @required\n * @type ReactNode\n * @description\n * The content to be displayed\n * */\n children: React.ReactNode\n\n /**\n * @default 10\n * @type number\n * @description\n * The count of sparkles\n * */\n sparklesCount?: number\n\n /**\n * @default \"{first: '#9E7AFF', second: '#FE8BBB'}\"\n * @type string\n * @description\n * The colors of the sparkles\n * */\n colors?: {\n first: string\n second: string\n }\n}\n\nexport const SparklesText: React.FC<SparklesTextProps> = ({\n children,\n colors = { first: \"#9E7AFF\", second: \"#FE8BBB\" },\n className,\n sparklesCount = 10,\n ...props\n}) => {\n const [sparkles, setSparkles] = useState<Sparkle[]>([])\n\n useEffect(() => {\n const generateStar = (): Sparkle => {\n const starX = `${Math.random() * 100}%`\n const starY = `${Math.random() * 100}%`\n const color = Math.random() > 0.5 ? colors.first : colors.second\n const delay = Math.random() * 2\n const scale = Math.random() * 1 + 0.3\n const lifespan = Math.random() * 10 + 5\n const id = `${starX}-${starY}-${Date.now()}`\n return { id, x: starX, y: starY, color, delay, scale, lifespan }\n }\n\n const initializeStars = () => {\n const newSparkles = Array.from({ length: sparklesCount }, generateStar)\n setSparkles(newSparkles)\n }\n\n const updateStars = () => {\n setSparkles((currentSparkles) =>\n currentSparkles.map((star) => {\n if (star.lifespan <= 0) {\n return generateStar()\n } else {\n return { ...star, lifespan: star.lifespan - 0.1 }\n }\n })\n )\n }\n\n initializeStars()\n const interval = setInterval(updateStars, 100)\n\n return () => clearInterval(interval)\n }, [colors.first, colors.second, sparklesCount])\n\n return (\n <div\n className={cn(\"text-6xl font-bold\", className)}\n {...props}\n style={\n {\n \"--sparkles-first-color\": `${colors.first}`,\n \"--sparkles-second-color\": `${colors.second}`,\n } as CSSProperties\n }\n >\n <span className=\"relative inline-block\">\n {sparkles.map((sparkle) => (\n <Sparkle key={sparkle.id} {...sparkle} />\n ))}\n <strong>{children}</strong>\n </span>\n </div>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/spinning-text.json b/apps/www/public/r/spinning-text.jsonindex ab0317cc..e711e328 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, { 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",+ "content": "\"use client\"\n\nimport React, { type ComponentPropsWithoutRef } from \"react\"\nimport { motion, type Transition, type 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-animate.json b/apps/www/public/r/text-animate.jsonindex 5ad60f8c..f5a87dba 100644--- a/apps/www/public/r/text-animate.json+++ b/apps/www/public/r/text-animate.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/text-animate.tsx",- "content": "\"use client\"\n\nimport { memo } from \"react\"\nimport {\n AnimatePresence,\n motion,\n Variants,\n type DOMMotionComponents,\n type MotionProps,\n} from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype AnimationType = \"text\" | \"word\" | \"character\" | \"line\"\ntype AnimationVariant =\n | \"fadeIn\"\n | \"blurIn\"\n | \"blurInUp\"\n | \"blurInDown\"\n | \"slideUp\"\n | \"slideDown\"\n | \"slideLeft\"\n | \"slideRight\"\n | \"scaleUp\"\n | \"scaleDown\"\n\nconst motionElements = {\n article: motion.article,\n div: motion.div,\n h1: motion.h1,\n h2: motion.h2,\n h3: motion.h3,\n h4: motion.h4,\n h5: motion.h5,\n h6: motion.h6,\n li: motion.li,\n p: motion.p,\n section: motion.section,\n span: motion.span,\n} as const\n\ntype MotionElementType = Extract<\n keyof DOMMotionComponents,\n keyof typeof motionElements\n>\n\ninterface TextAnimateProps extends Omit<MotionProps, \"children\"> {\n /**\n * The text content to animate\n */\n children: string\n /**\n * The class name to be applied to the component\n */\n className?: string\n /**\n * The class name to be applied to each segment\n */\n segmentClassName?: string\n /**\n * The delay before the animation starts\n */\n delay?: number\n /**\n * The duration of the animation\n */\n duration?: number\n /**\n * Custom motion variants for the animation\n */\n variants?: Variants\n /**\n * The element type to render\n */\n as?: MotionElementType\n /**\n * How to split the text (\"text\", \"word\", \"character\")\n */\n by?: AnimationType\n /**\n * Whether to start animation when component enters viewport\n */\n startOnView?: boolean\n /**\n * Whether to animate only once\n */\n once?: boolean\n /**\n * The animation preset to use\n */\n animation?: AnimationVariant\n /**\n * Whether to enable accessibility features (default: true)\n */\n accessible?: boolean\n}\n\nconst staggerTimings: Record<AnimationType, number> = {\n text: 0.06,\n word: 0.05,\n character: 0.03,\n line: 0.06,\n}\n\nconst defaultContainerVariants = {\n hidden: { opacity: 1 },\n show: {\n opacity: 1,\n transition: {\n delayChildren: 0,\n staggerChildren: 0.05,\n },\n },\n exit: {\n opacity: 0,\n transition: {\n staggerChildren: 0.05,\n staggerDirection: -1,\n },\n },\n}\n\nconst defaultItemVariants: Variants = {\n hidden: { opacity: 0 },\n show: {\n opacity: 1,\n },\n exit: {\n opacity: 0,\n },\n}\n\nconst defaultItemAnimationVariants: Record<\n AnimationVariant,\n { container: Variants; item: Variants }\n> = {\n fadeIn: {\n container: defaultContainerVariants,\n item: {\n hidden: { opacity: 0, y: 20 },\n show: {\n opacity: 1,\n y: 0,\n transition: {\n duration: 0.3,\n },\n },\n exit: {\n opacity: 0,\n y: 20,\n transition: { duration: 0.3 },\n },\n },\n },\n blurIn: {\n container: defaultContainerVariants,\n item: {\n hidden: { opacity: 0, filter: \"blur(10px)\" },\n show: {\n opacity: 1,\n filter: \"blur(0px)\",\n transition: {\n duration: 0.3,\n },\n },\n exit: {\n opacity: 0,\n filter: \"blur(10px)\",\n transition: { duration: 0.3 },\n },\n },\n },\n blurInUp: {\n container: defaultContainerVariants,\n item: {\n hidden: { opacity: 0, filter: \"blur(10px)\", y: 20 },\n show: {\n opacity: 1,\n filter: \"blur(0px)\",\n y: 0,\n transition: {\n y: { duration: 0.3 },\n opacity: { duration: 0.4 },\n filter: { duration: 0.3 },\n },\n },\n exit: {\n opacity: 0,\n filter: \"blur(10px)\",\n y: 20,\n transition: {\n y: { duration: 0.3 },\n opacity: { duration: 0.4 },\n filter: { duration: 0.3 },\n },\n },\n },\n },\n blurInDown: {\n container: defaultContainerVariants,\n item: {\n hidden: { opacity: 0, filter: \"blur(10px)\", y: -20 },\n show: {\n opacity: 1,\n filter: \"blur(0px)\",\n y: 0,\n transition: {\n y: { duration: 0.3 },\n opacity: { duration: 0.4 },\n filter: { duration: 0.3 },\n },\n },\n },\n },\n slideUp: {\n container: defaultContainerVariants,\n item: {\n hidden: { y: 20, opacity: 0 },\n show: {\n y: 0,\n opacity: 1,\n transition: {\n duration: 0.3,\n },\n },\n exit: {\n y: -20,\n opacity: 0,\n transition: {\n duration: 0.3,\n },\n },\n },\n },\n slideDown: {\n container: defaultContainerVariants,\n item: {\n hidden: { y: -20, opacity: 0 },\n show: {\n y: 0,\n opacity: 1,\n transition: { duration: 0.3 },\n },\n exit: {\n y: 20,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n slideLeft: {\n container: defaultContainerVariants,\n item: {\n hidden: { x: 20, opacity: 0 },\n show: {\n x: 0,\n opacity: 1,\n transition: { duration: 0.3 },\n },\n exit: {\n x: -20,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n slideRight: {\n container: defaultContainerVariants,\n item: {\n hidden: { x: -20, opacity: 0 },\n show: {\n x: 0,\n opacity: 1,\n transition: { duration: 0.3 },\n },\n exit: {\n x: 20,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n scaleUp: {\n container: defaultContainerVariants,\n item: {\n hidden: { scale: 0.5, opacity: 0 },\n show: {\n scale: 1,\n opacity: 1,\n transition: {\n duration: 0.3,\n scale: {\n type: \"spring\",\n damping: 15,\n stiffness: 300,\n },\n },\n },\n exit: {\n scale: 0.5,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n scaleDown: {\n container: defaultContainerVariants,\n item: {\n hidden: { scale: 1.5, opacity: 0 },\n show: {\n scale: 1,\n opacity: 1,\n transition: {\n duration: 0.3,\n scale: {\n type: \"spring\",\n damping: 15,\n stiffness: 300,\n },\n },\n },\n exit: {\n scale: 1.5,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n}\n\nconst TextAnimateBase = ({\n children,\n delay = 0,\n duration = 0.3,\n variants,\n className,\n segmentClassName,\n as: Component = \"p\",\n startOnView = true,\n once = false,\n by = \"word\",\n animation = \"fadeIn\",\n accessible = true,\n ...props\n}: TextAnimateProps) => {\n const MotionComponent = motionElements[Component]\n\n let segments: string[] = []\n switch (by) {\n case \"word\":\n segments = children.split(/(\\s+)/)\n break\n case \"character\":\n segments = children.split(\"\")\n break\n case \"line\":\n segments = children.split(\"\\n\")\n break\n case \"text\":\n default:\n segments = [children]\n break\n }\n\n const finalVariants = variants\n ? {\n container: {\n hidden: { opacity: 0 },\n show: {\n opacity: 1,\n transition: {\n opacity: { duration: 0.01, delay },\n delayChildren: delay,\n staggerChildren: duration / segments.length,\n },\n },\n exit: {\n opacity: 0,\n transition: {\n staggerChildren: duration / segments.length,\n staggerDirection: -1,\n },\n },\n },\n item: variants,\n }\n : animation\n ? {\n container: {\n ...defaultItemAnimationVariants[animation].container,\n show: {\n ...defaultItemAnimationVariants[animation].container.show,\n transition: {\n delayChildren: delay,\n staggerChildren: duration / segments.length,\n },\n },\n exit: {\n ...defaultItemAnimationVariants[animation].container.exit,\n transition: {\n staggerChildren: duration / segments.length,\n staggerDirection: -1,\n },\n },\n },\n item: defaultItemAnimationVariants[animation].item,\n }\n : { container: defaultContainerVariants, item: defaultItemVariants }\n\n return (\n <AnimatePresence mode=\"popLayout\">\n <MotionComponent\n variants={finalVariants.container as Variants}\n initial=\"hidden\"\n whileInView={startOnView ? \"show\" : undefined}\n animate={startOnView ? undefined : \"show\"}\n exit=\"exit\"\n className={cn(\"whitespace-pre-wrap\", className)}\n viewport={{ once }}\n aria-label={accessible ? children : undefined}\n {...props}\n >\n {accessible && <span className=\"sr-only\">{children}</span>}\n {segments.map((segment, i) => (\n <motion.span\n key={`${by}-${segment}-${i}`}\n variants={finalVariants.item}\n custom={i * staggerTimings[by]}\n className={cn(\n by === \"line\" ? \"block\" : \"inline-block whitespace-pre\",\n by === \"character\" && \"\",\n segmentClassName\n )}\n aria-hidden={accessible ? true : undefined}\n >\n {segment}\n </motion.span>\n ))}\n </MotionComponent>\n </AnimatePresence>\n )\n}\n\n// Export the memoized version\nexport const TextAnimate = memo(TextAnimateBase)\n",+ "content": "\"use client\"\n\nimport { memo } from \"react\"\nimport {\n AnimatePresence,\n motion,\n type DOMMotionComponents,\n type MotionProps,\n type Variants,\n} from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype AnimationType = \"text\" | \"word\" | \"character\" | \"line\"\ntype AnimationVariant =\n | \"fadeIn\"\n | \"blurIn\"\n | \"blurInUp\"\n | \"blurInDown\"\n | \"slideUp\"\n | \"slideDown\"\n | \"slideLeft\"\n | \"slideRight\"\n | \"scaleUp\"\n | \"scaleDown\"\n\nconst motionElements = {\n article: motion.article,\n div: motion.div,\n h1: motion.h1,\n h2: motion.h2,\n h3: motion.h3,\n h4: motion.h4,\n h5: motion.h5,\n h6: motion.h6,\n li: motion.li,\n p: motion.p,\n section: motion.section,\n span: motion.span,\n} as const\n\ntype MotionElementType = Extract<\n keyof DOMMotionComponents,\n keyof typeof motionElements\n>\n\ninterface TextAnimateProps extends Omit<MotionProps, \"children\"> {\n /**\n * The text content to animate\n */\n children: string\n /**\n * The class name to be applied to the component\n */\n className?: string\n /**\n * The class name to be applied to each segment\n */\n segmentClassName?: string\n /**\n * The delay before the animation starts\n */\n delay?: number\n /**\n * The duration of the animation\n */\n duration?: number\n /**\n * Custom motion variants for the animation\n */\n variants?: Variants\n /**\n * The element type to render\n */\n as?: MotionElementType\n /**\n * How to split the text (\"text\", \"word\", \"character\")\n */\n by?: AnimationType\n /**\n * Whether to start animation when component enters viewport\n */\n startOnView?: boolean\n /**\n * Whether to animate only once\n */\n once?: boolean\n /**\n * The animation preset to use\n */\n animation?: AnimationVariant\n /**\n * Whether to enable accessibility features (default: true)\n */\n accessible?: boolean\n}\n\nconst staggerTimings: Record<AnimationType, number> = {\n text: 0.06,\n word: 0.05,\n character: 0.03,\n line: 0.06,\n}\n\nconst defaultContainerVariants = {\n hidden: { opacity: 1 },\n show: {\n opacity: 1,\n transition: {\n delayChildren: 0,\n staggerChildren: 0.05,\n },\n },\n exit: {\n opacity: 0,\n transition: {\n staggerChildren: 0.05,\n staggerDirection: -1,\n },\n },\n}\n\nconst defaultItemVariants: Variants = {\n hidden: { opacity: 0 },\n show: {\n opacity: 1,\n },\n exit: {\n opacity: 0,\n },\n}\n\nconst defaultItemAnimationVariants: Record<\n AnimationVariant,\n { container: Variants; item: Variants }\n> = {\n fadeIn: {\n container: defaultContainerVariants,\n item: {\n hidden: { opacity: 0, y: 20 },\n show: {\n opacity: 1,\n y: 0,\n transition: {\n duration: 0.3,\n },\n },\n exit: {\n opacity: 0,\n y: 20,\n transition: { duration: 0.3 },\n },\n },\n },\n blurIn: {\n container: defaultContainerVariants,\n item: {\n hidden: { opacity: 0, filter: \"blur(10px)\" },\n show: {\n opacity: 1,\n filter: \"blur(0px)\",\n transition: {\n duration: 0.3,\n },\n },\n exit: {\n opacity: 0,\n filter: \"blur(10px)\",\n transition: { duration: 0.3 },\n },\n },\n },\n blurInUp: {\n container: defaultContainerVariants,\n item: {\n hidden: { opacity: 0, filter: \"blur(10px)\", y: 20 },\n show: {\n opacity: 1,\n filter: \"blur(0px)\",\n y: 0,\n transition: {\n y: { duration: 0.3 },\n opacity: { duration: 0.4 },\n filter: { duration: 0.3 },\n },\n },\n exit: {\n opacity: 0,\n filter: \"blur(10px)\",\n y: 20,\n transition: {\n y: { duration: 0.3 },\n opacity: { duration: 0.4 },\n filter: { duration: 0.3 },\n },\n },\n },\n },\n blurInDown: {\n container: defaultContainerVariants,\n item: {\n hidden: { opacity: 0, filter: \"blur(10px)\", y: -20 },\n show: {\n opacity: 1,\n filter: \"blur(0px)\",\n y: 0,\n transition: {\n y: { duration: 0.3 },\n opacity: { duration: 0.4 },\n filter: { duration: 0.3 },\n },\n },\n },\n },\n slideUp: {\n container: defaultContainerVariants,\n item: {\n hidden: { y: 20, opacity: 0 },\n show: {\n y: 0,\n opacity: 1,\n transition: {\n duration: 0.3,\n },\n },\n exit: {\n y: -20,\n opacity: 0,\n transition: {\n duration: 0.3,\n },\n },\n },\n },\n slideDown: {\n container: defaultContainerVariants,\n item: {\n hidden: { y: -20, opacity: 0 },\n show: {\n y: 0,\n opacity: 1,\n transition: { duration: 0.3 },\n },\n exit: {\n y: 20,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n slideLeft: {\n container: defaultContainerVariants,\n item: {\n hidden: { x: 20, opacity: 0 },\n show: {\n x: 0,\n opacity: 1,\n transition: { duration: 0.3 },\n },\n exit: {\n x: -20,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n slideRight: {\n container: defaultContainerVariants,\n item: {\n hidden: { x: -20, opacity: 0 },\n show: {\n x: 0,\n opacity: 1,\n transition: { duration: 0.3 },\n },\n exit: {\n x: 20,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n scaleUp: {\n container: defaultContainerVariants,\n item: {\n hidden: { scale: 0.5, opacity: 0 },\n show: {\n scale: 1,\n opacity: 1,\n transition: {\n duration: 0.3,\n scale: {\n type: \"spring\",\n damping: 15,\n stiffness: 300,\n },\n },\n },\n exit: {\n scale: 0.5,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n scaleDown: {\n container: defaultContainerVariants,\n item: {\n hidden: { scale: 1.5, opacity: 0 },\n show: {\n scale: 1,\n opacity: 1,\n transition: {\n duration: 0.3,\n scale: {\n type: \"spring\",\n damping: 15,\n stiffness: 300,\n },\n },\n },\n exit: {\n scale: 1.5,\n opacity: 0,\n transition: { duration: 0.3 },\n },\n },\n },\n}\n\nconst TextAnimateBase = ({\n children,\n delay = 0,\n duration = 0.3,\n variants,\n className,\n segmentClassName,\n as: Component = \"p\",\n startOnView = true,\n once = false,\n by = \"word\",\n animation = \"fadeIn\",\n accessible = true,\n ...props\n}: TextAnimateProps) => {\n const MotionComponent = motionElements[Component]\n\n let segments: string[] = []\n switch (by) {\n case \"word\":\n segments = children.split(/(\\s+)/)\n break\n case \"character\":\n segments = children.split(\"\")\n break\n case \"line\":\n segments = children.split(\"\\n\")\n break\n case \"text\":\n default:\n segments = [children]\n break\n }\n\n const finalVariants = variants\n ? {\n container: {\n hidden: { opacity: 0 },\n show: {\n opacity: 1,\n transition: {\n opacity: { duration: 0.01, delay },\n delayChildren: delay,\n staggerChildren: duration / segments.length,\n },\n },\n exit: {\n opacity: 0,\n transition: {\n staggerChildren: duration / segments.length,\n staggerDirection: -1,\n },\n },\n },\n item: variants,\n }\n : animation\n ? {\n container: {\n ...defaultItemAnimationVariants[animation].container,\n show: {\n ...defaultItemAnimationVariants[animation].container.show,\n transition: {\n delayChildren: delay,\n staggerChildren: duration / segments.length,\n },\n },\n exit: {\n ...defaultItemAnimationVariants[animation].container.exit,\n transition: {\n staggerChildren: duration / segments.length,\n staggerDirection: -1,\n },\n },\n },\n item: defaultItemAnimationVariants[animation].item,\n }\n : { container: defaultContainerVariants, item: defaultItemVariants }\n\n return (\n <AnimatePresence mode=\"popLayout\">\n <MotionComponent\n variants={finalVariants.container as Variants}\n initial=\"hidden\"\n whileInView={startOnView ? \"show\" : undefined}\n animate={startOnView ? undefined : \"show\"}\n exit=\"exit\"\n className={cn(\"whitespace-pre-wrap\", className)}\n viewport={{ once }}\n aria-label={accessible ? children : undefined}\n {...props}\n >\n {accessible && <span className=\"sr-only\">{children}</span>}\n {segments.map((segment, i) => (\n <motion.span\n key={`${by}-${segment}-${i}`}\n variants={finalVariants.item}\n custom={i * staggerTimings[by]}\n className={cn(\n by === \"line\" ? \"block\" : \"inline-block whitespace-pre\",\n by === \"character\" && \"\",\n segmentClassName\n )}\n aria-hidden={accessible ? true : undefined}\n >\n {segment}\n </motion.span>\n ))}\n </MotionComponent>\n </AnimatePresence>\n )\n}\n\n// Export the memoized version\nexport const TextAnimate = memo(TextAnimateBase)\n","type": "registry:ui"}]diff --git a/apps/www/public/r/video-text.json b/apps/www/public/r/video-text.jsonindex 8779a53d..858aabc6 100644--- a/apps/www/public/r/video-text.json+++ b/apps/www/public/r/video-text.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/video-text.tsx",- "content": "\"use client\"\n\nimport React, { ElementType, ReactNode, useEffect, useState } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface VideoTextProps {\n /**\n * The video source URL\n */\n src: string\n /**\n * Additional className for the container\n */\n className?: string\n /**\n * Whether to autoplay the video\n */\n autoPlay?: boolean\n /**\n * Whether to mute the video\n */\n muted?: boolean\n /**\n * Whether to loop the video\n */\n loop?: boolean\n /**\n * Whether to preload the video\n */\n preload?: \"auto\" | \"metadata\" | \"none\"\n /**\n * The content to display (will have the video \"inside\" it)\n */\n children: ReactNode\n /**\n * Font size for the text mask (in viewport width units)\n * @default 10\n */\n fontSize?: string | number\n /**\n * Font weight for the text mask\n * @default \"bold\"\n */\n fontWeight?: string | number\n /**\n * Text anchor for the text mask\n * @default \"middle\"\n */\n textAnchor?: string\n /**\n * Dominant baseline for the text mask\n * @default \"middle\"\n */\n dominantBaseline?: string\n /**\n * Font family for the text mask\n * @default \"sans-serif\"\n */\n fontFamily?: string\n /**\n * The element type to render for the text\n * @default \"div\"\n */\n as?: ElementType\n}\n\nexport function VideoText({\n src,\n children,\n className = \"\",\n autoPlay = true,\n muted = true,\n loop = true,\n preload = \"auto\",\n fontSize = 20,\n fontWeight = \"bold\",\n textAnchor = \"middle\",\n dominantBaseline = \"middle\",\n fontFamily = \"sans-serif\",\n as: Component = \"div\",\n}: VideoTextProps) {\n const [svgMask, setSvgMask] = useState(\"\")\n const content = React.Children.toArray(children).join(\"\")\n\n useEffect(() => {\n const updateSvgMask = () => {\n const responsiveFontSize =\n typeof fontSize === \"number\" ? `${fontSize}vw` : fontSize\n const newSvgMask = `<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'><text x='50%' y='50%' font-size='${responsiveFontSize}' font-weight='${fontWeight}' text-anchor='${textAnchor}' dominant-baseline='${dominantBaseline}' font-family='${fontFamily}'>${content}</text></svg>`\n setSvgMask(newSvgMask)\n }\n\n updateSvgMask()\n window.addEventListener(\"resize\", updateSvgMask)\n return () => window.removeEventListener(\"resize\", updateSvgMask)\n }, [content, fontSize, fontWeight, textAnchor, dominantBaseline, fontFamily])\n\n const dataUrlMask = `url(\"data:image/svg+xml,${encodeURIComponent(svgMask)}\")`\n\n return (\n <Component className={cn(`relative size-full`, className)}>\n {/* Create a container that masks the video to only show within text */}\n <div\n className=\"absolute inset-0 flex items-center justify-center\"\n style={{\n maskImage: dataUrlMask,\n WebkitMaskImage: dataUrlMask,\n maskSize: \"contain\",\n WebkitMaskSize: \"contain\",\n maskRepeat: \"no-repeat\",\n WebkitMaskRepeat: \"no-repeat\",\n maskPosition: \"center\",\n WebkitMaskPosition: \"center\",\n }}\n >\n <video\n className=\"h-full w-full object-cover\"\n autoPlay={autoPlay}\n muted={muted}\n loop={loop}\n preload={preload}\n playsInline\n >\n <source src={src} />\n Your browser does not support the video tag.\n </video>\n </div>\n\n {/* Add a backup text element for SEO/accessibility */}\n <span className=\"sr-only\">{content}</span>\n </Component>\n )\n}\n",+ "content": "\"use client\"\n\nimport React, {\n useEffect,\n useState,\n type ElementType,\n type ReactNode,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface VideoTextProps {\n /**\n * The video source URL\n */\n src: string\n /**\n * Additional className for the container\n */\n className?: string\n /**\n * Whether to autoplay the video\n */\n autoPlay?: boolean\n /**\n * Whether to mute the video\n */\n muted?: boolean\n /**\n * Whether to loop the video\n */\n loop?: boolean\n /**\n * Whether to preload the video\n */\n preload?: \"auto\" | \"metadata\" | \"none\"\n /**\n * The content to display (will have the video \"inside\" it)\n */\n children: ReactNode\n /**\n * Font size for the text mask (in viewport width units)\n * @default 10\n */\n fontSize?: string | number\n /**\n * Font weight for the text mask\n * @default \"bold\"\n */\n fontWeight?: string | number\n /**\n * Text anchor for the text mask\n * @default \"middle\"\n */\n textAnchor?: string\n /**\n * Dominant baseline for the text mask\n * @default \"middle\"\n */\n dominantBaseline?: string\n /**\n * Font family for the text mask\n * @default \"sans-serif\"\n */\n fontFamily?: string\n /**\n * The element type to render for the text\n * @default \"div\"\n */\n as?: ElementType\n}\n\nexport function VideoText({\n src,\n children,\n className = \"\",\n autoPlay = true,\n muted = true,\n loop = true,\n preload = \"auto\",\n fontSize = 20,\n fontWeight = \"bold\",\n textAnchor = \"middle\",\n dominantBaseline = \"middle\",\n fontFamily = \"sans-serif\",\n as: Component = \"div\",\n}: VideoTextProps) {\n const [svgMask, setSvgMask] = useState(\"\")\n const content = React.Children.toArray(children).join(\"\")\n\n useEffect(() => {\n const updateSvgMask = () => {\n const responsiveFontSize =\n typeof fontSize === \"number\" ? `${fontSize}vw` : fontSize\n const newSvgMask = `<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'><text x='50%' y='50%' font-size='${responsiveFontSize}' font-weight='${fontWeight}' text-anchor='${textAnchor}' dominant-baseline='${dominantBaseline}' font-family='${fontFamily}'>${content}</text></svg>`\n setSvgMask(newSvgMask)\n }\n\n updateSvgMask()\n window.addEventListener(\"resize\", updateSvgMask)\n return () => window.removeEventListener(\"resize\", updateSvgMask)\n }, [content, fontSize, fontWeight, textAnchor, dominantBaseline, fontFamily])\n\n const dataUrlMask = `url(\"data:image/svg+xml,${encodeURIComponent(svgMask)}\")`\n\n return (\n <Component className={cn(`relative size-full`, className)}>\n {/* Create a container that masks the video to only show within text */}\n <div\n className=\"absolute inset-0 flex items-center justify-center\"\n style={{\n maskImage: dataUrlMask,\n WebkitMaskImage: dataUrlMask,\n maskSize: \"contain\",\n WebkitMaskSize: \"contain\",\n maskRepeat: \"no-repeat\",\n WebkitMaskRepeat: \"no-repeat\",\n maskPosition: \"center\",\n WebkitMaskPosition: \"center\",\n }}\n >\n <video\n className=\"h-full w-full object-cover\"\n autoPlay={autoPlay}\n muted={muted}\n loop={loop}\n preload={preload}\n playsInline\n >\n <source src={src} />\n Your browser does not support the video tag.\n </video>\n </div>\n\n {/* Add a backup text element for SEO/accessibility */}\n <span className=\"sr-only\">{content}</span>\n </Component>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/public/r/warp-background.json b/apps/www/public/r/warp-background.jsonindex 221c2213..a46362ed 100644--- a/apps/www/public/r/warp-background.json+++ b/apps/www/public/r/warp-background.json@@ -10,7 +10,7 @@"files": [{"path": "registry/magicui/warp-background.tsx",- "content": "\"use client\"\n\nimport React, { HTMLAttributes, useCallback, useMemo } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface WarpBackgroundProps extends HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n perspective?: number\n beamsPerSide?: number\n beamSize?: number\n beamDelayMax?: number\n beamDelayMin?: number\n beamDuration?: number\n gridColor?: string\n}\n\nconst Beam = ({\n width,\n x,\n delay,\n duration,\n}: {\n width: string | number\n x: string | number\n delay: number\n duration: number\n}) => {\n const hue = Math.floor(Math.random() * 360)\n const ar = Math.floor(Math.random() * 10) + 1\n\n return (\n <motion.div\n style={\n {\n \"--x\": `${x}`,\n \"--width\": `${width}`,\n \"--aspect-ratio\": `${ar}`,\n \"--background\": `linear-gradient(hsl(${hue} 80% 60%), transparent)`,\n } as React.CSSProperties\n }\n className={`absolute top-0 left-(--x) aspect-[1/var(--aspect-ratio)] w-(--width) [background:var(--background)]`}\n initial={{ y: \"100cqmax\", x: \"-50%\" }}\n animate={{ y: \"-100%\", x: \"-50%\" }}\n transition={{\n duration,\n delay,\n repeat: Infinity,\n ease: \"linear\",\n }}\n />\n )\n}\n\nexport const WarpBackground: React.FC<WarpBackgroundProps> = ({\n children,\n perspective = 100,\n className,\n beamsPerSide = 3,\n beamSize = 5,\n beamDelayMax = 3,\n beamDelayMin = 0,\n beamDuration = 3,\n gridColor = \"var(--border)\",\n ...props\n}) => {\n const generateBeams = useCallback(() => {\n const beams = []\n const cellsPerSide = Math.floor(100 / beamSize)\n const step = cellsPerSide / beamsPerSide\n\n for (let i = 0; i < beamsPerSide; i++) {\n const x = Math.floor(i * step)\n const delay = Math.random() * (beamDelayMax - beamDelayMin) + beamDelayMin\n beams.push({ x, delay })\n }\n return beams\n }, [beamsPerSide, beamSize, beamDelayMax, beamDelayMin])\n\n const topBeams = useMemo(() => generateBeams(), [generateBeams])\n const rightBeams = useMemo(() => generateBeams(), [generateBeams])\n const bottomBeams = useMemo(() => generateBeams(), [generateBeams])\n const leftBeams = useMemo(() => generateBeams(), [generateBeams])\n\n return (\n <div className={cn(\"relative rounded border p-20\", className)} {...props}>\n <div\n style={\n {\n \"--perspective\": `${perspective}px`,\n \"--grid-color\": gridColor,\n \"--beam-size\": `${beamSize}%`,\n } as React.CSSProperties\n }\n className={\n \"@container-[size] pointer-events-none absolute top-0 left-0 size-full overflow-hidden [clipPath:inset(0)] perspective-(--perspective) transform-3d\"\n }\n >\n {/* top side */}\n <div className=\"@container absolute z-20 h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {topBeams.map((beam, index) => (\n <Beam\n key={`top-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n {/* bottom side */}\n <div className=\"@container absolute top-full h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {bottomBeams.map((beam, index) => (\n <Beam\n key={`bottom-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n {/* left side */}\n <div className=\"@container absolute top-0 left-0 h-[100cqmax] w-[100cqh] origin-[0%_0%] transform-[rotate(90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {leftBeams.map((beam, index) => (\n <Beam\n key={`left-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n {/* right side */}\n <div className=\"@container absolute top-0 right-0 h-[100cqmax] w-[100cqh] origin-[100%_0%] transform-[rotate(-90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {rightBeams.map((beam, index) => (\n <Beam\n key={`right-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n </div>\n <div className=\"relative\">{children}</div>\n </div>\n )\n}\n",+ "content": "\"use client\"\n\nimport React, { useCallback, useMemo, type HTMLAttributes } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface WarpBackgroundProps extends HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n perspective?: number\n beamsPerSide?: number\n beamSize?: number\n beamDelayMax?: number\n beamDelayMin?: number\n beamDuration?: number\n gridColor?: string\n}\n\nconst Beam = ({\n width,\n x,\n delay,\n duration,\n}: {\n width: string | number\n x: string | number\n delay: number\n duration: number\n}) => {\n const hue = Math.floor(Math.random() * 360)\n const ar = Math.floor(Math.random() * 10) + 1\n\n return (\n <motion.div\n style={\n {\n \"--x\": `${x}`,\n \"--width\": `${width}`,\n \"--aspect-ratio\": `${ar}`,\n \"--background\": `linear-gradient(hsl(${hue} 80% 60%), transparent)`,\n } as React.CSSProperties\n }\n className={`absolute top-0 left-(--x) aspect-[1/var(--aspect-ratio)] w-(--width) [background:var(--background)]`}\n initial={{ y: \"100cqmax\", x: \"-50%\" }}\n animate={{ y: \"-100%\", x: \"-50%\" }}\n transition={{\n duration,\n delay,\n repeat: Infinity,\n ease: \"linear\",\n }}\n />\n )\n}\n\nexport const WarpBackground: React.FC<WarpBackgroundProps> = ({\n children,\n perspective = 100,\n className,\n beamsPerSide = 3,\n beamSize = 5,\n beamDelayMax = 3,\n beamDelayMin = 0,\n beamDuration = 3,\n gridColor = \"var(--border)\",\n ...props\n}) => {\n const generateBeams = useCallback(() => {\n const beams = []\n const cellsPerSide = Math.floor(100 / beamSize)\n const step = cellsPerSide / beamsPerSide\n\n for (let i = 0; i < beamsPerSide; i++) {\n const x = Math.floor(i * step)\n const delay = Math.random() * (beamDelayMax - beamDelayMin) + beamDelayMin\n beams.push({ x, delay })\n }\n return beams\n }, [beamsPerSide, beamSize, beamDelayMax, beamDelayMin])\n\n const topBeams = useMemo(() => generateBeams(), [generateBeams])\n const rightBeams = useMemo(() => generateBeams(), [generateBeams])\n const bottomBeams = useMemo(() => generateBeams(), [generateBeams])\n const leftBeams = useMemo(() => generateBeams(), [generateBeams])\n\n return (\n <div className={cn(\"relative rounded border p-20\", className)} {...props}>\n <div\n style={\n {\n \"--perspective\": `${perspective}px`,\n \"--grid-color\": gridColor,\n \"--beam-size\": `${beamSize}%`,\n } as React.CSSProperties\n }\n className={\n \"@container-[size] pointer-events-none absolute top-0 left-0 size-full overflow-hidden [clipPath:inset(0)] perspective-(--perspective) transform-3d\"\n }\n >\n {/* top side */}\n <div className=\"@container absolute z-20 h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {topBeams.map((beam, index) => (\n <Beam\n key={`top-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n {/* bottom side */}\n <div className=\"@container absolute top-full h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {bottomBeams.map((beam, index) => (\n <Beam\n key={`bottom-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n {/* left side */}\n <div className=\"@container absolute top-0 left-0 h-[100cqmax] w-[100cqh] origin-[0%_0%] transform-[rotate(90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {leftBeams.map((beam, index) => (\n <Beam\n key={`left-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n {/* right side */}\n <div className=\"@container absolute top-0 right-0 h-[100cqmax] w-[100cqh] origin-[100%_0%] transform-[rotate(-90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {rightBeams.map((beam, index) => (\n <Beam\n key={`right-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n </div>\n <div className=\"relative\">{children}</div>\n </div>\n )\n}\n","type": "registry:ui"}]diff --git a/apps/www/registry/index.ts b/apps/www/registry/index.tsindex 3c2923bc..830be3b4 100644--- a/apps/www/registry/index.ts+++ b/apps/www/registry/index.ts@@ -1,4 +1,8 @@-import { registryIndexSchema, RegistryItem, type Registry } from "shadcn/schema"+import {+ registryIndexSchema,+ type Registry,+ type RegistryItem,+} from "shadcn/schema"import { examples } from "@/registry/registry-examples"import { lib } from "@/registry/registry-lib"diff --git a/apps/www/registry/magicui/android.tsx b/apps/www/registry/magicui/android.tsxindex 7bec58f6..754b0655 100644--- a/apps/www/registry/magicui/android.tsx+++ b/apps/www/registry/magicui/android.tsx@@ -1,4 +1,4 @@-import { SVGProps } from "react"+import { type SVGProps } from "react"export interface AndroidProps extends SVGProps<SVGSVGElement> {width?: numberdiff --git a/apps/www/registry/magicui/animated-subscribe-button.tsx b/apps/www/registry/magicui/animated-subscribe-button.tsxindex 2b30417a..d78e95e6 100644--- a/apps/www/registry/magicui/animated-subscribe-button.tsx+++ b/apps/www/registry/magicui/animated-subscribe-button.tsx@@ -1,7 +1,7 @@"use client"import React, { useEffect, useState } from "react"-import { AnimatePresence, HTMLMotionProps, motion } from "motion/react"+import { AnimatePresence, motion, type HTMLMotionProps } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/border-beam.tsx b/apps/www/registry/magicui/border-beam.tsxindex 1f594d1e..f35bb34c 100644--- a/apps/www/registry/magicui/border-beam.tsx+++ b/apps/www/registry/magicui/border-beam.tsx@@ -1,6 +1,6 @@"use client"-import { motion, MotionStyle, Transition } from "motion/react"+import { motion, type MotionStyle, type Transition } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/client-tweet-card.tsx b/apps/www/registry/magicui/client-tweet-card.tsxindex d5c03f9b..24dc9a88 100644--- a/apps/www/registry/magicui/client-tweet-card.tsx+++ b/apps/www/registry/magicui/client-tweet-card.tsx@@ -1,6 +1,6 @@"use client"-import { TweetProps, useTweet } from "react-tweet"+import { useTweet, type TweetProps } from "react-tweet"import {MagicTweet,diff --git a/apps/www/registry/magicui/comic-text.tsx b/apps/www/registry/magicui/comic-text.tsxindex 059681fe..12c9b4a0 100644--- a/apps/www/registry/magicui/comic-text.tsx+++ b/apps/www/registry/magicui/comic-text.tsx@@ -1,6 +1,6 @@"use client"-import { CSSProperties } from "react"+import { type CSSProperties } from "react"import { motion } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/cool-mode.tsx b/apps/www/registry/magicui/cool-mode.tsxindex 6115a027..5089f028 100644--- a/apps/www/registry/magicui/cool-mode.tsx+++ b/apps/www/registry/magicui/cool-mode.tsx@@ -1,6 +1,6 @@"use client"-import React, { ReactNode, useEffect, useRef } from "react"+import React, { useEffect, useRef, type ReactNode } from "react"export interface BaseParticle {element: HTMLElement | SVGSVGElementdiff --git a/apps/www/registry/magicui/dock.tsx b/apps/www/registry/magicui/dock.tsxindex d0b5b58c..c62a97b1 100644--- a/apps/www/registry/magicui/dock.tsx+++ b/apps/www/registry/magicui/dock.tsx@@ -1,6 +1,6 @@"use client"-import React, { PropsWithChildren, useRef } from "react"+import React, { useRef, type PropsWithChildren } from "react"import { cva, type VariantProps } from "class-variance-authority"import {motion,diff --git a/apps/www/registry/magicui/neon-gradient-card.tsx b/apps/www/registry/magicui/neon-gradient-card.tsxindex c9d46c56..931de84f 100644--- a/apps/www/registry/magicui/neon-gradient-card.tsx+++ b/apps/www/registry/magicui/neon-gradient-card.tsx@@ -1,12 +1,12 @@"use client"import {- CSSProperties,- ReactElement,- ReactNode,useEffect,useRef,useState,+ type CSSProperties,+ type ReactElement,+ type ReactNode,} from "react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/rainbow-button.tsx b/apps/www/registry/magicui/rainbow-button.tsxindex 075dcbf6..47273007 100644--- a/apps/www/registry/magicui/rainbow-button.tsx+++ b/apps/www/registry/magicui/rainbow-button.tsx@@ -1,6 +1,6 @@import React from "react"import { Slot } from "@radix-ui/react-slot"-import { cva, VariantProps } from "class-variance-authority"+import { cva, type VariantProps } from "class-variance-authority"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/ripple-button.tsx b/apps/www/registry/magicui/ripple-button.tsxindex f583f981..0cc571cb 100644--- a/apps/www/registry/magicui/ripple-button.tsx+++ b/apps/www/registry/magicui/ripple-button.tsx@@ -1,6 +1,6 @@"use client"-import React, { MouseEvent, useEffect, useState } from "react"+import React, { useEffect, useState, type MouseEvent } from "react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/smooth-cursor.tsx b/apps/www/registry/magicui/smooth-cursor.tsxindex 39c9f5f4..bcb2bdc7 100644--- a/apps/www/registry/magicui/smooth-cursor.tsx+++ b/apps/www/registry/magicui/smooth-cursor.tsx@@ -1,6 +1,6 @@"use client"-import { FC, useEffect, useRef, useState } from "react"+import { useEffect, useRef, useState, type FC } from "react"import { motion, useSpring } from "motion/react"interface Position {diff --git a/apps/www/registry/magicui/sparkles-text.tsx b/apps/www/registry/magicui/sparkles-text.tsxindex a4073359..2befd517 100644--- a/apps/www/registry/magicui/sparkles-text.tsx+++ b/apps/www/registry/magicui/sparkles-text.tsx@@ -1,6 +1,11 @@"use client"-import { CSSProperties, ReactElement, useEffect, useState } from "react"+import {+ useEffect,+ useState,+ type CSSProperties,+ type ReactElement,+} from "react"import { motion } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/spinning-text.tsx b/apps/www/registry/magicui/spinning-text.tsxindex 0a55d27f..1162d1b1 100644--- a/apps/www/registry/magicui/spinning-text.tsx+++ b/apps/www/registry/magicui/spinning-text.tsx@@ -1,7 +1,7 @@"use client"import React, { type ComponentPropsWithoutRef } from "react"-import { motion, Transition, Variants } from "motion/react"+import { motion, type Transition, type Variants } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/text-animate.tsx b/apps/www/registry/magicui/text-animate.tsxindex ce2b453f..6b470f1e 100644--- a/apps/www/registry/magicui/text-animate.tsx+++ b/apps/www/registry/magicui/text-animate.tsx@@ -4,9 +4,9 @@ import { memo } from "react"import {AnimatePresence,motion,- Variants,type DOMMotionComponents,type MotionProps,+ type Variants,} from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/video-text.tsx b/apps/www/registry/magicui/video-text.tsxindex 9f51c0e5..274c1197 100644--- a/apps/www/registry/magicui/video-text.tsx+++ b/apps/www/registry/magicui/video-text.tsx@@ -1,6 +1,11 @@"use client"-import React, { ElementType, ReactNode, useEffect, useState } from "react"+import React, {+ useEffect,+ useState,+ type ElementType,+ type ReactNode,+} from "react"import { cn } from "@/lib/utils"diff --git a/apps/www/registry/magicui/warp-background.tsx b/apps/www/registry/magicui/warp-background.tsxindex 9e05319d..0b78c589 100644--- a/apps/www/registry/magicui/warp-background.tsx+++ b/apps/www/registry/magicui/warp-background.tsx@@ -1,6 +1,6 @@"use client"-import React, { HTMLAttributes, useCallback, useMemo } from "react"+import React, { useCallback, useMemo, type HTMLAttributes } from "react"import { motion } from "motion/react"import { cn } from "@/lib/utils"diff --git a/apps/www/tsconfig.json b/apps/www/tsconfig.jsonindex 3251b69c..80fb9b2e 100644--- a/apps/www/tsconfig.json+++ b/apps/www/tsconfig.json@@ -13,6 +13,7 @@"moduleResolution": "bundler","resolveJsonModule": true,"isolatedModules": true,+ "verbatimModuleSyntax": true,"jsx": "preserve","incremental": true,"plugins": [