{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "logo-cloud",
  "title": "Logo Cloud",
  "description": "Customer or partner logos in a grid or a scrolling marquee under a small title.",
  "registryDependencies": [
    "@corsair-ui/utils",
    "@corsair-ui/marquee"
  ],
  "files": [
    {
      "path": "registry/default/components/blocks/logo-cloud.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport { cn } from \"@/registry/default/lib/utils\";\nimport { Marquee } from \"@/registry/default/ui/marquee\";\n\ninterface LogoCloudLogo {\n  /** Stable React key. Falls back to the index. */\n  id?: string;\n  /** The accessible name of the logo. Shown as a text wordmark when there is no `logo`. */\n  name: string;\n  /** An image or SVG. Its own text is replaced by `name` for screen readers. */\n  logo?: ReactNode;\n  /** Makes the logo a link. */\n  href?: string;\n}\n\ntype LogoCloudVariant = \"grid\" | \"marquee\";\n\ninterface LogoCloudProps extends Omit<ComponentProps<\"section\">, \"title\"> {\n  /** Small centred line above the logos, rendered in an `<h2>`; pass `null` to hide it. */\n  title?: ReactNode;\n  logos?: LogoCloudLogo[];\n  /** A static grid, or a row that scrolls in a loop. */\n  variant?: LogoCloudVariant;\n}\n\nconst defaultLogos: LogoCloudLogo[] = [\n  { id: \"northwind\", name: \"Northwind\" },\n  { id: \"lumen\", name: \"Lumen Labs\" },\n  { id: \"quanta\", name: \"Quanta\" },\n  { id: \"evergreen\", name: \"Evergreen\" },\n  { id: \"polaris\", name: \"Polaris\" },\n  { id: \"brightpath\", name: \"Brightpath\" },\n];\n\nfunction LogoCloudMark({ name, logo, href }: LogoCloudLogo) {\n  if (href) {\n    return (\n      <a\n        href={href}\n        aria-label={logo != null ? name : undefined}\n        data-slot=\"logo-cloud-link\"\n        className=\"group/logo focus-visible:ring-ring/50 flex items-center rounded-md outline-none focus-visible:ring-[3px]\"\n      >\n        {logo ?? <LogoCloudWordmark name={name} />}\n      </a>\n    );\n  }\n  if (logo != null) {\n    return (\n      <span role=\"img\" aria-label={name} data-slot=\"logo-cloud-image\" className=\"flex items-center\">\n        {logo}\n      </span>\n    );\n  }\n  return <LogoCloudWordmark name={name} />;\n}\n\nfunction LogoCloudWordmark({ name }: { name: string }) {\n  return (\n    <span\n      data-slot=\"logo-cloud-wordmark\"\n      className=\"text-muted-foreground group-hover/logo:text-foreground text-lg font-semibold tracking-tight whitespace-nowrap transition-colors motion-reduce:transition-none\"\n    >\n      {name}\n    </span>\n  );\n}\n\n/**\n * A row of customer or partner logos under a small centred title. With no\n * props it shows six fictional names as text wordmarks; pass `logos` with an\n * image or SVG in `logo` for real marks, and `href` to make them links.\n *\n * `variant=\"grid\"` (the default) lays them out in two to six columns;\n * `variant=\"marquee\"` scrolls them in an endless loop that pauses on hover\n * and holds still with `prefers-reduced-motion`. The variant is exposed as\n * `data-variant`.\n *\n * Accessibility: every logo is named by `name`: a custom `logo` is wrapped\n * in `role=\"img\"` with that name, or the link gets it as its `aria-label`.\n * The logos are a list. In the marquee, the copies that make the loop are\n * hidden from screen readers and the keyboard.\n *\n * @example\n * <LogoCloud\n *   variant=\"marquee\"\n *   logos={[\n *     { name: \"Northwind\", logo: <img src=\"/northwind.svg\" alt=\"\" className=\"h-8\" /> },\n *     { name: \"Quanta\", href: \"#customers\" },\n *   ]}\n * />\n */\nfunction LogoCloud({\n  title = \"Trusted by teams at\",\n  logos = defaultLogos,\n  variant = \"grid\",\n  className,\n  ...props\n}: LogoCloudProps) {\n  const items = logos.map((logo, index) => (\n    <li\n      key={logo.id ?? index}\n      data-slot=\"logo-cloud-item\"\n      className={cn(\"flex items-center\", variant === \"marquee\" && \"shrink-0\")}\n    >\n      <LogoCloudMark {...logo} />\n    </li>\n  ));\n\n  return (\n    <section\n      data-slot=\"logo-cloud\"\n      data-variant={variant}\n      className={cn(\"py-16 sm:py-24\", className)}\n      {...props}\n    >\n      <div data-slot=\"logo-cloud-container\" className=\"mx-auto w-full max-w-6xl px-4 sm:px-6\">\n        {title != null ? (\n          <h2\n            data-slot=\"logo-cloud-title\"\n            className=\"text-muted-foreground text-center text-sm font-medium\"\n          >\n            {title}\n          </h2>\n        ) : null}\n        {variant === \"marquee\" ? (\n          <Marquee pauseOnHover gap=\"3rem\" className={cn(title != null && \"mt-8\")}>\n            {/* One list per copy, spaced like the gap between copies, so the loop has no seam. */}\n            <ul data-slot=\"logo-cloud-list\" className=\"flex items-center gap-12\">\n              {items}\n            </ul>\n          </Marquee>\n        ) : (\n          <ul\n            data-slot=\"logo-cloud-list\"\n            className={cn(\n              \"grid grid-cols-2 items-center justify-items-center gap-8 sm:grid-cols-3 lg:grid-cols-6\",\n              title != null && \"mt-8\"\n            )}\n          >\n            {items}\n          </ul>\n        )}\n      </div>\n    </section>\n  );\n}\n\nexport { LogoCloud, type LogoCloudLogo, type LogoCloudProps, type LogoCloudVariant };\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:block"
}