Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

fix: build fix

Dillion Verma978a4b1402bb
diff --git a/apps/www/app/(docs)/docs/[[...slug]]/page.tsx b/apps/www/app/(docs)/docs/[[...slug]]/page.tsx
index 96ca8d10..edc7fc5a 100644
--- a/apps/www/app/(docs)/docs/[[...slug]]/page.tsx
+++ b/apps/www/app/(docs)/docs/[[...slug]]/page.tsx
@@ -2,17 +2,12 @@ import type { Metadata } from "next"
import Link from "next/link"
import { notFound } from "next/navigation"
import { mdxComponents } from "@/mdx-components"
-import {
- IconArrowLeft,
- IconArrowRight,
- IconArrowUpRight,
-} from "@tabler/icons-react"
+import { IconArrowLeft, IconArrowRight } from "@tabler/icons-react"
import { findNeighbour } from "fumadocs-core/server"
import { replaceComponentSource } from "@/lib/docs"
import { source } from "@/lib/source"
import { absoluteUrl } from "@/lib/utils"
-import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { Contribute } from "@/components/contribute"
import { DocsCopyPage } from "@/components/docs-copy-page"
@@ -145,24 +140,6 @@ export default async function DocPage({ params }: DocPageProps) {
</p>
)}
</div>
- {links ? (
- <div className="flex items-center space-x-2 pt-4">
- {links?.doc && (
- <Badge asChild variant="secondary">
- <Link href={links.doc} target="_blank" rel="noreferrer">
- Docs <IconArrowUpRight />
- </Link>
- </Badge>
- )}
- {links?.api && (
- <Badge asChild variant="secondary">
- <Link href={links.api} target="_blank" rel="noreferrer">
- API Reference <IconArrowUpRight />
- </Link>
- </Badge>
- )}
- </div>
- ) : null}
</div>
<div className="w-full flex-1 *:data-[slot=alert]:first:mt-0">
<MDX components={mdxComponents} />
diff --git a/apps/www/public/r/android-demo-2.json b/apps/www/public/r/android-demo-2.json
index fa6cc48a..d4273148 100644
--- a/apps/www/public/r/android-demo-2.json
+++ b/apps/www/public/r/android-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/android-demo-2.tsx",
- "content": "import { Android } from \"@/registry/magicui/android\";\n\nexport default function AndroidDemo() {\n return (\n <div className=\"relative\">\n <Android\n className=\"size-full\"\n src=\"https://images.unsplash.com/photo-1730326405863-c6fa7e499a6e?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n />\n </div>\n );\n}\n",
+ "content": "import { Android } from \"@/registry/magicui/android\"\n\nexport default function AndroidDemo() {\n return (\n <div className=\"relative\">\n <Android\n className=\"size-full\"\n src=\"https://images.unsplash.com/photo-1730326405863-c6fa7e499a6e?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/android-demo-3.json b/apps/www/public/r/android-demo-3.json
index 1d730925..bfd9bfd4 100644
--- a/apps/www/public/r/android-demo-3.json
+++ b/apps/www/public/r/android-demo-3.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/android-demo-3.tsx",
- "content": "import { Android } from \"@/registry/magicui/android\";\n\nexport default function AndroidDemo() {\n return (\n <div className=\"relative\">\n <Android\n className=\"size-full\"\n videoSrc=\"https://videos.pexels.com/video-files/14993748/14993748-uhd_1296_2304_30fps.mp4\"\n />\n </div>\n );\n}\n",
+ "content": "import { Android } from \"@/registry/magicui/android\"\n\nexport default function AndroidDemo() {\n return (\n <div className=\"relative\">\n <Android\n className=\"size-full\"\n videoSrc=\"https://videos.pexels.com/video-files/14993748/14993748-uhd_1296_2304_30fps.mp4\"\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/android-demo.json b/apps/www/public/r/android-demo.json
index 1d5128c0..ad46c274 100644
--- a/apps/www/public/r/android-demo.json
+++ b/apps/www/public/r/android-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/android-demo.tsx",
- "content": "import { Android } from \"@/registry/magicui/android\";\n\nexport default function AndroidDemo() {\n return (\n <div className=\"relative\">\n <Android className=\"size-full\" />\n </div>\n );\n}\n",
+ "content": "import { Android } from \"@/registry/magicui/android\"\n\nexport default function AndroidDemo() {\n return (\n <div className=\"relative\">\n <Android className=\"size-full\" />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/android.json b/apps/www/public/r/android.json
index 676263f1..3f4c19b9 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 { 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/animated-beam-bidirectional.json b/apps/www/public/r/animated-beam-bidirectional.json
index fb3841f5..a96b9cbb 100644
--- a/apps/www/public/r/animated-beam-bidirectional.json
+++ b/apps/www/public/r/animated-beam-bidirectional.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-beam-bidirectional.tsx",
- "content": "\"use client\";\n\nimport React, { forwardRef, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\";\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"z-10 flex size-12 items-center justify-center rounded-full border-2 bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className,\n )}\n >\n {children}\n </div>\n );\n});\n\nCircle.displayName = \"Circle\";\n\nexport default function AnimatedBeamDemo() {\n const containerRef = useRef<HTMLDivElement>(null);\n const div1Ref = useRef<HTMLDivElement>(null);\n const div2Ref = useRef<HTMLDivElement>(null);\n\n return (\n <div\n className=\"relative flex w-full max-w-[500px] items-center justify-center overflow-hidden p-10\"\n ref={containerRef}\n >\n <div className=\"flex size-full flex-col items-stretch justify-between gap-10\">\n <div className=\"flex flex-row justify-between\">\n <Circle ref={div1Ref}>\n <Icons.user />\n </Circle>\n <Circle ref={div2Ref}>\n <Icons.openai />\n </Circle>\n </div>\n </div>\n\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div2Ref}\n startYOffset={10}\n endYOffset={10}\n curvature={-20}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div2Ref}\n startYOffset={-10}\n endYOffset={-10}\n curvature={20}\n reverse\n />\n </div>\n );\n}\n\nconst Icons = {\n openai: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n user: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"#000000\"\n strokeWidth=\"2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n ),\n};\n",
+ "content": "\"use client\"\n\nimport React, { forwardRef, useRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\"\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"z-10 flex size-12 items-center justify-center rounded-full border-2 bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className\n )}\n >\n {children}\n </div>\n )\n})\n\nCircle.displayName = \"Circle\"\n\nexport default function AnimatedBeamDemo() {\n const containerRef = useRef<HTMLDivElement>(null)\n const div1Ref = useRef<HTMLDivElement>(null)\n const div2Ref = useRef<HTMLDivElement>(null)\n\n return (\n <div\n className=\"relative flex w-full max-w-[500px] items-center justify-center overflow-hidden p-10\"\n ref={containerRef}\n >\n <div className=\"flex size-full flex-col items-stretch justify-between gap-10\">\n <div className=\"flex flex-row justify-between\">\n <Circle ref={div1Ref}>\n <Icons.user />\n </Circle>\n <Circle ref={div2Ref}>\n <Icons.openai />\n </Circle>\n </div>\n </div>\n\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div2Ref}\n startYOffset={10}\n endYOffset={10}\n curvature={-20}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div2Ref}\n startYOffset={-10}\n endYOffset={-10}\n curvature={20}\n reverse\n />\n </div>\n )\n}\n\nconst Icons = {\n openai: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n user: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"#000000\"\n strokeWidth=\"2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n ),\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-beam-demo.json b/apps/www/public/r/animated-beam-demo.json
index 3b974915..9c9d3dab 100644
--- a/apps/www/public/r/animated-beam-demo.json
+++ b/apps/www/public/r/animated-beam-demo.json
@@ -13,7 +13,7 @@
"files": [
{
"path": "registry/example/animated-beam-demo.tsx",
- "content": "\"use client\";\n\nimport React, { forwardRef, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\";\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"z-10 flex size-12 items-center justify-center rounded-full border-2 bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className,\n )}\n >\n {children}\n </div>\n );\n});\n\nCircle.displayName = \"Circle\";\n\nexport default function AnimatedBeamDemo() {\n const containerRef = useRef<HTMLDivElement>(null);\n const div1Ref = useRef<HTMLDivElement>(null);\n const div2Ref = useRef<HTMLDivElement>(null);\n const div3Ref = useRef<HTMLDivElement>(null);\n const div4Ref = useRef<HTMLDivElement>(null);\n const div5Ref = useRef<HTMLDivElement>(null);\n const div6Ref = useRef<HTMLDivElement>(null);\n const div7Ref = useRef<HTMLDivElement>(null);\n\n return (\n <div\n className=\"relative flex h-[300px] w-full items-center justify-center overflow-hidden p-10\"\n ref={containerRef}\n >\n <div className=\"flex size-full max-h-[200px] max-w-lg flex-col items-stretch justify-between gap-10\">\n <div className=\"flex flex-row items-center justify-between\">\n <Circle ref={div1Ref}>\n <Icons.googleDrive />\n </Circle>\n <Circle ref={div5Ref}>\n <Icons.googleDocs />\n </Circle>\n </div>\n <div className=\"flex flex-row items-center justify-between\">\n <Circle ref={div2Ref}>\n <Icons.notion />\n </Circle>\n <Circle ref={div4Ref} className=\"size-16\">\n <Icons.openai />\n </Circle>\n <Circle ref={div6Ref}>\n <Icons.zapier />\n </Circle>\n </div>\n <div className=\"flex flex-row items-center justify-between\">\n <Circle ref={div3Ref}>\n <Icons.whatsapp />\n </Circle>\n <Circle ref={div7Ref}>\n <Icons.messenger />\n </Circle>\n </div>\n </div>\n\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div4Ref}\n curvature={-75}\n endYOffset={-10}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div2Ref}\n toRef={div4Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div3Ref}\n toRef={div4Ref}\n curvature={75}\n endYOffset={10}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div5Ref}\n toRef={div4Ref}\n curvature={-75}\n endYOffset={-10}\n reverse\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div6Ref}\n toRef={div4Ref}\n reverse\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div7Ref}\n toRef={div4Ref}\n curvature={75}\n endYOffset={10}\n reverse\n />\n </div>\n );\n}\n\nconst Icons = {\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n googleDocs: () => (\n <svg\n width=\"47px\"\n height=\"65px\"\n viewBox=\"0 0 47 65\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-1\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-3\"\n />\n <linearGradient\n x1=\"50.0053945%\"\n y1=\"8.58610612%\"\n x2=\"50.0053945%\"\n y2=\"100.013939%\"\n id=\"linearGradient-5\"\n >\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.2\" offset=\"0%\" />\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.02\" offset=\"100%\" />\n </linearGradient>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-6\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-8\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-10\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-12\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-14\"\n />\n <radialGradient\n cx=\"3.16804688%\"\n cy=\"2.71744318%\"\n fx=\"3.16804688%\"\n fy=\"2.71744318%\"\n r=\"161.248516%\"\n gradientTransform=\"translate(0.031680,0.027174),scale(1.000000,0.723077),translate(-0.031680,-0.027174)\"\n id=\"radialGradient-16\"\n >\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0.1\" offset=\"0%\" />\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0\" offset=\"100%\" />\n </radialGradient>\n </defs>\n <g\n id=\"Page-1\"\n stroke=\"none\"\n strokeWidth=\"1\"\n fill=\"none\"\n fillRule=\"evenodd\"\n >\n <g transform=\"translate(-451.000000, -463.000000)\">\n <g id=\"Hero\" transform=\"translate(0.000000, 63.000000)\">\n <g id=\"Personal\" transform=\"translate(277.000000, 309.000000)\">\n <g id=\"Docs-icon\" transform=\"translate(174.000000, 91.000000)\">\n <g id=\"Group\">\n <g id=\"Clipped\">\n <mask id=\"mask-2\" fill=\"white\">\n <use xlinkHref=\"#path-1\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L36.71875,10.3409091 L29.375,0 Z\"\n id=\"Path\"\n fill=\"#4285F4\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-2)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-4\" fill=\"white\">\n <use xlinkHref=\"#path-3\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <polygon\n id=\"Path\"\n fill=\"url(#linearGradient-5)\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-4)\"\n points=\"30.6638281 16.4309659 47 32.8582386 47 17.7272727\"\n ></polygon>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-7\" fill=\"white\">\n <use xlinkHref=\"#path-6\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M11.75,47.2727273 L35.25,47.2727273 L35.25,44.3181818 L11.75,44.3181818 L11.75,47.2727273 Z M11.75,53.1818182 L29.375,53.1818182 L29.375,50.2272727 L11.75,50.2272727 L11.75,53.1818182 Z M11.75,32.5 L11.75,35.4545455 L35.25,35.4545455 L35.25,32.5 L11.75,32.5 Z M11.75,41.3636364 L35.25,41.3636364 L35.25,38.4090909 L11.75,38.4090909 L11.75,41.3636364 Z\"\n id=\"Shape\"\n fill=\"#F1F1F1\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-7)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-9\" fill=\"white\">\n <use xlinkHref=\"#path-8\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <g id=\"Group\" mask=\"url(#mask-9)\">\n <g transform=\"translate(26.437500, -2.954545)\">\n <path\n d=\"M2.9375,2.95454545 L2.9375,16.25 C2.9375,18.6985795 4.90929688,20.6818182 7.34375,20.6818182 L20.5625,20.6818182 L2.9375,2.95454545 Z\"\n id=\"Path\"\n fill=\"#A1C2FA\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-11\" fill=\"white\">\n <use xlinkHref=\"#path-10\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,4.80113636 C0,2.36363636 1.9828125,0.369318182 4.40625,0.369318182 L29.375,0.369318182 L29.375,0 L4.40625,0 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#FFFFFF\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-11)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-13\" fill=\"white\">\n <use xlinkHref=\"#path-12\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M42.59375,64.6306818 L4.40625,64.6306818 C1.9828125,64.6306818 0,62.6363636 0,60.1988636 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,60.1988636 C47,62.6363636 45.0171875,64.6306818 42.59375,64.6306818 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-13)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-15\" fill=\"white\">\n <use xlinkHref=\"#path-14\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M33.78125,17.7272727 C31.3467969,17.7272727 29.375,15.7440341 29.375,13.2954545 L29.375,13.6647727 C29.375,16.1133523 31.3467969,18.0965909 33.78125,18.0965909 L47,18.0965909 L47,17.7272727 L33.78125,17.7272727 Z\"\n id=\"Path\"\n fillOpacity=\"0.1\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-15)\"\n />\n </g>\n </g>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"Path\"\n fill=\"url(#radialGradient-16)\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n ),\n zapier: () => (\n <svg\n width=\"105\"\n height=\"28\"\n viewBox=\"0 0 244 66\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M57.1877 45.2253L57.1534 45.1166L78.809 25.2914V15.7391H44.0663V25.2914H64.8181L64.8524 25.3829L43.4084 45.2253V54.7775H79.1579V45.2253H57.1877Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M100.487 14.8297C96.4797 14.8297 93.2136 15.434 90.6892 16.6429C88.3376 17.6963 86.3568 19.4321 85.0036 21.6249C83.7091 23.8321 82.8962 26.2883 82.6184 28.832L93.1602 30.3135C93.5415 28.0674 94.3042 26.4754 95.4482 25.5373C96.7486 24.5562 98.3511 24.0605 99.9783 24.136C102.118 24.136 103.67 24.7079 104.634 25.8519C105.59 26.9959 106.076 28.5803 106.076 30.6681V31.7091H95.9401C90.7807 31.7091 87.0742 32.8531 84.8206 35.1411C82.5669 37.429 81.442 40.4492 81.4458 44.2014C81.4458 48.0452 82.5707 50.9052 84.8206 52.7813C87.0704 54.6574 89.8999 55.5897 93.3089 55.5783C97.5379 55.5783 100.791 54.1235 103.067 51.214C104.412 49.426 105.372 47.3793 105.887 45.2024H106.27L107.723 54.7546H117.275V30.5651C117.275 25.5659 115.958 21.6936 113.323 18.948C110.688 16.2024 106.409 14.8297 100.487 14.8297ZM103.828 44.6475C102.312 45.9116 100.327 46.5408 97.8562 46.5408C95.8199 46.5408 94.4052 46.1843 93.6121 45.4712C93.2256 45.1338 92.9182 44.7155 92.7116 44.246C92.505 43.7764 92.4043 43.2671 92.4166 42.7543C92.3941 42.2706 92.4702 41.7874 92.6403 41.3341C92.8104 40.8808 93.071 40.4668 93.4062 40.1174C93.7687 39.7774 94.1964 39.5145 94.6633 39.3444C95.1303 39.1743 95.6269 39.1006 96.1231 39.1278H106.093V39.7856C106.113 40.7154 105.919 41.6374 105.527 42.4804C105.134 43.3234 104.553 44.0649 103.828 44.6475Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M175.035 15.7391H163.75V54.7833H175.035V15.7391Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M241.666 15.7391C238.478 15.7391 235.965 16.864 234.127 19.1139C232.808 20.7307 231.805 23.1197 231.119 26.2809H230.787L229.311 15.7391H219.673V54.7775H230.959V34.7578C230.959 32.2335 231.55 30.2982 232.732 28.9521C233.914 27.606 236.095 26.933 239.275 26.933H243.559V15.7391H241.666Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M208.473 17.0147C205.839 15.4474 202.515 14.6657 198.504 14.6695C192.189 14.6695 187.247 16.4675 183.678 20.0634C180.108 23.6593 178.324 28.6166 178.324 34.9352C178.233 38.7553 179.067 42.5407 180.755 45.9689C182.3 49.0238 184.706 51.5592 187.676 53.2618C190.665 54.9892 194.221 55.8548 198.344 55.8586C201.909 55.8586 204.887 55.3095 207.278 54.2113C209.526 53.225 211.483 51.6791 212.964 49.7211C214.373 47.7991 215.42 45.6359 216.052 43.3377L206.329 40.615C205.919 42.1094 205.131 43.4728 204.041 44.5732C202.942 45.6714 201.102 46.2206 198.521 46.2206C195.451 46.2206 193.163 45.3416 191.657 43.5837C190.564 42.3139 189.878 40.5006 189.575 38.1498H216.201C216.31 37.0515 216.367 36.1306 216.367 35.387V32.9561C216.431 29.6903 215.757 26.4522 214.394 23.4839C213.118 20.7799 211.054 18.5248 208.473 17.0147ZM198.178 23.9758C202.754 23.9758 205.348 26.2275 205.962 30.731H189.775C190.032 29.2284 190.655 27.8121 191.588 26.607C193.072 24.8491 195.268 23.972 198.178 23.9758Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M169.515 0.00366253C168.666 -0.0252113 167.82 0.116874 167.027 0.421484C166.234 0.726094 165.511 1.187 164.899 1.77682C164.297 2.3723 163.824 3.08658 163.512 3.87431C163.2 4.66204 163.055 5.50601 163.086 6.35275C163.056 7.20497 163.201 8.05433 163.514 8.84781C163.826 9.64129 164.299 10.3619 164.902 10.9646C165.505 11.5673 166.226 12.0392 167.02 12.3509C167.814 12.6626 168.663 12.8074 169.515 12.7762C170.362 12.8082 171.206 12.6635 171.994 12.3514C172.782 12.0392 173.496 11.5664 174.091 10.963C174.682 10.3534 175.142 9.63077 175.446 8.83849C175.75 8.04621 175.89 7.20067 175.859 6.35275C175.898 5.50985 175.761 4.66806 175.456 3.88115C175.151 3.09424 174.686 2.37951 174.09 1.78258C173.493 1.18565 172.779 0.719644 171.992 0.414327C171.206 0.109011 170.364 -0.0288946 169.521 0.00938803L169.515 0.00366253Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M146.201 14.6695C142.357 14.6695 139.268 15.8764 136.935 18.2902C135.207 20.0786 133.939 22.7479 133.131 26.2981H132.771L131.295 15.7563H121.657V66H132.942V45.3054H133.354C133.698 46.6852 134.181 48.0267 134.795 49.3093C135.75 51.3986 137.316 53.1496 139.286 54.3314C141.328 55.446 143.629 56.0005 145.955 55.9387C150.68 55.9387 154.277 54.0988 156.748 50.419C159.219 46.7392 160.455 41.6046 160.455 35.0153C160.455 28.6509 159.259 23.6689 156.869 20.0691C154.478 16.4694 150.922 14.6695 146.201 14.6695ZM147.345 42.9602C146.029 44.8668 143.97 45.8201 141.167 45.8201C140.012 45.8735 138.86 45.6507 137.808 45.1703C136.755 44.6898 135.832 43.9656 135.116 43.0574C133.655 41.2233 132.927 38.7122 132.931 35.5243V34.7807C132.931 31.5432 133.659 29.0646 135.116 27.3448C136.572 25.625 138.59 24.7747 141.167 24.7937C144.02 24.7937 146.092 25.6994 147.385 27.5107C148.678 29.322 149.324 31.8483 149.324 35.0896C149.332 38.4414 148.676 41.065 147.356 42.9602H147.345Z\"\n fill=\"#201515\"\n />\n <path d=\"M39.0441 45.2253H0V54.789H39.0441V45.2253Z\" fill=\"#FF4F00\" />\n </svg>\n ),\n messenger: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <radialGradient\n id=\"8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1\"\n cx=\"11.087\"\n cy=\"7.022\"\n r=\"47.612\"\n gradientTransform=\"matrix(1 0 0 -1 0 50)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#1292ff\"></stop>\n <stop offset=\".079\" stopColor=\"#2982ff\"></stop>\n <stop offset=\".23\" stopColor=\"#4e69ff\"></stop>\n <stop offset=\".351\" stopColor=\"#6559ff\"></stop>\n <stop offset=\".428\" stopColor=\"#6d53ff\"></stop>\n <stop offset=\".754\" stopColor=\"#df47aa\"></stop>\n <stop offset=\".946\" stopColor=\"#ff6257\"></stop>\n </radialGradient>\n <path\n fill=\"url(#8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1)\"\n d=\"M44,23.5C44,34.27,35.05,43,24,43c-1.651,0-3.25-0.194-4.784-0.564\tc-0.465-0.112-0.951-0.069-1.379,0.145L13.46,44.77C12.33,45.335,11,44.513,11,43.249v-4.025c0-0.575-0.257-1.111-0.681-1.499\tC6.425,34.165,4,29.11,4,23.5C4,12.73,12.95,4,24,4S44,12.73,44,23.5z\"\n />\n <path\n d=\"M34.992,17.292c-0.428,0-0.843,0.142-1.2,0.411l-5.694,4.215\tc-0.133,0.1-0.28,0.15-0.435,0.15c-0.15,0-0.291-0.047-0.41-0.136l-3.972-2.99c-0.808-0.601-1.76-0.918-2.757-0.918\tc-1.576,0-3.025,0.791-3.876,2.116l-1.211,1.891l-4.12,6.695c-0.392,0.614-0.422,1.372-0.071,2.014\tc0.358,0.654,1.034,1.06,1.764,1.06c0.428,0,0.843-0.142,1.2-0.411l5.694-4.215c0.133-0.1,0.28-0.15,0.435-0.15\tc0.15,0,0.291,0.047,0.41,0.136l3.972,2.99c0.809,0.602,1.76,0.918,2.757,0.918c1.576,0,3.025-0.791,3.876-2.116l1.211-1.891\tl4.12-6.695c0.392-0.614,0.422-1.372,0.071-2.014C36.398,17.698,35.722,17.292,34.992,17.292L34.992,17.292z\"\n opacity=\".05\"\n />\n <path\n d=\"M34.992,17.792c-0.319,0-0.63,0.107-0.899,0.31l-5.697,4.218\tc-0.216,0.163-0.468,0.248-0.732,0.248c-0.259,0-0.504-0.082-0.71-0.236l-3.973-2.991c-0.719-0.535-1.568-0.817-2.457-0.817\tc-1.405,0-2.696,0.705-3.455,1.887l-1.21,1.891l-4.115,6.688c-0.297,0.465-0.32,1.033-0.058,1.511c0.266,0.486,0.787,0.8,1.325,0.8\tc0.319,0,0.63-0.107,0.899-0.31l5.697-4.218c0.216-0.163,0.468-0.248,0.732-0.248c0.259,0,0.504,0.082,0.71,0.236l3.973,2.991\tc0.719,0.535,1.568,0.817,2.457,0.817c1.405,0,2.696-0.705,3.455-1.887l1.21-1.891l4.115-6.688c0.297-0.465,0.32-1.033,0.058-1.511\tC36.051,18.106,35.531,17.792,34.992,17.792L34.992,17.792z\"\n opacity=\".07\"\n />\n <path\n fill=\"#ffffff\"\n d=\"M34.394,18.501l-5.7,4.22c-0.61,0.46-1.44,0.46-2.04,0.01L22.68,19.74\tc-1.68-1.25-4.06-0.82-5.19,0.94l-1.21,1.89l-4.11,6.68c-0.6,0.94,0.55,2.01,1.44,1.34l5.7-4.22c0.61-0.46,1.44-0.46,2.04-0.01\tl3.974,2.991c1.68,1.25,4.06,0.82,5.19-0.94l1.21-1.89l4.11-6.68C36.434,18.901,35.284,17.831,34.394,18.501z\"\n />\n </svg>\n ),\n};\n",
+ "content": "\"use client\"\n\nimport React, { forwardRef, useRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\"\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"z-10 flex size-12 items-center justify-center rounded-full border-2 bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className\n )}\n >\n {children}\n </div>\n )\n})\n\nCircle.displayName = \"Circle\"\n\nexport default function AnimatedBeamDemo() {\n const containerRef = useRef<HTMLDivElement>(null)\n const div1Ref = useRef<HTMLDivElement>(null)\n const div2Ref = useRef<HTMLDivElement>(null)\n const div3Ref = useRef<HTMLDivElement>(null)\n const div4Ref = useRef<HTMLDivElement>(null)\n const div5Ref = useRef<HTMLDivElement>(null)\n const div6Ref = useRef<HTMLDivElement>(null)\n const div7Ref = useRef<HTMLDivElement>(null)\n\n return (\n <div\n className=\"relative flex h-[300px] w-full items-center justify-center overflow-hidden p-10\"\n ref={containerRef}\n >\n <div className=\"flex size-full max-h-[200px] max-w-lg flex-col items-stretch justify-between gap-10\">\n <div className=\"flex flex-row items-center justify-between\">\n <Circle ref={div1Ref}>\n <Icons.googleDrive />\n </Circle>\n <Circle ref={div5Ref}>\n <Icons.googleDocs />\n </Circle>\n </div>\n <div className=\"flex flex-row items-center justify-between\">\n <Circle ref={div2Ref}>\n <Icons.notion />\n </Circle>\n <Circle ref={div4Ref} className=\"size-16\">\n <Icons.openai />\n </Circle>\n <Circle ref={div6Ref}>\n <Icons.zapier />\n </Circle>\n </div>\n <div className=\"flex flex-row items-center justify-between\">\n <Circle ref={div3Ref}>\n <Icons.whatsapp />\n </Circle>\n <Circle ref={div7Ref}>\n <Icons.messenger />\n </Circle>\n </div>\n </div>\n\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div4Ref}\n curvature={-75}\n endYOffset={-10}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div2Ref}\n toRef={div4Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div3Ref}\n toRef={div4Ref}\n curvature={75}\n endYOffset={10}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div5Ref}\n toRef={div4Ref}\n curvature={-75}\n endYOffset={-10}\n reverse\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div6Ref}\n toRef={div4Ref}\n reverse\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div7Ref}\n toRef={div4Ref}\n curvature={75}\n endYOffset={10}\n reverse\n />\n </div>\n )\n}\n\nconst Icons = {\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n googleDocs: () => (\n <svg\n width=\"47px\"\n height=\"65px\"\n viewBox=\"0 0 47 65\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-1\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-3\"\n />\n <linearGradient\n x1=\"50.0053945%\"\n y1=\"8.58610612%\"\n x2=\"50.0053945%\"\n y2=\"100.013939%\"\n id=\"linearGradient-5\"\n >\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.2\" offset=\"0%\" />\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.02\" offset=\"100%\" />\n </linearGradient>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-6\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-8\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-10\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-12\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-14\"\n />\n <radialGradient\n cx=\"3.16804688%\"\n cy=\"2.71744318%\"\n fx=\"3.16804688%\"\n fy=\"2.71744318%\"\n r=\"161.248516%\"\n gradientTransform=\"translate(0.031680,0.027174),scale(1.000000,0.723077),translate(-0.031680,-0.027174)\"\n id=\"radialGradient-16\"\n >\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0.1\" offset=\"0%\" />\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0\" offset=\"100%\" />\n </radialGradient>\n </defs>\n <g\n id=\"Page-1\"\n stroke=\"none\"\n strokeWidth=\"1\"\n fill=\"none\"\n fillRule=\"evenodd\"\n >\n <g transform=\"translate(-451.000000, -463.000000)\">\n <g id=\"Hero\" transform=\"translate(0.000000, 63.000000)\">\n <g id=\"Personal\" transform=\"translate(277.000000, 309.000000)\">\n <g id=\"Docs-icon\" transform=\"translate(174.000000, 91.000000)\">\n <g id=\"Group\">\n <g id=\"Clipped\">\n <mask id=\"mask-2\" fill=\"white\">\n <use xlinkHref=\"#path-1\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L36.71875,10.3409091 L29.375,0 Z\"\n id=\"Path\"\n fill=\"#4285F4\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-2)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-4\" fill=\"white\">\n <use xlinkHref=\"#path-3\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <polygon\n id=\"Path\"\n fill=\"url(#linearGradient-5)\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-4)\"\n points=\"30.6638281 16.4309659 47 32.8582386 47 17.7272727\"\n ></polygon>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-7\" fill=\"white\">\n <use xlinkHref=\"#path-6\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M11.75,47.2727273 L35.25,47.2727273 L35.25,44.3181818 L11.75,44.3181818 L11.75,47.2727273 Z M11.75,53.1818182 L29.375,53.1818182 L29.375,50.2272727 L11.75,50.2272727 L11.75,53.1818182 Z M11.75,32.5 L11.75,35.4545455 L35.25,35.4545455 L35.25,32.5 L11.75,32.5 Z M11.75,41.3636364 L35.25,41.3636364 L35.25,38.4090909 L11.75,38.4090909 L11.75,41.3636364 Z\"\n id=\"Shape\"\n fill=\"#F1F1F1\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-7)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-9\" fill=\"white\">\n <use xlinkHref=\"#path-8\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <g id=\"Group\" mask=\"url(#mask-9)\">\n <g transform=\"translate(26.437500, -2.954545)\">\n <path\n d=\"M2.9375,2.95454545 L2.9375,16.25 C2.9375,18.6985795 4.90929688,20.6818182 7.34375,20.6818182 L20.5625,20.6818182 L2.9375,2.95454545 Z\"\n id=\"Path\"\n fill=\"#A1C2FA\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-11\" fill=\"white\">\n <use xlinkHref=\"#path-10\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,4.80113636 C0,2.36363636 1.9828125,0.369318182 4.40625,0.369318182 L29.375,0.369318182 L29.375,0 L4.40625,0 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#FFFFFF\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-11)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-13\" fill=\"white\">\n <use xlinkHref=\"#path-12\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M42.59375,64.6306818 L4.40625,64.6306818 C1.9828125,64.6306818 0,62.6363636 0,60.1988636 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,60.1988636 C47,62.6363636 45.0171875,64.6306818 42.59375,64.6306818 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-13)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-15\" fill=\"white\">\n <use xlinkHref=\"#path-14\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M33.78125,17.7272727 C31.3467969,17.7272727 29.375,15.7440341 29.375,13.2954545 L29.375,13.6647727 C29.375,16.1133523 31.3467969,18.0965909 33.78125,18.0965909 L47,18.0965909 L47,17.7272727 L33.78125,17.7272727 Z\"\n id=\"Path\"\n fillOpacity=\"0.1\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-15)\"\n />\n </g>\n </g>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"Path\"\n fill=\"url(#radialGradient-16)\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n ),\n zapier: () => (\n <svg\n width=\"105\"\n height=\"28\"\n viewBox=\"0 0 244 66\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M57.1877 45.2253L57.1534 45.1166L78.809 25.2914V15.7391H44.0663V25.2914H64.8181L64.8524 25.3829L43.4084 45.2253V54.7775H79.1579V45.2253H57.1877Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M100.487 14.8297C96.4797 14.8297 93.2136 15.434 90.6892 16.6429C88.3376 17.6963 86.3568 19.4321 85.0036 21.6249C83.7091 23.8321 82.8962 26.2883 82.6184 28.832L93.1602 30.3135C93.5415 28.0674 94.3042 26.4754 95.4482 25.5373C96.7486 24.5562 98.3511 24.0605 99.9783 24.136C102.118 24.136 103.67 24.7079 104.634 25.8519C105.59 26.9959 106.076 28.5803 106.076 30.6681V31.7091H95.9401C90.7807 31.7091 87.0742 32.8531 84.8206 35.1411C82.5669 37.429 81.442 40.4492 81.4458 44.2014C81.4458 48.0452 82.5707 50.9052 84.8206 52.7813C87.0704 54.6574 89.8999 55.5897 93.3089 55.5783C97.5379 55.5783 100.791 54.1235 103.067 51.214C104.412 49.426 105.372 47.3793 105.887 45.2024H106.27L107.723 54.7546H117.275V30.5651C117.275 25.5659 115.958 21.6936 113.323 18.948C110.688 16.2024 106.409 14.8297 100.487 14.8297ZM103.828 44.6475C102.312 45.9116 100.327 46.5408 97.8562 46.5408C95.8199 46.5408 94.4052 46.1843 93.6121 45.4712C93.2256 45.1338 92.9182 44.7155 92.7116 44.246C92.505 43.7764 92.4043 43.2671 92.4166 42.7543C92.3941 42.2706 92.4702 41.7874 92.6403 41.3341C92.8104 40.8808 93.071 40.4668 93.4062 40.1174C93.7687 39.7774 94.1964 39.5145 94.6633 39.3444C95.1303 39.1743 95.6269 39.1006 96.1231 39.1278H106.093V39.7856C106.113 40.7154 105.919 41.6374 105.527 42.4804C105.134 43.3234 104.553 44.0649 103.828 44.6475Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M175.035 15.7391H163.75V54.7833H175.035V15.7391Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M241.666 15.7391C238.478 15.7391 235.965 16.864 234.127 19.1139C232.808 20.7307 231.805 23.1197 231.119 26.2809H230.787L229.311 15.7391H219.673V54.7775H230.959V34.7578C230.959 32.2335 231.55 30.2982 232.732 28.9521C233.914 27.606 236.095 26.933 239.275 26.933H243.559V15.7391H241.666Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M208.473 17.0147C205.839 15.4474 202.515 14.6657 198.504 14.6695C192.189 14.6695 187.247 16.4675 183.678 20.0634C180.108 23.6593 178.324 28.6166 178.324 34.9352C178.233 38.7553 179.067 42.5407 180.755 45.9689C182.3 49.0238 184.706 51.5592 187.676 53.2618C190.665 54.9892 194.221 55.8548 198.344 55.8586C201.909 55.8586 204.887 55.3095 207.278 54.2113C209.526 53.225 211.483 51.6791 212.964 49.7211C214.373 47.7991 215.42 45.6359 216.052 43.3377L206.329 40.615C205.919 42.1094 205.131 43.4728 204.041 44.5732C202.942 45.6714 201.102 46.2206 198.521 46.2206C195.451 46.2206 193.163 45.3416 191.657 43.5837C190.564 42.3139 189.878 40.5006 189.575 38.1498H216.201C216.31 37.0515 216.367 36.1306 216.367 35.387V32.9561C216.431 29.6903 215.757 26.4522 214.394 23.4839C213.118 20.7799 211.054 18.5248 208.473 17.0147ZM198.178 23.9758C202.754 23.9758 205.348 26.2275 205.962 30.731H189.775C190.032 29.2284 190.655 27.8121 191.588 26.607C193.072 24.8491 195.268 23.972 198.178 23.9758Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M169.515 0.00366253C168.666 -0.0252113 167.82 0.116874 167.027 0.421484C166.234 0.726094 165.511 1.187 164.899 1.77682C164.297 2.3723 163.824 3.08658 163.512 3.87431C163.2 4.66204 163.055 5.50601 163.086 6.35275C163.056 7.20497 163.201 8.05433 163.514 8.84781C163.826 9.64129 164.299 10.3619 164.902 10.9646C165.505 11.5673 166.226 12.0392 167.02 12.3509C167.814 12.6626 168.663 12.8074 169.515 12.7762C170.362 12.8082 171.206 12.6635 171.994 12.3514C172.782 12.0392 173.496 11.5664 174.091 10.963C174.682 10.3534 175.142 9.63077 175.446 8.83849C175.75 8.04621 175.89 7.20067 175.859 6.35275C175.898 5.50985 175.761 4.66806 175.456 3.88115C175.151 3.09424 174.686 2.37951 174.09 1.78258C173.493 1.18565 172.779 0.719644 171.992 0.414327C171.206 0.109011 170.364 -0.0288946 169.521 0.00938803L169.515 0.00366253Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M146.201 14.6695C142.357 14.6695 139.268 15.8764 136.935 18.2902C135.207 20.0786 133.939 22.7479 133.131 26.2981H132.771L131.295 15.7563H121.657V66H132.942V45.3054H133.354C133.698 46.6852 134.181 48.0267 134.795 49.3093C135.75 51.3986 137.316 53.1496 139.286 54.3314C141.328 55.446 143.629 56.0005 145.955 55.9387C150.68 55.9387 154.277 54.0988 156.748 50.419C159.219 46.7392 160.455 41.6046 160.455 35.0153C160.455 28.6509 159.259 23.6689 156.869 20.0691C154.478 16.4694 150.922 14.6695 146.201 14.6695ZM147.345 42.9602C146.029 44.8668 143.97 45.8201 141.167 45.8201C140.012 45.8735 138.86 45.6507 137.808 45.1703C136.755 44.6898 135.832 43.9656 135.116 43.0574C133.655 41.2233 132.927 38.7122 132.931 35.5243V34.7807C132.931 31.5432 133.659 29.0646 135.116 27.3448C136.572 25.625 138.59 24.7747 141.167 24.7937C144.02 24.7937 146.092 25.6994 147.385 27.5107C148.678 29.322 149.324 31.8483 149.324 35.0896C149.332 38.4414 148.676 41.065 147.356 42.9602H147.345Z\"\n fill=\"#201515\"\n />\n <path d=\"M39.0441 45.2253H0V54.789H39.0441V45.2253Z\" fill=\"#FF4F00\" />\n </svg>\n ),\n messenger: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <radialGradient\n id=\"8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1\"\n cx=\"11.087\"\n cy=\"7.022\"\n r=\"47.612\"\n gradientTransform=\"matrix(1 0 0 -1 0 50)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#1292ff\"></stop>\n <stop offset=\".079\" stopColor=\"#2982ff\"></stop>\n <stop offset=\".23\" stopColor=\"#4e69ff\"></stop>\n <stop offset=\".351\" stopColor=\"#6559ff\"></stop>\n <stop offset=\".428\" stopColor=\"#6d53ff\"></stop>\n <stop offset=\".754\" stopColor=\"#df47aa\"></stop>\n <stop offset=\".946\" stopColor=\"#ff6257\"></stop>\n </radialGradient>\n <path\n fill=\"url(#8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1)\"\n d=\"M44,23.5C44,34.27,35.05,43,24,43c-1.651,0-3.25-0.194-4.784-0.564\tc-0.465-0.112-0.951-0.069-1.379,0.145L13.46,44.77C12.33,45.335,11,44.513,11,43.249v-4.025c0-0.575-0.257-1.111-0.681-1.499\tC6.425,34.165,4,29.11,4,23.5C4,12.73,12.95,4,24,4S44,12.73,44,23.5z\"\n />\n <path\n d=\"M34.992,17.292c-0.428,0-0.843,0.142-1.2,0.411l-5.694,4.215\tc-0.133,0.1-0.28,0.15-0.435,0.15c-0.15,0-0.291-0.047-0.41-0.136l-3.972-2.99c-0.808-0.601-1.76-0.918-2.757-0.918\tc-1.576,0-3.025,0.791-3.876,2.116l-1.211,1.891l-4.12,6.695c-0.392,0.614-0.422,1.372-0.071,2.014\tc0.358,0.654,1.034,1.06,1.764,1.06c0.428,0,0.843-0.142,1.2-0.411l5.694-4.215c0.133-0.1,0.28-0.15,0.435-0.15\tc0.15,0,0.291,0.047,0.41,0.136l3.972,2.99c0.809,0.602,1.76,0.918,2.757,0.918c1.576,0,3.025-0.791,3.876-2.116l1.211-1.891\tl4.12-6.695c0.392-0.614,0.422-1.372,0.071-2.014C36.398,17.698,35.722,17.292,34.992,17.292L34.992,17.292z\"\n opacity=\".05\"\n />\n <path\n d=\"M34.992,17.792c-0.319,0-0.63,0.107-0.899,0.31l-5.697,4.218\tc-0.216,0.163-0.468,0.248-0.732,0.248c-0.259,0-0.504-0.082-0.71-0.236l-3.973-2.991c-0.719-0.535-1.568-0.817-2.457-0.817\tc-1.405,0-2.696,0.705-3.455,1.887l-1.21,1.891l-4.115,6.688c-0.297,0.465-0.32,1.033-0.058,1.511c0.266,0.486,0.787,0.8,1.325,0.8\tc0.319,0,0.63-0.107,0.899-0.31l5.697-4.218c0.216-0.163,0.468-0.248,0.732-0.248c0.259,0,0.504,0.082,0.71,0.236l3.973,2.991\tc0.719,0.535,1.568,0.817,2.457,0.817c1.405,0,2.696-0.705,3.455-1.887l1.21-1.891l4.115-6.688c0.297-0.465,0.32-1.033,0.058-1.511\tC36.051,18.106,35.531,17.792,34.992,17.792L34.992,17.792z\"\n opacity=\".07\"\n />\n <path\n fill=\"#ffffff\"\n d=\"M34.394,18.501l-5.7,4.22c-0.61,0.46-1.44,0.46-2.04,0.01L22.68,19.74\tc-1.68-1.25-4.06-0.82-5.19,0.94l-1.21,1.89l-4.11,6.68c-0.6,0.94,0.55,2.01,1.44,1.34l5.7-4.22c0.61-0.46,1.44-0.46,2.04-0.01\tl3.974,2.991c1.68,1.25,4.06,0.82,5.19-0.94l1.21-1.89l4.11-6.68C36.434,18.901,35.284,17.831,34.394,18.501z\"\n />\n </svg>\n ),\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-beam-multiple-inputs.json b/apps/www/public/r/animated-beam-multiple-inputs.json
index 5b7d6a0d..a472c2db 100644
--- a/apps/www/public/r/animated-beam-multiple-inputs.json
+++ b/apps/www/public/r/animated-beam-multiple-inputs.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-beam-multiple-inputs.tsx",
- "content": "\"use client\";\n\nimport React, { forwardRef, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\";\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"z-10 flex size-12 items-center justify-center rounded-full border-2 border-border bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className,\n )}\n >\n {children}\n </div>\n );\n});\n\nCircle.displayName = \"Circle\";\n\nexport default function AnimatedBeamMultipleOutputDemo({\n className,\n}: {\n className?: string;\n}) {\n const containerRef = useRef<HTMLDivElement>(null);\n const div1Ref = useRef<HTMLDivElement>(null);\n const div2Ref = useRef<HTMLDivElement>(null);\n const div3Ref = useRef<HTMLDivElement>(null);\n const div4Ref = useRef<HTMLDivElement>(null);\n const div5Ref = useRef<HTMLDivElement>(null);\n const div6Ref = useRef<HTMLDivElement>(null);\n const div7Ref = useRef<HTMLDivElement>(null);\n\n return (\n <div\n className={cn(\n \"relative flex h-[500px] w-full items-center justify-center overflow-hidden p-10\",\n className,\n )}\n ref={containerRef}\n >\n <div className=\"flex size-full max-w-lg flex-row items-stretch justify-between gap-10\">\n <div className=\"flex flex-col justify-center gap-2\">\n <Circle ref={div1Ref}>\n <Icons.googleDrive />\n </Circle>\n <Circle ref={div2Ref}>\n <Icons.googleDocs />\n </Circle>\n <Circle ref={div3Ref}>\n <Icons.whatsapp />\n </Circle>\n <Circle ref={div4Ref}>\n <Icons.messenger />\n </Circle>\n <Circle ref={div5Ref}>\n <Icons.notion />\n </Circle>\n </div>\n <div className=\"flex flex-col justify-center\">\n <Circle ref={div6Ref} className=\"size-16\">\n <Icons.openai />\n </Circle>\n </div>\n <div className=\"flex flex-col justify-center\">\n <Circle ref={div7Ref}>\n <Icons.user />\n </Circle>\n </div>\n </div>\n\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div2Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div3Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div4Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div5Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div6Ref}\n toRef={div7Ref}\n />\n </div>\n );\n}\n\nconst Icons = {\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n googleDocs: () => (\n <svg\n width=\"47px\"\n height=\"65px\"\n viewBox=\"0 0 47 65\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-1\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-3\"\n />\n <linearGradient\n x1=\"50.0053945%\"\n y1=\"8.58610612%\"\n x2=\"50.0053945%\"\n y2=\"100.013939%\"\n id=\"linearGradient-5\"\n >\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.2\" offset=\"0%\" />\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.02\" offset=\"100%\" />\n </linearGradient>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-6\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-8\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-10\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-12\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-14\"\n />\n <radialGradient\n cx=\"3.16804688%\"\n cy=\"2.71744318%\"\n fx=\"3.16804688%\"\n fy=\"2.71744318%\"\n r=\"161.248516%\"\n gradientTransform=\"translate(0.031680,0.027174),scale(1.000000,0.723077),translate(-0.031680,-0.027174)\"\n id=\"radialGradient-16\"\n >\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0.1\" offset=\"0%\" />\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0\" offset=\"100%\" />\n </radialGradient>\n </defs>\n <g\n id=\"Page-1\"\n stroke=\"none\"\n strokeWidth=\"1\"\n fill=\"none\"\n fillRule=\"evenodd\"\n >\n <g transform=\"translate(-451.000000, -463.000000)\">\n <g id=\"Hero\" transform=\"translate(0.000000, 63.000000)\">\n <g id=\"Personal\" transform=\"translate(277.000000, 309.000000)\">\n <g id=\"Docs-icon\" transform=\"translate(174.000000, 91.000000)\">\n <g id=\"Group\">\n <g id=\"Clipped\">\n <mask id=\"mask-2\" fill=\"white\">\n <use xlinkHref=\"#path-1\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L36.71875,10.3409091 L29.375,0 Z\"\n id=\"Path\"\n fill=\"#4285F4\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-2)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-4\" fill=\"white\">\n <use xlinkHref=\"#path-3\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <polygon\n id=\"Path\"\n fill=\"url(#linearGradient-5)\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-4)\"\n points=\"30.6638281 16.4309659 47 32.8582386 47 17.7272727\"\n ></polygon>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-7\" fill=\"white\">\n <use xlinkHref=\"#path-6\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M11.75,47.2727273 L35.25,47.2727273 L35.25,44.3181818 L11.75,44.3181818 L11.75,47.2727273 Z M11.75,53.1818182 L29.375,53.1818182 L29.375,50.2272727 L11.75,50.2272727 L11.75,53.1818182 Z M11.75,32.5 L11.75,35.4545455 L35.25,35.4545455 L35.25,32.5 L11.75,32.5 Z M11.75,41.3636364 L35.25,41.3636364 L35.25,38.4090909 L11.75,38.4090909 L11.75,41.3636364 Z\"\n id=\"Shape\"\n fill=\"#F1F1F1\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-7)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-9\" fill=\"white\">\n <use xlinkHref=\"#path-8\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <g id=\"Group\" mask=\"url(#mask-9)\">\n <g transform=\"translate(26.437500, -2.954545)\">\n <path\n d=\"M2.9375,2.95454545 L2.9375,16.25 C2.9375,18.6985795 4.90929688,20.6818182 7.34375,20.6818182 L20.5625,20.6818182 L2.9375,2.95454545 Z\"\n id=\"Path\"\n fill=\"#A1C2FA\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-11\" fill=\"white\">\n <use xlinkHref=\"#path-10\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,4.80113636 C0,2.36363636 1.9828125,0.369318182 4.40625,0.369318182 L29.375,0.369318182 L29.375,0 L4.40625,0 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#FFFFFF\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-11)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-13\" fill=\"white\">\n <use xlinkHref=\"#path-12\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M42.59375,64.6306818 L4.40625,64.6306818 C1.9828125,64.6306818 0,62.6363636 0,60.1988636 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,60.1988636 C47,62.6363636 45.0171875,64.6306818 42.59375,64.6306818 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-13)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-15\" fill=\"white\">\n <use xlinkHref=\"#path-14\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M33.78125,17.7272727 C31.3467969,17.7272727 29.375,15.7440341 29.375,13.2954545 L29.375,13.6647727 C29.375,16.1133523 31.3467969,18.0965909 33.78125,18.0965909 L47,18.0965909 L47,17.7272727 L33.78125,17.7272727 Z\"\n id=\"Path\"\n fillOpacity=\"0.1\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-15)\"\n />\n </g>\n </g>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"Path\"\n fill=\"url(#radialGradient-16)\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n ),\n zapier: () => (\n <svg\n width=\"105\"\n height=\"28\"\n viewBox=\"0 0 244 66\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M57.1877 45.2253L57.1534 45.1166L78.809 25.2914V15.7391H44.0663V25.2914H64.8181L64.8524 25.3829L43.4084 45.2253V54.7775H79.1579V45.2253H57.1877Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M100.487 14.8297C96.4797 14.8297 93.2136 15.434 90.6892 16.6429C88.3376 17.6963 86.3568 19.4321 85.0036 21.6249C83.7091 23.8321 82.8962 26.2883 82.6184 28.832L93.1602 30.3135C93.5415 28.0674 94.3042 26.4754 95.4482 25.5373C96.7486 24.5562 98.3511 24.0605 99.9783 24.136C102.118 24.136 103.67 24.7079 104.634 25.8519C105.59 26.9959 106.076 28.5803 106.076 30.6681V31.7091H95.9401C90.7807 31.7091 87.0742 32.8531 84.8206 35.1411C82.5669 37.429 81.442 40.4492 81.4458 44.2014C81.4458 48.0452 82.5707 50.9052 84.8206 52.7813C87.0704 54.6574 89.8999 55.5897 93.3089 55.5783C97.5379 55.5783 100.791 54.1235 103.067 51.214C104.412 49.426 105.372 47.3793 105.887 45.2024H106.27L107.723 54.7546H117.275V30.5651C117.275 25.5659 115.958 21.6936 113.323 18.948C110.688 16.2024 106.409 14.8297 100.487 14.8297ZM103.828 44.6475C102.312 45.9116 100.327 46.5408 97.8562 46.5408C95.8199 46.5408 94.4052 46.1843 93.6121 45.4712C93.2256 45.1338 92.9182 44.7155 92.7116 44.246C92.505 43.7764 92.4043 43.2671 92.4166 42.7543C92.3941 42.2706 92.4702 41.7874 92.6403 41.3341C92.8104 40.8808 93.071 40.4668 93.4062 40.1174C93.7687 39.7774 94.1964 39.5145 94.6633 39.3444C95.1303 39.1743 95.6269 39.1006 96.1231 39.1278H106.093V39.7856C106.113 40.7154 105.919 41.6374 105.527 42.4804C105.134 43.3234 104.553 44.0649 103.828 44.6475Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M175.035 15.7391H163.75V54.7833H175.035V15.7391Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M241.666 15.7391C238.478 15.7391 235.965 16.864 234.127 19.1139C232.808 20.7307 231.805 23.1197 231.119 26.2809H230.787L229.311 15.7391H219.673V54.7775H230.959V34.7578C230.959 32.2335 231.55 30.2982 232.732 28.9521C233.914 27.606 236.095 26.933 239.275 26.933H243.559V15.7391H241.666Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M208.473 17.0147C205.839 15.4474 202.515 14.6657 198.504 14.6695C192.189 14.6695 187.247 16.4675 183.678 20.0634C180.108 23.6593 178.324 28.6166 178.324 34.9352C178.233 38.7553 179.067 42.5407 180.755 45.9689C182.3 49.0238 184.706 51.5592 187.676 53.2618C190.665 54.9892 194.221 55.8548 198.344 55.8586C201.909 55.8586 204.887 55.3095 207.278 54.2113C209.526 53.225 211.483 51.6791 212.964 49.7211C214.373 47.7991 215.42 45.6359 216.052 43.3377L206.329 40.615C205.919 42.1094 205.131 43.4728 204.041 44.5732C202.942 45.6714 201.102 46.2206 198.521 46.2206C195.451 46.2206 193.163 45.3416 191.657 43.5837C190.564 42.3139 189.878 40.5006 189.575 38.1498H216.201C216.31 37.0515 216.367 36.1306 216.367 35.387V32.9561C216.431 29.6903 215.757 26.4522 214.394 23.4839C213.118 20.7799 211.054 18.5248 208.473 17.0147ZM198.178 23.9758C202.754 23.9758 205.348 26.2275 205.962 30.731H189.775C190.032 29.2284 190.655 27.8121 191.588 26.607C193.072 24.8491 195.268 23.972 198.178 23.9758Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M169.515 0.00366253C168.666 -0.0252113 167.82 0.116874 167.027 0.421484C166.234 0.726094 165.511 1.187 164.899 1.77682C164.297 2.3723 163.824 3.08658 163.512 3.87431C163.2 4.66204 163.055 5.50601 163.086 6.35275C163.056 7.20497 163.201 8.05433 163.514 8.84781C163.826 9.64129 164.299 10.3619 164.902 10.9646C165.505 11.5673 166.226 12.0392 167.02 12.3509C167.814 12.6626 168.663 12.8074 169.515 12.7762C170.362 12.8082 171.206 12.6635 171.994 12.3514C172.782 12.0392 173.496 11.5664 174.091 10.963C174.682 10.3534 175.142 9.63077 175.446 8.83849C175.75 8.04621 175.89 7.20067 175.859 6.35275C175.898 5.50985 175.761 4.66806 175.456 3.88115C175.151 3.09424 174.686 2.37951 174.09 1.78258C173.493 1.18565 172.779 0.719644 171.992 0.414327C171.206 0.109011 170.364 -0.0288946 169.521 0.00938803L169.515 0.00366253Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M146.201 14.6695C142.357 14.6695 139.268 15.8764 136.935 18.2902C135.207 20.0786 133.939 22.7479 133.131 26.2981H132.771L131.295 15.7563H121.657V66H132.942V45.3054H133.354C133.698 46.6852 134.181 48.0267 134.795 49.3093C135.75 51.3986 137.316 53.1496 139.286 54.3314C141.328 55.446 143.629 56.0005 145.955 55.9387C150.68 55.9387 154.277 54.0988 156.748 50.419C159.219 46.7392 160.455 41.6046 160.455 35.0153C160.455 28.6509 159.259 23.6689 156.869 20.0691C154.478 16.4694 150.922 14.6695 146.201 14.6695ZM147.345 42.9602C146.029 44.8668 143.97 45.8201 141.167 45.8201C140.012 45.8735 138.86 45.6507 137.808 45.1703C136.755 44.6898 135.832 43.9656 135.116 43.0574C133.655 41.2233 132.927 38.7122 132.931 35.5243V34.7807C132.931 31.5432 133.659 29.0646 135.116 27.3448C136.572 25.625 138.59 24.7747 141.167 24.7937C144.02 24.7937 146.092 25.6994 147.385 27.5107C148.678 29.322 149.324 31.8483 149.324 35.0896C149.332 38.4414 148.676 41.065 147.356 42.9602H147.345Z\"\n fill=\"#201515\"\n />\n <path d=\"M39.0441 45.2253H0V54.789H39.0441V45.2253Z\" fill=\"#FF4F00\" />\n </svg>\n ),\n messenger: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <radialGradient\n id=\"8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1\"\n cx=\"11.087\"\n cy=\"7.022\"\n r=\"47.612\"\n gradientTransform=\"matrix(1 0 0 -1 0 50)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#1292ff\"></stop>\n <stop offset=\".079\" stopColor=\"#2982ff\"></stop>\n <stop offset=\".23\" stopColor=\"#4e69ff\"></stop>\n <stop offset=\".351\" stopColor=\"#6559ff\"></stop>\n <stop offset=\".428\" stopColor=\"#6d53ff\"></stop>\n <stop offset=\".754\" stopColor=\"#df47aa\"></stop>\n <stop offset=\".946\" stopColor=\"#ff6257\"></stop>\n </radialGradient>\n <path\n fill=\"url(#8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1)\"\n d=\"M44,23.5C44,34.27,35.05,43,24,43c-1.651,0-3.25-0.194-4.784-0.564\tc-0.465-0.112-0.951-0.069-1.379,0.145L13.46,44.77C12.33,45.335,11,44.513,11,43.249v-4.025c0-0.575-0.257-1.111-0.681-1.499\tC6.425,34.165,4,29.11,4,23.5C4,12.73,12.95,4,24,4S44,12.73,44,23.5z\"\n />\n <path\n d=\"M34.992,17.292c-0.428,0-0.843,0.142-1.2,0.411l-5.694,4.215\tc-0.133,0.1-0.28,0.15-0.435,0.15c-0.15,0-0.291-0.047-0.41-0.136l-3.972-2.99c-0.808-0.601-1.76-0.918-2.757-0.918\tc-1.576,0-3.025,0.791-3.876,2.116l-1.211,1.891l-4.12,6.695c-0.392,0.614-0.422,1.372-0.071,2.014\tc0.358,0.654,1.034,1.06,1.764,1.06c0.428,0,0.843-0.142,1.2-0.411l5.694-4.215c0.133-0.1,0.28-0.15,0.435-0.15\tc0.15,0,0.291,0.047,0.41,0.136l3.972,2.99c0.809,0.602,1.76,0.918,2.757,0.918c1.576,0,3.025-0.791,3.876-2.116l1.211-1.891\tl4.12-6.695c0.392-0.614,0.422-1.372,0.071-2.014C36.398,17.698,35.722,17.292,34.992,17.292L34.992,17.292z\"\n opacity=\".05\"\n />\n <path\n d=\"M34.992,17.792c-0.319,0-0.63,0.107-0.899,0.31l-5.697,4.218\tc-0.216,0.163-0.468,0.248-0.732,0.248c-0.259,0-0.504-0.082-0.71-0.236l-3.973-2.991c-0.719-0.535-1.568-0.817-2.457-0.817\tc-1.405,0-2.696,0.705-3.455,1.887l-1.21,1.891l-4.115,6.688c-0.297,0.465-0.32,1.033-0.058,1.511c0.266,0.486,0.787,0.8,1.325,0.8\tc0.319,0,0.63-0.107,0.899-0.31l5.697-4.218c0.216-0.163,0.468-0.248,0.732-0.248c0.259,0,0.504,0.082,0.71,0.236l3.973,2.991\tc0.719,0.535,1.568,0.817,2.457,0.817c1.405,0,2.696-0.705,3.455-1.887l1.21-1.891l4.115-6.688c0.297-0.465,0.32-1.033,0.058-1.511\tC36.051,18.106,35.531,17.792,34.992,17.792L34.992,17.792z\"\n opacity=\".07\"\n />\n <path\n fill=\"#ffffff\"\n d=\"M34.394,18.501l-5.7,4.22c-0.61,0.46-1.44,0.46-2.04,0.01L22.68,19.74\tc-1.68-1.25-4.06-0.82-5.19,0.94l-1.21,1.89l-4.11,6.68c-0.6,0.94,0.55,2.01,1.44,1.34l5.7-4.22c0.61-0.46,1.44-0.46,2.04-0.01\tl3.974,2.991c1.68,1.25,4.06,0.82,5.19-0.94l1.21-1.89l4.11-6.68C36.434,18.901,35.284,17.831,34.394,18.501z\"\n />\n </svg>\n ),\n user: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"#000000\"\n strokeWidth=\"2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n ),\n};\n",
+ "content": "\"use client\"\n\nimport React, { forwardRef, useRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\"\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"border-border z-10 flex size-12 items-center justify-center rounded-full border-2 bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className\n )}\n >\n {children}\n </div>\n )\n})\n\nCircle.displayName = \"Circle\"\n\nexport default function AnimatedBeamMultipleOutputDemo({\n className,\n}: {\n className?: string\n}) {\n const containerRef = useRef<HTMLDivElement>(null)\n const div1Ref = useRef<HTMLDivElement>(null)\n const div2Ref = useRef<HTMLDivElement>(null)\n const div3Ref = useRef<HTMLDivElement>(null)\n const div4Ref = useRef<HTMLDivElement>(null)\n const div5Ref = useRef<HTMLDivElement>(null)\n const div6Ref = useRef<HTMLDivElement>(null)\n const div7Ref = useRef<HTMLDivElement>(null)\n\n return (\n <div\n className={cn(\n \"relative flex h-[500px] w-full items-center justify-center overflow-hidden p-10\",\n className\n )}\n ref={containerRef}\n >\n <div className=\"flex size-full max-w-lg flex-row items-stretch justify-between gap-10\">\n <div className=\"flex flex-col justify-center gap-2\">\n <Circle ref={div1Ref}>\n <Icons.googleDrive />\n </Circle>\n <Circle ref={div2Ref}>\n <Icons.googleDocs />\n </Circle>\n <Circle ref={div3Ref}>\n <Icons.whatsapp />\n </Circle>\n <Circle ref={div4Ref}>\n <Icons.messenger />\n </Circle>\n <Circle ref={div5Ref}>\n <Icons.notion />\n </Circle>\n </div>\n <div className=\"flex flex-col justify-center\">\n <Circle ref={div6Ref} className=\"size-16\">\n <Icons.openai />\n </Circle>\n </div>\n <div className=\"flex flex-col justify-center\">\n <Circle ref={div7Ref}>\n <Icons.user />\n </Circle>\n </div>\n </div>\n\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div2Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div3Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div4Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div5Ref}\n toRef={div6Ref}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div6Ref}\n toRef={div7Ref}\n />\n </div>\n )\n}\n\nconst Icons = {\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n googleDocs: () => (\n <svg\n width=\"47px\"\n height=\"65px\"\n viewBox=\"0 0 47 65\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-1\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-3\"\n />\n <linearGradient\n x1=\"50.0053945%\"\n y1=\"8.58610612%\"\n x2=\"50.0053945%\"\n y2=\"100.013939%\"\n id=\"linearGradient-5\"\n >\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.2\" offset=\"0%\" />\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.02\" offset=\"100%\" />\n </linearGradient>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-6\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-8\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-10\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-12\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-14\"\n />\n <radialGradient\n cx=\"3.16804688%\"\n cy=\"2.71744318%\"\n fx=\"3.16804688%\"\n fy=\"2.71744318%\"\n r=\"161.248516%\"\n gradientTransform=\"translate(0.031680,0.027174),scale(1.000000,0.723077),translate(-0.031680,-0.027174)\"\n id=\"radialGradient-16\"\n >\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0.1\" offset=\"0%\" />\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0\" offset=\"100%\" />\n </radialGradient>\n </defs>\n <g\n id=\"Page-1\"\n stroke=\"none\"\n strokeWidth=\"1\"\n fill=\"none\"\n fillRule=\"evenodd\"\n >\n <g transform=\"translate(-451.000000, -463.000000)\">\n <g id=\"Hero\" transform=\"translate(0.000000, 63.000000)\">\n <g id=\"Personal\" transform=\"translate(277.000000, 309.000000)\">\n <g id=\"Docs-icon\" transform=\"translate(174.000000, 91.000000)\">\n <g id=\"Group\">\n <g id=\"Clipped\">\n <mask id=\"mask-2\" fill=\"white\">\n <use xlinkHref=\"#path-1\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L36.71875,10.3409091 L29.375,0 Z\"\n id=\"Path\"\n fill=\"#4285F4\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-2)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-4\" fill=\"white\">\n <use xlinkHref=\"#path-3\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <polygon\n id=\"Path\"\n fill=\"url(#linearGradient-5)\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-4)\"\n points=\"30.6638281 16.4309659 47 32.8582386 47 17.7272727\"\n ></polygon>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-7\" fill=\"white\">\n <use xlinkHref=\"#path-6\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M11.75,47.2727273 L35.25,47.2727273 L35.25,44.3181818 L11.75,44.3181818 L11.75,47.2727273 Z M11.75,53.1818182 L29.375,53.1818182 L29.375,50.2272727 L11.75,50.2272727 L11.75,53.1818182 Z M11.75,32.5 L11.75,35.4545455 L35.25,35.4545455 L35.25,32.5 L11.75,32.5 Z M11.75,41.3636364 L35.25,41.3636364 L35.25,38.4090909 L11.75,38.4090909 L11.75,41.3636364 Z\"\n id=\"Shape\"\n fill=\"#F1F1F1\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-7)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-9\" fill=\"white\">\n <use xlinkHref=\"#path-8\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <g id=\"Group\" mask=\"url(#mask-9)\">\n <g transform=\"translate(26.437500, -2.954545)\">\n <path\n d=\"M2.9375,2.95454545 L2.9375,16.25 C2.9375,18.6985795 4.90929688,20.6818182 7.34375,20.6818182 L20.5625,20.6818182 L2.9375,2.95454545 Z\"\n id=\"Path\"\n fill=\"#A1C2FA\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-11\" fill=\"white\">\n <use xlinkHref=\"#path-10\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,4.80113636 C0,2.36363636 1.9828125,0.369318182 4.40625,0.369318182 L29.375,0.369318182 L29.375,0 L4.40625,0 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#FFFFFF\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-11)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-13\" fill=\"white\">\n <use xlinkHref=\"#path-12\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M42.59375,64.6306818 L4.40625,64.6306818 C1.9828125,64.6306818 0,62.6363636 0,60.1988636 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,60.1988636 C47,62.6363636 45.0171875,64.6306818 42.59375,64.6306818 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-13)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-15\" fill=\"white\">\n <use xlinkHref=\"#path-14\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M33.78125,17.7272727 C31.3467969,17.7272727 29.375,15.7440341 29.375,13.2954545 L29.375,13.6647727 C29.375,16.1133523 31.3467969,18.0965909 33.78125,18.0965909 L47,18.0965909 L47,17.7272727 L33.78125,17.7272727 Z\"\n id=\"Path\"\n fillOpacity=\"0.1\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-15)\"\n />\n </g>\n </g>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"Path\"\n fill=\"url(#radialGradient-16)\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n ),\n zapier: () => (\n <svg\n width=\"105\"\n height=\"28\"\n viewBox=\"0 0 244 66\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M57.1877 45.2253L57.1534 45.1166L78.809 25.2914V15.7391H44.0663V25.2914H64.8181L64.8524 25.3829L43.4084 45.2253V54.7775H79.1579V45.2253H57.1877Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M100.487 14.8297C96.4797 14.8297 93.2136 15.434 90.6892 16.6429C88.3376 17.6963 86.3568 19.4321 85.0036 21.6249C83.7091 23.8321 82.8962 26.2883 82.6184 28.832L93.1602 30.3135C93.5415 28.0674 94.3042 26.4754 95.4482 25.5373C96.7486 24.5562 98.3511 24.0605 99.9783 24.136C102.118 24.136 103.67 24.7079 104.634 25.8519C105.59 26.9959 106.076 28.5803 106.076 30.6681V31.7091H95.9401C90.7807 31.7091 87.0742 32.8531 84.8206 35.1411C82.5669 37.429 81.442 40.4492 81.4458 44.2014C81.4458 48.0452 82.5707 50.9052 84.8206 52.7813C87.0704 54.6574 89.8999 55.5897 93.3089 55.5783C97.5379 55.5783 100.791 54.1235 103.067 51.214C104.412 49.426 105.372 47.3793 105.887 45.2024H106.27L107.723 54.7546H117.275V30.5651C117.275 25.5659 115.958 21.6936 113.323 18.948C110.688 16.2024 106.409 14.8297 100.487 14.8297ZM103.828 44.6475C102.312 45.9116 100.327 46.5408 97.8562 46.5408C95.8199 46.5408 94.4052 46.1843 93.6121 45.4712C93.2256 45.1338 92.9182 44.7155 92.7116 44.246C92.505 43.7764 92.4043 43.2671 92.4166 42.7543C92.3941 42.2706 92.4702 41.7874 92.6403 41.3341C92.8104 40.8808 93.071 40.4668 93.4062 40.1174C93.7687 39.7774 94.1964 39.5145 94.6633 39.3444C95.1303 39.1743 95.6269 39.1006 96.1231 39.1278H106.093V39.7856C106.113 40.7154 105.919 41.6374 105.527 42.4804C105.134 43.3234 104.553 44.0649 103.828 44.6475Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M175.035 15.7391H163.75V54.7833H175.035V15.7391Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M241.666 15.7391C238.478 15.7391 235.965 16.864 234.127 19.1139C232.808 20.7307 231.805 23.1197 231.119 26.2809H230.787L229.311 15.7391H219.673V54.7775H230.959V34.7578C230.959 32.2335 231.55 30.2982 232.732 28.9521C233.914 27.606 236.095 26.933 239.275 26.933H243.559V15.7391H241.666Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M208.473 17.0147C205.839 15.4474 202.515 14.6657 198.504 14.6695C192.189 14.6695 187.247 16.4675 183.678 20.0634C180.108 23.6593 178.324 28.6166 178.324 34.9352C178.233 38.7553 179.067 42.5407 180.755 45.9689C182.3 49.0238 184.706 51.5592 187.676 53.2618C190.665 54.9892 194.221 55.8548 198.344 55.8586C201.909 55.8586 204.887 55.3095 207.278 54.2113C209.526 53.225 211.483 51.6791 212.964 49.7211C214.373 47.7991 215.42 45.6359 216.052 43.3377L206.329 40.615C205.919 42.1094 205.131 43.4728 204.041 44.5732C202.942 45.6714 201.102 46.2206 198.521 46.2206C195.451 46.2206 193.163 45.3416 191.657 43.5837C190.564 42.3139 189.878 40.5006 189.575 38.1498H216.201C216.31 37.0515 216.367 36.1306 216.367 35.387V32.9561C216.431 29.6903 215.757 26.4522 214.394 23.4839C213.118 20.7799 211.054 18.5248 208.473 17.0147ZM198.178 23.9758C202.754 23.9758 205.348 26.2275 205.962 30.731H189.775C190.032 29.2284 190.655 27.8121 191.588 26.607C193.072 24.8491 195.268 23.972 198.178 23.9758Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M169.515 0.00366253C168.666 -0.0252113 167.82 0.116874 167.027 0.421484C166.234 0.726094 165.511 1.187 164.899 1.77682C164.297 2.3723 163.824 3.08658 163.512 3.87431C163.2 4.66204 163.055 5.50601 163.086 6.35275C163.056 7.20497 163.201 8.05433 163.514 8.84781C163.826 9.64129 164.299 10.3619 164.902 10.9646C165.505 11.5673 166.226 12.0392 167.02 12.3509C167.814 12.6626 168.663 12.8074 169.515 12.7762C170.362 12.8082 171.206 12.6635 171.994 12.3514C172.782 12.0392 173.496 11.5664 174.091 10.963C174.682 10.3534 175.142 9.63077 175.446 8.83849C175.75 8.04621 175.89 7.20067 175.859 6.35275C175.898 5.50985 175.761 4.66806 175.456 3.88115C175.151 3.09424 174.686 2.37951 174.09 1.78258C173.493 1.18565 172.779 0.719644 171.992 0.414327C171.206 0.109011 170.364 -0.0288946 169.521 0.00938803L169.515 0.00366253Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M146.201 14.6695C142.357 14.6695 139.268 15.8764 136.935 18.2902C135.207 20.0786 133.939 22.7479 133.131 26.2981H132.771L131.295 15.7563H121.657V66H132.942V45.3054H133.354C133.698 46.6852 134.181 48.0267 134.795 49.3093C135.75 51.3986 137.316 53.1496 139.286 54.3314C141.328 55.446 143.629 56.0005 145.955 55.9387C150.68 55.9387 154.277 54.0988 156.748 50.419C159.219 46.7392 160.455 41.6046 160.455 35.0153C160.455 28.6509 159.259 23.6689 156.869 20.0691C154.478 16.4694 150.922 14.6695 146.201 14.6695ZM147.345 42.9602C146.029 44.8668 143.97 45.8201 141.167 45.8201C140.012 45.8735 138.86 45.6507 137.808 45.1703C136.755 44.6898 135.832 43.9656 135.116 43.0574C133.655 41.2233 132.927 38.7122 132.931 35.5243V34.7807C132.931 31.5432 133.659 29.0646 135.116 27.3448C136.572 25.625 138.59 24.7747 141.167 24.7937C144.02 24.7937 146.092 25.6994 147.385 27.5107C148.678 29.322 149.324 31.8483 149.324 35.0896C149.332 38.4414 148.676 41.065 147.356 42.9602H147.345Z\"\n fill=\"#201515\"\n />\n <path d=\"M39.0441 45.2253H0V54.789H39.0441V45.2253Z\" fill=\"#FF4F00\" />\n </svg>\n ),\n messenger: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <radialGradient\n id=\"8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1\"\n cx=\"11.087\"\n cy=\"7.022\"\n r=\"47.612\"\n gradientTransform=\"matrix(1 0 0 -1 0 50)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#1292ff\"></stop>\n <stop offset=\".079\" stopColor=\"#2982ff\"></stop>\n <stop offset=\".23\" stopColor=\"#4e69ff\"></stop>\n <stop offset=\".351\" stopColor=\"#6559ff\"></stop>\n <stop offset=\".428\" stopColor=\"#6d53ff\"></stop>\n <stop offset=\".754\" stopColor=\"#df47aa\"></stop>\n <stop offset=\".946\" stopColor=\"#ff6257\"></stop>\n </radialGradient>\n <path\n fill=\"url(#8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1)\"\n d=\"M44,23.5C44,34.27,35.05,43,24,43c-1.651,0-3.25-0.194-4.784-0.564\tc-0.465-0.112-0.951-0.069-1.379,0.145L13.46,44.77C12.33,45.335,11,44.513,11,43.249v-4.025c0-0.575-0.257-1.111-0.681-1.499\tC6.425,34.165,4,29.11,4,23.5C4,12.73,12.95,4,24,4S44,12.73,44,23.5z\"\n />\n <path\n d=\"M34.992,17.292c-0.428,0-0.843,0.142-1.2,0.411l-5.694,4.215\tc-0.133,0.1-0.28,0.15-0.435,0.15c-0.15,0-0.291-0.047-0.41-0.136l-3.972-2.99c-0.808-0.601-1.76-0.918-2.757-0.918\tc-1.576,0-3.025,0.791-3.876,2.116l-1.211,1.891l-4.12,6.695c-0.392,0.614-0.422,1.372-0.071,2.014\tc0.358,0.654,1.034,1.06,1.764,1.06c0.428,0,0.843-0.142,1.2-0.411l5.694-4.215c0.133-0.1,0.28-0.15,0.435-0.15\tc0.15,0,0.291,0.047,0.41,0.136l3.972,2.99c0.809,0.602,1.76,0.918,2.757,0.918c1.576,0,3.025-0.791,3.876-2.116l1.211-1.891\tl4.12-6.695c0.392-0.614,0.422-1.372,0.071-2.014C36.398,17.698,35.722,17.292,34.992,17.292L34.992,17.292z\"\n opacity=\".05\"\n />\n <path\n d=\"M34.992,17.792c-0.319,0-0.63,0.107-0.899,0.31l-5.697,4.218\tc-0.216,0.163-0.468,0.248-0.732,0.248c-0.259,0-0.504-0.082-0.71-0.236l-3.973-2.991c-0.719-0.535-1.568-0.817-2.457-0.817\tc-1.405,0-2.696,0.705-3.455,1.887l-1.21,1.891l-4.115,6.688c-0.297,0.465-0.32,1.033-0.058,1.511c0.266,0.486,0.787,0.8,1.325,0.8\tc0.319,0,0.63-0.107,0.899-0.31l5.697-4.218c0.216-0.163,0.468-0.248,0.732-0.248c0.259,0,0.504,0.082,0.71,0.236l3.973,2.991\tc0.719,0.535,1.568,0.817,2.457,0.817c1.405,0,2.696-0.705,3.455-1.887l1.21-1.891l4.115-6.688c0.297-0.465,0.32-1.033,0.058-1.511\tC36.051,18.106,35.531,17.792,34.992,17.792L34.992,17.792z\"\n opacity=\".07\"\n />\n <path\n fill=\"#ffffff\"\n d=\"M34.394,18.501l-5.7,4.22c-0.61,0.46-1.44,0.46-2.04,0.01L22.68,19.74\tc-1.68-1.25-4.06-0.82-5.19,0.94l-1.21,1.89l-4.11,6.68c-0.6,0.94,0.55,2.01,1.44,1.34l5.7-4.22c0.61-0.46,1.44-0.46,2.04-0.01\tl3.974,2.991c1.68,1.25,4.06,0.82,5.19-0.94l1.21-1.89l4.11-6.68C36.434,18.901,35.284,17.831,34.394,18.501z\"\n />\n </svg>\n ),\n user: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"#000000\"\n strokeWidth=\"2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n ),\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-beam-multiple-outputs.json b/apps/www/public/r/animated-beam-multiple-outputs.json
index 15ce0d34..0af9bfd4 100644
--- a/apps/www/public/r/animated-beam-multiple-outputs.json
+++ b/apps/www/public/r/animated-beam-multiple-outputs.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-beam-multiple-outputs.tsx",
- "content": "\"use client\";\n\nimport React, { forwardRef, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\";\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"z-10 flex size-12 items-center justify-center rounded-full border-2 bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className,\n )}\n >\n {children}\n </div>\n );\n});\n\nCircle.displayName = \"Circle\";\n\nexport default function AnimatedBeamMultipleOutputDemo({\n className,\n}: {\n className?: string;\n}) {\n const containerRef = useRef<HTMLDivElement>(null);\n const div1Ref = useRef<HTMLDivElement>(null);\n const div2Ref = useRef<HTMLDivElement>(null);\n const div3Ref = useRef<HTMLDivElement>(null);\n const div4Ref = useRef<HTMLDivElement>(null);\n const div5Ref = useRef<HTMLDivElement>(null);\n const div6Ref = useRef<HTMLDivElement>(null);\n const div7Ref = useRef<HTMLDivElement>(null);\n\n return (\n <div\n className={cn(\n \"relative flex h-[500px] w-full items-center justify-center overflow-hidden p-10\",\n className,\n )}\n ref={containerRef}\n >\n <div className=\"flex size-full max-w-lg flex-row items-stretch justify-between gap-10\">\n <div className=\"flex flex-col justify-center\">\n <Circle ref={div7Ref}>\n <Icons.user />\n </Circle>\n </div>\n <div className=\"flex flex-col justify-center\">\n <Circle ref={div6Ref} className=\"size-16\">\n <Icons.openai />\n </Circle>\n </div>\n <div className=\"flex flex-col justify-center gap-2\">\n <Circle ref={div1Ref}>\n <Icons.googleDrive />\n </Circle>\n <Circle ref={div2Ref}>\n <Icons.googleDocs />\n </Circle>\n <Circle ref={div3Ref}>\n <Icons.whatsapp />\n </Circle>\n <Circle ref={div4Ref}>\n <Icons.messenger />\n </Circle>\n <Circle ref={div5Ref}>\n <Icons.notion />\n </Circle>\n </div>\n </div>\n\n {/* AnimatedBeams */}\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div2Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div3Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div4Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div5Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div6Ref}\n toRef={div7Ref}\n duration={3}\n />\n </div>\n );\n}\n\nconst Icons = {\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n googleDocs: () => (\n <svg\n width=\"47px\"\n height=\"65px\"\n viewBox=\"0 0 47 65\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-1\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-3\"\n />\n <linearGradient\n x1=\"50.0053945%\"\n y1=\"8.58610612%\"\n x2=\"50.0053945%\"\n y2=\"100.013939%\"\n id=\"linearGradient-5\"\n >\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.2\" offset=\"0%\" />\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.02\" offset=\"100%\" />\n </linearGradient>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-6\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-8\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-10\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-12\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-14\"\n />\n <radialGradient\n cx=\"3.16804688%\"\n cy=\"2.71744318%\"\n fx=\"3.16804688%\"\n fy=\"2.71744318%\"\n r=\"161.248516%\"\n gradientTransform=\"translate(0.031680,0.027174),scale(1.000000,0.723077),translate(-0.031680,-0.027174)\"\n id=\"radialGradient-16\"\n >\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0.1\" offset=\"0%\" />\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0\" offset=\"100%\" />\n </radialGradient>\n </defs>\n <g\n id=\"Page-1\"\n stroke=\"none\"\n strokeWidth=\"1\"\n fill=\"none\"\n fillRule=\"evenodd\"\n >\n <g transform=\"translate(-451.000000, -463.000000)\">\n <g id=\"Hero\" transform=\"translate(0.000000, 63.000000)\">\n <g id=\"Personal\" transform=\"translate(277.000000, 309.000000)\">\n <g id=\"Docs-icon\" transform=\"translate(174.000000, 91.000000)\">\n <g id=\"Group\">\n <g id=\"Clipped\">\n <mask id=\"mask-2\" fill=\"white\">\n <use xlinkHref=\"#path-1\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L36.71875,10.3409091 L29.375,0 Z\"\n id=\"Path\"\n fill=\"#4285F4\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-2)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-4\" fill=\"white\">\n <use xlinkHref=\"#path-3\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <polygon\n id=\"Path\"\n fill=\"url(#linearGradient-5)\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-4)\"\n points=\"30.6638281 16.4309659 47 32.8582386 47 17.7272727\"\n ></polygon>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-7\" fill=\"white\">\n <use xlinkHref=\"#path-6\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M11.75,47.2727273 L35.25,47.2727273 L35.25,44.3181818 L11.75,44.3181818 L11.75,47.2727273 Z M11.75,53.1818182 L29.375,53.1818182 L29.375,50.2272727 L11.75,50.2272727 L11.75,53.1818182 Z M11.75,32.5 L11.75,35.4545455 L35.25,35.4545455 L35.25,32.5 L11.75,32.5 Z M11.75,41.3636364 L35.25,41.3636364 L35.25,38.4090909 L11.75,38.4090909 L11.75,41.3636364 Z\"\n id=\"Shape\"\n fill=\"#F1F1F1\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-7)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-9\" fill=\"white\">\n <use xlinkHref=\"#path-8\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <g id=\"Group\" mask=\"url(#mask-9)\">\n <g transform=\"translate(26.437500, -2.954545)\">\n <path\n d=\"M2.9375,2.95454545 L2.9375,16.25 C2.9375,18.6985795 4.90929688,20.6818182 7.34375,20.6818182 L20.5625,20.6818182 L2.9375,2.95454545 Z\"\n id=\"Path\"\n fill=\"#A1C2FA\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-11\" fill=\"white\">\n <use xlinkHref=\"#path-10\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,4.80113636 C0,2.36363636 1.9828125,0.369318182 4.40625,0.369318182 L29.375,0.369318182 L29.375,0 L4.40625,0 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#FFFFFF\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-11)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-13\" fill=\"white\">\n <use xlinkHref=\"#path-12\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M42.59375,64.6306818 L4.40625,64.6306818 C1.9828125,64.6306818 0,62.6363636 0,60.1988636 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,60.1988636 C47,62.6363636 45.0171875,64.6306818 42.59375,64.6306818 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-13)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-15\" fill=\"white\">\n <use xlinkHref=\"#path-14\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M33.78125,17.7272727 C31.3467969,17.7272727 29.375,15.7440341 29.375,13.2954545 L29.375,13.6647727 C29.375,16.1133523 31.3467969,18.0965909 33.78125,18.0965909 L47,18.0965909 L47,17.7272727 L33.78125,17.7272727 Z\"\n id=\"Path\"\n fillOpacity=\"0.1\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-15)\"\n />\n </g>\n </g>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"Path\"\n fill=\"url(#radialGradient-16)\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n ),\n zapier: () => (\n <svg\n width=\"105\"\n height=\"28\"\n viewBox=\"0 0 244 66\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M57.1877 45.2253L57.1534 45.1166L78.809 25.2914V15.7391H44.0663V25.2914H64.8181L64.8524 25.3829L43.4084 45.2253V54.7775H79.1579V45.2253H57.1877Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M100.487 14.8297C96.4797 14.8297 93.2136 15.434 90.6892 16.6429C88.3376 17.6963 86.3568 19.4321 85.0036 21.6249C83.7091 23.8321 82.8962 26.2883 82.6184 28.832L93.1602 30.3135C93.5415 28.0674 94.3042 26.4754 95.4482 25.5373C96.7486 24.5562 98.3511 24.0605 99.9783 24.136C102.118 24.136 103.67 24.7079 104.634 25.8519C105.59 26.9959 106.076 28.5803 106.076 30.6681V31.7091H95.9401C90.7807 31.7091 87.0742 32.8531 84.8206 35.1411C82.5669 37.429 81.442 40.4492 81.4458 44.2014C81.4458 48.0452 82.5707 50.9052 84.8206 52.7813C87.0704 54.6574 89.8999 55.5897 93.3089 55.5783C97.5379 55.5783 100.791 54.1235 103.067 51.214C104.412 49.426 105.372 47.3793 105.887 45.2024H106.27L107.723 54.7546H117.275V30.5651C117.275 25.5659 115.958 21.6936 113.323 18.948C110.688 16.2024 106.409 14.8297 100.487 14.8297ZM103.828 44.6475C102.312 45.9116 100.327 46.5408 97.8562 46.5408C95.8199 46.5408 94.4052 46.1843 93.6121 45.4712C93.2256 45.1338 92.9182 44.7155 92.7116 44.246C92.505 43.7764 92.4043 43.2671 92.4166 42.7543C92.3941 42.2706 92.4702 41.7874 92.6403 41.3341C92.8104 40.8808 93.071 40.4668 93.4062 40.1174C93.7687 39.7774 94.1964 39.5145 94.6633 39.3444C95.1303 39.1743 95.6269 39.1006 96.1231 39.1278H106.093V39.7856C106.113 40.7154 105.919 41.6374 105.527 42.4804C105.134 43.3234 104.553 44.0649 103.828 44.6475Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M175.035 15.7391H163.75V54.7833H175.035V15.7391Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M241.666 15.7391C238.478 15.7391 235.965 16.864 234.127 19.1139C232.808 20.7307 231.805 23.1197 231.119 26.2809H230.787L229.311 15.7391H219.673V54.7775H230.959V34.7578C230.959 32.2335 231.55 30.2982 232.732 28.9521C233.914 27.606 236.095 26.933 239.275 26.933H243.559V15.7391H241.666Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M208.473 17.0147C205.839 15.4474 202.515 14.6657 198.504 14.6695C192.189 14.6695 187.247 16.4675 183.678 20.0634C180.108 23.6593 178.324 28.6166 178.324 34.9352C178.233 38.7553 179.067 42.5407 180.755 45.9689C182.3 49.0238 184.706 51.5592 187.676 53.2618C190.665 54.9892 194.221 55.8548 198.344 55.8586C201.909 55.8586 204.887 55.3095 207.278 54.2113C209.526 53.225 211.483 51.6791 212.964 49.7211C214.373 47.7991 215.42 45.6359 216.052 43.3377L206.329 40.615C205.919 42.1094 205.131 43.4728 204.041 44.5732C202.942 45.6714 201.102 46.2206 198.521 46.2206C195.451 46.2206 193.163 45.3416 191.657 43.5837C190.564 42.3139 189.878 40.5006 189.575 38.1498H216.201C216.31 37.0515 216.367 36.1306 216.367 35.387V32.9561C216.431 29.6903 215.757 26.4522 214.394 23.4839C213.118 20.7799 211.054 18.5248 208.473 17.0147ZM198.178 23.9758C202.754 23.9758 205.348 26.2275 205.962 30.731H189.775C190.032 29.2284 190.655 27.8121 191.588 26.607C193.072 24.8491 195.268 23.972 198.178 23.9758Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M169.515 0.00366253C168.666 -0.0252113 167.82 0.116874 167.027 0.421484C166.234 0.726094 165.511 1.187 164.899 1.77682C164.297 2.3723 163.824 3.08658 163.512 3.87431C163.2 4.66204 163.055 5.50601 163.086 6.35275C163.056 7.20497 163.201 8.05433 163.514 8.84781C163.826 9.64129 164.299 10.3619 164.902 10.9646C165.505 11.5673 166.226 12.0392 167.02 12.3509C167.814 12.6626 168.663 12.8074 169.515 12.7762C170.362 12.8082 171.206 12.6635 171.994 12.3514C172.782 12.0392 173.496 11.5664 174.091 10.963C174.682 10.3534 175.142 9.63077 175.446 8.83849C175.75 8.04621 175.89 7.20067 175.859 6.35275C175.898 5.50985 175.761 4.66806 175.456 3.88115C175.151 3.09424 174.686 2.37951 174.09 1.78258C173.493 1.18565 172.779 0.719644 171.992 0.414327C171.206 0.109011 170.364 -0.0288946 169.521 0.00938803L169.515 0.00366253Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M146.201 14.6695C142.357 14.6695 139.268 15.8764 136.935 18.2902C135.207 20.0786 133.939 22.7479 133.131 26.2981H132.771L131.295 15.7563H121.657V66H132.942V45.3054H133.354C133.698 46.6852 134.181 48.0267 134.795 49.3093C135.75 51.3986 137.316 53.1496 139.286 54.3314C141.328 55.446 143.629 56.0005 145.955 55.9387C150.68 55.9387 154.277 54.0988 156.748 50.419C159.219 46.7392 160.455 41.6046 160.455 35.0153C160.455 28.6509 159.259 23.6689 156.869 20.0691C154.478 16.4694 150.922 14.6695 146.201 14.6695ZM147.345 42.9602C146.029 44.8668 143.97 45.8201 141.167 45.8201C140.012 45.8735 138.86 45.6507 137.808 45.1703C136.755 44.6898 135.832 43.9656 135.116 43.0574C133.655 41.2233 132.927 38.7122 132.931 35.5243V34.7807C132.931 31.5432 133.659 29.0646 135.116 27.3448C136.572 25.625 138.59 24.7747 141.167 24.7937C144.02 24.7937 146.092 25.6994 147.385 27.5107C148.678 29.322 149.324 31.8483 149.324 35.0896C149.332 38.4414 148.676 41.065 147.356 42.9602H147.345Z\"\n fill=\"#201515\"\n />\n <path d=\"M39.0441 45.2253H0V54.789H39.0441V45.2253Z\" fill=\"#FF4F00\" />\n </svg>\n ),\n messenger: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <radialGradient\n id=\"8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1\"\n cx=\"11.087\"\n cy=\"7.022\"\n r=\"47.612\"\n gradientTransform=\"matrix(1 0 0 -1 0 50)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#1292ff\"></stop>\n <stop offset=\".079\" stopColor=\"#2982ff\"></stop>\n <stop offset=\".23\" stopColor=\"#4e69ff\"></stop>\n <stop offset=\".351\" stopColor=\"#6559ff\"></stop>\n <stop offset=\".428\" stopColor=\"#6d53ff\"></stop>\n <stop offset=\".754\" stopColor=\"#df47aa\"></stop>\n <stop offset=\".946\" stopColor=\"#ff6257\"></stop>\n </radialGradient>\n <path\n fill=\"url(#8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1)\"\n d=\"M44,23.5C44,34.27,35.05,43,24,43c-1.651,0-3.25-0.194-4.784-0.564\tc-0.465-0.112-0.951-0.069-1.379,0.145L13.46,44.77C12.33,45.335,11,44.513,11,43.249v-4.025c0-0.575-0.257-1.111-0.681-1.499\tC6.425,34.165,4,29.11,4,23.5C4,12.73,12.95,4,24,4S44,12.73,44,23.5z\"\n />\n <path\n d=\"M34.992,17.292c-0.428,0-0.843,0.142-1.2,0.411l-5.694,4.215\tc-0.133,0.1-0.28,0.15-0.435,0.15c-0.15,0-0.291-0.047-0.41-0.136l-3.972-2.99c-0.808-0.601-1.76-0.918-2.757-0.918\tc-1.576,0-3.025,0.791-3.876,2.116l-1.211,1.891l-4.12,6.695c-0.392,0.614-0.422,1.372-0.071,2.014\tc0.358,0.654,1.034,1.06,1.764,1.06c0.428,0,0.843-0.142,1.2-0.411l5.694-4.215c0.133-0.1,0.28-0.15,0.435-0.15\tc0.15,0,0.291,0.047,0.41,0.136l3.972,2.99c0.809,0.602,1.76,0.918,2.757,0.918c1.576,0,3.025-0.791,3.876-2.116l1.211-1.891\tl4.12-6.695c0.392-0.614,0.422-1.372,0.071-2.014C36.398,17.698,35.722,17.292,34.992,17.292L34.992,17.292z\"\n opacity=\".05\"\n />\n <path\n d=\"M34.992,17.792c-0.319,0-0.63,0.107-0.899,0.31l-5.697,4.218\tc-0.216,0.163-0.468,0.248-0.732,0.248c-0.259,0-0.504-0.082-0.71-0.236l-3.973-2.991c-0.719-0.535-1.568-0.817-2.457-0.817\tc-1.405,0-2.696,0.705-3.455,1.887l-1.21,1.891l-4.115,6.688c-0.297,0.465-0.32,1.033-0.058,1.511c0.266,0.486,0.787,0.8,1.325,0.8\tc0.319,0,0.63-0.107,0.899-0.31l5.697-4.218c0.216-0.163,0.468-0.248,0.732-0.248c0.259,0,0.504,0.082,0.71,0.236l3.973,2.991\tc0.719,0.535,1.568,0.817,2.457,0.817c1.405,0,2.696-0.705,3.455-1.887l1.21-1.891l4.115-6.688c0.297-0.465,0.32-1.033,0.058-1.511\tC36.051,18.106,35.531,17.792,34.992,17.792L34.992,17.792z\"\n opacity=\".07\"\n />\n <path\n fill=\"#ffffff\"\n d=\"M34.394,18.501l-5.7,4.22c-0.61,0.46-1.44,0.46-2.04,0.01L22.68,19.74\tc-1.68-1.25-4.06-0.82-5.19,0.94l-1.21,1.89l-4.11,6.68c-0.6,0.94,0.55,2.01,1.44,1.34l5.7-4.22c0.61-0.46,1.44-0.46,2.04-0.01\tl3.974,2.991c1.68,1.25,4.06,0.82,5.19-0.94l1.21-1.89l4.11-6.68C36.434,18.901,35.284,17.831,34.394,18.501z\"\n />\n </svg>\n ),\n user: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"#000000\"\n strokeWidth=\"2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n ),\n};\n",
+ "content": "\"use client\"\n\nimport React, { forwardRef, useRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\"\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"z-10 flex size-12 items-center justify-center rounded-full border-2 bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className\n )}\n >\n {children}\n </div>\n )\n})\n\nCircle.displayName = \"Circle\"\n\nexport default function AnimatedBeamMultipleOutputDemo({\n className,\n}: {\n className?: string\n}) {\n const containerRef = useRef<HTMLDivElement>(null)\n const div1Ref = useRef<HTMLDivElement>(null)\n const div2Ref = useRef<HTMLDivElement>(null)\n const div3Ref = useRef<HTMLDivElement>(null)\n const div4Ref = useRef<HTMLDivElement>(null)\n const div5Ref = useRef<HTMLDivElement>(null)\n const div6Ref = useRef<HTMLDivElement>(null)\n const div7Ref = useRef<HTMLDivElement>(null)\n\n return (\n <div\n className={cn(\n \"relative flex h-[500px] w-full items-center justify-center overflow-hidden p-10\",\n className\n )}\n ref={containerRef}\n >\n <div className=\"flex size-full max-w-lg flex-row items-stretch justify-between gap-10\">\n <div className=\"flex flex-col justify-center\">\n <Circle ref={div7Ref}>\n <Icons.user />\n </Circle>\n </div>\n <div className=\"flex flex-col justify-center\">\n <Circle ref={div6Ref} className=\"size-16\">\n <Icons.openai />\n </Circle>\n </div>\n <div className=\"flex flex-col justify-center gap-2\">\n <Circle ref={div1Ref}>\n <Icons.googleDrive />\n </Circle>\n <Circle ref={div2Ref}>\n <Icons.googleDocs />\n </Circle>\n <Circle ref={div3Ref}>\n <Icons.whatsapp />\n </Circle>\n <Circle ref={div4Ref}>\n <Icons.messenger />\n </Circle>\n <Circle ref={div5Ref}>\n <Icons.notion />\n </Circle>\n </div>\n </div>\n\n {/* AnimatedBeams */}\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div2Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div3Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div4Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div5Ref}\n toRef={div6Ref}\n duration={3}\n />\n <AnimatedBeam\n containerRef={containerRef}\n fromRef={div6Ref}\n toRef={div7Ref}\n duration={3}\n />\n </div>\n )\n}\n\nconst Icons = {\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n googleDocs: () => (\n <svg\n width=\"47px\"\n height=\"65px\"\n viewBox=\"0 0 47 65\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-1\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-3\"\n />\n <linearGradient\n x1=\"50.0053945%\"\n y1=\"8.58610612%\"\n x2=\"50.0053945%\"\n y2=\"100.013939%\"\n id=\"linearGradient-5\"\n >\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.2\" offset=\"0%\" />\n <stop stopColor=\"#1A237E\" stopOpacity=\"0.02\" offset=\"100%\" />\n </linearGradient>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-6\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-8\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-10\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-12\"\n />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"path-14\"\n />\n <radialGradient\n cx=\"3.16804688%\"\n cy=\"2.71744318%\"\n fx=\"3.16804688%\"\n fy=\"2.71744318%\"\n r=\"161.248516%\"\n gradientTransform=\"translate(0.031680,0.027174),scale(1.000000,0.723077),translate(-0.031680,-0.027174)\"\n id=\"radialGradient-16\"\n >\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0.1\" offset=\"0%\" />\n <stop stopColor=\"#FFFFFF\" stopOpacity=\"0\" offset=\"100%\" />\n </radialGradient>\n </defs>\n <g\n id=\"Page-1\"\n stroke=\"none\"\n strokeWidth=\"1\"\n fill=\"none\"\n fillRule=\"evenodd\"\n >\n <g transform=\"translate(-451.000000, -463.000000)\">\n <g id=\"Hero\" transform=\"translate(0.000000, 63.000000)\">\n <g id=\"Personal\" transform=\"translate(277.000000, 309.000000)\">\n <g id=\"Docs-icon\" transform=\"translate(174.000000, 91.000000)\">\n <g id=\"Group\">\n <g id=\"Clipped\">\n <mask id=\"mask-2\" fill=\"white\">\n <use xlinkHref=\"#path-1\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L36.71875,10.3409091 L29.375,0 Z\"\n id=\"Path\"\n fill=\"#4285F4\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-2)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-4\" fill=\"white\">\n <use xlinkHref=\"#path-3\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <polygon\n id=\"Path\"\n fill=\"url(#linearGradient-5)\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-4)\"\n points=\"30.6638281 16.4309659 47 32.8582386 47 17.7272727\"\n ></polygon>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-7\" fill=\"white\">\n <use xlinkHref=\"#path-6\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M11.75,47.2727273 L35.25,47.2727273 L35.25,44.3181818 L11.75,44.3181818 L11.75,47.2727273 Z M11.75,53.1818182 L29.375,53.1818182 L29.375,50.2272727 L11.75,50.2272727 L11.75,53.1818182 Z M11.75,32.5 L11.75,35.4545455 L35.25,35.4545455 L35.25,32.5 L11.75,32.5 Z M11.75,41.3636364 L35.25,41.3636364 L35.25,38.4090909 L11.75,38.4090909 L11.75,41.3636364 Z\"\n id=\"Shape\"\n fill=\"#F1F1F1\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-7)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-9\" fill=\"white\">\n <use xlinkHref=\"#path-8\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <g id=\"Group\" mask=\"url(#mask-9)\">\n <g transform=\"translate(26.437500, -2.954545)\">\n <path\n d=\"M2.9375,2.95454545 L2.9375,16.25 C2.9375,18.6985795 4.90929688,20.6818182 7.34375,20.6818182 L20.5625,20.6818182 L2.9375,2.95454545 Z\"\n id=\"Path\"\n fill=\"#A1C2FA\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-11\" fill=\"white\">\n <use xlinkHref=\"#path-10\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,4.80113636 C0,2.36363636 1.9828125,0.369318182 4.40625,0.369318182 L29.375,0.369318182 L29.375,0 L4.40625,0 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#FFFFFF\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-11)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-13\" fill=\"white\">\n <use xlinkHref=\"#path-12\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M42.59375,64.6306818 L4.40625,64.6306818 C1.9828125,64.6306818 0,62.6363636 0,60.1988636 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,60.1988636 C47,62.6363636 45.0171875,64.6306818 42.59375,64.6306818 Z\"\n id=\"Path\"\n fillOpacity=\"0.2\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-13)\"\n />\n </g>\n <g id=\"Clipped\">\n <mask id=\"mask-15\" fill=\"white\">\n <use xlinkHref=\"#path-14\" />\n </mask>\n <g id=\"SVGID_1_\" />\n <path\n d=\"M33.78125,17.7272727 C31.3467969,17.7272727 29.375,15.7440341 29.375,13.2954545 L29.375,13.6647727 C29.375,16.1133523 31.3467969,18.0965909 33.78125,18.0965909 L47,18.0965909 L47,17.7272727 L33.78125,17.7272727 Z\"\n id=\"Path\"\n fillOpacity=\"0.1\"\n fill=\"#1A237E\"\n fillRule=\"nonzero\"\n mask=\"url(#mask-15)\"\n />\n </g>\n </g>\n <path\n d=\"M29.375,0 L4.40625,0 C1.9828125,0 0,1.99431818 0,4.43181818 L0,60.5681818 C0,63.0056818 1.9828125,65 4.40625,65 L42.59375,65 C45.0171875,65 47,63.0056818 47,60.5681818 L47,17.7272727 L29.375,0 Z\"\n id=\"Path\"\n fill=\"url(#radialGradient-16)\"\n fillRule=\"nonzero\"\n />\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n ),\n zapier: () => (\n <svg\n width=\"105\"\n height=\"28\"\n viewBox=\"0 0 244 66\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M57.1877 45.2253L57.1534 45.1166L78.809 25.2914V15.7391H44.0663V25.2914H64.8181L64.8524 25.3829L43.4084 45.2253V54.7775H79.1579V45.2253H57.1877Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M100.487 14.8297C96.4797 14.8297 93.2136 15.434 90.6892 16.6429C88.3376 17.6963 86.3568 19.4321 85.0036 21.6249C83.7091 23.8321 82.8962 26.2883 82.6184 28.832L93.1602 30.3135C93.5415 28.0674 94.3042 26.4754 95.4482 25.5373C96.7486 24.5562 98.3511 24.0605 99.9783 24.136C102.118 24.136 103.67 24.7079 104.634 25.8519C105.59 26.9959 106.076 28.5803 106.076 30.6681V31.7091H95.9401C90.7807 31.7091 87.0742 32.8531 84.8206 35.1411C82.5669 37.429 81.442 40.4492 81.4458 44.2014C81.4458 48.0452 82.5707 50.9052 84.8206 52.7813C87.0704 54.6574 89.8999 55.5897 93.3089 55.5783C97.5379 55.5783 100.791 54.1235 103.067 51.214C104.412 49.426 105.372 47.3793 105.887 45.2024H106.27L107.723 54.7546H117.275V30.5651C117.275 25.5659 115.958 21.6936 113.323 18.948C110.688 16.2024 106.409 14.8297 100.487 14.8297ZM103.828 44.6475C102.312 45.9116 100.327 46.5408 97.8562 46.5408C95.8199 46.5408 94.4052 46.1843 93.6121 45.4712C93.2256 45.1338 92.9182 44.7155 92.7116 44.246C92.505 43.7764 92.4043 43.2671 92.4166 42.7543C92.3941 42.2706 92.4702 41.7874 92.6403 41.3341C92.8104 40.8808 93.071 40.4668 93.4062 40.1174C93.7687 39.7774 94.1964 39.5145 94.6633 39.3444C95.1303 39.1743 95.6269 39.1006 96.1231 39.1278H106.093V39.7856C106.113 40.7154 105.919 41.6374 105.527 42.4804C105.134 43.3234 104.553 44.0649 103.828 44.6475Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M175.035 15.7391H163.75V54.7833H175.035V15.7391Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M241.666 15.7391C238.478 15.7391 235.965 16.864 234.127 19.1139C232.808 20.7307 231.805 23.1197 231.119 26.2809H230.787L229.311 15.7391H219.673V54.7775H230.959V34.7578C230.959 32.2335 231.55 30.2982 232.732 28.9521C233.914 27.606 236.095 26.933 239.275 26.933H243.559V15.7391H241.666Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M208.473 17.0147C205.839 15.4474 202.515 14.6657 198.504 14.6695C192.189 14.6695 187.247 16.4675 183.678 20.0634C180.108 23.6593 178.324 28.6166 178.324 34.9352C178.233 38.7553 179.067 42.5407 180.755 45.9689C182.3 49.0238 184.706 51.5592 187.676 53.2618C190.665 54.9892 194.221 55.8548 198.344 55.8586C201.909 55.8586 204.887 55.3095 207.278 54.2113C209.526 53.225 211.483 51.6791 212.964 49.7211C214.373 47.7991 215.42 45.6359 216.052 43.3377L206.329 40.615C205.919 42.1094 205.131 43.4728 204.041 44.5732C202.942 45.6714 201.102 46.2206 198.521 46.2206C195.451 46.2206 193.163 45.3416 191.657 43.5837C190.564 42.3139 189.878 40.5006 189.575 38.1498H216.201C216.31 37.0515 216.367 36.1306 216.367 35.387V32.9561C216.431 29.6903 215.757 26.4522 214.394 23.4839C213.118 20.7799 211.054 18.5248 208.473 17.0147ZM198.178 23.9758C202.754 23.9758 205.348 26.2275 205.962 30.731H189.775C190.032 29.2284 190.655 27.8121 191.588 26.607C193.072 24.8491 195.268 23.972 198.178 23.9758Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M169.515 0.00366253C168.666 -0.0252113 167.82 0.116874 167.027 0.421484C166.234 0.726094 165.511 1.187 164.899 1.77682C164.297 2.3723 163.824 3.08658 163.512 3.87431C163.2 4.66204 163.055 5.50601 163.086 6.35275C163.056 7.20497 163.201 8.05433 163.514 8.84781C163.826 9.64129 164.299 10.3619 164.902 10.9646C165.505 11.5673 166.226 12.0392 167.02 12.3509C167.814 12.6626 168.663 12.8074 169.515 12.7762C170.362 12.8082 171.206 12.6635 171.994 12.3514C172.782 12.0392 173.496 11.5664 174.091 10.963C174.682 10.3534 175.142 9.63077 175.446 8.83849C175.75 8.04621 175.89 7.20067 175.859 6.35275C175.898 5.50985 175.761 4.66806 175.456 3.88115C175.151 3.09424 174.686 2.37951 174.09 1.78258C173.493 1.18565 172.779 0.719644 171.992 0.414327C171.206 0.109011 170.364 -0.0288946 169.521 0.00938803L169.515 0.00366253Z\"\n fill=\"#201515\"\n />\n <path\n d=\"M146.201 14.6695C142.357 14.6695 139.268 15.8764 136.935 18.2902C135.207 20.0786 133.939 22.7479 133.131 26.2981H132.771L131.295 15.7563H121.657V66H132.942V45.3054H133.354C133.698 46.6852 134.181 48.0267 134.795 49.3093C135.75 51.3986 137.316 53.1496 139.286 54.3314C141.328 55.446 143.629 56.0005 145.955 55.9387C150.68 55.9387 154.277 54.0988 156.748 50.419C159.219 46.7392 160.455 41.6046 160.455 35.0153C160.455 28.6509 159.259 23.6689 156.869 20.0691C154.478 16.4694 150.922 14.6695 146.201 14.6695ZM147.345 42.9602C146.029 44.8668 143.97 45.8201 141.167 45.8201C140.012 45.8735 138.86 45.6507 137.808 45.1703C136.755 44.6898 135.832 43.9656 135.116 43.0574C133.655 41.2233 132.927 38.7122 132.931 35.5243V34.7807C132.931 31.5432 133.659 29.0646 135.116 27.3448C136.572 25.625 138.59 24.7747 141.167 24.7937C144.02 24.7937 146.092 25.6994 147.385 27.5107C148.678 29.322 149.324 31.8483 149.324 35.0896C149.332 38.4414 148.676 41.065 147.356 42.9602H147.345Z\"\n fill=\"#201515\"\n />\n <path d=\"M39.0441 45.2253H0V54.789H39.0441V45.2253Z\" fill=\"#FF4F00\" />\n </svg>\n ),\n messenger: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <radialGradient\n id=\"8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1\"\n cx=\"11.087\"\n cy=\"7.022\"\n r=\"47.612\"\n gradientTransform=\"matrix(1 0 0 -1 0 50)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#1292ff\"></stop>\n <stop offset=\".079\" stopColor=\"#2982ff\"></stop>\n <stop offset=\".23\" stopColor=\"#4e69ff\"></stop>\n <stop offset=\".351\" stopColor=\"#6559ff\"></stop>\n <stop offset=\".428\" stopColor=\"#6d53ff\"></stop>\n <stop offset=\".754\" stopColor=\"#df47aa\"></stop>\n <stop offset=\".946\" stopColor=\"#ff6257\"></stop>\n </radialGradient>\n <path\n fill=\"url(#8O3wK6b5ASW2Wn6hRCB5xa_YFbzdUk7Q3F8_gr1)\"\n d=\"M44,23.5C44,34.27,35.05,43,24,43c-1.651,0-3.25-0.194-4.784-0.564\tc-0.465-0.112-0.951-0.069-1.379,0.145L13.46,44.77C12.33,45.335,11,44.513,11,43.249v-4.025c0-0.575-0.257-1.111-0.681-1.499\tC6.425,34.165,4,29.11,4,23.5C4,12.73,12.95,4,24,4S44,12.73,44,23.5z\"\n />\n <path\n d=\"M34.992,17.292c-0.428,0-0.843,0.142-1.2,0.411l-5.694,4.215\tc-0.133,0.1-0.28,0.15-0.435,0.15c-0.15,0-0.291-0.047-0.41-0.136l-3.972-2.99c-0.808-0.601-1.76-0.918-2.757-0.918\tc-1.576,0-3.025,0.791-3.876,2.116l-1.211,1.891l-4.12,6.695c-0.392,0.614-0.422,1.372-0.071,2.014\tc0.358,0.654,1.034,1.06,1.764,1.06c0.428,0,0.843-0.142,1.2-0.411l5.694-4.215c0.133-0.1,0.28-0.15,0.435-0.15\tc0.15,0,0.291,0.047,0.41,0.136l3.972,2.99c0.809,0.602,1.76,0.918,2.757,0.918c1.576,0,3.025-0.791,3.876-2.116l1.211-1.891\tl4.12-6.695c0.392-0.614,0.422-1.372,0.071-2.014C36.398,17.698,35.722,17.292,34.992,17.292L34.992,17.292z\"\n opacity=\".05\"\n />\n <path\n d=\"M34.992,17.792c-0.319,0-0.63,0.107-0.899,0.31l-5.697,4.218\tc-0.216,0.163-0.468,0.248-0.732,0.248c-0.259,0-0.504-0.082-0.71-0.236l-3.973-2.991c-0.719-0.535-1.568-0.817-2.457-0.817\tc-1.405,0-2.696,0.705-3.455,1.887l-1.21,1.891l-4.115,6.688c-0.297,0.465-0.32,1.033-0.058,1.511c0.266,0.486,0.787,0.8,1.325,0.8\tc0.319,0,0.63-0.107,0.899-0.31l5.697-4.218c0.216-0.163,0.468-0.248,0.732-0.248c0.259,0,0.504,0.082,0.71,0.236l3.973,2.991\tc0.719,0.535,1.568,0.817,2.457,0.817c1.405,0,2.696-0.705,3.455-1.887l1.21-1.891l4.115-6.688c0.297-0.465,0.32-1.033,0.058-1.511\tC36.051,18.106,35.531,17.792,34.992,17.792L34.992,17.792z\"\n opacity=\".07\"\n />\n <path\n fill=\"#ffffff\"\n d=\"M34.394,18.501l-5.7,4.22c-0.61,0.46-1.44,0.46-2.04,0.01L22.68,19.74\tc-1.68-1.25-4.06-0.82-5.19,0.94l-1.21,1.89l-4.11,6.68c-0.6,0.94,0.55,2.01,1.44,1.34l5.7-4.22c0.61-0.46,1.44-0.46,2.04-0.01\tl3.974,2.991c1.68,1.25,4.06,0.82,5.19-0.94l1.21-1.89l4.11-6.68C36.434,18.901,35.284,17.831,34.394,18.501z\"\n />\n </svg>\n ),\n user: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"#000000\"\n strokeWidth=\"2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n ),\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-beam-unidirectional.json b/apps/www/public/r/animated-beam-unidirectional.json
index 06aaaee9..45596f1e 100644
--- a/apps/www/public/r/animated-beam-unidirectional.json
+++ b/apps/www/public/r/animated-beam-unidirectional.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-beam-unidirectional.tsx",
- "content": "\"use client\";\n\nimport React, { forwardRef, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\";\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"z-10 flex size-12 items-center justify-center rounded-full border-2 bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className,\n )}\n >\n {children}\n </div>\n );\n});\n\nCircle.displayName = \"Circle\";\n\nexport default function AnimatedBeamDemo() {\n const containerRef = useRef<HTMLDivElement>(null);\n const div1Ref = useRef<HTMLDivElement>(null);\n const div2Ref = useRef<HTMLDivElement>(null);\n\n return (\n <div\n className=\"relative flex w-full max-w-[500px] items-center justify-center overflow-hidden p-10\"\n ref={containerRef}\n >\n <div className=\"flex size-full flex-col items-stretch justify-between gap-10\">\n <div className=\"flex flex-row justify-between\">\n <Circle ref={div1Ref}>\n <Icons.user />\n </Circle>\n <Circle ref={div2Ref}>\n <Icons.openai />\n </Circle>\n </div>\n </div>\n\n <AnimatedBeam\n duration={3}\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div2Ref}\n />\n </div>\n );\n}\n\nconst Icons = {\n openai: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n user: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"#000000\"\n strokeWidth=\"2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n ),\n};\n",
+ "content": "\"use client\"\n\nimport React, { forwardRef, useRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { AnimatedBeam } from \"@/registry/magicui/animated-beam\"\n\nconst Circle = forwardRef<\n HTMLDivElement,\n { className?: string; children?: React.ReactNode }\n>(({ className, children }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"z-10 flex size-12 items-center justify-center rounded-full border-2 bg-white p-3 shadow-[0_0_20px_-12px_rgba(0,0,0,0.8)]\",\n className\n )}\n >\n {children}\n </div>\n )\n})\n\nCircle.displayName = \"Circle\"\n\nexport default function AnimatedBeamDemo() {\n const containerRef = useRef<HTMLDivElement>(null)\n const div1Ref = useRef<HTMLDivElement>(null)\n const div2Ref = useRef<HTMLDivElement>(null)\n\n return (\n <div\n className=\"relative flex w-full max-w-[500px] items-center justify-center overflow-hidden p-10\"\n ref={containerRef}\n >\n <div className=\"flex size-full flex-col items-stretch justify-between gap-10\">\n <div className=\"flex flex-row justify-between\">\n <Circle ref={div1Ref}>\n <Icons.user />\n </Circle>\n <Circle ref={div2Ref}>\n <Icons.openai />\n </Circle>\n </div>\n </div>\n\n <AnimatedBeam\n duration={3}\n containerRef={containerRef}\n fromRef={div1Ref}\n toRef={div2Ref}\n />\n </div>\n )\n}\n\nconst Icons = {\n openai: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n user: () => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"#000000\"\n strokeWidth=\"2\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n ),\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-beam.json b/apps/www/public/r/animated-beam.json
index 4cff7436..8069ff0f 100644
--- a/apps/www/public/r/animated-beam.json
+++ b/apps/www/public/r/animated-beam.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/animated-beam.tsx",
- "content": "\"use client\";\n\nimport { motion } from \"motion/react\";\nimport { RefObject, useEffect, useId, useState } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface AnimatedBeamProps {\n className?: string;\n containerRef: RefObject<HTMLElement | null>; // Container ref\n fromRef: RefObject<HTMLElement | null>;\n toRef: RefObject<HTMLElement | null>;\n curvature?: number;\n reverse?: boolean;\n pathColor?: string;\n pathWidth?: number;\n pathOpacity?: number;\n gradientStartColor?: string;\n gradientStopColor?: string;\n delay?: number;\n duration?: number;\n startXOffset?: number;\n startYOffset?: number;\n endXOffset?: number;\n endYOffset?: number;\n}\n\nexport const AnimatedBeam: React.FC<AnimatedBeamProps> = ({\n className,\n containerRef,\n fromRef,\n toRef,\n curvature = 0,\n reverse = false, // Include the reverse prop\n duration = Math.random() * 3 + 4,\n delay = 0,\n pathColor = \"gray\",\n pathWidth = 2,\n pathOpacity = 0.2,\n gradientStartColor = \"#ffaa40\",\n gradientStopColor = \"#9c40ff\",\n startXOffset = 0,\n startYOffset = 0,\n endXOffset = 0,\n endYOffset = 0,\n}) => {\n const id = useId();\n const [pathD, setPathD] = useState(\"\");\n const [svgDimensions, setSvgDimensions] = useState({ width: 0, height: 0 });\n\n // Calculate the gradient coordinates based on the reverse prop\n const gradientCoordinates = reverse\n ? {\n x1: [\"90%\", \"-10%\"],\n x2: [\"100%\", \"0%\"],\n y1: [\"0%\", \"0%\"],\n y2: [\"0%\", \"0%\"],\n }\n : {\n x1: [\"10%\", \"110%\"],\n x2: [\"0%\", \"100%\"],\n y1: [\"0%\", \"0%\"],\n y2: [\"0%\", \"0%\"],\n };\n\n useEffect(() => {\n const updatePath = () => {\n if (containerRef.current && fromRef.current && toRef.current) {\n const containerRect = containerRef.current.getBoundingClientRect();\n const rectA = fromRef.current.getBoundingClientRect();\n const rectB = toRef.current.getBoundingClientRect();\n\n const svgWidth = containerRect.width;\n const svgHeight = containerRect.height;\n setSvgDimensions({ width: svgWidth, height: svgHeight });\n\n const startX =\n rectA.left - containerRect.left + rectA.width / 2 + startXOffset;\n const startY =\n rectA.top - containerRect.top + rectA.height / 2 + startYOffset;\n const endX =\n rectB.left - containerRect.left + rectB.width / 2 + endXOffset;\n const endY =\n rectB.top - containerRect.top + rectB.height / 2 + endYOffset;\n\n const controlY = startY - curvature;\n const d = `M ${startX},${startY} Q ${\n (startX + endX) / 2\n },${controlY} ${endX},${endY}`;\n setPathD(d);\n }\n };\n\n // Initialize ResizeObserver\n const resizeObserver = new ResizeObserver(() => {\n updatePath();\n });\n\n // Observe the container element\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n\n // Call the updatePath initially to set the initial path\n updatePath();\n\n // Clean up the observer on component unmount\n return () => {\n resizeObserver.disconnect();\n };\n }, [\n containerRef,\n fromRef,\n toRef,\n curvature,\n startXOffset,\n startYOffset,\n endXOffset,\n endYOffset,\n ]);\n\n return (\n <svg\n fill=\"none\"\n width={svgDimensions.width}\n height={svgDimensions.height}\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\n \"pointer-events-none absolute left-0 top-0 transform-gpu stroke-2\",\n className,\n )}\n viewBox={`0 0 ${svgDimensions.width} ${svgDimensions.height}`}\n >\n <path\n d={pathD}\n stroke={pathColor}\n strokeWidth={pathWidth}\n strokeOpacity={pathOpacity}\n strokeLinecap=\"round\"\n />\n <path\n d={pathD}\n strokeWidth={pathWidth}\n stroke={`url(#${id})`}\n strokeOpacity=\"1\"\n strokeLinecap=\"round\"\n />\n <defs>\n <motion.linearGradient\n className=\"transform-gpu\"\n id={id}\n gradientUnits={\"userSpaceOnUse\"}\n initial={{\n x1: \"0%\",\n x2: \"0%\",\n y1: \"0%\",\n y2: \"0%\",\n }}\n animate={{\n x1: gradientCoordinates.x1,\n x2: gradientCoordinates.x2,\n y1: gradientCoordinates.y1,\n y2: gradientCoordinates.y2,\n }}\n transition={{\n delay,\n duration,\n ease: [0.16, 1, 0.3, 1], // https://easings.net/#easeOutExpo\n repeat: Infinity,\n repeatDelay: 0,\n }}\n >\n <stop stopColor={gradientStartColor} stopOpacity=\"0\"></stop>\n <stop stopColor={gradientStartColor}></stop>\n <stop offset=\"32.5%\" stopColor={gradientStopColor}></stop>\n <stop\n offset=\"100%\"\n stopColor={gradientStopColor}\n stopOpacity=\"0\"\n ></stop>\n </motion.linearGradient>\n </defs>\n </svg>\n );\n};\n",
+ "content": "\"use client\"\n\nimport { RefObject, useEffect, useId, useState } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedBeamProps {\n className?: string\n containerRef: RefObject<HTMLElement | null> // Container ref\n fromRef: RefObject<HTMLElement | null>\n toRef: RefObject<HTMLElement | null>\n curvature?: number\n reverse?: boolean\n pathColor?: string\n pathWidth?: number\n pathOpacity?: number\n gradientStartColor?: string\n gradientStopColor?: string\n delay?: number\n duration?: number\n startXOffset?: number\n startYOffset?: number\n endXOffset?: number\n endYOffset?: number\n}\n\nexport const AnimatedBeam: React.FC<AnimatedBeamProps> = ({\n className,\n containerRef,\n fromRef,\n toRef,\n curvature = 0,\n reverse = false, // Include the reverse prop\n duration = Math.random() * 3 + 4,\n delay = 0,\n pathColor = \"gray\",\n pathWidth = 2,\n pathOpacity = 0.2,\n gradientStartColor = \"#ffaa40\",\n gradientStopColor = \"#9c40ff\",\n startXOffset = 0,\n startYOffset = 0,\n endXOffset = 0,\n endYOffset = 0,\n}) => {\n const id = useId()\n const [pathD, setPathD] = useState(\"\")\n const [svgDimensions, setSvgDimensions] = useState({ width: 0, height: 0 })\n\n // Calculate the gradient coordinates based on the reverse prop\n const gradientCoordinates = reverse\n ? {\n x1: [\"90%\", \"-10%\"],\n x2: [\"100%\", \"0%\"],\n y1: [\"0%\", \"0%\"],\n y2: [\"0%\", \"0%\"],\n }\n : {\n x1: [\"10%\", \"110%\"],\n x2: [\"0%\", \"100%\"],\n y1: [\"0%\", \"0%\"],\n y2: [\"0%\", \"0%\"],\n }\n\n useEffect(() => {\n const updatePath = () => {\n if (containerRef.current && fromRef.current && toRef.current) {\n const containerRect = containerRef.current.getBoundingClientRect()\n const rectA = fromRef.current.getBoundingClientRect()\n const rectB = toRef.current.getBoundingClientRect()\n\n const svgWidth = containerRect.width\n const svgHeight = containerRect.height\n setSvgDimensions({ width: svgWidth, height: svgHeight })\n\n const startX =\n rectA.left - containerRect.left + rectA.width / 2 + startXOffset\n const startY =\n rectA.top - containerRect.top + rectA.height / 2 + startYOffset\n const endX =\n rectB.left - containerRect.left + rectB.width / 2 + endXOffset\n const endY =\n rectB.top - containerRect.top + rectB.height / 2 + endYOffset\n\n const controlY = startY - curvature\n const d = `M ${startX},${startY} Q ${\n (startX + endX) / 2\n },${controlY} ${endX},${endY}`\n setPathD(d)\n }\n }\n\n // Initialize ResizeObserver\n const resizeObserver = new ResizeObserver(() => {\n updatePath()\n })\n\n // Observe the container element\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current)\n }\n\n // Call the updatePath initially to set the initial path\n updatePath()\n\n // Clean up the observer on component unmount\n return () => {\n resizeObserver.disconnect()\n }\n }, [\n containerRef,\n fromRef,\n toRef,\n curvature,\n startXOffset,\n startYOffset,\n endXOffset,\n endYOffset,\n ])\n\n return (\n <svg\n fill=\"none\"\n width={svgDimensions.width}\n height={svgDimensions.height}\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\n \"pointer-events-none absolute top-0 left-0 transform-gpu stroke-2\",\n className\n )}\n viewBox={`0 0 ${svgDimensions.width} ${svgDimensions.height}`}\n >\n <path\n d={pathD}\n stroke={pathColor}\n strokeWidth={pathWidth}\n strokeOpacity={pathOpacity}\n strokeLinecap=\"round\"\n />\n <path\n d={pathD}\n strokeWidth={pathWidth}\n stroke={`url(#${id})`}\n strokeOpacity=\"1\"\n strokeLinecap=\"round\"\n />\n <defs>\n <motion.linearGradient\n className=\"transform-gpu\"\n id={id}\n gradientUnits={\"userSpaceOnUse\"}\n initial={{\n x1: \"0%\",\n x2: \"0%\",\n y1: \"0%\",\n y2: \"0%\",\n }}\n animate={{\n x1: gradientCoordinates.x1,\n x2: gradientCoordinates.x2,\n y1: gradientCoordinates.y1,\n y2: gradientCoordinates.y2,\n }}\n transition={{\n delay,\n duration,\n ease: [0.16, 1, 0.3, 1], // https://easings.net/#easeOutExpo\n repeat: Infinity,\n repeatDelay: 0,\n }}\n >\n <stop stopColor={gradientStartColor} stopOpacity=\"0\"></stop>\n <stop stopColor={gradientStartColor}></stop>\n <stop offset=\"32.5%\" stopColor={gradientStopColor}></stop>\n <stop\n offset=\"100%\"\n stopColor={gradientStopColor}\n stopOpacity=\"0\"\n ></stop>\n </motion.linearGradient>\n </defs>\n </svg>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/animated-circular-progress-bar-demo.json b/apps/www/public/r/animated-circular-progress-bar-demo.json
index a0d61151..f03f2195 100644
--- a/apps/www/public/r/animated-circular-progress-bar-demo.json
+++ b/apps/www/public/r/animated-circular-progress-bar-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-circular-progress-bar-demo.tsx",
- "content": "\"use client\";\n\nimport { useEffect, useState } from \"react\";\n\nimport { AnimatedCircularProgressBar } from \"@/registry/magicui/animated-circular-progress-bar\";\n\nexport default function AnimatedCircularProgressBarDemo() {\n const [value, setValue] = useState(0);\n\n useEffect(() => {\n const handleIncrement = (prev: number) => {\n if (prev === 100) {\n return 0;\n }\n return prev + 10;\n };\n setValue(handleIncrement);\n const interval = setInterval(() => setValue(handleIncrement), 2000);\n return () => clearInterval(interval);\n }, []);\n\n return (\n <AnimatedCircularProgressBar\n value={value}\n gaugePrimaryColor=\"rgb(79 70 229)\"\n gaugeSecondaryColor=\"rgba(0, 0, 0, 0.1)\"\n />\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nimport { AnimatedCircularProgressBar } from \"@/registry/magicui/animated-circular-progress-bar\"\n\nexport default function AnimatedCircularProgressBarDemo() {\n const [value, setValue] = useState(0)\n\n useEffect(() => {\n const handleIncrement = (prev: number) => {\n if (prev === 100) {\n return 0\n }\n return prev + 10\n }\n setValue(handleIncrement)\n const interval = setInterval(() => setValue(handleIncrement), 2000)\n return () => clearInterval(interval)\n }, [])\n\n return (\n <AnimatedCircularProgressBar\n value={value}\n gaugePrimaryColor=\"rgb(79 70 229)\"\n gaugeSecondaryColor=\"rgba(0, 0, 0, 0.1)\"\n />\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-circular-progress-bar.json b/apps/www/public/r/animated-circular-progress-bar.json
index 12523aec..419b6b3e 100644
--- a/apps/www/public/r/animated-circular-progress-bar.json
+++ b/apps/www/public/r/animated-circular-progress-bar.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/animated-circular-progress-bar.tsx",
- "content": "import { cn } from \"@/lib/utils\";\n\ninterface AnimatedCircularProgressBarProps {\n max?: number;\n min?: number;\n value: number;\n gaugePrimaryColor: string;\n gaugeSecondaryColor: string;\n className?: string;\n}\n\nexport function AnimatedCircularProgressBar({\n max = 100,\n min = 0,\n value = 0,\n gaugePrimaryColor,\n gaugeSecondaryColor,\n className,\n}: AnimatedCircularProgressBarProps) {\n const circumference = 2 * Math.PI * 45;\n const percentPx = circumference / 100;\n const currentPercent = Math.round(((value - min) / (max - min)) * 100);\n\n return (\n <div\n className={cn(\"relative size-40 text-2xl font-semibold\", className)}\n style={\n {\n \"--circle-size\": \"100px\",\n \"--circumference\": circumference,\n \"--percent-to-px\": `${percentPx}px`,\n \"--gap-percent\": \"5\",\n \"--offset-factor\": \"0\",\n \"--transition-length\": \"1s\",\n \"--transition-step\": \"200ms\",\n \"--delay\": \"0s\",\n \"--percent-to-deg\": \"3.6deg\",\n transform: \"translateZ(0)\",\n } as React.CSSProperties\n }\n >\n <svg\n fill=\"none\"\n className=\"size-full\"\n strokeWidth=\"2\"\n viewBox=\"0 0 100 100\"\n >\n {currentPercent <= 90 && currentPercent >= 0 && (\n <circle\n cx=\"50\"\n cy=\"50\"\n r=\"45\"\n strokeWidth=\"10\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\" opacity-100\"\n style={\n {\n stroke: gaugeSecondaryColor,\n \"--stroke-percent\": 90 - currentPercent,\n \"--offset-factor-secondary\": \"calc(1 - var(--offset-factor))\",\n strokeDasharray:\n \"calc(var(--stroke-percent) * var(--percent-to-px)) var(--circumference)\",\n transform:\n \"rotate(calc(1turn - 90deg - (var(--gap-percent) * var(--percent-to-deg) * var(--offset-factor-secondary)))) scaleY(-1)\",\n transition: \"all var(--transition-length) ease var(--delay)\",\n transformOrigin:\n \"calc(var(--circle-size) / 2) calc(var(--circle-size) / 2)\",\n } as React.CSSProperties\n }\n />\n )}\n <circle\n cx=\"50\"\n cy=\"50\"\n r=\"45\"\n strokeWidth=\"10\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"opacity-100\"\n style={\n {\n stroke: gaugePrimaryColor,\n \"--stroke-percent\": currentPercent,\n strokeDasharray:\n \"calc(var(--stroke-percent) * var(--percent-to-px)) var(--circumference)\",\n transition:\n \"var(--transition-length) ease var(--delay),stroke var(--transition-length) ease var(--delay)\",\n transitionProperty: \"stroke-dasharray,transform\",\n transform:\n \"rotate(calc(-90deg + var(--gap-percent) * var(--offset-factor) * var(--percent-to-deg)))\",\n transformOrigin:\n \"calc(var(--circle-size) / 2) calc(var(--circle-size) / 2)\",\n } as React.CSSProperties\n }\n />\n </svg>\n <span\n data-current-value={currentPercent}\n className=\"duration-[var(--transition-length)] delay-[var(--delay)] absolute inset-0 m-auto size-fit ease-linear animate-in fade-in\"\n >\n {currentPercent}\n </span>\n </div>\n );\n}\n",
+ "content": "import { cn } from \"@/lib/utils\"\n\ninterface AnimatedCircularProgressBarProps {\n max?: number\n min?: number\n value: number\n gaugePrimaryColor: string\n gaugeSecondaryColor: string\n className?: string\n}\n\nexport function AnimatedCircularProgressBar({\n max = 100,\n min = 0,\n value = 0,\n gaugePrimaryColor,\n gaugeSecondaryColor,\n className,\n}: AnimatedCircularProgressBarProps) {\n const circumference = 2 * Math.PI * 45\n const percentPx = circumference / 100\n const currentPercent = Math.round(((value - min) / (max - min)) * 100)\n\n return (\n <div\n className={cn(\"relative size-40 text-2xl font-semibold\", className)}\n style={\n {\n \"--circle-size\": \"100px\",\n \"--circumference\": circumference,\n \"--percent-to-px\": `${percentPx}px`,\n \"--gap-percent\": \"5\",\n \"--offset-factor\": \"0\",\n \"--transition-length\": \"1s\",\n \"--transition-step\": \"200ms\",\n \"--delay\": \"0s\",\n \"--percent-to-deg\": \"3.6deg\",\n transform: \"translateZ(0)\",\n } as React.CSSProperties\n }\n >\n <svg\n fill=\"none\"\n className=\"size-full\"\n strokeWidth=\"2\"\n viewBox=\"0 0 100 100\"\n >\n {currentPercent <= 90 && currentPercent >= 0 && (\n <circle\n cx=\"50\"\n cy=\"50\"\n r=\"45\"\n strokeWidth=\"10\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"opacity-100\"\n style={\n {\n stroke: gaugeSecondaryColor,\n \"--stroke-percent\": 90 - currentPercent,\n \"--offset-factor-secondary\": \"calc(1 - var(--offset-factor))\",\n strokeDasharray:\n \"calc(var(--stroke-percent) * var(--percent-to-px)) var(--circumference)\",\n transform:\n \"rotate(calc(1turn - 90deg - (var(--gap-percent) * var(--percent-to-deg) * var(--offset-factor-secondary)))) scaleY(-1)\",\n transition: \"all var(--transition-length) ease var(--delay)\",\n transformOrigin:\n \"calc(var(--circle-size) / 2) calc(var(--circle-size) / 2)\",\n } as React.CSSProperties\n }\n />\n )}\n <circle\n cx=\"50\"\n cy=\"50\"\n r=\"45\"\n strokeWidth=\"10\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"opacity-100\"\n style={\n {\n stroke: gaugePrimaryColor,\n \"--stroke-percent\": currentPercent,\n strokeDasharray:\n \"calc(var(--stroke-percent) * var(--percent-to-px)) var(--circumference)\",\n transition:\n \"var(--transition-length) ease var(--delay),stroke var(--transition-length) ease var(--delay)\",\n transitionProperty: \"stroke-dasharray,transform\",\n transform:\n \"rotate(calc(-90deg + var(--gap-percent) * var(--offset-factor) * var(--percent-to-deg)))\",\n transformOrigin:\n \"calc(var(--circle-size) / 2) calc(var(--circle-size) / 2)\",\n } as React.CSSProperties\n }\n />\n </svg>\n <span\n data-current-value={currentPercent}\n className=\"animate-in fade-in absolute inset-0 m-auto size-fit delay-[var(--delay)] duration-[var(--transition-length)] ease-linear\"\n >\n {currentPercent}\n </span>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/animated-gradient-text-demo-2.json b/apps/www/public/r/animated-gradient-text-demo-2.json
index d06499f7..c333cb44 100644
--- a/apps/www/public/r/animated-gradient-text-demo-2.json
+++ b/apps/www/public/r/animated-gradient-text-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-gradient-text-demo-2.tsx",
- "content": "import { AnimatedGradientText } from \"@/registry/magicui/animated-gradient-text\";\n\nexport default function AnimatedGradientTextDemo() {\n return (\n <AnimatedGradientText\n speed={2}\n colorFrom=\"#4ade80\"\n colorTo=\"#06b6d4\"\n className=\"text-4xl font-semibold tracking-tight\"\n >\n Fast Gradient\n </AnimatedGradientText>\n );\n}\n",
+ "content": "import { AnimatedGradientText } from \"@/registry/magicui/animated-gradient-text\"\n\nexport default function AnimatedGradientTextDemo() {\n return (\n <AnimatedGradientText\n speed={2}\n colorFrom=\"#4ade80\"\n colorTo=\"#06b6d4\"\n className=\"text-4xl font-semibold tracking-tight\"\n >\n Fast Gradient\n </AnimatedGradientText>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-gradient-text-demo.json b/apps/www/public/r/animated-gradient-text-demo.json
index 0e19a9db..6544eef7 100644
--- a/apps/www/public/r/animated-gradient-text-demo.json
+++ b/apps/www/public/r/animated-gradient-text-demo.json
@@ -13,7 +13,7 @@
"files": [
{
"path": "registry/example/animated-gradient-text-demo.tsx",
- "content": "import { cn } from \"@/lib/utils\";\nimport { AnimatedGradientText } from \"@/registry/magicui/animated-gradient-text\";\nimport { ChevronRight } from \"lucide-react\";\n\nexport default function AnimatedGradientTextDemo() {\n return (\n <div className=\"group relative mx-auto flex items-center justify-center rounded-full px-4 py-1.5 shadow-[inset_0_-8px_10px_#8fdfff1f] transition-shadow duration-500 ease-out hover:shadow-[inset_0_-5px_10px_#8fdfff3f] \">\n <span\n className={cn(\n \"absolute inset-0 block h-full w-full animate-gradient rounded-[inherit] bg-gradient-to-r from-[#ffaa40]/50 via-[#9c40ff]/50 to-[#ffaa40]/50 bg-[length:300%_100%] p-[1px]\",\n )}\n style={{\n WebkitMask:\n \"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)\",\n WebkitMaskComposite: \"destination-out\",\n mask: \"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)\",\n maskComposite: \"subtract\",\n WebkitClipPath: \"padding-box\",\n }}\n />\n 🎉 <hr className=\"mx-2 h-4 w-px shrink-0 bg-neutral-500\" />\n <AnimatedGradientText className=\"text-sm font-medium\">\n Introducing Magic UI\n </AnimatedGradientText>\n <ChevronRight\n className=\"ml-1 size-4 stroke-neutral-500 transition-transform\n duration-300 ease-in-out group-hover:translate-x-0.5\"\n />\n </div>\n );\n}\n",
+ "content": "import { ChevronRight } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { AnimatedGradientText } from \"@/registry/magicui/animated-gradient-text\"\n\nexport default function AnimatedGradientTextDemo() {\n return (\n <div className=\"group relative mx-auto flex items-center justify-center rounded-full px-4 py-1.5 shadow-[inset_0_-8px_10px_#8fdfff1f] transition-shadow duration-500 ease-out hover:shadow-[inset_0_-5px_10px_#8fdfff3f]\">\n <span\n className={cn(\n \"animate-gradient absolute inset-0 block h-full w-full rounded-[inherit] bg-gradient-to-r from-[#ffaa40]/50 via-[#9c40ff]/50 to-[#ffaa40]/50 bg-[length:300%_100%] p-[1px]\"\n )}\n style={{\n WebkitMask:\n \"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)\",\n WebkitMaskComposite: \"destination-out\",\n mask: \"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)\",\n maskComposite: \"subtract\",\n WebkitClipPath: \"padding-box\",\n }}\n />\n 🎉 <hr className=\"mx-2 h-4 w-px shrink-0 bg-neutral-500\" />\n <AnimatedGradientText className=\"text-sm font-medium\">\n Introducing Magic UI\n </AnimatedGradientText>\n <ChevronRight className=\"ml-1 size-4 stroke-neutral-500 transition-transform duration-300 ease-in-out group-hover:translate-x-0.5\" />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-gradient-text.json b/apps/www/public/r/animated-gradient-text.json
index a374fb08..196c5452 100644
--- a/apps/www/public/r/animated-gradient-text.json
+++ b/apps/www/public/r/animated-gradient-text.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/animated-gradient-text.tsx",
- "content": "import { cn } from \"@/lib/utils\";\nimport { ComponentPropsWithoutRef } from \"react\";\n\nexport interface AnimatedGradientTextProps\n extends ComponentPropsWithoutRef<\"div\"> {\n speed?: number;\n colorFrom?: string;\n colorTo?: string;\n}\n\nexport function AnimatedGradientText({\n children,\n className,\n speed = 1,\n colorFrom = \"#ffaa40\",\n colorTo = \"#9c40ff\",\n ...props\n}: AnimatedGradientTextProps) {\n return (\n <span\n style={\n {\n \"--bg-size\": `${speed * 300}%`,\n \"--color-from\": colorFrom,\n \"--color-to\": colorTo,\n } as React.CSSProperties\n }\n className={cn(\n `inline animate-gradient bg-gradient-to-r from-[var(--color-from)] via-[var(--color-to)] to-[var(--color-from)] bg-[length:var(--bg-size)_100%] bg-clip-text text-transparent`,\n className,\n )}\n {...props}\n >\n {children}\n </span>\n );\n}\n",
+ "content": "import { ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGradientTextProps\n extends ComponentPropsWithoutRef<\"div\"> {\n speed?: number\n colorFrom?: string\n colorTo?: string\n}\n\nexport function AnimatedGradientText({\n children,\n className,\n speed = 1,\n colorFrom = \"#ffaa40\",\n colorTo = \"#9c40ff\",\n ...props\n}: AnimatedGradientTextProps) {\n return (\n <span\n style={\n {\n \"--bg-size\": `${speed * 300}%`,\n \"--color-from\": colorFrom,\n \"--color-to\": colorTo,\n } as React.CSSProperties\n }\n className={cn(\n `animate-gradient inline bg-gradient-to-r from-[var(--color-from)] via-[var(--color-to)] to-[var(--color-from)] bg-[length:var(--bg-size)_100%] bg-clip-text text-transparent`,\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/animated-grid-pattern-demo.json b/apps/www/public/r/animated-grid-pattern-demo.json
index 2d11baae..78b11d4c 100644
--- a/apps/www/public/r/animated-grid-pattern-demo.json
+++ b/apps/www/public/r/animated-grid-pattern-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-grid-pattern-demo.tsx",
- "content": "import { cn } from \"@/lib/utils\";\nimport { AnimatedGridPattern } from \"@/registry/magicui/animated-grid-pattern\";\n\nexport default function AnimatedGridPatternDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20\">\n <AnimatedGridPattern\n numSquares={30}\n maxOpacity={0.1}\n duration={3}\n repeatDelay={1}\n className={cn(\n \"[mask-image:radial-gradient(500px_circle_at_center,white,transparent)]\",\n \"inset-x-0 inset-y-[-30%] h-[200%] skew-y-12\",\n )}\n />\n </div>\n );\n}\n",
+ "content": "import { cn } from \"@/lib/utils\"\nimport { AnimatedGridPattern } from \"@/registry/magicui/animated-grid-pattern\"\n\nexport default function AnimatedGridPatternDemo() {\n return (\n <div className=\"bg-background relative flex h-[500px] w-full items-center justify-center overflow-hidden rounded-lg border p-20\">\n <AnimatedGridPattern\n numSquares={30}\n maxOpacity={0.1}\n duration={3}\n repeatDelay={1}\n className={cn(\n \"[mask-image:radial-gradient(500px_circle_at_center,white,transparent)]\",\n \"inset-x-0 inset-y-[-30%] h-[200%] skew-y-12\"\n )}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-grid-pattern.json b/apps/www/public/r/animated-grid-pattern.json
index 309a1407..329e7b19 100644
--- a/apps/www/public/r/animated-grid-pattern.json
+++ b/apps/www/public/r/animated-grid-pattern.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/animated-grid-pattern.tsx",
- "content": "\"use client\";\n\nimport { motion } from \"motion/react\";\nimport {\n ComponentPropsWithoutRef,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface AnimatedGridPatternProps\n extends ComponentPropsWithoutRef<\"svg\"> {\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n strokeDasharray?: any;\n numSquares?: number;\n maxOpacity?: number;\n duration?: number;\n repeatDelay?: number;\n}\n\nexport function AnimatedGridPattern({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n numSquares = 50,\n className,\n maxOpacity = 0.5,\n duration = 4,\n repeatDelay = 0.5,\n ...props\n}: AnimatedGridPatternProps) {\n const id = useId();\n const containerRef = useRef(null);\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 });\n const [squares, setSquares] = useState(() => generateSquares(numSquares));\n\n function getPos() {\n return [\n Math.floor((Math.random() * dimensions.width) / width),\n Math.floor((Math.random() * dimensions.height) / height),\n ];\n }\n\n // Adjust the generateSquares function to return objects with an id, x, and y\n function generateSquares(count: number) {\n return Array.from({ length: count }, (_, i) => ({\n id: i,\n pos: getPos(),\n }));\n }\n\n // Function to update a single square's position\n const updateSquarePosition = (id: number) => {\n setSquares((currentSquares) =>\n currentSquares.map((sq) =>\n sq.id === id\n ? {\n ...sq,\n pos: getPos(),\n }\n : sq,\n ),\n );\n };\n\n // Update squares to animate in\n useEffect(() => {\n if (dimensions.width && dimensions.height) {\n setSquares(generateSquares(numSquares));\n }\n }, [dimensions, numSquares]);\n\n // Resize observer to update container dimensions\n useEffect(() => {\n const resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n setDimensions({\n width: entry.contentRect.width,\n height: entry.contentRect.height,\n });\n }\n });\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n\n return () => {\n if (containerRef.current) {\n resizeObserver.unobserve(containerRef.current);\n }\n };\n }, [containerRef]);\n\n return (\n <svg\n ref={containerRef}\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30\",\n className,\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" fill={`url(#${id})`} />\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(({ pos: [x, y], id }, index) => (\n <motion.rect\n initial={{ opacity: 0 }}\n animate={{ opacity: maxOpacity }}\n transition={{\n duration,\n repeat: 1,\n delay: index * 0.1,\n repeatType: \"reverse\",\n }}\n onAnimationComplete={() => updateSquarePosition(id)}\n key={`${x}-${y}-${index}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n fill=\"currentColor\"\n strokeWidth=\"0\"\n />\n ))}\n </svg>\n </svg>\n );\n}\n",
+ "content": "\"use client\"\n\nimport {\n ComponentPropsWithoutRef,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGridPatternProps\n extends ComponentPropsWithoutRef<\"svg\"> {\n width?: number\n height?: number\n x?: number\n y?: number\n strokeDasharray?: any\n numSquares?: number\n maxOpacity?: number\n duration?: number\n repeatDelay?: number\n}\n\nexport function AnimatedGridPattern({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n numSquares = 50,\n className,\n maxOpacity = 0.5,\n duration = 4,\n repeatDelay = 0.5,\n ...props\n}: AnimatedGridPatternProps) {\n const id = useId()\n const containerRef = useRef(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n const [squares, setSquares] = useState(() => generateSquares(numSquares))\n\n function getPos() {\n return [\n Math.floor((Math.random() * dimensions.width) / width),\n Math.floor((Math.random() * dimensions.height) / height),\n ]\n }\n\n // Adjust the generateSquares function to return objects with an id, x, and y\n function generateSquares(count: number) {\n return Array.from({ length: count }, (_, i) => ({\n id: i,\n pos: getPos(),\n }))\n }\n\n // Function to update a single square's position\n const updateSquarePosition = (id: number) => {\n setSquares((currentSquares) =>\n currentSquares.map((sq) =>\n sq.id === id\n ? {\n ...sq,\n pos: getPos(),\n }\n : sq\n )\n )\n }\n\n // Update squares to animate in\n useEffect(() => {\n if (dimensions.width && dimensions.height) {\n setSquares(generateSquares(numSquares))\n }\n }, [dimensions, numSquares])\n\n // Resize observer to update container dimensions\n useEffect(() => {\n const resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n setDimensions({\n width: entry.contentRect.width,\n height: entry.contentRect.height,\n })\n }\n })\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current)\n }\n\n return () => {\n if (containerRef.current) {\n resizeObserver.unobserve(containerRef.current)\n }\n }\n }, [containerRef])\n\n return (\n <svg\n ref={containerRef}\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30\",\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" fill={`url(#${id})`} />\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(({ pos: [x, y], id }, index) => (\n <motion.rect\n initial={{ opacity: 0 }}\n animate={{ opacity: maxOpacity }}\n transition={{\n duration,\n repeat: 1,\n delay: index * 0.1,\n repeatType: \"reverse\",\n }}\n onAnimationComplete={() => updateSquarePosition(id)}\n key={`${x}-${y}-${index}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n fill=\"currentColor\"\n strokeWidth=\"0\"\n />\n ))}\n </svg>\n </svg>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/animated-list-demo.json b/apps/www/public/r/animated-list-demo.json
index 14b03308..66d57b15 100644
--- a/apps/www/public/r/animated-list-demo.json
+++ b/apps/www/public/r/animated-list-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-list-demo.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { AnimatedList } from \"@/registry/magicui/animated-list\";\n\ninterface Item {\n name: string;\n description: string;\n icon: string;\n color: string;\n time: string;\n}\n\nlet notifications = [\n {\n name: \"Payment received\",\n description: \"Magic UI\",\n time: \"15m ago\",\n\n icon: \"💸\",\n color: \"#00C9A7\",\n },\n {\n name: \"User signed up\",\n description: \"Magic UI\",\n time: \"10m ago\",\n icon: \"👤\",\n color: \"#FFB800\",\n },\n {\n name: \"New message\",\n description: \"Magic UI\",\n time: \"5m ago\",\n icon: \"💬\",\n color: \"#FF3D71\",\n },\n {\n name: \"New event\",\n description: \"Magic UI\",\n time: \"2m ago\",\n icon: \"🗞️\",\n color: \"#1E86FF\",\n },\n];\n\nnotifications = Array.from({ length: 10 }, () => notifications).flat();\n\nconst Notification = ({ name, description, icon, color, time }: Item) => {\n return (\n <figure\n className={cn(\n \"relative mx-auto min-h-fit w-full max-w-[400px] cursor-pointer overflow-hidden rounded-2xl p-4\",\n // animation styles\n \"transition-all duration-200 ease-in-out hover:scale-[103%]\",\n // light styles\n \"bg-white [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]\",\n // dark styles\n \"transform-gpu dark:bg-transparent dark:backdrop-blur-md dark:[border:1px_solid_rgba(255,255,255,.1)] dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset]\",\n )}\n >\n <div className=\"flex flex-row items-center gap-3\">\n <div\n className=\"flex size-10 items-center justify-center rounded-2xl\"\n style={{\n backgroundColor: color,\n }}\n >\n <span className=\"text-lg\">{icon}</span>\n </div>\n <div className=\"flex flex-col overflow-hidden\">\n <figcaption className=\"flex flex-row items-center whitespace-pre text-lg font-medium dark:text-white \">\n <span className=\"text-sm sm:text-lg\">{name}</span>\n <span className=\"mx-1\">·</span>\n <span className=\"text-xs text-gray-500\">{time}</span>\n </figcaption>\n <p className=\"text-sm font-normal dark:text-white/60\">\n {description}\n </p>\n </div>\n </div>\n </figure>\n );\n};\n\nexport default function AnimatedListDemo({\n className,\n}: {\n className?: string;\n}) {\n return (\n <div\n className={cn(\n \"relative flex h-[500px] w-full flex-col overflow-hidden p-2\",\n className,\n )}\n >\n <AnimatedList>\n {notifications.map((item, idx) => (\n <Notification {...item} key={idx} />\n ))}\n </AnimatedList>\n\n <div className=\"pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t from-background\"></div>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport { AnimatedList } from \"@/registry/magicui/animated-list\"\n\ninterface Item {\n name: string\n description: string\n icon: string\n color: string\n time: string\n}\n\nlet notifications = [\n {\n name: \"Payment received\",\n description: \"Magic UI\",\n time: \"15m ago\",\n\n icon: \"💸\",\n color: \"#00C9A7\",\n },\n {\n name: \"User signed up\",\n description: \"Magic UI\",\n time: \"10m ago\",\n icon: \"👤\",\n color: \"#FFB800\",\n },\n {\n name: \"New message\",\n description: \"Magic UI\",\n time: \"5m ago\",\n icon: \"💬\",\n color: \"#FF3D71\",\n },\n {\n name: \"New event\",\n description: \"Magic UI\",\n time: \"2m ago\",\n icon: \"🗞️\",\n color: \"#1E86FF\",\n },\n]\n\nnotifications = Array.from({ length: 10 }, () => notifications).flat()\n\nconst Notification = ({ name, description, icon, color, time }: Item) => {\n return (\n <figure\n className={cn(\n \"relative mx-auto min-h-fit w-full max-w-[400px] cursor-pointer overflow-hidden rounded-2xl p-4\",\n // animation styles\n \"transition-all duration-200 ease-in-out hover:scale-[103%]\",\n // light styles\n \"bg-white [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]\",\n // dark styles\n \"transform-gpu dark:bg-transparent dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] dark:backdrop-blur-md dark:[border:1px_solid_rgba(255,255,255,.1)]\"\n )}\n >\n <div className=\"flex flex-row items-center gap-3\">\n <div\n className=\"flex size-10 items-center justify-center rounded-2xl\"\n style={{\n backgroundColor: color,\n }}\n >\n <span className=\"text-lg\">{icon}</span>\n </div>\n <div className=\"flex flex-col overflow-hidden\">\n <figcaption className=\"flex flex-row items-center text-lg font-medium whitespace-pre dark:text-white\">\n <span className=\"text-sm sm:text-lg\">{name}</span>\n <span className=\"mx-1\">·</span>\n <span className=\"text-xs text-gray-500\">{time}</span>\n </figcaption>\n <p className=\"text-sm font-normal dark:text-white/60\">\n {description}\n </p>\n </div>\n </div>\n </figure>\n )\n}\n\nexport default function AnimatedListDemo({\n className,\n}: {\n className?: string\n}) {\n return (\n <div\n className={cn(\n \"relative flex h-[500px] w-full flex-col overflow-hidden p-2\",\n className\n )}\n >\n <AnimatedList>\n {notifications.map((item, idx) => (\n <Notification {...item} key={idx} />\n ))}\n </AnimatedList>\n\n <div className=\"from-background pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t\"></div>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-list.json b/apps/www/public/r/animated-list.json
index dd990f57..654b22ec 100644
--- a/apps/www/public/r/animated-list.json
+++ b/apps/www/public/r/animated-list.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/animated-list.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { AnimatePresence, motion, MotionProps } from \"motion/react\";\nimport React, {\n ComponentPropsWithoutRef,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\n\nexport function AnimatedListItem({ children }: { children: React.ReactNode }) {\n const animations: MotionProps = {\n initial: { scale: 0, opacity: 0 },\n animate: { scale: 1, opacity: 1, originY: 0 },\n exit: { scale: 0, opacity: 0 },\n transition: { type: \"spring\", stiffness: 350, damping: 40 },\n };\n\n return (\n <motion.div {...animations} layout className=\"mx-auto w-full\">\n {children}\n </motion.div>\n );\n}\n\nexport interface AnimatedListProps extends ComponentPropsWithoutRef<\"div\"> {\n children: React.ReactNode;\n delay?: number;\n}\n\nexport const AnimatedList = React.memo(\n ({ children, className, delay = 1000, ...props }: AnimatedListProps) => {\n const [index, setIndex] = useState(0);\n const childrenArray = useMemo(\n () => React.Children.toArray(children),\n [children],\n );\n\n useEffect(() => {\n if (index < childrenArray.length - 1) {\n const timeout = setTimeout(() => {\n setIndex((prevIndex) => (prevIndex + 1) % childrenArray.length);\n }, delay);\n\n return () => clearTimeout(timeout);\n }\n }, [index, delay, childrenArray.length]);\n\n const itemsToShow = useMemo(() => {\n const result = childrenArray.slice(0, index + 1).reverse();\n return result;\n }, [index, childrenArray]);\n\n return (\n <div\n className={cn(`flex flex-col items-center gap-4`, className)}\n {...props}\n >\n <AnimatePresence>\n {itemsToShow.map((item) => (\n <AnimatedListItem key={(item as React.ReactElement).key}>\n {item}\n </AnimatedListItem>\n ))}\n </AnimatePresence>\n </div>\n );\n },\n);\n\nAnimatedList.displayName = \"AnimatedList\";\n",
+ "content": "\"use client\"\n\nimport React, {\n ComponentPropsWithoutRef,\n useEffect,\n useMemo,\n useState,\n} from \"react\"\nimport { AnimatePresence, motion, MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport function AnimatedListItem({ children }: { children: React.ReactNode }) {\n const animations: MotionProps = {\n initial: { scale: 0, opacity: 0 },\n animate: { scale: 1, opacity: 1, originY: 0 },\n exit: { scale: 0, opacity: 0 },\n transition: { type: \"spring\", stiffness: 350, damping: 40 },\n }\n\n return (\n <motion.div {...animations} layout className=\"mx-auto w-full\">\n {children}\n </motion.div>\n )\n}\n\nexport interface AnimatedListProps extends ComponentPropsWithoutRef<\"div\"> {\n children: React.ReactNode\n delay?: number\n}\n\nexport const AnimatedList = React.memo(\n ({ children, className, delay = 1000, ...props }: AnimatedListProps) => {\n const [index, setIndex] = useState(0)\n const childrenArray = useMemo(\n () => React.Children.toArray(children),\n [children]\n )\n\n useEffect(() => {\n if (index < childrenArray.length - 1) {\n const timeout = setTimeout(() => {\n setIndex((prevIndex) => (prevIndex + 1) % childrenArray.length)\n }, delay)\n\n return () => clearTimeout(timeout)\n }\n }, [index, delay, childrenArray.length])\n\n const itemsToShow = useMemo(() => {\n const result = childrenArray.slice(0, index + 1).reverse()\n return result\n }, [index, childrenArray])\n\n return (\n <div\n className={cn(`flex flex-col items-center gap-4`, className)}\n {...props}\n >\n <AnimatePresence>\n {itemsToShow.map((item) => (\n <AnimatedListItem key={(item as React.ReactElement).key}>\n {item}\n </AnimatedListItem>\n ))}\n </AnimatePresence>\n </div>\n )\n }\n)\n\nAnimatedList.displayName = \"AnimatedList\"\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/animated-shiny-text-demo.json b/apps/www/public/r/animated-shiny-text-demo.json
index 22d3262f..a2425664 100644
--- a/apps/www/public/r/animated-shiny-text-demo.json
+++ b/apps/www/public/r/animated-shiny-text-demo.json
@@ -13,7 +13,7 @@
"files": [
{
"path": "registry/example/animated-shiny-text-demo.tsx",
- "content": "import { ArrowRightIcon } from \"@radix-ui/react-icons\";\n\nimport { cn } from \"@/lib/utils\";\nimport { AnimatedShinyText } from \"@/registry/magicui/animated-shiny-text\";\n\nexport default function AnimatedShinyTextDemo() {\n return (\n <div className=\"z-10 flex min-h-64 items-center justify-center\">\n <div\n className={cn(\n \"group rounded-full border border-black/5 bg-neutral-100 text-base text-white transition-all ease-in hover:cursor-pointer hover:bg-neutral-200 dark:border-white/5 dark:bg-neutral-900 dark:hover:bg-neutral-800\",\n )}\n >\n <AnimatedShinyText className=\"inline-flex items-center justify-center px-4 py-1 transition ease-out hover:text-neutral-600 hover:duration-300 hover:dark:text-neutral-400\">\n <span>✨ Introducing Magic UI</span>\n <ArrowRightIcon className=\"ml-1 size-3 transition-transform duration-300 ease-in-out group-hover:translate-x-0.5\" />\n </AnimatedShinyText>\n </div>\n </div>\n );\n}\n",
+ "content": "import { ArrowRightIcon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\nimport { AnimatedShinyText } from \"@/registry/magicui/animated-shiny-text\"\n\nexport default function AnimatedShinyTextDemo() {\n return (\n <div className=\"z-10 flex min-h-64 items-center justify-center\">\n <div\n className={cn(\n \"group rounded-full border border-black/5 bg-neutral-100 text-base text-white transition-all ease-in hover:cursor-pointer hover:bg-neutral-200 dark:border-white/5 dark:bg-neutral-900 dark:hover:bg-neutral-800\"\n )}\n >\n <AnimatedShinyText className=\"inline-flex items-center justify-center px-4 py-1 transition ease-out hover:text-neutral-600 hover:duration-300 hover:dark:text-neutral-400\">\n <span>✨ Introducing Magic UI</span>\n <ArrowRightIcon className=\"ml-1 size-3 transition-transform duration-300 ease-in-out group-hover:translate-x-0.5\" />\n </AnimatedShinyText>\n </div>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-shiny-text.json b/apps/www/public/r/animated-shiny-text.json
index 495440b3..05be2598 100644
--- a/apps/www/public/r/animated-shiny-text.json
+++ b/apps/www/public/r/animated-shiny-text.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/animated-shiny-text.tsx",
- "content": "import { ComponentPropsWithoutRef, CSSProperties, FC } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface AnimatedShinyTextProps\n extends ComponentPropsWithoutRef<\"span\"> {\n shimmerWidth?: number;\n}\n\nexport const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({\n children,\n className,\n shimmerWidth = 100,\n ...props\n}) => {\n return (\n <span\n style={\n {\n \"--shiny-width\": `${shimmerWidth}px`,\n } as CSSProperties\n }\n className={cn(\n \"mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70\",\n\n // Shine effect\n \"animate-shiny-text bg-clip-text bg-no-repeat [background-position:0_0] [background-size:var(--shiny-width)_100%] [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]\",\n\n // Shine gradient\n \"bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80\",\n\n className,\n )}\n {...props}\n >\n {children}\n </span>\n );\n};\n",
+ "content": "import { ComponentPropsWithoutRef, CSSProperties, FC } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedShinyTextProps\n extends ComponentPropsWithoutRef<\"span\"> {\n shimmerWidth?: number\n}\n\nexport const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({\n children,\n className,\n shimmerWidth = 100,\n ...props\n}) => {\n return (\n <span\n style={\n {\n \"--shiny-width\": `${shimmerWidth}px`,\n } as CSSProperties\n }\n className={cn(\n \"mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70\",\n\n // Shine effect\n \"animate-shiny-text [background-size:var(--shiny-width)_100%] bg-clip-text [background-position:0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]\",\n\n // Shine gradient\n \"bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80\",\n\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/animated-subscribe-button-controlled-demo.json b/apps/www/public/r/animated-subscribe-button-controlled-demo.json
index 2d5ebd3b..a90a7fc5 100644
--- a/apps/www/public/r/animated-subscribe-button-controlled-demo.json
+++ b/apps/www/public/r/animated-subscribe-button-controlled-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-subscribe-button-controlled-demo.tsx",
- "content": "\"use client\";\n\nimport { AnimatedSubscribeButton } from \"@/registry/magicui/animated-subscribe-button\";\nimport { CheckIcon, ChevronRightIcon } from \"lucide-react\";\nimport { useState } from \"react\";\n\nexport default function AnimatedSubscribeButtonControlledDemo() {\n const [subscribed, setSubscribed] = useState(false);\n const [loading, setLoading] = useState(false);\n\n async function handleClick() {\n setLoading(true);\n await new Promise((res) => setTimeout(res, 1500));\n setSubscribed(true);\n setTimeout(() => setSubscribed(false), 3000);\n setLoading(false);\n }\n\n return (\n <AnimatedSubscribeButton\n className=\"w-36\"\n subscribeStatus={subscribed}\n onClick={() => !loading && handleClick()}\n >\n <span className=\"group inline-flex items-center\">\n {loading ? (\n \"Sending...\"\n ) : (\n <>\n Follow\n <ChevronRightIcon className=\"ml-1 size-4 transition-transform duration-300 group-hover:translate-x-1\" />\n </>\n )}\n </span>\n <span className=\"group inline-flex items-center\">\n <CheckIcon className=\"mr-2 size-4\" />\n Subscribed\n </span>\n </AnimatedSubscribeButton>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport { CheckIcon, ChevronRightIcon } from \"lucide-react\"\n\nimport { AnimatedSubscribeButton } from \"@/registry/magicui/animated-subscribe-button\"\n\nexport default function AnimatedSubscribeButtonControlledDemo() {\n const [subscribed, setSubscribed] = useState(false)\n const [loading, setLoading] = useState(false)\n\n async function handleClick() {\n setLoading(true)\n await new Promise((res) => setTimeout(res, 1500))\n setSubscribed(true)\n setTimeout(() => setSubscribed(false), 3000)\n setLoading(false)\n }\n\n return (\n <AnimatedSubscribeButton\n className=\"w-36\"\n subscribeStatus={subscribed}\n onClick={() => !loading && handleClick()}\n >\n <span className=\"group inline-flex items-center\">\n {loading ? (\n \"Sending...\"\n ) : (\n <>\n Follow\n <ChevronRightIcon className=\"ml-1 size-4 transition-transform duration-300 group-hover:translate-x-1\" />\n </>\n )}\n </span>\n <span className=\"group inline-flex items-center\">\n <CheckIcon className=\"mr-2 size-4\" />\n Subscribed\n </span>\n </AnimatedSubscribeButton>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-subscribe-button-demo.json b/apps/www/public/r/animated-subscribe-button-demo.json
index 8c7da173..76fbbab1 100644
--- a/apps/www/public/r/animated-subscribe-button-demo.json
+++ b/apps/www/public/r/animated-subscribe-button-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-subscribe-button-demo.tsx",
- "content": "import { AnimatedSubscribeButton } from \"@/registry/magicui/animated-subscribe-button\";\nimport { CheckIcon, ChevronRightIcon } from \"lucide-react\";\n\nexport default function AnimatedSubscribeButtonDemo() {\n return (\n <AnimatedSubscribeButton className=\"w-36\">\n <span className=\"group inline-flex items-center\">\n Follow\n <ChevronRightIcon className=\"ml-1 size-4 transition-transform duration-300 group-hover:translate-x-1\" />\n </span>\n <span className=\"group inline-flex items-center\">\n <CheckIcon className=\"mr-2 size-4\" />\n Subscribed\n </span>\n </AnimatedSubscribeButton>\n );\n}\n",
+ "content": "import { CheckIcon, ChevronRightIcon } from \"lucide-react\"\n\nimport { AnimatedSubscribeButton } from \"@/registry/magicui/animated-subscribe-button\"\n\nexport default function AnimatedSubscribeButtonDemo() {\n return (\n <AnimatedSubscribeButton className=\"w-36\">\n <span className=\"group inline-flex items-center\">\n Follow\n <ChevronRightIcon className=\"ml-1 size-4 transition-transform duration-300 group-hover:translate-x-1\" />\n </span>\n <span className=\"group inline-flex items-center\">\n <CheckIcon className=\"mr-2 size-4\" />\n Subscribed\n </span>\n </AnimatedSubscribeButton>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-subscribe-button.json b/apps/www/public/r/animated-subscribe-button.json
index 90aa9800..6c56ba89 100644
--- a/apps/www/public/r/animated-subscribe-button.json
+++ b/apps/www/public/r/animated-subscribe-button.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/animated-subscribe-button.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { HTMLMotionProps } from \"motion/react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface AnimatedSubscribeButtonProps\n extends Omit<HTMLMotionProps<\"button\">, \"ref\"> {\n subscribeStatus?: boolean;\n children: React.ReactNode;\n className?: string;\n}\n\nexport const AnimatedSubscribeButton = React.forwardRef<\n HTMLButtonElement,\n AnimatedSubscribeButtonProps\n>(({ subscribeStatus, onClick, className, children, ...props }, ref) => {\n const isControlled = subscribeStatus !== undefined; // controlled vs uncontrolled check\n const [isSubscribed, setIsSubscribed] = useState<boolean>(\n subscribeStatus ?? false,\n );\n\n useEffect(() => {\n if (isControlled) {\n setIsSubscribed(subscribeStatus!);\n }\n }, [subscribeStatus, isControlled]);\n\n if (\n React.Children.count(children) !== 2 ||\n !React.Children.toArray(children).every(\n (child) => React.isValidElement(child) && child.type === \"span\",\n )\n ) {\n throw new Error(\n \"AnimatedSubscribeButton expects two children, both of which must be <span> elements.\",\n );\n }\n\n const childrenArray = React.Children.toArray(children);\n const initialChild = childrenArray[0];\n const changeChild = childrenArray[1];\n\n return (\n <AnimatePresence mode=\"wait\">\n {isSubscribed ? (\n <motion.button\n ref={ref}\n className={cn(\n \"relative flex h-10 w-fit items-center justify-center overflow-hidden rounded-lg bg-primary px-6 text-primary-foreground\",\n className,\n )}\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n if (!isControlled) {\n setIsSubscribed(false); // Only toggle manually if uncontrolled\n }\n onClick?.(e);\n }}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n {...props}\n >\n <motion.span\n key=\"action\"\n className=\"relative flex h-full w-full items-center justify-center font-semibold\"\n initial={{ y: -50 }}\n animate={{ y: 0 }}\n >\n {changeChild} {/* Use children for subscribed state */}\n </motion.span>\n </motion.button>\n ) : (\n <motion.button\n ref={ref}\n className={cn(\n \"relative flex h-10 w-fit cursor-pointer items-center justify-center rounded-lg border-none bg-primary px-6 text-primary-foreground\",\n className,\n )}\n onClick={(e) => {\n if (!isControlled) {\n setIsSubscribed(true); // Only toggle manually if uncontrolled\n }\n onClick?.(e);\n }}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n {...props}\n >\n <motion.span\n key=\"reaction\"\n className=\"relative flex items-center justify-center font-semibold\"\n initial={{ x: 0 }}\n exit={{ x: 50, transition: { duration: 0.1 } }}\n >\n {initialChild} {/* Use children for unsubscribed state */}\n </motion.span>\n </motion.button>\n )}\n </AnimatePresence>\n );\n});\n\nAnimatedSubscribeButton.displayName = \"AnimatedSubscribeButton\";\n",
+ "content": "\"use client\"\n\nimport React, { useEffect, useState } from \"react\"\nimport { AnimatePresence, HTMLMotionProps, motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface AnimatedSubscribeButtonProps\n extends Omit<HTMLMotionProps<\"button\">, \"ref\"> {\n subscribeStatus?: boolean\n children: React.ReactNode\n className?: string\n}\n\nexport const AnimatedSubscribeButton = React.forwardRef<\n HTMLButtonElement,\n AnimatedSubscribeButtonProps\n>(({ subscribeStatus, onClick, className, children, ...props }, ref) => {\n const isControlled = subscribeStatus !== undefined // controlled vs uncontrolled check\n const [isSubscribed, setIsSubscribed] = useState<boolean>(\n subscribeStatus ?? false\n )\n\n useEffect(() => {\n if (isControlled) {\n setIsSubscribed(subscribeStatus!)\n }\n }, [subscribeStatus, isControlled])\n\n if (\n React.Children.count(children) !== 2 ||\n !React.Children.toArray(children).every(\n (child) => React.isValidElement(child) && child.type === \"span\"\n )\n ) {\n throw new Error(\n \"AnimatedSubscribeButton expects two children, both of which must be <span> elements.\"\n )\n }\n\n const childrenArray = React.Children.toArray(children)\n const initialChild = childrenArray[0]\n const changeChild = childrenArray[1]\n\n return (\n <AnimatePresence mode=\"wait\">\n {isSubscribed ? (\n <motion.button\n ref={ref}\n className={cn(\n \"bg-primary text-primary-foreground relative flex h-10 w-fit items-center justify-center overflow-hidden rounded-lg px-6\",\n className\n )}\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n if (!isControlled) {\n setIsSubscribed(false) // Only toggle manually if uncontrolled\n }\n onClick?.(e)\n }}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n {...props}\n >\n <motion.span\n key=\"action\"\n className=\"relative flex h-full w-full items-center justify-center font-semibold\"\n initial={{ y: -50 }}\n animate={{ y: 0 }}\n >\n {changeChild} {/* Use children for subscribed state */}\n </motion.span>\n </motion.button>\n ) : (\n <motion.button\n ref={ref}\n className={cn(\n \"bg-primary text-primary-foreground relative flex h-10 w-fit cursor-pointer items-center justify-center rounded-lg border-none px-6\",\n className\n )}\n onClick={(e) => {\n if (!isControlled) {\n setIsSubscribed(true) // Only toggle manually if uncontrolled\n }\n onClick?.(e)\n }}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n {...props}\n >\n <motion.span\n key=\"reaction\"\n className=\"relative flex items-center justify-center font-semibold\"\n initial={{ x: 0 }}\n exit={{ x: 50, transition: { duration: 0.1 } }}\n >\n {initialChild} {/* Use children for unsubscribed state */}\n </motion.span>\n </motion.button>\n )}\n </AnimatePresence>\n )\n})\n\nAnimatedSubscribeButton.displayName = \"AnimatedSubscribeButton\"\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/animated-theme-toggler-demo.json b/apps/www/public/r/animated-theme-toggler-demo.json
index 9594db56..d2e4081a 100644
--- a/apps/www/public/r/animated-theme-toggler-demo.json
+++ b/apps/www/public/r/animated-theme-toggler-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/animated-theme-toggler-demo.tsx",
- "content": "import { AnimatedThemeToggler } from \"@/registry/magicui/animated-theme-toggler\";\n\nfunction AnimatedThemeTogglerDemo() {\n return (\n <div>\n <AnimatedThemeToggler />\n </div>\n );\n}\nexport default AnimatedThemeTogglerDemo;\n",
+ "content": "import { AnimatedThemeToggler } from \"@/registry/magicui/animated-theme-toggler\"\n\nfunction AnimatedThemeTogglerDemo() {\n return (\n <div>\n <AnimatedThemeToggler />\n </div>\n )\n}\nexport default AnimatedThemeTogglerDemo\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/animated-theme-toggler.json b/apps/www/public/r/animated-theme-toggler.json
index 5f2321c3..b3a411ca 100644
--- a/apps/www/public/r/animated-theme-toggler.json
+++ b/apps/www/public/r/animated-theme-toggler.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/animated-theme-toggler.tsx",
- "content": "\"use client\";\n\nimport { Moon, Sun } from \"lucide-react\";\nimport { useState, useEffect, useRef, useCallback } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { cn } from \"@/lib/utils\";\n\ntype Props = {\n className?: string;\n};\n\nexport const AnimatedThemeToggler = ({ className }: Props) => {\n const [isDark, setIsDark] = useState(false);\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n const updateTheme = () => {\n setIsDark(document.documentElement.classList.contains(\"dark\"));\n };\n\n updateTheme();\n\n const observer = new MutationObserver(updateTheme);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"class\"],\n });\n\n return () => observer.disconnect();\n }, []);\n\n const toggleTheme = useCallback(async () => {\n if (!buttonRef.current) return;\n\n await document.startViewTransition(() => {\n flushSync(() => {\n const newTheme = !isDark;\n setIsDark(newTheme);\n document.documentElement.classList.toggle(\"dark\");\n localStorage.setItem(\"theme\", newTheme ? \"dark\" : \"light\");\n });\n }).ready;\n\n const { top, left, width, height } =\n buttonRef.current.getBoundingClientRect();\n const x = left + width / 2;\n const y = top + height / 2;\n const maxRadius = Math.hypot(\n Math.max(left, window.innerWidth - left),\n Math.max(top, window.innerHeight - top),\n );\n\n document.documentElement.animate(\n {\n clipPath: [\n `circle(0px at ${x}px ${y}px)`,\n `circle(${maxRadius}px at ${x}px ${y}px)`,\n ],\n },\n {\n duration: 700,\n easing: \"ease-in-out\",\n pseudoElement: \"::view-transition-new(root)\",\n },\n );\n }, [isDark]);\n\n return (\n <button ref={buttonRef} onClick={toggleTheme} className={cn(className)}>\n {isDark ? <Sun /> : <Moon />}\n </button>\n );\n};\n",
+ "content": "\"use client\"\n\nimport { useCallback, useEffect, useRef, useState } from \"react\"\nimport { Moon, Sun } from \"lucide-react\"\nimport { flushSync } from \"react-dom\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Props = {\n className?: string\n}\n\nexport const AnimatedThemeToggler = ({ className }: Props) => {\n const [isDark, setIsDark] = useState(false)\n const buttonRef = useRef<HTMLButtonElement>(null)\n\n useEffect(() => {\n const updateTheme = () => {\n setIsDark(document.documentElement.classList.contains(\"dark\"))\n }\n\n updateTheme()\n\n const observer = new MutationObserver(updateTheme)\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"class\"],\n })\n\n return () => observer.disconnect()\n }, [])\n\n const toggleTheme = useCallback(async () => {\n if (!buttonRef.current) return\n\n await document.startViewTransition(() => {\n flushSync(() => {\n const newTheme = !isDark\n setIsDark(newTheme)\n document.documentElement.classList.toggle(\"dark\")\n localStorage.setItem(\"theme\", newTheme ? \"dark\" : \"light\")\n })\n }).ready\n\n const { top, left, width, height } =\n buttonRef.current.getBoundingClientRect()\n const x = left + width / 2\n const y = top + height / 2\n const maxRadius = Math.hypot(\n Math.max(left, window.innerWidth - left),\n Math.max(top, window.innerHeight - top)\n )\n\n document.documentElement.animate(\n {\n clipPath: [\n `circle(0px at ${x}px ${y}px)`,\n `circle(${maxRadius}px at ${x}px ${y}px)`,\n ],\n },\n {\n duration: 700,\n easing: \"ease-in-out\",\n pseudoElement: \"::view-transition-new(root)\",\n }\n )\n }, [isDark])\n\n return (\n <button ref={buttonRef} onClick={toggleTheme} className={cn(className)}>\n {isDark ? <Sun /> : <Moon />}\n </button>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/arc-timeline-demo.json b/apps/www/public/r/arc-timeline-demo.json
index 6a7cf52d..9732d967 100644
--- a/apps/www/public/r/arc-timeline-demo.json
+++ b/apps/www/public/r/arc-timeline-demo.json
@@ -10,12 +10,12 @@
"files": [
{
"path": "registry/example/arc-timeline-demo.tsx",
- "content": "import { ArcTimeline, ArcTimelineItem } from \"@/registry/magicui/arc-timeline\";\nimport {\n RocketIcon,\n CubeIcon,\n LockClosedIcon,\n GlobeIcon,\n GearIcon,\n LightningBoltIcon,\n StarIcon,\n MagicWandIcon,\n} from \"@radix-ui/react-icons\";\n\nexport default function ArcTimelineDemo() {\n return (\n <ArcTimeline\n // className={cn(\n // \"[--step-line-active-color:#888888] dark:[--step-line-active-color:#9780ff]\",\n // \"[--step-line-inactive-color:#b1b1b1] dark:[--step-line-inactive-color:#737373]\",\n // \"[--placeholder-line-color:#a1a1a1] dark:[--placeholder-line-color:#737373]\",\n // \"[--icon-active-color:#555555] dark:[--icon-active-color:#d4d4d4]\",\n // \"[--icon-inactive-color:#a3a3a3] dark:[--icon-inactive-color:#a3a3a3]\",\n // \"[--time-active-color:#555555] dark:[--time-active-color:#d4d4d4]\",\n // \"[--time-inactive-color:#a3a3a3] dark:[--time-inactive-color:#a3a3a3]\",\n // \"[--description-color:#555555] dark:[--description-color:#d4d4d4]\"\n // )}\n data={TIMELINE}\n defaultActiveStep={{ time: \"2025 Q2\", stepIndex: 0 }}\n arcConfig={{\n circleWidth: 4500,\n angleBetweenMinorSteps: 0.4,\n lineCountFillBetweenSteps: 8,\n boundaryPlaceholderLinesCount: 50,\n }}\n />\n );\n}\n\nconst TIMELINE: ArcTimelineItem[] = [\n {\n time: \"2022\",\n steps: [\n {\n icon: <RocketIcon width={20} height={20} />,\n content:\n \"Founded Visionary Tech, a cutting-edge AI development company.\",\n },\n {\n icon: <CubeIcon width={20} height={20} />,\n content:\n \"Launched first AI-powered mobile app for personalized recommendations.\",\n },\n ],\n },\n {\n time: \"2023\",\n steps: [\n {\n icon: <LockClosedIcon width={20} height={20} />,\n content: \"Raised $3M seed round at a $20M valuation.\",\n },\n {\n icon: <GlobeIcon width={20} height={20} />,\n content:\n \"Expanded to global markets with localized app versions in 5 countries.\",\n },\n {\n icon: <GearIcon width={20} height={20} />,\n content:\n \"Implemented enhanced machine learning algorithms for data prediction.\",\n },\n ],\n },\n {\n time: \"2024\",\n steps: [\n {\n icon: <RocketIcon width={20} height={20} />,\n content:\n \"Introduced AI-powered virtual assistant for customer service.\",\n },\n {\n icon: <GlobeIcon width={20} height={20} />,\n content:\n \"Partnered with several tech giants to enhance app capabilities.\",\n },\n {\n icon: <MagicWandIcon width={20} height={20} />,\n content:\n \"Launched AR-based features for more immersive user experiences.\",\n },\n ],\n },\n {\n time: \"2025 Q1\",\n steps: [\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Rolled out AI-driven marketplace for personalized product discovery.\",\n },\n {\n icon: <LightningBoltIcon width={20} height={20} />,\n content: \"Introduced blockchain integration for secure transactions.\",\n },\n {\n icon: <RocketIcon width={20} height={20} />,\n content:\n \"Showcased at CES with revolutionary AI-powered consumer products.\",\n },\n ],\n },\n {\n time: \"2025 Q2\",\n steps: [\n {\n icon: <GearIcon width={20} height={20} />,\n content: \"Rebranded company with new logo and visual identity.\",\n },\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Launched AI-driven content creation tool for marketing teams.\",\n },\n {\n icon: <CubeIcon width={20} height={20} />,\n content:\n \"Acquired a competitor in the AI space to strengthen market position.\",\n },\n ],\n },\n {\n time: \"2025 Q3\",\n steps: [\n {\n icon: <CubeIcon width={20} height={20} />,\n content: \"Launched self-driving AI platform for industrial automation.\",\n },\n {\n icon: <MagicWandIcon width={20} height={20} />,\n content: \"Added virtual reality integration to the product suite.\",\n },\n ],\n },\n {\n time: \"2025 Q4\",\n steps: [\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Introduced AI-driven analytics dashboard for enterprise clients.\",\n },\n {\n icon: <LightningBoltIcon width={20} height={20} />,\n content:\n \"Launched international expansion into Asian and European markets.\",\n },\n {\n icon: <RocketIcon width={20} height={20} />,\n content: \"Hosted first global conference showcasing AI innovations.\",\n },\n ],\n },\n {\n time: \"2026 Q1\",\n steps: [\n {\n icon: <GearIcon width={20} height={20} />,\n content:\n \"Released API for developers to integrate AI into their applications.\",\n },\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Launched new AI-powered voice assistant with multi-language support.\",\n },\n {\n icon: <GlobeIcon width={20} height={20} />,\n content:\n \"Partnered with government agencies for AI-driven policy making.\",\n },\n ],\n },\n {\n time: \"2026 Q2\",\n steps: [\n {\n icon: <GearIcon width={20} height={20} />,\n content: \"Unveiled new AI-powered robotics platform for manufacturing.\",\n },\n {\n icon: <MagicWandIcon width={20} height={20} />,\n content:\n \"Introduced machine learning models for sustainable energy solutions.\",\n },\n ],\n },\n];\n",
+ "content": "import {\n CubeIcon,\n GearIcon,\n GlobeIcon,\n LightningBoltIcon,\n LockClosedIcon,\n MagicWandIcon,\n RocketIcon,\n StarIcon,\n} from \"@radix-ui/react-icons\"\n\nimport { ArcTimeline, ArcTimelineItem } from \"@/registry/magicui/arc-timeline\"\n\nexport default function ArcTimelineDemo() {\n return (\n <ArcTimeline\n // className={cn(\n // \"[--step-line-active-color:#888888] dark:[--step-line-active-color:#9780ff]\",\n // \"[--step-line-inactive-color:#b1b1b1] dark:[--step-line-inactive-color:#737373]\",\n // \"[--placeholder-line-color:#a1a1a1] dark:[--placeholder-line-color:#737373]\",\n // \"[--icon-active-color:#555555] dark:[--icon-active-color:#d4d4d4]\",\n // \"[--icon-inactive-color:#a3a3a3] dark:[--icon-inactive-color:#a3a3a3]\",\n // \"[--time-active-color:#555555] dark:[--time-active-color:#d4d4d4]\",\n // \"[--time-inactive-color:#a3a3a3] dark:[--time-inactive-color:#a3a3a3]\",\n // \"[--description-color:#555555] dark:[--description-color:#d4d4d4]\"\n // )}\n data={TIMELINE}\n defaultActiveStep={{ time: \"2025 Q2\", stepIndex: 0 }}\n arcConfig={{\n circleWidth: 4500,\n angleBetweenMinorSteps: 0.4,\n lineCountFillBetweenSteps: 8,\n boundaryPlaceholderLinesCount: 50,\n }}\n />\n )\n}\n\nconst TIMELINE: ArcTimelineItem[] = [\n {\n time: \"2022\",\n steps: [\n {\n icon: <RocketIcon width={20} height={20} />,\n content:\n \"Founded Visionary Tech, a cutting-edge AI development company.\",\n },\n {\n icon: <CubeIcon width={20} height={20} />,\n content:\n \"Launched first AI-powered mobile app for personalized recommendations.\",\n },\n ],\n },\n {\n time: \"2023\",\n steps: [\n {\n icon: <LockClosedIcon width={20} height={20} />,\n content: \"Raised $3M seed round at a $20M valuation.\",\n },\n {\n icon: <GlobeIcon width={20} height={20} />,\n content:\n \"Expanded to global markets with localized app versions in 5 countries.\",\n },\n {\n icon: <GearIcon width={20} height={20} />,\n content:\n \"Implemented enhanced machine learning algorithms for data prediction.\",\n },\n ],\n },\n {\n time: \"2024\",\n steps: [\n {\n icon: <RocketIcon width={20} height={20} />,\n content:\n \"Introduced AI-powered virtual assistant for customer service.\",\n },\n {\n icon: <GlobeIcon width={20} height={20} />,\n content:\n \"Partnered with several tech giants to enhance app capabilities.\",\n },\n {\n icon: <MagicWandIcon width={20} height={20} />,\n content:\n \"Launched AR-based features for more immersive user experiences.\",\n },\n ],\n },\n {\n time: \"2025 Q1\",\n steps: [\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Rolled out AI-driven marketplace for personalized product discovery.\",\n },\n {\n icon: <LightningBoltIcon width={20} height={20} />,\n content: \"Introduced blockchain integration for secure transactions.\",\n },\n {\n icon: <RocketIcon width={20} height={20} />,\n content:\n \"Showcased at CES with revolutionary AI-powered consumer products.\",\n },\n ],\n },\n {\n time: \"2025 Q2\",\n steps: [\n {\n icon: <GearIcon width={20} height={20} />,\n content: \"Rebranded company with new logo and visual identity.\",\n },\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Launched AI-driven content creation tool for marketing teams.\",\n },\n {\n icon: <CubeIcon width={20} height={20} />,\n content:\n \"Acquired a competitor in the AI space to strengthen market position.\",\n },\n ],\n },\n {\n time: \"2025 Q3\",\n steps: [\n {\n icon: <CubeIcon width={20} height={20} />,\n content: \"Launched self-driving AI platform for industrial automation.\",\n },\n {\n icon: <MagicWandIcon width={20} height={20} />,\n content: \"Added virtual reality integration to the product suite.\",\n },\n ],\n },\n {\n time: \"2025 Q4\",\n steps: [\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Introduced AI-driven analytics dashboard for enterprise clients.\",\n },\n {\n icon: <LightningBoltIcon width={20} height={20} />,\n content:\n \"Launched international expansion into Asian and European markets.\",\n },\n {\n icon: <RocketIcon width={20} height={20} />,\n content: \"Hosted first global conference showcasing AI innovations.\",\n },\n ],\n },\n {\n time: \"2026 Q1\",\n steps: [\n {\n icon: <GearIcon width={20} height={20} />,\n content:\n \"Released API for developers to integrate AI into their applications.\",\n },\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Launched new AI-powered voice assistant with multi-language support.\",\n },\n {\n icon: <GlobeIcon width={20} height={20} />,\n content:\n \"Partnered with government agencies for AI-driven policy making.\",\n },\n ],\n },\n {\n time: \"2026 Q2\",\n steps: [\n {\n icon: <GearIcon width={20} height={20} />,\n content: \"Unveiled new AI-powered robotics platform for manufacturing.\",\n },\n {\n icon: <MagicWandIcon width={20} height={20} />,\n content:\n \"Introduced machine learning models for sustainable energy solutions.\",\n },\n ],\n },\n]\n",
"type": "registry:example"
},
{
"path": "registry/magicui/arc-timeline.tsx",
- "content": "\"use client\";\nimport { cn } from \"@/lib/utils\";\nimport { ComponentPropsWithoutRef, ReactNode, useState } from \"react\";\n\nexport interface ArcTimelineItem {\n time: ReactNode;\n steps: Array<{\n icon: ReactNode;\n content: ReactNode;\n }>;\n}\ninterface ArcTimelineProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string;\n /**\n * The data of the arc timeline\n */\n data: ArcTimelineItem[];\n /**\n * The configuration of the arc timeline\n */\n arcConfig?: {\n /**\n * The width of the circle, default is 5000\n */\n circleWidth?: number;\n /**\n * The angle between minor steps, default is 0.35\n */\n angleBetweenMinorSteps?: number;\n /**\n * The number of lines to fill between steps, default is 10\n */\n lineCountFillBetweenSteps?: number;\n /**\n * The number of lines to fill in before the first step and after the last step\n */\n boundaryPlaceholderLinesCount?: number;\n };\n /**\n * The default active step\n */\n defaultActiveStep?: {\n /**\n * The time of the default active step\n */\n time?: string;\n /**\n * The index of the default active step\n */\n stepIndex?: number;\n };\n}\n\nexport function ArcTimeline(props: ArcTimelineProps) {\n const {\n className,\n children,\n data,\n arcConfig = {},\n defaultActiveStep = {},\n ...restProps\n } = props;\n\n const {\n circleWidth = 5000,\n angleBetweenMinorSteps = 0.35,\n lineCountFillBetweenSteps = 10,\n boundaryPlaceholderLinesCount = 50,\n } = arcConfig;\n\n const {\n time: defaultActiveTime = data[0].time,\n stepIndex: defaultActiveStepIndex = 0,\n } = defaultActiveStep || {};\n\n const [circleContainerRotateDeg, setCircleContainerRotateDeg] = useState(\n () => {\n let count = 0;\n for (const timelineItem of data) {\n if (timelineItem.time === defaultActiveTime) {\n count += defaultActiveStepIndex;\n break;\n } else {\n count += timelineItem.steps.length;\n }\n }\n return (\n -1 * count * angleBetweenMinorSteps * (lineCountFillBetweenSteps + 1) -\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount\n );\n },\n );\n\n return (\n <div\n {...restProps}\n className={cn(\"relative h-[380px] w-full overflow-hidden\", className)}\n >\n <div\n style={{\n transform: `translateX(-50%) rotate(${circleContainerRotateDeg}deg)`,\n width: `${circleWidth}px`,\n }}\n className=\"absolute left-1/2 top-28 aspect-square origin-center rounded-full transition-all duration-500 ease-in-out\"\n >\n {data.map((line, lineIndex) => {\n return (\n <div key={`${lineIndex}`}>\n {line.steps.map((step, stepIndex) => {\n // calc the angle of the step\n const angle =\n angleBetweenMinorSteps *\n (lineCountFillBetweenSteps + 1) *\n (data\n .slice(0, lineIndex)\n .map((item) => item.steps.length)\n .reduce((prev, current) => prev + current, 0) +\n stepIndex) +\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount;\n const isLastStep =\n lineIndex === data.length - 1 &&\n stepIndex === line.steps.length - 1;\n const isFirstStep = lineIndex === 0 && stepIndex === 0;\n // check if the step is active\n const isActive =\n Math.abs(angle + circleContainerRotateDeg) < 0.01;\n return (\n <div key={`${lineIndex}-${stepIndex}`}>\n {/* placeholder lines before the first step */}\n {isFirstStep && (\n <PlaceholderLines\n isFirstStep={true}\n isLastStep={false}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n )}\n <div\n className={cn(\n \"absolute left-1/2 top-0 -translate-x-1/2 cursor-pointer transition-all duration-200\",\n isActive ? \"h-[120px] w-[2px]\" : \"h-16 w-[1.5px]\",\n )}\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${angle}deg)`,\n }}\n onClick={() => {\n setCircleContainerRotateDeg(-1 * angle);\n }}\n >\n <div\n className={cn(\n \"h-full w-full transition-colors duration-200\",\n isActive\n ? \"bg-[var(--step-line-active-color,#888888)] dark:bg-[var(--step-line-active-color,#9780ff)]\"\n : \"bg-[var(--step-line-inactive-color,#b1b1b1)] dark:bg-[var(--step-line-inactive-color,#737373)]\",\n )}\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * angle - circleContainerRotateDeg\n }deg)`,\n }}\n >\n <div\n className={cn(\n \"absolute bottom-0 left-1/2 aspect-square -translate-x-1/2\",\n isActive\n ? \"translate-y-[calc(100%_+_14px)] scale-[1.2] text-[var(--icon-active-color,#555555)] dark:text-[var(--icon-active-color,#d4d4d4)]\"\n : \"translate-y-[calc(100%_+_4px)] scale-100 text-[var(--icon-inactive-color,#a3a3a3)] dark:text-[var(--icon-inactive-color,#a3a3a3)]\",\n )}\n >\n {step.icon}\n </div>\n <p\n className={cn(\n \"absolute bottom-0 left-1/2 line-clamp-3 flex w-[240px] -translate-x-1/2 translate-y-[calc(100%_+_42px)] items-center justify-center text-center text-sm transition-opacity duration-300 ease-in\",\n \"text-[var(--description-color,#555555)] dark:text-[var(--description-color,#d4d4d4)]\",\n isActive ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n {step.content}\n </p>\n </div>\n {stepIndex === 0 && (\n <div\n className={cn(\n \"absolute left-1/2 top-0 z-10 -translate-x-1/2 translate-y-[calc(-100%-24px)] whitespace-nowrap\",\n isActive\n ? \"text-[var(--time-active-color,#555555)] dark:text-[var(--time-active-color,#d4d4d4)]\"\n : \"text-[var(--time-inactive-color,#a3a3a3)] dark:text-[var(--time-inactive-color,#a3a3a3)]\",\n )}\n >\n {line.time}\n </div>\n )}\n </div>\n\n {/* fill lines between steps, in the last step, fill the placeholder lines */}\n <PlaceholderLines\n isFirstStep={false}\n isLastStep={isLastStep}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\ninterface PlaceholderLinesProps {\n isFirstStep: boolean;\n angleBetweenMinorSteps: number;\n angle: number;\n lineCountFillBetweenSteps: number;\n boundaryPlaceholderLinesCount: number;\n isLastStep: boolean;\n lineIndex: number;\n stepIndex: number;\n circleWidth: number;\n circleContainerRotateDeg: number;\n}\nfunction PlaceholderLines(props: PlaceholderLinesProps) {\n const {\n isFirstStep,\n isLastStep,\n angle,\n angleBetweenMinorSteps,\n lineCountFillBetweenSteps,\n boundaryPlaceholderLinesCount,\n lineIndex,\n stepIndex,\n circleWidth,\n circleContainerRotateDeg,\n } = props;\n\n const getAngle = (index: number) => {\n if (isFirstStep) {\n return index * angleBetweenMinorSteps;\n } else {\n return angle + (index + 1) * angleBetweenMinorSteps;\n }\n };\n\n return (\n <>\n {Array(\n isLastStep || isFirstStep\n ? boundaryPlaceholderLinesCount\n : lineCountFillBetweenSteps,\n )\n .fill(\"\")\n .map((_, fillIndex) => {\n const fillAngle = getAngle(fillIndex);\n return (\n <div\n key={`${lineIndex}-${stepIndex}-${fillIndex}`}\n className=\"absolute left-1/2 top-0 h-[34px] w-[1px] -translate-x-1/2\"\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${fillAngle}deg)`,\n }}\n >\n <div\n className=\"h-full w-full bg-[var(--placeholder-line-color,#a1a1a1)] dark:bg-[var(--placeholder-line-color,#737373)]\"\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * fillAngle - circleContainerRotateDeg\n }deg)`,\n }}\n ></div>\n </div>\n );\n })}\n </>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { ComponentPropsWithoutRef, ReactNode, useState } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface ArcTimelineItem {\n time: ReactNode\n steps: Array<{\n icon: ReactNode\n content: ReactNode\n }>\n}\ninterface ArcTimelineProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * The data of the arc timeline\n */\n data: ArcTimelineItem[]\n /**\n * The configuration of the arc timeline\n */\n arcConfig?: {\n /**\n * The width of the circle, default is 5000\n */\n circleWidth?: number\n /**\n * The angle between minor steps, default is 0.35\n */\n angleBetweenMinorSteps?: number\n /**\n * The number of lines to fill between steps, default is 10\n */\n lineCountFillBetweenSteps?: number\n /**\n * The number of lines to fill in before the first step and after the last step\n */\n boundaryPlaceholderLinesCount?: number\n }\n /**\n * The default active step\n */\n defaultActiveStep?: {\n /**\n * The time of the default active step\n */\n time?: string\n /**\n * The index of the default active step\n */\n stepIndex?: number\n }\n}\n\nexport function ArcTimeline(props: ArcTimelineProps) {\n const {\n className,\n children,\n data,\n arcConfig = {},\n defaultActiveStep = {},\n ...restProps\n } = props\n\n const {\n circleWidth = 5000,\n angleBetweenMinorSteps = 0.35,\n lineCountFillBetweenSteps = 10,\n boundaryPlaceholderLinesCount = 50,\n } = arcConfig\n\n const {\n time: defaultActiveTime = data[0].time,\n stepIndex: defaultActiveStepIndex = 0,\n } = defaultActiveStep || {}\n\n const [circleContainerRotateDeg, setCircleContainerRotateDeg] = useState(\n () => {\n let count = 0\n for (const timelineItem of data) {\n if (timelineItem.time === defaultActiveTime) {\n count += defaultActiveStepIndex\n break\n } else {\n count += timelineItem.steps.length\n }\n }\n return (\n -1 * count * angleBetweenMinorSteps * (lineCountFillBetweenSteps + 1) -\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount\n )\n }\n )\n\n return (\n <div\n {...restProps}\n className={cn(\"relative h-[380px] w-full overflow-hidden\", className)}\n >\n <div\n style={{\n transform: `translateX(-50%) rotate(${circleContainerRotateDeg}deg)`,\n width: `${circleWidth}px`,\n }}\n className=\"absolute top-28 left-1/2 aspect-square origin-center rounded-full transition-all duration-500 ease-in-out\"\n >\n {data.map((line, lineIndex) => {\n return (\n <div key={`${lineIndex}`}>\n {line.steps.map((step, stepIndex) => {\n // calc the angle of the step\n const angle =\n angleBetweenMinorSteps *\n (lineCountFillBetweenSteps + 1) *\n (data\n .slice(0, lineIndex)\n .map((item) => item.steps.length)\n .reduce((prev, current) => prev + current, 0) +\n stepIndex) +\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount\n const isLastStep =\n lineIndex === data.length - 1 &&\n stepIndex === line.steps.length - 1\n const isFirstStep = lineIndex === 0 && stepIndex === 0\n // check if the step is active\n const isActive =\n Math.abs(angle + circleContainerRotateDeg) < 0.01\n return (\n <div key={`${lineIndex}-${stepIndex}`}>\n {/* placeholder lines before the first step */}\n {isFirstStep && (\n <PlaceholderLines\n isFirstStep={true}\n isLastStep={false}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n )}\n <div\n className={cn(\n \"absolute top-0 left-1/2 -translate-x-1/2 cursor-pointer transition-all duration-200\",\n isActive ? \"h-[120px] w-[2px]\" : \"h-16 w-[1.5px]\"\n )}\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${angle}deg)`,\n }}\n onClick={() => {\n setCircleContainerRotateDeg(-1 * angle)\n }}\n >\n <div\n className={cn(\n \"h-full w-full transition-colors duration-200\",\n isActive\n ? \"bg-[var(--step-line-active-color,#888888)] dark:bg-[var(--step-line-active-color,#9780ff)]\"\n : \"bg-[var(--step-line-inactive-color,#b1b1b1)] dark:bg-[var(--step-line-inactive-color,#737373)]\"\n )}\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * angle - circleContainerRotateDeg\n }deg)`,\n }}\n >\n <div\n className={cn(\n \"absolute bottom-0 left-1/2 aspect-square -translate-x-1/2\",\n isActive\n ? \"translate-y-[calc(100%_+_14px)] scale-[1.2] text-[var(--icon-active-color,#555555)] dark:text-[var(--icon-active-color,#d4d4d4)]\"\n : \"translate-y-[calc(100%_+_4px)] scale-100 text-[var(--icon-inactive-color,#a3a3a3)] dark:text-[var(--icon-inactive-color,#a3a3a3)]\"\n )}\n >\n {step.icon}\n </div>\n <p\n className={cn(\n \"absolute bottom-0 left-1/2 line-clamp-3 flex w-[240px] -translate-x-1/2 translate-y-[calc(100%_+_42px)] items-center justify-center text-center text-sm transition-opacity duration-300 ease-in\",\n \"text-[var(--description-color,#555555)] dark:text-[var(--description-color,#d4d4d4)]\",\n isActive ? \"opacity-100\" : \"opacity-0\"\n )}\n >\n {step.content}\n </p>\n </div>\n {stepIndex === 0 && (\n <div\n className={cn(\n \"absolute top-0 left-1/2 z-10 -translate-x-1/2 translate-y-[calc(-100%-24px)] whitespace-nowrap\",\n isActive\n ? \"text-[var(--time-active-color,#555555)] dark:text-[var(--time-active-color,#d4d4d4)]\"\n : \"text-[var(--time-inactive-color,#a3a3a3)] dark:text-[var(--time-inactive-color,#a3a3a3)]\"\n )}\n >\n {line.time}\n </div>\n )}\n </div>\n\n {/* fill lines between steps, in the last step, fill the placeholder lines */}\n <PlaceholderLines\n isFirstStep={false}\n isLastStep={isLastStep}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n </div>\n )\n })}\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\ninterface PlaceholderLinesProps {\n isFirstStep: boolean\n angleBetweenMinorSteps: number\n angle: number\n lineCountFillBetweenSteps: number\n boundaryPlaceholderLinesCount: number\n isLastStep: boolean\n lineIndex: number\n stepIndex: number\n circleWidth: number\n circleContainerRotateDeg: number\n}\nfunction PlaceholderLines(props: PlaceholderLinesProps) {\n const {\n isFirstStep,\n isLastStep,\n angle,\n angleBetweenMinorSteps,\n lineCountFillBetweenSteps,\n boundaryPlaceholderLinesCount,\n lineIndex,\n stepIndex,\n circleWidth,\n circleContainerRotateDeg,\n } = props\n\n const getAngle = (index: number) => {\n if (isFirstStep) {\n return index * angleBetweenMinorSteps\n } else {\n return angle + (index + 1) * angleBetweenMinorSteps\n }\n }\n\n return (\n <>\n {Array(\n isLastStep || isFirstStep\n ? boundaryPlaceholderLinesCount\n : lineCountFillBetweenSteps\n )\n .fill(\"\")\n .map((_, fillIndex) => {\n const fillAngle = getAngle(fillIndex)\n return (\n <div\n key={`${lineIndex}-${stepIndex}-${fillIndex}`}\n className=\"absolute top-0 left-1/2 h-[34px] w-[1px] -translate-x-1/2\"\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${fillAngle}deg)`,\n }}\n >\n <div\n className=\"h-full w-full bg-[var(--placeholder-line-color,#a1a1a1)] dark:bg-[var(--placeholder-line-color,#737373)]\"\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * fillAngle - circleContainerRotateDeg\n }deg)`,\n }}\n ></div>\n </div>\n )\n })}\n </>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/arc-timeline.json b/apps/www/public/r/arc-timeline.json
index 98f8258d..96035ade 100644
--- a/apps/www/public/r/arc-timeline.json
+++ b/apps/www/public/r/arc-timeline.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/arc-timeline.tsx",
- "content": "\"use client\";\nimport { cn } from \"@/lib/utils\";\nimport { ComponentPropsWithoutRef, ReactNode, useState } from \"react\";\n\nexport interface ArcTimelineItem {\n time: ReactNode;\n steps: Array<{\n icon: ReactNode;\n content: ReactNode;\n }>;\n}\ninterface ArcTimelineProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string;\n /**\n * The data of the arc timeline\n */\n data: ArcTimelineItem[];\n /**\n * The configuration of the arc timeline\n */\n arcConfig?: {\n /**\n * The width of the circle, default is 5000\n */\n circleWidth?: number;\n /**\n * The angle between minor steps, default is 0.35\n */\n angleBetweenMinorSteps?: number;\n /**\n * The number of lines to fill between steps, default is 10\n */\n lineCountFillBetweenSteps?: number;\n /**\n * The number of lines to fill in before the first step and after the last step\n */\n boundaryPlaceholderLinesCount?: number;\n };\n /**\n * The default active step\n */\n defaultActiveStep?: {\n /**\n * The time of the default active step\n */\n time?: string;\n /**\n * The index of the default active step\n */\n stepIndex?: number;\n };\n}\n\nexport function ArcTimeline(props: ArcTimelineProps) {\n const {\n className,\n children,\n data,\n arcConfig = {},\n defaultActiveStep = {},\n ...restProps\n } = props;\n\n const {\n circleWidth = 5000,\n angleBetweenMinorSteps = 0.35,\n lineCountFillBetweenSteps = 10,\n boundaryPlaceholderLinesCount = 50,\n } = arcConfig;\n\n const {\n time: defaultActiveTime = data[0].time,\n stepIndex: defaultActiveStepIndex = 0,\n } = defaultActiveStep || {};\n\n const [circleContainerRotateDeg, setCircleContainerRotateDeg] = useState(\n () => {\n let count = 0;\n for (const timelineItem of data) {\n if (timelineItem.time === defaultActiveTime) {\n count += defaultActiveStepIndex;\n break;\n } else {\n count += timelineItem.steps.length;\n }\n }\n return (\n -1 * count * angleBetweenMinorSteps * (lineCountFillBetweenSteps + 1) -\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount\n );\n },\n );\n\n return (\n <div\n {...restProps}\n className={cn(\"relative h-[380px] w-full overflow-hidden\", className)}\n >\n <div\n style={{\n transform: `translateX(-50%) rotate(${circleContainerRotateDeg}deg)`,\n width: `${circleWidth}px`,\n }}\n className=\"absolute left-1/2 top-28 aspect-square origin-center rounded-full transition-all duration-500 ease-in-out\"\n >\n {data.map((line, lineIndex) => {\n return (\n <div key={`${lineIndex}`}>\n {line.steps.map((step, stepIndex) => {\n // calc the angle of the step\n const angle =\n angleBetweenMinorSteps *\n (lineCountFillBetweenSteps + 1) *\n (data\n .slice(0, lineIndex)\n .map((item) => item.steps.length)\n .reduce((prev, current) => prev + current, 0) +\n stepIndex) +\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount;\n const isLastStep =\n lineIndex === data.length - 1 &&\n stepIndex === line.steps.length - 1;\n const isFirstStep = lineIndex === 0 && stepIndex === 0;\n // check if the step is active\n const isActive =\n Math.abs(angle + circleContainerRotateDeg) < 0.01;\n return (\n <div key={`${lineIndex}-${stepIndex}`}>\n {/* placeholder lines before the first step */}\n {isFirstStep && (\n <PlaceholderLines\n isFirstStep={true}\n isLastStep={false}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n )}\n <div\n className={cn(\n \"absolute left-1/2 top-0 -translate-x-1/2 cursor-pointer transition-all duration-200\",\n isActive ? \"h-[120px] w-[2px]\" : \"h-16 w-[1.5px]\",\n )}\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${angle}deg)`,\n }}\n onClick={() => {\n setCircleContainerRotateDeg(-1 * angle);\n }}\n >\n <div\n className={cn(\n \"h-full w-full transition-colors duration-200\",\n isActive\n ? \"bg-[var(--step-line-active-color,#888888)] dark:bg-[var(--step-line-active-color,#9780ff)]\"\n : \"bg-[var(--step-line-inactive-color,#b1b1b1)] dark:bg-[var(--step-line-inactive-color,#737373)]\",\n )}\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * angle - circleContainerRotateDeg\n }deg)`,\n }}\n >\n <div\n className={cn(\n \"absolute bottom-0 left-1/2 aspect-square -translate-x-1/2\",\n isActive\n ? \"translate-y-[calc(100%_+_14px)] scale-[1.2] text-[var(--icon-active-color,#555555)] dark:text-[var(--icon-active-color,#d4d4d4)]\"\n : \"translate-y-[calc(100%_+_4px)] scale-100 text-[var(--icon-inactive-color,#a3a3a3)] dark:text-[var(--icon-inactive-color,#a3a3a3)]\",\n )}\n >\n {step.icon}\n </div>\n <p\n className={cn(\n \"absolute bottom-0 left-1/2 line-clamp-3 flex w-[240px] -translate-x-1/2 translate-y-[calc(100%_+_42px)] items-center justify-center text-center text-sm transition-opacity duration-300 ease-in\",\n \"text-[var(--description-color,#555555)] dark:text-[var(--description-color,#d4d4d4)]\",\n isActive ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n {step.content}\n </p>\n </div>\n {stepIndex === 0 && (\n <div\n className={cn(\n \"absolute left-1/2 top-0 z-10 -translate-x-1/2 translate-y-[calc(-100%-24px)] whitespace-nowrap\",\n isActive\n ? \"text-[var(--time-active-color,#555555)] dark:text-[var(--time-active-color,#d4d4d4)]\"\n : \"text-[var(--time-inactive-color,#a3a3a3)] dark:text-[var(--time-inactive-color,#a3a3a3)]\",\n )}\n >\n {line.time}\n </div>\n )}\n </div>\n\n {/* fill lines between steps, in the last step, fill the placeholder lines */}\n <PlaceholderLines\n isFirstStep={false}\n isLastStep={isLastStep}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\ninterface PlaceholderLinesProps {\n isFirstStep: boolean;\n angleBetweenMinorSteps: number;\n angle: number;\n lineCountFillBetweenSteps: number;\n boundaryPlaceholderLinesCount: number;\n isLastStep: boolean;\n lineIndex: number;\n stepIndex: number;\n circleWidth: number;\n circleContainerRotateDeg: number;\n}\nfunction PlaceholderLines(props: PlaceholderLinesProps) {\n const {\n isFirstStep,\n isLastStep,\n angle,\n angleBetweenMinorSteps,\n lineCountFillBetweenSteps,\n boundaryPlaceholderLinesCount,\n lineIndex,\n stepIndex,\n circleWidth,\n circleContainerRotateDeg,\n } = props;\n\n const getAngle = (index: number) => {\n if (isFirstStep) {\n return index * angleBetweenMinorSteps;\n } else {\n return angle + (index + 1) * angleBetweenMinorSteps;\n }\n };\n\n return (\n <>\n {Array(\n isLastStep || isFirstStep\n ? boundaryPlaceholderLinesCount\n : lineCountFillBetweenSteps,\n )\n .fill(\"\")\n .map((_, fillIndex) => {\n const fillAngle = getAngle(fillIndex);\n return (\n <div\n key={`${lineIndex}-${stepIndex}-${fillIndex}`}\n className=\"absolute left-1/2 top-0 h-[34px] w-[1px] -translate-x-1/2\"\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${fillAngle}deg)`,\n }}\n >\n <div\n className=\"h-full w-full bg-[var(--placeholder-line-color,#a1a1a1)] dark:bg-[var(--placeholder-line-color,#737373)]\"\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * fillAngle - circleContainerRotateDeg\n }deg)`,\n }}\n ></div>\n </div>\n );\n })}\n </>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { ComponentPropsWithoutRef, ReactNode, useState } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface ArcTimelineItem {\n time: ReactNode\n steps: Array<{\n icon: ReactNode\n content: ReactNode\n }>\n}\ninterface ArcTimelineProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * The data of the arc timeline\n */\n data: ArcTimelineItem[]\n /**\n * The configuration of the arc timeline\n */\n arcConfig?: {\n /**\n * The width of the circle, default is 5000\n */\n circleWidth?: number\n /**\n * The angle between minor steps, default is 0.35\n */\n angleBetweenMinorSteps?: number\n /**\n * The number of lines to fill between steps, default is 10\n */\n lineCountFillBetweenSteps?: number\n /**\n * The number of lines to fill in before the first step and after the last step\n */\n boundaryPlaceholderLinesCount?: number\n }\n /**\n * The default active step\n */\n defaultActiveStep?: {\n /**\n * The time of the default active step\n */\n time?: string\n /**\n * The index of the default active step\n */\n stepIndex?: number\n }\n}\n\nexport function ArcTimeline(props: ArcTimelineProps) {\n const {\n className,\n children,\n data,\n arcConfig = {},\n defaultActiveStep = {},\n ...restProps\n } = props\n\n const {\n circleWidth = 5000,\n angleBetweenMinorSteps = 0.35,\n lineCountFillBetweenSteps = 10,\n boundaryPlaceholderLinesCount = 50,\n } = arcConfig\n\n const {\n time: defaultActiveTime = data[0].time,\n stepIndex: defaultActiveStepIndex = 0,\n } = defaultActiveStep || {}\n\n const [circleContainerRotateDeg, setCircleContainerRotateDeg] = useState(\n () => {\n let count = 0\n for (const timelineItem of data) {\n if (timelineItem.time === defaultActiveTime) {\n count += defaultActiveStepIndex\n break\n } else {\n count += timelineItem.steps.length\n }\n }\n return (\n -1 * count * angleBetweenMinorSteps * (lineCountFillBetweenSteps + 1) -\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount\n )\n }\n )\n\n return (\n <div\n {...restProps}\n className={cn(\"relative h-[380px] w-full overflow-hidden\", className)}\n >\n <div\n style={{\n transform: `translateX(-50%) rotate(${circleContainerRotateDeg}deg)`,\n width: `${circleWidth}px`,\n }}\n className=\"absolute top-28 left-1/2 aspect-square origin-center rounded-full transition-all duration-500 ease-in-out\"\n >\n {data.map((line, lineIndex) => {\n return (\n <div key={`${lineIndex}`}>\n {line.steps.map((step, stepIndex) => {\n // calc the angle of the step\n const angle =\n angleBetweenMinorSteps *\n (lineCountFillBetweenSteps + 1) *\n (data\n .slice(0, lineIndex)\n .map((item) => item.steps.length)\n .reduce((prev, current) => prev + current, 0) +\n stepIndex) +\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount\n const isLastStep =\n lineIndex === data.length - 1 &&\n stepIndex === line.steps.length - 1\n const isFirstStep = lineIndex === 0 && stepIndex === 0\n // check if the step is active\n const isActive =\n Math.abs(angle + circleContainerRotateDeg) < 0.01\n return (\n <div key={`${lineIndex}-${stepIndex}`}>\n {/* placeholder lines before the first step */}\n {isFirstStep && (\n <PlaceholderLines\n isFirstStep={true}\n isLastStep={false}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n )}\n <div\n className={cn(\n \"absolute top-0 left-1/2 -translate-x-1/2 cursor-pointer transition-all duration-200\",\n isActive ? \"h-[120px] w-[2px]\" : \"h-16 w-[1.5px]\"\n )}\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${angle}deg)`,\n }}\n onClick={() => {\n setCircleContainerRotateDeg(-1 * angle)\n }}\n >\n <div\n className={cn(\n \"h-full w-full transition-colors duration-200\",\n isActive\n ? \"bg-[var(--step-line-active-color,#888888)] dark:bg-[var(--step-line-active-color,#9780ff)]\"\n : \"bg-[var(--step-line-inactive-color,#b1b1b1)] dark:bg-[var(--step-line-inactive-color,#737373)]\"\n )}\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * angle - circleContainerRotateDeg\n }deg)`,\n }}\n >\n <div\n className={cn(\n \"absolute bottom-0 left-1/2 aspect-square -translate-x-1/2\",\n isActive\n ? \"translate-y-[calc(100%_+_14px)] scale-[1.2] text-[var(--icon-active-color,#555555)] dark:text-[var(--icon-active-color,#d4d4d4)]\"\n : \"translate-y-[calc(100%_+_4px)] scale-100 text-[var(--icon-inactive-color,#a3a3a3)] dark:text-[var(--icon-inactive-color,#a3a3a3)]\"\n )}\n >\n {step.icon}\n </div>\n <p\n className={cn(\n \"absolute bottom-0 left-1/2 line-clamp-3 flex w-[240px] -translate-x-1/2 translate-y-[calc(100%_+_42px)] items-center justify-center text-center text-sm transition-opacity duration-300 ease-in\",\n \"text-[var(--description-color,#555555)] dark:text-[var(--description-color,#d4d4d4)]\",\n isActive ? \"opacity-100\" : \"opacity-0\"\n )}\n >\n {step.content}\n </p>\n </div>\n {stepIndex === 0 && (\n <div\n className={cn(\n \"absolute top-0 left-1/2 z-10 -translate-x-1/2 translate-y-[calc(-100%-24px)] whitespace-nowrap\",\n isActive\n ? \"text-[var(--time-active-color,#555555)] dark:text-[var(--time-active-color,#d4d4d4)]\"\n : \"text-[var(--time-inactive-color,#a3a3a3)] dark:text-[var(--time-inactive-color,#a3a3a3)]\"\n )}\n >\n {line.time}\n </div>\n )}\n </div>\n\n {/* fill lines between steps, in the last step, fill the placeholder lines */}\n <PlaceholderLines\n isFirstStep={false}\n isLastStep={isLastStep}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n </div>\n )\n })}\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\ninterface PlaceholderLinesProps {\n isFirstStep: boolean\n angleBetweenMinorSteps: number\n angle: number\n lineCountFillBetweenSteps: number\n boundaryPlaceholderLinesCount: number\n isLastStep: boolean\n lineIndex: number\n stepIndex: number\n circleWidth: number\n circleContainerRotateDeg: number\n}\nfunction PlaceholderLines(props: PlaceholderLinesProps) {\n const {\n isFirstStep,\n isLastStep,\n angle,\n angleBetweenMinorSteps,\n lineCountFillBetweenSteps,\n boundaryPlaceholderLinesCount,\n lineIndex,\n stepIndex,\n circleWidth,\n circleContainerRotateDeg,\n } = props\n\n const getAngle = (index: number) => {\n if (isFirstStep) {\n return index * angleBetweenMinorSteps\n } else {\n return angle + (index + 1) * angleBetweenMinorSteps\n }\n }\n\n return (\n <>\n {Array(\n isLastStep || isFirstStep\n ? boundaryPlaceholderLinesCount\n : lineCountFillBetweenSteps\n )\n .fill(\"\")\n .map((_, fillIndex) => {\n const fillAngle = getAngle(fillIndex)\n return (\n <div\n key={`${lineIndex}-${stepIndex}-${fillIndex}`}\n className=\"absolute top-0 left-1/2 h-[34px] w-[1px] -translate-x-1/2\"\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${fillAngle}deg)`,\n }}\n >\n <div\n className=\"h-full w-full bg-[var(--placeholder-line-color,#a1a1a1)] dark:bg-[var(--placeholder-line-color,#737373)]\"\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * fillAngle - circleContainerRotateDeg\n }deg)`,\n }}\n ></div>\n </div>\n )\n })}\n </>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/aurora-text-demo.json b/apps/www/public/r/aurora-text-demo.json
index 6b283e7c..44fc35cb 100644
--- a/apps/www/public/r/aurora-text-demo.json
+++ b/apps/www/public/r/aurora-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/aurora-text-demo.tsx",
- "content": "import { AuroraText } from \"@/registry/magicui/aurora-text\";\n\nexport default function AuroraTextDemo() {\n return (\n <h1 className=\"text-4xl font-bold tracking-tighter md:text-5xl lg:text-7xl\">\n Ship <AuroraText>beautiful</AuroraText>\n </h1>\n );\n}\n",
+ "content": "import { AuroraText } from \"@/registry/magicui/aurora-text\"\n\nexport default function AuroraTextDemo() {\n return (\n <h1 className=\"text-4xl font-bold tracking-tighter md:text-5xl lg:text-7xl\">\n Ship <AuroraText>beautiful</AuroraText>\n </h1>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/aurora-text.json b/apps/www/public/r/aurora-text.json
index 8ac608f5..cf775202 100644
--- a/apps/www/public/r/aurora-text.json
+++ b/apps/www/public/r/aurora-text.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/aurora-text.tsx",
- "content": "\"use client\";\n\nimport React, { memo } from \"react\";\n\ninterface AuroraTextProps {\n children: React.ReactNode;\n className?: string;\n colors?: string[];\n speed?: number;\n}\n\nexport const AuroraText = memo(\n ({\n children,\n className = \"\",\n colors = [\"#FF0080\", \"#7928CA\", \"#0070F3\", \"#38bdf8\"],\n speed = 1,\n }: AuroraTextProps) => {\n const gradientStyle = {\n backgroundImage: `linear-gradient(135deg, ${colors.join(\", \")}, ${\n colors[0]\n })`,\n WebkitBackgroundClip: \"text\",\n WebkitTextFillColor: \"transparent\",\n animationDuration: `${10 / speed}s`,\n };\n\n return (\n <span className={`relative inline-block ${className}`}>\n <span className=\"sr-only\">{children}</span>\n <span\n className=\"relative animate-aurora bg-[length:200%_auto] bg-clip-text text-transparent\"\n style={gradientStyle}\n aria-hidden=\"true\"\n >\n {children}\n </span>\n </span>\n );\n },\n);\n\nAuroraText.displayName = \"AuroraText\";\n",
+ "content": "\"use client\"\n\nimport React, { memo } from \"react\"\n\ninterface AuroraTextProps {\n children: React.ReactNode\n className?: string\n colors?: string[]\n speed?: number\n}\n\nexport const AuroraText = memo(\n ({\n children,\n className = \"\",\n colors = [\"#FF0080\", \"#7928CA\", \"#0070F3\", \"#38bdf8\"],\n speed = 1,\n }: AuroraTextProps) => {\n const gradientStyle = {\n backgroundImage: `linear-gradient(135deg, ${colors.join(\", \")}, ${\n colors[0]\n })`,\n WebkitBackgroundClip: \"text\",\n WebkitTextFillColor: \"transparent\",\n animationDuration: `${10 / speed}s`,\n }\n\n return (\n <span className={`relative inline-block ${className}`}>\n <span className=\"sr-only\">{children}</span>\n <span\n className=\"animate-aurora relative bg-[length:200%_auto] bg-clip-text text-transparent\"\n style={gradientStyle}\n aria-hidden=\"true\"\n >\n {children}\n </span>\n </span>\n )\n }\n)\n\nAuroraText.displayName = \"AuroraText\"\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/avatar-circles-demo.json b/apps/www/public/r/avatar-circles-demo.json
index 2ecf3a45..9f1fde78 100644
--- a/apps/www/public/r/avatar-circles-demo.json
+++ b/apps/www/public/r/avatar-circles-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/avatar-circles-demo.tsx",
- "content": "import { AvatarCircles } from \"@/registry/magicui/avatar-circles\";\n\nconst avatars = [\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/16860528\",\n profileUrl: \"https://github.com/dillionverma\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/20110627\",\n profileUrl: \"https://github.com/tomonarifeehan\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/106103625\",\n profileUrl: \"https://github.com/BankkRoll\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/59228569\",\n profileUrl: \"https://github.com/safethecode\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/59442788\",\n profileUrl: \"https://github.com/sanjay-mali\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/89768406\",\n profileUrl: \"https://github.com/itsarghyadas\",\n },\n];\n\nexport default function AvatarCirclesDemo() {\n return <AvatarCircles numPeople={99} avatarUrls={avatars} />;\n}\n",
+ "content": "import { AvatarCircles } from \"@/registry/magicui/avatar-circles\"\n\nconst avatars = [\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/16860528\",\n profileUrl: \"https://github.com/dillionverma\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/20110627\",\n profileUrl: \"https://github.com/tomonarifeehan\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/106103625\",\n profileUrl: \"https://github.com/BankkRoll\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/59228569\",\n profileUrl: \"https://github.com/safethecode\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/59442788\",\n profileUrl: \"https://github.com/sanjay-mali\",\n },\n {\n imageUrl: \"https://avatars.githubusercontent.com/u/89768406\",\n profileUrl: \"https://github.com/itsarghyadas\",\n },\n]\n\nexport default function AvatarCirclesDemo() {\n return <AvatarCircles numPeople={99} avatarUrls={avatars} />\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/avatar-circles.json b/apps/www/public/r/avatar-circles.json
index 42e958e9..54e6ada4 100644
--- a/apps/www/public/r/avatar-circles.json
+++ b/apps/www/public/r/avatar-circles.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/avatar-circles.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\n\"use client\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface Avatar {\n imageUrl: string;\n profileUrl: string;\n}\ninterface AvatarCirclesProps {\n className?: string;\n numPeople?: number;\n avatarUrls: Avatar[];\n}\n\nexport const AvatarCircles = ({\n numPeople,\n className,\n avatarUrls,\n}: AvatarCirclesProps) => {\n return (\n <div className={cn(\"z-10 flex -space-x-4 rtl:space-x-reverse\", className)}>\n {avatarUrls.map((url, index) => (\n <a\n key={index}\n href={url.profileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <img\n key={index}\n className=\"h-10 w-10 rounded-full border-2 border-white dark:border-gray-800\"\n src={url.imageUrl}\n width={40}\n height={40}\n alt={`Avatar ${index + 1}`}\n />\n </a>\n ))}\n {(numPeople ?? 0) > 0 && (\n <a\n className=\"flex h-10 w-10 items-center justify-center rounded-full border-2 border-white bg-black text-center text-xs font-medium text-white hover:bg-gray-600 dark:border-gray-800 dark:bg-white dark:text-black\"\n href=\"\"\n >\n +{numPeople}\n </a>\n )}\n </div>\n );\n};\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\n\"use client\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface Avatar {\n imageUrl: string\n profileUrl: string\n}\ninterface AvatarCirclesProps {\n className?: string\n numPeople?: number\n avatarUrls: Avatar[]\n}\n\nexport const AvatarCircles = ({\n numPeople,\n className,\n avatarUrls,\n}: AvatarCirclesProps) => {\n return (\n <div className={cn(\"z-10 flex -space-x-4 rtl:space-x-reverse\", className)}>\n {avatarUrls.map((url, index) => (\n <a\n key={index}\n href={url.profileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <img\n key={index}\n className=\"h-10 w-10 rounded-full border-2 border-white dark:border-gray-800\"\n src={url.imageUrl}\n width={40}\n height={40}\n alt={`Avatar ${index + 1}`}\n />\n </a>\n ))}\n {(numPeople ?? 0) > 0 && (\n <a\n className=\"flex h-10 w-10 items-center justify-center rounded-full border-2 border-white bg-black text-center text-xs font-medium text-white hover:bg-gray-600 dark:border-gray-800 dark:bg-white dark:text-black\"\n href=\"\"\n >\n +{numPeople}\n </a>\n )}\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/bento-demo-vertical.json b/apps/www/public/r/bento-demo-vertical.json
index f1e31336..2adf50ab 100644
--- a/apps/www/public/r/bento-demo-vertical.json
+++ b/apps/www/public/r/bento-demo-vertical.json
@@ -13,7 +13,7 @@
"files": [
{
"path": "registry/example/bento-demo-vertical.tsx",
- "content": "import {\n BellIcon,\n CalendarIcon,\n FileTextIcon,\n GlobeIcon,\n InputIcon,\n} from \"@radix-ui/react-icons\";\n\nimport { BentoCard, BentoGrid } from \"@/registry/magicui/bento-grid\";\n\nconst features = [\n {\n Icon: FileTextIcon,\n name: \"Save your files\",\n description: \"We automatically save your files as you type.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -right-20 -top-20 opacity-60\" />,\n className: \"lg:row-start-1 lg:row-end-4 lg:col-start-2 lg:col-end-3\",\n },\n {\n Icon: InputIcon,\n name: \"Full text search\",\n description: \"Search through all your files in one place.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -right-20 -top-20 opacity-60\" />,\n className: \"lg:col-start-1 lg:col-end-2 lg:row-start-1 lg:row-end-3\",\n },\n {\n Icon: GlobeIcon,\n name: \"Multilingual\",\n description: \"Supports 100+ languages and counting.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -right-20 -top-20 opacity-60\" />,\n className: \"lg:col-start-1 lg:col-end-2 lg:row-start-3 lg:row-end-4\",\n },\n {\n Icon: CalendarIcon,\n name: \"Calendar\",\n description: \"Use the calendar to filter your files by date.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -right-20 -top-20 opacity-60\" />,\n className: \"lg:col-start-3 lg:col-end-3 lg:row-start-1 lg:row-end-2\",\n },\n {\n Icon: BellIcon,\n name: \"Notifications\",\n description:\n \"Get notified when someone shares a file or mentions you in a comment.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -right-20 -top-20 opacity-60\" />,\n className: \"lg:col-start-3 lg:col-end-3 lg:row-start-2 lg:row-end-4\",\n },\n];\n\nexport default function BentoDemo() {\n return (\n <BentoGrid className=\"lg:grid-rows-3\">\n {features.map((feature) => (\n <BentoCard key={feature.name} {...feature} />\n ))}\n </BentoGrid>\n );\n}\n",
+ "content": "import {\n BellIcon,\n CalendarIcon,\n FileTextIcon,\n GlobeIcon,\n InputIcon,\n} from \"@radix-ui/react-icons\"\n\nimport { BentoCard, BentoGrid } from \"@/registry/magicui/bento-grid\"\n\nconst features = [\n {\n Icon: FileTextIcon,\n name: \"Save your files\",\n description: \"We automatically save your files as you type.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -top-20 -right-20 opacity-60\" />,\n className: \"lg:row-start-1 lg:row-end-4 lg:col-start-2 lg:col-end-3\",\n },\n {\n Icon: InputIcon,\n name: \"Full text search\",\n description: \"Search through all your files in one place.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -top-20 -right-20 opacity-60\" />,\n className: \"lg:col-start-1 lg:col-end-2 lg:row-start-1 lg:row-end-3\",\n },\n {\n Icon: GlobeIcon,\n name: \"Multilingual\",\n description: \"Supports 100+ languages and counting.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -top-20 -right-20 opacity-60\" />,\n className: \"lg:col-start-1 lg:col-end-2 lg:row-start-3 lg:row-end-4\",\n },\n {\n Icon: CalendarIcon,\n name: \"Calendar\",\n description: \"Use the calendar to filter your files by date.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -top-20 -right-20 opacity-60\" />,\n className: \"lg:col-start-3 lg:col-end-3 lg:row-start-1 lg:row-end-2\",\n },\n {\n Icon: BellIcon,\n name: \"Notifications\",\n description:\n \"Get notified when someone shares a file or mentions you in a comment.\",\n href: \"/\",\n cta: \"Learn more\",\n background: <img className=\"absolute -top-20 -right-20 opacity-60\" />,\n className: \"lg:col-start-3 lg:col-end-3 lg:row-start-2 lg:row-end-4\",\n },\n]\n\nexport default function BentoDemo() {\n return (\n <BentoGrid className=\"lg:grid-rows-3\">\n {features.map((feature) => (\n <BentoCard key={feature.name} {...feature} />\n ))}\n </BentoGrid>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/bento-demo.json b/apps/www/public/r/bento-demo.json
index af8b01da..3104e8ec 100644
--- a/apps/www/public/r/bento-demo.json
+++ b/apps/www/public/r/bento-demo.json
@@ -18,7 +18,7 @@
"files": [
{
"path": "registry/example/bento-demo.tsx",
- "content": "import { CalendarIcon, FileTextIcon } from \"@radix-ui/react-icons\";\nimport { BellIcon, Share2Icon } from \"lucide-react\";\n\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { cn } from \"@/lib/utils\";\nimport AnimatedBeamMultipleOutputDemo from \"@/registry/example/animated-beam-multiple-outputs\";\nimport AnimatedListDemo from \"@/registry/example/animated-list-demo\";\nimport { BentoCard, BentoGrid } from \"@/registry/magicui/bento-grid\";\nimport { Marquee } from \"@/registry/magicui/marquee\";\n\nconst files = [\n {\n name: \"bitcoin.pdf\",\n body: \"Bitcoin is a cryptocurrency invented in 2008 by an unknown person or group of people using the name Satoshi Nakamoto.\",\n },\n {\n name: \"finances.xlsx\",\n body: \"A spreadsheet or worksheet is a file made of rows and columns that help sort data, arrange data easily, and calculate numerical data.\",\n },\n {\n name: \"logo.svg\",\n body: \"Scalable Vector Graphics is an Extensible Markup Language-based vector image format for two-dimensional graphics with support for interactivity and animation.\",\n },\n {\n name: \"keys.gpg\",\n body: \"GPG keys are used to encrypt and decrypt email, files, directories, and whole disk partitions and to authenticate messages.\",\n },\n {\n name: \"seed.txt\",\n body: \"A seed phrase, seed recovery phrase or backup seed phrase is a list of words which store all the information needed to recover Bitcoin funds on-chain.\",\n },\n];\n\nconst features = [\n {\n Icon: FileTextIcon,\n name: \"Save your files\",\n description: \"We automatically save your files as you type.\",\n href: \"#\",\n cta: \"Learn more\",\n className: \"col-span-3 lg:col-span-1\",\n background: (\n <Marquee\n pauseOnHover\n className=\"absolute top-10 [--duration:20s] [mask-image:linear-gradient(to_top,transparent_40%,#000_100%)] \"\n >\n {files.map((f, idx) => (\n <figure\n key={idx}\n className={cn(\n \"relative w-32 cursor-pointer overflow-hidden rounded-xl border p-4\",\n \"border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]\",\n \"dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]\",\n \"transform-gpu blur-[1px] transition-all duration-300 ease-out hover:blur-none\",\n )}\n >\n <div className=\"flex flex-row items-center gap-2\">\n <div className=\"flex flex-col\">\n <figcaption className=\"text-sm font-medium dark:text-white \">\n {f.name}\n </figcaption>\n </div>\n </div>\n <blockquote className=\"mt-2 text-xs\">{f.body}</blockquote>\n </figure>\n ))}\n </Marquee>\n ),\n },\n {\n Icon: BellIcon,\n name: \"Notifications\",\n description: \"Get notified when something happens.\",\n href: \"#\",\n cta: \"Learn more\",\n className: \"col-span-3 lg:col-span-2\",\n background: (\n <AnimatedListDemo className=\"absolute right-2 top-4 h-[300px] w-full scale-75 border-none transition-all duration-300 ease-out [mask-image:linear-gradient(to_top,transparent_10%,#000_100%)] group-hover:scale-90\" />\n ),\n },\n {\n Icon: Share2Icon,\n name: \"Integrations\",\n description: \"Supports 100+ integrations and counting.\",\n href: \"#\",\n cta: \"Learn more\",\n className: \"col-span-3 lg:col-span-2\",\n background: (\n <AnimatedBeamMultipleOutputDemo className=\"absolute right-2 top-4 h-[300px] border-none transition-all duration-300 ease-out [mask-image:linear-gradient(to_top,transparent_10%,#000_100%)] group-hover:scale-105\" />\n ),\n },\n {\n Icon: CalendarIcon,\n name: \"Calendar\",\n description: \"Use the calendar to filter your files by date.\",\n className: \"col-span-3 lg:col-span-1\",\n href: \"#\",\n cta: \"Learn more\",\n background: (\n <Calendar\n mode=\"single\"\n selected={new Date(2022, 4, 11, 0, 0, 0)}\n className=\"absolute right-0 top-10 origin-top scale-75 rounded-md border transition-all duration-300 ease-out [mask-image:linear-gradient(to_top,transparent_40%,#000_100%)] group-hover:scale-90\"\n />\n ),\n },\n];\n\nexport default function BentoDemo() {\n return (\n <BentoGrid>\n {features.map((feature, idx) => (\n <BentoCard key={idx} {...feature} />\n ))}\n </BentoGrid>\n );\n}\n",
+ "content": "import { CalendarIcon, FileTextIcon } from \"@radix-ui/react-icons\"\nimport { BellIcon, Share2Icon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Calendar } from \"@/components/ui/calendar\"\nimport AnimatedBeamMultipleOutputDemo from \"@/registry/example/animated-beam-multiple-outputs\"\nimport AnimatedListDemo from \"@/registry/example/animated-list-demo\"\nimport { BentoCard, BentoGrid } from \"@/registry/magicui/bento-grid\"\nimport { Marquee } from \"@/registry/magicui/marquee\"\n\nconst files = [\n {\n name: \"bitcoin.pdf\",\n body: \"Bitcoin is a cryptocurrency invented in 2008 by an unknown person or group of people using the name Satoshi Nakamoto.\",\n },\n {\n name: \"finances.xlsx\",\n body: \"A spreadsheet or worksheet is a file made of rows and columns that help sort data, arrange data easily, and calculate numerical data.\",\n },\n {\n name: \"logo.svg\",\n body: \"Scalable Vector Graphics is an Extensible Markup Language-based vector image format for two-dimensional graphics with support for interactivity and animation.\",\n },\n {\n name: \"keys.gpg\",\n body: \"GPG keys are used to encrypt and decrypt email, files, directories, and whole disk partitions and to authenticate messages.\",\n },\n {\n name: \"seed.txt\",\n body: \"A seed phrase, seed recovery phrase or backup seed phrase is a list of words which store all the information needed to recover Bitcoin funds on-chain.\",\n },\n]\n\nconst features = [\n {\n Icon: FileTextIcon,\n name: \"Save your files\",\n description: \"We automatically save your files as you type.\",\n href: \"#\",\n cta: \"Learn more\",\n className: \"col-span-3 lg:col-span-1\",\n background: (\n <Marquee\n pauseOnHover\n className=\"absolute top-10 [mask-image:linear-gradient(to_top,transparent_40%,#000_100%)] [--duration:20s]\"\n >\n {files.map((f, idx) => (\n <figure\n key={idx}\n className={cn(\n \"relative w-32 cursor-pointer overflow-hidden rounded-xl border p-4\",\n \"border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]\",\n \"dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]\",\n \"transform-gpu blur-[1px] transition-all duration-300 ease-out hover:blur-none\"\n )}\n >\n <div className=\"flex flex-row items-center gap-2\">\n <div className=\"flex flex-col\">\n <figcaption className=\"text-sm font-medium dark:text-white\">\n {f.name}\n </figcaption>\n </div>\n </div>\n <blockquote className=\"mt-2 text-xs\">{f.body}</blockquote>\n </figure>\n ))}\n </Marquee>\n ),\n },\n {\n Icon: BellIcon,\n name: \"Notifications\",\n description: \"Get notified when something happens.\",\n href: \"#\",\n cta: \"Learn more\",\n className: \"col-span-3 lg:col-span-2\",\n background: (\n <AnimatedListDemo className=\"absolute top-4 right-2 h-[300px] w-full scale-75 border-none [mask-image:linear-gradient(to_top,transparent_10%,#000_100%)] transition-all duration-300 ease-out group-hover:scale-90\" />\n ),\n },\n {\n Icon: Share2Icon,\n name: \"Integrations\",\n description: \"Supports 100+ integrations and counting.\",\n href: \"#\",\n cta: \"Learn more\",\n className: \"col-span-3 lg:col-span-2\",\n background: (\n <AnimatedBeamMultipleOutputDemo className=\"absolute top-4 right-2 h-[300px] border-none [mask-image:linear-gradient(to_top,transparent_10%,#000_100%)] transition-all duration-300 ease-out group-hover:scale-105\" />\n ),\n },\n {\n Icon: CalendarIcon,\n name: \"Calendar\",\n description: \"Use the calendar to filter your files by date.\",\n className: \"col-span-3 lg:col-span-1\",\n href: \"#\",\n cta: \"Learn more\",\n background: (\n <Calendar\n mode=\"single\"\n selected={new Date(2022, 4, 11, 0, 0, 0)}\n className=\"absolute top-10 right-0 origin-top scale-75 rounded-md border [mask-image:linear-gradient(to_top,transparent_40%,#000_100%)] transition-all duration-300 ease-out group-hover:scale-90\"\n />\n ),\n },\n]\n\nexport default function BentoDemo() {\n return (\n <BentoGrid>\n {features.map((feature, idx) => (\n <BentoCard key={idx} {...feature} />\n ))}\n </BentoGrid>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/bento-grid.json b/apps/www/public/r/bento-grid.json
index 797b78e6..16f1c9f9 100644
--- a/apps/www/public/r/bento-grid.json
+++ b/apps/www/public/r/bento-grid.json
@@ -13,7 +13,7 @@
"files": [
{
"path": "registry/magicui/bento-grid.tsx",
- "content": "import { ArrowRightIcon } from \"@radix-ui/react-icons\";\nimport { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\ninterface BentoGridProps extends ComponentPropsWithoutRef<\"div\"> {\n children: ReactNode;\n className?: string;\n}\n\ninterface BentoCardProps extends ComponentPropsWithoutRef<\"div\"> {\n name: string;\n className: string;\n background: ReactNode;\n Icon: React.ElementType;\n description: string;\n href: string;\n cta: string;\n}\n\nconst BentoGrid = ({ children, className, ...props }: BentoGridProps) => {\n return (\n <div\n className={cn(\n \"grid w-full auto-rows-[22rem] grid-cols-3 gap-4\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n};\n\nconst BentoCard = ({\n name,\n className,\n background,\n Icon,\n description,\n href,\n cta,\n ...props\n}: BentoCardProps) => (\n <div\n key={name}\n className={cn(\n \"group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl\",\n // light styles\n \"bg-background [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]\",\n // dark styles\n \"transform-gpu dark:bg-background dark:[border:1px_solid_rgba(255,255,255,.1)] dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset]\",\n className,\n )}\n {...props}\n >\n <div>{background}</div>\n <div className=\"p-4\">\n <div className=\"pointer-events-none z-10 flex transform-gpu flex-col gap-1 transition-all duration-300 lg:group-hover:-translate-y-10\">\n <Icon className=\"h-12 w-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75\" />\n <h3 className=\"text-xl font-semibold text-neutral-700 dark:text-neutral-300\">\n {name}\n </h3>\n <p className=\"max-w-lg text-neutral-400\">{description}</p>\n </div>\n\n <div\n className={cn(\n \"lg:hidden pointer-events-none flex w-full translate-y-0 transform-gpu flex-row items-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100\",\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n </div>\n\n <div\n className={cn(\n \"hidden lg:flex pointer-events-none absolute bottom-0 w-full translate-y-10 transform-gpu flex-row items-center p-4 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100\",\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n\n <div className=\"pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10\" />\n </div>\n);\n\nexport { BentoCard, BentoGrid };\n",
+ "content": "import { ComponentPropsWithoutRef, ReactNode } from \"react\"\nimport { ArrowRightIcon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ninterface BentoGridProps extends ComponentPropsWithoutRef<\"div\"> {\n children: ReactNode\n className?: string\n}\n\ninterface BentoCardProps extends ComponentPropsWithoutRef<\"div\"> {\n name: string\n className: string\n background: ReactNode\n Icon: React.ElementType\n description: string\n href: string\n cta: string\n}\n\nconst BentoGrid = ({ children, className, ...props }: BentoGridProps) => {\n return (\n <div\n className={cn(\n \"grid w-full auto-rows-[22rem] grid-cols-3 gap-4\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nconst BentoCard = ({\n name,\n className,\n background,\n Icon,\n description,\n href,\n cta,\n ...props\n}: BentoCardProps) => (\n <div\n key={name}\n className={cn(\n \"group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl\",\n // light styles\n \"bg-background [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]\",\n // dark styles\n \"dark:bg-background transform-gpu dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] dark:[border:1px_solid_rgba(255,255,255,.1)]\",\n className\n )}\n {...props}\n >\n <div>{background}</div>\n <div className=\"p-4\">\n <div className=\"pointer-events-none z-10 flex transform-gpu flex-col gap-1 transition-all duration-300 lg:group-hover:-translate-y-10\">\n <Icon className=\"h-12 w-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75\" />\n <h3 className=\"text-xl font-semibold text-neutral-700 dark:text-neutral-300\">\n {name}\n </h3>\n <p className=\"max-w-lg text-neutral-400\">{description}</p>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none flex w-full translate-y-0 transform-gpu flex-row items-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:hidden\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none absolute bottom-0 hidden w-full translate-y-10 transform-gpu flex-row items-center p-4 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:flex\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n\n <div className=\"pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10\" />\n </div>\n)\n\nexport { BentoCard, BentoGrid }\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/blur-fade-demo.json b/apps/www/public/r/blur-fade-demo.json
index 70497111..b396f974 100644
--- a/apps/www/public/r/blur-fade-demo.json
+++ b/apps/www/public/r/blur-fade-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/blur-fade-demo.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\nimport { BlurFade } from \"@/registry/magicui/blur-fade\";\n\nconst images = Array.from({ length: 9 }, (_, i) => {\n const isLandscape = i % 2 === 0;\n const width = isLandscape ? 800 : 600;\n const height = isLandscape ? 600 : 800;\n return `https://picsum.photos/seed/${i + 1}/${width}/${height}`;\n});\n\nexport default function BlurFadeDemo() {\n return (\n <section id=\"photos\">\n <div className=\"columns-2 gap-4 sm:columns-3\">\n {images.map((imageUrl, idx) => (\n <BlurFade key={imageUrl} delay={0.25 + idx * 0.05} inView>\n <img\n className=\"mb-4 size-full rounded-lg object-contain\"\n src={imageUrl}\n alt={`Random stock image ${idx + 1}`}\n />\n </BlurFade>\n ))}\n </div>\n </section>\n );\n}\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\nimport { BlurFade } from \"@/registry/magicui/blur-fade\"\n\nconst images = Array.from({ length: 9 }, (_, i) => {\n const isLandscape = i % 2 === 0\n const width = isLandscape ? 800 : 600\n const height = isLandscape ? 600 : 800\n return `https://picsum.photos/seed/${i + 1}/${width}/${height}`\n})\n\nexport default function BlurFadeDemo() {\n return (\n <section id=\"photos\">\n <div className=\"columns-2 gap-4 sm:columns-3\">\n {images.map((imageUrl, idx) => (\n <BlurFade key={imageUrl} delay={0.25 + idx * 0.05} inView>\n <img\n className=\"mb-4 size-full rounded-lg object-contain\"\n src={imageUrl}\n alt={`Random stock image ${idx + 1}`}\n />\n </BlurFade>\n ))}\n </div>\n </section>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/blur-fade-text-demo.json b/apps/www/public/r/blur-fade-text-demo.json
index f493bd8c..41a6004e 100644
--- a/apps/www/public/r/blur-fade-text-demo.json
+++ b/apps/www/public/r/blur-fade-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/blur-fade-text-demo.tsx",
- "content": "import { BlurFade } from \"@/registry/magicui/blur-fade\";\n\nexport default function BlurFadeTextDemo() {\n return (\n <section id=\"header\">\n <BlurFade delay={0.25} inView>\n <h2 className=\"text-3xl font-bold tracking-tighter sm:text-5xl xl:text-6xl/none\">\n Hello World 👋\n </h2>\n </BlurFade>\n <BlurFade delay={0.25 * 2} inView>\n <span className=\"text-pretty text-xl tracking-tighter sm:text-3xl xl:text-4xl/none\">\n Nice to meet you\n </span>\n </BlurFade>\n </section>\n );\n}\n",
+ "content": "import { BlurFade } from \"@/registry/magicui/blur-fade\"\n\nexport default function BlurFadeTextDemo() {\n return (\n <section id=\"header\">\n <BlurFade delay={0.25} inView>\n <h2 className=\"text-3xl font-bold tracking-tighter sm:text-5xl xl:text-6xl/none\">\n Hello World 👋\n </h2>\n </BlurFade>\n <BlurFade delay={0.25 * 2} inView>\n <span className=\"text-xl tracking-tighter text-pretty sm:text-3xl xl:text-4xl/none\">\n Nice to meet you\n </span>\n </BlurFade>\n </section>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/blur-fade.json b/apps/www/public/r/blur-fade.json
index 5d93404d..c86c300e 100644
--- a/apps/www/public/r/blur-fade.json
+++ b/apps/www/public/r/blur-fade.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/blur-fade.tsx",
- "content": "\"use client\";\n\nimport {\n AnimatePresence,\n motion,\n useInView,\n UseInViewOptions,\n Variants,\n MotionProps,\n} from \"motion/react\";\nimport { useRef } from \"react\";\n\ntype MarginType = UseInViewOptions[\"margin\"];\n\ninterface BlurFadeProps extends MotionProps {\n children: React.ReactNode;\n className?: string;\n variant?: {\n hidden: { y: number };\n visible: { y: number };\n };\n duration?: number;\n delay?: number;\n offset?: number;\n direction?: \"up\" | \"down\" | \"left\" | \"right\";\n inView?: boolean;\n inViewMargin?: MarginType;\n blur?: string;\n}\n\nexport function BlurFade({\n children,\n className,\n variant,\n duration = 0.4,\n delay = 0,\n offset = 6,\n direction = \"down\",\n inView = false,\n inViewMargin = \"-50px\",\n blur = \"6px\",\n ...props\n}: BlurFadeProps) {\n const ref = useRef(null);\n const inViewResult = useInView(ref, { once: true, margin: inViewMargin });\n const isInView = !inView || inViewResult;\n const defaultVariants: Variants = {\n hidden: {\n [direction === \"left\" || direction === \"right\" ? \"x\" : \"y\"]:\n direction === \"right\" || direction === \"down\" ? -offset : offset,\n opacity: 0,\n filter: `blur(${blur})`,\n },\n visible: {\n [direction === \"left\" || direction === \"right\" ? \"x\" : \"y\"]: 0,\n opacity: 1,\n filter: `blur(0px)`,\n },\n };\n const combinedVariants = variant || defaultVariants;\n return (\n <AnimatePresence>\n <motion.div\n ref={ref}\n initial=\"hidden\"\n animate={isInView ? \"visible\" : \"hidden\"}\n exit=\"hidden\"\n variants={combinedVariants}\n transition={{\n delay: 0.04 + delay,\n duration,\n ease: \"easeOut\",\n }}\n className={className}\n {...props}\n >\n {children}\n </motion.div>\n </AnimatePresence>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useRef } from \"react\"\nimport {\n AnimatePresence,\n motion,\n MotionProps,\n useInView,\n UseInViewOptions,\n Variants,\n} from \"motion/react\"\n\ntype MarginType = UseInViewOptions[\"margin\"]\n\ninterface BlurFadeProps extends MotionProps {\n children: React.ReactNode\n className?: string\n variant?: {\n hidden: { y: number }\n visible: { y: number }\n }\n duration?: number\n delay?: number\n offset?: number\n direction?: \"up\" | \"down\" | \"left\" | \"right\"\n inView?: boolean\n inViewMargin?: MarginType\n blur?: string\n}\n\nexport function BlurFade({\n children,\n className,\n variant,\n duration = 0.4,\n delay = 0,\n offset = 6,\n direction = \"down\",\n inView = false,\n inViewMargin = \"-50px\",\n blur = \"6px\",\n ...props\n}: BlurFadeProps) {\n const ref = useRef(null)\n const inViewResult = useInView(ref, { once: true, margin: inViewMargin })\n const isInView = !inView || inViewResult\n const defaultVariants: Variants = {\n hidden: {\n [direction === \"left\" || direction === \"right\" ? \"x\" : \"y\"]:\n direction === \"right\" || direction === \"down\" ? -offset : offset,\n opacity: 0,\n filter: `blur(${blur})`,\n },\n visible: {\n [direction === \"left\" || direction === \"right\" ? \"x\" : \"y\"]: 0,\n opacity: 1,\n filter: `blur(0px)`,\n },\n }\n const combinedVariants = variant || defaultVariants\n return (\n <AnimatePresence>\n <motion.div\n ref={ref}\n initial=\"hidden\"\n animate={isInView ? \"visible\" : \"hidden\"}\n exit=\"hidden\"\n variants={combinedVariants}\n transition={{\n delay: 0.04 + delay,\n duration,\n ease: \"easeOut\",\n }}\n className={className}\n {...props}\n >\n {children}\n </motion.div>\n </AnimatePresence>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/border-beam-demo-2.json b/apps/www/public/r/border-beam-demo-2.json
index fd2693c1..4eea8ee5 100644
--- a/apps/www/public/r/border-beam-demo-2.json
+++ b/apps/www/public/r/border-beam-demo-2.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/example/border-beam-demo-2.tsx",
- "content": "import { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { BorderBeam } from \"@/registry/magicui/border-beam\";\nimport { Play, SkipBack, SkipForward } from \"lucide-react\";\n\nexport default function MusicPlayer() {\n return (\n <Card className=\"relative w-[350px] overflow-hidden\">\n <CardHeader>\n <CardTitle>Now Playing</CardTitle>\n <CardDescription>Stairway to Heaven - Led Zeppelin</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"flex flex-col items-center gap-4\">\n <div className=\"h-48 w-48 rounded-lg bg-gradient-to-br from-purple-500 to-pink-500\" />\n <div className=\"h-1 w-full rounded-full bg-secondary\">\n <div className=\"h-full w-1/3 rounded-full bg-primary\" />\n </div>\n <div className=\"flex w-full justify-between text-sm text-muted-foreground\">\n <span>2:45</span>\n <span>8:02</span>\n </div>\n </div>\n </CardContent>\n <CardFooter className=\"flex justify-center gap-4\">\n <Button variant=\"outline\" size=\"icon\" className=\"rounded-full\">\n <SkipBack className=\"size-4\" />\n </Button>\n <Button size=\"icon\" className=\"rounded-full\">\n <Play className=\"size-4\" />\n </Button>\n <Button variant=\"outline\" size=\"icon\" className=\"rounded-full\">\n <SkipForward className=\"size-4\" />\n </Button>\n </CardFooter>\n <BorderBeam\n duration={6}\n size={400}\n className=\"from-transparent via-red-500 to-transparent\"\n />\n <BorderBeam\n duration={6}\n delay={3}\n size={400}\n borderWidth={2}\n className=\"from-transparent via-blue-500 to-transparent\"\n />\n </Card>\n );\n}\n",
+ "content": "import { Play, SkipBack, SkipForward } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { BorderBeam } from \"@/registry/magicui/border-beam\"\n\nexport default function MusicPlayer() {\n return (\n <Card className=\"relative w-[350px] overflow-hidden\">\n <CardHeader>\n <CardTitle>Now Playing</CardTitle>\n <CardDescription>Stairway to Heaven - Led Zeppelin</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"flex flex-col items-center gap-4\">\n <div className=\"h-48 w-48 rounded-lg bg-gradient-to-br from-purple-500 to-pink-500\" />\n <div className=\"bg-secondary h-1 w-full rounded-full\">\n <div className=\"bg-primary h-full w-1/3 rounded-full\" />\n </div>\n <div className=\"text-muted-foreground flex w-full justify-between text-sm\">\n <span>2:45</span>\n <span>8:02</span>\n </div>\n </div>\n </CardContent>\n <CardFooter className=\"flex justify-center gap-4\">\n <Button variant=\"outline\" size=\"icon\" className=\"rounded-full\">\n <SkipBack className=\"size-4\" />\n </Button>\n <Button size=\"icon\" className=\"rounded-full\">\n <Play className=\"size-4\" />\n </Button>\n <Button variant=\"outline\" size=\"icon\" className=\"rounded-full\">\n <SkipForward className=\"size-4\" />\n </Button>\n </CardFooter>\n <BorderBeam\n duration={6}\n size={400}\n className=\"from-transparent via-red-500 to-transparent\"\n />\n <BorderBeam\n duration={6}\n delay={3}\n size={400}\n borderWidth={2}\n className=\"from-transparent via-blue-500 to-transparent\"\n />\n </Card>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/border-beam-demo-3.json b/apps/www/public/r/border-beam-demo-3.json
index f6622b55..420b5353 100644
--- a/apps/www/public/r/border-beam-demo-3.json
+++ b/apps/www/public/r/border-beam-demo-3.json
@@ -14,7 +14,7 @@
"files": [
{
"path": "registry/example/border-beam-demo-3.tsx",
- "content": "import { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { BorderBeam } from \"@/registry/magicui/border-beam\";\n\nexport default function LoginForm() {\n return (\n <Card className=\"relative w-[350px] overflow-hidden\">\n <CardHeader>\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account.\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <div className=\"grid w-full items-center gap-4\">\n <div className=\"flex flex-col space-y-1.5\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"Enter your email\" />\n </div>\n <div className=\"flex flex-col space-y-1.5\">\n <Label htmlFor=\"password\">Password</Label>\n <Input\n id=\"password\"\n type=\"password\"\n placeholder=\"Enter your password\"\n />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter className=\"flex justify-between\">\n <Button variant=\"outline\">Register</Button>\n <Button>Login</Button>\n </CardFooter>\n <BorderBeam\n duration={4}\n size={300}\n reverse\n className=\"from-transparent via-green-500 to-transparent\"\n />\n </Card>\n );\n}\n",
+ "content": "import { Button } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { Input } from \"@/components/ui/input\"\nimport { Label } from \"@/components/ui/label\"\nimport { BorderBeam } from \"@/registry/magicui/border-beam\"\n\nexport default function LoginForm() {\n return (\n <Card className=\"relative w-[350px] overflow-hidden\">\n <CardHeader>\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account.\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <div className=\"grid w-full items-center gap-4\">\n <div className=\"flex flex-col space-y-1.5\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"Enter your email\" />\n </div>\n <div className=\"flex flex-col space-y-1.5\">\n <Label htmlFor=\"password\">Password</Label>\n <Input\n id=\"password\"\n type=\"password\"\n placeholder=\"Enter your password\"\n />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter className=\"flex justify-between\">\n <Button variant=\"outline\">Register</Button>\n <Button>Login</Button>\n </CardFooter>\n <BorderBeam\n duration={4}\n size={300}\n reverse\n className=\"from-transparent via-green-500 to-transparent\"\n />\n </Card>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/border-beam-demo-4.json b/apps/www/public/r/border-beam-demo-4.json
index be6efa58..1fb1e74b 100644
--- a/apps/www/public/r/border-beam-demo-4.json
+++ b/apps/www/public/r/border-beam-demo-4.json
@@ -11,7 +11,7 @@
"files": [
{
"path": "registry/example/border-beam-demo-4.tsx",
- "content": "import { Button } from \"@/components/ui/button\";\nimport { BorderBeam } from \"@/registry/magicui/border-beam\";\n\nexport default function Component() {\n return (\n <Button className=\"relative overflow-hidden\" size=\"lg\" variant=\"outline\">\n Buy Now\n <BorderBeam\n size={40}\n initialOffset={20}\n className=\"from-transparent via-yellow-500 to-transparent\"\n transition={{\n type: \"spring\",\n stiffness: 60,\n damping: 20,\n }}\n />\n </Button>\n );\n}\n",
+ "content": "import { Button } from \"@/components/ui/button\"\nimport { BorderBeam } from \"@/registry/magicui/border-beam\"\n\nexport default function Component() {\n return (\n <Button className=\"relative overflow-hidden\" size=\"lg\" variant=\"outline\">\n Buy Now\n <BorderBeam\n size={40}\n initialOffset={20}\n className=\"from-transparent via-yellow-500 to-transparent\"\n transition={{\n type: \"spring\",\n stiffness: 60,\n damping: 20,\n }}\n />\n </Button>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/border-beam-demo.json b/apps/www/public/r/border-beam-demo.json
index a920115c..ddf73091 100644
--- a/apps/www/public/r/border-beam-demo.json
+++ b/apps/www/public/r/border-beam-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/border-beam-demo.tsx",
- "content": "import { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { BorderBeam } from \"@/registry/magicui/border-beam\";\n\nexport default function Component() {\n return (\n <Card className=\"relative w-[350px] overflow-hidden\">\n <CardHeader>\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account.\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <div className=\"grid w-full items-center gap-4\">\n <div className=\"flex flex-col space-y-1.5\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"Enter your email\" />\n </div>\n <div className=\"flex flex-col space-y-1.5\">\n <Label htmlFor=\"password\">Password</Label>\n <Input\n id=\"password\"\n type=\"password\"\n placeholder=\"Enter your password\"\n />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter className=\"flex justify-between\">\n <Button variant=\"outline\">Register</Button>\n <Button>Login</Button>\n </CardFooter>\n <BorderBeam duration={8} size={100} />\n </Card>\n );\n}\n",
+ "content": "import { Button } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { Input } from \"@/components/ui/input\"\nimport { Label } from \"@/components/ui/label\"\nimport { BorderBeam } from \"@/registry/magicui/border-beam\"\n\nexport default function Component() {\n return (\n <Card className=\"relative w-[350px] overflow-hidden\">\n <CardHeader>\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account.\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <div className=\"grid w-full items-center gap-4\">\n <div className=\"flex flex-col space-y-1.5\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"Enter your email\" />\n </div>\n <div className=\"flex flex-col space-y-1.5\">\n <Label htmlFor=\"password\">Password</Label>\n <Input\n id=\"password\"\n type=\"password\"\n placeholder=\"Enter your password\"\n />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter className=\"flex justify-between\">\n <Button variant=\"outline\">Register</Button>\n <Button>Login</Button>\n </CardFooter>\n <BorderBeam duration={8} size={100} />\n </Card>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/border-beam.json b/apps/www/public/r/border-beam.json
index 7c113e79..7fcfe30e 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 { cn } from \"@/lib/utils\";\nimport { motion, MotionStyle, Transition } from \"motion/react\";\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-transparent [mask-clip:padding-box,border-box] [mask-composite:intersect] [mask-image:linear-gradient(transparent,transparent),linear-gradient(#000,#000)] border-(length:--border-beam-width)\"\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-gradient-to-l from-[var(--color-from)] via-[var(--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, 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-image:linear-gradient(transparent,transparent),linear-gradient(#000,#000)] [mask-composite: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-gradient-to-l from-[var(--color-from)] via-[var(--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/box-reveal-demo.json b/apps/www/public/r/box-reveal-demo.json
index 3d70a297..82f6f0cf 100644
--- a/apps/www/public/r/box-reveal-demo.json
+++ b/apps/www/public/r/box-reveal-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/box-reveal-demo.tsx",
- "content": "import { Button } from \"@/components/ui/button\";\nimport { BoxReveal } from \"@/registry/magicui/box-reveal\";\n\nexport default function BoxRevealDemo() {\n return (\n <div className=\"size-full max-w-lg items-center justify-center overflow-hidden pt-8\">\n <BoxReveal boxColor={\"#5046e6\"} duration={0.5}>\n <p className=\"text-[3.5rem] font-semibold\">\n Magic UI<span className=\"text-[#5046e6]\">.</span>\n </p>\n </BoxReveal>\n\n <BoxReveal boxColor={\"#5046e6\"} duration={0.5}>\n <h2 className=\"mt-[.5rem] text-[1rem]\">\n UI library for{\" \"}\n <span className=\"text-[#5046e6]\">Design Engineers</span>\n </h2>\n </BoxReveal>\n\n <BoxReveal boxColor={\"#5046e6\"} duration={0.5}>\n <div className=\"mt-6\">\n <p>\n -&gt; 20+ free and open-source animated components built with\n <span className=\"font-semibold text-[#5046e6]\">React</span>,\n <span className=\"font-semibold text-[#5046e6]\">Typescript</span>,\n <span className=\"font-semibold text-[#5046e6]\">Tailwind CSS</span>,\n and\n <span className=\"font-semibold text-[#5046e6]\">Motion</span>\n . <br />\n -&gt; 100% open-source, and customizable. <br />\n </p>\n </div>\n </BoxReveal>\n\n <BoxReveal boxColor={\"#5046e6\"} duration={0.5}>\n <Button className=\"mt-[1.6rem] bg-[#5046e6]\">Explore</Button>\n </BoxReveal>\n </div>\n );\n}\n",
+ "content": "import { Button } from \"@/components/ui/button\"\nimport { BoxReveal } from \"@/registry/magicui/box-reveal\"\n\nexport default function BoxRevealDemo() {\n return (\n <div className=\"size-full max-w-lg items-center justify-center overflow-hidden pt-8\">\n <BoxReveal boxColor={\"#5046e6\"} duration={0.5}>\n <p className=\"text-[3.5rem] font-semibold\">\n Magic UI<span className=\"text-[#5046e6]\">.</span>\n </p>\n </BoxReveal>\n\n <BoxReveal boxColor={\"#5046e6\"} duration={0.5}>\n <h2 className=\"mt-[.5rem] text-[1rem]\">\n UI library for{\" \"}\n <span className=\"text-[#5046e6]\">Design Engineers</span>\n </h2>\n </BoxReveal>\n\n <BoxReveal boxColor={\"#5046e6\"} duration={0.5}>\n <div className=\"mt-6\">\n <p>\n -&gt; 20+ free and open-source animated components built with\n <span className=\"font-semibold text-[#5046e6]\">React</span>,\n <span className=\"font-semibold text-[#5046e6]\">Typescript</span>,\n <span className=\"font-semibold text-[#5046e6]\">Tailwind CSS</span>,\n and\n <span className=\"font-semibold text-[#5046e6]\">Motion</span>\n . <br />\n -&gt; 100% open-source, and customizable. <br />\n </p>\n </div>\n </BoxReveal>\n\n <BoxReveal boxColor={\"#5046e6\"} duration={0.5}>\n <Button className=\"mt-[1.6rem] bg-[#5046e6]\">Explore</Button>\n </BoxReveal>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/box-reveal.json b/apps/www/public/r/box-reveal.json
index 145669dc..6001a769 100644
--- a/apps/www/public/r/box-reveal.json
+++ b/apps/www/public/r/box-reveal.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/box-reveal.tsx",
- "content": "\"use client\";\n\nimport { motion, useAnimation, useInView } from \"motion/react\";\nimport { useEffect, useRef } from \"react\";\n\nexport interface BoxRevealProps {\n children: React.ReactNode;\n width?: \"fit-content\" | \"100%\";\n boxColor?: string;\n duration?: number;\n}\n\nexport const BoxReveal = ({\n children,\n width = \"fit-content\",\n boxColor = \"#5046e6\",\n duration,\n}: BoxRevealProps) => {\n const mainControls = useAnimation();\n const slideControls = useAnimation();\n\n const ref = useRef(null);\n const isInView = useInView(ref, { once: true });\n\n useEffect(() => {\n if (isInView) {\n slideControls.start(\"visible\");\n mainControls.start(\"visible\");\n } else {\n slideControls.start(\"hidden\");\n mainControls.start(\"hidden\");\n }\n }, [isInView, mainControls, slideControls]);\n\n return (\n <div ref={ref} style={{ position: \"relative\", width, overflow: \"hidden\" }}>\n <motion.div\n variants={{\n hidden: { opacity: 0, y: 75 },\n visible: { opacity: 1, y: 0 },\n }}\n initial=\"hidden\"\n animate={mainControls}\n transition={{ duration: duration ? duration : 0.5, delay: 0.25 }}\n >\n {children}\n </motion.div>\n\n <motion.div\n variants={{\n hidden: { left: 0 },\n visible: { left: \"100%\" },\n }}\n initial=\"hidden\"\n animate={slideControls}\n transition={{ duration: duration ? duration : 0.5, ease: \"easeIn\" }}\n style={{\n position: \"absolute\",\n top: 4,\n bottom: 4,\n left: 0,\n right: 0,\n zIndex: 20,\n background: boxColor,\n }}\n />\n </div>\n );\n};\n",
+ "content": "\"use client\"\n\nimport { useEffect, useRef } from \"react\"\nimport { motion, useAnimation, useInView } from \"motion/react\"\n\nexport interface BoxRevealProps {\n children: React.ReactNode\n width?: \"fit-content\" | \"100%\"\n boxColor?: string\n duration?: number\n}\n\nexport const BoxReveal = ({\n children,\n width = \"fit-content\",\n boxColor = \"#5046e6\",\n duration,\n}: BoxRevealProps) => {\n const mainControls = useAnimation()\n const slideControls = useAnimation()\n\n const ref = useRef(null)\n const isInView = useInView(ref, { once: true })\n\n useEffect(() => {\n if (isInView) {\n slideControls.start(\"visible\")\n mainControls.start(\"visible\")\n } else {\n slideControls.start(\"hidden\")\n mainControls.start(\"hidden\")\n }\n }, [isInView, mainControls, slideControls])\n\n return (\n <div ref={ref} style={{ position: \"relative\", width, overflow: \"hidden\" }}>\n <motion.div\n variants={{\n hidden: { opacity: 0, y: 75 },\n visible: { opacity: 1, y: 0 },\n }}\n initial=\"hidden\"\n animate={mainControls}\n transition={{ duration: duration ? duration : 0.5, delay: 0.25 }}\n >\n {children}\n </motion.div>\n\n <motion.div\n variants={{\n hidden: { left: 0 },\n visible: { left: \"100%\" },\n }}\n initial=\"hidden\"\n animate={slideControls}\n transition={{ duration: duration ? duration : 0.5, ease: \"easeIn\" }}\n style={{\n position: \"absolute\",\n top: 4,\n bottom: 4,\n left: 0,\n right: 0,\n zIndex: 20,\n background: boxColor,\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.json
index dbd754af..397d97a8 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} components={components} {...props} />;\n};\n",
+ "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} components={components} {...props} />\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/code-comparison-demo.json b/apps/www/public/r/code-comparison-demo.json
index c8ec106f..8af02d04 100644
--- a/apps/www/public/r/code-comparison-demo.json
+++ b/apps/www/public/r/code-comparison-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/code-comparison-demo.tsx",
- "content": "import { CodeComparison } from \"@/registry/magicui/code-comparison\";\n\nconst beforeCode = `import { NextRequest } from 'next/server';\n\nexport const middleware = async (req: NextRequest) => {\n let user = undefined;\n let team = undefined;\n const token = req.headers.get('token'); \n\n if(req.nextUrl.pathname.startsWith('/auth')) {\n user = await getUserByToken(token);\n\n if(!user) {\n return NextResponse.redirect('/login');\n }\n }\n\n if(req.nextUrl.pathname.startsWith('/team')) {\n user = await getUserByToken(token);\n\n if(!user) {\n return NextResponse.redirect('/login');\n }\n\n const slug = req.nextUrl.query.slug;\n team = await getTeamBySlug(slug); // [!code highlight]\n\n if(!team) { // [!code highlight]\n return NextResponse.redirect('/'); // [!code highlight]\n } // [!code highlight]\n } // [!code highlight]\n\n return NextResponse.next(); // [!code highlight]\n}\n\nexport const config = {\n matcher: ['/((?!_next/|_static|_vercel|[\\\\w-]+\\\\.\\\\w+).*)'], // [!code highlight]\n};`;\n\nconst afterCode = `import { createMiddleware, type MiddlewareFunctionProps } from '@app/(auth)/auth/_middleware';\nimport { auth } from '@/app/(auth)/auth/_middleware'; // [!code --]\nimport { auth } from '@/app/(auth)/auth/_middleware'; // [!code ++]\nimport { team } from '@/app/(team)/team/_middleware';\n\nconst middlewares = {\n '/auth{/:path?}': auth,\n '/team{/:slug?}': [ auth, team ],\n};\n\nexport const middleware = createMiddleware(middlewares); // [!code focus]\n\nexport const config = {\n matcher: ['/((?!_next/|_static|_vercel|[\\\\w-]+\\\\.\\\\w+).*)'],\n};`;\n\nexport default function CodeComparisonDemo() {\n return (\n <CodeComparison\n beforeCode={beforeCode}\n afterCode={afterCode}\n language=\"typescript\"\n filename=\"middleware.ts\"\n lightTheme=\"github-light\"\n darkTheme=\"github-dark\"\n highlightColor=\"rgba(101, 117, 133, 0.16)\"\n />\n );\n}\n",
+ "content": "import { CodeComparison } from \"@/registry/magicui/code-comparison\"\n\nconst beforeCode = `import { NextRequest } from 'next/server';\n\nexport const middleware = async (req: NextRequest) => {\n let user = undefined;\n let team = undefined;\n const token = req.headers.get('token'); \n\n if(req.nextUrl.pathname.startsWith('/auth')) {\n user = await getUserByToken(token);\n\n if(!user) {\n return NextResponse.redirect('/login');\n }\n }\n\n if(req.nextUrl.pathname.startsWith('/team')) {\n user = await getUserByToken(token);\n\n if(!user) {\n return NextResponse.redirect('/login');\n }\n\n const slug = req.nextUrl.query.slug;\n team = await getTeamBySlug(slug); // [!code highlight]\n\n if(!team) { // [!code highlight]\n return NextResponse.redirect('/'); // [!code highlight]\n } // [!code highlight]\n } // [!code highlight]\n\n return NextResponse.next(); // [!code highlight]\n}\n\nexport const config = {\n matcher: ['/((?!_next/|_static|_vercel|[\\\\w-]+\\\\.\\\\w+).*)'], // [!code highlight]\n};`\n\nconst afterCode = `import { createMiddleware, type MiddlewareFunctionProps } from '@app/(auth)/auth/_middleware';\nimport { auth } from '@/app/(auth)/auth/_middleware'; // [!code --]\nimport { auth } from '@/app/(auth)/auth/_middleware'; // [!code ++]\nimport { team } from '@/app/(team)/team/_middleware';\n\nconst middlewares = {\n '/auth{/:path?}': auth,\n '/team{/:slug?}': [ auth, team ],\n};\n\nexport const middleware = createMiddleware(middlewares); // [!code focus]\n\nexport const config = {\n matcher: ['/((?!_next/|_static|_vercel|[\\\\w-]+\\\\.\\\\w+).*)'],\n};`\n\nexport default function CodeComparisonDemo() {\n return (\n <CodeComparison\n beforeCode={beforeCode}\n afterCode={afterCode}\n language=\"typescript\"\n filename=\"middleware.ts\"\n lightTheme=\"github-light\"\n darkTheme=\"github-dark\"\n highlightColor=\"rgba(101, 117, 133, 0.16)\"\n />\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/code-comparison.json b/apps/www/public/r/code-comparison.json
index 0b40a35d..33bf05f1 100644
--- a/apps/www/public/r/code-comparison.json
+++ b/apps/www/public/r/code-comparison.json
@@ -11,7 +11,7 @@
"files": [
{
"path": "registry/magicui/code-comparison.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n transformerNotationDiff,\n transformerNotationFocus,\n} from \"@shikijs/transformers\";\nimport { FileIcon } from \"lucide-react\";\nimport { useTheme } from \"next-themes\";\nimport { useEffect, useState, useMemo } from \"react\";\n\ninterface CodeComparisonProps {\n beforeCode: string;\n afterCode: string;\n language: string;\n filename: string;\n lightTheme: string;\n darkTheme: string;\n highlightColor?: string;\n}\n\nexport function CodeComparison({\n beforeCode,\n afterCode,\n language,\n filename,\n lightTheme,\n darkTheme,\n highlightColor = \"#ff3333\",\n}: CodeComparisonProps) {\n const { theme, systemTheme } = useTheme();\n const [highlightedBefore, setHighlightedBefore] = useState(\"\");\n const [highlightedAfter, setHighlightedAfter] = useState(\"\");\n const [hasLeftFocus, setHasLeftFocus] = useState(false);\n const [hasRightFocus, setHasRightFocus] = useState(false);\n\n const selectedTheme = useMemo(() => {\n const currentTheme = theme === \"system\" ? systemTheme : theme;\n return currentTheme === \"dark\" ? darkTheme : lightTheme;\n }, [theme, systemTheme, darkTheme, lightTheme]);\n\n useEffect(() => {\n if (highlightedBefore || highlightedAfter) {\n setHasLeftFocus(highlightedBefore.includes('class=\"line focused\"'));\n setHasRightFocus(highlightedAfter.includes('class=\"line focused\"'));\n }\n }, [highlightedBefore, highlightedAfter]);\n\n useEffect(() => {\n async function highlightCode() {\n try {\n const { codeToHtml } = await import(\"shiki\");\n const { transformerNotationHighlight } = await import(\n \"@shikijs/transformers\"\n );\n\n const before = await codeToHtml(beforeCode, {\n lang: language,\n theme: selectedTheme,\n transformers: [\n transformerNotationHighlight({ matchAlgorithm: \"v3\" }),\n transformerNotationDiff({ matchAlgorithm: \"v3\" }),\n transformerNotationFocus({ matchAlgorithm: \"v3\" }),\n ],\n });\n const after = await codeToHtml(afterCode, {\n lang: language,\n theme: selectedTheme,\n transformers: [\n transformerNotationHighlight({ matchAlgorithm: \"v3\" }),\n transformerNotationDiff({ matchAlgorithm: \"v3\" }),\n transformerNotationFocus({ matchAlgorithm: \"v3\" }),\n ],\n });\n setHighlightedBefore(before);\n setHighlightedAfter(after);\n } catch (error) {\n console.error(\"Error highlighting code:\", error);\n setHighlightedBefore(`<pre>${beforeCode}</pre>`);\n setHighlightedAfter(`<pre>${afterCode}</pre>`);\n }\n }\n highlightCode();\n }, [beforeCode, afterCode, language, selectedTheme]);\n\n const renderCode = (code: string, highlighted: string) => {\n if (highlighted) {\n return (\n <div\n style={{ \"--highlight-color\": highlightColor } as React.CSSProperties}\n className={cn(\n \"h-full w-full overflow-auto bg-background font-mono text-xs\",\n \"[&>pre]:h-full [&>pre]:!w-screen [&>pre]:py-2\",\n \"[&>pre>code]:!inline-block [&>pre>code]:!w-full\",\n \"[&>pre>code>span]:!inline-block [&>pre>code>span]:w-full [&>pre>code>span]:px-4 [&>pre>code>span]:py-0.5\",\n \"[&>pre>code>.highlighted]:inline-block [&>pre>code>.highlighted]:w-full [&>pre>code>.highlighted]:!bg-[var(--highlight-color)]\",\n \"group-hover/left:[&>pre>code>:not(.focused)]:!opacity-100 group-hover/left:[&>pre>code>:not(.focused)]:!blur-none\",\n \"group-hover/right:[&>pre>code>:not(.focused)]:!opacity-100 group-hover/right:[&>pre>code>:not(.focused)]:!blur-none\",\n \"[&>pre>code>.add]:bg-[rgba(16,185,129,.16)] [&>pre>code>.remove]:bg-[rgba(244,63,94,.16)]\",\n \"group-hover/left:[&>pre>code>:not(.focused)]:transition-all group-hover/left:[&>pre>code>:not(.focused)]:duration-300\",\n \"group-hover/right:[&>pre>code>:not(.focused)]:transition-all group-hover/right:[&>pre>code>:not(.focused)]:duration-300\",\n )}\n dangerouslySetInnerHTML={{ __html: highlighted }}\n />\n );\n } else {\n return (\n <pre className=\"h-full overflow-auto break-all bg-background p-4 font-mono text-xs text-foreground\">\n {code}\n </pre>\n );\n }\n };\n\n return (\n <div className=\"mx-auto w-full max-w-5xl\">\n <div className=\"group relative w-full overflow-hidden rounded-md border border-border\">\n <div className=\"relative grid md:grid-cols-2\">\n <div\n className={cn(\n \"leftside group/left border-primary/20 md:border-r\",\n hasLeftFocus &&\n \"[&>div>pre>code>:not(.focused)]:!opacity-50 [&>div>pre>code>:not(.focused)]:!blur-[0.095rem]\",\n \"[&>div>pre>code>:not(.focused)]:transition-all [&>div>pre>code>:not(.focused)]:duration-300\",\n )}\n >\n <div className=\"flex items-center border-b border-primary/20 bg-accent p-2 text-sm text-foreground\">\n <FileIcon className=\"mr-2 h-4 w-4\" />\n {filename}\n <span className=\"ml-auto hidden md:block\">before</span>\n </div>\n {renderCode(beforeCode, highlightedBefore)}\n </div>\n <div\n className={cn(\n \"rightside group/right border-t border-primary/20 md:border-t-0\",\n hasRightFocus &&\n \"[&>div>pre>code>:not(.focused)]:!opacity-50 [&>div>pre>code>:not(.focused)]:!blur-[0.095rem]\",\n \"[&>div>pre>code>:not(.focused)]:transition-all [&>div>pre>code>:not(.focused)]:duration-300\",\n )}\n >\n <div className=\"flex items-center border-b border-primary/20 bg-accent p-2 text-sm text-foreground\">\n <FileIcon className=\"mr-2 h-4 w-4\" />\n {filename}\n <span className=\"ml-auto hidden md:block\">after</span>\n </div>\n {renderCode(afterCode, highlightedAfter)}\n </div>\n </div>\n <div className=\"absolute left-1/2 top-1/2 hidden h-8 w-8 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md border border-primary/20 bg-accent text-xs text-foreground md:flex\">\n VS\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useMemo, useState } from \"react\"\nimport {\n transformerNotationDiff,\n transformerNotationFocus,\n} from \"@shikijs/transformers\"\nimport { FileIcon } from \"lucide-react\"\nimport { useTheme } from \"next-themes\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface CodeComparisonProps {\n beforeCode: string\n afterCode: string\n language: string\n filename: string\n lightTheme: string\n darkTheme: string\n highlightColor?: string\n}\n\nexport function CodeComparison({\n beforeCode,\n afterCode,\n language,\n filename,\n lightTheme,\n darkTheme,\n highlightColor = \"#ff3333\",\n}: CodeComparisonProps) {\n const { theme, systemTheme } = useTheme()\n const [highlightedBefore, setHighlightedBefore] = useState(\"\")\n const [highlightedAfter, setHighlightedAfter] = useState(\"\")\n const [hasLeftFocus, setHasLeftFocus] = useState(false)\n const [hasRightFocus, setHasRightFocus] = useState(false)\n\n const selectedTheme = useMemo(() => {\n const currentTheme = theme === \"system\" ? systemTheme : theme\n return currentTheme === \"dark\" ? darkTheme : lightTheme\n }, [theme, systemTheme, darkTheme, lightTheme])\n\n useEffect(() => {\n if (highlightedBefore || highlightedAfter) {\n setHasLeftFocus(highlightedBefore.includes('class=\"line focused\"'))\n setHasRightFocus(highlightedAfter.includes('class=\"line focused\"'))\n }\n }, [highlightedBefore, highlightedAfter])\n\n useEffect(() => {\n async function highlightCode() {\n try {\n const { codeToHtml } = await import(\"shiki\")\n const { transformerNotationHighlight } = await import(\n \"@shikijs/transformers\"\n )\n\n const before = await codeToHtml(beforeCode, {\n lang: language,\n theme: selectedTheme,\n transformers: [\n transformerNotationHighlight({ matchAlgorithm: \"v3\" }),\n transformerNotationDiff({ matchAlgorithm: \"v3\" }),\n transformerNotationFocus({ matchAlgorithm: \"v3\" }),\n ],\n })\n const after = await codeToHtml(afterCode, {\n lang: language,\n theme: selectedTheme,\n transformers: [\n transformerNotationHighlight({ matchAlgorithm: \"v3\" }),\n transformerNotationDiff({ matchAlgorithm: \"v3\" }),\n transformerNotationFocus({ matchAlgorithm: \"v3\" }),\n ],\n })\n setHighlightedBefore(before)\n setHighlightedAfter(after)\n } catch (error) {\n console.error(\"Error highlighting code:\", error)\n setHighlightedBefore(`<pre>${beforeCode}</pre>`)\n setHighlightedAfter(`<pre>${afterCode}</pre>`)\n }\n }\n highlightCode()\n }, [beforeCode, afterCode, language, selectedTheme])\n\n const renderCode = (code: string, highlighted: string) => {\n if (highlighted) {\n return (\n <div\n style={{ \"--highlight-color\": highlightColor } as React.CSSProperties}\n className={cn(\n \"bg-background h-full w-full overflow-auto font-mono text-xs\",\n \"[&>pre]:h-full [&>pre]:!w-screen [&>pre]:py-2\",\n \"[&>pre>code]:!inline-block [&>pre>code]:!w-full\",\n \"[&>pre>code>span]:!inline-block [&>pre>code>span]:w-full [&>pre>code>span]:px-4 [&>pre>code>span]:py-0.5\",\n \"[&>pre>code>.highlighted]:inline-block [&>pre>code>.highlighted]:w-full [&>pre>code>.highlighted]:!bg-[var(--highlight-color)]\",\n \"group-hover/left:[&>pre>code>:not(.focused)]:!opacity-100 group-hover/left:[&>pre>code>:not(.focused)]:!blur-none\",\n \"group-hover/right:[&>pre>code>:not(.focused)]:!opacity-100 group-hover/right:[&>pre>code>:not(.focused)]:!blur-none\",\n \"[&>pre>code>.add]:bg-[rgba(16,185,129,.16)] [&>pre>code>.remove]:bg-[rgba(244,63,94,.16)]\",\n \"group-hover/left:[&>pre>code>:not(.focused)]:transition-all group-hover/left:[&>pre>code>:not(.focused)]:duration-300\",\n \"group-hover/right:[&>pre>code>:not(.focused)]:transition-all group-hover/right:[&>pre>code>:not(.focused)]:duration-300\"\n )}\n dangerouslySetInnerHTML={{ __html: highlighted }}\n />\n )\n } else {\n return (\n <pre className=\"bg-background text-foreground h-full overflow-auto p-4 font-mono text-xs break-all\">\n {code}\n </pre>\n )\n }\n }\n\n return (\n <div className=\"mx-auto w-full max-w-5xl\">\n <div className=\"group border-border relative w-full overflow-hidden rounded-md border\">\n <div className=\"relative grid md:grid-cols-2\">\n <div\n className={cn(\n \"leftside group/left border-primary/20 md:border-r\",\n hasLeftFocus &&\n \"[&>div>pre>code>:not(.focused)]:!opacity-50 [&>div>pre>code>:not(.focused)]:!blur-[0.095rem]\",\n \"[&>div>pre>code>:not(.focused)]:transition-all [&>div>pre>code>:not(.focused)]:duration-300\"\n )}\n >\n <div className=\"border-primary/20 bg-accent text-foreground flex items-center border-b p-2 text-sm\">\n <FileIcon className=\"mr-2 h-4 w-4\" />\n {filename}\n <span className=\"ml-auto hidden md:block\">before</span>\n </div>\n {renderCode(beforeCode, highlightedBefore)}\n </div>\n <div\n className={cn(\n \"rightside group/right border-primary/20 border-t md:border-t-0\",\n hasRightFocus &&\n \"[&>div>pre>code>:not(.focused)]:!opacity-50 [&>div>pre>code>:not(.focused)]:!blur-[0.095rem]\",\n \"[&>div>pre>code>:not(.focused)]:transition-all [&>div>pre>code>:not(.focused)]:duration-300\"\n )}\n >\n <div className=\"border-primary/20 bg-accent text-foreground flex items-center border-b p-2 text-sm\">\n <FileIcon className=\"mr-2 h-4 w-4\" />\n {filename}\n <span className=\"ml-auto hidden md:block\">after</span>\n </div>\n {renderCode(afterCode, highlightedAfter)}\n </div>\n </div>\n <div className=\"border-primary/20 bg-accent text-foreground absolute top-1/2 left-1/2 hidden h-8 w-8 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md border text-xs md:flex\">\n VS\n </div>\n </div>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/comic-text-demo.json b/apps/www/public/r/comic-text-demo.json
index 5cd565b4..95dbfcfb 100644
--- a/apps/www/public/r/comic-text-demo.json
+++ b/apps/www/public/r/comic-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/comic-text-demo.tsx",
- "content": "import { ComicText } from \"@/registry/magicui/comic-text\";\n\nexport default function ComicTextDemo() {\n return (\n <div className=\"space-y-8 text-center\">\n <ComicText fontSize={5}>BOOM!</ComicText>\n </div>\n );\n}\n",
+ "content": "import { ComicText } from \"@/registry/magicui/comic-text\"\n\nexport default function ComicTextDemo() {\n return (\n <div className=\"space-y-8 text-center\">\n <ComicText fontSize={5}>BOOM!</ComicText>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/comic-text.json b/apps/www/public/r/comic-text.json
index 7fd31c56..42b1728a 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\";\nimport { cn } from \"@/lib/utils\";\nimport { motion } from \"motion/react\";\nimport { CSSProperties } from \"react\";\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(\"select-none text-center\", 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 { 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/confetti-basic-cannon.json b/apps/www/public/r/confetti-basic-cannon.json
index 66861e02..243a7847 100644
--- a/apps/www/public/r/confetti-basic-cannon.json
+++ b/apps/www/public/r/confetti-basic-cannon.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/confetti-basic-cannon.tsx",
- "content": "import { ConfettiButton } from \"@/registry/magicui/confetti\";\n\nexport default function ConfettiButtonDemo() {\n return (\n <div className=\"relative\">\n <ConfettiButton>Confetti 🎉</ConfettiButton>\n </div>\n );\n}\n",
+ "content": "import { ConfettiButton } from \"@/registry/magicui/confetti\"\n\nexport default function ConfettiButtonDemo() {\n return (\n <div className=\"relative\">\n <ConfettiButton>Confetti 🎉</ConfettiButton>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/confetti-custom-shapes.json b/apps/www/public/r/confetti-custom-shapes.json
index 117dbd91..b89babe9 100644
--- a/apps/www/public/r/confetti-custom-shapes.json
+++ b/apps/www/public/r/confetti-custom-shapes.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/confetti-custom-shapes.tsx",
- "content": "\"use client\";\n\nimport confetti from \"canvas-confetti\";\n\nimport { Button } from \"@/components/ui/button\";\n\nexport default function ConfettiCustomShapes() {\n const handleClick = () => {\n const scalar = 2;\n const triangle = confetti.shapeFromPath({\n path: \"M0 10 L5 0 L10 10z\",\n });\n const square = confetti.shapeFromPath({\n path: \"M0 0 L10 0 L10 10 L0 10 Z\",\n });\n const coin = confetti.shapeFromPath({\n path: \"M5 0 A5 5 0 1 0 5 10 A5 5 0 1 0 5 0 Z\",\n });\n const tree = confetti.shapeFromPath({\n path: \"M5 0 L10 10 L0 10 Z\",\n });\n\n const defaults = {\n spread: 360,\n ticks: 60,\n gravity: 0,\n decay: 0.96,\n startVelocity: 20,\n shapes: [triangle, square, coin, tree],\n scalar,\n };\n\n const shoot = () => {\n confetti({\n ...defaults,\n particleCount: 30,\n });\n\n confetti({\n ...defaults,\n particleCount: 5,\n });\n\n confetti({\n ...defaults,\n particleCount: 15,\n scalar: scalar / 2,\n shapes: [\"circle\"],\n });\n };\n\n setTimeout(shoot, 0);\n setTimeout(shoot, 100);\n setTimeout(shoot, 200);\n };\n\n return (\n <div className=\"relative flex items-center justify-center\">\n <Button onClick={handleClick}>Trigger Shapes</Button>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport confetti from \"canvas-confetti\"\n\nimport { Button } from \"@/components/ui/button\"\n\nexport default function ConfettiCustomShapes() {\n const handleClick = () => {\n const scalar = 2\n const triangle = confetti.shapeFromPath({\n path: \"M0 10 L5 0 L10 10z\",\n })\n const square = confetti.shapeFromPath({\n path: \"M0 0 L10 0 L10 10 L0 10 Z\",\n })\n const coin = confetti.shapeFromPath({\n path: \"M5 0 A5 5 0 1 0 5 10 A5 5 0 1 0 5 0 Z\",\n })\n const tree = confetti.shapeFromPath({\n path: \"M5 0 L10 10 L0 10 Z\",\n })\n\n const defaults = {\n spread: 360,\n ticks: 60,\n gravity: 0,\n decay: 0.96,\n startVelocity: 20,\n shapes: [triangle, square, coin, tree],\n scalar,\n }\n\n const shoot = () => {\n confetti({\n ...defaults,\n particleCount: 30,\n })\n\n confetti({\n ...defaults,\n particleCount: 5,\n })\n\n confetti({\n ...defaults,\n particleCount: 15,\n scalar: scalar / 2,\n shapes: [\"circle\"],\n })\n }\n\n setTimeout(shoot, 0)\n setTimeout(shoot, 100)\n setTimeout(shoot, 200)\n }\n\n return (\n <div className=\"relative flex items-center justify-center\">\n <Button onClick={handleClick}>Trigger Shapes</Button>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/confetti-demo.json b/apps/www/public/r/confetti-demo.json
index b2716b58..edb7d41c 100644
--- a/apps/www/public/r/confetti-demo.json
+++ b/apps/www/public/r/confetti-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/confetti-demo.tsx",
- "content": "\"use client\";\n\nimport { useRef } from \"react\";\n\nimport { Confetti, type ConfettiRef } from \"@/registry/magicui/confetti\";\n\nexport default function ConfettiDemo() {\n const confettiRef = useRef<ConfettiRef>(null);\n\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <span className=\"pointer-events-none whitespace-pre-wrap bg-gradient-to-b from-black to-gray-300/80 bg-clip-text text-center text-8xl font-semibold leading-none text-transparent dark:from-white dark:to-slate-900/10\">\n Confetti\n </span>\n\n <Confetti\n ref={confettiRef}\n className=\"absolute left-0 top-0 z-0 size-full\"\n onMouseEnter={() => {\n confettiRef.current?.fire({});\n }}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useRef } from \"react\"\n\nimport { Confetti, type ConfettiRef } from \"@/registry/magicui/confetti\"\n\nexport default function ConfettiDemo() {\n const confettiRef = useRef<ConfettiRef>(null)\n\n return (\n <div className=\"bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <span className=\"pointer-events-none bg-gradient-to-b from-black to-gray-300/80 bg-clip-text text-center text-8xl leading-none font-semibold whitespace-pre-wrap text-transparent dark:from-white dark:to-slate-900/10\">\n Confetti\n </span>\n\n <Confetti\n ref={confettiRef}\n className=\"absolute top-0 left-0 z-0 size-full\"\n onMouseEnter={() => {\n confettiRef.current?.fire({})\n }}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/confetti-emoji.json b/apps/www/public/r/confetti-emoji.json
index 545629d5..84f33a44 100644
--- a/apps/www/public/r/confetti-emoji.json
+++ b/apps/www/public/r/confetti-emoji.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/confetti-emoji.tsx",
- "content": "\"use client\";\n\nimport confetti from \"canvas-confetti\";\n\nimport { Button } from \"@/components/ui/button\";\n\nexport default function ConfettiEmoji() {\n const handleClick = () => {\n const scalar = 2;\n const unicorn = confetti.shapeFromText({ text: \"🦄\", scalar });\n\n const defaults = {\n spread: 360,\n ticks: 60,\n gravity: 0,\n decay: 0.96,\n startVelocity: 20,\n shapes: [unicorn],\n scalar,\n };\n\n const shoot = () => {\n confetti({\n ...defaults,\n particleCount: 30,\n });\n\n confetti({\n ...defaults,\n particleCount: 5,\n });\n\n confetti({\n ...defaults,\n particleCount: 15,\n scalar: scalar / 2,\n shapes: [\"circle\"],\n });\n };\n\n setTimeout(shoot, 0);\n setTimeout(shoot, 100);\n setTimeout(shoot, 200);\n };\n\n return (\n <div className=\"relative justify-center\">\n <Button onClick={handleClick}>Trigger Emoji</Button>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport confetti from \"canvas-confetti\"\n\nimport { Button } from \"@/components/ui/button\"\n\nexport default function ConfettiEmoji() {\n const handleClick = () => {\n const scalar = 2\n const unicorn = confetti.shapeFromText({ text: \"🦄\", scalar })\n\n const defaults = {\n spread: 360,\n ticks: 60,\n gravity: 0,\n decay: 0.96,\n startVelocity: 20,\n shapes: [unicorn],\n scalar,\n }\n\n const shoot = () => {\n confetti({\n ...defaults,\n particleCount: 30,\n })\n\n confetti({\n ...defaults,\n particleCount: 5,\n })\n\n confetti({\n ...defaults,\n particleCount: 15,\n scalar: scalar / 2,\n shapes: [\"circle\"],\n })\n }\n\n setTimeout(shoot, 0)\n setTimeout(shoot, 100)\n setTimeout(shoot, 200)\n }\n\n return (\n <div className=\"relative justify-center\">\n <Button onClick={handleClick}>Trigger Emoji</Button>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/confetti-fireworks.json b/apps/www/public/r/confetti-fireworks.json
index 054a746c..f693a62a 100644
--- a/apps/www/public/r/confetti-fireworks.json
+++ b/apps/www/public/r/confetti-fireworks.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/confetti-fireworks.tsx",
- "content": "\"use client\";\n\nimport confetti from \"canvas-confetti\";\n\nimport { Button } from \"@/components/ui/button\";\n\nexport default function ConfettiFireworks() {\n const handleClick = () => {\n const duration = 5 * 1000;\n const animationEnd = Date.now() + duration;\n const defaults = { startVelocity: 30, spread: 360, ticks: 60, zIndex: 0 };\n\n const randomInRange = (min: number, max: number) =>\n Math.random() * (max - min) + min;\n\n const interval = window.setInterval(() => {\n const timeLeft = animationEnd - Date.now();\n\n if (timeLeft <= 0) {\n return clearInterval(interval);\n }\n\n const particleCount = 50 * (timeLeft / duration);\n confetti({\n ...defaults,\n particleCount,\n origin: { x: randomInRange(0.1, 0.3), y: Math.random() - 0.2 },\n });\n confetti({\n ...defaults,\n particleCount,\n origin: { x: randomInRange(0.7, 0.9), y: Math.random() - 0.2 },\n });\n }, 250);\n };\n\n return (\n <div className=\"relative\">\n <Button onClick={handleClick}>Trigger Fireworks</Button>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport confetti from \"canvas-confetti\"\n\nimport { Button } from \"@/components/ui/button\"\n\nexport default function ConfettiFireworks() {\n const handleClick = () => {\n const duration = 5 * 1000\n const animationEnd = Date.now() + duration\n const defaults = { startVelocity: 30, spread: 360, ticks: 60, zIndex: 0 }\n\n const randomInRange = (min: number, max: number) =>\n Math.random() * (max - min) + min\n\n const interval = window.setInterval(() => {\n const timeLeft = animationEnd - Date.now()\n\n if (timeLeft <= 0) {\n return clearInterval(interval)\n }\n\n const particleCount = 50 * (timeLeft / duration)\n confetti({\n ...defaults,\n particleCount,\n origin: { x: randomInRange(0.1, 0.3), y: Math.random() - 0.2 },\n })\n confetti({\n ...defaults,\n particleCount,\n origin: { x: randomInRange(0.7, 0.9), y: Math.random() - 0.2 },\n })\n }, 250)\n }\n\n return (\n <div className=\"relative\">\n <Button onClick={handleClick}>Trigger Fireworks</Button>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/confetti-random-direction.json b/apps/www/public/r/confetti-random-direction.json
index 10c2c89b..8bd6ff2b 100644
--- a/apps/www/public/r/confetti-random-direction.json
+++ b/apps/www/public/r/confetti-random-direction.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/confetti-random-direction.tsx",
- "content": "import { ConfettiButton } from \"@/registry/magicui/confetti\";\n\nexport default function ConfettiButtonDemo() {\n return (\n <div className=\"relative\">\n <ConfettiButton\n options={{\n get angle() {\n return Math.random() * 360;\n },\n }}\n >\n Random Confetti 🎉\n </ConfettiButton>\n </div>\n );\n}\n",
+ "content": "import { ConfettiButton } from \"@/registry/magicui/confetti\"\n\nexport default function ConfettiButtonDemo() {\n return (\n <div className=\"relative\">\n <ConfettiButton\n options={{\n get angle() {\n return Math.random() * 360\n },\n }}\n >\n Random Confetti 🎉\n </ConfettiButton>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/confetti-side-cannons.json b/apps/www/public/r/confetti-side-cannons.json
index e569a57e..4530ada1 100644
--- a/apps/www/public/r/confetti-side-cannons.json
+++ b/apps/www/public/r/confetti-side-cannons.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/confetti-side-cannons.tsx",
- "content": "\"use client\";\n\nimport confetti from \"canvas-confetti\";\n\nimport { Button } from \"@/components/ui/button\";\n\nexport default function ConfettiSideCannons() {\n const handleClick = () => {\n const end = Date.now() + 3 * 1000; // 3 seconds\n const colors = [\"#a786ff\", \"#fd8bbc\", \"#eca184\", \"#f8deb1\"];\n\n const frame = () => {\n if (Date.now() > end) return;\n\n confetti({\n particleCount: 2,\n angle: 60,\n spread: 55,\n startVelocity: 60,\n origin: { x: 0, y: 0.5 },\n colors: colors,\n });\n confetti({\n particleCount: 2,\n angle: 120,\n spread: 55,\n startVelocity: 60,\n origin: { x: 1, y: 0.5 },\n colors: colors,\n });\n\n requestAnimationFrame(frame);\n };\n\n frame();\n };\n\n return (\n <div className=\"relative\">\n <Button onClick={handleClick}>Trigger Side Cannons</Button>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport confetti from \"canvas-confetti\"\n\nimport { Button } from \"@/components/ui/button\"\n\nexport default function ConfettiSideCannons() {\n const handleClick = () => {\n const end = Date.now() + 3 * 1000 // 3 seconds\n const colors = [\"#a786ff\", \"#fd8bbc\", \"#eca184\", \"#f8deb1\"]\n\n const frame = () => {\n if (Date.now() > end) return\n\n confetti({\n particleCount: 2,\n angle: 60,\n spread: 55,\n startVelocity: 60,\n origin: { x: 0, y: 0.5 },\n colors: colors,\n })\n confetti({\n particleCount: 2,\n angle: 120,\n spread: 55,\n startVelocity: 60,\n origin: { x: 1, y: 0.5 },\n colors: colors,\n })\n\n requestAnimationFrame(frame)\n }\n\n frame()\n }\n\n return (\n <div className=\"relative\">\n <Button onClick={handleClick}>Trigger Side Cannons</Button>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/confetti-stars.json b/apps/www/public/r/confetti-stars.json
index b293f7a7..1d1a3335 100644
--- a/apps/www/public/r/confetti-stars.json
+++ b/apps/www/public/r/confetti-stars.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/confetti-stars.tsx",
- "content": "\"use client\";\n\nimport confetti from \"canvas-confetti\";\n\nimport { Button } from \"@/components/ui/button\";\n\nexport default function ConfettiStars() {\n const handleClick = () => {\n const defaults = {\n spread: 360,\n ticks: 50,\n gravity: 0,\n decay: 0.94,\n startVelocity: 30,\n colors: [\"#FFE400\", \"#FFBD00\", \"#E89400\", \"#FFCA6C\", \"#FDFFB8\"],\n };\n\n const shoot = () => {\n confetti({\n ...defaults,\n particleCount: 40,\n scalar: 1.2,\n shapes: [\"star\"],\n });\n\n confetti({\n ...defaults,\n particleCount: 10,\n scalar: 0.75,\n shapes: [\"circle\"],\n });\n };\n\n setTimeout(shoot, 0);\n setTimeout(shoot, 100);\n setTimeout(shoot, 200);\n };\n\n return (\n <div className=\"relative\">\n <Button onClick={handleClick}>Trigger Stars</Button>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport confetti from \"canvas-confetti\"\n\nimport { Button } from \"@/components/ui/button\"\n\nexport default function ConfettiStars() {\n const handleClick = () => {\n const defaults = {\n spread: 360,\n ticks: 50,\n gravity: 0,\n decay: 0.94,\n startVelocity: 30,\n colors: [\"#FFE400\", \"#FFBD00\", \"#E89400\", \"#FFCA6C\", \"#FDFFB8\"],\n }\n\n const shoot = () => {\n confetti({\n ...defaults,\n particleCount: 40,\n scalar: 1.2,\n shapes: [\"star\"],\n })\n\n confetti({\n ...defaults,\n particleCount: 10,\n scalar: 0.75,\n shapes: [\"circle\"],\n })\n }\n\n setTimeout(shoot, 0)\n setTimeout(shoot, 100)\n setTimeout(shoot, 200)\n }\n\n return (\n <div className=\"relative\">\n <Button onClick={handleClick}>Trigger Stars</Button>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/confetti.json b/apps/www/public/r/confetti.json
index 73a157f9..b216a75b 100644
--- a/apps/www/public/r/confetti.json
+++ b/apps/www/public/r/confetti.json
@@ -14,7 +14,7 @@
"files": [
{
"path": "registry/magicui/confetti.tsx",
- "content": "\"use client\";\n\nimport type {\n GlobalOptions as ConfettiGlobalOptions,\n CreateTypes as ConfettiInstance,\n Options as ConfettiOptions,\n} from \"canvas-confetti\";\nimport confetti from \"canvas-confetti\";\nimport type { ReactNode } from \"react\";\nimport React, {\n createContext,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\n\ntype Api = {\n fire: (options?: ConfettiOptions) => void;\n};\n\ntype Props = React.ComponentPropsWithRef<\"canvas\"> & {\n options?: ConfettiOptions;\n globalOptions?: ConfettiGlobalOptions;\n manualstart?: boolean;\n children?: ReactNode;\n};\n\nexport type ConfettiRef = Api | null;\n\nconst ConfettiContext = createContext<Api>({} as Api);\n\n// Define component first\nconst ConfettiComponent = forwardRef<ConfettiRef, Props>((props, ref) => {\n const {\n options,\n globalOptions = { resize: true, useWorker: true },\n manualstart = false,\n children,\n ...rest\n } = props;\n const instanceRef = useRef<ConfettiInstance | null>(null);\n\n const canvasRef = useCallback(\n (node: HTMLCanvasElement) => {\n if (node !== null) {\n if (instanceRef.current) return;\n instanceRef.current = confetti.create(node, {\n ...globalOptions,\n resize: true,\n });\n } else {\n if (instanceRef.current) {\n instanceRef.current.reset();\n instanceRef.current = null;\n }\n }\n },\n [globalOptions],\n );\n\n const fire = useCallback(\n async (opts = {}) => {\n try {\n await instanceRef.current?.({ ...options, ...opts });\n } catch (error) {\n console.error(\"Confetti error:\", error);\n }\n },\n [options],\n );\n\n const api = useMemo(\n () => ({\n fire,\n }),\n [fire],\n );\n\n useImperativeHandle(ref, () => api, [api]);\n\n useEffect(() => {\n if (!manualstart) {\n (async () => {\n try {\n await fire();\n } catch (error) {\n console.error(\"Confetti effect error:\", error);\n }\n })();\n }\n }, [manualstart, fire]);\n\n return (\n <ConfettiContext.Provider value={api}>\n <canvas ref={canvasRef} {...rest} />\n {children}\n </ConfettiContext.Provider>\n );\n});\n\n// Set display name immediately\nConfettiComponent.displayName = \"Confetti\";\n\n// Export as Confetti\nexport const Confetti = ConfettiComponent;\n\ninterface ConfettiButtonProps extends React.ComponentProps<\"button\"> {\n options?: ConfettiOptions &\n ConfettiGlobalOptions & { canvas?: HTMLCanvasElement };\n}\n\nconst ConfettiButtonComponent = ({\n options,\n children,\n ...props\n}: ConfettiButtonProps) => {\n const handleClick = async (event: React.MouseEvent<HTMLButtonElement>) => {\n try {\n const rect = event.currentTarget.getBoundingClientRect();\n const x = rect.left + rect.width / 2;\n const y = rect.top + rect.height / 2;\n await confetti({\n ...options,\n origin: {\n x: x / window.innerWidth,\n y: y / window.innerHeight,\n },\n });\n } catch (error) {\n console.error(\"Confetti button error:\", error);\n }\n };\n\n return (\n <Button onClick={handleClick} {...props}>\n {children}\n </Button>\n );\n};\n\nConfettiButtonComponent.displayName = \"ConfettiButton\";\n\nexport const ConfettiButton = ConfettiButtonComponent;\n",
+ "content": "\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport React, {\n createContext,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\"\nimport type {\n GlobalOptions as ConfettiGlobalOptions,\n CreateTypes as ConfettiInstance,\n Options as ConfettiOptions,\n} from \"canvas-confetti\"\nimport confetti from \"canvas-confetti\"\n\nimport { Button } from \"@/components/ui/button\"\n\ntype Api = {\n fire: (options?: ConfettiOptions) => void\n}\n\ntype Props = React.ComponentPropsWithRef<\"canvas\"> & {\n options?: ConfettiOptions\n globalOptions?: ConfettiGlobalOptions\n manualstart?: boolean\n children?: ReactNode\n}\n\nexport type ConfettiRef = Api | null\n\nconst ConfettiContext = createContext<Api>({} as Api)\n\n// Define component first\nconst ConfettiComponent = forwardRef<ConfettiRef, Props>((props, ref) => {\n const {\n options,\n globalOptions = { resize: true, useWorker: true },\n manualstart = false,\n children,\n ...rest\n } = props\n const instanceRef = useRef<ConfettiInstance | null>(null)\n\n const canvasRef = useCallback(\n (node: HTMLCanvasElement) => {\n if (node !== null) {\n if (instanceRef.current) return\n instanceRef.current = confetti.create(node, {\n ...globalOptions,\n resize: true,\n })\n } else {\n if (instanceRef.current) {\n instanceRef.current.reset()\n instanceRef.current = null\n }\n }\n },\n [globalOptions]\n )\n\n const fire = useCallback(\n async (opts = {}) => {\n try {\n await instanceRef.current?.({ ...options, ...opts })\n } catch (error) {\n console.error(\"Confetti error:\", error)\n }\n },\n [options]\n )\n\n const api = useMemo(\n () => ({\n fire,\n }),\n [fire]\n )\n\n useImperativeHandle(ref, () => api, [api])\n\n useEffect(() => {\n if (!manualstart) {\n ;(async () => {\n try {\n await fire()\n } catch (error) {\n console.error(\"Confetti effect error:\", error)\n }\n })()\n }\n }, [manualstart, fire])\n\n return (\n <ConfettiContext.Provider value={api}>\n <canvas ref={canvasRef} {...rest} />\n {children}\n </ConfettiContext.Provider>\n )\n})\n\n// Set display name immediately\nConfettiComponent.displayName = \"Confetti\"\n\n// Export as Confetti\nexport const Confetti = ConfettiComponent\n\ninterface ConfettiButtonProps extends React.ComponentProps<\"button\"> {\n options?: ConfettiOptions &\n ConfettiGlobalOptions & { canvas?: HTMLCanvasElement }\n}\n\nconst ConfettiButtonComponent = ({\n options,\n children,\n ...props\n}: ConfettiButtonProps) => {\n const handleClick = async (event: React.MouseEvent<HTMLButtonElement>) => {\n try {\n const rect = event.currentTarget.getBoundingClientRect()\n const x = rect.left + rect.width / 2\n const y = rect.top + rect.height / 2\n await confetti({\n ...options,\n origin: {\n x: x / window.innerWidth,\n y: y / window.innerHeight,\n },\n })\n } catch (error) {\n console.error(\"Confetti button error:\", error)\n }\n }\n\n return (\n <Button onClick={handleClick} {...props}>\n {children}\n </Button>\n )\n}\n\nConfettiButtonComponent.displayName = \"ConfettiButton\"\n\nexport const ConfettiButton = ConfettiButtonComponent\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/cool-mode-custom.json b/apps/www/public/r/cool-mode-custom.json
index ca400f2e..e1769f9e 100644
--- a/apps/www/public/r/cool-mode-custom.json
+++ b/apps/www/public/r/cool-mode-custom.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/cool-mode-custom.tsx",
- "content": "import { Button } from \"@/components/ui/button\";\nimport { CoolMode } from \"@/registry/magicui/cool-mode\";\n\nexport default function CoolModeCustom() {\n return (\n <div className=\"relative justify-center\">\n <CoolMode\n options={{\n particle:\n \"https://pbs.twimg.com/profile_images/1782811051504885763/YR5-kWOI_400x400.jpg\",\n }}\n >\n <Button>Click Me!</Button>\n </CoolMode>\n </div>\n );\n}\n",
+ "content": "import { Button } from \"@/components/ui/button\"\nimport { CoolMode } from \"@/registry/magicui/cool-mode\"\n\nexport default function CoolModeCustom() {\n return (\n <div className=\"relative justify-center\">\n <CoolMode\n options={{\n particle:\n \"https://pbs.twimg.com/profile_images/1782811051504885763/YR5-kWOI_400x400.jpg\",\n }}\n >\n <Button>Click Me!</Button>\n </CoolMode>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/cool-mode-demo.json b/apps/www/public/r/cool-mode-demo.json
index 5136ac75..9fac16eb 100644
--- a/apps/www/public/r/cool-mode-demo.json
+++ b/apps/www/public/r/cool-mode-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/cool-mode-demo.tsx",
- "content": "import { Button } from \"@/components/ui/button\";\nimport { CoolMode } from \"@/registry/magicui/cool-mode\";\n\nexport default function CoolModeDemo() {\n return (\n <div className=\"relative justify-center\">\n <CoolMode>\n <Button>Click Me!</Button>\n </CoolMode>\n </div>\n );\n}\n",
+ "content": "import { Button } from \"@/components/ui/button\"\nimport { CoolMode } from \"@/registry/magicui/cool-mode\"\n\nexport default function CoolModeDemo() {\n return (\n <div className=\"relative justify-center\">\n <CoolMode>\n <Button>Click Me!</Button>\n </CoolMode>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/cool-mode.json b/apps/www/public/r/cool-mode.json
index 7d034de8..056966b8 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 getContainer = () => {\n const id = \"_coolMode_effect\";\n let 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 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 const svgNS = \"http://www.w3.org/2000/svg\";\n const circleSVG = document.createElementNS(svgNS, \"svg\");\n const circle = document.createElementNS(svgNS, \"circle\");\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(\n null,\n \"fill\",\n `hsl(${Math.random() * 360}, 70%, 50%)`,\n );\n\n circleSVG.appendChild(circle);\n circleSVG.setAttribute(\"width\", size.toString());\n circleSVG.setAttribute(\"height\", size.toString());\n\n particle.appendChild(circleSVG);\n } else if (\n particleType.startsWith(\"http\") ||\n particleType.startsWith(\"/\")\n ) {\n // Handle URL-based images\n particle.innerHTML = `<img src=\"${particleType}\" width=\"${size}\" height=\"${size}\" style=\"border-radius: 50%\">`;\n } else {\n // Handle emoji or text characters\n const fontSizeMultiplier = 3; // Make emojis 3x bigger\n const emojiSize = size * fontSizeMultiplier;\n particle.innerHTML = `<div style=\"font-size: ${emojiSize}px; line-height: 1; text-align: center; width: ${size}px; height: ${size}px; display: flex; align-items: center; justify-content: center; transform: scale(${fontSizeMultiplier}); transform-origin: center;\">${particleType}</div>`;\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 if (ref.current) {\n return applyParticleEffect(ref.current, options);\n }\n }, [options]);\n\n return <span ref={ref}>{children}</span>;\n};\n",
+ "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 getContainer = () => {\n const id = \"_coolMode_effect\"\n let 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 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 const svgNS = \"http://www.w3.org/2000/svg\"\n const circleSVG = document.createElementNS(svgNS, \"svg\")\n const circle = document.createElementNS(svgNS, \"circle\")\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(\n null,\n \"fill\",\n `hsl(${Math.random() * 360}, 70%, 50%)`\n )\n\n circleSVG.appendChild(circle)\n circleSVG.setAttribute(\"width\", size.toString())\n circleSVG.setAttribute(\"height\", size.toString())\n\n particle.appendChild(circleSVG)\n } else if (\n particleType.startsWith(\"http\") ||\n particleType.startsWith(\"/\")\n ) {\n // Handle URL-based images\n particle.innerHTML = `<img src=\"${particleType}\" width=\"${size}\" height=\"${size}\" style=\"border-radius: 50%\">`\n } else {\n // Handle emoji or text characters\n const fontSizeMultiplier = 3 // Make emojis 3x bigger\n const emojiSize = size * fontSizeMultiplier\n particle.innerHTML = `<div style=\"font-size: ${emojiSize}px; line-height: 1; text-align: center; width: ${size}px; height: ${size}px; display: flex; align-items: center; justify-content: center; transform: scale(${fontSizeMultiplier}); transform-origin: center;\">${particleType}</div>`\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 if (ref.current) {\n return applyParticleEffect(ref.current, options)\n }\n }, [options])\n\n return <span ref={ref}>{children}</span>\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/dock-demo-2.json b/apps/www/public/r/dock-demo-2.json
index b0d6e826..dde6af6d 100644
--- a/apps/www/public/r/dock-demo-2.json
+++ b/apps/www/public/r/dock-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/dock-demo-2.tsx",
- "content": "\"use client\";\n\nimport React from \"react\";\n\nimport { Dock, DockIcon } from \"@/registry/magicui/dock\";\n\nexport type IconProps = React.HTMLAttributes<SVGElement>;\n\nexport default function DockDemo() {\n return (\n <div className=\"relative\">\n <Dock direction=\"middle\">\n <DockIcon>\n <Icons.gitHub className=\"size-6\" />\n </DockIcon>\n <DockIcon>\n <Icons.googleDrive className=\"size-6\" />\n </DockIcon>\n <DockIcon>\n <Icons.notion className=\"size-6\" />\n </DockIcon>\n <DockIcon>\n <Icons.whatsapp className=\"size-6\" />\n </DockIcon>\n </Dock>\n </div>\n );\n}\n\nconst Icons = {\n gitHub: (props: IconProps) => (\n <svg viewBox=\"0 0 438.549 438.549\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n ></path>\n </svg>\n ),\n notion: (props: IconProps) => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#fff\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000\"\n />\n </svg>\n ),\n googleDrive: (props: IconProps) => (\n <svg viewBox=\"0 0 87.3 78\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: (props: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 175.216 175.552\"\n {...props}\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n fill=\"#b3b3b3\"\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n filter=\"url(#a)\"\n />\n <path\n fill=\"#fff\"\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n />\n <path\n fill=\"url(#linearGradient1780)\"\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n />\n <path\n fill=\"url(#b)\"\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n />\n <path\n fill=\"#fff\"\n fillRule=\"evenodd\"\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n />\n </svg>\n ),\n};\n",
+ "content": "\"use client\"\n\nimport React from \"react\"\n\nimport { Dock, DockIcon } from \"@/registry/magicui/dock\"\n\nexport type IconProps = React.HTMLAttributes<SVGElement>\n\nexport default function DockDemo() {\n return (\n <div className=\"relative\">\n <Dock direction=\"middle\">\n <DockIcon>\n <Icons.gitHub className=\"size-6\" />\n </DockIcon>\n <DockIcon>\n <Icons.googleDrive className=\"size-6\" />\n </DockIcon>\n <DockIcon>\n <Icons.notion className=\"size-6\" />\n </DockIcon>\n <DockIcon>\n <Icons.whatsapp className=\"size-6\" />\n </DockIcon>\n </Dock>\n </div>\n )\n}\n\nconst Icons = {\n gitHub: (props: IconProps) => (\n <svg viewBox=\"0 0 438.549 438.549\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n ></path>\n </svg>\n ),\n notion: (props: IconProps) => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#fff\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000\"\n />\n </svg>\n ),\n googleDrive: (props: IconProps) => (\n <svg viewBox=\"0 0 87.3 78\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: (props: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 175.216 175.552\"\n {...props}\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n fill=\"#b3b3b3\"\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n filter=\"url(#a)\"\n />\n <path\n fill=\"#fff\"\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n />\n <path\n fill=\"url(#linearGradient1780)\"\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n />\n <path\n fill=\"url(#b)\"\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n />\n <path\n fill=\"#fff\"\n fillRule=\"evenodd\"\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n />\n </svg>\n ),\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/dock-demo-3.json b/apps/www/public/r/dock-demo-3.json
index 23af5420..193421d7 100644
--- a/apps/www/public/r/dock-demo-3.json
+++ b/apps/www/public/r/dock-demo-3.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/dock-demo-3.tsx",
- "content": "\"use client\";\n\nimport React from \"react\";\n\nimport { Dock, DockIcon } from \"@/registry/magicui/dock\";\n\nexport type IconProps = React.HTMLAttributes<SVGElement>;\n\nexport default function DockDemo() {\n return (\n <div className=\"relative\">\n <Dock iconMagnification={60} iconDistance={100}>\n <DockIcon className=\"bg-black/10 dark:bg-white/10\">\n <Icons.gitHub className=\"size-full\" />\n </DockIcon>\n <DockIcon className=\"bg-black/10 dark:bg-white/10\">\n <Icons.googleDrive className=\"size-full\" />\n </DockIcon>\n <DockIcon className=\"bg-black/10 dark:bg-white/10\">\n <Icons.notion className=\"size-full\" />\n </DockIcon>\n <DockIcon className=\"bg-black/10 dark:bg-white/10\">\n <Icons.whatsapp className=\"size-full\" />\n </DockIcon>\n </Dock>\n </div>\n );\n}\n\nconst Icons = {\n gitHub: (props: IconProps) => (\n <svg viewBox=\"0 0 438.549 438.549\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n ></path>\n </svg>\n ),\n notion: (props: IconProps) => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#fff\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000\"\n />\n </svg>\n ),\n googleDrive: (props: IconProps) => (\n <svg viewBox=\"0 0 87.3 78\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: (props: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 175.216 175.552\"\n {...props}\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n fill=\"#b3b3b3\"\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n filter=\"url(#a)\"\n />\n <path\n fill=\"#fff\"\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n />\n <path\n fill=\"url(#linearGradient1780)\"\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n />\n <path\n fill=\"url(#b)\"\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n />\n <path\n fill=\"#fff\"\n fillRule=\"evenodd\"\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n />\n </svg>\n ),\n};\n",
+ "content": "\"use client\"\n\nimport React from \"react\"\n\nimport { Dock, DockIcon } from \"@/registry/magicui/dock\"\n\nexport type IconProps = React.HTMLAttributes<SVGElement>\n\nexport default function DockDemo() {\n return (\n <div className=\"relative\">\n <Dock iconMagnification={60} iconDistance={100}>\n <DockIcon className=\"bg-black/10 dark:bg-white/10\">\n <Icons.gitHub className=\"size-full\" />\n </DockIcon>\n <DockIcon className=\"bg-black/10 dark:bg-white/10\">\n <Icons.googleDrive className=\"size-full\" />\n </DockIcon>\n <DockIcon className=\"bg-black/10 dark:bg-white/10\">\n <Icons.notion className=\"size-full\" />\n </DockIcon>\n <DockIcon className=\"bg-black/10 dark:bg-white/10\">\n <Icons.whatsapp className=\"size-full\" />\n </DockIcon>\n </Dock>\n </div>\n )\n}\n\nconst Icons = {\n gitHub: (props: IconProps) => (\n <svg viewBox=\"0 0 438.549 438.549\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n ></path>\n </svg>\n ),\n notion: (props: IconProps) => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#fff\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000\"\n />\n </svg>\n ),\n googleDrive: (props: IconProps) => (\n <svg viewBox=\"0 0 87.3 78\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: (props: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 175.216 175.552\"\n {...props}\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n fill=\"#b3b3b3\"\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n filter=\"url(#a)\"\n />\n <path\n fill=\"#fff\"\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n />\n <path\n fill=\"url(#linearGradient1780)\"\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n />\n <path\n fill=\"url(#b)\"\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n />\n <path\n fill=\"#fff\"\n fillRule=\"evenodd\"\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n />\n </svg>\n ),\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/dock-demo.json b/apps/www/public/r/dock-demo.json
index 083b9693..05215e41 100644
--- a/apps/www/public/r/dock-demo.json
+++ b/apps/www/public/r/dock-demo.json
@@ -14,7 +14,7 @@
"files": [
{
"path": "registry/example/dock-demo.tsx",
- "content": "\"use client\";\n\nimport { CalendarIcon, HomeIcon, MailIcon, PencilIcon } from \"lucide-react\";\nimport Link from \"next/link\";\nimport React from \"react\";\n\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { Separator } from \"@/components/ui/separator\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/lib/utils\";\nimport { Dock, DockIcon } from \"@/registry/magicui/dock\";\n\nexport type IconProps = React.HTMLAttributes<SVGElement>;\n\nconst Icons = {\n calendar: (props: IconProps) => <CalendarIcon {...props} />,\n email: (props: IconProps) => <MailIcon {...props} />,\n linkedin: (props: IconProps) => (\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <title>LinkedIn</title>\n <path\n fill=\"currentColor\"\n d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z\"\n />\n </svg>\n ),\n x: (props: IconProps) => (\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <title>X</title>\n <path\n fill=\"currentColor\"\n d=\"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z\"\n />\n </svg>\n ),\n youtube: (props: IconProps) => (\n <svg\n width=\"32px\"\n height=\"32px\"\n viewBox=\"0 0 32 32\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>youtube</title>\n <path d=\"M29.41,9.26a3.5,3.5,0,0,0-2.47-2.47C24.76,6.2,16,6.2,16,6.2s-8.76,0-10.94.59A3.5,3.5,0,0,0,2.59,9.26,36.13,36.13,0,0,0,2,16a36.13,36.13,0,0,0,.59,6.74,3.5,3.5,0,0,0,2.47,2.47C7.24,25.8,16,25.8,16,25.8s8.76,0,10.94-.59a3.5,3.5,0,0,0,2.47-2.47A36.13,36.13,0,0,0,30,16,36.13,36.13,0,0,0,29.41,9.26ZM13.2,20.2V11.8L20.47,16Z\" />\n </svg>\n ),\n github: (props: IconProps) => (\n <svg viewBox=\"0 0 438.549 438.549\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n ></path>\n </svg>\n ),\n};\n\nconst DATA = {\n navbar: [\n { href: \"#\", icon: HomeIcon, label: \"Home\" },\n { href: \"#\", icon: PencilIcon, label: \"Blog\" },\n ],\n contact: {\n social: {\n GitHub: {\n name: \"GitHub\",\n url: \"#\",\n icon: Icons.github,\n },\n LinkedIn: {\n name: \"LinkedIn\",\n url: \"#\",\n icon: Icons.linkedin,\n },\n X: {\n name: \"X\",\n url: \"#\",\n icon: Icons.x,\n },\n email: {\n name: \"Send Email\",\n url: \"#\",\n icon: Icons.email,\n },\n },\n },\n};\n\nexport default function DockDemo() {\n return (\n <div className=\"flex flex-col items-center justify-center\">\n <span className=\"pointer-events-none whitespace-pre-wrap bg-gradient-to-b from-black to-gray-300/80 bg-clip-text text-center text-8xl font-semibold leading-none text-transparent dark:from-white dark:to-slate-900/10\">\n Dock\n </span>\n <TooltipProvider>\n <Dock direction=\"middle\">\n {DATA.navbar.map((item) => (\n <DockIcon key={item.label}>\n <Tooltip>\n <TooltipTrigger asChild>\n <Link\n href={item.href}\n aria-label={item.label}\n className={cn(\n buttonVariants({ variant: \"ghost\", size: \"icon\" }),\n \"size-12 rounded-full\",\n )}\n >\n <item.icon className=\"size-4\" />\n </Link>\n </TooltipTrigger>\n <TooltipContent>\n <p>{item.label}</p>\n </TooltipContent>\n </Tooltip>\n </DockIcon>\n ))}\n <Separator orientation=\"vertical\" className=\"h-full\" />\n {Object.entries(DATA.contact.social).map(([name, social]) => (\n <DockIcon key={name}>\n <Tooltip>\n <TooltipTrigger asChild>\n <Link\n href={social.url}\n aria-label={social.name}\n className={cn(\n buttonVariants({ variant: \"ghost\", size: \"icon\" }),\n \"size-12 rounded-full \",\n )}\n >\n <social.icon className=\"size-4\" />\n </Link>\n </TooltipTrigger>\n <TooltipContent>\n <p>{name}</p>\n </TooltipContent>\n </Tooltip>\n </DockIcon>\n ))}\n </Dock>\n </TooltipProvider>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport React from \"react\"\nimport Link from \"next/link\"\nimport { CalendarIcon, HomeIcon, MailIcon, PencilIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"@/components/ui/button\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\"\nimport { Dock, DockIcon } from \"@/registry/magicui/dock\"\n\nexport type IconProps = React.HTMLAttributes<SVGElement>\n\nconst Icons = {\n calendar: (props: IconProps) => <CalendarIcon {...props} />,\n email: (props: IconProps) => <MailIcon {...props} />,\n linkedin: (props: IconProps) => (\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <title>LinkedIn</title>\n <path\n fill=\"currentColor\"\n d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z\"\n />\n </svg>\n ),\n x: (props: IconProps) => (\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <title>X</title>\n <path\n fill=\"currentColor\"\n d=\"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z\"\n />\n </svg>\n ),\n youtube: (props: IconProps) => (\n <svg\n width=\"32px\"\n height=\"32px\"\n viewBox=\"0 0 32 32\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <title>youtube</title>\n <path d=\"M29.41,9.26a3.5,3.5,0,0,0-2.47-2.47C24.76,6.2,16,6.2,16,6.2s-8.76,0-10.94.59A3.5,3.5,0,0,0,2.59,9.26,36.13,36.13,0,0,0,2,16a36.13,36.13,0,0,0,.59,6.74,3.5,3.5,0,0,0,2.47,2.47C7.24,25.8,16,25.8,16,25.8s8.76,0,10.94-.59a3.5,3.5,0,0,0,2.47-2.47A36.13,36.13,0,0,0,30,16,36.13,36.13,0,0,0,29.41,9.26ZM13.2,20.2V11.8L20.47,16Z\" />\n </svg>\n ),\n github: (props: IconProps) => (\n <svg viewBox=\"0 0 438.549 438.549\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n ></path>\n </svg>\n ),\n}\n\nconst DATA = {\n navbar: [\n { href: \"#\", icon: HomeIcon, label: \"Home\" },\n { href: \"#\", icon: PencilIcon, label: \"Blog\" },\n ],\n contact: {\n social: {\n GitHub: {\n name: \"GitHub\",\n url: \"#\",\n icon: Icons.github,\n },\n LinkedIn: {\n name: \"LinkedIn\",\n url: \"#\",\n icon: Icons.linkedin,\n },\n X: {\n name: \"X\",\n url: \"#\",\n icon: Icons.x,\n },\n email: {\n name: \"Send Email\",\n url: \"#\",\n icon: Icons.email,\n },\n },\n },\n}\n\nexport default function DockDemo() {\n return (\n <div className=\"flex flex-col items-center justify-center\">\n <span className=\"pointer-events-none bg-gradient-to-b from-black to-gray-300/80 bg-clip-text text-center text-8xl leading-none font-semibold whitespace-pre-wrap text-transparent dark:from-white dark:to-slate-900/10\">\n Dock\n </span>\n <TooltipProvider>\n <Dock direction=\"middle\">\n {DATA.navbar.map((item) => (\n <DockIcon key={item.label}>\n <Tooltip>\n <TooltipTrigger asChild>\n <Link\n href={item.href}\n aria-label={item.label}\n className={cn(\n buttonVariants({ variant: \"ghost\", size: \"icon\" }),\n \"size-12 rounded-full\"\n )}\n >\n <item.icon className=\"size-4\" />\n </Link>\n </TooltipTrigger>\n <TooltipContent>\n <p>{item.label}</p>\n </TooltipContent>\n </Tooltip>\n </DockIcon>\n ))}\n <Separator orientation=\"vertical\" className=\"h-full\" />\n {Object.entries(DATA.contact.social).map(([name, social]) => (\n <DockIcon key={name}>\n <Tooltip>\n <TooltipTrigger asChild>\n <Link\n href={social.url}\n aria-label={social.name}\n className={cn(\n buttonVariants({ variant: \"ghost\", size: \"icon\" }),\n \"size-12 rounded-full\"\n )}\n >\n <social.icon className=\"size-4\" />\n </Link>\n </TooltipTrigger>\n <TooltipContent>\n <p>{name}</p>\n </TooltipContent>\n </Tooltip>\n </DockIcon>\n ))}\n </Dock>\n </TooltipProvider>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/dock.json b/apps/www/public/r/dock.json
index fef1c4e5..edd91dd4 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 { 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\";\nimport React, { PropsWithChildren, useRef } from \"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\n extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, \"children\"> {\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 && \"transition-colors hover:bg-muted-foreground\",\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, { 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\n extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, \"children\"> {\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/dot-pattern-demo.json b/apps/www/public/r/dot-pattern-demo.json
index 57d62c30..3cfb3fe4 100644
--- a/apps/www/public/r/dot-pattern-demo.json
+++ b/apps/www/public/r/dot-pattern-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/dot-pattern-demo.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { DotPattern } from \"@/registry/magicui/dot-pattern\";\n\nexport default function DotPatternDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <DotPattern\n className={cn(\n \"[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]\",\n )}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport { DotPattern } from \"@/registry/magicui/dot-pattern\"\n\nexport default function DotPatternDemo() {\n return (\n <div className=\"bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <DotPattern\n className={cn(\n \"[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]\"\n )}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/dot-pattern-linear-gradient.json b/apps/www/public/r/dot-pattern-linear-gradient.json
index 79770f46..9bbcf6cb 100644
--- a/apps/www/public/r/dot-pattern-linear-gradient.json
+++ b/apps/www/public/r/dot-pattern-linear-gradient.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/dot-pattern-linear-gradient.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { DotPattern } from \"@/registry/magicui/dot-pattern\";\n\nexport default function DotPatternLinearGradient() {\n return (\n <div className=\"relative flex size-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20\">\n <DotPattern\n width={20}\n height={20}\n cx={1}\n cy={1}\n cr={1}\n className={cn(\n \"[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)] \",\n )}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport { DotPattern } from \"@/registry/magicui/dot-pattern\"\n\nexport default function DotPatternLinearGradient() {\n return (\n <div className=\"bg-background relative flex size-full items-center justify-center overflow-hidden rounded-lg border p-20\">\n <DotPattern\n width={20}\n height={20}\n cx={1}\n cy={1}\n cr={1}\n className={cn(\n \"[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)]\"\n )}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/dot-pattern-with-glow-effect.json b/apps/www/public/r/dot-pattern-with-glow-effect.json
index c5c27a04..4299079f 100644
--- a/apps/www/public/r/dot-pattern-with-glow-effect.json
+++ b/apps/www/public/r/dot-pattern-with-glow-effect.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/dot-pattern-with-glow-effect.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { DotPattern } from \"@/registry/magicui/dot-pattern\";\n\nexport default function DotPatternWithGlowEffectDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden\">\n <DotPattern\n glow={true}\n className={cn(\n \"[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]\",\n )}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport { DotPattern } from \"@/registry/magicui/dot-pattern\"\n\nexport default function DotPatternWithGlowEffectDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden\">\n <DotPattern\n glow={true}\n className={cn(\n \"[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]\"\n )}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/dot-pattern.json b/apps/www/public/r/dot-pattern.json
index 6b79dc81..0ddd3782 100644
--- a/apps/www/public/r/dot-pattern.json
+++ b/apps/www/public/r/dot-pattern.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/dot-pattern.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { motion } from \"motion/react\";\nimport React, { useEffect, useId, useRef, useState } from \"react\";\n\n/**\n * DotPattern Component Props\n *\n * @param {number} [width=16] - The horizontal spacing between dots\n * @param {number} [height=16] - The vertical spacing between dots\n * @param {number} [x=0] - The x-offset of the entire pattern\n * @param {number} [y=0] - The y-offset of the entire pattern\n * @param {number} [cx=1] - The x-offset of individual dots\n * @param {number} [cy=1] - The y-offset of individual dots\n * @param {number} [cr=1] - The radius of each dot\n * @param {string} [className] - Additional CSS classes to apply to the SVG container\n * @param {boolean} [glow=false] - Whether dots should have a glowing animation effect\n */\ninterface DotPatternProps extends React.SVGProps<SVGSVGElement> {\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n cx?: number;\n cy?: number;\n cr?: number;\n className?: string;\n glow?: boolean;\n [key: string]: unknown;\n}\n\n/**\n * DotPattern Component\n *\n * A React component that creates an animated or static dot pattern background using SVG.\n * The pattern automatically adjusts to fill its container and can optionally display glowing dots.\n *\n * @component\n *\n * @see DotPatternProps for the props interface.\n *\n * @example\n * // Basic usage\n * <DotPattern />\n *\n * // With glowing effect and custom spacing\n * <DotPattern\n * width={20}\n * height={20}\n * glow={true}\n * className=\"opacity-50\"\n * />\n *\n * @notes\n * - The component is client-side only (\"use client\")\n * - Automatically responds to container size changes\n * - When glow is enabled, dots will animate with random delays and durations\n * - Uses Motion for animations\n * - Dots color can be controlled via the text color utility classes\n */\n\nexport function DotPattern({\n width = 16,\n height = 16,\n x = 0,\n y = 0,\n cx = 1,\n cy = 1,\n cr = 1,\n className,\n glow = false,\n ...props\n}: DotPatternProps) {\n const id = useId();\n const containerRef = useRef<SVGSVGElement>(null);\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 });\n\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const { width, height } = containerRef.current.getBoundingClientRect();\n setDimensions({ width, height });\n }\n };\n\n updateDimensions();\n window.addEventListener(\"resize\", updateDimensions);\n return () => window.removeEventListener(\"resize\", updateDimensions);\n }, []);\n\n const dots = Array.from(\n {\n length:\n Math.ceil(dimensions.width / width) *\n Math.ceil(dimensions.height / height),\n },\n (_, i) => {\n const col = i % Math.ceil(dimensions.width / width);\n const row = Math.floor(i / Math.ceil(dimensions.width / width));\n return {\n x: col * width + cx,\n y: row * height + cy,\n delay: Math.random() * 5,\n duration: Math.random() * 3 + 2,\n };\n },\n );\n\n return (\n <svg\n ref={containerRef}\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full text-neutral-400/80\",\n className,\n )}\n {...props}\n >\n <defs>\n <radialGradient id={`${id}-gradient`}>\n <stop offset=\"0%\" stopColor=\"currentColor\" stopOpacity=\"1\" />\n <stop offset=\"100%\" stopColor=\"currentColor\" stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n {dots.map((dot, index) => (\n <motion.circle\n key={`${dot.x}-${dot.y}`}\n cx={dot.x}\n cy={dot.y}\n r={cr}\n fill={glow ? `url(#${id}-gradient)` : \"currentColor\"}\n initial={glow ? { opacity: 0.4, scale: 1 } : {}}\n animate={\n glow\n ? {\n opacity: [0.4, 1, 0.4],\n scale: [1, 1.5, 1],\n }\n : {}\n }\n transition={\n glow\n ? {\n duration: dot.duration,\n repeat: Infinity,\n repeatType: \"reverse\",\n delay: dot.delay,\n ease: \"easeInOut\",\n }\n : {}\n }\n />\n ))}\n </svg>\n );\n}\n",
+ "content": "\"use client\"\n\nimport React, { useEffect, useId, useRef, useState } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/**\n * DotPattern Component Props\n *\n * @param {number} [width=16] - The horizontal spacing between dots\n * @param {number} [height=16] - The vertical spacing between dots\n * @param {number} [x=0] - The x-offset of the entire pattern\n * @param {number} [y=0] - The y-offset of the entire pattern\n * @param {number} [cx=1] - The x-offset of individual dots\n * @param {number} [cy=1] - The y-offset of individual dots\n * @param {number} [cr=1] - The radius of each dot\n * @param {string} [className] - Additional CSS classes to apply to the SVG container\n * @param {boolean} [glow=false] - Whether dots should have a glowing animation effect\n */\ninterface DotPatternProps extends React.SVGProps<SVGSVGElement> {\n width?: number\n height?: number\n x?: number\n y?: number\n cx?: number\n cy?: number\n cr?: number\n className?: string\n glow?: boolean\n [key: string]: unknown\n}\n\n/**\n * DotPattern Component\n *\n * A React component that creates an animated or static dot pattern background using SVG.\n * The pattern automatically adjusts to fill its container and can optionally display glowing dots.\n *\n * @component\n *\n * @see DotPatternProps for the props interface.\n *\n * @example\n * // Basic usage\n * <DotPattern />\n *\n * // With glowing effect and custom spacing\n * <DotPattern\n * width={20}\n * height={20}\n * glow={true}\n * className=\"opacity-50\"\n * />\n *\n * @notes\n * - The component is client-side only (\"use client\")\n * - Automatically responds to container size changes\n * - When glow is enabled, dots will animate with random delays and durations\n * - Uses Motion for animations\n * - Dots color can be controlled via the text color utility classes\n */\n\nexport function DotPattern({\n width = 16,\n height = 16,\n x = 0,\n y = 0,\n cx = 1,\n cy = 1,\n cr = 1,\n className,\n glow = false,\n ...props\n}: DotPatternProps) {\n const id = useId()\n const containerRef = useRef<SVGSVGElement>(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const { width, height } = containerRef.current.getBoundingClientRect()\n setDimensions({ width, height })\n }\n }\n\n updateDimensions()\n window.addEventListener(\"resize\", updateDimensions)\n return () => window.removeEventListener(\"resize\", updateDimensions)\n }, [])\n\n const dots = Array.from(\n {\n length:\n Math.ceil(dimensions.width / width) *\n Math.ceil(dimensions.height / height),\n },\n (_, i) => {\n const col = i % Math.ceil(dimensions.width / width)\n const row = Math.floor(i / Math.ceil(dimensions.width / width))\n return {\n x: col * width + cx,\n y: row * height + cy,\n delay: Math.random() * 5,\n duration: Math.random() * 3 + 2,\n }\n }\n )\n\n return (\n <svg\n ref={containerRef}\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full text-neutral-400/80\",\n className\n )}\n {...props}\n >\n <defs>\n <radialGradient id={`${id}-gradient`}>\n <stop offset=\"0%\" stopColor=\"currentColor\" stopOpacity=\"1\" />\n <stop offset=\"100%\" stopColor=\"currentColor\" stopOpacity=\"0\" />\n </radialGradient>\n </defs>\n {dots.map((dot, index) => (\n <motion.circle\n key={`${dot.x}-${dot.y}`}\n cx={dot.x}\n cy={dot.y}\n r={cr}\n fill={glow ? `url(#${id}-gradient)` : \"currentColor\"}\n initial={glow ? { opacity: 0.4, scale: 1 } : {}}\n animate={\n glow\n ? {\n opacity: [0.4, 1, 0.4],\n scale: [1, 1.5, 1],\n }\n : {}\n }\n transition={\n glow\n ? {\n duration: dot.duration,\n repeat: Infinity,\n repeatType: \"reverse\",\n delay: dot.delay,\n ease: \"easeInOut\",\n }\n : {}\n }\n />\n ))}\n </svg>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/file-tree-demo.json b/apps/www/public/r/file-tree-demo.json
index a2aa82fa..842bf545 100644
--- a/apps/www/public/r/file-tree-demo.json
+++ b/apps/www/public/r/file-tree-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/file-tree-demo.tsx",
- "content": "import { File, Folder, Tree } from \"@/registry/magicui/file-tree\";\n\nexport default function FileTreeDemo() {\n return (\n <div className=\"relative flex h-[300px] w-1/2 flex-col items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <Tree\n className=\"overflow-hidden rounded-md bg-background p-2\"\n initialSelectedId=\"7\"\n initialExpandedItems={[\n \"1\",\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"11\",\n ]}\n elements={ELEMENTS}\n >\n <Folder element=\"src\" value=\"1\">\n <Folder value=\"2\" element=\"app\">\n <File value=\"3\">\n <p>layout.tsx</p>\n </File>\n <File value=\"4\">\n <p>page.tsx</p>\n </File>\n </Folder>\n <Folder value=\"5\" element=\"components\">\n <Folder value=\"6\" element=\"ui\">\n <File value=\"7\">\n <p>button.tsx</p>\n </File>\n </Folder>\n <File value=\"8\">\n <p>header.tsx</p>\n </File>\n <File value=\"9\">\n <p>footer.tsx</p>\n </File>\n </Folder>\n <Folder value=\"10\" element=\"lib\">\n <File value=\"11\">\n <p>utils.ts</p>\n </File>\n </Folder>\n </Folder>\n </Tree>\n </div>\n );\n}\n\nconst ELEMENTS = [\n {\n id: \"1\",\n isSelectable: true,\n name: \"src\",\n children: [\n {\n id: \"2\",\n isSelectable: true,\n name: \"app\",\n children: [\n {\n id: \"3\",\n isSelectable: true,\n name: \"layout.tsx\",\n },\n {\n id: \"4\",\n isSelectable: true,\n name: \"page.tsx\",\n },\n ],\n },\n {\n id: \"5\",\n isSelectable: true,\n name: \"components\",\n children: [\n {\n id: \"6\",\n isSelectable: true,\n name: \"header.tsx\",\n },\n {\n id: \"7\",\n isSelectable: true,\n name: \"footer.tsx\",\n },\n ],\n },\n {\n id: \"8\",\n isSelectable: true,\n name: \"lib\",\n children: [\n {\n id: \"9\",\n isSelectable: true,\n name: \"utils.ts\",\n },\n ],\n },\n ],\n },\n];\n",
+ "content": "import { File, Folder, Tree } from \"@/registry/magicui/file-tree\"\n\nexport default function FileTreeDemo() {\n return (\n <div className=\"bg-background relative flex h-[300px] w-1/2 flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <Tree\n className=\"bg-background overflow-hidden rounded-md p-2\"\n initialSelectedId=\"7\"\n initialExpandedItems={[\n \"1\",\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"11\",\n ]}\n elements={ELEMENTS}\n >\n <Folder element=\"src\" value=\"1\">\n <Folder value=\"2\" element=\"app\">\n <File value=\"3\">\n <p>layout.tsx</p>\n </File>\n <File value=\"4\">\n <p>page.tsx</p>\n </File>\n </Folder>\n <Folder value=\"5\" element=\"components\">\n <Folder value=\"6\" element=\"ui\">\n <File value=\"7\">\n <p>button.tsx</p>\n </File>\n </Folder>\n <File value=\"8\">\n <p>header.tsx</p>\n </File>\n <File value=\"9\">\n <p>footer.tsx</p>\n </File>\n </Folder>\n <Folder value=\"10\" element=\"lib\">\n <File value=\"11\">\n <p>utils.ts</p>\n </File>\n </Folder>\n </Folder>\n </Tree>\n </div>\n )\n}\n\nconst ELEMENTS = [\n {\n id: \"1\",\n isSelectable: true,\n name: \"src\",\n children: [\n {\n id: \"2\",\n isSelectable: true,\n name: \"app\",\n children: [\n {\n id: \"3\",\n isSelectable: true,\n name: \"layout.tsx\",\n },\n {\n id: \"4\",\n isSelectable: true,\n name: \"page.tsx\",\n },\n ],\n },\n {\n id: \"5\",\n isSelectable: true,\n name: \"components\",\n children: [\n {\n id: \"6\",\n isSelectable: true,\n name: \"header.tsx\",\n },\n {\n id: \"7\",\n isSelectable: true,\n name: \"footer.tsx\",\n },\n ],\n },\n {\n id: \"8\",\n isSelectable: true,\n name: \"lib\",\n children: [\n {\n id: \"9\",\n isSelectable: true,\n name: \"utils.ts\",\n },\n ],\n },\n ],\n },\n]\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/file-tree.json b/apps/www/public/r/file-tree.json
index 14640d0a..6e7603d0 100644
--- a/apps/www/public/r/file-tree.json
+++ b/apps/www/public/r/file-tree.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/file-tree.tsx",
- "content": "\"use client\";\n\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { FileIcon, FolderIcon, FolderOpenIcon } from \"lucide-react\";\nimport React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { ScrollArea } from \"@/components/ui/scroll-area\";\nimport { cn } from \"@/lib/utils\";\n\ntype TreeViewElement = {\n id: string;\n name: string;\n isSelectable?: boolean;\n children?: TreeViewElement[];\n};\n\ntype TreeContextProps = {\n selectedId: string | undefined;\n expandedItems: string[] | undefined;\n indicator: boolean;\n handleExpand: (id: string) => void;\n selectItem: (id: string) => void;\n setExpandedItems?: React.Dispatch<React.SetStateAction<string[] | undefined>>;\n openIcon?: React.ReactNode;\n closeIcon?: React.ReactNode;\n direction: \"rtl\" | \"ltr\";\n};\n\nconst TreeContext = createContext<TreeContextProps | null>(null);\n\nconst useTree = () => {\n const context = useContext(TreeContext);\n if (!context) {\n throw new Error(\"useTree must be used within a TreeProvider\");\n }\n return context;\n};\n\ninterface TreeViewComponentProps extends React.HTMLAttributes<HTMLDivElement> {}\n\ntype Direction = \"rtl\" | \"ltr\" | undefined;\n\ntype TreeViewProps = {\n initialSelectedId?: string;\n indicator?: boolean;\n elements?: TreeViewElement[];\n initialExpandedItems?: string[];\n openIcon?: React.ReactNode;\n closeIcon?: React.ReactNode;\n} & TreeViewComponentProps;\n\nconst Tree = forwardRef<HTMLDivElement, TreeViewProps>(\n (\n {\n className,\n elements,\n initialSelectedId,\n initialExpandedItems,\n children,\n indicator = true,\n openIcon,\n closeIcon,\n dir,\n ...props\n },\n ref,\n ) => {\n const [selectedId, setSelectedId] = useState<string | undefined>(\n initialSelectedId,\n );\n const [expandedItems, setExpandedItems] = useState<string[] | undefined>(\n initialExpandedItems,\n );\n\n const selectItem = useCallback((id: string) => {\n setSelectedId(id);\n }, []);\n\n const handleExpand = useCallback((id: string) => {\n setExpandedItems((prev) => {\n if (prev?.includes(id)) {\n return prev.filter((item) => item !== id);\n }\n return [...(prev ?? []), id];\n });\n }, []);\n\n const expandSpecificTargetedElements = useCallback(\n (elements?: TreeViewElement[], selectId?: string) => {\n if (!elements || !selectId) return;\n const findParent = (\n currentElement: TreeViewElement,\n currentPath: string[] = [],\n ) => {\n const isSelectable = currentElement.isSelectable ?? true;\n const newPath = [...currentPath, currentElement.id];\n if (currentElement.id === selectId) {\n if (isSelectable) {\n setExpandedItems((prev) => [...(prev ?? []), ...newPath]);\n } else {\n if (newPath.includes(currentElement.id)) {\n newPath.pop();\n setExpandedItems((prev) => [...(prev ?? []), ...newPath]);\n }\n }\n return;\n }\n if (\n isSelectable &&\n currentElement.children &&\n currentElement.children.length > 0\n ) {\n currentElement.children.forEach((child) => {\n findParent(child, newPath);\n });\n }\n };\n elements.forEach((element) => {\n findParent(element);\n });\n },\n [],\n );\n\n useEffect(() => {\n if (initialSelectedId) {\n expandSpecificTargetedElements(elements, initialSelectedId);\n }\n }, [initialSelectedId, elements]);\n\n const direction = dir === \"rtl\" ? \"rtl\" : \"ltr\";\n\n return (\n <TreeContext.Provider\n value={{\n selectedId,\n expandedItems,\n handleExpand,\n selectItem,\n setExpandedItems,\n indicator,\n openIcon,\n closeIcon,\n direction,\n }}\n >\n <div className={cn(\"size-full\", className)}>\n <ScrollArea\n ref={ref}\n className=\"relative h-full px-2\"\n dir={dir as Direction}\n >\n <AccordionPrimitive.Root\n {...props}\n type=\"multiple\"\n defaultValue={expandedItems}\n value={expandedItems}\n className=\"flex flex-col gap-1\"\n onValueChange={(value) =>\n setExpandedItems((prev) => [...(prev ?? []), value[0]])\n }\n dir={dir as Direction}\n >\n {children}\n </AccordionPrimitive.Root>\n </ScrollArea>\n </div>\n </TreeContext.Provider>\n );\n },\n);\n\nTree.displayName = \"Tree\";\n\nconst TreeIndicator = forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { direction } = useTree();\n\n return (\n <div\n dir={direction}\n ref={ref}\n className={cn(\n \"absolute left-1.5 h-full w-px rounded-md bg-muted py-3 duration-300 ease-in-out hover:bg-slate-300 rtl:right-1.5\",\n className,\n )}\n {...props}\n />\n );\n});\n\nTreeIndicator.displayName = \"TreeIndicator\";\n\ninterface FolderComponentProps\n extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {}\n\ntype FolderProps = {\n expandedItems?: string[];\n element: string;\n isSelectable?: boolean;\n isSelect?: boolean;\n} & FolderComponentProps;\n\nconst Folder = forwardRef<\n HTMLDivElement,\n FolderProps & React.HTMLAttributes<HTMLDivElement>\n>(\n (\n {\n className,\n element,\n value,\n isSelectable = true,\n isSelect,\n children,\n ...props\n },\n ref,\n ) => {\n const {\n direction,\n handleExpand,\n expandedItems,\n indicator,\n setExpandedItems,\n openIcon,\n closeIcon,\n } = useTree();\n\n return (\n <AccordionPrimitive.Item\n {...props}\n value={value}\n className=\"relative h-full overflow-hidden\"\n >\n <AccordionPrimitive.Trigger\n className={cn(\n `flex items-center gap-1 rounded-md text-sm`,\n className,\n {\n \"bg-muted rounded-md\": isSelect && isSelectable,\n \"cursor-pointer\": isSelectable,\n \"cursor-not-allowed opacity-50\": !isSelectable,\n },\n )}\n disabled={!isSelectable}\n onClick={() => handleExpand(value)}\n >\n {expandedItems?.includes(value)\n ? (openIcon ?? <FolderOpenIcon className=\"size-4\" />)\n : (closeIcon ?? <FolderIcon className=\"size-4\" />)}\n <span>{element}</span>\n </AccordionPrimitive.Trigger>\n <AccordionPrimitive.Content className=\"relative h-full overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\">\n {element && indicator && <TreeIndicator aria-hidden=\"true\" />}\n <AccordionPrimitive.Root\n dir={direction}\n type=\"multiple\"\n className=\"ml-5 flex flex-col gap-1 py-1 rtl:mr-5 \"\n defaultValue={expandedItems}\n value={expandedItems}\n onValueChange={(value) => {\n setExpandedItems?.((prev) => [...(prev ?? []), value[0]]);\n }}\n >\n {children}\n </AccordionPrimitive.Root>\n </AccordionPrimitive.Content>\n </AccordionPrimitive.Item>\n );\n },\n);\n\nFolder.displayName = \"Folder\";\n\nconst File = forwardRef<\n HTMLButtonElement,\n {\n value: string;\n handleSelect?: (id: string) => void;\n isSelectable?: boolean;\n isSelect?: boolean;\n fileIcon?: React.ReactNode;\n } & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(\n (\n {\n value,\n className,\n handleSelect,\n isSelectable = true,\n isSelect,\n fileIcon,\n children,\n ...props\n },\n ref,\n ) => {\n const { direction, selectedId, selectItem } = useTree();\n const isSelected = isSelect ?? selectedId === value;\n return (\n <button\n ref={ref}\n type=\"button\"\n disabled={!isSelectable}\n className={cn(\n \"flex w-fit items-center gap-1 rounded-md pr-1 text-sm duration-200 ease-in-out rtl:pl-1 rtl:pr-0\",\n {\n \"bg-muted\": isSelected && isSelectable,\n },\n isSelectable ? \"cursor-pointer\" : \"cursor-not-allowed opacity-50\",\n direction === \"rtl\" ? \"rtl\" : \"ltr\",\n className,\n )}\n onClick={() => selectItem(value)}\n {...props}\n >\n {fileIcon ?? <FileIcon className=\"size-4\" />}\n {children}\n </button>\n );\n },\n);\n\nFile.displayName = \"File\";\n\nconst CollapseButton = forwardRef<\n HTMLButtonElement,\n {\n elements: TreeViewElement[];\n expandAll?: boolean;\n } & React.HTMLAttributes<HTMLButtonElement>\n>(({ className, elements, expandAll = false, children, ...props }, ref) => {\n const { expandedItems, setExpandedItems } = useTree();\n\n const expendAllTree = useCallback((elements: TreeViewElement[]) => {\n const expandTree = (element: TreeViewElement) => {\n const isSelectable = element.isSelectable ?? true;\n if (isSelectable && element.children && element.children.length > 0) {\n setExpandedItems?.((prev) => [...(prev ?? []), element.id]);\n element.children.forEach(expandTree);\n }\n };\n\n elements.forEach(expandTree);\n }, []);\n\n const closeAll = useCallback(() => {\n setExpandedItems?.([]);\n }, []);\n\n useEffect(() => {\n console.log(expandAll);\n if (expandAll) {\n expendAllTree(elements);\n }\n }, [expandAll]);\n\n return (\n <Button\n variant={\"ghost\"}\n className=\"absolute bottom-1 right-2 h-8 w-fit p-1\"\n onClick={\n expandedItems && expandedItems.length > 0\n ? closeAll\n : () => expendAllTree(elements)\n }\n ref={ref}\n {...props}\n >\n {children}\n <span className=\"sr-only\">Toggle</span>\n </Button>\n );\n});\n\nCollapseButton.displayName = \"CollapseButton\";\n\nexport { CollapseButton, File, Folder, Tree, type TreeViewElement };\n",
+ "content": "\"use client\"\n\nimport React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { FileIcon, FolderIcon, FolderOpenIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { ScrollArea } from \"@/components/ui/scroll-area\"\n\ntype TreeViewElement = {\n id: string\n name: string\n isSelectable?: boolean\n children?: TreeViewElement[]\n}\n\ntype TreeContextProps = {\n selectedId: string | undefined\n expandedItems: string[] | undefined\n indicator: boolean\n handleExpand: (id: string) => void\n selectItem: (id: string) => void\n setExpandedItems?: React.Dispatch<React.SetStateAction<string[] | undefined>>\n openIcon?: React.ReactNode\n closeIcon?: React.ReactNode\n direction: \"rtl\" | \"ltr\"\n}\n\nconst TreeContext = createContext<TreeContextProps | null>(null)\n\nconst useTree = () => {\n const context = useContext(TreeContext)\n if (!context) {\n throw new Error(\"useTree must be used within a TreeProvider\")\n }\n return context\n}\n\ninterface TreeViewComponentProps extends React.HTMLAttributes<HTMLDivElement> {}\n\ntype Direction = \"rtl\" | \"ltr\" | undefined\n\ntype TreeViewProps = {\n initialSelectedId?: string\n indicator?: boolean\n elements?: TreeViewElement[]\n initialExpandedItems?: string[]\n openIcon?: React.ReactNode\n closeIcon?: React.ReactNode\n} & TreeViewComponentProps\n\nconst Tree = forwardRef<HTMLDivElement, TreeViewProps>(\n (\n {\n className,\n elements,\n initialSelectedId,\n initialExpandedItems,\n children,\n indicator = true,\n openIcon,\n closeIcon,\n dir,\n ...props\n },\n ref\n ) => {\n const [selectedId, setSelectedId] = useState<string | undefined>(\n initialSelectedId\n )\n const [expandedItems, setExpandedItems] = useState<string[] | undefined>(\n initialExpandedItems\n )\n\n const selectItem = useCallback((id: string) => {\n setSelectedId(id)\n }, [])\n\n const handleExpand = useCallback((id: string) => {\n setExpandedItems((prev) => {\n if (prev?.includes(id)) {\n return prev.filter((item) => item !== id)\n }\n return [...(prev ?? []), id]\n })\n }, [])\n\n const expandSpecificTargetedElements = useCallback(\n (elements?: TreeViewElement[], selectId?: string) => {\n if (!elements || !selectId) return\n const findParent = (\n currentElement: TreeViewElement,\n currentPath: string[] = []\n ) => {\n const isSelectable = currentElement.isSelectable ?? true\n const newPath = [...currentPath, currentElement.id]\n if (currentElement.id === selectId) {\n if (isSelectable) {\n setExpandedItems((prev) => [...(prev ?? []), ...newPath])\n } else {\n if (newPath.includes(currentElement.id)) {\n newPath.pop()\n setExpandedItems((prev) => [...(prev ?? []), ...newPath])\n }\n }\n return\n }\n if (\n isSelectable &&\n currentElement.children &&\n currentElement.children.length > 0\n ) {\n currentElement.children.forEach((child) => {\n findParent(child, newPath)\n })\n }\n }\n elements.forEach((element) => {\n findParent(element)\n })\n },\n []\n )\n\n useEffect(() => {\n if (initialSelectedId) {\n expandSpecificTargetedElements(elements, initialSelectedId)\n }\n }, [initialSelectedId, elements])\n\n const direction = dir === \"rtl\" ? \"rtl\" : \"ltr\"\n\n return (\n <TreeContext.Provider\n value={{\n selectedId,\n expandedItems,\n handleExpand,\n selectItem,\n setExpandedItems,\n indicator,\n openIcon,\n closeIcon,\n direction,\n }}\n >\n <div className={cn(\"size-full\", className)}>\n <ScrollArea\n ref={ref}\n className=\"relative h-full px-2\"\n dir={dir as Direction}\n >\n <AccordionPrimitive.Root\n {...props}\n type=\"multiple\"\n defaultValue={expandedItems}\n value={expandedItems}\n className=\"flex flex-col gap-1\"\n onValueChange={(value) =>\n setExpandedItems((prev) => [...(prev ?? []), value[0]])\n }\n dir={dir as Direction}\n >\n {children}\n </AccordionPrimitive.Root>\n </ScrollArea>\n </div>\n </TreeContext.Provider>\n )\n }\n)\n\nTree.displayName = \"Tree\"\n\nconst TreeIndicator = forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { direction } = useTree()\n\n return (\n <div\n dir={direction}\n ref={ref}\n className={cn(\n \"bg-muted absolute left-1.5 h-full w-px rounded-md py-3 duration-300 ease-in-out hover:bg-slate-300 rtl:right-1.5\",\n className\n )}\n {...props}\n />\n )\n})\n\nTreeIndicator.displayName = \"TreeIndicator\"\n\ninterface FolderComponentProps\n extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {}\n\ntype FolderProps = {\n expandedItems?: string[]\n element: string\n isSelectable?: boolean\n isSelect?: boolean\n} & FolderComponentProps\n\nconst Folder = forwardRef<\n HTMLDivElement,\n FolderProps & React.HTMLAttributes<HTMLDivElement>\n>(\n (\n {\n className,\n element,\n value,\n isSelectable = true,\n isSelect,\n children,\n ...props\n },\n ref\n ) => {\n const {\n direction,\n handleExpand,\n expandedItems,\n indicator,\n setExpandedItems,\n openIcon,\n closeIcon,\n } = useTree()\n\n return (\n <AccordionPrimitive.Item\n {...props}\n value={value}\n className=\"relative h-full overflow-hidden\"\n >\n <AccordionPrimitive.Trigger\n className={cn(\n `flex items-center gap-1 rounded-md text-sm`,\n className,\n {\n \"bg-muted rounded-md\": isSelect && isSelectable,\n \"cursor-pointer\": isSelectable,\n \"cursor-not-allowed opacity-50\": !isSelectable,\n }\n )}\n disabled={!isSelectable}\n onClick={() => handleExpand(value)}\n >\n {expandedItems?.includes(value)\n ? (openIcon ?? <FolderOpenIcon className=\"size-4\" />)\n : (closeIcon ?? <FolderIcon className=\"size-4\" />)}\n <span>{element}</span>\n </AccordionPrimitive.Trigger>\n <AccordionPrimitive.Content className=\"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down relative h-full overflow-hidden text-sm\">\n {element && indicator && <TreeIndicator aria-hidden=\"true\" />}\n <AccordionPrimitive.Root\n dir={direction}\n type=\"multiple\"\n className=\"ml-5 flex flex-col gap-1 py-1 rtl:mr-5\"\n defaultValue={expandedItems}\n value={expandedItems}\n onValueChange={(value) => {\n setExpandedItems?.((prev) => [...(prev ?? []), value[0]])\n }}\n >\n {children}\n </AccordionPrimitive.Root>\n </AccordionPrimitive.Content>\n </AccordionPrimitive.Item>\n )\n }\n)\n\nFolder.displayName = \"Folder\"\n\nconst File = forwardRef<\n HTMLButtonElement,\n {\n value: string\n handleSelect?: (id: string) => void\n isSelectable?: boolean\n isSelect?: boolean\n fileIcon?: React.ReactNode\n } & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(\n (\n {\n value,\n className,\n handleSelect,\n isSelectable = true,\n isSelect,\n fileIcon,\n children,\n ...props\n },\n ref\n ) => {\n const { direction, selectedId, selectItem } = useTree()\n const isSelected = isSelect ?? selectedId === value\n return (\n <button\n ref={ref}\n type=\"button\"\n disabled={!isSelectable}\n className={cn(\n \"flex w-fit items-center gap-1 rounded-md pr-1 text-sm duration-200 ease-in-out rtl:pr-0 rtl:pl-1\",\n {\n \"bg-muted\": isSelected && isSelectable,\n },\n isSelectable ? \"cursor-pointer\" : \"cursor-not-allowed opacity-50\",\n direction === \"rtl\" ? \"rtl\" : \"ltr\",\n className\n )}\n onClick={() => selectItem(value)}\n {...props}\n >\n {fileIcon ?? <FileIcon className=\"size-4\" />}\n {children}\n </button>\n )\n }\n)\n\nFile.displayName = \"File\"\n\nconst CollapseButton = forwardRef<\n HTMLButtonElement,\n {\n elements: TreeViewElement[]\n expandAll?: boolean\n } & React.HTMLAttributes<HTMLButtonElement>\n>(({ className, elements, expandAll = false, children, ...props }, ref) => {\n const { expandedItems, setExpandedItems } = useTree()\n\n const expendAllTree = useCallback((elements: TreeViewElement[]) => {\n const expandTree = (element: TreeViewElement) => {\n const isSelectable = element.isSelectable ?? true\n if (isSelectable && element.children && element.children.length > 0) {\n setExpandedItems?.((prev) => [...(prev ?? []), element.id])\n element.children.forEach(expandTree)\n }\n }\n\n elements.forEach(expandTree)\n }, [])\n\n const closeAll = useCallback(() => {\n setExpandedItems?.([])\n }, [])\n\n useEffect(() => {\n console.log(expandAll)\n if (expandAll) {\n expendAllTree(elements)\n }\n }, [expandAll])\n\n return (\n <Button\n variant={\"ghost\"}\n className=\"absolute right-2 bottom-1 h-8 w-fit p-1\"\n onClick={\n expandedItems && expandedItems.length > 0\n ? closeAll\n : () => expendAllTree(elements)\n }\n ref={ref}\n {...props}\n >\n {children}\n <span className=\"sr-only\">Toggle</span>\n </Button>\n )\n})\n\nCollapseButton.displayName = \"CollapseButton\"\n\nexport { CollapseButton, File, Folder, Tree, type TreeViewElement }\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/flickering-grid-demo.json b/apps/www/public/r/flickering-grid-demo.json
index acb7a2f6..c993d5e6 100644
--- a/apps/www/public/r/flickering-grid-demo.json
+++ b/apps/www/public/r/flickering-grid-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/flickering-grid-demo.tsx",
- "content": "import { FlickeringGrid } from \"@/registry/magicui/flickering-grid\";\n\nexport default function FlickeringGridDemo() {\n return (\n <div className=\"relative h-[500px] w-full overflow-hidden rounded-lg border bg-background\">\n <FlickeringGrid\n className=\"absolute inset-0 z-0 size-full\"\n squareSize={4}\n gridGap={6}\n color=\"#6B7280\"\n maxOpacity={0.5}\n flickerChance={0.1}\n height={800}\n width={800}\n />\n </div>\n );\n}\n",
+ "content": "import { FlickeringGrid } from \"@/registry/magicui/flickering-grid\"\n\nexport default function FlickeringGridDemo() {\n return (\n <div className=\"bg-background relative h-[500px] w-full overflow-hidden rounded-lg border\">\n <FlickeringGrid\n className=\"absolute inset-0 z-0 size-full\"\n squareSize={4}\n gridGap={6}\n color=\"#6B7280\"\n maxOpacity={0.5}\n flickerChance={0.1}\n height={800}\n width={800}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/flickering-grid-rounded-demo.json b/apps/www/public/r/flickering-grid-rounded-demo.json
index fa60d910..dbfbfd3c 100644
--- a/apps/www/public/r/flickering-grid-rounded-demo.json
+++ b/apps/www/public/r/flickering-grid-rounded-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/flickering-grid-rounded-demo.tsx",
- "content": "import { FlickeringGrid } from \"@/registry/magicui/flickering-grid\";\n\nexport default function FlickeringGridRoundedDemo() {\n return (\n <div className=\"relative size-[600px] w-full overflow-hidden rounded-lg border bg-background\">\n <FlickeringGrid\n className=\"relative inset-0 z-0 [mask-image:radial-gradient(450px_circle_at_center,white,transparent)]\"\n squareSize={4}\n gridGap={6}\n color=\"#60A5FA\"\n maxOpacity={0.5}\n flickerChance={0.1}\n height={800}\n width={800}\n />\n </div>\n );\n}\n",
+ "content": "import { FlickeringGrid } from \"@/registry/magicui/flickering-grid\"\n\nexport default function FlickeringGridRoundedDemo() {\n return (\n <div className=\"bg-background relative size-[600px] w-full overflow-hidden rounded-lg border\">\n <FlickeringGrid\n className=\"relative inset-0 z-0 [mask-image:radial-gradient(450px_circle_at_center,white,transparent)]\"\n squareSize={4}\n gridGap={6}\n color=\"#60A5FA\"\n maxOpacity={0.5}\n flickerChance={0.1}\n height={800}\n width={800}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/flickering-grid.json b/apps/www/public/r/flickering-grid.json
index a2dbcab5..fecf6a2b 100644
--- a/apps/www/public/r/flickering-grid.json
+++ b/apps/www/public/r/flickering-grid.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/flickering-grid.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\ninterface FlickeringGridProps extends React.HTMLAttributes<HTMLDivElement> {\n squareSize?: number;\n gridGap?: number;\n flickerChance?: number;\n color?: string;\n width?: number;\n height?: number;\n className?: string;\n maxOpacity?: number;\n}\n\nexport const FlickeringGrid: React.FC<FlickeringGridProps> = ({\n squareSize = 4,\n gridGap = 6,\n flickerChance = 0.3,\n color = \"rgb(0, 0, 0)\",\n width,\n height,\n className,\n maxOpacity = 0.3,\n ...props\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [isInView, setIsInView] = useState(false);\n const [canvasSize, setCanvasSize] = useState({ width: 0, height: 0 });\n\n const memoizedColor = useMemo(() => {\n const toRGBA = (color: string) => {\n if (typeof window === \"undefined\") {\n return `rgba(0, 0, 0,`;\n }\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return \"rgba(255, 0, 0,\";\n ctx.fillStyle = color;\n ctx.fillRect(0, 0, 1, 1);\n const [r, g, b] = Array.from(ctx.getImageData(0, 0, 1, 1).data);\n return `rgba(${r}, ${g}, ${b},`;\n };\n return toRGBA(color);\n }, [color]);\n\n const setupCanvas = useCallback(\n (canvas: HTMLCanvasElement, width: number, height: number) => {\n const dpr = window.devicePixelRatio || 1;\n canvas.width = width * dpr;\n canvas.height = height * dpr;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${height}px`;\n const cols = Math.floor(width / (squareSize + gridGap));\n const rows = Math.floor(height / (squareSize + gridGap));\n\n const squares = new Float32Array(cols * rows);\n for (let i = 0; i < squares.length; i++) {\n squares[i] = Math.random() * maxOpacity;\n }\n\n return { cols, rows, squares, dpr };\n },\n [squareSize, gridGap, maxOpacity],\n );\n\n const updateSquares = useCallback(\n (squares: Float32Array, deltaTime: number) => {\n for (let i = 0; i < squares.length; i++) {\n if (Math.random() < flickerChance * deltaTime) {\n squares[i] = Math.random() * maxOpacity;\n }\n }\n },\n [flickerChance, maxOpacity],\n );\n\n const drawGrid = useCallback(\n (\n ctx: CanvasRenderingContext2D,\n width: number,\n height: number,\n cols: number,\n rows: number,\n squares: Float32Array,\n dpr: number,\n ) => {\n ctx.clearRect(0, 0, width, height);\n ctx.fillStyle = \"transparent\";\n ctx.fillRect(0, 0, width, height);\n\n for (let i = 0; i < cols; i++) {\n for (let j = 0; j < rows; j++) {\n const opacity = squares[i * rows + j];\n ctx.fillStyle = `${memoizedColor}${opacity})`;\n ctx.fillRect(\n i * (squareSize + gridGap) * dpr,\n j * (squareSize + gridGap) * dpr,\n squareSize * dpr,\n squareSize * dpr,\n );\n }\n }\n },\n [memoizedColor, squareSize, gridGap],\n );\n\n useEffect(() => {\n const canvas = canvasRef.current;\n const container = containerRef.current;\n if (!canvas || !container) return;\n\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return;\n\n let animationFrameId: number;\n let gridParams: ReturnType<typeof setupCanvas>;\n\n const updateCanvasSize = () => {\n const newWidth = width || container.clientWidth;\n const newHeight = height || container.clientHeight;\n setCanvasSize({ width: newWidth, height: newHeight });\n gridParams = setupCanvas(canvas, newWidth, newHeight);\n };\n\n updateCanvasSize();\n\n let lastTime = 0;\n const animate = (time: number) => {\n if (!isInView) return;\n\n const deltaTime = (time - lastTime) / 1000;\n lastTime = time;\n\n updateSquares(gridParams.squares, deltaTime);\n drawGrid(\n ctx,\n canvas.width,\n canvas.height,\n gridParams.cols,\n gridParams.rows,\n gridParams.squares,\n gridParams.dpr,\n );\n animationFrameId = requestAnimationFrame(animate);\n };\n\n const resizeObserver = new ResizeObserver(() => {\n updateCanvasSize();\n });\n\n resizeObserver.observe(container);\n\n const intersectionObserver = new IntersectionObserver(\n ([entry]) => {\n setIsInView(entry.isIntersecting);\n },\n { threshold: 0 },\n );\n\n intersectionObserver.observe(canvas);\n\n if (isInView) {\n animationFrameId = requestAnimationFrame(animate);\n }\n\n return () => {\n cancelAnimationFrame(animationFrameId);\n resizeObserver.disconnect();\n intersectionObserver.disconnect();\n };\n }, [setupCanvas, updateSquares, drawGrid, width, height, isInView]);\n\n return (\n <div\n ref={containerRef}\n className={cn(`h-full w-full ${className}`)}\n {...props}\n >\n <canvas\n ref={canvasRef}\n className=\"pointer-events-none\"\n style={{\n width: canvasSize.width,\n height: canvasSize.height,\n }}\n />\n </div>\n );\n};\n",
+ "content": "\"use client\"\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface FlickeringGridProps extends React.HTMLAttributes<HTMLDivElement> {\n squareSize?: number\n gridGap?: number\n flickerChance?: number\n color?: string\n width?: number\n height?: number\n className?: string\n maxOpacity?: number\n}\n\nexport const FlickeringGrid: React.FC<FlickeringGridProps> = ({\n squareSize = 4,\n gridGap = 6,\n flickerChance = 0.3,\n color = \"rgb(0, 0, 0)\",\n width,\n height,\n className,\n maxOpacity = 0.3,\n ...props\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [isInView, setIsInView] = useState(false)\n const [canvasSize, setCanvasSize] = useState({ width: 0, height: 0 })\n\n const memoizedColor = useMemo(() => {\n const toRGBA = (color: string) => {\n if (typeof window === \"undefined\") {\n return `rgba(0, 0, 0,`\n }\n const canvas = document.createElement(\"canvas\")\n canvas.width = canvas.height = 1\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return \"rgba(255, 0, 0,\"\n ctx.fillStyle = color\n ctx.fillRect(0, 0, 1, 1)\n const [r, g, b] = Array.from(ctx.getImageData(0, 0, 1, 1).data)\n return `rgba(${r}, ${g}, ${b},`\n }\n return toRGBA(color)\n }, [color])\n\n const setupCanvas = useCallback(\n (canvas: HTMLCanvasElement, width: number, height: number) => {\n const dpr = window.devicePixelRatio || 1\n canvas.width = width * dpr\n canvas.height = height * dpr\n canvas.style.width = `${width}px`\n canvas.style.height = `${height}px`\n const cols = Math.floor(width / (squareSize + gridGap))\n const rows = Math.floor(height / (squareSize + gridGap))\n\n const squares = new Float32Array(cols * rows)\n for (let i = 0; i < squares.length; i++) {\n squares[i] = Math.random() * maxOpacity\n }\n\n return { cols, rows, squares, dpr }\n },\n [squareSize, gridGap, maxOpacity]\n )\n\n const updateSquares = useCallback(\n (squares: Float32Array, deltaTime: number) => {\n for (let i = 0; i < squares.length; i++) {\n if (Math.random() < flickerChance * deltaTime) {\n squares[i] = Math.random() * maxOpacity\n }\n }\n },\n [flickerChance, maxOpacity]\n )\n\n const drawGrid = useCallback(\n (\n ctx: CanvasRenderingContext2D,\n width: number,\n height: number,\n cols: number,\n rows: number,\n squares: Float32Array,\n dpr: number\n ) => {\n ctx.clearRect(0, 0, width, height)\n ctx.fillStyle = \"transparent\"\n ctx.fillRect(0, 0, width, height)\n\n for (let i = 0; i < cols; i++) {\n for (let j = 0; j < rows; j++) {\n const opacity = squares[i * rows + j]\n ctx.fillStyle = `${memoizedColor}${opacity})`\n ctx.fillRect(\n i * (squareSize + gridGap) * dpr,\n j * (squareSize + gridGap) * dpr,\n squareSize * dpr,\n squareSize * dpr\n )\n }\n }\n },\n [memoizedColor, squareSize, gridGap]\n )\n\n useEffect(() => {\n const canvas = canvasRef.current\n const container = containerRef.current\n if (!canvas || !container) return\n\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return\n\n let animationFrameId: number\n let gridParams: ReturnType<typeof setupCanvas>\n\n const updateCanvasSize = () => {\n const newWidth = width || container.clientWidth\n const newHeight = height || container.clientHeight\n setCanvasSize({ width: newWidth, height: newHeight })\n gridParams = setupCanvas(canvas, newWidth, newHeight)\n }\n\n updateCanvasSize()\n\n let lastTime = 0\n const animate = (time: number) => {\n if (!isInView) return\n\n const deltaTime = (time - lastTime) / 1000\n lastTime = time\n\n updateSquares(gridParams.squares, deltaTime)\n drawGrid(\n ctx,\n canvas.width,\n canvas.height,\n gridParams.cols,\n gridParams.rows,\n gridParams.squares,\n gridParams.dpr\n )\n animationFrameId = requestAnimationFrame(animate)\n }\n\n const resizeObserver = new ResizeObserver(() => {\n updateCanvasSize()\n })\n\n resizeObserver.observe(container)\n\n const intersectionObserver = new IntersectionObserver(\n ([entry]) => {\n setIsInView(entry.isIntersecting)\n },\n { threshold: 0 }\n )\n\n intersectionObserver.observe(canvas)\n\n if (isInView) {\n animationFrameId = requestAnimationFrame(animate)\n }\n\n return () => {\n cancelAnimationFrame(animationFrameId)\n resizeObserver.disconnect()\n intersectionObserver.disconnect()\n }\n }, [setupCanvas, updateSquares, drawGrid, width, height, isInView])\n\n return (\n <div\n ref={containerRef}\n className={cn(`h-full w-full ${className}`)}\n {...props}\n >\n <canvas\n ref={canvasRef}\n className=\"pointer-events-none\"\n style={{\n width: canvasSize.width,\n height: canvasSize.height,\n }}\n />\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/flip-text-demo.json b/apps/www/public/r/flip-text-demo.json
index e5071ab0..f5ead515 100644
--- a/apps/www/public/r/flip-text-demo.json
+++ b/apps/www/public/r/flip-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/flip-text-demo.tsx",
- "content": "import { FlipText } from \"@/registry/magicui/flip-text\";\n\nexport default function FlipTextDemo() {\n return (\n <FlipText className=\"text-4xl font-bold -tracking-widest text-black dark:text-white md:text-7xl md:leading-[5rem]\">\n Flip Text\n </FlipText>\n );\n}\n",
+ "content": "import { FlipText } from \"@/registry/magicui/flip-text\"\n\nexport default function FlipTextDemo() {\n return (\n <FlipText className=\"text-4xl font-bold -tracking-widest text-black md:text-7xl md:leading-[5rem] dark:text-white\">\n Flip Text\n </FlipText>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/flip-text.json b/apps/www/public/r/flip-text.json
index 3e3a0e2c..b45d9909 100644
--- a/apps/www/public/r/flip-text.json
+++ b/apps/www/public/r/flip-text.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/flip-text.tsx",
- "content": "\"use client\";\n\nimport { AnimatePresence, motion, Variants, MotionProps } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { ElementType } from \"react\";\nimport React from \"react\";\n\ninterface FlipTextProps extends MotionProps {\n /** The duration of the animation */\n duration?: number;\n /** The delay between each character */\n delayMultiple?: number;\n /** The variants of the animation */\n framerProps?: Variants;\n /** The class name of the component */\n className?: string;\n /** The element type of the component */\n as?: ElementType;\n /** The children of the component */\n children: React.ReactNode;\n /** The variants of the animation */\n variants?: Variants;\n}\n\nconst defaultVariants: Variants = {\n hidden: { rotateX: -90, opacity: 0 },\n visible: { rotateX: 0, opacity: 1 },\n};\n\nexport function FlipText({\n children,\n duration = 0.5,\n delayMultiple = 0.08,\n\n className,\n as: Component = \"span\",\n variants,\n ...props\n}: FlipTextProps) {\n const MotionComponent = motion.create(Component);\n const characters = React.Children.toArray(children).join(\"\").split(\"\");\n\n return (\n <div className=\"flex justify-center space-x-2\">\n <AnimatePresence mode=\"wait\">\n {characters.map((char, i) => (\n <MotionComponent\n key={i}\n initial=\"hidden\"\n animate=\"visible\"\n exit=\"hidden\"\n variants={variants || defaultVariants}\n transition={{ duration, delay: i * delayMultiple }}\n className={cn(\"origin-center drop-shadow-sm\", className)}\n {...props}\n >\n {char}\n </MotionComponent>\n ))}\n </AnimatePresence>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport React, { ElementType } from \"react\"\nimport { AnimatePresence, motion, MotionProps, Variants } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface FlipTextProps extends MotionProps {\n /** The duration of the animation */\n duration?: number\n /** The delay between each character */\n delayMultiple?: number\n /** The variants of the animation */\n framerProps?: Variants\n /** The class name of the component */\n className?: string\n /** The element type of the component */\n as?: ElementType\n /** The children of the component */\n children: React.ReactNode\n /** The variants of the animation */\n variants?: Variants\n}\n\nconst defaultVariants: Variants = {\n hidden: { rotateX: -90, opacity: 0 },\n visible: { rotateX: 0, opacity: 1 },\n}\n\nexport function FlipText({\n children,\n duration = 0.5,\n delayMultiple = 0.08,\n\n className,\n as: Component = \"span\",\n variants,\n ...props\n}: FlipTextProps) {\n const MotionComponent = motion.create(Component)\n const characters = React.Children.toArray(children).join(\"\").split(\"\")\n\n return (\n <div className=\"flex justify-center space-x-2\">\n <AnimatePresence mode=\"wait\">\n {characters.map((char, i) => (\n <MotionComponent\n key={i}\n initial=\"hidden\"\n animate=\"visible\"\n exit=\"hidden\"\n variants={variants || defaultVariants}\n transition={{ duration, delay: i * delayMultiple }}\n className={cn(\"origin-center drop-shadow-sm\", className)}\n {...props}\n >\n {char}\n </MotionComponent>\n ))}\n </AnimatePresence>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/globe-demo.json b/apps/www/public/r/globe-demo.json
index b2f669e6..6b9f7844 100644
--- a/apps/www/public/r/globe-demo.json
+++ b/apps/www/public/r/globe-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/globe-demo.tsx",
- "content": "import { Globe } from \"@/registry/magicui/globe\";\n\nexport default function GlobeDemo() {\n return (\n <div className=\"relative flex size-full max-w-lg items-center justify-center overflow-hidden rounded-lg border bg-background px-40 pb-40 pt-8 md:pb-60\">\n <span className=\"pointer-events-none whitespace-pre-wrap bg-gradient-to-b from-black to-gray-300/80 bg-clip-text text-center text-8xl font-semibold leading-none text-transparent dark:from-white dark:to-slate-900/10\">\n Globe\n </span>\n <Globe className=\"top-28\" />\n <div className=\"pointer-events-none absolute inset-0 h-full bg-[radial-gradient(circle_at_50%_200%,rgba(0,0,0,0.2),rgba(255,255,255,0))]\" />\n </div>\n );\n}\n",
+ "content": "import { Globe } from \"@/registry/magicui/globe\"\n\nexport default function GlobeDemo() {\n return (\n <div className=\"bg-background relative flex size-full max-w-lg items-center justify-center overflow-hidden rounded-lg border px-40 pt-8 pb-40 md:pb-60\">\n <span className=\"pointer-events-none bg-gradient-to-b from-black to-gray-300/80 bg-clip-text text-center text-8xl leading-none font-semibold whitespace-pre-wrap text-transparent dark:from-white dark:to-slate-900/10\">\n Globe\n </span>\n <Globe className=\"top-28\" />\n <div className=\"pointer-events-none absolute inset-0 h-full bg-[radial-gradient(circle_at_50%_200%,rgba(0,0,0,0.2),rgba(255,255,255,0))]\" />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/globe.json b/apps/www/public/r/globe.json
index 3f4b4317..bc7cd439 100644
--- a/apps/www/public/r/globe.json
+++ b/apps/www/public/r/globe.json
@@ -11,7 +11,7 @@
"files": [
{
"path": "registry/magicui/globe.tsx",
- "content": "\"use client\";\n\nimport createGlobe, { COBEOptions } from \"cobe\";\nimport { useMotionValue, useSpring } from \"motion/react\";\nimport { useEffect, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst MOVEMENT_DAMPING = 1400;\n\nconst GLOBE_CONFIG: COBEOptions = {\n width: 800,\n height: 800,\n onRender: () => {},\n devicePixelRatio: 2,\n phi: 0,\n theta: 0.3,\n dark: 0,\n diffuse: 0.4,\n mapSamples: 16000,\n mapBrightness: 1.2,\n baseColor: [1, 1, 1],\n markerColor: [251 / 255, 100 / 255, 21 / 255],\n glowColor: [1, 1, 1],\n markers: [\n { location: [14.5995, 120.9842], size: 0.03 },\n { location: [19.076, 72.8777], size: 0.1 },\n { location: [23.8103, 90.4125], size: 0.05 },\n { location: [30.0444, 31.2357], size: 0.07 },\n { location: [39.9042, 116.4074], size: 0.08 },\n { location: [-23.5505, -46.6333], size: 0.1 },\n { location: [19.4326, -99.1332], size: 0.1 },\n { location: [40.7128, -74.006], size: 0.1 },\n { location: [34.6937, 135.5022], size: 0.05 },\n { location: [41.0082, 28.9784], size: 0.06 },\n ],\n};\n\nexport function Globe({\n className,\n config = GLOBE_CONFIG,\n}: {\n className?: string;\n config?: COBEOptions;\n}) {\n let phi = 0;\n let width = 0;\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const pointerInteracting = useRef<number | null>(null);\n const pointerInteractionMovement = useRef(0);\n\n const r = useMotionValue(0);\n const rs = useSpring(r, {\n mass: 1,\n damping: 30,\n stiffness: 100,\n });\n\n const updatePointerInteraction = (value: number | null) => {\n pointerInteracting.current = value;\n if (canvasRef.current) {\n canvasRef.current.style.cursor = value !== null ? \"grabbing\" : \"grab\";\n }\n };\n\n const updateMovement = (clientX: number) => {\n if (pointerInteracting.current !== null) {\n const delta = clientX - pointerInteracting.current;\n pointerInteractionMovement.current = delta;\n r.set(r.get() + delta / MOVEMENT_DAMPING);\n }\n };\n\n useEffect(() => {\n const onResize = () => {\n if (canvasRef.current) {\n width = canvasRef.current.offsetWidth;\n }\n };\n\n window.addEventListener(\"resize\", onResize);\n onResize();\n\n const globe = createGlobe(canvasRef.current!, {\n ...config,\n width: width * 2,\n height: width * 2,\n onRender: (state) => {\n if (!pointerInteracting.current) phi += 0.005;\n state.phi = phi + rs.get();\n state.width = width * 2;\n state.height = width * 2;\n },\n });\n\n setTimeout(() => (canvasRef.current!.style.opacity = \"1\"), 0);\n return () => {\n globe.destroy();\n window.removeEventListener(\"resize\", onResize);\n };\n }, [rs, config]);\n\n return (\n <div\n className={cn(\n \"absolute inset-0 mx-auto aspect-[1/1] w-full max-w-[600px]\",\n className,\n )}\n >\n <canvas\n className={cn(\n \"size-full opacity-0 transition-opacity duration-500 [contain:layout_paint_size]\",\n )}\n ref={canvasRef}\n onPointerDown={(e) => {\n pointerInteracting.current = e.clientX;\n updatePointerInteraction(e.clientX);\n }}\n onPointerUp={() => updatePointerInteraction(null)}\n onPointerOut={() => updatePointerInteraction(null)}\n onMouseMove={(e) => updateMovement(e.clientX)}\n onTouchMove={(e) =>\n e.touches[0] && updateMovement(e.touches[0].clientX)\n }\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useRef } from \"react\"\nimport createGlobe, { COBEOptions } from \"cobe\"\nimport { useMotionValue, useSpring } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst MOVEMENT_DAMPING = 1400\n\nconst GLOBE_CONFIG: COBEOptions = {\n width: 800,\n height: 800,\n onRender: () => {},\n devicePixelRatio: 2,\n phi: 0,\n theta: 0.3,\n dark: 0,\n diffuse: 0.4,\n mapSamples: 16000,\n mapBrightness: 1.2,\n baseColor: [1, 1, 1],\n markerColor: [251 / 255, 100 / 255, 21 / 255],\n glowColor: [1, 1, 1],\n markers: [\n { location: [14.5995, 120.9842], size: 0.03 },\n { location: [19.076, 72.8777], size: 0.1 },\n { location: [23.8103, 90.4125], size: 0.05 },\n { location: [30.0444, 31.2357], size: 0.07 },\n { location: [39.9042, 116.4074], size: 0.08 },\n { location: [-23.5505, -46.6333], size: 0.1 },\n { location: [19.4326, -99.1332], size: 0.1 },\n { location: [40.7128, -74.006], size: 0.1 },\n { location: [34.6937, 135.5022], size: 0.05 },\n { location: [41.0082, 28.9784], size: 0.06 },\n ],\n}\n\nexport function Globe({\n className,\n config = GLOBE_CONFIG,\n}: {\n className?: string\n config?: COBEOptions\n}) {\n let phi = 0\n let width = 0\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const pointerInteracting = useRef<number | null>(null)\n const pointerInteractionMovement = useRef(0)\n\n const r = useMotionValue(0)\n const rs = useSpring(r, {\n mass: 1,\n damping: 30,\n stiffness: 100,\n })\n\n const updatePointerInteraction = (value: number | null) => {\n pointerInteracting.current = value\n if (canvasRef.current) {\n canvasRef.current.style.cursor = value !== null ? \"grabbing\" : \"grab\"\n }\n }\n\n const updateMovement = (clientX: number) => {\n if (pointerInteracting.current !== null) {\n const delta = clientX - pointerInteracting.current\n pointerInteractionMovement.current = delta\n r.set(r.get() + delta / MOVEMENT_DAMPING)\n }\n }\n\n useEffect(() => {\n const onResize = () => {\n if (canvasRef.current) {\n width = canvasRef.current.offsetWidth\n }\n }\n\n window.addEventListener(\"resize\", onResize)\n onResize()\n\n const globe = createGlobe(canvasRef.current!, {\n ...config,\n width: width * 2,\n height: width * 2,\n onRender: (state) => {\n if (!pointerInteracting.current) phi += 0.005\n state.phi = phi + rs.get()\n state.width = width * 2\n state.height = width * 2\n },\n })\n\n setTimeout(() => (canvasRef.current!.style.opacity = \"1\"), 0)\n return () => {\n globe.destroy()\n window.removeEventListener(\"resize\", onResize)\n }\n }, [rs, config])\n\n return (\n <div\n className={cn(\n \"absolute inset-0 mx-auto aspect-[1/1] w-full max-w-[600px]\",\n className\n )}\n >\n <canvas\n className={cn(\n \"size-full opacity-0 transition-opacity duration-500 [contain:layout_paint_size]\"\n )}\n ref={canvasRef}\n onPointerDown={(e) => {\n pointerInteracting.current = e.clientX\n updatePointerInteraction(e.clientX)\n }}\n onPointerUp={() => updatePointerInteraction(null)}\n onPointerOut={() => updatePointerInteraction(null)}\n onMouseMove={(e) => updateMovement(e.clientX)}\n onTouchMove={(e) =>\n e.touches[0] && updateMovement(e.touches[0].clientX)\n }\n />\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/grid-beams-demo.json b/apps/www/public/r/grid-beams-demo.json
index 32b2e753..0a505a8d 100644
--- a/apps/www/public/r/grid-beams-demo.json
+++ b/apps/www/public/r/grid-beams-demo.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/example/grid-beams-demo.tsx",
- "content": "import { GridBeams } from \"@/registry/magicui/grid-beams\";\n\nexport default function GridBeamsDemo() {\n return (\n <div className=\"relative h-[500px] w-full overflow-hidden rounded-lg border\">\n <GridBeams\n gridSize={0}\n gridColor=\"rgba(255, 255, 255, 0.2)\"\n rayCount={20}\n rayOpacity={0.55}\n raySpeed={1.5}\n rayLength=\"40vh\"\n gridFadeStart={5}\n gridFadeEnd={90}\n className=\"h-full w-full\"\n >\n <div className=\"flex h-full items-center justify-center\">\n <div className=\"text-center space-y-6 px-4 mt-50\">\n <h1 className=\"text-5xl md:text-7xl font-bold text-white leading-tight\">\n Grid <span className=\"text-blue-400\">BEAMS</span>\n </h1>\n </div>\n </div>\n </GridBeams>\n </div>\n );\n}\n",
+ "content": "import { GridBeams } from \"@/registry/magicui/grid-beams\"\n\nexport default function GridBeamsDemo() {\n return (\n <div className=\"relative h-[500px] w-full overflow-hidden rounded-lg border\">\n <GridBeams\n gridSize={0}\n gridColor=\"rgba(255, 255, 255, 0.2)\"\n rayCount={20}\n rayOpacity={0.55}\n raySpeed={1.5}\n rayLength=\"40vh\"\n gridFadeStart={5}\n gridFadeEnd={90}\n className=\"h-full w-full\"\n >\n <div className=\"flex h-full items-center justify-center\">\n <div className=\"mt-50 space-y-6 px-4 text-center\">\n <h1 className=\"text-5xl leading-tight font-bold text-white md:text-7xl\">\n Grid <span className=\"text-blue-400\">BEAMS</span>\n </h1>\n </div>\n </div>\n </GridBeams>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/grid-beams.json b/apps/www/public/r/grid-beams.json
index a36f6de8..c2a89495 100644
--- a/apps/www/public/r/grid-beams.json
+++ b/apps/www/public/r/grid-beams.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/grid-beams.tsx",
- "content": "\"use client\";\n\nimport { motion } from \"motion/react\";\nimport React, { HTMLAttributes, useMemo } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nconst createGridMask = (start: number, end: number): string => {\n const mid = (start + end) / 2;\n return `linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.05) ${start}%, rgba(0,0,0,0.2) ${mid}%, rgba(0,0,0,0.6) ${end - 20}%, rgba(0,0,0,1) ${end}%)`;\n};\n\nconst generateRayConfig = (index: number, total: number) => {\n const progress = index / Math.max(total - 1, 1);\n const leftPercent = 2 + progress * 96;\n const rotation = 28 - progress * 56;\n const variation = (index * 0.618) % 1;\n\n return {\n left: `${leftPercent}%`,\n rotation,\n width: 40 + variation * 25,\n duration: 6 + variation * 5,\n delay: -variation * 10,\n swayDuration: 12 + variation * 9,\n swayDelay: -variation * 10,\n blur: 24 + variation * 9,\n strongSway: index % 2 === 0,\n };\n};\n\ninterface GridBeamsProps extends HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode;\n gridSize?: number;\n gridColor?: string;\n rayCount?: number;\n rayOpacity?: number;\n raySpeed?: number;\n rayLength?: string;\n gridFadeStart?: number;\n gridFadeEnd?: number;\n backgroundColor?: string;\n}\n\ninterface LightRayProps {\n left: string;\n rotation: number;\n width: number;\n delay: number;\n duration: number;\n swayDuration: number;\n swayDelay: number;\n blurAmount: number;\n isStrongerSway: boolean;\n opacity: number;\n speed: number;\n length: string;\n}\n\nconst LightRay = React.memo<LightRayProps>(\n ({\n left,\n rotation,\n width,\n delay,\n duration,\n swayDuration,\n swayDelay,\n blurAmount,\n isStrongerSway,\n opacity,\n speed,\n length,\n }) => {\n return (\n <motion.div\n className=\"absolute pointer-events-none -top-[5%] left-[var(--ray-left)] w-[var(--ray-width)] h-[var(--ray-height)] origin-top mix-blend-screen bg-[linear-gradient(to_bottom,rgba(200,220,255,var(--ray-opacity)),rgba(200,220,255,0))] blur-[var(--ray-blur)] translate-x-[-50%] rotate-[var(--ray-rotation)]\"\n style={\n {\n \"--ray-left\": left,\n \"--ray-width\": `${width}px`,\n \"--ray-height\": length,\n \"--ray-opacity\": opacity,\n \"--ray-blur\": `${blurAmount}px`,\n \"--ray-rotation\": `${rotation}deg`,\n } as React.CSSProperties\n }\n animate={{\n opacity: [0.3, 0.7, 0.3],\n transform: [\n `translateX(-50%) rotate(${rotation}deg)`,\n `translateX(-50%) rotate(${rotation + (isStrongerSway ? 1 : 0.5)}deg)`,\n `translateX(-50%) rotate(${rotation}deg)`,\n ],\n }}\n transition={{\n opacity: {\n duration: duration / speed,\n delay: delay / speed,\n repeat: Infinity,\n ease: \"easeInOut\",\n },\n transform: {\n duration: swayDuration / speed,\n delay: swayDelay / speed,\n repeat: Infinity,\n ease: \"easeInOut\",\n },\n }}\n />\n );\n },\n);\n\nexport const GridBeams: React.FC<GridBeamsProps> = ({\n children,\n className,\n gridSize = 40,\n gridColor = \"rgba(200, 220, 255, 0.2)\",\n rayCount = 15,\n rayOpacity = 0.35,\n raySpeed = 1,\n rayLength = \"45vh\",\n gridFadeStart = 30,\n gridFadeEnd = 90,\n backgroundColor = \"#020412\",\n ...props\n}) => {\n const rayConfigs = useMemo(() => {\n return Array.from({ length: rayCount }, (_, i) =>\n generateRayConfig(i, rayCount),\n );\n }, [rayCount]);\n\n const gridMask = useMemo(\n () => createGridMask(gridFadeStart, gridFadeEnd),\n [gridFadeStart, gridFadeEnd],\n );\n\n return (\n <div\n className={cn(\n \"relative overflow-hidden bg-[var(--bg-color)] bg-[radial-gradient(ellipse_at_50%_-20%,#1a2c5a,transparent_70%)]\",\n className,\n )}\n style={\n {\n \"--bg-color\": backgroundColor,\n } as React.CSSProperties\n }\n {...props}\n >\n <div\n className=\"absolute inset-0 pointer-events-none bg-[linear-gradient(var(--grid-color)_1px,transparent_1px),linear-gradient(90deg,var(--grid-color)_1px,transparent_1px)] bg-size-[var(--grid-size)_var(--grid-size)] [mask-image:var(--grid-mask)] [webkit-mask-image:var(--grid-mask)]\"\n style={\n {\n \"--grid-color\": gridColor,\n \"--grid-size\": `${gridSize}px`,\n \"--grid-mask\": gridMask,\n } as React.CSSProperties\n }\n />\n <div className=\"absolute inset-0 overflow-hidden pointer-events-none\">\n {rayConfigs.map((config, index) => (\n <LightRay\n key={index}\n left={config.left}\n rotation={config.rotation}\n width={config.width}\n delay={config.delay}\n duration={config.duration}\n swayDuration={config.swayDuration}\n swayDelay={config.swayDelay}\n blurAmount={config.blur}\n isStrongerSway={config.strongSway}\n opacity={rayOpacity}\n speed={raySpeed}\n length={rayLength}\n />\n ))}\n </div>\n\n <div className=\"relative z-10\">{children}</div>\n </div>\n );\n};\n",
+ "content": "\"use client\"\n\nimport React, { HTMLAttributes, useMemo } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst createGridMask = (start: number, end: number): string => {\n const mid = (start + end) / 2\n return `linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.05) ${start}%, rgba(0,0,0,0.2) ${mid}%, rgba(0,0,0,0.6) ${end - 20}%, rgba(0,0,0,1) ${end}%)`\n}\n\nconst generateRayConfig = (index: number, total: number) => {\n const progress = index / Math.max(total - 1, 1)\n const leftPercent = 2 + progress * 96\n const rotation = 28 - progress * 56\n const variation = (index * 0.618) % 1\n\n return {\n left: `${leftPercent}%`,\n rotation,\n width: 40 + variation * 25,\n duration: 6 + variation * 5,\n delay: -variation * 10,\n swayDuration: 12 + variation * 9,\n swayDelay: -variation * 10,\n blur: 24 + variation * 9,\n strongSway: index % 2 === 0,\n }\n}\n\ninterface GridBeamsProps extends HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n gridSize?: number\n gridColor?: string\n rayCount?: number\n rayOpacity?: number\n raySpeed?: number\n rayLength?: string\n gridFadeStart?: number\n gridFadeEnd?: number\n backgroundColor?: string\n}\n\ninterface LightRayProps {\n left: string\n rotation: number\n width: number\n delay: number\n duration: number\n swayDuration: number\n swayDelay: number\n blurAmount: number\n isStrongerSway: boolean\n opacity: number\n speed: number\n length: string\n}\n\nconst LightRay = React.memo<LightRayProps>(\n ({\n left,\n rotation,\n width,\n delay,\n duration,\n swayDuration,\n swayDelay,\n blurAmount,\n isStrongerSway,\n opacity,\n speed,\n length,\n }) => {\n return (\n <motion.div\n className=\"pointer-events-none absolute -top-[5%] left-[var(--ray-left)] h-[var(--ray-height)] w-[var(--ray-width)] origin-top translate-x-[-50%] rotate-[var(--ray-rotation)] bg-[linear-gradient(to_bottom,rgba(200,220,255,var(--ray-opacity)),rgba(200,220,255,0))] mix-blend-screen blur-[var(--ray-blur)]\"\n style={\n {\n \"--ray-left\": left,\n \"--ray-width\": `${width}px`,\n \"--ray-height\": length,\n \"--ray-opacity\": opacity,\n \"--ray-blur\": `${blurAmount}px`,\n \"--ray-rotation\": `${rotation}deg`,\n } as React.CSSProperties\n }\n animate={{\n opacity: [0.3, 0.7, 0.3],\n transform: [\n `translateX(-50%) rotate(${rotation}deg)`,\n `translateX(-50%) rotate(${rotation + (isStrongerSway ? 1 : 0.5)}deg)`,\n `translateX(-50%) rotate(${rotation}deg)`,\n ],\n }}\n transition={{\n opacity: {\n duration: duration / speed,\n delay: delay / speed,\n repeat: Infinity,\n ease: \"easeInOut\",\n },\n transform: {\n duration: swayDuration / speed,\n delay: swayDelay / speed,\n repeat: Infinity,\n ease: \"easeInOut\",\n },\n }}\n />\n )\n }\n)\n\nexport const GridBeams: React.FC<GridBeamsProps> = ({\n children,\n className,\n gridSize = 40,\n gridColor = \"rgba(200, 220, 255, 0.2)\",\n rayCount = 15,\n rayOpacity = 0.35,\n raySpeed = 1,\n rayLength = \"45vh\",\n gridFadeStart = 30,\n gridFadeEnd = 90,\n backgroundColor = \"#020412\",\n ...props\n}) => {\n const rayConfigs = useMemo(() => {\n return Array.from({ length: rayCount }, (_, i) =>\n generateRayConfig(i, rayCount)\n )\n }, [rayCount])\n\n const gridMask = useMemo(\n () => createGridMask(gridFadeStart, gridFadeEnd),\n [gridFadeStart, gridFadeEnd]\n )\n\n return (\n <div\n className={cn(\n \"relative overflow-hidden bg-[var(--bg-color)] bg-[radial-gradient(ellipse_at_50%_-20%,#1a2c5a,transparent_70%)]\",\n className\n )}\n style={\n {\n \"--bg-color\": backgroundColor,\n } as React.CSSProperties\n }\n {...props}\n >\n <div\n className=\"pointer-events-none absolute inset-0 bg-[linear-gradient(var(--grid-color)_1px,transparent_1px),linear-gradient(90deg,var(--grid-color)_1px,transparent_1px)] [mask-image:var(--grid-mask)] bg-size-[var(--grid-size)_var(--grid-size)] [webkit-mask-image:var(--grid-mask)]\"\n style={\n {\n \"--grid-color\": gridColor,\n \"--grid-size\": `${gridSize}px`,\n \"--grid-mask\": gridMask,\n } as React.CSSProperties\n }\n />\n <div className=\"pointer-events-none absolute inset-0 overflow-hidden\">\n {rayConfigs.map((config, index) => (\n <LightRay\n key={index}\n left={config.left}\n rotation={config.rotation}\n width={config.width}\n delay={config.delay}\n duration={config.duration}\n swayDuration={config.swayDuration}\n swayDelay={config.swayDelay}\n blurAmount={config.blur}\n isStrongerSway={config.strongSway}\n opacity={rayOpacity}\n speed={raySpeed}\n length={rayLength}\n />\n ))}\n </div>\n\n <div className=\"relative z-10\">{children}</div>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/grid-pattern-dashed.json b/apps/www/public/r/grid-pattern-dashed.json
index d1775dab..70a483ba 100644
--- a/apps/www/public/r/grid-pattern-dashed.json
+++ b/apps/www/public/r/grid-pattern-dashed.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/grid-pattern-dashed.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { GridPattern } from \"@/registry/magicui/grid-pattern\";\n\nexport default function GridPatternDashed() {\n return (\n <div className=\"relative flex size-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20\">\n <GridPattern\n width={30}\n height={30}\n x={-1}\n y={-1}\n strokeDasharray={\"4 2\"}\n className={cn(\n \"[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]\",\n )}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport { GridPattern } from \"@/registry/magicui/grid-pattern\"\n\nexport default function GridPatternDashed() {\n return (\n <div className=\"bg-background relative flex size-full items-center justify-center overflow-hidden rounded-lg border p-20\">\n <GridPattern\n width={30}\n height={30}\n x={-1}\n y={-1}\n strokeDasharray={\"4 2\"}\n className={cn(\n \"[mask-image:radial-gradient(300px_circle_at_center,white,transparent)]\"\n )}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/grid-pattern-demo.json b/apps/www/public/r/grid-pattern-demo.json
index c650c4bb..fee40d1c 100644
--- a/apps/www/public/r/grid-pattern-demo.json
+++ b/apps/www/public/r/grid-pattern-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/grid-pattern-demo.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { GridPattern } from \"@/registry/magicui/grid-pattern\";\n\nexport default function GridPatternDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <GridPattern\n squares={[\n [4, 4],\n [5, 1],\n [8, 2],\n [5, 3],\n [5, 5],\n [10, 10],\n [12, 15],\n [15, 10],\n [10, 15],\n [15, 10],\n [10, 15],\n [15, 10],\n ]}\n className={cn(\n \"[mask-image:radial-gradient(400px_circle_at_center,white,transparent)]\",\n \"inset-x-0 inset-y-[-30%] h-[200%] skew-y-12\",\n )}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport { GridPattern } from \"@/registry/magicui/grid-pattern\"\n\nexport default function GridPatternDemo() {\n return (\n <div className=\"bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <GridPattern\n squares={[\n [4, 4],\n [5, 1],\n [8, 2],\n [5, 3],\n [5, 5],\n [10, 10],\n [12, 15],\n [15, 10],\n [10, 15],\n [15, 10],\n [10, 15],\n [15, 10],\n ]}\n className={cn(\n \"[mask-image:radial-gradient(400px_circle_at_center,white,transparent)]\",\n \"inset-x-0 inset-y-[-30%] h-[200%] skew-y-12\"\n )}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/grid-pattern-linear-gradient.json b/apps/www/public/r/grid-pattern-linear-gradient.json
index 43d287a9..eb9ecfe6 100644
--- a/apps/www/public/r/grid-pattern-linear-gradient.json
+++ b/apps/www/public/r/grid-pattern-linear-gradient.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/grid-pattern-linear-gradient.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { GridPattern } from \"@/registry/magicui/grid-pattern\";\n\nexport default function GridPatternLinearGradient() {\n return (\n <div className=\"relative flex size-full items-center justify-center overflow-hidden rounded-lg border bg-background p-20\">\n <GridPattern\n width={20}\n height={20}\n x={-1}\n y={-1}\n className={cn(\n \"[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)] \",\n )}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport { GridPattern } from \"@/registry/magicui/grid-pattern\"\n\nexport default function GridPatternLinearGradient() {\n return (\n <div className=\"bg-background relative flex size-full items-center justify-center overflow-hidden rounded-lg border p-20\">\n <GridPattern\n width={20}\n height={20}\n x={-1}\n y={-1}\n className={cn(\n \"[mask-image:linear-gradient(to_bottom_right,white,transparent,transparent)]\"\n )}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/grid-pattern.json b/apps/www/public/r/grid-pattern.json
index 2eecb1a0..e6f04b33 100644
--- a/apps/www/public/r/grid-pattern.json
+++ b/apps/www/public/r/grid-pattern.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/grid-pattern.tsx",
- "content": "import { useId } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface GridPatternProps extends React.SVGProps<SVGSVGElement> {\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n squares?: Array<[x: number, y: number]>;\n strokeDasharray?: string;\n className?: string;\n [key: string]: unknown;\n}\n\nexport function GridPattern({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = \"0\",\n squares,\n className,\n ...props\n}: GridPatternProps) {\n const id = useId();\n\n return (\n <svg\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30\",\n className,\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" strokeWidth={0} fill={`url(#${id})`} />\n {squares && (\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(([x, y]) => (\n <rect\n strokeWidth=\"0\"\n key={`${x}-${y}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n />\n ))}\n </svg>\n )}\n </svg>\n );\n}\n",
+ "content": "import { useId } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface GridPatternProps extends React.SVGProps<SVGSVGElement> {\n width?: number\n height?: number\n x?: number\n y?: number\n squares?: Array<[x: number, y: number]>\n strokeDasharray?: string\n className?: string\n [key: string]: unknown\n}\n\nexport function GridPattern({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = \"0\",\n squares,\n className,\n ...props\n}: GridPatternProps) {\n const id = useId()\n\n return (\n <svg\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30\",\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" strokeWidth={0} fill={`url(#${id})`} />\n {squares && (\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(([x, y]) => (\n <rect\n strokeWidth=\"0\"\n key={`${x}-${y}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n />\n ))}\n </svg>\n )}\n </svg>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/hero-video-dialog-demo-top-in-bottom-out.json b/apps/www/public/r/hero-video-dialog-demo-top-in-bottom-out.json
index 62ac673e..cf652a91 100644
--- a/apps/www/public/r/hero-video-dialog-demo-top-in-bottom-out.json
+++ b/apps/www/public/r/hero-video-dialog-demo-top-in-bottom-out.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/hero-video-dialog-demo-top-in-bottom-out.tsx",
- "content": "import { HeroVideoDialog } from \"@/registry/magicui/hero-video-dialog\";\n\nexport default function HeroVideoDialogDemoTopInBottomOut() {\n return (\n <div className=\"relative\">\n <HeroVideoDialog\n className=\"block dark:hidden\"\n animationStyle=\"top-in-bottom-out\"\n videoSrc=\"https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb\"\n thumbnailSrc=\"https://startup-template-sage.vercel.app/hero-light.png\"\n thumbnailAlt=\"Hero Video\"\n />\n <HeroVideoDialog\n className=\"hidden dark:block\"\n animationStyle=\"top-in-bottom-out\"\n videoSrc=\"https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb\"\n thumbnailSrc=\"https://startup-template-sage.vercel.app/hero-dark.png\"\n thumbnailAlt=\"Hero Video\"\n />\n </div>\n );\n}\n",
+ "content": "import { HeroVideoDialog } from \"@/registry/magicui/hero-video-dialog\"\n\nexport default function HeroVideoDialogDemoTopInBottomOut() {\n return (\n <div className=\"relative\">\n <HeroVideoDialog\n className=\"block dark:hidden\"\n animationStyle=\"top-in-bottom-out\"\n videoSrc=\"https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb\"\n thumbnailSrc=\"https://startup-template-sage.vercel.app/hero-light.png\"\n thumbnailAlt=\"Hero Video\"\n />\n <HeroVideoDialog\n className=\"hidden dark:block\"\n animationStyle=\"top-in-bottom-out\"\n videoSrc=\"https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb\"\n thumbnailSrc=\"https://startup-template-sage.vercel.app/hero-dark.png\"\n thumbnailAlt=\"Hero Video\"\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/hero-video-dialog-demo.json b/apps/www/public/r/hero-video-dialog-demo.json
index c18846a4..b527bdd8 100644
--- a/apps/www/public/r/hero-video-dialog-demo.json
+++ b/apps/www/public/r/hero-video-dialog-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/hero-video-dialog-demo.tsx",
- "content": "import { HeroVideoDialog } from \"@/registry/magicui/hero-video-dialog\";\n\nexport default function HeroVideoDialogDemo() {\n return (\n <div className=\"relative\">\n <HeroVideoDialog\n className=\"block dark:hidden\"\n animationStyle=\"from-center\"\n videoSrc=\"https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb\"\n thumbnailSrc=\"https://startup-template-sage.vercel.app/hero-light.png\"\n thumbnailAlt=\"Hero Video\"\n />\n <HeroVideoDialog\n className=\"hidden dark:block\"\n animationStyle=\"from-center\"\n videoSrc=\"https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb\"\n thumbnailSrc=\"https://startup-template-sage.vercel.app/hero-dark.png\"\n thumbnailAlt=\"Hero Video\"\n />\n </div>\n );\n}\n",
+ "content": "import { HeroVideoDialog } from \"@/registry/magicui/hero-video-dialog\"\n\nexport default function HeroVideoDialogDemo() {\n return (\n <div className=\"relative\">\n <HeroVideoDialog\n className=\"block dark:hidden\"\n animationStyle=\"from-center\"\n videoSrc=\"https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb\"\n thumbnailSrc=\"https://startup-template-sage.vercel.app/hero-light.png\"\n thumbnailAlt=\"Hero Video\"\n />\n <HeroVideoDialog\n className=\"hidden dark:block\"\n animationStyle=\"from-center\"\n videoSrc=\"https://www.youtube.com/embed/qh3NGpYRG3I?si=4rb-zSdDkVK9qxxb\"\n thumbnailSrc=\"https://startup-template-sage.vercel.app/hero-dark.png\"\n thumbnailAlt=\"Hero Video\"\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/hero-video-dialog.json b/apps/www/public/r/hero-video-dialog.json
index 1638c2fd..98c84769 100644
--- a/apps/www/public/r/hero-video-dialog.json
+++ b/apps/www/public/r/hero-video-dialog.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/hero-video-dialog.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\n\"use client\";\n\nimport { useState } from \"react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { Play, XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\ntype AnimationStyle =\n | \"from-bottom\"\n | \"from-center\"\n | \"from-top\"\n | \"from-left\"\n | \"from-right\"\n | \"fade\"\n | \"top-in-bottom-out\"\n | \"left-in-right-out\";\n\ninterface HeroVideoProps {\n animationStyle?: AnimationStyle;\n videoSrc: string;\n thumbnailSrc: string;\n thumbnailAlt?: string;\n className?: string;\n}\n\nconst animationVariants = {\n \"from-bottom\": {\n initial: { y: \"100%\", opacity: 0 },\n animate: { y: 0, opacity: 1 },\n exit: { y: \"100%\", opacity: 0 },\n },\n \"from-center\": {\n initial: { scale: 0.5, opacity: 0 },\n animate: { scale: 1, opacity: 1 },\n exit: { scale: 0.5, opacity: 0 },\n },\n \"from-top\": {\n initial: { y: \"-100%\", opacity: 0 },\n animate: { y: 0, opacity: 1 },\n exit: { y: \"-100%\", opacity: 0 },\n },\n \"from-left\": {\n initial: { x: \"-100%\", opacity: 0 },\n animate: { x: 0, opacity: 1 },\n exit: { x: \"-100%\", opacity: 0 },\n },\n \"from-right\": {\n initial: { x: \"100%\", opacity: 0 },\n animate: { x: 0, opacity: 1 },\n exit: { x: \"100%\", opacity: 0 },\n },\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n },\n \"top-in-bottom-out\": {\n initial: { y: \"-100%\", opacity: 0 },\n animate: { y: 0, opacity: 1 },\n exit: { y: \"100%\", opacity: 0 },\n },\n \"left-in-right-out\": {\n initial: { x: \"-100%\", opacity: 0 },\n animate: { x: 0, opacity: 1 },\n exit: { x: \"100%\", opacity: 0 },\n },\n};\n\nexport function HeroVideoDialog({\n animationStyle = \"from-center\",\n videoSrc,\n thumbnailSrc,\n thumbnailAlt = \"Video thumbnail\",\n className,\n}: HeroVideoProps) {\n const [isVideoOpen, setIsVideoOpen] = useState(false);\n const selectedAnimation = animationVariants[animationStyle];\n\n return (\n <div className={cn(\"relative\", className)}>\n <button\n type=\"button\"\n aria-label=\"Play video\"\n className=\"group relative cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => setIsVideoOpen(true)}\n >\n <img\n src={thumbnailSrc}\n alt={thumbnailAlt}\n width={1920}\n height={1080}\n className=\"w-full rounded-md border shadow-lg transition-all duration-200 ease-out group-hover:brightness-[0.8]\"\n />\n <div className=\"absolute inset-0 flex scale-[0.9] items-center justify-center rounded-2xl transition-all duration-200 ease-out group-hover:scale-100\">\n <div className=\"flex size-28 items-center justify-center rounded-full bg-primary/10 backdrop-blur-md\">\n <div\n className={`relative flex size-20 scale-100 items-center justify-center rounded-full bg-gradient-to-b from-primary/30 to-primary shadow-md transition-all duration-200 ease-out group-hover:scale-[1.2]`}\n >\n <Play\n className=\"size-8 scale-100 fill-white text-white transition-transform duration-200 ease-out group-hover:scale-105\"\n style={{\n filter:\n \"drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06))\",\n }}\n />\n </div>\n </div>\n </div>\n </button>\n <AnimatePresence>\n {isVideoOpen && (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === \"Escape\" || e.key === \"Enter\" || e.key === \" \") {\n setIsVideoOpen(false);\n }\n }}\n onClick={() => setIsVideoOpen(false)}\n exit={{ opacity: 0 }}\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-md\"\n >\n <motion.div\n {...selectedAnimation}\n transition={{ type: \"spring\", damping: 30, stiffness: 300 }}\n className=\"relative mx-4 aspect-video w-full max-w-4xl md:mx-0\"\n >\n <motion.button className=\"absolute -top-16 right-0 rounded-full bg-neutral-900/50 p-2 text-xl text-white ring-1 backdrop-blur-md dark:bg-neutral-100/50 dark:text-black\">\n <XIcon className=\"size-5\" />\n </motion.button>\n <div className=\"relative isolate z-[1] size-full overflow-hidden rounded-2xl border-2 border-white\">\n <iframe\n src={videoSrc}\n title=\"Hero Video player\"\n className=\"size-full rounded-2xl\"\n allowFullScreen\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n ></iframe>\n </div>\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n );\n}\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\n\"use client\"\n\nimport { useState } from \"react\"\nimport { Play, XIcon } from \"lucide-react\"\nimport { AnimatePresence, motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype AnimationStyle =\n | \"from-bottom\"\n | \"from-center\"\n | \"from-top\"\n | \"from-left\"\n | \"from-right\"\n | \"fade\"\n | \"top-in-bottom-out\"\n | \"left-in-right-out\"\n\ninterface HeroVideoProps {\n animationStyle?: AnimationStyle\n videoSrc: string\n thumbnailSrc: string\n thumbnailAlt?: string\n className?: string\n}\n\nconst animationVariants = {\n \"from-bottom\": {\n initial: { y: \"100%\", opacity: 0 },\n animate: { y: 0, opacity: 1 },\n exit: { y: \"100%\", opacity: 0 },\n },\n \"from-center\": {\n initial: { scale: 0.5, opacity: 0 },\n animate: { scale: 1, opacity: 1 },\n exit: { scale: 0.5, opacity: 0 },\n },\n \"from-top\": {\n initial: { y: \"-100%\", opacity: 0 },\n animate: { y: 0, opacity: 1 },\n exit: { y: \"-100%\", opacity: 0 },\n },\n \"from-left\": {\n initial: { x: \"-100%\", opacity: 0 },\n animate: { x: 0, opacity: 1 },\n exit: { x: \"-100%\", opacity: 0 },\n },\n \"from-right\": {\n initial: { x: \"100%\", opacity: 0 },\n animate: { x: 0, opacity: 1 },\n exit: { x: \"100%\", opacity: 0 },\n },\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n },\n \"top-in-bottom-out\": {\n initial: { y: \"-100%\", opacity: 0 },\n animate: { y: 0, opacity: 1 },\n exit: { y: \"100%\", opacity: 0 },\n },\n \"left-in-right-out\": {\n initial: { x: \"-100%\", opacity: 0 },\n animate: { x: 0, opacity: 1 },\n exit: { x: \"100%\", opacity: 0 },\n },\n}\n\nexport function HeroVideoDialog({\n animationStyle = \"from-center\",\n videoSrc,\n thumbnailSrc,\n thumbnailAlt = \"Video thumbnail\",\n className,\n}: HeroVideoProps) {\n const [isVideoOpen, setIsVideoOpen] = useState(false)\n const selectedAnimation = animationVariants[animationStyle]\n\n return (\n <div className={cn(\"relative\", className)}>\n <button\n type=\"button\"\n aria-label=\"Play video\"\n className=\"group relative cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => setIsVideoOpen(true)}\n >\n <img\n src={thumbnailSrc}\n alt={thumbnailAlt}\n width={1920}\n height={1080}\n className=\"w-full rounded-md border shadow-lg transition-all duration-200 ease-out group-hover:brightness-[0.8]\"\n />\n <div className=\"absolute inset-0 flex scale-[0.9] items-center justify-center rounded-2xl transition-all duration-200 ease-out group-hover:scale-100\">\n <div className=\"bg-primary/10 flex size-28 items-center justify-center rounded-full backdrop-blur-md\">\n <div\n className={`from-primary/30 to-primary relative flex size-20 scale-100 items-center justify-center rounded-full bg-gradient-to-b shadow-md transition-all duration-200 ease-out group-hover:scale-[1.2]`}\n >\n <Play\n className=\"size-8 scale-100 fill-white text-white transition-transform duration-200 ease-out group-hover:scale-105\"\n style={{\n filter:\n \"drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06))\",\n }}\n />\n </div>\n </div>\n </div>\n </button>\n <AnimatePresence>\n {isVideoOpen && (\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === \"Escape\" || e.key === \"Enter\" || e.key === \" \") {\n setIsVideoOpen(false)\n }\n }}\n onClick={() => setIsVideoOpen(false)}\n exit={{ opacity: 0 }}\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-md\"\n >\n <motion.div\n {...selectedAnimation}\n transition={{ type: \"spring\", damping: 30, stiffness: 300 }}\n className=\"relative mx-4 aspect-video w-full max-w-4xl md:mx-0\"\n >\n <motion.button className=\"absolute -top-16 right-0 rounded-full bg-neutral-900/50 p-2 text-xl text-white ring-1 backdrop-blur-md dark:bg-neutral-100/50 dark:text-black\">\n <XIcon className=\"size-5\" />\n </motion.button>\n <div className=\"relative isolate z-[1] size-full overflow-hidden rounded-2xl border-2 border-white\">\n <iframe\n src={videoSrc}\n title=\"Hero Video player\"\n className=\"size-full rounded-2xl\"\n allowFullScreen\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n ></iframe>\n </div>\n </motion.div>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/highlighter-demo.json b/apps/www/public/r/highlighter-demo.json
index 30240f9a..a8234c0d 100644
--- a/apps/www/public/r/highlighter-demo.json
+++ b/apps/www/public/r/highlighter-demo.json
@@ -13,12 +13,12 @@
"files": [
{
"path": "registry/example/highlighter-demo.tsx",
- "content": "import { Highlighter } from \"@/registry/magicui/highlighter\";\n\nexport default function HighlighterDemo() {\n return (\n <div className=\"text-center\">\n <p className=\"leading-relaxed\">\n The{\" \"}\n <Highlighter action=\"underline\" color=\"#FF9800\">\n Magic UI Highlighter\n </Highlighter>{\" \"}\n makes important{\" \"}\n <Highlighter action=\"highlight\" color=\"#87CEFA\">\n text stand out\n </Highlighter>{\" \"}\n effortlessly.\n </p>\n </div>\n );\n}\n",
+ "content": "import { Highlighter } from \"@/registry/magicui/highlighter\"\n\nexport default function HighlighterDemo() {\n return (\n <div className=\"text-center\">\n <p className=\"leading-relaxed\">\n The{\" \"}\n <Highlighter action=\"underline\" color=\"#FF9800\">\n Magic UI Highlighter\n </Highlighter>{\" \"}\n makes important{\" \"}\n <Highlighter action=\"highlight\" color=\"#87CEFA\">\n text stand out\n </Highlighter>{\" \"}\n effortlessly.\n </p>\n </div>\n )\n}\n",
"type": "registry:example"
},
{
"path": "registry/magicui/highlighter.tsx",
- "content": "\"use client\";\n\nimport { useEffect, useRef } from \"react\";\nimport { useInView } from \"motion/react\";\nimport { annotate } from \"rough-notation\";\nimport type React from \"react\";\nimport { type RoughAnnotation } from \"rough-notation/lib/model\";\n\ntype AnnotationAction =\n | \"highlight\"\n | \"underline\"\n | \"box\"\n | \"circle\"\n | \"strike-through\"\n | \"crossed-off\"\n | \"bracket\";\n\ninterface HighlighterProps {\n children: React.ReactNode;\n action?: AnnotationAction;\n color?: string;\n strokeWidth?: number;\n animationDuration?: number;\n iterations?: number;\n padding?: number;\n multiline?: boolean;\n isView?: boolean;\n}\n\nexport function Highlighter({\n children,\n action = \"highlight\",\n color = \"#ffd1dc\",\n strokeWidth = 1.5,\n animationDuration = 600,\n iterations = 2,\n padding = 2,\n multiline = true,\n isView = false,\n}: HighlighterProps) {\n const elementRef = useRef<HTMLSpanElement>(null);\n const annotationRef = useRef<RoughAnnotation | null>(null);\n\n const isInView = useInView(elementRef, {\n once: true,\n margin: \"-10%\",\n });\n\n // If isView is false, always show. If isView is true, wait for inView\n const shouldShow = !isView || isInView;\n\n useEffect(() => {\n if (!shouldShow) return;\n\n const element = elementRef.current;\n if (!element) return;\n\n const annotationConfig = {\n type: action,\n color,\n strokeWidth,\n animationDuration,\n iterations,\n padding,\n multiline,\n };\n\n const annotation = annotate(element, annotationConfig);\n\n annotationRef.current = annotation;\n annotationRef.current.show();\n\n const resizeObserver = new ResizeObserver(() => {\n annotation.hide();\n annotation.show();\n });\n\n resizeObserver.observe(element);\n resizeObserver.observe(document.body);\n\n return () => {\n if (element) {\n annotate(element, { type: action }).remove();\n resizeObserver.disconnect();\n }\n };\n }, [\n shouldShow,\n action,\n color,\n strokeWidth,\n animationDuration,\n iterations,\n padding,\n multiline,\n ]);\n\n return (\n <span ref={elementRef} className=\"relative inline-block bg-transparent\">\n {children}\n </span>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useRef } from \"react\"\nimport type React from \"react\"\nimport { useInView } from \"motion/react\"\nimport { annotate } from \"rough-notation\"\nimport { type RoughAnnotation } from \"rough-notation/lib/model\"\n\ntype AnnotationAction =\n | \"highlight\"\n | \"underline\"\n | \"box\"\n | \"circle\"\n | \"strike-through\"\n | \"crossed-off\"\n | \"bracket\"\n\ninterface HighlighterProps {\n children: React.ReactNode\n action?: AnnotationAction\n color?: string\n strokeWidth?: number\n animationDuration?: number\n iterations?: number\n padding?: number\n multiline?: boolean\n isView?: boolean\n}\n\nexport function Highlighter({\n children,\n action = \"highlight\",\n color = \"#ffd1dc\",\n strokeWidth = 1.5,\n animationDuration = 600,\n iterations = 2,\n padding = 2,\n multiline = true,\n isView = false,\n}: HighlighterProps) {\n const elementRef = useRef<HTMLSpanElement>(null)\n const annotationRef = useRef<RoughAnnotation | null>(null)\n\n const isInView = useInView(elementRef, {\n once: true,\n margin: \"-10%\",\n })\n\n // If isView is false, always show. If isView is true, wait for inView\n const shouldShow = !isView || isInView\n\n useEffect(() => {\n if (!shouldShow) return\n\n const element = elementRef.current\n if (!element) return\n\n const annotationConfig = {\n type: action,\n color,\n strokeWidth,\n animationDuration,\n iterations,\n padding,\n multiline,\n }\n\n const annotation = annotate(element, annotationConfig)\n\n annotationRef.current = annotation\n annotationRef.current.show()\n\n const resizeObserver = new ResizeObserver(() => {\n annotation.hide()\n annotation.show()\n })\n\n resizeObserver.observe(element)\n resizeObserver.observe(document.body)\n\n return () => {\n if (element) {\n annotate(element, { type: action }).remove()\n resizeObserver.disconnect()\n }\n }\n }, [\n shouldShow,\n action,\n color,\n strokeWidth,\n animationDuration,\n iterations,\n padding,\n multiline,\n ])\n\n return (\n <span ref={elementRef} className=\"relative inline-block bg-transparent\">\n {children}\n </span>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/highlighter.json b/apps/www/public/r/highlighter.json
index 35b342ac..3a35e895 100644
--- a/apps/www/public/r/highlighter.json
+++ b/apps/www/public/r/highlighter.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/highlighter.tsx",
- "content": "\"use client\";\n\nimport { useEffect, useRef } from \"react\";\nimport { useInView } from \"motion/react\";\nimport { annotate } from \"rough-notation\";\nimport type React from \"react\";\nimport { type RoughAnnotation } from \"rough-notation/lib/model\";\n\ntype AnnotationAction =\n | \"highlight\"\n | \"underline\"\n | \"box\"\n | \"circle\"\n | \"strike-through\"\n | \"crossed-off\"\n | \"bracket\";\n\ninterface HighlighterProps {\n children: React.ReactNode;\n action?: AnnotationAction;\n color?: string;\n strokeWidth?: number;\n animationDuration?: number;\n iterations?: number;\n padding?: number;\n multiline?: boolean;\n isView?: boolean;\n}\n\nexport function Highlighter({\n children,\n action = \"highlight\",\n color = \"#ffd1dc\",\n strokeWidth = 1.5,\n animationDuration = 600,\n iterations = 2,\n padding = 2,\n multiline = true,\n isView = false,\n}: HighlighterProps) {\n const elementRef = useRef<HTMLSpanElement>(null);\n const annotationRef = useRef<RoughAnnotation | null>(null);\n\n const isInView = useInView(elementRef, {\n once: true,\n margin: \"-10%\",\n });\n\n // If isView is false, always show. If isView is true, wait for inView\n const shouldShow = !isView || isInView;\n\n useEffect(() => {\n if (!shouldShow) return;\n\n const element = elementRef.current;\n if (!element) return;\n\n const annotationConfig = {\n type: action,\n color,\n strokeWidth,\n animationDuration,\n iterations,\n padding,\n multiline,\n };\n\n const annotation = annotate(element, annotationConfig);\n\n annotationRef.current = annotation;\n annotationRef.current.show();\n\n const resizeObserver = new ResizeObserver(() => {\n annotation.hide();\n annotation.show();\n });\n\n resizeObserver.observe(element);\n resizeObserver.observe(document.body);\n\n return () => {\n if (element) {\n annotate(element, { type: action }).remove();\n resizeObserver.disconnect();\n }\n };\n }, [\n shouldShow,\n action,\n color,\n strokeWidth,\n animationDuration,\n iterations,\n padding,\n multiline,\n ]);\n\n return (\n <span ref={elementRef} className=\"relative inline-block bg-transparent\">\n {children}\n </span>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useRef } from \"react\"\nimport type React from \"react\"\nimport { useInView } from \"motion/react\"\nimport { annotate } from \"rough-notation\"\nimport { type RoughAnnotation } from \"rough-notation/lib/model\"\n\ntype AnnotationAction =\n | \"highlight\"\n | \"underline\"\n | \"box\"\n | \"circle\"\n | \"strike-through\"\n | \"crossed-off\"\n | \"bracket\"\n\ninterface HighlighterProps {\n children: React.ReactNode\n action?: AnnotationAction\n color?: string\n strokeWidth?: number\n animationDuration?: number\n iterations?: number\n padding?: number\n multiline?: boolean\n isView?: boolean\n}\n\nexport function Highlighter({\n children,\n action = \"highlight\",\n color = \"#ffd1dc\",\n strokeWidth = 1.5,\n animationDuration = 600,\n iterations = 2,\n padding = 2,\n multiline = true,\n isView = false,\n}: HighlighterProps) {\n const elementRef = useRef<HTMLSpanElement>(null)\n const annotationRef = useRef<RoughAnnotation | null>(null)\n\n const isInView = useInView(elementRef, {\n once: true,\n margin: \"-10%\",\n })\n\n // If isView is false, always show. If isView is true, wait for inView\n const shouldShow = !isView || isInView\n\n useEffect(() => {\n if (!shouldShow) return\n\n const element = elementRef.current\n if (!element) return\n\n const annotationConfig = {\n type: action,\n color,\n strokeWidth,\n animationDuration,\n iterations,\n padding,\n multiline,\n }\n\n const annotation = annotate(element, annotationConfig)\n\n annotationRef.current = annotation\n annotationRef.current.show()\n\n const resizeObserver = new ResizeObserver(() => {\n annotation.hide()\n annotation.show()\n })\n\n resizeObserver.observe(element)\n resizeObserver.observe(document.body)\n\n return () => {\n if (element) {\n annotate(element, { type: action }).remove()\n resizeObserver.disconnect()\n }\n }\n }, [\n shouldShow,\n action,\n color,\n strokeWidth,\n animationDuration,\n iterations,\n padding,\n multiline,\n ])\n\n return (\n <span ref={elementRef} className=\"relative inline-block bg-transparent\">\n {children}\n </span>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/hyper-text-demo.json b/apps/www/public/r/hyper-text-demo.json
index a322e0dd..78d8cb64 100644
--- a/apps/www/public/r/hyper-text-demo.json
+++ b/apps/www/public/r/hyper-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/hyper-text-demo.tsx",
- "content": "import { HyperText } from \"@/registry/magicui/hyper-text\";\n\nexport default function HyperTextDemo() {\n return <HyperText>Hover Me!</HyperText>;\n}\n",
+ "content": "import { HyperText } from \"@/registry/magicui/hyper-text\"\n\nexport default function HyperTextDemo() {\n return <HyperText>Hover Me!</HyperText>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/hyper-text.json b/apps/www/public/r/hyper-text.json
index 8f4b409c..cd0f0e27 100644
--- a/apps/www/public/r/hyper-text.json
+++ b/apps/www/public/r/hyper-text.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/hyper-text.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { AnimatePresence, motion, MotionProps } from \"motion/react\";\nimport { useEffect, useRef, useState } from \"react\";\n\ntype CharacterSet = string[] | readonly string[];\n\ninterface HyperTextProps extends MotionProps {\n /** The text content to be animated */\n children: string;\n /** Optional className for styling */\n className?: string;\n /** Duration of the animation in milliseconds */\n duration?: number;\n /** Delay before animation starts in milliseconds */\n delay?: number;\n /** Component to render as - defaults to div */\n as?: React.ElementType;\n /** Whether to start animation when element comes into view */\n startOnView?: boolean;\n /** Whether to trigger animation on hover */\n animateOnHover?: boolean;\n /** Custom character set for scramble effect. Defaults to uppercase alphabet */\n characterSet?: CharacterSet;\n}\n\nconst DEFAULT_CHARACTER_SET = Object.freeze(\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\"),\n) as readonly string[];\n\nconst getRandomInt = (max: number): number => Math.floor(Math.random() * max);\n\nexport function HyperText({\n children,\n className,\n duration = 800,\n delay = 0,\n as: Component = \"div\",\n startOnView = false,\n animateOnHover = true,\n characterSet = DEFAULT_CHARACTER_SET,\n ...props\n}: HyperTextProps) {\n const MotionComponent = motion.create(Component, {\n forwardMotionProps: true,\n });\n\n const [displayText, setDisplayText] = useState<string[]>(() =>\n children.split(\"\"),\n );\n const [isAnimating, setIsAnimating] = useState(false);\n const iterationCount = useRef(0);\n const elementRef = useRef<HTMLElement>(null);\n\n const handleAnimationTrigger = () => {\n if (animateOnHover && !isAnimating) {\n iterationCount.current = 0;\n setIsAnimating(true);\n }\n };\n\n // Handle animation start based on view or delay\n useEffect(() => {\n if (!startOnView) {\n const startTimeout = setTimeout(() => {\n setIsAnimating(true);\n }, delay);\n return () => clearTimeout(startTimeout);\n }\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry.isIntersecting) {\n setTimeout(() => {\n setIsAnimating(true);\n }, delay);\n observer.disconnect();\n }\n },\n { threshold: 0.1, rootMargin: \"-30% 0px -30% 0px\" },\n );\n\n if (elementRef.current) {\n observer.observe(elementRef.current);\n }\n\n return () => observer.disconnect();\n }, [delay, startOnView]);\n\n // Handle scramble animation\n useEffect(() => {\n if (!isAnimating) return;\n\n const maxIterations = children.length;\n const startTime = performance.now();\n let animationFrameId: number;\n\n const animate = (currentTime: number) => {\n const elapsed = currentTime - startTime;\n const progress = Math.min(elapsed / duration, 1);\n\n iterationCount.current = progress * maxIterations;\n\n setDisplayText((currentText) =>\n currentText.map((letter, index) =>\n letter === \" \"\n ? letter\n : index <= iterationCount.current\n ? children[index]\n : characterSet[getRandomInt(characterSet.length)],\n ),\n );\n\n if (progress < 1) {\n animationFrameId = requestAnimationFrame(animate);\n } else {\n setIsAnimating(false);\n }\n };\n\n animationFrameId = requestAnimationFrame(animate);\n\n return () => cancelAnimationFrame(animationFrameId);\n }, [children, duration, isAnimating, characterSet]);\n\n return (\n <MotionComponent\n ref={elementRef}\n className={cn(\"overflow-hidden py-2 text-4xl font-bold\", className)}\n onMouseEnter={handleAnimationTrigger}\n {...props}\n >\n <AnimatePresence>\n {displayText.map((letter, index) => (\n <motion.span\n key={index}\n className={cn(\"font-mono\", letter === \" \" ? \"w-3\" : \"\")}\n >\n {letter.toUpperCase()}\n </motion.span>\n ))}\n </AnimatePresence>\n </MotionComponent>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { AnimatePresence, motion, MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype CharacterSet = string[] | readonly string[]\n\ninterface HyperTextProps extends MotionProps {\n /** The text content to be animated */\n children: string\n /** Optional className for styling */\n className?: string\n /** Duration of the animation in milliseconds */\n duration?: number\n /** Delay before animation starts in milliseconds */\n delay?: number\n /** Component to render as - defaults to div */\n as?: React.ElementType\n /** Whether to start animation when element comes into view */\n startOnView?: boolean\n /** Whether to trigger animation on hover */\n animateOnHover?: boolean\n /** Custom character set for scramble effect. Defaults to uppercase alphabet */\n characterSet?: CharacterSet\n}\n\nconst DEFAULT_CHARACTER_SET = Object.freeze(\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\")\n) as readonly string[]\n\nconst getRandomInt = (max: number): number => Math.floor(Math.random() * max)\n\nexport function HyperText({\n children,\n className,\n duration = 800,\n delay = 0,\n as: Component = \"div\",\n startOnView = false,\n animateOnHover = true,\n characterSet = DEFAULT_CHARACTER_SET,\n ...props\n}: HyperTextProps) {\n const MotionComponent = motion.create(Component, {\n forwardMotionProps: true,\n })\n\n const [displayText, setDisplayText] = useState<string[]>(() =>\n children.split(\"\")\n )\n const [isAnimating, setIsAnimating] = useState(false)\n const iterationCount = useRef(0)\n const elementRef = useRef<HTMLElement>(null)\n\n const handleAnimationTrigger = () => {\n if (animateOnHover && !isAnimating) {\n iterationCount.current = 0\n setIsAnimating(true)\n }\n }\n\n // Handle animation start based on view or delay\n useEffect(() => {\n if (!startOnView) {\n const startTimeout = setTimeout(() => {\n setIsAnimating(true)\n }, delay)\n return () => clearTimeout(startTimeout)\n }\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry.isIntersecting) {\n setTimeout(() => {\n setIsAnimating(true)\n }, delay)\n observer.disconnect()\n }\n },\n { threshold: 0.1, rootMargin: \"-30% 0px -30% 0px\" }\n )\n\n if (elementRef.current) {\n observer.observe(elementRef.current)\n }\n\n return () => observer.disconnect()\n }, [delay, startOnView])\n\n // Handle scramble animation\n useEffect(() => {\n if (!isAnimating) return\n\n const maxIterations = children.length\n const startTime = performance.now()\n let animationFrameId: number\n\n const animate = (currentTime: number) => {\n const elapsed = currentTime - startTime\n const progress = Math.min(elapsed / duration, 1)\n\n iterationCount.current = progress * maxIterations\n\n setDisplayText((currentText) =>\n currentText.map((letter, index) =>\n letter === \" \"\n ? letter\n : index <= iterationCount.current\n ? children[index]\n : characterSet[getRandomInt(characterSet.length)]\n )\n )\n\n if (progress < 1) {\n animationFrameId = requestAnimationFrame(animate)\n } else {\n setIsAnimating(false)\n }\n }\n\n animationFrameId = requestAnimationFrame(animate)\n\n return () => cancelAnimationFrame(animationFrameId)\n }, [children, duration, isAnimating, characterSet])\n\n return (\n <MotionComponent\n ref={elementRef}\n className={cn(\"overflow-hidden py-2 text-4xl font-bold\", className)}\n onMouseEnter={handleAnimationTrigger}\n {...props}\n >\n <AnimatePresence>\n {displayText.map((letter, index) => (\n <motion.span\n key={index}\n className={cn(\"font-mono\", letter === \" \" ? \"w-3\" : \"\")}\n >\n {letter.toUpperCase()}\n </motion.span>\n ))}\n </AnimatePresence>\n </MotionComponent>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/icon-cloud-demo-2.json b/apps/www/public/r/icon-cloud-demo-2.json
index 96499e9b..67c003ef 100644
--- a/apps/www/public/r/icon-cloud-demo-2.json
+++ b/apps/www/public/r/icon-cloud-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/icon-cloud-demo-2.tsx",
- "content": "import { IconCloud } from \"@/registry/magicui/icon-cloud\";\n\nconst images = [\n \"https://images.unsplash.com/photo-1720048171230-c60d162f93a0?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675553988173-a5249b5815fe?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675297844586-534b030564e0?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675555581018-7f1a352ff9a6?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1719937050517-68d4e2a1702e?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1720048171230-c60d162f93a0?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675553988173-a5249b5815fe?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675297844586-534b030564e0?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675555581018-7f1a352ff9a6?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1719937050517-68d4e2a1702e?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1720048171230-c60d162f93a0?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675553988173-a5249b5815fe?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675297844586-534b030564e0?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675555581018-7f1a352ff9a6?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1719937050517-68d4e2a1702e?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n];\n\nexport default function IconCloudDemo() {\n return (\n <div className=\"relative flex size-full max-w-lg items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <IconCloud images={images} />\n </div>\n );\n}\n",
+ "content": "import { IconCloud } from \"@/registry/magicui/icon-cloud\"\n\nconst images = [\n \"https://images.unsplash.com/photo-1720048171230-c60d162f93a0?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675553988173-a5249b5815fe?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675297844586-534b030564e0?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675555581018-7f1a352ff9a6?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1719937050517-68d4e2a1702e?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1720048171230-c60d162f93a0?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675553988173-a5249b5815fe?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675297844586-534b030564e0?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675555581018-7f1a352ff9a6?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1719937050517-68d4e2a1702e?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1720048171230-c60d162f93a0?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675553988173-a5249b5815fe?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675297844586-534b030564e0?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1675555581018-7f1a352ff9a6?q=80&w=1964&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://images.unsplash.com/photo-1719937050517-68d4e2a1702e?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n]\n\nexport default function IconCloudDemo() {\n return (\n <div className=\"bg-background relative flex size-full max-w-lg items-center justify-center overflow-hidden rounded-lg border\">\n <IconCloud images={images} />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/icon-cloud-demo-3.json b/apps/www/public/r/icon-cloud-demo-3.json
index 8d961343..82141deb 100644
--- a/apps/www/public/r/icon-cloud-demo-3.json
+++ b/apps/www/public/r/icon-cloud-demo-3.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/icon-cloud-demo-3.tsx",
- "content": "import { IconCloud } from \"@/registry/magicui/icon-cloud\";\n\nconst Icons = {\n gitHub: () => (\n <svg width=\"100\" height=\"100\" viewBox=\"0 0 438.549 438.549\">\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n />\n </svg>\n ),\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"fill-black dark:fill-white\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n};\n\nexport default function IconCloudDemo() {\n return (\n <div className=\"relative flex size-full max-w-lg items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <IconCloud\n icons={[\n <Icons.gitHub key=\"github\" />,\n <Icons.notion key=\"notion\" />,\n <Icons.openai key=\"openai\" />,\n <Icons.googleDrive key=\"gdrive\" />,\n <Icons.whatsapp key=\"whatsapp\" />,\n <Icons.gitHub key=\"github2\" />,\n <Icons.notion key=\"notion2\" />,\n <Icons.openai key=\"openai2\" />,\n <Icons.googleDrive key=\"gdrive2\" />,\n <Icons.whatsapp key=\"whatsapp2\" />,\n <Icons.gitHub key=\"github3\" />,\n <Icons.notion key=\"notion3\" />,\n <Icons.openai key=\"openai3\" />,\n <Icons.googleDrive key=\"gdrive3\" />,\n <Icons.whatsapp key=\"whatsapp3\" />,\n <Icons.gitHub key=\"github4\" />,\n <Icons.notion key=\"notion4\" />,\n <Icons.openai key=\"openai4\" />,\n <Icons.googleDrive key=\"gdrive4\" />,\n <Icons.whatsapp key=\"whatsapp4\" />,\n <Icons.notion key=\"notion4\" />,\n <Icons.openai key=\"openai4\" />,\n <Icons.googleDrive key=\"gdrive4\" />,\n <Icons.whatsapp key=\"whatsapp4\" />,\n ]}\n />\n </div>\n );\n}\n",
+ "content": "import { IconCloud } from \"@/registry/magicui/icon-cloud\"\n\nconst Icons = {\n gitHub: () => (\n <svg width=\"100\" height=\"100\" viewBox=\"0 0 438.549 438.549\">\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n />\n </svg>\n ),\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"fill-black dark:fill-white\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n}\n\nexport default function IconCloudDemo() {\n return (\n <div className=\"bg-background relative flex size-full max-w-lg items-center justify-center overflow-hidden rounded-lg border\">\n <IconCloud\n icons={[\n <Icons.gitHub key=\"github\" />,\n <Icons.notion key=\"notion\" />,\n <Icons.openai key=\"openai\" />,\n <Icons.googleDrive key=\"gdrive\" />,\n <Icons.whatsapp key=\"whatsapp\" />,\n <Icons.gitHub key=\"github2\" />,\n <Icons.notion key=\"notion2\" />,\n <Icons.openai key=\"openai2\" />,\n <Icons.googleDrive key=\"gdrive2\" />,\n <Icons.whatsapp key=\"whatsapp2\" />,\n <Icons.gitHub key=\"github3\" />,\n <Icons.notion key=\"notion3\" />,\n <Icons.openai key=\"openai3\" />,\n <Icons.googleDrive key=\"gdrive3\" />,\n <Icons.whatsapp key=\"whatsapp3\" />,\n <Icons.gitHub key=\"github4\" />,\n <Icons.notion key=\"notion4\" />,\n <Icons.openai key=\"openai4\" />,\n <Icons.googleDrive key=\"gdrive4\" />,\n <Icons.whatsapp key=\"whatsapp4\" />,\n <Icons.notion key=\"notion4\" />,\n <Icons.openai key=\"openai4\" />,\n <Icons.googleDrive key=\"gdrive4\" />,\n <Icons.whatsapp key=\"whatsapp4\" />,\n ]}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/icon-cloud-demo.json b/apps/www/public/r/icon-cloud-demo.json
index d2e0864e..184383e9 100644
--- a/apps/www/public/r/icon-cloud-demo.json
+++ b/apps/www/public/r/icon-cloud-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/icon-cloud-demo.tsx",
- "content": "import { IconCloud } from \"@/registry/magicui/icon-cloud\";\n\nconst slugs = [\n \"typescript\",\n \"javascript\",\n \"dart\",\n \"java\",\n \"react\",\n \"flutter\",\n \"android\",\n \"html5\",\n \"css3\",\n \"nodedotjs\",\n \"express\",\n \"nextdotjs\",\n \"prisma\",\n \"amazonaws\",\n \"postgresql\",\n \"firebase\",\n \"nginx\",\n \"vercel\",\n \"testinglibrary\",\n \"jest\",\n \"cypress\",\n \"docker\",\n \"git\",\n \"jira\",\n \"github\",\n \"gitlab\",\n \"visualstudiocode\",\n \"androidstudio\",\n \"sonarqube\",\n \"figma\",\n];\n\nexport default function IconCloudDemo() {\n const images = slugs.map(\n (slug) => `https://cdn.simpleicons.org/${slug}/${slug}`,\n );\n\n return (\n <div className=\"relative flex size-full items-center justify-center overflow-hidden\">\n <IconCloud images={images} />\n </div>\n );\n}\n",
+ "content": "import { IconCloud } from \"@/registry/magicui/icon-cloud\"\n\nconst slugs = [\n \"typescript\",\n \"javascript\",\n \"dart\",\n \"java\",\n \"react\",\n \"flutter\",\n \"android\",\n \"html5\",\n \"css3\",\n \"nodedotjs\",\n \"express\",\n \"nextdotjs\",\n \"prisma\",\n \"amazonaws\",\n \"postgresql\",\n \"firebase\",\n \"nginx\",\n \"vercel\",\n \"testinglibrary\",\n \"jest\",\n \"cypress\",\n \"docker\",\n \"git\",\n \"jira\",\n \"github\",\n \"gitlab\",\n \"visualstudiocode\",\n \"androidstudio\",\n \"sonarqube\",\n \"figma\",\n]\n\nexport default function IconCloudDemo() {\n const images = slugs.map(\n (slug) => `https://cdn.simpleicons.org/${slug}/${slug}`\n )\n\n return (\n <div className=\"relative flex size-full items-center justify-center overflow-hidden\">\n <IconCloud images={images} />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/icon-cloud.json b/apps/www/public/r/icon-cloud.json
index e43b0680..9131fa6e 100644
--- a/apps/www/public/r/icon-cloud.json
+++ b/apps/www/public/r/icon-cloud.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/magicui/icon-cloud.tsx",
- "content": "\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { renderToString } from \"react-dom/server\";\n\ninterface Icon {\n x: number;\n y: number;\n z: number;\n scale: number;\n opacity: number;\n id: number;\n}\n\ninterface IconCloudProps {\n icons?: React.ReactNode[];\n images?: string[];\n}\n\nfunction easeOutCubic(t: number): number {\n return 1 - Math.pow(1 - t, 3);\n}\n\nexport function IconCloud({ icons, images }: IconCloudProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [iconPositions, setIconPositions] = useState<Icon[]>([]);\n const [rotation, setRotation] = useState({ x: 0, y: 0 });\n const [isDragging, setIsDragging] = useState(false);\n const [lastMousePos, setLastMousePos] = useState({ x: 0, y: 0 });\n const [mousePos, setMousePos] = useState({ x: 0, y: 0 });\n const [targetRotation, setTargetRotation] = useState<{\n x: number;\n y: number;\n startX: number;\n startY: number;\n distance: number;\n startTime: number;\n duration: number;\n } | null>(null);\n const animationFrameRef = useRef<number>(0);\n const rotationRef = useRef(rotation);\n const iconCanvasesRef = useRef<HTMLCanvasElement[]>([]);\n const imagesLoadedRef = useRef<boolean[]>([]);\n\n // Create icon canvases once when icons/images change\n useEffect(() => {\n if (!icons && !images) return;\n\n const items = icons || images || [];\n imagesLoadedRef.current = new Array(items.length).fill(false);\n\n const newIconCanvases = items.map((item, index) => {\n const offscreen = document.createElement(\"canvas\");\n offscreen.width = 40;\n offscreen.height = 40;\n const offCtx = offscreen.getContext(\"2d\");\n\n if (offCtx) {\n if (images) {\n // Handle image URLs directly\n const img = new Image();\n img.crossOrigin = \"anonymous\";\n img.src = items[index] as string;\n img.onload = () => {\n offCtx.clearRect(0, 0, offscreen.width, offscreen.height);\n\n // Create circular clipping path\n offCtx.beginPath();\n offCtx.arc(20, 20, 20, 0, Math.PI * 2);\n offCtx.closePath();\n offCtx.clip();\n\n // Draw the image\n offCtx.drawImage(img, 0, 0, 40, 40);\n\n imagesLoadedRef.current[index] = true;\n };\n } else {\n // Handle SVG icons\n offCtx.scale(0.4, 0.4);\n const svgString = renderToString(item as React.ReactElement);\n const img = new Image();\n img.src = \"data:image/svg+xml;base64,\" + btoa(svgString);\n img.onload = () => {\n offCtx.clearRect(0, 0, offscreen.width, offscreen.height);\n offCtx.drawImage(img, 0, 0);\n imagesLoadedRef.current[index] = true;\n };\n }\n }\n return offscreen;\n });\n\n iconCanvasesRef.current = newIconCanvases;\n }, [icons, images]);\n\n // Generate initial icon positions on a sphere\n useEffect(() => {\n const items = icons || images || [];\n const newIcons: Icon[] = [];\n const numIcons = items.length || 20;\n\n // Fibonacci sphere parameters\n const offset = 2 / numIcons;\n const increment = Math.PI * (3 - Math.sqrt(5));\n\n for (let i = 0; i < numIcons; i++) {\n const y = i * offset - 1 + offset / 2;\n const r = Math.sqrt(1 - y * y);\n const phi = i * increment;\n\n const x = Math.cos(phi) * r;\n const z = Math.sin(phi) * r;\n\n newIcons.push({\n x: x * 100,\n y: y * 100,\n z: z * 100,\n scale: 1,\n opacity: 1,\n id: i,\n });\n }\n setIconPositions(newIcons);\n }, [icons, images]);\n\n // Handle mouse events\n const handleMouseDown = (e: React.MouseEvent<HTMLCanvasElement>) => {\n const rect = canvasRef.current?.getBoundingClientRect();\n if (!rect || !canvasRef.current) return;\n\n const x = e.clientX - rect.left;\n const y = e.clientY - rect.top;\n\n const ctx = canvasRef.current.getContext(\"2d\");\n if (!ctx) return;\n\n iconPositions.forEach((icon) => {\n const cosX = Math.cos(rotationRef.current.x);\n const sinX = Math.sin(rotationRef.current.x);\n const cosY = Math.cos(rotationRef.current.y);\n const sinY = Math.sin(rotationRef.current.y);\n\n const rotatedX = icon.x * cosY - icon.z * sinY;\n const rotatedZ = icon.x * sinY + icon.z * cosY;\n const rotatedY = icon.y * cosX + rotatedZ * sinX;\n\n const screenX = canvasRef.current!.width / 2 + rotatedX;\n const screenY = canvasRef.current!.height / 2 + rotatedY;\n\n const scale = (rotatedZ + 200) / 300;\n const radius = 20 * scale;\n const dx = x - screenX;\n const dy = y - screenY;\n\n if (dx * dx + dy * dy < radius * radius) {\n const targetX = -Math.atan2(\n icon.y,\n Math.sqrt(icon.x * icon.x + icon.z * icon.z),\n );\n const targetY = Math.atan2(icon.x, icon.z);\n\n const currentX = rotationRef.current.x;\n const currentY = rotationRef.current.y;\n const distance = Math.sqrt(\n Math.pow(targetX - currentX, 2) + Math.pow(targetY - currentY, 2),\n );\n\n const duration = Math.min(2000, Math.max(800, distance * 1000));\n\n setTargetRotation({\n x: targetX,\n y: targetY,\n startX: currentX,\n startY: currentY,\n distance,\n startTime: performance.now(),\n duration,\n });\n return;\n }\n });\n\n setIsDragging(true);\n setLastMousePos({ x: e.clientX, y: e.clientY });\n };\n\n const handleMouseMove = (e: React.MouseEvent<HTMLCanvasElement>) => {\n const rect = canvasRef.current?.getBoundingClientRect();\n if (rect) {\n const x = e.clientX - rect.left;\n const y = e.clientY - rect.top;\n setMousePos({ x, y });\n }\n\n if (isDragging) {\n const deltaX = e.clientX - lastMousePos.x;\n const deltaY = e.clientY - lastMousePos.y;\n\n rotationRef.current = {\n x: rotationRef.current.x + deltaY * 0.002,\n y: rotationRef.current.y + deltaX * 0.002,\n };\n\n setLastMousePos({ x: e.clientX, y: e.clientY });\n }\n };\n\n const handleMouseUp = () => {\n setIsDragging(false);\n };\n\n // Animation and rendering\n useEffect(() => {\n const canvas = canvasRef.current;\n const ctx = canvas?.getContext(\"2d\");\n if (!canvas || !ctx) return;\n\n const animate = () => {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n const centerX = canvas.width / 2;\n const centerY = canvas.height / 2;\n const maxDistance = Math.sqrt(centerX * centerX + centerY * centerY);\n const dx = mousePos.x - centerX;\n const dy = mousePos.y - centerY;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const speed = 0.003 + (distance / maxDistance) * 0.01;\n\n if (targetRotation) {\n const elapsed = performance.now() - targetRotation.startTime;\n const progress = Math.min(1, elapsed / targetRotation.duration);\n const easedProgress = easeOutCubic(progress);\n\n rotationRef.current = {\n x:\n targetRotation.startX +\n (targetRotation.x - targetRotation.startX) * easedProgress,\n y:\n targetRotation.startY +\n (targetRotation.y - targetRotation.startY) * easedProgress,\n };\n\n if (progress >= 1) {\n setTargetRotation(null);\n }\n } else if (!isDragging) {\n rotationRef.current = {\n x: rotationRef.current.x + (dy / canvas.height) * speed,\n y: rotationRef.current.y + (dx / canvas.width) * speed,\n };\n }\n\n iconPositions.forEach((icon, index) => {\n const cosX = Math.cos(rotationRef.current.x);\n const sinX = Math.sin(rotationRef.current.x);\n const cosY = Math.cos(rotationRef.current.y);\n const sinY = Math.sin(rotationRef.current.y);\n\n const rotatedX = icon.x * cosY - icon.z * sinY;\n const rotatedZ = icon.x * sinY + icon.z * cosY;\n const rotatedY = icon.y * cosX + rotatedZ * sinX;\n\n const scale = (rotatedZ + 200) / 300;\n const opacity = Math.max(0.2, Math.min(1, (rotatedZ + 150) / 200));\n\n ctx.save();\n ctx.translate(\n canvas.width / 2 + rotatedX,\n canvas.height / 2 + rotatedY,\n );\n ctx.scale(scale, scale);\n ctx.globalAlpha = opacity;\n\n if (icons || images) {\n // Only try to render icons/images if they exist\n if (\n iconCanvasesRef.current[index] &&\n imagesLoadedRef.current[index]\n ) {\n ctx.drawImage(iconCanvasesRef.current[index], -20, -20, 40, 40);\n }\n } else {\n // Show numbered circles if no icons/images are provided\n ctx.beginPath();\n ctx.arc(0, 0, 20, 0, Math.PI * 2);\n ctx.fillStyle = \"#4444ff\";\n ctx.fill();\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.font = \"16px Arial\";\n ctx.fillText(`${icon.id + 1}`, 0, 0);\n }\n\n ctx.restore();\n });\n animationFrameRef.current = requestAnimationFrame(animate);\n };\n\n animate();\n\n return () => {\n if (animationFrameRef.current) {\n cancelAnimationFrame(animationFrameRef.current);\n }\n };\n }, [icons, images, iconPositions, isDragging, mousePos, targetRotation]);\n\n return (\n <canvas\n ref={canvasRef}\n width={400}\n height={400}\n onMouseDown={handleMouseDown}\n onMouseMove={handleMouseMove}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseUp}\n className=\"rounded-lg\"\n aria-label=\"Interactive 3D Icon Cloud\"\n role=\"img\"\n />\n );\n}\n",
+ "content": "\"use client\"\n\nimport React, { useEffect, useRef, useState } from \"react\"\nimport { renderToString } from \"react-dom/server\"\n\ninterface Icon {\n x: number\n y: number\n z: number\n scale: number\n opacity: number\n id: number\n}\n\ninterface IconCloudProps {\n icons?: React.ReactNode[]\n images?: string[]\n}\n\nfunction easeOutCubic(t: number): number {\n return 1 - Math.pow(1 - t, 3)\n}\n\nexport function IconCloud({ icons, images }: IconCloudProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const [iconPositions, setIconPositions] = useState<Icon[]>([])\n const [rotation, setRotation] = useState({ x: 0, y: 0 })\n const [isDragging, setIsDragging] = useState(false)\n const [lastMousePos, setLastMousePos] = useState({ x: 0, y: 0 })\n const [mousePos, setMousePos] = useState({ x: 0, y: 0 })\n const [targetRotation, setTargetRotation] = useState<{\n x: number\n y: number\n startX: number\n startY: number\n distance: number\n startTime: number\n duration: number\n } | null>(null)\n const animationFrameRef = useRef<number>(0)\n const rotationRef = useRef(rotation)\n const iconCanvasesRef = useRef<HTMLCanvasElement[]>([])\n const imagesLoadedRef = useRef<boolean[]>([])\n\n // Create icon canvases once when icons/images change\n useEffect(() => {\n if (!icons && !images) return\n\n const items = icons || images || []\n imagesLoadedRef.current = new Array(items.length).fill(false)\n\n const newIconCanvases = items.map((item, index) => {\n const offscreen = document.createElement(\"canvas\")\n offscreen.width = 40\n offscreen.height = 40\n const offCtx = offscreen.getContext(\"2d\")\n\n if (offCtx) {\n if (images) {\n // Handle image URLs directly\n const img = new Image()\n img.crossOrigin = \"anonymous\"\n img.src = items[index] as string\n img.onload = () => {\n offCtx.clearRect(0, 0, offscreen.width, offscreen.height)\n\n // Create circular clipping path\n offCtx.beginPath()\n offCtx.arc(20, 20, 20, 0, Math.PI * 2)\n offCtx.closePath()\n offCtx.clip()\n\n // Draw the image\n offCtx.drawImage(img, 0, 0, 40, 40)\n\n imagesLoadedRef.current[index] = true\n }\n } else {\n // Handle SVG icons\n offCtx.scale(0.4, 0.4)\n const svgString = renderToString(item as React.ReactElement)\n const img = new Image()\n img.src = \"data:image/svg+xml;base64,\" + btoa(svgString)\n img.onload = () => {\n offCtx.clearRect(0, 0, offscreen.width, offscreen.height)\n offCtx.drawImage(img, 0, 0)\n imagesLoadedRef.current[index] = true\n }\n }\n }\n return offscreen\n })\n\n iconCanvasesRef.current = newIconCanvases\n }, [icons, images])\n\n // Generate initial icon positions on a sphere\n useEffect(() => {\n const items = icons || images || []\n const newIcons: Icon[] = []\n const numIcons = items.length || 20\n\n // Fibonacci sphere parameters\n const offset = 2 / numIcons\n const increment = Math.PI * (3 - Math.sqrt(5))\n\n for (let i = 0; i < numIcons; i++) {\n const y = i * offset - 1 + offset / 2\n const r = Math.sqrt(1 - y * y)\n const phi = i * increment\n\n const x = Math.cos(phi) * r\n const z = Math.sin(phi) * r\n\n newIcons.push({\n x: x * 100,\n y: y * 100,\n z: z * 100,\n scale: 1,\n opacity: 1,\n id: i,\n })\n }\n setIconPositions(newIcons)\n }, [icons, images])\n\n // Handle mouse events\n const handleMouseDown = (e: React.MouseEvent<HTMLCanvasElement>) => {\n const rect = canvasRef.current?.getBoundingClientRect()\n if (!rect || !canvasRef.current) return\n\n const x = e.clientX - rect.left\n const y = e.clientY - rect.top\n\n const ctx = canvasRef.current.getContext(\"2d\")\n if (!ctx) return\n\n iconPositions.forEach((icon) => {\n const cosX = Math.cos(rotationRef.current.x)\n const sinX = Math.sin(rotationRef.current.x)\n const cosY = Math.cos(rotationRef.current.y)\n const sinY = Math.sin(rotationRef.current.y)\n\n const rotatedX = icon.x * cosY - icon.z * sinY\n const rotatedZ = icon.x * sinY + icon.z * cosY\n const rotatedY = icon.y * cosX + rotatedZ * sinX\n\n const screenX = canvasRef.current!.width / 2 + rotatedX\n const screenY = canvasRef.current!.height / 2 + rotatedY\n\n const scale = (rotatedZ + 200) / 300\n const radius = 20 * scale\n const dx = x - screenX\n const dy = y - screenY\n\n if (dx * dx + dy * dy < radius * radius) {\n const targetX = -Math.atan2(\n icon.y,\n Math.sqrt(icon.x * icon.x + icon.z * icon.z)\n )\n const targetY = Math.atan2(icon.x, icon.z)\n\n const currentX = rotationRef.current.x\n const currentY = rotationRef.current.y\n const distance = Math.sqrt(\n Math.pow(targetX - currentX, 2) + Math.pow(targetY - currentY, 2)\n )\n\n const duration = Math.min(2000, Math.max(800, distance * 1000))\n\n setTargetRotation({\n x: targetX,\n y: targetY,\n startX: currentX,\n startY: currentY,\n distance,\n startTime: performance.now(),\n duration,\n })\n return\n }\n })\n\n setIsDragging(true)\n setLastMousePos({ x: e.clientX, y: e.clientY })\n }\n\n const handleMouseMove = (e: React.MouseEvent<HTMLCanvasElement>) => {\n const rect = canvasRef.current?.getBoundingClientRect()\n if (rect) {\n const x = e.clientX - rect.left\n const y = e.clientY - rect.top\n setMousePos({ x, y })\n }\n\n if (isDragging) {\n const deltaX = e.clientX - lastMousePos.x\n const deltaY = e.clientY - lastMousePos.y\n\n rotationRef.current = {\n x: rotationRef.current.x + deltaY * 0.002,\n y: rotationRef.current.y + deltaX * 0.002,\n }\n\n setLastMousePos({ x: e.clientX, y: e.clientY })\n }\n }\n\n const handleMouseUp = () => {\n setIsDragging(false)\n }\n\n // Animation and rendering\n useEffect(() => {\n const canvas = canvasRef.current\n const ctx = canvas?.getContext(\"2d\")\n if (!canvas || !ctx) return\n\n const animate = () => {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n const centerX = canvas.width / 2\n const centerY = canvas.height / 2\n const maxDistance = Math.sqrt(centerX * centerX + centerY * centerY)\n const dx = mousePos.x - centerX\n const dy = mousePos.y - centerY\n const distance = Math.sqrt(dx * dx + dy * dy)\n const speed = 0.003 + (distance / maxDistance) * 0.01\n\n if (targetRotation) {\n const elapsed = performance.now() - targetRotation.startTime\n const progress = Math.min(1, elapsed / targetRotation.duration)\n const easedProgress = easeOutCubic(progress)\n\n rotationRef.current = {\n x:\n targetRotation.startX +\n (targetRotation.x - targetRotation.startX) * easedProgress,\n y:\n targetRotation.startY +\n (targetRotation.y - targetRotation.startY) * easedProgress,\n }\n\n if (progress >= 1) {\n setTargetRotation(null)\n }\n } else if (!isDragging) {\n rotationRef.current = {\n x: rotationRef.current.x + (dy / canvas.height) * speed,\n y: rotationRef.current.y + (dx / canvas.width) * speed,\n }\n }\n\n iconPositions.forEach((icon, index) => {\n const cosX = Math.cos(rotationRef.current.x)\n const sinX = Math.sin(rotationRef.current.x)\n const cosY = Math.cos(rotationRef.current.y)\n const sinY = Math.sin(rotationRef.current.y)\n\n const rotatedX = icon.x * cosY - icon.z * sinY\n const rotatedZ = icon.x * sinY + icon.z * cosY\n const rotatedY = icon.y * cosX + rotatedZ * sinX\n\n const scale = (rotatedZ + 200) / 300\n const opacity = Math.max(0.2, Math.min(1, (rotatedZ + 150) / 200))\n\n ctx.save()\n ctx.translate(canvas.width / 2 + rotatedX, canvas.height / 2 + rotatedY)\n ctx.scale(scale, scale)\n ctx.globalAlpha = opacity\n\n if (icons || images) {\n // Only try to render icons/images if they exist\n if (\n iconCanvasesRef.current[index] &&\n imagesLoadedRef.current[index]\n ) {\n ctx.drawImage(iconCanvasesRef.current[index], -20, -20, 40, 40)\n }\n } else {\n // Show numbered circles if no icons/images are provided\n ctx.beginPath()\n ctx.arc(0, 0, 20, 0, Math.PI * 2)\n ctx.fillStyle = \"#4444ff\"\n ctx.fill()\n ctx.fillStyle = \"white\"\n ctx.textAlign = \"center\"\n ctx.textBaseline = \"middle\"\n ctx.font = \"16px Arial\"\n ctx.fillText(`${icon.id + 1}`, 0, 0)\n }\n\n ctx.restore()\n })\n animationFrameRef.current = requestAnimationFrame(animate)\n }\n\n animate()\n\n return () => {\n if (animationFrameRef.current) {\n cancelAnimationFrame(animationFrameRef.current)\n }\n }\n }, [icons, images, iconPositions, isDragging, mousePos, targetRotation])\n\n return (\n <canvas\n ref={canvasRef}\n width={400}\n height={400}\n onMouseDown={handleMouseDown}\n onMouseMove={handleMouseMove}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseUp}\n className=\"rounded-lg\"\n aria-label=\"Interactive 3D Icon Cloud\"\n role=\"img\"\n />\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/interactive-grid-pattern-demo-2.json b/apps/www/public/r/interactive-grid-pattern-demo-2.json
index d8506d3c..3ed6dff6 100644
--- a/apps/www/public/r/interactive-grid-pattern-demo-2.json
+++ b/apps/www/public/r/interactive-grid-pattern-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/interactive-grid-pattern-demo-2.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { InteractiveGridPattern } from \"@/registry/magicui/interactive-grid-pattern\";\n\nexport default function InteractiveGridPatternDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <InteractiveGridPattern\n className={cn(\n \"[mask-image:radial-gradient(400px_circle_at_center,white,transparent)]\",\n )}\n width={20}\n height={20}\n squares={[80, 80]}\n squaresClassName=\"hover:fill-blue-500\"\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport { InteractiveGridPattern } from \"@/registry/magicui/interactive-grid-pattern\"\n\nexport default function InteractiveGridPatternDemo() {\n return (\n <div className=\"bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <InteractiveGridPattern\n className={cn(\n \"[mask-image:radial-gradient(400px_circle_at_center,white,transparent)]\"\n )}\n width={20}\n height={20}\n squares={[80, 80]}\n squaresClassName=\"hover:fill-blue-500\"\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/interactive-grid-pattern-demo.json b/apps/www/public/r/interactive-grid-pattern-demo.json
index 2fc16659..45b30b49 100644
--- a/apps/www/public/r/interactive-grid-pattern-demo.json
+++ b/apps/www/public/r/interactive-grid-pattern-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/interactive-grid-pattern-demo.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { InteractiveGridPattern } from \"@/registry/magicui/interactive-grid-pattern\";\n\nexport default function InteractiveGridPatternDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <InteractiveGridPattern\n className={cn(\n \"[mask-image:radial-gradient(400px_circle_at_center,white,transparent)]\",\n \"inset-x-0 inset-y-[-30%] h-[200%] skew-y-12\",\n )}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport { InteractiveGridPattern } from \"@/registry/magicui/interactive-grid-pattern\"\n\nexport default function InteractiveGridPatternDemo() {\n return (\n <div className=\"bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <InteractiveGridPattern\n className={cn(\n \"[mask-image:radial-gradient(400px_circle_at_center,white,transparent)]\",\n \"inset-x-0 inset-y-[-30%] h-[200%] skew-y-12\"\n )}\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/interactive-grid-pattern.json b/apps/www/public/r/interactive-grid-pattern.json
index 8f3dca6d..f54a5923 100644
--- a/apps/www/public/r/interactive-grid-pattern.json
+++ b/apps/www/public/r/interactive-grid-pattern.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/interactive-grid-pattern.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport React, { useState } from \"react\";\n\n/**\n * InteractiveGridPattern is a component that renders a grid pattern with interactive squares.\n *\n * @param width - The width of each square.\n * @param height - The height of each square.\n * @param squares - The number of squares in the grid. The first element is the number of horizontal squares, and the second element is the number of vertical squares.\n * @param className - The class name of the grid.\n * @param squaresClassName - The class name of the squares.\n */\ninterface InteractiveGridPatternProps extends React.SVGProps<SVGSVGElement> {\n width?: number;\n height?: number;\n squares?: [number, number]; // [horizontal, vertical]\n className?: string;\n squaresClassName?: string;\n}\n\n/**\n * The InteractiveGridPattern component.\n *\n * @see InteractiveGridPatternProps for the props interface.\n * @returns A React component.\n */\nexport function InteractiveGridPattern({\n width = 40,\n height = 40,\n squares = [24, 24],\n className,\n squaresClassName,\n ...props\n}: InteractiveGridPatternProps) {\n const [horizontal, vertical] = squares;\n const [hoveredSquare, setHoveredSquare] = useState<number | null>(null);\n\n return (\n <svg\n width={width * horizontal}\n height={height * vertical}\n className={cn(\n \"absolute inset-0 h-full w-full border border-gray-400/30\",\n className,\n )}\n {...props}\n >\n {Array.from({ length: horizontal * vertical }).map((_, index) => {\n const x = (index % horizontal) * width;\n const y = Math.floor(index / horizontal) * height;\n return (\n <rect\n key={index}\n x={x}\n y={y}\n width={width}\n height={height}\n className={cn(\n \"stroke-gray-400/30 transition-all duration-100 ease-in-out [&:not(:hover)]:duration-1000\",\n hoveredSquare === index ? \"fill-gray-300/30\" : \"fill-transparent\",\n squaresClassName,\n )}\n onMouseEnter={() => setHoveredSquare(index)}\n onMouseLeave={() => setHoveredSquare(null)}\n />\n );\n })}\n </svg>\n );\n}\n",
+ "content": "\"use client\"\n\nimport React, { useState } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/**\n * InteractiveGridPattern is a component that renders a grid pattern with interactive squares.\n *\n * @param width - The width of each square.\n * @param height - The height of each square.\n * @param squares - The number of squares in the grid. The first element is the number of horizontal squares, and the second element is the number of vertical squares.\n * @param className - The class name of the grid.\n * @param squaresClassName - The class name of the squares.\n */\ninterface InteractiveGridPatternProps extends React.SVGProps<SVGSVGElement> {\n width?: number\n height?: number\n squares?: [number, number] // [horizontal, vertical]\n className?: string\n squaresClassName?: string\n}\n\n/**\n * The InteractiveGridPattern component.\n *\n * @see InteractiveGridPatternProps for the props interface.\n * @returns A React component.\n */\nexport function InteractiveGridPattern({\n width = 40,\n height = 40,\n squares = [24, 24],\n className,\n squaresClassName,\n ...props\n}: InteractiveGridPatternProps) {\n const [horizontal, vertical] = squares\n const [hoveredSquare, setHoveredSquare] = useState<number | null>(null)\n\n return (\n <svg\n width={width * horizontal}\n height={height * vertical}\n className={cn(\n \"absolute inset-0 h-full w-full border border-gray-400/30\",\n className\n )}\n {...props}\n >\n {Array.from({ length: horizontal * vertical }).map((_, index) => {\n const x = (index % horizontal) * width\n const y = Math.floor(index / horizontal) * height\n return (\n <rect\n key={index}\n x={x}\n y={y}\n width={width}\n height={height}\n className={cn(\n \"stroke-gray-400/30 transition-all duration-100 ease-in-out [&:not(:hover)]:duration-1000\",\n hoveredSquare === index ? \"fill-gray-300/30\" : \"fill-transparent\",\n squaresClassName\n )}\n onMouseEnter={() => setHoveredSquare(index)}\n onMouseLeave={() => setHoveredSquare(null)}\n />\n )\n })}\n </svg>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/interactive-hover-button-demo.json b/apps/www/public/r/interactive-hover-button-demo.json
index c69cbe8c..dd8b09ac 100644
--- a/apps/www/public/r/interactive-hover-button-demo.json
+++ b/apps/www/public/r/interactive-hover-button-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/interactive-hover-button-demo.tsx",
- "content": "import { InteractiveHoverButton } from \"@/registry/magicui/interactive-hover-button\";\n\nexport default function InteractiveHoverButtonDemo() {\n return <InteractiveHoverButton>Hover Me</InteractiveHoverButton>;\n}\n",
+ "content": "import { InteractiveHoverButton } from \"@/registry/magicui/interactive-hover-button\"\n\nexport default function InteractiveHoverButtonDemo() {\n return <InteractiveHoverButton>Hover Me</InteractiveHoverButton>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/interactive-hover-button.json b/apps/www/public/r/interactive-hover-button.json
index 3df877f0..79ef3485 100644
--- a/apps/www/public/r/interactive-hover-button.json
+++ b/apps/www/public/r/interactive-hover-button.json
@@ -5,7 +5,7 @@
"files": [
{
"path": "registry/magicui/interactive-hover-button.tsx",
- "content": "import React from \"react\";\nimport { ArrowRight } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\ninterface InteractiveHoverButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const InteractiveHoverButton = React.forwardRef<\n HTMLButtonElement,\n InteractiveHoverButtonProps\n>(({ children, className, ...props }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(\n \"group relative w-auto cursor-pointer overflow-hidden rounded-full border bg-background p-2 px-6 text-center font-semibold\",\n className,\n )}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"h-2 w-2 rounded-full bg-primary transition-all duration-300 group-hover:scale-[100.8]\"></div>\n <span className=\"inline-block transition-all duration-300 group-hover:translate-x-12 group-hover:opacity-0\">\n {children}\n </span>\n </div>\n <div className=\"absolute top-0 z-10 flex h-full w-full translate-x-12 items-center justify-center gap-2 text-primary-foreground opacity-0 transition-all duration-300 group-hover:-translate-x-5 group-hover:opacity-100\">\n <span>{children}</span>\n <ArrowRight />\n </div>\n </button>\n );\n});\n\nInteractiveHoverButton.displayName = \"InteractiveHoverButton\";\n",
+ "content": "import React from \"react\"\nimport { ArrowRight } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface InteractiveHoverButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const InteractiveHoverButton = React.forwardRef<\n HTMLButtonElement,\n InteractiveHoverButtonProps\n>(({ children, className, ...props }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(\n \"group bg-background relative w-auto cursor-pointer overflow-hidden rounded-full border p-2 px-6 text-center font-semibold\",\n className\n )}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"bg-primary h-2 w-2 rounded-full transition-all duration-300 group-hover:scale-[100.8]\"></div>\n <span className=\"inline-block transition-all duration-300 group-hover:translate-x-12 group-hover:opacity-0\">\n {children}\n </span>\n </div>\n <div className=\"text-primary-foreground absolute top-0 z-10 flex h-full w-full translate-x-12 items-center justify-center gap-2 opacity-0 transition-all duration-300 group-hover:-translate-x-5 group-hover:opacity-100\">\n <span>{children}</span>\n <ArrowRight />\n </div>\n </button>\n )\n})\n\nInteractiveHoverButton.displayName = \"InteractiveHoverButton\"\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/iphone-15-pro-demo-2.json b/apps/www/public/r/iphone-15-pro-demo-2.json
index 58a62485..f1233cd4 100644
--- a/apps/www/public/r/iphone-15-pro-demo-2.json
+++ b/apps/www/public/r/iphone-15-pro-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/iphone-15-pro-demo-2.tsx",
- "content": "import { Iphone15Pro } from \"@/registry/magicui/iphone-15-pro\";\n\nexport default function Iphone15ProDemo() {\n return (\n <div className=\"w-[434px]\">\n <Iphone15Pro src=\"https://placehold.co/900x1600?text=Hello+World\" />\n </div>\n );\n}\n",
+ "content": "import { Iphone15Pro } from \"@/registry/magicui/iphone-15-pro\"\n\nexport default function Iphone15ProDemo() {\n return (\n <div className=\"w-[434px]\">\n <Iphone15Pro src=\"https://placehold.co/900x1600?text=Hello+World\" />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/iphone-15-pro-demo-3.json b/apps/www/public/r/iphone-15-pro-demo-3.json
index f12b2914..971feb66 100644
--- a/apps/www/public/r/iphone-15-pro-demo-3.json
+++ b/apps/www/public/r/iphone-15-pro-demo-3.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/iphone-15-pro-demo-3.tsx",
- "content": "import { Iphone15Pro } from \"@/registry/magicui/iphone-15-pro\";\n\nexport default function Iphone15ProDemo() {\n return (\n <div className=\"w-[434px]\">\n <Iphone15Pro videoSrc=\"https://videos.pexels.com/video-files/8946986/8946986-uhd_1440_2732_25fps.mp4\" />\n </div>\n );\n}\n",
+ "content": "import { Iphone15Pro } from \"@/registry/magicui/iphone-15-pro\"\n\nexport default function Iphone15ProDemo() {\n return (\n <div className=\"w-[434px]\">\n <Iphone15Pro videoSrc=\"https://videos.pexels.com/video-files/8946986/8946986-uhd_1440_2732_25fps.mp4\" />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/iphone-15-pro-demo.json b/apps/www/public/r/iphone-15-pro-demo.json
index 280798ec..201a3faf 100644
--- a/apps/www/public/r/iphone-15-pro-demo.json
+++ b/apps/www/public/r/iphone-15-pro-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/iphone-15-pro-demo.tsx",
- "content": "import { Iphone15Pro } from \"@/registry/magicui/iphone-15-pro\";\n\nexport default function Iphone15ProDemo() {\n return (\n <div className=\"w-[434px]\">\n <Iphone15Pro />\n </div>\n );\n}\n",
+ "content": "import { Iphone15Pro } from \"@/registry/magicui/iphone-15-pro\"\n\nexport default function Iphone15ProDemo() {\n return (\n <div className=\"w-[434px]\">\n <Iphone15Pro />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/iphone-15-pro.json b/apps/www/public/r/iphone-15-pro.json
index 90225f97..3b3c8596 100644
--- a/apps/www/public/r/iphone-15-pro.json
+++ b/apps/www/public/r/iphone-15-pro.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/iphone-15-pro.tsx",
- "content": "import type { HTMLAttributes } from \"react\";\n\nconst PHONE_WIDTH = 433;\nconst PHONE_HEIGHT = 882;\nconst SCREEN_X = 21.25;\nconst SCREEN_Y = 19.25;\nconst SCREEN_WIDTH = 389.5;\nconst SCREEN_HEIGHT = 843.5;\nconst SCREEN_RADIUS = 55.75;\n\n// Calculated percentages\nconst LEFT_PCT = (SCREEN_X / PHONE_WIDTH) * 100;\nconst TOP_PCT = (SCREEN_Y / PHONE_HEIGHT) * 100;\nconst WIDTH_PCT = (SCREEN_WIDTH / PHONE_WIDTH) * 100;\nconst HEIGHT_PCT = (SCREEN_HEIGHT / PHONE_HEIGHT) * 100;\nconst RADIUS_H = (SCREEN_RADIUS / SCREEN_WIDTH) * 100;\nconst RADIUS_V = (SCREEN_RADIUS / SCREEN_HEIGHT) * 100;\n\nexport interface Iphone15ProProps extends HTMLAttributes<HTMLDivElement> {\n src?: string;\n videoSrc?: string;\n}\n\nexport function Iphone15Pro({\n src,\n videoSrc,\n className,\n style,\n ...props\n}: Iphone15ProProps) {\n const hasVideo = !!videoSrc;\n const hasMedia = hasVideo || !!src;\n\n return (\n <div\n className={`relative inline-block w-full align-middle leading-none ${className}`}\n style={{\n aspectRatio: `${PHONE_WIDTH}/${PHONE_HEIGHT}`,\n ...style,\n }}\n {...props}\n >\n {hasVideo && (\n <div\n className=\"pointer-events-none absolute z-0 overflow-hidden\"\n style={{\n left: `${LEFT_PCT}%`,\n top: `${TOP_PCT}%`,\n width: `${WIDTH_PCT}%`,\n height: `${HEIGHT_PCT}%`,\n borderRadius: `${RADIUS_H}% / ${RADIUS_V}%`,\n }}\n >\n <video\n className=\"block size-full object-cover\"\n src={videoSrc}\n autoPlay\n loop\n muted\n playsInline\n preload=\"metadata\"\n />\n </div>\n )}\n\n {!hasVideo && src && (\n <div\n className=\"pointer-events-none absolute z-0 overflow-hidden\"\n style={{\n left: `${LEFT_PCT}%`,\n top: `${TOP_PCT}%`,\n width: `${WIDTH_PCT}%`,\n height: `${HEIGHT_PCT}%`,\n borderRadius: `${RADIUS_H}% / ${RADIUS_V}%`,\n }}\n >\n <img\n src={src}\n alt=\"\"\n className=\"block size-full object-cover object-top\"\n />\n </div>\n )}\n\n <svg\n viewBox={`0 0 ${PHONE_WIDTH} ${PHONE_HEIGHT}`}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"absolute inset-0 size-full\"\n style={{ transform: \"translateZ(0)\" }}\n >\n <g mask={hasMedia ? \"url(#screenPunch)\" : undefined}>\n <path\n d=\"M2 73C2 32.6832 34.6832 0 75 0H357C397.317 0 430 32.6832 430 73V809C430 849.317 397.317 882 357 882H75C34.6832 882 2 849.317 2 809V73Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M0 171C0 170.448 0.447715 170 1 170H3V204H1C0.447715 204 0 203.552 0 203V171Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M1 234C1 233.448 1.44772 233 2 233H3.5V300H2C1.44772 300 1 299.552 1 299V234Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M1 319C1 318.448 1.44772 318 2 318H3.5V385H2C1.44772 385 1 384.552 1 384V319Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M430 279H432C432.552 279 433 279.448 433 280V384C433 384.552 432.552 385 432 385H430V279Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M6 74C6 35.3401 37.3401 4 76 4H356C394.66 4 426 35.3401 426 74V808C426 846.66 394.66 878 356 878H76C37.3401 878 6 846.66 6 808V74Z\"\n className=\"fill-white dark:fill-[#262626]\"\n />\n </g>\n\n <path\n opacity=\"0.5\"\n d=\"M174 5H258V5.5C258 6.60457 257.105 7.5 256 7.5H176C174.895 7.5 174 6.60457 174 5.5V5Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n\n <path\n d={`M${SCREEN_X} 75C${SCREEN_X} 44.2101 46.2101 ${SCREEN_Y} 77 ${SCREEN_Y}H355C385.79 ${SCREEN_Y} 410.75 44.2101 410.75 75V807C410.75 837.79 385.79 862.75 355 862.75H77C46.2101 862.75 ${SCREEN_X} 837.79 ${SCREEN_X} 807V75Z`}\n className=\"fill-[#E5E5E5] stroke-[#E5E5E5] stroke-[0.5] dark:fill-[#404040] dark:stroke-[#404040]\"\n mask={hasMedia ? \"url(#screenPunch)\" : undefined}\n />\n\n <path\n d=\"M154 48.5C154 38.2827 162.283 30 172.5 30H259.5C269.717 30 278 38.2827 278 48.5C278 58.7173 269.717 67 259.5 67H172.5C162.283 67 154 58.7173 154 48.5Z\"\n className=\"fill-[#F5F5F5] dark:fill-[#262626]\"\n />\n <path\n d=\"M249 48.5C249 42.701 253.701 38 259.5 38C265.299 38 270 42.701 270 48.5C270 54.299 265.299 59 259.5 59C253.701 59 249 54.299 249 48.5Z\"\n className=\"fill-[#F5F5F5] dark:fill-[#262626]\"\n />\n <path\n d=\"M254 48.5C254 45.4624 256.462 43 259.5 43C262.538 43 265 45.4624 265 48.5C265 51.5376 262.538 54 259.5 54C256.462 54 254 51.5376 254 48.5Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n\n <defs>\n <mask id=\"screenPunch\" maskUnits=\"userSpaceOnUse\">\n <rect\n x=\"0\"\n y=\"0\"\n width={PHONE_WIDTH}\n height={PHONE_HEIGHT}\n fill=\"white\"\n />\n <rect\n x={SCREEN_X}\n y={SCREEN_Y}\n width={SCREEN_WIDTH}\n height={SCREEN_HEIGHT}\n rx={SCREEN_RADIUS}\n ry={SCREEN_RADIUS}\n fill=\"black\"\n />\n </mask>\n <clipPath id=\"roundedCorners\">\n <rect\n x={SCREEN_X}\n y={SCREEN_Y}\n width={SCREEN_WIDTH}\n height={SCREEN_HEIGHT}\n rx={SCREEN_RADIUS}\n ry={SCREEN_RADIUS}\n />\n </clipPath>\n </defs>\n </svg>\n </div>\n );\n}\n",
+ "content": "import type { HTMLAttributes } from \"react\"\n\nconst PHONE_WIDTH = 433\nconst PHONE_HEIGHT = 882\nconst SCREEN_X = 21.25\nconst SCREEN_Y = 19.25\nconst SCREEN_WIDTH = 389.5\nconst SCREEN_HEIGHT = 843.5\nconst SCREEN_RADIUS = 55.75\n\n// Calculated percentages\nconst LEFT_PCT = (SCREEN_X / PHONE_WIDTH) * 100\nconst TOP_PCT = (SCREEN_Y / PHONE_HEIGHT) * 100\nconst WIDTH_PCT = (SCREEN_WIDTH / PHONE_WIDTH) * 100\nconst HEIGHT_PCT = (SCREEN_HEIGHT / PHONE_HEIGHT) * 100\nconst RADIUS_H = (SCREEN_RADIUS / SCREEN_WIDTH) * 100\nconst RADIUS_V = (SCREEN_RADIUS / SCREEN_HEIGHT) * 100\n\nexport interface Iphone15ProProps extends HTMLAttributes<HTMLDivElement> {\n src?: string\n videoSrc?: string\n}\n\nexport function Iphone15Pro({\n src,\n videoSrc,\n className,\n style,\n ...props\n}: Iphone15ProProps) {\n const hasVideo = !!videoSrc\n const hasMedia = hasVideo || !!src\n\n return (\n <div\n className={`relative inline-block w-full align-middle leading-none ${className}`}\n style={{\n aspectRatio: `${PHONE_WIDTH}/${PHONE_HEIGHT}`,\n ...style,\n }}\n {...props}\n >\n {hasVideo && (\n <div\n className=\"pointer-events-none absolute z-0 overflow-hidden\"\n style={{\n left: `${LEFT_PCT}%`,\n top: `${TOP_PCT}%`,\n width: `${WIDTH_PCT}%`,\n height: `${HEIGHT_PCT}%`,\n borderRadius: `${RADIUS_H}% / ${RADIUS_V}%`,\n }}\n >\n <video\n className=\"block size-full object-cover\"\n src={videoSrc}\n autoPlay\n loop\n muted\n playsInline\n preload=\"metadata\"\n />\n </div>\n )}\n\n {!hasVideo && src && (\n <div\n className=\"pointer-events-none absolute z-0 overflow-hidden\"\n style={{\n left: `${LEFT_PCT}%`,\n top: `${TOP_PCT}%`,\n width: `${WIDTH_PCT}%`,\n height: `${HEIGHT_PCT}%`,\n borderRadius: `${RADIUS_H}% / ${RADIUS_V}%`,\n }}\n >\n <img\n src={src}\n alt=\"\"\n className=\"block size-full object-cover object-top\"\n />\n </div>\n )}\n\n <svg\n viewBox={`0 0 ${PHONE_WIDTH} ${PHONE_HEIGHT}`}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"absolute inset-0 size-full\"\n style={{ transform: \"translateZ(0)\" }}\n >\n <g mask={hasMedia ? \"url(#screenPunch)\" : undefined}>\n <path\n d=\"M2 73C2 32.6832 34.6832 0 75 0H357C397.317 0 430 32.6832 430 73V809C430 849.317 397.317 882 357 882H75C34.6832 882 2 849.317 2 809V73Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M0 171C0 170.448 0.447715 170 1 170H3V204H1C0.447715 204 0 203.552 0 203V171Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M1 234C1 233.448 1.44772 233 2 233H3.5V300H2C1.44772 300 1 299.552 1 299V234Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M1 319C1 318.448 1.44772 318 2 318H3.5V385H2C1.44772 385 1 384.552 1 384V319Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M430 279H432C432.552 279 433 279.448 433 280V384C433 384.552 432.552 385 432 385H430V279Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M6 74C6 35.3401 37.3401 4 76 4H356C394.66 4 426 35.3401 426 74V808C426 846.66 394.66 878 356 878H76C37.3401 878 6 846.66 6 808V74Z\"\n className=\"fill-white dark:fill-[#262626]\"\n />\n </g>\n\n <path\n opacity=\"0.5\"\n d=\"M174 5H258V5.5C258 6.60457 257.105 7.5 256 7.5H176C174.895 7.5 174 6.60457 174 5.5V5Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n\n <path\n d={`M${SCREEN_X} 75C${SCREEN_X} 44.2101 46.2101 ${SCREEN_Y} 77 ${SCREEN_Y}H355C385.79 ${SCREEN_Y} 410.75 44.2101 410.75 75V807C410.75 837.79 385.79 862.75 355 862.75H77C46.2101 862.75 ${SCREEN_X} 837.79 ${SCREEN_X} 807V75Z`}\n className=\"fill-[#E5E5E5] stroke-[#E5E5E5] stroke-[0.5] dark:fill-[#404040] dark:stroke-[#404040]\"\n mask={hasMedia ? \"url(#screenPunch)\" : undefined}\n />\n\n <path\n d=\"M154 48.5C154 38.2827 162.283 30 172.5 30H259.5C269.717 30 278 38.2827 278 48.5C278 58.7173 269.717 67 259.5 67H172.5C162.283 67 154 58.7173 154 48.5Z\"\n className=\"fill-[#F5F5F5] dark:fill-[#262626]\"\n />\n <path\n d=\"M249 48.5C249 42.701 253.701 38 259.5 38C265.299 38 270 42.701 270 48.5C270 54.299 265.299 59 259.5 59C253.701 59 249 54.299 249 48.5Z\"\n className=\"fill-[#F5F5F5] dark:fill-[#262626]\"\n />\n <path\n d=\"M254 48.5C254 45.4624 256.462 43 259.5 43C262.538 43 265 45.4624 265 48.5C265 51.5376 262.538 54 259.5 54C256.462 54 254 51.5376 254 48.5Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n\n <defs>\n <mask id=\"screenPunch\" maskUnits=\"userSpaceOnUse\">\n <rect\n x=\"0\"\n y=\"0\"\n width={PHONE_WIDTH}\n height={PHONE_HEIGHT}\n fill=\"white\"\n />\n <rect\n x={SCREEN_X}\n y={SCREEN_Y}\n width={SCREEN_WIDTH}\n height={SCREEN_HEIGHT}\n rx={SCREEN_RADIUS}\n ry={SCREEN_RADIUS}\n fill=\"black\"\n />\n </mask>\n <clipPath id=\"roundedCorners\">\n <rect\n x={SCREEN_X}\n y={SCREEN_Y}\n width={SCREEN_WIDTH}\n height={SCREEN_HEIGHT}\n rx={SCREEN_RADIUS}\n ry={SCREEN_RADIUS}\n />\n </clipPath>\n </defs>\n </svg>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/lens-demo-2.json b/apps/www/public/r/lens-demo-2.json
index 847dc260..5b16b1e2 100644
--- a/apps/www/public/r/lens-demo-2.json
+++ b/apps/www/public/r/lens-demo-2.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/example/lens-demo-2.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Lens } from \"@/registry/magicui/lens\";\n\nexport default function LensDemo() {\n return (\n <Card className=\"relative max-w-md shadow-none\">\n <CardHeader>\n <Lens isStatic position={{ x: 260, y: 150 }}>\n <img\n src=\"https://images.unsplash.com/photo-1736606355698-5efdb410fe93?q=80&w=2071&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n alt=\"image placeholder\"\n width={500}\n height={500}\n />\n </Lens>\n </CardHeader>\n <CardContent>\n <CardTitle className=\"text-2xl\">Your next camp</CardTitle>\n <CardDescription>\n See our latest and best camp destinations all across the five\n continents of the globe.\n </CardDescription>\n </CardContent>\n <CardFooter className=\"space-x-4\">\n <Button>Let&apos;s go</Button>\n <Button variant=\"secondary\">Another time</Button>\n </CardFooter>\n </Card>\n );\n}\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { Lens } from \"@/registry/magicui/lens\"\n\nexport default function LensDemo() {\n return (\n <Card className=\"relative max-w-md shadow-none\">\n <CardHeader>\n <Lens isStatic position={{ x: 260, y: 150 }}>\n <img\n src=\"https://images.unsplash.com/photo-1736606355698-5efdb410fe93?q=80&w=2071&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n alt=\"image placeholder\"\n width={500}\n height={500}\n />\n </Lens>\n </CardHeader>\n <CardContent>\n <CardTitle className=\"text-2xl\">Your next camp</CardTitle>\n <CardDescription>\n See our latest and best camp destinations all across the five\n continents of the globe.\n </CardDescription>\n </CardContent>\n <CardFooter className=\"space-x-4\">\n <Button>Let&apos;s go</Button>\n <Button variant=\"secondary\">Another time</Button>\n </CardFooter>\n </Card>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/lens-demo-3.json b/apps/www/public/r/lens-demo-3.json
index 8b73166c..b2619af2 100644
--- a/apps/www/public/r/lens-demo-3.json
+++ b/apps/www/public/r/lens-demo-3.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/example/lens-demo-3.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Lens } from \"@/registry/magicui/lens\";\n\nexport default function LensDemo() {\n return (\n <Card className=\"relative max-w-md shadow-none\">\n <CardHeader>\n <Lens defaultPosition={{ x: 260, y: 150 }}>\n <img\n src=\"https://images.unsplash.com/photo-1736606355698-5efdb410fe93?q=80&w=2071&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n alt=\"image placeholder\"\n width={500}\n height={500}\n />\n </Lens>\n </CardHeader>\n <CardContent>\n <CardTitle className=\"text-2xl\">Your next camp</CardTitle>\n <CardDescription>\n See our latest and best camp destinations all across the five\n continents of the globe.\n </CardDescription>\n </CardContent>\n <CardFooter className=\"space-x-4\">\n <Button>Let&apos;s go</Button>\n <Button variant=\"secondary\">Another time</Button>\n </CardFooter>\n </Card>\n );\n}\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { Lens } from \"@/registry/magicui/lens\"\n\nexport default function LensDemo() {\n return (\n <Card className=\"relative max-w-md shadow-none\">\n <CardHeader>\n <Lens defaultPosition={{ x: 260, y: 150 }}>\n <img\n src=\"https://images.unsplash.com/photo-1736606355698-5efdb410fe93?q=80&w=2071&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n alt=\"image placeholder\"\n width={500}\n height={500}\n />\n </Lens>\n </CardHeader>\n <CardContent>\n <CardTitle className=\"text-2xl\">Your next camp</CardTitle>\n <CardDescription>\n See our latest and best camp destinations all across the five\n continents of the globe.\n </CardDescription>\n </CardContent>\n <CardFooter className=\"space-x-4\">\n <Button>Let&apos;s go</Button>\n <Button variant=\"secondary\">Another time</Button>\n </CardFooter>\n </Card>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/lens-demo.json b/apps/www/public/r/lens-demo.json
index 4390f4ad..ecf96918 100644
--- a/apps/www/public/r/lens-demo.json
+++ b/apps/www/public/r/lens-demo.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/example/lens-demo.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\n\n\"use client\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Lens } from \"@/registry/magicui/lens\";\n\nexport default function LensDemo() {\n return (\n <Card className=\"relative max-w-md shadow-none\">\n <CardHeader>\n <Lens\n zoomFactor={2}\n lensSize={150}\n isStatic={false}\n ariaLabel=\"Zoom Area\"\n >\n <img\n src=\"https://images.unsplash.com/photo-1736606355698-5efdb410fe93?q=80&w=2071&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n alt=\"image placeholder\"\n width={500}\n height={500}\n />\n </Lens>\n </CardHeader>\n <CardContent>\n <CardTitle className=\"text-2xl\">Your next camp</CardTitle>\n <CardDescription>\n See our latest and best camp destinations all across the five\n continents of the globe.\n </CardDescription>\n </CardContent>\n <CardFooter className=\"space-x-4\">\n <Button>Let&apos;s go</Button>\n <Button variant=\"secondary\">Another time</Button>\n </CardFooter>\n </Card>\n );\n}\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\n\n\"use client\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { Lens } from \"@/registry/magicui/lens\"\n\nexport default function LensDemo() {\n return (\n <Card className=\"relative max-w-md shadow-none\">\n <CardHeader>\n <Lens\n zoomFactor={2}\n lensSize={150}\n isStatic={false}\n ariaLabel=\"Zoom Area\"\n >\n <img\n src=\"https://images.unsplash.com/photo-1736606355698-5efdb410fe93?q=80&w=2071&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n alt=\"image placeholder\"\n width={500}\n height={500}\n />\n </Lens>\n </CardHeader>\n <CardContent>\n <CardTitle className=\"text-2xl\">Your next camp</CardTitle>\n <CardDescription>\n See our latest and best camp destinations all across the five\n continents of the globe.\n </CardDescription>\n </CardContent>\n <CardFooter className=\"space-x-4\">\n <Button>Let&apos;s go</Button>\n <Button variant=\"secondary\">Another time</Button>\n </CardFooter>\n </Card>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/lens.json b/apps/www/public/r/lens.json
index c8d83df1..3f55ecd7 100644
--- a/apps/www/public/r/lens.json
+++ b/apps/www/public/r/lens.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/lens.tsx",
- "content": "\"use client\";\n\nimport { AnimatePresence, motion, useMotionTemplate } from \"motion/react\";\nimport React, { useCallback, useMemo, useRef, useState } from \"react\";\n\ninterface Position {\n /** The x coordinate of the lens */\n x: number;\n /** The y coordinate of the lens */\n y: number;\n}\n\ninterface LensProps {\n /** The children of the lens */\n children: React.ReactNode;\n /** The zoom factor of the lens */\n zoomFactor?: number;\n /** The size of the lens */\n lensSize?: number;\n /** The position of the lens */\n position?: Position;\n /** The default position of the lens */\n defaultPosition?: Position;\n /** Whether the lens is static */\n isStatic?: boolean;\n /** The duration of the animation */\n duration?: number;\n /** The color of the lens */\n lensColor?: string;\n /** The aria label of the lens */\n ariaLabel?: string;\n}\n\nexport function Lens({\n children,\n zoomFactor = 1.3,\n lensSize = 170,\n isStatic = false,\n position = { x: 0, y: 0 },\n defaultPosition,\n duration = 0.1,\n lensColor = \"black\",\n ariaLabel = \"Zoom Area\",\n}: LensProps) {\n if (zoomFactor < 1) {\n throw new Error(\"zoomFactor must be greater than 1\");\n }\n if (lensSize < 0) {\n throw new Error(\"lensSize must be greater than 0\");\n }\n\n const [isHovering, setIsHovering] = useState(false);\n const [mousePosition, setMousePosition] = useState<Position>(position);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const currentPosition = useMemo(() => {\n if (isStatic) return position;\n if (defaultPosition && !isHovering) return defaultPosition;\n return mousePosition;\n }, [isStatic, position, defaultPosition, isHovering, mousePosition]);\n\n const handleMouseMove = useCallback((e: React.MouseEvent<HTMLDivElement>) => {\n const rect = e.currentTarget.getBoundingClientRect();\n setMousePosition({\n x: e.clientX - rect.left,\n y: e.clientY - rect.top,\n });\n }, []);\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === \"Escape\") setIsHovering(false);\n }, []);\n\n const maskImage = useMotionTemplate`radial-gradient(circle ${\n lensSize / 2\n }px at ${currentPosition.x}px ${\n currentPosition.y\n }px, ${lensColor} 100%, transparent 100%)`;\n\n const LensContent = useMemo(() => {\n const { x, y } = currentPosition;\n\n return (\n <motion.div\n initial={{ opacity: 0, scale: 0.58 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.8 }}\n transition={{ duration }}\n className=\"absolute inset-0 overflow-hidden\"\n style={{\n maskImage,\n WebkitMaskImage: maskImage,\n transformOrigin: `${x}px ${y}px`,\n zIndex: 50,\n }}\n >\n <div\n className=\"absolute inset-0\"\n style={{\n transform: `scale(${zoomFactor})`,\n transformOrigin: `${x}px ${y}px`,\n }}\n >\n {children}\n </div>\n </motion.div>\n );\n }, [currentPosition, lensSize, lensColor, zoomFactor, children, duration]);\n\n return (\n <div\n ref={containerRef}\n className=\"relative z-20 overflow-hidden rounded-xl\"\n onMouseEnter={() => setIsHovering(true)}\n onMouseLeave={() => setIsHovering(false)}\n onMouseMove={handleMouseMove}\n onKeyDown={handleKeyDown}\n role=\"region\"\n aria-label={ariaLabel}\n tabIndex={0}\n >\n {children}\n {isStatic || defaultPosition ? (\n LensContent\n ) : (\n <AnimatePresence mode=\"popLayout\">\n {isHovering && LensContent}\n </AnimatePresence>\n )}\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport React, { useCallback, useMemo, useRef, useState } from \"react\"\nimport { AnimatePresence, motion, useMotionTemplate } from \"motion/react\"\n\ninterface Position {\n /** The x coordinate of the lens */\n x: number\n /** The y coordinate of the lens */\n y: number\n}\n\ninterface LensProps {\n /** The children of the lens */\n children: React.ReactNode\n /** The zoom factor of the lens */\n zoomFactor?: number\n /** The size of the lens */\n lensSize?: number\n /** The position of the lens */\n position?: Position\n /** The default position of the lens */\n defaultPosition?: Position\n /** Whether the lens is static */\n isStatic?: boolean\n /** The duration of the animation */\n duration?: number\n /** The color of the lens */\n lensColor?: string\n /** The aria label of the lens */\n ariaLabel?: string\n}\n\nexport function Lens({\n children,\n zoomFactor = 1.3,\n lensSize = 170,\n isStatic = false,\n position = { x: 0, y: 0 },\n defaultPosition,\n duration = 0.1,\n lensColor = \"black\",\n ariaLabel = \"Zoom Area\",\n}: LensProps) {\n if (zoomFactor < 1) {\n throw new Error(\"zoomFactor must be greater than 1\")\n }\n if (lensSize < 0) {\n throw new Error(\"lensSize must be greater than 0\")\n }\n\n const [isHovering, setIsHovering] = useState(false)\n const [mousePosition, setMousePosition] = useState<Position>(position)\n const containerRef = useRef<HTMLDivElement>(null)\n\n const currentPosition = useMemo(() => {\n if (isStatic) return position\n if (defaultPosition && !isHovering) return defaultPosition\n return mousePosition\n }, [isStatic, position, defaultPosition, isHovering, mousePosition])\n\n const handleMouseMove = useCallback((e: React.MouseEvent<HTMLDivElement>) => {\n const rect = e.currentTarget.getBoundingClientRect()\n setMousePosition({\n x: e.clientX - rect.left,\n y: e.clientY - rect.top,\n })\n }, [])\n\n const handleKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.key === \"Escape\") setIsHovering(false)\n }, [])\n\n const maskImage = useMotionTemplate`radial-gradient(circle ${\n lensSize / 2\n }px at ${currentPosition.x}px ${\n currentPosition.y\n }px, ${lensColor} 100%, transparent 100%)`\n\n const LensContent = useMemo(() => {\n const { x, y } = currentPosition\n\n return (\n <motion.div\n initial={{ opacity: 0, scale: 0.58 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={{ opacity: 0, scale: 0.8 }}\n transition={{ duration }}\n className=\"absolute inset-0 overflow-hidden\"\n style={{\n maskImage,\n WebkitMaskImage: maskImage,\n transformOrigin: `${x}px ${y}px`,\n zIndex: 50,\n }}\n >\n <div\n className=\"absolute inset-0\"\n style={{\n transform: `scale(${zoomFactor})`,\n transformOrigin: `${x}px ${y}px`,\n }}\n >\n {children}\n </div>\n </motion.div>\n )\n }, [currentPosition, lensSize, lensColor, zoomFactor, children, duration])\n\n return (\n <div\n ref={containerRef}\n className=\"relative z-20 overflow-hidden rounded-xl\"\n onMouseEnter={() => setIsHovering(true)}\n onMouseLeave={() => setIsHovering(false)}\n onMouseMove={handleMouseMove}\n onKeyDown={handleKeyDown}\n role=\"region\"\n aria-label={ariaLabel}\n tabIndex={0}\n >\n {children}\n {isStatic || defaultPosition ? (\n LensContent\n ) : (\n <AnimatePresence mode=\"popLayout\">\n {isHovering && LensContent}\n </AnimatePresence>\n )}\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/line-shadow-text-demo.json b/apps/www/public/r/line-shadow-text-demo.json
index 01b8d514..b4fae667 100644
--- a/apps/www/public/r/line-shadow-text-demo.json
+++ b/apps/www/public/r/line-shadow-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/line-shadow-text-demo.tsx",
- "content": "\"use client\";\n\nimport { LineShadowText } from \"@/registry/magicui/line-shadow-text\";\nimport { useTheme } from \"next-themes\";\n\nexport default function LineShadowTextDemo() {\n const theme = useTheme();\n const shadowColor = theme.resolvedTheme === \"dark\" ? \"white\" : \"black\";\n return (\n <h1 className=\"text-balance text-5xl font-semibold leading-none tracking-tighter sm:text-6xl md:text-7xl lg:text-8xl\">\n Ship\n <LineShadowText className=\"italic\" shadowColor={shadowColor}>\n Fast\n </LineShadowText>\n </h1>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useTheme } from \"next-themes\"\n\nimport { LineShadowText } from \"@/registry/magicui/line-shadow-text\"\n\nexport default function LineShadowTextDemo() {\n const theme = useTheme()\n const shadowColor = theme.resolvedTheme === \"dark\" ? \"white\" : \"black\"\n return (\n <h1 className=\"text-5xl leading-none font-semibold tracking-tighter text-balance sm:text-6xl md:text-7xl lg:text-8xl\">\n Ship\n <LineShadowText className=\"italic\" shadowColor={shadowColor}>\n Fast\n </LineShadowText>\n </h1>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/line-shadow-text.json b/apps/www/public/r/line-shadow-text.json
index fe27ad62..23a7c78a 100644
--- a/apps/www/public/r/line-shadow-text.json
+++ b/apps/www/public/r/line-shadow-text.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/line-shadow-text.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { motion, MotionProps } from \"motion/react\";\n\ninterface LineShadowTextProps\n extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps>,\n MotionProps {\n shadowColor?: string;\n as?: React.ElementType;\n}\n\nexport function LineShadowText({\n children,\n shadowColor = \"black\",\n className,\n as: Component = \"span\",\n ...props\n}: LineShadowTextProps) {\n const MotionComponent = motion.create(Component);\n const content = typeof children === \"string\" ? children : null;\n\n if (!content) {\n throw new Error(\"LineShadowText only accepts string content\");\n }\n\n return (\n <MotionComponent\n style={{ \"--shadow-color\": shadowColor } as React.CSSProperties}\n className={cn(\n \"relative z-0 inline-flex\",\n \"after:absolute after:left-[0.04em] after:top-[0.04em] after:content-[attr(data-text)]\",\n \"after:bg-[linear-gradient(45deg,transparent_45%,var(--shadow-color)_45%,var(--shadow-color)_55%,transparent_0)]\",\n \"after:-z-10 after:bg-[length:0.06em_0.06em] after:bg-clip-text after:text-transparent\",\n \"after:animate-line-shadow\",\n className,\n )}\n data-text={content}\n {...props}\n >\n {content}\n </MotionComponent>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { motion, MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface LineShadowTextProps\n extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps>,\n MotionProps {\n shadowColor?: string\n as?: React.ElementType\n}\n\nexport function LineShadowText({\n children,\n shadowColor = \"black\",\n className,\n as: Component = \"span\",\n ...props\n}: LineShadowTextProps) {\n const MotionComponent = motion.create(Component)\n const content = typeof children === \"string\" ? children : null\n\n if (!content) {\n throw new Error(\"LineShadowText only accepts string content\")\n }\n\n return (\n <MotionComponent\n style={{ \"--shadow-color\": shadowColor } as React.CSSProperties}\n className={cn(\n \"relative z-0 inline-flex\",\n \"after:absolute after:top-[0.04em] after:left-[0.04em] after:content-[attr(data-text)]\",\n \"after:bg-[linear-gradient(45deg,transparent_45%,var(--shadow-color)_45%,var(--shadow-color)_55%,transparent_0)]\",\n \"after:-z-10 after:bg-[length:0.06em_0.06em] after:bg-clip-text after:text-transparent\",\n \"after:animate-line-shadow\",\n className\n )}\n data-text={content}\n {...props}\n >\n {content}\n </MotionComponent>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/magic-card-demo.json b/apps/www/public/r/magic-card-demo.json
index 7b19347e..729927fe 100644
--- a/apps/www/public/r/magic-card-demo.json
+++ b/apps/www/public/r/magic-card-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/magic-card-demo.tsx",
- "content": "\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { MagicCard } from \"@/registry/magicui/magic-card\";\nimport { useTheme } from \"next-themes\";\n\nexport default function MagicCardDemo() {\n const { theme } = useTheme();\n return (\n <Card className=\"p-0 max-w-sm w-full shadow-none border-none\">\n <MagicCard\n gradientColor={theme === \"dark\" ? \"#262626\" : \"#D9D9D955\"}\n className=\"p-0\"\n >\n <CardHeader className=\"border-b border-border p-4 [.border-b]:pb-4\">\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account\n </CardDescription>\n </CardHeader>\n <CardContent className=\"p-4\">\n <form>\n <div className=\"grid gap-4\">\n <div className=\"grid gap-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"[email protected]\" />\n </div>\n <div className=\"grid gap-2\">\n <Label htmlFor=\"password\">Password</Label>\n <Input id=\"password\" type=\"password\" />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter className=\"p-4 border-t border-border [.border-t]:pt-4\">\n <Button className=\"w-full\">Sign In</Button>\n </CardFooter>\n </MagicCard>\n </Card>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useTheme } from \"next-themes\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { Input } from \"@/components/ui/input\"\nimport { Label } from \"@/components/ui/label\"\nimport { MagicCard } from \"@/registry/magicui/magic-card\"\n\nexport default function MagicCardDemo() {\n const { theme } = useTheme()\n return (\n <Card className=\"w-full max-w-sm border-none p-0 shadow-none\">\n <MagicCard\n gradientColor={theme === \"dark\" ? \"#262626\" : \"#D9D9D955\"}\n className=\"p-0\"\n >\n <CardHeader className=\"border-border border-b p-4 [.border-b]:pb-4\">\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account\n </CardDescription>\n </CardHeader>\n <CardContent className=\"p-4\">\n <form>\n <div className=\"grid gap-4\">\n <div className=\"grid gap-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"[email protected]\" />\n </div>\n <div className=\"grid gap-2\">\n <Label htmlFor=\"password\">Password</Label>\n <Input id=\"password\" type=\"password\" />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter className=\"border-border border-t p-4 [.border-t]:pt-4\">\n <Button className=\"w-full\">Sign In</Button>\n </CardFooter>\n </MagicCard>\n </Card>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/magic-card.json b/apps/www/public/r/magic-card.json
index 69ad0740..9b8ecd31 100644
--- a/apps/www/public/r/magic-card.json
+++ b/apps/www/public/r/magic-card.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/magic-card.tsx",
- "content": "\"use client\";\n\nimport { motion, useMotionTemplate, useMotionValue } from \"motion/react\";\nimport React, { useCallback, useEffect } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface MagicCardProps {\n children?: React.ReactNode;\n className?: string;\n gradientSize?: number;\n gradientColor?: string;\n gradientOpacity?: number;\n gradientFrom?: string;\n gradientTo?: string;\n}\n\nexport function MagicCard({\n children,\n className,\n gradientSize = 200,\n gradientColor = \"#262626\",\n gradientOpacity = 0.8,\n gradientFrom = \"#9E7AFF\",\n gradientTo = \"#FE8BBB\",\n}: MagicCardProps) {\n const mouseX = useMotionValue(-gradientSize);\n const mouseY = useMotionValue(-gradientSize);\n const reset = useCallback(() => {\n mouseX.set(-gradientSize);\n mouseY.set(-gradientSize);\n }, [gradientSize, mouseX, mouseY]);\n\n const handlePointerMove = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n const rect = e.currentTarget.getBoundingClientRect();\n mouseX.set(e.clientX - rect.left);\n mouseY.set(e.clientY - rect.top);\n },\n [mouseX, mouseY],\n );\n\n useEffect(() => {\n reset();\n }, [reset]);\n\n useEffect(() => {\n const handleGlobalPointerOut = (e: PointerEvent) => {\n if (!e.relatedTarget) {\n reset();\n }\n };\n\n const handleVisibility = () => {\n if (document.visibilityState !== \"visible\") {\n reset();\n }\n };\n\n window.addEventListener(\"pointerout\", handleGlobalPointerOut);\n window.addEventListener(\"blur\", reset);\n document.addEventListener(\"visibilitychange\", handleVisibility);\n\n return () => {\n window.removeEventListener(\"pointerout\", handleGlobalPointerOut);\n window.removeEventListener(\"blur\", reset);\n document.removeEventListener(\"visibilitychange\", handleVisibility);\n };\n }, [reset]);\n\n return (\n <div\n className={cn(\"group relative rounded-[inherit]\", className)}\n onPointerMove={handlePointerMove}\n onPointerLeave={reset}\n onPointerEnter={reset}\n >\n <motion.div\n className=\"pointer-events-none absolute inset-0 rounded-[inherit] bg-border duration-300 group-hover:opacity-100\"\n style={{\n background: useMotionTemplate`\n radial-gradient(${gradientSize}px circle at ${mouseX}px ${mouseY}px,\n ${gradientFrom}, \n ${gradientTo}, \n var(--border) 100%\n )\n `,\n }}\n />\n <div className=\"absolute inset-px rounded-[inherit] bg-background\" />\n <motion.div\n className=\"pointer-events-none absolute inset-px rounded-[inherit] opacity-0 transition-opacity duration-300 group-hover:opacity-100\"\n style={{\n background: useMotionTemplate`\n radial-gradient(${gradientSize}px circle at ${mouseX}px ${mouseY}px, ${gradientColor}, transparent 100%)\n `,\n opacity: gradientOpacity,\n }}\n />\n <div className=\"relative\">{children}</div>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport React, { useCallback, useEffect } from \"react\"\nimport { motion, useMotionTemplate, useMotionValue } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MagicCardProps {\n children?: React.ReactNode\n className?: string\n gradientSize?: number\n gradientColor?: string\n gradientOpacity?: number\n gradientFrom?: string\n gradientTo?: string\n}\n\nexport function MagicCard({\n children,\n className,\n gradientSize = 200,\n gradientColor = \"#262626\",\n gradientOpacity = 0.8,\n gradientFrom = \"#9E7AFF\",\n gradientTo = \"#FE8BBB\",\n}: MagicCardProps) {\n const mouseX = useMotionValue(-gradientSize)\n const mouseY = useMotionValue(-gradientSize)\n const reset = useCallback(() => {\n mouseX.set(-gradientSize)\n mouseY.set(-gradientSize)\n }, [gradientSize, mouseX, mouseY])\n\n const handlePointerMove = useCallback(\n (e: React.PointerEvent<HTMLDivElement>) => {\n const rect = e.currentTarget.getBoundingClientRect()\n mouseX.set(e.clientX - rect.left)\n mouseY.set(e.clientY - rect.top)\n },\n [mouseX, mouseY]\n )\n\n useEffect(() => {\n reset()\n }, [reset])\n\n useEffect(() => {\n const handleGlobalPointerOut = (e: PointerEvent) => {\n if (!e.relatedTarget) {\n reset()\n }\n }\n\n const handleVisibility = () => {\n if (document.visibilityState !== \"visible\") {\n reset()\n }\n }\n\n window.addEventListener(\"pointerout\", handleGlobalPointerOut)\n window.addEventListener(\"blur\", reset)\n document.addEventListener(\"visibilitychange\", handleVisibility)\n\n return () => {\n window.removeEventListener(\"pointerout\", handleGlobalPointerOut)\n window.removeEventListener(\"blur\", reset)\n document.removeEventListener(\"visibilitychange\", handleVisibility)\n }\n }, [reset])\n\n return (\n <div\n className={cn(\"group relative rounded-[inherit]\", className)}\n onPointerMove={handlePointerMove}\n onPointerLeave={reset}\n onPointerEnter={reset}\n >\n <motion.div\n className=\"bg-border pointer-events-none absolute inset-0 rounded-[inherit] duration-300 group-hover:opacity-100\"\n style={{\n background: useMotionTemplate`\n radial-gradient(${gradientSize}px circle at ${mouseX}px ${mouseY}px,\n ${gradientFrom}, \n ${gradientTo}, \n var(--border) 100%\n )\n `,\n }}\n />\n <div className=\"bg-background absolute inset-px rounded-[inherit]\" />\n <motion.div\n className=\"pointer-events-none absolute inset-px rounded-[inherit] opacity-0 transition-opacity duration-300 group-hover:opacity-100\"\n style={{\n background: useMotionTemplate`\n radial-gradient(${gradientSize}px circle at ${mouseX}px ${mouseY}px, ${gradientColor}, transparent 100%)\n `,\n opacity: gradientOpacity,\n }}\n />\n <div className=\"relative\">{children}</div>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/marquee-3d.json b/apps/www/public/r/marquee-3d.json
index a31192c3..df49ad5b 100644
--- a/apps/www/public/r/marquee-3d.json
+++ b/apps/www/public/r/marquee-3d.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/marquee-3d.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\nimport { cn } from \"@/lib/utils\";\nimport { Marquee } from \"@/registry/magicui/marquee\";\n\nconst reviews = [\n {\n name: \"Jack\",\n username: \"@jack\",\n body: \"I've never seen anything like this before. It's amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jack\",\n },\n {\n name: \"Jill\",\n username: \"@jill\",\n body: \"I don't know what to say. I'm speechless. This is amazing.\",\n img: \"https://avatar.vercel.sh/jill\",\n },\n {\n name: \"John\",\n username: \"@john\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/john\",\n },\n];\n\nconst firstRow = reviews.slice(0, reviews.length / 2);\nconst secondRow = reviews.slice(reviews.length / 2);\nconst thirdRow = reviews.slice(0, reviews.length / 2);\nconst fourthRow = reviews.slice(reviews.length / 2);\n\nconst ReviewCard = ({\n img,\n name,\n username,\n body,\n}: {\n img: string;\n name: string;\n username: string;\n body: string;\n}) => {\n return (\n <figure\n className={cn(\n \"relative h-full w-fit sm:w-36 cursor-pointer overflow-hidden rounded-xl border p-4\",\n // light styles\n \"border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]\",\n // dark styles\n \"dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]\",\n )}\n >\n <div className=\"flex flex-row items-center gap-2\">\n <img className=\"rounded-full\" width=\"32\" height=\"32\" alt=\"\" src={img} />\n <div className=\"flex flex-col\">\n <figcaption className=\"text-sm font-medium dark:text-white\">\n {name}\n </figcaption>\n <p className=\"text-xs font-medium dark:text-white/40\">{username}</p>\n </div>\n </div>\n <blockquote className=\"mt-2 text-sm\">{body}</blockquote>\n </figure>\n );\n};\n\nexport default function Marquee3D() {\n return (\n <div className=\"relative flex h-96 w-full flex-row items-center justify-center gap-4 overflow-hidden [perspective:300px]\">\n <div\n className=\"flex flex-row items-center gap-4\"\n style={{\n transform:\n \"translateX(-100px) translateY(0px) translateZ(-100px) rotateX(20deg) rotateY(-10deg) rotateZ(20deg)\",\n }}\n >\n <Marquee pauseOnHover vertical className=\"[--duration:20s]\">\n {firstRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee reverse pauseOnHover className=\"[--duration:20s]\" vertical>\n {secondRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee reverse pauseOnHover className=\"[--duration:20s]\" vertical>\n {thirdRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee pauseOnHover className=\"[--duration:20s]\" vertical>\n {fourthRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n </div>\n\n <div className=\"pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-gradient-to-b from-background\"></div>\n <div className=\"pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t from-background\"></div>\n <div className=\"pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r from-background\"></div>\n <div className=\"pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l from-background\"></div>\n </div>\n );\n}\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\nimport { cn } from \"@/lib/utils\"\nimport { Marquee } from \"@/registry/magicui/marquee\"\n\nconst reviews = [\n {\n name: \"Jack\",\n username: \"@jack\",\n body: \"I've never seen anything like this before. It's amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jack\",\n },\n {\n name: \"Jill\",\n username: \"@jill\",\n body: \"I don't know what to say. I'm speechless. This is amazing.\",\n img: \"https://avatar.vercel.sh/jill\",\n },\n {\n name: \"John\",\n username: \"@john\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/john\",\n },\n]\n\nconst firstRow = reviews.slice(0, reviews.length / 2)\nconst secondRow = reviews.slice(reviews.length / 2)\nconst thirdRow = reviews.slice(0, reviews.length / 2)\nconst fourthRow = reviews.slice(reviews.length / 2)\n\nconst ReviewCard = ({\n img,\n name,\n username,\n body,\n}: {\n img: string\n name: string\n username: string\n body: string\n}) => {\n return (\n <figure\n className={cn(\n \"relative h-full w-fit cursor-pointer overflow-hidden rounded-xl border p-4 sm:w-36\",\n // light styles\n \"border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]\",\n // dark styles\n \"dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]\"\n )}\n >\n <div className=\"flex flex-row items-center gap-2\">\n <img className=\"rounded-full\" width=\"32\" height=\"32\" alt=\"\" src={img} />\n <div className=\"flex flex-col\">\n <figcaption className=\"text-sm font-medium dark:text-white\">\n {name}\n </figcaption>\n <p className=\"text-xs font-medium dark:text-white/40\">{username}</p>\n </div>\n </div>\n <blockquote className=\"mt-2 text-sm\">{body}</blockquote>\n </figure>\n )\n}\n\nexport default function Marquee3D() {\n return (\n <div className=\"relative flex h-96 w-full flex-row items-center justify-center gap-4 overflow-hidden [perspective:300px]\">\n <div\n className=\"flex flex-row items-center gap-4\"\n style={{\n transform:\n \"translateX(-100px) translateY(0px) translateZ(-100px) rotateX(20deg) rotateY(-10deg) rotateZ(20deg)\",\n }}\n >\n <Marquee pauseOnHover vertical className=\"[--duration:20s]\">\n {firstRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee reverse pauseOnHover className=\"[--duration:20s]\" vertical>\n {secondRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee reverse pauseOnHover className=\"[--duration:20s]\" vertical>\n {thirdRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee pauseOnHover className=\"[--duration:20s]\" vertical>\n {fourthRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n </div>\n\n <div className=\"from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-gradient-to-b\"></div>\n <div className=\"from-background pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t\"></div>\n <div className=\"from-background pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r\"></div>\n <div className=\"from-background pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l\"></div>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/marquee-demo-vertical.json b/apps/www/public/r/marquee-demo-vertical.json
index febf45a4..888680dc 100644
--- a/apps/www/public/r/marquee-demo-vertical.json
+++ b/apps/www/public/r/marquee-demo-vertical.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/marquee-demo-vertical.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\nimport { cn } from \"@/lib/utils\";\nimport { Marquee } from \"@/registry/magicui/marquee\";\n\nconst reviews = [\n {\n name: \"Jack\",\n username: \"@jack\",\n body: \"I've never seen anything like this before. It's amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jack\",\n },\n {\n name: \"Jill\",\n username: \"@jill\",\n body: \"I don't know what to say. I'm speechless. This is amazing.\",\n img: \"https://avatar.vercel.sh/jill\",\n },\n {\n name: \"John\",\n username: \"@john\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/john\",\n },\n];\n\nconst firstRow = reviews.slice(0, reviews.length / 2);\nconst secondRow = reviews.slice(reviews.length / 2);\n\nconst ReviewCard = ({\n img,\n name,\n username,\n body,\n}: {\n img: string;\n name: string;\n username: string;\n body: string;\n}) => {\n return (\n <figure\n className={cn(\n \"relative h-full w-fit sm:w-36 cursor-pointer overflow-hidden rounded-xl border p-4\",\n // light styles\n \"border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]\",\n // dark styles\n \"dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]\",\n )}\n >\n <div className=\"flex flex-row items-center gap-2\">\n <img className=\"rounded-full\" width=\"32\" height=\"32\" alt=\"\" src={img} />\n <div className=\"flex flex-col\">\n <figcaption className=\"text-sm font-medium dark:text-white\">\n {name}\n </figcaption>\n <p className=\"text-xs font-medium dark:text-white/40\">{username}</p>\n </div>\n </div>\n <blockquote className=\"mt-2 text-sm\">{body}</blockquote>\n </figure>\n );\n};\n\nexport default function MarqueeDemoVertical() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-row items-center justify-center overflow-hidden\">\n <Marquee pauseOnHover vertical className=\"[--duration:20s]\">\n {firstRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee reverse pauseOnHover vertical className=\"[--duration:20s]\">\n {secondRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <div className=\"pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-gradient-to-b from-background\"></div>\n <div className=\"pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t from-background\"></div>\n </div>\n );\n}\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\nimport { cn } from \"@/lib/utils\"\nimport { Marquee } from \"@/registry/magicui/marquee\"\n\nconst reviews = [\n {\n name: \"Jack\",\n username: \"@jack\",\n body: \"I've never seen anything like this before. It's amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jack\",\n },\n {\n name: \"Jill\",\n username: \"@jill\",\n body: \"I don't know what to say. I'm speechless. This is amazing.\",\n img: \"https://avatar.vercel.sh/jill\",\n },\n {\n name: \"John\",\n username: \"@john\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/john\",\n },\n]\n\nconst firstRow = reviews.slice(0, reviews.length / 2)\nconst secondRow = reviews.slice(reviews.length / 2)\n\nconst ReviewCard = ({\n img,\n name,\n username,\n body,\n}: {\n img: string\n name: string\n username: string\n body: string\n}) => {\n return (\n <figure\n className={cn(\n \"relative h-full w-fit cursor-pointer overflow-hidden rounded-xl border p-4 sm:w-36\",\n // light styles\n \"border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]\",\n // dark styles\n \"dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]\"\n )}\n >\n <div className=\"flex flex-row items-center gap-2\">\n <img className=\"rounded-full\" width=\"32\" height=\"32\" alt=\"\" src={img} />\n <div className=\"flex flex-col\">\n <figcaption className=\"text-sm font-medium dark:text-white\">\n {name}\n </figcaption>\n <p className=\"text-xs font-medium dark:text-white/40\">{username}</p>\n </div>\n </div>\n <blockquote className=\"mt-2 text-sm\">{body}</blockquote>\n </figure>\n )\n}\n\nexport default function MarqueeDemoVertical() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-row items-center justify-center overflow-hidden\">\n <Marquee pauseOnHover vertical className=\"[--duration:20s]\">\n {firstRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee reverse pauseOnHover vertical className=\"[--duration:20s]\">\n {secondRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <div className=\"from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-gradient-to-b\"></div>\n <div className=\"from-background pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t\"></div>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/marquee-demo.json b/apps/www/public/r/marquee-demo.json
index 01c4a00a..fc19eb4c 100644
--- a/apps/www/public/r/marquee-demo.json
+++ b/apps/www/public/r/marquee-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/marquee-demo.tsx",
- "content": "import { cn } from \"@/lib/utils\";\nimport { Marquee } from \"@/registry/magicui/marquee\";\n\nconst reviews = [\n {\n name: \"Jack\",\n username: \"@jack\",\n body: \"I've never seen anything like this before. It's amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jack\",\n },\n {\n name: \"Jill\",\n username: \"@jill\",\n body: \"I don't know what to say. I'm speechless. This is amazing.\",\n img: \"https://avatar.vercel.sh/jill\",\n },\n {\n name: \"John\",\n username: \"@john\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/john\",\n },\n {\n name: \"Jane\",\n username: \"@jane\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jane\",\n },\n {\n name: \"Jenny\",\n username: \"@jenny\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jenny\",\n },\n {\n name: \"James\",\n username: \"@james\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/james\",\n },\n];\n\nconst firstRow = reviews.slice(0, reviews.length / 2);\nconst secondRow = reviews.slice(reviews.length / 2);\n\nconst ReviewCard = ({\n img,\n name,\n username,\n body,\n}: {\n img: string;\n name: string;\n username: string;\n body: string;\n}) => {\n return (\n <figure\n className={cn(\n \"relative h-full w-64 cursor-pointer overflow-hidden rounded-xl border p-4\",\n // light styles\n \"border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]\",\n // dark styles\n \"dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]\",\n )}\n >\n <div className=\"flex flex-row items-center gap-2\">\n <img className=\"rounded-full\" width=\"32\" height=\"32\" alt=\"\" src={img} />\n <div className=\"flex flex-col\">\n <figcaption className=\"text-sm font-medium dark:text-white\">\n {name}\n </figcaption>\n <p className=\"text-xs font-medium dark:text-white/40\">{username}</p>\n </div>\n </div>\n <blockquote className=\"mt-2 text-sm\">{body}</blockquote>\n </figure>\n );\n};\n\nexport default function MarqueeDemo() {\n return (\n <div className=\"relative flex w-full flex-col items-center justify-center overflow-hidden\">\n <Marquee pauseOnHover className=\"[--duration:20s]\">\n {firstRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee reverse pauseOnHover className=\"[--duration:20s]\">\n {secondRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <div className=\"pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r from-background\"></div>\n <div className=\"pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l from-background\"></div>\n </div>\n );\n}\n",
+ "content": "import { cn } from \"@/lib/utils\"\nimport { Marquee } from \"@/registry/magicui/marquee\"\n\nconst reviews = [\n {\n name: \"Jack\",\n username: \"@jack\",\n body: \"I've never seen anything like this before. It's amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jack\",\n },\n {\n name: \"Jill\",\n username: \"@jill\",\n body: \"I don't know what to say. I'm speechless. This is amazing.\",\n img: \"https://avatar.vercel.sh/jill\",\n },\n {\n name: \"John\",\n username: \"@john\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/john\",\n },\n {\n name: \"Jane\",\n username: \"@jane\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jane\",\n },\n {\n name: \"Jenny\",\n username: \"@jenny\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/jenny\",\n },\n {\n name: \"James\",\n username: \"@james\",\n body: \"I'm at a loss for words. This is amazing. I love it.\",\n img: \"https://avatar.vercel.sh/james\",\n },\n]\n\nconst firstRow = reviews.slice(0, reviews.length / 2)\nconst secondRow = reviews.slice(reviews.length / 2)\n\nconst ReviewCard = ({\n img,\n name,\n username,\n body,\n}: {\n img: string\n name: string\n username: string\n body: string\n}) => {\n return (\n <figure\n className={cn(\n \"relative h-full w-64 cursor-pointer overflow-hidden rounded-xl border p-4\",\n // light styles\n \"border-gray-950/[.1] bg-gray-950/[.01] hover:bg-gray-950/[.05]\",\n // dark styles\n \"dark:border-gray-50/[.1] dark:bg-gray-50/[.10] dark:hover:bg-gray-50/[.15]\"\n )}\n >\n <div className=\"flex flex-row items-center gap-2\">\n <img className=\"rounded-full\" width=\"32\" height=\"32\" alt=\"\" src={img} />\n <div className=\"flex flex-col\">\n <figcaption className=\"text-sm font-medium dark:text-white\">\n {name}\n </figcaption>\n <p className=\"text-xs font-medium dark:text-white/40\">{username}</p>\n </div>\n </div>\n <blockquote className=\"mt-2 text-sm\">{body}</blockquote>\n </figure>\n )\n}\n\nexport default function MarqueeDemo() {\n return (\n <div className=\"relative flex w-full flex-col items-center justify-center overflow-hidden\">\n <Marquee pauseOnHover className=\"[--duration:20s]\">\n {firstRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <Marquee reverse pauseOnHover className=\"[--duration:20s]\">\n {secondRow.map((review) => (\n <ReviewCard key={review.username} {...review} />\n ))}\n </Marquee>\n <div className=\"from-background pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r\"></div>\n <div className=\"from-background pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l\"></div>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/marquee-logos.json b/apps/www/public/r/marquee-logos.json
index ffc81553..12881c71 100644
--- a/apps/www/public/r/marquee-logos.json
+++ b/apps/www/public/r/marquee-logos.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/marquee-logos.tsx",
- "content": "import { cn } from \"@/lib/utils\";\nimport { Marquee } from \"@/registry/magicui/marquee\";\n\nconst logos = [\n {\n name: \"Microsoft\",\n img: \"https://cdn.simpleicons.org/microsoft/000/fff\",\n },\n {\n name: \"Apple\",\n img: \"https://cdn.simpleicons.org/apple/000/fff\",\n },\n {\n name: \"Google\",\n img: \"https://cdn.simpleicons.org/google/000/fff\",\n },\n {\n name: \"Facebook\",\n img: \"https://cdn.simpleicons.org/facebook/000/fff\",\n },\n {\n name: \"LinkedIn\",\n img: \"https://cdn.simpleicons.org/linkedin/000/fff\",\n },\n {\n name: \"Twitter\",\n img: \"https://cdn.simpleicons.org/twitter/000/fff\",\n },\n];\n\nconst Logo = ({ name, img }: { name: string; img: string }) => {\n return (\n <div className={cn(\"size-12 cursor-pointer\")}>\n <img src={img} alt={name} />\n </div>\n );\n};\n\nexport default function MarqueeLogos() {\n return (\n <div className=\"relative flex size-full flex-col items-center justify-center gap-4 overflow-hidden rounded-lg border bg-background py-20 md:shadow-xl\">\n <Marquee className=\"[--gap:3rem]\">\n {logos.map((logo, idx) => (\n <Logo key={idx} {...logo} />\n ))}\n </Marquee>\n <div className=\"pointer-events-none absolute inset-y-0 left-0 w-1/3 bg-gradient-to-r from-white dark:from-background\"></div>\n <div className=\"pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l from-white dark:from-background\"></div>\n </div>\n );\n}\n",
+ "content": "import { cn } from \"@/lib/utils\"\nimport { Marquee } from \"@/registry/magicui/marquee\"\n\nconst logos = [\n {\n name: \"Microsoft\",\n img: \"https://cdn.simpleicons.org/microsoft/000/fff\",\n },\n {\n name: \"Apple\",\n img: \"https://cdn.simpleicons.org/apple/000/fff\",\n },\n {\n name: \"Google\",\n img: \"https://cdn.simpleicons.org/google/000/fff\",\n },\n {\n name: \"Facebook\",\n img: \"https://cdn.simpleicons.org/facebook/000/fff\",\n },\n {\n name: \"LinkedIn\",\n img: \"https://cdn.simpleicons.org/linkedin/000/fff\",\n },\n {\n name: \"Twitter\",\n img: \"https://cdn.simpleicons.org/twitter/000/fff\",\n },\n]\n\nconst Logo = ({ name, img }: { name: string; img: string }) => {\n return (\n <div className={cn(\"size-12 cursor-pointer\")}>\n <img src={img} alt={name} />\n </div>\n )\n}\n\nexport default function MarqueeLogos() {\n return (\n <div className=\"bg-background relative flex size-full flex-col items-center justify-center gap-4 overflow-hidden rounded-lg border py-20 md:shadow-xl\">\n <Marquee className=\"[--gap:3rem]\">\n {logos.map((logo, idx) => (\n <Logo key={idx} {...logo} />\n ))}\n </Marquee>\n <div className=\"dark:from-background pointer-events-none absolute inset-y-0 left-0 w-1/3 bg-gradient-to-r from-white\"></div>\n <div className=\"dark:from-background pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l from-white\"></div>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/marquee.json b/apps/www/public/r/marquee.json
index 425a8821..f83f6e70 100644
--- a/apps/www/public/r/marquee.json
+++ b/apps/www/public/r/marquee.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/marquee.tsx",
- "content": "import { cn } from \"@/lib/utils\";\nimport { ComponentPropsWithoutRef } from \"react\";\n\ninterface MarqueeProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string;\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean;\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean;\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode;\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean;\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number;\n}\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n ...props\n}: MarqueeProps) {\n return (\n <div\n {...props}\n className={cn(\n \"group flex overflow-hidden p-2 [--duration:40s] [--gap:1rem] [gap:var(--gap)]\",\n {\n \"flex-row\": !vertical,\n \"flex-col\": vertical,\n },\n className,\n )}\n >\n {Array(repeat)\n .fill(0)\n .map((_, i) => (\n <div\n key={i}\n className={cn(\"flex shrink-0 justify-around [gap:var(--gap)]\", {\n \"animate-marquee flex-row\": !vertical,\n \"animate-marquee-vertical flex-col\": vertical,\n \"group-hover:[animation-play-state:paused]\": pauseOnHover,\n \"[animation-direction:reverse]\": reverse,\n })}\n >\n {children}\n </div>\n ))}\n </div>\n );\n}\n",
+ "content": "import { ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MarqueeProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number\n}\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n ...props\n}: MarqueeProps) {\n return (\n <div\n {...props}\n className={cn(\n \"group flex [gap:var(--gap)] overflow-hidden p-2 [--duration:40s] [--gap:1rem]\",\n {\n \"flex-row\": !vertical,\n \"flex-col\": vertical,\n },\n className\n )}\n >\n {Array(repeat)\n .fill(0)\n .map((_, i) => (\n <div\n key={i}\n className={cn(\"flex shrink-0 justify-around [gap:var(--gap)]\", {\n \"animate-marquee flex-row\": !vertical,\n \"animate-marquee-vertical flex-col\": vertical,\n \"group-hover:[animation-play-state:paused]\": pauseOnHover,\n \"[animation-direction:reverse]\": reverse,\n })}\n >\n {children}\n </div>\n ))}\n </div>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/meteors-demo.json b/apps/www/public/r/meteors-demo.json
index 790e0a6b..a58e4c50 100644
--- a/apps/www/public/r/meteors-demo.json
+++ b/apps/www/public/r/meteors-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/meteors-demo.tsx",
- "content": "import { Meteors } from \"@/registry/magicui/meteors\";\n\nexport default function MeteorDemo() {\n return (\n <div className=\"relative overflow-hidden h-[500px] w-full\">\n <Meteors number={30} />\n </div>\n );\n}\n",
+ "content": "import { Meteors } from \"@/registry/magicui/meteors\"\n\nexport default function MeteorDemo() {\n return (\n <div className=\"relative h-[500px] w-full overflow-hidden\">\n <Meteors number={30} />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/meteors.json b/apps/www/public/r/meteors.json
index 2726c13b..a1c299aa 100644
--- a/apps/www/public/r/meteors.json
+++ b/apps/www/public/r/meteors.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/meteors.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface MeteorsProps {\n number?: number;\n minDelay?: number;\n maxDelay?: number;\n minDuration?: number;\n maxDuration?: number;\n angle?: number;\n className?: string;\n}\n\nexport const Meteors = ({\n number = 20,\n minDelay = 0.2,\n maxDelay = 1.2,\n minDuration = 2,\n maxDuration = 10,\n angle = 215,\n className,\n}: MeteorsProps) => {\n const [meteorStyles, setMeteorStyles] = useState<Array<React.CSSProperties>>(\n [],\n );\n\n useEffect(() => {\n const styles = [...new Array(number)].map(() => ({\n \"--angle\": -angle + \"deg\",\n top: \"-5%\",\n left: `calc(0% + ${Math.floor(Math.random() * window.innerWidth)}px)`,\n animationDelay: Math.random() * (maxDelay - minDelay) + minDelay + \"s\",\n animationDuration:\n Math.floor(Math.random() * (maxDuration - minDuration) + minDuration) +\n \"s\",\n }));\n setMeteorStyles(styles);\n }, [number, minDelay, maxDelay, minDuration, maxDuration, angle]);\n\n return (\n <>\n {[...meteorStyles].map((style, idx) => (\n // Meteor Head\n <span\n key={idx}\n style={{ ...style }}\n className={cn(\n \"pointer-events-none absolute size-0.5 rotate-[var(--angle)] animate-meteor rounded-full bg-zinc-500 shadow-[0_0_0_1px_#ffffff10]\",\n className,\n )}\n >\n {/* Meteor Tail */}\n <div className=\"pointer-events-none absolute top-1/2 -z-10 h-px w-[50px] -translate-y-1/2 bg-gradient-to-r from-zinc-500 to-transparent\" />\n </span>\n ))}\n </>\n );\n};\n",
+ "content": "\"use client\"\n\nimport React, { useEffect, useState } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MeteorsProps {\n number?: number\n minDelay?: number\n maxDelay?: number\n minDuration?: number\n maxDuration?: number\n angle?: number\n className?: string\n}\n\nexport const Meteors = ({\n number = 20,\n minDelay = 0.2,\n maxDelay = 1.2,\n minDuration = 2,\n maxDuration = 10,\n angle = 215,\n className,\n}: MeteorsProps) => {\n const [meteorStyles, setMeteorStyles] = useState<Array<React.CSSProperties>>(\n []\n )\n\n useEffect(() => {\n const styles = [...new Array(number)].map(() => ({\n \"--angle\": -angle + \"deg\",\n top: \"-5%\",\n left: `calc(0% + ${Math.floor(Math.random() * window.innerWidth)}px)`,\n animationDelay: Math.random() * (maxDelay - minDelay) + minDelay + \"s\",\n animationDuration:\n Math.floor(Math.random() * (maxDuration - minDuration) + minDuration) +\n \"s\",\n }))\n setMeteorStyles(styles)\n }, [number, minDelay, maxDelay, minDuration, maxDuration, angle])\n\n return (\n <>\n {[...meteorStyles].map((style, idx) => (\n // Meteor Head\n <span\n key={idx}\n style={{ ...style }}\n className={cn(\n \"animate-meteor pointer-events-none absolute size-0.5 rotate-[var(--angle)] rounded-full bg-zinc-500 shadow-[0_0_0_1px_#ffffff10]\",\n className\n )}\n >\n {/* Meteor Tail */}\n <div className=\"pointer-events-none absolute top-1/2 -z-10 h-px w-[50px] -translate-y-1/2 bg-gradient-to-r from-zinc-500 to-transparent\" />\n </span>\n ))}\n </>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/morphing-text-demo.json b/apps/www/public/r/morphing-text-demo.json
index 1dbf4c9b..48b5174c 100644
--- a/apps/www/public/r/morphing-text-demo.json
+++ b/apps/www/public/r/morphing-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/morphing-text-demo.tsx",
- "content": "import { MorphingText } from \"@/registry/magicui/morphing-text\";\n\nconst texts = [\n \"Hello\",\n \"Morphing\",\n \"Text\",\n \"Animation\",\n \"React\",\n \"Component\",\n \"Smooth\",\n \"Transition\",\n \"Engaging\",\n];\n\nexport default function MorphingTextDemo() {\n return <MorphingText texts={texts} />;\n}\n",
+ "content": "import { MorphingText } from \"@/registry/magicui/morphing-text\"\n\nconst texts = [\n \"Hello\",\n \"Morphing\",\n \"Text\",\n \"Animation\",\n \"React\",\n \"Component\",\n \"Smooth\",\n \"Transition\",\n \"Engaging\",\n]\n\nexport default function MorphingTextDemo() {\n return <MorphingText texts={texts} />\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/morphing-text.json b/apps/www/public/r/morphing-text.json
index 2b1f2209..9ca24e51 100644
--- a/apps/www/public/r/morphing-text.json
+++ b/apps/www/public/r/morphing-text.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/morphing-text.tsx",
- "content": "\"use client\";\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst morphTime = 1.5;\nconst cooldownTime = 0.5;\n\nconst useMorphingText = (texts: string[]) => {\n const textIndexRef = useRef(0);\n const morphRef = useRef(0);\n const cooldownRef = useRef(0);\n const timeRef = useRef(new Date());\n\n const text1Ref = useRef<HTMLSpanElement>(null);\n const text2Ref = useRef<HTMLSpanElement>(null);\n\n const setStyles = useCallback(\n (fraction: number) => {\n const [current1, current2] = [text1Ref.current, text2Ref.current];\n if (!current1 || !current2) return;\n\n current2.style.filter = `blur(${Math.min(8 / fraction - 8, 100)}px)`;\n current2.style.opacity = `${Math.pow(fraction, 0.4) * 100}%`;\n\n const invertedFraction = 1 - fraction;\n current1.style.filter = `blur(${Math.min(\n 8 / invertedFraction - 8,\n 100,\n )}px)`;\n current1.style.opacity = `${Math.pow(invertedFraction, 0.4) * 100}%`;\n\n current1.textContent = texts[textIndexRef.current % texts.length];\n current2.textContent = texts[(textIndexRef.current + 1) % texts.length];\n },\n [texts],\n );\n\n const doMorph = useCallback(() => {\n morphRef.current -= cooldownRef.current;\n cooldownRef.current = 0;\n\n let fraction = morphRef.current / morphTime;\n\n if (fraction > 1) {\n cooldownRef.current = cooldownTime;\n fraction = 1;\n }\n\n setStyles(fraction);\n\n if (fraction === 1) {\n textIndexRef.current++;\n }\n }, [setStyles]);\n\n const doCooldown = useCallback(() => {\n morphRef.current = 0;\n const [current1, current2] = [text1Ref.current, text2Ref.current];\n if (current1 && current2) {\n current2.style.filter = \"none\";\n current2.style.opacity = \"100%\";\n current1.style.filter = \"none\";\n current1.style.opacity = \"0%\";\n }\n }, []);\n\n useEffect(() => {\n let animationFrameId: number;\n\n const animate = () => {\n animationFrameId = requestAnimationFrame(animate);\n\n const newTime = new Date();\n const dt = (newTime.getTime() - timeRef.current.getTime()) / 1000;\n timeRef.current = newTime;\n\n cooldownRef.current -= dt;\n\n if (cooldownRef.current <= 0) doMorph();\n else doCooldown();\n };\n\n animate();\n return () => {\n cancelAnimationFrame(animationFrameId);\n };\n }, [doMorph, doCooldown]);\n\n return { text1Ref, text2Ref };\n};\n\ninterface MorphingTextProps {\n className?: string;\n texts: string[];\n}\n\nconst Texts: React.FC<Pick<MorphingTextProps, \"texts\">> = ({ texts }) => {\n const { text1Ref, text2Ref } = useMorphingText(texts);\n return (\n <>\n <span\n className=\"absolute inset-x-0 top-0 m-auto inline-block w-full\"\n ref={text1Ref}\n />\n <span\n className=\"absolute inset-x-0 top-0 m-auto inline-block w-full\"\n ref={text2Ref}\n />\n </>\n );\n};\n\nconst SvgFilters: React.FC = () => (\n <svg\n id=\"filters\"\n className=\"fixed h-0 w-0\"\n preserveAspectRatio=\"xMidYMid slice\"\n >\n <defs>\n <filter id=\"threshold\">\n <feColorMatrix\n in=\"SourceGraphic\"\n type=\"matrix\"\n values=\"1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 255 -140\"\n />\n </filter>\n </defs>\n </svg>\n);\n\nexport const MorphingText: React.FC<MorphingTextProps> = ({\n texts,\n className,\n}) => (\n <div\n className={cn(\n \"relative mx-auto h-16 w-full max-w-screen-md text-center font-sans text-[40pt] font-bold leading-none [filter:url(#threshold)_blur(0.6px)] md:h-24 lg:text-[6rem]\",\n className,\n )}\n >\n <Texts texts={texts} />\n <SvgFilters />\n </div>\n);\n",
+ "content": "\"use client\"\n\nimport { useCallback, useEffect, useRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst morphTime = 1.5\nconst cooldownTime = 0.5\n\nconst useMorphingText = (texts: string[]) => {\n const textIndexRef = useRef(0)\n const morphRef = useRef(0)\n const cooldownRef = useRef(0)\n const timeRef = useRef(new Date())\n\n const text1Ref = useRef<HTMLSpanElement>(null)\n const text2Ref = useRef<HTMLSpanElement>(null)\n\n const setStyles = useCallback(\n (fraction: number) => {\n const [current1, current2] = [text1Ref.current, text2Ref.current]\n if (!current1 || !current2) return\n\n current2.style.filter = `blur(${Math.min(8 / fraction - 8, 100)}px)`\n current2.style.opacity = `${Math.pow(fraction, 0.4) * 100}%`\n\n const invertedFraction = 1 - fraction\n current1.style.filter = `blur(${Math.min(\n 8 / invertedFraction - 8,\n 100\n )}px)`\n current1.style.opacity = `${Math.pow(invertedFraction, 0.4) * 100}%`\n\n current1.textContent = texts[textIndexRef.current % texts.length]\n current2.textContent = texts[(textIndexRef.current + 1) % texts.length]\n },\n [texts]\n )\n\n const doMorph = useCallback(() => {\n morphRef.current -= cooldownRef.current\n cooldownRef.current = 0\n\n let fraction = morphRef.current / morphTime\n\n if (fraction > 1) {\n cooldownRef.current = cooldownTime\n fraction = 1\n }\n\n setStyles(fraction)\n\n if (fraction === 1) {\n textIndexRef.current++\n }\n }, [setStyles])\n\n const doCooldown = useCallback(() => {\n morphRef.current = 0\n const [current1, current2] = [text1Ref.current, text2Ref.current]\n if (current1 && current2) {\n current2.style.filter = \"none\"\n current2.style.opacity = \"100%\"\n current1.style.filter = \"none\"\n current1.style.opacity = \"0%\"\n }\n }, [])\n\n useEffect(() => {\n let animationFrameId: number\n\n const animate = () => {\n animationFrameId = requestAnimationFrame(animate)\n\n const newTime = new Date()\n const dt = (newTime.getTime() - timeRef.current.getTime()) / 1000\n timeRef.current = newTime\n\n cooldownRef.current -= dt\n\n if (cooldownRef.current <= 0) doMorph()\n else doCooldown()\n }\n\n animate()\n return () => {\n cancelAnimationFrame(animationFrameId)\n }\n }, [doMorph, doCooldown])\n\n return { text1Ref, text2Ref }\n}\n\ninterface MorphingTextProps {\n className?: string\n texts: string[]\n}\n\nconst Texts: React.FC<Pick<MorphingTextProps, \"texts\">> = ({ texts }) => {\n const { text1Ref, text2Ref } = useMorphingText(texts)\n return (\n <>\n <span\n className=\"absolute inset-x-0 top-0 m-auto inline-block w-full\"\n ref={text1Ref}\n />\n <span\n className=\"absolute inset-x-0 top-0 m-auto inline-block w-full\"\n ref={text2Ref}\n />\n </>\n )\n}\n\nconst SvgFilters: React.FC = () => (\n <svg\n id=\"filters\"\n className=\"fixed h-0 w-0\"\n preserveAspectRatio=\"xMidYMid slice\"\n >\n <defs>\n <filter id=\"threshold\">\n <feColorMatrix\n in=\"SourceGraphic\"\n type=\"matrix\"\n values=\"1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 255 -140\"\n />\n </filter>\n </defs>\n </svg>\n)\n\nexport const MorphingText: React.FC<MorphingTextProps> = ({\n texts,\n className,\n}) => (\n <div\n className={cn(\n \"relative mx-auto h-16 w-full max-w-screen-md text-center font-sans text-[40pt] leading-none font-bold [filter:url(#threshold)_blur(0.6px)] md:h-24 lg:text-[6rem]\",\n className\n )}\n >\n <Texts texts={texts} />\n <SvgFilters />\n </div>\n)\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/neon-gradient-card-demo.json b/apps/www/public/r/neon-gradient-card-demo.json
index 2f59f30d..87d07184 100644
--- a/apps/www/public/r/neon-gradient-card-demo.json
+++ b/apps/www/public/r/neon-gradient-card-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/neon-gradient-card-demo.tsx",
- "content": "import { NeonGradientCard } from \"@/registry/magicui/neon-gradient-card\";\n\nexport default function NeonGradientCardDemo() {\n return (\n <NeonGradientCard className=\"max-w-sm items-center justify-center text-center\">\n <span className=\"pointer-events-none z-10 h-full whitespace-pre-wrap bg-gradient-to-br from-[#ff2975] from-35% to-[#00FFF1] bg-clip-text text-center text-3xl md:text-5xl xl:text-6xl font-bold leading-none tracking-tighter text-balance text-transparent dark:drop-shadow-[0_5px_5px_rgba(0,0,0,0.8)]\">\n Neon Gradient Card\n </span>\n </NeonGradientCard>\n );\n}\n",
+ "content": "import { NeonGradientCard } from \"@/registry/magicui/neon-gradient-card\"\n\nexport default function NeonGradientCardDemo() {\n return (\n <NeonGradientCard className=\"max-w-sm items-center justify-center text-center\">\n <span className=\"pointer-events-none z-10 h-full bg-gradient-to-br from-[#ff2975] from-35% to-[#00FFF1] bg-clip-text text-center text-3xl leading-none font-bold tracking-tighter text-balance whitespace-pre-wrap text-transparent md:text-5xl xl:text-6xl dark:drop-shadow-[0_5px_5px_rgba(0,0,0,0.8)]\">\n Neon Gradient Card\n </span>\n </NeonGradientCard>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/neon-gradient-card.json b/apps/www/public/r/neon-gradient-card.json
index 486bb1d7..c69abe57 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 {\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 [key: string]: any;\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-[var(--border-radius)]\",\n className,\n )}\n {...props}\n >\n <div\n className={cn(\n \"relative size-full min-h-[inherit] rounded-[var(--card-content-radius)] bg-gray-100 p-6\",\n \"before:absolute before:-left-[var(--border-size)] before:-top-[var(--border-size)] before:-z-10 before:block\",\n \"before:h-[var(--pseudo-element-height)] before:w-[var(--pseudo-element-width)] before:rounded-[var(--border-radius)] before:content-['']\",\n \"before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-[length:100%_200%]\",\n \"before:animate-background-position-spin\",\n \"after:absolute after:-left-[var(--border-size)] after:-top-[var(--border-size)] after:-z-10 after:block\",\n \"after:h-[var(--pseudo-element-height)] after:w-[var(--pseudo-element-width)] after:rounded-[var(--border-radius)] after:blur-[var(--after-blur)] after:content-['']\",\n \"after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-[length:100%_200%] after:opacity-80\",\n \"after:animate-background-position-spin\",\n \"dark:bg-neutral-900\",\n \"break-words\",\n )}\n >\n {children}\n </div>\n </div>\n );\n};\n",
+ "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 {\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 [key: string]: any\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-[var(--border-radius)]\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"relative size-full min-h-[inherit] rounded-[var(--card-content-radius)] bg-gray-100 p-6\",\n \"before:absolute before:-top-[var(--border-size)] before:-left-[var(--border-size)] before:-z-10 before:block\",\n \"before:h-[var(--pseudo-element-height)] before:w-[var(--pseudo-element-width)] before:rounded-[var(--border-radius)] before:content-['']\",\n \"before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-[length:100%_200%]\",\n \"before:animate-background-position-spin\",\n \"after:absolute after:-top-[var(--border-size)] after:-left-[var(--border-size)] after:-z-10 after:block\",\n \"after:h-[var(--pseudo-element-height)] after:w-[var(--pseudo-element-width)] after:rounded-[var(--border-radius)] after:blur-[var(--after-blur)] after:content-['']\",\n \"after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-[length:100%_200%] after:opacity-80\",\n \"after:animate-background-position-spin\",\n \"dark:bg-neutral-900\",\n \"break-words\"\n )}\n >\n {children}\n </div>\n </div>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/number-ticker-decimal-demo.json b/apps/www/public/r/number-ticker-decimal-demo.json
index c803b334..ad8bb634 100644
--- a/apps/www/public/r/number-ticker-decimal-demo.json
+++ b/apps/www/public/r/number-ticker-decimal-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/number-ticker-decimal-demo.tsx",
- "content": "import { NumberTicker } from \"@/registry/magicui/number-ticker\";\n\nexport default function NumberTickerDemo() {\n return (\n <NumberTicker\n value={5.67}\n decimalPlaces={2}\n className=\"whitespace-pre-wrap text-8xl font-medium tracking-tighter text-black dark:text-white\"\n />\n );\n}\n",
+ "content": "import { NumberTicker } from \"@/registry/magicui/number-ticker\"\n\nexport default function NumberTickerDemo() {\n return (\n <NumberTicker\n value={5.67}\n decimalPlaces={2}\n className=\"text-8xl font-medium tracking-tighter whitespace-pre-wrap text-black dark:text-white\"\n />\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/number-ticker-demo-2.json b/apps/www/public/r/number-ticker-demo-2.json
index d70831a2..757e04d3 100644
--- a/apps/www/public/r/number-ticker-demo-2.json
+++ b/apps/www/public/r/number-ticker-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/number-ticker-demo-2.tsx",
- "content": "import { NumberTicker } from \"@/registry/magicui/number-ticker\";\n\nexport default function NumberTickerDemo() {\n return (\n <NumberTicker\n value={100}\n startValue={80}\n className=\"whitespace-pre-wrap text-8xl font-medium tracking-tighter text-black dark:text-white\"\n />\n );\n}\n",
+ "content": "import { NumberTicker } from \"@/registry/magicui/number-ticker\"\n\nexport default function NumberTickerDemo() {\n return (\n <NumberTicker\n value={100}\n startValue={80}\n className=\"text-8xl font-medium tracking-tighter whitespace-pre-wrap text-black dark:text-white\"\n />\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/number-ticker-demo.json b/apps/www/public/r/number-ticker-demo.json
index 61329ff1..48b7b056 100644
--- a/apps/www/public/r/number-ticker-demo.json
+++ b/apps/www/public/r/number-ticker-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/number-ticker-demo.tsx",
- "content": "import { NumberTicker } from \"@/registry/magicui/number-ticker\";\n\nexport default function NumberTickerDemo() {\n return (\n <NumberTicker\n value={100}\n className=\"whitespace-pre-wrap text-8xl font-medium tracking-tighter text-black dark:text-white\"\n />\n );\n}\n",
+ "content": "import { NumberTicker } from \"@/registry/magicui/number-ticker\"\n\nexport default function NumberTickerDemo() {\n return (\n <NumberTicker\n value={100}\n className=\"text-8xl font-medium tracking-tighter whitespace-pre-wrap text-black dark:text-white\"\n />\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/number-ticker.json b/apps/www/public/r/number-ticker.json
index eb8bf2d9..b0af0b47 100644
--- a/apps/www/public/r/number-ticker.json
+++ b/apps/www/public/r/number-ticker.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/number-ticker.tsx",
- "content": "\"use client\";\n\nimport { useInView, useMotionValue, useSpring } from \"motion/react\";\nimport { ComponentPropsWithoutRef, useEffect, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface NumberTickerProps extends ComponentPropsWithoutRef<\"span\"> {\n value: number;\n startValue?: number;\n direction?: \"up\" | \"down\";\n delay?: number;\n decimalPlaces?: number;\n}\n\nexport function NumberTicker({\n value,\n startValue = 0,\n direction = \"up\",\n delay = 0,\n className,\n decimalPlaces = 0,\n ...props\n}: NumberTickerProps) {\n const ref = useRef<HTMLSpanElement>(null);\n const motionValue = useMotionValue(direction === \"down\" ? value : startValue);\n const springValue = useSpring(motionValue, {\n damping: 60,\n stiffness: 100,\n });\n const isInView = useInView(ref, { once: true, margin: \"0px\" });\n\n useEffect(() => {\n if (isInView) {\n const timer = setTimeout(() => {\n motionValue.set(direction === \"down\" ? startValue : value);\n }, delay * 1000);\n return () => clearTimeout(timer);\n }\n }, [motionValue, isInView, delay, value, direction, startValue]);\n\n useEffect(\n () =>\n springValue.on(\"change\", (latest) => {\n if (ref.current) {\n ref.current.textContent = Intl.NumberFormat(\"en-US\", {\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces,\n }).format(Number(latest.toFixed(decimalPlaces)));\n }\n }),\n [springValue, decimalPlaces],\n );\n\n return (\n <span\n ref={ref}\n className={cn(\n \"inline-block tabular-nums tracking-wider text-black dark:text-white\",\n className,\n )}\n {...props}\n >\n {startValue}\n </span>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { ComponentPropsWithoutRef, useEffect, useRef } from \"react\"\nimport { useInView, useMotionValue, useSpring } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface NumberTickerProps extends ComponentPropsWithoutRef<\"span\"> {\n value: number\n startValue?: number\n direction?: \"up\" | \"down\"\n delay?: number\n decimalPlaces?: number\n}\n\nexport function NumberTicker({\n value,\n startValue = 0,\n direction = \"up\",\n delay = 0,\n className,\n decimalPlaces = 0,\n ...props\n}: NumberTickerProps) {\n const ref = useRef<HTMLSpanElement>(null)\n const motionValue = useMotionValue(direction === \"down\" ? value : startValue)\n const springValue = useSpring(motionValue, {\n damping: 60,\n stiffness: 100,\n })\n const isInView = useInView(ref, { once: true, margin: \"0px\" })\n\n useEffect(() => {\n if (isInView) {\n const timer = setTimeout(() => {\n motionValue.set(direction === \"down\" ? startValue : value)\n }, delay * 1000)\n return () => clearTimeout(timer)\n }\n }, [motionValue, isInView, delay, value, direction, startValue])\n\n useEffect(\n () =>\n springValue.on(\"change\", (latest) => {\n if (ref.current) {\n ref.current.textContent = Intl.NumberFormat(\"en-US\", {\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces,\n }).format(Number(latest.toFixed(decimalPlaces)))\n }\n }),\n [springValue, decimalPlaces]\n )\n\n return (\n <span\n ref={ref}\n className={cn(\n \"inline-block tracking-wider text-black tabular-nums dark:text-white\",\n className\n )}\n {...props}\n >\n {startValue}\n </span>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/orbiting-circles-demo.json b/apps/www/public/r/orbiting-circles-demo.json
index 85460c52..0aeb2c17 100644
--- a/apps/www/public/r/orbiting-circles-demo.json
+++ b/apps/www/public/r/orbiting-circles-demo.json
@@ -13,7 +13,7 @@
"files": [
{
"path": "registry/example/orbiting-circles-demo.tsx",
- "content": "import { OrbitingCircles } from \"@/registry/magicui/orbiting-circles\";\n\nexport default function OrbitingCirclesDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden\">\n <OrbitingCircles iconSize={40}>\n <Icons.whatsapp />\n <Icons.notion />\n <Icons.openai />\n <Icons.googleDrive />\n <Icons.whatsapp />\n </OrbitingCircles>\n <OrbitingCircles iconSize={30} radius={100} reverse speed={2}>\n <Icons.whatsapp />\n <Icons.notion />\n <Icons.openai />\n <Icons.googleDrive />\n </OrbitingCircles>\n </div>\n );\n}\n\nconst Icons = {\n gitHub: () => (\n <svg width=\"100\" height=\"100\" viewBox=\"0 0 438.549 438.549\">\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n />\n </svg>\n ),\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"fill-black dark:fill-white\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n};\n",
+ "content": "import { OrbitingCircles } from \"@/registry/magicui/orbiting-circles\"\n\nexport default function OrbitingCirclesDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden\">\n <OrbitingCircles iconSize={40}>\n <Icons.whatsapp />\n <Icons.notion />\n <Icons.openai />\n <Icons.googleDrive />\n <Icons.whatsapp />\n </OrbitingCircles>\n <OrbitingCircles iconSize={30} radius={100} reverse speed={2}>\n <Icons.whatsapp />\n <Icons.notion />\n <Icons.openai />\n <Icons.googleDrive />\n </OrbitingCircles>\n </div>\n )\n}\n\nconst Icons = {\n gitHub: () => (\n <svg width=\"100\" height=\"100\" viewBox=\"0 0 438.549 438.549\">\n <path\n fill=\"currentColor\"\n d=\"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z\"\n />\n </svg>\n ),\n notion: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6.017 4.313l55.333 -4.087c6.797 -0.583 8.543 -0.19 12.817 2.917l17.663 12.443c2.913 2.14 3.883 2.723 3.883 5.053v68.243c0 4.277 -1.553 6.807 -6.99 7.193L24.467 99.967c-4.08 0.193 -6.023 -0.39 -8.16 -3.113L3.3 79.94c-2.333 -3.113 -3.3 -5.443 -3.3 -8.167V11.113c0 -3.497 1.553 -6.413 6.017 -6.8z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M61.35 0.227l-55.333 4.087C1.553 4.7 0 7.617 0 11.113v60.66c0 2.723 0.967 5.053 3.3 8.167l13.007 16.913c2.137 2.723 4.08 3.307 8.16 3.113l64.257 -3.89c5.433 -0.387 6.99 -2.917 6.99 -7.193V20.64c0 -2.21 -0.873 -2.847 -3.443 -4.733L74.167 3.143c-4.273 -3.107 -6.02 -3.5 -12.817 -2.917zM25.92 19.523c-5.247 0.353 -6.437 0.433 -9.417 -1.99L8.927 11.507c-0.77 -0.78 -0.383 -1.753 1.557 -1.947l53.193 -3.887c4.467 -0.39 6.793 1.167 8.54 2.527l9.123 6.61c0.39 0.197 1.36 1.36 0.193 1.36l-54.933 3.307 -0.68 0.047zM19.803 88.3V30.367c0 -2.53 0.777 -3.697 3.103 -3.893L86 22.78c2.14 -0.193 3.107 1.167 3.107 3.693v57.547c0 2.53 -0.39 4.67 -3.883 4.863l-60.377 3.5c-3.493 0.193 -5.043 -0.97 -5.043 -4.083zm59.6 -54.827c0.387 1.75 0 3.5 -1.75 3.7l-2.91 0.577v42.773c-2.527 1.36 -4.853 2.137 -6.797 2.137 -3.107 0 -3.883 -0.973 -6.21 -3.887l-19.03 -29.94v28.967l6.02 1.363s0 3.5 -4.857 3.5l-13.39 0.777c-0.39 -0.78 0 -2.723 1.357 -3.11l3.497 -0.97v-38.3L30.48 40.667c-0.39 -1.75 0.58 -4.277 3.3 -4.473l14.367 -0.967 19.8 30.327v-26.83l-5.047 -0.58c-0.39 -2.143 1.163 -3.7 3.103 -3.89l13.4 -0.78z\"\n fill=\"#000000\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n ),\n openai: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"fill-black dark:fill-white\"\n >\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n googleDrive: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 87.3 78\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z\"\n fill=\"#0066da\"\n />\n <path\n d=\"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z\"\n fill=\"#00ac47\"\n />\n <path\n d=\"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z\"\n fill=\"#ea4335\"\n />\n <path\n d=\"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z\"\n fill=\"#00832d\"\n />\n <path\n d=\"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z\"\n fill=\"#2684fc\"\n />\n <path\n d=\"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z\"\n fill=\"#ffba00\"\n />\n </svg>\n ),\n whatsapp: () => (\n <svg\n width=\"100\"\n height=\"100\"\n viewBox=\"0 0 175.216 175.552\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient\n id=\"b\"\n x1=\"85.915\"\n x2=\"86.535\"\n y1=\"32.567\"\n y2=\"137.092\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stopColor=\"#57d163\" />\n <stop offset=\"1\" stopColor=\"#23b33a\" />\n </linearGradient>\n <filter\n id=\"a\"\n width=\"1.115\"\n height=\"1.114\"\n x=\"-.057\"\n y=\"-.057\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation=\"3.531\" />\n </filter>\n </defs>\n <path\n d=\"m54.532 138.45 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.523h.023c33.707 0 61.139-27.426 61.153-61.135.006-16.335-6.349-31.696-17.895-43.251A60.75 60.75 0 0 0 87.94 25.983c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.558zm-40.811 23.544L24.16 123.88c-6.438-11.154-9.825-23.808-9.821-36.772.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954zm0 0\"\n fill=\"#b3b3b3\"\n filter=\"url(#a)\"\n />\n <path\n d=\"m12.966 161.238 10.439-38.114a73.42 73.42 0 0 1-9.821-36.772c.017-40.556 33.021-73.55 73.578-73.55 19.681.01 38.154 7.669 52.047 21.572s21.537 32.383 21.53 52.037c-.018 40.553-33.027 73.553-73.578 73.553h-.032c-12.313-.005-24.412-3.094-35.159-8.954z\"\n fill=\"#ffffff\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.312-6.179 22.559 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.518 31.126 8.524h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.929z\"\n fill=\"url(#linearGradient1780)\"\n />\n <path\n d=\"M87.184 25.227c-33.733 0-61.166 27.423-61.178 61.13a60.98 60.98 0 0 0 9.349 32.535l1.455 2.313-6.179 22.558 23.146-6.069 2.235 1.324c9.387 5.571 20.15 8.517 31.126 8.523h.023c33.707 0 61.14-27.426 61.153-61.135a60.75 60.75 0 0 0-17.895-43.251 60.75 60.75 0 0 0-43.235-17.928z\"\n fill=\"url(#b)\"\n />\n <path\n d=\"M68.772 55.603c-1.378-3.061-2.828-3.123-4.137-3.176l-3.524-.043c-1.226 0-3.218.46-4.902 2.3s-6.435 6.287-6.435 15.332 6.588 17.785 7.506 19.013 12.718 20.381 31.405 27.75c15.529 6.124 18.689 4.906 22.061 4.6s10.877-4.447 12.408-8.74 1.532-7.971 1.073-8.74-1.685-1.226-3.525-2.146-10.877-5.367-12.562-5.981-2.91-.919-4.137.921-4.746 5.979-5.819 7.206-2.144 1.381-3.984.462-7.76-2.861-14.784-9.124c-5.465-4.873-9.154-10.891-10.228-12.73s-.114-2.835.808-3.751c.825-.824 1.838-2.147 2.759-3.22s1.224-1.84 1.836-3.065.307-2.301-.153-3.22-4.032-10.011-5.666-13.647\"\n fill=\"#ffffff\"\n fillRule=\"evenodd\"\n />\n </svg>\n ),\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/orbiting-circles.json b/apps/www/public/r/orbiting-circles.json
index 29a48466..79dc292d 100644
--- a/apps/www/public/r/orbiting-circles.json
+++ b/apps/www/public/r/orbiting-circles.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/orbiting-circles.tsx",
- "content": "import { cn } from \"@/lib/utils\";\nimport React from \"react\";\n\nexport interface OrbitingCirclesProps\n extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n children?: React.ReactNode;\n reverse?: boolean;\n duration?: number;\n delay?: number;\n radius?: number;\n path?: boolean;\n iconSize?: number;\n speed?: number;\n}\n\nexport function OrbitingCircles({\n className,\n children,\n reverse,\n duration = 20,\n radius = 160,\n path = true,\n iconSize = 30,\n speed = 1,\n ...props\n}: OrbitingCirclesProps) {\n const calculatedDuration = duration / speed;\n return (\n <>\n {path && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n version=\"1.1\"\n className=\"pointer-events-none absolute inset-0 size-full\"\n >\n <circle\n className=\"stroke-black/10 stroke-1 dark:stroke-white/10\"\n cx=\"50%\"\n cy=\"50%\"\n r={radius}\n fill=\"none\"\n />\n </svg>\n )}\n {React.Children.map(children, (child, index) => {\n const angle = (360 / React.Children.count(children)) * index;\n return (\n <div\n style={\n {\n \"--duration\": calculatedDuration,\n \"--radius\": radius,\n \"--angle\": angle,\n \"--icon-size\": `${iconSize}px`,\n } as React.CSSProperties\n }\n className={cn(\n `absolute flex size-[var(--icon-size)] transform-gpu animate-orbit items-center justify-center rounded-full`,\n { \"[animation-direction:reverse]\": reverse },\n className,\n )}\n {...props}\n >\n {child}\n </div>\n );\n })}\n </>\n );\n}\n",
+ "content": "import React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface OrbitingCirclesProps\n extends React.HTMLAttributes<HTMLDivElement> {\n className?: string\n children?: React.ReactNode\n reverse?: boolean\n duration?: number\n delay?: number\n radius?: number\n path?: boolean\n iconSize?: number\n speed?: number\n}\n\nexport function OrbitingCircles({\n className,\n children,\n reverse,\n duration = 20,\n radius = 160,\n path = true,\n iconSize = 30,\n speed = 1,\n ...props\n}: OrbitingCirclesProps) {\n const calculatedDuration = duration / speed\n return (\n <>\n {path && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n version=\"1.1\"\n className=\"pointer-events-none absolute inset-0 size-full\"\n >\n <circle\n className=\"stroke-black/10 stroke-1 dark:stroke-white/10\"\n cx=\"50%\"\n cy=\"50%\"\n r={radius}\n fill=\"none\"\n />\n </svg>\n )}\n {React.Children.map(children, (child, index) => {\n const angle = (360 / React.Children.count(children)) * index\n return (\n <div\n style={\n {\n \"--duration\": calculatedDuration,\n \"--radius\": radius,\n \"--angle\": angle,\n \"--icon-size\": `${iconSize}px`,\n } as React.CSSProperties\n }\n className={cn(\n `animate-orbit absolute flex size-[var(--icon-size)] transform-gpu items-center justify-center rounded-full`,\n { \"[animation-direction:reverse]\": reverse },\n className\n )}\n {...props}\n >\n {child}\n </div>\n )\n })}\n </>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/particles-demo.json b/apps/www/public/r/particles-demo.json
index ed83f963..c3fa7396 100644
--- a/apps/www/public/r/particles-demo.json
+++ b/apps/www/public/r/particles-demo.json
@@ -13,7 +13,7 @@
"files": [
{
"path": "registry/example/particles-demo.tsx",
- "content": "\"use client\";\n\nimport { useTheme } from \"next-themes\";\nimport { useEffect, useState } from \"react\";\n\nimport { Particles } from \"@/registry/magicui/particles\";\n\nexport default function ParticlesDemo() {\n const { resolvedTheme } = useTheme();\n const [color, setColor] = useState(\"#ffffff\");\n\n useEffect(() => {\n setColor(resolvedTheme === \"dark\" ? \"#ffffff\" : \"#000000\");\n }, [resolvedTheme]);\n\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <span className=\"pointer-events-none z-10 whitespace-pre-wrap text-center text-8xl font-semibold leading-none\">\n Particles\n </span>\n <Particles\n className=\"absolute inset-0 z-0\"\n quantity={100}\n ease={80}\n color={color}\n refresh\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport { useTheme } from \"next-themes\"\n\nimport { Particles } from \"@/registry/magicui/particles\"\n\nexport default function ParticlesDemo() {\n const { resolvedTheme } = useTheme()\n const [color, setColor] = useState(\"#ffffff\")\n\n useEffect(() => {\n setColor(resolvedTheme === \"dark\" ? \"#ffffff\" : \"#000000\")\n }, [resolvedTheme])\n\n return (\n <div className=\"bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <span className=\"pointer-events-none z-10 text-center text-8xl leading-none font-semibold whitespace-pre-wrap\">\n Particles\n </span>\n <Particles\n className=\"absolute inset-0 z-0\"\n quantity={100}\n ease={80}\n color={color}\n refresh\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/particles.json b/apps/www/public/r/particles.json
index 56e572c1..b089e537 100644
--- a/apps/www/public/r/particles.json
+++ b/apps/www/public/r/particles.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/particles.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport React, {\n ComponentPropsWithoutRef,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\ninterface MousePosition {\n x: number;\n y: number;\n}\n\nfunction MousePosition(): MousePosition {\n const [mousePosition, setMousePosition] = useState<MousePosition>({\n x: 0,\n y: 0,\n });\n\n useEffect(() => {\n const handleMouseMove = (event: MouseEvent) => {\n setMousePosition({ x: event.clientX, y: event.clientY });\n };\n\n window.addEventListener(\"mousemove\", handleMouseMove);\n\n return () => {\n window.removeEventListener(\"mousemove\", handleMouseMove);\n };\n }, []);\n\n return mousePosition;\n}\n\ninterface ParticlesProps extends ComponentPropsWithoutRef<\"div\"> {\n className?: string;\n quantity?: number;\n staticity?: number;\n ease?: number;\n size?: number;\n refresh?: boolean;\n color?: string;\n vx?: number;\n vy?: number;\n}\n\nfunction hexToRgb(hex: string): number[] {\n hex = hex.replace(\"#\", \"\");\n\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\");\n }\n\n const hexInt = parseInt(hex, 16);\n const red = (hexInt >> 16) & 255;\n const green = (hexInt >> 8) & 255;\n const blue = hexInt & 255;\n return [red, green, blue];\n}\n\ntype Circle = {\n x: number;\n y: number;\n translateX: number;\n translateY: number;\n size: number;\n alpha: number;\n targetAlpha: number;\n dx: number;\n dy: number;\n magnetism: number;\n};\n\nexport const Particles: React.FC<ParticlesProps> = ({\n className = \"\",\n quantity = 100,\n staticity = 50,\n ease = 50,\n size = 0.4,\n refresh = false,\n color = \"#ffffff\",\n vx = 0,\n vy = 0,\n ...props\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const canvasContainerRef = useRef<HTMLDivElement>(null);\n const context = useRef<CanvasRenderingContext2D | null>(null);\n const circles = useRef<Circle[]>([]);\n const mousePosition = MousePosition();\n const mouse = useRef<{ x: number; y: number }>({ x: 0, y: 0 });\n const canvasSize = useRef<{ w: number; h: number }>({ w: 0, h: 0 });\n const dpr = typeof window !== \"undefined\" ? window.devicePixelRatio : 1;\n const rafID = useRef<number | null>(null);\n const resizeTimeout = useRef<NodeJS.Timeout | null>(null);\n\n useEffect(() => {\n if (canvasRef.current) {\n context.current = canvasRef.current.getContext(\"2d\");\n }\n initCanvas();\n animate();\n\n const handleResize = () => {\n if (resizeTimeout.current) {\n clearTimeout(resizeTimeout.current);\n }\n resizeTimeout.current = setTimeout(() => {\n initCanvas();\n }, 200);\n };\n\n window.addEventListener(\"resize\", handleResize);\n\n return () => {\n if (rafID.current != null) {\n window.cancelAnimationFrame(rafID.current);\n }\n if (resizeTimeout.current) {\n clearTimeout(resizeTimeout.current);\n }\n window.removeEventListener(\"resize\", handleResize);\n };\n }, [color]);\n\n useEffect(() => {\n onMouseMove();\n }, [mousePosition.x, mousePosition.y]);\n\n useEffect(() => {\n initCanvas();\n }, [refresh]);\n\n const initCanvas = () => {\n resizeCanvas();\n drawParticles();\n };\n\n const onMouseMove = () => {\n if (canvasRef.current) {\n const rect = canvasRef.current.getBoundingClientRect();\n const { w, h } = canvasSize.current;\n const x = mousePosition.x - rect.left - w / 2;\n const y = mousePosition.y - rect.top - h / 2;\n const inside = x < w / 2 && x > -w / 2 && y < h / 2 && y > -h / 2;\n if (inside) {\n mouse.current.x = x;\n mouse.current.y = y;\n }\n }\n };\n\n const resizeCanvas = () => {\n if (canvasContainerRef.current && canvasRef.current && context.current) {\n canvasSize.current.w = canvasContainerRef.current.offsetWidth;\n canvasSize.current.h = canvasContainerRef.current.offsetHeight;\n\n canvasRef.current.width = canvasSize.current.w * dpr;\n canvasRef.current.height = canvasSize.current.h * dpr;\n canvasRef.current.style.width = `${canvasSize.current.w}px`;\n canvasRef.current.style.height = `${canvasSize.current.h}px`;\n context.current.scale(dpr, dpr);\n\n // Clear existing particles and create new ones with exact quantity\n circles.current = [];\n for (let i = 0; i < quantity; i++) {\n const circle = circleParams();\n drawCircle(circle);\n }\n }\n };\n\n const circleParams = (): Circle => {\n const x = Math.floor(Math.random() * canvasSize.current.w);\n const y = Math.floor(Math.random() * canvasSize.current.h);\n const translateX = 0;\n const translateY = 0;\n const pSize = Math.floor(Math.random() * 2) + size;\n const alpha = 0;\n const targetAlpha = parseFloat((Math.random() * 0.6 + 0.1).toFixed(1));\n const dx = (Math.random() - 0.5) * 0.1;\n const dy = (Math.random() - 0.5) * 0.1;\n const magnetism = 0.1 + Math.random() * 4;\n return {\n x,\n y,\n translateX,\n translateY,\n size: pSize,\n alpha,\n targetAlpha,\n dx,\n dy,\n magnetism,\n };\n };\n\n const rgb = hexToRgb(color);\n\n const drawCircle = (circle: Circle, update = false) => {\n if (context.current) {\n const { x, y, translateX, translateY, size, alpha } = circle;\n context.current.translate(translateX, translateY);\n context.current.beginPath();\n context.current.arc(x, y, size, 0, 2 * Math.PI);\n context.current.fillStyle = `rgba(${rgb.join(\", \")}, ${alpha})`;\n context.current.fill();\n context.current.setTransform(dpr, 0, 0, dpr, 0, 0);\n\n if (!update) {\n circles.current.push(circle);\n }\n }\n };\n\n const clearContext = () => {\n if (context.current) {\n context.current.clearRect(\n 0,\n 0,\n canvasSize.current.w,\n canvasSize.current.h,\n );\n }\n };\n\n const drawParticles = () => {\n clearContext();\n const particleCount = quantity;\n for (let i = 0; i < particleCount; i++) {\n const circle = circleParams();\n drawCircle(circle);\n }\n };\n\n const remapValue = (\n value: number,\n start1: number,\n end1: number,\n start2: number,\n end2: number,\n ): number => {\n const remapped =\n ((value - start1) * (end2 - start2)) / (end1 - start1) + start2;\n return remapped > 0 ? remapped : 0;\n };\n\n const animate = () => {\n clearContext();\n circles.current.forEach((circle: Circle, i: number) => {\n // Handle the alpha value\n const edge = [\n circle.x + circle.translateX - circle.size, // distance from left edge\n canvasSize.current.w - circle.x - circle.translateX - circle.size, // distance from right edge\n circle.y + circle.translateY - circle.size, // distance from top edge\n canvasSize.current.h - circle.y - circle.translateY - circle.size, // distance from bottom edge\n ];\n const closestEdge = edge.reduce((a, b) => Math.min(a, b));\n const remapClosestEdge = parseFloat(\n remapValue(closestEdge, 0, 20, 0, 1).toFixed(2),\n );\n if (remapClosestEdge > 1) {\n circle.alpha += 0.02;\n if (circle.alpha > circle.targetAlpha) {\n circle.alpha = circle.targetAlpha;\n }\n } else {\n circle.alpha = circle.targetAlpha * remapClosestEdge;\n }\n circle.x += circle.dx + vx;\n circle.y += circle.dy + vy;\n circle.translateX +=\n (mouse.current.x / (staticity / circle.magnetism) - circle.translateX) /\n ease;\n circle.translateY +=\n (mouse.current.y / (staticity / circle.magnetism) - circle.translateY) /\n ease;\n\n drawCircle(circle, true);\n\n // circle gets out of the canvas\n if (\n circle.x < -circle.size ||\n circle.x > canvasSize.current.w + circle.size ||\n circle.y < -circle.size ||\n circle.y > canvasSize.current.h + circle.size\n ) {\n // remove the circle from the array\n circles.current.splice(i, 1);\n // create a new circle\n const newCircle = circleParams();\n drawCircle(newCircle);\n }\n });\n rafID.current = window.requestAnimationFrame(animate);\n };\n\n return (\n <div\n className={cn(\"pointer-events-none\", className)}\n ref={canvasContainerRef}\n aria-hidden=\"true\"\n {...props}\n >\n <canvas ref={canvasRef} className=\"size-full\" />\n </div>\n );\n};\n",
+ "content": "\"use client\"\n\nimport React, {\n ComponentPropsWithoutRef,\n useEffect,\n useRef,\n useState,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MousePosition {\n x: number\n y: number\n}\n\nfunction MousePosition(): MousePosition {\n const [mousePosition, setMousePosition] = useState<MousePosition>({\n x: 0,\n y: 0,\n })\n\n useEffect(() => {\n const handleMouseMove = (event: MouseEvent) => {\n setMousePosition({ x: event.clientX, y: event.clientY })\n }\n\n window.addEventListener(\"mousemove\", handleMouseMove)\n\n return () => {\n window.removeEventListener(\"mousemove\", handleMouseMove)\n }\n }, [])\n\n return mousePosition\n}\n\ninterface ParticlesProps extends ComponentPropsWithoutRef<\"div\"> {\n className?: string\n quantity?: number\n staticity?: number\n ease?: number\n size?: number\n refresh?: boolean\n color?: string\n vx?: number\n vy?: number\n}\n\nfunction hexToRgb(hex: string): number[] {\n hex = hex.replace(\"#\", \"\")\n\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\")\n }\n\n const hexInt = parseInt(hex, 16)\n const red = (hexInt >> 16) & 255\n const green = (hexInt >> 8) & 255\n const blue = hexInt & 255\n return [red, green, blue]\n}\n\ntype Circle = {\n x: number\n y: number\n translateX: number\n translateY: number\n size: number\n alpha: number\n targetAlpha: number\n dx: number\n dy: number\n magnetism: number\n}\n\nexport const Particles: React.FC<ParticlesProps> = ({\n className = \"\",\n quantity = 100,\n staticity = 50,\n ease = 50,\n size = 0.4,\n refresh = false,\n color = \"#ffffff\",\n vx = 0,\n vy = 0,\n ...props\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const canvasContainerRef = useRef<HTMLDivElement>(null)\n const context = useRef<CanvasRenderingContext2D | null>(null)\n const circles = useRef<Circle[]>([])\n const mousePosition = MousePosition()\n const mouse = useRef<{ x: number; y: number }>({ x: 0, y: 0 })\n const canvasSize = useRef<{ w: number; h: number }>({ w: 0, h: 0 })\n const dpr = typeof window !== \"undefined\" ? window.devicePixelRatio : 1\n const rafID = useRef<number | null>(null)\n const resizeTimeout = useRef<NodeJS.Timeout | null>(null)\n\n useEffect(() => {\n if (canvasRef.current) {\n context.current = canvasRef.current.getContext(\"2d\")\n }\n initCanvas()\n animate()\n\n const handleResize = () => {\n if (resizeTimeout.current) {\n clearTimeout(resizeTimeout.current)\n }\n resizeTimeout.current = setTimeout(() => {\n initCanvas()\n }, 200)\n }\n\n window.addEventListener(\"resize\", handleResize)\n\n return () => {\n if (rafID.current != null) {\n window.cancelAnimationFrame(rafID.current)\n }\n if (resizeTimeout.current) {\n clearTimeout(resizeTimeout.current)\n }\n window.removeEventListener(\"resize\", handleResize)\n }\n }, [color])\n\n useEffect(() => {\n onMouseMove()\n }, [mousePosition.x, mousePosition.y])\n\n useEffect(() => {\n initCanvas()\n }, [refresh])\n\n const initCanvas = () => {\n resizeCanvas()\n drawParticles()\n }\n\n const onMouseMove = () => {\n if (canvasRef.current) {\n const rect = canvasRef.current.getBoundingClientRect()\n const { w, h } = canvasSize.current\n const x = mousePosition.x - rect.left - w / 2\n const y = mousePosition.y - rect.top - h / 2\n const inside = x < w / 2 && x > -w / 2 && y < h / 2 && y > -h / 2\n if (inside) {\n mouse.current.x = x\n mouse.current.y = y\n }\n }\n }\n\n const resizeCanvas = () => {\n if (canvasContainerRef.current && canvasRef.current && context.current) {\n canvasSize.current.w = canvasContainerRef.current.offsetWidth\n canvasSize.current.h = canvasContainerRef.current.offsetHeight\n\n canvasRef.current.width = canvasSize.current.w * dpr\n canvasRef.current.height = canvasSize.current.h * dpr\n canvasRef.current.style.width = `${canvasSize.current.w}px`\n canvasRef.current.style.height = `${canvasSize.current.h}px`\n context.current.scale(dpr, dpr)\n\n // Clear existing particles and create new ones with exact quantity\n circles.current = []\n for (let i = 0; i < quantity; i++) {\n const circle = circleParams()\n drawCircle(circle)\n }\n }\n }\n\n const circleParams = (): Circle => {\n const x = Math.floor(Math.random() * canvasSize.current.w)\n const y = Math.floor(Math.random() * canvasSize.current.h)\n const translateX = 0\n const translateY = 0\n const pSize = Math.floor(Math.random() * 2) + size\n const alpha = 0\n const targetAlpha = parseFloat((Math.random() * 0.6 + 0.1).toFixed(1))\n const dx = (Math.random() - 0.5) * 0.1\n const dy = (Math.random() - 0.5) * 0.1\n const magnetism = 0.1 + Math.random() * 4\n return {\n x,\n y,\n translateX,\n translateY,\n size: pSize,\n alpha,\n targetAlpha,\n dx,\n dy,\n magnetism,\n }\n }\n\n const rgb = hexToRgb(color)\n\n const drawCircle = (circle: Circle, update = false) => {\n if (context.current) {\n const { x, y, translateX, translateY, size, alpha } = circle\n context.current.translate(translateX, translateY)\n context.current.beginPath()\n context.current.arc(x, y, size, 0, 2 * Math.PI)\n context.current.fillStyle = `rgba(${rgb.join(\", \")}, ${alpha})`\n context.current.fill()\n context.current.setTransform(dpr, 0, 0, dpr, 0, 0)\n\n if (!update) {\n circles.current.push(circle)\n }\n }\n }\n\n const clearContext = () => {\n if (context.current) {\n context.current.clearRect(\n 0,\n 0,\n canvasSize.current.w,\n canvasSize.current.h\n )\n }\n }\n\n const drawParticles = () => {\n clearContext()\n const particleCount = quantity\n for (let i = 0; i < particleCount; i++) {\n const circle = circleParams()\n drawCircle(circle)\n }\n }\n\n const remapValue = (\n value: number,\n start1: number,\n end1: number,\n start2: number,\n end2: number\n ): number => {\n const remapped =\n ((value - start1) * (end2 - start2)) / (end1 - start1) + start2\n return remapped > 0 ? remapped : 0\n }\n\n const animate = () => {\n clearContext()\n circles.current.forEach((circle: Circle, i: number) => {\n // Handle the alpha value\n const edge = [\n circle.x + circle.translateX - circle.size, // distance from left edge\n canvasSize.current.w - circle.x - circle.translateX - circle.size, // distance from right edge\n circle.y + circle.translateY - circle.size, // distance from top edge\n canvasSize.current.h - circle.y - circle.translateY - circle.size, // distance from bottom edge\n ]\n const closestEdge = edge.reduce((a, b) => Math.min(a, b))\n const remapClosestEdge = parseFloat(\n remapValue(closestEdge, 0, 20, 0, 1).toFixed(2)\n )\n if (remapClosestEdge > 1) {\n circle.alpha += 0.02\n if (circle.alpha > circle.targetAlpha) {\n circle.alpha = circle.targetAlpha\n }\n } else {\n circle.alpha = circle.targetAlpha * remapClosestEdge\n }\n circle.x += circle.dx + vx\n circle.y += circle.dy + vy\n circle.translateX +=\n (mouse.current.x / (staticity / circle.magnetism) - circle.translateX) /\n ease\n circle.translateY +=\n (mouse.current.y / (staticity / circle.magnetism) - circle.translateY) /\n ease\n\n drawCircle(circle, true)\n\n // circle gets out of the canvas\n if (\n circle.x < -circle.size ||\n circle.x > canvasSize.current.w + circle.size ||\n circle.y < -circle.size ||\n circle.y > canvasSize.current.h + circle.size\n ) {\n // remove the circle from the array\n circles.current.splice(i, 1)\n // create a new circle\n const newCircle = circleParams()\n drawCircle(newCircle)\n }\n })\n rafID.current = window.requestAnimationFrame(animate)\n }\n\n return (\n <div\n className={cn(\"pointer-events-none\", className)}\n ref={canvasContainerRef}\n aria-hidden=\"true\"\n {...props}\n >\n <canvas ref={canvasRef} className=\"size-full\" />\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/pixel-image-demo.json b/apps/www/public/r/pixel-image-demo.json
index 221a2cc8..21244f2d 100644
--- a/apps/www/public/r/pixel-image-demo.json
+++ b/apps/www/public/r/pixel-image-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/pixel-image-demo.tsx",
- "content": "import { PixelImage } from \"@/registry/magicui/pixel-image\";\n\nexport default function Home() {\n return (\n <PixelImage\n src=\"/pixel-image-demo.jpg\"\n customGrid={{ rows: 4, cols: 6 }}\n grayscaleAnimation\n />\n );\n}\n",
+ "content": "import { PixelImage } from \"@/registry/magicui/pixel-image\"\n\nexport default function Home() {\n return (\n <PixelImage\n src=\"/pixel-image-demo.jpg\"\n customGrid={{ rows: 4, cols: 6 }}\n grayscaleAnimation\n />\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/pixel-image.json b/apps/www/public/r/pixel-image.json
index 56ada2a7..fe85eeac 100644
--- a/apps/www/public/r/pixel-image.json
+++ b/apps/www/public/r/pixel-image.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/pixel-image.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { useEffect, useMemo, useState } from \"react\";\n\ntype Grid = {\n rows: number;\n cols: number;\n};\n\nconst DEFAULT_GRIDS: Record<string, Grid> = {\n \"6x4\": { rows: 4, cols: 6 },\n \"8x8\": { rows: 8, cols: 8 },\n \"8x3\": { rows: 3, cols: 8 },\n \"4x6\": { rows: 6, cols: 4 },\n \"3x8\": { rows: 8, cols: 3 },\n};\n\ntype PredefinedGridKey = keyof typeof DEFAULT_GRIDS;\n\ninterface PixelImageProps {\n src: string;\n grid?: PredefinedGridKey;\n customGrid?: Grid;\n grayscaleAnimation?: boolean;\n pixelFadeInDuration?: number; // in ms\n maxAnimationDelay?: number; // in ms\n colorRevealDelay?: number; // in ms\n}\n\nexport const PixelImage = ({\n src,\n grid = \"6x4\",\n grayscaleAnimation = true,\n pixelFadeInDuration = 1000,\n maxAnimationDelay = 1200,\n colorRevealDelay = 1300,\n customGrid,\n}: PixelImageProps) => {\n const [isVisible, setIsVisible] = useState(false);\n const [showColor, setShowColor] = useState(false);\n\n const MIN_GRID = 1;\n const MAX_GRID = 16;\n\n const { rows, cols } = useMemo(() => {\n const isValidGrid = (grid?: Grid) => {\n if (!grid) return false;\n const { rows, cols } = grid;\n return (\n Number.isInteger(rows) &&\n Number.isInteger(cols) &&\n rows >= MIN_GRID &&\n cols >= MIN_GRID &&\n rows <= MAX_GRID &&\n cols <= MAX_GRID\n );\n };\n\n return isValidGrid(customGrid) ? customGrid! : DEFAULT_GRIDS[grid];\n }, [customGrid, grid]);\n\n useEffect(() => {\n setIsVisible(true);\n const colorTimeout = setTimeout(() => {\n setShowColor(true);\n }, colorRevealDelay);\n return () => clearTimeout(colorTimeout);\n }, [colorRevealDelay]);\n\n const pieces = useMemo(() => {\n const total = rows * cols;\n return Array.from({ length: total }, (_, index) => {\n const row = Math.floor(index / cols);\n const col = index % cols;\n\n const clipPath = `polygon(\n ${col * (100 / cols)}% ${row * (100 / rows)}%,\n ${(col + 1) * (100 / cols)}% ${row * (100 / rows)}%,\n ${(col + 1) * (100 / cols)}% ${(row + 1) * (100 / rows)}%,\n ${col * (100 / cols)}% ${(row + 1) * (100 / rows)}%\n )`;\n\n const delay = Math.random() * maxAnimationDelay;\n return {\n clipPath,\n delay,\n };\n });\n }, [rows, cols, maxAnimationDelay]);\n\n return (\n <div className=\"relative h-72 w-72 select-none md:h-96 md:w-96\">\n {pieces.map((piece, index) => (\n <div\n key={index}\n className={cn(\n \"absolute inset-0 transition-all ease-out\",\n isVisible ? \"opacity-100\" : \"opacity-0\",\n )}\n style={{\n clipPath: piece.clipPath,\n transitionDelay: `${piece.delay}ms`,\n transitionDuration: `${pixelFadeInDuration}ms`,\n }}\n >\n <img\n src={src}\n alt={`Pixel image piece ${index + 1}`}\n className={cn(\n \"z-1 object-cover rounded-[2.5rem]\",\n grayscaleAnimation && (showColor ? \"grayscale-0\" : \"grayscale\"),\n )}\n style={{\n transition: grayscaleAnimation\n ? `filter ${pixelFadeInDuration}ms cubic-bezier(0.4, 0, 0.2, 1)`\n : \"none\",\n }}\n draggable={false}\n />\n </div>\n ))}\n </div>\n );\n};\n",
+ "content": "\"use client\"\n\nimport { useEffect, useMemo, useState } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Grid = {\n rows: number\n cols: number\n}\n\nconst DEFAULT_GRIDS: Record<string, Grid> = {\n \"6x4\": { rows: 4, cols: 6 },\n \"8x8\": { rows: 8, cols: 8 },\n \"8x3\": { rows: 3, cols: 8 },\n \"4x6\": { rows: 6, cols: 4 },\n \"3x8\": { rows: 8, cols: 3 },\n}\n\ntype PredefinedGridKey = keyof typeof DEFAULT_GRIDS\n\ninterface PixelImageProps {\n src: string\n grid?: PredefinedGridKey\n customGrid?: Grid\n grayscaleAnimation?: boolean\n pixelFadeInDuration?: number // in ms\n maxAnimationDelay?: number // in ms\n colorRevealDelay?: number // in ms\n}\n\nexport const PixelImage = ({\n src,\n grid = \"6x4\",\n grayscaleAnimation = true,\n pixelFadeInDuration = 1000,\n maxAnimationDelay = 1200,\n colorRevealDelay = 1300,\n customGrid,\n}: PixelImageProps) => {\n const [isVisible, setIsVisible] = useState(false)\n const [showColor, setShowColor] = useState(false)\n\n const MIN_GRID = 1\n const MAX_GRID = 16\n\n const { rows, cols } = useMemo(() => {\n const isValidGrid = (grid?: Grid) => {\n if (!grid) return false\n const { rows, cols } = grid\n return (\n Number.isInteger(rows) &&\n Number.isInteger(cols) &&\n rows >= MIN_GRID &&\n cols >= MIN_GRID &&\n rows <= MAX_GRID &&\n cols <= MAX_GRID\n )\n }\n\n return isValidGrid(customGrid) ? customGrid! : DEFAULT_GRIDS[grid]\n }, [customGrid, grid])\n\n useEffect(() => {\n setIsVisible(true)\n const colorTimeout = setTimeout(() => {\n setShowColor(true)\n }, colorRevealDelay)\n return () => clearTimeout(colorTimeout)\n }, [colorRevealDelay])\n\n const pieces = useMemo(() => {\n const total = rows * cols\n return Array.from({ length: total }, (_, index) => {\n const row = Math.floor(index / cols)\n const col = index % cols\n\n const clipPath = `polygon(\n ${col * (100 / cols)}% ${row * (100 / rows)}%,\n ${(col + 1) * (100 / cols)}% ${row * (100 / rows)}%,\n ${(col + 1) * (100 / cols)}% ${(row + 1) * (100 / rows)}%,\n ${col * (100 / cols)}% ${(row + 1) * (100 / rows)}%\n )`\n\n const delay = Math.random() * maxAnimationDelay\n return {\n clipPath,\n delay,\n }\n })\n }, [rows, cols, maxAnimationDelay])\n\n return (\n <div className=\"relative h-72 w-72 select-none md:h-96 md:w-96\">\n {pieces.map((piece, index) => (\n <div\n key={index}\n className={cn(\n \"absolute inset-0 transition-all ease-out\",\n isVisible ? \"opacity-100\" : \"opacity-0\"\n )}\n style={{\n clipPath: piece.clipPath,\n transitionDelay: `${piece.delay}ms`,\n transitionDuration: `${pixelFadeInDuration}ms`,\n }}\n >\n <img\n src={src}\n alt={`Pixel image piece ${index + 1}`}\n className={cn(\n \"z-1 rounded-[2.5rem] object-cover\",\n grayscaleAnimation && (showColor ? \"grayscale-0\" : \"grayscale\")\n )}\n style={{\n transition: grayscaleAnimation\n ? `filter ${pixelFadeInDuration}ms cubic-bezier(0.4, 0, 0.2, 1)`\n : \"none\",\n }}\n draggable={false}\n />\n </div>\n ))}\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/pointer-demo-1.json b/apps/www/public/r/pointer-demo-1.json
index b9b04f30..67f809c5 100644
--- a/apps/www/public/r/pointer-demo-1.json
+++ b/apps/www/public/r/pointer-demo-1.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/pointer-demo-1.tsx",
- "content": "\"use client\";\n\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Pointer } from \"@/registry/magicui/pointer\";\nimport { motion } from \"motion/react\";\n\nexport default function PointerDemo1() {\n return (\n <div className=\"grid grid-cols-1 gap-6 md:grid-cols-2 md:grid-rows-2\">\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-slate-50 to-slate-100 transition-all dark:from-slate-900 dark:to-slate-800 shadow-none\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Animated Pointer</CardTitle>\n <CardDescription className=\"text-sm text-slate-600 dark:text-slate-400\">\n Animated pointer\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-slate-800 dark:text-slate-200\">\n Move your cursor here\n </span>\n </CardContent>\n <Pointer>\n <motion.div\n animate={{\n scale: [0.8, 1, 0.8],\n rotate: [0, 5, -5, 0],\n }}\n transition={{\n duration: 1.5,\n repeat: Infinity,\n ease: \"easeInOut\",\n }}\n >\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"text-pink-600\"\n >\n <motion.path\n d=\"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z\"\n fill=\"currentColor\"\n animate={{ scale: [1, 1.2, 1] }}\n transition={{\n duration: 0.8,\n repeat: Infinity,\n ease: \"easeInOut\",\n }}\n />\n </svg>\n </motion.div>\n </Pointer>\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-blue-50 to-blue-100 transition-all dark:from-blue-900 dark:to-blue-800 shadow-none\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Colored Pointer</CardTitle>\n <CardDescription className=\"text-sm text-blue-700 dark:text-blue-300\">\n A custom pointer with different color\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-blue-800 dark:text-blue-200\">\n Try me out\n </span>\n </CardContent>\n <Pointer className=\"fill-blue-500\" />\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-purple-50 to-purple-100 transition-all dark:from-purple-900 dark:to-purple-800 shadow-none\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Custom Shape</CardTitle>\n <CardDescription className=\"text-sm text-purple-700 dark:text-purple-300\">\n A pointer with a custom SVG shape\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-purple-800 dark:text-purple-200\">\n Hover here\n </span>\n </CardContent>\n <Pointer>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" className=\"fill-purple-500\" />\n <circle cx=\"12\" cy=\"12\" r=\"5\" className=\"fill-white\" />\n </svg>\n </Pointer>\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-green-50 to-green-100 transition-all dark:from-green-900 dark:to-green-800 shadow-none\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Emoji Pointer</CardTitle>\n <CardDescription className=\"text-sm text-green-700 dark:text-green-300\">\n Using an emoji as a custom pointer\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-green-800 dark:text-green-200\">\n Check this out\n </span>\n </CardContent>\n <Pointer>\n <div className=\"text-2xl\">👆</div>\n </Pointer>\n </Card>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { motion } from \"motion/react\"\n\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { Pointer } from \"@/registry/magicui/pointer\"\n\nexport default function PointerDemo1() {\n return (\n <div className=\"grid grid-cols-1 gap-6 md:grid-cols-2 md:grid-rows-2\">\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-slate-50 to-slate-100 shadow-none transition-all dark:from-slate-900 dark:to-slate-800\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Animated Pointer</CardTitle>\n <CardDescription className=\"text-sm text-slate-600 dark:text-slate-400\">\n Animated pointer\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-slate-800 dark:text-slate-200\">\n Move your cursor here\n </span>\n </CardContent>\n <Pointer>\n <motion.div\n animate={{\n scale: [0.8, 1, 0.8],\n rotate: [0, 5, -5, 0],\n }}\n transition={{\n duration: 1.5,\n repeat: Infinity,\n ease: \"easeInOut\",\n }}\n >\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"text-pink-600\"\n >\n <motion.path\n d=\"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z\"\n fill=\"currentColor\"\n animate={{ scale: [1, 1.2, 1] }}\n transition={{\n duration: 0.8,\n repeat: Infinity,\n ease: \"easeInOut\",\n }}\n />\n </svg>\n </motion.div>\n </Pointer>\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-blue-50 to-blue-100 shadow-none transition-all dark:from-blue-900 dark:to-blue-800\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Colored Pointer</CardTitle>\n <CardDescription className=\"text-sm text-blue-700 dark:text-blue-300\">\n A custom pointer with different color\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-blue-800 dark:text-blue-200\">\n Try me out\n </span>\n </CardContent>\n <Pointer className=\"fill-blue-500\" />\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-purple-50 to-purple-100 shadow-none transition-all dark:from-purple-900 dark:to-purple-800\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Custom Shape</CardTitle>\n <CardDescription className=\"text-sm text-purple-700 dark:text-purple-300\">\n A pointer with a custom SVG shape\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-purple-800 dark:text-purple-200\">\n Hover here\n </span>\n </CardContent>\n <Pointer>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" className=\"fill-purple-500\" />\n <circle cx=\"12\" cy=\"12\" r=\"5\" className=\"fill-white\" />\n </svg>\n </Pointer>\n </Card>\n\n <Card className=\"col-span-1 row-span-1 overflow-hidden border bg-gradient-to-br from-green-50 to-green-100 shadow-none transition-all dark:from-green-900 dark:to-green-800\">\n <CardHeader className=\"relative pb-2\">\n <CardTitle className=\"text-xl font-bold\">Emoji Pointer</CardTitle>\n <CardDescription className=\"text-sm text-green-700 dark:text-green-300\">\n Using an emoji as a custom pointer\n </CardDescription>\n </CardHeader>\n <CardContent className=\"relative flex h-40 items-center justify-center p-6\">\n <span className=\"pointer-events-none text-center text-xl font-medium text-green-800 dark:text-green-200\">\n Check this out\n </span>\n </CardContent>\n <Pointer>\n <div className=\"text-2xl\">👆</div>\n </Pointer>\n </Card>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/pointer.json b/apps/www/public/r/pointer.json
index d05932f0..511e9041 100644
--- a/apps/www/public/r/pointer.json
+++ b/apps/www/public/r/pointer.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/pointer.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n AnimatePresence,\n HTMLMotionProps,\n motion,\n useMotionValue,\n} from \"motion/react\";\nimport { useEffect, useRef, useState } from \"react\";\n\ninterface PointerProps extends Omit<HTMLMotionProps<\"div\">, \"ref\"> {}\n\n/**\n * A custom pointer component that displays an animated cursor.\n * Add this as a child to any component to enable a custom pointer when hovering.\n * You can pass custom children to render as the pointer.\n *\n * @component\n * @param {PointerProps} props - The component props\n */\nexport function Pointer({\n className,\n style,\n children,\n ...props\n}: PointerProps): React.ReactNode {\n const x = useMotionValue(0);\n const y = useMotionValue(0);\n const [isActive, setIsActive] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (typeof window !== \"undefined\" && containerRef.current) {\n // Get the parent element directly from the ref\n const parentElement = containerRef.current.parentElement;\n\n if (parentElement) {\n // Add cursor-none to parent\n parentElement.style.cursor = \"none\";\n\n // Add event listeners to parent\n const handleMouseMove = (e: MouseEvent) => {\n x.set(e.clientX);\n y.set(e.clientY);\n };\n\n const handleMouseEnter = (e: MouseEvent) => {\n x.set(e.clientX);\n y.set(e.clientY);\n setIsActive(true);\n };\n\n const handleMouseLeave = () => {\n setIsActive(false);\n };\n\n parentElement.addEventListener(\"mousemove\", handleMouseMove);\n parentElement.addEventListener(\"mouseenter\", handleMouseEnter);\n parentElement.addEventListener(\"mouseleave\", handleMouseLeave);\n\n return () => {\n parentElement.style.cursor = \"\";\n parentElement.removeEventListener(\"mousemove\", handleMouseMove);\n parentElement.removeEventListener(\"mouseenter\", handleMouseEnter);\n parentElement.removeEventListener(\"mouseleave\", handleMouseLeave);\n };\n }\n }\n }, [x, y]);\n\n return (\n <>\n <div ref={containerRef} />\n <AnimatePresence>\n {isActive && (\n <motion.div\n className=\"transform-[translate(-50%,-50%)] pointer-events-none fixed z-50\"\n style={{\n top: y,\n left: x,\n ...style,\n }}\n initial={{\n scale: 0,\n opacity: 0,\n }}\n animate={{\n scale: 1,\n opacity: 1,\n }}\n exit={{\n scale: 0,\n opacity: 0,\n }}\n {...props}\n >\n {children || (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"1\"\n viewBox=\"0 0 16 16\"\n height=\"24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\n \"rotate-[-70deg] stroke-white text-black\",\n className,\n )}\n >\n <path d=\"M14.082 2.182a.5.5 0 0 1 .103.557L8.528 15.467a.5.5 0 0 1-.917-.007L5.57 10.694.803 8.652a.5.5 0 0 1-.006-.916l12.728-5.657a.5.5 0 0 1 .556.103z\" />\n </svg>\n )}\n </motion.div>\n )}\n </AnimatePresence>\n </>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport {\n AnimatePresence,\n HTMLMotionProps,\n motion,\n useMotionValue,\n} from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface PointerProps extends Omit<HTMLMotionProps<\"div\">, \"ref\"> {}\n\n/**\n * A custom pointer component that displays an animated cursor.\n * Add this as a child to any component to enable a custom pointer when hovering.\n * You can pass custom children to render as the pointer.\n *\n * @component\n * @param {PointerProps} props - The component props\n */\nexport function Pointer({\n className,\n style,\n children,\n ...props\n}: PointerProps): React.ReactNode {\n const x = useMotionValue(0)\n const y = useMotionValue(0)\n const [isActive, setIsActive] = useState<boolean>(false)\n const containerRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (typeof window !== \"undefined\" && containerRef.current) {\n // Get the parent element directly from the ref\n const parentElement = containerRef.current.parentElement\n\n if (parentElement) {\n // Add cursor-none to parent\n parentElement.style.cursor = \"none\"\n\n // Add event listeners to parent\n const handleMouseMove = (e: MouseEvent) => {\n x.set(e.clientX)\n y.set(e.clientY)\n }\n\n const handleMouseEnter = (e: MouseEvent) => {\n x.set(e.clientX)\n y.set(e.clientY)\n setIsActive(true)\n }\n\n const handleMouseLeave = () => {\n setIsActive(false)\n }\n\n parentElement.addEventListener(\"mousemove\", handleMouseMove)\n parentElement.addEventListener(\"mouseenter\", handleMouseEnter)\n parentElement.addEventListener(\"mouseleave\", handleMouseLeave)\n\n return () => {\n parentElement.style.cursor = \"\"\n parentElement.removeEventListener(\"mousemove\", handleMouseMove)\n parentElement.removeEventListener(\"mouseenter\", handleMouseEnter)\n parentElement.removeEventListener(\"mouseleave\", handleMouseLeave)\n }\n }\n }\n }, [x, y])\n\n return (\n <>\n <div ref={containerRef} />\n <AnimatePresence>\n {isActive && (\n <motion.div\n className=\"pointer-events-none fixed z-50 transform-[translate(-50%,-50%)]\"\n style={{\n top: y,\n left: x,\n ...style,\n }}\n initial={{\n scale: 0,\n opacity: 0,\n }}\n animate={{\n scale: 1,\n opacity: 1,\n }}\n exit={{\n scale: 0,\n opacity: 0,\n }}\n {...props}\n >\n {children || (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"1\"\n viewBox=\"0 0 16 16\"\n height=\"24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\n \"rotate-[-70deg] stroke-white text-black\",\n className\n )}\n >\n <path d=\"M14.082 2.182a.5.5 0 0 1 .103.557L8.528 15.467a.5.5 0 0 1-.917-.007L5.57 10.694.803 8.652a.5.5 0 0 1-.006-.916l12.728-5.657a.5.5 0 0 1 .556.103z\" />\n </svg>\n )}\n </motion.div>\n )}\n </AnimatePresence>\n </>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/progressive-blur-demo.json b/apps/www/public/r/progressive-blur-demo.json
index 0595552f..f12e2c2d 100644
--- a/apps/www/public/r/progressive-blur-demo.json
+++ b/apps/www/public/r/progressive-blur-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/progressive-blur-demo.tsx",
- "content": "\"use client\";\n\nimport { ScrollArea } from \"@/components/ui/scroll-area\";\nimport { ProgressiveBlur } from \"@/registry/magicui/progressive-blur\";\n\nexport default function ProgressiveBlurDemo() {\n return (\n <div className=\"relative w-full border rounded-xl\">\n <ScrollArea className=\"relative h-[400px] overflow-hidden\">\n <div className=\"flex flex-col gap-2 p-4\">\n {Array.from({ length: 20 }).map((_, index) => (\n <div\n key={index}\n className=\"flex h-20 w-full items-center justify-center rounded-xl bg-card border\"\n >\n {index}\n </div>\n ))}\n </div>\n <ProgressiveBlur position=\"bottom\" height=\"40%\" />\n </ScrollArea>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { ScrollArea } from \"@/components/ui/scroll-area\"\nimport { ProgressiveBlur } from \"@/registry/magicui/progressive-blur\"\n\nexport default function ProgressiveBlurDemo() {\n return (\n <div className=\"relative w-full rounded-xl border\">\n <ScrollArea className=\"relative h-[400px] overflow-hidden\">\n <div className=\"flex flex-col gap-2 p-4\">\n {Array.from({ length: 20 }).map((_, index) => (\n <div\n key={index}\n className=\"bg-card flex h-20 w-full items-center justify-center rounded-xl border\"\n >\n {index}\n </div>\n ))}\n </div>\n <ProgressiveBlur position=\"bottom\" height=\"40%\" />\n </ScrollArea>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/progressive-blur.json b/apps/www/public/r/progressive-blur.json
index 288599ea..3c5e7213 100644
--- a/apps/www/public/r/progressive-blur.json
+++ b/apps/www/public/r/progressive-blur.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/progressive-blur.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport React from \"react\";\n\nexport interface ProgressiveBlurProps {\n className?: string;\n height?: string;\n position?: \"top\" | \"bottom\" | \"both\";\n blurLevels?: number[];\n children?: React.ReactNode;\n}\n\nexport function ProgressiveBlur({\n className,\n height = \"30%\",\n position = \"bottom\",\n blurLevels = [0.5, 1, 2, 4, 8, 16, 32, 64],\n}: ProgressiveBlurProps) {\n // Create array with length equal to blurLevels.length - 2 (for before/after pseudo elements)\n const divElements = Array(blurLevels.length - 2).fill(null);\n\n return (\n <div\n className={cn(\n \"gradient-blur pointer-events-none absolute z-10 inset-x-0\",\n className,\n position === \"top\"\n ? \"top-0\"\n : position === \"bottom\"\n ? \"bottom-0\"\n : \"inset-y-0\",\n )}\n style={{\n height: position === \"both\" ? \"100%\" : height,\n }}\n >\n {/* First blur layer (pseudo element) */}\n <div\n className=\"absolute inset-0\"\n style={{\n zIndex: 1,\n backdropFilter: `blur(${blurLevels[0]}px)`,\n WebkitBackdropFilter: `blur(${blurLevels[0]}px)`,\n maskImage:\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 12.5%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 37.5%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 12.5%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 37.5%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`,\n WebkitMaskImage:\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 12.5%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 37.5%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 12.5%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 37.5%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`,\n }}\n />\n\n {/* Middle blur layers */}\n {divElements.map((_, index) => {\n const blurIndex = index + 1;\n const startPercent = blurIndex * 12.5;\n const midPercent = (blurIndex + 1) * 12.5;\n const endPercent = (blurIndex + 2) * 12.5;\n\n const maskGradient =\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) ${startPercent}%, rgba(0,0,0,1) ${midPercent}%, rgba(0,0,0,1) ${endPercent}%, rgba(0,0,0,0) ${endPercent + 12.5}%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) ${startPercent}%, rgba(0,0,0,1) ${midPercent}%, rgba(0,0,0,1) ${endPercent}%, rgba(0,0,0,0) ${endPercent + 12.5}%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`;\n\n return (\n <div\n key={`blur-${index}`}\n className=\"absolute inset-0\"\n style={{\n zIndex: index + 2,\n backdropFilter: `blur(${blurLevels[blurIndex]}px)`,\n WebkitBackdropFilter: `blur(${blurLevels[blurIndex]}px)`,\n maskImage: maskGradient,\n WebkitMaskImage: maskGradient,\n }}\n />\n );\n })}\n\n {/* Last blur layer (pseudo element) */}\n <div\n className=\"absolute inset-0\"\n style={{\n zIndex: blurLevels.length,\n backdropFilter: `blur(${blurLevels[blurLevels.length - 1]}px)`,\n WebkitBackdropFilter: `blur(${blurLevels[blurLevels.length - 1]}px)`,\n maskImage:\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) 87.5%, rgba(0,0,0,1) 100%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) 87.5%, rgba(0,0,0,1) 100%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`,\n WebkitMaskImage:\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) 87.5%, rgba(0,0,0,1) 100%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) 87.5%, rgba(0,0,0,1) 100%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`,\n }}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface ProgressiveBlurProps {\n className?: string\n height?: string\n position?: \"top\" | \"bottom\" | \"both\"\n blurLevels?: number[]\n children?: React.ReactNode\n}\n\nexport function ProgressiveBlur({\n className,\n height = \"30%\",\n position = \"bottom\",\n blurLevels = [0.5, 1, 2, 4, 8, 16, 32, 64],\n}: ProgressiveBlurProps) {\n // Create array with length equal to blurLevels.length - 2 (for before/after pseudo elements)\n const divElements = Array(blurLevels.length - 2).fill(null)\n\n return (\n <div\n className={cn(\n \"gradient-blur pointer-events-none absolute inset-x-0 z-10\",\n className,\n position === \"top\"\n ? \"top-0\"\n : position === \"bottom\"\n ? \"bottom-0\"\n : \"inset-y-0\"\n )}\n style={{\n height: position === \"both\" ? \"100%\" : height,\n }}\n >\n {/* First blur layer (pseudo element) */}\n <div\n className=\"absolute inset-0\"\n style={{\n zIndex: 1,\n backdropFilter: `blur(${blurLevels[0]}px)`,\n WebkitBackdropFilter: `blur(${blurLevels[0]}px)`,\n maskImage:\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 12.5%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 37.5%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 12.5%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 37.5%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`,\n WebkitMaskImage:\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 12.5%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 37.5%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 12.5%, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 37.5%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`,\n }}\n />\n\n {/* Middle blur layers */}\n {divElements.map((_, index) => {\n const blurIndex = index + 1\n const startPercent = blurIndex * 12.5\n const midPercent = (blurIndex + 1) * 12.5\n const endPercent = (blurIndex + 2) * 12.5\n\n const maskGradient =\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) ${startPercent}%, rgba(0,0,0,1) ${midPercent}%, rgba(0,0,0,1) ${endPercent}%, rgba(0,0,0,0) ${endPercent + 12.5}%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) ${startPercent}%, rgba(0,0,0,1) ${midPercent}%, rgba(0,0,0,1) ${endPercent}%, rgba(0,0,0,0) ${endPercent + 12.5}%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`\n\n return (\n <div\n key={`blur-${index}`}\n className=\"absolute inset-0\"\n style={{\n zIndex: index + 2,\n backdropFilter: `blur(${blurLevels[blurIndex]}px)`,\n WebkitBackdropFilter: `blur(${blurLevels[blurIndex]}px)`,\n maskImage: maskGradient,\n WebkitMaskImage: maskGradient,\n }}\n />\n )\n })}\n\n {/* Last blur layer (pseudo element) */}\n <div\n className=\"absolute inset-0\"\n style={{\n zIndex: blurLevels.length,\n backdropFilter: `blur(${blurLevels[blurLevels.length - 1]}px)`,\n WebkitBackdropFilter: `blur(${blurLevels[blurLevels.length - 1]}px)`,\n maskImage:\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) 87.5%, rgba(0,0,0,1) 100%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) 87.5%, rgba(0,0,0,1) 100%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`,\n WebkitMaskImage:\n position === \"bottom\"\n ? `linear-gradient(to bottom, rgba(0,0,0,0) 87.5%, rgba(0,0,0,1) 100%)`\n : position === \"top\"\n ? `linear-gradient(to top, rgba(0,0,0,0) 87.5%, rgba(0,0,0,1) 100%)`\n : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)`,\n }}\n />\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/pulsating-button-demo.json b/apps/www/public/r/pulsating-button-demo.json
index 3953245b..85aefe9b 100644
--- a/apps/www/public/r/pulsating-button-demo.json
+++ b/apps/www/public/r/pulsating-button-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/pulsating-button-demo.tsx",
- "content": "import { PulsatingButton } from \"@/registry/magicui/pulsating-button\";\n\nexport default function PulsatingButtonDemo() {\n return <PulsatingButton>Join Affiliate Program</PulsatingButton>;\n}\n",
+ "content": "import { PulsatingButton } from \"@/registry/magicui/pulsating-button\"\n\nexport default function PulsatingButtonDemo() {\n return <PulsatingButton>Join Affiliate Program</PulsatingButton>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/pulsating-button.json b/apps/www/public/r/pulsating-button.json
index ec3e3b30..9864d843 100644
--- a/apps/www/public/r/pulsating-button.json
+++ b/apps/www/public/r/pulsating-button.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/pulsating-button.tsx",
- "content": "import React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\ninterface PulsatingButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n pulseColor?: string;\n duration?: string;\n}\n\nexport const PulsatingButton = React.forwardRef<\n HTMLButtonElement,\n PulsatingButtonProps\n>(\n (\n {\n className,\n children,\n pulseColor = \"#808080\",\n duration = \"1.5s\",\n ...props\n },\n ref,\n ) => {\n return (\n <button\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer items-center justify-center rounded-lg bg-primary px-4 py-2 text-center text-primary-foreground\",\n className,\n )}\n style={\n {\n \"--pulse-color\": pulseColor,\n \"--duration\": duration,\n } as React.CSSProperties\n }\n {...props}\n >\n <div className=\"relative z-10\">{children}</div>\n <div className=\"absolute left-1/2 top-1/2 size-full -translate-x-1/2 -translate-y-1/2 animate-pulse rounded-lg bg-inherit\" />\n </button>\n );\n },\n);\n\nPulsatingButton.displayName = \"PulsatingButton\";\n",
+ "content": "import React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface PulsatingButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n pulseColor?: string\n duration?: string\n}\n\nexport const PulsatingButton = React.forwardRef<\n HTMLButtonElement,\n PulsatingButtonProps\n>(\n (\n {\n className,\n children,\n pulseColor = \"#808080\",\n duration = \"1.5s\",\n ...props\n },\n ref\n ) => {\n return (\n <button\n ref={ref}\n className={cn(\n \"bg-primary text-primary-foreground relative flex cursor-pointer items-center justify-center rounded-lg px-4 py-2 text-center\",\n className\n )}\n style={\n {\n \"--pulse-color\": pulseColor,\n \"--duration\": duration,\n } as React.CSSProperties\n }\n {...props}\n >\n <div className=\"relative z-10\">{children}</div>\n <div className=\"absolute top-1/2 left-1/2 size-full -translate-x-1/2 -translate-y-1/2 animate-pulse rounded-lg bg-inherit\" />\n </button>\n )\n }\n)\n\nPulsatingButton.displayName = \"PulsatingButton\"\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/rainbow-button-demo-2.json b/apps/www/public/r/rainbow-button-demo-2.json
index 86cfe0fd..f51032c1 100644
--- a/apps/www/public/r/rainbow-button-demo-2.json
+++ b/apps/www/public/r/rainbow-button-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/rainbow-button-demo-2.tsx",
- "content": "import { RainbowButton } from \"@/registry/magicui/rainbow-button\";\n\nexport default function RainbowButtonDemo() {\n return <RainbowButton variant=\"outline\">Get Unlimited Access</RainbowButton>;\n}\n",
+ "content": "import { RainbowButton } from \"@/registry/magicui/rainbow-button\"\n\nexport default function RainbowButtonDemo() {\n return <RainbowButton variant=\"outline\">Get Unlimited Access</RainbowButton>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/rainbow-button-demo.json b/apps/www/public/r/rainbow-button-demo.json
index 13bc0992..9f27f8c6 100644
--- a/apps/www/public/r/rainbow-button-demo.json
+++ b/apps/www/public/r/rainbow-button-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/rainbow-button-demo.tsx",
- "content": "import { RainbowButton } from \"@/registry/magicui/rainbow-button\";\n\nexport default function RainbowButtonDemo() {\n return <RainbowButton>Get Unlimited Access</RainbowButton>;\n}\n",
+ "content": "import { RainbowButton } from \"@/registry/magicui/rainbow-button\"\n\nexport default function RainbowButtonDemo() {\n return <RainbowButton>Get Unlimited Access</RainbowButton>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/rainbow-button.json b/apps/www/public/r/rainbow-button.json
index 69db179a..9dfe5dc7 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 { cn } from \"@/lib/utils\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport React from \"react\";\n\ninterface RainbowButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {}\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:[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:[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 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, VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RainbowButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {}\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:[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:[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 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/retro-grid-demo.json b/apps/www/public/r/retro-grid-demo.json
index 35530282..e7f0ae1a 100644
--- a/apps/www/public/r/retro-grid-demo.json
+++ b/apps/www/public/r/retro-grid-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/retro-grid-demo.tsx",
- "content": "\"use client\";\n\nimport { RetroGrid } from \"@/registry/magicui/retro-grid\";\n\nexport default function RetroGridDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <span className=\"pointer-events-none z-10 whitespace-pre-wrap bg-gradient-to-b from-[#ffd319] via-[#ff2975] to-[#8c1eff] bg-clip-text text-center text-7xl font-bold leading-none tracking-tighter text-transparent\">\n Retro Grid\n </span>\n\n <RetroGrid />\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { RetroGrid } from \"@/registry/magicui/retro-grid\"\n\nexport default function RetroGridDemo() {\n return (\n <div className=\"bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <span className=\"pointer-events-none z-10 bg-gradient-to-b from-[#ffd319] via-[#ff2975] to-[#8c1eff] bg-clip-text text-center text-7xl leading-none font-bold tracking-tighter whitespace-pre-wrap text-transparent\">\n Retro Grid\n </span>\n\n <RetroGrid />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/retro-grid.json b/apps/www/public/r/retro-grid.json
index edafbc1e..1426369a 100644
--- a/apps/www/public/r/retro-grid.json
+++ b/apps/www/public/r/retro-grid.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/retro-grid.tsx",
- "content": "import { cn } from \"@/lib/utils\";\n\ninterface RetroGridProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Additional CSS classes to apply to the grid container\n */\n className?: string;\n /**\n * Rotation angle of the grid in degrees\n * @default 65\n */\n angle?: number;\n /**\n * Grid cell size in pixels\n * @default 60\n */\n cellSize?: number;\n /**\n * Grid opacity value between 0 and 1\n * @default 0.5\n */\n opacity?: number;\n /**\n * Grid line color in light mode\n * @default \"gray\"\n */\n lightLineColor?: string;\n /**\n * Grid line color in dark mode\n * @default \"gray\"\n */\n darkLineColor?: string;\n}\n\nexport function RetroGrid({\n className,\n angle = 65,\n cellSize = 60,\n opacity = 0.5,\n lightLineColor = \"gray\",\n darkLineColor = \"gray\",\n ...props\n}: RetroGridProps) {\n const gridStyles = {\n \"--grid-angle\": `${angle}deg`,\n \"--cell-size\": `${cellSize}px`,\n \"--opacity\": opacity,\n \"--light-line\": lightLineColor,\n \"--dark-line\": darkLineColor,\n } as React.CSSProperties;\n\n return (\n <div\n className={cn(\n \"pointer-events-none absolute size-full overflow-hidden [perspective:200px]\",\n `opacity-[var(--opacity)]`,\n className,\n )}\n style={gridStyles}\n {...props}\n >\n <div className=\"absolute inset-0 [transform:rotateX(var(--grid-angle))]\">\n <div className=\"animate-grid [background-image:linear-gradient(to_right,var(--light-line)_1px,transparent_0),linear-gradient(to_bottom,var(--light-line)_1px,transparent_0)] [background-repeat:repeat] [background-size:var(--cell-size)_var(--cell-size)] [height:300vh] [inset:0%_0px] [margin-left:-200%] [transform-origin:100%_0_0] [width:600vw] dark:[background-image:linear-gradient(to_right,var(--dark-line)_1px,transparent_0),linear-gradient(to_bottom,var(--dark-line)_1px,transparent_0)]\" />\n </div>\n\n <div className=\"absolute inset-0 bg-gradient-to-t from-white to-transparent to-90% dark:from-black\" />\n </div>\n );\n}\n",
+ "content": "import { cn } from \"@/lib/utils\"\n\ninterface RetroGridProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Additional CSS classes to apply to the grid container\n */\n className?: string\n /**\n * Rotation angle of the grid in degrees\n * @default 65\n */\n angle?: number\n /**\n * Grid cell size in pixels\n * @default 60\n */\n cellSize?: number\n /**\n * Grid opacity value between 0 and 1\n * @default 0.5\n */\n opacity?: number\n /**\n * Grid line color in light mode\n * @default \"gray\"\n */\n lightLineColor?: string\n /**\n * Grid line color in dark mode\n * @default \"gray\"\n */\n darkLineColor?: string\n}\n\nexport function RetroGrid({\n className,\n angle = 65,\n cellSize = 60,\n opacity = 0.5,\n lightLineColor = \"gray\",\n darkLineColor = \"gray\",\n ...props\n}: RetroGridProps) {\n const gridStyles = {\n \"--grid-angle\": `${angle}deg`,\n \"--cell-size\": `${cellSize}px`,\n \"--opacity\": opacity,\n \"--light-line\": lightLineColor,\n \"--dark-line\": darkLineColor,\n } as React.CSSProperties\n\n return (\n <div\n className={cn(\n \"pointer-events-none absolute size-full overflow-hidden [perspective:200px]\",\n `opacity-[var(--opacity)]`,\n className\n )}\n style={gridStyles}\n {...props}\n >\n <div className=\"absolute inset-0 [transform:rotateX(var(--grid-angle))]\">\n <div className=\"animate-grid [inset:0%_0px] [margin-left:-200%] [height:300vh] [width:600vw] [transform-origin:100%_0_0] [background-image:linear-gradient(to_right,var(--light-line)_1px,transparent_0),linear-gradient(to_bottom,var(--light-line)_1px,transparent_0)] [background-size:var(--cell-size)_var(--cell-size)] [background-repeat:repeat] dark:[background-image:linear-gradient(to_right,var(--dark-line)_1px,transparent_0),linear-gradient(to_bottom,var(--dark-line)_1px,transparent_0)]\" />\n </div>\n\n <div className=\"absolute inset-0 bg-gradient-to-t from-white to-transparent to-90% dark:from-black\" />\n </div>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/ripple-button-demo.json b/apps/www/public/r/ripple-button-demo.json
index b33b9817..8dfdb8a6 100644
--- a/apps/www/public/r/ripple-button-demo.json
+++ b/apps/www/public/r/ripple-button-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/ripple-button-demo.tsx",
- "content": "import { RippleButton } from \"@/registry/magicui/ripple-button\";\n\nexport default function RippleButtonDemo() {\n return <RippleButton rippleColor=\"#ADD8E6\">Click me</RippleButton>;\n}\n",
+ "content": "import { RippleButton } from \"@/registry/magicui/ripple-button\"\n\nexport default function RippleButtonDemo() {\n return <RippleButton rippleColor=\"#ADD8E6\">Click me</RippleButton>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/ripple-button.json b/apps/www/public/r/ripple-button.json
index ee954404..38afe9b8 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 { cn } from \"@/lib/utils\";\nimport React, { MouseEvent, useEffect, useState } from \"react\";\n\ninterface RippleButtonProps\n 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 if (buttonRipples.length > 0) {\n const lastRipple = buttonRipples[buttonRipples.length - 1];\n const timeout = setTimeout(() => {\n setButtonRipples((prevRipples) =>\n prevRipples.filter((ripple) => ripple.key !== lastRipple.key),\n );\n }, parseInt(duration));\n return () => clearTimeout(timeout);\n }\n }, [buttonRipples, duration]);\n\n return (\n <button\n className={cn(\n \"relative flex cursor-pointer items-center justify-center overflow-hidden rounded-lg border-2 bg-background px-4 py-2 text-center text-primary\",\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=\"absolute animate-rippling rounded-full bg-background opacity-30\"\n key={ripple.key}\n style={{\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 }}\n />\n ))}\n </span>\n </button>\n );\n },\n);\n\nRippleButton.displayName = \"RippleButton\";\n",
+ "content": "\"use client\"\n\nimport React, { MouseEvent, useEffect, useState } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RippleButtonProps\n 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 if (buttonRipples.length > 0) {\n const lastRipple = buttonRipples[buttonRipples.length - 1]\n const timeout = setTimeout(() => {\n setButtonRipples((prevRipples) =>\n prevRipples.filter((ripple) => ripple.key !== lastRipple.key)\n )\n }, parseInt(duration))\n return () => clearTimeout(timeout)\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 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 }}\n />\n ))}\n </span>\n </button>\n )\n }\n)\n\nRippleButton.displayName = \"RippleButton\"\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/ripple-demo.json b/apps/www/public/r/ripple-demo.json
index 1468a5d3..343c79a6 100644
--- a/apps/www/public/r/ripple-demo.json
+++ b/apps/www/public/r/ripple-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/ripple-demo.tsx",
- "content": "import { Ripple } from \"@/registry/magicui/ripple\";\n\nexport default function RippleDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border bg-background\">\n <p className=\"z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-white\">\n Ripple\n </p>\n <Ripple />\n </div>\n );\n}\n",
+ "content": "import { Ripple } from \"@/registry/magicui/ripple\"\n\nexport default function RippleDemo() {\n return (\n <div className=\"bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <p className=\"z-10 text-center text-5xl font-medium tracking-tighter whitespace-pre-wrap text-white\">\n Ripple\n </p>\n <Ripple />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/ripple.json b/apps/www/public/r/ripple.json
index d6787320..e6ba0188 100644
--- a/apps/www/public/r/ripple.json
+++ b/apps/www/public/r/ripple.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/ripple.tsx",
- "content": "import React, { ComponentPropsWithoutRef, CSSProperties } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface RippleProps extends ComponentPropsWithoutRef<\"div\"> {\n mainCircleSize?: number;\n mainCircleOpacity?: number;\n numCircles?: number;\n}\n\nexport const Ripple = React.memo(function Ripple({\n mainCircleSize = 210,\n mainCircleOpacity = 0.24,\n numCircles = 8,\n className,\n ...props\n}: RippleProps) {\n return (\n <div\n className={cn(\n \"pointer-events-none absolute inset-0 select-none [mask-image:linear-gradient(to_bottom,white,transparent)]\",\n className,\n )}\n {...props}\n >\n {Array.from({ length: numCircles }, (_, i) => {\n const size = mainCircleSize + i * 70;\n const opacity = mainCircleOpacity - i * 0.03;\n const animationDelay = `${i * 0.06}s`;\n const borderStyle = \"solid\";\n\n return (\n <div\n key={i}\n className={`absolute animate-ripple rounded-full border bg-foreground/25 shadow-xl`}\n style={\n {\n \"--i\": i,\n width: `${size}px`,\n height: `${size}px`,\n opacity,\n animationDelay,\n borderStyle,\n borderWidth: \"1px\",\n borderColor: `var(--foreground)`,\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%) scale(1)\",\n } as CSSProperties\n }\n />\n );\n })}\n </div>\n );\n});\n\nRipple.displayName = \"Ripple\";\n",
+ "content": "import React, { ComponentPropsWithoutRef, CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RippleProps extends ComponentPropsWithoutRef<\"div\"> {\n mainCircleSize?: number\n mainCircleOpacity?: number\n numCircles?: number\n}\n\nexport const Ripple = React.memo(function Ripple({\n mainCircleSize = 210,\n mainCircleOpacity = 0.24,\n numCircles = 8,\n className,\n ...props\n}: RippleProps) {\n return (\n <div\n className={cn(\n \"pointer-events-none absolute inset-0 [mask-image:linear-gradient(to_bottom,white,transparent)] select-none\",\n className\n )}\n {...props}\n >\n {Array.from({ length: numCircles }, (_, i) => {\n const size = mainCircleSize + i * 70\n const opacity = mainCircleOpacity - i * 0.03\n const animationDelay = `${i * 0.06}s`\n const borderStyle = \"solid\"\n\n return (\n <div\n key={i}\n className={`animate-ripple bg-foreground/25 absolute rounded-full border shadow-xl`}\n style={\n {\n \"--i\": i,\n width: `${size}px`,\n height: `${size}px`,\n opacity,\n animationDelay,\n borderStyle,\n borderWidth: \"1px\",\n borderColor: `var(--foreground)`,\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%) scale(1)\",\n } as CSSProperties\n }\n />\n )\n })}\n </div>\n )\n})\n\nRipple.displayName = \"Ripple\"\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/safari-demo-2.json b/apps/www/public/r/safari-demo-2.json
index e76125d9..80c43688 100644
--- a/apps/www/public/r/safari-demo-2.json
+++ b/apps/www/public/r/safari-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/safari-demo-2.tsx",
- "content": "import { Safari } from \"@/registry/magicui/safari\";\n\nexport default function SafariDemo() {\n return (\n <div className=\"w-[1203px]\">\n <Safari\n url=\"magicui.design\"\n imageSrc=\"https://placehold.co/1200x750?text=Hello+World\"\n />\n </div>\n );\n}\n",
+ "content": "import { Safari } from \"@/registry/magicui/safari\"\n\nexport default function SafariDemo() {\n return (\n <div className=\"w-[1203px]\">\n <Safari\n url=\"magicui.design\"\n imageSrc=\"https://placehold.co/1200x750?text=Hello+World\"\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/safari-demo-3.json b/apps/www/public/r/safari-demo-3.json
index 6e116e6c..ab093032 100644
--- a/apps/www/public/r/safari-demo-3.json
+++ b/apps/www/public/r/safari-demo-3.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/safari-demo-3.tsx",
- "content": "import { Safari } from \"@/registry/magicui/safari\";\n\nexport default function SafariDemo() {\n return (\n <div className=\"w-[1203px]\">\n <Safari\n url=\"magicui.design\"\n videoSrc=\"https://videos.pexels.com/video-files/27180348/12091515_2560_1440_50fps.mp4\"\n />\n </div>\n );\n}\n",
+ "content": "import { Safari } from \"@/registry/magicui/safari\"\n\nexport default function SafariDemo() {\n return (\n <div className=\"w-[1203px]\">\n <Safari\n url=\"magicui.design\"\n videoSrc=\"https://videos.pexels.com/video-files/27180348/12091515_2560_1440_50fps.mp4\"\n />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/safari-demo-4.json b/apps/www/public/r/safari-demo-4.json
index 22ab66ee..ea892ddb 100644
--- a/apps/www/public/r/safari-demo-4.json
+++ b/apps/www/public/r/safari-demo-4.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/safari-demo-4.tsx",
- "content": "import { Safari } from \"@/registry/magicui/safari\";\n\nexport default function SafariDemo() {\n return (\n <div className=\"w-[1203px]\">\n <Safari url=\"magicui.design\" mode=\"simple\" />\n </div>\n );\n}\n",
+ "content": "import { Safari } from \"@/registry/magicui/safari\"\n\nexport default function SafariDemo() {\n return (\n <div className=\"w-[1203px]\">\n <Safari url=\"magicui.design\" mode=\"simple\" />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/safari-demo.json b/apps/www/public/r/safari-demo.json
index 181dd421..66a56fc1 100644
--- a/apps/www/public/r/safari-demo.json
+++ b/apps/www/public/r/safari-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/safari-demo.tsx",
- "content": "import { Safari } from \"@/registry/magicui/safari\";\n\nexport default function SafariDemo() {\n return (\n <div className=\"w-[1203px]\">\n <Safari url=\"magicui.design\" />\n </div>\n );\n}\n",
+ "content": "import { Safari } from \"@/registry/magicui/safari\"\n\nexport default function SafariDemo() {\n return (\n <div className=\"w-[1203px]\">\n <Safari url=\"magicui.design\" />\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/safari.json b/apps/www/public/r/safari.json
index b896249b..2b2fb83a 100644
--- a/apps/www/public/r/safari.json
+++ b/apps/www/public/r/safari.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/safari.tsx",
- "content": "import type { HTMLAttributes } from \"react\";\n\nconst SAFARI_WIDTH = 1203;\nconst SAFARI_HEIGHT = 753;\nconst SCREEN_X = 1;\nconst SCREEN_Y = 52;\nconst SCREEN_WIDTH = 1200;\nconst SCREEN_HEIGHT = 700;\n\n// Calculated percentages\nconst LEFT_PCT = (SCREEN_X / SAFARI_WIDTH) * 100;\nconst TOP_PCT = (SCREEN_Y / SAFARI_HEIGHT) * 100;\nconst WIDTH_PCT = (SCREEN_WIDTH / SAFARI_WIDTH) * 100;\nconst HEIGHT_PCT = (SCREEN_HEIGHT / SAFARI_HEIGHT) * 100;\n\ntype SafariMode = \"default\" | \"simple\";\n\nexport interface SafariProps extends HTMLAttributes<HTMLDivElement> {\n url?: string;\n imageSrc?: string;\n videoSrc?: string;\n mode?: SafariMode;\n}\n\nexport function Safari({\n imageSrc,\n videoSrc,\n url,\n mode = \"default\",\n className,\n style,\n ...props\n}: SafariProps) {\n const hasVideo = !!videoSrc;\n const hasMedia = hasVideo || !!imageSrc;\n\n return (\n <div\n className={`relative inline-block w-full align-middle leading-none ${className ?? \"\"}`}\n style={{\n aspectRatio: `${SAFARI_WIDTH}/${SAFARI_HEIGHT}`,\n ...style,\n }}\n {...props}\n >\n {hasVideo && (\n <div\n className=\"pointer-events-none absolute z-0 overflow-hidden\"\n style={{\n left: `${LEFT_PCT}%`,\n top: `${TOP_PCT}%`,\n width: `${WIDTH_PCT}%`,\n height: `${HEIGHT_PCT}%`,\n }}\n >\n <video\n className=\"block size-full object-cover\"\n src={videoSrc}\n autoPlay\n loop\n muted\n playsInline\n preload=\"metadata\"\n />\n </div>\n )}\n\n {!hasVideo && imageSrc && (\n <div\n className=\"pointer-events-none absolute z-0 overflow-hidden\"\n style={{\n left: `${LEFT_PCT}%`,\n top: `${TOP_PCT}%`,\n width: `${WIDTH_PCT}%`,\n height: `${HEIGHT_PCT}%`,\n borderRadius: \"0 0 11px 11px\",\n }}\n >\n <img\n src={imageSrc}\n alt=\"\"\n className=\"block size-full object-cover object-top\"\n />\n </div>\n )}\n\n <svg\n viewBox={`0 0 ${SAFARI_WIDTH} ${SAFARI_HEIGHT}`}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"absolute inset-0 z-10 size-full\"\n style={{ transform: \"translateZ(0)\" }}\n >\n <defs>\n <mask id=\"safariPunch\" maskUnits=\"userSpaceOnUse\">\n <rect\n x=\"0\"\n y=\"0\"\n width={SAFARI_WIDTH}\n height={SAFARI_HEIGHT}\n fill=\"white\"\n />\n <path\n d=\"M1 52H1201V741C1201 747.075 1196.08 752 1190 752H12C5.92486 752 1 747.075 1 741V52Z\"\n fill=\"black\"\n />\n </mask>\n\n <clipPath id=\"path0\">\n <rect width={SAFARI_WIDTH} height={SAFARI_HEIGHT} fill=\"white\" />\n </clipPath>\n\n <clipPath id=\"roundedBottom\">\n <path\n d=\"M1 52H1201V741C1201 747.075 1196.08 752 1190 752H12C5.92486 752 1 747.075 1 741V52Z\"\n fill=\"white\"\n />\n </clipPath>\n </defs>\n\n <g\n clipPath=\"url(#path0)\"\n mask={hasMedia ? \"url(#safariPunch)\" : undefined}\n >\n <path\n d=\"M0 52H1202V741C1202 747.627 1196.63 753 1190 753H12C5.37258 753 0 747.627 0 741V52Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0 12C0 5.37258 5.37258 0 12 0H1190C1196.63 0 1202 5.37258 1202 12V52H0L0 12Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M1.06738 12C1.06738 5.92487 5.99225 1 12.0674 1H1189.93C1196.01 1 1200.93 5.92487 1200.93 12V51H1.06738V12Z\"\n className=\"fill-white dark:fill-[#262626]\"\n />\n <circle\n cx=\"27\"\n cy=\"25\"\n r=\"6\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <circle\n cx=\"47\"\n cy=\"25\"\n r=\"6\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <circle\n cx=\"67\"\n cy=\"25\"\n r=\"6\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M286 17C286 13.6863 288.686 11 292 11H946C949.314 11 952 13.6863 952 17V35C952 38.3137 949.314 41 946 41H292C288.686 41 286 38.3137 286 35V17Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M566.269 32.0852H572.426C573.277 32.0852 573.696 31.6663 573.696 30.7395V25.9851C573.696 25.1472 573.353 24.7219 572.642 24.6521V23.0842C572.642 20.6721 571.036 19.5105 569.348 19.5105C567.659 19.5105 566.053 20.6721 566.053 23.0842V24.6711C565.393 24.7727 565 25.1917 565 25.9851V30.7395C565 31.6663 565.418 32.0852 566.269 32.0852ZM567.272 22.97C567.272 21.491 568.211 20.6785 569.348 20.6785C570.478 20.6785 571.423 21.491 571.423 22.97V24.6394L567.272 24.6458V22.97Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n\n <g className=\"mix-blend-luminosity\">\n <text\n x=\"580\"\n y=\"30\"\n fill=\"#A3A3A3\"\n fontSize=\"12\"\n fontFamily=\"Arial, sans-serif\"\n >\n {url}\n </text>\n </g>\n\n {mode === \"default\" ? (\n <>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M265.5 33.8984C265.641 33.8984 265.852 33.8516 266.047 33.7422C270.547 31.2969 272.109 30.1641 272.109 27.3203V21.4219C272.109 20.4844 271.742 20.1484 270.961 19.8125C270.094 19.4453 267.18 18.4297 266.328 18.1406C266.07 18.0547 265.766 18 265.5 18C265.234 18 264.93 18.0703 264.672 18.1406C263.82 18.3828 260.906 19.4531 260.039 19.8125C259.258 20.1406 258.891 20.4844 258.891 21.4219V27.3203C258.891 30.1641 260.461 31.2812 264.945 33.7422C265.148 33.8516 265.359 33.8984 265.5 33.8984ZM265.922 19.5781C266.945 19.9766 269.172 20.7656 270.344 21.1875C270.562 21.2656 270.617 21.3828 270.617 21.6641V27.0234C270.617 29.3125 269.469 29.9375 265.945 32.0625C265.727 32.1875 265.617 32.2344 265.508 32.2344V19.4844C265.617 19.4844 265.734 19.5156 265.922 19.5781Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M936.273 24.9766C936.5 24.9766 936.68 24.9062 936.82 24.7578L940.023 21.5312C940.195 21.3594 940.273 21.1719 940.273 20.9531C940.273 20.7422 940.188 20.5391 940.023 20.3828L936.82 17.125C936.68 16.9688 936.5 16.8906 936.273 16.8906C935.852 16.8906 935.516 17.2422 935.516 17.6719C935.516 17.8828 935.594 18.0547 935.727 18.2031L937.594 20.0312C937.227 19.9766 936.852 19.9453 936.477 19.9453C932.609 19.9453 929.516 23.0391 929.516 26.9141C929.516 30.7891 932.633 33.9062 936.5 33.9062C940.375 33.9062 943.484 30.7891 943.484 26.9141C943.484 26.4453 943.156 26.1094 942.688 26.1094C942.234 26.1094 941.93 26.4453 941.93 26.9141C941.93 29.9297 939.516 32.3516 936.5 32.3516C933.492 32.3516 931.07 29.9297 931.07 26.9141C931.07 23.875 933.469 21.4688 936.477 21.4688C936.984 21.4688 937.453 21.5078 937.867 21.5781L935.734 23.6875C935.594 23.8281 935.516 24 935.516 24.2109C935.516 24.6406 935.852 24.9766 936.273 24.9766Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M1134 33.0156C1134.49 33.0156 1134.89 32.6094 1134.89 32.1484V27.2578H1139.66C1140.13 27.2578 1140.54 26.8594 1140.54 26.3672C1140.54 25.8828 1140.13 25.4766 1139.66 25.4766H1134.89V20.5859C1134.89 20.1172 1134.49 19.7188 1134 19.7188C1133.52 19.7188 1133.11 20.1172 1133.11 20.5859V25.4766H1128.34C1127.88 25.4766 1127.46 25.8828 1127.46 26.3672C1127.46 26.8594 1127.88 27.2578 1128.34 27.2578H1133.11V32.1484C1133.11 32.6094 1133.52 33.0156 1134 33.0156Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M1161.8 31.0703H1163.23V32.375C1163.23 34.0547 1164.12 34.9219 1165.81 34.9219H1174.2C1175.89 34.9219 1176.77 34.0547 1176.77 32.3828V24.0469C1176.77 22.375 1175.89 21.5 1174.2 21.5H1172.77V20.2578C1172.77 18.5859 1171.88 17.7109 1170.19 17.7109H1161.8C1160.1 17.7109 1159.23 18.5781 1159.23 20.2578V28.5234C1159.23 30.1953 1160.1 31.0703 1161.8 31.0703ZM1161.9 29.5078C1161.18 29.5078 1160.78 29.1328 1160.78 28.3828V20.3984C1160.78 19.6406 1161.18 19.2656 1161.9 19.2656H1170.09C1170.8 19.2656 1171.2 19.6406 1171.2 20.3984V21.5H1165.81C1164.12 21.5 1163.23 22.375 1163.23 24.0469V29.5078H1161.9ZM1165.91 33.3672C1165.19 33.3672 1164.8 32.9922 1164.8 32.2422V24.1875C1164.8 23.4297 1165.19 23.0625 1165.91 23.0625H1174.1C1174.81 23.0625 1175.21 23.4297 1175.21 24.1875V32.2422C1175.21 32.9922 1174.81 33.3672 1174.1 33.3672H1165.91Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M1099.51 28.4141C1099.91 28.4141 1100.24 28.0859 1100.24 27.6953V19.8359L1100.18 18.6797L1100.66 19.25L1101.75 20.4141C1101.88 20.5547 1102.06 20.625 1102.24 20.625C1102.6 20.625 1102.9 20.3672 1102.9 20C1102.9 19.8047 1102.82 19.6641 1102.69 19.5312L1100.06 17.0078C1099.88 16.8203 1099.7 16.7578 1099.51 16.7578C1099.32 16.7578 1099.14 16.8203 1098.95 17.0078L1096.33 19.5312C1096.2 19.6641 1096.12 19.8047 1096.12 20C1096.12 20.3672 1096.41 20.625 1096.77 20.625C1096.95 20.625 1097.14 20.5547 1097.27 20.4141L1098.35 19.25L1098.84 18.6719L1098.78 19.8359V27.6953C1098.78 28.0859 1099.11 28.4141 1099.51 28.4141ZM1095 34.6562H1104C1105.7 34.6562 1106.57 33.7812 1106.57 32.1094V24.4297C1106.57 22.7578 1105.7 21.8828 1104 21.8828H1101.89V23.4375H1103.9C1104.61 23.4375 1105.02 23.8125 1105.02 24.5625V31.9688C1105.02 32.7188 1104.61 33.0938 1103.9 33.0938H1095.1C1094.38 33.0938 1093.98 32.7188 1093.98 31.9688V24.5625C1093.98 23.8125 1094.38 23.4375 1095.1 23.4375H1097.13V21.8828H1095C1093.31 21.8828 1092.43 22.75 1092.43 24.4297V32.1094C1092.43 33.7812 1093.31 34.6562 1095 34.6562Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M99.5703 33.6016H112.938C114.633 33.6016 115.516 32.7266 115.516 31.0547V21.5469C115.516 19.875 114.633 19 112.938 19H99.5703C97.8828 19 97 19.8672 97 21.5469V31.0547C97 32.7266 97.8828 33.6016 99.5703 33.6016ZM99.6719 32.0469C98.9531 32.0469 98.5547 31.6719 98.5547 30.9141V21.6875C98.5547 20.9297 98.9531 20.5547 99.6719 20.5547H103.234V32.0469H99.6719ZM112.836 20.5547C113.555 20.5547 113.953 20.9297 113.953 21.6875V30.9141C113.953 31.6719 113.555 32.0469 112.836 32.0469H104.711V20.5547H112.836ZM101.703 23.4141C101.984 23.4141 102.219 23.1719 102.219 22.9062C102.219 22.6406 101.984 22.4062 101.703 22.4062H100.102C99.8203 22.4062 99.5859 22.6406 99.5859 22.9062C99.5859 23.1719 99.8203 23.4141 100.102 23.4141H101.703ZM101.703 25.5156C101.984 25.5156 102.219 25.2812 102.219 25.0078C102.219 24.7422 101.984 24.5078 101.703 24.5078H100.102C99.8203 24.5078 99.5859 24.7422 99.5859 25.0078C99.5859 25.2812 99.8203 25.5156 100.102 25.5156H101.703ZM101.703 27.6094C101.984 27.6094 102.219 27.3828 102.219 27.1094C102.219 26.8438 101.984 26.6172 101.703 26.6172H100.102C99.8203 26.6172 99.5859 26.8438 99.5859 27.1094C99.5859 27.3828 99.8203 27.6094 100.102 27.6094H101.703Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M143.914 32.5938C144.094 32.7656 144.312 32.8594 144.562 32.8594C145.086 32.8594 145.492 32.4531 145.492 31.9375C145.492 31.6797 145.391 31.4453 145.211 31.2656L139.742 25.9219L145.211 20.5938C145.391 20.4141 145.492 20.1719 145.492 19.9219C145.492 19.4062 145.086 19 144.562 19C144.312 19 144.094 19.0938 143.922 19.2656L137.844 25.2031C137.625 25.4062 137.516 25.6562 137.516 25.9297C137.516 26.2031 137.625 26.4375 137.836 26.6484L143.914 32.5938Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M168.422 32.8594C168.68 32.8594 168.891 32.7656 169.07 32.5938L175.148 26.6562C175.359 26.4375 175.469 26.2109 175.469 25.9297C175.469 25.6562 175.367 25.4141 175.148 25.2109L169.07 19.2656C168.891 19.0938 168.68 19 168.422 19C167.898 19 167.492 19.4062 167.492 19.9219C167.492 20.1719 167.602 20.4141 167.773 20.5938L173.25 25.9375L167.773 31.2656C167.594 31.4531 167.492 31.6797 167.492 31.9375C167.492 32.4531 167.898 32.8594 168.422 32.8594Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n </>\n ) : null}\n </g>\n </svg>\n </div>\n );\n}\n",
+ "content": "import type { HTMLAttributes } from \"react\"\n\nconst SAFARI_WIDTH = 1203\nconst SAFARI_HEIGHT = 753\nconst SCREEN_X = 1\nconst SCREEN_Y = 52\nconst SCREEN_WIDTH = 1200\nconst SCREEN_HEIGHT = 700\n\n// Calculated percentages\nconst LEFT_PCT = (SCREEN_X / SAFARI_WIDTH) * 100\nconst TOP_PCT = (SCREEN_Y / SAFARI_HEIGHT) * 100\nconst WIDTH_PCT = (SCREEN_WIDTH / SAFARI_WIDTH) * 100\nconst HEIGHT_PCT = (SCREEN_HEIGHT / SAFARI_HEIGHT) * 100\n\ntype SafariMode = \"default\" | \"simple\"\n\nexport interface SafariProps extends HTMLAttributes<HTMLDivElement> {\n url?: string\n imageSrc?: string\n videoSrc?: string\n mode?: SafariMode\n}\n\nexport function Safari({\n imageSrc,\n videoSrc,\n url,\n mode = \"default\",\n className,\n style,\n ...props\n}: SafariProps) {\n const hasVideo = !!videoSrc\n const hasMedia = hasVideo || !!imageSrc\n\n return (\n <div\n className={`relative inline-block w-full align-middle leading-none ${className ?? \"\"}`}\n style={{\n aspectRatio: `${SAFARI_WIDTH}/${SAFARI_HEIGHT}`,\n ...style,\n }}\n {...props}\n >\n {hasVideo && (\n <div\n className=\"pointer-events-none absolute z-0 overflow-hidden\"\n style={{\n left: `${LEFT_PCT}%`,\n top: `${TOP_PCT}%`,\n width: `${WIDTH_PCT}%`,\n height: `${HEIGHT_PCT}%`,\n }}\n >\n <video\n className=\"block size-full object-cover\"\n src={videoSrc}\n autoPlay\n loop\n muted\n playsInline\n preload=\"metadata\"\n />\n </div>\n )}\n\n {!hasVideo && imageSrc && (\n <div\n className=\"pointer-events-none absolute z-0 overflow-hidden\"\n style={{\n left: `${LEFT_PCT}%`,\n top: `${TOP_PCT}%`,\n width: `${WIDTH_PCT}%`,\n height: `${HEIGHT_PCT}%`,\n borderRadius: \"0 0 11px 11px\",\n }}\n >\n <img\n src={imageSrc}\n alt=\"\"\n className=\"block size-full object-cover object-top\"\n />\n </div>\n )}\n\n <svg\n viewBox={`0 0 ${SAFARI_WIDTH} ${SAFARI_HEIGHT}`}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"absolute inset-0 z-10 size-full\"\n style={{ transform: \"translateZ(0)\" }}\n >\n <defs>\n <mask id=\"safariPunch\" maskUnits=\"userSpaceOnUse\">\n <rect\n x=\"0\"\n y=\"0\"\n width={SAFARI_WIDTH}\n height={SAFARI_HEIGHT}\n fill=\"white\"\n />\n <path\n d=\"M1 52H1201V741C1201 747.075 1196.08 752 1190 752H12C5.92486 752 1 747.075 1 741V52Z\"\n fill=\"black\"\n />\n </mask>\n\n <clipPath id=\"path0\">\n <rect width={SAFARI_WIDTH} height={SAFARI_HEIGHT} fill=\"white\" />\n </clipPath>\n\n <clipPath id=\"roundedBottom\">\n <path\n d=\"M1 52H1201V741C1201 747.075 1196.08 752 1190 752H12C5.92486 752 1 747.075 1 741V52Z\"\n fill=\"white\"\n />\n </clipPath>\n </defs>\n\n <g\n clipPath=\"url(#path0)\"\n mask={hasMedia ? \"url(#safariPunch)\" : undefined}\n >\n <path\n d=\"M0 52H1202V741C1202 747.627 1196.63 753 1190 753H12C5.37258 753 0 747.627 0 741V52Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0 12C0 5.37258 5.37258 0 12 0H1190C1196.63 0 1202 5.37258 1202 12V52H0L0 12Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M1.06738 12C1.06738 5.92487 5.99225 1 12.0674 1H1189.93C1196.01 1 1200.93 5.92487 1200.93 12V51H1.06738V12Z\"\n className=\"fill-white dark:fill-[#262626]\"\n />\n <circle\n cx=\"27\"\n cy=\"25\"\n r=\"6\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <circle\n cx=\"47\"\n cy=\"25\"\n r=\"6\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <circle\n cx=\"67\"\n cy=\"25\"\n r=\"6\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <path\n d=\"M286 17C286 13.6863 288.686 11 292 11H946C949.314 11 952 13.6863 952 17V35C952 38.3137 949.314 41 946 41H292C288.686 41 286 38.3137 286 35V17Z\"\n className=\"fill-[#E5E5E5] dark:fill-[#404040]\"\n />\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M566.269 32.0852H572.426C573.277 32.0852 573.696 31.6663 573.696 30.7395V25.9851C573.696 25.1472 573.353 24.7219 572.642 24.6521V23.0842C572.642 20.6721 571.036 19.5105 569.348 19.5105C567.659 19.5105 566.053 20.6721 566.053 23.0842V24.6711C565.393 24.7727 565 25.1917 565 25.9851V30.7395C565 31.6663 565.418 32.0852 566.269 32.0852ZM567.272 22.97C567.272 21.491 568.211 20.6785 569.348 20.6785C570.478 20.6785 571.423 21.491 571.423 22.97V24.6394L567.272 24.6458V22.97Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n\n <g className=\"mix-blend-luminosity\">\n <text\n x=\"580\"\n y=\"30\"\n fill=\"#A3A3A3\"\n fontSize=\"12\"\n fontFamily=\"Arial, sans-serif\"\n >\n {url}\n </text>\n </g>\n\n {mode === \"default\" ? (\n <>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M265.5 33.8984C265.641 33.8984 265.852 33.8516 266.047 33.7422C270.547 31.2969 272.109 30.1641 272.109 27.3203V21.4219C272.109 20.4844 271.742 20.1484 270.961 19.8125C270.094 19.4453 267.18 18.4297 266.328 18.1406C266.07 18.0547 265.766 18 265.5 18C265.234 18 264.93 18.0703 264.672 18.1406C263.82 18.3828 260.906 19.4531 260.039 19.8125C259.258 20.1406 258.891 20.4844 258.891 21.4219V27.3203C258.891 30.1641 260.461 31.2812 264.945 33.7422C265.148 33.8516 265.359 33.8984 265.5 33.8984ZM265.922 19.5781C266.945 19.9766 269.172 20.7656 270.344 21.1875C270.562 21.2656 270.617 21.3828 270.617 21.6641V27.0234C270.617 29.3125 269.469 29.9375 265.945 32.0625C265.727 32.1875 265.617 32.2344 265.508 32.2344V19.4844C265.617 19.4844 265.734 19.5156 265.922 19.5781Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M936.273 24.9766C936.5 24.9766 936.68 24.9062 936.82 24.7578L940.023 21.5312C940.195 21.3594 940.273 21.1719 940.273 20.9531C940.273 20.7422 940.188 20.5391 940.023 20.3828L936.82 17.125C936.68 16.9688 936.5 16.8906 936.273 16.8906C935.852 16.8906 935.516 17.2422 935.516 17.6719C935.516 17.8828 935.594 18.0547 935.727 18.2031L937.594 20.0312C937.227 19.9766 936.852 19.9453 936.477 19.9453C932.609 19.9453 929.516 23.0391 929.516 26.9141C929.516 30.7891 932.633 33.9062 936.5 33.9062C940.375 33.9062 943.484 30.7891 943.484 26.9141C943.484 26.4453 943.156 26.1094 942.688 26.1094C942.234 26.1094 941.93 26.4453 941.93 26.9141C941.93 29.9297 939.516 32.3516 936.5 32.3516C933.492 32.3516 931.07 29.9297 931.07 26.9141C931.07 23.875 933.469 21.4688 936.477 21.4688C936.984 21.4688 937.453 21.5078 937.867 21.5781L935.734 23.6875C935.594 23.8281 935.516 24 935.516 24.2109C935.516 24.6406 935.852 24.9766 936.273 24.9766Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M1134 33.0156C1134.49 33.0156 1134.89 32.6094 1134.89 32.1484V27.2578H1139.66C1140.13 27.2578 1140.54 26.8594 1140.54 26.3672C1140.54 25.8828 1140.13 25.4766 1139.66 25.4766H1134.89V20.5859C1134.89 20.1172 1134.49 19.7188 1134 19.7188C1133.52 19.7188 1133.11 20.1172 1133.11 20.5859V25.4766H1128.34C1127.88 25.4766 1127.46 25.8828 1127.46 26.3672C1127.46 26.8594 1127.88 27.2578 1128.34 27.2578H1133.11V32.1484C1133.11 32.6094 1133.52 33.0156 1134 33.0156Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M1161.8 31.0703H1163.23V32.375C1163.23 34.0547 1164.12 34.9219 1165.81 34.9219H1174.2C1175.89 34.9219 1176.77 34.0547 1176.77 32.3828V24.0469C1176.77 22.375 1175.89 21.5 1174.2 21.5H1172.77V20.2578C1172.77 18.5859 1171.88 17.7109 1170.19 17.7109H1161.8C1160.1 17.7109 1159.23 18.5781 1159.23 20.2578V28.5234C1159.23 30.1953 1160.1 31.0703 1161.8 31.0703ZM1161.9 29.5078C1161.18 29.5078 1160.78 29.1328 1160.78 28.3828V20.3984C1160.78 19.6406 1161.18 19.2656 1161.9 19.2656H1170.09C1170.8 19.2656 1171.2 19.6406 1171.2 20.3984V21.5H1165.81C1164.12 21.5 1163.23 22.375 1163.23 24.0469V29.5078H1161.9ZM1165.91 33.3672C1165.19 33.3672 1164.8 32.9922 1164.8 32.2422V24.1875C1164.8 23.4297 1165.19 23.0625 1165.91 23.0625H1174.1C1174.81 23.0625 1175.21 23.4297 1175.21 24.1875V32.2422C1175.21 32.9922 1174.81 33.3672 1174.1 33.3672H1165.91Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M1099.51 28.4141C1099.91 28.4141 1100.24 28.0859 1100.24 27.6953V19.8359L1100.18 18.6797L1100.66 19.25L1101.75 20.4141C1101.88 20.5547 1102.06 20.625 1102.24 20.625C1102.6 20.625 1102.9 20.3672 1102.9 20C1102.9 19.8047 1102.82 19.6641 1102.69 19.5312L1100.06 17.0078C1099.88 16.8203 1099.7 16.7578 1099.51 16.7578C1099.32 16.7578 1099.14 16.8203 1098.95 17.0078L1096.33 19.5312C1096.2 19.6641 1096.12 19.8047 1096.12 20C1096.12 20.3672 1096.41 20.625 1096.77 20.625C1096.95 20.625 1097.14 20.5547 1097.27 20.4141L1098.35 19.25L1098.84 18.6719L1098.78 19.8359V27.6953C1098.78 28.0859 1099.11 28.4141 1099.51 28.4141ZM1095 34.6562H1104C1105.7 34.6562 1106.57 33.7812 1106.57 32.1094V24.4297C1106.57 22.7578 1105.7 21.8828 1104 21.8828H1101.89V23.4375H1103.9C1104.61 23.4375 1105.02 23.8125 1105.02 24.5625V31.9688C1105.02 32.7188 1104.61 33.0938 1103.9 33.0938H1095.1C1094.38 33.0938 1093.98 32.7188 1093.98 31.9688V24.5625C1093.98 23.8125 1094.38 23.4375 1095.1 23.4375H1097.13V21.8828H1095C1093.31 21.8828 1092.43 22.75 1092.43 24.4297V32.1094C1092.43 33.7812 1093.31 34.6562 1095 34.6562Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M99.5703 33.6016H112.938C114.633 33.6016 115.516 32.7266 115.516 31.0547V21.5469C115.516 19.875 114.633 19 112.938 19H99.5703C97.8828 19 97 19.8672 97 21.5469V31.0547C97 32.7266 97.8828 33.6016 99.5703 33.6016ZM99.6719 32.0469C98.9531 32.0469 98.5547 31.6719 98.5547 30.9141V21.6875C98.5547 20.9297 98.9531 20.5547 99.6719 20.5547H103.234V32.0469H99.6719ZM112.836 20.5547C113.555 20.5547 113.953 20.9297 113.953 21.6875V30.9141C113.953 31.6719 113.555 32.0469 112.836 32.0469H104.711V20.5547H112.836ZM101.703 23.4141C101.984 23.4141 102.219 23.1719 102.219 22.9062C102.219 22.6406 101.984 22.4062 101.703 22.4062H100.102C99.8203 22.4062 99.5859 22.6406 99.5859 22.9062C99.5859 23.1719 99.8203 23.4141 100.102 23.4141H101.703ZM101.703 25.5156C101.984 25.5156 102.219 25.2812 102.219 25.0078C102.219 24.7422 101.984 24.5078 101.703 24.5078H100.102C99.8203 24.5078 99.5859 24.7422 99.5859 25.0078C99.5859 25.2812 99.8203 25.5156 100.102 25.5156H101.703ZM101.703 27.6094C101.984 27.6094 102.219 27.3828 102.219 27.1094C102.219 26.8438 101.984 26.6172 101.703 26.6172H100.102C99.8203 26.6172 99.5859 26.8438 99.5859 27.1094C99.5859 27.3828 99.8203 27.6094 100.102 27.6094H101.703Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M143.914 32.5938C144.094 32.7656 144.312 32.8594 144.562 32.8594C145.086 32.8594 145.492 32.4531 145.492 31.9375C145.492 31.6797 145.391 31.4453 145.211 31.2656L139.742 25.9219L145.211 20.5938C145.391 20.4141 145.492 20.1719 145.492 19.9219C145.492 19.4062 145.086 19 144.562 19C144.312 19 144.094 19.0938 143.922 19.2656L137.844 25.2031C137.625 25.4062 137.516 25.6562 137.516 25.9297C137.516 26.2031 137.625 26.4375 137.836 26.6484L143.914 32.5938Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n <g className=\"mix-blend-luminosity\">\n <path\n d=\"M168.422 32.8594C168.68 32.8594 168.891 32.7656 169.07 32.5938L175.148 26.6562C175.359 26.4375 175.469 26.2109 175.469 25.9297C175.469 25.6562 175.367 25.4141 175.148 25.2109L169.07 19.2656C168.891 19.0938 168.68 19 168.422 19C167.898 19 167.492 19.4062 167.492 19.9219C167.492 20.1719 167.602 20.4141 167.773 20.5938L173.25 25.9375L167.773 31.2656C167.594 31.4531 167.492 31.6797 167.492 31.9375C167.492 32.4531 167.898 32.8594 168.422 32.8594Z\"\n fill=\"#A3A3A3\"\n />\n </g>\n </>\n ) : null}\n </g>\n </svg>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/scratch-to-reveal-demo.json b/apps/www/public/r/scratch-to-reveal-demo.json
index bf59be28..dba2edd3 100644
--- a/apps/www/public/r/scratch-to-reveal-demo.json
+++ b/apps/www/public/r/scratch-to-reveal-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/scratch-to-reveal-demo.tsx",
- "content": "import { ScratchToReveal } from \"@/registry/magicui/scratch-to-reveal\";\n\nexport default function ScratchToRevealDemo() {\n return (\n <ScratchToReveal\n width={250}\n height={250}\n minScratchPercentage={70}\n className=\"flex items-center justify-center overflow-hidden rounded-2xl border-2 bg-gray-100\"\n gradientColors={[\"#A97CF8\", \"#F38CB8\", \"#FDCC92\"]}\n >\n <p className=\"text-9xl\">😎</p>\n </ScratchToReveal>\n );\n}\n",
+ "content": "import { ScratchToReveal } from \"@/registry/magicui/scratch-to-reveal\"\n\nexport default function ScratchToRevealDemo() {\n return (\n <ScratchToReveal\n width={250}\n height={250}\n minScratchPercentage={70}\n className=\"flex items-center justify-center overflow-hidden rounded-2xl border-2 bg-gray-100\"\n gradientColors={[\"#A97CF8\", \"#F38CB8\", \"#FDCC92\"]}\n >\n <p className=\"text-9xl\">😎</p>\n </ScratchToReveal>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/scratch-to-reveal.json b/apps/www/public/r/scratch-to-reveal.json
index aca66d86..cef31150 100644
--- a/apps/www/public/r/scratch-to-reveal.json
+++ b/apps/www/public/r/scratch-to-reveal.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/scratch-to-reveal.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { motion, useAnimation } from \"motion/react\";\nimport React, { useEffect, useRef, useState } from \"react\";\n\ninterface ScratchToRevealProps {\n children: React.ReactNode;\n width: number;\n height: number;\n minScratchPercentage?: number;\n className?: string;\n onComplete?: () => void;\n gradientColors?: [string, string, string];\n}\n\nexport const ScratchToReveal: React.FC<ScratchToRevealProps> = ({\n width,\n height,\n minScratchPercentage = 50,\n onComplete,\n children,\n className,\n gradientColors = [\"#A97CF8\", \"#F38CB8\", \"#FDCC92\"],\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [isScratching, setIsScratching] = useState(false);\n const [isComplete, setIsComplete] = useState(false);\n\n const controls = useAnimation();\n\n useEffect(() => {\n const canvas = canvasRef.current;\n const ctx = canvas?.getContext(\"2d\");\n if (canvas && ctx) {\n ctx.fillStyle = \"#ccc\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n const gradient = ctx.createLinearGradient(\n 0,\n 0,\n canvas.width,\n canvas.height,\n );\n gradient.addColorStop(0, gradientColors[0]);\n gradient.addColorStop(0.5, gradientColors[1]);\n gradient.addColorStop(1, gradientColors[2]);\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n }\n }, [gradientColors]);\n\n useEffect(() => {\n const handleDocumentMouseMove = (event: MouseEvent) => {\n if (!isScratching) return;\n scratch(event.clientX, event.clientY);\n };\n\n const handleDocumentTouchMove = (event: TouchEvent) => {\n if (!isScratching) return;\n const touch = event.touches[0];\n scratch(touch.clientX, touch.clientY);\n };\n\n const handleDocumentMouseUp = () => {\n setIsScratching(false);\n checkCompletion();\n };\n\n const handleDocumentTouchEnd = () => {\n setIsScratching(false);\n checkCompletion();\n };\n\n document.addEventListener(\"mousedown\", handleDocumentMouseMove);\n document.addEventListener(\"mousemove\", handleDocumentMouseMove);\n document.addEventListener(\"touchstart\", handleDocumentTouchMove);\n document.addEventListener(\"touchmove\", handleDocumentTouchMove);\n document.addEventListener(\"mouseup\", handleDocumentMouseUp);\n document.addEventListener(\"touchend\", handleDocumentTouchEnd);\n document.addEventListener(\"touchcancel\", handleDocumentTouchEnd);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleDocumentMouseMove);\n document.removeEventListener(\"mousemove\", handleDocumentMouseMove);\n document.removeEventListener(\"touchstart\", handleDocumentTouchMove);\n document.removeEventListener(\"touchmove\", handleDocumentTouchMove);\n document.removeEventListener(\"mouseup\", handleDocumentMouseUp);\n document.removeEventListener(\"touchend\", handleDocumentTouchEnd);\n document.removeEventListener(\"touchcancel\", handleDocumentTouchEnd);\n };\n }, [isScratching]);\n\n const handleMouseDown = () => setIsScratching(true);\n\n const handleTouchStart = () => setIsScratching(true);\n\n const scratch = (clientX: number, clientY: number) => {\n const canvas = canvasRef.current;\n const ctx = canvas?.getContext(\"2d\");\n if (canvas && ctx) {\n const rect = canvas.getBoundingClientRect();\n const x = clientX - rect.left + 16;\n const y = clientY - rect.top + 16;\n ctx.globalCompositeOperation = \"destination-out\";\n ctx.beginPath();\n ctx.arc(x, y, 30, 0, Math.PI * 2);\n ctx.fill();\n }\n };\n\n const startAnimation = async () => {\n await controls.start({\n scale: [1, 1.5, 1],\n rotate: [0, 10, -10, 10, -10, 0],\n transition: { duration: 0.5 },\n });\n\n // Call onComplete after animation finishes\n if (onComplete) {\n onComplete();\n }\n };\n\n const checkCompletion = () => {\n if (isComplete) return;\n\n const canvas = canvasRef.current;\n const ctx = canvas?.getContext(\"2d\");\n if (canvas && ctx) {\n const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n const pixels = imageData.data;\n const totalPixels = pixels.length / 4;\n let clearPixels = 0;\n\n for (let i = 3; i < pixels.length; i += 4) {\n if (pixels[i] === 0) clearPixels++;\n }\n\n const percentage = (clearPixels / totalPixels) * 100;\n\n if (percentage >= minScratchPercentage) {\n setIsComplete(true);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n startAnimation();\n }\n }\n };\n\n return (\n <motion.div\n className={cn(\"relative select-none\", className)}\n style={{\n width,\n height,\n cursor:\n \"url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIj4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNSIgc3R5bGU9ImZpbGw6I2ZmZjtzdHJva2U6IzAwMDtzdHJva2Utd2lkdGg6MXB4OyIgLz4KPC9zdmc+'), auto\",\n }}\n animate={controls}\n >\n <canvas\n ref={canvasRef}\n width={width}\n height={height}\n className=\"absolute left-0 top-0\"\n onMouseDown={handleMouseDown}\n onTouchStart={handleTouchStart}\n ></canvas>\n {children}\n </motion.div>\n );\n};\n",
+ "content": "\"use client\"\n\nimport React, { useEffect, useRef, useState } from \"react\"\nimport { motion, useAnimation } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ScratchToRevealProps {\n children: React.ReactNode\n width: number\n height: number\n minScratchPercentage?: number\n className?: string\n onComplete?: () => void\n gradientColors?: [string, string, string]\n}\n\nexport const ScratchToReveal: React.FC<ScratchToRevealProps> = ({\n width,\n height,\n minScratchPercentage = 50,\n onComplete,\n children,\n className,\n gradientColors = [\"#A97CF8\", \"#F38CB8\", \"#FDCC92\"],\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const [isScratching, setIsScratching] = useState(false)\n const [isComplete, setIsComplete] = useState(false)\n\n const controls = useAnimation()\n\n useEffect(() => {\n const canvas = canvasRef.current\n const ctx = canvas?.getContext(\"2d\")\n if (canvas && ctx) {\n ctx.fillStyle = \"#ccc\"\n ctx.fillRect(0, 0, canvas.width, canvas.height)\n const gradient = ctx.createLinearGradient(\n 0,\n 0,\n canvas.width,\n canvas.height\n )\n gradient.addColorStop(0, gradientColors[0])\n gradient.addColorStop(0.5, gradientColors[1])\n gradient.addColorStop(1, gradientColors[2])\n ctx.fillStyle = gradient\n ctx.fillRect(0, 0, canvas.width, canvas.height)\n }\n }, [gradientColors])\n\n useEffect(() => {\n const handleDocumentMouseMove = (event: MouseEvent) => {\n if (!isScratching) return\n scratch(event.clientX, event.clientY)\n }\n\n const handleDocumentTouchMove = (event: TouchEvent) => {\n if (!isScratching) return\n const touch = event.touches[0]\n scratch(touch.clientX, touch.clientY)\n }\n\n const handleDocumentMouseUp = () => {\n setIsScratching(false)\n checkCompletion()\n }\n\n const handleDocumentTouchEnd = () => {\n setIsScratching(false)\n checkCompletion()\n }\n\n document.addEventListener(\"mousedown\", handleDocumentMouseMove)\n document.addEventListener(\"mousemove\", handleDocumentMouseMove)\n document.addEventListener(\"touchstart\", handleDocumentTouchMove)\n document.addEventListener(\"touchmove\", handleDocumentTouchMove)\n document.addEventListener(\"mouseup\", handleDocumentMouseUp)\n document.addEventListener(\"touchend\", handleDocumentTouchEnd)\n document.addEventListener(\"touchcancel\", handleDocumentTouchEnd)\n\n return () => {\n document.removeEventListener(\"mousedown\", handleDocumentMouseMove)\n document.removeEventListener(\"mousemove\", handleDocumentMouseMove)\n document.removeEventListener(\"touchstart\", handleDocumentTouchMove)\n document.removeEventListener(\"touchmove\", handleDocumentTouchMove)\n document.removeEventListener(\"mouseup\", handleDocumentMouseUp)\n document.removeEventListener(\"touchend\", handleDocumentTouchEnd)\n document.removeEventListener(\"touchcancel\", handleDocumentTouchEnd)\n }\n }, [isScratching])\n\n const handleMouseDown = () => setIsScratching(true)\n\n const handleTouchStart = () => setIsScratching(true)\n\n const scratch = (clientX: number, clientY: number) => {\n const canvas = canvasRef.current\n const ctx = canvas?.getContext(\"2d\")\n if (canvas && ctx) {\n const rect = canvas.getBoundingClientRect()\n const x = clientX - rect.left + 16\n const y = clientY - rect.top + 16\n ctx.globalCompositeOperation = \"destination-out\"\n ctx.beginPath()\n ctx.arc(x, y, 30, 0, Math.PI * 2)\n ctx.fill()\n }\n }\n\n const startAnimation = async () => {\n await controls.start({\n scale: [1, 1.5, 1],\n rotate: [0, 10, -10, 10, -10, 0],\n transition: { duration: 0.5 },\n })\n\n // Call onComplete after animation finishes\n if (onComplete) {\n onComplete()\n }\n }\n\n const checkCompletion = () => {\n if (isComplete) return\n\n const canvas = canvasRef.current\n const ctx = canvas?.getContext(\"2d\")\n if (canvas && ctx) {\n const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height)\n const pixels = imageData.data\n const totalPixels = pixels.length / 4\n let clearPixels = 0\n\n for (let i = 3; i < pixels.length; i += 4) {\n if (pixels[i] === 0) clearPixels++\n }\n\n const percentage = (clearPixels / totalPixels) * 100\n\n if (percentage >= minScratchPercentage) {\n setIsComplete(true)\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n startAnimation()\n }\n }\n }\n\n return (\n <motion.div\n className={cn(\"relative select-none\", className)}\n style={{\n width,\n height,\n cursor:\n \"url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIj4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNSIgc3R5bGU9ImZpbGw6I2ZmZjtzdHJva2U6IzAwMDtzdHJva2Utd2lkdGg6MXB4OyIgLz4KPC9zdmc+'), auto\",\n }}\n animate={controls}\n >\n <canvas\n ref={canvasRef}\n width={width}\n height={height}\n className=\"absolute top-0 left-0\"\n onMouseDown={handleMouseDown}\n onTouchStart={handleTouchStart}\n ></canvas>\n {children}\n </motion.div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/script-copy-btn-demo.json b/apps/www/public/r/script-copy-btn-demo.json
index 89d5b3b7..df06e355 100644
--- a/apps/www/public/r/script-copy-btn-demo.json
+++ b/apps/www/public/r/script-copy-btn-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/script-copy-btn-demo.tsx",
- "content": "import { ScriptCopyBtn } from \"@/registry/magicui/script-copy-btn\";\n\nexport default function ScriptCopyBtnDemo() {\n const customCommandMap = {\n npm: \"npm run shadcn add button\",\n yarn: \"yarn shadcn add button\",\n pnpm: \"pnpm dlx shadcn@latest add button\",\n bun: \"bun x shadcn@latest add button\",\n };\n return (\n <ScriptCopyBtn\n showMultiplePackageOptions={true}\n codeLanguage=\"shell\"\n lightTheme=\"nord\"\n darkTheme=\"vitesse-dark\"\n commandMap={customCommandMap}\n />\n );\n}\n",
+ "content": "import { ScriptCopyBtn } from \"@/registry/magicui/script-copy-btn\"\n\nexport default function ScriptCopyBtnDemo() {\n const customCommandMap = {\n npm: \"npm run shadcn add button\",\n yarn: \"yarn shadcn add button\",\n pnpm: \"pnpm dlx shadcn@latest add button\",\n bun: \"bun x shadcn@latest add button\",\n }\n return (\n <ScriptCopyBtn\n showMultiplePackageOptions={true}\n codeLanguage=\"shell\"\n lightTheme=\"nord\"\n darkTheme=\"vitesse-dark\"\n commandMap={customCommandMap}\n />\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/script-copy-btn.json b/apps/www/public/r/script-copy-btn.json
index e604d803..f6121a23 100644
--- a/apps/www/public/r/script-copy-btn.json
+++ b/apps/www/public/r/script-copy-btn.json
@@ -15,7 +15,7 @@
"files": [
{
"path": "registry/magicui/script-copy-btn.tsx",
- "content": "\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\nimport { Check, Copy } from \"lucide-react\";\nimport { motion } from \"motion/react\";\nimport { useTheme } from \"next-themes\";\nimport { HTMLAttributes, useEffect, useState } from \"react\";\n\ninterface ScriptCopyBtnProps extends HTMLAttributes<HTMLDivElement> {\n showMultiplePackageOptions?: boolean;\n codeLanguage: string;\n lightTheme: string;\n darkTheme: string;\n commandMap: Record<string, string>;\n className?: string;\n}\n\nexport function ScriptCopyBtn({\n showMultiplePackageOptions = true,\n codeLanguage,\n lightTheme,\n darkTheme,\n commandMap,\n className,\n}: ScriptCopyBtnProps) {\n const packageManagers = Object.keys(commandMap);\n const [packageManager, setPackageManager] = useState(packageManagers[0]);\n const [copied, setCopied] = useState(false);\n const [highlightedCode, setHighlightedCode] = useState(\"\");\n const { theme } = useTheme();\n const command = commandMap[packageManager];\n\n useEffect(() => {\n async function loadHighlightedCode() {\n try {\n const { codeToHtml } = await import(\"shiki\");\n const highlighted = await codeToHtml(command, {\n lang: codeLanguage,\n themes: {\n light: lightTheme,\n dark: darkTheme,\n },\n defaultColor: theme === \"dark\" ? \"dark\" : \"light\",\n });\n setHighlightedCode(highlighted);\n } catch (error) {\n console.error(\"Error highlighting code:\", error);\n setHighlightedCode(`<pre>${command}</pre>`);\n }\n }\n\n loadHighlightedCode();\n }, [command, theme, codeLanguage, lightTheme, darkTheme]);\n\n const copyToClipboard = () => {\n navigator.clipboard.writeText(command);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n return (\n <div\n className={cn(\n \"mx-auto flex max-w-md items-center justify-center\",\n className,\n )}\n >\n <div className=\"w-full space-y-2\">\n <div className=\"mb-2 flex items-center justify-between\">\n {showMultiplePackageOptions && (\n <div className=\"relative\">\n <div className=\"inline-flex overflow-hidden rounded-md border border-border text-xs\">\n {packageManagers.map((pm, index) => (\n <div key={pm} className=\"flex items-center\">\n {index > 0 && (\n <div className=\"h-4 w-px bg-border\" aria-hidden=\"true\" />\n )}\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={`relative rounded-none bg-background px-2 py-1 hover:bg-background ${\n packageManager === pm\n ? \"text-primary\"\n : \"text-muted-foreground\"\n }`}\n onClick={() => setPackageManager(pm)}\n >\n {pm}\n {packageManager === pm && (\n <motion.div\n className=\"absolute inset-x-0 bottom-[1px] mx-auto h-0.5 w-[90%] bg-primary\"\n layoutId=\"activeTab\"\n initial={false}\n transition={{\n type: \"spring\",\n stiffness: 500,\n damping: 30,\n }}\n />\n )}\n </Button>\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n <div className=\"relative flex items-center\">\n <div className=\"min-w-[300px] grow font-mono\">\n {highlightedCode ? (\n <div\n className={`[&>pre]:overflow-x-auto [&>pre]:rounded-md [&>pre]:p-2 [&>pre]:px-4 [&>pre]:font-mono ${\n theme === \"dark\" ? \"dark\" : \"light\"\n }`}\n dangerouslySetInnerHTML={{ __html: highlightedCode }}\n />\n ) : (\n <pre className=\"rounded-md border border-border bg-white p-2 px-4 font-mono dark:bg-black\">\n {command}\n </pre>\n )}\n </div>\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"relative ml-2 rounded-md\"\n onClick={copyToClipboard}\n aria-label={copied ? \"Copied\" : \"Copy to clipboard\"}\n >\n <span className=\"sr-only\">{copied ? \"Copied\" : \"Copy\"}</span>\n <Copy\n className={`h-4 w-4 transition-all duration-300 ${\n copied ? \"scale-0\" : \"scale-100\"\n }`}\n />\n <Check\n className={`absolute inset-0 m-auto h-4 w-4 transition-all duration-300 ${\n copied ? \"scale-100\" : \"scale-0\"\n }`}\n />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { HTMLAttributes, useEffect, useState } from \"react\"\nimport { Check, Copy } from \"lucide-react\"\nimport { motion } from \"motion/react\"\nimport { useTheme } from \"next-themes\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ninterface ScriptCopyBtnProps extends HTMLAttributes<HTMLDivElement> {\n showMultiplePackageOptions?: boolean\n codeLanguage: string\n lightTheme: string\n darkTheme: string\n commandMap: Record<string, string>\n className?: string\n}\n\nexport function ScriptCopyBtn({\n showMultiplePackageOptions = true,\n codeLanguage,\n lightTheme,\n darkTheme,\n commandMap,\n className,\n}: ScriptCopyBtnProps) {\n const packageManagers = Object.keys(commandMap)\n const [packageManager, setPackageManager] = useState(packageManagers[0])\n const [copied, setCopied] = useState(false)\n const [highlightedCode, setHighlightedCode] = useState(\"\")\n const { theme } = useTheme()\n const command = commandMap[packageManager]\n\n useEffect(() => {\n async function loadHighlightedCode() {\n try {\n const { codeToHtml } = await import(\"shiki\")\n const highlighted = await codeToHtml(command, {\n lang: codeLanguage,\n themes: {\n light: lightTheme,\n dark: darkTheme,\n },\n defaultColor: theme === \"dark\" ? \"dark\" : \"light\",\n })\n setHighlightedCode(highlighted)\n } catch (error) {\n console.error(\"Error highlighting code:\", error)\n setHighlightedCode(`<pre>${command}</pre>`)\n }\n }\n\n loadHighlightedCode()\n }, [command, theme, codeLanguage, lightTheme, darkTheme])\n\n const copyToClipboard = () => {\n navigator.clipboard.writeText(command)\n setCopied(true)\n setTimeout(() => setCopied(false), 2000)\n }\n\n return (\n <div\n className={cn(\n \"mx-auto flex max-w-md items-center justify-center\",\n className\n )}\n >\n <div className=\"w-full space-y-2\">\n <div className=\"mb-2 flex items-center justify-between\">\n {showMultiplePackageOptions && (\n <div className=\"relative\">\n <div className=\"border-border inline-flex overflow-hidden rounded-md border text-xs\">\n {packageManagers.map((pm, index) => (\n <div key={pm} className=\"flex items-center\">\n {index > 0 && (\n <div className=\"bg-border h-4 w-px\" aria-hidden=\"true\" />\n )}\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={`bg-background hover:bg-background relative rounded-none px-2 py-1 ${\n packageManager === pm\n ? \"text-primary\"\n : \"text-muted-foreground\"\n }`}\n onClick={() => setPackageManager(pm)}\n >\n {pm}\n {packageManager === pm && (\n <motion.div\n className=\"bg-primary absolute inset-x-0 bottom-[1px] mx-auto h-0.5 w-[90%]\"\n layoutId=\"activeTab\"\n initial={false}\n transition={{\n type: \"spring\",\n stiffness: 500,\n damping: 30,\n }}\n />\n )}\n </Button>\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n <div className=\"relative flex items-center\">\n <div className=\"min-w-[300px] grow font-mono\">\n {highlightedCode ? (\n <div\n className={`[&>pre]:overflow-x-auto [&>pre]:rounded-md [&>pre]:p-2 [&>pre]:px-4 [&>pre]:font-mono ${\n theme === \"dark\" ? \"dark\" : \"light\"\n }`}\n dangerouslySetInnerHTML={{ __html: highlightedCode }}\n />\n ) : (\n <pre className=\"border-border rounded-md border bg-white p-2 px-4 font-mono dark:bg-black\">\n {command}\n </pre>\n )}\n </div>\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"relative ml-2 rounded-md\"\n onClick={copyToClipboard}\n aria-label={copied ? \"Copied\" : \"Copy to clipboard\"}\n >\n <span className=\"sr-only\">{copied ? \"Copied\" : \"Copy\"}</span>\n <Copy\n className={`h-4 w-4 transition-all duration-300 ${\n copied ? \"scale-0\" : \"scale-100\"\n }`}\n />\n <Check\n className={`absolute inset-0 m-auto h-4 w-4 transition-all duration-300 ${\n copied ? \"scale-100\" : \"scale-0\"\n }`}\n />\n </Button>\n </div>\n </div>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/scroll-based-velocity-demo.json b/apps/www/public/r/scroll-based-velocity-demo.json
index 8094bcf6..681c4d86 100644
--- a/apps/www/public/r/scroll-based-velocity-demo.json
+++ b/apps/www/public/r/scroll-based-velocity-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/scroll-based-velocity-demo.tsx",
- "content": "import {\n ScrollVelocityContainer,\n ScrollVelocityRow,\n} from \"@/registry/magicui/scroll-based-velocity\";\n\nexport default function ScrollBasedVelocityDemo() {\n return (\n <div className=\"relative flex w-full flex-col items-center justify-center overflow-hidden\">\n <ScrollVelocityContainer className=\"text-4xl md:text-7xl md:leading-[5rem] font-bold tracking-[-0.02em]\">\n <ScrollVelocityRow baseVelocity={20} direction={1}>\n Velocity Scroll\n </ScrollVelocityRow>\n <ScrollVelocityRow baseVelocity={20} direction={-1}>\n Velocity Scroll\n </ScrollVelocityRow>\n </ScrollVelocityContainer>\n <div className=\"pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r from-background\"></div>\n <div className=\"pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l from-background\"></div>\n </div>\n );\n}\n",
+ "content": "import {\n ScrollVelocityContainer,\n ScrollVelocityRow,\n} from \"@/registry/magicui/scroll-based-velocity\"\n\nexport default function ScrollBasedVelocityDemo() {\n return (\n <div className=\"relative flex w-full flex-col items-center justify-center overflow-hidden\">\n <ScrollVelocityContainer className=\"text-4xl font-bold tracking-[-0.02em] md:text-7xl md:leading-[5rem]\">\n <ScrollVelocityRow baseVelocity={20} direction={1}>\n Velocity Scroll\n </ScrollVelocityRow>\n <ScrollVelocityRow baseVelocity={20} direction={-1}>\n Velocity Scroll\n </ScrollVelocityRow>\n </ScrollVelocityContainer>\n <div className=\"from-background pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r\"></div>\n <div className=\"from-background pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l\"></div>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/scroll-based-velocity-images-demo.json b/apps/www/public/r/scroll-based-velocity-images-demo.json
index 11176b80..c40dbc24 100644
--- a/apps/www/public/r/scroll-based-velocity-images-demo.json
+++ b/apps/www/public/r/scroll-based-velocity-images-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/scroll-based-velocity-images-demo.tsx",
- "content": "import {\n ScrollVelocityContainer,\n ScrollVelocityRow,\n} from \"@/registry/magicui/scroll-based-velocity\";\n\nconst IMAGES_ROW_A = [\n \"https://images.unsplash.com/photo-1749738456487-2af715ab65ea?q=80&w=2340&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1720139288219-e20aa9c8895b?q=80&w=1810&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n];\n\nconst IMAGES_ROW_B = [\n \"https://images.unsplash.com/photo-1749738456487-2af715ab65ea?q=80&w=2340&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1720139288219-e20aa9c8895b?q=80&w=1810&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n];\n\nexport default function ScrollBasedVelocityImagesDemo() {\n return (\n <div className=\"relative flex w-full flex-col items-center justify-center overflow-hidden py-8\">\n <ScrollVelocityContainer className=\"w-full\">\n <ScrollVelocityRow baseVelocity={6} direction={1} className=\"py-4\">\n {IMAGES_ROW_A.map((src, idx) => (\n <img\n key={idx}\n src={`${src}&ixlib=rb-4.0.3`}\n alt=\"Unsplash sample\"\n width={240}\n height={160}\n loading=\"lazy\"\n decoding=\"async\"\n className=\"mx-4 inline-block h-40 w-60 rounded-lg object-cover shadow-sm\"\n />\n ))}\n </ScrollVelocityRow>\n <ScrollVelocityRow baseVelocity={6} direction={-1} className=\"py-4\">\n {IMAGES_ROW_B.map((src, idx) => (\n <img\n key={idx}\n src={`${src}&ixlib=rb-4.0.3`}\n alt=\"Unsplash sample\"\n width={240}\n height={160}\n loading=\"lazy\"\n decoding=\"async\"\n className=\"mx-4 inline-block h-40 w-60 rounded-lg object-cover shadow-sm\"\n />\n ))}\n </ScrollVelocityRow>\n </ScrollVelocityContainer>\n\n <div className=\"pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r from-background\"></div>\n <div className=\"pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l from-background\"></div>\n </div>\n );\n}\n",
+ "content": "import {\n ScrollVelocityContainer,\n ScrollVelocityRow,\n} from \"@/registry/magicui/scroll-based-velocity\"\n\nconst IMAGES_ROW_A = [\n \"https://images.unsplash.com/photo-1749738456487-2af715ab65ea?q=80&w=2340&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1720139288219-e20aa9c8895b?q=80&w=1810&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n]\n\nconst IMAGES_ROW_B = [\n \"https://images.unsplash.com/photo-1749738456487-2af715ab65ea?q=80&w=2340&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n \"https://plus.unsplash.com/premium_photo-1720139288219-e20aa9c8895b?q=80&w=1810&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n]\n\nexport default function ScrollBasedVelocityImagesDemo() {\n return (\n <div className=\"relative flex w-full flex-col items-center justify-center overflow-hidden py-8\">\n <ScrollVelocityContainer className=\"w-full\">\n <ScrollVelocityRow baseVelocity={6} direction={1} className=\"py-4\">\n {IMAGES_ROW_A.map((src, idx) => (\n <img\n key={idx}\n src={`${src}&ixlib=rb-4.0.3`}\n alt=\"Unsplash sample\"\n width={240}\n height={160}\n loading=\"lazy\"\n decoding=\"async\"\n className=\"mx-4 inline-block h-40 w-60 rounded-lg object-cover shadow-sm\"\n />\n ))}\n </ScrollVelocityRow>\n <ScrollVelocityRow baseVelocity={6} direction={-1} className=\"py-4\">\n {IMAGES_ROW_B.map((src, idx) => (\n <img\n key={idx}\n src={`${src}&ixlib=rb-4.0.3`}\n alt=\"Unsplash sample\"\n width={240}\n height={160}\n loading=\"lazy\"\n decoding=\"async\"\n className=\"mx-4 inline-block h-40 w-60 rounded-lg object-cover shadow-sm\"\n />\n ))}\n </ScrollVelocityRow>\n </ScrollVelocityContainer>\n\n <div className=\"from-background pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r\"></div>\n <div className=\"from-background pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l\"></div>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/scroll-based-velocity.json b/apps/www/public/r/scroll-based-velocity.json
index c4484155..807dbbec 100644
--- a/apps/www/public/r/scroll-based-velocity.json
+++ b/apps/www/public/r/scroll-based-velocity.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/scroll-based-velocity.tsx",
- "content": "\"use client\";\n\nimport {\n motion,\n useAnimationFrame,\n useMotionValue,\n useScroll,\n useSpring,\n useTransform,\n useVelocity,\n} from \"motion/react\";\nimport React, { useContext, useEffect, useRef, useState } from \"react\";\nimport type { MotionValue } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface ScrollVelocityRowProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode;\n baseVelocity?: number;\n direction?: 1 | -1;\n}\n\nexport const wrap = (min: number, max: number, v: number) => {\n const rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nconst ScrollVelocityContext = React.createContext<MotionValue<number> | null>(\n null,\n);\n\nexport function ScrollVelocityContainer({\n children,\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n const { scrollY } = useScroll();\n const scrollVelocity = useVelocity(scrollY);\n const smoothVelocity = useSpring(scrollVelocity, {\n damping: 50,\n stiffness: 400,\n });\n const velocityFactor = useTransform(smoothVelocity, (v) => {\n const sign = v < 0 ? -1 : 1;\n const magnitude = Math.min(5, (Math.abs(v) / 1000) * 5);\n return sign * magnitude;\n });\n\n return (\n <ScrollVelocityContext.Provider value={velocityFactor}>\n <div className={cn(\"relative w-full\", className)} {...props}>\n {children}\n </div>\n </ScrollVelocityContext.Provider>\n );\n}\n\nexport function ScrollVelocityRow(props: ScrollVelocityRowProps) {\n const sharedVelocityFactor = useContext(ScrollVelocityContext);\n if (sharedVelocityFactor) {\n return (\n <ScrollVelocityRowImpl {...props} velocityFactor={sharedVelocityFactor} />\n );\n }\n return <ScrollVelocityRowLocal {...props} />;\n}\n\ninterface ScrollVelocityRowImplProps extends ScrollVelocityRowProps {\n velocityFactor: MotionValue<number>;\n}\n\nfunction ScrollVelocityRowImpl({\n children,\n baseVelocity = 5,\n direction = 1,\n className,\n velocityFactor,\n ...props\n}: ScrollVelocityRowImplProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n const blockRef = useRef<HTMLDivElement>(null);\n const [numCopies, setNumCopies] = useState(1);\n\n const baseX = useMotionValue(0);\n const baseDirectionRef = useRef<number>(direction >= 0 ? 1 : -1);\n const currentDirectionRef = useRef<number>(direction >= 0 ? 1 : -1);\n const unitWidth = useMotionValue(0);\n\n const isInViewRef = useRef(true);\n const isPageVisibleRef = useRef(true);\n const prefersReducedMotionRef = useRef(false);\n\n useEffect(() => {\n const container = containerRef.current;\n const block = blockRef.current;\n if (!container || !block) return;\n\n const updateSizes = () => {\n const cw = container.offsetWidth || 0;\n const bw = block.scrollWidth || 0;\n unitWidth.set(bw);\n const nextCopies = bw > 0 ? Math.max(3, Math.ceil(cw / bw) + 2) : 1;\n setNumCopies((prev) => (prev === nextCopies ? prev : nextCopies));\n };\n\n updateSizes();\n\n const ro = new ResizeObserver(updateSizes);\n ro.observe(container);\n ro.observe(block);\n\n const io = new IntersectionObserver(([entry]) => {\n isInViewRef.current = entry.isIntersecting;\n });\n io.observe(container);\n\n const handleVisibility = () => {\n isPageVisibleRef.current = document.visibilityState === \"visible\";\n };\n document.addEventListener(\"visibilitychange\", handleVisibility, {\n passive: true,\n });\n handleVisibility();\n\n const mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const handlePRM = () => {\n prefersReducedMotionRef.current = mq.matches;\n };\n mq.addEventListener(\"change\", handlePRM);\n handlePRM();\n\n return () => {\n ro.disconnect();\n io.disconnect();\n document.removeEventListener(\"visibilitychange\", handleVisibility);\n mq.removeEventListener(\"change\", handlePRM);\n };\n }, [children, unitWidth]);\n\n const x = useTransform([baseX, unitWidth], ([v, bw]) => {\n const width = Number(bw) || 1;\n const offset = Number(v) || 0;\n return `${-wrap(0, width, offset)}px`;\n });\n\n useAnimationFrame((_, delta) => {\n if (!isInViewRef.current || !isPageVisibleRef.current) return;\n const dt = delta / 1000;\n const vf = velocityFactor.get();\n const absVf = Math.min(5, Math.abs(vf));\n const speedMultiplier = prefersReducedMotionRef.current ? 1 : 1 + absVf;\n\n if (absVf > 0.1) {\n const scrollDirection = vf >= 0 ? 1 : -1;\n currentDirectionRef.current = baseDirectionRef.current * scrollDirection;\n }\n\n const bw = unitWidth.get() || 0;\n if (bw <= 0) return;\n const pixelsPerSecond = (bw * baseVelocity) / 100;\n const moveBy =\n currentDirectionRef.current * pixelsPerSecond * speedMultiplier * dt;\n baseX.set(baseX.get() + moveBy);\n });\n\n return (\n <div\n ref={containerRef}\n className={cn(\"w-full overflow-hidden whitespace-nowrap\", className)}\n {...props}\n >\n <motion.div\n className=\"inline-flex items-center will-change-transform transform-gpu select-none\"\n style={{ x }}\n >\n {Array.from({ length: numCopies }).map((_, i) => (\n <div\n key={i}\n ref={i === 0 ? blockRef : null}\n aria-hidden={i !== 0}\n className=\"inline-flex shrink-0 items-center\"\n >\n {children}\n </div>\n ))}\n </motion.div>\n </div>\n );\n}\n\nfunction ScrollVelocityRowLocal(props: ScrollVelocityRowProps) {\n const { scrollY } = useScroll();\n const localVelocity = useVelocity(scrollY);\n const localSmoothVelocity = useSpring(localVelocity, {\n damping: 50,\n stiffness: 400,\n });\n const localVelocityFactor = useTransform(localSmoothVelocity, (v) => {\n const sign = v < 0 ? -1 : 1;\n const magnitude = Math.min(5, (Math.abs(v) / 1000) * 5);\n return sign * magnitude;\n });\n return (\n <ScrollVelocityRowImpl {...props} velocityFactor={localVelocityFactor} />\n );\n}\n",
+ "content": "\"use client\"\n\nimport React, { useContext, useEffect, useRef, useState } from \"react\"\nimport {\n motion,\n useAnimationFrame,\n useMotionValue,\n useScroll,\n useSpring,\n useTransform,\n useVelocity,\n} from \"motion/react\"\nimport type { MotionValue } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ScrollVelocityRowProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n baseVelocity?: number\n direction?: 1 | -1\n}\n\nexport const wrap = (min: number, max: number, v: number) => {\n const rangeSize = max - min\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min\n}\n\nconst ScrollVelocityContext = React.createContext<MotionValue<number> | null>(\n null\n)\n\nexport function ScrollVelocityContainer({\n children,\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n const { scrollY } = useScroll()\n const scrollVelocity = useVelocity(scrollY)\n const smoothVelocity = useSpring(scrollVelocity, {\n damping: 50,\n stiffness: 400,\n })\n const velocityFactor = useTransform(smoothVelocity, (v) => {\n const sign = v < 0 ? -1 : 1\n const magnitude = Math.min(5, (Math.abs(v) / 1000) * 5)\n return sign * magnitude\n })\n\n return (\n <ScrollVelocityContext.Provider value={velocityFactor}>\n <div className={cn(\"relative w-full\", className)} {...props}>\n {children}\n </div>\n </ScrollVelocityContext.Provider>\n )\n}\n\nexport function ScrollVelocityRow(props: ScrollVelocityRowProps) {\n const sharedVelocityFactor = useContext(ScrollVelocityContext)\n if (sharedVelocityFactor) {\n return (\n <ScrollVelocityRowImpl {...props} velocityFactor={sharedVelocityFactor} />\n )\n }\n return <ScrollVelocityRowLocal {...props} />\n}\n\ninterface ScrollVelocityRowImplProps extends ScrollVelocityRowProps {\n velocityFactor: MotionValue<number>\n}\n\nfunction ScrollVelocityRowImpl({\n children,\n baseVelocity = 5,\n direction = 1,\n className,\n velocityFactor,\n ...props\n}: ScrollVelocityRowImplProps) {\n const containerRef = useRef<HTMLDivElement>(null)\n const blockRef = useRef<HTMLDivElement>(null)\n const [numCopies, setNumCopies] = useState(1)\n\n const baseX = useMotionValue(0)\n const baseDirectionRef = useRef<number>(direction >= 0 ? 1 : -1)\n const currentDirectionRef = useRef<number>(direction >= 0 ? 1 : -1)\n const unitWidth = useMotionValue(0)\n\n const isInViewRef = useRef(true)\n const isPageVisibleRef = useRef(true)\n const prefersReducedMotionRef = useRef(false)\n\n useEffect(() => {\n const container = containerRef.current\n const block = blockRef.current\n if (!container || !block) return\n\n const updateSizes = () => {\n const cw = container.offsetWidth || 0\n const bw = block.scrollWidth || 0\n unitWidth.set(bw)\n const nextCopies = bw > 0 ? Math.max(3, Math.ceil(cw / bw) + 2) : 1\n setNumCopies((prev) => (prev === nextCopies ? prev : nextCopies))\n }\n\n updateSizes()\n\n const ro = new ResizeObserver(updateSizes)\n ro.observe(container)\n ro.observe(block)\n\n const io = new IntersectionObserver(([entry]) => {\n isInViewRef.current = entry.isIntersecting\n })\n io.observe(container)\n\n const handleVisibility = () => {\n isPageVisibleRef.current = document.visibilityState === \"visible\"\n }\n document.addEventListener(\"visibilitychange\", handleVisibility, {\n passive: true,\n })\n handleVisibility()\n\n const mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\")\n const handlePRM = () => {\n prefersReducedMotionRef.current = mq.matches\n }\n mq.addEventListener(\"change\", handlePRM)\n handlePRM()\n\n return () => {\n ro.disconnect()\n io.disconnect()\n document.removeEventListener(\"visibilitychange\", handleVisibility)\n mq.removeEventListener(\"change\", handlePRM)\n }\n }, [children, unitWidth])\n\n const x = useTransform([baseX, unitWidth], ([v, bw]) => {\n const width = Number(bw) || 1\n const offset = Number(v) || 0\n return `${-wrap(0, width, offset)}px`\n })\n\n useAnimationFrame((_, delta) => {\n if (!isInViewRef.current || !isPageVisibleRef.current) return\n const dt = delta / 1000\n const vf = velocityFactor.get()\n const absVf = Math.min(5, Math.abs(vf))\n const speedMultiplier = prefersReducedMotionRef.current ? 1 : 1 + absVf\n\n if (absVf > 0.1) {\n const scrollDirection = vf >= 0 ? 1 : -1\n currentDirectionRef.current = baseDirectionRef.current * scrollDirection\n }\n\n const bw = unitWidth.get() || 0\n if (bw <= 0) return\n const pixelsPerSecond = (bw * baseVelocity) / 100\n const moveBy =\n currentDirectionRef.current * pixelsPerSecond * speedMultiplier * dt\n baseX.set(baseX.get() + moveBy)\n })\n\n return (\n <div\n ref={containerRef}\n className={cn(\"w-full overflow-hidden whitespace-nowrap\", className)}\n {...props}\n >\n <motion.div\n className=\"inline-flex transform-gpu items-center will-change-transform select-none\"\n style={{ x }}\n >\n {Array.from({ length: numCopies }).map((_, i) => (\n <div\n key={i}\n ref={i === 0 ? blockRef : null}\n aria-hidden={i !== 0}\n className=\"inline-flex shrink-0 items-center\"\n >\n {children}\n </div>\n ))}\n </motion.div>\n </div>\n )\n}\n\nfunction ScrollVelocityRowLocal(props: ScrollVelocityRowProps) {\n const { scrollY } = useScroll()\n const localVelocity = useVelocity(scrollY)\n const localSmoothVelocity = useSpring(localVelocity, {\n damping: 50,\n stiffness: 400,\n })\n const localVelocityFactor = useTransform(localSmoothVelocity, (v) => {\n const sign = v < 0 ? -1 : 1\n const magnitude = Math.min(5, (Math.abs(v) / 1000) * 5)\n return sign * magnitude\n })\n return (\n <ScrollVelocityRowImpl {...props} velocityFactor={localVelocityFactor} />\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/scroll-progress-demo.json b/apps/www/public/r/scroll-progress-demo.json
index 306829af..47572a25 100644
--- a/apps/www/public/r/scroll-progress-demo.json
+++ b/apps/www/public/r/scroll-progress-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/scroll-progress-demo.tsx",
- "content": "import { ScrollProgress } from \"@/registry/magicui/scroll-progress\";\n\nexport default function ScrollProgressDemo() {\n return (\n <div className=\"z-10 rounded-lg p-4\">\n <ScrollProgress className=\"top-[65px]\" />\n <h2 className=\"pb-4 font-bold\">\n Note: The scroll progress is shown below the navbar of the page.\n </h2>\n </div>\n );\n}\n",
+ "content": "import { ScrollProgress } from \"@/registry/magicui/scroll-progress\"\n\nexport default function ScrollProgressDemo() {\n return (\n <div className=\"z-10 rounded-lg p-4\">\n <ScrollProgress className=\"top-[65px]\" />\n <h2 className=\"pb-4 font-bold\">\n Note: The scroll progress is shown below the navbar of the page.\n </h2>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/scroll-progress.json b/apps/www/public/r/scroll-progress.json
index 0a2e81e1..407c896c 100644
--- a/apps/www/public/r/scroll-progress.json
+++ b/apps/www/public/r/scroll-progress.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/scroll-progress.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { motion, MotionProps, useScroll } from \"motion/react\";\nimport React from \"react\";\ninterface ScrollProgressProps\n extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {}\n\nexport const ScrollProgress = React.forwardRef<\n HTMLDivElement,\n ScrollProgressProps\n>(({ className, ...props }, ref) => {\n const { scrollYProgress } = useScroll();\n\n return (\n <motion.div\n ref={ref}\n className={cn(\n \"fixed inset-x-0 top-0 z-50 h-px origin-left bg-gradient-to-r from-[#A97CF8] via-[#F38CB8] to-[#FDCC92]\",\n className,\n )}\n style={{\n scaleX: scrollYProgress,\n }}\n {...props}\n />\n );\n});\n\nScrollProgress.displayName = \"ScrollProgress\";\n",
+ "content": "\"use client\"\n\nimport React from \"react\"\nimport { motion, MotionProps, useScroll } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ScrollProgressProps\n extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {}\n\nexport const ScrollProgress = React.forwardRef<\n HTMLDivElement,\n ScrollProgressProps\n>(({ className, ...props }, ref) => {\n const { scrollYProgress } = useScroll()\n\n return (\n <motion.div\n ref={ref}\n className={cn(\n \"fixed inset-x-0 top-0 z-50 h-px origin-left bg-gradient-to-r from-[#A97CF8] via-[#F38CB8] to-[#FDCC92]\",\n className\n )}\n style={{\n scaleX: scrollYProgress,\n }}\n {...props}\n />\n )\n})\n\nScrollProgress.displayName = \"ScrollProgress\"\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/shimmer-button-demo.json b/apps/www/public/r/shimmer-button-demo.json
index 5ae9dfa7..96cdfadd 100644
--- a/apps/www/public/r/shimmer-button-demo.json
+++ b/apps/www/public/r/shimmer-button-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/shimmer-button-demo.tsx",
- "content": "import { ShimmerButton } from \"@/registry/magicui/shimmer-button\";\n\nexport default function ShimmerButtonDemo() {\n return (\n <ShimmerButton className=\"shadow-2xl\">\n <span className=\"whitespace-pre-wrap text-center text-sm font-medium leading-none tracking-tight text-white dark:from-white dark:to-slate-900/10 lg:text-lg\">\n Shimmer Button\n </span>\n </ShimmerButton>\n );\n}\n",
+ "content": "import { ShimmerButton } from \"@/registry/magicui/shimmer-button\"\n\nexport default function ShimmerButtonDemo() {\n return (\n <ShimmerButton className=\"shadow-2xl\">\n <span className=\"text-center text-sm leading-none font-medium tracking-tight whitespace-pre-wrap text-white lg:text-lg dark:from-white dark:to-slate-900/10\">\n Shimmer Button\n </span>\n </ShimmerButton>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/shimmer-button.json b/apps/www/public/r/shimmer-button.json
index c441ee09..07583cb0 100644
--- a/apps/www/public/r/shimmer-button.json
+++ b/apps/www/public/r/shimmer-button.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/shimmer-button.tsx",
- "content": "import React, { CSSProperties, ComponentPropsWithoutRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface ShimmerButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n shimmerColor?: string;\n shimmerSize?: string;\n borderRadius?: string;\n shimmerDuration?: string;\n background?: string;\n className?: string;\n children?: React.ReactNode;\n}\n\nexport const ShimmerButton = React.forwardRef<\n HTMLButtonElement,\n ShimmerButtonProps\n>(\n (\n {\n shimmerColor = \"#ffffff\",\n shimmerSize = \"0.05em\",\n shimmerDuration = \"3s\",\n borderRadius = \"100px\",\n background = \"rgba(0, 0, 0, 1)\",\n className,\n children,\n ...props\n },\n ref,\n ) => {\n return (\n <button\n style={\n {\n \"--spread\": \"90deg\",\n \"--shimmer-color\": shimmerColor,\n \"--radius\": borderRadius,\n \"--speed\": shimmerDuration,\n \"--cut\": shimmerSize,\n \"--bg\": background,\n } as CSSProperties\n }\n className={cn(\n \"group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden whitespace-nowrap border border-white/10 px-6 py-3 text-white [background:var(--bg)] [border-radius:var(--radius)]\",\n \"transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px\",\n className,\n )}\n ref={ref}\n {...props}\n >\n {/* spark container */}\n <div\n className={cn(\n \"-z-30 blur-[2px]\",\n \"absolute inset-0 overflow-visible [container-type:size]\",\n )}\n >\n {/* spark */}\n <div className=\"absolute inset-0 h-[100cqh] animate-shimmer-slide [aspect-ratio:1] [border-radius:0] [mask:none]\">\n {/* spark before */}\n <div className=\"absolute -inset-full w-auto rotate-0 animate-spin-around [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))] [translate:0_0]\" />\n </div>\n </div>\n {children}\n\n {/* Highlight */}\n <div\n className={cn(\n \"inset-0 absolute size-full\",\n\n \"rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f]\",\n\n // transition\n \"transform-gpu transition-all duration-300 ease-in-out\",\n\n // on hover\n \"group-hover:shadow-[inset_0_-6px_10px_#ffffff3f]\",\n\n // on click\n \"group-active:shadow-[inset_0_-10px_10px_#ffffff3f]\",\n )}\n />\n\n {/* backdrop */}\n <div\n className={cn(\n \"absolute -z-20 [background:var(--bg)] [border-radius:var(--radius)] [inset:var(--cut)]\",\n )}\n />\n </button>\n );\n },\n);\n\nShimmerButton.displayName = \"ShimmerButton\";\n",
+ "content": "import React, { ComponentPropsWithoutRef, CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface ShimmerButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n shimmerColor?: string\n shimmerSize?: string\n borderRadius?: string\n shimmerDuration?: string\n background?: string\n className?: string\n children?: React.ReactNode\n}\n\nexport const ShimmerButton = React.forwardRef<\n HTMLButtonElement,\n ShimmerButtonProps\n>(\n (\n {\n shimmerColor = \"#ffffff\",\n shimmerSize = \"0.05em\",\n shimmerDuration = \"3s\",\n borderRadius = \"100px\",\n background = \"rgba(0, 0, 0, 1)\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n return (\n <button\n style={\n {\n \"--spread\": \"90deg\",\n \"--shimmer-color\": shimmerColor,\n \"--radius\": borderRadius,\n \"--speed\": shimmerDuration,\n \"--cut\": shimmerSize,\n \"--bg\": background,\n } as CSSProperties\n }\n className={cn(\n \"group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden [border-radius:var(--radius)] border border-white/10 px-6 py-3 whitespace-nowrap text-white [background:var(--bg)]\",\n \"transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px\",\n className\n )}\n ref={ref}\n {...props}\n >\n {/* spark container */}\n <div\n className={cn(\n \"-z-30 blur-[2px]\",\n \"[container-type:size] absolute inset-0 overflow-visible\"\n )}\n >\n {/* spark */}\n <div className=\"animate-shimmer-slide absolute inset-0 [aspect-ratio:1] h-[100cqh] [border-radius:0] [mask:none]\">\n {/* spark before */}\n <div className=\"animate-spin-around absolute -inset-full w-auto [translate:0_0] rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))]\" />\n </div>\n </div>\n {children}\n\n {/* Highlight */}\n <div\n className={cn(\n \"absolute inset-0 size-full\",\n\n \"rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f]\",\n\n // transition\n \"transform-gpu transition-all duration-300 ease-in-out\",\n\n // on hover\n \"group-hover:shadow-[inset_0_-6px_10px_#ffffff3f]\",\n\n // on click\n \"group-active:shadow-[inset_0_-10px_10px_#ffffff3f]\"\n )}\n />\n\n {/* backdrop */}\n <div\n className={cn(\n \"absolute [inset:var(--cut)] -z-20 [border-radius:var(--radius)] [background:var(--bg)]\"\n )}\n />\n </button>\n )\n }\n)\n\nShimmerButton.displayName = \"ShimmerButton\"\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/shine-border-demo-2.json b/apps/www/public/r/shine-border-demo-2.json
index 5b35b4d2..af2094f2 100644
--- a/apps/www/public/r/shine-border-demo-2.json
+++ b/apps/www/public/r/shine-border-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/shine-border-demo-2.tsx",
- "content": "\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { ShineBorder } from \"@/registry/magicui/shine-border\";\nimport { useTheme } from \"next-themes\";\n\nexport default function ShineBorderDemo2() {\n const theme = useTheme();\n return (\n <Card className=\"relative overflow-hidden\">\n <ShineBorder shineColor={theme.theme === \"dark\" ? \"white\" : \"black\"} />\n <CardHeader>\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <div className=\"grid gap-4\">\n <div className=\"grid gap-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"[email protected]\" />\n </div>\n <div className=\"grid gap-2\">\n <Label htmlFor=\"password\">Password</Label>\n <Input id=\"password\" type=\"password\" />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter>\n <Button className=\"w-full\">Sign In</Button>\n </CardFooter>\n </Card>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useTheme } from \"next-themes\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { Input } from \"@/components/ui/input\"\nimport { Label } from \"@/components/ui/label\"\nimport { ShineBorder } from \"@/registry/magicui/shine-border\"\n\nexport default function ShineBorderDemo2() {\n const theme = useTheme()\n return (\n <Card className=\"relative overflow-hidden\">\n <ShineBorder shineColor={theme.theme === \"dark\" ? \"white\" : \"black\"} />\n <CardHeader>\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <div className=\"grid gap-4\">\n <div className=\"grid gap-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"[email protected]\" />\n </div>\n <div className=\"grid gap-2\">\n <Label htmlFor=\"password\">Password</Label>\n <Input id=\"password\" type=\"password\" />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter>\n <Button className=\"w-full\">Sign In</Button>\n </CardFooter>\n </Card>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/shine-border-demo.json b/apps/www/public/r/shine-border-demo.json
index c4b31b42..3df7f2a0 100644
--- a/apps/www/public/r/shine-border-demo.json
+++ b/apps/www/public/r/shine-border-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/shine-border-demo.tsx",
- "content": "import { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { ShineBorder } from \"@/registry/magicui/shine-border\";\n\nexport default function ShineBorderDemo() {\n return (\n <Card className=\"relative overflow-hidden max-w-[350px] w-full\">\n <ShineBorder shineColor={[\"#A07CFE\", \"#FE8FB5\", \"#FFBE7B\"]} />\n <CardHeader>\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <div className=\"grid gap-4\">\n <div className=\"grid gap-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"[email protected]\" />\n </div>\n <div className=\"grid gap-2\">\n <Label htmlFor=\"password\">Password</Label>\n <Input id=\"password\" type=\"password\" />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter>\n <Button className=\"w-full\">Sign In</Button>\n </CardFooter>\n </Card>\n );\n}\n",
+ "content": "import { Button } from \"@/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { Input } from \"@/components/ui/input\"\nimport { Label } from \"@/components/ui/label\"\nimport { ShineBorder } from \"@/registry/magicui/shine-border\"\n\nexport default function ShineBorderDemo() {\n return (\n <Card className=\"relative w-full max-w-[350px] overflow-hidden\">\n <ShineBorder shineColor={[\"#A07CFE\", \"#FE8FB5\", \"#FFBE7B\"]} />\n <CardHeader>\n <CardTitle>Login</CardTitle>\n <CardDescription>\n Enter your credentials to access your account\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <div className=\"grid gap-4\">\n <div className=\"grid gap-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" type=\"email\" placeholder=\"[email protected]\" />\n </div>\n <div className=\"grid gap-2\">\n <Label htmlFor=\"password\">Password</Label>\n <Input id=\"password\" type=\"password\" />\n </div>\n </div>\n </form>\n </CardContent>\n <CardFooter>\n <Button className=\"w-full\">Sign In</Button>\n </CardFooter>\n </Card>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/shine-border.json b/apps/www/public/r/shine-border.json
index ab570a53..02cfb620 100644
--- a/apps/www/public/r/shine-border.json
+++ b/apps/www/public/r/shine-border.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/shine-border.tsx",
- "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface ShineBorderProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Width of the border in pixels\n * @default 1\n */\n borderWidth?: number;\n /**\n * Duration of the animation in seconds\n * @default 14\n */\n duration?: number;\n /**\n * Color of the border, can be a single color or an array of colors\n * @default \"#000000\"\n */\n shineColor?: string | string[];\n}\n\n/**\n * Shine Border\n *\n * An animated background border effect component with configurable properties.\n */\nexport function ShineBorder({\n borderWidth = 1,\n duration = 14,\n shineColor = \"#000000\",\n className,\n style,\n ...props\n}: ShineBorderProps) {\n return (\n <div\n style={\n {\n \"--border-width\": `${borderWidth}px`,\n \"--duration\": `${duration}s`,\n backgroundImage: `radial-gradient(transparent,transparent, ${\n Array.isArray(shineColor) ? shineColor.join(\",\") : shineColor\n },transparent,transparent)`,\n backgroundSize: \"300% 300%\",\n mask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,\n WebkitMask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,\n WebkitMaskComposite: \"xor\",\n maskComposite: \"exclude\",\n padding: \"var(--border-width)\",\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"pointer-events-none absolute inset-0 size-full rounded-[inherit] will-change-[background-position] motion-safe:animate-shine\",\n className,\n )}\n {...props}\n />\n );\n}\n",
+ "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ShineBorderProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Width of the border in pixels\n * @default 1\n */\n borderWidth?: number\n /**\n * Duration of the animation in seconds\n * @default 14\n */\n duration?: number\n /**\n * Color of the border, can be a single color or an array of colors\n * @default \"#000000\"\n */\n shineColor?: string | string[]\n}\n\n/**\n * Shine Border\n *\n * An animated background border effect component with configurable properties.\n */\nexport function ShineBorder({\n borderWidth = 1,\n duration = 14,\n shineColor = \"#000000\",\n className,\n style,\n ...props\n}: ShineBorderProps) {\n return (\n <div\n style={\n {\n \"--border-width\": `${borderWidth}px`,\n \"--duration\": `${duration}s`,\n backgroundImage: `radial-gradient(transparent,transparent, ${\n Array.isArray(shineColor) ? shineColor.join(\",\") : shineColor\n },transparent,transparent)`,\n backgroundSize: \"300% 300%\",\n mask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,\n WebkitMask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,\n WebkitMaskComposite: \"xor\",\n maskComposite: \"exclude\",\n padding: \"var(--border-width)\",\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"motion-safe:animate-shine pointer-events-none absolute inset-0 size-full rounded-[inherit] will-change-[background-position]\",\n className\n )}\n {...props}\n />\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/shiny-button-demo.json b/apps/www/public/r/shiny-button-demo.json
index d5bb0b77..fb2eecbc 100644
--- a/apps/www/public/r/shiny-button-demo.json
+++ b/apps/www/public/r/shiny-button-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/shiny-button-demo.tsx",
- "content": "import { ShinyButton } from \"@/registry/magicui/shiny-button\";\n\nexport default function ShinyButtonDemo() {\n return <ShinyButton>Shiny Button</ShinyButton>;\n}\n",
+ "content": "import { ShinyButton } from \"@/registry/magicui/shiny-button\"\n\nexport default function ShinyButtonDemo() {\n return <ShinyButton>Shiny Button</ShinyButton>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/shiny-button.json b/apps/www/public/r/shiny-button.json
index e833e9da..37568aa1 100644
--- a/apps/www/public/r/shiny-button.json
+++ b/apps/www/public/r/shiny-button.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/shiny-button.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { motion, type MotionProps } from \"motion/react\";\nimport React from \"react\";\n\nconst animationProps: MotionProps = {\n initial: { \"--x\": \"100%\", scale: 0.8 },\n animate: { \"--x\": \"-100%\", scale: 1 },\n whileTap: { scale: 0.95 },\n transition: {\n repeat: Infinity,\n repeatType: \"loop\",\n repeatDelay: 1,\n type: \"spring\",\n stiffness: 20,\n damping: 15,\n mass: 2,\n scale: {\n type: \"spring\",\n stiffness: 200,\n damping: 5,\n mass: 0.5,\n },\n },\n};\n\ninterface ShinyButtonProps\n extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps>,\n MotionProps {\n children: React.ReactNode;\n className?: string;\n}\n\nexport const ShinyButton = React.forwardRef<\n HTMLButtonElement,\n ShinyButtonProps\n>(({ children, className, ...props }, ref) => {\n return (\n <motion.button\n ref={ref}\n className={cn(\n \"relative cursor-pointer rounded-lg px-6 py-2 font-medium backdrop-blur-xl border transition-shadow duration-300 ease-in-out hover:shadow dark:bg-[radial-gradient(circle_at_50%_0%,var(--primary)/10%_0%,transparent_60%)] dark:hover:shadow-[0_0_20px_var(--primary)/10%]\",\n className,\n )}\n {...animationProps}\n {...props}\n >\n <span\n className=\"relative block size-full text-sm uppercase tracking-wide text-[rgb(0,0,0,65%)] dark:font-light dark:text-[rgb(255,255,255,90%)]\"\n style={{\n maskImage:\n \"linear-gradient(-75deg,var(--primary) calc(var(--x) + 20%),transparent calc(var(--x) + 30%),var(--primary) calc(var(--x) + 100%))\",\n }}\n >\n {children}\n </span>\n <span\n style={{\n mask: \"linear-gradient(rgb(0,0,0), rgb(0,0,0)) content-box exclude,linear-gradient(rgb(0,0,0), rgb(0,0,0))\",\n WebkitMask:\n \"linear-gradient(rgb(0,0,0), rgb(0,0,0)) content-box exclude,linear-gradient(rgb(0,0,0), rgb(0,0,0))\",\n backgroundImage:\n \"linear-gradient(-75deg,var(--primary)/10% calc(var(--x)+20%),var(--primary)/50% calc(var(--x)+25%),var(--primary)/10% calc(var(--x)+100%))\",\n }}\n className=\"absolute inset-0 z-10 block rounded-[inherit] p-px\"\n />\n </motion.button>\n );\n});\n\nShinyButton.displayName = \"ShinyButton\";\n",
+ "content": "\"use client\"\n\nimport React from \"react\"\nimport { motion, type MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst animationProps: MotionProps = {\n initial: { \"--x\": \"100%\", scale: 0.8 },\n animate: { \"--x\": \"-100%\", scale: 1 },\n whileTap: { scale: 0.95 },\n transition: {\n repeat: Infinity,\n repeatType: \"loop\",\n repeatDelay: 1,\n type: \"spring\",\n stiffness: 20,\n damping: 15,\n mass: 2,\n scale: {\n type: \"spring\",\n stiffness: 200,\n damping: 5,\n mass: 0.5,\n },\n },\n}\n\ninterface ShinyButtonProps\n extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps>,\n MotionProps {\n children: React.ReactNode\n className?: string\n}\n\nexport const ShinyButton = React.forwardRef<\n HTMLButtonElement,\n ShinyButtonProps\n>(({ children, className, ...props }, ref) => {\n return (\n <motion.button\n ref={ref}\n className={cn(\n \"relative cursor-pointer rounded-lg border px-6 py-2 font-medium backdrop-blur-xl transition-shadow duration-300 ease-in-out hover:shadow dark:bg-[radial-gradient(circle_at_50%_0%,var(--primary)/10%_0%,transparent_60%)] dark:hover:shadow-[0_0_20px_var(--primary)/10%]\",\n className\n )}\n {...animationProps}\n {...props}\n >\n <span\n className=\"relative block size-full text-sm tracking-wide text-[rgb(0,0,0,65%)] uppercase dark:font-light dark:text-[rgb(255,255,255,90%)]\"\n style={{\n maskImage:\n \"linear-gradient(-75deg,var(--primary) calc(var(--x) + 20%),transparent calc(var(--x) + 30%),var(--primary) calc(var(--x) + 100%))\",\n }}\n >\n {children}\n </span>\n <span\n style={{\n mask: \"linear-gradient(rgb(0,0,0), rgb(0,0,0)) content-box exclude,linear-gradient(rgb(0,0,0), rgb(0,0,0))\",\n WebkitMask:\n \"linear-gradient(rgb(0,0,0), rgb(0,0,0)) content-box exclude,linear-gradient(rgb(0,0,0), rgb(0,0,0))\",\n backgroundImage:\n \"linear-gradient(-75deg,var(--primary)/10% calc(var(--x)+20%),var(--primary)/50% calc(var(--x)+25%),var(--primary)/10% calc(var(--x)+100%))\",\n }}\n className=\"absolute inset-0 z-10 block rounded-[inherit] p-px\"\n />\n </motion.button>\n )\n})\n\nShinyButton.displayName = \"ShinyButton\"\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/smooth-cursor-demo.json b/apps/www/public/r/smooth-cursor-demo.json
index be750e36..611baf70 100644
--- a/apps/www/public/r/smooth-cursor-demo.json
+++ b/apps/www/public/r/smooth-cursor-demo.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/example/smooth-cursor-demo.tsx",
- "content": "import { SmoothCursor } from \"@/registry/magicui/smooth-cursor\";\n\nexport default function SmoothCursorDemo() {\n return (\n <>\n <span className=\"hidden md:block\">Move your mouse around</span>\n <span className=\"block md:hidden\">Tap anywhere to see the cursor</span>\n <SmoothCursor />\n </>\n );\n}\n",
+ "content": "import { SmoothCursor } from \"@/registry/magicui/smooth-cursor\"\n\nexport default function SmoothCursorDemo() {\n return (\n <>\n <span className=\"hidden md:block\">Move your mouse around</span>\n <span className=\"block md:hidden\">Tap anywhere to see the cursor</span>\n <SmoothCursor />\n </>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/smooth-cursor.json b/apps/www/public/r/smooth-cursor.json
index 27aa949e..3c2ea020 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 { motion, useSpring } from \"motion/react\";\nimport { FC, useEffect, useRef, useState } from \"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 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 [isMoving, setIsMoving] = useState(false);\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\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 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 smoothMouseMove = (e: MouseEvent) => {\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 setIsMoving(true);\n\n const timeout = setTimeout(() => {\n scale.set(1);\n setIsMoving(false);\n }, 150);\n\n return () => clearTimeout(timeout);\n }\n };\n\n let rafId: number;\n const throttledMouseMove = (e: MouseEvent) => {\n if (rafId) return;\n\n rafId = requestAnimationFrame(() => {\n smoothMouseMove(e);\n rafId = 0;\n });\n };\n\n document.body.style.cursor = \"none\";\n window.addEventListener(\"mousemove\", throttledMouseMove);\n\n return () => {\n window.removeEventListener(\"mousemove\", throttledMouseMove);\n document.body.style.cursor = \"auto\";\n if (rafId) cancelAnimationFrame(rafId);\n };\n }, [cursorX, cursorY, rotation, scale]);\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 }}\n initial={{ scale: 0 }}\n animate={{ scale: 1 }}\n transition={{\n type: \"spring\",\n stiffness: 400,\n damping: 30,\n }}\n >\n {cursor}\n </motion.div>\n );\n}\n",
+ "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 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 [isMoving, setIsMoving] = useState(false)\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\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 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 smoothMouseMove = (e: MouseEvent) => {\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 setIsMoving(true)\n\n const timeout = setTimeout(() => {\n scale.set(1)\n setIsMoving(false)\n }, 150)\n\n return () => clearTimeout(timeout)\n }\n }\n\n let rafId: number\n const throttledMouseMove = (e: MouseEvent) => {\n if (rafId) return\n\n rafId = requestAnimationFrame(() => {\n smoothMouseMove(e)\n rafId = 0\n })\n }\n\n document.body.style.cursor = \"none\"\n window.addEventListener(\"mousemove\", throttledMouseMove)\n\n return () => {\n window.removeEventListener(\"mousemove\", throttledMouseMove)\n document.body.style.cursor = \"auto\"\n if (rafId) cancelAnimationFrame(rafId)\n }\n }, [cursorX, cursorY, rotation, scale])\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 }}\n initial={{ scale: 0 }}\n animate={{ scale: 1 }}\n transition={{\n type: \"spring\",\n stiffness: 400,\n damping: 30,\n }}\n >\n {cursor}\n </motion.div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/sparkles-text-demo.json b/apps/www/public/r/sparkles-text-demo.json
index d4d91cbe..811149ac 100644
--- a/apps/www/public/r/sparkles-text-demo.json
+++ b/apps/www/public/r/sparkles-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/sparkles-text-demo.tsx",
- "content": "import { SparklesText } from \"@/registry/magicui/sparkles-text\";\n\nexport default function SparklesTextDemo() {\n return <SparklesText>Magic UI</SparklesText>;\n}\n",
+ "content": "import { SparklesText } from \"@/registry/magicui/sparkles-text\"\n\nexport default function SparklesTextDemo() {\n return <SparklesText>Magic UI</SparklesText>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/sparkles-text.json b/apps/www/public/r/sparkles-text.json
index 5e4f0f75..22a08ec5 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 { motion } from \"motion/react\";\nimport { CSSProperties, ReactElement, useEffect, useState } from \"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 { 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",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/spinning-text-demo-2.json b/apps/www/public/r/spinning-text-demo-2.json
index f366d1b0..ca911b9a 100644
--- a/apps/www/public/r/spinning-text-demo-2.json
+++ b/apps/www/public/r/spinning-text-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/spinning-text-demo-2.tsx",
- "content": "import { SpinningText } from \"@/registry/magicui/spinning-text\";\n\nexport default function SpinningTextBasic() {\n return (\n <SpinningText reverse className=\"text-4xl\" duration={4} radius={6}>\n learn more • earn more • grow more •\n </SpinningText>\n );\n}\n",
+ "content": "import { SpinningText } from \"@/registry/magicui/spinning-text\"\n\nexport default function SpinningTextBasic() {\n return (\n <SpinningText reverse className=\"text-4xl\" duration={4} radius={6}>\n learn more • earn more • grow more •\n </SpinningText>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/spinning-text-demo.json b/apps/www/public/r/spinning-text-demo.json
index c54aa944..fbf32aa6 100644
--- a/apps/www/public/r/spinning-text-demo.json
+++ b/apps/www/public/r/spinning-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/spinning-text-demo.tsx",
- "content": "import { SpinningText } from \"@/registry/magicui/spinning-text\";\n\nexport default function SpinningTextBasic() {\n return <SpinningText>learn more • earn more • grow more •</SpinningText>;\n}\n",
+ "content": "import { SpinningText } from \"@/registry/magicui/spinning-text\"\n\nexport default function SpinningTextBasic() {\n return <SpinningText>learn more • earn more • grow more •</SpinningText>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/spinning-text.json b/apps/www/public/r/spinning-text.json
index 1b2b935f..46dbdb36 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 { cn } from \"@/lib/utils\";\nimport { motion, Transition, Variants } from \"motion/react\";\nimport React, { ComponentPropsWithoutRef } from \"react\";\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 left-1/2 top-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, { ComponentPropsWithoutRef } from \"react\"\nimport { motion, Transition, Variants } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface SpinningTextProps extends ComponentPropsWithoutRef<\"div\"> {\n children: string | string[]\n duration?: number\n reverse?: boolean\n radius?: number\n transition?: Transition\n variants?: {\n container?: Variants\n item?: Variants\n }\n}\n\nconst BASE_TRANSITION: Transition = {\n repeat: Infinity,\n ease: \"linear\",\n}\n\nconst BASE_ITEM_VARIANTS: Variants = {\n hidden: {\n opacity: 1,\n },\n visible: {\n opacity: 1,\n },\n}\n\nexport function SpinningText({\n children,\n duration = 10,\n reverse = false,\n radius = 5,\n transition,\n variants,\n className,\n style,\n}: SpinningTextProps) {\n if (typeof children !== \"string\" && !Array.isArray(children)) {\n throw new Error(\"children must be a string or an array of strings\")\n }\n\n if (Array.isArray(children)) {\n // Validate all elements are strings\n if (!children.every((child) => typeof child === \"string\")) {\n throw new Error(\"all elements in children array must be strings\")\n }\n children = children.join(\"\")\n }\n\n const letters = children.split(\"\")\n letters.push(\" \")\n\n const finalTransition: Transition = {\n ...BASE_TRANSITION,\n ...transition,\n duration: (transition as { duration?: number })?.duration ?? duration,\n }\n\n const containerVariants: Variants = {\n visible: { rotate: reverse ? -360 : 360 },\n ...variants?.container,\n }\n\n const itemVariants: Variants = {\n ...BASE_ITEM_VARIANTS,\n ...variants?.item,\n }\n\n return (\n <motion.div\n className={cn(\"relative\", className)}\n style={{\n ...style,\n }}\n initial=\"hidden\"\n animate=\"visible\"\n variants={containerVariants}\n transition={finalTransition}\n >\n {letters.map((letter, index) => (\n <motion.span\n aria-hidden=\"true\"\n key={`${index}-${letter}`}\n variants={itemVariants}\n className=\"absolute top-1/2 left-1/2 inline-block\"\n style={\n {\n \"--index\": index,\n \"--total\": letters.length,\n \"--radius\": radius,\n transform: `\n translate(-50%, -50%)\n rotate(calc(360deg / var(--total) * var(--index)))\n translateY(calc(var(--radius, 5) * -1ch))\n `,\n transformOrigin: \"center\",\n } as React.CSSProperties\n }\n >\n {letter}\n </motion.span>\n ))}\n <span className=\"sr-only\">{children}</span>\n </motion.div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/terminal-demo-2.json b/apps/www/public/r/terminal-demo-2.json
index 9b900e0b..df08ba30 100644
--- a/apps/www/public/r/terminal-demo-2.json
+++ b/apps/www/public/r/terminal-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/terminal-demo-2.tsx",
- "content": "import {\n AnimatedSpan,\n Terminal,\n TypingAnimation,\n} from \"@/registry/magicui/terminal\";\n\nexport default function TerminalDemo2() {\n return (\n <Terminal>\n <TypingAnimation delay={0}>$ ls</TypingAnimation>\n\n <AnimatedSpan delay={800} className=\"text-blue-500\">\n Documents Downloads Pictures\n </AnimatedSpan>\n\n <TypingAnimation delay={1600}>$ cd Documents</TypingAnimation>\n\n <TypingAnimation delay={2400}>$ pwd</TypingAnimation>\n\n <AnimatedSpan delay={3200} className=\"text-green-500\">\n /home/user/Documents\n </AnimatedSpan>\n </Terminal>\n );\n}\n",
+ "content": "import {\n AnimatedSpan,\n Terminal,\n TypingAnimation,\n} from \"@/registry/magicui/terminal\"\n\nexport default function TerminalDemo2() {\n return (\n <Terminal>\n <TypingAnimation delay={0}>$ ls</TypingAnimation>\n\n <AnimatedSpan delay={800} className=\"text-blue-500\">\n Documents Downloads Pictures\n </AnimatedSpan>\n\n <TypingAnimation delay={1600}>$ cd Documents</TypingAnimation>\n\n <TypingAnimation delay={2400}>$ pwd</TypingAnimation>\n\n <AnimatedSpan delay={3200} className=\"text-green-500\">\n /home/user/Documents\n </AnimatedSpan>\n </Terminal>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/terminal-demo.json b/apps/www/public/r/terminal-demo.json
index 06aade16..84c3004f 100644
--- a/apps/www/public/r/terminal-demo.json
+++ b/apps/www/public/r/terminal-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/terminal-demo.tsx",
- "content": "import {\n AnimatedSpan,\n Terminal,\n TypingAnimation,\n} from \"@/registry/magicui/terminal\";\n\nexport default function TerminalDemo() {\n return (\n <Terminal>\n <TypingAnimation>&gt; pnpm dlx shadcn@latest init</TypingAnimation>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Preflight checks.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Verifying framework. Found Next.js.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Validating Tailwind CSS.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Validating import alias.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Writing components.json.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Checking registry.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Updating tailwind.config.ts\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Updating app/globals.css\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Installing dependencies.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-blue-500\">\n <span>ℹ Updated 1 file:</span>\n <span className=\"pl-2\">- lib/utils.ts</span>\n </AnimatedSpan>\n\n <TypingAnimation className=\"text-muted-foreground\">\n Success! Project initialization completed.\n </TypingAnimation>\n\n <TypingAnimation className=\"text-muted-foreground\">\n You may now add components.\n </TypingAnimation>\n </Terminal>\n );\n}\n",
+ "content": "import {\n AnimatedSpan,\n Terminal,\n TypingAnimation,\n} from \"@/registry/magicui/terminal\"\n\nexport default function TerminalDemo() {\n return (\n <Terminal>\n <TypingAnimation>&gt; pnpm dlx shadcn@latest init</TypingAnimation>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Preflight checks.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Verifying framework. Found Next.js.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Validating Tailwind CSS.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Validating import alias.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Writing components.json.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Checking registry.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Updating tailwind.config.ts\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Updating app/globals.css\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-green-500\">\n ✔ Installing dependencies.\n </AnimatedSpan>\n\n <AnimatedSpan className=\"text-blue-500\">\n <span>ℹ Updated 1 file:</span>\n <span className=\"pl-2\">- lib/utils.ts</span>\n </AnimatedSpan>\n\n <TypingAnimation className=\"text-muted-foreground\">\n Success! Project initialization completed.\n </TypingAnimation>\n\n <TypingAnimation className=\"text-muted-foreground\">\n You may now add components.\n </TypingAnimation>\n </Terminal>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/terminal.json b/apps/www/public/r/terminal.json
index dddc4385..e8eea0bb 100644
--- a/apps/www/public/r/terminal.json
+++ b/apps/www/public/r/terminal.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/terminal.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { motion, MotionProps, useInView } from \"motion/react\";\nimport {\n Children,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\ninterface SequenceContextValue {\n completeItem: (index: number) => void;\n activeIndex: number;\n sequenceStarted: boolean;\n}\n\nconst SequenceContext = createContext<SequenceContextValue | null>(null);\n\nconst useSequence = () => useContext(SequenceContext);\n\nconst ItemIndexContext = createContext<number | null>(null);\nconst useItemIndex = () => useContext(ItemIndexContext);\n\ninterface AnimatedSpanProps extends MotionProps {\n children: React.ReactNode;\n delay?: number;\n className?: string;\n startOnView?: boolean;\n}\n\nexport const AnimatedSpan = ({\n children,\n delay = 0,\n className,\n startOnView = false,\n ...props\n}: AnimatedSpanProps) => {\n const elementRef = useRef<HTMLDivElement | null>(null);\n const isInView = useInView(elementRef as React.RefObject<Element>, {\n amount: 0.3,\n once: true,\n });\n\n const sequence = useSequence();\n const itemIndex = useItemIndex();\n const [hasStarted, setHasStarted] = useState(false);\n useEffect(() => {\n if (!sequence || itemIndex === null) return;\n if (!sequence.sequenceStarted) return;\n if (hasStarted) return;\n if (sequence.activeIndex === itemIndex) {\n setHasStarted(true);\n }\n }, [sequence?.activeIndex, sequence?.sequenceStarted, hasStarted, itemIndex]);\n\n const shouldAnimate = sequence ? hasStarted : startOnView ? isInView : true;\n\n return (\n <motion.div\n ref={elementRef}\n initial={{ opacity: 0, y: -5 }}\n animate={shouldAnimate ? { opacity: 1, y: 0 } : { opacity: 0, y: -5 }}\n transition={{ duration: 0.3, delay: sequence ? 0 : delay / 1000 }}\n className={cn(\"grid text-sm font-normal tracking-tight\", className)}\n onAnimationComplete={() => {\n if (!sequence) return;\n if (itemIndex === null) return;\n sequence.completeItem(itemIndex);\n }}\n {...props}\n >\n {children}\n </motion.div>\n );\n};\n\ninterface TypingAnimationProps extends MotionProps {\n children: string;\n className?: string;\n duration?: number;\n delay?: number;\n as?: React.ElementType;\n startOnView?: boolean;\n}\n\nexport const TypingAnimation = ({\n children,\n className,\n duration = 60,\n delay = 0,\n as: Component = \"span\",\n startOnView = true,\n ...props\n}: TypingAnimationProps) => {\n if (typeof children !== \"string\") {\n throw new Error(\"TypingAnimation: children must be a string. Received:\");\n }\n\n const MotionComponent = useMemo(\n () =>\n motion.create(Component, {\n forwardMotionProps: true,\n }),\n [Component],\n );\n\n const [displayedText, setDisplayedText] = useState<string>(\"\");\n const [started, setStarted] = useState(false);\n const elementRef = useRef<HTMLElement | null>(null);\n const isInView = useInView(elementRef as React.RefObject<Element>, {\n amount: 0.3,\n once: true,\n });\n\n const sequence = useSequence();\n const itemIndex = useItemIndex();\n\n useEffect(() => {\n if (sequence && itemIndex !== null) {\n if (!sequence.sequenceStarted) return;\n if (started) return;\n if (sequence.activeIndex === itemIndex) {\n setStarted(true);\n }\n return;\n }\n\n if (!startOnView) {\n const startTimeout = setTimeout(() => setStarted(true), delay);\n return () => clearTimeout(startTimeout);\n }\n\n if (!isInView) return;\n\n const startTimeout = setTimeout(() => setStarted(true), delay);\n return () => clearTimeout(startTimeout);\n }, [\n delay,\n startOnView,\n isInView,\n started,\n sequence?.activeIndex,\n sequence?.sequenceStarted,\n itemIndex,\n ]);\n\n useEffect(() => {\n if (!started) return;\n\n let i = 0;\n const typingEffect = setInterval(() => {\n if (i < children.length) {\n setDisplayedText(children.substring(0, i + 1));\n i++;\n } else {\n clearInterval(typingEffect);\n if (sequence && itemIndex !== null) {\n sequence.completeItem(itemIndex);\n }\n }\n }, duration);\n\n return () => {\n clearInterval(typingEffect);\n };\n }, [children, duration, started]);\n\n return (\n <MotionComponent\n ref={elementRef}\n className={cn(\"text-sm font-normal tracking-tight\", className)}\n {...props}\n >\n {displayedText}\n </MotionComponent>\n );\n};\n\ninterface TerminalProps {\n children: React.ReactNode;\n className?: string;\n sequence?: boolean;\n startOnView?: boolean;\n}\n\nexport const Terminal = ({\n children,\n className,\n sequence = true,\n startOnView = true,\n}: TerminalProps) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const isInView = useInView(containerRef as React.RefObject<Element>, {\n amount: 0.3,\n once: true,\n });\n\n const [activeIndex, setActiveIndex] = useState(0);\n const sequenceHasStarted = sequence ? !startOnView || isInView : false;\n\n const contextValue = useMemo<SequenceContextValue | null>(() => {\n if (!sequence) return null;\n return {\n completeItem: (index: number) => {\n setActiveIndex((current) =>\n index === current ? current + 1 : current,\n );\n },\n activeIndex,\n sequenceStarted: sequenceHasStarted,\n };\n }, [sequence, activeIndex, sequenceHasStarted]);\n\n const wrappedChildren = useMemo(() => {\n if (!sequence) return children;\n const array = Children.toArray(children);\n return array.map((child, index) => (\n <ItemIndexContext.Provider key={index} value={index}>\n {child as React.ReactNode}\n </ItemIndexContext.Provider>\n ));\n }, [children, sequence]);\n\n const content = (\n <div\n ref={containerRef}\n className={cn(\n \"z-0 h-full max-h-[400px] w-full max-w-lg rounded-xl border border-border bg-background\",\n className,\n )}\n >\n <div className=\"flex flex-col gap-y-2 border-b border-border p-4\">\n <div className=\"flex flex-row gap-x-2\">\n <div className=\"h-2 w-2 rounded-full bg-red-500\"></div>\n <div className=\"h-2 w-2 rounded-full bg-yellow-500\"></div>\n <div className=\"h-2 w-2 rounded-full bg-green-500\"></div>\n </div>\n </div>\n <pre className=\"p-4\">\n <code className=\"grid gap-y-1 overflow-auto\">{wrappedChildren}</code>\n </pre>\n </div>\n );\n\n if (!sequence) return content;\n\n return (\n <SequenceContext.Provider value={contextValue}>\n {content}\n </SequenceContext.Provider>\n );\n};\n",
+ "content": "\"use client\"\n\nimport {\n Children,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { motion, MotionProps, useInView } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface SequenceContextValue {\n completeItem: (index: number) => void\n activeIndex: number\n sequenceStarted: boolean\n}\n\nconst SequenceContext = createContext<SequenceContextValue | null>(null)\n\nconst useSequence = () => useContext(SequenceContext)\n\nconst ItemIndexContext = createContext<number | null>(null)\nconst useItemIndex = () => useContext(ItemIndexContext)\n\ninterface AnimatedSpanProps extends MotionProps {\n children: React.ReactNode\n delay?: number\n className?: string\n startOnView?: boolean\n}\n\nexport const AnimatedSpan = ({\n children,\n delay = 0,\n className,\n startOnView = false,\n ...props\n}: AnimatedSpanProps) => {\n const elementRef = useRef<HTMLDivElement | null>(null)\n const isInView = useInView(elementRef as React.RefObject<Element>, {\n amount: 0.3,\n once: true,\n })\n\n const sequence = useSequence()\n const itemIndex = useItemIndex()\n const [hasStarted, setHasStarted] = useState(false)\n useEffect(() => {\n if (!sequence || itemIndex === null) return\n if (!sequence.sequenceStarted) return\n if (hasStarted) return\n if (sequence.activeIndex === itemIndex) {\n setHasStarted(true)\n }\n }, [sequence?.activeIndex, sequence?.sequenceStarted, hasStarted, itemIndex])\n\n const shouldAnimate = sequence ? hasStarted : startOnView ? isInView : true\n\n return (\n <motion.div\n ref={elementRef}\n initial={{ opacity: 0, y: -5 }}\n animate={shouldAnimate ? { opacity: 1, y: 0 } : { opacity: 0, y: -5 }}\n transition={{ duration: 0.3, delay: sequence ? 0 : delay / 1000 }}\n className={cn(\"grid text-sm font-normal tracking-tight\", className)}\n onAnimationComplete={() => {\n if (!sequence) return\n if (itemIndex === null) return\n sequence.completeItem(itemIndex)\n }}\n {...props}\n >\n {children}\n </motion.div>\n )\n}\n\ninterface TypingAnimationProps extends MotionProps {\n children: string\n className?: string\n duration?: number\n delay?: number\n as?: React.ElementType\n startOnView?: boolean\n}\n\nexport const TypingAnimation = ({\n children,\n className,\n duration = 60,\n delay = 0,\n as: Component = \"span\",\n startOnView = true,\n ...props\n}: TypingAnimationProps) => {\n if (typeof children !== \"string\") {\n throw new Error(\"TypingAnimation: children must be a string. Received:\")\n }\n\n const MotionComponent = useMemo(\n () =>\n motion.create(Component, {\n forwardMotionProps: true,\n }),\n [Component]\n )\n\n const [displayedText, setDisplayedText] = useState<string>(\"\")\n const [started, setStarted] = useState(false)\n const elementRef = useRef<HTMLElement | null>(null)\n const isInView = useInView(elementRef as React.RefObject<Element>, {\n amount: 0.3,\n once: true,\n })\n\n const sequence = useSequence()\n const itemIndex = useItemIndex()\n\n useEffect(() => {\n if (sequence && itemIndex !== null) {\n if (!sequence.sequenceStarted) return\n if (started) return\n if (sequence.activeIndex === itemIndex) {\n setStarted(true)\n }\n return\n }\n\n if (!startOnView) {\n const startTimeout = setTimeout(() => setStarted(true), delay)\n return () => clearTimeout(startTimeout)\n }\n\n if (!isInView) return\n\n const startTimeout = setTimeout(() => setStarted(true), delay)\n return () => clearTimeout(startTimeout)\n }, [\n delay,\n startOnView,\n isInView,\n started,\n sequence?.activeIndex,\n sequence?.sequenceStarted,\n itemIndex,\n ])\n\n useEffect(() => {\n if (!started) return\n\n let i = 0\n const typingEffect = setInterval(() => {\n if (i < children.length) {\n setDisplayedText(children.substring(0, i + 1))\n i++\n } else {\n clearInterval(typingEffect)\n if (sequence && itemIndex !== null) {\n sequence.completeItem(itemIndex)\n }\n }\n }, duration)\n\n return () => {\n clearInterval(typingEffect)\n }\n }, [children, duration, started])\n\n return (\n <MotionComponent\n ref={elementRef}\n className={cn(\"text-sm font-normal tracking-tight\", className)}\n {...props}\n >\n {displayedText}\n </MotionComponent>\n )\n}\n\ninterface TerminalProps {\n children: React.ReactNode\n className?: string\n sequence?: boolean\n startOnView?: boolean\n}\n\nexport const Terminal = ({\n children,\n className,\n sequence = true,\n startOnView = true,\n}: TerminalProps) => {\n const containerRef = useRef<HTMLDivElement | null>(null)\n const isInView = useInView(containerRef as React.RefObject<Element>, {\n amount: 0.3,\n once: true,\n })\n\n const [activeIndex, setActiveIndex] = useState(0)\n const sequenceHasStarted = sequence ? !startOnView || isInView : false\n\n const contextValue = useMemo<SequenceContextValue | null>(() => {\n if (!sequence) return null\n return {\n completeItem: (index: number) => {\n setActiveIndex((current) => (index === current ? current + 1 : current))\n },\n activeIndex,\n sequenceStarted: sequenceHasStarted,\n }\n }, [sequence, activeIndex, sequenceHasStarted])\n\n const wrappedChildren = useMemo(() => {\n if (!sequence) return children\n const array = Children.toArray(children)\n return array.map((child, index) => (\n <ItemIndexContext.Provider key={index} value={index}>\n {child as React.ReactNode}\n </ItemIndexContext.Provider>\n ))\n }, [children, sequence])\n\n const content = (\n <div\n ref={containerRef}\n className={cn(\n \"border-border bg-background z-0 h-full max-h-[400px] w-full max-w-lg rounded-xl border\",\n className\n )}\n >\n <div className=\"border-border flex flex-col gap-y-2 border-b p-4\">\n <div className=\"flex flex-row gap-x-2\">\n <div className=\"h-2 w-2 rounded-full bg-red-500\"></div>\n <div className=\"h-2 w-2 rounded-full bg-yellow-500\"></div>\n <div className=\"h-2 w-2 rounded-full bg-green-500\"></div>\n </div>\n </div>\n <pre className=\"p-4\">\n <code className=\"grid gap-y-1 overflow-auto\">{wrappedChildren}</code>\n </pre>\n </div>\n )\n\n if (!sequence) return content\n\n return (\n <SequenceContext.Provider value={contextValue}>\n {content}\n </SequenceContext.Provider>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/text-animate-demo-2.json b/apps/www/public/r/text-animate-demo-2.json
index 8a2bb36d..fda27ddf 100644
--- a/apps/www/public/r/text-animate-demo-2.json
+++ b/apps/www/public/r/text-animate-demo-2.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-animate-demo-2.tsx",
- "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\";\n\nexport default function TextAnimateDemo2() {\n return (\n <TextAnimate animation=\"blurIn\" as=\"h1\">\n Blur in text\n </TextAnimate>\n );\n}\n",
+ "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\"\n\nexport default function TextAnimateDemo2() {\n return (\n <TextAnimate animation=\"blurIn\" as=\"h1\">\n Blur in text\n </TextAnimate>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-animate-demo-3.json b/apps/www/public/r/text-animate-demo-3.json
index db77d1eb..563f08fd 100644
--- a/apps/www/public/r/text-animate-demo-3.json
+++ b/apps/www/public/r/text-animate-demo-3.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-animate-demo-3.tsx",
- "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\";\n\nexport default function TextAnimateDemo3() {\n return (\n <TextAnimate animation=\"slideUp\" by=\"word\">\n Slide up by word\n </TextAnimate>\n );\n}\n",
+ "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\"\n\nexport default function TextAnimateDemo3() {\n return (\n <TextAnimate animation=\"slideUp\" by=\"word\">\n Slide up by word\n </TextAnimate>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-animate-demo-4.json b/apps/www/public/r/text-animate-demo-4.json
index 1dbb5217..318efc4c 100644
--- a/apps/www/public/r/text-animate-demo-4.json
+++ b/apps/www/public/r/text-animate-demo-4.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-animate-demo-4.tsx",
- "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\";\n\nexport default function TextAnimateDemo4() {\n return (\n <TextAnimate animation=\"scaleUp\" by=\"text\">\n Scale up by text\n </TextAnimate>\n );\n}\n",
+ "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\"\n\nexport default function TextAnimateDemo4() {\n return (\n <TextAnimate animation=\"scaleUp\" by=\"text\">\n Scale up by text\n </TextAnimate>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-animate-demo-5.json b/apps/www/public/r/text-animate-demo-5.json
index ecd3d263..c45be626 100644
--- a/apps/www/public/r/text-animate-demo-5.json
+++ b/apps/www/public/r/text-animate-demo-5.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-animate-demo-5.tsx",
- "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\";\n\nexport default function TextAnimateDemo5() {\n return (\n <TextAnimate animation=\"fadeIn\" by=\"line\" as=\"p\">\n {`Fade in by line as paragraph\\n\\nFade in by line as paragraph\\n\\nFade in by line as paragraph`}\n </TextAnimate>\n );\n}\n",
+ "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\"\n\nexport default function TextAnimateDemo5() {\n return (\n <TextAnimate animation=\"fadeIn\" by=\"line\" as=\"p\">\n {`Fade in by line as paragraph\\n\\nFade in by line as paragraph\\n\\nFade in by line as paragraph`}\n </TextAnimate>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-animate-demo-6.json b/apps/www/public/r/text-animate-demo-6.json
index eabb4550..ae5af501 100644
--- a/apps/www/public/r/text-animate-demo-6.json
+++ b/apps/www/public/r/text-animate-demo-6.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-animate-demo-6.tsx",
- "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\";\n\nexport default function TextAnimateDemo6() {\n return (\n <TextAnimate animation=\"slideLeft\" by=\"character\">\n Slide left by character\n </TextAnimate>\n );\n}\n",
+ "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\"\n\nexport default function TextAnimateDemo6() {\n return (\n <TextAnimate animation=\"slideLeft\" by=\"character\">\n Slide left by character\n </TextAnimate>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-animate-demo-7.json b/apps/www/public/r/text-animate-demo-7.json
index 1dc98d28..42bd7a8c 100644
--- a/apps/www/public/r/text-animate-demo-7.json
+++ b/apps/www/public/r/text-animate-demo-7.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-animate-demo-7.tsx",
- "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\";\n\nexport default function TextAnimateDemo7() {\n return (\n <TextAnimate animation=\"blurInUp\" by=\"character\" delay={2}>\n Blur in by character\n </TextAnimate>\n );\n}\n",
+ "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\"\n\nexport default function TextAnimateDemo7() {\n return (\n <TextAnimate animation=\"blurInUp\" by=\"character\" delay={2}>\n Blur in by character\n </TextAnimate>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-animate-demo-8.json b/apps/www/public/r/text-animate-demo-8.json
index a9709bfd..02038209 100644
--- a/apps/www/public/r/text-animate-demo-8.json
+++ b/apps/www/public/r/text-animate-demo-8.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-animate-demo-8.tsx",
- "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\";\n\nexport default function TextAnimateDemo8() {\n return (\n <TextAnimate animation=\"blurInUp\" by=\"character\" duration={5}>\n Blur in by character\n </TextAnimate>\n );\n}\n",
+ "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\"\n\nexport default function TextAnimateDemo8() {\n return (\n <TextAnimate animation=\"blurInUp\" by=\"character\" duration={5}>\n Blur in by character\n </TextAnimate>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-animate-demo-9.json b/apps/www/public/r/text-animate-demo-9.json
index 009d51d7..751d24dd 100644
--- a/apps/www/public/r/text-animate-demo-9.json
+++ b/apps/www/public/r/text-animate-demo-9.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-animate-demo-9.tsx",
- "content": "\"use client\";\n\nimport { TextAnimate } from \"@/registry/magicui/text-animate\";\n\nexport default function TextAnimateDemo9() {\n return (\n <TextAnimate\n variants={{\n hidden: {\n opacity: 0,\n y: 30,\n rotate: 45,\n scale: 0.5,\n },\n show: (i) => ({\n opacity: 1,\n y: 0,\n rotate: 0,\n scale: 1,\n transition: {\n delay: i * 0.1,\n duration: 0.4,\n y: {\n type: \"spring\",\n damping: 12,\n stiffness: 200,\n mass: 0.8,\n },\n rotate: {\n type: \"spring\",\n damping: 8,\n stiffness: 150,\n },\n scale: {\n type: \"spring\",\n damping: 10,\n stiffness: 300,\n },\n },\n }),\n exit: (i) => ({\n opacity: 0,\n y: 30,\n rotate: 45,\n scale: 0.5,\n transition: {\n delay: i * 0.1,\n duration: 0.4,\n },\n }),\n }}\n by=\"character\"\n >\n Wavy Motion!\n </TextAnimate>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { TextAnimate } from \"@/registry/magicui/text-animate\"\n\nexport default function TextAnimateDemo9() {\n return (\n <TextAnimate\n variants={{\n hidden: {\n opacity: 0,\n y: 30,\n rotate: 45,\n scale: 0.5,\n },\n show: (i) => ({\n opacity: 1,\n y: 0,\n rotate: 0,\n scale: 1,\n transition: {\n delay: i * 0.1,\n duration: 0.4,\n y: {\n type: \"spring\",\n damping: 12,\n stiffness: 200,\n mass: 0.8,\n },\n rotate: {\n type: \"spring\",\n damping: 8,\n stiffness: 150,\n },\n scale: {\n type: \"spring\",\n damping: 10,\n stiffness: 300,\n },\n },\n }),\n exit: (i) => ({\n opacity: 0,\n y: 30,\n rotate: 45,\n scale: 0.5,\n transition: {\n delay: i * 0.1,\n duration: 0.4,\n },\n }),\n }}\n by=\"character\"\n >\n Wavy Motion!\n </TextAnimate>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-animate-demo.json b/apps/www/public/r/text-animate-demo.json
index fc0a9d2f..7157b00b 100644
--- a/apps/www/public/r/text-animate-demo.json
+++ b/apps/www/public/r/text-animate-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-animate-demo.tsx",
- "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\";\n\nexport default function TextAnimateDemo() {\n return (\n <TextAnimate animation=\"blurInUp\" by=\"character\" once>\n Blur in by character\n </TextAnimate>\n );\n}\n",
+ "content": "import { TextAnimate } from \"@/registry/magicui/text-animate\"\n\nexport default function TextAnimateDemo() {\n return (\n <TextAnimate animation=\"blurInUp\" by=\"character\" once>\n Blur in by character\n </TextAnimate>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-animate.json b/apps/www/public/r/text-animate.json
index 6d752498..2f3f78d2 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 { cn } from \"@/lib/utils\";\nimport { AnimatePresence, motion, MotionProps, Variants } from \"motion/react\";\nimport { ElementType, memo } from \"react\";\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\ninterface TextAnimateProps extends MotionProps {\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?: ElementType;\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 = motion.create(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 { ElementType, memo } from \"react\"\nimport { AnimatePresence, motion, MotionProps, Variants } 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\ninterface TextAnimateProps extends MotionProps {\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?: ElementType\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 = motion.create(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/text-reveal-demo.json b/apps/www/public/r/text-reveal-demo.json
index b6c8ab5e..946203ec 100644
--- a/apps/www/public/r/text-reveal-demo.json
+++ b/apps/www/public/r/text-reveal-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/text-reveal-demo.tsx",
- "content": "import { TextReveal } from \"@/registry/magicui/text-reveal\";\n\nexport default function TextRevealDemo() {\n return <TextReveal>Magic UI will change the way you design.</TextReveal>;\n}\n",
+ "content": "import { TextReveal } from \"@/registry/magicui/text-reveal\"\n\nexport default function TextRevealDemo() {\n return <TextReveal>Magic UI will change the way you design.</TextReveal>\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/text-reveal.json b/apps/www/public/r/text-reveal.json
index 75aa2133..404ea203 100644
--- a/apps/www/public/r/text-reveal.json
+++ b/apps/www/public/r/text-reveal.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/text-reveal.tsx",
- "content": "\"use client\";\n\nimport { motion, MotionValue, useScroll, useTransform } from \"motion/react\";\nimport { ComponentPropsWithoutRef, FC, ReactNode, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface TextRevealProps extends ComponentPropsWithoutRef<\"div\"> {\n children: string;\n}\n\nexport const TextReveal: FC<TextRevealProps> = ({ children, className }) => {\n const targetRef = useRef<HTMLDivElement | null>(null);\n const { scrollYProgress } = useScroll({\n target: targetRef,\n });\n\n if (typeof children !== \"string\") {\n throw new Error(\"TextReveal: children must be a string\");\n }\n\n const words = children.split(\" \");\n\n return (\n <div ref={targetRef} className={cn(\"relative z-0 h-[200vh]\", className)}>\n <div\n className={\n \"sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-[1rem] py-[5rem]\"\n }\n >\n <span\n ref={targetRef}\n className={\n \"flex flex-wrap p-5 text-2xl font-bold text-black/20 dark:text-white/20 md:p-8 md:text-3xl lg:p-10 lg:text-4xl xl:text-5xl\"\n }\n >\n {words.map((word, i) => {\n const start = i / words.length;\n const end = start + 1 / words.length;\n return (\n <Word key={i} progress={scrollYProgress} range={[start, end]}>\n {word}\n </Word>\n );\n })}\n </span>\n </div>\n </div>\n );\n};\n\ninterface WordProps {\n children: ReactNode;\n progress: MotionValue<number>;\n range: [number, number];\n}\n\nconst Word: FC<WordProps> = ({ children, progress, range }) => {\n const opacity = useTransform(progress, range, [0, 1]);\n return (\n <span className=\"xl:lg-3 relative mx-1 lg:mx-1.5\">\n <span className=\"absolute opacity-30\">{children}</span>\n <motion.span\n style={{ opacity: opacity }}\n className={\"text-black dark:text-white\"}\n >\n {children}\n </motion.span>\n </span>\n );\n};\n",
+ "content": "\"use client\"\n\nimport { ComponentPropsWithoutRef, FC, ReactNode, useRef } from \"react\"\nimport { motion, MotionValue, useScroll, useTransform } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface TextRevealProps extends ComponentPropsWithoutRef<\"div\"> {\n children: string\n}\n\nexport const TextReveal: FC<TextRevealProps> = ({ children, className }) => {\n const targetRef = useRef<HTMLDivElement | null>(null)\n const { scrollYProgress } = useScroll({\n target: targetRef,\n })\n\n if (typeof children !== \"string\") {\n throw new Error(\"TextReveal: children must be a string\")\n }\n\n const words = children.split(\" \")\n\n return (\n <div ref={targetRef} className={cn(\"relative z-0 h-[200vh]\", className)}>\n <div\n className={\n \"sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-[1rem] py-[5rem]\"\n }\n >\n <span\n ref={targetRef}\n className={\n \"flex flex-wrap p-5 text-2xl font-bold text-black/20 md:p-8 md:text-3xl lg:p-10 lg:text-4xl xl:text-5xl dark:text-white/20\"\n }\n >\n {words.map((word, i) => {\n const start = i / words.length\n const end = start + 1 / words.length\n return (\n <Word key={i} progress={scrollYProgress} range={[start, end]}>\n {word}\n </Word>\n )\n })}\n </span>\n </div>\n </div>\n )\n}\n\ninterface WordProps {\n children: ReactNode\n progress: MotionValue<number>\n range: [number, number]\n}\n\nconst Word: FC<WordProps> = ({ children, progress, range }) => {\n const opacity = useTransform(progress, range, [0, 1])\n return (\n <span className=\"xl:lg-3 relative mx-1 lg:mx-1.5\">\n <span className=\"absolute opacity-30\">{children}</span>\n <motion.span\n style={{ opacity: opacity }}\n className={\"text-black dark:text-white\"}\n >\n {children}\n </motion.span>\n </span>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/tweet-card-demo.json b/apps/www/public/r/tweet-card-demo.json
index e64bc055..69077321 100644
--- a/apps/www/public/r/tweet-card-demo.json
+++ b/apps/www/public/r/tweet-card-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/tweet-card-demo.tsx",
- "content": "import { ClientTweetCard } from \"@/registry/magicui/client-tweet-card\";\n\n/**\n * <TweetCard /> (Server Side Only)\n * <ClientTweetCard /> (Client Side Only)\n */\nexport default function TweetDemo() {\n return <ClientTweetCard id=\"1668408059125702661\" />;\n}\n",
+ "content": "import { ClientTweetCard } from \"@/registry/magicui/client-tweet-card\"\n\n/**\n * <TweetCard /> (Server Side Only)\n * <ClientTweetCard /> (Client Side Only)\n */\nexport default function TweetDemo() {\n return <ClientTweetCard id=\"1668408059125702661\" />\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/tweet-card-images.json b/apps/www/public/r/tweet-card-images.json
index c62d50eb..0d11ed24 100644
--- a/apps/www/public/r/tweet-card-images.json
+++ b/apps/www/public/r/tweet-card-images.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/tweet-card-images.tsx",
- "content": "import { ClientTweetCard } from \"@/registry/magicui/client-tweet-card\";\n\nexport default function TweetImages() {\n return <ClientTweetCard id=\"1678577280489234432\" className=\"shadow-2xl\" />;\n}\n",
+ "content": "import { ClientTweetCard } from \"@/registry/magicui/client-tweet-card\"\n\nexport default function TweetImages() {\n return <ClientTweetCard id=\"1678577280489234432\" className=\"shadow-2xl\" />\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/tweet-card-meta-preview.json b/apps/www/public/r/tweet-card-meta-preview.json
index 39c9674c..aa91cb91 100644
--- a/apps/www/public/r/tweet-card-meta-preview.json
+++ b/apps/www/public/r/tweet-card-meta-preview.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/tweet-card-meta-preview.tsx",
- "content": "import { ClientTweetCard } from \"@/registry/magicui/client-tweet-card\";\n\nexport default function TweetMetaPreview() {\n return <ClientTweetCard id=\"1675849118445436929\" className=\"shadow-2xl\" />;\n}\n",
+ "content": "import { ClientTweetCard } from \"@/registry/magicui/client-tweet-card\"\n\nexport default function TweetMetaPreview() {\n return <ClientTweetCard id=\"1675849118445436929\" className=\"shadow-2xl\" />\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/tweet-card.json b/apps/www/public/r/tweet-card.json
index 5a53e74b..61b0a93b 100644
--- a/apps/www/public/r/tweet-card.json
+++ b/apps/www/public/r/tweet-card.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/tweet-card.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\nimport { Suspense } from \"react\";\nimport {\n enrichTweet,\n type EnrichedTweet,\n type TweetProps,\n type TwitterComponents,\n} from \"react-tweet\";\nimport { getTweet, type Tweet } from \"react-tweet/api\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface TwitterIconProps {\n className?: string;\n [key: string]: unknown;\n}\nconst Twitter = ({ className, ...props }: TwitterIconProps) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n {...props}\n >\n <g>\n <path fill=\"none\" d=\"M0 0h24v24H0z\"></path>\n <path d=\"M22.162 5.656a8.384 8.384 0 0 1-2.402.658A4.196 4.196 0 0 0 21.6 4c-.82.488-1.719.83-2.656 1.015a4.182 4.182 0 0 0-7.126 3.814 11.874 11.874 0 0 1-8.62-4.37 4.168 4.168 0 0 0-.566 2.103c0 1.45.738 2.731 1.86 3.481a4.168 4.168 0 0 1-1.894-.523v.052a4.185 4.185 0 0 0 3.355 4.101 4.21 4.21 0 0 1-1.89.072A4.185 4.185 0 0 0 7.97 16.65a8.394 8.394 0 0 1-6.191 1.732 11.83 11.83 0 0 0 6.41 1.88c7.693 0 11.9-6.373 11.9-11.9 0-.18-.005-.362-.013-.54a8.496 8.496 0 0 0 2.087-2.165z\"></path>\n </g>\n </svg>\n);\n\nconst Verified = ({ className, ...props }: TwitterIconProps) => (\n <svg\n aria-label=\"Verified Account\"\n viewBox=\"0 0 24 24\"\n className={className}\n {...props}\n >\n <g fill=\"currentColor\">\n <path d=\"M22.5 12.5c0-1.58-.875-2.95-2.148-3.6.154-.435.238-.905.238-1.4 0-2.21-1.71-3.998-3.818-3.998-.47 0-.92.084-1.336.25C14.818 2.415 13.51 1.5 12 1.5s-2.816.917-3.437 2.25c-.415-.165-.866-.25-1.336-.25-2.11 0-3.818 1.79-3.818 4 0 .494.083.964.237 1.4-1.272.65-2.147 2.018-2.147 3.6 0 1.495.782 2.798 1.942 3.486-.02.17-.032.34-.032.514 0 2.21 1.708 4 3.818 4 .47 0 .92-.086 1.335-.25.62 1.334 1.926 2.25 3.437 2.25 1.512 0 2.818-.916 3.437-2.25.415.163.865.248 1.336.248 2.11 0 3.818-1.79 3.818-4 0-.174-.012-.344-.033-.513 1.158-.687 1.943-1.99 1.943-3.484zm-6.616-3.334l-4.334 6.5c-.145.217-.382.334-.625.334-.143 0-.288-.04-.416-.126l-.115-.094-2.415-2.415c-.293-.293-.293-.768 0-1.06s.768-.294 1.06 0l1.77 1.767 3.825-5.74c.23-.345.696-.436 1.04-.207.346.23.44.696.21 1.04z\" />\n </g>\n </svg>\n);\n\nexport const truncate = (str: string | null, length: number) => {\n if (!str || str.length <= length) return str;\n return `${str.slice(0, length - 3)}...`;\n};\n\nconst Skeleton = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div className={cn(\"rounded-md bg-primary/10\", className)} {...props} />\n );\n};\n\nexport const TweetSkeleton = ({\n className,\n ...props\n}: {\n className?: string;\n [key: string]: unknown;\n}) => (\n <div\n className={cn(\n \"flex size-full max-h-max min-w-72 flex-col gap-2 rounded-lg border p-4\",\n className,\n )}\n {...props}\n >\n <div className=\"flex flex-row gap-2\">\n <Skeleton className=\"size-10 shrink-0 rounded-full\" />\n <Skeleton className=\"h-10 w-full\" />\n </div>\n <Skeleton className=\"h-20 w-full\" />\n </div>\n);\n\nexport const TweetNotFound = ({\n className,\n ...props\n}: {\n className?: string;\n [key: string]: unknown;\n}) => (\n <div\n className={cn(\n \"flex size-full flex-col items-center justify-center gap-2 rounded-lg border p-4\",\n className,\n )}\n {...props}\n >\n <h3>Tweet not found</h3>\n </div>\n);\n\nexport const TweetHeader = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"flex flex-row justify-between tracking-tight\">\n <div className=\"flex items-center space-x-2\">\n <a href={tweet.user.url} target=\"_blank\" rel=\"noreferrer\">\n <img\n title={`Profile picture of ${tweet.user.name}`}\n alt={tweet.user.screen_name}\n height={48}\n width={48}\n src={tweet.user.profile_image_url_https}\n className=\"overflow-hidden rounded-full border border-transparent\"\n />\n </a>\n <div>\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"flex items-center whitespace-nowrap font-semibold\"\n >\n {truncate(tweet.user.name, 20)}\n {tweet.user.verified ||\n (tweet.user.is_blue_verified && (\n <Verified className=\"ml-1 inline size-4 text-blue-500\" />\n ))}\n </a>\n <div className=\"flex items-center space-x-1\">\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-sm text-gray-500 transition-all duration-75\"\n >\n @{truncate(tweet.user.screen_name, 16)}\n </a>\n </div>\n </div>\n </div>\n <a href={tweet.url} target=\"_blank\" rel=\"noreferrer\">\n <span className=\"sr-only\">Link to tweet</span>\n <Twitter className=\"size-5 items-start text-[#3BA9EE] transition-all ease-in-out hover:scale-105\" />\n </a>\n </div>\n);\n\nexport const TweetBody = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"break-words leading-normal tracking-tighter\">\n {tweet.entities.map((entity, idx) => {\n switch (entity.type) {\n case \"url\":\n case \"symbol\":\n case \"hashtag\":\n case \"mention\":\n return (\n <a\n key={idx}\n href={entity.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm font-normal text-gray-500\"\n >\n <span>{entity.text}</span>\n </a>\n );\n case \"text\":\n return (\n <span\n key={idx}\n className=\"text-sm font-normal\"\n dangerouslySetInnerHTML={{ __html: entity.text }}\n />\n );\n }\n })}\n </div>\n);\n\nexport const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => {\n if (!tweet.video && !tweet.photos) return null;\n return (\n <div className=\"flex flex-1 items-center justify-center\">\n {tweet.video && (\n <video\n poster={tweet.video.poster}\n autoPlay\n loop\n muted\n playsInline\n className=\"rounded-xl border shadow-sm\"\n >\n <source src={tweet.video.variants[0].src} type=\"video/mp4\" />\n Your browser does not support the video tag.\n </video>\n )}\n {tweet.photos && (\n <div className=\"relative flex transform-gpu snap-x snap-mandatory gap-4 overflow-x-auto\">\n <div className=\"shrink-0 snap-center sm:w-2\" />\n {tweet.photos.map((photo) => (\n <img\n key={photo.url}\n src={photo.url}\n title={\"Photo by \" + tweet.user.name}\n alt={tweet.text}\n className=\"h-64 w-5/6 shrink-0 snap-center snap-always rounded-xl border object-cover shadow-sm\"\n />\n ))}\n <div className=\"shrink-0 snap-center sm:w-2\" />\n </div>\n )}\n {!tweet.video &&\n !tweet.photos &&\n // @ts-ignore\n tweet?.card?.binding_values?.thumbnail_image_large?.image_value.url && (\n <img\n src={\n // @ts-ignore\n tweet.card.binding_values.thumbnail_image_large.image_value.url\n }\n className=\"h-64 rounded-xl border object-cover shadow-sm\"\n alt={tweet.text}\n />\n )}\n </div>\n );\n};\n\nexport const MagicTweet = ({\n tweet,\n components,\n className,\n ...props\n}: {\n tweet: Tweet;\n components?: TwitterComponents;\n className?: string;\n}) => {\n const enrichedTweet = enrichTweet(tweet);\n return (\n <div\n className={cn(\n \"relative flex w-full h-fit max-w-lg flex-col gap-2 overflow-hidden rounded-lg border p-4 backdrop-blur-md\",\n className,\n )}\n {...props}\n >\n <TweetHeader tweet={enrichedTweet} />\n <TweetBody tweet={enrichedTweet} />\n <TweetMedia tweet={enrichedTweet} />\n </div>\n );\n};\n\n/**\n * TweetCard (Server Side Only)\n */\nexport const TweetCard = async ({\n id,\n components,\n fallback = <TweetSkeleton />,\n onError,\n ...props\n}: TweetProps & {\n className?: string;\n}) => {\n const tweet = id\n ? await getTweet(id).catch((err) => {\n if (onError) {\n onError(err);\n } else {\n console.error(err);\n }\n })\n : undefined;\n\n if (!tweet) {\n const NotFound = components?.TweetNotFound || TweetNotFound;\n return <NotFound {...props} />;\n }\n\n return (\n <Suspense fallback={fallback}>\n <MagicTweet tweet={tweet} {...props} />\n </Suspense>\n );\n};\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\nimport { Suspense } from \"react\"\nimport {\n enrichTweet,\n type EnrichedTweet,\n type TweetProps,\n type TwitterComponents,\n} from \"react-tweet\"\nimport { getTweet, type Tweet } from \"react-tweet/api\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TwitterIconProps {\n className?: string\n [key: string]: unknown\n}\nconst Twitter = ({ className, ...props }: TwitterIconProps) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n {...props}\n >\n <g>\n <path fill=\"none\" d=\"M0 0h24v24H0z\"></path>\n <path d=\"M22.162 5.656a8.384 8.384 0 0 1-2.402.658A4.196 4.196 0 0 0 21.6 4c-.82.488-1.719.83-2.656 1.015a4.182 4.182 0 0 0-7.126 3.814 11.874 11.874 0 0 1-8.62-4.37 4.168 4.168 0 0 0-.566 2.103c0 1.45.738 2.731 1.86 3.481a4.168 4.168 0 0 1-1.894-.523v.052a4.185 4.185 0 0 0 3.355 4.101 4.21 4.21 0 0 1-1.89.072A4.185 4.185 0 0 0 7.97 16.65a8.394 8.394 0 0 1-6.191 1.732 11.83 11.83 0 0 0 6.41 1.88c7.693 0 11.9-6.373 11.9-11.9 0-.18-.005-.362-.013-.54a8.496 8.496 0 0 0 2.087-2.165z\"></path>\n </g>\n </svg>\n)\n\nconst Verified = ({ className, ...props }: TwitterIconProps) => (\n <svg\n aria-label=\"Verified Account\"\n viewBox=\"0 0 24 24\"\n className={className}\n {...props}\n >\n <g fill=\"currentColor\">\n <path d=\"M22.5 12.5c0-1.58-.875-2.95-2.148-3.6.154-.435.238-.905.238-1.4 0-2.21-1.71-3.998-3.818-3.998-.47 0-.92.084-1.336.25C14.818 2.415 13.51 1.5 12 1.5s-2.816.917-3.437 2.25c-.415-.165-.866-.25-1.336-.25-2.11 0-3.818 1.79-3.818 4 0 .494.083.964.237 1.4-1.272.65-2.147 2.018-2.147 3.6 0 1.495.782 2.798 1.942 3.486-.02.17-.032.34-.032.514 0 2.21 1.708 4 3.818 4 .47 0 .92-.086 1.335-.25.62 1.334 1.926 2.25 3.437 2.25 1.512 0 2.818-.916 3.437-2.25.415.163.865.248 1.336.248 2.11 0 3.818-1.79 3.818-4 0-.174-.012-.344-.033-.513 1.158-.687 1.943-1.99 1.943-3.484zm-6.616-3.334l-4.334 6.5c-.145.217-.382.334-.625.334-.143 0-.288-.04-.416-.126l-.115-.094-2.415-2.415c-.293-.293-.293-.768 0-1.06s.768-.294 1.06 0l1.77 1.767 3.825-5.74c.23-.345.696-.436 1.04-.207.346.23.44.696.21 1.04z\" />\n </g>\n </svg>\n)\n\nexport const truncate = (str: string | null, length: number) => {\n if (!str || str.length <= length) return str\n return `${str.slice(0, length - 3)}...`\n}\n\nconst Skeleton = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div className={cn(\"bg-primary/10 rounded-md\", className)} {...props} />\n )\n}\n\nexport const TweetSkeleton = ({\n className,\n ...props\n}: {\n className?: string\n [key: string]: unknown\n}) => (\n <div\n className={cn(\n \"flex size-full max-h-max min-w-72 flex-col gap-2 rounded-lg border p-4\",\n className\n )}\n {...props}\n >\n <div className=\"flex flex-row gap-2\">\n <Skeleton className=\"size-10 shrink-0 rounded-full\" />\n <Skeleton className=\"h-10 w-full\" />\n </div>\n <Skeleton className=\"h-20 w-full\" />\n </div>\n)\n\nexport const TweetNotFound = ({\n className,\n ...props\n}: {\n className?: string\n [key: string]: unknown\n}) => (\n <div\n className={cn(\n \"flex size-full flex-col items-center justify-center gap-2 rounded-lg border p-4\",\n className\n )}\n {...props}\n >\n <h3>Tweet not found</h3>\n </div>\n)\n\nexport const TweetHeader = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"flex flex-row justify-between tracking-tight\">\n <div className=\"flex items-center space-x-2\">\n <a href={tweet.user.url} target=\"_blank\" rel=\"noreferrer\">\n <img\n title={`Profile picture of ${tweet.user.name}`}\n alt={tweet.user.screen_name}\n height={48}\n width={48}\n src={tweet.user.profile_image_url_https}\n className=\"overflow-hidden rounded-full border border-transparent\"\n />\n </a>\n <div>\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"flex items-center font-semibold whitespace-nowrap\"\n >\n {truncate(tweet.user.name, 20)}\n {tweet.user.verified ||\n (tweet.user.is_blue_verified && (\n <Verified className=\"ml-1 inline size-4 text-blue-500\" />\n ))}\n </a>\n <div className=\"flex items-center space-x-1\">\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-sm text-gray-500 transition-all duration-75\"\n >\n @{truncate(tweet.user.screen_name, 16)}\n </a>\n </div>\n </div>\n </div>\n <a href={tweet.url} target=\"_blank\" rel=\"noreferrer\">\n <span className=\"sr-only\">Link to tweet</span>\n <Twitter className=\"size-5 items-start text-[#3BA9EE] transition-all ease-in-out hover:scale-105\" />\n </a>\n </div>\n)\n\nexport const TweetBody = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"leading-normal tracking-tighter break-words\">\n {tweet.entities.map((entity, idx) => {\n switch (entity.type) {\n case \"url\":\n case \"symbol\":\n case \"hashtag\":\n case \"mention\":\n return (\n <a\n key={idx}\n href={entity.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm font-normal text-gray-500\"\n >\n <span>{entity.text}</span>\n </a>\n )\n case \"text\":\n return (\n <span\n key={idx}\n className=\"text-sm font-normal\"\n dangerouslySetInnerHTML={{ __html: entity.text }}\n />\n )\n }\n })}\n </div>\n)\n\nexport const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => {\n if (!tweet.video && !tweet.photos) return null\n return (\n <div className=\"flex flex-1 items-center justify-center\">\n {tweet.video && (\n <video\n poster={tweet.video.poster}\n autoPlay\n loop\n muted\n playsInline\n className=\"rounded-xl border shadow-sm\"\n >\n <source src={tweet.video.variants[0].src} type=\"video/mp4\" />\n Your browser does not support the video tag.\n </video>\n )}\n {tweet.photos && (\n <div className=\"relative flex transform-gpu snap-x snap-mandatory gap-4 overflow-x-auto\">\n <div className=\"shrink-0 snap-center sm:w-2\" />\n {tweet.photos.map((photo) => (\n <img\n key={photo.url}\n src={photo.url}\n title={\"Photo by \" + tweet.user.name}\n alt={tweet.text}\n className=\"h-64 w-5/6 shrink-0 snap-center snap-always rounded-xl border object-cover shadow-sm\"\n />\n ))}\n <div className=\"shrink-0 snap-center sm:w-2\" />\n </div>\n )}\n {!tweet.video &&\n !tweet.photos &&\n // @ts-ignore\n tweet?.card?.binding_values?.thumbnail_image_large?.image_value.url && (\n <img\n src={\n // @ts-ignore\n tweet.card.binding_values.thumbnail_image_large.image_value.url\n }\n className=\"h-64 rounded-xl border object-cover shadow-sm\"\n alt={tweet.text}\n />\n )}\n </div>\n )\n}\n\nexport const MagicTweet = ({\n tweet,\n components,\n className,\n ...props\n}: {\n tweet: Tweet\n components?: TwitterComponents\n className?: string\n}) => {\n const enrichedTweet = enrichTweet(tweet)\n return (\n <div\n className={cn(\n \"relative flex h-fit w-full max-w-lg flex-col gap-2 overflow-hidden rounded-lg border p-4 backdrop-blur-md\",\n className\n )}\n {...props}\n >\n <TweetHeader tweet={enrichedTweet} />\n <TweetBody tweet={enrichedTweet} />\n <TweetMedia tweet={enrichedTweet} />\n </div>\n )\n}\n\n/**\n * TweetCard (Server Side Only)\n */\nexport const TweetCard = async ({\n id,\n components,\n fallback = <TweetSkeleton />,\n onError,\n ...props\n}: TweetProps & {\n className?: string\n}) => {\n const tweet = id\n ? await getTweet(id).catch((err) => {\n if (onError) {\n onError(err)\n } else {\n console.error(err)\n }\n })\n : undefined\n\n if (!tweet) {\n const NotFound = components?.TweetNotFound || TweetNotFound\n return <NotFound {...props} />\n }\n\n return (\n <Suspense fallback={fallback}>\n <MagicTweet tweet={tweet} {...props} />\n </Suspense>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/typing-animation-demo.json b/apps/www/public/r/typing-animation-demo.json
index 1734c30e..bcc2108f 100644
--- a/apps/www/public/r/typing-animation-demo.json
+++ b/apps/www/public/r/typing-animation-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/typing-animation-demo.tsx",
- "content": "import { TypingAnimation } from \"@/registry/magicui/typing-animation\";\n\nexport default function TypingAnimationDemo() {\n return (\n <TypingAnimation startOnView={true}>Typing Animation 👋</TypingAnimation>\n );\n}\n",
+ "content": "import { TypingAnimation } from \"@/registry/magicui/typing-animation\"\n\nexport default function TypingAnimationDemo() {\n return (\n <TypingAnimation startOnView={true}>Typing Animation 👋</TypingAnimation>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/typing-animation.json b/apps/www/public/r/typing-animation.json
index a421eade..f64158b2 100644
--- a/apps/www/public/r/typing-animation.json
+++ b/apps/www/public/r/typing-animation.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/typing-animation.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { motion, MotionProps, useInView } from \"motion/react\";\nimport { useEffect, useRef, useState } from \"react\";\n\ninterface TypingAnimationProps extends MotionProps {\n children: string;\n className?: string;\n duration?: number;\n delay?: number;\n as?: React.ElementType;\n startOnView?: boolean;\n}\n\nexport function TypingAnimation({\n children,\n className,\n duration = 100,\n delay = 0,\n as: Component = \"div\",\n startOnView = false,\n ...props\n}: TypingAnimationProps) {\n const MotionComponent = motion.create(Component, {\n forwardMotionProps: true,\n });\n\n const [displayedText, setDisplayedText] = useState<string>(\"\");\n const [started, setStarted] = useState(false);\n const elementRef = useRef<HTMLElement | null>(null);\n const isInView = useInView(elementRef as React.RefObject<Element>, {\n amount: 0.3,\n once: true,\n });\n\n useEffect(() => {\n if (!startOnView) {\n const startTimeout = setTimeout(() => {\n setStarted(true);\n }, delay);\n return () => clearTimeout(startTimeout);\n }\n\n if (!isInView) return;\n\n const startTimeout = setTimeout(() => {\n setStarted(true);\n }, delay);\n\n return () => clearTimeout(startTimeout);\n }, [delay, startOnView, isInView]);\n\n useEffect(() => {\n if (!started) return;\n\n const graphemes = Array.from(children);\n let i = 0;\n const typingEffect = setInterval(() => {\n if (i < graphemes.length) {\n setDisplayedText(graphemes.slice(0, i + 1).join(\"\"));\n i++;\n } else {\n clearInterval(typingEffect);\n }\n }, duration);\n\n return () => {\n clearInterval(typingEffect);\n };\n }, [children, duration, started]);\n\n return (\n <MotionComponent\n ref={elementRef}\n className={cn(\n \"text-4xl font-bold leading-[5rem] tracking-[-0.02em]\",\n className,\n )}\n {...props}\n >\n {displayedText}\n </MotionComponent>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { motion, MotionProps, useInView } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TypingAnimationProps extends MotionProps {\n children: string\n className?: string\n duration?: number\n delay?: number\n as?: React.ElementType\n startOnView?: boolean\n}\n\nexport function TypingAnimation({\n children,\n className,\n duration = 100,\n delay = 0,\n as: Component = \"div\",\n startOnView = false,\n ...props\n}: TypingAnimationProps) {\n const MotionComponent = motion.create(Component, {\n forwardMotionProps: true,\n })\n\n const [displayedText, setDisplayedText] = useState<string>(\"\")\n const [started, setStarted] = useState(false)\n const elementRef = useRef<HTMLElement | null>(null)\n const isInView = useInView(elementRef as React.RefObject<Element>, {\n amount: 0.3,\n once: true,\n })\n\n useEffect(() => {\n if (!startOnView) {\n const startTimeout = setTimeout(() => {\n setStarted(true)\n }, delay)\n return () => clearTimeout(startTimeout)\n }\n\n if (!isInView) return\n\n const startTimeout = setTimeout(() => {\n setStarted(true)\n }, delay)\n\n return () => clearTimeout(startTimeout)\n }, [delay, startOnView, isInView])\n\n useEffect(() => {\n if (!started) return\n\n const graphemes = Array.from(children)\n let i = 0\n const typingEffect = setInterval(() => {\n if (i < graphemes.length) {\n setDisplayedText(graphemes.slice(0, i + 1).join(\"\"))\n i++\n } else {\n clearInterval(typingEffect)\n }\n }, duration)\n\n return () => {\n clearInterval(typingEffect)\n }\n }, [children, duration, started])\n\n return (\n <MotionComponent\n ref={elementRef}\n className={cn(\n \"text-4xl leading-[5rem] font-bold tracking-[-0.02em]\",\n className\n )}\n {...props}\n >\n {displayedText}\n </MotionComponent>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/utils.json b/apps/www/public/r/utils.json
index 30dfae52..82f2d28f 100644
--- a/apps/www/public/r/utils.json
+++ b/apps/www/public/r/utils.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/lib/utils.ts",
- "content": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n",
+ "content": "import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n",
"type": "registry:lib"
}
]
diff --git a/apps/www/public/r/video-text-demo.json b/apps/www/public/r/video-text-demo.json
index c8b8be15..756e39fc 100644
--- a/apps/www/public/r/video-text-demo.json
+++ b/apps/www/public/r/video-text-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/video-text-demo.tsx",
- "content": "import { VideoText } from \"@/registry/magicui/video-text\";\n\nexport default function VideoTextDemo() {\n return (\n <div className=\"relative h-[200px] w-full overflow-hidden\">\n <VideoText src=\"https://cdn.magicui.design/ocean-small.webm\">\n OCEAN\n </VideoText>\n </div>\n );\n}\n",
+ "content": "import { VideoText } from \"@/registry/magicui/video-text\"\n\nexport default function VideoTextDemo() {\n return (\n <div className=\"relative h-[200px] w-full overflow-hidden\">\n <VideoText src=\"https://cdn.magicui.design/ocean-small.webm\">\n OCEAN\n </VideoText>\n </div>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/video-text.json b/apps/www/public/r/video-text.json
index d7d31ea1..8779a53d 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 { cn } from \"@/lib/utils\";\nimport React, { ElementType, ReactNode, useEffect, useState } from \"react\";\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=\"w-full h-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, { 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",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/warp-background-demo.json b/apps/www/public/r/warp-background-demo.json
index 3e029f2d..a3dee42e 100644
--- a/apps/www/public/r/warp-background-demo.json
+++ b/apps/www/public/r/warp-background-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/warp-background-demo.tsx",
- "content": "import {\n Card,\n CardContent,\n CardDescription,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { WarpBackground } from \"@/registry/magicui/warp-background\";\n\nexport default function ExampleComponentDemo() {\n return (\n <WarpBackground>\n <Card className=\"w-80\">\n <CardContent className=\"flex flex-col gap-2 p-4\">\n <CardTitle>Congratulations on Your Promotion!</CardTitle>\n <CardDescription>\n Your hard work and dedication have paid off. We&apos;re thrilled to\n see you take this next step in your career. Keep up the fantastic\n work!\n </CardDescription>\n </CardContent>\n </Card>\n </WarpBackground>\n );\n}\n",
+ "content": "import {\n Card,\n CardContent,\n CardDescription,\n CardTitle,\n} from \"@/components/ui/card\"\nimport { WarpBackground } from \"@/registry/magicui/warp-background\"\n\nexport default function ExampleComponentDemo() {\n return (\n <WarpBackground>\n <Card className=\"w-80\">\n <CardContent className=\"flex flex-col gap-2 p-4\">\n <CardTitle>Congratulations on Your Promotion!</CardTitle>\n <CardDescription>\n Your hard work and dedication have paid off. We&apos;re thrilled to\n see you take this next step in your career. Keep up the fantastic\n work!\n </CardDescription>\n </CardContent>\n </Card>\n </WarpBackground>\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/warp-background.json b/apps/www/public/r/warp-background.json
index f41ec90d..63db0349 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 { cn } from \"@/lib/utils\";\nimport { motion } from \"motion/react\";\nimport React, { HTMLAttributes, useCallback, useMemo } from \"react\";\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 left-[var(--x)] top-0 [aspect-ratio:1/var(--aspect-ratio)] [background:var(--background)] [width:var(--width)]`}\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 =\n 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 \"pointer-events-none absolute left-0 top-0 size-full overflow-hidden [clipPath:inset(0)] [container-type:size] [perspective:var(--perspective)] [transform-style:preserve-3d]\"\n }\n >\n {/* top side */}\n <div className=\"absolute z-20 [transform-style:preserve-3d] [background-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)] [container-type:inline-size] [height:100cqmax] [transform-origin:50%_0%] [transform:rotateX(-90deg)] [width:100cqi]\">\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=\"absolute top-full [transform-style:preserve-3d] [background-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)] [container-type:inline-size] [height:100cqmax] [transform-origin:50%_0%] [transform:rotateX(-90deg)] [width:100cqi]\">\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=\"absolute left-0 top-0 [transform-style:preserve-3d] [background-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)] [container-type:inline-size] [height:100cqmax] [transform-origin:0%_0%] [transform:rotate(90deg)_rotateX(-90deg)] [width:100cqh]\">\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=\"absolute right-0 top-0 [transform-style:preserve-3d] [background-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)] [container-type:inline-size] [height:100cqmax] [width:100cqh] [transform-origin:100%_0%] [transform:rotate(-90deg)_rotateX(-90deg)]\">\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, { 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-[var(--x)] [aspect-ratio:1/var(--aspect-ratio)] [width:var(--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-type:size] pointer-events-none absolute top-0 left-0 size-full overflow-hidden [clipPath:inset(0)] [perspective:var(--perspective)] [transform-style:preserve-3d]\"\n }\n >\n {/* top side */}\n <div className=\"[container-type:inline-size] absolute z-20 [height:100cqmax] [width:100cqi] [transform-origin:50%_0%] [transform:rotateX(-90deg)] [background-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-style:preserve-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-type:inline-size] absolute top-full [height:100cqmax] [width:100cqi] [transform-origin:50%_0%] [transform:rotateX(-90deg)] [background-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-style:preserve-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-type:inline-size] absolute top-0 left-0 [height:100cqmax] [width:100cqh] [transform-origin:0%_0%] [transform:rotate(90deg)_rotateX(-90deg)] [background-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-style:preserve-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-type:inline-size] absolute top-0 right-0 [height:100cqmax] [width:100cqh] [transform-origin:100%_0%] [transform:rotate(-90deg)_rotateX(-90deg)] [background-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-style:preserve-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/public/r/word-rotate-demo.json b/apps/www/public/r/word-rotate-demo.json
index 7958378d..8e017d33 100644
--- a/apps/www/public/r/word-rotate-demo.json
+++ b/apps/www/public/r/word-rotate-demo.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/example/word-rotate-demo.tsx",
- "content": "import { WordRotate } from \"@/registry/magicui/word-rotate\";\n\nexport default function WordRotateDemo() {\n return (\n <WordRotate\n className=\"text-4xl font-bold text-black dark:text-white\"\n words={[\"Word\", \"Rotate\"]}\n />\n );\n}\n",
+ "content": "import { WordRotate } from \"@/registry/magicui/word-rotate\"\n\nexport default function WordRotateDemo() {\n return (\n <WordRotate\n className=\"text-4xl font-bold text-black dark:text-white\"\n words={[\"Word\", \"Rotate\"]}\n />\n )\n}\n",
"type": "registry:example"
}
]
diff --git a/apps/www/public/r/word-rotate.json b/apps/www/public/r/word-rotate.json
index a111d8cf..0e5a9667 100644
--- a/apps/www/public/r/word-rotate.json
+++ b/apps/www/public/r/word-rotate.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/word-rotate.tsx",
- "content": "\"use client\";\n\nimport { AnimatePresence, motion, MotionProps } from \"motion/react\";\nimport { useEffect, useState } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface WordRotateProps {\n words: string[];\n duration?: number;\n motionProps?: MotionProps;\n className?: string;\n}\n\nexport function WordRotate({\n words,\n duration = 2500,\n motionProps = {\n initial: { opacity: 0, y: -50 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: 50 },\n transition: { duration: 0.25, ease: \"easeOut\" },\n },\n className,\n}: WordRotateProps) {\n const [index, setIndex] = useState(0);\n\n useEffect(() => {\n const interval = setInterval(() => {\n setIndex((prevIndex) => (prevIndex + 1) % words.length);\n }, duration);\n\n // Clean up interval on unmount\n return () => clearInterval(interval);\n }, [words, duration]);\n\n return (\n <div className=\"overflow-hidden py-2\">\n <AnimatePresence mode=\"wait\">\n <motion.h1\n key={words[index]}\n className={cn(className)}\n {...motionProps}\n >\n {words[index]}\n </motion.h1>\n </AnimatePresence>\n </div>\n );\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport { AnimatePresence, motion, MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface WordRotateProps {\n words: string[]\n duration?: number\n motionProps?: MotionProps\n className?: string\n}\n\nexport function WordRotate({\n words,\n duration = 2500,\n motionProps = {\n initial: { opacity: 0, y: -50 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: 50 },\n transition: { duration: 0.25, ease: \"easeOut\" },\n },\n className,\n}: WordRotateProps) {\n const [index, setIndex] = useState(0)\n\n useEffect(() => {\n const interval = setInterval(() => {\n setIndex((prevIndex) => (prevIndex + 1) % words.length)\n }, duration)\n\n // Clean up interval on unmount\n return () => clearInterval(interval)\n }, [words, duration])\n\n return (\n <div className=\"overflow-hidden py-2\">\n <AnimatePresence mode=\"wait\">\n <motion.h1\n key={words[index]}\n className={cn(className)}\n {...motionProps}\n >\n {words[index]}\n </motion.h1>\n </AnimatePresence>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]