{
  "name": "ConfidenceIndicator",
  "source": "src/components/ConfidenceIndicator.tsx",
  "propsType": "ConfidenceIndicatorProps",
  "description": "ConfidenceIndicator — how much to trust the thing next to it.\n\nTHERE IS NO PERCENTAGE PROP, AND THERE WILL NOT BE ONE\n\n\"87% confident\" reads as a measurement. Almost nowhere is it one: it is\nusually a softmax score, a heuristic, or a number a model produced about\nitself — none of which are calibrated probabilities, and all of which invite\na reader to treat two digits of precision as real. Three levels cannot\noverclaim in that way.\n\n`basis` IS REQUIRED FOR THE SAME REASON. A level with nothing behind it is\ndecoration that changes behaviour: people act on \"high confidence\" whether or\nnot anything justifies it. Making the justification a required prop is the\nonly enforcement available here, and it is a type error rather than a policy\n— which is the strongest kind this system can offer.\n\nIt renders as text plus a three-bar meter, never the meter alone. The bars\ndiffer in filled COUNT, not only in colour, so the reading survives greyscale\nand forced-colours mode.",
  "import": "import { ConfidenceIndicator } from 'ionbase-ui';",
  "status": "stable",
  "summary": "How much to trust the thing next to it — three levels with a required basis, never a percentage.",
  "useWhen": [
    "a generated answer varies in reliability and the reader should weigh it",
    "you can say what the confidence rests on"
  ],
  "useInstead": [
    {
      "when": "the answer is wrong or missing rather than uncertain",
      "use": "Alert"
    },
    {
      "when": "you want to show where the claim came from",
      "use": "Citation",
      "why": "a source is stronger than a confidence level, and often what the reader actually wanted"
    },
    {
      "when": "it is a status rather than a reliability",
      "use": "Badge"
    },
    {
      "when": "the reader needs to know the content was generated, not how far to trust it",
      "use": "AILabel",
      "why": "who made it and how good it is are different questions; pair them when both matter"
    }
  ],
  "variants": {
    "level": {
      "low": {
        "use": "thin or conflicting evidence. One bar, warning colour"
      },
      "medium": {
        "use": "reasonable support with real gaps. Two bars"
      },
      "high": {
        "use": "corroborated, and you can say by what. Three bars"
      }
    }
  },
  "a11y": {
    "guarantees": [
      "the level is spelled out in text, so it never depends on the meter",
      "the meter differs in filled COUNT rather than only in colour, and in forced-colours mode filled bars are solid while empty ones are outlined"
    ],
    "requires": [
      "`basis` — a type error if omitted, and the reason this component exists rather than a coloured dot"
    ]
  },
  "antiPatterns": [
    {
      "dont": "asking for a percentage prop",
      "why": "\"87% confident\" reads as a measurement and almost never is one — usually a softmax score or a model's claim about itself, neither of which is a calibrated probability. Three levels cannot overclaim that way"
    },
    {
      "dont": "a vague basis like \"model output\"",
      "why": "it satisfies the type and defeats the purpose — say \"3 of 4 sources agree\" or \"single unverified source\""
    },
    {
      "dont": "high confidence on every response",
      "why": "an indicator that never varies is decoration that still changes behaviour"
    }
  ],
  "stylesheet": "src/styles/confidence-indicator.css",
  "tokens": [
    "--border-width-default",
    "--font-family-sans",
    "--font-weight-medium",
    "--icon-information",
    "--icon-success",
    "--icon-tertiary",
    "--icon-warning",
    "--radius-2xs",
    "--spacing-12",
    "--spacing-16",
    "--spacing-2",
    "--spacing-4",
    "--spacing-8",
    "--text-default",
    "--text-secondary",
    "--text-tertiary",
    "--type-caption",
    "--type-caption-line-height"
  ],
  "props": {
    "level": {
      "type": "ConfidenceLevel",
      "required": true,
      "origin": "own",
      "values": [
        "low",
        "medium",
        "high"
      ]
    },
    "basis": {
      "type": "string",
      "required": true,
      "origin": "own",
      "description": "What the level is based on. REQUIRED, and the reason this component exists\nrather than a coloured dot: a confidence with no stated basis is a number\nthe reader has no way to weigh. \"3 of 4 sources agree\", \"no matching\nrecords found\", \"single unverified source\"."
    },
    "label": {
      "type": "string | undefined",
      "required": false,
      "origin": "own",
      "description": "Override the level's word. Keep it a word, not a percentage."
    }
  },
  "propCounts": {
    "own": 3,
    "aria": 0,
    "dom": 277,
    "other": 0
  }
}
