{
  "component": {
    "id": "address-form",
    "name": "Address form",
    "tier": "pro",
    "exampleId": "address-form",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/address-form-demo.tsx",
    "exportName": "AddressFormDemo",
    "sha256": "d099800f0748d0af72d51d535fd8f71b6fda2608ada1108c4e5a4ff51f9b9a6e",
    "helperImports": [],
    "directComponentImports": [
      "address-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/address-form",
    "registryUrl": "https://tidalui.com/r/pro/address-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/address-form",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/address-form",
      "registryUrl": "https://tidalui.com/r/pro/address-form.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/address-form.tsx",
    "exports": [
      "TidalAddressField",
      "TidalAddressForm",
      "TidalAddressOption",
      "TidalAddressValue"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/address-form.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "address-form"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/address-form.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/address-form.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/address-form-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useEffect, useRef, useState, type Dispatch, type SetStateAction } from \"react\";\n\nimport { TidalAddressForm, type TidalAddressField, type TidalAddressOption, type TidalAddressValue } from \"./components/ui/address-form\";\n\nimport \"./components/ui/address-form.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .address-form-demo,\\n.tidal-scope .address-form-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .address-form-demo {\\n  display: grid;\\n  width: min(100%, 1040px);\\n  min-width: 0;\\n  gap: 22px;\\n  margin-inline: auto;\\n  padding: clamp(16px, 4vw, 42px);\\n}\\n\\n@container tidal-preview (max-width: 390px) {\\n  .tidal-scope .address-form-demo {\\n    gap: 16px;\\n    padding: 12px;\\n  }\\n}\";\n\nconst COUNTRIES: readonly TidalAddressOption[] = [\n  { value: \"US\", label: \"United States\" },\n  { value: \"CA\", label: \"Canada\" },\n];\n\nconst REGIONS: Readonly<Record<string, readonly TidalAddressOption[]>> = {\n  US: [\n    { value: \"IL\", label: \"Illinois\" },\n    { value: \"IN\", label: \"Indiana\" },\n    { value: \"MI\", label: \"Michigan\" },\n  ],\n  CA: [\n    { value: \"ON\", label: \"Ontario\" },\n    { value: \"QC\", label: \"Quebec\" },\n    { value: \"BC\", label: \"British Columbia\" },\n  ],\n};\n\nconst INITIAL_SHIPPING: TidalAddressValue = {\n  name: \"Avery Morgan\",\n  company: \"Northstar Studio\",\n  line1: \"1440 Market Street\",\n  line2: \"Suite 210\",\n  city: \"Chicago\",\n  region: \"IL\",\n  postalCode: \"60607\",\n  country: \"US\",\n};\n\nconst INITIAL_BILLING: TidalAddressValue = {\n  name: \"Avery Morgan\",\n  company: \"Northstar Studio\",\n  line1: \"28 Wellington Street\",\n  line2: \"\",\n  city: \"Toronto\",\n  region: \"ON\",\n  postalCode: \"M5E 1C7\",\n  country: \"CA\",\n};\n\nexport function AddressFormDemo() {\n  const [shipping, setShipping] = useState<TidalAddressValue>({\n    ...INITIAL_SHIPPING,\n  });\n  const [billing, setBilling] = useState<TidalAddressValue>({\n    ...INITIAL_BILLING,\n  });\n  const [sameAsShipping, setSameAsShipping] = useState(true);\n  const [busy, setBusy] = useState(false);\n  const [status, setStatus] = useState(\"No unsaved changes.\");\n  const timerRef = useRef<number | null>(null);\n\n  useEffect(\n    () => () => {\n      if (timerRef.current !== null) window.clearTimeout(timerRef.current);\n    },\n    [],\n  );\n\n  function cancelPending() {\n    if (timerRef.current !== null) {\n      window.clearTimeout(timerRef.current);\n      timerRef.current = null;\n    }\n    setBusy(false);\n  }\n\n  function updateAddress(\n    setter: Dispatch<SetStateAction<TidalAddressValue>>,\n    field: TidalAddressField,\n    value: string,\n  ) {\n    cancelPending();\n    setter((current) => ({\n      ...current,\n      [field]: value,\n      ...(field === \"country\" ? { region: \"\" } : null),\n    }));\n    setStatus(\"Unsaved changes.\");\n  }\n\n  return (\n    <section className=\"address-form-demo\" aria-label=\"Address form preview\">\n      <TidalAddressForm\n        title=\"Delivery address\"\n        description=\"Enter shipping and billing details.\"\n        shipping={{\n          value: shipping,\n          onValueChange: (field, value) =>\n            updateAddress(setShipping, field, value),\n          countryOptions: COUNTRIES,\n          regionOptions: REGIONS[shipping.country] ?? [],\n          legend: \"Shipping address\",\n          namePrefix: \"shipping\",\n          fields: {\n            name: {\n              inputProps: { required: true, autoCapitalize: \"words\" },\n            },\n            line1: { inputProps: { required: true } },\n            city: { inputProps: { required: true } },\n            region: { selectProps: { required: true } },\n            postalCode: { inputProps: { required: true } },\n            country: { selectProps: { required: true } },\n          },\n        }}\n        billing={{\n          value: billing,\n          onValueChange: (field, value) =>\n            updateAddress(setBilling, field, value),\n          countryOptions: COUNTRIES,\n          regionOptions: REGIONS[billing.country] ?? [],\n          legend: \"Billing address\",\n          namePrefix: \"billing\",\n          sameAsShipping,\n          sameAsLabel: \"Billing address matches shipping\",\n          onSameAsShippingChange: (checked) => {\n            cancelPending();\n            setSameAsShipping(checked);\n            setStatus(\n              checked\n                ? \"Billing matches the shipping address.\"\n                : \"Enter a separate billing address.\",\n            );\n          },\n          fields: {\n            name: { inputProps: { required: true } },\n            line1: { inputProps: { required: true } },\n            city: { inputProps: { required: true } },\n            region: { selectProps: { required: true } },\n            postalCode: { inputProps: { required: true } },\n            country: { selectProps: { required: true } },\n          },\n        }}\n        busy={busy}\n        onSubmit={(event) => {\n          event.preventDefault();\n          if (busy) return;\n          const submittedFields = Array.from(\n            new FormData(event.currentTarget).keys(),\n          ).length;\n          setBusy(true);\n          setStatus(\"Saving address…\");\n          timerRef.current = window.setTimeout(() => {\n            timerRef.current = null;\n            setBusy(false);\n            setStatus(\n              `Address updated in this preview. ${submittedFields} fields checked.`,\n            );\n          }, 600);\n        }}\n        onResetRequest={() => {\n          cancelPending();\n          setShipping({ ...INITIAL_SHIPPING });\n          setBilling({ ...INITIAL_BILLING });\n          setSameAsShipping(true);\n          setStatus(\"Address reset.\");\n        }}\n        action=\"/local-address-preview\"\n        method=\"post\"\n        status={\n          <span role=\"status\" aria-live=\"polite\">\n            {status}\n          </span>\n        }\n        submitButtonProps={{\n          formAction: \"/local-address-preview\",\n          formMethod: \"post\",\n        }}\n        footer=\"Sample data. Changes stay in this preview.\"\n      />\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      <AddressFormDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/address-form.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "busy",
      "type": "inferred-from-existing-demo",
      "initial": "false",
      "setter": "setBusy",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onResetRequest",
      "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": "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": []
}
