{
  "$schema": "https://www.digitaltableteur.com/schemas/contract-spec/1.0/contract.schema.json",
  "specVersion": "1.0",
  "name": "FileUpload",
  "status": "stable",
  "description": "File picker with size validation and clear control.",
  "package": {
    "name": "@digitaltableteur/react",
    "import": "import { FileUpload } from \"@digitaltableteur/react\";"
  },
  "props": {
    "label": {
      "type": "string",
      "optional": false,
      "description": "Field label"
    },
    "placeholder": {
      "type": "string",
      "optional": true,
      "description": "Placeholder shown when no file is selected"
    },
    "helperText": {
      "type": "string",
      "optional": true,
      "description": "Helper copy below the control"
    },
    "uploadButtonLabel": {
      "type": "string",
      "optional": false,
      "description": "Upload button label"
    },
    "clearButtonLabel": {
      "type": "string",
      "optional": true,
      "description": "Clear/remove button label; the button shows only while a file is set, and activating it moves focus to the upload button"
    },
    "accept": {
      "type": "string",
      "optional": true,
      "description": "Accepted file extensions/MIME types for the native picker"
    },
    "maxSizeInBytes": {
      "type": "number",
      "optional": true,
      "description": "Maximum file size in bytes; checked when a file is picked"
    },
    "sizeErrorMessage": {
      "type": "string",
      "optional": true,
      "description": "Error shown when a picked file exceeds maxSizeInBytes"
    },
    "error": {
      "type": "string",
      "optional": true,
      "description": "External error message; renders above the helper line"
    },
    "value": {
      "type": "File | null",
      "optional": true,
      "description": "Controlled File value"
    },
    "onFileChange": {
      "type": "(file: File | null) => void",
      "optional": true,
      "description": "Called when a file is selected or cleared"
    },
    "disabled": {
      "type": "boolean",
      "optional": true,
      "description": "Disables the control."
    },
    "required": {
      "type": "boolean",
      "optional": true,
      "description": "Marks the field required."
    },
    "appearance": {
      "type": "union",
      "values": [
        "default",
        "editorial"
      ],
      "optional": true,
      "description": "Match FormFieldEditorial / Combobox styling on editorial forms."
    },
    "className": {
      "type": "string",
      "optional": true
    }
  },
  "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/FileUpload/__a11y-evidence__/forms-fileupload-default.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:39:02.351Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-default.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:20:01.230Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-default.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:53.943Z",
            "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/FileUpload/__a11y-evidence__/forms-fileupload-default.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:39:02.351Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-default.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:47:45.690Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-default.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:20:01.230Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-default.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:53.943Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-example.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:39:02.414Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-example.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:47:45.807Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-example.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:20:01.298Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-example.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:54.016Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-forced-colors.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:39:02.442Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-forced-colors.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:47:45.850Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:20:01.327Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-forced-colors.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:54.045Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-playground.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:39:02.381Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-playground.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:47:45.760Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-playground.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:20:01.262Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/components/FileUpload/__a11y-evidence__/forms-fileupload-playground.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:53.976Z",
            "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/FileUpload/__a11y-evidence__/forms-fileupload-default.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:47:45.690Z",
            "passed": true,
            "runner": "local-recapture"
          }
        ]
      },
      {
        "id": "keyboard-contract",
        "statement": "Every documented keyboard interaction works as specified.",
        "verification": "unverified",
        "wcag": [
          "2.1.1",
          "2.1.2"
        ],
        "note": "No exportable evidence record for this check; re-run the check to capture one."
      },
      {
        "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-07-07 — beta→stable: 4-mode AT (base/light/dark/forced-colors) verified on a non-6010 Storybook; accessibility tree and real-browser forced-colors confirmed.",
        "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/FileUpload/FileUpload.module.css",
    "../../../nextjs-app/shared/components/FileUpload/FileUpload.tsx"
  ]
}
