{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"agent-card","type":"registry:ui","title":"Agent card","description":"Realtor contact card with initials avatar, rating, license, languages and call, email and tour actions.","dependencies":["lucide-react","motion"],"registryDependencies":["utils"],"files":[{"path":"registry/items/agent-card/agent-card.tsx","type":"registry:ui","target":"components/facade/agent-card.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\nimport { Calendar, Mail, Phone, Star } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface AgentCardProps {\n  name?: string;\n  title?: string;\n  brokerage?: string;\n  license?: string;\n  /** Optional headshot URL. Falls back to an initials avatar. */\n  photoSrc?: string;\n  rating?: number;\n  reviewCount?: number;\n  languages?: string[];\n  phone?: string;\n  email?: string;\n  /** Link or handler for the schedule tour action. */\n  scheduleHref?: string;\n  onSchedule?: () => void;\n  /** Optional stats shown under the header, e.g. homes sold. */\n  stats?: Array<{ label: string; value: string }>;\n  /** Show the online status dot on the avatar. */\n  available?: boolean;\n  className?: string;\n}\n\nfunction initialsOf(name: string) {\n  return name\n    .split(/\\s+/)\n    .filter(Boolean)\n    .slice(0, 2)\n    .map((p) => p[0]?.toUpperCase() ?? \"\")\n    .join(\"\");\n}\n\nfunction Rating({ value, count }: { value: number; count?: number }) {\n  const rounded = Math.round(value * 2) / 2;\n  return (\n    <div className=\"flex items-center gap-1.5\" role=\"img\" aria-label={`Rated ${value.toFixed(1)} out of 5${count ? ` from ${count} reviews` : \"\"}`}>\n      <div className=\"flex gap-px\" aria-hidden=\"true\">\n        {Array.from({ length: 5 }).map((_, i) => {\n          const fill = Math.max(0, Math.min(1, rounded - i));\n          return (\n            <span key={i} className=\"relative size-3.5\">\n              <Star className=\"absolute inset-0 size-3.5 text-foreground/15\" fill=\"currentColor\" strokeWidth={0} />\n              <span className=\"absolute inset-0 overflow-hidden\" style={{ width: `${fill * 100}%` }}>\n                <Star className=\"size-3.5 text-star\" fill=\"currentColor\" strokeWidth={0} />\n              </span>\n            </span>\n          );\n        })}\n      </div>\n      <span className=\"text-sm font-medium tabular-nums text-foreground\">{value.toFixed(1)}</span>\n      {count !== undefined && <span className=\"text-sm text-muted-foreground\">({count})</span>}\n    </div>\n  );\n}\n\nexport function AgentCard({\n  name = \"Danielle Ortiz\",\n  title = \"Realtor\",\n  brokerage = \"Summit Peak Realty\",\n  license = \"CO FA.100082417\",\n  photoSrc,\n  rating = 4.9,\n  reviewCount = 128,\n  languages = [\"English\", \"Spanish\"],\n  phone = \"(303) 555-0148\",\n  email = \"danielle@summitpeakrealty.com\",\n  scheduleHref = \"#schedule\",\n  onSchedule,\n  stats,\n  available = true,\n  className,\n}: AgentCardProps) {\n  const reduce = useReducedMotion();\n  const tel = `tel:${phone.replace(/[^0-9+]/g, \"\")}`;\n\n  const btnBase =\n    \"inline-flex h-11 items-center justify-center gap-2 rounded-full px-4 text-sm font-medium transition-[background-color,color,opacity] duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-muted\";\n  const btnSecondary = cn(btnBase, \"bg-background text-foreground hover:bg-background/70 dark:bg-secondary dark:hover:bg-secondary/70\");\n  const btnPrimary = cn(btnBase, \"col-span-2 bg-brand text-brand-foreground hover:bg-[color-mix(in_srgb,var(--brand)_88%,black)]\");\n\n  return (\n    <motion.article\n      whileHover={reduce ? undefined : { y: -2 }}\n      transition={{ type: \"spring\", stiffness: 400, damping: 36 }}\n      className={cn(\"w-full max-w-sm rounded-[28px] bg-muted p-6 text-foreground\", className)}\n    >\n      <header className=\"flex items-start gap-4\">\n        <div className=\"relative shrink-0\">\n          {photoSrc ? (\n            // eslint-disable-next-line @next/next/no-img-element\n            <img src={photoSrc} alt={name} className=\"size-16 rounded-full object-cover\" />\n          ) : (\n            <div\n              className=\"grid size-16 place-items-center rounded-full bg-foreground font-display text-lg font-semibold tracking-[-0.02em] text-background\"\n              aria-hidden=\"true\"\n            >\n              {initialsOf(name)}\n            </div>\n          )}\n          {available && (\n            <span className=\"absolute bottom-0.5 right-0.5 size-3.5 rounded-full border-2 border-muted bg-success\" aria-label=\"Available now\" role=\"img\" />\n          )}\n        </div>\n        <div className=\"min-w-0 flex-1 pt-1\">\n          <h3 className=\"truncate font-display text-[17px] font-semibold leading-tight tracking-[-0.02em]\">{name}</h3>\n          <p className=\"mt-0.5 truncate text-sm text-muted-foreground\">\n            {title}, {brokerage}\n          </p>\n          <div className=\"mt-2\">\n            <Rating value={rating} count={reviewCount} />\n          </div>\n        </div>\n      </header>\n\n      {stats && stats.length > 0 && (\n        <dl className=\"mt-5 grid grid-cols-3 gap-2\">\n          {stats.slice(0, 3).map((s) => (\n            <div key={s.label} className=\"flex flex-col-reverse rounded-2xl bg-background px-2 py-3 text-center dark:bg-secondary\">\n              <dt className=\"mt-0.5 text-[12px] text-muted-foreground\">{s.label}</dt>\n              <dd className=\"font-display text-lg font-semibold tracking-[-0.02em] tabular-nums\">{s.value}</dd>\n            </div>\n          ))}\n        </dl>\n      )}\n\n      <div className=\"mt-5 flex flex-wrap items-center gap-x-2 gap-y-1.5 text-[13px] text-muted-foreground\">\n        <span>{languages.join(\", \")}</span>\n        <span className=\"ml-auto tabular-nums\">Lic. {license}</span>\n      </div>\n\n      <div className=\"mt-5 grid grid-cols-2 gap-2\">\n        <a href={tel} className={btnSecondary}>\n          <Phone className=\"size-4\" aria-hidden=\"true\" />\n          Call\n        </a>\n        <a href={`mailto:${email}`} className={btnSecondary}>\n          <Mail className=\"size-4\" aria-hidden=\"true\" />\n          Email\n        </a>\n        {onSchedule ? (\n          <button type=\"button\" onClick={onSchedule} className={btnPrimary}>\n            <Calendar className=\"size-4\" aria-hidden=\"true\" />\n            Schedule a tour\n          </button>\n        ) : (\n          <a href={scheduleHref} className={btnPrimary}>\n            <Calendar className=\"size-4\" aria-hidden=\"true\" />\n            Schedule a tour\n          </a>\n        )}\n      </div>\n    </motion.article>\n  );\n}\n\nexport default AgentCard;\n"}],"categories":["cards"],"meta":{"tier":"free","demo":"import { AgentCard } from \"./agent-card\";\n\nexport default function Demo() {\n  return (\n    <div className=\"grid w-full max-w-[780px] grid-cols-1 justify-items-center gap-4 sm:grid-cols-2\">\n      <AgentCard\n        name=\"Danielle Ortiz\"\n        title=\"Realtor\"\n        brokerage=\"Summit Peak Realty\"\n        license=\"CO FA.100082417\"\n        rating={4.9}\n        reviewCount={128}\n        languages={[\"English\", \"Spanish\"]}\n        phone=\"(303) 555-0148\"\n        email=\"danielle@summitpeakrealty.com\"\n        stats={[\n          { label: \"Homes sold\", value: \"214\" },\n          { label: \"Avg. days\", value: \"11\" },\n          { label: \"Sale to list\", value: \"101%\" },\n        ]}\n      />\n      <AgentCard\n        name=\"Marcus Bell\"\n        title=\"Broker associate\"\n        brokerage=\"Coastline Partners\"\n        license=\"FL BK3318842\"\n        rating={4.8}\n        reviewCount={86}\n        languages={[\"English\", \"Portuguese\"]}\n        phone=\"(305) 555-0192\"\n        email=\"marcus@coastlinepartners.com\"\n        available={false}\n        stats={[\n          { label: \"Homes sold\", value: \"167\" },\n          { label: \"Volume\", value: \"$142M\" },\n          { label: \"Years\", value: \"12\" },\n        ]}\n      />\n    </div>\n  );\n}\n"}}