{
  "component": {
    "id": "support-inbox",
    "name": "Support inbox",
    "tier": "pro",
    "exampleId": "support-inbox",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/support-inbox-demo.tsx",
    "exportName": "SupportInboxDemo",
    "sha256": "57b5dce6ce496cc660f95aab11d5e5434ffff7aa92133408101406993c1b4d56",
    "helperImports": [],
    "directComponentImports": [
      "support-inbox"
    ],
    "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/support-inbox",
    "registryUrl": "https://tidalui.com/r/pro/support-inbox.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/support-inbox",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/support-inbox",
      "registryUrl": "https://tidalui.com/r/pro/support-inbox.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/support-inbox.tsx",
    "exports": [
      "TidalSupportAction",
      "TidalSupportInbox",
      "TidalSupportStatusOption",
      "TidalSupportTicket"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/support-inbox.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "support-inbox"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/support-inbox.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/support-inbox.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/support-inbox-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useMemo, useRef, useState, type FormEvent } from \"react\";\n\nimport { TidalSupportInbox, type TidalSupportAction, type TidalSupportStatusOption, type TidalSupportTicket } from \"./components/ui/support-inbox\";\n\nimport \"./components/ui/support-inbox.css\";\n\nfunction tidalExampleAvatarDataUri(seed: unknown) {\n  const text = String(seed).replace(/[^a-z0-9]/gi, \"\").slice(-2) || \"UI\";\n  const palette = [\"#333333\", \"#555555\", \"#777777\", \"#999999\", \"#bbbbbb\"];\n  const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length];\n  const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\"><rect width=\"96\" height=\"96\" rx=\"48\" fill=\"${color}\"/><circle cx=\"48\" cy=\"38\" r=\"17\" fill=\"white\" fill-opacity=\".92\"/><path d=\"M18 92c3-22 15-34 30-34s27 12 30 34\" fill=\"white\" fill-opacity=\".92\"/></svg>`;\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\nfunction tidalExampleImageDataUri(label: string) {\n  const safeLabel = label.replace(/[<>&]/g, \"\").slice(0, 28) || \"Sample image\";\n  const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1200 675\"><defs><linearGradient id=\"g\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\"><stop stop-color=\"#171717\"/><stop offset=\"1\" stop-color=\"#555555\"/></linearGradient></defs><rect width=\"1200\" height=\"675\" fill=\"url(#g)\"/><circle cx=\"950\" cy=\"100\" r=\"260\" fill=\"white\" fill-opacity=\".08\"/><text x=\"80\" y=\"570\" fill=\"white\" font-family=\"system-ui,sans-serif\" font-size=\"64\" font-weight=\"700\">${safeLabel}</text></svg>`;\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\nconst tidalExampleStyles = \".tidal-scope .support-inbox-demo,\\n.tidal-scope .support-inbox-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .support-inbox-demo {\\n  width: 100%;\\n  max-width: 1160px;\\n  min-width: 0;\\n  padding: 20px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 22px;\\n  background:\\n    linear-gradient(var(--t-border) 1px, transparent 1px),\\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\\n    var(--t-subtle);\\n  background-size: 22px 22px;\\n  container: support-demo / inline-size;\\n}\\n\\n@container support-demo (max-width: 430px) {\\n  .tidal-scope .support-inbox-demo {\\n    padding: 8px;\\n  }\\n}\";\n\nconst INITIAL_TICKETS: readonly TidalSupportTicket[] = [\n  {\n    id: \"ava-export\",\n    customerName: \"Ava Chen\",\n    subject: \"Export includes an extra blank page\",\n    preview: \"The PDF is correct except for the final page.\",\n    timestamp: \"12 min\",\n    avatarSrc: tidalExampleAvatarDataUri(\"01\"),\n    status: \"open\",\n    statusLabel: \"Open\",\n    unreadCount: 2,\n    messages: [\n      {\n        id: \"ava-1\",\n        authorName: \"Ava Chen\",\n        avatarSrc: tidalExampleAvatarDataUri(\"01\"),\n        side: \"customer\",\n        timestamp: \"9:12 AM\",\n        body: \"The sample export looks right, but it adds one blank page at the end.\",\n      },\n      {\n        id: \"ava-2\",\n        authorName: \"Eli Park\",\n        avatarSrc: tidalExampleAvatarDataUri(\"04\"),\n        side: \"agent\",\n        timestamp: \"9:18 AM\",\n        body: \"Thanks. I can reproduce that in this fictional thread and will check the final section break.\",\n      },\n    ],\n  },\n  {\n    id: \"noah-members\",\n    customerName: \"Noah Reed\",\n    subject: \"Where do I review invited members?\",\n    preview: \"Looking for the sample member list.\",\n    timestamp: \"34 min\",\n    avatarSrc: tidalExampleAvatarDataUri(\"02\"),\n    status: \"pending\",\n    statusLabel: \"Pending\",\n    messages: [\n      {\n        id: \"noah-1\",\n        authorName: \"Noah Reed\",\n        avatarSrc: tidalExampleAvatarDataUri(\"02\"),\n        side: \"customer\",\n        timestamp: \"8:46 AM\",\n        body: \"Where can I see the people already invited to the sample workspace?\",\n      },\n    ],\n  },\n  {\n    id: \"mila-copy\",\n    customerName: \"Mila Stone\",\n    subject: \"Update the confirmation copy\",\n    preview: \"The current line needs a clearer next step.\",\n    timestamp: \"Yesterday\",\n    avatarSrc: tidalExampleAvatarDataUri(\"03\"),\n    status: \"resolved\",\n    statusLabel: \"Resolved\",\n    messages: [\n      {\n        id: \"mila-1\",\n        authorName: \"Mila Stone\",\n        avatarSrc: tidalExampleAvatarDataUri(\"03\"),\n        side: \"customer\",\n        timestamp: \"Yesterday\",\n        body: \"Could the confirmation explain what happens after the local draft is created?\",\n      },\n      {\n        id: \"mila-2\",\n        authorName: \"Eli Park\",\n        avatarSrc: tidalExampleAvatarDataUri(\"04\"),\n        side: \"agent\",\n        timestamp: \"Yesterday\",\n        body: \"The revised fictional copy now points to the review step.\",\n      },\n    ],\n  },\n];\n\nconst STATUS_OPTIONS: readonly TidalSupportStatusOption[] = [\n  { value: \"all\", label: \"All statuses\" },\n  { value: \"open\", label: \"Open\" },\n  { value: \"pending\", label: \"Pending\" },\n  { value: \"resolved\", label: \"Resolved\" },\n];\n\nfunction filterTickets(\n  tickets: readonly TidalSupportTicket[],\n  search: string,\n  status: string,\n) {\n  const query = search.trim().toLocaleLowerCase();\n  return tickets.filter((ticket) => {\n    const matchesStatus = status === \"all\" || ticket.status === status;\n    const matchesSearch =\n      !query ||\n      `${ticket.customerName} ${ticket.subject}`\n        .toLocaleLowerCase()\n        .includes(query);\n    return matchesStatus && matchesSearch;\n  });\n}\n\nexport function SupportInboxDemo() {\n  const [tickets, setTickets] = useState(INITIAL_TICKETS);\n  const [selectedId, setSelectedId] = useState(\"ava-export\");\n  const [search, setSearch] = useState(\"\");\n  const [status, setStatus] = useState(\"all\");\n  const [draft, setDraft] = useState(\"\");\n  const [message, setMessage] = useState(\n    \"This fictional inbox uses only local preview state.\",\n  );\n  const localReplyNumber = useRef(0);\n  const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n  const visibleTickets = useMemo(\n    () => filterTickets(tickets, search, status),\n    [search, status, tickets],\n  );\n\n  function reconcileSelection(nextTickets: readonly TidalSupportTicket[]) {\n    if (nextTickets.some((ticket) => ticket.id === selectedId)) return;\n    setSelectedId(nextTickets[0]?.id ?? \"\");\n    setDraft(\"\");\n  }\n\n  const selectedTicket = tickets.find((ticket) => ticket.id === selectedId);\n  const conversationActions = useMemo<readonly TidalSupportAction[]>(\n    () =>\n      selectedTicket\n        ? [\n            {\n              kind: \"button\" as const,\n              id: \"toggle-pending\",\n              label:\n                selectedTicket.status === \"pending\"\n                  ? \"Mark open\"\n                  : \"Mark pending\",\n              onAction: () => {\n                const nextStatus =\n                  selectedTicket.status === \"pending\" ? \"open\" : \"pending\";\n                setStatus(\"all\");\n                setTickets((current) =>\n                  current.map((ticket) =>\n                    ticket.id === selectedTicket.id\n                      ? {\n                          ...ticket,\n                          status: nextStatus,\n                          statusLabel:\n                            nextStatus === \"open\" ? \"Open\" : \"Pending\",\n                        }\n                      : ticket,\n                  ),\n                );\n                setMessage(\n                  `${selectedTicket.subject} marked ${nextStatus} in the local sample. The status filter returned to All statuses so the selected thread stays open.`,\n                );\n              },\n            },\n          ]\n        : [],\n    [selectedTicket],\n  );\n\n  function addLocalReply(\n    ticket: TidalSupportTicket,\n    event: FormEvent<HTMLFormElement>,\n  ) {\n    event.preventDefault();\n    const body = draft.trim();\n    if (!body) {\n      setMessage(\"Write a local reply before adding it.\");\n      textareaRef.current?.focus({ preventScroll: true });\n      return;\n    }\n    localReplyNumber.current += 1;\n    const replyId = `local-reply-${localReplyNumber.current}`;\n    setTickets((current) =>\n      current.map((currentTicket) =>\n        currentTicket.id === ticket.id\n          ? {\n              ...currentTicket,\n              messages: [\n                ...currentTicket.messages,\n                {\n                  id: replyId,\n                  authorName: \"Eli Park\",\n                  avatarSrc: tidalExampleAvatarDataUri(\"04\"),\n                  side: \"agent\" as const,\n                  timestamp: \"Just now\",\n                  body,\n                },\n              ],\n            }\n          : currentTicket,\n      ),\n    );\n    setDraft(\"\");\n    setMessage(`A fictional reply was added locally to ${ticket.subject}.`);\n    textareaRef.current?.focus({ preventScroll: true });\n  }\n\n  return (\n    <div className=\"support-inbox-demo\">\n      <TidalSupportInbox\n        title=\"Support inbox\"\n        eyebrow={null}\n        description=\"Search sample tickets and add a local reply.\"\n        tickets={visibleTickets}\n        selectedTicketId={selectedId}\n        onTicketSelect={(ticket) => {\n          setSelectedId(ticket.id);\n          setDraft(\"\");\n          setMessage(`${ticket.subject} selected.`);\n        }}\n        searchValue={search}\n        onSearchValueChange={(value) => {\n          setSearch(value);\n          reconcileSelection(filterTickets(tickets, value, status));\n        }}\n        searchInputProps={{ placeholder: \"Search name or subject\" }}\n        statusFilterValue={status}\n        statusOptions={STATUS_OPTIONS}\n        onStatusFilterChange={(value) => {\n          setStatus(value);\n          reconcileSelection(filterTickets(tickets, search, value));\n        }}\n        conversationActions={conversationActions}\n        draftValue={draft}\n        onDraftValueChange={setDraft}\n        onReplySubmit={addLocalReply}\n        composerLabel=\"Local reply draft\"\n        composerPlaceholder=\"Write a fictional reply\"\n        submitLabel=\"Add local reply\"\n        textareaRef={textareaRef}\n        submitButtonProps={{ disabled: !draft.trim() }}\n        footer={\n          <span>\n            <span role=\"status\" aria-live=\"polite\">\n              {message}\n            </span>{\" \"}\n            No reply is sent, stored, or connected to a support service.\n          </span>\n        }\n      />\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      <SupportInboxDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/support-inbox.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "selectedTicketId",
      "type": "inferred-from-existing-demo",
      "initial": "\"ava-export\"",
      "setter": "setSelectedId",
      "proposalCanBeRejected": false
    },
    {
      "prop": "searchValue",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setSearch",
      "proposalCanBeRejected": false
    },
    {
      "prop": "statusFilterValue",
      "type": "inferred-from-existing-demo",
      "initial": "\"all\"",
      "setter": "setStatus",
      "proposalCanBeRejected": false
    },
    {
      "prop": "draftValue",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setDraft",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onDraftValueChange",
      "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": "onReplySubmit",
      "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": "onSearchValueChange",
      "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": "onStatusFilterChange",
      "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": "onTicketSelect",
      "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": "No error announcement path is present in this demo; the consumer owns validation messaging.",
    "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": []
}
