{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "uploader-solid",
  "title": "Uploader (Solid)",
  "description": "File uploads with progress, cancel and retry.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/solid@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/solid/uploader.tsx",
      "content": "import { uploaderPrimitive } from \"@kind-ui/agent-ui/core\";\nimport type { ComponentProps } from \"@solidjs/web\";\nimport { FileInput, FileInputDropzone, FileInputTrigger } from \"@ui-sdk/solid/file-input\";\nimport { createParts } from \"@ui-sdk/solid/primitive\";\nimport { Progress, ProgressIndicator, ProgressLabel, ProgressTrack } from \"@ui-sdk/solid/progress\";\nimport { For } from \"solid-js\";\n\nconst parts = createParts(uploaderPrimitive, { root: \"div\", list: \"ul\", item: \"li\", action: \"button\" });\n\nexport type UploaderProps = Omit<ComponentProps<typeof parts.Root>, \"children\">;\n\n/**\n * A File Input drop zone with a Browse button, then a row per item with its progress, and Cancel or Retry when the\n * host offers them. Name it with `aria-label`.\n */\nexport function Uploader(props: UploaderProps) {\n  return (\n    <parts.Root {...props}>\n      {(state) => (\n        <>\n          <FileInput {...state.fileInput}>\n            <FileInputDropzone>\n              <span data-upload-icon=\"\" />\n              <span data-hint=\"\">Drop files here, or</span>\n              <FileInputTrigger>browse</FileInputTrigger>\n            </FileInputDropzone>\n          </FileInput>\n          <parts.List>\n            {(list) => (\n              <For each={list.rows} keyed={(row) => row.item.id}>\n                {(row) => <UploaderItem value={row().item.id} />}\n              </For>\n            )}\n          </parts.List>\n        </>\n      )}\n    </parts.Root>\n  );\n}\n\nexport type UploaderItemProps = Omit<ComponentProps<typeof parts.Item>, \"children\">;\n\n/** One upload: the file's name and progress bar, what it's doing, and its action. */\nexport function UploaderItem(props: UploaderItemProps) {\n  return (\n    <parts.Item {...props}>\n      {(state) => (\n        <>\n          <span data-icon=\"\" />\n          <Progress value={state.item?.progress ?? null}>\n            <ProgressLabel>{state.item?.name}</ProgressLabel>\n            <ProgressTrack>\n              <ProgressIndicator />\n            </ProgressTrack>\n          </Progress>\n          <span data-detail=\"\">{state.detail}</span>\n          <parts.Action value={props.value} />\n        </>\n      )}\n    </parts.Item>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@ui/solid/uploader.tsx"
    }
  ],
  "meta": {
    "layer": "solid"
  },
  "type": "registry:ui"
}
