{
  "component": {
    "id": "phone-input",
    "name": "Phone input",
    "tier": "pro",
    "exampleId": "phone-input",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/phone-input-demo.tsx",
    "exportName": "PhoneInputDemo",
    "sha256": "775f6fac831cd708564efba39802abafb22e735c22d67cb23c49fa452ed52115",
    "helperImports": [],
    "directComponentImports": [
      "phone-input"
    ],
    "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/phone-input",
    "registryUrl": "https://tidalui.com/r/pro/phone-input.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/phone-input",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/phone-input",
      "registryUrl": "https://tidalui.com/r/pro/phone-input.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/phone-input.tsx",
    "exports": [
      "TidalPhoneInput",
      "TidalPhonePasteRequest",
      "TidalPhoneValue"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/phone-input.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "phone-input"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/phone-input.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/phone-input.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/phone-input-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useState, type ReactNode } from \"react\";\n\nimport { TidalPhoneInput, type TidalPhonePasteRequest, type TidalPhoneValue } from \"./components/ui/phone-input\";\n\nimport \"./components/ui/phone-input.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .phone-input-demo,\\n.tidal-scope .phone-input-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .phone-input-demo {\\n  container: phone-input-demo / inline-size;\\n  display: grid;\\n  width: min(100%, 680px);\\n  min-width: 0;\\n  gap: 16px;\\n  color: var(--t-ink);\\n}\\n\\n.tidal-scope .phone-input-demo-actions {\\n  display: flex;\\n  flex-wrap: wrap;\\n  gap: 9px;\\n}\\n\\n.tidal-scope .phone-input-demo-actions button {\\n  display: inline-flex;\\n  min-width: 128px;\\n  min-height: 44px;\\n  align-items: center;\\n  justify-content: center;\\n  padding: 9px 14px;\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-control);\\n  background: var(--t-surface);\\n  color: var(--t-ink);\\n  font: inherit;\\n  font-size: 12px;\\n  font-weight: 700;\\n  cursor: pointer;\\n  transition:\\n    color 140ms,\\n    background-color 140ms,\\n    border-color 140ms,\\n    transform 140ms var(--t-ease-out);\\n}\\n\\n.tidal-scope .phone-input-demo-actions button[type=\\\"submit\\\"] {\\n  border-color: var(--t-ink);\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n}\\n\\n.tidal-scope .phone-input-demo-actions button:hover {\\n  border-color: var(--t-ink);\\n}\\n\\n.tidal-scope .phone-input-demo-actions button[type=\\\"reset\\\"]:hover {\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n}\\n\\n.tidal-scope .phone-input-demo-actions button:active {\\n  transform: scale(0.98);\\n}\\n\\n.tidal-scope .phone-input-demo-actions button:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .phone-input-demo-status,\\n.tidal-scope .phone-input-demo-note {\\n  min-width: 0;\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .phone-input-demo-note {\\n  padding-block-start: 10px;\\n  border-block-start: 1px solid var(--t-border);\\n}\\n\\n@container phone-input-demo (max-width: 360px) {\\n  .tidal-scope .phone-input-demo-actions {\\n    display: grid;\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n\\n  .tidal-scope .phone-input-demo-actions button {\\n    width: 100%;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .phone-input-demo-actions button {\\n    transition: none;\\n  }\\n\\n  .tidal-scope .phone-input-demo-actions button:active {\\n    transform: none;\\n  }\\n}\";\n\nconst COUNTRIES = [\n  { code: \"US\", label: \"United States\", dialCode: \"+1\" },\n  { code: \"CA\", label: \"Canada\", dialCode: \"+1\" },\n  { code: \"GB\", label: \"United Kingdom\", dialCode: \"+44\" },\n  { code: \"AU\", label: \"Australia\", dialCode: \"+61\" },\n] as const;\n\nconst INITIAL_VALUE: TidalPhoneValue = {\n  country: \"US\",\n  number: \"202 555 0147\",\n  extension: \"204\",\n};\n\nfunction parseSamplePaste({\n  text,\n  value,\n  countries,\n}: TidalPhonePasteRequest): TidalPhoneValue | null {\n  const trimmed = text.trim().replace(/^tel:/i, \"\");\n  if (!trimmed) return null;\n  const extensionMatch = trimmed.match(/(?:ext\\.?|x)\\s*([0-9]+)\\s*$/i);\n  const withoutExtension = extensionMatch\n    ? trimmed.slice(0, extensionMatch.index).trim()\n    : trimmed;\n  const currentCountry = countries.find(\n    (country) => country.code === value.country,\n  );\n  const prefixedCountry =\n    (currentCountry && withoutExtension.startsWith(currentCountry.dialCode)\n      ? currentCountry\n      : countries\n          .filter((candidate) =>\n            withoutExtension.startsWith(candidate.dialCode),\n          )\n          .sort((a, b) => b.dialCode.length - a.dialCode.length)[0]) ??\n    undefined;\n  const country = prefixedCountry ?? currentCountry;\n  const number = prefixedCountry\n    ? withoutExtension.slice(prefixedCountry.dialCode.length).trim()\n    : withoutExtension;\n  return {\n    country: country?.code ?? value.country,\n    number,\n    extension: extensionMatch?.[1] ?? value.extension,\n  };\n}\n\nexport function PhoneInputDemo() {\n  const generatedId = useId().replace(/:/g, \"\");\n  const [value, setValue] = useState<TidalPhoneValue>(INITIAL_VALUE);\n  const [error, setError] = useState<ReactNode>(null);\n  const [status, setStatus] = useState(\n    \"Edit the sample number or paste a number with an extension.\",\n  );\n\n  return (\n    <form\n      id={generatedId}\n      className=\"phone-input-demo\"\n      aria-label=\"Phone input preview\"\n      onSubmit={(event) => {\n        event.preventDefault();\n        const formData = new FormData(event.currentTarget);\n        setError(null);\n        setStatus(\n          `Prepared ${String(formData.get(\"contact-country\"))} ${String(formData.get(\"contact-phone\"))}${formData.get(\"contact-extension\") ? ` extension ${String(formData.get(\"contact-extension\"))}` : \"\"} locally.`,\n        );\n      }}\n      onReset={(event) => {\n        if (event.defaultPrevented) return;\n        setValue(INITIAL_VALUE);\n        setError(null);\n        setStatus(\"Sample phone details reset.\");\n      }}\n    >\n      <TidalPhoneInput\n        label=\"Contact phone\"\n        description=\"Select a country and enter its local phone number.\"\n        error={error}\n        countries={COUNTRIES}\n        value={value}\n        onValueChange={(next, field) => {\n          setValue(next);\n          setError(null);\n          setStatus(\n            field === \"country\"\n              ? \"Country context updated.\"\n              : \"Sample phone details updated.\",\n          );\n        }}\n        parsePaste={parseSamplePaste}\n        form={generatedId}\n        countryName=\"contact-country\"\n        numberName=\"contact-phone\"\n        extensionName=\"contact-extension\"\n        required\n        numberInputProps={{\n          placeholder: \"202 555 0147\",\n          onInvalid: (event: import(\"react\").InvalidEvent<HTMLInputElement>) => {\n            event.preventDefault();\n            setError(\"Enter a phone number for this local sample.\");\n            setStatus(\"Check the phone number.\");\n            event.currentTarget.focus({ preventScroll: true });\n          },\n        }}\n      />\n\n      <div className=\"phone-input-demo-actions\">\n        <button type=\"submit\">Prepare sample</button>\n        <button type=\"reset\">Reset</button>\n      </div>\n      <p className=\"phone-input-demo-status\" role=\"status\" aria-live=\"polite\">\n        {status}\n      </p>\n      <p className=\"phone-input-demo-note\">\n        Sample data. Paste handling uses this preview’s local adapter.\n      </p>\n    </form>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <PhoneInputDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/phone-input.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "error",
      "type": "inferred-from-existing-demo",
      "initial": "null",
      "setter": "setError",
      "proposalCanBeRejected": false
    },
    {
      "prop": "value",
      "type": "inferred-from-existing-demo",
      "initial": "INITIAL_VALUE",
      "setter": "setValue",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onReset",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "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": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onValueChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": false,
      "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": []
}
