{
  "component": {
    "id": "team-invitations",
    "name": "Team invitations",
    "tier": "pro",
    "exampleId": "team-invitations",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/team-invitations-demo.tsx",
    "exportName": "TeamInvitationsDemo",
    "sha256": "5016b552aadf1eb2701438258f51ff304b78283de67f5b5355314e1401aa4475",
    "helperImports": [],
    "directComponentImports": [
      "alert-dialog",
      "team-invitations"
    ],
    "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/team-invitations",
    "registryUrl": "https://tidalui.com/r/pro/team-invitations.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/team-invitations",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/team-invitations",
      "registryUrl": "https://tidalui.com/r/pro/team-invitations.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    },
    {
      "order": 2,
      "kind": "demo-only-additional",
      "dependency": "@tidal-pro/alert-dialog",
      "purpose": "complete-example-demo-dependency",
      "command": "npx shadcn@latest add @tidal-pro/alert-dialog",
      "registryUrl": "https://tidalui.com/r/pro/alert-dialog.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/team-invitations.tsx",
    "exports": [
      "TidalAlertDialog",
      "TidalInvitationRecord",
      "TidalTeamInvitations"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/team-invitations.css",
      "components/ui/alert-dialog.css",
      "components/ui/input-group.css",
      "components/ui/native-select.css",
      "components/ui/status-badge.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "https://tidalui.com/r/tidal-button.json",
      "@tidal-pro/input-group",
      "@tidal-pro/native-select",
      "https://tidalui.com/r/status-badge.json"
    ],
    "additionalRegistry": [
      "@tidal-pro/alert-dialog"
    ],
    "installClosure": [
      "alert-dialog",
      "input-group",
      "native-select",
      "status-badge",
      "team-invitations",
      "tidal-button"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/team-invitations.css",
      "components/ui/alert-dialog.css",
      "components/ui/input-group.css",
      "components/ui/native-select.css",
      "components/ui/status-badge.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/team-invitations.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/team-invitations-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useRef, useState } from \"react\";\n\nimport { TidalAlertDialog } from \"./components/ui/alert-dialog\";\n\nimport { TidalTeamInvitations, type TidalInvitationRecord } from \"./components/ui/team-invitations\";\n\nimport \"./components/ui/team-invitations.css\";\n\nimport \"./components/ui/alert-dialog.css\";\n\nimport \"./components/ui/input-group.css\";\n\nimport \"./components/ui/native-select.css\";\n\nimport \"./components/ui/status-badge.css\";\n\n\n\nconst tidalExampleStyles = \".team-invitations-demo {\\n  display: grid;\\n  width: min(100%, 860px);\\n  min-width: 0;\\n  gap: 14px;\\n}\\n\\n.team-invitations-demo-footer {\\n  display: flex;\\n  min-width: 0;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 14px;\\n}\\n\\n.team-invitations-demo-footer output {\\n  min-width: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.55;\\n  overflow-wrap: anywhere;\\n}\\n\\n.team-invitations-demo-footer button {\\n  min-width: 44px;\\n  min-height: 44px;\\n  flex: none;\\n  padding: 9px 13px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n  background: var(--t-surface);\\n  color: var(--t-ink);\\n  font: inherit;\\n  font-size: 11px;\\n  font-weight: 650;\\n  cursor: pointer;\\n}\\n\\n.team-invitations-demo-footer button:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n@media (max-width: 480px) {\\n  .team-invitations-demo-footer {\\n    display: grid;\\n  }\\n\\n  .team-invitations-demo-footer button {\\n    width: 100%;\\n    font-size: 16px;\\n  }\\n}\";\n\nconst INITIAL_INVITATIONS: readonly TidalInvitationRecord[] = [\n  {\n    id: \"ava\",\n    email: \"ava@example.com\",\n    role: \"Member\",\n    status: \"pending\",\n    sentAt: \"Today, 9:20 AM\",\n    dateTime: \"2026-10-15T09:20:00-05:00\",\n  },\n  {\n    id: \"noah\",\n    email: \"noah@example.com\",\n    role: \"Reviewer\",\n    status: \"accepted\",\n    sentAt: \"October 12\",\n    dateTime: \"2026-10-12\",\n  },\n  {\n    id: \"mila\",\n    email: \"mila@example.com\",\n    role: \"Member\",\n    status: \"expired\",\n    sentAt: \"September 30\",\n    dateTime: \"2026-09-30\",\n  },\n];\n\nconst ROLES = [\n  { value: \"member\", label: \"Member\" },\n  { value: \"reviewer\", label: \"Reviewer\" },\n  { value: \"admin\", label: \"Admin\" },\n] as const;\n\nexport function TeamInvitationsDemo({\n  theme = \"light\",\n  dir = \"ltr\",\n}: {\n  theme?: \"light\" | \"dark\";\n  dir?: \"ltr\" | \"rtl\";\n}) {\n  const generatedId = useId().replace(/:/g, \"\");\n  const statusId = `${generatedId}-invitation-status`;\n  const rootRef = useRef<HTMLElement>(null);\n  const openerRef = useRef<HTMLButtonElement | null>(null);\n  const nextInvitationId = useRef(0);\n  const [invitations, setInvitations] =\n    useState<readonly TidalInvitationRecord[]>(INITIAL_INVITATIONS);\n  const [email, setEmail] = useState(\"rhea@example.com\");\n  const [role, setRole] = useState(\"member\");\n  const [revokeId, setRevokeId] = useState<string | null>(null);\n  const [status, setStatus] = useState(\n    \"Fictional local invitations. No email or account request is active.\",\n  );\n  const requested = invitations.find((item) => item.id === revokeId);\n\n  return (\n    <div className=\"team-invitations-demo\" dir={dir}>\n      <TidalTeamInvitations\n        ref={rootRef}\n        aria-describedby={statusId}\n        title=\"Team invitations\"\n        description=\"Invite a sample teammate and review the invitation history.\"\n        invitations={invitations}\n        roles={ROLES}\n        emailValue={email}\n        roleValue={role}\n        onEmailChange={setEmail}\n        onRoleChange={setRole}\n        onInviteRequest={(nextEmail, nextRole) => {\n          const roleLabel =\n            ROLES.find((option) => option.value === nextRole)?.label ??\n            nextRole;\n          setInvitations((current) => [\n            {\n              id: `local-${generatedId}-${++nextInvitationId.current}`,\n              email: nextEmail,\n              role: roleLabel,\n              status: \"pending\",\n              sentAt: \"Just now\",\n              dateTime: \"2026-10-15T12:00:00-05:00\",\n            },\n            ...current,\n          ]);\n          setEmail(\"\");\n          setStatus(\n            `${nextEmail} was added to this local sample. No email was sent.`,\n          );\n        }}\n        onResendRequest={(invitation) => {\n          setInvitations((current) =>\n            current.map((item) =>\n              item.id === invitation.id\n                ? {\n                    ...item,\n                    status: \"pending\",\n                    sentAt: \"Just now\",\n                    dateTime: \"2026-10-15T12:00:00-05:00\",\n                  }\n                : item,\n            ),\n          );\n          setStatus(\n            `${invitation.email} was refreshed locally. No email was sent.`,\n          );\n        }}\n        onRevokeRequest={(invitation, event) => {\n          openerRef.current = event.currentTarget;\n          setRevokeId(invitation.id);\n        }}\n      />\n      <TidalAlertDialog\n        open={requested !== undefined}\n        onOpenChange={(open) => {\n          if (!open) setRevokeId(null);\n        }}\n        trigger={\n          <button type=\"button\" hidden tabIndex={-1}>\n            Confirm sample revocation\n          </button>\n        }\n        title={`Revoke ${requested?.email ?? \"sample invitation\"}?`}\n        description=\"This removes only the local sample row. It does not revoke account access or contact an email service.\"\n        cancelLabel=\"Cancel\"\n        confirmLabel=\"Remove sample invitation\"\n        tone=\"danger\"\n        theme={theme}\n        dir={dir}\n        onCancel={() => setRevokeId(null)}\n        onConfirm={() => {\n          if (!requested) return;\n          setInvitations((current) =>\n            current.filter((item) => item.id !== requested.id),\n          );\n          setStatus(`${requested.email} was removed from this local sample.`);\n          setRevokeId(null);\n        }}\n        contentProps={{\n          onCloseAutoFocus: (event) => {\n            event.preventDefault();\n            const opener = openerRef.current;\n            const fallback = rootRef.current?.querySelector<HTMLButtonElement>(\n              \"[data-invitation-action]:not(:disabled):not([aria-disabled='true'])\",\n            );\n            const target =\n              opener?.isConnected === true &&\n              !opener.disabled &&\n              opener.getAttribute(\"aria-disabled\") !== \"true\"\n                ? opener\n                : (fallback ?? rootRef.current);\n            openerRef.current = null;\n            target?.focus({ preventScroll: true });\n          },\n        }}\n      />\n      <div className=\"team-invitations-demo-footer\">\n        <output id={statusId} aria-live=\"polite\">\n          {status}\n        </output>\n        <button\n          type=\"button\"\n          onClick={() => {\n            setInvitations(INITIAL_INVITATIONS);\n            setEmail(\"rhea@example.com\");\n            setRole(\"member\");\n            setRevokeId(null);\n            openerRef.current = null;\n            setStatus(\"The fictional invitation sample was reset.\");\n          }}\n        >\n          Reset sample\n        </button>\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      <TeamInvitationsDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/team-invitations.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "invitations",
      "type": "inferred-from-existing-demo",
      "initial": "INITIAL_INVITATIONS",
      "setter": "setInvitations",
      "proposalCanBeRejected": false
    },
    {
      "prop": "emailValue",
      "type": "inferred-from-existing-demo",
      "initial": "\"rhea@example.com\"",
      "setter": "setEmail",
      "proposalCanBeRejected": false
    },
    {
      "prop": "roleValue",
      "type": "inferred-from-existing-demo",
      "initial": "\"member\"",
      "setter": "setRole",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onCancel",
      "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": "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": "onConfirm",
      "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": "onEmailChange",
      "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": "onInviteRequest",
      "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": "onOpenChange",
      "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": "onResendRequest",
      "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": "onRevokeRequest",
      "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": "onRoleChange",
      "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": "Verify focus returns to the invoking control after dismissal.",
    "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": []
}
