{
  "$schema": "https://rift-ds.com/schema/component.schema.json",
  "version": "1.40.0",
  "kind": "component",
  "name": "AttachmentGroup",
  "label": "Attachment group",
  "slug": "attachment-group",
  "category": "ai",
  "description": "The files on a sent message: one picture at its own shape, or a grid of tiles that collapses behind a count.",
  "client": true,
  "importPath": "rift-ds/components/Attachment/AttachmentGroup",
  "barrel": "main",
  "docsUrl": "https://rift-ds.com/components/attachment-group",
  "markdownUrl": "https://rift-ds.com/components/attachment-group.md",
  "exports": [
    {
      "component": "AttachmentGroup",
      "props": [
        {
          "name": "items",
          "type": "AttachmentItem[]",
          "typeKind": "array",
          "required": true,
          "description": "The files on the message, in order.",
          "typeRefs": [
            "AttachmentItem"
          ]
        },
        {
          "name": "align",
          "type": "\"start\" | \"end\"",
          "typeKind": "enum",
          "values": [
            "end",
            "start"
          ],
          "required": false,
          "description": "Which edge the layout hugs: `end` for the sender's own turns.",
          "default": "start"
        },
        {
          "name": "max",
          "type": "number",
          "typeKind": "primitive",
          "required": false,
          "description": "Most cells shown before the rest collapse. Over the limit, the last\ncell becomes a \"+N\" button standing for the hidden files.",
          "default": 4
        },
        {
          "name": "open",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Whether the overflow is expanded, for controlled use. Pair with `onOpenChange`."
        },
        {
          "name": "defaultOpen",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Whether the overflow starts expanded, for uncontrolled use.",
          "default": false
        },
        {
          "name": "onOpenChange",
          "type": "((open: boolean) => void)",
          "typeKind": "function",
          "required": false,
          "description": "Fires when the overflow expands or collapses."
        },
        {
          "name": "viewer",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Open a pressed file in the built-in AttachmentViewer, which steps\nthrough the rest of the group. Turn it off to handle presses yourself\nthrough `onItemClick`.",
          "default": true
        },
        {
          "name": "onItemClick",
          "type": "((item: AttachmentItem) => void)",
          "typeKind": "function",
          "required": false,
          "description": "Fires when a file is pressed, whether or not the viewer opens.",
          "typeRefs": [
            "AttachmentItem"
          ]
        },
        {
          "name": "renderPreview",
          "type": "((item: AttachmentItem) => ReactNode)",
          "typeKind": "function",
          "required": false,
          "description": "Passed to the viewer: draws a file it cannot, such as the pages of a PDF.",
          "typeRefs": [
            "AttachmentItem"
          ]
        },
        {
          "name": "onDownload",
          "type": "((item: AttachmentItem) => void)",
          "typeKind": "function",
          "required": false,
          "description": "Passed to the viewer: fires when Download is pressed, and renders the buttons.",
          "typeRefs": [
            "AttachmentItem"
          ]
        },
        {
          "name": "onRetry",
          "type": "((item: AttachmentItem) => void)",
          "typeKind": "function",
          "required": false,
          "description": "Passed to the viewer: fires when \"Try again\" is pressed on a file that failed to load.",
          "typeRefs": [
            "AttachmentItem"
          ]
        },
        {
          "name": "size",
          "type": "\"default\" | \"compact\"",
          "typeKind": "enum",
          "values": [
            "compact",
            "default"
          ],
          "required": false,
          "description": "Tile size, passed to every tile.",
          "default": "default"
        },
        {
          "name": "label",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Accessible label for the list.",
          "default": "Attachments"
        },
        {
          "name": "showMoreLabel",
          "type": "((hidden: number) => string)",
          "typeKind": "function",
          "required": false,
          "description": "Builds the accessible label of the \"+N\" button from the hidden count.",
          "defaultExpression": "(hidden) => `Show ${hidden} more`"
        },
        {
          "name": "showLessLabel",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Text of the collapse button under an expanded group.",
          "default": "Show fewer"
        },
        {
          "name": "attachmentTileLabels",
          "type": "Pick<AttachmentTileProps, \"uploadingLabel\" | \"errorLabel\" | \"unavailableLabel\" | \"progressLabel\">",
          "typeKind": "reference",
          "required": false,
          "description": "The status lines and progress name every tile writes, merged over the tile's English defaults (\"Uploading…\", \"Upload failed\", \"Unavailable\").",
          "typeRefs": [
            "AttachmentTileProps"
          ]
        },
        {
          "name": "attachmentViewerLabels",
          "type": "Pick<AttachmentViewerProps, \"closeLabel\" | \"downloadLabel\" | \"previousLabel\" | \"nextLabel\" | \"retryLabel\" | \"noPreviewLabel\" | \"failedLabel\" | \"failedDescription\" | \"formatPosition\">",
          "typeKind": "reference",
          "required": false,
          "description": "The words the built-in viewer writes, merged over its English defaults: its buttons (\"Download\", \"Close\", \"Previous file\", \"Next file\", \"Try again\"), its fallback headlines and the position text (\"2 of 5\").",
          "typeRefs": [
            "AttachmentViewerProps"
          ]
        },
        {
          "name": "locale",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "The BCP 47 locale file sizes are written in, such as `de-DE` (`1,5 MB`). Defaults to the nearest LocaleProvider's, else `en-US`."
        },
        {
          "name": "className",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Additional CSS classes",
          "default": ""
        }
      ]
    }
  ],
  "types": {
    "AttachmentItem": {
      "kind": "interface",
      "definition": "interface AttachmentItem {\n  /** Stable identity, unique within its list. */\n  id: string;\n  /** File name, extension included. */\n  name: string;\n  /** What kind of file it is. */\n  kind: FileKind;\n  /**\n   * Short label on the file's type mark, replacing the one derived from its\n   * kind and extension (`getFileTypeLabel`: \"PDF\", \"DOC\", the extension, or\n   * \"FILE\"), wherever the family draws the mark: the tile, a lone picture's\n   * badge, the viewer and a composer's queue. Set it to localise the mark or\n   * to name a format the derivation does not know.\n   */\n  typeLabel?: string;\n  /** Size in bytes. */\n  size?: number;\n  /** Mime type, when the source reported one. */\n  mimeType?: string;\n  /** Where the file is in its life. */\n  status: AttachmentStatus;\n  /** Upload progress, 0 to 100, while `status` is `uploading`. */\n  progress?: number;\n  /** Why it failed, while `status` is `error`. */\n  error?: string;\n  /** Image that fills the tile: an object URL for a picture, or a\n      host-rendered first page for a document. */\n  previewSrc?: string;\n  /** Alt text for the preview. Defaults to the name. */\n  previewAlt?: string;\n  /** Full-size image for the viewer, when the preview is a thumbnail.\n      Defaults to `previewSrc`. */\n  src?: string;\n  /** The file itself, for the viewer to show a PDF or a text file in place\n      (through DocumentViewer) and for a picture with no `src`. Distinct\n      from `src`, which is always an image. */\n  fileUrl?: string;\n  /** Intrinsic width of the preview, to reserve its shape before it loads. */\n  width?: number;\n  /** Intrinsic height of the preview. */\n  height?: number;\n  /** First lines of a pasted block, drawn as the tile's excerpt. */\n  excerpt?: string;\n}",
      "description": "One attachment as the family passes it around: what a tile draws, what a\ngroup lays out, and what `useAttachments` keeps. Plain data, so it\nserialises and crosses the server boundary; the `File` itself stays with\nwhoever owns the upload.",
      "refs": [
        "AttachmentStatus",
        "FileKind"
      ]
    },
    "AttachmentStatus": {
      "kind": "type",
      "definition": "type AttachmentStatus = 'ready' | 'uploading' | 'error' | 'unavailable';",
      "description": "Where an attachment is in its life: usable, on its way, failed, or gone."
    },
    "AttachmentTileProps": {
      "kind": "component-props",
      "component": "AttachmentTile",
      "see": "get_component(\"AttachmentTile\")"
    },
    "AttachmentViewerProps": {
      "kind": "component-props",
      "component": "AttachmentViewer",
      "see": "get_component(\"AttachmentViewer\")"
    },
    "FileKind": {
      "kind": "type",
      "definition": "type FileKind =\n  | 'pdf'\n  | 'document'\n  | 'spreadsheet'\n  | 'presentation'\n  | 'image'\n  | 'audio'\n  | 'video'\n  | 'archive'\n  | 'code'\n  | 'text'\n  | 'pasted'\n  | 'generic';"
    }
  },
  "externalTypes": {
    "Pick": "typescript",
    "ReactNode": "react"
  },
  "keyboard": [
    {
      "pattern": "disclosure",
      "part": "control that shows the rest of the files",
      "label": "Disclosure",
      "apg": "https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/",
      "rows": [
        {
          "keys": [
            "Enter"
          ],
          "text": "Opens what it controls, and closes it when it is open."
        },
        {
          "keys": [
            "Space"
          ],
          "text": "Does the same as Enter."
        }
      ]
    }
  ],
  "size": {
    "gzip": 14422
  }
}
