{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cta",
  "title": "Call to Action",
  "description": "A closing band with a title, a description and one or two actions.",
  "registryDependencies": [
    "@corsair-ui/utils",
    "@corsair-ui/button"
  ],
  "files": [
    {
      "path": "registry/default/components/blocks/cta.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport { cn } from \"@/registry/default/lib/utils\";\nimport { Button } from \"@/registry/default/ui/button\";\n\n// The surface of the band for each variant. The variant names come from its keys.\nconst BAND = {\n  muted: \"bg-muted\",\n  primary: \"bg-primary text-primary-foreground\",\n  outline: \"border\",\n};\n\ntype CallToActionVariant = keyof typeof BAND;\ntype CallToActionAlign = \"center\" | \"start\";\n\ninterface CallToActionProps extends Omit<ComponentProps<\"section\">, \"title\"> {\n  /** Rendered in an `<h2>`. */\n  title?: ReactNode;\n  description?: ReactNode;\n  /** Buttons or links. Defaults to \"Start for free\" and \"Talk to sales\"; pass `null` to hide them. */\n  actions?: ReactNode;\n  /** The band's surface: muted, the primary colour, or a border. */\n  variant?: CallToActionVariant;\n  /** Centred, or text on the start side with the actions on the other (from `md`). */\n  align?: CallToActionAlign;\n}\n\nfunction defaultActions(variant: CallToActionVariant) {\n  // On the primary colour, secondary and ghost buttons stay readable.\n  if (variant === \"primary\") {\n    return (\n      <>\n        <Button asChild size=\"lg\" variant=\"secondary\">\n          <a href=\"#get-started\">Start for free</a>\n        </Button>\n        <Button\n          asChild\n          size=\"lg\"\n          variant=\"ghost\"\n          className=\"text-primary-foreground hover:bg-primary-foreground/10 hover:text-primary-foreground focus-visible:ring-primary-foreground/50\"\n        >\n          <a href=\"#contact\">Talk to sales</a>\n        </Button>\n      </>\n    );\n  }\n  return (\n    <>\n      <Button asChild size=\"lg\">\n        <a href=\"#get-started\">Start for free</a>\n      </Button>\n      <Button asChild size=\"lg\" variant=\"outline\">\n        <a href=\"#contact\">Talk to sales</a>\n      </Button>\n    </>\n  );\n}\n\n/**\n * A closing call to action: a title, a short description and one or two\n * actions in a rounded band. `<CallToAction />` renders a complete example.\n *\n * `variant` picks the band's surface: `muted` (the default), `primary`\n * (the default buttons switch to secondary and ghost, so they stay\n * readable on the primary colour) or `outline`. With `align=\"start\"` the\n * text sits on the start side and the actions on the other side from\n * `md` up. Both are exposed as `data-variant` and `data-align`.\n *\n * Accessibility: the title is an `<h2>`. When you pass your own actions on\n * the primary band, pick button variants with enough contrast against it.\n *\n * @example\n * <CallToAction\n *   variant=\"primary\"\n *   align=\"start\"\n *   title=\"Ready to get started?\"\n *   description=\"Create an account in under a minute.\"\n *   actions={\n *     <Button asChild variant=\"secondary\">\n *       <a href=\"#signup\">Sign up</a>\n *     </Button>\n *   }\n * />\n */\nfunction CallToAction({\n  title = \"Start building with Acme today\",\n  description = \"Set up your workspace in minutes. No credit card needed, and you can cancel at any time.\",\n  actions,\n  variant = \"muted\",\n  align = \"center\",\n  className,\n  ...props\n}: CallToActionProps) {\n  const centered = align === \"center\";\n  const content = actions === undefined ? defaultActions(variant) : actions;\n\n  return (\n    <section\n      data-slot=\"cta\"\n      data-variant={variant}\n      data-align={align}\n      className={cn(\"py-16 sm:py-24\", className)}\n      {...props}\n    >\n      <div data-slot=\"cta-container\" className=\"mx-auto w-full max-w-6xl px-4 sm:px-6\">\n        <div\n          data-slot=\"cta-band\"\n          className={cn(\n            \"flex flex-col gap-8 rounded-xl px-6 py-12 sm:px-12 sm:py-16\",\n            BAND[variant],\n            centered ? \"items-center text-center\" : \"md:flex-row md:items-center md:justify-between\"\n          )}\n        >\n          <div data-slot=\"cta-content\" className={cn(\"max-w-2xl\", centered && \"mx-auto\")}>\n            {title != null ? (\n              <h2\n                data-slot=\"cta-title\"\n                className=\"text-3xl font-semibold tracking-tight text-balance sm:text-4xl\"\n              >\n                {title}\n              </h2>\n            ) : null}\n            {description != null ? (\n              <p\n                data-slot=\"cta-description\"\n                className={cn(\n                  \"mt-4 text-lg text-pretty\",\n                  variant === \"primary\" ? \"text-primary-foreground/80\" : \"text-muted-foreground\"\n                )}\n              >\n                {description}\n              </p>\n            ) : null}\n          </div>\n          {content != null ? (\n            <div\n              data-slot=\"cta-actions\"\n              className={cn(\"flex flex-wrap gap-3\", centered ? \"justify-center\" : \"md:shrink-0\")}\n            >\n              {content}\n            </div>\n          ) : null}\n        </div>\n      </div>\n    </section>\n  );\n}\n\nexport { CallToAction, type CallToActionAlign, type CallToActionProps, type CallToActionVariant };\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:block"
}