import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';export interface LyraDropZoneRejectedFile{readonly file:File;readonly reason:'type'|'count'|'size'|'directory'|'read'|'limit'|'maxFiles'|'maxTotalSize';}export interface LyraDropZoneFilesDetail{readonly files:readonly File[];readonly rejected:readonly LyraDropZoneRejectedFile[]; /** Remaining allowance under `maxFiles` after this drop, at the control's running count * (`heldFileCount`, since this component retains nothing of its own between drops) -- `null` * while `maxFiles` is unset (no limit), never negative. */ readonly remainingFiles:number|null; /** Remaining allowance under `maxTotalSize` after this drop, in bytes -- `null` while * `maxTotalSize` is unset (no limit), never negative. */ readonly remainingTotalSize:number|null;} /** `lr-files`' event type on `lr-drop-zone`, narrowing `target`/`currentTarget` to `LyraDropZone` * so a listener reads them without casting -- same convention as `lr-file-input`'s * `LyraFileInputFilesEvent`. */ export interface LyraDropZoneFilesEvent extends CustomEvent{readonly target:LyraDropZone;readonly currentTarget:LyraDropZone;}export interface LyraDropZoneEventMap{'lr-files':LyraDropZoneFilesEvent;} /** * `` -- a drag-and-drop region wrapper with no file input of its own. Wrap it around * an arbitrary region (a chat composer, a whole conversation viewport, a panel far larger than any * single control) to make that entire region a file-drop target: it owns the drag-session state, * renders a themeable drag-over overlay, applies `accept`/size/count limits, and emits the same * `lr-files` event shape `lr-file-input` does -- `detail: { files, rejected }` -- so the two are * interchangeable from a listener's point of view. It never renders a native file picker, a * selected-file list, or any focusable control of its own; wrap `lr-file-input` itself (or any * other focusable content) inside it when the region also needs a click-to-browse affordance. * * The drag-session mechanics (nested-depth tracking, accept/reject preview, legacy File System API * folder traversal) are the exact ones `lr-file-input` uses, shared through * `internal/drop-session-controller.ts` rather than reimplemented here. * * @customElement lr-drop-zone * @slot - The wrapped region. Rendered as ordinary light DOM content; this element adds only the * drag listeners and the overlay layered on top. * @slot overlay - Custom drag-over overlay content, overriding the localized accept/reject text. * @event lr-files - Frozen `detail: { files, rejected, remainingFiles, remainingTotalSize }` with * detached readonly sequences and rejected-file records, fired on drop. * `remainingFiles`/`remainingTotalSize` report the allowance still left under `maxFiles`/ * `maxTotalSize` after this drop (`null` while that limit is unset). Immutable `File` items retain * identity. Typed as {@linkcode LyraDropZoneFilesEvent}, so * `event.target`/`event.currentTarget` are `LyraDropZone` without a cast. * @csspart base - The wrapping element wrapping the default slot and the overlay. * @csspart overlay - The drag-over overlay, layered above the slotted content. Hidden outside an * active drag session. * @csspart overlay-icon - The default decorative overlay icon. * @csspart overlay-text - Wrapper around the overlay slot/text content. * @csspart status - The visually-hidden, `aria-hidden` mirror of the drag accept/reject state and * accepted/rejected counts. The announcement itself lands in the shared light-DOM polite region * (`acquireAnnouncementSink()` in `internal/announcer.ts`); this part is a styling/inspection * surface only. * @csspart rejection - The visible region listing each currently-rejected file alongside its * reason, rendered in addition to the sr-only `status` summary. * @cssstate dragging - Matches during an active file drag session. * @cssprop [--lr-drop-zone-radius=var(--lr-radius)] - Corner radius of `[part="overlay"]`. * @cssprop [--lr-drop-zone-overlay-border-color=var(--lr-color-brand)] - Dashed border color of * `[part="overlay"]` in its neutral drag state, before an accept or reject verdict. * @cssprop [--lr-drop-zone-overlay-bg=color-mix(in srgb, var(--lr-color-brand) 8%, transparent)] - * Fill of `[part="overlay"]` in that same neutral drag state. * @cssprop [--lr-drop-zone-overlay-font-size=var(--lr-font-size-md-sm)] - Overlay instructional * text size. * @cssprop [--lr-drop-zone-overlay-icon-size=var(--lr-font-size-xl)] - `[part="overlay-icon"]` * glyph size. * @cssprop [--lr-drop-zone-overlay-gap=var(--lr-space-xs)] - Gap between the overlay icon and text. * @cssprop [--lr-drop-zone-accept-border-color=var(--lr-color-success)] - Border color of * `[part="overlay"][data-drag-state="accept"]`. * @cssprop [--lr-drop-zone-accept-bg=color-mix(in srgb, var(--lr-color-success) 12%, transparent)] - * Background of `[part="overlay"][data-drag-state="accept"]`. * @cssprop [--lr-drop-zone-reject-border-color=var(--lr-color-danger)] - Border color of * `[part="overlay"][data-drag-state="reject"]`. * @cssprop [--lr-drop-zone-reject-bg=color-mix(in srgb, var(--lr-color-danger) 12%, transparent)] - * Background of `[part="overlay"][data-drag-state="reject"]`. * @status experimental * @since 16.0.0 */ export declare class LyraDropZone extends LyraElement{protected static readonly immutableEventDetails:readonly string[];static styles:import("lit").CSSResultGroup[]; /** Disables drag/drop handling entirely; the wrapped content keeps its own interactivity. */ disabled:boolean; /** Accepts more than one file per drop, and enables recursive folder-drop traversal -- same * contract as `lr-file-input`'s `multiple`. Unlike `lr-file-input`, this defaults to `true`: * a region wrapper's typical use (dropping several files onto a chat surface) expects more than * one file, and there is no native single-file picker here to keep in sync. */ multiple:boolean; /** Native-`accept`-style allowlist (`".csv,.xlsx"`, `"image/*"`, comma-separated mixes) -- * identical parsing to `lr-file-input`'s `accept`, via the same `matchesAccept()`. */ accept:string; /** Largest accepted file size in bytes. `0` (the default) disables the check -- identical * contract to `lr-file-input`'s `maxFileSize`, including its invalid-override fallback. */ maxFileSize:number; /** Largest number of files accepted per drop, counting `heldFileCount` plus the current drop's * files. `0` (the default) disables the check -- identical contract to `lr-file-input`'s * `maxFiles`. Since this component retains nothing of its own between drops, the count would * otherwise always cover only the current drop -- `heldFileCount` is what lets a cumulative cap * span separate drops. */ maxFiles:number; /** Largest combined byte size accepted per drop, summing `heldTotalSize` plus the current * drop's files. `0` (the default) disables the check -- identical contract to * `lr-file-input`'s `maxTotalSize`. */ maxTotalSize:number; /** Externally held file count added to the running count `maxFiles` evaluates against -- * identical contract to `lr-file-input`'s `heldFileCount`, letting a cumulative, server-backed * cap span separate drops onto this region. `0` (the default) means "nothing held" and * reproduces prior behavior exactly. A negative, `NaN`, or `Infinity` value is normalized to * `0` via `finiteCount`. */ heldFileCount:number; /** Externally held byte total added to the running size `maxTotalSize` evaluates against -- * identical contract to `lr-file-input`'s `heldTotalSize`. */ heldTotalSize:number;private dragState;private rejectedFiles;private resultStatus;private readonly internals;private readonly dropSession;private politeSink?;private assertiveSink?; /** False until the first render has committed, so mounting never announces a resting state. */ private announcementsArmed;constructor(); /** Readonly state derived from the current drag session. * @default false */ get dragging():boolean;protected willUpdate(changed:PropertyValues):void;connectedCallback():void;disconnectedCallback():void;protected updated(changed:PropertyValues):void; /** `maxFileSize` normalized exactly like `lr-file-input`'s `effectiveMaxFileSize`. */ private get effectiveMaxFileSize(); /** `maxFiles` normalized exactly like `lr-file-input`'s `effectiveMaxFiles`. */ private get effectiveMaxFiles(); /** `maxTotalSize` normalized exactly like `lr-file-input`'s `effectiveMaxTotalSize`. */ private get effectiveMaxTotalSize();private isAllowed;private classify;private rejectionMessage;private emitFiles;private folderFailure;private onDragEnter;private onDragOver;private onDragLeave;private onDrop;private overlayText;private statusText;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-drop-zone':LyraDropZone;}}