{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "attachments-svelte",
  "title": "Attachments (Svelte)",
  "description": "A removable list of attached files.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/svelte@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/svelte/attachments/Attachment.svelte",
      "content": "<!--\n  One chip: an image's preview or a file icon, the name, the size or error, and a remove button. Written without\n  whitespace between them, which would join the chip's text.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let props: ComponentProps<typeof parts.Item> & { children?: never } = $props();\n</script>\n\n<parts.Item {...props}>\n  {#snippet children({ item, preview, detail })}{#if preview}<img\n        data-preview=\"\"\n        src={preview}\n        alt=\"\"\n      />{:else}<span data-icon=\"\"></span>{/if}<span data-name=\"\">{item?.name}</span><span data-detail=\"\">{detail}</span\n    ><parts.Remove value={props.value} />{/snippet}\n</parts.Item>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/attachments/Attachment.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/attachments/Attachments.svelte",
      "content": "<!--\n  The `items` as chips, one Tab stop with arrow keys between them. Name it with `aria-label`. Without children, each\n  of its `rows` gets an `Attachment`, so a removed chip fades out. To style the chips, pass a `children` snippet of\n  `{ rows }` that renders an `Attachment` per row, with the item's `id` as its `value`; chips rendered from `items`\n  instead leave at once.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import Attachment from \"./Attachment.svelte\";\n  import { parts } from \"./parts\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Root> = $props();\n</script>\n\n<parts.Root {...props}>\n  {#snippet children(state)}\n    {#if content}\n      {@render content(state)}\n    {:else}\n      {#each state.rows as row (row.item.id)}\n        <Attachment value={row.item.id} />\n      {/each}\n    {/if}\n  {/snippet}\n</parts.Root>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/attachments/Attachments.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/attachments/index.ts",
      "content": "import type { ComponentProps } from \"svelte\";\nimport Attachment from \"./Attachment.svelte\";\nimport Attachments from \"./Attachments.svelte\";\n\nexport { Attachment, Attachments };\nexport type AttachmentsProps = ComponentProps<typeof Attachments>;\n",
      "type": "registry:ui",
      "target": "@ui/svelte/attachments/index.ts"
    },
    {
      "path": "packages/agent-ui/src/svelte/attachments/parts.ts",
      "content": "import { attachmentsPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/svelte/primitive\";\n\nexport const parts = createParts(attachmentsPrimitive, { root: \"ul\", item: \"li\", remove: \"span\" });\n",
      "type": "registry:ui",
      "target": "@ui/svelte/attachments/parts.ts"
    }
  ],
  "meta": {
    "layer": "svelte"
  },
  "type": "registry:ui"
}
