{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "call-to-action",
  "title": "Call to Action",
  "description": "A closing section with one goal, supporting copy, and reassurance.",
  "dependencies": [
    "class-variance-authority",
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "https://uaiblocks.dev/r/uai-theme.json",
    "https://uaiblocks.dev/r/trust-panel.json",
    "https://uaiblocks.dev/r/uai-utils.json"
  ],
  "files": [
    {
      "path": "src/registry/uai/blocks/call-to-action.tsx",
      "content": "\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { Check } from \"lucide-react\";\nimport { type ComponentProps, createContext, useContext, useId } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { TrustPanelBadge, TrustPanelBadges } from \"@/components/ui/uai/trust-panel\";\nimport { cn } from \"@/lib/uai-utils\";\n\nexport const CALL_TO_ACTION_VARIANTS = [\"banner\", \"centered\", \"split\"] as const;\nexport type CallToActionVariant = (typeof CALL_TO_ACTION_VARIANTS)[number];\nexport type CallToActionProps = ComponentProps<\"section\"> & { variant?: CallToActionVariant };\n\ntype CtaContext = { id: string; variant: CallToActionVariant };\nconst Context = createContext<CtaContext | null>(null);\nfunction useCta(part: string) {\n  const context = useContext(Context);\n  if (!context) throw new Error(`${part} must be used within CallToAction`);\n  return context;\n}\n\nconst callToActionVariants = cva(\"@container min-w-0 text-[13px]/[18px] text-foreground\", {\n  variants: {\n    variant: {\n      banner:\n        \"rounded-[14px] bg-[color-mix(in_oklab,var(--muted)_75%,var(--card))] p-[clamp(24px,5cqi,44px)]\",\n      centered: \"px-0 py-6 text-center\",\n      split:\n        \"rounded-[14px] border bg-card p-[clamp(20px,4cqi,32px)] shadow-[0_1px_2px_oklch(0_0_0/0.04)]\",\n    },\n  },\n});\n\n/** A closing section with one goal, supporting copy, and reassurance. Split stacks below 640px. */\nexport function CallToAction({\n  variant = \"banner\",\n  className,\n  children,\n  ...props\n}: CallToActionProps) {\n  const id = useId();\n  return (\n    <Context.Provider value={{ id, variant }}>\n      <section\n        aria-labelledby={`${id}-title`}\n        data-slot=\"call-to-action\"\n        data-variant={variant}\n        className={cn(callToActionVariants({ variant }), className)}\n        {...props}\n      >\n        <div\n          className={cn(\n            \"grid min-w-0 gap-5\",\n            variant === \"split\" &&\n              \"@min-[640px]:grid-cols-[minmax(0,1fr)_auto] @min-[640px]:items-center @min-[640px]:gap-x-8\",\n          )}\n        >\n          {children}\n        </div>\n      </section>\n    </Context.Provider>\n  );\n}\n\nexport function CallToActionContent({ className, ...props }: ComponentProps<\"div\">) {\n  const { variant } = useCta(\"CallToActionContent\");\n  return (\n    <div\n      data-slot=\"call-to-action-content\"\n      className={cn(\n        \"grid min-w-0 gap-2.5\",\n        variant === \"centered\"\n          ? \"mx-auto max-w-[560px] justify-items-center\"\n          : \"max-w-[640px] justify-items-start\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function CallToActionTitle({ className, ...props }: ComponentProps<\"h2\">) {\n  const { id, variant } = useCta(\"CallToActionTitle\");\n  return (\n    <h2\n      data-slot=\"call-to-action-title\"\n      className={cn(\n        \"m-0 font-medium text-balance\",\n        variant === \"split\"\n          ? \"text-[22px]/[1.15] tracking-[-0.02em]\"\n          : \"text-[length:clamp(22px,2.5cqi_+_12px,30px)]/[1.15] tracking-[-0.025em]\",\n        className,\n      )}\n      {...props}\n      id={`${id}-title`}\n    />\n  );\n}\n\nexport function CallToActionDescription({ className, ...props }: ComponentProps<\"p\">) {\n  return (\n    <p\n      data-slot=\"call-to-action-description\"\n      className={cn(\"m-0 text-[15px]/[23px] text-pretty text-muted-foreground\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function CallToActionActions({ className, ...props }: ComponentProps<\"div\">) {\n  const { variant } = useCta(\"CallToActionActions\");\n  return (\n    <div\n      data-slot=\"call-to-action-actions\"\n      className={cn(\n        \"flex flex-wrap items-center gap-2\",\n        variant === \"centered\" ? \"justify-center\" : \"justify-start\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport type CallToActionActionProps = ComponentProps<\"a\"> & {\n  priority?: \"primary\" | \"secondary\";\n};\n\nconst callToActionActionVariants = cva(\n  \"h-9 gap-1.5 rounded-full py-0 text-[13px]/[18px] decoration-border-strong underline-offset-3 transition-[filter,text-decoration-color,scale] duration-[120ms,120ms,140ms] ease-[ease-out,ease-out,cubic-bezier(0.23,1,0.32,1)] focus-visible:ring-0 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100\",\n  {\n    variants: {\n      priority: {\n        primary:\n          \"bg-primary px-4 text-primary-foreground no-underline hover:bg-primary hover:brightness-[1.08] has-[>svg]:px-4\",\n        secondary:\n          \"bg-transparent px-3 text-foreground underline hover:underline hover:decoration-current has-[>svg]:px-3\",\n      },\n    },\n  },\n);\n\nexport function CallToActionAction({\n  priority = \"primary\",\n  className,\n  ...props\n}: CallToActionActionProps) {\n  return (\n    <Button\n      asChild\n      variant={priority === \"primary\" ? \"default\" : \"link\"}\n      className={cn(callToActionActionVariants({ priority }), className)}\n    >\n      <a data-slot=\"call-to-action-action\" data-priority={priority} {...props} />\n    </Button>\n  );\n}\n\n/** Reassurance points rendered as Trust Panel badges. Pass an aria-label that names the list. */\nexport function CallToActionReassurance({ className, ...props }: ComponentProps<\"ul\">) {\n  const { variant } = useCta(\"CallToActionReassurance\");\n  return (\n    <TrustPanelBadges\n      data-slot=\"call-to-action-reassurance\"\n      className={cn(\n        variant === \"centered\" ? \"justify-center\" : \"justify-start\",\n        variant === \"split\" && \"@min-[640px]:col-span-full\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function CallToActionReassuranceItem({\n  icon = <Check size={14} className=\"size-3.5\" strokeWidth={2} aria-hidden=\"true\" />,\n  ...props\n}: ComponentProps<typeof TrustPanelBadge>) {\n  useCta(\"CallToActionReassuranceItem\");\n  return <TrustPanelBadge data-slot=\"call-to-action-reassurance-item\" {...props} icon={icon} />;\n}\n",
      "type": "registry:component",
      "target": "@components/uai/call-to-action.tsx"
    }
  ],
  "categories": [
    "marketing",
    "conversion"
  ],
  "type": "registry:block"
}