{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "status-dot",
  "title": "Status Dot",
  "description": "A presence and status indicator: online, away, busy, offline and live dots with an optional label, a pulsing ring for live states, and a pinned mode that sits on an avatar's corner behind a cut-out ring.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/status-dot/status-dot.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, AnimatePresence, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type StatusDotStatus = \"online\" | \"away\" | \"busy\" | \"offline\" | \"live\";\nexport type StatusDotSize = \"sm\" | \"md\" | \"lg\";\nexport type StatusDotPlacement = \"top-right\" | \"bottom-right\" | \"top-left\" | \"bottom-left\";\n\nexport interface StatusDotProps {\n  status?: StatusDotStatus;\n  /** Text next to the dot (or its accessible name when hidden). Defaults to the status name. */\n  label?: string;\n  showLabel?: boolean;\n  /** An expanding ring around the dot. On by default for online and live. */\n  pulse?: boolean;\n  size?: StatusDotSize;\n  theme?: \"dark\" | \"light\";\n  /** Wrap an avatar (or anything) to pin the dot to one of its corners. */\n  children?: React.ReactNode;\n  placement?: StatusDotPlacement;\n  /** Colour of the cut-out ring around a pinned dot; match it to what's behind the avatar. */\n  ringColor?: string;\n  /** Overrides the status colour. */\n  color?: string;\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.56)\", ring: \"#0A0A0A\", online: \"#5BD68A\", away: \"#F2A841\", busy: \"#FF7A6B\", offline: \"rgba(245,244,241,0.38)\", live: \"#FF5A4E\" },\n  light: { text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.56)\", ring: \"#FFFFFF\", online: \"#16A34A\", away: \"#D98A1C\", busy: \"#E5484D\", offline: \"rgba(10,10,10,0.3)\", live: \"#E5342A\" },\n};\n\nconst SIZES: Record<StatusDotSize, { dot: number; font: number; gap: number; ring: number }> = {\n  sm: { dot: 8, font: 12.5, gap: 6, ring: 2 },\n  md: { dot: 10, font: 13.5, gap: 7, ring: 2.5 },\n  lg: { dot: 12, font: 15, gap: 8, ring: 3 },\n};\n\nconst LABELS: Record<StatusDotStatus, string> = { online: \"Online\", away: \"Away\", busy: \"Busy\", offline: \"Offline\", live: \"Live\" };\n\nfunction Dot({ color, size, pulse, ring, ringColor, reduce, status }: { color: string; size: number; pulse: boolean; ring: number; ringColor?: string; reduce: boolean; status: StatusDotStatus }) {\n  return (\n    <span className=\"relative inline-flex shrink-0\" style={{ width: size, height: size }}>\n      {pulse && !reduce && (\n        <motion.span\n          aria-hidden=\"true\"\n          className=\"absolute inset-0 rounded-full\"\n          style={{ background: color }}\n          initial={{ scale: 1, opacity: 0.55 }}\n          animate={{ scale: 2.6, opacity: 0 }}\n          transition={{ duration: status === \"live\" ? 1.1 : 1.8, repeat: Infinity, ease: \"easeOut\" }}\n        />\n      )}\n      {/* Keyed by status so a change pops the new colour in with a small bounce. */}\n      <AnimatePresence initial={false} mode=\"popLayout\">\n        <motion.span\n          key={status + color}\n          aria-hidden=\"true\"\n          className=\"absolute inset-0 rounded-full\"\n          style={{ background: color, boxShadow: ringColor ? `0 0 0 ${ring}px ${ringColor}` : undefined }}\n          initial={reduce ? { opacity: 0 } : { scale: 0.4, opacity: 0 }}\n          animate={{ scale: 1, opacity: 1 }}\n          exit={{ opacity: 0, transition: { duration: 0.12 } }}\n          transition={{ type: \"spring\", stiffness: 520, damping: 22 }}\n        />\n      </AnimatePresence>\n    </span>\n  );\n}\n\nexport function StatusDot({\n  status = \"online\",\n  label,\n  showLabel = false,\n  pulse,\n  size = \"md\",\n  theme = \"dark\",\n  children,\n  placement = \"bottom-right\",\n  ringColor,\n  color,\n  className,\n}: StatusDotProps) {\n  const p = PALETTES[theme];\n  const s = SIZES[size];\n  const reduce = Boolean(useReducedMotion());\n  const tone = color ?? p[status];\n  const name = label ?? LABELS[status];\n  const pulsing = pulse ?? (status === \"online\" || status === \"live\");\n\n  if (children !== undefined) {\n    const [v, h] = placement.split(\"-\") as [\"top\" | \"bottom\", \"left\" | \"right\"];\n    return (\n      <span className={cn(\"relative inline-flex\", className)}>\n        {children}\n        <span className=\"absolute\" style={{ [v]: 0, [h]: 0, transform: `translate(${h === \"right\" ? \"15%\" : \"-15%\"}, ${v === \"bottom\" ? \"15%\" : \"-15%\"})` }}>\n          <Dot color={tone} size={s.dot + 2} pulse={pulsing} ring={s.ring} ringColor={ringColor ?? p.ring} reduce={reduce} status={status} />\n        </span>\n        <span className=\"sr-only\">{name}</span>\n      </span>\n    );\n  }\n\n  return (\n    <span\n      // With a visible label the text itself is read; without one, the dot is an image named by it.\n      role={showLabel ? undefined : \"img\"}\n      aria-label={showLabel ? undefined : name}\n      className={cn(\"inline-flex items-center\", className)}\n      style={{ gap: s.gap, fontFamily: \"Inter, sans-serif\" }}\n    >\n      <Dot color={tone} size={s.dot} pulse={pulsing} ring={s.ring} reduce={reduce} status={status} />\n      {showLabel && (\n        <span className=\"font-medium\" style={{ color: status === \"offline\" ? p.muted : p.text, fontSize: s.font, lineHeight: 1 }}>\n          {name}\n        </span>\n      )}\n    </span>\n  );\n}\n\nexport default StatusDot;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}