gantri-components 2.127.0-beta.4 → 2.127.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  export declare const defaultImageExtensions: readonly ["gif", "jpeg", "jpg", "png", "webp"];
2
2
  export declare const fileUploaderVariants: {
3
3
  readonly button: "button";
4
+ readonly custom: "custom";
4
5
  readonly link: "link";
5
6
  readonly plain: "plain";
6
7
  readonly thumbnail: "thumbnail";
@@ -3,7 +3,6 @@ import { ButtonProps } from '../button/button.types';
3
3
  import { BoxProps } from '../box/box.types';
4
4
  import { fileUploaderVariants } from './file-uploader.constants';
5
5
  export type FileUploaderProps = {
6
- CustomContent?: FileUploaderCustomContent;
7
6
  /** Any children passed will appear just within the uploader above everything else. Use this for notifications like download toasts. */
8
7
  children?: ReactNode;
9
8
  className?: string;
@@ -30,9 +29,9 @@ export type FileUploaderProps = {
30
29
  /** If invalid, return the error message to display. */
31
30
  validateFile?: ValidateFile;
32
31
  /** The 'link' and 'plain' variants will show the 'button' variant if nothing has been uploaded yet. */
33
- variant: UploaderVariant;
34
- } & Partial<FileUploaderDefaultProps> & (WithDraggableProps | WithoutDraggableProps) & (WithReplaceableProps | WithoutReplaceableProps) & (ImmediatelyUploadProps | DelayUploadProps);
35
- export type UploaderVariant = (typeof fileUploaderVariants)[keyof typeof fileUploaderVariants];
32
+ variant: FileUploaderVariant;
33
+ } & Partial<FileUploaderDefaultProps> & (WithDraggableProps | WithoutDraggableProps) & (WithReplaceableProps | WithoutReplaceableProps) & (ImmediatelyUploadProps | DelayUploadProps) & (WithCustomContent | WithoutCustomContent);
34
+ export type FileUploaderVariant = (typeof fileUploaderVariants)[keyof typeof fileUploaderVariants];
36
35
  export type HandleDeleteFile = (props: HandleFileDeleteArgs) => Promise<void>;
37
36
  export type HandleFileDeleteArgs = {
38
37
  fileName: string;
@@ -70,6 +69,7 @@ export type FileUploaderCustomContent = (props: {
70
69
  UploaderActionIcons: () => JSX.Element;
71
70
  fileName: string;
72
71
  fileUrl: string;
72
+ handleOpenFileSelect: () => void;
73
73
  isDraggingOver: boolean;
74
74
  processing: boolean;
75
75
  }) => JSX.Element;
@@ -104,6 +104,14 @@ type WithoutReplaceableProps = {
104
104
  isReplaceable?: never;
105
105
  onReplace?: never;
106
106
  };
107
+ type WithCustomContent = {
108
+ CustomContent: FileUploaderCustomContent;
109
+ variant: 'custom';
110
+ };
111
+ type WithoutCustomContent = {
112
+ CustomContent?: never;
113
+ variant: FileUploaderVariant;
114
+ };
107
115
  export type FileUploaderDefaultProps = {
108
116
  buttonProps?: Partial<ButtonProps>;
109
117
  /** Set to `null` or `[]` to allow all file types. */