Skip to content

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

refactor: prefer-nullish-coalescing (#901)

Yeom-JinHoa1ed938c4cf1
diff --git a/apps/www/app/(blog)/blog/[...slug]/page.tsx b/apps/www/app/(blog)/blog/[...slug]/page.tsx
index 5fff4ca2..b6362de9 100644
--- a/apps/www/app/(blog)/blog/[...slug]/page.tsx
+++ b/apps/www/app/(blog)/blog/[...slug]/page.tsx
@@ -60,7 +60,7 @@ export async function generateMetadata({
url: absoluteUrl(page.url),
images: [
{
- url: doc.image || "",
+ url: doc.image ?? "",
width: 1200,
height: 630,
},
@@ -71,7 +71,7 @@ export async function generateMetadata({
title: doc.title,
description: doc.description,
- images: [doc.image || ""],
+ images: [doc.image ?? ""],
creator: "@dillionverma",
},
}
@@ -117,7 +117,7 @@ export default async function BlogPage({ params }: PageProps) {
dateModified: doc.publishedOn,
author: {
"@type": "Person",
- name: doc.author || "Magic UI Team",
+ name: doc.author ?? "Magic UI Team",
url: siteConfig.links?.twitter,
},
image: doc.image ? [doc.image] : undefined,
diff --git a/apps/www/app/og/route.tsx b/apps/www/app/og/route.tsx
index 20ef4aac..075c60e5 100644
--- a/apps/www/app/og/route.tsx
+++ b/apps/www/app/og/route.tsx
@@ -43,6 +43,7 @@ export async function GET(request: Request) {
const description = searchParams.get("description")
const [fonts] = await Promise.all([loadAssets()])
+ const hasContent = [title, description].some(Boolean)
return new ImageResponse(
<div
@@ -53,7 +54,7 @@ export async function GET(request: Request) {
<div tw="flex border absolute border-neutral-200 border-dashed inset-y-0 right-16 w-[1px]" />
<div tw="flex border absolute border-neutral-200 inset-x-0 h-[1px] top-16" />
<div tw="flex border absolute border-neutral-200 inset-x-0 h-[1px] bottom-16" />
- {(title || description) && (
+ {hasContent && (
<div tw="flex absolute flex-row items-center justify-center bottom-24 right-24 text-white">
<Icons.logo width={48} height={48} />
<div tw="text-black flex text-[32px] font-semibold tracking-tight ml-2">
@@ -62,7 +63,7 @@ export async function GET(request: Request) {
</div>
)}
<div tw="flex flex-col absolute justify-center items-center inset-0 p-24 w-full h-full">
- {title || description ? (
+ {hasContent ? (
<div tw="flex flex-col items-center justify-center text-center w-full h-full">
<div tw="tracking-tight flex flex-col justify-center text-black text-balance font-semibold text-[80px]">
{title}
diff --git a/apps/www/components/blog/table-of-contents.tsx b/apps/www/components/blog/table-of-contents.tsx
index 6a65bca6..cc73a08f 100644
--- a/apps/www/components/blog/table-of-contents.tsx
+++ b/apps/www/components/blog/table-of-contents.tsx
@@ -31,7 +31,7 @@ export function BlogTableOfContents({
// Extract headings from rendered DOM
const extractHeadings = () => {
const headingElements =
- document.querySelector(".article-content")?.querySelectorAll("h2") || []
+ document.querySelector(".article-content")?.querySelectorAll("h2") ?? []
const extractedHeadings: string[] = []
headingElements.forEach((element) => {
if (element.textContent) {
@@ -60,13 +60,13 @@ export function BlogTableOfContents({
)
const headingElements =
- document.querySelector(".article-content")?.querySelectorAll("h2") || []
+ document.querySelector(".article-content")?.querySelectorAll("h2") ?? []
headingElements.forEach((element) => observer.observe(element))
// Also update active heading on scroll
const onScroll = () => {
const headings = Array.from(
- document.querySelector(".article-content")?.querySelectorAll("h2") || []
+ document.querySelector(".article-content")?.querySelectorAll("h2") ?? []
)
const middle = window.innerHeight / 2
diff --git a/apps/www/components/code-tabs.tsx b/apps/www/components/code-tabs.tsx
index 6244db50..8f3c9fe3 100644
--- a/apps/www/components/code-tabs.tsx
+++ b/apps/www/components/code-tabs.tsx
@@ -9,7 +9,7 @@ export function CodeTabs({ children }: React.ComponentProps<typeof Tabs>) {
const [config, setConfig] = useConfig()
const installationType = React.useMemo(() => {
- return config.installationType || "cli"
+ return config.installationType ?? "cli"
}, [config])
return (
diff --git a/apps/www/components/docs-sidebar.tsx b/apps/www/components/docs-sidebar.tsx
index 2e496f19..917f3667 100644
--- a/apps/www/components/docs-sidebar.tsx
+++ b/apps/www/components/docs-sidebar.tsx
@@ -112,7 +112,7 @@ export function DocsSidebar({
</SidebarGroupLabel>
<SidebarGroupContent>
<DocsSidebarNavItems
- items={section.items || []}
+ items={section.items ?? []}
pathname={pathname}
/>
</SidebarGroupContent>
diff --git a/apps/www/lib/rehype-component.ts b/apps/www/lib/rehype-component.ts
index e399f4be..728edc72 100644
--- a/apps/www/lib/rehype-component.ts
+++ b/apps/www/lib/rehype-component.ts
@@ -15,7 +15,7 @@ export function rehypeComponent() {
name: string
value?: string
type?: string
- }) || {}
+ }) ?? {}
if (node.name === "ComponentSource") {
const name = getNodeAttributeByName(node, "name")?.value as string
@@ -35,7 +35,7 @@ export function rehypeComponent() {
} else {
const component = Index[name]
src = fileName
- ? component.files.find((file: unknown) => {
+ ? (component.files.find((file: unknown) => {
if (typeof file === "string") {
return (
file.endsWith(`${fileName}.tsx`) ||
@@ -43,7 +43,7 @@ export function rehypeComponent() {
)
}
return false
- }) || component.files[0]?.path
+ }) ?? component.files[0]?.path)
: component.files[0]?.path
}
diff --git a/apps/www/mdx-components.tsx b/apps/www/mdx-components.tsx
index 94ef6cf0..a79c241c 100644
--- a/apps/www/mdx-components.tsx
+++ b/apps/www/mdx-components.tsx
@@ -287,10 +287,10 @@ export const mdxComponents = {
}: React.ComponentProps<"img">) => (
<Image
className={cn("mt-6 rounded-md border", className)}
- src={(src as string) || ""}
+ src={(src as string) ?? ""}
width={Number(width)}
height={Number(height)}
- alt={alt || ""}
+ alt={alt ?? ""}
{...props}
/>
),
diff --git a/apps/www/public/llms-full.txt b/apps/www/public/llms-full.txt
index a1686cde..127cb4ed 100644
--- a/apps/www/public/llms-full.txt
+++ b/apps/www/public/llms-full.txt
@@ -3394,8 +3394,8 @@ import { useRef } from "react"
import {
AnimatePresence,
motion,
- type MotionProps,
useInView,
+ type MotionProps,
type UseInViewOptions,
type Variants,
} from "motion/react"
@@ -3450,7 +3450,7 @@ export function BlurFade({
filter: `blur(0px)`,
},
}
- const combinedVariants = variant || defaultVariants
+ const combinedVariants = variant ?? defaultVariants
const hiddenFilter = getFilter(combinedVariants.hidden)
const visibleFilter = getFilter(combinedVariants.visible)
@@ -3888,7 +3888,7 @@ export const ClientTweetCard = ({
if (isLoading) return fallback
if (error || !data) {
- const NotFound = components?.TweetNotFound || TweetNotFound
+ const NotFound = components?.TweetNotFound ?? TweetNotFound
return <NotFound error={onError ? onError(error) : error} />
}
@@ -7840,7 +7840,7 @@ export function IconCloud({ icons, images }: IconCloudProps) {
useEffect(() => {
if (!icons && !images) return
- const items = icons || images || []
+ const items = icons ?? images ?? []
imagesLoadedRef.current = new Array(items.length).fill(false)
const newIconCanvases = items.map((item, index) => {
@@ -7890,7 +7890,7 @@ export function IconCloud({ icons, images }: IconCloudProps) {
// Generate initial icon positions on a sphere
useEffect(() => {
- const items = icons || images || []
+ const items = icons ?? images ?? []
const newIcons: Icon[] = []
const numIcons = items.length || 20
@@ -15264,7 +15264,7 @@ export const TweetCard = async ({
: undefined
if (!tweet) {
- const NotFound = components?.TweetNotFound || TweetNotFound
+ const NotFound = components?.TweetNotFound ?? TweetNotFound
return <NotFound {...props} />
}
@@ -15375,13 +15375,13 @@ export function TypingAnimation({
})
const wordsToAnimate = useMemo(
- () => words || (children ? [children] : []),
+ () => words ?? (children ? [children] : []),
[words, children]
)
const hasMultipleWords = wordsToAnimate.length > 1
- const typingSpeed = typeSpeed || duration
- const deletingSpeed = deleteSpeed || typingSpeed / 2
+ const typingSpeed = typeSpeed ?? duration
+ const deletingSpeed = deleteSpeed ?? typingSpeed / 2
const shouldStart = startOnView ? isInView : true
diff --git a/apps/www/public/r/blur-fade.json b/apps/www/public/r/blur-fade.json
index 6080a851..0151ccbd 100644
--- a/apps/www/public/r/blur-fade.json
+++ b/apps/www/public/r/blur-fade.json
@@ -10,7 +10,7 @@
"files": [
{
"path": "registry/magicui/blur-fade.tsx",
- "content": "\"use client\"\n\nimport { useRef } from \"react\"\nimport {\n AnimatePresence,\n motion,\n type MotionProps,\n useInView,\n type UseInViewOptions,\n type Variants,\n} from \"motion/react\"\n\ntype MarginType = UseInViewOptions[\"margin\"]\n\ninterface BlurFadeProps extends MotionProps {\n children: React.ReactNode\n className?: string\n variant?: {\n hidden: { y: number }\n visible: { y: number }\n }\n duration?: number\n delay?: number\n offset?: number\n direction?: \"up\" | \"down\" | \"left\" | \"right\"\n inView?: boolean\n inViewMargin?: MarginType\n blur?: string\n}\n\nconst getFilter = (v: Variants[string]) =>\n typeof v === \"function\" ? undefined : v.filter\n\nexport function BlurFade({\n children,\n className,\n variant,\n duration = 0.4,\n delay = 0,\n offset = 6,\n direction = \"down\",\n inView = false,\n inViewMargin = \"-50px\",\n blur = \"6px\",\n ...props\n}: BlurFadeProps) {\n const ref = useRef(null)\n const inViewResult = useInView(ref, { once: true, margin: inViewMargin })\n const isInView = !inView || inViewResult\n const defaultVariants: Variants = {\n hidden: {\n [direction === \"left\" || direction === \"right\" ? \"x\" : \"y\"]:\n direction === \"right\" || direction === \"down\" ? -offset : offset,\n opacity: 0,\n filter: `blur(${blur})`,\n },\n visible: {\n [direction === \"left\" || direction === \"right\" ? \"x\" : \"y\"]: 0,\n opacity: 1,\n filter: `blur(0px)`,\n },\n }\n const combinedVariants = variant || defaultVariants\n\n const hiddenFilter = getFilter(combinedVariants.hidden)\n const visibleFilter = getFilter(combinedVariants.visible)\n\n const shouldTransitionFilter =\n hiddenFilter != null &&\n visibleFilter != null &&\n hiddenFilter !== visibleFilter\n\n return (\n <AnimatePresence>\n <motion.div\n ref={ref}\n initial=\"hidden\"\n animate={isInView ? \"visible\" : \"hidden\"}\n exit=\"hidden\"\n variants={combinedVariants}\n transition={{\n delay: 0.04 + delay,\n duration,\n ease: \"easeOut\",\n ...(shouldTransitionFilter ? { filter: { duration } } : {}),\n }}\n className={className}\n {...props}\n >\n {children}\n </motion.div>\n </AnimatePresence>\n )\n}\n",
+ "content": "\"use client\"\n\nimport { useRef } from \"react\"\nimport {\n AnimatePresence,\n motion,\n useInView,\n type MotionProps,\n type UseInViewOptions,\n type Variants,\n} from \"motion/react\"\n\ntype MarginType = UseInViewOptions[\"margin\"]\n\ninterface BlurFadeProps extends MotionProps {\n children: React.ReactNode\n className?: string\n variant?: {\n hidden: { y: number }\n visible: { y: number }\n }\n duration?: number\n delay?: number\n offset?: number\n direction?: \"up\" | \"down\" | \"left\" | \"right\"\n inView?: boolean\n inViewMargin?: MarginType\n blur?: string\n}\n\nconst getFilter = (v: Variants[string]) =>\n typeof v === \"function\" ? undefined : v.filter\n\nexport function BlurFade({\n children,\n className,\n variant,\n duration = 0.4,\n delay = 0,\n offset = 6,\n direction = \"down\",\n inView = false,\n inViewMargin = \"-50px\",\n blur = \"6px\",\n ...props\n}: BlurFadeProps) {\n const ref = useRef(null)\n const inViewResult = useInView(ref, { once: true, margin: inViewMargin })\n const isInView = !inView || inViewResult\n const defaultVariants: Variants = {\n hidden: {\n [direction === \"left\" || direction === \"right\" ? \"x\" : \"y\"]:\n direction === \"right\" || direction === \"down\" ? -offset : offset,\n opacity: 0,\n filter: `blur(${blur})`,\n },\n visible: {\n [direction === \"left\" || direction === \"right\" ? \"x\" : \"y\"]: 0,\n opacity: 1,\n filter: `blur(0px)`,\n },\n }\n const combinedVariants = variant ?? defaultVariants\n\n const hiddenFilter = getFilter(combinedVariants.hidden)\n const visibleFilter = getFilter(combinedVariants.visible)\n\n const shouldTransitionFilter =\n hiddenFilter != null &&\n visibleFilter != null &&\n hiddenFilter !== visibleFilter\n\n return (\n <AnimatePresence>\n <motion.div\n ref={ref}\n initial=\"hidden\"\n animate={isInView ? \"visible\" : \"hidden\"}\n exit=\"hidden\"\n variants={combinedVariants}\n transition={{\n delay: 0.04 + delay,\n duration,\n ease: \"easeOut\",\n ...(shouldTransitionFilter ? { filter: { duration } } : {}),\n }}\n className={className}\n {...props}\n >\n {children}\n </motion.div>\n </AnimatePresence>\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/client-tweet-card.json b/apps/www/public/r/client-tweet-card.json
index b48d0400..98ac10c1 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} {...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/icon-cloud.json b/apps/www/public/r/icon-cloud.json
index 9131fa6e..412ba23e 100644
--- a/apps/www/public/r/icon-cloud.json
+++ b/apps/www/public/r/icon-cloud.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/magicui/icon-cloud.tsx",
- "content": "\"use client\"\n\nimport React, { useEffect, useRef, useState } from \"react\"\nimport { renderToString } from \"react-dom/server\"\n\ninterface Icon {\n x: number\n y: number\n z: number\n scale: number\n opacity: number\n id: number\n}\n\ninterface IconCloudProps {\n icons?: React.ReactNode[]\n images?: string[]\n}\n\nfunction easeOutCubic(t: number): number {\n return 1 - Math.pow(1 - t, 3)\n}\n\nexport function IconCloud({ icons, images }: IconCloudProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const [iconPositions, setIconPositions] = useState<Icon[]>([])\n const [rotation, setRotation] = useState({ x: 0, y: 0 })\n const [isDragging, setIsDragging] = useState(false)\n const [lastMousePos, setLastMousePos] = useState({ x: 0, y: 0 })\n const [mousePos, setMousePos] = useState({ x: 0, y: 0 })\n const [targetRotation, setTargetRotation] = useState<{\n x: number\n y: number\n startX: number\n startY: number\n distance: number\n startTime: number\n duration: number\n } | null>(null)\n const animationFrameRef = useRef<number>(0)\n const rotationRef = useRef(rotation)\n const iconCanvasesRef = useRef<HTMLCanvasElement[]>([])\n const imagesLoadedRef = useRef<boolean[]>([])\n\n // Create icon canvases once when icons/images change\n useEffect(() => {\n if (!icons && !images) return\n\n const items = icons || images || []\n imagesLoadedRef.current = new Array(items.length).fill(false)\n\n const newIconCanvases = items.map((item, index) => {\n const offscreen = document.createElement(\"canvas\")\n offscreen.width = 40\n offscreen.height = 40\n const offCtx = offscreen.getContext(\"2d\")\n\n if (offCtx) {\n if (images) {\n // Handle image URLs directly\n const img = new Image()\n img.crossOrigin = \"anonymous\"\n img.src = items[index] as string\n img.onload = () => {\n offCtx.clearRect(0, 0, offscreen.width, offscreen.height)\n\n // Create circular clipping path\n offCtx.beginPath()\n offCtx.arc(20, 20, 20, 0, Math.PI * 2)\n offCtx.closePath()\n offCtx.clip()\n\n // Draw the image\n offCtx.drawImage(img, 0, 0, 40, 40)\n\n imagesLoadedRef.current[index] = true\n }\n } else {\n // Handle SVG icons\n offCtx.scale(0.4, 0.4)\n const svgString = renderToString(item as React.ReactElement)\n const img = new Image()\n img.src = \"data:image/svg+xml;base64,\" + btoa(svgString)\n img.onload = () => {\n offCtx.clearRect(0, 0, offscreen.width, offscreen.height)\n offCtx.drawImage(img, 0, 0)\n imagesLoadedRef.current[index] = true\n }\n }\n }\n return offscreen\n })\n\n iconCanvasesRef.current = newIconCanvases\n }, [icons, images])\n\n // Generate initial icon positions on a sphere\n useEffect(() => {\n const items = icons || images || []\n const newIcons: Icon[] = []\n const numIcons = items.length || 20\n\n // Fibonacci sphere parameters\n const offset = 2 / numIcons\n const increment = Math.PI * (3 - Math.sqrt(5))\n\n for (let i = 0; i < numIcons; i++) {\n const y = i * offset - 1 + offset / 2\n const r = Math.sqrt(1 - y * y)\n const phi = i * increment\n\n const x = Math.cos(phi) * r\n const z = Math.sin(phi) * r\n\n newIcons.push({\n x: x * 100,\n y: y * 100,\n z: z * 100,\n scale: 1,\n opacity: 1,\n id: i,\n })\n }\n setIconPositions(newIcons)\n }, [icons, images])\n\n // Handle mouse events\n const handleMouseDown = (e: React.MouseEvent<HTMLCanvasElement>) => {\n const rect = canvasRef.current?.getBoundingClientRect()\n if (!rect || !canvasRef.current) return\n\n const x = e.clientX - rect.left\n const y = e.clientY - rect.top\n\n const ctx = canvasRef.current.getContext(\"2d\")\n if (!ctx) return\n\n iconPositions.forEach((icon) => {\n const cosX = Math.cos(rotationRef.current.x)\n const sinX = Math.sin(rotationRef.current.x)\n const cosY = Math.cos(rotationRef.current.y)\n const sinY = Math.sin(rotationRef.current.y)\n\n const rotatedX = icon.x * cosY - icon.z * sinY\n const rotatedZ = icon.x * sinY + icon.z * cosY\n const rotatedY = icon.y * cosX + rotatedZ * sinX\n\n const screenX = canvasRef.current!.width / 2 + rotatedX\n const screenY = canvasRef.current!.height / 2 + rotatedY\n\n const scale = (rotatedZ + 200) / 300\n const radius = 20 * scale\n const dx = x - screenX\n const dy = y - screenY\n\n if (dx * dx + dy * dy < radius * radius) {\n const targetX = -Math.atan2(\n icon.y,\n Math.sqrt(icon.x * icon.x + icon.z * icon.z)\n )\n const targetY = Math.atan2(icon.x, icon.z)\n\n const currentX = rotationRef.current.x\n const currentY = rotationRef.current.y\n const distance = Math.sqrt(\n Math.pow(targetX - currentX, 2) + Math.pow(targetY - currentY, 2)\n )\n\n const duration = Math.min(2000, Math.max(800, distance * 1000))\n\n setTargetRotation({\n x: targetX,\n y: targetY,\n startX: currentX,\n startY: currentY,\n distance,\n startTime: performance.now(),\n duration,\n })\n return\n }\n })\n\n setIsDragging(true)\n setLastMousePos({ x: e.clientX, y: e.clientY })\n }\n\n const handleMouseMove = (e: React.MouseEvent<HTMLCanvasElement>) => {\n const rect = canvasRef.current?.getBoundingClientRect()\n if (rect) {\n const x = e.clientX - rect.left\n const y = e.clientY - rect.top\n setMousePos({ x, y })\n }\n\n if (isDragging) {\n const deltaX = e.clientX - lastMousePos.x\n const deltaY = e.clientY - lastMousePos.y\n\n rotationRef.current = {\n x: rotationRef.current.x + deltaY * 0.002,\n y: rotationRef.current.y + deltaX * 0.002,\n }\n\n setLastMousePos({ x: e.clientX, y: e.clientY })\n }\n }\n\n const handleMouseUp = () => {\n setIsDragging(false)\n }\n\n // Animation and rendering\n useEffect(() => {\n const canvas = canvasRef.current\n const ctx = canvas?.getContext(\"2d\")\n if (!canvas || !ctx) return\n\n const animate = () => {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n const centerX = canvas.width / 2\n const centerY = canvas.height / 2\n const maxDistance = Math.sqrt(centerX * centerX + centerY * centerY)\n const dx = mousePos.x - centerX\n const dy = mousePos.y - centerY\n const distance = Math.sqrt(dx * dx + dy * dy)\n const speed = 0.003 + (distance / maxDistance) * 0.01\n\n if (targetRotation) {\n const elapsed = performance.now() - targetRotation.startTime\n const progress = Math.min(1, elapsed / targetRotation.duration)\n const easedProgress = easeOutCubic(progress)\n\n rotationRef.current = {\n x:\n targetRotation.startX +\n (targetRotation.x - targetRotation.startX) * easedProgress,\n y:\n targetRotation.startY +\n (targetRotation.y - targetRotation.startY) * easedProgress,\n }\n\n if (progress >= 1) {\n setTargetRotation(null)\n }\n } else if (!isDragging) {\n rotationRef.current = {\n x: rotationRef.current.x + (dy / canvas.height) * speed,\n y: rotationRef.current.y + (dx / canvas.width) * speed,\n }\n }\n\n iconPositions.forEach((icon, index) => {\n const cosX = Math.cos(rotationRef.current.x)\n const sinX = Math.sin(rotationRef.current.x)\n const cosY = Math.cos(rotationRef.current.y)\n const sinY = Math.sin(rotationRef.current.y)\n\n const rotatedX = icon.x * cosY - icon.z * sinY\n const rotatedZ = icon.x * sinY + icon.z * cosY\n const rotatedY = icon.y * cosX + rotatedZ * sinX\n\n const scale = (rotatedZ + 200) / 300\n const opacity = Math.max(0.2, Math.min(1, (rotatedZ + 150) / 200))\n\n ctx.save()\n ctx.translate(canvas.width / 2 + rotatedX, canvas.height / 2 + rotatedY)\n ctx.scale(scale, scale)\n ctx.globalAlpha = opacity\n\n if (icons || images) {\n // Only try to render icons/images if they exist\n if (\n iconCanvasesRef.current[index] &&\n imagesLoadedRef.current[index]\n ) {\n ctx.drawImage(iconCanvasesRef.current[index], -20, -20, 40, 40)\n }\n } else {\n // Show numbered circles if no icons/images are provided\n ctx.beginPath()\n ctx.arc(0, 0, 20, 0, Math.PI * 2)\n ctx.fillStyle = \"#4444ff\"\n ctx.fill()\n ctx.fillStyle = \"white\"\n ctx.textAlign = \"center\"\n ctx.textBaseline = \"middle\"\n ctx.font = \"16px Arial\"\n ctx.fillText(`${icon.id + 1}`, 0, 0)\n }\n\n ctx.restore()\n })\n animationFrameRef.current = requestAnimationFrame(animate)\n }\n\n animate()\n\n return () => {\n if (animationFrameRef.current) {\n cancelAnimationFrame(animationFrameRef.current)\n }\n }\n }, [icons, images, iconPositions, isDragging, mousePos, targetRotation])\n\n return (\n <canvas\n ref={canvasRef}\n width={400}\n height={400}\n onMouseDown={handleMouseDown}\n onMouseMove={handleMouseMove}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseUp}\n className=\"rounded-lg\"\n aria-label=\"Interactive 3D Icon Cloud\"\n role=\"img\"\n />\n )\n}\n",
+ "content": "\"use client\"\n\nimport React, { useEffect, useRef, useState } from \"react\"\nimport { renderToString } from \"react-dom/server\"\n\ninterface Icon {\n x: number\n y: number\n z: number\n scale: number\n opacity: number\n id: number\n}\n\ninterface IconCloudProps {\n icons?: React.ReactNode[]\n images?: string[]\n}\n\nfunction easeOutCubic(t: number): number {\n return 1 - Math.pow(1 - t, 3)\n}\n\nexport function IconCloud({ icons, images }: IconCloudProps) {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n const [iconPositions, setIconPositions] = useState<Icon[]>([])\n const [rotation, setRotation] = useState({ x: 0, y: 0 })\n const [isDragging, setIsDragging] = useState(false)\n const [lastMousePos, setLastMousePos] = useState({ x: 0, y: 0 })\n const [mousePos, setMousePos] = useState({ x: 0, y: 0 })\n const [targetRotation, setTargetRotation] = useState<{\n x: number\n y: number\n startX: number\n startY: number\n distance: number\n startTime: number\n duration: number\n } | null>(null)\n const animationFrameRef = useRef<number>(0)\n const rotationRef = useRef(rotation)\n const iconCanvasesRef = useRef<HTMLCanvasElement[]>([])\n const imagesLoadedRef = useRef<boolean[]>([])\n\n // Create icon canvases once when icons/images change\n useEffect(() => {\n if (!icons && !images) return\n\n const items = icons ?? images ?? []\n imagesLoadedRef.current = new Array(items.length).fill(false)\n\n const newIconCanvases = items.map((item, index) => {\n const offscreen = document.createElement(\"canvas\")\n offscreen.width = 40\n offscreen.height = 40\n const offCtx = offscreen.getContext(\"2d\")\n\n if (offCtx) {\n if (images) {\n // Handle image URLs directly\n const img = new Image()\n img.crossOrigin = \"anonymous\"\n img.src = items[index] as string\n img.onload = () => {\n offCtx.clearRect(0, 0, offscreen.width, offscreen.height)\n\n // Create circular clipping path\n offCtx.beginPath()\n offCtx.arc(20, 20, 20, 0, Math.PI * 2)\n offCtx.closePath()\n offCtx.clip()\n\n // Draw the image\n offCtx.drawImage(img, 0, 0, 40, 40)\n\n imagesLoadedRef.current[index] = true\n }\n } else {\n // Handle SVG icons\n offCtx.scale(0.4, 0.4)\n const svgString = renderToString(item as React.ReactElement)\n const img = new Image()\n img.src = \"data:image/svg+xml;base64,\" + btoa(svgString)\n img.onload = () => {\n offCtx.clearRect(0, 0, offscreen.width, offscreen.height)\n offCtx.drawImage(img, 0, 0)\n imagesLoadedRef.current[index] = true\n }\n }\n }\n return offscreen\n })\n\n iconCanvasesRef.current = newIconCanvases\n }, [icons, images])\n\n // Generate initial icon positions on a sphere\n useEffect(() => {\n const items = icons ?? images ?? []\n const newIcons: Icon[] = []\n const numIcons = items.length || 20\n\n // Fibonacci sphere parameters\n const offset = 2 / numIcons\n const increment = Math.PI * (3 - Math.sqrt(5))\n\n for (let i = 0; i < numIcons; i++) {\n const y = i * offset - 1 + offset / 2\n const r = Math.sqrt(1 - y * y)\n const phi = i * increment\n\n const x = Math.cos(phi) * r\n const z = Math.sin(phi) * r\n\n newIcons.push({\n x: x * 100,\n y: y * 100,\n z: z * 100,\n scale: 1,\n opacity: 1,\n id: i,\n })\n }\n setIconPositions(newIcons)\n }, [icons, images])\n\n // Handle mouse events\n const handleMouseDown = (e: React.MouseEvent<HTMLCanvasElement>) => {\n const rect = canvasRef.current?.getBoundingClientRect()\n if (!rect || !canvasRef.current) return\n\n const x = e.clientX - rect.left\n const y = e.clientY - rect.top\n\n const ctx = canvasRef.current.getContext(\"2d\")\n if (!ctx) return\n\n iconPositions.forEach((icon) => {\n const cosX = Math.cos(rotationRef.current.x)\n const sinX = Math.sin(rotationRef.current.x)\n const cosY = Math.cos(rotationRef.current.y)\n const sinY = Math.sin(rotationRef.current.y)\n\n const rotatedX = icon.x * cosY - icon.z * sinY\n const rotatedZ = icon.x * sinY + icon.z * cosY\n const rotatedY = icon.y * cosX + rotatedZ * sinX\n\n const screenX = canvasRef.current!.width / 2 + rotatedX\n const screenY = canvasRef.current!.height / 2 + rotatedY\n\n const scale = (rotatedZ + 200) / 300\n const radius = 20 * scale\n const dx = x - screenX\n const dy = y - screenY\n\n if (dx * dx + dy * dy < radius * radius) {\n const targetX = -Math.atan2(\n icon.y,\n Math.sqrt(icon.x * icon.x + icon.z * icon.z)\n )\n const targetY = Math.atan2(icon.x, icon.z)\n\n const currentX = rotationRef.current.x\n const currentY = rotationRef.current.y\n const distance = Math.sqrt(\n Math.pow(targetX - currentX, 2) + Math.pow(targetY - currentY, 2)\n )\n\n const duration = Math.min(2000, Math.max(800, distance * 1000))\n\n setTargetRotation({\n x: targetX,\n y: targetY,\n startX: currentX,\n startY: currentY,\n distance,\n startTime: performance.now(),\n duration,\n })\n return\n }\n })\n\n setIsDragging(true)\n setLastMousePos({ x: e.clientX, y: e.clientY })\n }\n\n const handleMouseMove = (e: React.MouseEvent<HTMLCanvasElement>) => {\n const rect = canvasRef.current?.getBoundingClientRect()\n if (rect) {\n const x = e.clientX - rect.left\n const y = e.clientY - rect.top\n setMousePos({ x, y })\n }\n\n if (isDragging) {\n const deltaX = e.clientX - lastMousePos.x\n const deltaY = e.clientY - lastMousePos.y\n\n rotationRef.current = {\n x: rotationRef.current.x + deltaY * 0.002,\n y: rotationRef.current.y + deltaX * 0.002,\n }\n\n setLastMousePos({ x: e.clientX, y: e.clientY })\n }\n }\n\n const handleMouseUp = () => {\n setIsDragging(false)\n }\n\n // Animation and rendering\n useEffect(() => {\n const canvas = canvasRef.current\n const ctx = canvas?.getContext(\"2d\")\n if (!canvas || !ctx) return\n\n const animate = () => {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n const centerX = canvas.width / 2\n const centerY = canvas.height / 2\n const maxDistance = Math.sqrt(centerX * centerX + centerY * centerY)\n const dx = mousePos.x - centerX\n const dy = mousePos.y - centerY\n const distance = Math.sqrt(dx * dx + dy * dy)\n const speed = 0.003 + (distance / maxDistance) * 0.01\n\n if (targetRotation) {\n const elapsed = performance.now() - targetRotation.startTime\n const progress = Math.min(1, elapsed / targetRotation.duration)\n const easedProgress = easeOutCubic(progress)\n\n rotationRef.current = {\n x:\n targetRotation.startX +\n (targetRotation.x - targetRotation.startX) * easedProgress,\n y:\n targetRotation.startY +\n (targetRotation.y - targetRotation.startY) * easedProgress,\n }\n\n if (progress >= 1) {\n setTargetRotation(null)\n }\n } else if (!isDragging) {\n rotationRef.current = {\n x: rotationRef.current.x + (dy / canvas.height) * speed,\n y: rotationRef.current.y + (dx / canvas.width) * speed,\n }\n }\n\n iconPositions.forEach((icon, index) => {\n const cosX = Math.cos(rotationRef.current.x)\n const sinX = Math.sin(rotationRef.current.x)\n const cosY = Math.cos(rotationRef.current.y)\n const sinY = Math.sin(rotationRef.current.y)\n\n const rotatedX = icon.x * cosY - icon.z * sinY\n const rotatedZ = icon.x * sinY + icon.z * cosY\n const rotatedY = icon.y * cosX + rotatedZ * sinX\n\n const scale = (rotatedZ + 200) / 300\n const opacity = Math.max(0.2, Math.min(1, (rotatedZ + 150) / 200))\n\n ctx.save()\n ctx.translate(canvas.width / 2 + rotatedX, canvas.height / 2 + rotatedY)\n ctx.scale(scale, scale)\n ctx.globalAlpha = opacity\n\n if (icons || images) {\n // Only try to render icons/images if they exist\n if (\n iconCanvasesRef.current[index] &&\n imagesLoadedRef.current[index]\n ) {\n ctx.drawImage(iconCanvasesRef.current[index], -20, -20, 40, 40)\n }\n } else {\n // Show numbered circles if no icons/images are provided\n ctx.beginPath()\n ctx.arc(0, 0, 20, 0, Math.PI * 2)\n ctx.fillStyle = \"#4444ff\"\n ctx.fill()\n ctx.fillStyle = \"white\"\n ctx.textAlign = \"center\"\n ctx.textBaseline = \"middle\"\n ctx.font = \"16px Arial\"\n ctx.fillText(`${icon.id + 1}`, 0, 0)\n }\n\n ctx.restore()\n })\n animationFrameRef.current = requestAnimationFrame(animate)\n }\n\n animate()\n\n return () => {\n if (animationFrameRef.current) {\n cancelAnimationFrame(animationFrameRef.current)\n }\n }\n }, [icons, images, iconPositions, isDragging, mousePos, targetRotation])\n\n return (\n <canvas\n ref={canvasRef}\n width={400}\n height={400}\n onMouseDown={handleMouseDown}\n onMouseMove={handleMouseMove}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseUp}\n className=\"rounded-lg\"\n aria-label=\"Interactive 3D Icon Cloud\"\n role=\"img\"\n />\n )\n}\n",
"type": "registry:ui"
}
]
diff --git a/apps/www/public/r/tweet-card.json b/apps/www/public/r/tweet-card.json
index 07fb59dc..f70b5fc0 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 { 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-xl 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 items-start justify-between tracking-normal\">\n <div className=\"flex items-center space-x-3\">\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"shrink-0\"\n >\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=\"border-border/50 overflow-hidden rounded-full border\"\n />\n </a>\n <div className=\"flex flex-col gap-0.5\">\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-foreground flex items-center font-medium whitespace-nowrap transition-opacity hover:opacity-80\"\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-muted-foreground hover:text-foreground text-sm transition-colors\"\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=\"text-muted-foreground hover:text-foreground size-5 items-start transition-all ease-in-out hover:scale-105\" />\n </a>\n </div>\n)\n\nexport const TweetBody = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"text-[15px] leading-relaxed tracking-normal wrap-break-word\">\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-muted-foreground hover:text-foreground text-[15px] font-normal transition-colors\"\n >\n <span>{entity.text}</span>\n </a>\n )\n case \"text\":\n return (\n <span\n key={idx}\n className=\"text-foreground text-[15px] 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-4 overflow-hidden rounded-xl border p-5\",\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-xl 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 items-start justify-between tracking-normal\">\n <div className=\"flex items-center space-x-3\">\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"shrink-0\"\n >\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=\"border-border/50 overflow-hidden rounded-full border\"\n />\n </a>\n <div className=\"flex flex-col gap-0.5\">\n <a\n href={tweet.user.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-foreground flex items-center font-medium whitespace-nowrap transition-opacity hover:opacity-80\"\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-muted-foreground hover:text-foreground text-sm transition-colors\"\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=\"text-muted-foreground hover:text-foreground size-5 items-start transition-all ease-in-out hover:scale-105\" />\n </a>\n </div>\n)\n\nexport const TweetBody = ({ tweet }: { tweet: EnrichedTweet }) => (\n <div className=\"text-[15px] leading-relaxed tracking-normal wrap-break-word\">\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-muted-foreground hover:text-foreground text-[15px] font-normal transition-colors\"\n >\n <span>{entity.text}</span>\n </a>\n )\n case \"text\":\n return (\n <span\n key={idx}\n className=\"text-foreground text-[15px] 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-4 overflow-hidden rounded-xl border p-5\",\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 1c931125..83255623 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, useMemo, useRef, useState } from \"react\"\nimport { motion, useInView, type MotionProps } 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",
+ "content": "\"use client\"\n\nimport { useEffect, useMemo, useRef, useState } from \"react\"\nimport { motion, useInView, type MotionProps } 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/__index__.tsx b/apps/www/registry/__index__.tsx
index 28b83d4c..ad873423 100644
--- a/apps/www/registry/__index__.tsx
+++ b/apps/www/registry/__index__.tsx
@@ -27,8 +27,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/magic-card.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -44,8 +44,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/android.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -61,8 +61,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/warp-background.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -78,8 +78,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/line-shadow-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -95,8 +95,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/aurora-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -112,8 +112,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/morphing-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -129,8 +129,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/scroll-progress.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -146,8 +146,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/lens.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -163,8 +163,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/pointer.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -180,8 +180,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/smooth-cursor.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -197,8 +197,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/progressive-blur.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -214,8 +214,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/neon-gradient-card.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -231,8 +231,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/meteors.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -248,8 +248,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/grid-pattern.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -265,8 +265,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/striped-pattern.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -282,8 +282,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/interactive-grid-pattern.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -299,8 +299,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/dot-pattern.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -316,8 +316,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/flickering-grid.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -333,8 +333,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/hero-video-dialog.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -350,8 +350,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/code-comparison.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -367,8 +367,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/marquee.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -384,8 +384,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/globe.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -401,8 +401,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/shimmer-button.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -418,8 +418,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/tweet-card.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -435,8 +435,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/client-tweet-card.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -452,8 +452,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/bento-grid.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -469,8 +469,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/particles.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -486,8 +486,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/number-ticker.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -503,8 +503,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/ripple.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -520,8 +520,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/retro-grid.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -537,8 +537,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/animated-list.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -554,8 +554,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/animated-shiny-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -571,8 +571,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/animated-grid-pattern.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -588,8 +588,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/border-beam.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -605,8 +605,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/animated-beam.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -622,8 +622,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/text-reveal.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -639,8 +639,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/hyper-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -656,8 +656,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/animated-gradient-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -673,8 +673,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/orbiting-circles.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -690,8 +690,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/dock.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -707,8 +707,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/word-rotate.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -724,8 +724,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/avatar-circles.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -741,8 +741,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/typing-animation.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -758,8 +758,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/sparkles-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -775,8 +775,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/spinning-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -792,8 +792,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/comic-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -809,8 +809,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/icon-cloud.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -826,8 +826,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/text-animate.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -843,8 +843,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/scroll-based-velocity.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -860,8 +860,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/shiny-button.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -877,8 +877,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/shine-border.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -894,8 +894,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/animated-circular-progress-bar.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -911,8 +911,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/confetti.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -928,8 +928,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/cool-mode.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -945,8 +945,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/pulsating-button.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -962,8 +962,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/ripple-button.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -979,8 +979,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/file-tree.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -996,8 +996,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/blur-fade.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1013,8 +1013,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/safari.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1030,8 +1030,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/iphone.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1047,8 +1047,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/rainbow-button.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1064,8 +1064,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/interactive-hover-button.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1081,8 +1081,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/terminal.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1098,8 +1098,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/video-text.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1115,8 +1115,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/pixel-image.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1132,8 +1132,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/highlighter.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1149,8 +1149,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/animated-theme-toggler.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1166,8 +1166,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/light-rays.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1183,8 +1183,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/magicui/dotted-map.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1200,8 +1200,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/magic-card-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1217,8 +1217,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/android-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1234,8 +1234,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/android-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1251,8 +1251,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/android-demo-3.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1268,8 +1268,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/warp-background-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1285,8 +1285,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/line-shadow-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1302,8 +1302,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/aurora-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1319,8 +1319,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/morphing-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1336,8 +1336,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/scroll-progress-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1353,8 +1353,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/lens-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1370,8 +1370,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/lens-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1387,8 +1387,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/lens-demo-3.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1404,8 +1404,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/pointer-demo-1.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1421,8 +1421,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/smooth-cursor-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1438,8 +1438,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/progressive-blur-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1455,8 +1455,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/neon-gradient-card-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1472,8 +1472,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/meteors-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1489,8 +1489,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/grid-pattern-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1506,8 +1506,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/striped-pattern-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1523,8 +1523,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/striped-pattern-dashed.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1540,8 +1540,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/striped-pattern-right.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1557,8 +1557,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/grid-pattern-linear-gradient.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1574,8 +1574,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/grid-pattern-dashed.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1591,8 +1591,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/dot-pattern-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1608,8 +1608,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/dot-pattern-linear-gradient.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1625,8 +1625,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/dot-pattern-with-glow-effect.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1642,8 +1642,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/flickering-grid-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1659,8 +1659,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/flickering-grid-rounded-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1676,8 +1676,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/hero-video-dialog-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1693,8 +1693,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/hero-video-dialog-demo-top-in-bottom-out.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1710,8 +1710,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/code-comparison-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1727,8 +1727,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/marquee-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1744,8 +1744,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/marquee-demo-vertical.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1761,8 +1761,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/marquee-logos.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1778,8 +1778,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/marquee-3d.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1795,8 +1795,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/globe-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1812,8 +1812,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/tweet-card-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1829,8 +1829,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/tweet-card-images.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1846,8 +1846,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/tweet-card-meta-preview.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1863,8 +1863,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/shimmer-button-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1880,8 +1880,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/bento-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1897,8 +1897,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/bento-demo-vertical.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1914,8 +1914,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/number-ticker-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1931,8 +1931,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/number-ticker-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1948,8 +1948,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/number-ticker-decimal-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1965,8 +1965,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/ripple-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1982,8 +1982,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/retro-grid-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -1999,8 +1999,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-list-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2016,8 +2016,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-shiny-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2033,8 +2033,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/particles-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2050,8 +2050,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-grid-pattern-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2067,8 +2067,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/interactive-grid-pattern-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2084,8 +2084,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/interactive-grid-pattern-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2101,8 +2101,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/border-beam-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2118,8 +2118,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/border-beam-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2135,8 +2135,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/border-beam-demo-3.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2152,8 +2152,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/border-beam-demo-4.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2169,8 +2169,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-beam-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2186,8 +2186,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-beam-unidirectional.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2203,8 +2203,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-beam-bidirectional.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2220,8 +2220,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-beam-multiple-inputs.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2237,8 +2237,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-beam-multiple-outputs.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2254,8 +2254,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-reveal-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2271,8 +2271,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-gradient-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2288,8 +2288,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-gradient-text-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2305,8 +2305,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/orbiting-circles-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2322,8 +2322,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/dock-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2339,8 +2339,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/dock-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2356,8 +2356,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/dock-demo-3.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2373,8 +2373,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/word-rotate-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2390,8 +2390,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/hyper-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2407,8 +2407,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/avatar-circles-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2424,8 +2424,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/typing-animation-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2441,8 +2441,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/typing-animation-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2458,8 +2458,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/typing-animation-demo-3.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2475,8 +2475,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/typing-animation-demo-4.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2492,8 +2492,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/typing-animation-demo-5.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2509,8 +2509,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/typing-animation-demo-6.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2526,8 +2526,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/typing-animation-demo-7.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2543,8 +2543,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/typing-animation-demo-8.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2560,8 +2560,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/scroll-based-velocity-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2577,8 +2577,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/scroll-based-velocity-images-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2594,8 +2594,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/sparkles-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2611,8 +2611,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/spinning-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2628,8 +2628,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/spinning-text-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2645,8 +2645,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/comic-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2662,8 +2662,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/icon-cloud-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2679,8 +2679,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/icon-cloud-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2696,8 +2696,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/icon-cloud-demo-3.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2713,8 +2713,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-animate-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2730,8 +2730,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-animate-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2747,8 +2747,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-animate-demo-3.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2764,8 +2764,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-animate-demo-4.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2781,8 +2781,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-animate-demo-5.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2798,8 +2798,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-animate-demo-6.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2815,8 +2815,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-animate-demo-7.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2832,8 +2832,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-animate-demo-8.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2849,8 +2849,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/text-animate-demo-9.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2866,8 +2866,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/shiny-button-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2883,8 +2883,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-circular-progress-bar-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2900,8 +2900,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/shine-border-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2917,8 +2917,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/shine-border-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2934,8 +2934,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/confetti-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2951,8 +2951,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/confetti-basic-cannon.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2968,8 +2968,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/confetti-random-direction.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -2985,8 +2985,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/confetti-fireworks.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3002,8 +3002,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/confetti-stars.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3019,8 +3019,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/confetti-side-cannons.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3036,8 +3036,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/confetti-custom-shapes.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3053,8 +3053,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/confetti-emoji.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3070,8 +3070,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/cool-mode-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3087,8 +3087,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/cool-mode-custom.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3104,8 +3104,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/pulsating-button-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3121,8 +3121,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/ripple-button-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3138,8 +3138,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/file-tree-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3155,8 +3155,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/blur-fade-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3172,8 +3172,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/blur-fade-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3189,8 +3189,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/safari-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3206,8 +3206,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/safari-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3223,8 +3223,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/safari-demo-3.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3240,8 +3240,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/safari-demo-4.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3257,8 +3257,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/iphone-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3274,8 +3274,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/iphone-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3291,8 +3291,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/iphone-demo-3.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3308,8 +3308,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/rainbow-button-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3325,8 +3325,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/rainbow-button-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3342,8 +3342,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/interactive-hover-button-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3359,8 +3359,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/terminal-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3376,8 +3376,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/terminal-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3393,8 +3393,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/video-text-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3410,8 +3410,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/pixel-image-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3431,8 +3431,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/highlighter-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3448,8 +3448,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/animated-theme-toggler-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3465,8 +3465,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/light-rays-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3482,8 +3482,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/dotted-map-demo.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3499,8 +3499,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/example/dotted-map-demo-2.tsx")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
@@ -3516,8 +3516,8 @@ export const Index: Record<string, any> = {
}],
component: React.lazy(async () => {
const mod = await import("@/registry/lib/utils.ts")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
}),
meta: undefined,
},
diff --git a/apps/www/registry/magicui/blur-fade.tsx b/apps/www/registry/magicui/blur-fade.tsx
index 1a546c4b..fe7ca1e5 100644
--- a/apps/www/registry/magicui/blur-fade.tsx
+++ b/apps/www/registry/magicui/blur-fade.tsx
@@ -60,7 +60,7 @@ export function BlurFade({
filter: `blur(0px)`,
},
}
- const combinedVariants = variant || defaultVariants
+ const combinedVariants = variant ?? defaultVariants
const hiddenFilter = getFilter(combinedVariants.hidden)
const visibleFilter = getFilter(combinedVariants.visible)
diff --git a/apps/www/registry/magicui/client-tweet-card.tsx b/apps/www/registry/magicui/client-tweet-card.tsx
index 22a70371..d5c03f9b 100644
--- a/apps/www/registry/magicui/client-tweet-card.tsx
+++ b/apps/www/registry/magicui/client-tweet-card.tsx
@@ -21,7 +21,7 @@ export const ClientTweetCard = ({
if (isLoading) return fallback
if (error || !data) {
- const NotFound = components?.TweetNotFound || TweetNotFound
+ const NotFound = components?.TweetNotFound ?? TweetNotFound
return <NotFound error={onError ? onError(error) : error} />
}
diff --git a/apps/www/registry/magicui/icon-cloud.tsx b/apps/www/registry/magicui/icon-cloud.tsx
index f7e7559b..3406e857 100644
--- a/apps/www/registry/magicui/icon-cloud.tsx
+++ b/apps/www/registry/magicui/icon-cloud.tsx
@@ -46,7 +46,7 @@ export function IconCloud({ icons, images }: IconCloudProps) {
useEffect(() => {
if (!icons && !images) return
- const items = icons || images || []
+ const items = icons ?? images ?? []
imagesLoadedRef.current = new Array(items.length).fill(false)
const newIconCanvases = items.map((item, index) => {
@@ -96,7 +96,7 @@ export function IconCloud({ icons, images }: IconCloudProps) {
// Generate initial icon positions on a sphere
useEffect(() => {
- const items = icons || images || []
+ const items = icons ?? images ?? []
const newIcons: Icon[] = []
const numIcons = items.length || 20
diff --git a/apps/www/registry/magicui/tweet-card.tsx b/apps/www/registry/magicui/tweet-card.tsx
index 8a3f19d8..a7b10a75 100644
--- a/apps/www/registry/magicui/tweet-card.tsx
+++ b/apps/www/registry/magicui/tweet-card.tsx
@@ -275,7 +275,7 @@ export const TweetCard = async ({
: undefined
if (!tweet) {
- const NotFound = components?.TweetNotFound || TweetNotFound
+ const NotFound = components?.TweetNotFound ?? TweetNotFound
return <NotFound {...props} />
}
diff --git a/apps/www/registry/magicui/typing-animation.tsx b/apps/www/registry/magicui/typing-animation.tsx
index 88f16db4..a1951b0b 100644
--- a/apps/www/registry/magicui/typing-animation.tsx
+++ b/apps/www/registry/magicui/typing-animation.tsx
@@ -54,13 +54,13 @@ export function TypingAnimation({
})
const wordsToAnimate = useMemo(
- () => words || (children ? [children] : []),
+ () => words ?? (children ? [children] : []),
[words, children]
)
const hasMultipleWords = wordsToAnimate.length > 1
- const typingSpeed = typeSpeed || duration
- const deletingSpeed = deleteSpeed || typingSpeed / 2
+ const typingSpeed = typeSpeed ?? duration
+ const deletingSpeed = deleteSpeed ?? typingSpeed / 2
const shouldStart = startOnView ? isInView : true
diff --git a/apps/www/scripts/build-registry.mts b/apps/www/scripts/build-registry.mts
index aa37ed46..e9241a85 100644
--- a/apps/www/scripts/build-registry.mts
+++ b/apps/www/scripts/build-registry.mts
@@ -47,8 +47,8 @@ export const Index: Record<string, any> = {`
componentPath
? `React.lazy(async () => {
const mod = await import("${componentPath}")
- const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
- return { default: mod.default || mod[exportName] }
+ const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') ?? item.name
+ return { default: mod.default ?? mod[exportName] }
})`
: "null"
},