{"version":3,"file":"dropZone.types.mjs","names":[],"sources":["../../../../package/common/dropZone/dropZone.types.ts"],"sourcesContent":["import type React from 'react';\nimport type { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';\n\nexport enum DropZoneStatus {\n  /** Nothing is happening. */\n  Idle = 'idle',\n  /** A file drag is somewhere in the window — the zone is \"armed\". */\n  Dragging = 'dragging',\n  /** A file drag is hovering directly over this zone. */\n  Active = 'active',\n  /** The last drop / selection was rejected. */\n  Error = 'error',\n}\n\nexport enum DropZoneReturnType {\n  /** Emit the raw `File` objects (default). */\n  File = 'file',\n  /** Read each file as a base64 data URL and emit `LoadedFile`. */\n  Base64 = 'base64',\n  /** Read each file as UTF-8 text and emit `LoadedFile`. */\n  Text = 'text',\n}\n\nexport interface LoadedFile {\n  name: string;\n  size: number;\n  type: string;\n  lastModified: number;\n  /** The FileReader result — a base64 data URL or text, depending on `returnType`. */\n  data: string;\n}\n\nexport type DropZoneRejectionReason =\n  /** File extension / mime type not in `acceptedTypes`. */\n  | 'unacceptedType'\n  /** File exceeds `maxSize`. */\n  | 'tooLarge'\n  /** More files than `maxFiles` were provided. */\n  | 'tooMany'\n  /** Reading the file (base64 / text) failed. */\n  | 'readError';\n\nexport interface DropZoneRejection {\n  file: File;\n  reason: DropZoneRejectionReason;\n}\n\nexport interface DropZoneRenderState {\n  status: DropZoneStatus;\n  /** A drag is anywhere in the window (zone armed) or directly over it. */\n  isDragging: boolean;\n  /** A drag is directly over this zone. */\n  isActive: boolean;\n  disabled: boolean;\n}\n\nexport type DropZoneSlots = 'root' | 'content' | 'fileList' | 'fileItem' | 'input';\n\nexport interface DropZoneProps extends Omit<HtmlProps, 'children'> {\n  /** Static content, or a render function that receives the live drop state. */\n  children?: React.ReactNode | ((state: DropZoneRenderState) => React.ReactNode);\n\n  /**\n   * Accepted file types: extensions (`'.png'`), mime types (`'image/png'`),\n   * or wildcards (`'image/*'`). Empty / omitted means accept everything.\n   * Also drives the native picker's `accept` attribute.\n   */\n  acceptedTypes?: string[];\n  /** Output shape for each accepted file. Default: `File`. */\n  returnType?: DropZoneReturnType;\n\n  /** Open the native file picker when the zone is clicked. */\n  openPickerOnClick?: boolean;\n  /** Allow more than one file. Default: `true`. */\n  multiple?: boolean;\n  /** Reject files beyond this count (extras reported via `onReject`). */\n  maxFiles?: number;\n  /** Reject files larger than this many bytes. */\n  maxSize?: number;\n  /** Accept files pasted from the clipboard while the zone is focused. */\n  enablePaste?: boolean;\n  /** Recurse into dropped directories. Default: `true`. */\n  allowDirectories?: boolean;\n\n  /** Native `capture` attribute (mobile camera / mic). */\n  capture?: boolean | 'user' | 'environment';\n  disabled?: boolean;\n\n  /** Drop the built-in border / background styling; keep only base layout. */\n  unstyled?: boolean;\n  /** Render the names of `files` beneath the content. */\n  showFileNames?: boolean;\n  /** Files whose names are listed when `showFileNames` is set. */\n  files?: (File | LoadedFile)[];\n\n  onFilesChanged?: (files: (File | LoadedFile)[]) => void;\n  onReject?: (rejections: DropZoneRejection[]) => void;\n  onStatusChanged?: (status: DropZoneStatus) => void;\n\n  className?: string;\n  style?: React.CSSProperties;\n  classNames?: SlotClassNames<DropZoneSlots>;\n  styles?: SlotStyles<DropZoneSlots>;\n}\n"],"mappings":"aAGA,IAAY,EAAL,SAAA,EAAA,OAEL,GAAA,KAAA,OAEA,EAAA,SAAA,WAEA,EAAA,OAAA,SAEA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OAEL,GAAA,KAAA,OAEA,EAAA,OAAA,SAEA,EAAA,KAAA,QACF,EAAA,CAAA,CAAA"}