{
  "component": {
    "id": "import-wizard",
    "name": "Import wizard",
    "tier": "pro",
    "exampleId": "import-wizard",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/import-wizard-demo.tsx",
    "exportName": "ImportWizardDemo",
    "sha256": "96b6ee559fbfb90f1bcd62c8f6c6c6e08bd04f0a89c07225c6a983467ac7d1c2",
    "helperImports": [],
    "directComponentImports": [
      "column-mapper",
      "import-wizard"
    ],
    "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/import-wizard",
    "registryUrl": "https://tidalui.com/r/pro/import-wizard.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/import-wizard",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/import-wizard",
      "registryUrl": "https://tidalui.com/r/pro/import-wizard.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/import-wizard.tsx",
    "exports": [
      "TidalColumnMapping",
      "TidalImportFileSummary",
      "TidalImportStep",
      "TidalImportWizard"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/import-wizard.css",
      "components/ui/column-mapper.css",
      "components/ui/native-select.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "@tidal-pro/column-mapper"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "column-mapper",
      "import-wizard",
      "native-select"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/import-wizard.css",
      "components/ui/column-mapper.css",
      "components/ui/native-select.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/import-wizard.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/import-wizard-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useLayoutEffect, useMemo, useRef, useState } from \"react\";\n\nimport { TidalImportWizard, type TidalImportFileSummary, type TidalImportStep } from \"./components/ui/import-wizard\";\n\nimport type { TidalColumnMapping } from \"./components/ui/column-mapper\";\n\nimport \"./components/ui/column-mapper.css\";\n\nimport \"./components/ui/import-wizard.css\";\n\nimport \"./components/ui/native-select.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .import-wizard-demo {\\n  display: grid;\\n  width: min(100%, 900px);\\n  min-width: 0;\\n  gap: 14px;\\n}\\n\\n.tidal-scope .import-wizard-adapter {\\n  display: flex;\\n  min-width: 0;\\n  align-items: center;\\n  justify-content: center;\\n  gap: 10px;\\n}\\n\\n.tidal-scope .import-wizard-adapter input {\\n  position: absolute;\\n  width: 1px;\\n  height: 1px;\\n  overflow: hidden;\\n  clip-path: inset(50%);\\n}\\n\\n.tidal-scope .import-wizard-adapter > span {\\n  color: var(--t-muted);\\n  font-size: 11px;\\n}\\n\\n.tidal-scope .import-wizard-result {\\n  display: grid;\\n  justify-items: start;\\n  gap: 10px;\\n  padding: 22px;\\n  border: 1px solid var(--t-line);\\n  border-radius: 16px;\\n  background: var(--t-subtle);\\n}\\n\\n.tidal-scope .import-wizard-result strong {\\n  font-size: 18px;\\n  line-height: 1.2;\\n}\\n\\n.tidal-scope .import-wizard-result p,\\n.tidal-scope .import-wizard-status {\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 12px;\\n  line-height: 1.55;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .import-wizard-result button {\\n  min-width: 44px;\\n  min-height: 44px;\\n  padding: 10px 15px;\\n  border: 1px solid var(--t-ink);\\n  border-radius: 10px;\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n  font: inherit;\\n  font-size: 12px;\\n  font-weight: 700;\\n  cursor: pointer;\\n}\\n\\n.tidal-scope .import-wizard-result button:focus-visible {\\n  outline: 2px solid var(--t-ink);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .import-wizard-status {\\n  padding-inline: 4px;\\n}\\n\\n@container tidal-import (max-width: 440px) {\\n  .tidal-scope .import-wizard-adapter {\\n    align-items: stretch;\\n    flex-direction: column;\\n  }\\n\\n  .tidal-scope .import-wizard-adapter > span {\\n    text-align: center;\\n  }\\n}\";\n\nconst sources = [\n  { id: \"full_name\", label: \"full_name\", sample: \"Avery Morgan\" },\n  { id: \"email\", label: \"email\", sample: \"avery@example.test\" },\n  { id: \"company\", label: \"company\", sample: \"Northstar\" },\n];\n\nconst fields = [\n  { id: \"name\", label: \"Name\", required: true },\n  { id: \"email\", label: \"Email address\", required: true },\n  { id: \"organization\", label: \"Company\" },\n];\n\nconst preview = {\n  columns: [\n    { id: \"name\", label: \"Name\" },\n    { id: \"email\", label: \"Email address\" },\n    { id: \"organization\", label: \"Company\" },\n  ],\n  rows: [\n    {\n      id: \"row-1\",\n      cells: {\n        name: \"Avery Morgan\",\n        email: \"avery@example.test\",\n        organization: \"Northstar\",\n      },\n    },\n    {\n      id: \"row-2\",\n      cells: {\n        name: \"Noah Chen\",\n        email: \"noah@example.test\",\n        organization: \"Field Office\",\n      },\n    },\n    {\n      id: \"row-3\",\n      cells: {\n        name: \"Mila Ortiz\",\n        email: \"missing address\",\n        organization: \"Studio\",\n      },\n      issue: \"Email needs review\",\n    },\n  ],\n  totalRows: 3,\n};\n\nconst sampleFile: TidalImportFileSummary = {\n  id: \"sample-contacts-csv\",\n  name: \"sample-contacts.csv\",\n  size: \"1.4 KB\",\n  type: \"CSV sample\",\n  rowCount: 3,\n  status: \"valid\",\n  statusLabel: \"Ready for mapping\",\n};\n\nexport function ImportWizardDemo() {\n  const nativeId = useId().replace(/:/g, \"\");\n  const [step, setStep] = useState<TidalImportStep>(\"file\");\n  const [file, setFile] = useState<TidalImportFileSummary | undefined>();\n  const [fileError, setFileError] = useState<string>();\n  const [mapping, setMapping] = useState<TidalColumnMapping>({\n    name: \"full_name\",\n    email: \"email\",\n    organization: \"company\",\n  });\n  const [status, setStatus] = useState(\n    \"Choose the fictional sample to prepare an import plan locally.\",\n  );\n  const nativeInputRef = useRef<HTMLInputElement>(null);\n  const sampleButtonRef = useRef<HTMLButtonElement>(null);\n  const resetButtonRef = useRef<HTMLButtonElement>(null);\n  const focusIntent = useRef<{\n    expected: TidalImportStep;\n    origin: HTMLButtonElement;\n  } | null>(null);\n  const requiredReady = useMemo(\n    () => Boolean(mapping.name && mapping.email),\n    [mapping],\n  );\n\n  const reset = () => {\n    setStep(\"file\");\n    setFile(undefined);\n    setFileError(undefined);\n    setMapping({ name: \"full_name\", email: \"email\", organization: \"company\" });\n    if (nativeInputRef.current) nativeInputRef.current.value = \"\";\n    setStatus(\"Sample reset locally.\");\n  };\n\n  useLayoutEffect(() => {\n    const intent = focusIntent.current;\n    if (!intent || intent.expected !== step) return;\n    const active = intent.origin.ownerDocument.activeElement;\n    if (\n      active === intent.origin ||\n      active === intent.origin.ownerDocument.body ||\n      !(active instanceof HTMLElement) ||\n      !active.isConnected\n    ) {\n      (step === \"result\"\n        ? resetButtonRef.current\n        : sampleButtonRef.current\n      )?.focus({ preventScroll: true });\n    }\n    focusIntent.current = null;\n  }, [step]);\n\n  return (\n    <div className=\"import-wizard-demo\">\n      <TidalImportWizard\n        title=\"Import contacts\"\n        description=\"Prepare a file mapping and row review before handing the plan to your application.\"\n        step={step}\n        onStepChange={(next) => {\n          setStep(next);\n          setStatus(`${next[0].toUpperCase()}${next.slice(1)} step opened.`);\n        }}\n        file={file}\n        fileError={fileError}\n        fileAdapter={\n          <div className=\"import-wizard-adapter\">\n            <input\n              ref={nativeInputRef}\n              id={`${nativeId}-file`}\n              type=\"file\"\n              accept=\".csv,text/csv\"\n              onChange={(event) => {\n                const selected = event.currentTarget.files?.[0];\n                if (!selected) return;\n                setFile({\n                  id: `local-${selected.name}`,\n                  name: selected.name,\n                  size: `${Math.max(1, Math.ceil(selected.size / 1024))} KB`,\n                  type: selected.type || \"Unknown file type\",\n                  status: \"invalid\",\n                  statusLabel: \"Not parsed by this demo\",\n                });\n                setFileError(\n                  \"This preview does not read files. Use the fictional sample to continue.\",\n                );\n                setStatus(\n                  \"Only local file metadata was read by the native input.\",\n                );\n              }}\n            />\n            <label htmlFor={`${nativeId}-file`}>Choose CSV</label>\n            <span>or</span>\n            <button\n              ref={sampleButtonRef}\n              type=\"button\"\n              onClick={() => {\n                setFile(sampleFile);\n                setFileError(undefined);\n                setStatus(\"Fictional sample ready for mapping.\");\n              }}\n            >\n              Use sample CSV\n            </button>\n          </div>\n        }\n        sources={sources}\n        fields={fields}\n        mapping={mapping}\n        onMappingChange={(next) => {\n          setMapping(next);\n          setStatus(\"Mapping updated locally.\");\n        }}\n        preview={preview}\n        canContinue={\n          step === \"file\"\n            ? file?.id === sampleFile.id\n            : step === \"mapping\"\n              ? requiredReady\n              : true\n        }\n        formProps={{\n          action: \"#prepared-import-plan\",\n          method: \"get\",\n        }}\n        submitButtonProps={{\n          name: \"intent\",\n          value: \"prepare-import-plan\",\n          formAction: \"#sample-import-plan\",\n        }}\n        onImportPlan={(_plan, event) => {\n          event.preventDefault();\n          setStep(\"progress\");\n          setStatus(\"Import plan prepared locally. No rows were imported.\");\n        }}\n        onDownloadErrorRows={(event) => {\n          event.preventDefault();\n          setStatus(\n            \"Error-row download requested locally. No file was generated.\",\n          );\n        }}\n        onCancelProgress={() => {\n          setStep(\"review\");\n          setStatus(\"Sample preparation cancelled locally.\");\n        }}\n        progress={{\n          value: 3,\n          max: 4,\n          label: \"Preparing sample plan\",\n          valueLabel: \"3 of 4 checks\",\n          description: \"Local preview state only.\",\n          actions: (\n            <button\n              type=\"button\"\n              onClick={(event) => {\n                focusIntent.current = {\n                  expected: \"result\",\n                  origin: event.currentTarget,\n                };\n                setStep(\"result\");\n                setStatus(\"Sample plan is ready for consumer handling.\");\n              }}\n            >\n              Complete sample\n            </button>\n          ),\n        }}\n        result={\n          <div className=\"import-wizard-result\">\n            <strong>Import plan ready</strong>\n            <p>\n              Three fictional rows and the selected mapping are ready for the\n              consumer callback. Nothing was uploaded or imported.\n            </p>\n            <button\n              ref={resetButtonRef}\n              type=\"button\"\n              onClick={(event) => {\n                focusIntent.current = {\n                  expected: \"file\",\n                  origin: event.currentTarget,\n                };\n                reset();\n              }}\n            >\n              Reset sample\n            </button>\n          </div>\n        }\n      />\n      <p className=\"import-wizard-status\" role=\"status\">\n        {status}\n      </p>\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      <ImportWizardDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/import-wizard.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "step",
      "type": "inferred-from-existing-demo",
      "initial": "\"file\"",
      "setter": "setStep",
      "proposalCanBeRejected": false
    },
    {
      "prop": "file",
      "type": "inferred-from-existing-demo",
      "initial": "undefined",
      "setter": "setFile",
      "proposalCanBeRejected": false
    },
    {
      "prop": "fileError",
      "type": "inferred-from-existing-demo",
      "initial": "undefined",
      "setter": "setFileError",
      "proposalCanBeRejected": false
    },
    {
      "prop": "mapping",
      "type": "inferred-from-existing-demo",
      "initial": "{\n    name: \"full_name\",\n    email: \"email\",\n    organization: \"company\",\n  }",
      "setter": "setMapping",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onCancelProgress",
      "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": "onChange",
      "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": "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": "onDownloadErrorRows",
      "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": "onImportPlan",
      "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": "onMappingChange",
      "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": "onStepChange",
      "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": "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": []
}
