UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
fix: build fix
Dillion Verma0f5652f7d71c
diff --git a/__registry__/index.tsx b/__registry__/index.tsxindex 58731786..25f9b6fd 100644--- a/__registry__/index.tsx+++ b/__registry__/index.tsx@@ -2000,14 +2000,14 @@ export const Index: Record<string, any> = {},"dot-pattern-with-glow-effect": {name: "dot-pattern-with-glow-effect",- description: "",+ description: "Example showing a dot pattern with glow effect",type: "registry:example",- registryDependencies: ["dot-pattern"],+ registryDependencies: ["https://magicui.design/r/dot-pattern"],files: [{path: "registry/example/dot-pattern-with-glow-effect.tsx",type: "registry:example",- target: "",+ target: "components/dot-pattern-with-glow-effect.tsx",},],component: React.lazy(async () => {diff --git a/public/r/dot-pattern-with-glow-effect.json b/public/r/dot-pattern-with-glow-effect.jsonindex 18f2a1be..3eb426fb 100644--- a/public/r/dot-pattern-with-glow-effect.json+++ b/public/r/dot-pattern-with-glow-effect.json@@ -2,15 +2,17 @@"$schema": "https://ui.shadcn.com/schema/registry-item.json","name": "dot-pattern-with-glow-effect","type": "registry:example",+ "title": "Dot Pattern with glow effect",+ "description": "Example showing a dot pattern with glow effect","registryDependencies": [- "dot-pattern"+ "https://magicui.design/r/dot-pattern"],"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 rounded-lg border bg-background md:shadow-xl\">\n <p className=\"z-10 whitespace-pre-wrap text-center text-5xl font-medium tracking-tighter text-black dark:text-white\">\n Dot Pattern With Glow Effect\n </p>\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 \"@/components/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",- "target": ""+ "target": "components/dot-pattern-with-glow-effect.tsx"}]}\ No newline at end of filediff --git a/public/r/dot-pattern.json b/public/r/dot-pattern.jsonindex a14b2d04..a888a860 100644--- a/public/r/dot-pattern.json+++ b/public/r/dot-pattern.json@@ -7,7 +7,7 @@"files": [{"path": "registry/magicui/dot-pattern.tsx",- "content": "import { useId } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\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 [key: string]: unknown;\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 ...props\n}: DotPatternProps) {\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-neutral-400/80\",\n className,\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n patternContentUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <circle id=\"pattern-circle\" cx={cx} cy={cy} r={cr} />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" strokeWidth={0} fill={`url(#${id})`} />\n </svg>\n );\n}\n",+ "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\",\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 className=\"text-neutral-400/80\"\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","target": "components/magicui/dot-pattern.tsx"}diff --git a/registry.json b/registry.jsonindex 181d06b5..591621f9 100644--- a/registry.json+++ b/registry.json@@ -1724,14 +1724,16 @@{"name": "dot-pattern-with-glow-effect","type": "registry:example",+ "title": "Dot Pattern with glow effect",+ "description": "Example showing a dot pattern with glow effect","registryDependencies": [- "dot-pattern"+ "https://magicui.design/r/dot-pattern"],"files": [{"path": "registry/example/dot-pattern-with-glow-effect.tsx","type": "registry:example",- "target": ""+ "target": "components/dot-pattern-with-glow-effect.tsx"}]},diff --git a/registry/registry-examples.ts b/registry/registry-examples.tsindex b0e7db37..495fc1c9 100644--- a/registry/registry-examples.ts+++ b/registry/registry-examples.ts@@ -291,9 +291,9 @@ export const examples: Registry["items"] = [registryDependencies: ["https://magicui.design/r/dot-pattern"],files: [{- path: "example/dot-pattern-with-glow-effect.tsx",+ path: "registry/example/dot-pattern-with-glow-effect.tsx",type: "registry:example",- target: "",+ target: "components/dot-pattern-with-glow-effect.tsx",},],},