@adamosuiteservices/ui 2.18.0 → 2.18.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.
- package/dist/components/ui/file-upload/index.d.ts +0 -1
- package/dist/components/ui/file-upload-v2/index.d.ts +1 -0
- package/dist/file-upload-v2.cjs +8 -0
- package/dist/file-upload-v2.js +339 -0
- package/dist/file-upload.cjs +4 -11
- package/dist/file-upload.js +200 -531
- package/docs/components/ui/file-upload-v2.md +14 -11
- package/docs/components/ui/file-upload.md +2 -0
- package/llm.txt +1 -1
- package/package.json +5 -1
- /package/dist/components/ui/{file-upload → file-upload-v2}/file-upload-v2.d.ts +0 -0
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Enhanced file upload component with **unique file identification**, **metadata support**, and **server integration** capabilities. Built on the FileUpload component foundation, FileUploadV2 adds automatic ID generation for each file, making it ideal for scenarios requiring server-side file tracking, asynchronous uploads, and delete operations.
|
|
6
6
|
|
|
7
|
+
> **Need a simpler version?** Check out [FileUpload](file-upload.md) for basic file upload without IDs or server integration features.
|
|
8
|
+
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
11
|
- ✅ All features from FileUpload component
|
|
@@ -36,12 +38,12 @@ Use **FileUpload** (original) when you need:
|
|
|
36
38
|
## Import
|
|
37
39
|
|
|
38
40
|
```typescript
|
|
39
|
-
import { FileUploadV2 } from "@adamosuiteservices/ui/file-upload";
|
|
41
|
+
import { FileUploadV2 } from "@adamosuiteservices/ui/file-upload-v2";
|
|
40
42
|
import type {
|
|
41
43
|
FileUploadV2Props,
|
|
42
44
|
FileWithMetadata,
|
|
43
45
|
FileUploadV2Labels,
|
|
44
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
46
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
45
47
|
```
|
|
46
48
|
|
|
47
49
|
## Basic usage
|
|
@@ -53,7 +55,7 @@ import { useState } from "react";
|
|
|
53
55
|
import {
|
|
54
56
|
FileUploadV2,
|
|
55
57
|
FileWithMetadata,
|
|
56
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
58
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
57
59
|
|
|
58
60
|
function MyForm() {
|
|
59
61
|
const [file, setFile] = useState<FileWithMetadata | null>(null);
|
|
@@ -69,7 +71,7 @@ import { useState } from "react";
|
|
|
69
71
|
import {
|
|
70
72
|
FileUploadV2,
|
|
71
73
|
FileWithMetadata,
|
|
72
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
74
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
73
75
|
|
|
74
76
|
function MyForm() {
|
|
75
77
|
const [files, setFiles] = useState<FileWithMetadata[]>([]);
|
|
@@ -87,7 +89,7 @@ import { useState, useEffect } from "react";
|
|
|
87
89
|
import {
|
|
88
90
|
FileUploadV2,
|
|
89
91
|
FileWithMetadata,
|
|
90
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
92
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
91
93
|
|
|
92
94
|
function MyForm() {
|
|
93
95
|
const [files, setFiles] = useState<FileWithMetadata[]>([]);
|
|
@@ -454,7 +456,7 @@ import {
|
|
|
454
456
|
import {
|
|
455
457
|
FileUploadV2,
|
|
456
458
|
FileWithMetadata,
|
|
457
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
459
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
458
460
|
|
|
459
461
|
function FileUploadForm() {
|
|
460
462
|
const [file, setFile] = useState<FileWithMetadata | null>(null);
|
|
@@ -506,7 +508,7 @@ import { useState } from "react";
|
|
|
506
508
|
import {
|
|
507
509
|
FileUploadV2,
|
|
508
510
|
FileWithMetadata,
|
|
509
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
511
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
510
512
|
import { Button } from "@adamosuiteservices/ui/button";
|
|
511
513
|
import { Typography } from "@adamosuiteservices/ui/typography";
|
|
512
514
|
|
|
@@ -645,7 +647,7 @@ import { useState, useEffect } from "react";
|
|
|
645
647
|
import {
|
|
646
648
|
FileUploadV2,
|
|
647
649
|
FileWithMetadata,
|
|
648
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
650
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
649
651
|
|
|
650
652
|
function PreloadedFilesExample() {
|
|
651
653
|
const [files, setFiles] = useState<FileWithMetadata[]>([]);
|
|
@@ -703,7 +705,7 @@ import { useState } from "react";
|
|
|
703
705
|
import {
|
|
704
706
|
FileUploadV2,
|
|
705
707
|
FileWithMetadata,
|
|
706
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
708
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
707
709
|
import { v4 as uuidv4 } from "uuid";
|
|
708
710
|
|
|
709
711
|
function CustomIdExample() {
|
|
@@ -730,7 +732,7 @@ import { useState } from "react";
|
|
|
730
732
|
import {
|
|
731
733
|
FileUploadV2,
|
|
732
734
|
FileWithMetadata,
|
|
733
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
735
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
734
736
|
import { Field, FieldLabel, FieldError } from "@adamosuiteservices/ui/field";
|
|
735
737
|
import { Button } from "@adamosuiteservices/ui/button";
|
|
736
738
|
|
|
@@ -809,7 +811,7 @@ import { useState } from "react";
|
|
|
809
811
|
import {
|
|
810
812
|
FileUploadV2,
|
|
811
813
|
FileWithMetadata,
|
|
812
|
-
} from "@adamosuiteservices/ui/file-upload";
|
|
814
|
+
} from "@adamosuiteservices/ui/file-upload-v2";
|
|
813
815
|
import { Typography } from "@adamosuiteservices/ui/typography";
|
|
814
816
|
|
|
815
817
|
function EventTrackingExample() {
|
|
@@ -1111,3 +1113,4 @@ const [files, setFiles] = useState<FileWithMetadata[]>([]);
|
|
|
1111
1113
|
3. Access the native File object via `fileWithMetadata.file`
|
|
1112
1114
|
4. Use `fileWithMetadata.id` for server operations
|
|
1113
1115
|
5. Store server data in `fileWithMetadata.metadata`
|
|
1116
|
+
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
File upload component with **drag & drop** functionality, extension and size validation, preview of selected files, and visual drag area. Supports both single file and multiple file upload. Ideal for forms that require file uploads with immediate user feedback.
|
|
6
6
|
|
|
7
|
+
> **Looking for server integration?** Check out [FileUploadV2](file-upload-v2.md) which includes automatic ID generation and metadata support for server-side file tracking.
|
|
8
|
+
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
11
|
- ✅ Drag & drop with visual feedback
|
package/llm.txt
CHANGED
|
@@ -32,7 +32,7 @@ Before creating ANY component, verify it doesn't exist here. For implementation
|
|
|
32
32
|
- **Label** [`docs/components/ui/label.md`] - `@adamosuiteservices/ui/label`
|
|
33
33
|
- **Input Group** [`docs/components/ui/input-group.md`] - `@adamosuiteservices/ui/input-group`
|
|
34
34
|
- **File Upload** [`docs/components/ui/file-upload.md`] - `@adamosuiteservices/ui/file-upload` ⚠️ Simple file upload
|
|
35
|
-
- **File Upload V2** [`docs/components/ui/file-upload-v2.md`] - `@adamosuiteservices/ui/file-upload` ⚠️ With IDs for server integration
|
|
35
|
+
- **File Upload V2** [`docs/components/ui/file-upload-v2.md`] - `@adamosuiteservices/ui/file-upload-v2` ⚠️ With IDs for server integration
|
|
36
36
|
|
|
37
37
|
### Overlay Components (8)
|
|
38
38
|
- **Dialog** [`docs/components/ui/dialog.md`] - `@adamosuiteservices/ui/dialog` (modal)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamosuiteservices/ui",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -118,6 +118,10 @@
|
|
|
118
118
|
"types": "./dist/components/ui/file-upload/file-upload.d.ts",
|
|
119
119
|
"import": "./dist/file-upload.js"
|
|
120
120
|
},
|
|
121
|
+
"./file-upload-v2": {
|
|
122
|
+
"types": "./dist/components/ui/file-upload-v2/file-upload-v2.d.ts",
|
|
123
|
+
"import": "./dist/file-upload-v2.js"
|
|
124
|
+
},
|
|
121
125
|
"./hover-card": {
|
|
122
126
|
"types": "./dist/components/ui/hover-card/hover-card.d.ts",
|
|
123
127
|
"import": "./dist/hover-card.js"
|
|
File without changes
|