import * as react_jsx_runtime from 'react/jsx-runtime'; import { FileUIPart, SourceDocumentUIPart } from 'ai'; import { HTMLAttributes, ComponentProps, ReactNode } from 'react'; import { Button } from '../ui/button.js'; import { HoverCard, HoverCardContent, HoverCardTrigger } from '../ui/hover-card.js'; import 'class-variance-authority/types'; import '@base-ui/react/button'; import 'class-variance-authority'; import '@base-ui/react/preview-card'; type AttachmentData = (FileUIPart & { id: string; }) | (SourceDocumentUIPart & { id: string; }); type AttachmentMediaCategory = "image" | "video" | "audio" | "document" | "source" | "unknown"; type AttachmentVariant = "grid" | "inline" | "list"; declare const getMediaCategory: (data: AttachmentData) => AttachmentMediaCategory; declare const getAttachmentLabel: (data: AttachmentData) => string; interface AttachmentsContextValue { variant: AttachmentVariant; } interface AttachmentContextValue { data: AttachmentData; error: boolean; mediaCategory: AttachmentMediaCategory; onRemove?: () => void; variant: AttachmentVariant; } declare const useAttachmentsContext: () => AttachmentsContextValue; declare const useAttachmentContext: () => AttachmentContextValue; type AttachmentsProps = HTMLAttributes & { variant?: AttachmentVariant; }; declare const Attachments: ({ variant, className, children, ...props }: AttachmentsProps) => react_jsx_runtime.JSX.Element; type AttachmentProps = HTMLAttributes & { data: AttachmentData; /** * Mark this attachment as failed (upload error, virus scan flag, etc.). * Renders the chip with a destructive border + label, sets `aria-invalid` * for assistive tech. */ error?: boolean; onRemove?: () => void; }; declare const Attachment: ({ data, error, onRemove, className, children, ...props }: AttachmentProps) => react_jsx_runtime.JSX.Element; type AttachmentPreviewProps = HTMLAttributes & { fallbackIcon?: ReactNode; }; declare const AttachmentPreview: ({ fallbackIcon, className, ...props }: AttachmentPreviewProps) => react_jsx_runtime.JSX.Element; type AttachmentInfoProps = HTMLAttributes & { /** * Show the mediaType under the filename. Falls through to nothing if no * `size` is provided either. Mutually exclusive with `size` — `size` * wins when both are passed. */ showMediaType?: boolean; /** * Pre-formatted file size to render under the filename (e.g. `"1.2 MB"`). * Pre-formatted so the component stays unit-agnostic; format with whatever * helper makes sense at the call site (`pretty-bytes`, etc.). */ size?: string; }; declare const AttachmentInfo: ({ showMediaType, size, className, ...props }: AttachmentInfoProps) => react_jsx_runtime.JSX.Element | null; type AttachmentRemoveProps = ComponentProps & { label?: string; }; declare const AttachmentRemove: ({ label, className, children, ...props }: AttachmentRemoveProps) => react_jsx_runtime.JSX.Element | null; type AttachmentHoverCardProps = ComponentProps; declare const AttachmentHoverCard: (props: AttachmentHoverCardProps) => react_jsx_runtime.JSX.Element; type AttachmentHoverCardTriggerProps = ComponentProps; declare const AttachmentHoverCardTrigger: (props: AttachmentHoverCardTriggerProps) => react_jsx_runtime.JSX.Element; type AttachmentHoverCardContentProps = ComponentProps; declare const AttachmentHoverCardContent: ({ align, className, ...props }: AttachmentHoverCardContentProps) => react_jsx_runtime.JSX.Element; type AttachmentEmptyProps = HTMLAttributes; declare const AttachmentEmpty: ({ className, children, ...props }: AttachmentEmptyProps) => react_jsx_runtime.JSX.Element; export { Attachment, type AttachmentData, AttachmentEmpty, type AttachmentEmptyProps, AttachmentHoverCard, AttachmentHoverCardContent, type AttachmentHoverCardContentProps, type AttachmentHoverCardProps, AttachmentHoverCardTrigger, type AttachmentHoverCardTriggerProps, AttachmentInfo, type AttachmentInfoProps, type AttachmentMediaCategory, AttachmentPreview, type AttachmentPreviewProps, type AttachmentProps, AttachmentRemove, type AttachmentRemoveProps, type AttachmentVariant, Attachments, type AttachmentsProps, getAttachmentLabel, getMediaCategory, useAttachmentContext, useAttachmentsContext };