Skip to content

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

chore: standardizes the usage of Tailwind CSS (#916)

Lin Hugod12290d7199b
diff --git a/apps/www/components/code-block-wrapper.tsx b/apps/www/components/code-block-wrapper.tsx
index f7f18c66..e9398630 100644
--- a/apps/www/components/code-block-wrapper.tsx
+++ b/apps/www/components/code-block-wrapper.tsx
@@ -40,7 +40,7 @@ export function CodeBlockWrapper({
</CollapsibleContent>
<div
className={cn(
- "from-background/10 to-background absolute flex items-center justify-center bg-gradient-to-b to-90% p-2",
+ "from-background/10 to-background absolute flex items-center justify-center bg-linear-to-b to-90% p-2",
isOpened ? "inset-x-0 bottom-0 h-12 from-gray-900/30" : "inset-0"
)}
>
diff --git a/apps/www/components/code-collapsible-wrapper.tsx b/apps/www/components/code-collapsible-wrapper.tsx
index 465bf2aa..64fa197d 100644
--- a/apps/www/components/code-collapsible-wrapper.tsx
+++ b/apps/www/components/code-collapsible-wrapper.tsx
@@ -43,7 +43,7 @@ export function CodeCollapsibleWrapper({
>
{children}
</CollapsibleContent>
- <CollapsibleTrigger className="from-code/70 to-code text-muted-foreground absolute inset-x-0 -bottom-2 flex h-20 items-center justify-center rounded-b-lg bg-gradient-to-b text-sm group-data-[state=open]/collapsible:hidden">
+ <CollapsibleTrigger className="from-code/70 to-code text-muted-foreground absolute inset-x-0 -bottom-2 flex h-20 items-center justify-center rounded-b-lg bg-linear-to-b text-sm group-data-[state=open]/collapsible:hidden">
{isOpened ? "Collapse" : "Expand"}
</CollapsibleTrigger>
</Collapsible>
diff --git a/apps/www/components/sections/cta.tsx b/apps/www/components/sections/cta.tsx
index 64ea43bd..a47b1d8a 100644
--- a/apps/www/components/sections/cta.tsx
+++ b/apps/www/components/sections/cta.tsx
@@ -30,7 +30,7 @@ export function CTASection() {
<ChevronRight className="ml-1 size-4 transition-all duration-300 ease-out group-hover:translate-x-1" />
</a>
</div>
- <div className="absolute inset-x-0 bottom-0 h-full bg-gradient-to-b from-transparent to-white to-70% dark:to-black" />
+ <div className="absolute inset-x-0 bottom-0 h-full bg-linear-to-b from-transparent to-white to-70% dark:to-black" />
</div>
</div>
</section>
diff --git a/apps/www/public/llms-full.txt b/apps/www/public/llms-full.txt
index 6592df8b..f1e7ee98 100644
--- a/apps/www/public/llms-full.txt
+++ b/apps/www/public/llms-full.txt
@@ -2183,7 +2183,7 @@ export function AnimatedCircularProgressBar({
</svg>
<span
data-current-value={currentPercent}
- className="animate-in fade-in absolute inset-0 m-auto size-fit delay-[var(--delay)] duration-[var(--transition-length)] ease-linear"
+ className="animate-in fade-in absolute inset-0 m-auto size-fit delay-(--delay) duration-(--transition-length) ease-linear"
>
{currentPercent}
</span>
@@ -2261,7 +2261,7 @@ export function AnimatedGradientText({
} as React.CSSProperties
}
className={cn(
- `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`,
+ `animate-gradient inline bg-linear-to-r from-(--color-from) via-(--color-to) to-(--color-from) bg-size-[var(--bg-size)_100%] bg-clip-text text-transparent`,
className
)}
{...props}
@@ -2771,10 +2771,10 @@ export const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({
"mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70",
// Shine effect
- "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]",
+ "animate-shiny-text bg-size-[var(--shiny-width)_100%] bg-clip-text bg-position-[0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]",
// Shine gradient
- "bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80",
+ "bg-linear-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80",
className
)}
@@ -3202,7 +3202,7 @@ const BentoCard = ({
</Button>
</div>
- <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" />
+ <div className="pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/3 group-hover:dark:bg-neutral-800/10" />
</div>
)
@@ -3769,7 +3769,7 @@ export default function MusicPlayer() {
</CardHeader>
<CardContent>
<div className="flex flex-col items-center gap-4">
- <div className="h-48 w-48 rounded-lg bg-gradient-to-br from-purple-500 to-pink-500" />
+ <div className="h-48 w-48 rounded-lg bg-linear-to-br from-purple-500 to-pink-500" />
<div className="bg-secondary h-1 w-full rounded-full">
<div className="bg-primary h-full w-1/3 rounded-full" />
</div>
@@ -4027,12 +4027,12 @@ export function CodeComparison({
style={{ "--highlight-color": highlightColor } as React.CSSProperties}
className={cn(
"bg-background h-full w-full overflow-auto font-mono text-xs",
- "[&>pre]:h-full [&>pre]:!w-screen [&>pre]:py-2",
- "[&>pre>code]:!inline-block [&>pre>code]:!w-full",
- "[&>pre>code>span]:!inline-block [&>pre>code>span]:w-full [&>pre>code>span]:px-4 [&>pre>code>span]:py-0.5",
- "[&>pre>code>.highlighted]:inline-block [&>pre>code>.highlighted]:w-full [&>pre>code>.highlighted]:!bg-[var(--highlight-color)]",
- "group-hover/left:[&>pre>code>:not(.focused)]:!opacity-100 group-hover/left:[&>pre>code>:not(.focused)]:!blur-none",
- "group-hover/right:[&>pre>code>:not(.focused)]:!opacity-100 group-hover/right:[&>pre>code>:not(.focused)]:!blur-none",
+ "[&>pre]:h-full [&>pre]:w-screen! [&>pre]:py-2",
+ "[&>pre>code]:inline-block! [&>pre>code]:w-full!",
+ "[&>pre>code>span]:inline-block! [&>pre>code>span]:w-full [&>pre>code>span]:px-4 [&>pre>code>span]:py-0.5",
+ "[&>pre>code>.highlighted]:inline-block [&>pre>code>.highlighted]:w-full [&>pre>code>.highlighted]:bg-(--highlight-color)!",
+ "group-hover/left:[&>pre>code>:not(.focused)]:opacity-100! group-hover/left:[&>pre>code>:not(.focused)]:blur-none!",
+ "group-hover/right:[&>pre>code>:not(.focused)]:opacity-100! group-hover/right:[&>pre>code>:not(.focused)]:blur-none!",
"[&>pre>code>.add]:bg-[rgba(16,185,129,.16)] [&>pre>code>.remove]:bg-[rgba(244,63,94,.16)]",
"group-hover/left:[&>pre>code>:not(.focused)]:transition-all group-hover/left:[&>pre>code>:not(.focused)]:duration-300",
"group-hover/right:[&>pre>code>:not(.focused)]:transition-all group-hover/right:[&>pre>code>:not(.focused)]:duration-300"
@@ -4057,7 +4057,7 @@ export function CodeComparison({
className={cn(
"leftside group/left border-primary/20 md:border-r",
hasLeftFocus &&
- "[&>div>pre>code>:not(.focused)]:!opacity-50 [&>div>pre>code>:not(.focused)]:!blur-[0.095rem]",
+ "[&>div>pre>code>:not(.focused)]:opacity-50! [&>div>pre>code>:not(.focused)]:blur-[0.095rem]!",
"[&>div>pre>code>:not(.focused)]:transition-all [&>div>pre>code>:not(.focused)]:duration-300"
)}
>
@@ -4072,7 +4072,7 @@ export function CodeComparison({
className={cn(
"rightside group/right border-primary/20 border-t md:border-t-0",
hasRightFocus &&
- "[&>div>pre>code>:not(.focused)]:!opacity-50 [&>div>pre>code>:not(.focused)]:!blur-[0.095rem]",
+ "[&>div>pre>code>:not(.focused)]:opacity-50! [&>div>pre>code>:not(.focused)]:blur-[0.095rem]!",
"[&>div>pre>code>:not(.focused)]:transition-all [&>div>pre>code>:not(.focused)]:duration-300"
)}
>
@@ -4422,7 +4422,7 @@ export default function ConfettiDemo() {
return (
<div className="bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border">
- <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">
+ <span className="pointer-events-none bg-linear-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">
Confetti
</span>
@@ -7011,13 +7011,13 @@ export function Globe({
return (
<div
className={cn(
- "absolute inset-0 mx-auto aspect-[1/1] w-full max-w-[600px]",
+ "absolute inset-0 mx-auto aspect-square w-full max-w-150",
className
)}
>
<canvas
className={cn(
- "size-full opacity-0 transition-opacity duration-500 [contain:layout_paint_size]"
+ "size-full opacity-0 transition-opacity duration-500 contain-[layout_paint_size]"
)}
ref={canvasRef}
onPointerDown={(e) => {
@@ -7045,7 +7045,7 @@ import { Globe } from "@/registry/magicui/globe"
export default function GlobeDemo() {
return (
<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">
- <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">
+ <span className="pointer-events-none bg-linear-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">
Globe
</span>
<Globe className="top-28" />
@@ -7326,7 +7326,7 @@ export function HeroVideoDialog({
<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">
<div className="bg-primary/10 flex size-28 items-center justify-center rounded-full backdrop-blur-md">
<div
- 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]`}
+ className={`from-primary/30 to-primary relative flex size-20 scale-100 items-center justify-center rounded-full bg-linear-to-b shadow-md transition-all duration-200 ease-out group-hover:scale-[1.2]`}
>
<Play
className="size-8 scale-100 fill-white text-white transition-transform duration-200 ease-out group-hover:scale-105"
@@ -7363,7 +7363,7 @@ export function HeroVideoDialog({
<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">
<XIcon className="size-5" />
</motion.button>
- <div className="relative isolate z-[1] size-full overflow-hidden rounded-2xl border-2 border-white">
+ <div className="relative isolate z-1 size-full overflow-hidden rounded-2xl border-2 border-white">
<iframe
src={videoSrc}
title="Hero Video player"
@@ -8542,7 +8542,7 @@ export function InteractiveGridPattern({
width={width}
height={height}
className={cn(
- "stroke-gray-400/30 transition-all duration-100 ease-in-out [&:not(:hover)]:duration-1000",
+ "stroke-gray-400/30 transition-all duration-100 ease-in-out not-[&:hover]:duration-1000",
hoveredSquare === index ? "fill-gray-300/30" : "fill-transparent",
squaresClassName
)}
@@ -9232,7 +9232,7 @@ const Ray = ({
}: LightRay) => {
return (
<motion.div
- className="pointer-events-none absolute -top-[12%] left-[var(--ray-left)] h-[var(--light-rays-length)] w-[var(--ray-width)] origin-top -translate-x-1/2 rounded-full bg-gradient-to-b from-[color-mix(in_srgb,var(--light-rays-color)_70%,transparent)] to-transparent opacity-0 mix-blend-screen blur-[var(--light-rays-blur)]"
+ className="pointer-events-none absolute -top-[12%] left-[var(--ray-left)] h-[var(--light-rays-length)] w-[var(--ray-width)] origin-top -translate-x-1/2 rounded-full bg-linear-to-b from-[color-mix(in_srgb,var(--light-rays-color)_70%,transparent)] to-transparent opacity-0 mix-blend-screen blur-[var(--light-rays-blur)]"
style={
{
"--ray-left": `${left}%`,
@@ -9407,7 +9407,7 @@ export function LineShadowText({
"relative z-0 inline-flex",
"after:absolute after:top-[0.04em] after:left-[0.04em] after:content-[attr(data-text)]",
"after:bg-[linear-gradient(45deg,transparent_45%,var(--shadow-color)_45%,var(--shadow-color)_55%,transparent_0)]",
- "after:-z-10 after:bg-[length:0.06em_0.06em] after:bg-clip-text after:text-transparent",
+ "after:-z-10 after:bg-size-[0.06em_0.06em] after:bg-clip-text after:text-transparent",
"after:animate-line-shadow",
className
)}
@@ -9705,7 +9705,7 @@ export function Marquee({
<div
{...props}
className={cn(
- "group flex [gap:var(--gap)] overflow-hidden p-2 [--duration:40s] [--gap:1rem]",
+ "group flex gap-(--gap) overflow-hidden p-2 [--duration:40s] [--gap:1rem]",
{
"flex-row": !vertical,
"flex-col": vertical,
@@ -9718,7 +9718,7 @@ export function Marquee({
.map((_, i) => (
<div
key={i}
- className={cn("flex shrink-0 justify-around [gap:var(--gap)]", {
+ className={cn("flex shrink-0 justify-around gap-(--gap)", {
"animate-marquee flex-row": !vertical,
"animate-marquee-vertical flex-col": vertical,
"group-hover:[animation-play-state:paused]": pauseOnHover,
@@ -9916,7 +9916,7 @@ export default function MarqueeDemoVertical() {
<ReviewCard key={review.username} {...review} />
))}
</Marquee>
- <div className="from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-gradient-to-b"></div>
+ <div className="from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-linear-to-b"></div>
<div className="from-background pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t"></div>
</div>
)
@@ -10080,7 +10080,7 @@ export default function Marquee3D() {
</Marquee>
</div>
- <div className="from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-gradient-to-b"></div>
+ <div className="from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-linear-to-b"></div>
<div className="from-background pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t"></div>
<div className="from-background pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r"></div>
<div className="from-background pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l"></div>
@@ -10268,12 +10268,12 @@ export const Meteors = ({
key={idx}
style={{ ...style }}
className={cn(
- "animate-meteor pointer-events-none absolute size-0.5 rotate-[var(--angle)] rounded-full bg-zinc-500 shadow-[0_0_0_1px_#ffffff10]",
+ "animate-meteor pointer-events-none absolute size-0.5 rotate-(--angle) rounded-full bg-zinc-500 shadow-[0_0_0_1px_#ffffff10]",
className
)}
>
{/* Meteor Tail */}
- <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" />
+ <div className="pointer-events-none absolute top-1/2 -z-10 h-px w-12.5 -translate-y-1/2 bg-linear-to-r from-zinc-500 to-transparent" />
</span>
))}
</>
@@ -10291,7 +10291,7 @@ export default function MeteorDemo() {
return (
<div className="relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border">
<Meteors number={30} />
- <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">
+ <span className="pointer-events-none bg-linear-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">
Meteors
</span>
</div>
@@ -10446,7 +10446,7 @@ export const MorphingText: React.FC<MorphingTextProps> = ({
}) => (
<div
className={cn(
- "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]",
+ "relative mx-auto h-16 w-full max-w-3xl text-center font-sans text-[40pt] leading-none font-bold filter-[url(#threshold)_blur(0.6px)] md:h-24 lg:text-[6rem]",
className
)}
>
@@ -10608,24 +10608,24 @@ export const NeonGradientCard: React.FC<NeonGradientCardProps> = ({
} as CSSProperties
}
className={cn(
- "relative z-10 size-full rounded-[var(--border-radius)]",
+ "relative z-10 size-full rounded-(--border-radius)",
className
)}
{...props}
>
<div
className={cn(
- "relative size-full min-h-[inherit] rounded-[var(--card-content-radius)] bg-gray-100 p-6",
- "before:absolute before:-top-[var(--border-size)] before:-left-[var(--border-size)] before:-z-10 before:block",
- "before:h-[var(--pseudo-element-height)] before:w-[var(--pseudo-element-width)] before:rounded-[var(--border-radius)] before:content-['']",
- "before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-[length:100%_200%]",
+ "relative size-full min-h-[inherit] rounded-(--card-content-radius) bg-gray-100 p-6",
+ "before:absolute before:-top-(--border-size) before:-left-(--border-size) before:-z-10 before:block",
+ "before:h-(--pseudo-element-height) before:w-(--pseudo-element-width) before:rounded-(--border-radius) before:content-['']",
+ "before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-size-[100%_200%]",
"before:animate-background-position-spin",
- "after:absolute after:-top-[var(--border-size)] after:-left-[var(--border-size)] after:-z-10 after:block",
- "after:h-[var(--pseudo-element-height)] after:w-[var(--pseudo-element-width)] after:rounded-[var(--border-radius)] after:blur-[var(--after-blur)] after:content-['']",
- "after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-[length:100%_200%] after:opacity-80",
+ "after:absolute after:-top-(--border-size) after:-left-(--border-size) after:-z-10 after:block",
+ "after:h-(--pseudo-element-height) after:w-(--pseudo-element-width) after:rounded-(--border-radius) after:blur-(--after-blur) after:content-['']",
+ "after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-size-[100%_200%] after:opacity-80",
"after:animate-background-position-spin",
"dark:bg-neutral-900",
- "break-words"
+ "wrap-break-word"
)}
>
{children}
@@ -10644,7 +10644,7 @@ import { NeonGradientCard } from "@/registry/magicui/neon-gradient-card"
export default function NeonGradientCardDemo() {
return (
<NeonGradientCard className="max-w-sm items-center justify-center text-center">
- <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)]">
+ <span className="pointer-events-none z-10 h-full bg-linear-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)]">
Neon Gradient Card
</span>
</NeonGradientCard>
@@ -10848,7 +10848,7 @@ export function OrbitingCircles({
} as React.CSSProperties
}
className={cn(
- `animate-orbit absolute flex size-[var(--icon-size)] transform-gpu items-center justify-center rounded-full`,
+ `animate-orbit absolute flex size-(--icon-size) transform-gpu items-center justify-center rounded-full`,
{ "[animation-direction:reverse]": reverse },
className
)}
@@ -12129,18 +12129,18 @@ export function RetroGrid({
return (
<div
className={cn(
- "pointer-events-none absolute size-full overflow-hidden [perspective:200px]",
- `opacity-[var(--opacity)]`,
+ "pointer-events-none absolute size-full overflow-hidden perspective-[200px]",
+ `opacity-(--opacity)`,
className
)}
style={gridStyles}
{...props}
>
- <div className="absolute inset-0 [transform:rotateX(var(--grid-angle))]">
- <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)]" />
+ <div className="absolute inset-0 transform-[rotateX(var(--grid-angle))]">
+ <div className="animate-grid inset-[0%_0px] ml-[-200%] h-[300vh] w-[600vw] origin-[100%_0_0] bg-[linear-gradient(to_right,var(--light-line)_1px,transparent_0),linear-gradient(to_bottom,var(--light-line)_1px,transparent_0)] bg-size-[var(--cell-size)_var(--cell-size)] bg-repeat dark:bg-[linear-gradient(to_right,var(--dark-line)_1px,transparent_0),linear-gradient(to_bottom,var(--dark-line)_1px,transparent_0)]" />
</div>
- <div className="absolute inset-0 bg-gradient-to-t from-white to-transparent to-90% dark:from-black" />
+ <div className="absolute inset-0 bg-linear-to-t from-white to-transparent to-90% dark:from-black" />
</div>
)
}
@@ -12157,7 +12157,7 @@ import { RetroGrid } from "@/registry/magicui/retro-grid"
export default function RetroGridDemo() {
return (
<div className="bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border">
- <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">
+ <span className="pointer-events-none z-10 bg-linear-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">
Retro Grid
</span>
@@ -12193,7 +12193,7 @@ export const Ripple = React.memo(function Ripple({
return (
<div
className={cn(
- "pointer-events-none absolute inset-0 [mask-image:linear-gradient(to_bottom,white,transparent)] select-none",
+ "pointer-events-none absolute inset-0 mask-[linear-gradient(to_bottom,white,transparent)] select-none",
className
)}
{...props}
@@ -13028,7 +13028,7 @@ export function ScrollProgress({
<motion.div
ref={ref}
className={cn(
- "fixed inset-x-0 top-0 z-50 h-px origin-left bg-gradient-to-r from-[#A97CF8] via-[#F38CB8] to-[#FDCC92]",
+ "fixed inset-x-0 top-0 z-50 h-px origin-left bg-linear-to-r from-[#A97CF8] via-[#F38CB8] to-[#FDCC92]",
className
)}
style={{
@@ -13119,11 +13119,11 @@ export const ShimmerButton = React.forwardRef<
<div
className={cn(
"-z-30 blur-[2px]",
- "[container-type:size] absolute inset-0 overflow-visible"
+ "@container-[size] absolute inset-0 overflow-visible"
)}
>
{/* spark */}
- <div className="animate-shimmer-slide absolute inset-0 [aspect-ratio:1] h-[100cqh] [border-radius:0] [mask:none]">
+ <div className="animate-shimmer-slide absolute inset-0 aspect-[1] h-[100cqh] rounded-none [mask:none]">
{/* spark before */}
<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))]" />
</div>
@@ -13151,7 +13151,7 @@ export const ShimmerButton = React.forwardRef<
{/* backdrop */}
<div
className={cn(
- "absolute [inset:var(--cut)] -z-20 [border-radius:var(--radius)] [background:var(--bg)]"
+ "absolute inset-(--cut) -z-20 [border-radius:var(--radius)] [background:var(--bg)]"
)}
/>
</button>
@@ -14382,7 +14382,7 @@ export const Terminal = ({
<div
ref={containerRef}
className={cn(
- "border-border bg-background z-0 h-full max-h-[400px] w-full max-w-lg rounded-xl border",
+ "border-border bg-background z-0 h-full max-h-100 w-full max-w-lg rounded-xl border",
className
)}
>
@@ -15182,7 +15182,7 @@ export const TextReveal: FC<TextRevealProps> = ({ children, className }) => {
<div ref={targetRef} className={cn("relative z-0 h-[200vh]", className)}>
<div
className={
- "sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-[1rem] py-[5rem]"
+ "sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-4 py-20"
}
>
<span
@@ -16186,7 +16186,7 @@ const Beam = ({
"--background": `linear-gradient(hsl(${hue} 80% 60%), transparent)`,
} as React.CSSProperties
}
- className={`absolute top-0 left-[var(--x)] [aspect-ratio:1/var(--aspect-ratio)] [width:var(--width)] [background:var(--background)]`}
+ className={`absolute top-0 left-(--x) aspect-[1/var(--aspect-ratio)] w-(--width) [background:var(--background)]`}
initial={{ y: "100cqmax", x: "-50%" }}
animate={{ y: "-100%", x: "-50%" }}
transition={{
@@ -16240,11 +16240,11 @@ export const WarpBackground: React.FC<WarpBackgroundProps> = ({
} as React.CSSProperties
}
className={
- "[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]"
+ "@container-[size] pointer-events-none absolute top-0 left-0 size-full overflow-hidden [clipPath:inset(0)] perspective-(--perspective) transform-3d"
}
>
{/* top side */}
- <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]">
+ <div className="@container absolute z-20 h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d">
{topBeams.map((beam, index) => (
<Beam
key={`top-${index}`}
@@ -16256,7 +16256,7 @@ export const WarpBackground: React.FC<WarpBackgroundProps> = ({
))}
</div>
{/* bottom side */}
- <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]">
+ <div className="@container absolute top-full h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d">
{bottomBeams.map((beam, index) => (
<Beam
key={`bottom-${index}`}
@@ -16268,7 +16268,7 @@ export const WarpBackground: React.FC<WarpBackgroundProps> = ({
))}
</div>
{/* left side */}
- <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]">
+ <div className="@container absolute top-0 left-0 h-[100cqmax] w-[100cqh] origin-[0%_0%] transform-[rotate(90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d">
{leftBeams.map((beam, index) => (
<Beam
key={`left-${index}`}
@@ -16280,7 +16280,7 @@ export const WarpBackground: React.FC<WarpBackgroundProps> = ({
))}
</div>
{/* right side */}
- <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]">
+ <div className="@container absolute top-0 right-0 h-[100cqmax] w-[100cqh] origin-[100%_0%] transform-[rotate(-90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d">
{rightBeams.map((beam, index) => (
<Beam
key={`right-${index}`}
diff --git a/apps/www/public/r/animated-circular-progress-bar.json b/apps/www/public/r/animated-circular-progress-bar.json
index 419b6b3e..15ecd23a 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=\"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",
+ "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-(--delay) duration-(--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.json b/apps/www/public/r/animated-gradient-text.json
index 01a9f25f..43f20f83 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 { type ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGradientTextProps extends ComponentPropsWithoutRef<\"div\"> {\n speed?: number\n colorFrom?: string\n colorTo?: string\n}\n\nexport function AnimatedGradientText({\n children,\n className,\n speed = 1,\n colorFrom = \"#ffaa40\",\n colorTo = \"#9c40ff\",\n ...props\n}: AnimatedGradientTextProps) {\n return (\n <span\n style={\n {\n \"--bg-size\": `${speed * 300}%`,\n \"--color-from\": colorFrom,\n \"--color-to\": colorTo,\n } as React.CSSProperties\n }\n className={cn(\n `animate-gradient inline bg-gradient-to-r from-[var(--color-from)] via-[var(--color-to)] to-[var(--color-from)] bg-[length:var(--bg-size)_100%] bg-clip-text text-transparent`,\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n}\n",
+ "content": "import { type ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGradientTextProps extends ComponentPropsWithoutRef<\"div\"> {\n speed?: number\n colorFrom?: string\n colorTo?: string\n}\n\nexport function AnimatedGradientText({\n children,\n className,\n speed = 1,\n colorFrom = \"#ffaa40\",\n colorTo = \"#9c40ff\",\n ...props\n}: AnimatedGradientTextProps) {\n return (\n <span\n style={\n {\n \"--bg-size\": `${speed * 300}%`,\n \"--color-from\": colorFrom,\n \"--color-to\": colorTo,\n } as React.CSSProperties\n }\n className={cn(\n `animate-gradient inline bg-linear-to-r from-(--color-from) via-(--color-to) to-(--color-from) bg-size-[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-shiny-text.json b/apps/www/public/r/animated-shiny-text.json
index 551353b8..26ccc032 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 {\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type FC,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedShinyTextProps extends ComponentPropsWithoutRef<\"span\"> {\n shimmerWidth?: number\n}\n\nexport const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({\n children,\n className,\n shimmerWidth = 100,\n ...props\n}) => {\n return (\n <span\n style={\n {\n \"--shiny-width\": `${shimmerWidth}px`,\n } as CSSProperties\n }\n className={cn(\n \"mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70\",\n\n // Shine effect\n \"animate-shiny-text [background-size:var(--shiny-width)_100%] bg-clip-text [background-position:0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]\",\n\n // Shine gradient\n \"bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80\",\n\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n}\n",
+ "content": "import {\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type FC,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedShinyTextProps extends ComponentPropsWithoutRef<\"span\"> {\n shimmerWidth?: number\n}\n\nexport const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({\n children,\n className,\n shimmerWidth = 100,\n ...props\n}) => {\n return (\n <span\n style={\n {\n \"--shiny-width\": `${shimmerWidth}px`,\n } as CSSProperties\n }\n className={cn(\n \"mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70\",\n\n // Shine effect\n \"animate-shiny-text bg-size-[var(--shiny-width)_100%] bg-clip-text bg-position-[0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]\",\n\n // Shine gradient\n \"bg-linear-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80\",\n\n className\n )}\n {...props}\n >\n {children}\n </span>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/bento-grid.json b/apps/www/public/r/bento-grid.json
index da9bf103..2c712e87 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 { type ComponentPropsWithoutRef, type ReactNode } from \"react\"\nimport { ArrowRightIcon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ninterface BentoGridProps extends ComponentPropsWithoutRef<\"div\"> {\n children: ReactNode\n className?: string\n}\n\ninterface BentoCardProps extends ComponentPropsWithoutRef<\"div\"> {\n name: string\n className: string\n background: ReactNode\n Icon: React.ElementType\n description: string\n href: string\n cta: string\n}\n\nconst BentoGrid = ({ children, className, ...props }: BentoGridProps) => {\n return (\n <div\n className={cn(\n \"grid w-full auto-rows-[22rem] grid-cols-3 gap-4\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nconst BentoCard = ({\n name,\n className,\n background,\n Icon,\n description,\n href,\n cta,\n ...props\n}: BentoCardProps) => (\n <div\n key={name}\n className={cn(\n \"group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl\",\n // light styles\n \"bg-background [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]\",\n // dark styles\n \"dark:bg-background transform-gpu dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] dark:[border:1px_solid_rgba(255,255,255,.1)]\",\n className\n )}\n {...props}\n >\n <div>{background}</div>\n <div className=\"p-4\">\n <div className=\"pointer-events-none z-10 flex transform-gpu flex-col gap-1 transition-all duration-300 lg:group-hover:-translate-y-10\">\n <Icon className=\"h-12 w-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75\" />\n <h3 className=\"text-xl font-semibold text-neutral-700 dark:text-neutral-300\">\n {name}\n </h3>\n <p className=\"max-w-lg text-neutral-400\">{description}</p>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none flex w-full translate-y-0 transform-gpu flex-row items-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:hidden\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none absolute bottom-0 hidden w-full translate-y-10 transform-gpu flex-row items-center p-4 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:flex\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n\n <div className=\"pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10\" />\n </div>\n)\n\nexport { BentoCard, BentoGrid }\n",
+ "content": "import { type ComponentPropsWithoutRef, type ReactNode } from \"react\"\nimport { ArrowRightIcon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\ninterface BentoGridProps extends ComponentPropsWithoutRef<\"div\"> {\n children: ReactNode\n className?: string\n}\n\ninterface BentoCardProps extends ComponentPropsWithoutRef<\"div\"> {\n name: string\n className: string\n background: ReactNode\n Icon: React.ElementType\n description: string\n href: string\n cta: string\n}\n\nconst BentoGrid = ({ children, className, ...props }: BentoGridProps) => {\n return (\n <div\n className={cn(\n \"grid w-full auto-rows-[22rem] grid-cols-3 gap-4\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nconst BentoCard = ({\n name,\n className,\n background,\n Icon,\n description,\n href,\n cta,\n ...props\n}: BentoCardProps) => (\n <div\n key={name}\n className={cn(\n \"group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl\",\n // light styles\n \"bg-background [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]\",\n // dark styles\n \"dark:bg-background transform-gpu dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] dark:[border:1px_solid_rgba(255,255,255,.1)]\",\n className\n )}\n {...props}\n >\n <div>{background}</div>\n <div className=\"p-4\">\n <div className=\"pointer-events-none z-10 flex transform-gpu flex-col gap-1 transition-all duration-300 lg:group-hover:-translate-y-10\">\n <Icon className=\"h-12 w-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75\" />\n <h3 className=\"text-xl font-semibold text-neutral-700 dark:text-neutral-300\">\n {name}\n </h3>\n <p className=\"max-w-lg text-neutral-400\">{description}</p>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none flex w-full translate-y-0 transform-gpu flex-row items-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:hidden\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n </div>\n\n <div\n className={cn(\n \"pointer-events-none absolute bottom-0 hidden w-full translate-y-10 transform-gpu flex-row items-center p-4 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:flex\"\n )}\n >\n <Button\n variant=\"link\"\n asChild\n size=\"sm\"\n className=\"pointer-events-auto p-0\"\n >\n <a href={href}>\n {cta}\n <ArrowRightIcon className=\"ms-2 h-4 w-4 rtl:rotate-180\" />\n </a>\n </Button>\n </div>\n\n <div className=\"pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/3 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/border-beam-demo-2.json b/apps/www/public/r/border-beam-demo-2.json
index 4eea8ee5..064ecde4 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 { 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",
+ "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-linear-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/code-comparison.json b/apps/www/public/r/code-comparison.json
index 2154d7cb..2919dcde 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 { 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 } =\n await import(\"@shikijs/transformers\")\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",
+ "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 } =\n await import(\"@shikijs/transformers\")\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-(--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/confetti-demo.json b/apps/www/public/r/confetti-demo.json
index edb7d41c..f6316127 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=\"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",
+ "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-linear-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/globe-demo.json b/apps/www/public/r/globe-demo.json
index 6b9f7844..94b67932 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=\"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",
+ "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-linear-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 4c72d0a3..b72ac85b 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 { useEffect, useRef } from \"react\"\nimport createGlobe, { type 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 const canvasRef = useRef<HTMLCanvasElement>(null)\n const phiRef = useRef(0)\n const widthRef = useRef(0)\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 widthRef.current = canvasRef.current.offsetWidth\n }\n }\n\n window.addEventListener(\"resize\", onResize)\n onResize()\n\n const globe = createGlobe(canvasRef.current!, {\n ...config,\n width: widthRef.current * 2,\n height: widthRef.current * 2,\n onRender: (state) => {\n if (!pointerInteracting.current) phiRef.current += 0.005\n state.phi = phiRef.current + rs.get()\n state.width = widthRef.current * 2\n state.height = widthRef.current * 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, { type 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 const canvasRef = useRef<HTMLCanvasElement>(null)\n const phiRef = useRef(0)\n const widthRef = useRef(0)\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 widthRef.current = canvasRef.current.offsetWidth\n }\n }\n\n window.addEventListener(\"resize\", onResize)\n onResize()\n\n const globe = createGlobe(canvasRef.current!, {\n ...config,\n width: widthRef.current * 2,\n height: widthRef.current * 2,\n onRender: (state) => {\n if (!pointerInteracting.current) phiRef.current += 0.005\n state.phi = phiRef.current + rs.get()\n state.width = widthRef.current * 2\n state.height = widthRef.current * 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-square w-full max-w-150\",\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/hero-video-dialog.json b/apps/www/public/r/hero-video-dialog.json
index 37bb6020..72964e73 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": "\"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=\"mt-0 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": "\"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-linear-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=\"mt-0 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/interactive-grid-pattern.json b/apps/www/public/r/interactive-grid-pattern.json
index f54a5923..e1930540 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 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",
+ "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/light-rays.json b/apps/www/public/r/light-rays.json
index 3fb7ae8a..805b9f73 100644
--- a/apps/www/public/r/light-rays.json
+++ b/apps/www/public/r/light-rays.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/light-rays.tsx",
- "content": "\"use client\"\n\nimport { useEffect, useState, type CSSProperties } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface LightRaysProps extends React.HTMLAttributes<HTMLDivElement> {\n ref?: React.Ref<HTMLDivElement>\n count?: number\n color?: string\n blur?: number\n speed?: number\n length?: string\n}\n\ntype LightRay = {\n id: string\n left: number\n rotate: number\n width: number\n swing: number\n delay: number\n duration: number\n intensity: number\n}\n\nconst createRays = (count: number, cycle: number): LightRay[] => {\n if (count <= 0) return []\n\n return Array.from({ length: count }, (_, index) => {\n const left = 8 + Math.random() * 84\n const rotate = -28 + Math.random() * 56\n const width = 160 + Math.random() * 160\n const swing = 0.8 + Math.random() * 1.8\n const delay = Math.random() * cycle\n const duration = cycle * (0.75 + Math.random() * 0.5)\n const intensity = 0.6 + Math.random() * 0.5\n\n return {\n id: `${index}-${Math.round(left * 10)}`,\n left,\n rotate,\n width,\n swing,\n delay,\n duration,\n intensity,\n }\n })\n}\n\nconst Ray = ({\n left,\n rotate,\n width,\n swing,\n delay,\n duration,\n intensity,\n}: LightRay) => {\n return (\n <motion.div\n className=\"pointer-events-none absolute -top-[12%] left-[var(--ray-left)] h-[var(--light-rays-length)] w-[var(--ray-width)] origin-top -translate-x-1/2 rounded-full bg-gradient-to-b from-[color-mix(in_srgb,var(--light-rays-color)_70%,transparent)] to-transparent opacity-0 mix-blend-screen blur-[var(--light-rays-blur)]\"\n style={\n {\n \"--ray-left\": `${left}%`,\n \"--ray-width\": `${width}px`,\n } as CSSProperties\n }\n initial={{ rotate: rotate }}\n animate={{\n opacity: [0, intensity, 0],\n rotate: [rotate - swing, rotate + swing, rotate - swing],\n }}\n transition={{\n duration: duration,\n repeat: Infinity,\n ease: \"easeInOut\",\n delay: delay,\n repeatDelay: duration * 0.1,\n }}\n />\n )\n}\n\nexport function LightRays({\n className,\n style,\n count = 7,\n color = \"rgba(160, 210, 255, 0.2)\",\n blur = 36,\n speed = 14,\n length = \"70vh\",\n ref,\n ...props\n}: LightRaysProps) {\n const [rays, setRays] = useState<LightRay[]>([])\n const cycleDuration = Math.max(speed, 0.1)\n\n useEffect(() => {\n setRays(createRays(count, cycleDuration))\n }, [count, cycleDuration])\n\n return (\n <div\n ref={ref}\n className={cn(\n \"pointer-events-none absolute inset-0 isolate overflow-hidden rounded-[inherit]\",\n className\n )}\n style={\n {\n \"--light-rays-color\": color,\n \"--light-rays-blur\": `${blur}px`,\n \"--light-rays-length\": length,\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n <div className=\"absolute inset-0 overflow-hidden\">\n <div\n aria-hidden\n className=\"absolute inset-0 opacity-60\"\n style={\n {\n background:\n \"radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--light-rays-color) 45%, transparent), transparent 70%)\",\n } as CSSProperties\n }\n />\n <div\n aria-hidden\n className=\"absolute inset-0 opacity-60\"\n style={\n {\n background:\n \"radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--light-rays-color) 35%, transparent), transparent 75%)\",\n } as CSSProperties\n }\n />\n {rays.map((ray) => (\n <Ray key={ray.id} {...ray} />\n ))}\n </div>\n </div>\n )\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useState, type CSSProperties } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface LightRaysProps extends React.HTMLAttributes<HTMLDivElement> {\n ref?: React.Ref<HTMLDivElement>\n count?: number\n color?: string\n blur?: number\n speed?: number\n length?: string\n}\n\ntype LightRay = {\n id: string\n left: number\n rotate: number\n width: number\n swing: number\n delay: number\n duration: number\n intensity: number\n}\n\nconst createRays = (count: number, cycle: number): LightRay[] => {\n if (count <= 0) return []\n\n return Array.from({ length: count }, (_, index) => {\n const left = 8 + Math.random() * 84\n const rotate = -28 + Math.random() * 56\n const width = 160 + Math.random() * 160\n const swing = 0.8 + Math.random() * 1.8\n const delay = Math.random() * cycle\n const duration = cycle * (0.75 + Math.random() * 0.5)\n const intensity = 0.6 + Math.random() * 0.5\n\n return {\n id: `${index}-${Math.round(left * 10)}`,\n left,\n rotate,\n width,\n swing,\n delay,\n duration,\n intensity,\n }\n })\n}\n\nconst Ray = ({\n left,\n rotate,\n width,\n swing,\n delay,\n duration,\n intensity,\n}: LightRay) => {\n return (\n <motion.div\n className=\"pointer-events-none absolute -top-[12%] left-[var(--ray-left)] h-[var(--light-rays-length)] w-[var(--ray-width)] origin-top -translate-x-1/2 rounded-full bg-linear-to-b from-[color-mix(in_srgb,var(--light-rays-color)_70%,transparent)] to-transparent opacity-0 mix-blend-screen blur-[var(--light-rays-blur)]\"\n style={\n {\n \"--ray-left\": `${left}%`,\n \"--ray-width\": `${width}px`,\n } as CSSProperties\n }\n initial={{ rotate: rotate }}\n animate={{\n opacity: [0, intensity, 0],\n rotate: [rotate - swing, rotate + swing, rotate - swing],\n }}\n transition={{\n duration: duration,\n repeat: Infinity,\n ease: \"easeInOut\",\n delay: delay,\n repeatDelay: duration * 0.1,\n }}\n />\n )\n}\n\nexport function LightRays({\n className,\n style,\n count = 7,\n color = \"rgba(160, 210, 255, 0.2)\",\n blur = 36,\n speed = 14,\n length = \"70vh\",\n ref,\n ...props\n}: LightRaysProps) {\n const [rays, setRays] = useState<LightRay[]>([])\n const cycleDuration = Math.max(speed, 0.1)\n\n useEffect(() => {\n setRays(createRays(count, cycleDuration))\n }, [count, cycleDuration])\n\n return (\n <div\n ref={ref}\n className={cn(\n \"pointer-events-none absolute inset-0 isolate overflow-hidden rounded-[inherit]\",\n className\n )}\n style={\n {\n \"--light-rays-color\": color,\n \"--light-rays-blur\": `${blur}px`,\n \"--light-rays-length\": length,\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n <div className=\"absolute inset-0 overflow-hidden\">\n <div\n aria-hidden\n className=\"absolute inset-0 opacity-60\"\n style={\n {\n background:\n \"radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--light-rays-color) 45%, transparent), transparent 70%)\",\n } as CSSProperties\n }\n />\n <div\n aria-hidden\n className=\"absolute inset-0 opacity-60\"\n style={\n {\n background:\n \"radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--light-rays-color) 35%, transparent), transparent 75%)\",\n } as CSSProperties\n }\n />\n {rays.map((ray) => (\n <Ray key={ray.id} {...ray} />\n ))}\n </div>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/line-shadow-text.json b/apps/www/public/r/line-shadow-text.json
index d77a4137..e496c370 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 { type CSSProperties, type HTMLAttributes } from \"react\"\nimport {\n motion,\n type DOMMotionComponents,\n type MotionProps,\n} from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst motionElements = {\n article: motion.article,\n div: motion.div,\n h1: motion.h1,\n h2: motion.h2,\n h3: motion.h3,\n h4: motion.h4,\n h5: motion.h5,\n h6: motion.h6,\n li: motion.li,\n p: motion.p,\n section: motion.section,\n span: motion.span,\n} as const\n\ntype MotionElementType = Extract<\n keyof DOMMotionComponents,\n keyof typeof motionElements\n>\n\ninterface LineShadowTextProps\n extends Omit<HTMLAttributes<HTMLElement>, keyof MotionProps>, MotionProps {\n children: string\n shadowColor?: string\n as?: MotionElementType\n}\n\nexport function LineShadowText({\n children,\n shadowColor = \"black\",\n className,\n as: Component = \"span\",\n ...props\n}: LineShadowTextProps) {\n const MotionComponent = motionElements[Component]\n\n return (\n <MotionComponent\n style={{ \"--shadow-color\": shadowColor } as 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={children}\n {...props}\n >\n {children}\n </MotionComponent>\n )\n}\n",
+ "content": "\"use client\"\n\nimport { type CSSProperties, type HTMLAttributes } from \"react\"\nimport {\n motion,\n type DOMMotionComponents,\n type MotionProps,\n} from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst motionElements = {\n article: motion.article,\n div: motion.div,\n h1: motion.h1,\n h2: motion.h2,\n h3: motion.h3,\n h4: motion.h4,\n h5: motion.h5,\n h6: motion.h6,\n li: motion.li,\n p: motion.p,\n section: motion.section,\n span: motion.span,\n} as const\n\ntype MotionElementType = Extract<\n keyof DOMMotionComponents,\n keyof typeof motionElements\n>\n\ninterface LineShadowTextProps\n extends Omit<HTMLAttributes<HTMLElement>, keyof MotionProps>, MotionProps {\n children: string\n shadowColor?: string\n as?: MotionElementType\n}\n\nexport function LineShadowText({\n children,\n shadowColor = \"black\",\n className,\n as: Component = \"span\",\n ...props\n}: LineShadowTextProps) {\n const MotionComponent = motionElements[Component]\n\n return (\n <MotionComponent\n style={{ \"--shadow-color\": shadowColor } as 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-size-[0.06em_0.06em] after:bg-clip-text after:text-transparent\",\n \"after:animate-line-shadow\",\n className\n )}\n data-text={children}\n {...props}\n >\n {children}\n </MotionComponent>\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 cefd273b..21a0e9be 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": "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\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",
+ "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\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-linear-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 07636ab0..619b653d 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": "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\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",
+ "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\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-linear-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.json b/apps/www/public/r/marquee.json
index c26823e1..6c6e9b2e 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 { type ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MarqueeProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number\n}\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n ...props\n}: MarqueeProps) {\n return (\n <div\n {...props}\n className={cn(\n \"group flex [gap:var(--gap)] overflow-hidden p-2 [--duration:40s] [--gap:1rem]\",\n {\n \"flex-row\": !vertical,\n \"flex-col\": vertical,\n },\n className\n )}\n >\n {Array(repeat)\n .fill(0)\n .map((_, i) => (\n <div\n key={i}\n className={cn(\"flex shrink-0 justify-around [gap:var(--gap)]\", {\n \"animate-marquee flex-row\": !vertical,\n \"animate-marquee-vertical flex-col\": vertical,\n \"group-hover:[animation-play-state:paused]\": pauseOnHover,\n \"[animation-direction:reverse]\": reverse,\n })}\n >\n {children}\n </div>\n ))}\n </div>\n )\n}\n",
+ "content": "import { type ComponentPropsWithoutRef } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface MarqueeProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string\n /**\n * Whether to reverse the animation direction\n * @default false\n */\n reverse?: boolean\n /**\n * Whether to pause the animation on hover\n * @default false\n */\n pauseOnHover?: boolean\n /**\n * Content to be displayed in the marquee\n */\n children: React.ReactNode\n /**\n * Whether to animate vertically instead of horizontally\n * @default false\n */\n vertical?: boolean\n /**\n * Number of times to repeat the content\n * @default 4\n */\n repeat?: number\n}\n\nexport function Marquee({\n className,\n reverse = false,\n pauseOnHover = false,\n children,\n vertical = false,\n repeat = 4,\n ...props\n}: MarqueeProps) {\n return (\n <div\n {...props}\n className={cn(\n \"group flex gap-(--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-(--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 18e6e865..88ba7490 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 flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <Meteors number={30} />\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 Meteors\n </span>\n </div>\n )\n}\n",
+ "content": "import { Meteors } from \"@/registry/magicui/meteors\"\n\nexport default function MeteorDemo() {\n return (\n <div className=\"relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border\">\n <Meteors number={30} />\n <span className=\"pointer-events-none bg-linear-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 Meteors\n </span>\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 a1c299aa..f7cacfdd 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 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",
+ "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-(--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-12.5 -translate-y-1/2 bg-linear-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.json b/apps/www/public/r/morphing-text.json
index 9ca24e51..146ee90b 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] 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",
+ "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-3xl 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 87d07184..5070177b 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 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",
+ "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-linear-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 f9796699..9ffdf5be 100644
--- a/apps/www/public/r/neon-gradient-card.json
+++ b/apps/www/public/r/neon-gradient-card.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/neon-gradient-card.tsx",
- "content": "\"use client\"\n\nimport {\n CSSProperties,\n ReactElement,\n ReactNode,\n useEffect,\n useRef,\n useState,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface NeonColorsProps {\n firstColor: string\n secondColor: string\n}\n\ninterface NeonGradientCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @default <div />\n * @type ReactElement\n * @description\n * The component to be rendered as the card\n * */\n as?: ReactElement\n /**\n * @default \"\"\n * @type string\n * @description\n * The className of the card\n */\n className?: string\n\n /**\n * @default \"\"\n * @type ReactNode\n * @description\n * The children of the card\n * */\n children?: ReactNode\n\n /**\n * @default 5\n * @type number\n * @description\n * The size of the border in pixels\n * */\n borderSize?: number\n\n /**\n * @default 20\n * @type number\n * @description\n * The size of the radius in pixels\n * */\n borderRadius?: number\n\n /**\n * @default \"{ firstColor: '#ff00aa', secondColor: '#00FFF1' }\"\n * @type string\n * @description\n * The colors of the neon gradient\n * */\n neonColors?: NeonColorsProps\n}\n\nexport const NeonGradientCard: React.FC<NeonGradientCardProps> = ({\n className,\n children,\n borderSize = 2,\n borderRadius = 20,\n neonColors = {\n firstColor: \"#ff00aa\",\n secondColor: \"#00FFF1\",\n },\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }\n\n updateDimensions()\n window.addEventListener(\"resize\", updateDimensions)\n\n return () => {\n window.removeEventListener(\"resize\", updateDimensions)\n }\n }, [])\n\n useEffect(() => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }, [children])\n\n return (\n <div\n ref={containerRef}\n style={\n {\n \"--border-size\": `${borderSize}px`,\n \"--border-radius\": `${borderRadius}px`,\n \"--neon-first-color\": neonColors.firstColor,\n \"--neon-second-color\": neonColors.secondColor,\n \"--card-width\": `${dimensions.width}px`,\n \"--card-height\": `${dimensions.height}px`,\n \"--card-content-radius\": `${borderRadius - borderSize}px`,\n \"--pseudo-element-background-image\": `linear-gradient(0deg, ${neonColors.firstColor}, ${neonColors.secondColor})`,\n \"--pseudo-element-width\": `${dimensions.width + borderSize * 2}px`,\n \"--pseudo-element-height\": `${dimensions.height + borderSize * 2}px`,\n \"--after-blur\": `${dimensions.width / 3}px`,\n } as CSSProperties\n }\n className={cn(\n \"relative z-10 size-full rounded-[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",
+ "content": "\"use client\"\n\nimport {\n CSSProperties,\n ReactElement,\n ReactNode,\n useEffect,\n useRef,\n useState,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface NeonColorsProps {\n firstColor: string\n secondColor: string\n}\n\ninterface NeonGradientCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * @default <div />\n * @type ReactElement\n * @description\n * The component to be rendered as the card\n * */\n as?: ReactElement\n /**\n * @default \"\"\n * @type string\n * @description\n * The className of the card\n */\n className?: string\n\n /**\n * @default \"\"\n * @type ReactNode\n * @description\n * The children of the card\n * */\n children?: ReactNode\n\n /**\n * @default 5\n * @type number\n * @description\n * The size of the border in pixels\n * */\n borderSize?: number\n\n /**\n * @default 20\n * @type number\n * @description\n * The size of the radius in pixels\n * */\n borderRadius?: number\n\n /**\n * @default \"{ firstColor: '#ff00aa', secondColor: '#00FFF1' }\"\n * @type string\n * @description\n * The colors of the neon gradient\n * */\n neonColors?: NeonColorsProps\n}\n\nexport const NeonGradientCard: React.FC<NeonGradientCardProps> = ({\n className,\n children,\n borderSize = 2,\n borderRadius = 20,\n neonColors = {\n firstColor: \"#ff00aa\",\n secondColor: \"#00FFF1\",\n },\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }\n\n updateDimensions()\n window.addEventListener(\"resize\", updateDimensions)\n\n return () => {\n window.removeEventListener(\"resize\", updateDimensions)\n }\n }, [])\n\n useEffect(() => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }, [children])\n\n return (\n <div\n ref={containerRef}\n style={\n {\n \"--border-size\": `${borderSize}px`,\n \"--border-radius\": `${borderRadius}px`,\n \"--neon-first-color\": neonColors.firstColor,\n \"--neon-second-color\": neonColors.secondColor,\n \"--card-width\": `${dimensions.width}px`,\n \"--card-height\": `${dimensions.height}px`,\n \"--card-content-radius\": `${borderRadius - borderSize}px`,\n \"--pseudo-element-background-image\": `linear-gradient(0deg, ${neonColors.firstColor}, ${neonColors.secondColor})`,\n \"--pseudo-element-width\": `${dimensions.width + borderSize * 2}px`,\n \"--pseudo-element-height\": `${dimensions.height + borderSize * 2}px`,\n \"--after-blur\": `${dimensions.width / 3}px`,\n } as CSSProperties\n }\n className={cn(\n \"relative z-10 size-full rounded-(--border-radius)\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"relative size-full min-h-[inherit] rounded-(--card-content-radius) bg-gray-100 p-6\",\n \"before:absolute before:-top-(--border-size) before:-left-(--border-size) before:-z-10 before:block\",\n \"before:h-(--pseudo-element-height) before:w-(--pseudo-element-width) before:rounded-(--border-radius) before:content-['']\",\n \"before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-size-[100%_200%]\",\n \"before:animate-background-position-spin\",\n \"after:absolute after:-top-(--border-size) after:-left-(--border-size) after:-z-10 after:block\",\n \"after:h-(--pseudo-element-height) after:w-(--pseudo-element-width) after:rounded-(--border-radius) after:blur-(--after-blur) after:content-['']\",\n \"after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-size-[100%_200%] after:opacity-80\",\n \"after:animate-background-position-spin\",\n \"dark:bg-neutral-900\",\n \"wrap-break-word\"\n )}\n >\n {children}\n </div>\n </div>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/orbiting-circles.json b/apps/www/public/r/orbiting-circles.json
index b31a817e..b4421ab0 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 React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface OrbitingCirclesProps 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",
+ "content": "import React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface OrbitingCirclesProps 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-(--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/retro-grid-demo.json b/apps/www/public/r/retro-grid-demo.json
index e7f0ae1a..ad71a059 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=\"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",
+ "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-linear-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 1426369a..3e77bcd8 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 [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",
+ "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-(--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] ml-[-200%] h-[300vh] w-[600vw] origin-[100%_0_0] bg-[linear-gradient(to_right,var(--light-line)_1px,transparent_0),linear-gradient(to_bottom,var(--light-line)_1px,transparent_0)] bg-size-[var(--cell-size)_var(--cell-size)] bg-repeat dark:bg-[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-linear-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.json b/apps/www/public/r/ripple.json
index 90116d6e..c7ff29c8 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, { type ComponentPropsWithoutRef, type CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RippleProps extends ComponentPropsWithoutRef<\"div\"> {\n mainCircleSize?: number\n mainCircleOpacity?: number\n numCircles?: number\n}\n\nexport const Ripple = React.memo(function Ripple({\n mainCircleSize = 210,\n mainCircleOpacity = 0.24,\n numCircles = 8,\n className,\n ...props\n}: RippleProps) {\n return (\n <div\n className={cn(\n \"pointer-events-none absolute inset-0 [mask-image:linear-gradient(to_bottom,white,transparent)] select-none\",\n className\n )}\n {...props}\n >\n {Array.from({ length: numCircles }, (_, i) => {\n const size = mainCircleSize + i * 70\n const opacity = mainCircleOpacity - i * 0.03\n const animationDelay = `${i * 0.06}s`\n const borderStyle = \"solid\"\n\n return (\n <div\n key={i}\n className={`animate-ripple bg-foreground/25 absolute rounded-full border shadow-xl`}\n style={\n {\n \"--i\": i,\n width: `${size}px`,\n height: `${size}px`,\n opacity,\n animationDelay,\n borderStyle,\n borderWidth: \"1px\",\n borderColor: `var(--foreground)`,\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%) scale(1)\",\n } as CSSProperties\n }\n />\n )\n })}\n </div>\n )\n})\n\nRipple.displayName = \"Ripple\"\n",
+ "content": "import React, { type ComponentPropsWithoutRef, type CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RippleProps extends ComponentPropsWithoutRef<\"div\"> {\n mainCircleSize?: number\n mainCircleOpacity?: number\n numCircles?: number\n}\n\nexport const Ripple = React.memo(function Ripple({\n mainCircleSize = 210,\n mainCircleOpacity = 0.24,\n numCircles = 8,\n className,\n ...props\n}: RippleProps) {\n return (\n <div\n className={cn(\n \"pointer-events-none absolute inset-0 mask-[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/scroll-progress.json b/apps/www/public/r/scroll-progress.json
index f318b801..d72a00cc 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 { motion, useScroll, type MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ScrollProgressProps extends Omit<\n React.HTMLAttributes<HTMLElement>,\n keyof MotionProps\n> {\n ref?: React.Ref<HTMLDivElement>\n}\n\nexport function ScrollProgress({\n className,\n ref,\n ...props\n}: ScrollProgressProps) {\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",
+ "content": "\"use client\"\n\nimport { motion, useScroll, type MotionProps } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ScrollProgressProps extends Omit<\n React.HTMLAttributes<HTMLElement>,\n keyof MotionProps\n> {\n ref?: React.Ref<HTMLDivElement>\n}\n\nexport function ScrollProgress({\n className,\n ref,\n ...props\n}: ScrollProgressProps) {\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-linear-to-r from-[#A97CF8] via-[#F38CB8] to-[#FDCC92]\",\n className\n )}\n style={{\n scaleX: scrollYProgress,\n }}\n {...props}\n />\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/shimmer-button.json b/apps/www/public/r/shimmer-button.json
index 186a7750..3edc11a7 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, { type ComponentPropsWithoutRef, type CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface ShimmerButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n shimmerColor?: string\n shimmerSize?: string\n borderRadius?: string\n shimmerDuration?: string\n background?: string\n className?: string\n children?: React.ReactNode\n}\n\nexport const ShimmerButton = React.forwardRef<\n HTMLButtonElement,\n ShimmerButtonProps\n>(\n (\n {\n shimmerColor = \"#ffffff\",\n shimmerSize = \"0.05em\",\n shimmerDuration = \"3s\",\n borderRadius = \"100px\",\n background = \"rgba(0, 0, 0, 1)\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n return (\n <button\n style={\n {\n \"--spread\": \"90deg\",\n \"--shimmer-color\": shimmerColor,\n \"--radius\": borderRadius,\n \"--speed\": shimmerDuration,\n \"--cut\": shimmerSize,\n \"--bg\": background,\n } as CSSProperties\n }\n className={cn(\n \"group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden [border-radius:var(--radius)] border border-white/10 px-6 py-3 whitespace-nowrap text-white [background:var(--bg)]\",\n \"transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px\",\n className\n )}\n ref={ref}\n {...props}\n >\n {/* spark container */}\n <div\n className={cn(\n \"-z-30 blur-[2px]\",\n \"[container-type:size] absolute inset-0 overflow-visible\"\n )}\n >\n {/* spark */}\n <div className=\"animate-shimmer-slide absolute inset-0 [aspect-ratio:1] h-[100cqh] [border-radius:0] [mask:none]\">\n {/* spark before */}\n <div className=\"animate-spin-around absolute -inset-full w-auto [translate:0_0] rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))]\" />\n </div>\n </div>\n {children}\n\n {/* Highlight */}\n <div\n className={cn(\n \"absolute inset-0 size-full\",\n\n \"rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f]\",\n\n // transition\n \"transform-gpu transition-all duration-300 ease-in-out\",\n\n // on hover\n \"group-hover:shadow-[inset_0_-6px_10px_#ffffff3f]\",\n\n // on click\n \"group-active:shadow-[inset_0_-10px_10px_#ffffff3f]\"\n )}\n />\n\n {/* backdrop */}\n <div\n className={cn(\n \"absolute [inset:var(--cut)] -z-20 [border-radius:var(--radius)] [background:var(--bg)]\"\n )}\n />\n </button>\n )\n }\n)\n\nShimmerButton.displayName = \"ShimmerButton\"\n",
+ "content": "import React, { type ComponentPropsWithoutRef, type CSSProperties } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface ShimmerButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n shimmerColor?: string\n shimmerSize?: string\n borderRadius?: string\n shimmerDuration?: string\n background?: string\n className?: string\n children?: React.ReactNode\n}\n\nexport const ShimmerButton = React.forwardRef<\n HTMLButtonElement,\n ShimmerButtonProps\n>(\n (\n {\n shimmerColor = \"#ffffff\",\n shimmerSize = \"0.05em\",\n shimmerDuration = \"3s\",\n borderRadius = \"100px\",\n background = \"rgba(0, 0, 0, 1)\",\n className,\n children,\n ...props\n },\n ref\n ) => {\n return (\n <button\n style={\n {\n \"--spread\": \"90deg\",\n \"--shimmer-color\": shimmerColor,\n \"--radius\": borderRadius,\n \"--speed\": shimmerDuration,\n \"--cut\": shimmerSize,\n \"--bg\": background,\n } as CSSProperties\n }\n className={cn(\n \"group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden [border-radius:var(--radius)] border border-white/10 px-6 py-3 whitespace-nowrap text-white [background:var(--bg)]\",\n \"transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px\",\n className\n )}\n ref={ref}\n {...props}\n >\n {/* spark container */}\n <div\n className={cn(\n \"-z-30 blur-[2px]\",\n \"@container-[size] absolute inset-0 overflow-visible\"\n )}\n >\n {/* spark */}\n <div className=\"animate-shimmer-slide absolute inset-0 aspect-[1] h-[100cqh] rounded-none [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-(--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/terminal.json b/apps/www/public/r/terminal.json
index cc2619d2..7a99f78c 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 {\n Children,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentType,\n type RefAttributes,\n} from \"react\"\nimport {\n motion,\n useInView,\n type DOMMotionComponents,\n type HTMLMotionProps,\n type MotionProps,\n} 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\nconst motionElements = {\n article: motion.article,\n div: motion.div,\n h1: motion.h1,\n h2: motion.h2,\n h3: motion.h3,\n h4: motion.h4,\n h5: motion.h5,\n h6: motion.h6,\n li: motion.li,\n p: motion.p,\n section: motion.section,\n span: motion.span,\n} as const\n\ntype MotionElementType = Extract<\n keyof DOMMotionComponents,\n keyof typeof motionElements\n>\ntype TerminalTypingMotionComponent = ComponentType<\n Omit<HTMLMotionProps<\"span\">, \"ref\"> & RefAttributes<HTMLElement>\n>\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, 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 Omit<MotionProps, \"children\"> {\n children: string\n className?: string\n duration?: number\n delay?: number\n as?: MotionElementType\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 = motionElements[\n Component\n ] as TerminalTypingMotionComponent\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 const hasSequence = sequence !== null\n const sequenceStarted = sequence?.sequenceStarted ?? false\n const sequenceActiveIndex = sequence?.activeIndex ?? null\n const sequenceCompleteItemRef = useRef<\n SequenceContextValue[\"completeItem\"] | null\n >(null)\n const sequenceItemIndexRef = useRef<number | null>(null)\n\n useEffect(() => {\n sequenceCompleteItemRef.current = sequence?.completeItem ?? null\n sequenceItemIndexRef.current = itemIndex\n }, [sequence?.completeItem, itemIndex])\n\n useEffect(() => {\n let startTimeout: ReturnType<typeof setTimeout> | null = null\n\n if (hasSequence && itemIndex !== null) {\n if (sequenceStarted && !started && sequenceActiveIndex === itemIndex) {\n setStarted(true)\n }\n } else if (!startOnView || isInView) {\n startTimeout = setTimeout(() => setStarted(true), delay)\n }\n\n return () => {\n if (startTimeout !== null) {\n clearTimeout(startTimeout)\n }\n }\n }, [\n delay,\n startOnView,\n isInView,\n started,\n hasSequence,\n sequenceActiveIndex,\n sequenceStarted,\n itemIndex,\n ])\n\n useEffect(() => {\n let typingEffect: ReturnType<typeof setInterval> | null = null\n\n if (started) {\n let i = 0\n typingEffect = setInterval(() => {\n if (i < children.length) {\n setDisplayedText(children.substring(0, i + 1))\n i++\n } else {\n if (typingEffect !== null) {\n clearInterval(typingEffect)\n }\n const completeItem = sequenceCompleteItemRef.current\n const currentItemIndex = sequenceItemIndexRef.current\n if (completeItem && currentItemIndex !== null) {\n completeItem(currentItemIndex)\n }\n }\n }, duration)\n }\n\n return () => {\n if (typingEffect !== null) {\n clearInterval(typingEffect)\n }\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",
+ "content": "\"use client\"\n\nimport {\n Children,\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentType,\n type RefAttributes,\n} from \"react\"\nimport {\n motion,\n useInView,\n type DOMMotionComponents,\n type HTMLMotionProps,\n type MotionProps,\n} 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\nconst motionElements = {\n article: motion.article,\n div: motion.div,\n h1: motion.h1,\n h2: motion.h2,\n h3: motion.h3,\n h4: motion.h4,\n h5: motion.h5,\n h6: motion.h6,\n li: motion.li,\n p: motion.p,\n section: motion.section,\n span: motion.span,\n} as const\n\ntype MotionElementType = Extract<\n keyof DOMMotionComponents,\n keyof typeof motionElements\n>\ntype TerminalTypingMotionComponent = ComponentType<\n Omit<HTMLMotionProps<\"span\">, \"ref\"> & RefAttributes<HTMLElement>\n>\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, 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 Omit<MotionProps, \"children\"> {\n children: string\n className?: string\n duration?: number\n delay?: number\n as?: MotionElementType\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 = motionElements[\n Component\n ] as TerminalTypingMotionComponent\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 const hasSequence = sequence !== null\n const sequenceStarted = sequence?.sequenceStarted ?? false\n const sequenceActiveIndex = sequence?.activeIndex ?? null\n const sequenceCompleteItemRef = useRef<\n SequenceContextValue[\"completeItem\"] | null\n >(null)\n const sequenceItemIndexRef = useRef<number | null>(null)\n\n useEffect(() => {\n sequenceCompleteItemRef.current = sequence?.completeItem ?? null\n sequenceItemIndexRef.current = itemIndex\n }, [sequence?.completeItem, itemIndex])\n\n useEffect(() => {\n let startTimeout: ReturnType<typeof setTimeout> | null = null\n\n if (hasSequence && itemIndex !== null) {\n if (sequenceStarted && !started && sequenceActiveIndex === itemIndex) {\n setStarted(true)\n }\n } else if (!startOnView || isInView) {\n startTimeout = setTimeout(() => setStarted(true), delay)\n }\n\n return () => {\n if (startTimeout !== null) {\n clearTimeout(startTimeout)\n }\n }\n }, [\n delay,\n startOnView,\n isInView,\n started,\n hasSequence,\n sequenceActiveIndex,\n sequenceStarted,\n itemIndex,\n ])\n\n useEffect(() => {\n let typingEffect: ReturnType<typeof setInterval> | null = null\n\n if (started) {\n let i = 0\n typingEffect = setInterval(() => {\n if (i < children.length) {\n setDisplayedText(children.substring(0, i + 1))\n i++\n } else {\n if (typingEffect !== null) {\n clearInterval(typingEffect)\n }\n const completeItem = sequenceCompleteItemRef.current\n const currentItemIndex = sequenceItemIndexRef.current\n if (completeItem && currentItemIndex !== null) {\n completeItem(currentItemIndex)\n }\n }\n }, duration)\n }\n\n return () => {\n if (typingEffect !== null) {\n clearInterval(typingEffect)\n }\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-100 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-reveal.json b/apps/www/public/r/text-reveal.json
index e575bd4c..77175a1f 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 {\n useRef,\n type ComponentPropsWithoutRef,\n type FC,\n type ReactNode,\n} from \"react\"\nimport { motion, MotionValue, useScroll, useTransform } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface TextRevealProps extends ComponentPropsWithoutRef<\"div\"> {\n children: string\n}\n\nexport const TextReveal: FC<TextRevealProps> = ({ children, className }) => {\n const targetRef = useRef<HTMLDivElement | null>(null)\n const { scrollYProgress } = useScroll({\n target: targetRef,\n })\n\n if (typeof children !== \"string\") {\n throw new Error(\"TextReveal: children must be a string\")\n }\n\n const words = children.split(\" \")\n\n return (\n <div ref={targetRef} className={cn(\"relative z-0 h-[200vh]\", className)}>\n <div\n className={\n \"sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-[1rem] py-[5rem]\"\n }\n >\n <span\n ref={targetRef}\n className={\n \"flex flex-wrap p-5 text-2xl font-bold text-black/20 md:p-8 md:text-3xl lg:p-10 lg:text-4xl xl:text-5xl dark:text-white/20\"\n }\n >\n {words.map((word, i) => {\n const start = i / words.length\n const end = start + 1 / words.length\n return (\n <Word key={i} progress={scrollYProgress} range={[start, end]}>\n {word}\n </Word>\n )\n })}\n </span>\n </div>\n </div>\n )\n}\n\ninterface WordProps {\n children: ReactNode\n progress: MotionValue<number>\n range: [number, number]\n}\n\nconst Word: FC<WordProps> = ({ children, progress, range }) => {\n const opacity = useTransform(progress, range, [0, 1])\n return (\n <span className=\"xl:lg-3 relative mx-1 lg:mx-1.5\">\n <span className=\"absolute opacity-30\">{children}</span>\n <motion.span\n style={{ opacity: opacity }}\n className={\"text-black dark:text-white\"}\n >\n {children}\n </motion.span>\n </span>\n )\n}\n",
+ "content": "\"use client\"\n\nimport {\n useRef,\n type ComponentPropsWithoutRef,\n type FC,\n type ReactNode,\n} from \"react\"\nimport { motion, MotionValue, useScroll, useTransform } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface TextRevealProps extends ComponentPropsWithoutRef<\"div\"> {\n children: string\n}\n\nexport const TextReveal: FC<TextRevealProps> = ({ children, className }) => {\n const targetRef = useRef<HTMLDivElement | null>(null)\n const { scrollYProgress } = useScroll({\n target: targetRef,\n })\n\n if (typeof children !== \"string\") {\n throw new Error(\"TextReveal: children must be a string\")\n }\n\n const words = children.split(\" \")\n\n return (\n <div ref={targetRef} className={cn(\"relative z-0 h-[200vh]\", className)}>\n <div\n className={\n \"sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-4 py-20\"\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/warp-background.json b/apps/www/public/r/warp-background.json
index 63db0349..221c2213 100644
--- a/apps/www/public/r/warp-background.json
+++ b/apps/www/public/r/warp-background.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/warp-background.tsx",
- "content": "\"use client\"\n\nimport React, { HTMLAttributes, useCallback, useMemo } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface WarpBackgroundProps extends HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n perspective?: number\n beamsPerSide?: number\n beamSize?: number\n beamDelayMax?: number\n beamDelayMin?: number\n beamDuration?: number\n gridColor?: string\n}\n\nconst Beam = ({\n width,\n x,\n delay,\n duration,\n}: {\n width: string | number\n x: string | number\n delay: number\n duration: number\n}) => {\n const hue = Math.floor(Math.random() * 360)\n const ar = Math.floor(Math.random() * 10) + 1\n\n return (\n <motion.div\n style={\n {\n \"--x\": `${x}`,\n \"--width\": `${width}`,\n \"--aspect-ratio\": `${ar}`,\n \"--background\": `linear-gradient(hsl(${hue} 80% 60%), transparent)`,\n } as React.CSSProperties\n }\n className={`absolute top-0 left-[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",
+ "content": "\"use client\"\n\nimport React, { HTMLAttributes, useCallback, useMemo } from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface WarpBackgroundProps extends HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n perspective?: number\n beamsPerSide?: number\n beamSize?: number\n beamDelayMax?: number\n beamDelayMin?: number\n beamDuration?: number\n gridColor?: string\n}\n\nconst Beam = ({\n width,\n x,\n delay,\n duration,\n}: {\n width: string | number\n x: string | number\n delay: number\n duration: number\n}) => {\n const hue = Math.floor(Math.random() * 360)\n const ar = Math.floor(Math.random() * 10) + 1\n\n return (\n <motion.div\n style={\n {\n \"--x\": `${x}`,\n \"--width\": `${width}`,\n \"--aspect-ratio\": `${ar}`,\n \"--background\": `linear-gradient(hsl(${hue} 80% 60%), transparent)`,\n } as React.CSSProperties\n }\n className={`absolute top-0 left-(--x) aspect-[1/var(--aspect-ratio)] w-(--width) [background:var(--background)]`}\n initial={{ y: \"100cqmax\", x: \"-50%\" }}\n animate={{ y: \"-100%\", x: \"-50%\" }}\n transition={{\n duration,\n delay,\n repeat: Infinity,\n ease: \"linear\",\n }}\n />\n )\n}\n\nexport const WarpBackground: React.FC<WarpBackgroundProps> = ({\n children,\n perspective = 100,\n className,\n beamsPerSide = 3,\n beamSize = 5,\n beamDelayMax = 3,\n beamDelayMin = 0,\n beamDuration = 3,\n gridColor = \"var(--border)\",\n ...props\n}) => {\n const generateBeams = useCallback(() => {\n const beams = []\n const cellsPerSide = Math.floor(100 / beamSize)\n const step = cellsPerSide / beamsPerSide\n\n for (let i = 0; i < beamsPerSide; i++) {\n const x = Math.floor(i * step)\n const delay = Math.random() * (beamDelayMax - beamDelayMin) + beamDelayMin\n beams.push({ x, delay })\n }\n return beams\n }, [beamsPerSide, beamSize, beamDelayMax, beamDelayMin])\n\n const topBeams = useMemo(() => generateBeams(), [generateBeams])\n const rightBeams = useMemo(() => generateBeams(), [generateBeams])\n const bottomBeams = useMemo(() => generateBeams(), [generateBeams])\n const leftBeams = useMemo(() => generateBeams(), [generateBeams])\n\n return (\n <div className={cn(\"relative rounded border p-20\", className)} {...props}>\n <div\n style={\n {\n \"--perspective\": `${perspective}px`,\n \"--grid-color\": gridColor,\n \"--beam-size\": `${beamSize}%`,\n } as React.CSSProperties\n }\n className={\n \"@container-[size] pointer-events-none absolute top-0 left-0 size-full overflow-hidden [clipPath:inset(0)] perspective-(--perspective) transform-3d\"\n }\n >\n {/* top side */}\n <div className=\"@container absolute z-20 h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {topBeams.map((beam, index) => (\n <Beam\n key={`top-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n {/* bottom side */}\n <div className=\"@container absolute top-full h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {bottomBeams.map((beam, index) => (\n <Beam\n key={`bottom-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n {/* left side */}\n <div className=\"@container absolute top-0 left-0 h-[100cqmax] w-[100cqh] origin-[0%_0%] transform-[rotate(90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {leftBeams.map((beam, index) => (\n <Beam\n key={`left-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n {/* right side */}\n <div className=\"@container absolute top-0 right-0 h-[100cqmax] w-[100cqh] origin-[100%_0%] transform-[rotate(-90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d\">\n {rightBeams.map((beam, index) => (\n <Beam\n key={`right-${index}`}\n width={`${beamSize}%`}\n x={`${beam.x * beamSize}%`}\n delay={beam.delay}\n duration={beamDuration}\n />\n ))}\n </div>\n </div>\n <div className=\"relative\">{children}</div>\n </div>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/registry/example/border-beam-demo-2.tsx b/apps/www/registry/example/border-beam-demo-2.tsx
index c733b3de..b39da900 100644
--- a/apps/www/registry/example/border-beam-demo-2.tsx
+++ b/apps/www/registry/example/border-beam-demo-2.tsx
@@ -20,7 +20,7 @@ export default function MusicPlayer() {
</CardHeader>
<CardContent>
<div className="flex flex-col items-center gap-4">
- <div className="h-48 w-48 rounded-lg bg-gradient-to-br from-purple-500 to-pink-500" />
+ <div className="h-48 w-48 rounded-lg bg-linear-to-br from-purple-500 to-pink-500" />
<div className="bg-secondary h-1 w-full rounded-full">
<div className="bg-primary h-full w-1/3 rounded-full" />
</div>
diff --git a/apps/www/registry/example/confetti-demo.tsx b/apps/www/registry/example/confetti-demo.tsx
index 0169e3df..c26c0076 100644
--- a/apps/www/registry/example/confetti-demo.tsx
+++ b/apps/www/registry/example/confetti-demo.tsx
@@ -9,7 +9,7 @@ export default function ConfettiDemo() {
return (
<div className="bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border">
- <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">
+ <span className="pointer-events-none bg-linear-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">
Confetti
</span>
diff --git a/apps/www/registry/example/globe-demo.tsx b/apps/www/registry/example/globe-demo.tsx
index 1d862b26..38dfb7f9 100644
--- a/apps/www/registry/example/globe-demo.tsx
+++ b/apps/www/registry/example/globe-demo.tsx
@@ -3,7 +3,7 @@ import { Globe } from "@/registry/magicui/globe"
export default function GlobeDemo() {
return (
<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">
- <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">
+ <span className="pointer-events-none bg-linear-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">
Globe
</span>
<Globe className="top-28" />
diff --git a/apps/www/registry/example/marquee-3d.tsx b/apps/www/registry/example/marquee-3d.tsx
index 18f833af..720a7ce2 100644
--- a/apps/www/registry/example/marquee-3d.tsx
+++ b/apps/www/registry/example/marquee-3d.tsx
@@ -94,7 +94,7 @@ export default function Marquee3D() {
</Marquee>
</div>
- <div className="from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-gradient-to-b"></div>
+ <div className="from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-linear-to-b"></div>
<div className="from-background pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t"></div>
<div className="from-background pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r"></div>
<div className="from-background pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l"></div>
diff --git a/apps/www/registry/example/marquee-demo-vertical.tsx b/apps/www/registry/example/marquee-demo-vertical.tsx
index d0e3bbc0..016dc23e 100644
--- a/apps/www/registry/example/marquee-demo-vertical.tsx
+++ b/apps/www/registry/example/marquee-demo-vertical.tsx
@@ -73,7 +73,7 @@ export default function MarqueeDemoVertical() {
<ReviewCard key={review.username} {...review} />
))}
</Marquee>
- <div className="from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-gradient-to-b"></div>
+ <div className="from-background pointer-events-none absolute inset-x-0 top-0 h-1/4 bg-linear-to-b"></div>
<div className="from-background pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t"></div>
</div>
)
diff --git a/apps/www/registry/example/meteors-demo.tsx b/apps/www/registry/example/meteors-demo.tsx
index 39f2a7fc..178feb3b 100644
--- a/apps/www/registry/example/meteors-demo.tsx
+++ b/apps/www/registry/example/meteors-demo.tsx
@@ -4,7 +4,7 @@ export default function MeteorDemo() {
return (
<div className="relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border">
<Meteors number={30} />
- <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">
+ <span className="pointer-events-none bg-linear-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">
Meteors
</span>
</div>
diff --git a/apps/www/registry/example/neon-gradient-card-demo.tsx b/apps/www/registry/example/neon-gradient-card-demo.tsx
index b8ee7c02..11d50d2b 100644
--- a/apps/www/registry/example/neon-gradient-card-demo.tsx
+++ b/apps/www/registry/example/neon-gradient-card-demo.tsx
@@ -3,7 +3,7 @@ import { NeonGradientCard } from "@/registry/magicui/neon-gradient-card"
export default function NeonGradientCardDemo() {
return (
<NeonGradientCard className="max-w-sm items-center justify-center text-center">
- <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)]">
+ <span className="pointer-events-none z-10 h-full bg-linear-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)]">
Neon Gradient Card
</span>
</NeonGradientCard>
diff --git a/apps/www/registry/example/retro-grid-demo.tsx b/apps/www/registry/example/retro-grid-demo.tsx
index 018174db..906282d5 100644
--- a/apps/www/registry/example/retro-grid-demo.tsx
+++ b/apps/www/registry/example/retro-grid-demo.tsx
@@ -5,7 +5,7 @@ import { RetroGrid } from "@/registry/magicui/retro-grid"
export default function RetroGridDemo() {
return (
<div className="bg-background relative flex h-[500px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border">
- <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">
+ <span className="pointer-events-none z-10 bg-linear-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">
Retro Grid
</span>
diff --git a/apps/www/registry/magicui/animated-circular-progress-bar.tsx b/apps/www/registry/magicui/animated-circular-progress-bar.tsx
index 8205191d..cb2eef02 100644
--- a/apps/www/registry/magicui/animated-circular-progress-bar.tsx
+++ b/apps/www/registry/magicui/animated-circular-progress-bar.tsx
@@ -99,7 +99,7 @@ export function AnimatedCircularProgressBar({
</svg>
<span
data-current-value={currentPercent}
- className="animate-in fade-in absolute inset-0 m-auto size-fit delay-[var(--delay)] duration-[var(--transition-length)] ease-linear"
+ className="animate-in fade-in absolute inset-0 m-auto size-fit delay-(--delay) duration-(--transition-length) ease-linear"
>
{currentPercent}
</span>
diff --git a/apps/www/registry/magicui/animated-gradient-text.tsx b/apps/www/registry/magicui/animated-gradient-text.tsx
index c814eb3b..39c66904 100644
--- a/apps/www/registry/magicui/animated-gradient-text.tsx
+++ b/apps/www/registry/magicui/animated-gradient-text.tsx
@@ -26,7 +26,7 @@ export function AnimatedGradientText({
} as React.CSSProperties
}
className={cn(
- `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`,
+ `animate-gradient inline bg-linear-to-r from-(--color-from) via-(--color-to) to-(--color-from) bg-size-[var(--bg-size)_100%] bg-clip-text text-transparent`,
className
)}
{...props}
diff --git a/apps/www/registry/magicui/animated-shiny-text.tsx b/apps/www/registry/magicui/animated-shiny-text.tsx
index 60d23d69..02b24c19 100644
--- a/apps/www/registry/magicui/animated-shiny-text.tsx
+++ b/apps/www/registry/magicui/animated-shiny-text.tsx
@@ -27,10 +27,10 @@ export const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({
"mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70",
// Shine effect
- "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]",
+ "animate-shiny-text bg-size-[var(--shiny-width)_100%] bg-clip-text bg-position-[0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]",
// Shine gradient
- "bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80",
+ "bg-linear-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80",
className
)}
diff --git a/apps/www/registry/magicui/bento-grid.tsx b/apps/www/registry/magicui/bento-grid.tsx
index f602e5bf..7d106250 100644
--- a/apps/www/registry/magicui/bento-grid.tsx
+++ b/apps/www/registry/magicui/bento-grid.tsx
@@ -102,7 +102,7 @@ const BentoCard = ({
</Button>
</div>
- <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" />
+ <div className="pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/3 group-hover:dark:bg-neutral-800/10" />
</div>
)
diff --git a/apps/www/registry/magicui/code-comparison.tsx b/apps/www/registry/magicui/code-comparison.tsx
index a2617fd1..7113dd1d 100644
--- a/apps/www/registry/magicui/code-comparison.tsx
+++ b/apps/www/registry/magicui/code-comparison.tsx
@@ -90,12 +90,12 @@ export function CodeComparison({
style={{ "--highlight-color": highlightColor } as React.CSSProperties}
className={cn(
"bg-background h-full w-full overflow-auto font-mono text-xs",
- "[&>pre]:h-full [&>pre]:!w-screen [&>pre]:py-2",
- "[&>pre>code]:!inline-block [&>pre>code]:!w-full",
- "[&>pre>code>span]:!inline-block [&>pre>code>span]:w-full [&>pre>code>span]:px-4 [&>pre>code>span]:py-0.5",
- "[&>pre>code>.highlighted]:inline-block [&>pre>code>.highlighted]:w-full [&>pre>code>.highlighted]:!bg-[var(--highlight-color)]",
- "group-hover/left:[&>pre>code>:not(.focused)]:!opacity-100 group-hover/left:[&>pre>code>:not(.focused)]:!blur-none",
- "group-hover/right:[&>pre>code>:not(.focused)]:!opacity-100 group-hover/right:[&>pre>code>:not(.focused)]:!blur-none",
+ "[&>pre]:h-full [&>pre]:w-screen! [&>pre]:py-2",
+ "[&>pre>code]:inline-block! [&>pre>code]:w-full!",
+ "[&>pre>code>span]:inline-block! [&>pre>code>span]:w-full [&>pre>code>span]:px-4 [&>pre>code>span]:py-0.5",
+ "[&>pre>code>.highlighted]:inline-block [&>pre>code>.highlighted]:w-full [&>pre>code>.highlighted]:bg-(--highlight-color)!",
+ "group-hover/left:[&>pre>code>:not(.focused)]:opacity-100! group-hover/left:[&>pre>code>:not(.focused)]:blur-none!",
+ "group-hover/right:[&>pre>code>:not(.focused)]:opacity-100! group-hover/right:[&>pre>code>:not(.focused)]:blur-none!",
"[&>pre>code>.add]:bg-[rgba(16,185,129,.16)] [&>pre>code>.remove]:bg-[rgba(244,63,94,.16)]",
"group-hover/left:[&>pre>code>:not(.focused)]:transition-all group-hover/left:[&>pre>code>:not(.focused)]:duration-300",
"group-hover/right:[&>pre>code>:not(.focused)]:transition-all group-hover/right:[&>pre>code>:not(.focused)]:duration-300"
@@ -120,7 +120,7 @@ export function CodeComparison({
className={cn(
"leftside group/left border-primary/20 md:border-r",
hasLeftFocus &&
- "[&>div>pre>code>:not(.focused)]:!opacity-50 [&>div>pre>code>:not(.focused)]:!blur-[0.095rem]",
+ "[&>div>pre>code>:not(.focused)]:opacity-50! [&>div>pre>code>:not(.focused)]:blur-[0.095rem]!",
"[&>div>pre>code>:not(.focused)]:transition-all [&>div>pre>code>:not(.focused)]:duration-300"
)}
>
@@ -135,7 +135,7 @@ export function CodeComparison({
className={cn(
"rightside group/right border-primary/20 border-t md:border-t-0",
hasRightFocus &&
- "[&>div>pre>code>:not(.focused)]:!opacity-50 [&>div>pre>code>:not(.focused)]:!blur-[0.095rem]",
+ "[&>div>pre>code>:not(.focused)]:opacity-50! [&>div>pre>code>:not(.focused)]:blur-[0.095rem]!",
"[&>div>pre>code>:not(.focused)]:transition-all [&>div>pre>code>:not(.focused)]:duration-300"
)}
>
diff --git a/apps/www/registry/magicui/globe.tsx b/apps/www/registry/magicui/globe.tsx
index 4b2f887e..84c6de4d 100644
--- a/apps/www/registry/magicui/globe.tsx
+++ b/apps/www/registry/magicui/globe.tsx
@@ -103,13 +103,13 @@ export function Globe({
return (
<div
className={cn(
- "absolute inset-0 mx-auto aspect-[1/1] w-full max-w-[600px]",
+ "absolute inset-0 mx-auto aspect-square w-full max-w-150",
className
)}
>
<canvas
className={cn(
- "size-full opacity-0 transition-opacity duration-500 [contain:layout_paint_size]"
+ "size-full opacity-0 transition-opacity duration-500 contain-[layout_paint_size]"
)}
ref={canvasRef}
onPointerDown={(e) => {
diff --git a/apps/www/registry/magicui/hero-video-dialog.tsx b/apps/www/registry/magicui/hero-video-dialog.tsx
index 5efe1de9..600601e1 100644
--- a/apps/www/registry/magicui/hero-video-dialog.tsx
+++ b/apps/www/registry/magicui/hero-video-dialog.tsx
@@ -95,7 +95,7 @@ export function HeroVideoDialog({
<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">
<div className="bg-primary/10 flex size-28 items-center justify-center rounded-full backdrop-blur-md">
<div
- 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]`}
+ className={`from-primary/30 to-primary relative flex size-20 scale-100 items-center justify-center rounded-full bg-linear-to-b shadow-md transition-all duration-200 ease-out group-hover:scale-[1.2]`}
>
<Play
className="size-8 scale-100 fill-white text-white transition-transform duration-200 ease-out group-hover:scale-105"
@@ -132,7 +132,7 @@ export function HeroVideoDialog({
<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">
<XIcon className="size-5" />
</motion.button>
- <div className="relative isolate z-[1] size-full overflow-hidden rounded-2xl border-2 border-white">
+ <div className="relative isolate z-1 size-full overflow-hidden rounded-2xl border-2 border-white">
<iframe
src={videoSrc}
title="Hero Video player"
diff --git a/apps/www/registry/magicui/interactive-grid-pattern.tsx b/apps/www/registry/magicui/interactive-grid-pattern.tsx
index b2c7c580..7cd6bd23 100644
--- a/apps/www/registry/magicui/interactive-grid-pattern.tsx
+++ b/apps/www/registry/magicui/interactive-grid-pattern.tsx
@@ -59,7 +59,7 @@ export function InteractiveGridPattern({
width={width}
height={height}
className={cn(
- "stroke-gray-400/30 transition-all duration-100 ease-in-out [&:not(:hover)]:duration-1000",
+ "stroke-gray-400/30 transition-all duration-100 ease-in-out not-[&:hover]:duration-1000",
hoveredSquare === index ? "fill-gray-300/30" : "fill-transparent",
squaresClassName
)}
diff --git a/apps/www/registry/magicui/light-rays.tsx b/apps/www/registry/magicui/light-rays.tsx
index ed80dcce..575afc57 100644
--- a/apps/www/registry/magicui/light-rays.tsx
+++ b/apps/www/registry/magicui/light-rays.tsx
@@ -61,7 +61,7 @@ const Ray = ({
}: LightRay) => {
return (
<motion.div
- className="pointer-events-none absolute -top-[12%] left-[var(--ray-left)] h-[var(--light-rays-length)] w-[var(--ray-width)] origin-top -translate-x-1/2 rounded-full bg-gradient-to-b from-[color-mix(in_srgb,var(--light-rays-color)_70%,transparent)] to-transparent opacity-0 mix-blend-screen blur-[var(--light-rays-blur)]"
+ className="pointer-events-none absolute -top-[12%] left-[var(--ray-left)] h-[var(--light-rays-length)] w-[var(--ray-width)] origin-top -translate-x-1/2 rounded-full bg-linear-to-b from-[color-mix(in_srgb,var(--light-rays-color)_70%,transparent)] to-transparent opacity-0 mix-blend-screen blur-[var(--light-rays-blur)]"
style={
{
"--ray-left": `${left}%`,
diff --git a/apps/www/registry/magicui/line-shadow-text.tsx b/apps/www/registry/magicui/line-shadow-text.tsx
index 5b88a0cb..099c55d6 100644
--- a/apps/www/registry/magicui/line-shadow-text.tsx
+++ b/apps/www/registry/magicui/line-shadow-text.tsx
@@ -52,7 +52,7 @@ export function LineShadowText({
"relative z-0 inline-flex",
"after:absolute after:top-[0.04em] after:left-[0.04em] after:content-[attr(data-text)]",
"after:bg-[linear-gradient(45deg,transparent_45%,var(--shadow-color)_45%,var(--shadow-color)_55%,transparent_0)]",
- "after:-z-10 after:bg-[length:0.06em_0.06em] after:bg-clip-text after:text-transparent",
+ "after:-z-10 after:bg-size-[0.06em_0.06em] after:bg-clip-text after:text-transparent",
"after:animate-line-shadow",
className
)}
diff --git a/apps/www/registry/magicui/marquee.tsx b/apps/www/registry/magicui/marquee.tsx
index 214c13ce..c86ab573 100644
--- a/apps/www/registry/magicui/marquee.tsx
+++ b/apps/www/registry/magicui/marquee.tsx
@@ -46,7 +46,7 @@ export function Marquee({
<div
{...props}
className={cn(
- "group flex [gap:var(--gap)] overflow-hidden p-2 [--duration:40s] [--gap:1rem]",
+ "group flex gap-(--gap) overflow-hidden p-2 [--duration:40s] [--gap:1rem]",
{
"flex-row": !vertical,
"flex-col": vertical,
@@ -59,7 +59,7 @@ export function Marquee({
.map((_, i) => (
<div
key={i}
- className={cn("flex shrink-0 justify-around [gap:var(--gap)]", {
+ className={cn("flex shrink-0 justify-around gap-(--gap)", {
"animate-marquee flex-row": !vertical,
"animate-marquee-vertical flex-col": vertical,
"group-hover:[animation-play-state:paused]": pauseOnHover,
diff --git a/apps/www/registry/magicui/meteors.tsx b/apps/www/registry/magicui/meteors.tsx
index cfa402c8..e2aae8e2 100644
--- a/apps/www/registry/magicui/meteors.tsx
+++ b/apps/www/registry/magicui/meteors.tsx
@@ -48,12 +48,12 @@ export const Meteors = ({
key={idx}
style={{ ...style }}
className={cn(
- "animate-meteor pointer-events-none absolute size-0.5 rotate-[var(--angle)] rounded-full bg-zinc-500 shadow-[0_0_0_1px_#ffffff10]",
+ "animate-meteor pointer-events-none absolute size-0.5 rotate-(--angle) rounded-full bg-zinc-500 shadow-[0_0_0_1px_#ffffff10]",
className
)}
>
{/* Meteor Tail */}
- <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" />
+ <div className="pointer-events-none absolute top-1/2 -z-10 h-px w-12.5 -translate-y-1/2 bg-linear-to-r from-zinc-500 to-transparent" />
</span>
))}
</>
diff --git a/apps/www/registry/magicui/morphing-text.tsx b/apps/www/registry/magicui/morphing-text.tsx
index 5ac10f93..ff2baf0d 100644
--- a/apps/www/registry/magicui/morphing-text.tsx
+++ b/apps/www/registry/magicui/morphing-text.tsx
@@ -139,7 +139,7 @@ export const MorphingText: React.FC<MorphingTextProps> = ({
}) => (
<div
className={cn(
- "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]",
+ "relative mx-auto h-16 w-full max-w-3xl text-center font-sans text-[40pt] leading-none font-bold filter-[url(#threshold)_blur(0.6px)] md:h-24 lg:text-[6rem]",
className
)}
>
diff --git a/apps/www/registry/magicui/neon-gradient-card.tsx b/apps/www/registry/magicui/neon-gradient-card.tsx
index 5454f65b..c9d46c56 100644
--- a/apps/www/registry/magicui/neon-gradient-card.tsx
+++ b/apps/www/registry/magicui/neon-gradient-card.tsx
@@ -121,24 +121,24 @@ export const NeonGradientCard: React.FC<NeonGradientCardProps> = ({
} as CSSProperties
}
className={cn(
- "relative z-10 size-full rounded-[var(--border-radius)]",
+ "relative z-10 size-full rounded-(--border-radius)",
className
)}
{...props}
>
<div
className={cn(
- "relative size-full min-h-[inherit] rounded-[var(--card-content-radius)] bg-gray-100 p-6",
- "before:absolute before:-top-[var(--border-size)] before:-left-[var(--border-size)] before:-z-10 before:block",
- "before:h-[var(--pseudo-element-height)] before:w-[var(--pseudo-element-width)] before:rounded-[var(--border-radius)] before:content-['']",
- "before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-[length:100%_200%]",
+ "relative size-full min-h-[inherit] rounded-(--card-content-radius) bg-gray-100 p-6",
+ "before:absolute before:-top-(--border-size) before:-left-(--border-size) before:-z-10 before:block",
+ "before:h-(--pseudo-element-height) before:w-(--pseudo-element-width) before:rounded-(--border-radius) before:content-['']",
+ "before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-size-[100%_200%]",
"before:animate-background-position-spin",
- "after:absolute after:-top-[var(--border-size)] after:-left-[var(--border-size)] after:-z-10 after:block",
- "after:h-[var(--pseudo-element-height)] after:w-[var(--pseudo-element-width)] after:rounded-[var(--border-radius)] after:blur-[var(--after-blur)] after:content-['']",
- "after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-[length:100%_200%] after:opacity-80",
+ "after:absolute after:-top-(--border-size) after:-left-(--border-size) after:-z-10 after:block",
+ "after:h-(--pseudo-element-height) after:w-(--pseudo-element-width) after:rounded-(--border-radius) after:blur-(--after-blur) after:content-['']",
+ "after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-size-[100%_200%] after:opacity-80",
"after:animate-background-position-spin",
"dark:bg-neutral-900",
- "break-words"
+ "wrap-break-word"
)}
>
{children}
diff --git a/apps/www/registry/magicui/orbiting-circles.tsx b/apps/www/registry/magicui/orbiting-circles.tsx
index df207588..5cb8345d 100644
--- a/apps/www/registry/magicui/orbiting-circles.tsx
+++ b/apps/www/registry/magicui/orbiting-circles.tsx
@@ -56,7 +56,7 @@ export function OrbitingCircles({
} as React.CSSProperties
}
className={cn(
- `animate-orbit absolute flex size-[var(--icon-size)] transform-gpu items-center justify-center rounded-full`,
+ `animate-orbit absolute flex size-(--icon-size) transform-gpu items-center justify-center rounded-full`,
{ "[animation-direction:reverse]": reverse },
className
)}
diff --git a/apps/www/registry/magicui/retro-grid.tsx b/apps/www/registry/magicui/retro-grid.tsx
index ee5d247a..5c2c9172 100644
--- a/apps/www/registry/magicui/retro-grid.tsx
+++ b/apps/www/registry/magicui/retro-grid.tsx
@@ -52,18 +52,18 @@ export function RetroGrid({
return (
<div
className={cn(
- "pointer-events-none absolute size-full overflow-hidden [perspective:200px]",
- `opacity-[var(--opacity)]`,
+ "pointer-events-none absolute size-full overflow-hidden perspective-[200px]",
+ `opacity-(--opacity)`,
className
)}
style={gridStyles}
{...props}
>
- <div className="absolute inset-0 [transform:rotateX(var(--grid-angle))]">
- <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)]" />
+ <div className="absolute inset-0 transform-[rotateX(var(--grid-angle))]">
+ <div className="animate-grid inset-[0%_0px] ml-[-200%] h-[300vh] w-[600vw] origin-[100%_0_0] bg-[linear-gradient(to_right,var(--light-line)_1px,transparent_0),linear-gradient(to_bottom,var(--light-line)_1px,transparent_0)] bg-size-[var(--cell-size)_var(--cell-size)] bg-repeat dark:bg-[linear-gradient(to_right,var(--dark-line)_1px,transparent_0),linear-gradient(to_bottom,var(--dark-line)_1px,transparent_0)]" />
</div>
- <div className="absolute inset-0 bg-gradient-to-t from-white to-transparent to-90% dark:from-black" />
+ <div className="absolute inset-0 bg-linear-to-t from-white to-transparent to-90% dark:from-black" />
</div>
)
}
diff --git a/apps/www/registry/magicui/ripple.tsx b/apps/www/registry/magicui/ripple.tsx
index fa5aa897..bf166a1b 100644
--- a/apps/www/registry/magicui/ripple.tsx
+++ b/apps/www/registry/magicui/ripple.tsx
@@ -18,7 +18,7 @@ export const Ripple = React.memo(function Ripple({
return (
<div
className={cn(
- "pointer-events-none absolute inset-0 [mask-image:linear-gradient(to_bottom,white,transparent)] select-none",
+ "pointer-events-none absolute inset-0 mask-[linear-gradient(to_bottom,white,transparent)] select-none",
className
)}
{...props}
diff --git a/apps/www/registry/magicui/scroll-progress.tsx b/apps/www/registry/magicui/scroll-progress.tsx
index 574f5725..f4828f60 100644
--- a/apps/www/registry/magicui/scroll-progress.tsx
+++ b/apps/www/registry/magicui/scroll-progress.tsx
@@ -22,7 +22,7 @@ export function ScrollProgress({
<motion.div
ref={ref}
className={cn(
- "fixed inset-x-0 top-0 z-50 h-px origin-left bg-gradient-to-r from-[#A97CF8] via-[#F38CB8] to-[#FDCC92]",
+ "fixed inset-x-0 top-0 z-50 h-px origin-left bg-linear-to-r from-[#A97CF8] via-[#F38CB8] to-[#FDCC92]",
className
)}
style={{
diff --git a/apps/www/registry/magicui/shimmer-button.tsx b/apps/www/registry/magicui/shimmer-button.tsx
index 84be85fb..d675cc09 100644
--- a/apps/www/registry/magicui/shimmer-button.tsx
+++ b/apps/www/registry/magicui/shimmer-button.tsx
@@ -53,11 +53,11 @@ export const ShimmerButton = React.forwardRef<
<div
className={cn(
"-z-30 blur-[2px]",
- "[container-type:size] absolute inset-0 overflow-visible"
+ "@container-[size] absolute inset-0 overflow-visible"
)}
>
{/* spark */}
- <div className="animate-shimmer-slide absolute inset-0 [aspect-ratio:1] h-[100cqh] [border-radius:0] [mask:none]">
+ <div className="animate-shimmer-slide absolute inset-0 aspect-[1] h-[100cqh] rounded-none [mask:none]">
{/* spark before */}
<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))]" />
</div>
@@ -85,7 +85,7 @@ export const ShimmerButton = React.forwardRef<
{/* backdrop */}
<div
className={cn(
- "absolute [inset:var(--cut)] -z-20 [border-radius:var(--radius)] [background:var(--bg)]"
+ "absolute inset-(--cut) -z-20 [border-radius:var(--radius)] [background:var(--bg)]"
)}
/>
</button>
diff --git a/apps/www/registry/magicui/terminal.tsx b/apps/www/registry/magicui/terminal.tsx
index 5349de3a..0370980c 100644
--- a/apps/www/registry/magicui/terminal.tsx
+++ b/apps/www/registry/magicui/terminal.tsx
@@ -273,7 +273,7 @@ export const Terminal = ({
<div
ref={containerRef}
className={cn(
- "border-border bg-background z-0 h-full max-h-[400px] w-full max-w-lg rounded-xl border",
+ "border-border bg-background z-0 h-full max-h-100 w-full max-w-lg rounded-xl border",
className
)}
>
diff --git a/apps/www/registry/magicui/text-reveal.tsx b/apps/www/registry/magicui/text-reveal.tsx
index 401f9403..7b5c49be 100644
--- a/apps/www/registry/magicui/text-reveal.tsx
+++ b/apps/www/registry/magicui/text-reveal.tsx
@@ -30,7 +30,7 @@ export const TextReveal: FC<TextRevealProps> = ({ children, className }) => {
<div ref={targetRef} className={cn("relative z-0 h-[200vh]", className)}>
<div
className={
- "sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-[1rem] py-[5rem]"
+ "sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-4 py-20"
}
>
<span
diff --git a/apps/www/registry/magicui/warp-background.tsx b/apps/www/registry/magicui/warp-background.tsx
index 148762f4..9e05319d 100644
--- a/apps/www/registry/magicui/warp-background.tsx
+++ b/apps/www/registry/magicui/warp-background.tsx
@@ -40,7 +40,7 @@ const Beam = ({
"--background": `linear-gradient(hsl(${hue} 80% 60%), transparent)`,
} as React.CSSProperties
}
- className={`absolute top-0 left-[var(--x)] [aspect-ratio:1/var(--aspect-ratio)] [width:var(--width)] [background:var(--background)]`}
+ className={`absolute top-0 left-(--x) aspect-[1/var(--aspect-ratio)] w-(--width) [background:var(--background)]`}
initial={{ y: "100cqmax", x: "-50%" }}
animate={{ y: "-100%", x: "-50%" }}
transition={{
@@ -94,11 +94,11 @@ export const WarpBackground: React.FC<WarpBackgroundProps> = ({
} as React.CSSProperties
}
className={
- "[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]"
+ "@container-[size] pointer-events-none absolute top-0 left-0 size-full overflow-hidden [clipPath:inset(0)] perspective-(--perspective) transform-3d"
}
>
{/* top side */}
- <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]">
+ <div className="@container absolute z-20 h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d">
{topBeams.map((beam, index) => (
<Beam
key={`top-${index}`}
@@ -110,7 +110,7 @@ export const WarpBackground: React.FC<WarpBackgroundProps> = ({
))}
</div>
{/* bottom side */}
- <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]">
+ <div className="@container absolute top-full h-[100cqmax] w-[100cqi] origin-[50%_0%] transform-[rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d">
{bottomBeams.map((beam, index) => (
<Beam
key={`bottom-${index}`}
@@ -122,7 +122,7 @@ export const WarpBackground: React.FC<WarpBackgroundProps> = ({
))}
</div>
{/* left side */}
- <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]">
+ <div className="@container absolute top-0 left-0 h-[100cqmax] w-[100cqh] origin-[0%_0%] transform-[rotate(90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d">
{leftBeams.map((beam, index) => (
<Beam
key={`left-${index}`}
@@ -134,7 +134,7 @@ export const WarpBackground: React.FC<WarpBackgroundProps> = ({
))}
</div>
{/* right side */}
- <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]">
+ <div className="@container absolute top-0 right-0 h-[100cqmax] w-[100cqh] origin-[100%_0%] transform-[rotate(-90deg)_rotateX(-90deg)] bg-size-[var(--beam-size)_var(--beam-size)] [background:linear-gradient(var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_-0.5px_/var(--beam-size)_var(--beam-size),linear-gradient(90deg,var(--grid-color)_0_1px,transparent_1px_var(--beam-size))_50%_50%_/var(--beam-size)_var(--beam-size)] transform-3d">
{rightBeams.map((beam, index) => (
<Beam
key={`right-${index}`}