{
  "component": {
    "id": "prompt-library",
    "name": "Prompt library",
    "tier": "pro",
    "exampleId": "prompt-library",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/prompt-library-demo.tsx",
    "exportName": "PromptLibraryDemo",
    "sha256": "3d0dcb1a99c25ea3d4a30648c0614dd53be819f2f8c2363135d5eeb0c35c2029",
    "helperImports": [],
    "directComponentImports": [
      "prompt-library"
    ],
    "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/prompt-library",
    "registryUrl": "https://tidalui.com/r/pro/prompt-library.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/prompt-library",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/prompt-library",
      "registryUrl": "https://tidalui.com/r/pro/prompt-library.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/prompt-library.tsx",
    "exports": [
      "TidalPromptLibrary",
      "TidalPromptRecord"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/prompt-library.css",
      "components/ui/search-field.css",
      "components/ui/textarea.css",
      "components/ui/native-select.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "https://tidalui.com/r/search-field.json",
      "https://tidalui.com/r/textarea.json",
      "@tidal-pro/native-select"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "native-select",
      "prompt-library",
      "search-field",
      "textarea"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/prompt-library.css",
      "components/ui/search-field.css",
      "components/ui/textarea.css",
      "components/ui/native-select.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/prompt-library.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useState } from \"react\";\n\nimport { TidalPromptLibrary, type TidalPromptRecord } from \"./components/ui/prompt-library\";\n\nimport \"./components/ui/prompt-library.css\";\n\nimport \"./components/ui/search-field.css\";\n\nimport \"./components/ui/textarea.css\";\n\nimport \"./components/ui/native-select.css\";\n\n\n\nexport const promptCategories = [\n  { id: \"research\", label: \"Research\" },\n  { id: \"product\", label: \"Product\" },\n  { id: \"writing\", label: \"Writing\" },\n];\n\nexport const promptRecords: readonly TidalPromptRecord[] = [\n  {\n    id: \"interview\",\n    title: \"Customer interview summary\",\n    description: \"Turn interview notes into evidence and next steps.\",\n    categoryId: \"research\",\n    content:\n      \"Summarize these customer notes into pains, requests and next steps. Separate observed evidence from suggestions.\\n\\n{{notes}}\",\n    variables: [\n      {\n        id: \"notes\",\n        label: \"Interview notes\",\n        placeholder: \"Paste the notes to summarize\",\n        required: true,\n      },\n    ],\n  },\n  {\n    id: \"release\",\n    title: \"Release note\",\n    description: \"Explain a product change in plain language.\",\n    categoryId: \"writing\",\n    content:\n      \"Write a concise release note for this change. Explain what changed, who it helps, and how to use it. Avoid unsupported claims.\\n\\n{{change}}\",\n    variables: [{ id: \"change\", label: \"Product change\", required: true }],\n  },\n  {\n    id: \"empty\",\n    title: \"Empty-state copy\",\n    description: \"Write a clear next step for a new workspace.\",\n    categoryId: \"product\",\n    content:\n      \"Write a short heading, one sentence, and a button label for an empty {{screen}} screen. Help the user take the first useful action.\",\n    variables: [{ id: \"screen\", label: \"Screen name\", required: true }],\n  },\n];\n\nexport function PromptLibraryDemo() {\n  const [query, setQuery] = useState(\"\"),\n    [category, setCategory] = useState(\"\"),\n    [favorites, setFavorites] = useState<readonly string[]>([\"interview\"]),\n    [saved, setSaved] = useState(false),\n    [selected, setSelected] = useState<string | null>(\"interview\"),\n    [values, setValues] = useState<Readonly<Record<string, string>>>({\n      notes: \"The team needs a faster way to review open requests.\",\n    }),\n    [status, setStatus] = useState(\"\");\n  return (\n    <div style={{ width: \"100%\", maxWidth: 1120, marginInline: \"auto\" }}>\n      <TidalPromptLibrary\n        title=\"Prompt library\"\n        description=\"Reusable starting points for product work.\"\n        prompts={promptRecords}\n        categories={promptCategories}\n        query={query}\n        onQueryChange={setQuery}\n        categoryId={category}\n        onCategoryChange={setCategory}\n        favorites={favorites}\n        onFavoriteChange={(id, on) =>\n          setFavorites((v) => (on ? [...v, id] : v.filter((x) => x !== id)))\n        }\n        favoritesOnly={saved}\n        onFavoritesOnlyChange={setSaved}\n        selectedId={selected}\n        onSelectedChange={setSelected}\n        values={values}\n        onVariableChange={(id, value) =>\n          setValues((v) => ({ ...v, [id]: value }))\n        }\n        onUse={(p) =>\n          setStatus(p.title + \" selected in this preview. No model was called.\")\n        }\n      />\n      {status && (\n        <p role=\"status\" style={{ fontSize: 12, color: \"var(--t-muted)\" }}>\n          {status}\n        </p>\n      )}\n    </div>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <PromptLibraryDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/prompt-library.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
    }
  ],
  "events": [
    {
      "name": "onCategoryChange",
      "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": "onFavoriteChange",
      "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": "onFavoritesOnlyChange",
      "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": "onQueryChange",
      "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": "onSelectedChange",
      "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": "onUse",
      "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": "onVariableChange",
      "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": []
}
