{
  "$schema": "https://www.digitaltableteur.com/schemas/contract-spec/1.0/contract.schema.json",
  "specVersion": "1.0",
  "name": "ConfirmPopover",
  "status": "alpha",
  "description": "Asks \"are you sure?\" next to the control that triggered it: a non-modal alertdialog anchored to the trigger with a question, an optional consequence and Cancel / confirm buttons.",
  "props": {
    "children": {
      "type": "React.ReactElement",
      "optional": false,
      "description": "The control that opens the confirmation, usually a Button. It keeps its own label and styling."
    },
    "title": {
      "type": "string",
      "optional": false,
      "description": "The question, for example \"Clear the answers in this section?\". Names the dialog. With choices, it asks which one, for example \"What do you want to clear?\"."
    },
    "description": {
      "type": "string",
      "optional": true,
      "description": "What happens if the person confirms; describes the dialog."
    },
    "confirmLabel": {
      "type": "string",
      "optional": true,
      "description": "Label of the confirming button; repeat the action, for example \"Clear answers\". Not used with choices, where each choice has its own."
    },
    "choices": {
      "type": "ConfirmPopoverChoice[]",
      "optional": true,
      "description": "Several actions to pick from first; picking one asks \"are you sure?\" with that choice's question and labels."
    },
    "cancelLabel": {
      "type": "string",
      "optional": true,
      "description": "Label of the cancelling button."
    },
    "tone": {
      "type": "union",
      "values": [
        "error",
        "neutral"
      ],
      "optional": true,
      "description": "\"error\" for actions that remove or destroy something."
    },
    "onConfirm": {
      "type": "(choiceId?: string) => void",
      "optional": false,
      "description": "Called when the person confirms, with the picked choice's id when there are choices; the popover then closes."
    },
    "onOpenChange": {
      "type": "(open: boolean) => void",
      "optional": true,
      "description": "Called when the popover opens or closes, whichever way."
    },
    "side": {
      "type": "union",
      "values": [
        "top",
        "right",
        "bottom",
        "left"
      ],
      "optional": true,
      "description": "Preferred side of the trigger; flips when out of room."
    },
    "align": {
      "type": "union",
      "values": [
        "center",
        "start",
        "end"
      ],
      "optional": true,
      "description": "Alignment along that side. Not used with arrow, which always centres the\npopover on the trigger."
    },
    "arrow": {
      "type": "boolean",
      "optional": true,
      "description": "Draws a pointer from the middle of the popover's edge to the trigger, like\na speech bubble; side picks the edge (top, right, bottom or left) and the\npopover centres on the trigger. Off by default."
    },
    "shortcut": {
      "type": "string[]",
      "optional": true,
      "description": "Keys that run the action without the popover, one entry per key; shown\nunder the description as keycaps joined by plus signs."
    },
    "className": {
      "type": "string",
      "optional": true,
      "description": "Extra class on the popover surface."
    }
  },
  "rules": [
    {
      "id": "confirmpopover-arrow-centres",
      "when": {
        "arrow": {
          "present": true
        },
        "align": {
          "oneOf": [
            "start",
            "end"
          ]
        }
      },
      "forbid": [
        "align"
      ],
      "reason": "A speech-bubble pointer sits in the middle of the popover's edge, so the popover centres on the trigger and align is ignored. Drop align, e.g. <ConfirmPopover side=\"left\" arrow />.",
      "severity": "warning",
      "evidence": "ConfirmPopover.tsx development warning (arrow && align !== \"center\")"
    }
  ],
  "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/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-default.dark.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:25:40.200Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-default.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:12:26.846Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-default.light.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:19:54.345Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-example.dark.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:25:40.676Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-example.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:12:27.364Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-example.light.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:19:54.832Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-forced-colors.dark.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:25:40.899Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:12:27.600Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-forced-colors.light.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:19:55.048Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-playground.dark.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:25:40.425Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-playground.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:12:27.104Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-playground.light.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:19:54.583Z",
            "passed": true,
            "runner": "local-audit-fixes"
          }
        ]
      },
      {
        "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/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-default.dark.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:25:40.200Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-default.forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:32:45.101Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-default.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:12:26.846Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-default.light.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:19:54.345Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-example.dark.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:25:40.676Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-example.forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:32:45.560Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-example.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:12:27.364Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-example.light.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:19:54.832Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-forced-colors.dark.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:25:40.899Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-forced-colors.forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:32:45.764Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:12:27.600Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-forced-colors.light.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:19:55.048Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-playground.dark.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:25:40.425Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-playground.forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:32:45.328Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-playground.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:12:27.104Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-playground.light.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:19:54.583Z",
            "passed": true,
            "runner": "local-audit-fixes"
          }
        ]
      },
      {
        "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/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-default.forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:32:45.101Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-example.forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:32:45.560Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-forced-colors.forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:32:45.764Z",
            "passed": true,
            "runner": "local-audit-fixes"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/ConfirmPopover/__a11y-evidence__/overlay-confirmpopover-playground.forced-colors.json",
            "sourceCommit": "ffbeeeec52e120b19494e2ac7b4dbab8ff13ceb3",
            "capturedAt": "2026-11-07T09:32:45.328Z",
            "passed": true,
            "runner": "local-audit-fixes"
          }
        ]
      },
      {
        "id": "keyboard-contract",
        "statement": "Every documented keyboard interaction works as specified.",
        "verification": "unverified",
        "wcag": [
          "2.1.1",
          "2.1.2"
        ],
        "note": "Marked reviewed, but no review date was recorded."
      },
      {
        "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."
      }
    ]
  },
  "source": [
    "../../../nextjs-app/shared/components/ConfirmPopover/ConfirmPopover.module.css",
    "../../../nextjs-app/shared/components/ConfirmPopover/ConfirmPopover.tsx"
  ]
}
