@dimah-s3/ui 0.6.3 → 0.7.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.
Files changed (54) hide show
  1. package/README.md +13 -1
  2. package/css/shadcn.css +30 -0
  3. package/dist/components/{ui → dimah-s3/attachment}/circle-progress.d.ts +2 -1
  4. package/dist/components/dimah-s3/attachment/circle-progress.d.ts.map +1 -0
  5. package/dist/components/dimah-s3/attachment/file-attachment.d.ts +25 -0
  6. package/dist/components/dimah-s3/attachment/file-attachment.d.ts.map +1 -0
  7. package/dist/components/dimah-s3/attachment/status-attachment.d.ts +20 -0
  8. package/dist/components/dimah-s3/attachment/status-attachment.d.ts.map +1 -0
  9. package/dist/components/{delete → dimah-s3/delete}/delete-button.d.ts +11 -5
  10. package/dist/components/dimah-s3/delete/delete-button.d.ts.map +1 -0
  11. package/dist/components/{download → dimah-s3/download}/download-button.d.ts +11 -5
  12. package/dist/components/dimah-s3/download/download-button.d.ts.map +1 -0
  13. package/dist/components/{download → dimah-s3/download}/progress-download-button.d.ts +11 -5
  14. package/dist/components/dimah-s3/download/progress-download-button.d.ts.map +1 -0
  15. package/dist/components/dimah-s3/upload/multi-upload-status.d.ts +12 -0
  16. package/dist/components/dimah-s3/upload/multi-upload-status.d.ts.map +1 -0
  17. package/dist/components/dimah-s3/upload/upload-button.d.ts +36 -0
  18. package/dist/components/dimah-s3/upload/upload-button.d.ts.map +1 -0
  19. package/dist/components/dimah-s3/upload/upload-dropzone.d.ts +31 -0
  20. package/dist/components/dimah-s3/upload/upload-dropzone.d.ts.map +1 -0
  21. package/dist/components/{upload → dimah-s3/upload}/upload-status-block.d.ts +5 -7
  22. package/dist/components/dimah-s3/upload/upload-status-block.d.ts.map +1 -0
  23. package/dist/components/dimah-s3/upload/upload-status.d.ts +14 -0
  24. package/dist/components/dimah-s3/upload/upload-status.d.ts.map +1 -0
  25. package/dist/components/ui/attachment.d.ts +24 -0
  26. package/dist/components/ui/attachment.d.ts.map +1 -0
  27. package/dist/components/ui/button.d.ts.map +1 -1
  28. package/dist/hooks/use-file-reject-toast.d.ts +7 -0
  29. package/dist/hooks/use-file-reject-toast.d.ts.map +1 -0
  30. package/dist/hooks/use-upload-toast.d.ts +2 -5
  31. package/dist/hooks/use-upload-toast.d.ts.map +1 -1
  32. package/dist/index.d.ts +12 -8
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +1072 -333
  35. package/dist/index.js.map +1 -1
  36. package/dist/lib/attachment.d.ts +37 -0
  37. package/dist/lib/attachment.d.ts.map +1 -0
  38. package/dist/lib/file-type-icon.d.ts +13 -0
  39. package/dist/lib/file-type-icon.d.ts.map +1 -0
  40. package/package.json +17 -9
  41. package/styles.css +8 -2
  42. package/dist/components/delete/delete-button.d.ts.map +0 -1
  43. package/dist/components/download/download-button.d.ts.map +0 -1
  44. package/dist/components/download/progress-download-button.d.ts.map +0 -1
  45. package/dist/components/ui/circle-progress.d.ts.map +0 -1
  46. package/dist/components/upload/multi-upload-status.d.ts +0 -9
  47. package/dist/components/upload/multi-upload-status.d.ts.map +0 -1
  48. package/dist/components/upload/upload-button.d.ts +0 -30
  49. package/dist/components/upload/upload-button.d.ts.map +0 -1
  50. package/dist/components/upload/upload-dropzone.d.ts +0 -22
  51. package/dist/components/upload/upload-dropzone.d.ts.map +0 -1
  52. package/dist/components/upload/upload-status-block.d.ts.map +0 -1
  53. package/dist/components/upload/upload-status.d.ts +0 -14
  54. package/dist/components/upload/upload-status.d.ts.map +0 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Optional prebuilt UI components for `dimah-s3`, powered by `@dimah-s3/react`.
