@dimah-s3/ui 1.7.1 → 2.0.0-beta.0
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/README.md +73 -16
- package/css/shadcn.css +57 -23
- package/dist/components/dimah-s3/attachment/circle-progress.d.ts +14 -5
- package/dist/components/dimah-s3/attachment/circle-progress.d.ts.map +1 -1
- package/dist/components/dimah-s3/attachment/dismiss-attachment-action.d.ts +6 -2
- package/dist/components/dimah-s3/attachment/dismiss-attachment-action.d.ts.map +1 -1
- package/dist/components/dimah-s3/attachment/file-attachment.d.ts +33 -18
- package/dist/components/dimah-s3/attachment/file-attachment.d.ts.map +1 -1
- package/dist/components/dimah-s3/attachment/file-name.d.ts +18 -0
- package/dist/components/dimah-s3/attachment/file-name.d.ts.map +1 -0
- package/dist/{lib/file-type-icon.d.ts → components/dimah-s3/attachment/file-type-glyph.d.ts} +5 -11
- package/dist/components/dimah-s3/attachment/file-type-glyph.d.ts.map +1 -0
- package/dist/components/dimah-s3/attachment/folder-glyph.d.ts +9 -0
- package/dist/components/dimah-s3/attachment/folder-glyph.d.ts.map +1 -0
- package/dist/components/dimah-s3/attachment/status-attachment.d.ts +9 -11
- package/dist/components/dimah-s3/attachment/status-attachment.d.ts.map +1 -1
- package/dist/components/dimah-s3/delete/delete-confirm-dialog.d.ts +20 -0
- package/dist/components/dimah-s3/delete/delete-confirm-dialog.d.ts.map +1 -0
- package/dist/components/dimah-s3/delete/delete-toasts.d.ts +34 -0
- package/dist/components/dimah-s3/delete/delete-toasts.d.ts.map +1 -0
- package/dist/components/dimah-s3/delete/delete-trigger.d.ts +18 -0
- package/dist/components/dimah-s3/delete/delete-trigger.d.ts.map +1 -0
- package/dist/components/dimah-s3/delete/delete.d.ts +83 -0
- package/dist/components/dimah-s3/delete/delete.d.ts.map +1 -0
- package/dist/components/dimah-s3/download/download-progress.d.ts +16 -0
- package/dist/components/dimah-s3/download/download-progress.d.ts.map +1 -0
- package/dist/components/dimah-s3/download/download-toasts.d.ts +25 -0
- package/dist/components/dimah-s3/download/download-toasts.d.ts.map +1 -0
- package/dist/components/dimah-s3/download/download-trigger.d.ts +32 -0
- package/dist/components/dimah-s3/download/download-trigger.d.ts.map +1 -0
- package/dist/components/dimah-s3/download/download.d.ts +30 -0
- package/dist/components/dimah-s3/download/download.d.ts.map +1 -0
- package/dist/components/dimah-s3/list/object-list-breadcrumb.d.ts +6 -5
- package/dist/components/dimah-s3/list/object-list-breadcrumb.d.ts.map +1 -1
- package/dist/components/dimah-s3/list/object-list-content.d.ts +8 -0
- package/dist/components/dimah-s3/list/object-list-content.d.ts.map +1 -0
- package/dist/components/dimah-s3/list/object-list-context.d.ts +76 -0
- package/dist/components/dimah-s3/list/object-list-context.d.ts.map +1 -0
- package/dist/components/dimah-s3/list/object-list-controls.d.ts +46 -0
- package/dist/components/dimah-s3/list/object-list-controls.d.ts.map +1 -0
- package/dist/components/dimah-s3/list/object-list-entry.d.ts +28 -0
- package/dist/components/dimah-s3/list/object-list-entry.d.ts.map +1 -0
- package/dist/components/dimah-s3/list/object-list-feedback.d.ts +26 -0
- package/dist/components/dimah-s3/list/object-list-feedback.d.ts.map +1 -0
- package/dist/components/dimah-s3/list/object-list-header.d.ts +81 -0
- package/dist/components/dimah-s3/list/object-list-header.d.ts.map +1 -0
- package/dist/components/dimah-s3/list/object-list-item-menu.d.ts +65 -0
- package/dist/components/dimah-s3/list/object-list-item-menu.d.ts.map +1 -0
- package/dist/components/dimah-s3/list/object-list-keyboard.d.ts +21 -0
- package/dist/components/dimah-s3/list/object-list-keyboard.d.ts.map +1 -0
- package/dist/components/dimah-s3/list/object-list-states.d.ts +25 -11
- package/dist/components/dimah-s3/list/object-list-states.d.ts.map +1 -1
- package/dist/components/dimah-s3/list/object-list-upload.d.ts +29 -6
- package/dist/components/dimah-s3/list/object-list-upload.d.ts.map +1 -1
- package/dist/components/dimah-s3/list/object-list-usage.d.ts +8 -6
- package/dist/components/dimah-s3/list/object-list-usage.d.ts.map +1 -1
- package/dist/components/dimah-s3/list/object-list.d.ts +78 -137
- package/dist/components/dimah-s3/list/object-list.d.ts.map +1 -1
- package/dist/components/dimah-s3/preview/object-card.d.ts +38 -0
- package/dist/components/dimah-s3/preview/object-card.d.ts.map +1 -0
- package/dist/components/dimah-s3/preview/object-image.d.ts +30 -0
- package/dist/components/dimah-s3/preview/object-image.d.ts.map +1 -0
- package/dist/components/dimah-s3/upload/avatar-upload.d.ts +47 -0
- package/dist/components/dimah-s3/upload/avatar-upload.d.ts.map +1 -0
- package/dist/components/dimah-s3/upload/upload-dropzone.d.ts +48 -25
- package/dist/components/dimah-s3/upload/upload-dropzone.d.ts.map +1 -1
- package/dist/components/dimah-s3/upload/upload-field.d.ts +96 -0
- package/dist/components/dimah-s3/upload/upload-field.d.ts.map +1 -0
- package/dist/components/dimah-s3/upload/upload-file-list.d.ts +34 -0
- package/dist/components/dimah-s3/upload/upload-file-list.d.ts.map +1 -0
- package/dist/components/dimah-s3/upload/upload-status.d.ts +25 -20
- package/dist/components/dimah-s3/upload/upload-status.d.ts.map +1 -1
- package/dist/components/dimah-s3/upload/upload-toasts.d.ts +23 -0
- package/dist/components/dimah-s3/upload/upload-toasts.d.ts.map +1 -0
- package/dist/components/dimah-s3/upload/upload-trigger.d.ts +23 -0
- package/dist/components/dimah-s3/upload/upload-trigger.d.ts.map +1 -0
- package/dist/components/dimah-s3/upload/upload.d.ts +79 -0
- package/dist/components/dimah-s3/upload/upload.d.ts.map +1 -0
- package/dist/hooks/use-file-preview.d.ts +7 -0
- package/dist/hooks/use-file-preview.d.ts.map +1 -0
- package/dist/hooks/use-own-drag.d.ts +17 -0
- package/dist/hooks/use-own-drag.d.ts.map +1 -0
- package/dist/hooks/use-paste-files.d.ts +18 -0
- package/dist/hooks/use-paste-files.d.ts.map +1 -0
- package/dist/hooks/use-toast-owner.d.ts +16 -0
- package/dist/hooks/use-toast-owner.d.ts.map +1 -0
- package/dist/index.d.ts +39 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4226 -2676
- package/dist/index.js.map +1 -1
- package/dist/lib/attachment-layout.d.ts +3 -33
- package/dist/lib/attachment-layout.d.ts.map +1 -1
- package/dist/lib/format-expires-in.d.ts +2 -2
- package/dist/lib/format-expires-in.d.ts.map +1 -1
- package/dist/lib/is-field-target.d.ts +6 -0
- package/dist/lib/is-field-target.d.ts.map +1 -0
- package/dist/lib/upload-hints.d.ts +16 -0
- package/dist/lib/upload-hints.d.ts.map +1 -0
- package/package.json +24 -13
- package/styles.css +4 -3
- package/dist/components/dimah-s3/delete/delete-button.d.ts +0 -43
- package/dist/components/dimah-s3/delete/delete-button.d.ts.map +0 -1
- package/dist/components/dimah-s3/download/download-button.d.ts +0 -39
- package/dist/components/dimah-s3/download/download-button.d.ts.map +0 -1
- package/dist/components/dimah-s3/download/progress-download-button.d.ts +0 -44
- package/dist/components/dimah-s3/download/progress-download-button.d.ts.map +0 -1
- package/dist/components/dimah-s3/list/object-list-menu.d.ts +0 -65
- package/dist/components/dimah-s3/list/object-list-menu.d.ts.map +0 -1
- package/dist/components/dimah-s3/list/object-list-rows.d.ts +0 -32
- package/dist/components/dimah-s3/list/object-list-rows.d.ts.map +0 -1
- package/dist/components/dimah-s3/list/object-list-selection-state.d.ts +0 -38
- package/dist/components/dimah-s3/list/object-list-selection-state.d.ts.map +0 -1
- package/dist/components/dimah-s3/list/object-list-selection.d.ts +0 -36
- package/dist/components/dimah-s3/list/object-list-selection.d.ts.map +0 -1
- package/dist/components/dimah-s3/upload/multi-upload-status.d.ts +0 -8
- package/dist/components/dimah-s3/upload/multi-upload-status.d.ts.map +0 -1
- package/dist/components/dimah-s3/upload/upload-button.d.ts +0 -32
- package/dist/components/dimah-s3/upload/upload-button.d.ts.map +0 -1
- package/dist/hooks/use-delete-toast.d.ts +0 -12
- package/dist/hooks/use-delete-toast.d.ts.map +0 -1
- package/dist/hooks/use-delete-ui.d.ts +0 -16
- package/dist/hooks/use-delete-ui.d.ts.map +0 -1
- package/dist/hooks/use-download-toast.d.ts +0 -17
- package/dist/hooks/use-download-toast.d.ts.map +0 -1
- package/dist/hooks/use-download-ui.d.ts +0 -19
- package/dist/hooks/use-download-ui.d.ts.map +0 -1
- package/dist/hooks/use-file-reject-toast.d.ts +0 -7
- package/dist/hooks/use-file-reject-toast.d.ts.map +0 -1
- package/dist/hooks/use-upload-toast.d.ts +0 -7
- package/dist/hooks/use-upload-toast.d.ts.map +0 -1
- package/dist/hooks/use-upload-ui.d.ts +0 -13
- package/dist/hooks/use-upload-ui.d.ts.map +0 -1
- package/dist/lib/file-type-icon.d.ts.map +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import type { UseUploadReturn } from "@dimah-s3/react";
|
|
3
|
+
/** Props for {@link UploadField}. */
|
|
4
|
+
export type UploadFieldProps = {
|
|
5
|
+
/** The `useUpload` return whose uploads fill the field. */
|
|
6
|
+
upload: UseUploadReturn;
|
|
7
|
+
/** Form field name. Each key submits as its own hidden input. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Object keys, when you control the value. */
|
|
10
|
+
value?: readonly string[];
|
|
11
|
+
/** Object keys to start with, when the field keeps its own value. */
|
|
12
|
+
defaultValue?: readonly string[];
|
|
13
|
+
/** Runs with the new keys after an upload adds one or `remove` drops one. */
|
|
14
|
+
onValueChange?: (keys: string[]) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Most keys the field holds. Each call takes only the files that still
|
|
17
|
+
* fit, counting files still in flight. A full field takes no files.
|
|
18
|
+
*/
|
|
19
|
+
maxFiles?: number;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
/** One key of the field value, with what is known about its file. */
|
|
23
|
+
export type UploadFieldItem = {
|
|
24
|
+
key: string;
|
|
25
|
+
/** The uploaded file's name, or the last segment of the key. */
|
|
26
|
+
fileName: string;
|
|
27
|
+
/** Verified size in bytes, or `null` for keys the field did not upload. */
|
|
28
|
+
fileSize: number | null;
|
|
29
|
+
contentType: string | null;
|
|
30
|
+
/** The uploaded `File`, for a thumbnail, or `null` for keys the field did not upload. */
|
|
31
|
+
file: File | null;
|
|
32
|
+
};
|
|
33
|
+
/** What {@link UploadField} shares with its parts. */
|
|
34
|
+
export type UploadFieldContextValue = {
|
|
35
|
+
name: string;
|
|
36
|
+
value: readonly string[];
|
|
37
|
+
/** `value` with file details, in the same order. */
|
|
38
|
+
items: readonly UploadFieldItem[];
|
|
39
|
+
/** Files that still fit, counting files in flight, or `null` without `maxFiles`. */
|
|
40
|
+
remaining: number | null;
|
|
41
|
+
/** Drops `key` from the value. The stored object is kept. */
|
|
42
|
+
remove: (key: string) => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Form field whose value is the keys of the files uploaded through it.
|
|
46
|
+
*
|
|
47
|
+
* Each file that uploads successfully adds its key, so the value grows
|
|
48
|
+
* across calls even though the hook replaces its queue. Files that fail,
|
|
49
|
+
* are cancelled or are still in flight add nothing, and files that
|
|
50
|
+
* uploaded before the field mounted are left out. Every key renders as a
|
|
51
|
+
* hidden `<input name={name}>`, so the field submits with its form.
|
|
52
|
+
*
|
|
53
|
+
* Without `value`, a reset of its form (including React 19's automatic
|
|
54
|
+
* reset after a `<form action>`) restores `defaultValue` and reports it
|
|
55
|
+
* through `onValueChange`. Files that already uploaded are not added back;
|
|
56
|
+
* call `upload.reset()` to clear the status list too. With `value`, reset
|
|
57
|
+
* the value yourself.
|
|
58
|
+
*
|
|
59
|
+
* It wraps its children in `Upload`, so `UploadTrigger`, `UploadDropzone`
|
|
60
|
+
* and `UploadStatus` work inside it. A file moves from the status to the
|
|
61
|
+
* value once it uploads, so it never shows twice: the status keeps only
|
|
62
|
+
* files in flight or failed. With `maxFiles`, their calls take at
|
|
63
|
+
* most the files that still fit (files still uploading count), and the hook
|
|
64
|
+
* rejects the rest with `TOO_MANY_FILES`; a retry takes only the failed
|
|
65
|
+
* files that still fit. Once the field is full, its trigger and dropzone
|
|
66
|
+
* stay focusable but are `aria-disabled`, and the picker, drops, pastes and
|
|
67
|
+
* retries do nothing.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* const upload = useUpload({ route: "attachments", maxFiles: 5 });
|
|
72
|
+
*
|
|
73
|
+
* <form action={save}>
|
|
74
|
+
* <UploadField upload={upload} name="attachments" maxFiles={5}>
|
|
75
|
+
* <UploadDropzone />
|
|
76
|
+
* <UploadStatus />
|
|
77
|
+
* <UploadFieldValue />
|
|
78
|
+
* </UploadField>
|
|
79
|
+
* </form>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function UploadField({ upload, name, value: controlledValue, defaultValue, onValueChange, maxFiles, children, }: UploadFieldProps): import("react").JSX.Element;
|
|
83
|
+
/** The nearest {@link UploadField}. Use it to build your own parts. */
|
|
84
|
+
export declare function useUploadFieldContext(): UploadFieldContextValue;
|
|
85
|
+
/** Props for {@link UploadFieldValue}. Other props go to the `<ul>`. */
|
|
86
|
+
export type UploadFieldValueProps = Omit<ComponentProps<"ul">, "children"> & {
|
|
87
|
+
/** Renders one key. Defaults to a file card with a remove action. */
|
|
88
|
+
children?: (item: UploadFieldItem) => ReactNode;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The keys of the nearest `UploadField`, in order, each with a remove
|
|
92
|
+
* action and a thumbnail for images the field uploaded. Renders nothing
|
|
93
|
+
* while the value is empty.
|
|
94
|
+
*/
|
|
95
|
+
export declare function UploadFieldValue({ children, className, ...props }: UploadFieldValueProps): import("react").JSX.Element | null;
|
|
96
|
+
//# sourceMappingURL=upload-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-field.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-field.tsx"],"names":[],"mappings":"AAEA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA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EAAE,eAAe,EACtB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,QAAQ,GACT,EAAE,gBAAgB,+BA+GlB;AAED,uEAAuE;AACvE,wBAAgB,qBAAqB,IAAI,uBAAuB,CAQ/D;AAED,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,GAAG;IAC3E,qEAAqE;IACrE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,SAAS,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,qBAAqB,sCAiBvB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import type { UploadFileState } from "@dimah-s3/react";
|
|
3
|
+
import { type FileAttachmentProps } from "../attachment/file-attachment.js";
|
|
4
|
+
/** Props for {@link UploadFileItem}. Other props go to `FileAttachment`. */
|
|
5
|
+
export type UploadFileItemProps = Omit<FileAttachmentProps, "state" | "fileName" | "fileSize" | "contentType" | "previewUrl" | "percent" | "error" | "onCancel" | "onRetry"> & {
|
|
6
|
+
/** One entry of `upload.files`. */
|
|
7
|
+
file: UploadFileState;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Card for one file of the nearest `Upload`: its phase, progress and
|
|
11
|
+
* error, with a cancel action while it is queued or in flight and a retry
|
|
12
|
+
* action once it failed. A cancelled file leaves the queue, so focus moves
|
|
13
|
+
* on to the next action; a retried one keeps focus on its cancel action.
|
|
14
|
+
*/
|
|
15
|
+
export declare function UploadFileItem({ file, description, ...props }: UploadFileItemProps): import("react").JSX.Element;
|
|
16
|
+
/** How {@link UploadFileList} lays out its files. */
|
|
17
|
+
export type UploadFileListLayout = "list" | "grid";
|
|
18
|
+
/** Props for {@link UploadFileList}. Other props go to the `<ul>`. */
|
|
19
|
+
export type UploadFileListProps = Omit<ComponentProps<"ul">, "children"> & {
|
|
20
|
+
/**
|
|
21
|
+
* `list` stacks full-width rows. `grid` wraps tiles with the preview
|
|
22
|
+
* above the name, for images. @default "list"
|
|
23
|
+
*/
|
|
24
|
+
layout?: UploadFileListLayout;
|
|
25
|
+
/** Renders one file. Defaults to {@link UploadFileItem}. */
|
|
26
|
+
children?: (file: UploadFileState) => ReactNode;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Every file of the nearest `Upload`, in queue order. Renders nothing
|
|
30
|
+
* while the queue is empty. Inside an `UploadField` (a root with
|
|
31
|
+
* `hideUploaded`), files that uploaded are left out. It sets `data-layout`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function UploadFileList({ layout, children, className, ...props }: UploadFileListProps): import("react").JSX.Element | null;
|
|
34
|
+
//# sourceMappingURL=upload-file-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-file-list.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-file-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAmB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,kDAAkD,CAAC;AAO1D,4EAA4E;AAC5E,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,mBAAmB,EACjB,OAAO,GACP,UAAU,GACV,UAAU,GACV,aAAa,GACb,YAAY,GACZ,SAAS,GACT,OAAO,GACP,UAAU,GACV,SAAS,CACZ,GAAG;IACF,mCAAmC;IACnC,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,WAAW,EACX,GAAG,KAAK,EACT,EAAE,mBAAmB,+BAmCrB;AAED,qDAAqD;AACrD,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,GAAG;IACzE;;;OAGG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,SAAS,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAe,EACf,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,mBAAmB,sCA2BrB"}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
onCancel?: () => void;
|
|
8
|
-
/** When set (typically with an `uploadStore`), shows a pause control. */
|
|
9
|
-
onPause?: () => void;
|
|
10
|
-
/** Clears a completed or failed row. Typically `upload.reset`. */
|
|
11
|
-
onDismiss?: () => void;
|
|
12
|
-
className?: string;
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { type UploadFileListLayout } from "./upload-file-list.js";
|
|
3
|
+
/** Props for {@link UploadStatus}. Other props go to the wrapper `<div>`. */
|
|
4
|
+
export type UploadStatusProps = Omit<ComponentProps<"div">, "children"> & {
|
|
5
|
+
/** Layout of the files, as on `UploadFileList`. @default "list" */
|
|
6
|
+
layout?: UploadFileListLayout;
|
|
13
7
|
};
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Status of the nearest `Upload` queue. Renders nothing while it is idle.
|
|
10
|
+
*
|
|
11
|
+
* One file shows as its own card. Several files show as one card: a summary
|
|
12
|
+
* header with the overall progress ring, the count and the time left (or
|
|
13
|
+
* the result once they settle), above a row for each file. The rows scroll
|
|
14
|
+
* past 20rem. While files upload the summary offers "Cancel all uploads",
|
|
15
|
+
* and pause when the hook has an `uploadStore` so the uploads can resume;
|
|
16
|
+
* settled, it offers dismiss, and "Retry failed uploads" when files failed.
|
|
17
|
+
* A failed file has its own retry action. With `layout="grid"` the files
|
|
18
|
+
* show as tiles under the summary, also for one file.
|
|
19
|
+
*
|
|
20
|
+
* Inside an `UploadField` (a root with `hideUploaded`), files that uploaded
|
|
21
|
+
* leave the status, since the field's value lists them. When cancel, pause
|
|
22
|
+
* or dismiss removes the card that has focus, focus moves to the next
|
|
23
|
+
* action, else to the root's trigger or dropzone. It sets `data-phase` to
|
|
24
|
+
* the hook's phase.
|
|
25
|
+
*/
|
|
26
|
+
export declare function UploadStatus({ layout, className, ...props }: UploadStatusProps): import("react").JSX.Element | null;
|
|
22
27
|
//# sourceMappingURL=upload-status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-status.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-status.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload-status.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-status.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,OAAO,CAAC;AAiBvD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,+CAA+C,CAAC;AAEvD,6EAA6E;AAC7E,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACxE,mEAAmE;IACnE,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B,CAAC;AAKF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,iBAAiB,sCAqEnB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { UseUploadReturn } from "@dimah-s3/react";
|
|
2
|
+
/** Props for {@link UploadToasts}. */
|
|
3
|
+
export type UploadToastsProps = {
|
|
4
|
+
/** The `useUpload` return to report on. */
|
|
5
|
+
upload: UseUploadReturn;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Toasts for a `useUpload` hook: progress with a cancel action while files
|
|
9
|
+
* upload, the result once they settle, and the files it rejected. Mount it
|
|
10
|
+
* once per hook, next to one `<Toaster />`. It renders nothing.
|
|
11
|
+
*
|
|
12
|
+
* Only one owner reports per hook: a second `UploadToasts` for the same
|
|
13
|
+
* hook stays silent and warns in development, and the `ObjectList`
|
|
14
|
+
* built-in toasts step aside for it. Its progress toast closes when it
|
|
15
|
+
* unmounts.
|
|
16
|
+
*/
|
|
17
|
+
export declare function UploadToasts({ upload }: UploadToastsProps): import("react").JSX.Element | null;
|
|
18
|
+
/**
|
|
19
|
+
* Weak owner for `ObjectList`: it shows the same toasts only while no
|
|
20
|
+
* {@link UploadToasts} is mounted for the hook. @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function BuiltInUploadToasts({ upload }: UploadToastsProps): import("react").JSX.Element | null;
|
|
23
|
+
//# sourceMappingURL=upload-toasts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-toasts.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-toasts.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIxE,sCAAsC;AACtC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2CAA2C;IAC3C,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,iBAAiB,sCAGzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAAE,iBAAiB,sCAGhE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import type { UploadCallOptions } from "@dimah-s3/react";
|
|
3
|
+
import { Button } from "../../ui/button.js";
|
|
4
|
+
/** Props for {@link UploadTrigger}. Every `Button` prop is forwarded, `render` too. */
|
|
5
|
+
export type UploadTriggerProps = ComponentProps<typeof Button> & {
|
|
6
|
+
/** Call options for the picked files. */
|
|
7
|
+
call?: UploadCallOptions;
|
|
8
|
+
/** Shown in a tooltip on hover and focus. */
|
|
9
|
+
tooltip?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Button that opens the file picker of the nearest `Upload`. Render it
|
|
13
|
+
* inside `<Upload>`.
|
|
14
|
+
*
|
|
15
|
+
* The default content is an icon and "Upload file" (or "Upload files" when
|
|
16
|
+
* the hook takes more than one). An `onClick` that prevents the default
|
|
17
|
+
* keeps the picker closed. It is disabled while the hook is
|
|
18
|
+
* (`upload.disabled`); a `disabled` prop replaces that default, but the
|
|
19
|
+
* picker stays closed while the hook is disabled. While the root is full, as
|
|
20
|
+
* in a full `UploadField`, it stays focusable but is `aria-disabled`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function UploadTrigger({ call, tooltip, disabled, focusableWhenDisabled, className, children, onClick, ...props }: UploadTriggerProps): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=upload-trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-trigger.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAYhD,uFAAuF;AACvF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IAC/D,yCAAyC;IACzC,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,GAAG,KAAK,EACT,EAAE,kBAAkB,+BAgDpB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { UploadCallOptions, UseUploadReturn } from "@dimah-s3/react";
|
|
3
|
+
/** Props for {@link Upload}. */
|
|
4
|
+
export type UploadProps = {
|
|
5
|
+
/** The `useUpload` return its parts read. */
|
|
6
|
+
upload: UseUploadReturn;
|
|
7
|
+
/**
|
|
8
|
+
* Marks the root as full: `UploadTrigger` and `UploadDropzone` stay
|
|
9
|
+
* focusable but are `aria-disabled`. It only changes how they render, so
|
|
10
|
+
* `upload` must take no files itself. `UploadField` sets it, with a capped
|
|
11
|
+
* `upload`, once it is full. @default false
|
|
12
|
+
*/
|
|
13
|
+
isFull?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Leaves files that uploaded out of `UploadStatus` and `UploadFileList`,
|
|
16
|
+
* which then show only files in flight or failed. `UploadField` sets it,
|
|
17
|
+
* since its value lists those files. @default false
|
|
18
|
+
*/
|
|
19
|
+
hideUploaded?: boolean;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
/** What {@link Upload} shares with its parts. */
|
|
23
|
+
export type UploadContextValue = {
|
|
24
|
+
upload: UseUploadReturn;
|
|
25
|
+
/** The root takes no more files, as in a full `UploadField`. Parts render `aria-disabled`. */
|
|
26
|
+
isFull: boolean;
|
|
27
|
+
/** Status parts leave out files that uploaded, as in an `UploadField`. */
|
|
28
|
+
hideUploaded: boolean;
|
|
29
|
+
};
|
|
30
|
+
/** Set on `UploadTrigger` and `UploadDropzone` to the id of their root. */
|
|
31
|
+
declare const INTAKE_ATTRIBUTE = "data-dimah-s3-upload-intake";
|
|
32
|
+
/** Focus handling the root shares with its parts. */
|
|
33
|
+
type UploadFocusValue = {
|
|
34
|
+
/** Marks a picker or drop element of this root, a place focus can go. */
|
|
35
|
+
intakeProps: {
|
|
36
|
+
[INTAKE_ATTRIBUTE]: string;
|
|
37
|
+
};
|
|
38
|
+
/** Call before an action that may remove the focused element. */
|
|
39
|
+
keepFocus: () => void;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Root of the upload family. It shares `upload` with `UploadTrigger`,
|
|
43
|
+
* `UploadDropzone`, `UploadStatus` and `UploadFileList`, and renders the
|
|
44
|
+
* hidden file input they open. It adds no element of its own.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* const upload = useUpload({ route: "avatars" });
|
|
49
|
+
*
|
|
50
|
+
* <Upload upload={upload}>
|
|
51
|
+
* <UploadTrigger />
|
|
52
|
+
* <UploadStatus />
|
|
53
|
+
* </Upload>
|
|
54
|
+
* <UploadToasts upload={upload} />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function Upload({ upload, isFull, hideUploaded, children, }: UploadProps): import("react").JSX.Element;
|
|
58
|
+
/** The `upload` of the nearest {@link Upload}. Use it to build your own parts. */
|
|
59
|
+
export declare function useUploadContext(): UploadContextValue;
|
|
60
|
+
/**
|
|
61
|
+
* Focus handling of the nearest {@link Upload}: `intakeProps` for a picker
|
|
62
|
+
* or drop element, and `keepFocus` to call before an action that removes
|
|
63
|
+
* the element it is on. Focus then moves to the next action in the same
|
|
64
|
+
* status or list, else the previous one, else the root's trigger or
|
|
65
|
+
* dropzone, else the nearest `[data-dimah-s3-focus-root]`. @internal
|
|
66
|
+
*/
|
|
67
|
+
export declare function useUploadFocus(): UploadFocusValue;
|
|
68
|
+
/**
|
|
69
|
+
* Call options for files taken in by an upload part.
|
|
70
|
+
*
|
|
71
|
+
* Inside an `ObjectList` whose `upload` is this same hook (by
|
|
72
|
+
* `instanceId`, so a capped copy from `UploadField` counts), the source's
|
|
73
|
+
* `uploadOptions` for the open folder apply first, so files land in that
|
|
74
|
+
* folder. `call` merges over them: its fields win, and `metadata` merges
|
|
75
|
+
* key by key.
|
|
76
|
+
*/
|
|
77
|
+
export declare function useUploadCall(upload: UseUploadReturn, call: UploadCallOptions | undefined): UploadCallOptions | undefined;
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,iBAAiB,EAEjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAIzB,gCAAgC;AAChC,MAAM,MAAM,WAAW,GAAG;IACxB,6CAA6C;IAC7C,MAAM,EAAE,eAAe,CAAC;IACxB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,eAAe,CAAC;IACxB,8FAA8F;IAC9F,MAAM,EAAE,OAAO,CAAC;IAChB,0EAA0E;IAC1E,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAIF,2EAA2E;AAC3E,QAAA,MAAM,gBAAgB,gCAAgC,CAAC;AAEvD,qDAAqD;AACrD,KAAK,gBAAgB,GAAG;IACtB,yEAAyE;IACzE,WAAW,EAAE;QAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,iEAAiE;IACjE,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAmBF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,MAAc,EACd,YAAoB,EACpB,QAAQ,GACT,EAAE,WAAW,+BAqCb;AAED,kFAAkF;AAClF,wBAAgB,gBAAgB,IAAI,kBAAkB,CAQrD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,gBAAgB,CAQjD;AA+DD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAClC,iBAAiB,GAAG,SAAS,CAO/B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object URL of an image `file` for a thumbnail, or `null` for other files
|
|
3
|
+
* and while `file` is `null`. The URL is revoked once no mounted component
|
|
4
|
+
* uses it, a tick later, so a remount (as under StrictMode) keeps it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useFilePreview(file: File | null): string | null;
|
|
7
|
+
//# sourceMappingURL=use-file-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-file-preview.d.ts","sourceRoot":"","sources":["../../src/hooks/use-file-preview.ts"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAqB/D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type DragEvent } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Whether files are dragged over this element, from its own drag events.
|
|
4
|
+
*
|
|
5
|
+
* A hook's `isDragActive` is true while files are over any of its drop
|
|
6
|
+
* targets. Gate on `over` so only the target under the pointer shows and
|
|
7
|
+
* announces the drag. Wire `enter`, `leave` and `end` to the element's
|
|
8
|
+
* `onDragEnter`, `onDragLeave` and `onDrop`. Children fire their own enter
|
|
9
|
+
* and leave, so it counts the entered nodes.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useOwnDrag(): {
|
|
12
|
+
over: boolean;
|
|
13
|
+
enter(event: DragEvent<HTMLElement>): void;
|
|
14
|
+
leave(event: DragEvent<HTMLElement>): void;
|
|
15
|
+
end(): void;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=use-own-drag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-own-drag.d.ts","sourceRoot":"","sources":["../../src/hooks/use-own-drag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD;;;;;;;;GAQG;AACH,wBAAgB,UAAU;;iBAMT,SAAS,CAAC,WAAW,CAAC;iBAKtB,SAAS,CAAC,WAAW,CAAC;;EAStC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UploadCallOptions, UseUploadReturn } from "@dimah-s3/react";
|
|
2
|
+
/** Options for {@link usePasteFiles}. */
|
|
3
|
+
export type UsePasteFilesOptions = {
|
|
4
|
+
/** Call options for the pasted files. */
|
|
5
|
+
call?: UploadCallOptions;
|
|
6
|
+
/** Also off while `upload.disabled` is set. @default true */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Uploads files pasted anywhere on the page with `upload.handleFiles`.
|
|
11
|
+
*
|
|
12
|
+
* Pastes into a form field or editable text are left alone, and so are
|
|
13
|
+
* pastes another handler already took, such as a focused `UploadDropzone`
|
|
14
|
+
* (it prevents the default). A paste with no files is ignored. It listens
|
|
15
|
+
* only while `enabled` is on and the hook is not `disabled`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function usePasteFiles(upload: Pick<UseUploadReturn, "handleFiles" | "disabled">, options?: UsePasteFilesOptions): void;
|
|
18
|
+
//# sourceMappingURL=use-paste-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-paste-files.d.ts","sourceRoot":"","sources":["../../src/hooks/use-paste-files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAG1E,yCAAyC;AACzC,MAAM,MAAM,oBAAoB,GAAG;IACjC,yCAAyC;IACzC,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,aAAa,GAAG,UAAU,CAAC,EACzD,OAAO,GAAE,oBAAyB,GACjC,IAAI,CAsBN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers a toast owner for a hook instance (`instanceId` from the hook)
|
|
3
|
+
* and returns whether this owner is the active one. Only the active owner
|
|
4
|
+
* shows toasts and live messages, so they are never duplicated.
|
|
5
|
+
*
|
|
6
|
+
* - Strong (default): the first mounted strong owner is active. Extra strong
|
|
7
|
+
* owners render nothing and warn in development.
|
|
8
|
+
* - Weak (ObjectList built-ins): active only while no strong owner is
|
|
9
|
+
* mounted for the same hook.
|
|
10
|
+
*
|
|
11
|
+
* Returns `false` on the server and until the owner has mounted.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useToastOwner(instanceId: string, options?: {
|
|
14
|
+
weak?: boolean;
|
|
15
|
+
}): boolean;
|
|
16
|
+
//# sourceMappingURL=use-toast-owner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-toast-owner.d.ts","sourceRoot":"","sources":["../../src/hooks/use-toast-owner.ts"],"names":[],"mappings":"AA6DA;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,OAAO,CAcT"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,43 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
1
|
+
export { Upload, useUploadContext, type UploadProps, type UploadContextValue, } from "./components/dimah-s3/upload/upload.js";
|
|
2
|
+
export { UploadTrigger, type UploadTriggerProps, } from "./components/dimah-s3/upload/upload-trigger.js";
|
|
3
|
+
export { UploadDropzone, UploadDropzoneTrigger, type UploadDropzoneProps, type UploadDropzoneTriggerProps, } from "./components/dimah-s3/upload/upload-dropzone.js";
|
|
4
|
+
export { UploadStatus, type UploadStatusProps, } from "./components/dimah-s3/upload/upload-status.js";
|
|
5
|
+
export { UploadFileList, UploadFileItem, type UploadFileListLayout, type UploadFileListProps, type UploadFileItemProps, } from "./components/dimah-s3/upload/upload-file-list.js";
|
|
6
|
+
export { useUploadHints, type UploadHints, type UploadHintsPolicy, } from "./lib/upload-hints.js";
|
|
7
|
+
export { UploadToasts, type UploadToastsProps, } from "./components/dimah-s3/upload/upload-toasts.js";
|
|
8
|
+
export { usePasteFiles, type UsePasteFilesOptions, } from "./hooks/use-paste-files.js";
|
|
9
|
+
export { UploadField, UploadFieldValue, useUploadFieldContext, type UploadFieldProps, type UploadFieldValueProps, type UploadFieldItem, type UploadFieldContextValue, } from "./components/dimah-s3/upload/upload-field.js";
|
|
10
|
+
export { AvatarUpload, type AvatarUploadProps, } from "./components/dimah-s3/upload/avatar-upload.js";
|
|
11
|
+
export { ObjectImage, type ObjectImageProps, } from "./components/dimah-s3/preview/object-image.js";
|
|
12
|
+
export { ObjectCard, type ObjectCardProps, } from "./components/dimah-s3/preview/object-card.js";
|
|
13
|
+
export { Download, useDownloadContext, type DownloadProps, type DownloadContextValue, } from "./components/dimah-s3/download/download.js";
|
|
14
|
+
export { DownloadTrigger, type DownloadTriggerProps, } from "./components/dimah-s3/download/download-trigger.js";
|
|
15
|
+
export { DownloadProgress, type DownloadProgressProps, } from "./components/dimah-s3/download/download-progress.js";
|
|
16
|
+
export { DownloadToasts, type DownloadToastsProps, } from "./components/dimah-s3/download/download-toasts.js";
|
|
17
|
+
export { Delete, useDeleteContext, type DeleteProps, type DeleteContextValue, type DeleteTarget, type DeleteRequestOptions, } from "./components/dimah-s3/delete/delete.js";
|
|
18
|
+
export { DeleteTrigger, type DeleteTriggerProps, } from "./components/dimah-s3/delete/delete-trigger.js";
|
|
19
|
+
export { DeleteConfirmDialog, type DeleteConfirmDialogProps, } from "./components/dimah-s3/delete/delete-confirm-dialog.js";
|
|
20
|
+
export { DeleteToasts, type DeleteToastsProps, } from "./components/dimah-s3/delete/delete-toasts.js";
|
|
21
|
+
export { ObjectList, type ObjectListProps, } from "./components/dimah-s3/list/object-list.js";
|
|
22
|
+
export { useObjectListContext, useObjectListEntry, type ObjectListContextValue, type ObjectListFeedback, type ObjectListRenderers, type ObjectListView, } from "./components/dimah-s3/list/object-list-context.js";
|
|
23
|
+
export { ObjectListHeader, ObjectListSelectAll, ObjectListSelectionBar, ObjectListBulkDelete, NewFolderControl, type ObjectListHeaderProps, type ObjectListSelectionBarProps, type NewFolderControlProps, } from "./components/dimah-s3/list/object-list-header.js";
|
|
24
|
+
export { ObjectListBreadcrumb } from "./components/dimah-s3/list/object-list-breadcrumb.js";
|
|
25
|
+
export { ObjectListSearch, ObjectListSortMenu, ObjectListViewToggle, type ObjectListSearchProps, type ObjectListSortOption, } from "./components/dimah-s3/list/object-list-controls.js";
|
|
26
|
+
export { ObjectListContent } from "./components/dimah-s3/list/object-list-content.js";
|
|
27
|
+
export { ObjectListRow, ObjectListTile, ObjectListCheckbox, type ObjectListEntryProps, } from "./components/dimah-s3/list/object-list-entry.js";
|
|
28
|
+
export { ObjectListEmpty, type ObjectListEmptyProps, } from "./components/dimah-s3/list/object-list-states.js";
|
|
29
|
+
export { ObjectListUsage } from "./components/dimah-s3/list/object-list-usage.js";
|
|
30
|
+
export { ObjectListUploadStatus } from "./components/dimah-s3/list/object-list-upload.js";
|
|
31
|
+
export { ObjectListItemMenu, type ObjectListMenuAction, type ObjectListItemMenuProps, } from "./components/dimah-s3/list/object-list-item-menu.js";
|
|
10
32
|
export { FileAttachment, type FileAttachmentProps, } from "./components/dimah-s3/attachment/file-attachment.js";
|
|
11
33
|
export { StatusAttachment, type StatusAttachmentProps, } from "./components/dimah-s3/attachment/status-attachment.js";
|
|
12
|
-
export
|
|
13
|
-
export {
|
|
34
|
+
export { CircleProgress, type CircleProgressProps, } from "./components/dimah-s3/attachment/circle-progress.js";
|
|
35
|
+
export { FileName, type FileNameProps, } from "./components/dimah-s3/attachment/file-name.js";
|
|
36
|
+
export { FileTypeGlyph, type FileTypeGlyphProps, } from "./components/dimah-s3/attachment/file-type-glyph.js";
|
|
37
|
+
export { FolderGlyph, type FolderGlyphProps, } from "./components/dimah-s3/attachment/folder-glyph.js";
|
|
38
|
+
export { DismissAttachmentAction, type DismissAttachmentActionProps, } from "./components/dimah-s3/attachment/dismiss-attachment-action.js";
|
|
39
|
+
export { AttachmentGroup, AttachmentAction, AttachmentTrigger, } from "./components/ui/attachment.js";
|
|
40
|
+
export type { AttachmentState } from "./lib/attachment-layout.js";
|
|
14
41
|
export { Toaster, toast } from "./components/ui/toast.js";
|
|
15
|
-
export {
|
|
16
|
-
export { useFileRejectToast } from "./hooks/use-file-reject-toast.js";
|
|
17
|
-
export { useDownloadToast } from "./hooks/use-download-toast.js";
|
|
18
|
-
export { useDeleteToast } from "./hooks/use-delete-toast.js";
|
|
19
|
-
export { useUploadUi } from "./hooks/use-upload-ui.js";
|
|
20
|
-
export { useDownloadUi } from "./hooks/use-download-ui.js";
|
|
21
|
-
export { useDeleteUi } from "./hooks/use-delete-ui.js";
|
|
42
|
+
export { useToastOwner } from "./hooks/use-toast-owner.js";
|
|
22
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,GAChC,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,cAAc,EACd,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,GAC7B,MAAM,2CAA2C,CAAC;AACnD,OAAO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