{
  "component": {
    "id": "data-grid",
    "name": "Data grid",
    "tier": "pro",
    "exampleId": "data-grid",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/data-grid-demo.tsx",
    "exportName": "DataGridDemo",
    "sha256": "b3140a354dc76423324dc20d5a3e572e89bff785ac458eb748ffb739da5b3561",
    "helperImports": [],
    "directComponentImports": [
      "data-grid"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/data-grid",
    "registryUrl": "https://tidalui.com/r/pro/data-grid.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/data-grid",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/data-grid",
      "registryUrl": "https://tidalui.com/r/pro/data-grid.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/data-grid.tsx",
    "exports": [
      "TidalDataGrid",
      "TidalDataGridCell",
      "TidalDataGridColumn"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/data-grid.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "data-grid"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/data-grid.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/data-grid.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/data-grid-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useId, useState, type FormEvent, type SyntheticEvent } from \"react\";\n\nimport { TidalDataGrid, type TidalDataGridCell, type TidalDataGridColumn } from \"./components/ui/data-grid\";\n\nimport \"./components/ui/data-grid.css\";\n\n\n\nconst tidalExampleStyles = \".data-grid-demo {\\n  inline-size: 100%;\\n  max-inline-size: 860px;\\n  min-inline-size: 0;\\n}\\n.data-grid-demo-status {\\n  display: block;\\n  min-block-size: 20px;\\n  margin-block-start: 12px;\\n  color: var(--t-ink);\\n  font-size: 12px;\\n  line-height: 1.5;\\n}\\n.data-grid-demo-note {\\n  margin: 3px 0 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n}\";\n\ninterface ProjectRow {\n  id: string;\n  project: string;\n  owner: string;\n  seats: string;\n  status: string;\n}\n\nconst INITIAL_ROWS: ProjectRow[] = [\n  {\n    id: \"atlas\",\n    project: \"Atlas onboarding\",\n    owner: \"Mira Chen\",\n    seats: \"18\",\n    status: \"In review\",\n  },\n  {\n    id: \"relay\",\n    project: \"Relay workspace\",\n    owner: \"Owen Price\",\n    seats: \"32\",\n    status: \"Active\",\n  },\n  {\n    id: \"field\",\n    project: \"Field notes\",\n    owner: \"Sam Rivera\",\n    seats: \"7\",\n    status: \"Draft\",\n  },\n];\n\nexport function DataGridDemo() {\n  const statusId = useId().replace(/:/g, \"\");\n  const [rows, setRows] = useState(INITIAL_ROWS);\n  const [selected, setSelected] = useState<Set<string>>(new Set([\"relay\"]));\n  const [activeCell, setActiveCell] = useState<TidalDataGridCell | null>({\n    rowId: \"atlas\",\n    columnId: \"project\",\n  });\n  const [editingCell, setEditingCell] = useState<TidalDataGridCell | null>(\n    null,\n  );\n  const [editValue, setEditValue] = useState(\"\");\n  const [errors, setErrors] = useState<Record<string, string>>({});\n  const [status, setStatus] = useState(\"Select a cell or use the arrow keys.\");\n\n  const columns: readonly TidalDataGridColumn<ProjectRow>[] = [\n    {\n      id: \"project\",\n      header: \"Project\",\n      accessibleLabel: \"Project\",\n      renderCell: (row) => row.project,\n      getEditValue: (row) => row.project,\n      width: 220,\n      error: (row) => errors[`${row.id}:project`],\n    },\n    {\n      id: \"owner\",\n      header: \"Owner\",\n      accessibleLabel: \"Owner\",\n      renderCell: (row) => row.owner,\n      getEditValue: (row) => row.owner,\n      width: 180,\n      error: (row) => errors[`${row.id}:owner`],\n    },\n    {\n      id: \"seats\",\n      header: \"Seats\",\n      accessibleLabel: \"Seats\",\n      renderCell: (row) => row.seats,\n      getEditValue: (row) => row.seats,\n      inputType: \"number\",\n      width: 110,\n      align: \"end\",\n      editorProps: () => ({ min: \"0\", inputMode: \"numeric\" }),\n      error: (row) => errors[`${row.id}:seats`],\n    },\n    {\n      id: \"status\",\n      header: \"Status\",\n      accessibleLabel: \"Status\",\n      renderCell: (row) => row.status,\n      width: 140,\n    },\n  ];\n\n  function beginEditing(\n    cell: TidalDataGridCell | null,\n    event: SyntheticEvent<HTMLElement>,\n  ) {\n    if (!cell) {\n      setEditingCell(null);\n      setStatus(\"Edit cancelled.\");\n      return;\n    }\n    const row = rows.find((item) => item.id === cell.rowId);\n    const column = columns.find((item) => item.id === cell.columnId);\n    if (!row || !column?.getEditValue) return;\n    setEditValue(column.getEditValue(row));\n    setEditingCell(cell);\n    setStatus(\n      `Editing ${column.accessibleLabel.toLowerCase()} for ${row.project}.`,\n    );\n    if (event.defaultPrevented) return;\n  }\n\n  function commit(\n    cell: TidalDataGridCell,\n    value: string,\n    event: FormEvent<HTMLFormElement>,\n  ) {\n    event.preventDefault();\n    const next = value.trim();\n    const key = `${cell.rowId}:${cell.columnId}`;\n    if (\n      !next ||\n      (cell.columnId === \"seats\" && (!/^\\d+$/.test(next) || Number(next) > 999))\n    ) {\n      setErrors((current) => ({\n        ...current,\n        [key]:\n          cell.columnId === \"seats\"\n            ? \"Enter 0 to 999 seats.\"\n            : \"Enter a value.\",\n      }));\n      setStatus(\"Correct the highlighted cell.\");\n      return;\n    }\n    setRows((current) =>\n      current.map((row) =>\n        row.id === cell.rowId ? { ...row, [cell.columnId]: next } : row,\n      ),\n    );\n    setErrors((current) => {\n      const copy = { ...current };\n      delete copy[key];\n      return copy;\n    });\n    setEditingCell(null);\n    setStatus(\"Local sample row updated.\");\n  }\n\n  return (\n    <div className=\"data-grid-demo\">\n      <TidalDataGrid\n        caption=\"Project capacity\"\n        description=\"Edit the project, owner or seat count. Status is read only.\"\n        rows={rows}\n        columns={columns}\n        getRowId={(row) => row.id}\n        getRowLabel={(row) => row.project}\n        activeCell={activeCell}\n        onActiveCellChange={(cell) => setActiveCell(cell)}\n        editingCell={editingCell}\n        editValue={editValue}\n        onEditingCellChange={beginEditing}\n        onEditValueChange={(value) => setEditValue(value)}\n        onCellCommit={commit}\n        selection={{\n          selectedRowIds: selected,\n          onSelectionChange: (ids) => {\n            setSelected(ids);\n            setStatus(\n              `${ids.size} ${ids.size === 1 ? \"row\" : \"rows\"} selected.`,\n            );\n          },\n          getRowLabel: (row) => row.project,\n        }}\n      />\n      <output\n        id={statusId}\n        className=\"data-grid-demo-status\"\n        aria-live=\"polite\"\n      >\n        {status}\n      </output>\n      <p className=\"data-grid-demo-note\">\n        Sample records only. Changes stay in this preview.\n      </p>\n    </div>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <DataGridDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/data-grid.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "rows",
      "type": "inferred-from-existing-demo",
      "initial": "INITIAL_ROWS",
      "setter": "setRows",
      "proposalCanBeRejected": false
    },
    {
      "prop": "activeCell",
      "type": "inferred-from-existing-demo",
      "initial": "{\n    rowId: \"atlas\",\n    columnId: \"project\",\n  }",
      "setter": "setActiveCell",
      "proposalCanBeRejected": false
    },
    {
      "prop": "editingCell",
      "type": "inferred-from-existing-demo",
      "initial": "null,",
      "setter": "setEditingCell",
      "proposalCanBeRejected": false
    },
    {
      "prop": "editValue",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setEditValue",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onActiveCellChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onCellCommit",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onEditValueChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onEditingCellChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Consumer-provided label remains required where the component API requires one.",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Preserve browser focus order and visible focus.",
    "errorAnnouncement": "The existing error or alert path remains consumer-owned and should be announced by the rendered semantics.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
