{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "loader-typing",
  "type": "registry:component",
  "title": "Loader Typing",
  "description": "A chat typing indicator with three hopping dots in a bubble, plus an optional avatar and sender name.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "loaders",
    "loader",
    "typing",
    "chat",
    "bubble",
    "message",
    "indicator"
  ],
  "docs": "https://hyperblur.dev/effects/loader-typing",
  "files": [
    {
      "path": "registry/hyperblur/loader-typing.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/loader-typing.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LoaderTypingProps extends React.HTMLAttributes<HTMLDivElement> {\n  name?: string;\n  avatar?: string;\n  size?: number;\n  color?: string;\n  bubble?: string;\n  accent?: string;\n  label?: string;\n}\n\nconst css = `\n.hb-qc8 {\n  position: relative;\n  display: inline-flex;\n  align-items: flex-end;\n  gap: 8px;\n  box-sizing: border-box;\n  font-family: inherit;\n  color: #ededed;\n  vertical-align: middle;\n}\n.hb-qc8 *, .hb-qc8 *::before, .hb-qc8 *::after { box-sizing: border-box; }\n.hb-qc8-av {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: var(--hb-qc8-a);\n  height: var(--hb-qc8-a);\n  overflow: hidden;\n  border-radius: 50%;\n  background: linear-gradient(135deg, var(--hb-qc8-ac), #171717);\n  color: #fff;\n  font-size: calc(var(--hb-qc8-a) * 0.38);\n  font-weight: 600;\n  line-height: 1;\n}\n.hb-qc8-av { position: relative; }\n.hb-qc8-pic { position: absolute; inset: 0; background-size: cover; background-position: center; }\n.hb-qc8-col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }\n.hb-qc8-name { padding-left: 4px; font-size: 11px; line-height: 1.2; color: #8f8f8f; white-space: nowrap; }\n.hb-qc8-row { display: flex; align-items: center; gap: 8px; }\n.hb-qc8-bub {\n  display: inline-flex;\n  align-items: center;\n  gap: calc(var(--hb-qc8-s) * 0.14);\n  height: var(--hb-qc8-s);\n  padding: 0 calc(var(--hb-qc8-s) * 0.46);\n  border-radius: calc(var(--hb-qc8-s) / 2);\n  border-bottom-left-radius: calc(var(--hb-qc8-s) * 0.16);\n  background: var(--hb-qc8-b);\n  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);\n}\n.hb-qc8-bub > i {\n  flex: none;\n  width: calc(var(--hb-qc8-s) * 0.2);\n  height: calc(var(--hb-qc8-s) * 0.2);\n  border-radius: 50%;\n  background: var(--hb-qc8-c);\n  animation: hb-qc8-hop 1.2s ease-in-out infinite;\n  animation-delay: calc(var(--i) * 0.16s);\n}\n.hb-qc8-l { font-size: 12px; line-height: 1.3; color: #a1a1a1; white-space: nowrap; }\n.hb-qc8-sr {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  margin: -1px;\n  padding: 0;\n  overflow: hidden;\n  clip-path: inset(50%);\n  white-space: nowrap;\n  border: 0;\n}\n@keyframes hb-qc8-hop {\n  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }\n  30% { transform: translateY(-45%); opacity: 1; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-qc8-bub > i { animation: none; opacity: 0.75; }\n  .hb-qc8-bub > i:nth-child(2) { opacity: 1; }\n}\n`;\n\nfunction initials(name: string) {\n  const parts = name.trim().split(/\\s+/).filter(Boolean);\n  if (!parts.length) return \"\";\n  const first = parts[0][0] ?? \"\";\n  const last = parts.length > 1 ? parts[parts.length - 1][0] ?? \"\" : \"\";\n  return (first + last).toUpperCase();\n}\n\nexport function LoaderTyping({\n  name,\n  avatar,\n  size = 36,\n  color = \"#a1a1a1\",\n  bubble = \"#1f1f1f\",\n  accent = \"#2f7bff\",\n  label,\n  className = \"\",\n  style,\n  ...rest\n}: LoaderTypingProps) {\n  const showAvatar = Boolean(name || avatar);\n  const avatarSize = Math.round(size * 0.78);\n  const spoken = label ?? (name ? `${name} is typing` : \"Typing\");\n  const vars = {\n    \"--hb-qc8-s\": `${size}px`,\n    \"--hb-qc8-a\": `${avatarSize}px`,\n    \"--hb-qc8-c\": color,\n    \"--hb-qc8-b\": bubble,\n    \"--hb-qc8-ac\": accent,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <>\n      <style href=\"hb-loader-typing\" precedence=\"default\">{css}</style>\n      <div role=\"status\" className={`hb-qc8 ${className}`} style={vars} {...rest}>\n        {showAvatar ? (\n          <span className=\"hb-qc8-av\" aria-hidden=\"true\">\n            {initials(name ?? \"\")}\n            {avatar ? (\n              <span className=\"hb-qc8-pic\" style={{ backgroundImage: `url(\"${avatar.replace(/\"/g, \"%22\")}\")` }} />\n            ) : null}\n          </span>\n        ) : null}\n        <span className=\"hb-qc8-col\">\n          {name ? (\n            <span className=\"hb-qc8-name\" aria-hidden=\"true\">\n              {name}\n            </span>\n          ) : null}\n          <span className=\"hb-qc8-row\">\n            <span className=\"hb-qc8-bub\" aria-hidden=\"true\">\n              <i style={{ \"--i\": 0 } as React.CSSProperties} />\n              <i style={{ \"--i\": 1 } as React.CSSProperties} />\n              <i style={{ \"--i\": 2 } as React.CSSProperties} />\n            </span>\n            {label ? (\n              <span className=\"hb-qc8-l\" aria-hidden=\"true\">\n                {label}\n              </span>\n            ) : null}\n          </span>\n        </span>\n        <span className=\"hb-qc8-sr\">{spoken}</span>\n      </div>\n    </>\n  );\n}\n"
    }
  ]
}