{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "aurora-ai-commit",
  "title": "Aurora AI Commit",
  "author": "jmagar <https://github.com/jmagar>",
  "description": "Aurora-native commit parity surface from AI Elements.",
  "dependencies": [
    "lucide-react@^0.487.0"
  ],
  "registryDependencies": [
    "@aurora/aurora-tokens",
    "@aurora/aurora-ai-elements"
  ],
  "files": [
    {
      "path": "registry/aurora/blocks/ai/elements/commit.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Check, GitBranch, GitCommitHorizontal } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { useClipboard } from \"@/registry/aurora/lib/use-clipboard\"\n\nexport type CommitVariant = \"default\" | \"compact\"\n\nexport interface CommitProps extends React.HTMLAttributes<HTMLDivElement> {\n  /** Short commit hash, e.g. `ca8cb38`. */\n  hash: string\n  /** Commit subject line. */\n  message: string\n  /** Author handle; first letter seeds the avatar. */\n  author?: string\n  /** Relative timestamp, e.g. `4m ago`. */\n  time?: string\n  /** Branch name shown in the diffstat row. */\n  branch?: string\n  /** Files touched. */\n  files?: number\n  /** Lines added. */\n  additions?: number\n  /** Lines removed. */\n  deletions?: number\n  /** Render the AI authorship badge next to the subject. */\n  badge?: boolean\n  /** Density. `compact` collapses to a single row (avatar · message · hash). */\n  variant?: CommitVariant\n}\n\n// ── Aurora token panel surface (mirrors the elements panelStyle) ───────────────\nfunction commitPanelStyle(style?: React.CSSProperties): React.CSSProperties {\n  return {\n    background: \"var(--aurora-surface-raised)\",\n    border: \"1px solid var(--aurora-border-strong)\",\n    borderRadius: \"var(--aurora-radius-1)\",\n    boxShadow: \"var(--aurora-shadow-medium), var(--aurora-highlight-medium)\",\n    ...style,\n  }\n}\n\nfunction CommitAvatar({ seed, size }: { seed: string; size: number }) {\n  const initial = (seed.trim()[0] ?? \"?\").toUpperCase()\n  return (\n    <span\n      aria-hidden\n      className=\"grid place-items-center rounded-full\"\n      style={{\n        width: size,\n        height: size,\n        color: \"var(--aurora-accent-primary)\",\n        border: \"1.5px solid color-mix(in srgb, var(--aurora-accent-primary) 60%, transparent)\",\n        background: \"color-mix(in srgb, var(--aurora-accent-primary) 12%, transparent)\",\n        fontFamily: \"var(--aurora-font-display)\",\n        fontWeight: 700,\n        fontSize: size * 0.4,\n        lineHeight: 1,\n      }}\n    >\n      {initial}\n    </span>\n  )\n}\n\nfunction HashChip({ hash }: { hash: string }) {\n  const { copied, error, copy } = useClipboard(1200)\n  const handleCopy = React.useCallback(() => void copy(hash), [copy, hash])\n\n  return (\n    <button\n      type=\"button\"\n      onClick={handleCopy}\n      aria-label={copied ? `Copied ${hash}` : error ? `Unable to copy ${hash}` : `Copy commit ${hash}`}\n      className=\"inline-flex shrink-0 items-center gap-1.5 rounded-[8px] px-2.5 py-1 transition-colors\"\n      style={{\n        border: \"1px solid var(--aurora-border-default)\",\n        background: \"var(--aurora-control-surface)\",\n        color: copied ? \"var(--aurora-success)\" : \"var(--aurora-text-muted)\",\n      }}\n    >\n      {copied ? (\n        <Check className=\"size-3.5\" aria-hidden />\n      ) : (\n        <GitCommitHorizontal className=\"size-3.5\" aria-hidden style={{ opacity: 0.85 }} />\n      )}\n      <span className=\"aurora-text-meta\" style={{ color: \"currentColor\", fontVariantNumeric: \"tabular-nums\" }}>\n        {hash}\n      </span>\n      <span className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n        {copied ? \"Copied\" : error ? \"Unable to copy\" : \"\"}\n      </span>\n    </button>\n  )\n}\n\nconst Commit = React.memo(\n  function Commit(\n    { ref,\n      hash,\n      message,\n      author,\n      time,\n      branch,\n      files,\n      additions,\n      deletions,\n      badge = false,\n      variant = \"default\",\n      className,\n      style,\n      ...props\n    }: CommitProps & { ref?: React.Ref<HTMLDivElement> },\n  ) {\n    const seed = author ?? message\n    const hasDiffstat =\n      branch != null ||\n      files != null ||\n      additions != null ||\n      deletions != null\n\n    if (variant === \"compact\") {\n      return (\n        <div\n          ref={ref}\n          className={cn(\n            \"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 px-3.5 py-2.5\",\n            className,\n          )}\n          style={commitPanelStyle(style)}\n          {...props}\n        >\n          <CommitAvatar seed={seed} size={28} />\n          <span\n            className=\"block min-w-0 truncate\"\n            style={{\n              color: \"var(--aurora-text-primary)\",\n              fontFamily: \"var(--aurora-font-display)\",\n              fontWeight: 700,\n              fontSize: 16,\n              letterSpacing: 0,\n              lineHeight: 1.2,\n            }}\n          >\n            {message}\n          </span>\n          <span\n            className=\"aurora-text-meta shrink-0\"\n            style={{ color: \"var(--aurora-text-muted)\", fontVariantNumeric: \"tabular-nums\" }}\n          >\n            {hash}\n          </span>\n        </div>\n      )\n    }\n\n    return (\n      <div\n        ref={ref}\n        className={cn(\"grid gap-3 px-4 py-3.5\", className)}\n        style={commitPanelStyle(style)}\n        {...props}\n      >\n        {/* Header: avatar · message + meta + badge · hash chip */}\n        <div className=\"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3.5\">\n          <CommitAvatar seed={seed} size={44} />\n          <span className=\"grid min-w-0 gap-0.5\">\n            <span className=\"flex min-w-0 items-center gap-2.5\">\n              <span\n                className=\"min-w-0 truncate\"\n                style={{\n                  color: \"var(--aurora-text-primary)\",\n                  fontFamily: \"var(--aurora-font-display)\",\n                  fontWeight: 700,\n                  fontSize: 19,\n                  letterSpacing: 0,\n                  lineHeight: 1.15,\n                }}\n              >\n                {message}\n              </span>\n              {badge ? (\n                <span\n                  className=\"shrink-0 rounded-[7px] px-1.5 py-0.5\"\n                  style={{\n                    border: \"1px solid var(--axon-orange-border)\",\n                    background: \"var(--axon-orange-surface)\",\n                    color: \"var(--axon-orange-strong)\",\n                    fontFamily: \"var(--aurora-font-sans)\",\n                    fontWeight: 700,\n                    fontSize: 10,\n                    letterSpacing: \"var(--aurora-letter-eyebrow)\",\n                    lineHeight: 1.4,\n                    textTransform: \"uppercase\",\n                  }}\n                >\n                  AI\n                </span>\n              ) : null}\n            </span>\n            {author || time ? (\n              <span className=\"aurora-text-meta block truncate\">\n                {author}\n                {author && time ? \" · \" : \"\"}\n                {time}\n              </span>\n            ) : null}\n          </span>\n          <HashChip hash={hash} />\n        </div>\n\n        {/* Diffstat: branch · files / additions / deletions */}\n        {hasDiffstat ? (\n          <>\n            <div\n              aria-hidden\n              style={{ height: 1, background: \"var(--aurora-border-default)\" }}\n            />\n            <div className=\"flex items-center justify-between gap-3\">\n              <span className=\"flex min-w-0 items-center gap-2\">\n                {branch != null ? (\n                  <>\n                    <GitBranch\n                      className=\"size-3.5 shrink-0\"\n                      aria-hidden\n                      style={{ color: \"var(--aurora-text-muted)\" }}\n                    />\n                    <span\n                      className=\"aurora-text-meta truncate\"\n                      style={{ color: \"var(--aurora-text-muted)\" }}\n                    >\n                      {branch}\n                    </span>\n                  </>\n                ) : null}\n              </span>\n              <span\n                className=\"flex shrink-0 items-center gap-3.5 aurora-text-meta\"\n                style={{ fontVariantNumeric: \"tabular-nums\" }}\n              >\n                {files != null ? (\n                  <span style={{ color: \"var(--aurora-text-muted)\" }}>{files} files</span>\n                ) : null}\n                {additions != null ? (\n                  <span style={{ color: \"var(--aurora-success)\" }}>+{additions}</span>\n                ) : null}\n                {deletions != null ? (\n                  <span style={{ color: \"var(--aurora-error)\" }}>&minus;{deletions}</span>\n                ) : null}\n              </span>\n            </div>\n          </>\n        ) : null}\n      </div>\n    )\n  },\n)\nCommit.displayName = \"Commit\"\n\nexport { Commit }\n",
      "type": "registry:component",
      "target": "@components/aurora/ai/commit.tsx"
    }
  ],
  "meta": {
    "namespace": "@aurora",
    "style": "aurora",
    "family": "block",
    "requiresTokens": true,
    "sourcePath": "registry/aurora/blocks/ai/elements/commit.tsx",
    "installTarget": "@components/aurora/ai/commit.tsx",
    "taxonomy": "ai"
  },
  "docs": "Aurora block that expects `aurora-tokens` to be installed first.\n\nDefault install target: `@components/aurora/ai/commit.tsx`.\n\nRegistry dependencies: `aurora-tokens`, `aurora-ai-elements`.",
  "categories": [
    "aurora",
    "block",
    "ai"
  ],
  "type": "registry:block"
}