caplink-saas-ui-shared-component-library 0.3.18 → 0.3.20

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.
@@ -0,0 +1,21 @@
1
+ import { HTMLAttributes } from 'react';
2
+
3
+ export type ImageUploaderState = 'Uploading' | 'Removing' | 'Idle' | 'Disabled' | 'Finished';
4
+ export type ImageUploaderProps = {
5
+ imageName?: string;
6
+ imageSize?: string;
7
+ maxImageSizeInKb?: number;
8
+ imageUrl?: string;
9
+ onError?: (errorMessage: string) => void;
10
+ onRemove?: () => void;
11
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
12
+ state: ImageUploaderState;
13
+ customImagePreview?: React.ReactElement;
14
+ customImage?: React.ReactElement;
15
+ errorMessages?: {
16
+ priorityError?: string;
17
+ imageTypeError?: string;
18
+ imageSizeError?: string;
19
+ };
20
+ } & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;
21
+ export declare function ImageUploader(props: ImageUploaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export type ImageViewerProps = {
3
+ imageUrl?: string;
4
+ customImage?: React.ReactElement;
5
+ onClose: () => void;
6
+ };
7
+ export declare function ImageViewer(props: ImageViewerProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import { ImageUploader, ImageUploaderProps } from './image-uploader';
2
+
3
+ export { ImageUploader };
4
+ export type { ImageUploaderProps };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import { Spreadsheet } from './components/spreadsheet/ui';
2
2
  import { FileUploader, FileUploaderProps } from './components/file-uploader/ui';
3
+ import { ImageUploader, ImageUploaderProps } from './components/image-uploader/ui';
3
4
  import { MatrixTypes, SpreadsheetTypes } from './types';
4
5
 
5
6
  export declare const CapLink: {
6
7
  Spreadsheet: typeof Spreadsheet;
7
8
  FileUploader: typeof FileUploader;
8
9
  WithPortalProvider: ({ children }: import('./components/spreadsheet/lib/with-portal-provider').IWithPortalProvider) => import("react/jsx-runtime").JSX.Element;
10
+ ImageUploader: typeof ImageUploader;
9
11
  };
10
- export type { FileUploaderProps, MatrixTypes, SpreadsheetTypes };
12
+ export type { FileUploaderProps, ImageUploaderProps, MatrixTypes, SpreadsheetTypes };