{
  "component": {
    "id": "file-upload",
    "name": "File upload",
    "tier": "pro",
    "exampleId": "file-upload",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/file-upload-demo.tsx",
    "exportName": "FileUploadDemo",
    "sha256": "5e5df43810494b8f0337a767a0b4cd5f4e0151aa768a8d3ac60e50ed88324fb4",
    "helperImports": [],
    "directComponentImports": [
      "file-upload"
    ],
    "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/file-upload",
    "registryUrl": "https://tidalui.com/r/pro/file-upload.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/file-upload",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/file-upload",
      "registryUrl": "https://tidalui.com/r/pro/file-upload.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/file-upload.tsx",
    "exports": [
      "TidalFileStatus",
      "TidalFileUpload"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/file-upload.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "@radix-ui/react-compose-refs@1.1.5",
      "lucide-react"
    ],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "file-upload"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/file-upload.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/file-upload.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/file-upload-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useEffect, useRef, useState } from \"react\";\n\nimport { Plus, RotateCcw, Check, X } from \"lucide-react\";\n\nimport { TidalFileUpload, type TidalFileStatus } from \"./components/ui/file-upload\";\n\nimport \"./components/ui/file-upload.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .file-upload-specimen{width:100%;max-width:580px;padding:28px;border:1px solid var(--t-border);border-radius:var(--t-radius-card);background:var(--t-subtle);color:var(--t-ink);box-shadow:0 22px 44px -32px #00000038}.tidal-scope .file-upload-demo-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:18px}.tidal-scope .file-upload-demo-tools>button,.tidal-scope .file-upload-demo-prepare{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:44px;padding:9px 12px;border:1px solid var(--t-border);border-radius:var(--t-radius-control);background:var(--t-surface);color:var(--t-ink);font:inherit;font-size:11px;cursor:pointer;transition:background 140ms,transform 140ms var(--t-ease-out)}.tidal-scope .file-upload-demo-tools>button:hover{background:var(--t-wash)}.tidal-scope .file-upload-demo-tools>button:active,.tidal-scope .file-upload-demo-prepare:active:not(:disabled){transform:scale(.98)}.tidal-scope .file-upload-demo-prepare{width:100%;margin-top:10px;background:var(--t-ink);color:var(--t-surface);border-color:var(--t-ink)}.tidal-scope .file-upload-demo-prepare:focus-visible{outline:3px solid currentColor;outline-offset:-5px}.tidal-scope .file-upload-demo-prepare:disabled{opacity:.5;cursor:not-allowed}.tidal-scope .file-upload-demo-note{font-size:11px;line-height:1.6;color:var(--t-muted);margin:15px 0 0}\\n@media(max-width:480px){.tidal-scope .file-upload-specimen{padding:18px}}@media(prefers-reduced-motion:reduce){.tidal-scope .file-upload-demo-tools>button:active,.tidal-scope .file-upload-demo-prepare:active:not(:disabled){transform:none}}\";\n\nexport function FileUploadDemo(){\n  const [files,setFiles]=useState<File[]>([]),[states,setStates]=useState<Map<File,TidalFileStatus>>(new Map()),[running,setRunning]=useState(false),[revision,setRevision]=useState(0);\n  const timer=useRef<ReturnType<typeof setTimeout>|undefined>(undefined),progress=useRef(0);\n  useEffect(()=>()=>clearTimeout(timer.current),[]);\n  function cancel(){clearTimeout(timer.current);setRunning(false);setStates(current=>new Map([...current].filter(([,state])=>state.state!==\"uploading\")));}\n  function change(next:File[]){cancel();setFiles(next);setStates(current=>new Map([...current].filter(([file])=>next.includes(file))));}\n  function samples(){cancel();setStates(new Map());setFiles([new File([\"Project overview\\n\".repeat(64)],\"Project brief.txt\",{type:\"text/plain\"}),new File([\"# Launch checklist\\n\".repeat(48)],\"Launch checklist.md\",{type:\"text/markdown\"})]);}\n  function reset(){cancel();setFiles([]);setStates(new Map());setRevision(n=>n+1);}\n  function prepare(){if(running||!files.length)return;progress.current=0;setRunning(true);setStates(new Map(files.map(f=>[f,{state:\"uploading\",progress:0,label:\"Preparing sample\"}])));const step=()=>{progress.current=Math.min(100,progress.current+20);setStates(new Map(files.map(f=>[f,{state:progress.current===100?\"complete\":\"uploading\",progress:progress.current,label:progress.current===100?\"Sample ready\":\"Preparing sample\"}])));if(progress.current<100)timer.current=setTimeout(step,160);else setRunning(false);};timer.current=setTimeout(step,160);}\n  return <div className=\"file-upload-specimen\"><TidalFileUpload key={revision} label=\"Attachments\" files={files} onFilesChange={change} accept=\".txt,.md,.pdf\" maxFiles={3} maxSize={2_000_000} fileStates={states}/><div className=\"file-upload-demo-tools\"><button type=\"button\" onClick={samples}><Plus size={14} aria-hidden=\"true\"/>Add samples</button><button type=\"button\" onClick={reset}><RotateCcw size={14} aria-hidden=\"true\"/>Reset</button></div><button type=\"button\" className=\"file-upload-demo-prepare\" disabled={!files.length} aria-busy={running} onClick={running?cancel:prepare}>{running?<><X size={15} aria-hidden=\"true\"/>Cancel sample</>:<><Check size={15} aria-hidden=\"true\"/>Prepare sample</>}</button><p className=\"file-upload-demo-note\">Local files and preparation. Nothing is uploaded.</p></div>;\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <FileUploadDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/file-upload.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "files",
      "type": "inferred-from-existing-demo",
      "initial": "[]",
      "setter": "setFiles",
      "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": "onFilesChange",
      "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": false,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "No form submit is present in the existing demo.",
    "resetBehavior": "No reset control is present in the existing demo.",
    "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": []
}