4
4
 
5
- Full documentation: [dimah-s3.vercel.app](https://dimah-s3.vercel.app/docs/react/ui/upload-button)
5
+ Full documentation: [dimah-s3.vercel.app](https://dimah-s3.vercel.app/docs/react/ui/setup)
6
6
 
7
7
  ## Install
8
8
 
@@ -10,6 +10,18 @@ Full documentation: [dimah-s3.vercel.app](https://dimah-s3.vercel.app/docs/react
10
10
  pnpm add @dimah-s3/ui @dimah-s3/react
11
11
  ```
12
12
 
13
+ ## Styles
14
+
15
+ Import once in your CSS (Tailwind v4 source scan + shadcn color bridge):
16
+
17
+ ```css
18
+ @import "@dimah-s3/ui/styles.css";
19
+ ```
20
+
21
+ Colors default to your shadcn theme (`--primary`, `--muted`, …). Override
22
+ `--color-dimah-s3-*` to theme the library alone — see
23
+ [Theming](https://dimah-s3.vercel.app/docs/react/ui/customization/theming).
24
+
13
25
  ## Quick start
14
26
 
15
27
  ```tsx
package/css/shadcn.css ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @dimah-s3/ui color tokens ← host shadcn theme.
3
+ *
4
+ * Dimah-owned components use `bg-dimah-s3-*` / `text-dimah-s3-*` utilities so the
5
+ * library can be themed independently. By default every token points at the
6
+ * matching shadcn CSS variable (`--primary`, `--muted`, …).
7
+ *
8
+ * Override after import to theme only dimah-s3:
9
+ *
10
+ * @theme {
11
+ * --color-dimah-s3-primary: oklch(0.65 0.15 150);
12
+ * }
13
+ */
14
+ @theme {
15
+ --color-dimah-s3-background: var(--background);
16
+ --color-dimah-s3-foreground: var(--foreground);
17
+ --color-dimah-s3-card: var(--card);
18
+ --color-dimah-s3-card-foreground: var(--card-foreground);
19
+ --color-dimah-s3-primary: var(--primary);
20
+ --color-dimah-s3-primary-foreground: var(--primary-foreground);
21
+ --color-dimah-s3-secondary: var(--secondary);
22
+ --color-dimah-s3-secondary-foreground: var(--secondary-foreground);
23
+ --color-dimah-s3-muted: var(--muted);
24
+ --color-dimah-s3-muted-foreground: var(--muted-foreground);
25
+ --color-dimah-s3-accent: var(--accent);
26
+ --color-dimah-s3-accent-foreground: var(--accent-foreground);
27
+ --color-dimah-s3-destructive: var(--destructive);
28
+ --color-dimah-s3-border: var(--border);
29
+ --color-dimah-s3-ring: var(--ring);
30
+ }
@@ -1,6 +1,7 @@
1
- export declare function CircleProgress({ percent, size, strokeWidth, }: {
1
+ export declare function CircleProgress({ percent, size, strokeWidth, className, }: {
2
2
  percent: number;
3
3
  size?: number;
4
4
  strokeWidth?: number;
5
+ className?: string;
5
6
  }): import("react").JSX.Element;
6
7
  //# sourceMappingURL=circle-progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circle-progress.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/attachment/circle-progress.tsx"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,IAAS,EACT,WAAiB,EACjB,SAAS,GACV,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAmCA"}
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from "react";
2
+ import { type AttachmentOrientation, type AttachmentSize, type AttachmentState } from "../../../lib/attachment";
3
+ export type FileAttachmentProps = {
4
+ /** @default "sm" */
5
+ size?: AttachmentSize;
6
+ /** @default "horizontal" */
7
+ orientation?: AttachmentOrientation;
8
+ state: AttachmentState;
9
+ fileName: string;
10
+ fileSize?: number;
11
+ /** MIME type — used with the filename to pick a type icon when no preview. */
12
+ fileType?: string | null;
13
+ /** Image thumbnail URL — enables `AttachmentMedia variant="image"`. */
14
+ previewUrl?: string | null;
15
+ /** Progress 0–100 when `state` is uploading/idle (pending). */
16
+ percent?: number;
17
+ /** Secondary line; defaults to size, or error text when `state="error"`. */
18
+ description?: ReactNode;
19
+ error?: string | null;
20
+ onCancel?: () => void;
21
+ onPause?: () => void;
22
+ className?: string;
23
+ };
24
+ export declare function FileAttachment({ state, fileName, fileSize, fileType, previewUrl, percent, description, error, onCancel, onPause, size, orientation, className, }: FileAttachmentProps): import("react").JSX.Element;
25
+ //# sourceMappingURL=file-attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/attachment/file-attachment.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAcvC,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAa1B,MAAM,MAAM,mBAAmB,GAAG;IAChC,oBAAoB;IACpB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAW,EACX,WAAW,EACX,KAAK,EACL,QAAQ,EACR,OAAO,EACP,IAAW,EACX,WAA0B,EAC1B,SAAS,GACV,EAAE,mBAAmB,+BAkGrB"}
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from "react";
2
+ import { type AttachmentOrientation, type AttachmentSize, type AttachmentState } from "../../../lib/attachment";
3
+ export type StatusAttachmentProps = {
4
+ /** @default "sm" */
5
+ size?: AttachmentSize;
6
+ /** @default "horizontal" */
7
+ orientation?: AttachmentOrientation;
8
+ state: AttachmentState;
9
+ title?: ReactNode;
10
+ description?: ReactNode;
11
+ media?: ReactNode;
12
+ actions?: ReactNode;
13
+ className?: string;
14
+ };
15
+ /**
16
+ * Minimal Attachment shell for operation feedback (upload/download/delete).
17
+ * Relies on Attachment `data-state` styles for error/done chrome.
18
+ */
19
+ export declare function StatusAttachment({ state, title, description, media, actions, size, orientation, className, }: StatusAttachmentProps): import("react").JSX.Element;
20
+ //# sourceMappingURL=status-attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/attachment/status-attachment.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAcvC,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,MAAM,qBAAqB,GAAG;IAClC,oBAAoB;IACpB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,OAAO,EACP,IAAW,EACX,WAA0B,EAC1B,SAAS,GACV,EAAE,qBAAqB,+BAsCvB"}
@@ -1,9 +1,10 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
2
  import type { DeleteHooks } from "@dimah-s3/react";
3
3
  import type { S3Api } from "@dimah-s3/core";
4
- import { Button } from "../../components/ui/button";
4
+ import { type AttachmentLayoutAliases, type StatusSlot } from "../../../lib/attachment";
5
+ import { Button } from "../../../components/ui/button";
5
6
  /** Props for {@link DeleteButton}. */
6
- export type DeleteButtonProps = DeleteHooks & {
7
+ export type DeleteButtonProps = DeleteHooks & AttachmentLayoutAliases & {
7
8
  /** S3Api. Optional when an `<S3Provider>` is present in the tree. */
8
9
  api?: S3Api;
9
10
  /** S3 object key to delete. */
@@ -23,8 +24,13 @@ export type DeleteButtonProps = DeleteHooks & {
23
24
  tooltipText?: string;
24
25
  /** Show a toast during delete. @default true */
25
26
  toast?: boolean;
26
- /** Show inline error below the button. @default true */
27
- showStatus?: boolean;
27
+ /**
28
+ * Inline status control.
29
+ * - `true` (default): render below the button
30
+ * - `false`: hide status
31
+ * - `(node) => ReactNode`: wrap or relocate the status node
32
+ */
33
+ status?: StatusSlot;
28
34
  confirmTitle?: string;
29
35
  confirmDescription?: string;
30
36
  /** Button variant. @default "destructive" */
@@ -34,5 +40,5 @@ export type DeleteButtonProps = DeleteHooks & {
34
40
  /** Extra classes on the trigger button element. */
35
41
  buttonClassName?: string;
36
42
  };
37
- export declare function DeleteButton({ api, objectKey, fileName, fileSize, bucket, label, children, className, disabled, tooltipText, toast: enableToast, showStatus, confirmTitle, confirmDescription, variant, size, buttonClassName, beforeDelete, onDeleteStart, onSuccess, onError, }: DeleteButtonProps): import("react").JSX.Element;
43
+ export declare function DeleteButton({ api, objectKey, fileName, fileSize, bucket, label, children, className, disabled, tooltipText, toast: enableToast, status: statusSlot, confirmTitle, confirmDescription, variant, size, buttonClassName, attachmentSize, attachmentOrientation, beforeDelete, onDeleteStart, onSuccess, onError, }: DeleteButtonProps): import("react").JSX.Element;
38
44
  //# sourceMappingURL=delete-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-button.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/delete/delete-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EA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,MAAM,CAAC;CAC1B,CAAC;AAEJ,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,EACX,KAAK,EAAE,WAAkB,EACzB,MAAM,EAAE,UAAiB,EACzB,YAAY,EACZ,kBAAkB,EAClB,OAAuB,EACvB,IAAgB,EAChB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,OAAO,GACR,EAAE,iBAAiB,+BA2InB"}
@@ -1,8 +1,9 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
2
  import type { S3Api } from "@dimah-s3/core";
3
- import { Button } from "../../components/ui/button";
3
+ import { type AttachmentLayoutAliases, type StatusSlot } from "../../../lib/attachment";
4
+ import { Button } from "../../../components/ui/button";
4
5
  /** Props for {@link DownloadButton}. */
5
- export type DownloadButtonProps = {
6
+ export type DownloadButtonProps = AttachmentLayoutAliases & {
6
7
  /** S3Api. Optional when an `<S3Provider>` is present in the tree. */
7
8
  api?: S3Api;
8
9
  /** S3 object key to download. */
@@ -17,8 +18,13 @@ export type DownloadButtonProps = {
17
18
  disabled?: boolean;
18
19
  /** Show a toast when download starts. @default true */
19
20
  toast?: boolean;
20
- /** Show inline error below the button. @default true */
21
- showStatus?: boolean;
21
+ /**
22
+ * Inline status control.
23
+ * - `true` (default): render below the button
24
+ * - `false`: hide status
25
+ * - `(node) => ReactNode`: wrap or relocate the status node
26
+ */
27
+ status?: StatusSlot;
22
28
  /** Button variant. @default "outline" */
23
29
  variant?: ComponentProps<typeof Button>["variant"];
24
30
  /** Button size. @default "default" */
@@ -26,5 +32,5 @@ export type DownloadButtonProps = {
26
32
  /** Extra classes on the trigger button element. */
27
33
  buttonClassName?: string;
28
34
  };
29
- export declare function DownloadButton({ api, objectKey, fileName, label, children, className, disabled, toast: enableToast, showStatus, variant, size, buttonClassName, }: DownloadButtonProps): import("react").JSX.Element;
35
+ export declare function DownloadButton({ api, objectKey, fileName, label, children, className, disabled, toast: enableToast, status: statusSlot, variant, size, buttonClassName, attachmentSize, attachmentOrientation, }: DownloadButtonProps): import("react").JSX.Element;
30
36
  //# sourceMappingURL=download-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download-button.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/download/download-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAIhD,wCAAwC;AACxC,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,GAAG;IAC1D,qEAAqE;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,yCAAyC;IACzC,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;IACnD,sCAAsC;IACtC,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7C,mDAAmD;IACnD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,SAAS,EACT,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,KAAK,EAAE,WAAkB,EACzB,MAAM,EAAE,UAAiB,EACzB,OAAmB,EACnB,IAAgB,EAChB,eAAe,EACf,cAAc,EACd,qBAAqB,GACtB,EAAE,mBAAmB,+BAwDrB"}
@@ -1,9 +1,10 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
2
  import type { FetchDownloadHooks } from "@dimah-s3/react";
3
3
  import type { S3Api } from "@dimah-s3/core";
4
- import { Button } from "../../components/ui/button";
4
+ import { type AttachmentLayoutAliases, type StatusSlot } from "../../../lib/attachment";
5
+ import { Button } from "../../../components/ui/button";
5
6
  /** Props for {@link ProgressDownloadButton}. */
6
- export type ProgressDownloadButtonProps = FetchDownloadHooks & {
7
+ export type ProgressDownloadButtonProps = FetchDownloadHooks & AttachmentLayoutAliases & {
7
8
  /** S3Api. Optional when an `<S3Provider>` is present in the tree. */
8
9
  api?: S3Api;
9
10
  /** S3 object key to download. */
@@ -26,8 +27,13 @@ export type ProgressDownloadButtonProps = FetchDownloadHooks & {
26
27
  cancelTooltipText?: string;
27
28
  /** Show toasts during download. @default true */
28
29
  toast?: boolean;
29
- /** Show inline error below the button. @default true */
30
- showStatus?: boolean;
30
+ /**
31
+ * Inline status control.
32
+ * - `true` (default): render below the button
33
+ * - `false`: hide status
34
+ * - `(node) => ReactNode`: wrap or relocate the status node
35
+ */
36
+ status?: StatusSlot;
31
37
  /** Button variant. @default "outline" */
32
38
  variant?: ComponentProps<typeof Button>["variant"];
33
39
  /** Button size. @default "default" */
@@ -35,5 +41,5 @@ export type ProgressDownloadButtonProps = FetchDownloadHooks & {
35
41
  /** Extra classes on the trigger button element. */
36
42
  buttonClassName?: string;
37
43
  };
38
- export declare function ProgressDownloadButton({ api, objectKey, fileName, fileSize, bucket, label, children, className, fillClassName, disabled, tooltipText, cancelTooltipText, toast: enableToast, showStatus, variant, size, buttonClassName, beforeDownload, onDownloadStart, onProgress, onSuccess, onError, onCancel, }: ProgressDownloadButtonProps): import("react").JSX.Element;
44
+ export declare function ProgressDownloadButton({ api, objectKey, fileName, fileSize, bucket, label, children, className, fillClassName, disabled, tooltipText, cancelTooltipText, toast: enableToast, status: statusSlot, variant, size, buttonClassName, attachmentSize, attachmentOrientation, beforeDownload, onDownloadStart, onProgress, onSuccess, onError, onCancel, }: ProgressDownloadButtonProps): import("react").JSX.Element;
39
45
  //# sourceMappingURL=progress-download-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-download-button.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/download/progress-download-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAShD,gDAAgD;AAChD,MAAM,MAAM,2BAA2B,GAAG,kBAAkB,GAC1D,uBAAuB,GAAG;IACxB,qEAAqE;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iDAAiD;IACjD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,yCAAyC;IACzC,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;IACnD,sCAAsC;IACtC,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7C,mDAAmD;IACnD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ,wBAAgB,sBAAsB,CAAC,EACrC,GAAG,EACH,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,KAAK,EAAE,WAAkB,EACzB,MAAM,EAAE,UAAiB,EACzB,OAAmB,EACnB,IAAgB,EAChB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE,2BAA2B,+BAwH7B"}
@@ -0,0 +1,12 @@
1
+ import type { UploadProgress, MultiUploadFileState, MultiUploadPhase } from "@dimah-s3/react";
2
+ import type { AttachmentLayoutProps } from "../../../lib/attachment";
3
+ export type MultiUploadStatusProps = AttachmentLayoutProps & {
4
+ phase: MultiUploadPhase;
5
+ files: MultiUploadFileState[];
6
+ totalProgress: UploadProgress;
7
+ error: string | null;
8
+ onCancel?: () => void;
9
+ className?: string;
10
+ };
11
+ export declare function MultiUploadStatus({ phase, files, totalProgress, error, onCancel, size, orientation, className, }: MultiUploadStatusProps): import("react").JSX.Element | null;
12
+ //# sourceMappingURL=multi-upload-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-upload-status.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/multi-upload-status.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,qBAAqB,EAAmB,MAAM,kBAAkB,CAAC;AAQ/E,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GAAG;IAC3D,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,aAAa,EAAE,cAAc,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,KAAK,EACL,aAAa,EACb,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,SAAS,GACV,EAAE,sBAAsB,sCAkGxB"}
@@ -0,0 +1,36 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { type UseUploadOptions, type UseMultiUploadOptions } from "@dimah-s3/react";
3
+ import { type AttachmentLayoutAliases, type StatusSlot } from "../../../lib/attachment";
4
+ import { Button } from "../../../components/ui/button";
5
+ /** Props for {@link UploadButton}. Extends {@link UseUploadOptions} or {@link UseMultiUploadOptions}. */
6
+ export type UploadButtonProps = (UseUploadOptions | UseMultiUploadOptions) & AttachmentLayoutAliases & {
7
+ className?: string;
8
+ /** Button label. */
9
+ label?: string;
10
+ /** Custom button content. Replaces default icon + label. */
11
+ children?: ReactNode;
12
+ disabled?: boolean;
13
+ tooltipText?: string;
14
+ /** Show toasts during upload. @default true */
15
+ toast?: boolean;
16
+ /**
17
+ * Inline status control.
18
+ * - `true` (default): render below the button
19
+ * - `false`: hide status
20
+ * - `(node) => ReactNode`: wrap or relocate the status node
21
+ */
22
+ status?: StatusSlot;
23
+ /**
24
+ * Force multi-file mode. When omitted, multi mode is inferred from
25
+ * `maxFiles > 1`.
26
+ */
27
+ multiple?: boolean;
28
+ /** Button variant. @default "default" */
29
+ variant?: ComponentProps<typeof Button>["variant"];
30
+ /** Button size. @default "default" */
31
+ size?: ComponentProps<typeof Button>["size"];
32
+ /** Extra classes on the trigger button element. */
33
+ buttonClassName?: string;
34
+ };
35
+ export declare function UploadButton({ multiple, ...props }: UploadButtonProps): import("react").JSX.Element;
36
+ //# sourceMappingURL=upload-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-button.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAG3B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAahD,yGAAyG;AACzG,MAAM,MAAM,iBAAiB,GAAG,CAAC,gBAAgB,GAAG,qBAAqB,CAAC,GACxE,uBAAuB,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;IACnD,sCAAsC;IACtC,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7C,mDAAmD;IACnD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAqMJ,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,+BAerE"}
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from "react";
2
+ import { type UseUploadOptions, type UseMultiUploadOptions } from "@dimah-s3/react";
3
+ import { type AttachmentLayoutAliases, type StatusSlot } from "../../../lib/attachment";
4
+ /** Props for {@link UploadDropzone}. Extends {@link UseUploadOptions} or {@link UseMultiUploadOptions}. */
5
+ export type UploadDropzoneProps = (UseUploadOptions | UseMultiUploadOptions) & AttachmentLayoutAliases & {
6
+ className?: string;
7
+ /** Dropzone label. */
8
+ label?: string;
9
+ /**
10
+ * Custom dropzone chrome (icon + hints). Replaces the built-in idle content
11
+ * only — status still renders via the `status` prop.
12
+ */
13
+ children?: ReactNode;
14
+ disabled?: boolean;
15
+ /** Show toasts during upload. @default true */
16
+ toast?: boolean;
17
+ /**
18
+ * Inline status control.
19
+ * - `true` (default): render inside the dropzone
20
+ * - `false`: hide status
21
+ * - `(node) => ReactNode`: wrap or relocate the status node
22
+ */
23
+ status?: StatusSlot;
24
+ /**
25
+ * Force multi-file mode. When omitted, multi mode is inferred from
26
+ * `maxFiles > 1`.
27
+ */
28
+ multiple?: boolean;
29
+ };
30
+ export declare function UploadDropzone({ multiple, ...props }: UploadDropzoneProps): import("react").JSX.Element;
31
+ //# sourceMappingURL=upload-dropzone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-dropzone.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-dropzone.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAG3B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAQ1B,2GAA2G;AAC3G,MAAM,MAAM,mBAAmB,GAAG,CAAC,gBAAgB,GAAG,qBAAqB,CAAC,GAC1E,uBAAuB,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAmRJ,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAkBzE"}
@@ -1,13 +1,11 @@
1
- import type { UploadPhase, UploadProgress, MultiUploadFileState, MultiUploadPhase } from "@dimah-s3/react";
2
- export type UploadStatusBlockProps = {
1
+ import type { UploadFileInfo, UploadPhase, UploadProgress, MultiUploadFileState, MultiUploadPhase } from "@dimah-s3/react";
2
+ import type { AttachmentLayoutProps } from "../../../lib/attachment";
3
+ export type UploadStatusBlockProps = AttachmentLayoutProps & ({
3
4
  mode: "single";
4
5
  phase: UploadPhase;
5
6
  progress: UploadProgress;
6
7
  error: string | null;
7
- fileInfo: {
8
- name: string;
9
- size: number;
10
- } | null;
8
+ fileInfo: UploadFileInfo | null;
11
9
  onCancel?: () => void;
12
10
  onPause?: () => void;
13
11
  } | {
@@ -18,6 +16,6 @@ export type UploadStatusBlockProps = {
18
16
  error: string | null;
19
17
  onCancel?: () => void;
20
18
  onPause?: () => void;
21
- };
19
+ });
22
20
  export declare function UploadStatusBlock(props: UploadStatusBlockProps): import("react").JSX.Element;
23
21
  //# sourceMappingURL=upload-status-block.d.ts.map
@@ -0,0 +1 @@
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,cAAc,EACd,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GACxD,CACI;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,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,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CACJ,CAAC;AAEJ,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAgD9D"}
@@ -0,0 +1,14 @@
1
+ import type { UploadFileInfo, UploadPhase, UploadProgress } from "@dimah-s3/react";
2
+ import type { AttachmentLayoutProps } from "../../../lib/attachment";
3
+ export type UploadStatusProps = AttachmentLayoutProps & {
4
+ phase: UploadPhase;
5
+ progress: UploadProgress;
6
+ error: string | null;
7
+ fileInfo: UploadFileInfo | null;
8
+ onCancel?: () => void;
9
+ /** When set (typically with an `uploadStore`), shows a pause control. */
10
+ onPause?: () => void;
11
+ className?: string;
12
+ };
13
+ export declare function UploadStatus({ phase, progress, error, fileInfo, onCancel, onPause, size, orientation, className, }: UploadStatusProps): import("react").JSX.Element | null;
14
+ //# sourceMappingURL=upload-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-status.d.ts","sourceRoot":"","sources":["../../../../src/components/dimah-s3/upload/upload-status.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,cAAc,EACf,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG;IACtD,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,WAAW,EACX,SAAS,GACV,EAAE,iBAAiB,sCA6FnB"}
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ import { Button } from "../../components/ui/button";
5
+ declare const attachmentVariants: (props?: ({
6
+ size?: "default" | "sm" | "xs" | null | undefined;
7
+ orientation?: "horizontal" | "vertical" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ declare function Attachment({ className, state, size, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentVariants> & {
10
+ state?: "idle" | "uploading" | "processing" | "error" | "done";
11
+ }): React.JSX.Element;
12
+ declare const attachmentMediaVariants: (props?: ({
13
+ variant?: "icon" | "image" | null | undefined;
14
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
+ declare function AttachmentMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>): React.JSX.Element;
16
+ declare function AttachmentContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
17
+ declare function AttachmentTitle({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
18
+ declare function AttachmentDescription({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
19
+ declare function AttachmentActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
20
+ declare function AttachmentAction({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
21
+ declare function AttachmentTrigger({ className, render, type, ...props }: useRender.ComponentProps<"button">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
22
+ declare function AttachmentGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
23
+ export { Attachment, AttachmentGroup, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions, AttachmentAction, AttachmentTrigger, };
24
+ //# sourceMappingURL=attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../../src/components/ui/attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAA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AC,OAAO,MAAM,CAAC,qBAUrC;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,MAAM,EACN,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,0EAepC;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAW5E;AAED,OAAO,EACL,UAAU,EACV,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;8EAiCnB,CAAC;AAEF,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,+BAQ7D;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;8EAmCnB,CAAC;AAEF,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,+BAQ7D;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { FileRejection } from "@dimah-s3/react";
2
+ /**
3
+ * Toasts soft dropzone rejections (type / size / count).
4
+ * Shared by UploadButton and UploadDropzone when `toast` is enabled.
5
+ */
6
+ export declare function useFileRejectToast(fileRejections: readonly FileRejection[], enabled: boolean): void;
7
+ //# sourceMappingURL=use-file-reject-toast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-file-reject-toast.d.ts","sourceRoot":"","sources":["../../src/hooks/use-file-reject-toast.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAwBrD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,SAAS,aAAa,EAAE,EACxC,OAAO,EAAE,OAAO,QAwBjB"}
@@ -1,11 +1,8 @@
1
- import type { UploadProgress, MultiUploadFileState } from "@dimah-s3/react";
1
+ import type { UploadFileInfo, UploadProgress, MultiUploadFileState } from "@dimah-s3/react";
2
2
  export type UploadToastCtrl = {
3
3
  mode: "single" | "multi";
4
4
  phase: string;
5
- fileInfo?: {
6
- name: string;
7
- size: number;
8
- } | null;
5
+ fileInfo?: UploadFileInfo | null;
9
6
  progress?: UploadProgress;
10
7
  files?: MultiUploadFileState[];
11
8
  totalProgress?: UploadProgress;
@@ -1 +1 @@
1
- {"version":3,"file":"use-upload-toast.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload-toast.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAI5E,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAkBF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,QAoJrE"}
1
+ {"version":3,"file":"use-upload-toast.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload-toast.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAIzB,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAkBF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,QAoJrE"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,14 @@
1
- export { UploadButton, type UploadButtonProps, } from "./components/upload/upload-button";
2
- export { UploadDropzone, type UploadDropzoneProps, } from "./components/upload/upload-dropzone";
3
- export { UploadStatus } from "./components/upload/upload-status";
4
- export { MultiUploadStatus } from "./components/upload/multi-upload-status";
5
- export { UploadStatusBlock, type UploadStatusBlockProps, } from "./components/upload/upload-status-block";
6
- export { DownloadButton, type DownloadButtonProps, } from "./components/download/download-button";
7
- export { ProgressDownloadButton, type ProgressDownloadButtonProps, } from "./components/download/progress-download-button";
8
- export { DeleteButton, type DeleteButtonProps, } from "./components/delete/delete-button";
1
+ export { UploadButton, type UploadButtonProps, } from "./components/dimah-s3/upload/upload-button";
2
+ export { UploadDropzone, type UploadDropzoneProps, } from "./components/dimah-s3/upload/upload-dropzone";
3
+ export { UploadStatus, type UploadStatusProps, } from "./components/dimah-s3/upload/upload-status";
4
+ export { MultiUploadStatus, type MultiUploadStatusProps, } from "./components/dimah-s3/upload/multi-upload-status";
5
+ export { UploadStatusBlock, type UploadStatusBlockProps, } from "./components/dimah-s3/upload/upload-status-block";
6
+ export { DownloadButton, type DownloadButtonProps, } from "./components/dimah-s3/download/download-button";
7
+ export { ProgressDownloadButton, type ProgressDownloadButtonProps, } from "./components/dimah-s3/download/progress-download-button";
8
+ export { DeleteButton, type DeleteButtonProps, } from "./components/dimah-s3/delete/delete-button";
9
+ export { FileAttachment, type FileAttachmentProps, } from "./components/dimah-s3/attachment/file-attachment";
10
+ export { StatusAttachment, type StatusAttachmentProps, } from "./components/dimah-s3/attachment/status-attachment";
11
+ export type { AttachmentState, AttachmentSize, AttachmentOrientation, AttachmentLayoutProps, AttachmentLayoutAliases, StatusSlot, } from "./lib/attachment";
12
+ export { resolveStatusSlot } from "./lib/attachment";
9
13
  export { Toaster, toast } from "./components/ui/toast";
10
14
  //# sourceMappingURL=index.d.ts.map
@@ -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,mCAAmC,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM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