{
  "component": {
    "id": "integration-cards",
    "name": "Integration cards",
    "tier": "pro",
    "exampleId": "integration-cards",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/integration-cards-demo.tsx",
    "exportName": "IntegrationCardsDemo",
    "sha256": "61d5cf0470239ecd74501db0ebc6ea14961a3308ac3940437d8b7b54798ab5ea",
    "helperImports": [],
    "directComponentImports": [
      "integration-cards"
    ],
    "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/integration-cards",
    "registryUrl": "https://tidalui.com/r/pro/integration-cards.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/integration-cards",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/integration-cards",
      "registryUrl": "https://tidalui.com/r/pro/integration-cards.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/integration-cards.tsx",
    "exports": [
      "TidalIntegrationCards",
      "TidalIntegrationItem",
      "TidalIntegrationState"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/integration-cards.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "integration-cards"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/integration-cards.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/integration-cards.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/integration-cards-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { CalendarDays, Check, ChevronRight, FileText, MessageSquareText, RefreshCw, Unplug, Workflow } from \"lucide-react\";\n\nimport { useEffect, useId, useMemo, useRef, useState } from \"react\";\n\nimport { TidalIntegrationCards, type TidalIntegrationItem, type TidalIntegrationState } from \"./components/ui/integration-cards\";\n\nimport \"./components/ui/integration-cards.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .integration-cards-demo,\\n.tidal-scope .integration-cards-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .integration-cards-demo {\\n  display: grid;\\n  width: 100%;\\n  min-width: 0;\\n  grid-template-columns: minmax(0, 1fr);\\n  gap: 16px;\\n  padding: 16px;\\n  color: var(--t-ink);\\n  background: var(--t-subtle);\\n  border: 1px solid var(--t-border);\\n  border-radius: 22px;\\n  container: integration-demo / inline-size;\\n}\\n\\n.tidal-scope .integration-cards-demo-main {\\n  min-width: 0;\\n  padding: 16px;\\n  background: var(--t-surface);\\n  border: 1px solid var(--t-border);\\n  border-radius: 16px;\\n}\\n\\n.tidal-scope .integration-cards-demo .tidal-integration-footer > button {\\n  display: inline-flex;\\n  min-width: 44px;\\n  min-height: 44px;\\n  align-items: center;\\n  justify-content: center;\\n  gap: 8px;\\n  padding: 8px 12px;\\n  color: var(--t-ink);\\n  background: var(--t-surface);\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n  font: inherit;\\n  font-size: 11px;\\n  font-weight: 650;\\n  cursor: pointer;\\n}\\n\\n.tidal-scope .integration-cards-demo .tidal-integration-footer > button svg {\\n  width: 15px;\\n  height: 15px;\\n}\\n\\n.tidal-scope .integration-cards-demo .tidal-integration-footer > button:hover {\\n  border-color: var(--t-ink);\\n}\\n\\n.tidal-scope\\n  .integration-cards-demo\\n  .tidal-integration-footer\\n  > button:focus-visible,\\n.tidal-scope .integration-cards-demo-details h3:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .integration-cards-demo-details {\\n  display: grid;\\n  min-width: 0;\\n  grid-template-columns: minmax(150px, 0.7fr) minmax(180px, 1fr) minmax(\\n      220px,\\n      1fr\\n    );\\n  align-items: center;\\n  gap: 16px;\\n  margin-top: 14px;\\n  padding: 16px;\\n  color: var(--t-surface);\\n  background: var(--t-ink);\\n  border-radius: 14px;\\n}\\n\\n.tidal-scope .integration-cards-demo-details span,\\n.tidal-scope .integration-cards-demo-details dt {\\n  color: #bdbdbd;\\n  font-size: 11px;\\n  font-weight: 680;\\n  letter-spacing: 0.09em;\\n  line-height: 1.4;\\n  text-transform: uppercase;\\n}\\n\\n.tidal-scope .integration-cards-demo-details h3 {\\n  margin: 5px 0 0;\\n  color: inherit;\\n  font-size: 16px;\\n  line-height: 1.2;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .integration-cards-demo-details p {\\n  margin: 0;\\n  color: #d0d0d0;\\n  font-size: 11px;\\n  line-height: 1.55;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .integration-cards-demo-details dl {\\n  display: grid;\\n  grid-template-columns: repeat(2, minmax(0, 1fr));\\n  gap: 12px;\\n  margin: 0;\\n}\\n\\n.tidal-scope .integration-cards-demo-details dl > div,\\n.tidal-scope .integration-cards-demo-details dd {\\n  min-width: 0;\\n}\\n\\n.tidal-scope .integration-cards-demo-details dd {\\n  margin: 4px 0 0;\\n  color: var(--t-surface);\\n  font-size: 11px;\\n  font-weight: 620;\\n  line-height: 1.4;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .integration-cards-demo-status {\\n  min-height: 18px;\\n  margin: 10px 4px 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n  overflow-wrap: anywhere;\\n}\\n\\n@container integration-demo (max-width: 760px) {\\n  .tidal-scope .integration-cards-demo {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n}\\n\\n@container integration-demo (max-width: 560px) {\\n  .tidal-scope .integration-cards-demo {\\n    padding: 8px;\\n    border-radius: 16px;\\n  }\\n\\n  .tidal-scope .integration-cards-demo-main {\\n    padding: 12px;\\n    border-radius: 13px;\\n  }\\n\\n  .tidal-scope .integration-cards-demo-details {\\n    grid-template-columns: minmax(0, 1fr);\\n    gap: 10px;\\n    padding: 14px;\\n  }\\n\\n  .tidal-scope .integration-cards-demo-details dl {\\n    padding-top: 10px;\\n    border-top: 1px solid #ffffff2e;\\n  }\\n\\n  .tidal-scope .integration-cards-demo .tidal-integration-footer {\\n    align-items: flex-start;\\n    flex-direction: column;\\n  }\\n}\\n\\n@container integration-demo (max-width: 390px) {\\n  .tidal-scope .integration-cards-demo-main {\\n    padding: 9px;\\n  }\\n}\\n\\n@media (pointer: coarse) {\\n  .tidal-scope .integration-cards-demo :is(input, select, textarea) {\\n    font-size: 16px;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: no-preference) {\\n  .tidal-scope .integration-cards-demo-details {\\n    animation: integration-details-in 300ms var(--t-ease-out) both;\\n  }\\n}\\n\\n@keyframes integration-details-in {\\n  from {\\n    opacity: 0;\\n    transform: translateY(6px);\\n  }\\n  to {\\n    opacity: 1;\\n    transform: none;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .integration-cards-demo-details {\\n    animation: none;\\n  }\\n\\n  .tidal-scope .integration-cards-demo .tidal-integration-footer > button {\\n    transition: none;\\n  }\\n}\";\n\ntype IntegrationId = \"schedule\" | \"files\" | \"notes\" | \"relay\";\n\ntype FilterId = \"all\" | TidalIntegrationState;\n\ninterface SampleIntegration {\n  id: IntegrationId;\n  name: string;\n  description: string;\n  state: TidalIntegrationState;\n}\n\nconst initialIntegrations: readonly SampleIntegration[] = [\n  {\n    id: \"schedule\",\n    name: \"Schedule bridge\",\n    description:\n      \"Preview how sample project dates could be grouped in one place.\",\n    state: \"connected\",\n  },\n  {\n    id: \"files\",\n    name: \"File handoff\",\n    description: \"Stage sample project documents for a local review flow.\",\n    state: \"available\",\n  },\n  {\n    id: \"notes\",\n    name: \"Team notes\",\n    description: \"Review a sample channel that needs a delivery choice.\",\n    state: \"attention\",\n  },\n  {\n    id: \"relay\",\n    name: \"Relay rules\",\n    description: \"Preview a local rule after a sample task is completed.\",\n    state: \"available\",\n  },\n] as const;\n\nconst iconById = {\n  schedule: <CalendarDays />,\n  files: <FileText />,\n  notes: <MessageSquareText />,\n  relay: <Workflow />,\n} satisfies Record<IntegrationId, React.ReactNode>;\n\nconst settingsById = {\n  schedule: [\n    { id: \"range\", label: \"Range\", value: \"Next 14 sample days\" },\n    { id: \"direction\", label: \"Direction\", value: \"Two-way preview\" },\n  ],\n  files: [\n    { id: \"folder\", label: \"Folder\", value: \"Sample project files\" },\n    { id: \"access\", label: \"Access\", value: \"Preview only\" },\n  ],\n  notes: [\n    { id: \"channel\", label: \"Channel\", value: \"Review notes\" },\n    { id: \"delivery\", label: \"Delivery\", value: \"Choose manually\" },\n  ],\n  relay: [\n    { id: \"trigger\", label: \"Trigger\", value: \"Task completed\" },\n    { id: \"result\", label: \"Result\", value: \"Local status only\" },\n  ],\n} satisfies Record<\n  IntegrationId,\n  readonly { id: string; label: string; value: string }[]\n>;\n\nconst detailById = {\n  schedule: \"Shows a 14-day sample range and a two-way preview setting.\",\n  files: \"Keeps fictional project documents inside this browser preview.\",\n  notes: \"Waits for a sample delivery choice before its state is cleared.\",\n  relay: \"Changes only the local card state after a sample task event.\",\n} satisfies Record<IntegrationId, string>;\n\nfunction stateLabel(state: TidalIntegrationState) {\n  if (state === \"connected\") return \"Connected in sample\";\n  if (state === \"attention\") return \"Review sample\";\n  return \"Available\";\n}\n\nexport function IntegrationCardsDemo() {\n  const generatedId = useId().replace(/:/g, \"\");\n  const detailsId = `integration-sample-details-${generatedId}`;\n  const [integrations, setIntegrations] =\n    useState<readonly SampleIntegration[]>(initialIntegrations);\n  const [filter, setFilter] = useState<FilterId>(\"all\");\n  const [selectedDetails, setSelectedDetails] =\n    useState<IntegrationId>(\"schedule\");\n  const [message, setMessage] = useState(\n    \"This preview is local. No service or account was contacted.\",\n  );\n  const detailsHeadingRef = useRef<HTMLHeadingElement>(null);\n  const focusFrameRef = useRef<number | null>(null);\n\n  useEffect(\n    () => () => {\n      if (focusFrameRef.current !== null) {\n        cancelAnimationFrame(focusFrameRef.current);\n      }\n    },\n    [],\n  );\n\n  const counts = useMemo(\n    () => ({\n      all: integrations.length,\n      connected: integrations.filter((item) => item.state === \"connected\")\n        .length,\n      available: integrations.filter((item) => item.state === \"available\")\n        .length,\n      attention: integrations.filter((item) => item.state === \"attention\")\n        .length,\n    }),\n    [integrations],\n  );\n\n  const visibleIntegrations = useMemo(\n    () =>\n      filter === \"all\"\n        ? integrations\n        : integrations.filter((item) => item.state === filter),\n    [filter, integrations],\n  );\n\n  function updateState(id: IntegrationId, nextState: TidalIntegrationState) {\n    const item = integrations.find((entry) => entry.id === id);\n    if (!item) return;\n    setIntegrations((current) =>\n      current.map((entry) =>\n        entry.id === id ? { ...entry, state: nextState } : entry,\n      ),\n    );\n    if (filter !== \"all\" && filter !== nextState) setFilter(\"all\");\n    setMessage(\n      `${item.name} is now ${stateLabel(nextState).toLowerCase()}. This changed sample state only.`,\n    );\n  }\n\n  function showDetails(id: IntegrationId) {\n    setSelectedDetails(id);\n    setMessage(\n      `Showing local details for ${integrations.find((item) => item.id === id)?.name ?? \"the sample\"}.`,\n    );\n    if (focusFrameRef.current !== null) {\n      cancelAnimationFrame(focusFrameRef.current);\n    }\n    focusFrameRef.current = requestAnimationFrame(() => {\n      focusFrameRef.current = null;\n      detailsHeadingRef.current?.focus({ preventScroll: true });\n    });\n  }\n\n  const cards = useMemo<readonly TidalIntegrationItem[]>(\n    () =>\n      visibleIntegrations.map((integration) => {\n        const isConnected = integration.state === \"connected\";\n        const needsReview = integration.state === \"attention\";\n        return {\n          id: integration.id,\n          name: integration.name,\n          description: integration.description,\n          icon: iconById[integration.id],\n          status: {\n            state: integration.state,\n            label: stateLabel(integration.state),\n          },\n          settings: settingsById[integration.id],\n          action: {\n            kind: \"button\",\n            label: isConnected\n              ? \"Disconnect sample\"\n              : needsReview\n                ? \"Mark sample reviewed\"\n                : \"Connect sample\",\n            icon: isConnected ? <Unplug /> : <Check />,\n            onAction: () =>\n              updateState(\n                integration.id,\n                isConnected ? \"available\" : \"connected\",\n              ),\n          },\n          secondaryAction: {\n            kind: \"button\",\n            label: \"View details\",\n            icon: <ChevronRight />,\n            buttonProps: { \"aria-controls\": detailsId },\n            onAction: () => showDetails(integration.id),\n          },\n          footer: \"Local preview data\",\n        };\n      }),\n    [detailsId, visibleIntegrations],\n  );\n\n  const filters = ([\"all\", \"connected\", \"available\", \"attention\"] as const).map(\n    (id) => ({\n      id,\n      label:\n        id === \"all\"\n          ? \"All\"\n          : id === \"connected\"\n            ? \"Connected\"\n            : id === \"available\"\n              ? \"Available\"\n              : \"Review\",\n      count: counts[id],\n    }),\n  );\n\n  const selected = integrations.find((item) => item.id === selectedDetails)!;\n\n  function selectFilter(nextFilter: string) {\n    const next = nextFilter as FilterId;\n    const nextVisible =\n      next === \"all\"\n        ? integrations\n        : integrations.filter((item) => item.state === next);\n    setFilter(next);\n    if (\n      nextVisible.length > 0 &&\n      !nextVisible.some((item) => item.id === selectedDetails)\n    ) {\n      setSelectedDetails(nextVisible[0].id);\n    }\n    setMessage(\n      next === \"all\"\n        ? \"Showing all four local samples.\"\n        : nextVisible.length\n          ? `Showing ${nextVisible.length} ${next} local ${nextVisible.length === 1 ? \"sample\" : \"samples\"}.`\n          : `No local samples are ${next}.`,\n    );\n  }\n\n  function resetSample() {\n    if (focusFrameRef.current !== null) {\n      cancelAnimationFrame(focusFrameRef.current);\n      focusFrameRef.current = null;\n    }\n    setIntegrations(initialIntegrations);\n    setFilter(\"all\");\n    setSelectedDetails(\"schedule\");\n    setMessage(\"Sample reset. No service or account was contacted.\");\n  }\n\n  return (\n    <div className=\"integration-cards-demo\">\n      <div className=\"integration-cards-demo-main\">\n        <TidalIntegrationCards\n          title=\"Integrations\"\n          eyebrow={null}\n          description=\"Explore the sample connections and their settings.\"\n          items={cards}\n          filters={filters}\n          filterLabel=\"Filter sample integrations\"\n          activeFilter={filter}\n          onFilterChange={selectFilter}\n          emptyMessage=\"No sample integrations match this filter.\"\n          footer={\n            <>\n              <span>Fictional sample data</span>\n              <button type=\"button\" onClick={resetSample}>\n                <RefreshCw aria-hidden=\"true\" />\n                Reset sample\n              </button>\n            </>\n          }\n        />\n\n        <section\n          id={detailsId}\n          className=\"integration-cards-demo-details\"\n          aria-labelledby={`${detailsId}-title`}\n        >\n          <div>\n            <span>Selected preview</span>\n            <h3 id={`${detailsId}-title`} ref={detailsHeadingRef} tabIndex={-1}>\n              {selected.name}\n            </h3>\n          </div>\n          <p>{detailById[selected.id]}</p>\n          <dl>\n            {settingsById[selected.id].map((setting) => (\n              <div key={setting.id}>\n                <dt>{setting.label}</dt>\n                <dd>{setting.value}</dd>\n              </div>\n            ))}\n          </dl>\n        </section>\n\n        <p\n          className=\"integration-cards-demo-status\"\n          role=\"status\"\n          aria-live=\"polite\"\n        >\n          {message}\n        </p>\n      </div>\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      <IntegrationCardsDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/integration-cards.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "activeFilter",
      "type": "inferred-from-existing-demo",
      "initial": "\"all\"",
      "setter": "setFilter",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onClick",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onFilterChange",
      "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": "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": "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": []
}
