{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"cta-centered","type":"registry:block","title":"CTA centered","description":"The promise and two actions on a soft glow, with what's included and the people already using it.","dependencies":["lucide-react"],"registryDependencies":["https://dashral.com/r/utils.json","https://dashral.com/r/avatar.json","https://dashral.com/r/button.json"],"files":[{"path":"registry/dashral/blocks/cta-centered.tsx","type":"registry:file","target":"components/dashral/blocks/cta-centered.tsx","content":"import { ArrowRight, Check } from \"lucide-react\"\nimport { Avatar } from \"../avatar\"\nimport { Button } from \"../button\"\n\nconst samplePeople = [{ name: \"Sophia Chen\" }, { name: \"Liam Johnson\" }, { name: \"Emma Davis\" }, { name: \"Noah Williams\" }, { name: \"Ava Brown\" }]\n// Each face its own soft tint, from the theme's status colors, on the card's color so the stack doesn't show through.\nconst tints = [\"bg-primary/15 text-primary-text\", \"bg-info/15 text-info-text\", \"bg-success/15 text-success-text\", \"bg-highlight/15 text-highlight-text\", \"bg-warning/20 text-warning-text\"]\n\n/** A button: a link with href, or your handler with onClick. */\nexport type BlockAction = { label: string; href?: string; onClick?: () => void }\n\nexport type CtaCenteredProps = {\n  /** The pill above the heading; none hides it. */\n  badge?: React.ReactNode\n  title?: React.ReactNode\n  description?: React.ReactNode\n  primary?: BlockAction\n  /** The second button; null hides it. */\n  secondary?: BlockAction | null\n  /** Short promises under the buttons; none hides the row. */\n  promises?: string[]\n  /** The people already using it, and their rating; no people hides the row. */\n  people?: { name: string; src?: string }[]\n  rating?: React.ReactNode\n}\n\n/**\n * A call to action between sections of a landing page: the promise and two actions on a soft glow, with the people\n * already using it under them. Every part comes from props.\n */\nexport function CtaCentered({\n  badge = \"2,400 teams joined this month\",\n  title = \"Stop guessing. See every number in one place.\",\n  description = \"Connect your data, pick a dashboard and invite the team. Everyone sees the same numbers by lunch.\",\n  primary = { label: \"Start for free\", href: \"#\" },\n  secondary = { label: \"Talk to sales\", href: \"#\" },\n  promises = [\"Free for small teams\", \"No credit card\", \"Set up in minutes\"],\n  people = samplePeople,\n  rating = (\n    <>\n      <span className=\"font-medium text-foreground\">4.9 out of 5</span> from 1,200+ reviews\n    </>\n  ),\n}: CtaCenteredProps) {\n  return (\n    <section className=\"bg-background p-4 sm:p-6\">\n      <div className=\"relative isolate mx-auto max-w-6xl overflow-hidden rounded-3xl border bg-card px-6 py-14 text-center shadow-xs sm:px-12 sm:py-20\">\n        {/* The glow and the grid, both decoration: brightest at the top, gone at the edges. */}\n        <div aria-hidden className=\"absolute -top-40 left-1/2 -z-10 h-80 w-[36rem] max-w-full -translate-x-1/2 rounded-full bg-primary/25 blur-3xl\" />\n        <div\n          aria-hidden\n          className=\"absolute inset-0 -z-10 [background-image:linear-gradient(to_right,var(--border)_1px,transparent_1px),linear-gradient(to_bottom,var(--border)_1px,transparent_1px)] [background-size:40px_40px] opacity-50 [mask-image:radial-gradient(ellipse_60%_55%_at_50%_0%,black,transparent)]\"\n        />\n\n        {badge && (\n          <p className=\"mx-auto mb-5 inline-flex items-center gap-2 rounded-full border bg-background/70 px-3 py-1 text-xs font-medium text-muted-foreground backdrop-blur\">\n            <span aria-hidden className=\"size-1.5 rounded-full bg-success\" />\n            {badge}\n          </p>\n        )}\n        <h2 className=\"mx-auto max-w-2xl text-3xl font-semibold tracking-tight text-balance sm:text-5xl sm:leading-[1.08]\">{title}</h2>\n        {description && <p className=\"mx-auto mt-5 max-w-lg text-pretty text-muted-foreground sm:text-lg\">{description}</p>}\n\n        {/* Side by side, on a phone too: each takes its share of the row, and the second wraps under only when the\n            two labels can't fit one line. */}\n        <div className=\"mt-8 flex flex-wrap justify-center gap-3\">\n          <Action action={primary} className=\"group flex-auto sm:flex-none\">\n            {primary.label}\n            <ArrowRight\n              aria-hidden\n              className=\"transition-transform duration-(--duration-fast) group-hover:translate-x-0.5 rtl:-scale-x-100 rtl:group-hover:-translate-x-0.5\"\n            />\n          </Action>\n          {secondary && (\n            <Action action={secondary} variant=\"outline\" className=\"flex-auto sm:flex-none\">\n              {secondary.label}\n            </Action>\n          )}\n        </div>\n\n        {promises.length > 0 && (\n          <ul className=\"mt-6 flex flex-wrap justify-center gap-x-5 gap-y-2 text-sm text-muted-foreground\">\n            {promises.map((promise) => (\n              <li key={promise} className=\"flex items-center gap-1.5\">\n                <Check aria-hidden className=\"size-4 text-success-text\" />\n                {promise}\n              </li>\n            ))}\n          </ul>\n        )}\n\n        {people.length > 0 && (\n          <div className=\"mt-10 flex flex-col items-center justify-center gap-3 sm:flex-row\">\n            <div className=\"flex -space-x-1.5 rtl:space-x-reverse\">\n              {people.map(({ name, src }, i) => (\n                <Avatar\n                  key={name}\n                  name={name}\n                  src={src}\n                  alt=\"\"\n                  size=\"lg\"\n                  className=\"rounded-full bg-card ring-[3px] ring-card\"\n                  classNames={{ fallback: `text-xs font-semibold ${tints[i % tints.length]}` }}\n                />\n              ))}\n            </div>\n            {rating && <p className=\"text-sm text-muted-foreground\">{rating}</p>}\n          </div>\n        )}\n      </div>\n    </section>\n  )\n}\n\n/** A large button that follows its action: a link, or a handler. */\nfunction Action({ action, variant, className, children }: { action: BlockAction; variant?: \"outline\"; className?: string; children: React.ReactNode }) {\n  return action.href ? (\n    <Button size=\"lg\" variant={variant} className={className} asChild>\n      <a href={action.href}>{children}</a>\n    </Button>\n  ) : (\n    <Button size=\"lg\" variant={variant} className={className} onClick={action.onClick}>\n      {children}\n    </Button>\n  )\n}\n"}],"cssVars":{"theme":{"color-primary-text":"var(--primary-text, var(--primary))","color-info":"var(--info)","color-info-foreground":"var(--info-foreground)","color-info-text":"var(--info-text)","color-success":"var(--success)","color-success-foreground":"var(--success-foreground)","color-success-text":"var(--success-text)","color-warning":"var(--warning)","color-warning-foreground":"var(--warning-foreground)","color-warning-text":"var(--warning-text)","color-highlight":"var(--highlight)","color-highlight-foreground":"var(--highlight-foreground)","color-highlight-text":"var(--highlight-text)","ease-standard":"var(--ease-standard)","ease-enter":"var(--ease-enter)","ease-exit":"var(--ease-exit)","ease-spring":"var(--ease-spring)"},"light":{"info":"oklch(0.5 0.134 242.749)","info-foreground":"oklch(0.985 0 0)","info-text":"oklch(0.443 0.11 240.79)","success":"oklch(0.508 0.118 165.612)","success-foreground":"oklch(0.985 0 0)","success-text":"oklch(0.432 0.095 166.913)","warning":"#f59200","warning-foreground":"oklch(0.3 0.07 60)","warning-text":"#964e00","highlight":"#b8008c","highlight-foreground":"oklch(0.985 0 0)","highlight-text":"#a3007b","duration-fast":"160ms","duration-standard":"240ms","duration-considered":"480ms","ease-standard":"cubic-bezier(0.2, 0, 0, 1)","ease-enter":"cubic-bezier(0, 0, 0, 1)","ease-exit":"cubic-bezier(0.3, 0, 1, 1)","ease-spring":"linear(0, 0.071 4%, 0.234 8%, 0.433 12%, 0.626 17%, 0.791 21%, 0.917 25%, 1.004 29%, 1.055 33%, 1.079 38%, 1.083 42%, 1.075 46%, 1.06 50%, 1.043 54%, 1.027 58%, 1.015 62%, 1.005 67%, 0.998 71%, 0.995 75%, 0.993 79%, 0.993 83%, 0.994 88%, 0.995 92%, 0.997 96%, 1)"},"dark":{"info":"oklch(0.685 0.169 237.323)","info-foreground":"oklch(0.2 0 0)","info-text":"oklch(0.746 0.16 232.661)","success":"oklch(0.696 0.17 162.48)","success-foreground":"oklch(0.2 0.04 160)","success-text":"oklch(0.765 0.177 163.223)","warning":"#f59200","warning-foreground":"oklch(0.25 0.06 60)","warning-text":"#ffba42","highlight":"#ff2ecf","highlight-foreground":"oklch(0.2 0 0)","highlight-text":"#ff75df"}}}