{
  "antiPatterns": [
    "Using a code as the only explanation.",
    "Inferring available actions from the displayed message."
  ],
  "api": {
    "importPath": "@ancrel/ui",
    "props": [
      {
        "name": "actions",
        "required": false,
        "type": "ReactNode"
      },
      {
        "name": "className",
        "required": false,
        "type": "string"
      },
      {
        "name": "code",
        "required": false,
        "type": "string"
      },
      {
        "name": "detail",
        "required": false,
        "type": "ReactNode"
      },
      {
        "name": "key",
        "required": false,
        "type": "React.Key | null | undefined"
      },
      {
        "name": "ref",
        "required": false,
        "type": "React.Ref<HTMLDivElement> | undefined"
      },
      {
        "name": "title",
        "required": true,
        "type": "ReactNode"
      },
      {
        "name": "tone",
        "required": false,
        "type": "Tone"
      }
    ],
    "symbol": "ErrorCard",
    "typeRef": "api/ui/error-card/index.d.ts"
  },
  "constraints": [
    "Choose danger or warning and state the problem in the title.",
    "Provide only actions the caller can perform in the current context."
  ],
  "docs": "raw/frontend/error-card.md",
  "examples": [
    {
      "code": "'use client'\n\nimport { useState } from 'react'\nimport { Button, ErrorCard } from '@ancrel/ui'\nimport '@ancrel/tokens/css'\nimport '@ancrel/ui/styles.css'\n\nexport default function App() {\n  const [editing, setEditing] = useState(false)\n  return editing ? <label>Document title <input defaultValue=\"Untitled\" /></label> :\n    <ErrorCard title=\"Document title already in use\" tone=\"warning\" code=\"E_DUPLICATE\"\n      detail=\"Choose another title to save a separate copy.\"\n      actions={<Button onClick={() => setEditing(true)}>Rename document</Button>} />\n}\n",
      "command": "pnpm test",
      "entry": "examples/fe.error-card/App.tsx",
      "fixture": "examples/fe.error-card/",
      "id": "minimal"
    }
  ],
  "id": "fe.error-card",
  "kind": "react-component",
  "language": "typescript",
  "layer": "frontend",
  "owner": "frontend-infra",
  "package": {
    "ecosystem": "npm",
    "name": "@ancrel/ui",
    "version": "0.2.0"
  },
  "provenance": {
    "changes": "Retained the recoverable error surface from lines 145–280. Replaced application-specific error categories, text and action mappings with caller-supplied content.",
    "commit": "4cc384c3bdbd09a3a50268adf81ba23f53aac93e",
    "mode": "extracted",
    "origin": "rule-studio",
    "path": "frontend/src/components/tasks/TaskErrorCard.tsx",
    "rights": "org-internal; approved-by=owner; ref=item-15"
  },
  "schemaVersion": 1,
  "stability": "experimental",
  "summary": "Present a recoverable error with a title, optional code, details and caller-supplied actions.",
  "tokenDependencies": [
    "ref.color.x202025",
    "ref.color.x392628",
    "ref.color.x393021",
    "ref.color.x684a84",
    "ref.color.x765400",
    "ref.color.x79633c",
    "ref.color.x845357",
    "ref.color.x9f3035",
    "ref.color.xb7a167",
    "ref.color.xcd9092",
    "ref.color.xcdb2ea",
    "ref.color.xedc678",
    "ref.color.xededef",
    "ref.color.xf39b9b",
    "ref.color.xfaf1d9",
    "ref.color.xfbeaec",
    "ref.family.mono",
    "ref.space.px12",
    "ref.space.px2",
    "ref.space.px6",
    "ref.space.px8",
    "ref.weight.w600",
    "sys.action.focus",
    "sys.ink.primary",
    "sys.radius.md",
    "sys.space.hair",
    "sys.space.inset",
    "sys.space.snug",
    "sys.status.danger.bg",
    "sys.status.danger.border",
    "sys.status.danger.fg",
    "sys.status.warning.bg",
    "sys.status.warning.border",
    "sys.status.warning.fg",
    "sys.type.family.mono",
    "sys.type.heading.3.weight"
  ]
}
