tsp-form 0.6.9 → 0.7.1

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,27 @@
1
+ import { ReactNode } from 'react';
2
+ import '../styles/file-uploader.css';
3
+ export interface UploadedFile {
4
+ id: string;
5
+ file: File;
6
+ name: string;
7
+ size: number;
8
+ type: string;
9
+ }
10
+ export interface FileRejection {
11
+ file: File;
12
+ reason: 'too-large' | 'too-many';
13
+ }
14
+ export interface FileUploaderProps {
15
+ value?: UploadedFile[];
16
+ onUpload?: (files: UploadedFile[]) => void;
17
+ accept?: string;
18
+ multiple?: boolean;
19
+ maxFiles?: number;
20
+ maxFileSize?: number;
21
+ onReject?: (rejections: FileRejection[]) => void;
22
+ disabled?: boolean;
23
+ children?: ReactNode | ((isDragging: boolean) => ReactNode);
24
+ className?: string;
25
+ }
26
+ export declare function FileUploader({ value, onUpload, accept, multiple, maxFiles, maxFileSize, onReject, disabled, children, className, }: FileUploaderProps): import("react/jsx-runtime").JSX.Element;
27
+ //# sourceMappingURL=FileUploader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../../src/components/FileUploader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyD,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,6BAA6B,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,WAAW,GAAG,UAAU,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,UAAU,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,YAAY,CAAC,EAC3B,KAAU,EACV,QAAQ,EACR,MAAM,EACN,QAAgB,EAChB,QAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAgB,EAChB,QAAQ,EACR,SAAS,GACV,EAAE,iBAAiB,2CA6GnB"}
@@ -0,0 +1,30 @@
1
+ import '../styles/image-cropper.css';
2
+ export interface ImageCropperRef {
3
+ /** Current zoom level */
4
+ zoom: number;
5
+ /** Minimum zoom (auto-computed so image covers viewport) */
6
+ minZoom: number;
7
+ /** Maximum zoom */
8
+ maxZoom: number;
9
+ /** Set zoom level (clamped to min/max, re-centers) */
10
+ setZoom: (zoom: number) => void;
11
+ /** Render the visible crop area to a Blob + File, returned via the callback */
12
+ crop: (callback: (blob: Blob, file: File) => void) => void;
13
+ }
14
+ export interface ImageCropperProps {
15
+ src: string | File | Blob;
16
+ aspectRatio?: number;
17
+ minZoom?: number;
18
+ maxZoom?: number;
19
+ outputType?: string;
20
+ outputQuality?: number;
21
+ outputWidth?: number;
22
+ className?: string;
23
+ viewportWidth?: number;
24
+ viewportHeight?: number;
25
+ wheelZoom?: boolean;
26
+ /** Called whenever zoom changes (from gestures or setZoom) */
27
+ onZoomChange?: (zoom: number) => void;
28
+ }
29
+ export declare const ImageCropper: import("react").ForwardRefExoticComponent<ImageCropperProps & import("react").RefAttributes<ImageCropperRef>>;
30
+ //# sourceMappingURL=ImageCropper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageCropper.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCropper.tsx"],"names":[],"mappings":"AAEA,OAAO,6BAA6B,CAAC;AAErC,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,+EAA+E;IAC/E,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,KAAK,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,YAAY,+GAsTvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsp-form",
3
- "version": "0.6.9",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "description": "A unified Tailwind 4 variables compatible UI component library for my own projects.",
6
6
  "module": "dist/index.js",