{
  "$schema": "https://www.digitaltableteur.com/schemas/contract-spec/1.0/contract.schema.json",
  "specVersion": "1.0",
  "name": "Badge",
  "status": "stable",
  "description": "Compact status label with an orthogonal variant (visual weight) and tone (semantic colour), a size, and an optional icon.",
  "package": {
    "name": "@digitaltableteur/react",
    "import": "import { Badge } from \"@digitaltableteur/react\";"
  },
  "props": {
    "children": {
      "type": "React.ReactNode",
      "optional": false,
      "description": "Label. Rendered exactly as given (never looked up as a translation key), so pass already translated text."
    },
    "variant": {
      "type": "union",
      "values": [
        "primary",
        "secondary"
      ],
      "optional": true,
      "description": "Visual weight. Defaults to `primary`."
    },
    "tone": {
      "type": "union",
      "values": [
        "info",
        "success",
        "warning",
        "error",
        "neutral"
      ],
      "optional": true,
      "description": "Semantic colour, orthogonal to `variant`. When omitted no tone class is\napplied and no semantic icon is added."
    },
    "size": {
      "type": "union",
      "values": [
        "sm",
        "md",
        "lg",
        "xs"
      ],
      "optional": true,
      "description": "Size. Defaults to `md`."
    },
    "className": {
      "type": "string",
      "optional": true
    },
    "removable": {
      "type": "boolean",
      "optional": true,
      "description": "Renders a dismiss control that removes the badge. On dismiss, focus moves\nto the next focusable element (else the previous one) before the badge\nunmounts. Defaults to `false`."
    },
    "onRemove": {
      "type": "() => void",
      "optional": true,
      "description": "Called after the badge is dismissed and focus has moved; focus it sets here wins."
    },
    "icon": {
      "type": "React.ReactNode",
      "optional": true,
      "description": "Leading icon; a semantic icon is supplied automatically for non-neutral tones."
    },
    "dot": {
      "type": "boolean",
      "optional": true,
      "description": "Render a leading StatusDot instead of the semantic icon, for example on\nlifecycle badges (alpha/beta/stable/deprecated). The dot paints the badge's\nown text colour (currentcolor), so on a filled badge it matches the label\nrather than the tone. An explicit `icon` still wins."
    },
    "square": {
      "type": "boolean",
      "optional": true,
      "description": "Square (non-pill) corners."
    },
    "role": {
      "type": "\"status\"",
      "optional": true,
      "description": "ARIA role. `\"status\"` makes dynamic updates announce via `aria-live=\"polite\"`\n(e.g. a live notification count). Omit for static decorative badges."
    }
  },
  "accessibility": {
    "criteria": [
      {
        "id": "axe-no-violations",
        "statement": "Required stories produce no axe violations at the configured severity.",
        "verification": "automated",
        "wcag": [
          "2.5.8"
        ],
        "check": "npm run test:stories:matrix:ci",
        "evidence": [
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-default.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:43:15.527Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-default.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:24:27.924Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-default.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:34:31.260Z",
            "passed": true,
            "runner": "local-recapture"
          }
        ]
      },
      {
        "id": "accessibility-tree",
        "statement": "The accessibility tree (role, name, state) matches the committed snapshot for every required story.",
        "verification": "automated",
        "wcag": [
          "1.3.1",
          "4.1.2"
        ],
        "check": "npm run test:stories:matrix:ci",
        "evidence": [
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-default.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:43:15.527Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-default.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:51:34.235Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-default.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:24:27.924Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-default.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:34:31.260Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-example.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:43:15.589Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-example.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:51:34.279Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-example.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:24:27.973Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-example.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:34:31.327Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-forced-colors.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:43:15.619Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-forced-colors.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:51:34.320Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:24:28.014Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-forced-colors.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:34:31.392Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-playground.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:43:14.985Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-playground.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:51:33.883Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-playground.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:24:27.302Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-playground.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:34:30.584Z",
            "passed": true,
            "runner": "local-recapture"
          }
        ]
      },
      {
        "id": "forced-colors-real-browser",
        "statement": "The component remains legible and operable under a real browser forced-colors: active pass.",
        "verification": "automated",
        "check": "npm run test:stories:hc",
        "evidence": [
          {
            "artifact": "../../../nextjs-app/shared/components/Badge/__a11y-evidence__/content-badge-default.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:51:34.235Z",
            "passed": true,
            "runner": "local-recapture"
          }
        ]
      },
      {
        "id": "aria-requirements",
        "statement": "Documented ARIA roles, states, and properties are present on the rendered output.",
        "verification": "unverified",
        "wcag": [
          "4.1.2"
        ],
        "note": "No exportable evidence record for this check; re-run the check to capture one."
      },
      {
        "id": "human-a11y-review",
        "statement": "A human completed an end-to-end accessibility review of this component.",
        "verification": "manual",
        "note": "2026-06-18 — platinum pass: variant/tone API, sm/md/lg sizes, contrast and forced-colors verified.",
        "reviewedAt": "2026-11-04"
      }
    ]
  },
  "governance": {
    "owner": "design-system",
    "lastReviewed": "2026-11-04",
    "note": "Reviewed by Petri Lahdelma; prepared by Claude from a code review on 2026-11-03"
  },
  "source": [
    "../../../nextjs-app/shared/components/Badge/Badge.module.css",
    "../../../nextjs-app/shared/components/Badge/Badge.tsx"
  ]
}
