{
  "component": {
    "id": "audit-log",
    "name": "Audit log",
    "tier": "pro",
    "exampleId": "audit-log",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/audit-log-demo.tsx",
    "exportName": "AuditLogDemo",
    "sha256": "937770ada5fed3f6bb7b49a6295f1ff2ff453818000d90d44ac5a95fe17f3e8a",
    "helperImports": [],
    "directComponentImports": [
      "audit-log"
    ],
    "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/audit-log",
    "registryUrl": "https://tidalui.com/r/pro/audit-log.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/audit-log",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/audit-log",
      "registryUrl": "https://tidalui.com/r/pro/audit-log.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/audit-log.tsx",
    "exports": [
      "TidalAuditEvent",
      "TidalAuditFilter",
      "TidalAuditLinkedResource",
      "TidalAuditLog"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/audit-log.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "audit-log"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/audit-log.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/audit-log.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/audit-log-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useMemo, useState, type MouseEvent } from \"react\";\n\nimport { TidalAuditLog, type TidalAuditEvent, type TidalAuditFilter, type TidalAuditLinkedResource } from \"./components/ui/audit-log\";\n\nimport \"./components/ui/audit-log.css\";\n\n\n\nconst tidalExampleStyles = \".audit-demo,\\n.audit-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.audit-demo {\\n  container: audit-demo / inline-size;\\n  display: grid;\\n  width: 100%;\\n  max-width: 780px;\\n  min-width: 0;\\n  gap: 12px;\\n}\\n\\n.audit-demo-status,\\n.audit-demo-boundary,\\n.audit-demo-resources p {\\n  min-width: 0;\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n  overflow-wrap: anywhere;\\n}\\n\\n.audit-demo-status {\\n  min-height: 34px;\\n  padding: 8px 11px;\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-control);\\n  background: var(--t-subtle);\\n}\\n\\n.audit-demo-resources {\\n  display: grid;\\n  min-width: 0;\\n  grid-template-columns: repeat(3, minmax(0, 1fr));\\n  gap: 8px;\\n}\\n\\n.audit-demo-resources details {\\n  min-width: 0;\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-control);\\n  background: var(--t-surface);\\n}\\n\\n.audit-demo-resources summary {\\n  display: flex;\\n  min-width: 0;\\n  min-height: 44px;\\n  align-items: center;\\n  padding: 8px 10px;\\n  color: var(--t-ink);\\n  font-size: 11px;\\n  font-weight: 720;\\n  line-height: 1.4;\\n  cursor: pointer;\\n  overflow-wrap: anywhere;\\n}\\n\\n.audit-demo-resources summary:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.audit-demo-resources p {\\n  padding: 0 10px 11px;\\n}\\n\\n.audit-demo-boundary {\\n  text-align: center;\\n}\\n\\n@container audit-demo (max-width: 560px) {\\n  .audit-demo-resources {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n}\\n\\n@media (max-width: 560px) {\\n  .audit-demo-resources {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .audit-demo,\\n  .audit-demo * {\\n    scroll-behavior: auto;\\n  }\\n}\";\n\nconst SAMPLE_EVENTS = [\n  {\n    id: \"policy-updated\",\n    actor: { name: \"Ava Patel\", detail: \"Workspace owner\" },\n    action: \"updated access for\",\n    resourceKey: \"design-review\",\n    resourceLabel: \"Design review\",\n    category: \"access\",\n    dateTime: \"2026-10-14T15:42:00-05:00\",\n    timeLabel: \"3:42 PM\",\n    description: \"Review access changed for the sample workspace.\",\n    changes: [\n      {\n        id: \"visibility\",\n        field: \"Visibility\",\n        before: \"Private\",\n        after: \"Workspace members\",\n      },\n      {\n        id: \"commenting\",\n        field: \"Comments\",\n        before: \"Editors\",\n        after: \"All members\",\n      },\n    ],\n    recordNote: \"Source label: workspace settings\",\n  },\n  {\n    id: \"brief-renamed\",\n    actor: { name: \"Noah Kim\", detail: \"Editor\" },\n    action: \"renamed\",\n    resourceKey: \"project-brief\",\n    resourceLabel: \"Project brief\",\n    category: \"content\",\n    dateTime: \"2026-10-14T14:18:00-05:00\",\n    timeLabel: \"2:18 PM\",\n    description:\n      \"The supplied record includes the exact previous and next title.\",\n    changes: [\n      {\n        id: \"title\",\n        field: \"Title\",\n        before: \"Launch outline\",\n        after: \"Project brief\",\n      },\n    ],\n    recordNote: \"Source label: document settings\",\n  },\n  {\n    id: \"guest-removed\",\n    actor: { name: \"Mila Santos\", detail: \"Project lead\" },\n    action: \"removed a guest from\",\n    resourceKey: \"launch-board\",\n    resourceLabel: \"Launch board\",\n    category: \"access\",\n    dateTime: \"2026-10-14T12:06:00-05:00\",\n    timeLabel: \"12:06 PM\",\n    changes: [\n      {\n        id: \"guest\",\n        field: \"Guest access\",\n        before: \"sample.guest@example.test\",\n        after: \"Removed\",\n      },\n    ],\n    recordNote: \"Source label: member settings\",\n  },\n  {\n    id: \"status-changed\",\n    actor: { name: \"Ava Patel\", detail: \"Workspace owner\" },\n    action: \"changed the status of\",\n    resourceKey: \"launch-board\",\n    resourceLabel: \"Launch board\",\n    category: \"content\",\n    dateTime: \"2026-10-14T10:31:00-05:00\",\n    timeLabel: \"10:31 AM\",\n    changes: [\n      {\n        id: \"status\",\n        field: \"Status\",\n        before: \"Review\",\n        after: \"Ready\",\n      },\n    ],\n    recordNote: \"Source label: project board\",\n  },\n] as const;\n\ntype ActorFilter = \"all\" | \"ava\" | \"noah\" | \"mila\";\n\ntype CategoryFilter = \"all\" | \"access\" | \"content\";\n\nexport function AuditLogDemo() {\n  const instanceId = useId().replace(/:/g, \"\");\n  const [actor, setActor] = useState<ActorFilter>(\"all\");\n  const [category, setCategory] = useState<CategoryFilter>(\"all\");\n  const [exportStatus, setExportStatus] = useState(\n    \"No sample export has been prepared.\",\n  );\n\n  const resourceIds = useMemo(\n    () =>\n      Object.fromEntries(\n        [\"design-review\", \"project-brief\", \"launch-board\"].map((key) => [\n          key,\n          `audit-demo-${instanceId}-${key}`,\n        ]),\n      ),\n    [instanceId],\n  );\n  const events = useMemo<readonly TidalAuditEvent[]>(\n    () =>\n      SAMPLE_EVENTS.filter((event) => {\n        const actorMatches =\n          actor === \"all\" ||\n          event.actor.name.toLocaleLowerCase().startsWith(actor);\n        return (\n          actorMatches && (category === \"all\" || event.category === category)\n        );\n      }).map((event) => ({\n        id: event.id,\n        actor: event.actor,\n        action: event.action,\n        resource: {\n          label: event.resourceLabel,\n          href: `#${resourceIds[event.resourceKey]}`,\n        },\n        dateTime: event.dateTime,\n        timeLabel: event.timeLabel,\n        description: \"description\" in event ? event.description : undefined,\n        changes: event.changes,\n        recordNote: event.recordNote,\n      })),\n    [actor, category, resourceIds],\n  );\n\n  const filters = useMemo<readonly TidalAuditFilter[]>(\n    () => [\n      {\n        id: \"actor\",\n        label: \"Actor\",\n        value: actor,\n        options: [\n          { value: \"all\", label: \"All actors\", count: 4 },\n          { value: \"ava\", label: \"Ava Patel\", count: 2 },\n          { value: \"noah\", label: \"Noah Kim\", count: 1 },\n          { value: \"mila\", label: \"Mila Santos\", count: 1 },\n        ],\n        onValueChange: (value: string) => setActor(value as ActorFilter),\n      },\n      {\n        id: \"category\",\n        label: \"Record type\",\n        value: category,\n        options: [\n          { value: \"all\", label: \"All records\", count: 4 },\n          { value: \"access\", label: \"Access\", count: 2 },\n          { value: \"content\", label: \"Content\", count: 2 },\n        ],\n        onValueChange: (value: string) => setCategory(value as CategoryFilter),\n      },\n    ],\n    [actor, category],\n  );\n\n  const openResource = (event: MouseEvent<HTMLAnchorElement>) => {\n    if (\n      event.button !== 0 ||\n      event.metaKey ||\n      event.ctrlKey ||\n      event.shiftKey ||\n      event.altKey\n    )\n      return;\n    const href = event.currentTarget.getAttribute(\"href\");\n    if (!href?.startsWith(\"#\")) return;\n    const target = event.currentTarget.ownerDocument.getElementById(\n      href.slice(1),\n    );\n    if (target instanceof HTMLDetailsElement) target.open = true;\n  };\n\n  const linkedEvents: readonly TidalAuditEvent[] = events.map((event) => ({\n    ...event,\n    resource:\n      \"href\" in event.resource\n        ? {\n            ...(event.resource as TidalAuditLinkedResource),\n            linkProps: { onClick: openResource },\n          }\n        : event.resource,\n  }));\n\n  return (\n    <section className=\"audit-demo\" aria-label=\"Audit log sample\">\n      <TidalAuditLog\n        title=\"Workspace audit\"\n        description=\"Review exact sample changes and their supplied context.\"\n        summary={`${events.length} visible record${events.length === 1 ? \"\" : \"s\"}`}\n        timezoneLabel=\"Central time\"\n        events={linkedEvents}\n        filters={filters}\n        exportAction={{\n          label: \"Prepare export preview\",\n          onExport: () =>\n            setExportStatus(\n              `Export preview prepared locally for ${events.length} record${events.length === 1 ? \"\" : \"s\"}. No file was created.`,\n            ),\n        }}\n        emptyContent=\"No sample records match both filters.\"\n      />\n\n      <p className=\"audit-demo-status\" role=\"status\">\n        {exportStatus}\n      </p>\n\n      <div className=\"audit-demo-resources\" aria-label=\"Sample resource notes\">\n        <details id={resourceIds[\"design-review\"]}>\n          <summary>Design review</summary>\n          <p>Sample review space with workspace-member access.</p>\n        </details>\n        <details id={resourceIds[\"project-brief\"]}>\n          <summary>Project brief</summary>\n          <p>Sample document using the updated title.</p>\n        </details>\n        <details id={resourceIds[\"launch-board\"]}>\n          <summary>Launch board</summary>\n          <p>Sample board with local access and status changes.</p>\n        </details>\n      </div>\n\n      <p className=\"audit-demo-boundary\">\n        Sample records. Filters and export preview stay on this page.\n      </p>\n    </section>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <AuditLogDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/audit-log.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [],
  "events": [],
  "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": "Existing demo label or ARIA prop",
    "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": []
}
