Skip to content

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

fix: migrate next lint to eslint. fix lint errors

Dillion Verma06c3ba29037e
diff --git a/apps/www/eslint.config.mjs b/apps/www/eslint.config.mjs
index 3b4d71d4..91e28de6 100644
--- a/apps/www/eslint.config.mjs
+++ b/apps/www/eslint.config.mjs
@@ -10,6 +10,16 @@ const compat = new FlatCompat({
})
const eslintConfig = [
+ {
+ ignores: [
+ "node_modules/**",
+ ".next/**",
+ "out/**",
+ "build/**",
+ "next-env.d.ts",
+ ".source/**",
+ ],
+ },
...compat.config({
extends: ["next/core-web-vitals", "next/typescript"],
rules: {
diff --git a/apps/www/middleware.ts b/apps/www/middleware.ts
index d4342331..b7d22280 100644
--- a/apps/www/middleware.ts
+++ b/apps/www/middleware.ts
@@ -1,7 +1,5 @@
-import type { NextRequest } from "next/server"
-
export const config = {
matcher: ["/((?!_next|api|[\\w-]+\\.\\w+).*)"],
}
-export default async function middleware(req: NextRequest) {}
+export default async function middleware() {}
diff --git a/apps/www/package.json b/apps/www/package.json
index 069add41..e65c3180 100644
--- a/apps/www/package.json
+++ b/apps/www/package.json
@@ -13,8 +13,8 @@
"shadcn:build": "npx shadcn build registry.json --output ../www/public/r",
"typecheck": "tsc --noEmit",
"start": "next start",
- "lint": "next lint",
- "lint:fix": "next lint --fix",
+ "lint": "eslint .",
+ "lint:fix": "eslint --fix .",
"format:fix": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache",
"check": "pnpm lint && pnpm typecheck && pnpm format:check"
@@ -74,6 +74,7 @@
"zod": "^4.1.11"
},
"devDependencies": {
+ "@eslint/eslintrc": "^3.3.1",
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
"@shikijs/transformers": "^2.5.0",
"@tailwindcss/typography": "^0.5.16",
diff --git a/apps/www/public/llms-full.txt b/apps/www/public/llms-full.txt
index 10e99970..d881c5a2 100644
--- a/apps/www/public/llms-full.txt
+++ b/apps/www/public/llms-full.txt
@@ -2353,7 +2353,7 @@ export interface AnimatedGridPatternProps
height?: number
x?: number
y?: number
- strokeDasharray?: any
+ strokeDasharray?: number
numSquares?: number
maxOpacity?: number
duration?: number
@@ -2370,7 +2370,6 @@ export function AnimatedGridPattern({
className,
maxOpacity = 0.5,
duration = 4,
- repeatDelay = 0.5,
...props
}: AnimatedGridPatternProps) {
const id = useId()
@@ -2412,12 +2411,12 @@ export function AnimatedGridPattern({
if (dimensions.width && dimensions.height) {
setSquares(generateSquares(numSquares))
}
- }, [dimensions, numSquares])
+ }, [dimensions, numSquares, generateSquares])
// Resize observer to update container dimensions
useEffect(() => {
const resizeObserver = new ResizeObserver((entries) => {
- for (let entry of entries) {
+ for (const entry of entries) {
setDimensions({
width: entry.contentRect.width,
height: entry.contentRect.height,
@@ -3853,7 +3852,7 @@ export const ClientTweetCard = ({
return <NotFound error={onError ? onError(error) : error} />
}
- return <MagicTweet tweet={data} components={components} {...props} />
+ return <MagicTweet tweet={data} {...props} />
}
@@ -4715,7 +4714,7 @@ export interface CoolParticleOptions extends BaseParticleOptions {
const getContainer = () => {
const id = "_coolMode_effect"
- let existingContainer = document.getElementById(id)
+ const existingContainer = document.getElementById(id)
if (existingContainer) {
return existingContainer
@@ -6094,8 +6093,6 @@ const useTree = () => {
return context
}
-interface TreeViewComponentProps extends React.HTMLAttributes<HTMLDivElement> {}
-
type Direction = "rtl" | "ltr" | undefined
type TreeViewProps = {
@@ -6105,7 +6102,7 @@ type TreeViewProps = {
initialExpandedItems?: string[]
openIcon?: React.ReactNode
closeIcon?: React.ReactNode
-} & TreeViewComponentProps
+} & React.HTMLAttributes<HTMLDivElement>
const Tree = forwardRef<HTMLDivElement, TreeViewProps>(
(
@@ -6251,15 +6248,12 @@ const TreeIndicator = forwardRef<
TreeIndicator.displayName = "TreeIndicator"
-interface FolderComponentProps
- extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {}
-
type FolderProps = {
expandedItems?: string[]
element: string
isSelectable?: boolean
isSelect?: boolean
-} & FolderComponentProps
+} & React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
const Folder = forwardRef<
HTMLDivElement,
@@ -8472,21 +8466,17 @@ Title: interactive-hover-button
Description: The interactive-hover-button component.
--- file: magicui/interactive-hover-button.tsx ---
-import React from "react"
import { ArrowRight } from "lucide-react"
import { cn } from "@/lib/utils"
-interface InteractiveHoverButtonProps
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {}
-
-export const InteractiveHoverButton = React.forwardRef<
- HTMLButtonElement,
- InteractiveHoverButtonProps
->(({ children, className, ...props }, ref) => {
+export function InteractiveHoverButton({
+ children,
+ className,
+ ...props
+}: React.ButtonHTMLAttributes<HTMLButtonElement>) {
return (
<button
- ref={ref}
className={cn(
"group bg-background relative w-auto cursor-pointer overflow-hidden rounded-full border p-2 px-6 text-center font-semibold",
className
@@ -8505,9 +8495,7 @@ export const InteractiveHoverButton = React.forwardRef<
</div>
</button>
)
-})
-
-InteractiveHoverButton.displayName = "InteractiveHoverButton"
+}
===== EXAMPLE: interactive-hover-button-demo =====
@@ -9044,27 +9032,18 @@ Description: A component with animated light rays which shine down from above.
--- file: magicui/light-rays.tsx ---
"use client"
-import {
- forwardRef,
- useEffect,
- useState,
- type CSSProperties,
- type HTMLAttributes,
- type ReactNode,
-} from "react"
+import { useEffect, useState, type CSSProperties } from "react"
import { motion } from "motion/react"
import { cn } from "@/lib/utils"
-export type LightRaysProps = Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
- children?: ReactNode
+interface LightRaysProps extends React.HTMLAttributes<HTMLDivElement> {
+ ref?: React.Ref<HTMLDivElement>
count?: number
color?: string
blur?: number
- opacity?: number
speed?: number
length?: string
- fill?: boolean
}
type LightRay = {
@@ -9137,77 +9116,69 @@ const Ray = ({
)
}
-export const LightRays = forwardRef<HTMLDivElement, LightRaysProps>(
- (
- {
- className,
- style,
- count = 7,
- color = "rgba(160, 210, 255, 0.2)",
- blur = 36,
- opacity = 0.65,
- speed = 14,
- length = "70vh",
- fill = true,
- ...props
- },
- ref
- ) => {
- const [rays, setRays] = useState<LightRay[]>([])
- const cycleDuration = Math.max(speed, 0.1)
+export function LightRays({
+ className,
+ style,
+ count = 7,
+ color = "rgba(160, 210, 255, 0.2)",
+ blur = 36,
+ speed = 14,
+ length = "70vh",
+ ref,
+ ...props
+}: LightRaysProps) {
+ const [rays, setRays] = useState<LightRay[]>([])
+ const cycleDuration = Math.max(speed, 0.1)
- useEffect(() => {
- setRays(createRays(count, cycleDuration))
- }, [count, cycleDuration])
+ useEffect(() => {
+ setRays(createRays(count, cycleDuration))
+ }, [count, cycleDuration])
- return (
- <div
- ref={ref}
- className={cn(
- "pointer-events-none absolute inset-0 isolate overflow-hidden rounded-[inherit]",
- className
- )}
- style={
- {
- "--light-rays-color": color,
- "--light-rays-blur": `${blur}px`,
- "--light-rays-length": length,
- ...style,
- } as CSSProperties
- }
- {...props}
- >
- <div className="absolute inset-0 overflow-hidden">
- <div
- aria-hidden
- className="absolute inset-0 opacity-60"
- style={
- {
- background:
- "radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--light-rays-color) 45%, transparent), transparent 70%)",
- } as CSSProperties
- }
- />
- <div
- aria-hidden
- className="absolute inset-0 opacity-60"
- style={
- {
- background:
- "radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--light-rays-color) 35%, transparent), transparent 75%)",
- } as CSSProperties
- }
- />
- {rays.map((ray) => (
- <Ray {...ray} />
- ))}
- </div>
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ "pointer-events-none absolute inset-0 isolate overflow-hidden rounded-[inherit]",
+ className
+ )}
+ style={
+ {
+ "--light-rays-color": color,
+ "--light-rays-blur": `${blur}px`,
+ "--light-rays-length": length,
+ ...style,
+ } as CSSProperties
+ }
+ {...props}
+ >
+ <div className="absolute inset-0 overflow-hidden">
+ <div
+ aria-hidden
+ className="absolute inset-0 opacity-60"
+ style={
+ {
+ background:
+ "radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--light-rays-color) 45%, transparent), transparent 70%)",
+ } as CSSProperties
+ }
+ />
+ <div
+ aria-hidden
+ className="absolute inset-0 opacity-60"
+ style={
+ {
+ background:
+ "radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--light-rays-color) 35%, transparent), transparent 75%)",
+ } as CSSProperties
+ }
+ />
+ {rays.map((ray) => (
+ <Ray key={ray.id} {...ray} />
+ ))}
</div>
- )
- }
-)
-
-LightRays.displayName = "LightRays"
+ </div>
+ )
+}
===== EXAMPLE: light-rays-demo =====
@@ -10337,7 +10308,7 @@ interface NeonColorsProps {
secondColor: string
}
-interface NeonGradientCardProps {
+interface NeonGradientCardProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* @default <div />
* @type ReactElement
@@ -10384,8 +10355,6 @@ interface NeonGradientCardProps {
* The colors of the neon gradient
* */
neonColors?: NeonColorsProps
-
- [key: string]: any
}
export const NeonGradientCard: React.FC<NeonGradientCardProps> = ({
@@ -11376,22 +11345,20 @@ import {
import { cn } from "@/lib/utils"
-interface PointerProps extends Omit<HTMLMotionProps<"div">, "ref"> {}
-
/**
* A custom pointer component that displays an animated cursor.
* Add this as a child to any component to enable a custom pointer when hovering.
* You can pass custom children to render as the pointer.
*
* @component
- * @param {PointerProps} props - The component props
+ * @param {HTMLMotionProps<"div">} props - The component props
*/
export function Pointer({
className,
style,
children,
...props
-}: PointerProps): React.ReactNode {
+}: HTMLMotionProps<"div">): React.ReactNode {
const x = useMotionValue(0)
const y = useMotionValue(0)
const [isActive, setIsActive] = useState<boolean>(false)
@@ -11816,9 +11783,6 @@ import { cva, VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
-interface RainbowButtonProps
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {}
-
const rainbowButtonVariants = cva(
cn(
"relative cursor-pointer group transition-all animate-rainbow",
@@ -12811,18 +12775,20 @@ Description: Animated Scroll Progress for your pages
--- file: magicui/scroll-progress.tsx ---
"use client"
-import React from "react"
import { motion, MotionProps, useScroll } from "motion/react"
import { cn } from "@/lib/utils"
interface ScrollProgressProps
- extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {}
+ extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {
+ ref?: React.Ref<HTMLDivElement>
+}
-export const ScrollProgress = React.forwardRef<
- HTMLDivElement,
- ScrollProgressProps
->(({ className, ...props }, ref) => {
+export function ScrollProgress({
+ className,
+ ref,
+ ...props
+}: ScrollProgressProps) {
const { scrollYProgress } = useScroll()
return (
@@ -12838,9 +12804,7 @@ export const ScrollProgress = React.forwardRef<
{...props}
/>
)
-})
-
-ScrollProgress.displayName = "ScrollProgress"
+}
===== EXAMPLE: scroll-progress-demo =====
@@ -14969,12 +14933,7 @@ Description: A card that displays a tweet with the author's name, handle, and pr
--- file: magicui/tweet-card.tsx ---
/* eslint-disable @next/next/no-img-element */
import { Suspense } from "react"
-import {
- enrichTweet,
- type EnrichedTweet,
- type TweetProps,
- type TwitterComponents,
-} from "react-tweet"
+import { enrichTweet, type EnrichedTweet, type TweetProps } from "react-tweet"
import { getTweet, type Tweet } from "react-tweet/api"
import { cn } from "@/lib/utils"
@@ -15182,11 +15141,11 @@ export const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => {
)}
{!tweet.video &&
!tweet.photos &&
- // @ts-ignore
+ // @ts-expect-error package doesn't have type definitions
tweet?.card?.binding_values?.thumbnail_image_large?.image_value.url && (
<img
src={
- // @ts-ignore
+ // @ts-expect-error package doesn't have type definitions
tweet.card.binding_values.thumbnail_image_large.image_value.url
}
className="h-64 rounded-xl border object-cover shadow-sm"
@@ -15199,12 +15158,10 @@ export const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => {
export const MagicTweet = ({
tweet,
- components,
className,
...props
}: {
tweet: Tweet
- components?: TwitterComponents
className?: string
}) => {
const enrichedTweet = enrichTweet(tweet)
@@ -15303,7 +15260,7 @@ Description: Characters appearing in typed animation
--- file: magicui/typing-animation.tsx ---
"use client"
-import { useEffect, useRef, useState } from "react"
+import { useEffect, useMemo, useRef, useState } from "react"
import { motion, MotionProps, useInView } from "motion/react"
import { cn } from "@/lib/utils"
@@ -15356,7 +15313,10 @@ export function TypingAnimation({
once: true,
})
- const wordsToAnimate = words || (children ? [children] : [])
+ const wordsToAnimate = useMemo(
+ () => words || (children ? [children] : []),
+ [words, children]
+ )
const hasMultipleWords = wordsToAnimate.length > 1
const typingSpeed = typeSpeed || duration
diff --git a/apps/www/public/r/animated-grid-pattern.json b/apps/www/public/r/animated-grid-pattern.json
index 329e7b19..3ff60f24 100644
--- a/apps/www/public/r/animated-grid-pattern.json
+++ b/apps/www/public/r/animated-grid-pattern.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/animated-grid-pattern.tsx",
- "content": "\"use client\"\n\nimport {\n ComponentPropsWithoutRef,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGridPatternProps\n extends ComponentPropsWithoutRef<\"svg\"> {\n width?: number\n height?: number\n x?: number\n y?: number\n strokeDasharray?: any\n numSquares?: number\n maxOpacity?: number\n duration?: number\n repeatDelay?: number\n}\n\nexport function AnimatedGridPattern({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n numSquares = 50,\n className,\n maxOpacity = 0.5,\n duration = 4,\n repeatDelay = 0.5,\n ...props\n}: AnimatedGridPatternProps) {\n const id = useId()\n const containerRef = useRef(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n const [squares, setSquares] = useState(() => generateSquares(numSquares))\n\n function getPos() {\n return [\n Math.floor((Math.random() * dimensions.width) / width),\n Math.floor((Math.random() * dimensions.height) / height),\n ]\n }\n\n // Adjust the generateSquares function to return objects with an id, x, and y\n function generateSquares(count: number) {\n return Array.from({ length: count }, (_, i) => ({\n id: i,\n pos: getPos(),\n }))\n }\n\n // Function to update a single square's position\n const updateSquarePosition = (id: number) => {\n setSquares((currentSquares) =>\n currentSquares.map((sq) =>\n sq.id === id\n ? {\n ...sq,\n pos: getPos(),\n }\n : sq\n )\n )\n }\n\n // Update squares to animate in\n useEffect(() => {\n if (dimensions.width && dimensions.height) {\n setSquares(generateSquares(numSquares))\n }\n }, [dimensions, numSquares])\n\n // Resize observer to update container dimensions\n useEffect(() => {\n const resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n setDimensions({\n width: entry.contentRect.width,\n height: entry.contentRect.height,\n })\n }\n })\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current)\n }\n\n return () => {\n if (containerRef.current) {\n resizeObserver.unobserve(containerRef.current)\n }\n }\n }, [containerRef])\n\n return (\n <svg\n ref={containerRef}\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30\",\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" fill={`url(#${id})`} />\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(({ pos: [x, y], id }, index) => (\n <motion.rect\n initial={{ opacity: 0 }}\n animate={{ opacity: maxOpacity }}\n transition={{\n duration,\n repeat: 1,\n delay: index * 0.1,\n repeatType: \"reverse\",\n }}\n onAnimationComplete={() => updateSquarePosition(id)}\n key={`${x}-${y}-${index}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n fill=\"currentColor\"\n strokeWidth=\"0\"\n />\n ))}\n </svg>\n </svg>\n )\n}\n",
+ "content": "\"use client\"\n\nimport {\n ComponentPropsWithoutRef,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface AnimatedGridPatternProps\n extends ComponentPropsWithoutRef<\"svg\"> {\n width?: number\n height?: number\n x?: number\n y?: number\n strokeDasharray?: number\n numSquares?: number\n maxOpacity?: number\n duration?: number\n repeatDelay?: number\n}\n\nexport function AnimatedGridPattern({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n numSquares = 50,\n className,\n maxOpacity = 0.5,\n duration = 4,\n ...props\n}: AnimatedGridPatternProps) {\n const id = useId()\n const containerRef = useRef(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n const [squares, setSquares] = useState(() => generateSquares(numSquares))\n\n function getPos() {\n return [\n Math.floor((Math.random() * dimensions.width) / width),\n Math.floor((Math.random() * dimensions.height) / height),\n ]\n }\n\n // Adjust the generateSquares function to return objects with an id, x, and y\n function generateSquares(count: number) {\n return Array.from({ length: count }, (_, i) => ({\n id: i,\n pos: getPos(),\n }))\n }\n\n // Function to update a single square's position\n const updateSquarePosition = (id: number) => {\n setSquares((currentSquares) =>\n currentSquares.map((sq) =>\n sq.id === id\n ? {\n ...sq,\n pos: getPos(),\n }\n : sq\n )\n )\n }\n\n // Update squares to animate in\n useEffect(() => {\n if (dimensions.width && dimensions.height) {\n setSquares(generateSquares(numSquares))\n }\n }, [dimensions, numSquares, generateSquares])\n\n // Resize observer to update container dimensions\n useEffect(() => {\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setDimensions({\n width: entry.contentRect.width,\n height: entry.contentRect.height,\n })\n }\n })\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current)\n }\n\n return () => {\n if (containerRef.current) {\n resizeObserver.unobserve(containerRef.current)\n }\n }\n }, [containerRef])\n\n return (\n <svg\n ref={containerRef}\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30\",\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" fill={`url(#${id})`} />\n <svg x={x} y={y} className=\"overflow-visible\">\n {squares.map(({ pos: [x, y], id }, index) => (\n <motion.rect\n initial={{ opacity: 0 }}\n animate={{ opacity: maxOpacity }}\n transition={{\n duration,\n repeat: 1,\n delay: index * 0.1,\n repeatType: \"reverse\",\n }}\n onAnimationComplete={() => updateSquarePosition(id)}\n key={`${x}-${y}-${index}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n fill=\"currentColor\"\n strokeWidth=\"0\"\n />\n ))}\n </svg>\n </svg>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/client-tweet-card.json b/apps/www/public/r/client-tweet-card.json
index 397d97a8..b48d0400 100644
--- a/apps/www/public/r/client-tweet-card.json
+++ b/apps/www/public/r/client-tweet-card.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/client-tweet-card.tsx",
- "content": "\"use client\"\n\nimport { TweetProps, useTweet } from \"react-tweet\"\n\nimport {\n MagicTweet,\n TweetNotFound,\n TweetSkeleton,\n} from \"@/registry/magicui/tweet-card\"\n\nexport const ClientTweetCard = ({\n id,\n apiUrl,\n fallback = <TweetSkeleton />,\n components,\n fetchOptions,\n onError,\n ...props\n}: TweetProps & { className?: string }) => {\n const { data, error, isLoading } = useTweet(id, apiUrl, fetchOptions)\n\n if (isLoading) return fallback\n if (error || !data) {\n const NotFound = components?.TweetNotFound || TweetNotFound\n return <NotFound error={onError ? onError(error) : error} />\n }\n\n return <MagicTweet tweet={data} components={components} {...props} />\n}\n",
+ "content": "\"use client\"\n\nimport { TweetProps, useTweet } from \"react-tweet\"\n\nimport {\n MagicTweet,\n TweetNotFound,\n TweetSkeleton,\n} from \"@/registry/magicui/tweet-card\"\n\nexport const ClientTweetCard = ({\n id,\n apiUrl,\n fallback = <TweetSkeleton />,\n components,\n fetchOptions,\n onError,\n ...props\n}: TweetProps & { className?: string }) => {\n const { data, error, isLoading } = useTweet(id, apiUrl, fetchOptions)\n\n if (isLoading) return fallback\n if (error || !data) {\n const NotFound = components?.TweetNotFound || TweetNotFound\n return <NotFound error={onError ? onError(error) : error} />\n }\n\n return <MagicTweet tweet={data} {...props} />\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/cool-mode.json b/apps/www/public/r/cool-mode.json
index 056966b8..b6c776b6 100644
--- a/apps/www/public/r/cool-mode.json
+++ b/apps/www/public/r/cool-mode.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/cool-mode.tsx",
- "content": "\"use client\"\n\nimport React, { ReactNode, useEffect, useRef } from \"react\"\n\nexport interface BaseParticle {\n element: HTMLElement | SVGSVGElement\n left: number\n size: number\n top: number\n}\n\nexport interface BaseParticleOptions {\n particle?: string\n size?: number\n}\n\nexport interface CoolParticle extends BaseParticle {\n direction: number\n speedHorz: number\n speedUp: number\n spinSpeed: number\n spinVal: number\n}\n\nexport interface CoolParticleOptions extends BaseParticleOptions {\n particleCount?: number\n speedHorz?: number\n speedUp?: number\n}\n\nconst getContainer = () => {\n const id = \"_coolMode_effect\"\n let existingContainer = document.getElementById(id)\n\n if (existingContainer) {\n return existingContainer\n }\n\n const container = document.createElement(\"div\")\n container.setAttribute(\"id\", id)\n container.setAttribute(\n \"style\",\n \"overflow:hidden; position:fixed; height:100%; top:0; left:0; right:0; bottom:0; pointer-events:none; z-index:2147483647\"\n )\n\n document.body.appendChild(container)\n\n return container\n}\n\nlet instanceCounter = 0\n\nconst applyParticleEffect = (\n element: HTMLElement,\n options?: CoolParticleOptions\n): (() => void) => {\n instanceCounter++\n\n const defaultParticle = \"circle\"\n const particleType = options?.particle || defaultParticle\n const sizes = [15, 20, 25, 35, 45]\n const limit = 45\n\n let particles: CoolParticle[] = []\n let autoAddParticle = false\n let mouseX = 0\n let mouseY = 0\n\n const container = getContainer()\n\n function generateParticle() {\n const size =\n options?.size || sizes[Math.floor(Math.random() * sizes.length)]\n const speedHorz = options?.speedHorz || Math.random() * 10\n const speedUp = options?.speedUp || Math.random() * 25\n const spinVal = Math.random() * 360\n const spinSpeed = Math.random() * 35 * (Math.random() <= 0.5 ? -1 : 1)\n const top = mouseY - size / 2\n const left = mouseX - size / 2\n const direction = Math.random() <= 0.5 ? -1 : 1\n\n const particle = document.createElement(\"div\")\n\n if (particleType === \"circle\") {\n const svgNS = \"http://www.w3.org/2000/svg\"\n const circleSVG = document.createElementNS(svgNS, \"svg\")\n const circle = document.createElementNS(svgNS, \"circle\")\n circle.setAttributeNS(null, \"cx\", (size / 2).toString())\n circle.setAttributeNS(null, \"cy\", (size / 2).toString())\n circle.setAttributeNS(null, \"r\", (size / 2).toString())\n circle.setAttributeNS(\n null,\n \"fill\",\n `hsl(${Math.random() * 360}, 70%, 50%)`\n )\n\n circleSVG.appendChild(circle)\n circleSVG.setAttribute(\"width\", size.toString())\n circleSVG.setAttribute(\"height\", size.toString())\n\n particle.appendChild(circleSVG)\n } else if (\n particleType.startsWith(\"http\") ||\n particleType.startsWith(\"/\")\n ) {\n // Handle URL-based images\n particle.innerHTML = `<img src=\"${particleType}\" width=\"${size}\" height=\"${size}\" style=\"border-radius: 50%\">`\n } else {\n // Handle emoji or text characters\n const fontSizeMultiplier = 3 // Make emojis 3x bigger\n const emojiSize = size * fontSizeMultiplier\n particle.innerHTML = `<div style=\"font-size: ${emojiSize}px; line-height: 1; text-align: center; width: ${size}px; height: ${size}px; display: flex; align-items: center; justify-content: center; transform: scale(${fontSizeMultiplier}); transform-origin: center;\">${particleType}</div>`\n }\n\n particle.style.position = \"absolute\"\n particle.style.transform = `translate3d(${left}px, ${top}px, 0px) rotate(${spinVal}deg)`\n\n container.appendChild(particle)\n\n particles.push({\n direction,\n element: particle,\n left,\n size,\n speedHorz,\n speedUp,\n spinSpeed,\n spinVal,\n top,\n })\n }\n\n function refreshParticles() {\n particles.forEach((p) => {\n p.left = p.left - p.speedHorz * p.direction\n p.top = p.top - p.speedUp\n p.speedUp = Math.min(p.size, p.speedUp - 1)\n p.spinVal = p.spinVal + p.spinSpeed\n\n if (\n p.top >=\n Math.max(window.innerHeight, document.body.clientHeight) + p.size\n ) {\n particles = particles.filter((o) => o !== p)\n p.element.remove()\n }\n\n p.element.setAttribute(\n \"style\",\n [\n \"position:absolute\",\n \"will-change:transform\",\n `top:${p.top}px`,\n `left:${p.left}px`,\n `transform:rotate(${p.spinVal}deg)`,\n ].join(\";\")\n )\n })\n }\n\n let animationFrame: number | undefined\n\n let lastParticleTimestamp = 0\n const particleGenerationDelay = 30\n\n function loop() {\n const currentTime = performance.now()\n if (\n autoAddParticle &&\n particles.length < limit &&\n currentTime - lastParticleTimestamp > particleGenerationDelay\n ) {\n generateParticle()\n lastParticleTimestamp = currentTime\n }\n\n refreshParticles()\n animationFrame = requestAnimationFrame(loop)\n }\n\n loop()\n\n const isTouchInteraction = \"ontouchstart\" in window\n\n const tap = isTouchInteraction ? \"touchstart\" : \"mousedown\"\n const tapEnd = isTouchInteraction ? \"touchend\" : \"mouseup\"\n const move = isTouchInteraction ? \"touchmove\" : \"mousemove\"\n\n const updateMousePosition = (e: MouseEvent | TouchEvent) => {\n if (\"touches\" in e) {\n mouseX = e.touches?.[0].clientX\n mouseY = e.touches?.[0].clientY\n } else {\n mouseX = e.clientX\n mouseY = e.clientY\n }\n }\n\n const tapHandler = (e: MouseEvent | TouchEvent) => {\n updateMousePosition(e)\n autoAddParticle = true\n }\n\n const disableAutoAddParticle = () => {\n autoAddParticle = false\n }\n\n element.addEventListener(move, updateMousePosition, { passive: true })\n element.addEventListener(tap, tapHandler, { passive: true })\n element.addEventListener(tapEnd, disableAutoAddParticle, { passive: true })\n element.addEventListener(\"mouseleave\", disableAutoAddParticle, {\n passive: true,\n })\n\n return () => {\n element.removeEventListener(move, updateMousePosition)\n element.removeEventListener(tap, tapHandler)\n element.removeEventListener(tapEnd, disableAutoAddParticle)\n element.removeEventListener(\"mouseleave\", disableAutoAddParticle)\n\n const interval = setInterval(() => {\n if (animationFrame && particles.length === 0) {\n cancelAnimationFrame(animationFrame)\n clearInterval(interval)\n\n if (--instanceCounter === 0) {\n container.remove()\n }\n }\n }, 500)\n }\n}\n\ninterface CoolModeProps {\n children: ReactNode\n options?: CoolParticleOptions\n}\n\nexport const CoolMode: React.FC<CoolModeProps> = ({ children, options }) => {\n const ref = useRef<HTMLSpanElement>(null)\n\n useEffect(() => {\n if (ref.current) {\n return applyParticleEffect(ref.current, options)\n }\n }, [options])\n\n return <span ref={ref}>{children}</span>\n}\n",
+ "content": "\"use client\"\n\nimport React, { ReactNode, useEffect, useRef } from \"react\"\n\nexport interface BaseParticle {\n element: HTMLElement | SVGSVGElement\n left: number\n size: number\n top: number\n}\n\nexport interface BaseParticleOptions {\n particle?: string\n size?: number\n}\n\nexport interface CoolParticle extends BaseParticle {\n direction: number\n speedHorz: number\n speedUp: number\n spinSpeed: number\n spinVal: number\n}\n\nexport interface CoolParticleOptions extends BaseParticleOptions {\n particleCount?: number\n speedHorz?: number\n speedUp?: number\n}\n\nconst getContainer = () => {\n const id = \"_coolMode_effect\"\n const existingContainer = document.getElementById(id)\n\n if (existingContainer) {\n return existingContainer\n }\n\n const container = document.createElement(\"div\")\n container.setAttribute(\"id\", id)\n container.setAttribute(\n \"style\",\n \"overflow:hidden; position:fixed; height:100%; top:0; left:0; right:0; bottom:0; pointer-events:none; z-index:2147483647\"\n )\n\n document.body.appendChild(container)\n\n return container\n}\n\nlet instanceCounter = 0\n\nconst applyParticleEffect = (\n element: HTMLElement,\n options?: CoolParticleOptions\n): (() => void) => {\n instanceCounter++\n\n const defaultParticle = \"circle\"\n const particleType = options?.particle || defaultParticle\n const sizes = [15, 20, 25, 35, 45]\n const limit = 45\n\n let particles: CoolParticle[] = []\n let autoAddParticle = false\n let mouseX = 0\n let mouseY = 0\n\n const container = getContainer()\n\n function generateParticle() {\n const size =\n options?.size || sizes[Math.floor(Math.random() * sizes.length)]\n const speedHorz = options?.speedHorz || Math.random() * 10\n const speedUp = options?.speedUp || Math.random() * 25\n const spinVal = Math.random() * 360\n const spinSpeed = Math.random() * 35 * (Math.random() <= 0.5 ? -1 : 1)\n const top = mouseY - size / 2\n const left = mouseX - size / 2\n const direction = Math.random() <= 0.5 ? -1 : 1\n\n const particle = document.createElement(\"div\")\n\n if (particleType === \"circle\") {\n const svgNS = \"http://www.w3.org/2000/svg\"\n const circleSVG = document.createElementNS(svgNS, \"svg\")\n const circle = document.createElementNS(svgNS, \"circle\")\n circle.setAttributeNS(null, \"cx\", (size / 2).toString())\n circle.setAttributeNS(null, \"cy\", (size / 2).toString())\n circle.setAttributeNS(null, \"r\", (size / 2).toString())\n circle.setAttributeNS(\n null,\n \"fill\",\n `hsl(${Math.random() * 360}, 70%, 50%)`\n )\n\n circleSVG.appendChild(circle)\n circleSVG.setAttribute(\"width\", size.toString())\n circleSVG.setAttribute(\"height\", size.toString())\n\n particle.appendChild(circleSVG)\n } else if (\n particleType.startsWith(\"http\") ||\n particleType.startsWith(\"/\")\n ) {\n // Handle URL-based images\n particle.innerHTML = `<img src=\"${particleType}\" width=\"${size}\" height=\"${size}\" style=\"border-radius: 50%\">`\n } else {\n // Handle emoji or text characters\n const fontSizeMultiplier = 3 // Make emojis 3x bigger\n const emojiSize = size * fontSizeMultiplier\n particle.innerHTML = `<div style=\"font-size: ${emojiSize}px; line-height: 1; text-align: center; width: ${size}px; height: ${size}px; display: flex; align-items: center; justify-content: center; transform: scale(${fontSizeMultiplier}); transform-origin: center;\">${particleType}</div>`\n }\n\n particle.style.position = \"absolute\"\n particle.style.transform = `translate3d(${left}px, ${top}px, 0px) rotate(${spinVal}deg)`\n\n container.appendChild(particle)\n\n particles.push({\n direction,\n element: particle,\n left,\n size,\n speedHorz,\n speedUp,\n spinSpeed,\n spinVal,\n top,\n })\n }\n\n function refreshParticles() {\n particles.forEach((p) => {\n p.left = p.left - p.speedHorz * p.direction\n p.top = p.top - p.speedUp\n p.speedUp = Math.min(p.size, p.speedUp - 1)\n p.spinVal = p.spinVal + p.spinSpeed\n\n if (\n p.top >=\n Math.max(window.innerHeight, document.body.clientHeight) + p.size\n ) {\n particles = particles.filter((o) => o !== p)\n p.element.remove()\n }\n\n p.element.setAttribute(\n \"style\",\n [\n \"position:absolute\",\n \"will-change:transform\",\n `top:${p.top}px`,\n `left:${p.left}px`,\n `transform:rotate(${p.spinVal}deg)`,\n ].join(\";\")\n )\n })\n }\n\n let animationFrame: number | undefined\n\n let lastParticleTimestamp = 0\n const particleGenerationDelay = 30\n\n function loop() {\n const currentTime = performance.now()\n if (\n autoAddParticle &&\n particles.length < limit &&\n currentTime - lastParticleTimestamp > particleGenerationDelay\n ) {\n generateParticle()\n lastParticleTimestamp = currentTime\n }\n\n refreshParticles()\n animationFrame = requestAnimationFrame(loop)\n }\n\n loop()\n\n const isTouchInteraction = \"ontouchstart\" in window\n\n const tap = isTouchInteraction ? \"touchstart\" : \"mousedown\"\n const tapEnd = isTouchInteraction ? \"touchend\" : \"mouseup\"\n const move = isTouchInteraction ? \"touchmove\" : \"mousemove\"\n\n const updateMousePosition = (e: MouseEvent | TouchEvent) => {\n if (\"touches\" in e) {\n mouseX = e.touches?.[0].clientX\n mouseY = e.touches?.[0].clientY\n } else {\n mouseX = e.clientX\n mouseY = e.clientY\n }\n }\n\n const tapHandler = (e: MouseEvent | TouchEvent) => {\n updateMousePosition(e)\n autoAddParticle = true\n }\n\n const disableAutoAddParticle = () => {\n autoAddParticle = false\n }\n\n element.addEventListener(move, updateMousePosition, { passive: true })\n element.addEventListener(tap, tapHandler, { passive: true })\n element.addEventListener(tapEnd, disableAutoAddParticle, { passive: true })\n element.addEventListener(\"mouseleave\", disableAutoAddParticle, {\n passive: true,\n })\n\n return () => {\n element.removeEventListener(move, updateMousePosition)\n element.removeEventListener(tap, tapHandler)\n element.removeEventListener(tapEnd, disableAutoAddParticle)\n element.removeEventListener(\"mouseleave\", disableAutoAddParticle)\n\n const interval = setInterval(() => {\n if (animationFrame && particles.length === 0) {\n cancelAnimationFrame(animationFrame)\n clearInterval(interval)\n\n if (--instanceCounter === 0) {\n container.remove()\n }\n }\n }, 500)\n }\n}\n\ninterface CoolModeProps {\n children: ReactNode\n options?: CoolParticleOptions\n}\n\nexport const CoolMode: React.FC<CoolModeProps> = ({ children, options }) => {\n const ref = useRef<HTMLSpanElement>(null)\n\n useEffect(() => {\n if (ref.current) {\n return applyParticleEffect(ref.current, options)\n }\n }, [options])\n\n return <span ref={ref}>{children}</span>\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/file-tree.json b/apps/www/public/r/file-tree.json
index 6e7603d0..f984d47c 100644
--- a/apps/www/public/r/file-tree.json
+++ b/apps/www/public/r/file-tree.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/file-tree.tsx",
- "content": "\"use client\"\n\nimport React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { FileIcon, FolderIcon, FolderOpenIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { ScrollArea } from \"@/components/ui/scroll-area\"\n\ntype TreeViewElement = {\n id: string\n name: string\n isSelectable?: boolean\n children?: TreeViewElement[]\n}\n\ntype TreeContextProps = {\n selectedId: string | undefined\n expandedItems: string[] | undefined\n indicator: boolean\n handleExpand: (id: string) => void\n selectItem: (id: string) => void\n setExpandedItems?: React.Dispatch<React.SetStateAction<string[] | undefined>>\n openIcon?: React.ReactNode\n closeIcon?: React.ReactNode\n direction: \"rtl\" | \"ltr\"\n}\n\nconst TreeContext = createContext<TreeContextProps | null>(null)\n\nconst useTree = () => {\n const context = useContext(TreeContext)\n if (!context) {\n throw new Error(\"useTree must be used within a TreeProvider\")\n }\n return context\n}\n\ninterface TreeViewComponentProps extends React.HTMLAttributes<HTMLDivElement> {}\n\ntype Direction = \"rtl\" | \"ltr\" | undefined\n\ntype TreeViewProps = {\n initialSelectedId?: string\n indicator?: boolean\n elements?: TreeViewElement[]\n initialExpandedItems?: string[]\n openIcon?: React.ReactNode\n closeIcon?: React.ReactNode\n} & TreeViewComponentProps\n\nconst Tree = forwardRef<HTMLDivElement, TreeViewProps>(\n (\n {\n className,\n elements,\n initialSelectedId,\n initialExpandedItems,\n children,\n indicator = true,\n openIcon,\n closeIcon,\n dir,\n ...props\n },\n ref\n ) => {\n const [selectedId, setSelectedId] = useState<string | undefined>(\n initialSelectedId\n )\n const [expandedItems, setExpandedItems] = useState<string[] | undefined>(\n initialExpandedItems\n )\n\n const selectItem = useCallback((id: string) => {\n setSelectedId(id)\n }, [])\n\n const handleExpand = useCallback((id: string) => {\n setExpandedItems((prev) => {\n if (prev?.includes(id)) {\n return prev.filter((item) => item !== id)\n }\n return [...(prev ?? []), id]\n })\n }, [])\n\n const expandSpecificTargetedElements = useCallback(\n (elements?: TreeViewElement[], selectId?: string) => {\n if (!elements || !selectId) return\n const findParent = (\n currentElement: TreeViewElement,\n currentPath: string[] = []\n ) => {\n const isSelectable = currentElement.isSelectable ?? true\n const newPath = [...currentPath, currentElement.id]\n if (currentElement.id === selectId) {\n if (isSelectable) {\n setExpandedItems((prev) => [...(prev ?? []), ...newPath])\n } else {\n if (newPath.includes(currentElement.id)) {\n newPath.pop()\n setExpandedItems((prev) => [...(prev ?? []), ...newPath])\n }\n }\n return\n }\n if (\n isSelectable &&\n currentElement.children &&\n currentElement.children.length > 0\n ) {\n currentElement.children.forEach((child) => {\n findParent(child, newPath)\n })\n }\n }\n elements.forEach((element) => {\n findParent(element)\n })\n },\n []\n )\n\n useEffect(() => {\n if (initialSelectedId) {\n expandSpecificTargetedElements(elements, initialSelectedId)\n }\n }, [initialSelectedId, elements])\n\n const direction = dir === \"rtl\" ? \"rtl\" : \"ltr\"\n\n return (\n <TreeContext.Provider\n value={{\n selectedId,\n expandedItems,\n handleExpand,\n selectItem,\n setExpandedItems,\n indicator,\n openIcon,\n closeIcon,\n direction,\n }}\n >\n <div className={cn(\"size-full\", className)}>\n <ScrollArea\n ref={ref}\n className=\"relative h-full px-2\"\n dir={dir as Direction}\n >\n <AccordionPrimitive.Root\n {...props}\n type=\"multiple\"\n defaultValue={expandedItems}\n value={expandedItems}\n className=\"flex flex-col gap-1\"\n onValueChange={(value) =>\n setExpandedItems((prev) => [...(prev ?? []), value[0]])\n }\n dir={dir as Direction}\n >\n {children}\n </AccordionPrimitive.Root>\n </ScrollArea>\n </div>\n </TreeContext.Provider>\n )\n }\n)\n\nTree.displayName = \"Tree\"\n\nconst TreeIndicator = forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { direction } = useTree()\n\n return (\n <div\n dir={direction}\n ref={ref}\n className={cn(\n \"bg-muted absolute left-1.5 h-full w-px rounded-md py-3 duration-300 ease-in-out hover:bg-slate-300 rtl:right-1.5\",\n className\n )}\n {...props}\n />\n )\n})\n\nTreeIndicator.displayName = \"TreeIndicator\"\n\ninterface FolderComponentProps\n extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {}\n\ntype FolderProps = {\n expandedItems?: string[]\n element: string\n isSelectable?: boolean\n isSelect?: boolean\n} & FolderComponentProps\n\nconst Folder = forwardRef<\n HTMLDivElement,\n FolderProps & React.HTMLAttributes<HTMLDivElement>\n>(\n (\n {\n className,\n element,\n value,\n isSelectable = true,\n isSelect,\n children,\n ...props\n },\n ref\n ) => {\n const {\n direction,\n handleExpand,\n expandedItems,\n indicator,\n setExpandedItems,\n openIcon,\n closeIcon,\n } = useTree()\n\n return (\n <AccordionPrimitive.Item\n {...props}\n value={value}\n className=\"relative h-full overflow-hidden\"\n >\n <AccordionPrimitive.Trigger\n className={cn(\n `flex items-center gap-1 rounded-md text-sm`,\n className,\n {\n \"bg-muted rounded-md\": isSelect && isSelectable,\n \"cursor-pointer\": isSelectable,\n \"cursor-not-allowed opacity-50\": !isSelectable,\n }\n )}\n disabled={!isSelectable}\n onClick={() => handleExpand(value)}\n >\n {expandedItems?.includes(value)\n ? (openIcon ?? <FolderOpenIcon className=\"size-4\" />)\n : (closeIcon ?? <FolderIcon className=\"size-4\" />)}\n <span>{element}</span>\n </AccordionPrimitive.Trigger>\n <AccordionPrimitive.Content className=\"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down relative h-full overflow-hidden text-sm\">\n {element && indicator && <TreeIndicator aria-hidden=\"true\" />}\n <AccordionPrimitive.Root\n dir={direction}\n type=\"multiple\"\n className=\"ml-5 flex flex-col gap-1 py-1 rtl:mr-5\"\n defaultValue={expandedItems}\n value={expandedItems}\n onValueChange={(value) => {\n setExpandedItems?.((prev) => [...(prev ?? []), value[0]])\n }}\n >\n {children}\n </AccordionPrimitive.Root>\n </AccordionPrimitive.Content>\n </AccordionPrimitive.Item>\n )\n }\n)\n\nFolder.displayName = \"Folder\"\n\nconst File = forwardRef<\n HTMLButtonElement,\n {\n value: string\n handleSelect?: (id: string) => void\n isSelectable?: boolean\n isSelect?: boolean\n fileIcon?: React.ReactNode\n } & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(\n (\n {\n value,\n className,\n handleSelect,\n isSelectable = true,\n isSelect,\n fileIcon,\n children,\n ...props\n },\n ref\n ) => {\n const { direction, selectedId, selectItem } = useTree()\n const isSelected = isSelect ?? selectedId === value\n return (\n <button\n ref={ref}\n type=\"button\"\n disabled={!isSelectable}\n className={cn(\n \"flex w-fit items-center gap-1 rounded-md pr-1 text-sm duration-200 ease-in-out rtl:pr-0 rtl:pl-1\",\n {\n \"bg-muted\": isSelected && isSelectable,\n },\n isSelectable ? \"cursor-pointer\" : \"cursor-not-allowed opacity-50\",\n direction === \"rtl\" ? \"rtl\" : \"ltr\",\n className\n )}\n onClick={() => selectItem(value)}\n {...props}\n >\n {fileIcon ?? <FileIcon className=\"size-4\" />}\n {children}\n </button>\n )\n }\n)\n\nFile.displayName = \"File\"\n\nconst CollapseButton = forwardRef<\n HTMLButtonElement,\n {\n elements: TreeViewElement[]\n expandAll?: boolean\n } & React.HTMLAttributes<HTMLButtonElement>\n>(({ className, elements, expandAll = false, children, ...props }, ref) => {\n const { expandedItems, setExpandedItems } = useTree()\n\n const expendAllTree = useCallback((elements: TreeViewElement[]) => {\n const expandTree = (element: TreeViewElement) => {\n const isSelectable = element.isSelectable ?? true\n if (isSelectable && element.children && element.children.length > 0) {\n setExpandedItems?.((prev) => [...(prev ?? []), element.id])\n element.children.forEach(expandTree)\n }\n }\n\n elements.forEach(expandTree)\n }, [])\n\n const closeAll = useCallback(() => {\n setExpandedItems?.([])\n }, [])\n\n useEffect(() => {\n console.log(expandAll)\n if (expandAll) {\n expendAllTree(elements)\n }\n }, [expandAll])\n\n return (\n <Button\n variant={\"ghost\"}\n className=\"absolute right-2 bottom-1 h-8 w-fit p-1\"\n onClick={\n expandedItems && expandedItems.length > 0\n ? closeAll\n : () => expendAllTree(elements)\n }\n ref={ref}\n {...props}\n >\n {children}\n <span className=\"sr-only\">Toggle</span>\n </Button>\n )\n})\n\nCollapseButton.displayName = \"CollapseButton\"\n\nexport { CollapseButton, File, Folder, Tree, type TreeViewElement }\n",
+ "content": "\"use client\"\n\nimport React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useState,\n} from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { FileIcon, FolderIcon, FolderOpenIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { ScrollArea } from \"@/components/ui/scroll-area\"\n\ntype TreeViewElement = {\n id: string\n name: string\n isSelectable?: boolean\n children?: TreeViewElement[]\n}\n\ntype TreeContextProps = {\n selectedId: string | undefined\n expandedItems: string[] | undefined\n indicator: boolean\n handleExpand: (id: string) => void\n selectItem: (id: string) => void\n setExpandedItems?: React.Dispatch<React.SetStateAction<string[] | undefined>>\n openIcon?: React.ReactNode\n closeIcon?: React.ReactNode\n direction: \"rtl\" | \"ltr\"\n}\n\nconst TreeContext = createContext<TreeContextProps | null>(null)\n\nconst useTree = () => {\n const context = useContext(TreeContext)\n if (!context) {\n throw new Error(\"useTree must be used within a TreeProvider\")\n }\n return context\n}\n\ntype Direction = \"rtl\" | \"ltr\" | undefined\n\ntype TreeViewProps = {\n initialSelectedId?: string\n indicator?: boolean\n elements?: TreeViewElement[]\n initialExpandedItems?: string[]\n openIcon?: React.ReactNode\n closeIcon?: React.ReactNode\n} & React.HTMLAttributes<HTMLDivElement>\n\nconst Tree = forwardRef<HTMLDivElement, TreeViewProps>(\n (\n {\n className,\n elements,\n initialSelectedId,\n initialExpandedItems,\n children,\n indicator = true,\n openIcon,\n closeIcon,\n dir,\n ...props\n },\n ref\n ) => {\n const [selectedId, setSelectedId] = useState<string | undefined>(\n initialSelectedId\n )\n const [expandedItems, setExpandedItems] = useState<string[] | undefined>(\n initialExpandedItems\n )\n\n const selectItem = useCallback((id: string) => {\n setSelectedId(id)\n }, [])\n\n const handleExpand = useCallback((id: string) => {\n setExpandedItems((prev) => {\n if (prev?.includes(id)) {\n return prev.filter((item) => item !== id)\n }\n return [...(prev ?? []), id]\n })\n }, [])\n\n const expandSpecificTargetedElements = useCallback(\n (elements?: TreeViewElement[], selectId?: string) => {\n if (!elements || !selectId) return\n const findParent = (\n currentElement: TreeViewElement,\n currentPath: string[] = []\n ) => {\n const isSelectable = currentElement.isSelectable ?? true\n const newPath = [...currentPath, currentElement.id]\n if (currentElement.id === selectId) {\n if (isSelectable) {\n setExpandedItems((prev) => [...(prev ?? []), ...newPath])\n } else {\n if (newPath.includes(currentElement.id)) {\n newPath.pop()\n setExpandedItems((prev) => [...(prev ?? []), ...newPath])\n }\n }\n return\n }\n if (\n isSelectable &&\n currentElement.children &&\n currentElement.children.length > 0\n ) {\n currentElement.children.forEach((child) => {\n findParent(child, newPath)\n })\n }\n }\n elements.forEach((element) => {\n findParent(element)\n })\n },\n []\n )\n\n useEffect(() => {\n if (initialSelectedId) {\n expandSpecificTargetedElements(elements, initialSelectedId)\n }\n }, [initialSelectedId, elements])\n\n const direction = dir === \"rtl\" ? \"rtl\" : \"ltr\"\n\n return (\n <TreeContext.Provider\n value={{\n selectedId,\n expandedItems,\n handleExpand,\n selectItem,\n setExpandedItems,\n indicator,\n openIcon,\n closeIcon,\n direction,\n }}\n >\n <div className={cn(\"size-full\", className)}>\n <ScrollArea\n ref={ref}\n className=\"relative h-full px-2\"\n dir={dir as Direction}\n >\n <AccordionPrimitive.Root\n {...props}\n type=\"multiple\"\n defaultValue={expandedItems}\n value={expandedItems}\n className=\"flex flex-col gap-1\"\n onValueChange={(value) =>\n setExpandedItems((prev) => [...(prev ?? []), value[0]])\n }\n dir={dir as Direction}\n >\n {children}\n </AccordionPrimitive.Root>\n </ScrollArea>\n </div>\n </TreeContext.Provider>\n )\n }\n)\n\nTree.displayName = \"Tree\"\n\nconst TreeIndicator = forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { direction } = useTree()\n\n return (\n <div\n dir={direction}\n ref={ref}\n className={cn(\n \"bg-muted absolute left-1.5 h-full w-px rounded-md py-3 duration-300 ease-in-out hover:bg-slate-300 rtl:right-1.5\",\n className\n )}\n {...props}\n />\n )\n})\n\nTreeIndicator.displayName = \"TreeIndicator\"\n\ntype FolderProps = {\n expandedItems?: string[]\n element: string\n isSelectable?: boolean\n isSelect?: boolean\n} & React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n\nconst Folder = forwardRef<\n HTMLDivElement,\n FolderProps & React.HTMLAttributes<HTMLDivElement>\n>(\n (\n {\n className,\n element,\n value,\n isSelectable = true,\n isSelect,\n children,\n ...props\n },\n ref\n ) => {\n const {\n direction,\n handleExpand,\n expandedItems,\n indicator,\n setExpandedItems,\n openIcon,\n closeIcon,\n } = useTree()\n\n return (\n <AccordionPrimitive.Item\n {...props}\n value={value}\n className=\"relative h-full overflow-hidden\"\n >\n <AccordionPrimitive.Trigger\n className={cn(\n `flex items-center gap-1 rounded-md text-sm`,\n className,\n {\n \"bg-muted rounded-md\": isSelect && isSelectable,\n \"cursor-pointer\": isSelectable,\n \"cursor-not-allowed opacity-50\": !isSelectable,\n }\n )}\n disabled={!isSelectable}\n onClick={() => handleExpand(value)}\n >\n {expandedItems?.includes(value)\n ? (openIcon ?? <FolderOpenIcon className=\"size-4\" />)\n : (closeIcon ?? <FolderIcon className=\"size-4\" />)}\n <span>{element}</span>\n </AccordionPrimitive.Trigger>\n <AccordionPrimitive.Content className=\"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down relative h-full overflow-hidden text-sm\">\n {element && indicator && <TreeIndicator aria-hidden=\"true\" />}\n <AccordionPrimitive.Root\n dir={direction}\n type=\"multiple\"\n className=\"ml-5 flex flex-col gap-1 py-1 rtl:mr-5\"\n defaultValue={expandedItems}\n value={expandedItems}\n onValueChange={(value) => {\n setExpandedItems?.((prev) => [...(prev ?? []), value[0]])\n }}\n >\n {children}\n </AccordionPrimitive.Root>\n </AccordionPrimitive.Content>\n </AccordionPrimitive.Item>\n )\n }\n)\n\nFolder.displayName = \"Folder\"\n\nconst File = forwardRef<\n HTMLButtonElement,\n {\n value: string\n handleSelect?: (id: string) => void\n isSelectable?: boolean\n isSelect?: boolean\n fileIcon?: React.ReactNode\n } & React.ButtonHTMLAttributes<HTMLButtonElement>\n>(\n (\n {\n value,\n className,\n handleSelect,\n isSelectable = true,\n isSelect,\n fileIcon,\n children,\n ...props\n },\n ref\n ) => {\n const { direction, selectedId, selectItem } = useTree()\n const isSelected = isSelect ?? selectedId === value\n return (\n <button\n ref={ref}\n type=\"button\"\n disabled={!isSelectable}\n className={cn(\n \"flex w-fit items-center gap-1 rounded-md pr-1 text-sm duration-200 ease-in-out rtl:pr-0 rtl:pl-1\",\n {\n \"bg-muted\": isSelected && isSelectable,\n },\n isSelectable ? \"cursor-pointer\" : \"cursor-not-allowed opacity-50\",\n direction === \"rtl\" ? \"rtl\" : \"ltr\",\n className\n )}\n onClick={() => selectItem(value)}\n {...props}\n >\n {fileIcon ?? <FileIcon className=\"size-4\" />}\n {children}\n </button>\n )\n }\n)\n\nFile.displayName = \"File\"\n\nconst CollapseButton = forwardRef<\n HTMLButtonElement,\n {\n elements: TreeViewElement[]\n expandAll?: boolean\n } & React.HTMLAttributes<HTMLButtonElement>\n>(({ className, elements, expandAll = false, children, ...props }, ref) => {\n const { expandedItems, setExpandedItems } = useTree()\n\n const expendAllTree = useCallback((elements: TreeViewElement[]) => {\n const expandTree = (element: TreeViewElement) => {\n const isSelectable = element.isSelectable ?? true\n if (isSelectable && element.children && element.children.length > 0) {\n setExpandedItems?.((prev) => [...(prev ?? []), element.id])\n element.children.forEach(expandTree)\n }\n }\n\n elements.forEach(expandTree)\n }, [])\n\n const closeAll = useCallback(() => {\n setExpandedItems?.([])\n }, [])\n\n useEffect(() => {\n console.log(expandAll)\n if (expandAll) {\n expendAllTree(elements)\n }\n }, [expandAll])\n\n return (\n <Button\n variant={\"ghost\"}\n className=\"absolute right-2 bottom-1 h-8 w-fit p-1\"\n onClick={\n expandedItems && expandedItems.length > 0\n ? closeAll\n : () => expendAllTree(elements)\n }\n ref={ref}\n {...props}\n >\n {children}\n <span className=\"sr-only\">Toggle</span>\n </Button>\n )\n})\n\nCollapseButton.displayName = \"CollapseButton\"\n\nexport { CollapseButton, File, Folder, Tree, type TreeViewElement }\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/interactive-hover-button.json b/apps/www/public/r/interactive-hover-button.json
index 79ef3485..d1f0b48e 100644
--- a/apps/www/public/r/interactive-hover-button.json
+++ b/apps/www/public/r/interactive-hover-button.json
@@ -5,7 +5,7 @@
"files": [
{
"path": "registry/magicui/interactive-hover-button.tsx",
- "content": "import React from \"react\"\nimport { ArrowRight } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface InteractiveHoverButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const InteractiveHoverButton = React.forwardRef<\n HTMLButtonElement,\n InteractiveHoverButtonProps\n>(({ children, className, ...props }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(\n \"group bg-background relative w-auto cursor-pointer overflow-hidden rounded-full border p-2 px-6 text-center font-semibold\",\n className\n )}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"bg-primary h-2 w-2 rounded-full transition-all duration-300 group-hover:scale-[100.8]\"></div>\n <span className=\"inline-block transition-all duration-300 group-hover:translate-x-12 group-hover:opacity-0\">\n {children}\n </span>\n </div>\n <div className=\"text-primary-foreground absolute top-0 z-10 flex h-full w-full translate-x-12 items-center justify-center gap-2 opacity-0 transition-all duration-300 group-hover:-translate-x-5 group-hover:opacity-100\">\n <span>{children}</span>\n <ArrowRight />\n </div>\n </button>\n )\n})\n\nInteractiveHoverButton.displayName = \"InteractiveHoverButton\"\n",
+ "content": "import { ArrowRight } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport function InteractiveHoverButton({\n children,\n className,\n ...props\n}: React.ButtonHTMLAttributes<HTMLButtonElement>) {\n return (\n <button\n className={cn(\n \"group bg-background relative w-auto cursor-pointer overflow-hidden rounded-full border p-2 px-6 text-center font-semibold\",\n className\n )}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"bg-primary h-2 w-2 rounded-full transition-all duration-300 group-hover:scale-[100.8]\"></div>\n <span className=\"inline-block transition-all duration-300 group-hover:translate-x-12 group-hover:opacity-0\">\n {children}\n </span>\n </div>\n <div className=\"text-primary-foreground absolute top-0 z-10 flex h-full w-full translate-x-12 items-center justify-center gap-2 opacity-0 transition-all duration-300 group-hover:-translate-x-5 group-hover:opacity-100\">\n <span>{children}</span>\n <ArrowRight />\n </div>\n </button>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/light-rays.json b/apps/www/public/r/light-rays.json
index 58bd6f75..3fb7ae8a 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 {\n forwardRef,\n useEffect,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\"\nimport { motion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport type LightRaysProps = Omit<HTMLAttributes<HTMLDivElement>, \"color\"> & {\n children?: ReactNode\n count?: number\n color?: string\n blur?: number\n opacity?: number\n speed?: number\n length?: string\n fill?: boolean\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 const LightRays = forwardRef<HTMLDivElement, LightRaysProps>(\n (\n {\n className,\n style,\n count = 7,\n color = \"rgba(160, 210, 255, 0.2)\",\n blur = 36,\n opacity = 0.65,\n speed = 14,\n length = \"70vh\",\n fill = true,\n ...props\n },\n ref\n ) => {\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 {...ray} />\n ))}\n </div>\n </div>\n )\n }\n)\n\nLightRays.displayName = \"LightRays\"\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-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",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/neon-gradient-card.json b/apps/www/public/r/neon-gradient-card.json
index c69abe57..f9796699 100644
--- a/apps/www/public/r/neon-gradient-card.json
+++ b/apps/www/public/r/neon-gradient-card.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/neon-gradient-card.tsx",
- "content": "\"use client\"\n\nimport {\n CSSProperties,\n ReactElement,\n ReactNode,\n useEffect,\n useRef,\n useState,\n} from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface NeonColorsProps {\n firstColor: string\n secondColor: string\n}\n\ninterface NeonGradientCardProps {\n /**\n * @default <div />\n * @type ReactElement\n * @description\n * The component to be rendered as the card\n * */\n as?: ReactElement\n /**\n * @default \"\"\n * @type string\n * @description\n * The className of the card\n */\n className?: string\n\n /**\n * @default \"\"\n * @type ReactNode\n * @description\n * The children of the card\n * */\n children?: ReactNode\n\n /**\n * @default 5\n * @type number\n * @description\n * The size of the border in pixels\n * */\n borderSize?: number\n\n /**\n * @default 20\n * @type number\n * @description\n * The size of the radius in pixels\n * */\n borderRadius?: number\n\n /**\n * @default \"{ firstColor: '#ff00aa', secondColor: '#00FFF1' }\"\n * @type string\n * @description\n * The colors of the neon gradient\n * */\n neonColors?: NeonColorsProps\n\n [key: string]: any\n}\n\nexport const NeonGradientCard: React.FC<NeonGradientCardProps> = ({\n className,\n children,\n borderSize = 2,\n borderRadius = 20,\n neonColors = {\n firstColor: \"#ff00aa\",\n secondColor: \"#00FFF1\",\n },\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const [dimensions, setDimensions] = useState({ width: 0, height: 0 })\n\n useEffect(() => {\n const updateDimensions = () => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }\n\n updateDimensions()\n window.addEventListener(\"resize\", updateDimensions)\n\n return () => {\n window.removeEventListener(\"resize\", updateDimensions)\n }\n }, [])\n\n useEffect(() => {\n if (containerRef.current) {\n const { offsetWidth, offsetHeight } = containerRef.current\n setDimensions({ width: offsetWidth, height: offsetHeight })\n }\n }, [children])\n\n return (\n <div\n ref={containerRef}\n style={\n {\n \"--border-size\": `${borderSize}px`,\n \"--border-radius\": `${borderRadius}px`,\n \"--neon-first-color\": neonColors.firstColor,\n \"--neon-second-color\": neonColors.secondColor,\n \"--card-width\": `${dimensions.width}px`,\n \"--card-height\": `${dimensions.height}px`,\n \"--card-content-radius\": `${borderRadius - borderSize}px`,\n \"--pseudo-element-background-image\": `linear-gradient(0deg, ${neonColors.firstColor}, ${neonColors.secondColor})`,\n \"--pseudo-element-width\": `${dimensions.width + borderSize * 2}px`,\n \"--pseudo-element-height\": `${dimensions.height + borderSize * 2}px`,\n \"--after-blur\": `${dimensions.width / 3}px`,\n } as CSSProperties\n }\n className={cn(\n \"relative z-10 size-full rounded-[var(--border-radius)]\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"relative size-full min-h-[inherit] rounded-[var(--card-content-radius)] bg-gray-100 p-6\",\n \"before:absolute before:-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-[var(--border-radius)]\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"relative size-full min-h-[inherit] rounded-[var(--card-content-radius)] bg-gray-100 p-6\",\n \"before:absolute before:-top-[var(--border-size)] before:-left-[var(--border-size)] before:-z-10 before:block\",\n \"before:h-[var(--pseudo-element-height)] before:w-[var(--pseudo-element-width)] before:rounded-[var(--border-radius)] before:content-['']\",\n \"before:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] before:bg-[length:100%_200%]\",\n \"before:animate-background-position-spin\",\n \"after:absolute after:-top-[var(--border-size)] after:-left-[var(--border-size)] after:-z-10 after:block\",\n \"after:h-[var(--pseudo-element-height)] after:w-[var(--pseudo-element-width)] after:rounded-[var(--border-radius)] after:blur-[var(--after-blur)] after:content-['']\",\n \"after:bg-[linear-gradient(0deg,var(--neon-first-color),var(--neon-second-color))] after:bg-[length:100%_200%] after:opacity-80\",\n \"after:animate-background-position-spin\",\n \"dark:bg-neutral-900\",\n \"break-words\"\n )}\n >\n {children}\n </div>\n </div>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/pointer.json b/apps/www/public/r/pointer.json
index 511e9041..8ea7c56b 100644
--- a/apps/www/public/r/pointer.json
+++ b/apps/www/public/r/pointer.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/pointer.tsx",
- "content": "\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport {\n AnimatePresence,\n HTMLMotionProps,\n motion,\n useMotionValue,\n} from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface PointerProps extends Omit<HTMLMotionProps<\"div\">, \"ref\"> {}\n\n/**\n * A custom pointer component that displays an animated cursor.\n * Add this as a child to any component to enable a custom pointer when hovering.\n * You can pass custom children to render as the pointer.\n *\n * @component\n * @param {PointerProps} props - The component props\n */\nexport function Pointer({\n className,\n style,\n children,\n ...props\n}: PointerProps): React.ReactNode {\n const x = useMotionValue(0)\n const y = useMotionValue(0)\n const [isActive, setIsActive] = useState<boolean>(false)\n const containerRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (typeof window !== \"undefined\" && containerRef.current) {\n // Get the parent element directly from the ref\n const parentElement = containerRef.current.parentElement\n\n if (parentElement) {\n // Add cursor-none to parent\n parentElement.style.cursor = \"none\"\n\n // Add event listeners to parent\n const handleMouseMove = (e: MouseEvent) => {\n x.set(e.clientX)\n y.set(e.clientY)\n }\n\n const handleMouseEnter = (e: MouseEvent) => {\n x.set(e.clientX)\n y.set(e.clientY)\n setIsActive(true)\n }\n\n const handleMouseLeave = () => {\n setIsActive(false)\n }\n\n parentElement.addEventListener(\"mousemove\", handleMouseMove)\n parentElement.addEventListener(\"mouseenter\", handleMouseEnter)\n parentElement.addEventListener(\"mouseleave\", handleMouseLeave)\n\n return () => {\n parentElement.style.cursor = \"\"\n parentElement.removeEventListener(\"mousemove\", handleMouseMove)\n parentElement.removeEventListener(\"mouseenter\", handleMouseEnter)\n parentElement.removeEventListener(\"mouseleave\", handleMouseLeave)\n }\n }\n }\n }, [x, y])\n\n return (\n <>\n <div ref={containerRef} />\n <AnimatePresence>\n {isActive && (\n <motion.div\n className=\"pointer-events-none fixed z-50 transform-[translate(-50%,-50%)]\"\n style={{\n top: y,\n left: x,\n ...style,\n }}\n initial={{\n scale: 0,\n opacity: 0,\n }}\n animate={{\n scale: 1,\n opacity: 1,\n }}\n exit={{\n scale: 0,\n opacity: 0,\n }}\n {...props}\n >\n {children || (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"1\"\n viewBox=\"0 0 16 16\"\n height=\"24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\n \"rotate-[-70deg] stroke-white text-black\",\n className\n )}\n >\n <path d=\"M14.082 2.182a.5.5 0 0 1 .103.557L8.528 15.467a.5.5 0 0 1-.917-.007L5.57 10.694.803 8.652a.5.5 0 0 1-.006-.916l12.728-5.657a.5.5 0 0 1 .556.103z\" />\n </svg>\n )}\n </motion.div>\n )}\n </AnimatePresence>\n </>\n )\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport {\n AnimatePresence,\n HTMLMotionProps,\n motion,\n useMotionValue,\n} from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/**\n * A custom pointer component that displays an animated cursor.\n * Add this as a child to any component to enable a custom pointer when hovering.\n * You can pass custom children to render as the pointer.\n *\n * @component\n * @param {HTMLMotionProps<\"div\">} props - The component props\n */\nexport function Pointer({\n className,\n style,\n children,\n ...props\n}: HTMLMotionProps<\"div\">): React.ReactNode {\n const x = useMotionValue(0)\n const y = useMotionValue(0)\n const [isActive, setIsActive] = useState<boolean>(false)\n const containerRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (typeof window !== \"undefined\" && containerRef.current) {\n // Get the parent element directly from the ref\n const parentElement = containerRef.current.parentElement\n\n if (parentElement) {\n // Add cursor-none to parent\n parentElement.style.cursor = \"none\"\n\n // Add event listeners to parent\n const handleMouseMove = (e: MouseEvent) => {\n x.set(e.clientX)\n y.set(e.clientY)\n }\n\n const handleMouseEnter = (e: MouseEvent) => {\n x.set(e.clientX)\n y.set(e.clientY)\n setIsActive(true)\n }\n\n const handleMouseLeave = () => {\n setIsActive(false)\n }\n\n parentElement.addEventListener(\"mousemove\", handleMouseMove)\n parentElement.addEventListener(\"mouseenter\", handleMouseEnter)\n parentElement.addEventListener(\"mouseleave\", handleMouseLeave)\n\n return () => {\n parentElement.style.cursor = \"\"\n parentElement.removeEventListener(\"mousemove\", handleMouseMove)\n parentElement.removeEventListener(\"mouseenter\", handleMouseEnter)\n parentElement.removeEventListener(\"mouseleave\", handleMouseLeave)\n }\n }\n }\n }, [x, y])\n\n return (\n <>\n <div ref={containerRef} />\n <AnimatePresence>\n {isActive && (\n <motion.div\n className=\"pointer-events-none fixed z-50 transform-[translate(-50%,-50%)]\"\n style={{\n top: y,\n left: x,\n ...style,\n }}\n initial={{\n scale: 0,\n opacity: 0,\n }}\n animate={{\n scale: 1,\n opacity: 1,\n }}\n exit={{\n scale: 0,\n opacity: 0,\n }}\n {...props}\n >\n {children || (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"1\"\n viewBox=\"0 0 16 16\"\n height=\"24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\n \"rotate-[-70deg] stroke-white text-black\",\n className\n )}\n >\n <path d=\"M14.082 2.182a.5.5 0 0 1 .103.557L8.528 15.467a.5.5 0 0 1-.917-.007L5.57 10.694.803 8.652a.5.5 0 0 1-.006-.916l12.728-5.657a.5.5 0 0 1 .556.103z\" />\n </svg>\n )}\n </motion.div>\n )}\n </AnimatePresence>\n </>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/rainbow-button.json b/apps/www/public/r/rainbow-button.json
index 9dfe5dc7..54f4515f 100644
--- a/apps/www/public/r/rainbow-button.json
+++ b/apps/www/public/r/rainbow-button.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/magicui/rainbow-button.tsx",
- "content": "import React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RainbowButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nconst rainbowButtonVariants = cva(\n cn(\n \"relative cursor-pointer group transition-all animate-rainbow\",\n \"inline-flex items-center justify-center gap-2 shrink-0\",\n \"rounded-sm outline-none focus-visible:ring-[3px] aria-invalid:border-destructive\",\n \"text-sm font-medium whitespace-nowrap\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0\"\n ),\n {\n variants: {\n variant: {\n default:\n \"border-0 bg-[linear-gradient(#121213,#121213),linear-gradient(#121213_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-primary-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] [border:calc(0.125rem)_solid_transparent] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#fff,#fff),linear-gradient(#fff_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))]\",\n outline:\n \"border border-input border-b-transparent bg-[linear-gradient(#ffffff,#ffffff),linear-gradient(#ffffff_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-accent-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#0a0a0a,#0a0a0a),linear-gradient(#0a0a0a_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))]\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-xl px-3 text-xs\",\n lg: \"h-11 rounded-xl px-8\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\ninterface RainbowButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof rainbowButtonVariants> {\n asChild?: boolean\n}\n\nconst RainbowButton = React.forwardRef<HTMLButtonElement, RainbowButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n data-slot=\"button\"\n className={cn(rainbowButtonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nRainbowButton.displayName = \"RainbowButton\"\n\nexport { RainbowButton, rainbowButtonVariants, type RainbowButtonProps }\n",
+ "content": "import React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst rainbowButtonVariants = cva(\n cn(\n \"relative cursor-pointer group transition-all animate-rainbow\",\n \"inline-flex items-center justify-center gap-2 shrink-0\",\n \"rounded-sm outline-none focus-visible:ring-[3px] aria-invalid:border-destructive\",\n \"text-sm font-medium whitespace-nowrap\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0\"\n ),\n {\n variants: {\n variant: {\n default:\n \"border-0 bg-[linear-gradient(#121213,#121213),linear-gradient(#121213_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-primary-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] [border:calc(0.125rem)_solid_transparent] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#fff,#fff),linear-gradient(#fff_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))]\",\n outline:\n \"border border-input border-b-transparent bg-[linear-gradient(#ffffff,#ffffff),linear-gradient(#ffffff_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-accent-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:[filter:blur(0.75rem)] dark:bg-[linear-gradient(#0a0a0a,#0a0a0a),linear-gradient(#0a0a0a_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))]\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-xl px-3 text-xs\",\n lg: \"h-11 rounded-xl px-8\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\ninterface RainbowButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof rainbowButtonVariants> {\n asChild?: boolean\n}\n\nconst RainbowButton = React.forwardRef<HTMLButtonElement, RainbowButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n data-slot=\"button\"\n className={cn(rainbowButtonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nRainbowButton.displayName = \"RainbowButton\"\n\nexport { RainbowButton, rainbowButtonVariants, type RainbowButtonProps }\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/public/r/scroll-progress.json b/apps/www/public/r/scroll-progress.json
index 407c896c..bd2c0909 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 React from \"react\"\nimport { motion, MotionProps, useScroll } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ScrollProgressProps\n extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {}\n\nexport const ScrollProgress = React.forwardRef<\n HTMLDivElement,\n ScrollProgressProps\n>(({ className, ...props }, ref) => {\n const { scrollYProgress } = useScroll()\n\n return (\n <motion.div\n ref={ref}\n className={cn(\n \"fixed inset-x-0 top-0 z-50 h-px origin-left bg-gradient-to-r from-[#A97CF8] via-[#F38CB8] to-[#FDCC92]\",\n className\n )}\n style={{\n scaleX: scrollYProgress,\n }}\n {...props}\n />\n )\n})\n\nScrollProgress.displayName = \"ScrollProgress\"\n",
+ "content": "\"use client\"\n\nimport { motion, MotionProps, useScroll } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ScrollProgressProps\n extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {\n 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",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/tweet-card.json b/apps/www/public/r/tweet-card.json
index 1235252c..2bca47aa 100644
--- a/apps/www/public/r/tweet-card.json
+++ b/apps/www/public/r/tweet-card.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/tweet-card.tsx",
- "content": "/* eslint-disable @next/next/no-img-element */\nimport { Suspense } from \"react\"\nimport {\n enrichTweet,\n type EnrichedTweet,\n type TweetProps,\n type TwitterComponents,\n} from \"react-tweet\"\nimport { getTweet, type Tweet } from \"react-tweet/api\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TwitterIconProps {\n className?: string\n [key: string]: unknown\n}\nconst Twitter = ({ className, ...props }: TwitterIconProps) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n {...props}\n >\n <g>\n <path fill=\"none\" d=\"M0 0h24v24H0z\"></path>\n <path d=\"M22.162 5.656a8.384 8.384 0 0 1-2.402.658A4.196 4.196 0 0 0 21.6 4c-.82.488-1.719.83-2.656 1.015a4.182 4.182 0 0 0-7.126 3.814 11.874 11.874 0 0 1-8.62-4.37 4.168 4.168 0 0 0-.566 2.103c0 1.45.738 2.731 1.86 3.481a4.168 4.168 0 0 1-1.894-.523v.052a4.185 4.185 0 0 0 3.355 4.101 4.21 4.21 0 0 1-1.89.072A4.185 4.185 0 0 0 7.97 16.65a8.394 8.394 0 0 1-6.191 1.732 11.83 11.83 0 0 0 6.41 1.88c7.693 0 11.9-6.373 11.9-11.9 0-.18-.005-.362-.013-.54a8.496 8.496 0 0 0 2.087-2.165z\"></path>\n </g>\n </svg>\n)\n\nconst Verified = ({ className, ...props }: TwitterIconProps) => (\n <svg\n aria-label=\"Verified Account\"\n viewBox=\"0 0 24 24\"\n className={className}\n {...props}\n >\n <g fill=\"currentColor\">\n <path d=\"M22.5 12.5c0-1.58-.875-2.95-2.148-3.6.154-.435.238-.905.238-1.4 0-2.21-1.71-3.998-3.818-3.998-.47 0-.92.084-1.336.25C14.818 2.415 13.51 1.5 12 1.5s-2.816.917-3.437 2.25c-.415-.165-.866-.25-1.336-.25-2.11 0-3.818 1.79-3.818 4 0 .494.083.964.237 1.4-1.272.65-2.147 2.018-2.147 3.6 0 1.495.782 2.798 1.942 3.486-.02.17-.032.34-.032.514 0 2.21 1.708 4 3.818 4 .47 0 .92-.086 1.335-.25.62 1.334 1.926 2.25 3.437 2.25 1.512 0 2.818-.916 3.437-2.25.415.163.865.248 1.336.248 2.11 0 3.818-1.79 3.818-4 0-.174-.012-.344-.033-.513 1.158-.687 1.943-1.99 1.943-3.484zm-6.616-3.334l-4.334 6.5c-.145.217-.382.334-.625.334-.143 0-.288-.04-.416-.126l-.115-.094-2.415-2.415c-.293-.293-.293-.768 0-1.06s.768-.294 1.06 0l1.77 1.767 3.825-5.74c.23-.345.696-.436 1.04-.207.346.23.44.696.21 1.04z\" />\n </g>\n </svg>\n)\n\nexport const truncate = (str: string | null, length: number) => {\n if (!str || str.length <= length) return str\n return `${str.slice(0, length - 3)}...`\n}\n\nconst Skeleton = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div className={cn(\"bg-primary/10 rounded-md\", className)} {...props} />\n )\n}\n\nexport const TweetSkeleton = ({\n className,\n ...props\n}: {\n className?: string\n [key: string]: unknown\n}) => (\n <div\n className={cn(\n \"flex size-full max-h-max min-w-72 flex-col gap-2 rounded-lg border p-4\",\n className\n )}\n {...props}\n >\n <div className=\"flex flex-row gap-2\">\n <Skeleton className=\"size-10 shrink-0 rounded-full\" />\n <Skeleton className=\"h-10 w-full\" />\n </div>\n <Skeleton className=\"h-20 w-full\" />\n </div>\n)\n\nexport const TweetNotFound = ({\n className,\n ...props\n}: {\n className?: string\n [key: string]: unknown\n}) => (\n <div\n className={cn(\n \"flex size-full flex-col items-center justify-center gap-2 rounded-lg border p-4\",\n className\n )}\n {...props}\n >\n <h3>Tweet not found</h3>\n </div>\n)\n\nexport const TweetHeader = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"flex flex-row justify-between tracking-tight\">\n <div className=\"flex items-center space-x-2\">\n <a href={tweet.user.url} target=\"_blank\" rel=\"noreferrer\">\n <img\n title={`Profile picture of ${tweet.user.name}`}\n alt={tweet.user.screen_name}\n height={48}\n width={48}\n src={tweet.user.profile_image_url_https}\n className=\"overflow-hidden rounded-full border border-transparent\"\n />\n </a>\n <div>\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"flex items-center font-semibold whitespace-nowrap\"\n >\n {truncate(tweet.user.name, 20)}\n {tweet.user.verified ||\n (tweet.user.is_blue_verified && (\n <Verified className=\"ml-1 inline size-4 text-blue-500\" />\n ))}\n </a>\n <div className=\"flex items-center space-x-1\">\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-sm text-gray-500 transition-all duration-75\"\n >\n @{truncate(tweet.user.screen_name, 16)}\n </a>\n </div>\n </div>\n </div>\n <a href={tweet.url} target=\"_blank\" rel=\"noreferrer\">\n <span className=\"sr-only\">Link to tweet</span>\n <Twitter className=\"size-5 items-start text-[#3BA9EE] transition-all ease-in-out hover:scale-105\" />\n </a>\n </div>\n)\n\nexport const TweetBody = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"leading-normal tracking-tighter break-words\">\n {tweet.entities.map((entity, idx) => {\n switch (entity.type) {\n case \"url\":\n case \"symbol\":\n case \"hashtag\":\n case \"mention\":\n return (\n <a\n key={idx}\n href={entity.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm font-normal text-gray-500\"\n >\n <span>{entity.text}</span>\n </a>\n )\n case \"text\":\n return (\n <span\n key={idx}\n className=\"text-sm font-normal\"\n dangerouslySetInnerHTML={{ __html: entity.text }}\n />\n )\n }\n })}\n </div>\n)\n\nexport const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => {\n if (!tweet.video && !tweet.photos) return null\n return (\n <div className=\"flex flex-1 items-center justify-center\">\n {tweet.video && (\n <video\n poster={tweet.video.poster}\n autoPlay\n loop\n muted\n playsInline\n className=\"rounded-xl border shadow-sm\"\n >\n <source src={tweet.video.variants[0].src} type=\"video/mp4\" />\n Your browser does not support the video tag.\n </video>\n )}\n {tweet.photos && (\n <div className=\"relative flex transform-gpu snap-x snap-mandatory gap-4 overflow-x-auto\">\n <div className=\"shrink-0 snap-center sm:w-2\" />\n {tweet.photos.map((photo) => (\n <img\n key={photo.url}\n src={photo.url}\n width={photo.width}\n height={photo.height}\n title={\"Photo by \" + tweet.user.name}\n alt={tweet.text}\n className=\"h-64 w-5/6 shrink-0 snap-center snap-always rounded-xl border object-cover shadow-sm\"\n />\n ))}\n <div className=\"shrink-0 snap-center sm:w-2\" />\n </div>\n )}\n {!tweet.video &&\n !tweet.photos &&\n // @ts-ignore\n tweet?.card?.binding_values?.thumbnail_image_large?.image_value.url && (\n <img\n src={\n // @ts-ignore\n tweet.card.binding_values.thumbnail_image_large.image_value.url\n }\n className=\"h-64 rounded-xl border object-cover shadow-sm\"\n alt={tweet.text}\n />\n )}\n </div>\n )\n}\n\nexport const MagicTweet = ({\n tweet,\n components,\n className,\n ...props\n}: {\n tweet: Tweet\n components?: TwitterComponents\n className?: string\n}) => {\n const enrichedTweet = enrichTweet(tweet)\n return (\n <div\n className={cn(\n \"relative flex h-fit w-full max-w-lg flex-col gap-2 overflow-hidden rounded-lg border p-4 backdrop-blur-md\",\n className\n )}\n {...props}\n >\n <TweetHeader tweet={enrichedTweet} />\n <TweetBody tweet={enrichedTweet} />\n <TweetMedia tweet={enrichedTweet} />\n </div>\n )\n}\n\n/**\n * TweetCard (Server Side Only)\n */\nexport const TweetCard = async ({\n id,\n components,\n fallback = <TweetSkeleton />,\n onError,\n ...props\n}: TweetProps & {\n className?: string\n}) => {\n const tweet = id\n ? await getTweet(id).catch((err) => {\n if (onError) {\n onError(err)\n } else {\n console.error(err)\n }\n })\n : undefined\n\n if (!tweet) {\n const NotFound = components?.TweetNotFound || TweetNotFound\n return <NotFound {...props} />\n }\n\n return (\n <Suspense fallback={fallback}>\n <MagicTweet tweet={tweet} {...props} />\n </Suspense>\n )\n}\n",
+ "content": "/* eslint-disable @next/next/no-img-element */\nimport { Suspense } from \"react\"\nimport { enrichTweet, type EnrichedTweet, type TweetProps } from \"react-tweet\"\nimport { getTweet, type Tweet } from \"react-tweet/api\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TwitterIconProps {\n className?: string\n [key: string]: unknown\n}\nconst Twitter = ({ className, ...props }: TwitterIconProps) => (\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n {...props}\n >\n <g>\n <path fill=\"none\" d=\"M0 0h24v24H0z\"></path>\n <path d=\"M22.162 5.656a8.384 8.384 0 0 1-2.402.658A4.196 4.196 0 0 0 21.6 4c-.82.488-1.719.83-2.656 1.015a4.182 4.182 0 0 0-7.126 3.814 11.874 11.874 0 0 1-8.62-4.37 4.168 4.168 0 0 0-.566 2.103c0 1.45.738 2.731 1.86 3.481a4.168 4.168 0 0 1-1.894-.523v.052a4.185 4.185 0 0 0 3.355 4.101 4.21 4.21 0 0 1-1.89.072A4.185 4.185 0 0 0 7.97 16.65a8.394 8.394 0 0 1-6.191 1.732 11.83 11.83 0 0 0 6.41 1.88c7.693 0 11.9-6.373 11.9-11.9 0-.18-.005-.362-.013-.54a8.496 8.496 0 0 0 2.087-2.165z\"></path>\n </g>\n </svg>\n)\n\nconst Verified = ({ className, ...props }: TwitterIconProps) => (\n <svg\n aria-label=\"Verified Account\"\n viewBox=\"0 0 24 24\"\n className={className}\n {...props}\n >\n <g fill=\"currentColor\">\n <path d=\"M22.5 12.5c0-1.58-.875-2.95-2.148-3.6.154-.435.238-.905.238-1.4 0-2.21-1.71-3.998-3.818-3.998-.47 0-.92.084-1.336.25C14.818 2.415 13.51 1.5 12 1.5s-2.816.917-3.437 2.25c-.415-.165-.866-.25-1.336-.25-2.11 0-3.818 1.79-3.818 4 0 .494.083.964.237 1.4-1.272.65-2.147 2.018-2.147 3.6 0 1.495.782 2.798 1.942 3.486-.02.17-.032.34-.032.514 0 2.21 1.708 4 3.818 4 .47 0 .92-.086 1.335-.25.62 1.334 1.926 2.25 3.437 2.25 1.512 0 2.818-.916 3.437-2.25.415.163.865.248 1.336.248 2.11 0 3.818-1.79 3.818-4 0-.174-.012-.344-.033-.513 1.158-.687 1.943-1.99 1.943-3.484zm-6.616-3.334l-4.334 6.5c-.145.217-.382.334-.625.334-.143 0-.288-.04-.416-.126l-.115-.094-2.415-2.415c-.293-.293-.293-.768 0-1.06s.768-.294 1.06 0l1.77 1.767 3.825-5.74c.23-.345.696-.436 1.04-.207.346.23.44.696.21 1.04z\" />\n </g>\n </svg>\n)\n\nexport const truncate = (str: string | null, length: number) => {\n if (!str || str.length <= length) return str\n return `${str.slice(0, length - 3)}...`\n}\n\nconst Skeleton = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div className={cn(\"bg-primary/10 rounded-md\", className)} {...props} />\n )\n}\n\nexport const TweetSkeleton = ({\n className,\n ...props\n}: {\n className?: string\n [key: string]: unknown\n}) => (\n <div\n className={cn(\n \"flex size-full max-h-max min-w-72 flex-col gap-2 rounded-lg border p-4\",\n className\n )}\n {...props}\n >\n <div className=\"flex flex-row gap-2\">\n <Skeleton className=\"size-10 shrink-0 rounded-full\" />\n <Skeleton className=\"h-10 w-full\" />\n </div>\n <Skeleton className=\"h-20 w-full\" />\n </div>\n)\n\nexport const TweetNotFound = ({\n className,\n ...props\n}: {\n className?: string\n [key: string]: unknown\n}) => (\n <div\n className={cn(\n \"flex size-full flex-col items-center justify-center gap-2 rounded-lg border p-4\",\n className\n )}\n {...props}\n >\n <h3>Tweet not found</h3>\n </div>\n)\n\nexport const TweetHeader = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"flex flex-row justify-between tracking-tight\">\n <div className=\"flex items-center space-x-2\">\n <a href={tweet.user.url} target=\"_blank\" rel=\"noreferrer\">\n <img\n title={`Profile picture of ${tweet.user.name}`}\n alt={tweet.user.screen_name}\n height={48}\n width={48}\n src={tweet.user.profile_image_url_https}\n className=\"overflow-hidden rounded-full border border-transparent\"\n />\n </a>\n <div>\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"flex items-center font-semibold whitespace-nowrap\"\n >\n {truncate(tweet.user.name, 20)}\n {tweet.user.verified ||\n (tweet.user.is_blue_verified && (\n <Verified className=\"ml-1 inline size-4 text-blue-500\" />\n ))}\n </a>\n <div className=\"flex items-center space-x-1\">\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-sm text-gray-500 transition-all duration-75\"\n >\n @{truncate(tweet.user.screen_name, 16)}\n </a>\n </div>\n </div>\n </div>\n <a href={tweet.url} target=\"_blank\" rel=\"noreferrer\">\n <span className=\"sr-only\">Link to tweet</span>\n <Twitter className=\"size-5 items-start text-[#3BA9EE] transition-all ease-in-out hover:scale-105\" />\n </a>\n </div>\n)\n\nexport const TweetBody = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"leading-normal tracking-tighter break-words\">\n {tweet.entities.map((entity, idx) => {\n switch (entity.type) {\n case \"url\":\n case \"symbol\":\n case \"hashtag\":\n case \"mention\":\n return (\n <a\n key={idx}\n href={entity.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-sm font-normal text-gray-500\"\n >\n <span>{entity.text}</span>\n </a>\n )\n case \"text\":\n return (\n <span\n key={idx}\n className=\"text-sm font-normal\"\n dangerouslySetInnerHTML={{ __html: entity.text }}\n />\n )\n }\n })}\n </div>\n)\n\nexport const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => {\n if (!tweet.video && !tweet.photos) return null\n return (\n <div className=\"flex flex-1 items-center justify-center\">\n {tweet.video && (\n <video\n poster={tweet.video.poster}\n autoPlay\n loop\n muted\n playsInline\n className=\"rounded-xl border shadow-sm\"\n >\n <source src={tweet.video.variants[0].src} type=\"video/mp4\" />\n Your browser does not support the video tag.\n </video>\n )}\n {tweet.photos && (\n <div className=\"relative flex transform-gpu snap-x snap-mandatory gap-4 overflow-x-auto\">\n <div className=\"shrink-0 snap-center sm:w-2\" />\n {tweet.photos.map((photo) => (\n <img\n key={photo.url}\n src={photo.url}\n width={photo.width}\n height={photo.height}\n title={\"Photo by \" + tweet.user.name}\n alt={tweet.text}\n className=\"h-64 w-5/6 shrink-0 snap-center snap-always rounded-xl border object-cover shadow-sm\"\n />\n ))}\n <div className=\"shrink-0 snap-center sm:w-2\" />\n </div>\n )}\n {!tweet.video &&\n !tweet.photos &&\n // @ts-expect-error package doesn't have type definitions\n tweet?.card?.binding_values?.thumbnail_image_large?.image_value.url && (\n <img\n src={\n // @ts-expect-error package doesn't have type definitions\n tweet.card.binding_values.thumbnail_image_large.image_value.url\n }\n className=\"h-64 rounded-xl border object-cover shadow-sm\"\n alt={tweet.text}\n />\n )}\n </div>\n )\n}\n\nexport const MagicTweet = ({\n tweet,\n className,\n ...props\n}: {\n tweet: Tweet\n className?: string\n}) => {\n const enrichedTweet = enrichTweet(tweet)\n return (\n <div\n className={cn(\n \"relative flex h-fit w-full max-w-lg flex-col gap-2 overflow-hidden rounded-lg border p-4 backdrop-blur-md\",\n className\n )}\n {...props}\n >\n <TweetHeader tweet={enrichedTweet} />\n <TweetBody tweet={enrichedTweet} />\n <TweetMedia tweet={enrichedTweet} />\n </div>\n )\n}\n\n/**\n * TweetCard (Server Side Only)\n */\nexport const TweetCard = async ({\n id,\n components,\n fallback = <TweetSkeleton />,\n onError,\n ...props\n}: TweetProps & {\n className?: string\n}) => {\n const tweet = id\n ? await getTweet(id).catch((err) => {\n if (onError) {\n onError(err)\n } else {\n console.error(err)\n }\n })\n : undefined\n\n if (!tweet) {\n const NotFound = components?.TweetNotFound || TweetNotFound\n return <NotFound {...props} />\n }\n\n return (\n <Suspense fallback={fallback}>\n <MagicTweet tweet={tweet} {...props} />\n </Suspense>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/typing-animation.json b/apps/www/public/r/typing-animation.json
index 1797e62b..0768cdeb 100644
--- a/apps/www/public/r/typing-animation.json
+++ b/apps/www/public/r/typing-animation.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/typing-animation.tsx",
- "content": "\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { motion, MotionProps, useInView } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TypingAnimationProps extends MotionProps {\n children?: string\n words?: string[]\n className?: string\n duration?: number\n typeSpeed?: number\n deleteSpeed?: number\n delay?: number\n pauseDelay?: number\n loop?: boolean\n as?: React.ElementType\n startOnView?: boolean\n showCursor?: boolean\n blinkCursor?: boolean\n cursorStyle?: \"line\" | \"block\" | \"underscore\"\n}\n\nexport function TypingAnimation({\n children,\n words,\n className,\n duration = 100,\n typeSpeed,\n deleteSpeed,\n delay = 0,\n pauseDelay = 1000,\n loop = false,\n as: Component = \"span\",\n startOnView = true,\n showCursor = true,\n blinkCursor = true,\n cursorStyle = \"line\",\n ...props\n}: TypingAnimationProps) {\n const MotionComponent = motion.create(Component, {\n forwardMotionProps: true,\n })\n\n const [displayedText, setDisplayedText] = useState<string>(\"\")\n const [currentWordIndex, setCurrentWordIndex] = useState(0)\n const [currentCharIndex, setCurrentCharIndex] = useState(0)\n const [phase, setPhase] = useState<\"typing\" | \"pause\" | \"deleting\">(\"typing\")\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 wordsToAnimate = words || (children ? [children] : [])\n const hasMultipleWords = wordsToAnimate.length > 1\n\n const typingSpeed = typeSpeed || duration\n const deletingSpeed = deleteSpeed || typingSpeed / 2\n\n const shouldStart = startOnView ? isInView : true\n\n useEffect(() => {\n if (!shouldStart || wordsToAnimate.length === 0) return\n\n const timeoutDelay =\n delay > 0 && displayedText === \"\"\n ? delay\n : phase === \"typing\"\n ? typingSpeed\n : phase === \"deleting\"\n ? deletingSpeed\n : pauseDelay\n\n const timeout = setTimeout(() => {\n const currentWord = wordsToAnimate[currentWordIndex] || \"\"\n const graphemes = Array.from(currentWord)\n\n switch (phase) {\n case \"typing\":\n if (currentCharIndex < graphemes.length) {\n setDisplayedText(graphemes.slice(0, currentCharIndex + 1).join(\"\"))\n setCurrentCharIndex(currentCharIndex + 1)\n } else {\n if (hasMultipleWords || loop) {\n const isLastWord = currentWordIndex === wordsToAnimate.length - 1\n if (!isLastWord || loop) {\n setPhase(\"pause\")\n }\n }\n }\n break\n\n case \"pause\":\n setPhase(\"deleting\")\n break\n\n case \"deleting\":\n if (currentCharIndex > 0) {\n setDisplayedText(graphemes.slice(0, currentCharIndex - 1).join(\"\"))\n setCurrentCharIndex(currentCharIndex - 1)\n } else {\n const nextIndex = (currentWordIndex + 1) % wordsToAnimate.length\n setCurrentWordIndex(nextIndex)\n setPhase(\"typing\")\n }\n break\n }\n }, timeoutDelay)\n\n return () => clearTimeout(timeout)\n }, [\n shouldStart,\n phase,\n currentCharIndex,\n currentWordIndex,\n displayedText,\n wordsToAnimate,\n hasMultipleWords,\n loop,\n typingSpeed,\n deletingSpeed,\n pauseDelay,\n delay,\n ])\n\n const currentWordGraphemes = Array.from(\n wordsToAnimate[currentWordIndex] || \"\"\n )\n const isComplete =\n !loop &&\n currentWordIndex === wordsToAnimate.length - 1 &&\n currentCharIndex >= currentWordGraphemes.length &&\n phase !== \"deleting\"\n\n const shouldShowCursor =\n showCursor &&\n !isComplete &&\n (hasMultipleWords || loop || currentCharIndex < currentWordGraphemes.length)\n\n const getCursorChar = () => {\n switch (cursorStyle) {\n case \"block\":\n return \"▌\"\n case \"underscore\":\n return \"_\"\n case \"line\":\n default:\n return \"|\"\n }\n }\n\n return (\n <MotionComponent\n ref={elementRef}\n className={cn(\"leading-[5rem] tracking-[-0.02em]\", className)}\n {...props}\n >\n {displayedText}\n {shouldShowCursor && (\n <span\n className={cn(\"inline-block\", blinkCursor && \"animate-blink-cursor\")}\n >\n {getCursorChar()}\n </span>\n )}\n </MotionComponent>\n )\n}\n",
+ "content": "\"use client\"\n\nimport { useEffect, useMemo, useRef, useState } from \"react\"\nimport { motion, MotionProps, useInView } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface TypingAnimationProps extends MotionProps {\n children?: string\n words?: string[]\n className?: string\n duration?: number\n typeSpeed?: number\n deleteSpeed?: number\n delay?: number\n pauseDelay?: number\n loop?: boolean\n as?: React.ElementType\n startOnView?: boolean\n showCursor?: boolean\n blinkCursor?: boolean\n cursorStyle?: \"line\" | \"block\" | \"underscore\"\n}\n\nexport function TypingAnimation({\n children,\n words,\n className,\n duration = 100,\n typeSpeed,\n deleteSpeed,\n delay = 0,\n pauseDelay = 1000,\n loop = false,\n as: Component = \"span\",\n startOnView = true,\n showCursor = true,\n blinkCursor = true,\n cursorStyle = \"line\",\n ...props\n}: TypingAnimationProps) {\n const MotionComponent = motion.create(Component, {\n forwardMotionProps: true,\n })\n\n const [displayedText, setDisplayedText] = useState<string>(\"\")\n const [currentWordIndex, setCurrentWordIndex] = useState(0)\n const [currentCharIndex, setCurrentCharIndex] = useState(0)\n const [phase, setPhase] = useState<\"typing\" | \"pause\" | \"deleting\">(\"typing\")\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 wordsToAnimate = useMemo(\n () => words || (children ? [children] : []),\n [words, children]\n )\n const hasMultipleWords = wordsToAnimate.length > 1\n\n const typingSpeed = typeSpeed || duration\n const deletingSpeed = deleteSpeed || typingSpeed / 2\n\n const shouldStart = startOnView ? isInView : true\n\n useEffect(() => {\n if (!shouldStart || wordsToAnimate.length === 0) return\n\n const timeoutDelay =\n delay > 0 && displayedText === \"\"\n ? delay\n : phase === \"typing\"\n ? typingSpeed\n : phase === \"deleting\"\n ? deletingSpeed\n : pauseDelay\n\n const timeout = setTimeout(() => {\n const currentWord = wordsToAnimate[currentWordIndex] || \"\"\n const graphemes = Array.from(currentWord)\n\n switch (phase) {\n case \"typing\":\n if (currentCharIndex < graphemes.length) {\n setDisplayedText(graphemes.slice(0, currentCharIndex + 1).join(\"\"))\n setCurrentCharIndex(currentCharIndex + 1)\n } else {\n if (hasMultipleWords || loop) {\n const isLastWord = currentWordIndex === wordsToAnimate.length - 1\n if (!isLastWord || loop) {\n setPhase(\"pause\")\n }\n }\n }\n break\n\n case \"pause\":\n setPhase(\"deleting\")\n break\n\n case \"deleting\":\n if (currentCharIndex > 0) {\n setDisplayedText(graphemes.slice(0, currentCharIndex - 1).join(\"\"))\n setCurrentCharIndex(currentCharIndex - 1)\n } else {\n const nextIndex = (currentWordIndex + 1) % wordsToAnimate.length\n setCurrentWordIndex(nextIndex)\n setPhase(\"typing\")\n }\n break\n }\n }, timeoutDelay)\n\n return () => clearTimeout(timeout)\n }, [\n shouldStart,\n phase,\n currentCharIndex,\n currentWordIndex,\n displayedText,\n wordsToAnimate,\n hasMultipleWords,\n loop,\n typingSpeed,\n deletingSpeed,\n pauseDelay,\n delay,\n ])\n\n const currentWordGraphemes = Array.from(\n wordsToAnimate[currentWordIndex] || \"\"\n )\n const isComplete =\n !loop &&\n currentWordIndex === wordsToAnimate.length - 1 &&\n currentCharIndex >= currentWordGraphemes.length &&\n phase !== \"deleting\"\n\n const shouldShowCursor =\n showCursor &&\n !isComplete &&\n (hasMultipleWords || loop || currentCharIndex < currentWordGraphemes.length)\n\n const getCursorChar = () => {\n switch (cursorStyle) {\n case \"block\":\n return \"▌\"\n case \"underscore\":\n return \"_\"\n case \"line\":\n default:\n return \"|\"\n }\n }\n\n return (\n <MotionComponent\n ref={elementRef}\n className={cn(\"leading-[5rem] tracking-[-0.02em]\", className)}\n {...props}\n >\n {displayedText}\n {shouldShowCursor && (\n <span\n className={cn(\"inline-block\", blinkCursor && \"animate-blink-cursor\")}\n >\n {getCursorChar()}\n </span>\n )}\n </MotionComponent>\n )\n}\n",
"type": "registry:ui"
}
],
diff --git a/apps/www/registry/magicui/animated-grid-pattern.tsx b/apps/www/registry/magicui/animated-grid-pattern.tsx
index ed1e7895..11ebb4cc 100644
--- a/apps/www/registry/magicui/animated-grid-pattern.tsx
+++ b/apps/www/registry/magicui/animated-grid-pattern.tsx
@@ -17,7 +17,7 @@ export interface AnimatedGridPatternProps
height?: number
x?: number
y?: number
- strokeDasharray?: any
+ strokeDasharray?: number
numSquares?: number
maxOpacity?: number
duration?: number
@@ -34,7 +34,6 @@ export function AnimatedGridPattern({
className,
maxOpacity = 0.5,
duration = 4,
- repeatDelay = 0.5,
...props
}: AnimatedGridPatternProps) {
const id = useId()
@@ -76,12 +75,12 @@ export function AnimatedGridPattern({
if (dimensions.width && dimensions.height) {
setSquares(generateSquares(numSquares))
}
- }, [dimensions, numSquares])
+ }, [dimensions, numSquares, generateSquares])
// Resize observer to update container dimensions
useEffect(() => {
const resizeObserver = new ResizeObserver((entries) => {
- for (let entry of entries) {
+ for (const entry of entries) {
setDimensions({
width: entry.contentRect.width,
height: entry.contentRect.height,
diff --git a/apps/www/registry/magicui/client-tweet-card.tsx b/apps/www/registry/magicui/client-tweet-card.tsx
index 43492b7c..22a70371 100644
--- a/apps/www/registry/magicui/client-tweet-card.tsx
+++ b/apps/www/registry/magicui/client-tweet-card.tsx
@@ -25,5 +25,5 @@ export const ClientTweetCard = ({
return <NotFound error={onError ? onError(error) : error} />
}
- return <MagicTweet tweet={data} components={components} {...props} />
+ return <MagicTweet tweet={data} {...props} />
}
diff --git a/apps/www/registry/magicui/cool-mode.tsx b/apps/www/registry/magicui/cool-mode.tsx
index 3ce16063..61e2de0e 100644
--- a/apps/www/registry/magicui/cool-mode.tsx
+++ b/apps/www/registry/magicui/cool-mode.tsx
@@ -30,7 +30,7 @@ export interface CoolParticleOptions extends BaseParticleOptions {
const getContainer = () => {
const id = "_coolMode_effect"
- let existingContainer = document.getElementById(id)
+ const existingContainer = document.getElementById(id)
if (existingContainer) {
return existingContainer
diff --git a/apps/www/registry/magicui/file-tree.tsx b/apps/www/registry/magicui/file-tree.tsx
index 87d62a63..abebaf69 100644
--- a/apps/www/registry/magicui/file-tree.tsx
+++ b/apps/www/registry/magicui/file-tree.tsx
@@ -44,8 +44,6 @@ const useTree = () => {
return context
}
-interface TreeViewComponentProps extends React.HTMLAttributes<HTMLDivElement> {}
-
type Direction = "rtl" | "ltr" | undefined
type TreeViewProps = {
@@ -55,7 +53,7 @@ type TreeViewProps = {
initialExpandedItems?: string[]
openIcon?: React.ReactNode
closeIcon?: React.ReactNode
-} & TreeViewComponentProps
+} & React.HTMLAttributes<HTMLDivElement>
const Tree = forwardRef<HTMLDivElement, TreeViewProps>(
(
@@ -201,15 +199,12 @@ const TreeIndicator = forwardRef<
TreeIndicator.displayName = "TreeIndicator"
-interface FolderComponentProps
- extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {}
-
type FolderProps = {
expandedItems?: string[]
element: string
isSelectable?: boolean
isSelect?: boolean
-} & FolderComponentProps
+} & React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
const Folder = forwardRef<
HTMLDivElement,
diff --git a/apps/www/registry/magicui/interactive-hover-button.tsx b/apps/www/registry/magicui/interactive-hover-button.tsx
index c38f762b..41d7e9f5 100644
--- a/apps/www/registry/magicui/interactive-hover-button.tsx
+++ b/apps/www/registry/magicui/interactive-hover-button.tsx
@@ -1,18 +1,14 @@
-import React from "react"
import { ArrowRight } from "lucide-react"
import { cn } from "@/lib/utils"
-interface InteractiveHoverButtonProps
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {}
-
-export const InteractiveHoverButton = React.forwardRef<
- HTMLButtonElement,
- InteractiveHoverButtonProps
->(({ children, className, ...props }, ref) => {
+export function InteractiveHoverButton({
+ children,
+ className,
+ ...props
+}: React.ButtonHTMLAttributes<HTMLButtonElement>) {
return (
<button
- ref={ref}
className={cn(
"group bg-background relative w-auto cursor-pointer overflow-hidden rounded-full border p-2 px-6 text-center font-semibold",
className
@@ -31,6 +27,4 @@ export const InteractiveHoverButton = React.forwardRef<
</div>
</button>
)
-})
-
-InteractiveHoverButton.displayName = "InteractiveHoverButton"
+}
diff --git a/apps/www/registry/magicui/light-rays.tsx b/apps/www/registry/magicui/light-rays.tsx
index 4a2508ef..ed80dcce 100644
--- a/apps/www/registry/magicui/light-rays.tsx
+++ b/apps/www/registry/magicui/light-rays.tsx
@@ -1,26 +1,17 @@
"use client"
-import {
- forwardRef,
- useEffect,
- useState,
- type CSSProperties,
- type HTMLAttributes,
- type ReactNode,
-} from "react"
+import { useEffect, useState, type CSSProperties } from "react"
import { motion } from "motion/react"
import { cn } from "@/lib/utils"
-export type LightRaysProps = Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
- children?: ReactNode
+interface LightRaysProps extends React.HTMLAttributes<HTMLDivElement> {
+ ref?: React.Ref<HTMLDivElement>
count?: number
color?: string
blur?: number
- opacity?: number
speed?: number
length?: string
- fill?: boolean
}
type LightRay = {
@@ -93,74 +84,66 @@ const Ray = ({
)
}
-export const LightRays = forwardRef<HTMLDivElement, LightRaysProps>(
- (
- {
- className,
- style,
- count = 7,
- color = "rgba(160, 210, 255, 0.2)",
- blur = 36,
- opacity = 0.65,
- speed = 14,
- length = "70vh",
- fill = true,
- ...props
- },
- ref
- ) => {
- const [rays, setRays] = useState<LightRay[]>([])
- const cycleDuration = Math.max(speed, 0.1)
+export function LightRays({
+ className,
+ style,
+ count = 7,
+ color = "rgba(160, 210, 255, 0.2)",
+ blur = 36,
+ speed = 14,
+ length = "70vh",
+ ref,
+ ...props
+}: LightRaysProps) {
+ const [rays, setRays] = useState<LightRay[]>([])
+ const cycleDuration = Math.max(speed, 0.1)
- useEffect(() => {
- setRays(createRays(count, cycleDuration))
- }, [count, cycleDuration])
+ useEffect(() => {
+ setRays(createRays(count, cycleDuration))
+ }, [count, cycleDuration])
- return (
- <div
- ref={ref}
- className={cn(
- "pointer-events-none absolute inset-0 isolate overflow-hidden rounded-[inherit]",
- className
- )}
- style={
- {
- "--light-rays-color": color,
- "--light-rays-blur": `${blur}px`,
- "--light-rays-length": length,
- ...style,
- } as CSSProperties
- }
- {...props}
- >
- <div className="absolute inset-0 overflow-hidden">
- <div
- aria-hidden
- className="absolute inset-0 opacity-60"
- style={
- {
- background:
- "radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--light-rays-color) 45%, transparent), transparent 70%)",
- } as CSSProperties
- }
- />
- <div
- aria-hidden
- className="absolute inset-0 opacity-60"
- style={
- {
- background:
- "radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--light-rays-color) 35%, transparent), transparent 75%)",
- } as CSSProperties
- }
- />
- {rays.map((ray) => (
- <Ray {...ray} />
- ))}
- </div>
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ "pointer-events-none absolute inset-0 isolate overflow-hidden rounded-[inherit]",
+ className
+ )}
+ style={
+ {
+ "--light-rays-color": color,
+ "--light-rays-blur": `${blur}px`,
+ "--light-rays-length": length,
+ ...style,
+ } as CSSProperties
+ }
+ {...props}
+ >
+ <div className="absolute inset-0 overflow-hidden">
+ <div
+ aria-hidden
+ className="absolute inset-0 opacity-60"
+ style={
+ {
+ background:
+ "radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--light-rays-color) 45%, transparent), transparent 70%)",
+ } as CSSProperties
+ }
+ />
+ <div
+ aria-hidden
+ className="absolute inset-0 opacity-60"
+ style={
+ {
+ background:
+ "radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--light-rays-color) 35%, transparent), transparent 75%)",
+ } as CSSProperties
+ }
+ />
+ {rays.map((ray) => (
+ <Ray key={ray.id} {...ray} />
+ ))}
</div>
- )
- }
-)
-
-LightRays.displayName = "LightRays"
+ </div>
+ )
+}
diff --git a/apps/www/registry/magicui/neon-gradient-card.tsx b/apps/www/registry/magicui/neon-gradient-card.tsx
index ee1c1dd7..5454f65b 100644
--- a/apps/www/registry/magicui/neon-gradient-card.tsx
+++ b/apps/www/registry/magicui/neon-gradient-card.tsx
@@ -16,7 +16,7 @@ interface NeonColorsProps {
secondColor: string
}
-interface NeonGradientCardProps {
+interface NeonGradientCardProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* @default <div />
* @type ReactElement
@@ -63,8 +63,6 @@ interface NeonGradientCardProps {
* The colors of the neon gradient
* */
neonColors?: NeonColorsProps
-
- [key: string]: any
}
export const NeonGradientCard: React.FC<NeonGradientCardProps> = ({
diff --git a/apps/www/registry/magicui/pointer.tsx b/apps/www/registry/magicui/pointer.tsx
index 321585d9..f6da4c15 100644
--- a/apps/www/registry/magicui/pointer.tsx
+++ b/apps/www/registry/magicui/pointer.tsx
@@ -10,22 +10,20 @@ import {
import { cn } from "@/lib/utils"
-interface PointerProps extends Omit<HTMLMotionProps<"div">, "ref"> {}
-
/**
* A custom pointer component that displays an animated cursor.
* Add this as a child to any component to enable a custom pointer when hovering.
* You can pass custom children to render as the pointer.
*
* @component
- * @param {PointerProps} props - The component props
+ * @param {HTMLMotionProps<"div">} props - The component props
*/
export function Pointer({
className,
style,
children,
...props
-}: PointerProps): React.ReactNode {
+}: HTMLMotionProps<"div">): React.ReactNode {
const x = useMotionValue(0)
const y = useMotionValue(0)
const [isActive, setIsActive] = useState<boolean>(false)
diff --git a/apps/www/registry/magicui/rainbow-button.tsx b/apps/www/registry/magicui/rainbow-button.tsx
index b7856836..39ef3093 100644
--- a/apps/www/registry/magicui/rainbow-button.tsx
+++ b/apps/www/registry/magicui/rainbow-button.tsx
@@ -4,9 +4,6 @@ import { cva, VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
-interface RainbowButtonProps
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {}
-
const rainbowButtonVariants = cva(
cn(
"relative cursor-pointer group transition-all animate-rainbow",
diff --git a/apps/www/registry/magicui/scroll-progress.tsx b/apps/www/registry/magicui/scroll-progress.tsx
index 2f353b09..92d65757 100644
--- a/apps/www/registry/magicui/scroll-progress.tsx
+++ b/apps/www/registry/magicui/scroll-progress.tsx
@@ -1,17 +1,19 @@
"use client"
-import React from "react"
import { motion, MotionProps, useScroll } from "motion/react"
import { cn } from "@/lib/utils"
interface ScrollProgressProps
- extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {}
+ extends Omit<React.HTMLAttributes<HTMLElement>, keyof MotionProps> {
+ ref?: React.Ref<HTMLDivElement>
+}
-export const ScrollProgress = React.forwardRef<
- HTMLDivElement,
- ScrollProgressProps
->(({ className, ...props }, ref) => {
+export function ScrollProgress({
+ className,
+ ref,
+ ...props
+}: ScrollProgressProps) {
const { scrollYProgress } = useScroll()
return (
@@ -27,6 +29,4 @@ export const ScrollProgress = React.forwardRef<
{...props}
/>
)
-})
-
-ScrollProgress.displayName = "ScrollProgress"
+}
diff --git a/apps/www/registry/magicui/tweet-card.tsx b/apps/www/registry/magicui/tweet-card.tsx
index a502e412..fb754b2d 100644
--- a/apps/www/registry/magicui/tweet-card.tsx
+++ b/apps/www/registry/magicui/tweet-card.tsx
@@ -1,11 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import { Suspense } from "react"
-import {
- enrichTweet,
- type EnrichedTweet,
- type TweetProps,
- type TwitterComponents,
-} from "react-tweet"
+import { enrichTweet, type EnrichedTweet, type TweetProps } from "react-tweet"
import { getTweet, type Tweet } from "react-tweet/api"
import { cn } from "@/lib/utils"
@@ -213,11 +208,11 @@ export const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => {
)}
{!tweet.video &&
!tweet.photos &&
- // @ts-ignore
+ // @ts-expect-error package doesn't have type definitions
tweet?.card?.binding_values?.thumbnail_image_large?.image_value.url && (
<img
src={
- // @ts-ignore
+ // @ts-expect-error package doesn't have type definitions
tweet.card.binding_values.thumbnail_image_large.image_value.url
}
className="h-64 rounded-xl border object-cover shadow-sm"
@@ -230,12 +225,10 @@ export const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => {
export const MagicTweet = ({
tweet,
- components,
className,
...props
}: {
tweet: Tweet
- components?: TwitterComponents
className?: string
}) => {
const enrichedTweet = enrichTweet(tweet)
diff --git a/apps/www/registry/magicui/typing-animation.tsx b/apps/www/registry/magicui/typing-animation.tsx
index a1ad2e3e..e6ef2cc5 100644
--- a/apps/www/registry/magicui/typing-animation.tsx
+++ b/apps/www/registry/magicui/typing-animation.tsx
@@ -1,6 +1,6 @@
"use client"
-import { useEffect, useRef, useState } from "react"
+import { useEffect, useMemo, useRef, useState } from "react"
import { motion, MotionProps, useInView } from "motion/react"
import { cn } from "@/lib/utils"
@@ -53,7 +53,10 @@ export function TypingAnimation({
once: true,
})
- const wordsToAnimate = words || (children ? [children] : [])
+ const wordsToAnimate = useMemo(
+ () => words || (children ? [children] : []),
+ [words, children]
+ )
const hasMultipleWords = wordsToAnimate.length > 1
const typingSpeed = typeSpeed || duration
diff --git a/apps/www/scripts/build-registry.mts b/apps/www/scripts/build-registry.mts
index d536c85f..aa37ed46 100644
--- a/apps/www/scripts/build-registry.mts
+++ b/apps/www/scripts/build-registry.mts
@@ -161,9 +161,8 @@ async function generateLlmsContent() {
.filter((item) => item.type === "registry:ui")
.sort((a, b) => a.name.localeCompare(b.name))
.map((component) => {
- const title = (component as any).title || component.name
- const description =
- (component as any).description || `The ${title} component.`
+ const title = component.title || component.name
+ const description = component.description || `The ${title} component.`
return `- [${title}](${siteConfig.url}/docs/components/${component.name}): ${description}`
})
@@ -176,7 +175,7 @@ async function generateLlmsContent() {
return true
})
.map((example) => {
- const title = (example as any).title || example.name
+ const title = example.title || example.name
const firstFile = example.files?.[0]?.path || ""
const url = firstFile
? `${siteConfig.links.github}/blob/main/${firstFile}`
@@ -215,16 +214,15 @@ async function generateLlmsFullContent(
const componentContents = await Promise.all(
components.map(async (component) => {
- const title = (component as any).title || component.name
- const description =
- (component as any).description || `The ${title} component.`
+ const title = component.title || component.name
+ const description = component.description || `The ${title} component.`
let content = [
`===== COMPONENT: ${component.name} =====`,
`Title: ${title}`,
`Description: ${description}`,
"",
- await readRegistryFilesContents(component as unknown as RegistryItem),
+ await readRegistryFilesContents(component),
].join("\n")
// Add examples for this component
@@ -232,14 +230,14 @@ async function generateLlmsFullContent(
for (const exampleName of relatedExamples) {
const example = registry.items.find((e) => e.name === exampleName)
if (example) {
- const exTitle = (example as any).title || example.name
+ const exTitle = example.title || example.name
content += [
"",
"",
`===== EXAMPLE: ${exampleName} =====`,
`Title: ${exTitle}`,
"",
- await readRegistryFilesContents(example as unknown as RegistryItem),
+ await readRegistryFilesContents(example),
].join("\n")
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1dfc202a..8f841012 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -186,6 +186,9 @@ importers:
specifier: ^4.1.11
version: 4.1.11
devDependencies:
+ '@eslint/eslintrc':
+ specifier: ^3.3.1
+ version: 3.3.1
'@ianvs/prettier-plugin-sort-imports':
specifier: ^4.7.0
version: 4.7.0([email protected])
@@ -8743,8 +8746,8 @@ snapshots:
'@typescript-eslint/parser': 5.62.0([email protected]([email protected]))([email protected])
eslint: 9.35.0([email protected])
eslint-import-resolver-node: 0.3.9
+ eslint-import-resolver-typescript: 3.10.1([email protected])([email protected]([email protected]))
eslint-plugin-jsx-a11y: 6.10.2([email protected]([email protected]))
eslint-plugin-react: 7.37.5([email protected]([email protected]))
eslint-plugin-react-hooks: 5.2.0([email protected]([email protected]))
@@ -8767,7 +8770,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@nolyfill/is-core-module': 1.0.39
debug: 4.4.3
@@ -8778,22 +8781,22 @@ snapshots:
tinyglobby: 0.2.15
unrs-resolver: 1.11.1
optionalDependencies:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 5.62.0([email protected]([email protected]))([email protected])
eslint: 9.35.0([email protected])
eslint-import-resolver-node: 0.3.9
+ eslint-import-resolver-typescript: 3.10.1([email protected])([email protected]([email protected]))
transitivePeerDependencies:
- supports-color
dependencies:
'@rtsao/scc': 1.1.0
array-includes: 3.1.9
@@ -8804,7 +8807,7 @@ snapshots:
doctrine: 2.1.0
eslint: 9.35.0([email protected])
eslint-import-resolver-node: 0.3.9
hasown: 2.0.2
is-core-module: 2.16.1
is-glob: 4.0.3