Skip to content

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

fix: lint fix

Arghya Das3859af2a8367
diff --git a/components/mobile-nav.tsx b/components/mobile-nav.tsx
index 010b3596..54c2e595 100644
--- a/components/mobile-nav.tsx
+++ b/components/mobile-nav.tsx
@@ -78,7 +78,7 @@ export function MobileNav() {
<MobileLink key={item.href} href={item.href}>
{item.title}
</MobileLink>
- )
+ ),
)}
</div>
<div className="flex flex-col gap-y-2">
@@ -93,7 +93,7 @@ export function MobileNav() {
onClick={() => item.event && posthog.capture(item.event)}
className={cn(
"text-muted-foreground",
- item.disabled && "cursor-not-allowed opacity-60"
+ item.disabled && "cursor-not-allowed opacity-60",
)}
>
{item.title}
@@ -108,7 +108,7 @@ export function MobileNav() {
key={index}
className={cn(
"text-muted-foreground",
- item.disabled && "cursor-not-allowed opacity-60"
+ item.disabled && "cursor-not-allowed opacity-60",
)}
>
{item.title}
@@ -118,7 +118,7 @@ export function MobileNav() {
</span>
)}
</span>
- )
+ ),
)}
</div>
))}
@@ -158,7 +158,7 @@ function MobileLink({
"p-1 pl-2.5 text-[15px]",
isActive
? "rounded-r-md border-l-2 border-primary/70 bg-secondary font-medium text-primary"
- : ""
+ : "",
)}
{...props}
>
diff --git a/public/r/index.json b/public/r/index.json
index 1907f5d1..9ecd5ce1 100644
--- a/public/r/index.json
+++ b/public/r/index.json
@@ -38,6 +38,9 @@
{
"name": "line-shadow-text",
"type": "registry:ui",
+ "dependencies": [
+ "motion"
+ ],
"files": [
{
"path": "magicui/line-shadow-text.tsx",
diff --git a/public/r/styles/default/interactive-hover-button.json b/public/r/styles/default/interactive-hover-button.json
index b0ebf488..719c8380 100644
--- a/public/r/styles/default/interactive-hover-button.json
+++ b/public/r/styles/default/interactive-hover-button.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "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 text?: string;\n}\n\nconst InteractiveHoverButton = React.forwardRef<\n HTMLButtonElement,\n InteractiveHoverButtonProps\n>(({ text = \"Button\", className, ...props }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(\n \"group relative w-32 cursor-pointer overflow-hidden rounded-full border bg-background p-2 text-center font-semibold\",\n className,\n )}\n {...props}\n >\n <span className=\"inline-block translate-x-1 transition-all duration-300 group-hover:translate-x-12 group-hover:opacity-0\">\n {text}\n </span>\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-1 group-hover:opacity-100\">\n <span>{text}</span>\n <ArrowRight />\n </div>\n <div className=\"absolute left-[20%] top-[40%] h-2 w-2 scale-[1] rounded-lg bg-primary transition-all duration-300 group-hover:left-[0%] group-hover:top-[0%] group-hover:h-full group-hover:w-full group-hover:scale-[1.8] group-hover:bg-primary\"></div>\n </button>\n );\n});\n\nInteractiveHoverButton.displayName = \"InteractiveHoverButton\";\n\nexport default InteractiveHoverButton;\n",
+ "content": "import React from \"react\";\nimport { ArrowRight } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\ninterface InteractiveHoverButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n text?: string;\n}\n\nconst InteractiveHoverButton = React.forwardRef<\n HTMLButtonElement,\n InteractiveHoverButtonProps\n>(({ text = \"Button\", className, ...props }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(\n \"group relative w-32 cursor-pointer overflow-hidden rounded-full border bg-background p-2 text-center font-semibold\",\n className,\n )}\n {...props}\n >\n <span className=\"inline-block translate-x-1 transition-all duration-300 group-hover:translate-x-12 group-hover:opacity-0\">\n {text}\n </span>\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-1 group-hover:opacity-100\">\n <span>{text}</span>\n <ArrowRight />\n </div>\n <div className=\"absolute left-[20%] top-[40%] h-2 w-2 scale-[1] rounded-full bg-primary transition-all duration-300 group-hover:left-[0%] group-hover:top-[0%] group-hover:h-full group-hover:w-full group-hover:scale-[1.8] group-hover:bg-primary\"></div>\n </button>\n );\n});\n\nInteractiveHoverButton.displayName = \"InteractiveHoverButton\";\n\nexport default InteractiveHoverButton;\n",
"type": "registry:ui",
"target": ""
}
diff --git a/public/r/styles/default/line-shadow-text.json b/public/r/styles/default/line-shadow-text.json
index 30e74120..3600cc9c 100644
--- a/public/r/styles/default/line-shadow-text.json
+++ b/public/r/styles/default/line-shadow-text.json
@@ -1,10 +1,13 @@
{
"name": "line-shadow-text",
"type": "registry:ui",
+ "dependencies": [
+ "motion"
+ ],
"files": [
{
"path": "magicui/line-shadow-text.tsx",
- "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport function LineShadowText({\n text = \"SHADOW\",\n shadowColor = \"black\",\n className,\n}: {\n text?: string;\n shadowColor?: string;\n className?: string;\n}) {\n return (\n <span\n style={{ \"--shadow-color\": shadowColor } as React.CSSProperties}\n className={cn(\n \"relative inline-flex\",\n\n // positioning\n \"after:absolute after:left-[0.04em] after:top-[0.04em] after:content-[attr(data-text)]\",\n\n // color\n \"after:bg-[linear-gradient(45deg,transparent_45%,var(--shadow-color)_45%,var(--shadow-color)_55%,transparent_0)]\",\n\n // text\n \"after:bg-[length:0.06em_0.06em] after:bg-clip-text after:text-transparent\",\n\n // animation\n \"after:animate-line-shadow\",\n\n className,\n )}\n data-text={text}\n >\n {text}\n </span>\n );\n}\n",
+ "content": "import { 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",
"type": "registry:ui",
"target": ""
}
diff --git a/public/r/styles/default/meteors.json b/public/r/styles/default/meteors.json
index e4c1ab23..85e64555 100644
--- a/public/r/styles/default/meteors.json
+++ b/public/r/styles/default/meteors.json
@@ -4,7 +4,7 @@
"files": [
{
"path": "magicui/meteors.tsx",
- "content": "\"use client\";\n\nimport { useEffect, useState } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface MeteorsProps {\n number?: number;\n}\nexport const Meteors = ({ number = 20 }: MeteorsProps) => {\n const [meteorStyles, setMeteorStyles] = useState<Array<React.CSSProperties>>(\n [],\n );\n\n useEffect(() => {\n const styles = [...new Array(number)].map(() => ({\n top: -5,\n left: Math.floor(Math.random() * window.innerWidth) + \"px\",\n animationDelay: Math.random() * 1 + 0.2 + \"s\",\n animationDuration: Math.floor(Math.random() * 8 + 2) + \"s\",\n }));\n setMeteorStyles(styles);\n }, [number]);\n\n return (\n <>\n {[...meteorStyles].map((style, idx) => (\n // Meteor Head\n <span\n key={idx}\n className={cn(\n \"pointer-events-none absolute left-1/2 top-1/2 size-0.5 rotate-[215deg] animate-meteor rounded-full bg-slate-500 shadow-[0_0_0_1px_#ffffff10]\",\n )}\n style={style}\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-slate-500 to-transparent\" />\n </span>\n ))}\n </>\n );\n};\n\nexport default Meteors;\n",
+ "content": "\"use client\";\n\nimport { useEffect, useState } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface MeteorsProps extends React.HTMLAttributes<HTMLSpanElement> {\n number?: number;\n}\nexport const Meteors = ({ number = 20, ...props }: MeteorsProps) => {\n const [meteorStyles, setMeteorStyles] = useState<Array<React.CSSProperties>>(\n [],\n );\n\n useEffect(() => {\n const styles = [...new Array(number)].map(() => ({\n top: -5,\n left: Math.floor(Math.random() * window.innerWidth) + \"px\",\n animationDelay: Math.random() * 1 + 0.2 + \"s\",\n animationDuration: Math.floor(Math.random() * 8 + 2) + \"s\",\n }));\n setMeteorStyles(styles);\n }, [number]);\n\n return (\n <>\n {[...meteorStyles].map((style, idx) => (\n // Meteor Head\n <span\n key={idx}\n className={cn(\n \"pointer-events-none absolute left-1/2 top-1/2 size-0.5 rotate-[215deg] animate-meteor rounded-full bg-slate-500 shadow-[0_0_0_1px_#ffffff10]\",\n )}\n style={style}\n {...props}\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-slate-500 to-transparent\" />\n </span>\n ))}\n </>\n );\n};\n",
"type": "registry:ui",
"target": ""
}