@uploadcn/react 0.0.0-stage → 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +45 -2
- package/dist/index.d.ts +576 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1224 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UploadCN contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @uploadcn/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React hooks and headless, accessible upload primitives for
|
|
4
|
+
[UploadCN](https://uploadcn.dev). The shadcn-styled components in the UploadCN registry
|
|
5
|
+
are built on these.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @uploadcn/react @uploadcn/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { s3Adapter } from "@uploadcn/core"
|
|
13
|
+
import { Upload } from "@uploadcn/react"
|
|
14
|
+
|
|
15
|
+
const adapter = s3Adapter({ endpoint: "/api/upload" })
|
|
16
|
+
|
|
17
|
+
export function Uploader() {
|
|
18
|
+
return (
|
|
19
|
+
<Upload.Root adapter={adapter} accept="image/*" maxFiles={5}>
|
|
20
|
+
<Upload.Dropzone>Drop images or press Enter to browse</Upload.Dropzone>
|
|
21
|
+
<Upload.List>
|
|
22
|
+
{(item) => (
|
|
23
|
+
<Upload.Item item={item}>
|
|
24
|
+
<Upload.Name />
|
|
25
|
+
<Upload.Progress>
|
|
26
|
+
<Upload.ProgressIndicator />
|
|
27
|
+
</Upload.Progress>
|
|
28
|
+
<Upload.Status />
|
|
29
|
+
<Upload.Retry>Retry</Upload.Retry>
|
|
30
|
+
<Upload.Remove>Remove</Upload.Remove>
|
|
31
|
+
</Upload.Item>
|
|
32
|
+
)}
|
|
33
|
+
</Upload.List>
|
|
34
|
+
</Upload.Root>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Hooks: `useUploader`, `useUpload`, `useUploadState`, `useUploadSelector`,
|
|
40
|
+
`useUploadItem`, `useUploadProgress`, `useUploadValue`, `useDropzone`, `useWindowDrop`,
|
|
41
|
+
`usePasteFiles`, `useFileValidation`, `useImageCompression`, `useImageCrop`,
|
|
42
|
+
`useFilePreview`, `useNetworkStatus`, `useUploadGuard`.
|
|
43
|
+
|
|
44
|
+
Requires React 19. Documentation: https://uploadcn.dev/docs/hooks
|
|
45
|
+
|
|
46
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
|
|
2
|
+
import { UploadAdapter, UploadError as UploadError$1, UploadItem, UploadStatus as UploadStatus$1, UploadSummary, Uploader, UploaderOptions, UploaderState, ValidateFilesResult, ValidationIssue, ValidationOptions } from "@uploadcn/core";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { CompressImageOptions, CropArea, ImageTransformOptions } from "@uploadcn/core/image";
|
|
5
|
+
//#region src/render.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Replace a primitive's element, like Base UI's `render` prop:
|
|
8
|
+
* pass an element to clone (`render={<Button />}`) or a function that
|
|
9
|
+
* receives the merged props and the component state.
|
|
10
|
+
*/
|
|
11
|
+
type RenderProp<TState> = React$1.ReactElement<Record<string, unknown>> | ((props: Record<string, unknown>, state: TState) => React$1.ReactElement);
|
|
12
|
+
type AnyProps = Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Merges two prop objects: event handlers run in sequence (unless the first
|
|
15
|
+
* calls `preventDefault`), classNames concatenate, styles shallow-merge,
|
|
16
|
+
* refs combine, and everything else from `overrides` wins.
|
|
17
|
+
*/
|
|
18
|
+
export declare function mergeProps(base: AnyProps, overrides: AnyProps): AnyProps;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/messages.d.ts
|
|
21
|
+
/** Every user-facing string, so primitives can be translated. */
|
|
22
|
+
interface UploadMessages {
|
|
23
|
+
status: Record<UploadStatus$1, string>;
|
|
24
|
+
retrying: string;
|
|
25
|
+
waitingForNetwork: string;
|
|
26
|
+
/** Live-region announcements. */
|
|
27
|
+
added: (count: number) => string;
|
|
28
|
+
uploaded: (name: string) => string;
|
|
29
|
+
failed: (name: string, reason: string) => string;
|
|
30
|
+
rejected: (name: string, reason: string) => string;
|
|
31
|
+
cancelled: (name: string) => string;
|
|
32
|
+
completed: (count: number) => string;
|
|
33
|
+
/** Accessible labels for item actions. */
|
|
34
|
+
remove: (name: string) => string;
|
|
35
|
+
cancel: (name: string) => string;
|
|
36
|
+
retry: (name: string) => string;
|
|
37
|
+
pause: (name: string) => string;
|
|
38
|
+
resume: (name: string) => string;
|
|
39
|
+
progress: (name: string) => string;
|
|
40
|
+
totalProgress: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const defaultMessages: UploadMessages;
|
|
43
|
+
/** A status label that also explains automatic retries and offline pauses. */
|
|
44
|
+
export declare function getStatusLabel(item: Pick<UploadItem, "status" | "retryAt" | "pauseReason">, messages?: UploadMessages): string;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/use-uploader.d.ts
|
|
47
|
+
interface UploaderCallbacks<TResult> {
|
|
48
|
+
onAdd?: (items: UploadItem<TResult>[]) => void;
|
|
49
|
+
onReject?: (item: UploadItem<TResult>) => void;
|
|
50
|
+
onSuccess?: (item: UploadItem<TResult>) => void;
|
|
51
|
+
onError?: (item: UploadItem<TResult>, error: UploadError$1) => void;
|
|
52
|
+
/** Called when the queue drains after uploads finished. */
|
|
53
|
+
onComplete?: (items: UploadItem<TResult>[]) => void;
|
|
54
|
+
}
|
|
55
|
+
interface UseUploaderOptions<TResult> extends Omit<UploaderOptions<TResult>, "adapter">, UploaderCallbacks<TResult> {
|
|
56
|
+
/**
|
|
57
|
+
* Where files go. Defaults to the adapter from the nearest
|
|
58
|
+
* `UploadConfigProvider`.
|
|
59
|
+
*/
|
|
60
|
+
adapter?: UploadAdapter<TResult>;
|
|
61
|
+
/** Restore persisted uploads on mount (requires `persistence`). */
|
|
62
|
+
restore?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates an upload engine bound to the component's lifetime. The instance
|
|
66
|
+
* is stable; option changes (including a new adapter) apply on the next
|
|
67
|
+
* render without recreating it.
|
|
68
|
+
*/
|
|
69
|
+
export declare function useUploader<TResult = unknown>(options?: UseUploaderOptions<TResult>): Uploader<TResult>;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/primitives.d.ts
|
|
72
|
+
type ElementProps<TTag extends keyof React$1.JSX.IntrinsicElements, TState> = Omit<React$1.ComponentPropsWithRef<TTag>, "children"> & {
|
|
73
|
+
render?: RenderProp<TState>;
|
|
74
|
+
children?: React$1.ReactNode;
|
|
75
|
+
};
|
|
76
|
+
declare const OPTION_KEYS: readonly ["adapter", "autoUpload", "concurrency", "retry", "duplicates", "transform", "process", "persistence", "network", "progressInterval", "accept", "maxSize", "minSize", "maxFiles", "minFiles", "image", "media", "validate", "restore", "onAdd", "onReject", "onSuccess", "onError", "onComplete"];
|
|
77
|
+
interface UploadRootState {
|
|
78
|
+
disabled: boolean;
|
|
79
|
+
isUploading: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface UploadRootOwnProps<TResult> {
|
|
82
|
+
/** Allow selecting several files. Default `true` (unless `maxFiles` is 1). */
|
|
83
|
+
multiple?: boolean;
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Renders hidden inputs with the values of successful uploads, so the
|
|
87
|
+
* component works in plain `<form>`s and server actions.
|
|
88
|
+
*/
|
|
89
|
+
name?: string;
|
|
90
|
+
/** Value submitted per successful upload. Defaults to `result.key`, `result.url`, or the file name. */
|
|
91
|
+
getFormValue?: (item: UploadItem<TResult>) => string;
|
|
92
|
+
/**
|
|
93
|
+
* What the form submits under `name`: `"value"` (default) submits a value
|
|
94
|
+
* per successful upload; `"file"` submits the selected files themselves,
|
|
95
|
+
* so the component works as a plain file input (no upload needed).
|
|
96
|
+
*/
|
|
97
|
+
submit?: "value" | "file";
|
|
98
|
+
/** Opens the camera on mobile (`<input capture>`). */
|
|
99
|
+
capture?: "user" | "environment";
|
|
100
|
+
/** Let users pick whole folders. */
|
|
101
|
+
directory?: boolean;
|
|
102
|
+
/** Translate or customize every string. */
|
|
103
|
+
messages?: Partial<UploadMessages>;
|
|
104
|
+
render?: RenderProp<UploadRootState>;
|
|
105
|
+
children?: React$1.ReactNode;
|
|
106
|
+
}
|
|
107
|
+
type DivProps = Omit<React$1.ComponentPropsWithRef<"div">, "onError" | "children">;
|
|
108
|
+
type UploadRootProps<TResult = unknown> = DivProps & UploadRootOwnProps<TResult> & (({
|
|
109
|
+
uploader: Uploader<TResult>;
|
|
110
|
+
} & { [K in (typeof OPTION_KEYS)[number]]?: never; }) | ({
|
|
111
|
+
uploader?: undefined;
|
|
112
|
+
} & UseUploaderOptions<TResult>));
|
|
113
|
+
/**
|
|
114
|
+
* The root of an upload UI. Pass uploader options directly
|
|
115
|
+
* (`<Upload adapter={…} maxFiles={5}>`) or an `uploader` from `useUploader`
|
|
116
|
+
* to control it from outside.
|
|
117
|
+
*/
|
|
118
|
+
export declare function UploadRoot<TResult = unknown>(props: UploadRootProps<TResult>): React$1.JSX.Element;
|
|
119
|
+
interface UploadDropzoneState {
|
|
120
|
+
isDragging: boolean;
|
|
121
|
+
isDragReject: boolean;
|
|
122
|
+
disabled: boolean;
|
|
123
|
+
}
|
|
124
|
+
type UploadDropzoneProps = ElementProps<"div", UploadDropzoneState> & {
|
|
125
|
+
/**
|
|
126
|
+
* Clicking or pressing Enter/Space opens the file picker. Set `false` when
|
|
127
|
+
* the dropzone contains its own `UploadTrigger`. Default `true`.
|
|
128
|
+
*/
|
|
129
|
+
clickable?: boolean;
|
|
130
|
+
};
|
|
131
|
+
export declare function UploadDropzone({ render, clickable, ...props }: UploadDropzoneProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
132
|
+
type UploadTriggerProps = ElementProps<"button", {
|
|
133
|
+
disabled: boolean;
|
|
134
|
+
}>;
|
|
135
|
+
/** A button that opens the file picker. */
|
|
136
|
+
export declare function UploadTrigger({ render, ...props }: UploadTriggerProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
137
|
+
type UploadListProps = Omit<ElementProps<"ul", {
|
|
138
|
+
count: number;
|
|
139
|
+
}>, "children"> & {
|
|
140
|
+
/**
|
|
141
|
+
* A template rendered once per item (`<UploadItem>…</UploadItem>`), or a
|
|
142
|
+
* function of the item for full control.
|
|
143
|
+
*/
|
|
144
|
+
children?: React$1.ReactNode | ((item: UploadItem) => React$1.ReactNode);
|
|
145
|
+
/** Show only matching items (e.g. hide rejected ones). */
|
|
146
|
+
filter?: (item: UploadItem) => boolean;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* A list of uploads. Children are rendered once per item, with the item in
|
|
150
|
+
* context; each item re-renders on its own progress without re-rendering
|
|
151
|
+
* its siblings.
|
|
152
|
+
*/
|
|
153
|
+
export declare function UploadList({ render, children, filter, ...props }: UploadListProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
154
|
+
type UploadItemProps = ElementProps<"li", UploadItem> & {
|
|
155
|
+
/** The item to render. Optional inside `UploadList`, which provides it. */
|
|
156
|
+
item?: UploadItem;
|
|
157
|
+
};
|
|
158
|
+
/** Provides an item to the item-level primitives inside it. */
|
|
159
|
+
export declare function UploadItemRoot({ item: itemProp, render, ...props }: UploadItemProps): React$1.JSX.Element;
|
|
160
|
+
type UploadPreviewProps = Omit<ElementProps<"img", UploadItem>, "src"> & {
|
|
161
|
+
/** Shown for files that can't be previewed as images. */
|
|
162
|
+
fallback?: React$1.ReactNode;
|
|
163
|
+
/** Max thumbnail dimension in px. Default 256. */
|
|
164
|
+
thumbnailSize?: number;
|
|
165
|
+
};
|
|
166
|
+
/** An image thumbnail of the item, or `fallback` for other file types. */
|
|
167
|
+
export declare function UploadPreview({ render, fallback, thumbnailSize, alt, ...props }: UploadPreviewProps): React$1.JSX.Element | null;
|
|
168
|
+
export declare function UploadName({ render, ...props }: ElementProps<"span", UploadItem>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
169
|
+
type UploadSizeProps = ElementProps<"span", UploadItem> & {
|
|
170
|
+
/** `"total"` shows the size; `"progress"` shows "3 MB / 10 MB" while uploading. */
|
|
171
|
+
format?: "total" | "progress";
|
|
172
|
+
};
|
|
173
|
+
export declare function UploadSize({ render, format, ...props }: UploadSizeProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
174
|
+
/** Upload speed and time remaining, while uploading. */
|
|
175
|
+
export declare function UploadSpeed({ render, ...props }: ElementProps<"span", UploadItem>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
176
|
+
export declare function UploadStatus({ render, ...props }: ElementProps<"span", UploadItem>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
177
|
+
/** The item's error or validation message, when it has one. */
|
|
178
|
+
export declare function UploadError({ render, ...props }: ElementProps<"p", UploadItem>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
179
|
+
/** Renders its children only once the item uploaded successfully. */
|
|
180
|
+
export declare function UploadSuccess({ children }: {
|
|
181
|
+
children?: React$1.ReactNode;
|
|
182
|
+
}): React$1.JSX.Element | null;
|
|
183
|
+
interface UploadProgressState {
|
|
184
|
+
percent: number;
|
|
185
|
+
indeterminate: boolean;
|
|
186
|
+
complete: boolean;
|
|
187
|
+
}
|
|
188
|
+
type UploadProgressProps = ElementProps<"div", UploadProgressState>;
|
|
189
|
+
/**
|
|
190
|
+
* An accessible progress bar. Inside `<UploadItem>` it tracks that item;
|
|
191
|
+
* anywhere else it tracks the whole queue.
|
|
192
|
+
*/
|
|
193
|
+
export declare function UploadProgress(props: UploadProgressProps): React$1.JSX.Element;
|
|
194
|
+
/** The filled part of `UploadProgress`. */
|
|
195
|
+
export declare function UploadProgressIndicator({ render, ...props }: ElementProps<"div", UploadProgressState>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
196
|
+
type ActionProps = ElementProps<"button", UploadItem> & {
|
|
197
|
+
/** Render (disabled) even when the action doesn't apply. */
|
|
198
|
+
forceMount?: boolean;
|
|
199
|
+
};
|
|
200
|
+
export declare const UploadRemove: {
|
|
201
|
+
({ render, forceMount, ...props }: ActionProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
202
|
+
displayName: string;
|
|
203
|
+
};
|
|
204
|
+
export declare const UploadCancel: {
|
|
205
|
+
({ render, forceMount, ...props }: ActionProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
206
|
+
displayName: string;
|
|
207
|
+
};
|
|
208
|
+
export declare const UploadRetry: {
|
|
209
|
+
({ render, forceMount, ...props }: ActionProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
210
|
+
displayName: string;
|
|
211
|
+
};
|
|
212
|
+
export declare const UploadPause: {
|
|
213
|
+
({ render, forceMount, ...props }: ActionProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
214
|
+
displayName: string;
|
|
215
|
+
};
|
|
216
|
+
export declare const UploadResume: {
|
|
217
|
+
({ render, forceMount, ...props }: ActionProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
218
|
+
displayName: string;
|
|
219
|
+
};
|
|
220
|
+
/** Renders its children only while the queue is empty. */
|
|
221
|
+
export declare function UploadEmpty({ children }: {
|
|
222
|
+
children?: React$1.ReactNode;
|
|
223
|
+
}): React$1.JSX.Element | null;
|
|
224
|
+
type QueueActionProps = ElementProps<"button", {
|
|
225
|
+
count: number;
|
|
226
|
+
}> & {
|
|
227
|
+
forceMount?: boolean;
|
|
228
|
+
};
|
|
229
|
+
/** Starts idle uploads (when `autoUpload` is off). Hidden when there are none. */
|
|
230
|
+
export declare function UploadStart({ render, forceMount, ...props }: QueueActionProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
231
|
+
/** Removes finished items (or every item with `all`). Hidden when there's nothing to clear. */
|
|
232
|
+
export declare function UploadClear({ render, forceMount, all, ...props }: QueueActionProps & {
|
|
233
|
+
all?: boolean;
|
|
234
|
+
}): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region src/context.d.ts
|
|
237
|
+
interface UploadContextValue {
|
|
238
|
+
uploader: Uploader<unknown>;
|
|
239
|
+
/** Opens the native file picker. */
|
|
240
|
+
openFileDialog: () => void;
|
|
241
|
+
/** Adds files through the same path as the picker and drops. */
|
|
242
|
+
addFiles: (files: File[]) => void;
|
|
243
|
+
accept: ValidationOptions["accept"];
|
|
244
|
+
multiple: boolean;
|
|
245
|
+
disabled: boolean;
|
|
246
|
+
messages: UploadMessages;
|
|
247
|
+
inputId: string;
|
|
248
|
+
}
|
|
249
|
+
export declare const UploadContext: React$1.Context<UploadContextValue | null>;
|
|
250
|
+
export declare function useUploadContext(): UploadContextValue;
|
|
251
|
+
export declare const UploadItemContext: React$1.Context<UploadItem<unknown> | null>;
|
|
252
|
+
/**
|
|
253
|
+
* The current item. Inside `<UploadItem>` it reads from context; pass an id
|
|
254
|
+
* to subscribe to any item from within `<Upload>`.
|
|
255
|
+
*/
|
|
256
|
+
export declare function useUploadItem<TResult = unknown>(id?: string): UploadItem<TResult>;
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/use-upload.d.ts
|
|
259
|
+
interface UseUploadReturn<TResult> {
|
|
260
|
+
uploader: Uploader<TResult>;
|
|
261
|
+
items: readonly UploadItem<TResult>[];
|
|
262
|
+
summary: UploadSummary;
|
|
263
|
+
online: boolean;
|
|
264
|
+
add: Uploader<TResult>["add"];
|
|
265
|
+
start: Uploader<TResult>["start"];
|
|
266
|
+
pause: Uploader<TResult>["pause"];
|
|
267
|
+
resume: Uploader<TResult>["resume"];
|
|
268
|
+
cancel: Uploader<TResult>["cancel"];
|
|
269
|
+
retry: Uploader<TResult>["retry"];
|
|
270
|
+
remove: Uploader<TResult>["remove"];
|
|
271
|
+
clearCompleted: Uploader<TResult>["clearCompleted"];
|
|
272
|
+
update: Uploader<TResult>["update"];
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* The all-in-one hook: creates an uploader and returns its items, an
|
|
276
|
+
* aggregate summary and bound actions.
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* const { items, add, summary } = useUpload({ adapter: s3Adapter({ endpoint: "/api/upload" }) })
|
|
280
|
+
*/
|
|
281
|
+
export declare function useUpload<TResult = unknown>(options: UseUploaderOptions<TResult>): UseUploadReturn<TResult>;
|
|
282
|
+
/** Like `useUpload`, for an uploader created elsewhere (e.g. from context). */
|
|
283
|
+
export declare function useUploadState<TResult>(uploader: Uploader<TResult>): UseUploadReturn<TResult>;
|
|
284
|
+
/** Aggregate progress, speed, ETA and counts for the whole queue. */
|
|
285
|
+
export declare function useUploadProgress<TResult>(uploader: Uploader<TResult>): UploadSummary;
|
|
286
|
+
/**
|
|
287
|
+
* Derives form values from successful uploads — e.g. object keys for a
|
|
288
|
+
* server action or react-hook-form field. Pass a stable `getValue` (defined
|
|
289
|
+
* outside the component or memoized) to keep the returned array stable.
|
|
290
|
+
*/
|
|
291
|
+
export declare function useUploadValue<TResult, TValue>(uploader: Uploader<TResult>, getValue: (item: UploadItem<TResult>) => TValue): TValue[];
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region src/use-upload-selector.d.ts
|
|
294
|
+
/**
|
|
295
|
+
* Subscribes to a slice of uploader state. The component re-renders only
|
|
296
|
+
* when the selected value changes (by `isEqual`, default `Object.is`).
|
|
297
|
+
*/
|
|
298
|
+
export declare function useUploadSelector<TResult, TSelected>(uploader: Uploader<TResult>, selector: (state: UploaderState<TResult>) => TSelected, isEqual?: (a: TSelected, b: TSelected) => boolean): TSelected;
|
|
299
|
+
/** Shallow array equality, for selectors that return lists. */
|
|
300
|
+
export declare function shallowArrayEqual<T>(a: readonly T[], b: readonly T[]): boolean;
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/use-dropzone.d.ts
|
|
303
|
+
interface UseDropzoneOptions {
|
|
304
|
+
/** Receives every dropped file, with folders expanded. */
|
|
305
|
+
onDrop: (files: File[]) => void;
|
|
306
|
+
/** Used to flag drags of unsupported types before they are dropped. */
|
|
307
|
+
accept?: ValidationOptions["accept"];
|
|
308
|
+
/** Reject drags carrying more than one file. */
|
|
309
|
+
multiple?: boolean;
|
|
310
|
+
disabled?: boolean;
|
|
311
|
+
}
|
|
312
|
+
interface DropzoneState {
|
|
313
|
+
/** Files are being dragged over the zone. */
|
|
314
|
+
isDragging: boolean;
|
|
315
|
+
/** The dragged files don't match `accept` (or `multiple`). */
|
|
316
|
+
isDragReject: boolean;
|
|
317
|
+
}
|
|
318
|
+
interface DropzoneHandlers {
|
|
319
|
+
onDragEnter: React$1.DragEventHandler;
|
|
320
|
+
onDragOver: React$1.DragEventHandler;
|
|
321
|
+
onDragLeave: React$1.DragEventHandler;
|
|
322
|
+
onDrop: React$1.DragEventHandler;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Drag-and-drop state and handlers for any element. Uses an enter/leave
|
|
326
|
+
* counter so moving over child elements doesn't flicker the drag state.
|
|
327
|
+
*/
|
|
328
|
+
export declare function useDropzone(options: UseDropzoneOptions): {
|
|
329
|
+
handlers: DropzoneHandlers;
|
|
330
|
+
/** Files are being dragged over the zone. */
|
|
331
|
+
isDragging: boolean;
|
|
332
|
+
/** The dragged files don't match `accept` (or `multiple`). */
|
|
333
|
+
isDragReject: boolean;
|
|
334
|
+
};
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/use-window-drop.d.ts
|
|
337
|
+
interface UseWindowDropOptions {
|
|
338
|
+
/** Called with files dropped anywhere on the page. */
|
|
339
|
+
onDrop: (files: File[]) => void;
|
|
340
|
+
/** Turn detection off without unmounting. Default `true`. */
|
|
341
|
+
enabled?: boolean;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Detects files dragged over the browser window — for "drop anywhere"
|
|
345
|
+
* overlays. Drops already handled by an inner dropzone (which calls
|
|
346
|
+
* `preventDefault`) are ignored, so the two can coexist.
|
|
347
|
+
*/
|
|
348
|
+
export declare function useWindowDrop({ onDrop, enabled }: UseWindowDropOptions): {
|
|
349
|
+
isDragging: boolean;
|
|
350
|
+
};
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/use-paste-files.d.ts
|
|
353
|
+
interface UsePasteFilesOptions {
|
|
354
|
+
onPaste: (files: File[]) => void;
|
|
355
|
+
/**
|
|
356
|
+
* Element to listen on. Defaults to the whole document, which is what chat
|
|
357
|
+
* inputs usually want (paste a screenshot anywhere).
|
|
358
|
+
*/
|
|
359
|
+
target?: React$1.RefObject<HTMLElement | null>;
|
|
360
|
+
enabled?: boolean;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Uploads files and screenshots pasted from the clipboard. Text pastes are
|
|
364
|
+
* left alone so inputs keep working normally.
|
|
365
|
+
*/
|
|
366
|
+
export declare function usePasteFiles({ onPaste, target, enabled }: UsePasteFilesOptions): void;
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region src/use-file-validation.d.ts
|
|
369
|
+
/**
|
|
370
|
+
* Standalone validation for flows that don't upload immediately — e.g.
|
|
371
|
+
* collecting files in a form and submitting them later. Uses the same rules
|
|
372
|
+
* as the uploader, including async and custom validators.
|
|
373
|
+
*/
|
|
374
|
+
export declare function useFileValidation(options: ValidationOptions): {
|
|
375
|
+
validate: (files: readonly File[], context?: {
|
|
376
|
+
existingCount?: number;
|
|
377
|
+
}) => Promise<ValidateFilesResult>;
|
|
378
|
+
validateCount: (count: number) => ValidationIssue | null;
|
|
379
|
+
isValidating: boolean;
|
|
380
|
+
};
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/use-image.d.ts
|
|
383
|
+
interface CompressionStats {
|
|
384
|
+
before: number;
|
|
385
|
+
after: number;
|
|
386
|
+
/** Fraction saved, 0–1. */
|
|
387
|
+
saved: number;
|
|
388
|
+
}
|
|
389
|
+
/** Compresses images on demand and reports how much was saved. */
|
|
390
|
+
export declare function useImageCompression(options?: CompressImageOptions): {
|
|
391
|
+
compress: (file: File) => Promise<File>;
|
|
392
|
+
isCompressing: boolean;
|
|
393
|
+
stats: CompressionStats | null;
|
|
394
|
+
error: Error | null;
|
|
395
|
+
};
|
|
396
|
+
interface ImageCropState {
|
|
397
|
+
/** Pan offset, in the units of your crop UI. */
|
|
398
|
+
position: {
|
|
399
|
+
x: number;
|
|
400
|
+
y: number;
|
|
401
|
+
};
|
|
402
|
+
zoom: number;
|
|
403
|
+
/** Degrees, clockwise. */
|
|
404
|
+
rotation: number;
|
|
405
|
+
flipHorizontal: boolean;
|
|
406
|
+
flipVertical: boolean;
|
|
407
|
+
/** Crop rectangle in source-image pixels, reported by the crop UI. */
|
|
408
|
+
area: CropArea | null;
|
|
409
|
+
}
|
|
410
|
+
interface UseImageCropOptions {
|
|
411
|
+
minZoom?: number;
|
|
412
|
+
maxZoom?: number;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* UI-agnostic crop/rotate/zoom state with an `apply` that renders the
|
|
416
|
+
* result. Pair it with any crop UI (react-easy-crop, a canvas, sliders).
|
|
417
|
+
*/
|
|
418
|
+
export declare function useImageCrop({ minZoom, maxZoom }?: UseImageCropOptions): {
|
|
419
|
+
minZoom: number;
|
|
420
|
+
maxZoom: number;
|
|
421
|
+
apply: (file: File, options?: Omit<ImageTransformOptions, "crop" | "rotate">) => Promise<File>;
|
|
422
|
+
setPosition: (position: {
|
|
423
|
+
x: number;
|
|
424
|
+
y: number;
|
|
425
|
+
}) => void;
|
|
426
|
+
setZoom: (zoom: number) => void;
|
|
427
|
+
setRotation: (rotation: number) => void;
|
|
428
|
+
rotateBy: (degrees: number) => void;
|
|
429
|
+
flip: (axis: "horizontal" | "vertical") => void;
|
|
430
|
+
setArea: (area: CropArea | null) => void;
|
|
431
|
+
reset: () => void;
|
|
432
|
+
/** Pan offset, in the units of your crop UI. */
|
|
433
|
+
position: {
|
|
434
|
+
x: number;
|
|
435
|
+
y: number;
|
|
436
|
+
};
|
|
437
|
+
zoom: number;
|
|
438
|
+
/** Degrees, clockwise. */
|
|
439
|
+
rotation: number;
|
|
440
|
+
flipHorizontal: boolean;
|
|
441
|
+
flipVertical: boolean;
|
|
442
|
+
/** Crop rectangle in source-image pixels, reported by the crop UI. */
|
|
443
|
+
area: CropArea | null;
|
|
444
|
+
};
|
|
445
|
+
//#endregion
|
|
446
|
+
//#region src/use-file-preview.d.ts
|
|
447
|
+
type PreviewKind = "image" | "video" | "audio" | "pdf" | "file";
|
|
448
|
+
export declare function getPreviewKind(file: {
|
|
449
|
+
type: string;
|
|
450
|
+
name: string;
|
|
451
|
+
}): PreviewKind;
|
|
452
|
+
interface UseFilePreviewOptions {
|
|
453
|
+
/**
|
|
454
|
+
* For images, render a downscaled thumbnail no larger than this many
|
|
455
|
+
* pixels instead of decoding the full image — keeps large galleries fast.
|
|
456
|
+
*/
|
|
457
|
+
thumbnailSize?: number;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* An object URL for previewing a file, revoked automatically when the file
|
|
461
|
+
* changes or the component unmounts.
|
|
462
|
+
*/
|
|
463
|
+
export declare function useFilePreview(file: File | Blob | null | undefined, { thumbnailSize }?: UseFilePreviewOptions): string | null;
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/use-network.d.ts
|
|
466
|
+
/**
|
|
467
|
+
* `navigator.onLine`, kept in sync with `online`/`offline` events. `true`
|
|
468
|
+
* on the server. Note that "online" only means a network interface is up.
|
|
469
|
+
*/
|
|
470
|
+
export declare function useNetworkStatus(): boolean;
|
|
471
|
+
interface UseUploadGuardOptions {
|
|
472
|
+
/** Default `true`. */
|
|
473
|
+
enabled?: boolean;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Warns before closing or reloading the tab while uploads are in progress.
|
|
477
|
+
* Browsers show their own generic message; custom text is not supported.
|
|
478
|
+
*/
|
|
479
|
+
export declare function useUploadGuard<TResult>(uploader: Uploader<TResult>, { enabled }?: UseUploadGuardOptions): boolean;
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region src/config.d.ts
|
|
482
|
+
/**
|
|
483
|
+
* App-wide defaults for every uploader below the provider: where files go
|
|
484
|
+
* (`adapter`), limits, retries and messages. Props on a component win.
|
|
485
|
+
*/
|
|
486
|
+
interface UploadConfig extends Partial<Omit<UploaderOptions<unknown>, "adapter">> {
|
|
487
|
+
adapter?: UploadAdapter<any>;
|
|
488
|
+
messages?: Partial<UploadMessages>;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Configure uploads once — usually in your root layout — and every Upload
|
|
492
|
+
* component and block uses it. Nest providers to override per section.
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
* <UploadConfigProvider adapter={cloudinaryAdapter({ cloudName, uploadPreset })}>
|
|
496
|
+
* {children}
|
|
497
|
+
* </UploadConfigProvider>
|
|
498
|
+
*/
|
|
499
|
+
export declare function UploadConfigProvider({ children, ...config }: UploadConfig & {
|
|
500
|
+
children?: React$1.ReactNode;
|
|
501
|
+
}): React$1.JSX.Element;
|
|
502
|
+
/** The merged config from the nearest `UploadConfigProvider`s. */
|
|
503
|
+
export declare function useUploadConfig(): UploadConfig;
|
|
504
|
+
//#endregion
|
|
505
|
+
//#region src/index.d.ts
|
|
506
|
+
/**
|
|
507
|
+
* Headless, accessible upload primitives. Style them directly or use the
|
|
508
|
+
* shadcn-styled versions from the UploadCN registry.
|
|
509
|
+
*/
|
|
510
|
+
export declare const Upload: {
|
|
511
|
+
Root: typeof UploadRoot;
|
|
512
|
+
Dropzone: typeof UploadDropzone;
|
|
513
|
+
Trigger: typeof UploadTrigger;
|
|
514
|
+
List: typeof UploadList;
|
|
515
|
+
Item: typeof UploadItemRoot;
|
|
516
|
+
Preview: typeof UploadPreview;
|
|
517
|
+
Name: typeof UploadName;
|
|
518
|
+
Size: typeof UploadSize;
|
|
519
|
+
Speed: typeof UploadSpeed;
|
|
520
|
+
Status: typeof UploadStatus;
|
|
521
|
+
Error: typeof UploadError;
|
|
522
|
+
Success: typeof UploadSuccess;
|
|
523
|
+
Progress: typeof UploadProgress;
|
|
524
|
+
ProgressIndicator: typeof UploadProgressIndicator;
|
|
525
|
+
Remove: {
|
|
526
|
+
({ render, forceMount, ...props }: Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children"> & {
|
|
527
|
+
render?: RenderProp<import("@uploadcn/core").UploadItem<unknown>> | undefined;
|
|
528
|
+
children?: React.ReactNode;
|
|
529
|
+
} & {
|
|
530
|
+
forceMount?: boolean;
|
|
531
|
+
}): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
532
|
+
displayName: string;
|
|
533
|
+
};
|
|
534
|
+
Cancel: {
|
|
535
|
+
({ render, forceMount, ...props }: Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children"> & {
|
|
536
|
+
render?: RenderProp<import("@uploadcn/core").UploadItem<unknown>> | undefined;
|
|
537
|
+
children?: React.ReactNode;
|
|
538
|
+
} & {
|
|
539
|
+
forceMount?: boolean;
|
|
540
|
+
}): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
541
|
+
displayName: string;
|
|
542
|
+
};
|
|
543
|
+
Retry: {
|
|
544
|
+
({ render, forceMount, ...props }: Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children"> & {
|
|
545
|
+
render?: RenderProp<import("@uploadcn/core").UploadItem<unknown>> | undefined;
|
|
546
|
+
children?: React.ReactNode;
|
|
547
|
+
} & {
|
|
548
|
+
forceMount?: boolean;
|
|
549
|
+
}): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
550
|
+
displayName: string;
|
|
551
|
+
};
|
|
552
|
+
Pause: {
|
|
553
|
+
({ render, forceMount, ...props }: Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children"> & {
|
|
554
|
+
render?: RenderProp<import("@uploadcn/core").UploadItem<unknown>> | undefined;
|
|
555
|
+
children?: React.ReactNode;
|
|
556
|
+
} & {
|
|
557
|
+
forceMount?: boolean;
|
|
558
|
+
}): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
559
|
+
displayName: string;
|
|
560
|
+
};
|
|
561
|
+
Resume: {
|
|
562
|
+
({ render, forceMount, ...props }: Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children"> & {
|
|
563
|
+
render?: RenderProp<import("@uploadcn/core").UploadItem<unknown>> | undefined;
|
|
564
|
+
children?: React.ReactNode;
|
|
565
|
+
} & {
|
|
566
|
+
forceMount?: boolean;
|
|
567
|
+
}): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
568
|
+
displayName: string;
|
|
569
|
+
};
|
|
570
|
+
Empty: typeof UploadEmpty;
|
|
571
|
+
Start: typeof UploadStart;
|
|
572
|
+
Clear: typeof UploadClear;
|
|
573
|
+
};
|
|
574
|
+
//#endregion
|
|
575
|
+
export type { CompressionStats, DropzoneHandlers, DropzoneState, ImageCropState, PreviewKind, RenderProp, UploadConfig, UploadContextValue, UploadDropzoneProps, UploadDropzoneState, UploadItemProps, UploadListProps, UploadMessages, UploadPreviewProps, UploadProgressProps, UploadProgressState, UploadRootProps, UploadRootState, UploadSizeProps, UploadTriggerProps, UploaderCallbacks, UseDropzoneOptions, UseFilePreviewOptions, UseImageCropOptions, UsePasteFilesOptions, UseUploadGuardOptions, UseUploadReturn, UseUploaderOptions, UseWindowDropOptions };
|
|
576
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["React","UploadStatus","UploadError","React","React","React","React","React","_$__render0.RenderProp"],"sources":["../src/render.ts","../src/messages.ts","../src/use-uploader.ts","../src/primitives.tsx","../src/context.ts","../src/use-upload.ts","../src/use-upload-selector.ts","../src/use-dropzone.ts","../src/use-window-drop.ts","../src/use-paste-files.ts","../src/use-file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