@dimah-s3/ui 1.1.1 → 1.2.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/dist/components/dimah-s3/delete/delete-button.d.ts +5 -9
- package/dist/components/dimah-s3/delete/delete-button.d.ts.map +1 -1
- package/dist/components/dimah-s3/download/download-button.d.ts +5 -9
- package/dist/components/dimah-s3/download/download-button.d.ts.map +1 -1
- package/dist/components/dimah-s3/download/progress-download-button.d.ts +5 -9
- package/dist/components/dimah-s3/download/progress-download-button.d.ts.map +1 -1
- package/dist/components/dimah-s3/upload/multi-upload-status.d.ts +5 -11
- package/dist/components/dimah-s3/upload/multi-upload-status.d.ts.map +1 -1
- package/dist/components/dimah-s3/upload/upload-button.d.ts +5 -9
- package/dist/components/dimah-s3/upload/upload-button.d.ts.map +1 -1
- package/dist/components/dimah-s3/upload/upload-dropzone.d.ts +5 -9
- package/dist/components/dimah-s3/upload/upload-dropzone.d.ts.map +1 -1
- package/dist/components/dimah-s3/upload/upload-status.d.ts +12 -6
- package/dist/components/dimah-s3/upload/upload-status.d.ts.map +1 -1
- package/dist/hooks/use-delete-toast.d.ts +7 -4
- package/dist/hooks/use-delete-toast.d.ts.map +1 -1
- package/dist/hooks/use-delete-ui.d.ts +16 -0
- package/dist/hooks/use-delete-ui.d.ts.map +1 -0
- package/dist/hooks/use-download-toast.d.ts +9 -13
- package/dist/hooks/use-download-toast.d.ts.map +1 -1
- package/dist/hooks/use-download-ui.d.ts +17 -0
- package/dist/hooks/use-download-ui.d.ts.map +1 -0
- package/dist/hooks/use-upload-toast.d.ts +2 -12
- package/dist/hooks/use-upload-toast.d.ts.map +1 -1
- package/dist/hooks/use-upload-ui.d.ts +13 -0
- package/dist/hooks/use-upload-ui.d.ts.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +558 -831
- package/dist/index.js.map +1 -1
- package/dist/lib/attachment-layout.d.ts +5 -2
- package/dist/lib/attachment-layout.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/components/dimah-s3/upload/upload-status-block.d.ts +0 -23
- package/dist/components/dimah-s3/upload/upload-status-block.d.ts.map +0 -1
- package/dist/components/dimah-s3/upload/upload-wired.d.ts +0 -48
- package/dist/components/dimah-s3/upload/upload-wired.d.ts.map +0 -1
|
@@ -43,6 +43,9 @@ export declare const ATTACHMENT_TITLE_CLASS = "max-w-[48ch] dark:shimmer-color-d
|
|
|
43
43
|
* - `(node) => ReactNode`: wrap or relocate the status node
|
|
44
44
|
*/
|
|
45
45
|
export type StatusSlot = boolean | ((node: ReactNode) => ReactNode);
|
|
46
|
-
/**
|
|
47
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Resolve a {@link StatusSlot} against a built status node.
|
|
48
|
+
* `wrap` only applies to the default slot (`true`), not a relocate function.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveStatusSlot(slot: StatusSlot | undefined, node: ReactNode, wrap?: (node: ReactNode) => ReactNode): ReactNode;
|
|
48
51
|
//# sourceMappingURL=attachment-layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-layout.d.ts","sourceRoot":"","sources":["../../src/lib/attachment-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,CACvC,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC,OAAO,CAAC,CAC3C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,WAAW,CACtC,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAC1C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAC7C,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC,aAAa,CAAC,CACjD,CAAC;A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uBAAuB,GAAG;IACpC,mEAAmE;IACnE,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,oDAAoD;IACpD,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CAC/C,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,kCAAkC,gEACgB,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,8DAC0B,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC;AAEpE;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,YAAO,EACvB,IAAI,EAAE,SAAS,EACf,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS,GACpC,SAAS,CAKX"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimah-s3/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Pre-built React UI components for S3 file upload, download, and delete",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"s3",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"css"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@dimah-s3/core": "1.
|
|
50
|
-
"@dimah-s3/react": "1.
|
|
49
|
+
"@dimah-s3/core": "1.2.0",
|
|
50
|
+
"@dimah-s3/react": "1.2.0",
|
|
51
51
|
"react-file-icon": "^1.6.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { DimahS3Error, UploadFileInfo, UploadPhase, UploadProgress, MultiUploadFileState, MultiUploadPhase } from "@dimah-s3/react";
|
|
2
|
-
import type { AttachmentLayoutProps } from "../../../lib/attachment-layout";
|
|
3
|
-
export type UploadStatusBlockProps = AttachmentLayoutProps & {
|
|
4
|
-
className?: string;
|
|
5
|
-
} & ({
|
|
6
|
-
mode: "single";
|
|
7
|
-
phase: UploadPhase;
|
|
8
|
-
progress: UploadProgress;
|
|
9
|
-
error: DimahS3Error | null;
|
|
10
|
-
fileInfo: UploadFileInfo | null;
|
|
11
|
-
onCancel?: () => void;
|
|
12
|
-
onPause?: () => void;
|
|
13
|
-
} | {
|
|
14
|
-
mode: "multi";
|
|
15
|
-
phase: MultiUploadPhase;
|
|
16
|
-
files: MultiUploadFileState[];
|
|
17
|
-
totalProgress: UploadProgress;
|
|
18
|
-
error: DimahS3Error | null;
|
|
19
|
-
onCancel?: () => void;
|
|
20
|
-
onPause?: () => void;
|
|
21
|
-
});
|
|
22
|
-
export declare function UploadStatusBlock(props: UploadStatusBlockProps): import("react").JSX.Element;
|
|
23
|
-
//# sourceMappingURL=upload-status-block.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-status-block.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-status-block.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GAAG;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,CACE;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,aAAa,EAAE,cAAc,CAAC;IAC9B,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CACJ,CAAC;AAEJ,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BA4C9D"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
import { useTranslations } from "@fuma-translate/react";
|
|
3
|
-
import { type UseUploadOptions, type UseMultiUploadOptions, type UseUploadReturn, type UseMultiUploadReturn } from "@dimah-s3/react";
|
|
4
|
-
import { type AttachmentLayoutAliases, type StatusSlot } from "../../../lib/attachment-layout";
|
|
5
|
-
export declare function canPauseUpload(uploadStore: UseUploadOptions["uploadStore"]): boolean;
|
|
6
|
-
export declare function dropzoneHints(options: UseUploadOptions | UseMultiUploadOptions, t: ReturnType<typeof useTranslations>): {
|
|
7
|
-
limitsLine: string | null;
|
|
8
|
-
acceptLine: string | null;
|
|
9
|
-
};
|
|
10
|
-
export declare function DropzoneChrome({ label, limitsLine, acceptLine, isDisabled, children, }: {
|
|
11
|
-
label: string;
|
|
12
|
-
limitsLine: string | null;
|
|
13
|
-
acceptLine: string | null;
|
|
14
|
-
isDisabled: boolean;
|
|
15
|
-
children?: ReactNode;
|
|
16
|
-
}): import("react").JSX.Element;
|
|
17
|
-
export declare function DropzoneFrame({ getRootProps, getInputProps, isDisabled, isDragReject, isDragAccept, isDragActive, className, hasCustomChrome, ariaLabel, chrome, status, }: {
|
|
18
|
-
getRootProps: UseUploadReturn["getRootProps"];
|
|
19
|
-
getInputProps: UseUploadReturn["getInputProps"];
|
|
20
|
-
isDisabled: boolean;
|
|
21
|
-
isDragReject: boolean;
|
|
22
|
-
isDragAccept: boolean;
|
|
23
|
-
isDragActive: boolean;
|
|
24
|
-
className?: string;
|
|
25
|
-
hasCustomChrome: boolean;
|
|
26
|
-
ariaLabel: string;
|
|
27
|
-
chrome: ReactNode;
|
|
28
|
-
status: ReactNode;
|
|
29
|
-
}): import("react").JSX.Element;
|
|
30
|
-
type StatusLayout = AttachmentLayoutAliases & {
|
|
31
|
-
toast?: boolean;
|
|
32
|
-
status?: StatusSlot;
|
|
33
|
-
};
|
|
34
|
-
export declare function useSingleUploadUi(ctrl: UseUploadReturn, { toast: enableToast, status: statusSlot, attachmentSize, attachmentOrientation, canPause, }: StatusLayout & {
|
|
35
|
-
canPause: boolean;
|
|
36
|
-
}): {
|
|
37
|
-
statusNode: import("react").JSX.Element | null;
|
|
38
|
-
statusSlot: StatusSlot;
|
|
39
|
-
};
|
|
40
|
-
export declare function useMultiUploadUi(ctrl: UseMultiUploadReturn, { toast: enableToast, status: statusSlot, attachmentSize, attachmentOrientation, canPause, }: StatusLayout & {
|
|
41
|
-
canPause: boolean;
|
|
42
|
-
}): {
|
|
43
|
-
statusNode: import("react").JSX.Element | null;
|
|
44
|
-
statusSlot: StatusSlot;
|
|
45
|
-
};
|
|
46
|
-
export declare function resolveDefaultStatus(statusSlot: StatusSlot, statusNode: ReactNode, wrap?: (node: ReactNode) => ReactNode): ReactNode;
|
|
47
|
-
export {};
|
|
48
|
-
//# sourceMappingURL=upload-wired.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-wired.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-wired.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,iBAA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