{
  "component": {
    "id": "workspace-switcher",
    "name": "Workspace switcher",
    "tier": "pro",
    "exampleId": "workspace-switcher",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/workspace-switcher-demo.tsx",
    "exportName": "WorkspaceSwitcherDemo",
    "sha256": "7efdd3c338de4366c50ac82e051a7dcb60665d9c7f8e5f30310a0f84e2be24bd",
    "helperImports": [],
    "directComponentImports": [
      "workspace-switcher"
    ],
    "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/workspace-switcher",
    "registryUrl": "https://tidalui.com/r/pro/workspace-switcher.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/workspace-switcher",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/workspace-switcher",
      "registryUrl": "https://tidalui.com/r/pro/workspace-switcher.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/workspace-switcher.tsx",
    "exports": [
      "TidalWorkspaceOption",
      "TidalWorkspaceSwitcher"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/workspace-switcher.css",
      "components/ui/combobox.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "@tidal-pro/combobox"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "combobox",
      "workspace-switcher"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/workspace-switcher.css",
      "components/ui/combobox.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/workspace-switcher.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/workspace-switcher-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useState, type MouseEvent } from \"react\";\n\nimport { TidalWorkspaceSwitcher, type TidalWorkspaceOption } from \"./components/ui/workspace-switcher\";\n\nimport \"./components/ui/workspace-switcher.css\";\n\nimport \"./components/ui/combobox.css\";\n\n\n\nconst tidalExampleStyles = \".workspace-switcher-demo {\\n  width: 100%;\\n  max-width: 660px;\\n  min-width: 0;\\n  display: grid;\\n  gap: 14px;\\n  padding: 18px;\\n}\\n\\n.workspace-switcher-demo > .tidal-workspace-switcher {\\n  width: 100%;\\n}\\n\\n.workspace-switcher-demo-actions {\\n  display: grid;\\n  grid-template-columns: repeat(2, minmax(0, 1fr));\\n  gap: 8px;\\n}\\n\\n.workspace-switcher-demo-actions button {\\n  min-width: 44px;\\n  min-height: 44px;\\n  padding: 9px 12px;\\n  border: 1px solid var(--t-ink);\\n  border-radius: 10px;\\n  color: var(--t-surface);\\n  background: var(--t-ink);\\n  font: inherit;\\n  font-size: 12px;\\n  font-weight: 600;\\n  cursor: pointer;\\n  transition:\\n    color 160ms var(--t-ease-out),\\n    background 160ms var(--t-ease-out),\\n    transform 140ms var(--t-ease-out);\\n}\\n\\n.workspace-switcher-demo-actions button + button {\\n  color: var(--t-ink);\\n  background: var(--t-surface);\\n  border-color: var(--t-border);\\n}\\n\\n.workspace-switcher-demo-actions button:hover {\\n  transform: translateY(-1px);\\n}\\n\\n.workspace-switcher-demo-actions button:active {\\n  transform: scale(0.985);\\n}\\n\\n.workspace-switcher-demo-actions button:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 2px;\\n}\\n\\n.workspace-switcher-demo-destination {\\n  min-width: 0;\\n  padding: 14px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 12px;\\n  background: var(--t-subtle);\\n}\\n\\n.workspace-switcher-demo-destination[hidden] {\\n  display: none;\\n}\\n\\n.workspace-switcher-demo-destination h3,\\n.workspace-switcher-demo-destination p,\\n.workspace-switcher-demo > [role=\\\"status\\\"],\\n.workspace-switcher-demo-note {\\n  margin: 0;\\n  overflow-wrap: anywhere;\\n}\\n\\n.workspace-switcher-demo-destination h3 {\\n  font-size: 13px;\\n  line-height: 1.3;\\n}\\n\\n.workspace-switcher-demo-destination p,\\n.workspace-switcher-demo > [role=\\\"status\\\"],\\n.workspace-switcher-demo-note {\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n}\\n\\n.workspace-switcher-demo-destination p {\\n  margin-top: 4px;\\n}\\n\\n.workspace-switcher-demo-note {\\n  padding-top: 12px;\\n  border-top: 1px solid var(--t-border);\\n}\\n\\n@container preview-canvas (max-width: 390px) {\\n  .workspace-switcher-demo {\\n    padding: 10px;\\n  }\\n\\n  .workspace-switcher-demo-actions {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n}\\n\\n@media (max-width: 480px) {\\n  .workspace-switcher-demo {\\n    padding: 10px;\\n  }\\n\\n  .workspace-switcher-demo-actions {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .workspace-switcher-demo-actions button {\\n    transition: none;\\n  }\\n\\n  .workspace-switcher-demo-actions button:hover,\\n  .workspace-switcher-demo-actions button:active {\\n    transform: none;\\n  }\\n}\";\n\nconst WORKSPACES: readonly TidalWorkspaceOption[] = [\n  {\n    id: \"north-star\",\n    name: \"North Star\",\n    role: \"Owner\",\n    status: \"Active\",\n    description: \"Product planning and launch work\",\n    searchTerms: [\"product\", \"launch\"],\n  },\n  {\n    id: \"field-notes\",\n    name: \"Field Notes\",\n    role: \"Editor\",\n    status: \"Active\",\n    description: \"Research briefs and customer notes\",\n    searchTerms: [\"research\", \"customer\"],\n  },\n  {\n    id: \"studio-lab\",\n    name: \"Studio Lab\",\n    role: \"Viewer\",\n    status: \"Review\",\n    description: \"Design experiments awaiting review\",\n    searchTerms: [\"design\", \"review\"],\n  },\n  {\n    id: \"archive-2025\",\n    name: \"2025 Archive\",\n    role: \"Viewer\",\n    status: \"Unavailable\",\n    description: \"Archived sample workspace\",\n    unavailable: true,\n  },\n];\n\nfunction plainPrimary(event: MouseEvent<HTMLAnchorElement>) {\n  return (\n    event.button === 0 &&\n    !event.metaKey &&\n    !event.ctrlKey &&\n    !event.shiftKey &&\n    !event.altKey\n  );\n}\n\nexport function WorkspaceSwitcherDemo() {\n  const uid = useId().replace(/:/g, \"\");\n  const formId = `workspace-demo-form-${uid}`;\n  const createId = `workspace-create-${uid}`;\n  const manageId = `workspace-manage-${uid}`;\n  const [query, setQuery] = useState(\"\");\n  const [open, setOpen] = useState(false);\n  const [highlighted, setHighlighted] = useState<string | undefined>();\n  const [activeId, setActiveId] = useState<string | null>(\"north-star\");\n  const [destination, setDestination] = useState<\"create\" | \"manage\" | null>(\n    null,\n  );\n  const [status, setStatus] = useState(\"North Star is active.\");\n  const active = WORKSPACES.find((workspace) => workspace.id === activeId);\n\n  return (\n    <div className=\"workspace-switcher-demo\">\n      <form\n        id={formId}\n        action={`#workspace-result-${uid}`}\n        onSubmit={(event) => {\n          event.preventDefault();\n          const data = new FormData(event.currentTarget);\n          setStatus(\n            `Prepared ${String(data.get(\"workspace\") ?? \"none\")} locally.`,\n          );\n        }}\n      />\n      <TidalWorkspaceSwitcher\n        label=\"Workspace\"\n        description=\"Search by workspace, role, or status.\"\n        workspaces={WORKSPACES}\n        query={query}\n        open={open}\n        highlightedWorkspaceId={highlighted}\n        activeWorkspaceId={activeId}\n        onQueryChange={(nextQuery) => {\n          setQuery(nextQuery);\n          setHighlighted(undefined);\n        }}\n        onOpenChange={setOpen}\n        onHighlightedWorkspaceChange={setHighlighted}\n        onWorkspaceChange={(workspace) => {\n          setActiveId(workspace.id);\n          setQuery(\"\");\n          setOpen(false);\n          setStatus(`${workspace.name} is active in this preview.`);\n        }}\n        name=\"workspace\"\n        form={formId}\n        createHref={`#${createId}`}\n        createLabel=\"Create workspace\"\n        createLinkProps={{\n          onClick: (event: import(\"react\").MouseEvent<HTMLAnchorElement>) => {\n            if (plainPrimary(event)) {\n              setDestination(\"create\");\n              setStatus(\"Create workspace details opened locally.\");\n            }\n          },\n        }}\n        manageHref={`#${manageId}`}\n        manageLabel=\"Manage workspace\"\n        manageDisabled={!active}\n        manageLinkProps={{\n          onClick: (event: import(\"react\").MouseEvent<HTMLAnchorElement>) => {\n            if (plainPrimary(event)) {\n              setDestination(\"manage\");\n              setStatus(\"Manage workspace details opened locally.\");\n            }\n          },\n        }}\n      />\n\n      <div className=\"workspace-switcher-demo-actions\">\n        <button type=\"submit\" form={formId}>\n          Use workspace\n        </button>\n        <button\n          type=\"button\"\n          onClick={() => {\n            setQuery(\"\");\n            setOpen(false);\n            setHighlighted(undefined);\n            setActiveId(\"north-star\");\n            setDestination(null);\n            setStatus(\"North Star is active.\");\n          }}\n        >\n          Reset\n        </button>\n      </div>\n\n      <section\n        id={createId}\n        className=\"workspace-switcher-demo-destination\"\n        hidden={destination !== \"create\"}\n        aria-labelledby={`${createId}-title`}\n      >\n        <h3 id={`${createId}-title`}>Create workspace</h3>\n        <p>A local sample destination. No workspace was created.</p>\n      </section>\n      <section\n        id={manageId}\n        className=\"workspace-switcher-demo-destination\"\n        hidden={destination !== \"manage\"}\n        aria-labelledby={`${manageId}-title`}\n      >\n        <h3 id={`${manageId}-title`}>Manage {active?.name ?? \"workspace\"}</h3>\n        <p>Role and access changes stay outside this preview.</p>\n      </section>\n      <p id={`workspace-result-${uid}`} role=\"status\" aria-live=\"polite\">\n        {status}\n      </p>\n      <p className=\"workspace-switcher-demo-note\">\n        Sample workspaces. 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      <WorkspaceSwitcherDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/workspace-switcher.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "query",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setQuery",
      "proposalCanBeRejected": false
    },
    {
      "prop": "open",
      "type": "inferred-from-existing-demo",
      "initial": "false",
      "setter": "setOpen",
      "proposalCanBeRejected": false
    },
    {
      "prop": "highlightedWorkspaceId",
      "type": "inferred-from-existing-demo",
      "initial": "undefined",
      "setter": "setHighlighted",
      "proposalCanBeRejected": false
    },
    {
      "prop": "activeWorkspaceId",
      "type": "inferred-from-existing-demo",
      "initial": "\"north-star\"",
      "setter": "setActiveId",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onClick",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onHighlightedWorkspaceChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onOpenChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onQueryChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onSubmit",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onWorkspaceChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [
      "workspace"
    ],
    "expectedFormData": {
      "workspace": "fixture value"
    },
    "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": []
}
