{
  "$schema": "https://www.digitaltableteur.com/schemas/contract-spec/1.0/contract.schema.json",
  "specVersion": "1.0",
  "name": "PageLayout",
  "status": "stable",
  "description": "Page-body wrapper with a max-width container, default page margins, an optional grid mode, and a spacing scale.",
  "package": {
    "name": "@digitaltableteur/react",
    "import": "import { PageLayout } from \"@digitaltableteur/react\";"
  },
  "props": {
    "children": {
      "type": "React.ReactNode",
      "optional": false,
      "description": "Content to be displayed within the layout"
    },
    "maxWidth": {
      "type": "union",
      "values": [
        "sm",
        "md",
        "lg",
        "full",
        "xl"
      ],
      "optional": true,
      "description": "Maximum width constraint for the content"
    },
    "grid": {
      "type": "boolean",
      "optional": true,
      "description": "Whether to use the 12-column grid system"
    },
    "columns": {
      "type": "number",
      "optional": true,
      "description": "Fixed number of equal columns when grid=true, written as an inline\ngrid-template-columns that replaces the responsive 4/8/12 column ladder\ngrid=true gives on its own. Ignored when grid is false."
    },
    "spacing": {
      "type": "union",
      "values": [
        "compact",
        "default",
        "comfortable",
        "spacious"
      ],
      "optional": true,
      "description": "Vertical spacing between sections"
    },
    "withMargins": {
      "type": "boolean",
      "optional": true,
      "description": "Apply consistent page margins"
    },
    "className": {
      "type": "string",
      "optional": true,
      "description": "Additional CSS class name"
    },
    "as": {
      "type": "union",
      "values": [
        "article",
        "main",
        "div",
        "section"
      ],
      "optional": true,
      "description": "Semantic HTML element to use for the container"
    },
    "role": {
      "type": "string",
      "optional": true,
      "description": "ARIA role for accessibility"
    },
    "ariaLabel": {
      "type": "string",
      "optional": true,
      "description": "ARIA label for accessibility"
    },
    "style": {
      "type": "React.CSSProperties",
      "optional": true,
      "description": "Inline style merged over the grid columns style; caller values win."
    }
  },
  "rules": [
    {
      "id": "pagelayout-columns-need-grid",
      "when": {
        "columns": {
          "present": true
        },
        "grid": {
          "absent": true
        }
      },
      "requireAllOf": [
        "grid"
      ],
      "reason": "`columns` only applies when `grid` is true; `grid` defaults to false, so the column count is dropped.",
      "severity": "error",
      "evidence": "PageLayout.tsx gridStyle: returns {} when !grid"
    },
    {
      "id": "pagelayout-columns-with-grid-off",
      "when": {
        "grid": {
          "equals": false
        }
      },
      "forbid": [
        "columns"
      ],
      "reason": "`columns` only applies when `grid` is true.",
      "severity": "error",
      "evidence": "PageLayout.tsx gridStyle: returns {} when !grid"
    }
  ],
  "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/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-default.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:36:29.275Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-default.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:17:33.901Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-default.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:15.382Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-example.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:36:29.855Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-example.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:17:34.435Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-example.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:16.130Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-forced-colors.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:36:30.151Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:17:34.696Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-forced-colors.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:16.534Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-playground.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:36:29.569Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-playground.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:17:34.164Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-playground.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:15.754Z",
            "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/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-default.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:36:29.275Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-default.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:44:51.599Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-default.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:17:33.901Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-default.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:15.382Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-example.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:36:29.855Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-example.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:44:52.126Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-example.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:17:34.435Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-example.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:16.130Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-forced-colors.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:36:30.151Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-forced-colors.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:44:52.387Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:17:34.696Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-forced-colors.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:16.534Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-playground.dark.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:36:29.569Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-playground.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:44:51.859Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-playground.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:17:34.164Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-playground.light.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:28:15.754Z",
            "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/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-default.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:44:51.599Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-example.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:44:52.126Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-forced-colors.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:44:52.387Z",
            "passed": true,
            "runner": "local-recapture"
          },
          {
            "artifact": "../../../nextjs-app/shared/patterns/PageLayout/__a11y-evidence__/patterns-pagelayout-playground.forced-colors.json",
            "sourceCommit": "930c562b591b6d9967e1e8c214899052624d9a2f",
            "capturedAt": "2026-11-03T22:44:51.859Z",
            "passed": true,
            "runner": "local-recapture"
          }
        ]
      },
      {
        "id": "human-a11y-review",
        "statement": "A human completed an end-to-end accessibility review of this component.",
        "verification": "manual",
        "note": "2026-05-28 — Promoted from alpha: Example + ForcedColors stories present; Storybook axe gate enabled. 2026-07-09 — Promoted beta→stable: AT snapshots captured for all required stories (base mode, sibling SiteFooter convention), forced-colors pass re-verified in real browser, consumers audited (12 production pages each).",
        "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/patterns/PageLayout/PageLayout.module.css",
    "../../../nextjs-app/shared/patterns/PageLayout/PageLayout.tsx"
  ]
}
