@deftui/react 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,74 +0,0 @@
1
- import * as React$1 from "react";
2
- import { useRender } from "@base-ui/react/use-render";
3
- type Direction = "ltr" | "rtl";
4
- interface FileState {
5
- file: File;
6
- progress: number;
7
- error?: string;
8
- status: "idle" | "uploading" | "error" | "success";
9
- }
10
- interface StoreState {
11
- files: Map<File, FileState>;
12
- dragOver: boolean;
13
- invalid: boolean;
14
- }
15
- declare function useStore<T>(selector: (state: StoreState) => T): T;
16
- interface FileUploadProps extends Omit<React$1.ComponentProps<"div"> & useRender.ComponentProps<"div">, "defaultValue" | "onChange"> {
17
- value?: File[];
18
- defaultValue?: File[];
19
- onValueChange?: (files: File[]) => void;
20
- onAccept?: (files: File[]) => void;
21
- onFileAccept?: (file: File) => void;
22
- onFileReject?: (file: File, message: string) => void;
23
- onFileValidate?: (file: File) => string | null | undefined;
24
- onUpload?: (files: File[], options: {
25
- onProgress: (file: File, progress: number) => void;
26
- onSuccess: (file: File) => void;
27
- onError: (file: File, error: Error) => void;
28
- }) => Promise<void> | void;
29
- accept?: string;
30
- maxFiles?: number;
31
- maxSize?: number;
32
- dir?: Direction;
33
- label?: string;
34
- name?: string;
35
- disabled?: boolean;
36
- invalid?: boolean;
37
- multiple?: boolean;
38
- required?: boolean;
39
- }
40
- declare function FileUpload(props: FileUploadProps): React$1.JSX.Element;
41
- interface FileUploadDropzoneProps extends React$1.ComponentProps<"div">, useRender.ComponentProps<"div"> {}
42
- declare function FileUploadDropzone(props: FileUploadDropzoneProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
43
- interface FileUploadTriggerProps extends React$1.ComponentProps<"button">, useRender.ComponentProps<"button"> {}
44
- declare function FileUploadTrigger(props: FileUploadTriggerProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
45
- interface FileUploadListProps extends React$1.ComponentProps<"div">, useRender.ComponentProps<"div"> {
46
- orientation?: "horizontal" | "vertical";
47
- forceMount?: boolean;
48
- }
49
- declare function FileUploadList(props: FileUploadListProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
50
- interface FileUploadItemProps extends React$1.ComponentProps<"div">, useRender.ComponentProps<"div"> {
51
- value: File;
52
- }
53
- declare function FileUploadItem(props: FileUploadItemProps): React$1.JSX.Element | null;
54
- interface FileUploadItemPreviewProps extends React$1.ComponentProps<"div">, useRender.ComponentProps<"div"> {
55
- previewRender?: (file: File, fallback: () => React$1.ReactNode) => React$1.ReactNode;
56
- }
57
- declare function FileUploadItemPreview(props: FileUploadItemPreviewProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
58
- interface FileUploadItemMetadataProps extends React$1.ComponentProps<"div">, useRender.ComponentProps<"div"> {
59
- size?: "default" | "sm";
60
- }
61
- declare function FileUploadItemMetadata(props: FileUploadItemMetadataProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
62
- interface FileUploadItemProgressProps extends React$1.ComponentProps<"div">, useRender.ComponentProps<"div"> {
63
- variant?: "linear" | "circular" | "fill";
64
- size?: number;
65
- forceMount?: boolean;
66
- }
67
- declare function FileUploadItemProgress(props: FileUploadItemProgressProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
68
- interface FileUploadItemDeleteProps extends React$1.ComponentProps<"button">, useRender.ComponentProps<"button"> {}
69
- declare function FileUploadItemDelete(props: FileUploadItemDeleteProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
70
- interface FileUploadClearProps extends React$1.ComponentProps<"button">, useRender.ComponentProps<"button"> {
71
- forceMount?: boolean;
72
- }
73
- declare function FileUploadClear(props: FileUploadClearProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
74
- export { FileUpload, FileUploadClear, FileUploadDropzone, FileUploadItem, FileUploadItemDelete, FileUploadItemMetadata, FileUploadItemPreview, FileUploadItemProgress, FileUploadList, type FileUploadProps, FileUploadTrigger, useStore as useFileUpload };