{
  "component": {
    "id": "contact-form",
    "name": "Contact form",
    "tier": "pro",
    "exampleId": "contact-form",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/contact-form-demo.tsx",
    "exportName": "ContactFormDemo",
    "sha256": "fc07794854c90b7baa0a9174a03b9a6b57a6b83ef77758a9ffff11a309f9db85",
    "helperImports": [],
    "directComponentImports": [
      "contact-form"
    ],
    "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/contact-form",
    "registryUrl": "https://tidalui.com/r/pro/contact-form.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/contact-form",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/contact-form",
      "registryUrl": "https://tidalui.com/r/pro/contact-form.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/contact-form.tsx",
    "exports": [
      "TidalContactForm",
      "TidalContactFormStatus",
      "TidalContactIntentOption"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/contact-form.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "contact-form"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/contact-form.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/contact-form.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/contact-form-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useEffect, useLayoutEffect, useRef, useState, type FormEvent, type InvalidEvent } from \"react\";\n\nimport { RotateCcw } from \"lucide-react\";\n\nimport { TidalContactForm, type TidalContactFormStatus, type TidalContactIntentOption } from \"./components/ui/contact-form\";\n\nimport \"./components/ui/contact-form.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .contact-form-demo {\\n  width: 100%;\\n  max-width: 980px;\\n  min-width: 0;\\n  overflow: hidden;\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-card);\\n  background: var(--t-subtle);\\n  color: var(--t-ink);\\n  box-shadow: 0 25px 54px -38px #0000005c;\\n  container-type: inline-size;\\n}\\n\\n.tidal-scope .contact-form-demo-layout {\\n  display: grid;\\n  grid-template-columns: minmax(0, 1fr);\\n  min-width: 0;\\n}\\n\\n.tidal-scope .contact-form-demo,\\n.tidal-scope .contact-form-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .contact-form-demo-stage {\\n  display: grid;\\n  place-items: center;\\n  min-width: 0;\\n  padding: 28px;\\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}\\n\\n.tidal-scope .contact-form-demo-stage > .tidal-contact-form {\\n  max-width: 700px;\\n}\\n\\n.tidal-scope .contact-form-demo-footer {\\n  display: flex;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 12px;\\n  min-width: 0;\\n}\\n\\n.tidal-scope .contact-form-demo-footer > span {\\n  min-width: 0;\\n}\\n\\n.tidal-scope .contact-form-demo-footer > button {\\n  display: inline-flex;\\n  align-items: center;\\n  justify-content: center;\\n  gap: 7px;\\n  min-width: 44px;\\n  min-height: 44px;\\n  flex: none;\\n  padding: 8px 10px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 9px;\\n  background: var(--t-surface);\\n  color: var(--t-ink);\\n  font: inherit;\\n  font-size: 11px;\\n  cursor: pointer;\\n  transition:\\n    background 160ms,\\n    transform 140ms var(--t-ease-out);\\n}\\n\\n.tidal-scope .contact-form-demo-footer > button:hover {\\n  background: var(--t-wash);\\n}\\n\\n.tidal-scope .contact-form-demo-footer > button:active {\\n  transform: scale(0.98);\\n}\\n\\n.tidal-scope .contact-form-demo-footer > button:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n@container (max-width: 720px) {\\n  .tidal-scope .contact-form-demo-layout {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n}\\n\\n@container (max-width: 430px) {\\n  .tidal-scope .contact-form-demo-stage {\\n    padding: 12px;\\n    background-size: 18px 18px;\\n  }\\n\\n  .tidal-scope .contact-form-demo-footer {\\n    align-items: flex-start;\\n    flex-direction: column;\\n  }\\n\\n  .tidal-scope .contact-form-demo-footer > button {\\n    width: 100%;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  \\n  .tidal-scope .contact-form-demo-stage {\\n    animation: none;\\n    opacity: 1;\\n    transform: none;\\n  }\\n\\n  \\n  .tidal-scope .contact-form-demo-footer > button {\\n    transform: none;\\n    transition: none;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: no-preference) {\\n  @keyframes contact-form-demo-enter {\\n    from {\\n      opacity: 0;\\n      transform: translateY(10px);\\n    }\\n    to {\\n      opacity: 1;\\n      transform: translateY(0);\\n    }\\n  }\\n\\n  \\n  .tidal-scope .contact-form-demo-stage {\\n    animation: contact-form-demo-enter 560ms var(--t-ease-out) both;\\n  }\\n\\n  .tidal-scope .contact-form-demo-stage {\\n    animation-delay: 70ms;\\n  }\\n}\";\n\nconst INTENT_OPTIONS = [\n  {\n    id: \"project\",\n    label: \"A project conversation\",\n    description: \"Explore a focused product need\",\n  },\n  {\n    id: \"sales\",\n    label: \"A product walkthrough\",\n    description: \"See how a team could use it\",\n  },\n  {\n    id: \"partnership\",\n    label: \"A partnership question\",\n    description: \"Discuss a possible collaboration\",\n  },\n] as const satisfies readonly TidalContactIntentOption[];\n\ntype ContactFocusTarget = \"name\" | \"email\" | \"message\";\n\nexport function ContactFormDemo() {\n  const [name, setName] = useState(\"\");\n  const [email, setEmail] = useState(\"\");\n  const [company, setCompany] = useState(\"\");\n  const [message, setMessage] = useState(\"\");\n  const [intent, setIntent] = useState<string>(INTENT_OPTIONS[0].id);\n  const [status, setStatus] = useState<TidalContactFormStatus>(\"idle\");\n  const [statusMessage, setStatusMessage] = useState(\"\");\n  const [nameError, setNameError] = useState(\"\");\n  const [emailError, setEmailError] = useState(\"\");\n  const [messageError, setMessageError] = useState(\"\");\n  const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n  const nameInput = useRef<HTMLInputElement>(null);\n  const emailInput = useRef<HTMLInputElement>(null);\n  const messageInput = useRef<HTMLTextAreaElement>(null);\n  const statusElement = useRef<HTMLDivElement>(null);\n  const focusNameOnIdle = useRef(false);\n  const focusErrorOnRender = useRef(false);\n  const focusTarget = useRef<ContactFocusTarget>(\"name\");\n\n  useEffect(() => () => clearTimeout(timer.current), []);\n\n  useLayoutEffect(() => {\n    if (status === \"success\" && document.activeElement === document.body) {\n      statusElement.current\n        ?.querySelector<HTMLButtonElement>(\"button\")\n        ?.focus({ preventScroll: true });\n    }\n    if (status === \"error\" && focusErrorOnRender.current) {\n      focusErrorOnRender.current = false;\n      const target = focusTarget.current;\n      const refs = {\n        name: nameInput,\n        email: emailInput,\n        message: messageInput,\n      };\n      refs[target].current?.focus({ preventScroll: true });\n      return;\n    }\n\n    if (status === \"idle\" && focusNameOnIdle.current) {\n      focusNameOnIdle.current = false;\n      const target = focusTarget.current;\n      focusTarget.current = \"name\";\n      const refs = {\n        name: nameInput,\n        email: emailInput,\n        message: messageInput,\n      };\n      refs[target].current?.focus({ preventScroll: true });\n    }\n  }, [messageError, nameError, emailError, status]);\n\n  function clearStatus() {\n    clearTimeout(timer.current);\n    if (status !== \"idle\") {\n      setStatus(\"idle\");\n      setStatusMessage(\"\");\n    }\n  }\n\n  function handleInvalid(\n    event: InvalidEvent<HTMLInputElement | HTMLTextAreaElement>,\n  ) {\n    const field = event.currentTarget;\n    const target: ContactFocusTarget | undefined =\n      field.name === \"name\" ||\n      field.name === \"email\" ||\n      field.name === \"message\"\n        ? field.name\n        : undefined;\n    if (target && !focusErrorOnRender.current) {\n      focusTarget.current = target;\n    }\n    focusErrorOnRender.current = true;\n    setStatus(\"error\");\n    setStatusMessage(\"Review the highlighted sample fields before continuing.\");\n    if (field.name === \"name\") {\n      setNameError(\n        field.validity.valueMissing\n          ? \"Add a name for this sample.\"\n          : \"Use a readable name.\",\n      );\n    } else if (field.name === \"email\") {\n      setEmailError(\n        field.validity.valueMissing\n          ? \"Add a work email for this sample.\"\n          : \"Use a complete work email address.\",\n      );\n    } else if (field.name === \"message\") {\n      setMessageError(\"Add a short note for this sample.\");\n    }\n  }\n\n  function handleSubmit(event: FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    clearTimeout(timer.current);\n    setNameError(\"\");\n    setEmailError(\"\");\n    setMessageError(\"\");\n    focusErrorOnRender.current = false;\n    focusTarget.current = \"name\";\n    setStatus(\"pending\");\n    setStatusMessage(\"Preparing this sample locally. Nothing is being sent.\");\n    timer.current = setTimeout(() => {\n      setStatus(\"success\");\n      setStatusMessage(\n        \"Sample prepared locally. Nothing was sent, delivered, or saved.\",\n      );\n    }, 680);\n  }\n\n  function editSample() {\n    clearTimeout(timer.current);\n    if (status !== \"error\") focusTarget.current = \"name\";\n    focusNameOnIdle.current = true;\n    setStatus(\"idle\");\n    setStatusMessage(\"\");\n  }\n\n  function clearSample() {\n    clearTimeout(timer.current);\n    setName(\"\");\n    setEmail(\"\");\n    setCompany(\"\");\n    setMessage(\"\");\n    setIntent(INTENT_OPTIONS[0].id);\n    setNameError(\"\");\n    setEmailError(\"\");\n    setMessageError(\"\");\n    focusErrorOnRender.current = false;\n    focusTarget.current = \"name\";\n    focusNameOnIdle.current = true;\n    setStatus(\"idle\");\n    setStatusMessage(\"\");\n  }\n\n  return (\n    <section className=\"contact-form-demo\" data-status={status}>\n      <div className=\"contact-form-demo-layout\">\n        <div className=\"contact-form-demo-stage\">\n          <TidalContactForm\n            title=\"Contact the team\"\n            description=\"Use sample values to preview the form.\"\n            headingLevel=\"h3\"\n            nameRef={nameInput}\n            emailRef={emailInput}\n            messageRef={messageInput}\n            statusRef={statusElement}\n            status={status}\n            statusMessage={statusMessage}\n            statusActionLabel={\n              status === \"error\"\n                ? \"Review fields\"\n                : status === \"success\"\n                  ? \"Edit sample\"\n                  : undefined\n            }\n            onStatusAction={editSample}\n            pendingLabel=\"Preparing sample\"\n            submitLabel=\"Prepare sample\"\n            onSubmit={handleSubmit}\n            intentOptions={INTENT_OPTIONS}\n            intent={intent}\n            onIntentChange={(option) => setIntent(option.id)}\n            intentSelectProps={{\n              onChange: () => clearStatus(),\n            }}\n            nameError={nameError}\n            emailError={emailError}\n            messageError={messageError}\n            nameInputProps={{\n              value: name,\n              placeholder: \"Your name\",\n              onChange: (event: import(\"react\").ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n                setName(event.target.value);\n                setNameError(\"\");\n                clearStatus();\n              },\n              onInvalid: handleInvalid,\n            }}\n            emailInputProps={{\n              value: email,\n              placeholder: \"name@company.com\",\n              inputMode: \"email\",\n              onChange: (event: import(\"react\").ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n                setEmail(event.target.value);\n                setEmailError(\"\");\n                clearStatus();\n              },\n              onInvalid: handleInvalid,\n            }}\n            companyInputProps={{\n              value: company,\n              placeholder: \"Company or team\",\n              onChange: (event: import(\"react\").ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n                setCompany(event.target.value);\n                clearStatus();\n              },\n            }}\n            messageInputProps={{\n              value: message,\n              placeholder: \"A few useful details, goals, or questions\",\n              rows: 5,\n              onChange: (event: import(\"react\").ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n                setMessage(event.target.value);\n                setMessageError(\"\");\n                clearStatus();\n              },\n              onInvalid: handleInvalid,\n            }}\n            footer={\n              <div className=\"contact-form-demo-footer\">\n                <span>Local preview. Sample values only.</span>\n                <button type=\"button\" onClick={clearSample}>\n                  <RotateCcw size={14} aria-hidden=\"true\" />\n                  Clear sample\n                </button>\n              </div>\n            }\n          />\n        </div>\n      </div>\n    </section>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <ContactFormDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/contact-form.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "status",
      "type": "inferred-from-existing-demo",
      "initial": "\"idle\"",
      "setter": "setStatus",
      "proposalCanBeRejected": false
    },
    {
      "prop": "statusMessage",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setStatusMessage",
      "proposalCanBeRejected": false
    },
    {
      "prop": "intent",
      "type": "inferred-from-existing-demo",
      "initial": "INTENT_OPTIONS[0].id",
      "setter": "setIntent",
      "proposalCanBeRejected": false
    },
    {
      "prop": "nameError",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setNameError",
      "proposalCanBeRejected": false
    },
    {
      "prop": "emailError",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setEmailError",
      "proposalCanBeRejected": false
    },
    {
      "prop": "messageError",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setMessageError",
      "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": "onIntentChange",
      "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": "onStatusAction",
      "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": "onSubmit",
      "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."
    }
  ],
  "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": "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": []
}
