ultra-image-uploader 1.0.0 → 2.0.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 (37) hide show
  1. package/README.md +176 -354
  2. package/dist/components/ImageUploader.d.ts +7 -46
  3. package/dist/components/ImageUploader.d.ts.map +1 -1
  4. package/dist/components/ImageUploader.js +83 -93
  5. package/dist/components/ImageUploader.js.map +1 -1
  6. package/dist/index.d.ts +7 -7
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +7 -9
  9. package/dist/index.js.map +1 -1
  10. package/dist/providers/index.d.ts +23 -17
  11. package/dist/providers/index.d.ts.map +1 -1
  12. package/dist/providers/index.js +119 -27
  13. package/dist/providers/index.js.map +1 -1
  14. package/dist/types/index.d.ts +25 -32
  15. package/dist/types/index.d.ts.map +1 -1
  16. package/dist/types/index.js +1 -1
  17. package/package.json +5 -6
  18. package/dist/providers/BaseProvider.d.ts +0 -19
  19. package/dist/providers/BaseProvider.d.ts.map +0 -1
  20. package/dist/providers/BaseProvider.js +0 -48
  21. package/dist/providers/BaseProvider.js.map +0 -1
  22. package/dist/providers/CloudinaryProvider.d.ts +0 -17
  23. package/dist/providers/CloudinaryProvider.d.ts.map +0 -1
  24. package/dist/providers/CloudinaryProvider.js +0 -123
  25. package/dist/providers/CloudinaryProvider.js.map +0 -1
  26. package/dist/providers/ImgBBProvider.d.ts +0 -13
  27. package/dist/providers/ImgBBProvider.d.ts.map +0 -1
  28. package/dist/providers/ImgBBProvider.js +0 -68
  29. package/dist/providers/ImgBBProvider.js.map +0 -1
  30. package/dist/utils/imageUpload.d.ts +0 -11
  31. package/dist/utils/imageUpload.d.ts.map +0 -1
  32. package/dist/utils/imageUpload.js +0 -32
  33. package/dist/utils/imageUpload.js.map +0 -1
  34. package/dist/utils/upload.d.ts +0 -49
  35. package/dist/utils/upload.d.ts.map +0 -1
  36. package/dist/utils/upload.js +0 -62
  37. package/dist/utils/upload.js.map +0 -1
package/README.md CHANGED
@@ -2,12 +2,13 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- A modern, feature-rich React image upload component with support for multiple hosting providers.
5
+ A modern, beautiful React image upload component with support for multiple providers.
6
6
 
7
7
  [![npm version](https://badge.fury.io/js/ultra-image-uploader.svg)](https://www.npmjs.com/package/ultra-image-uploader)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green)](https://opensource.org/licenses/MIT)
9
10
 
10
- **Features** • **Multiple Providers** • **Themeable** **TypeScript** • **Production Ready**
11
+ **Modern UI** • **Multiple Providers** • **5 Themes** • **Production Ready**
11
12
 
12
13
  </div>
13
14
 
@@ -15,32 +16,25 @@ A modern, feature-rich React image upload component with support for multiple ho
15
16
 
16
17
  ## Features
17
18
 
18
- - **Multiple Provider Support** - Built-in support for ImgBB and Cloudinary
19
- - **Drag & Drop** - Intuitive drag and drop interface
20
- - **Upload Progress** - Real-time upload progress tracking
21
- - **File Validation** - Comprehensive file type, size, and dimension validation
22
- - **Theme System** - 5 built-in themes + custom theme support
23
- - **Auto Upload** - Optional automatic upload on file selection
24
- - **Image Preview** - Instant preview with file size display
25
- - **Error Handling** - Graceful error handling with user feedback
26
- - **TypeScript** - Fully typed for excellent developer experience
27
- - **Customizable** - Highly customizable styling and behavior
28
- - **Tree Shakeable** - Optimized bundle size
19
+ - **Beautiful UI** - Modern, clean design with smooth animations
20
+ - **5 Built-in Themes** - Light, Dark, Modern, Ocean, Sunset
21
+ - **Custom Themes** - Create your own color schemes
22
+ - **Multiple Providers** - ImgBB & Cloudinary support
23
+ - **Drag & Drop** - Intuitive file handling
24
+ - **Upload Progress** - Real-time progress tracking
25
+ - **File Validation** - Type and size validation
26
+ - **Auto Upload** - Optional automatic uploading
27
+ - **TypeScript** - Fully typed
28
+ - **Simple API** - Easy to use
29
29
 
30
30
  ## Installation
31
31
 
32
32
  ```bash
33
33
  npm install ultra-image-uploader
34
- # or
35
- yarn add ultra-image-uploader
36
- # or
37
- pnpm add ultra-image-uploader
38
34
  ```
39
35
 
40
36
  ## Quick Start
41
37
 
42
- ### Basic Usage
43
-
44
38
  ```tsx
45
39
  import { ImageUploader } from "ultra-image-uploader";
46
40
  import { useState } from "react";
@@ -52,447 +46,275 @@ function App() {
52
46
  <ImageUploader
53
47
  images={images}
54
48
  setImages={setImages}
55
- multiple={true}
49
+ multiple
56
50
  theme="light"
57
51
  />
58
52
  );
59
53
  }
60
54
  ```
61
55
 
62
- ### With ImgBB Upload
56
+ ## Themes
57
+
58
+ Choose from 5 beautiful themes:
63
59
 
64
60
  ```tsx
65
- import { ImageUploader, uploadImagesToImageBB } from "ultra-image-uploader";
66
- import { useState } from "react";
61
+ // Light (default)
62
+ <ImageUploader theme="light" images={images} setImages={setImages} />
67
63
 
68
- function ImageUploadForm() {
69
- const [images, setImages] = useState<File[]>([]);
70
- const [uploadedUrls, setUploadedUrls] = useState<string[]>([]);
71
- const [loading, setLoading] = useState(false);
64
+ // Dark
65
+ <ImageUploader theme="dark" images={images} setImages={setImages} />
72
66
 
73
- const handleUpload = async () => {
74
- setLoading(true);
75
- try {
76
- const result = await uploadImagesToImageBB(
77
- images,
78
- "your-imgbb-api-key-here"
79
- );
80
- setUploadedUrls(result.urls);
81
- console.log("Uploaded URLs:", result.urls);
82
- } catch (error) {
83
- console.error("Error uploading images:", error);
84
- } finally {
85
- setLoading(false);
86
- }
87
- };
67
+ // Modern (pink)
68
+ <ImageUploader theme="modern" images={images} setImages={setImages} />
88
69
 
89
- return (
90
- <div>
91
- <ImageUploader
92
- images={images}
93
- setImages={setImages}
94
- multiple={true}
95
- theme="modern"
96
- />
97
- <button
98
- onClick={handleUpload}
99
- disabled={loading || images.length === 0}
100
- className="bg-blue-500 text-white px-4 py-2 rounded disabled:opacity-50"
101
- >
102
- {loading ? "Uploading..." : "Upload to ImgBB"}
103
- </button>
104
-
105
- {uploadedUrls.length > 0 && (
106
- <div>
107
- <h3>Uploaded Images:</h3>
108
- {uploadedUrls.map((url) => (
109
- <img key={url} src={url} alt="Uploaded" />
110
- ))}
111
- </div>
112
- )}
113
- </div>
114
- );
115
- }
70
+ // Ocean (cyan)
71
+ <ImageUploader theme="ocean" images={images} setImages={setImages} />
72
+
73
+ // Sunset (orange)
74
+ <ImageUploader theme="sunset" images={images} setImages={setImages} />
116
75
  ```
117
76
 
118
- ### With Cloudinary
77
+ ## Custom Theme
119
78
 
120
79
  ```tsx
121
- import { ImageUploader, uploadImagesToCloudinary } from "ultra-image-uploader";
122
- import { useState } from "react";
80
+ import { ImageUploader, type ThemeConfig } from "ultra-image-uploader";
81
+
82
+ const customTheme: ThemeConfig = {
83
+ primary: '#ff6b6b',
84
+ background: '#fff',
85
+ border: '#ddd',
86
+ text: '#333',
87
+ textSecondary: '#666',
88
+ error: '#e74c3c',
89
+ success: '#2ecc71',
90
+ radius: '8px',
91
+ };
92
+
93
+ <ImageUploader
94
+ images={images}
95
+ setImages={setImages}
96
+ theme={customTheme}
97
+ />
98
+ ```
99
+
100
+ ## Upload to ImgBB
123
101
 
124
- function CloudinaryUpload() {
102
+ ```tsx
103
+ import { ImageUploader, uploadImagesToImageBB } from "ultra-image-uploader";
104
+
105
+ function UploadToImgBB() {
125
106
  const [images, setImages] = useState<File[]>([]);
126
- const [loading, setLoading] = useState(false);
127
107
 
128
108
  const handleUpload = async () => {
129
- setLoading(true);
130
- try {
131
- const results = await uploadImagesToCloudinary(
132
- images,
133
- {
134
- cloudName: "your-cloud-name",
135
- uploadPreset: "your-upload-preset", // for unsigned uploads
136
- },
137
- {
138
- onProgress: (progress) => {
139
- console.log(`Upload: ${progress.percentage}%`);
140
- },
141
- transformOptions: {
142
- width: 800,
143
- height: 600,
144
- crop: "limit",
145
- quality: 80,
146
- },
147
- }
148
- );
149
- console.log("Uploaded:", results);
150
- } catch (error) {
151
- console.error("Error:", error);
152
- } finally {
153
- setLoading(false);
154
- }
109
+ const result = await uploadImagesToImageBB(images, 'YOUR_API_KEY');
110
+ console.log('Uploaded:', result.urls);
155
111
  };
156
112
 
157
113
  return (
158
114
  <div>
159
- <ImageUploader
160
- images={images}
161
- setImages={setImages}
162
- multiple={true}
163
- theme="dark"
164
- />
165
- <button onClick={handleUpload} disabled={loading}>
166
- Upload to Cloudinary
167
- </button>
115
+ <ImageUploader images={images} setImages={setImages} multiple />
116
+ <button onClick={handleUpload}>Upload</button>
168
117
  </div>
169
118
  );
170
119
  }
171
120
  ```
172
121
 
173
- ### Auto Upload Mode
122
+ ## Upload to Cloudinary
174
123
 
175
124
  ```tsx
176
- import { ImageUploader } from "ultra-image-uploader";
177
- import { useState } from "react";
125
+ import { ImageUploader, uploadImagesToCloudinary } from "ultra-image-uploader";
178
126
 
179
- function AutoUploadExample() {
127
+ function UploadToCloudinary() {
180
128
  const [images, setImages] = useState<File[]>([]);
181
- const [uploadedUrls, setUploadedUrls] = useState<string[]>([]);
129
+
130
+ const handleUpload = async () => {
131
+ const results = await uploadImagesToCloudinary(images, {
132
+ cloudName: 'your-cloud-name',
133
+ uploadPreset: 'your-upload-preset',
134
+ });
135
+ console.log('Uploaded:', results.map(r => r.url));
136
+ };
182
137
 
183
138
  return (
184
- <ImageUploader
185
- images={images}
186
- setImages={setImages}
187
- multiple={true}
188
- autoUpload={true}
189
- uploadConfig={{
190
- provider: "imgbb",
191
- config: { apiKey: "your-api-key" },
192
- }}
193
- onUploadComplete={(urls) => {
194
- setUploadedUrls(urls);
195
- console.log("All uploads complete!", urls);
196
- }}
197
- onUploadError={(error) => {
198
- console.error("Upload failed:", error);
199
- }}
200
- theme="colorful"
201
- />
139
+ <div>
140
+ <ImageUploader images={images} setImages={setImages} multiple theme="dark" />
141
+ <button onClick={handleUpload}>Upload</button>
142
+ </div>
202
143
  );
203
144
  }
204
145
  ```
205
146
 
206
- ## Theming
207
-
208
- ### Built-in Themes
209
-
210
- The component comes with 5 beautiful themes:
211
-
212
- - **`light`** - Clean and modern light theme
213
- - **`dark`** - Sleek dark theme
214
- - **`modern`** - Purple-themed modern design
215
- - **`minimal`** - Minimalist black and white
216
- - **`colorful`** - Warm amber/yellow theme
147
+ ## Auto Upload Mode
217
148
 
218
149
  ```tsx
219
- <ImageUploader images={images} setImages={setImages} theme="dark" />
220
- ```
221
-
222
- ### Custom Theme
223
-
224
- Create your own theme with full customization:
225
-
226
- ```tsx
227
- import { ImageUploader, type UploaderTheme } from "ultra-image-uploader";
228
-
229
- const customTheme: UploaderTheme = {
230
- primary: "#ff6b6b",
231
- primaryHover: "#ee5a5a",
232
- background: "#f7f7f7",
233
- border: "#ddd",
234
- text: "#333",
235
- textSecondary: "#666",
236
- error: "#e74c3c",
237
- success: "#2ecc71",
238
- radius: "8px",
239
- };
240
-
241
150
  <ImageUploader
242
151
  images={images}
243
152
  setImages={setImages}
244
- customTheme={customTheme}
153
+ multiple
154
+ autoUpload
155
+ uploadConfig={{
156
+ provider: 'imgbb',
157
+ config: { apiKey: 'your-api-key' },
158
+ }}
159
+ onUploadComplete={(urls) => console.log('Done!', urls)}
160
+ onUploadError={(error) => console.error('Error:', error)}
245
161
  />
246
162
  ```
247
163
 
248
- ## Component Props
164
+ ## Props
249
165
 
250
166
  | Prop | Type | Default | Description |
251
167
  |------|------|---------|-------------|
252
- | `images` | `File[]` | **Required** | Array of selected image files |
253
- | `setImages` | `(files: File[]) => void` | **Required** | Function to update images array |
254
- | `mode` | `'add' \| 'update'` | `'add'` | Component operation mode |
255
- | `defaultImages` | `string[]` | `[]` | Existing image URLs for update mode |
256
- | `multiple` | `boolean` | `false` | Allow multiple file selection |
257
- | `theme` | `ThemePreset` | `'light'` | Built-in theme to use |
258
- | `customTheme` | `UploaderTheme` | `undefined` | Custom theme configuration |
168
+ | `images` | `File[]` | **Required** | Selected image files |
169
+ | `setImages` | `(files: File[]) => void` | **Required** | Update images state |
170
+ | `multiple` | `boolean` | `false` | Allow multiple files |
171
+ | `theme` | `'light' \| 'dark' \| 'modern' \| 'ocean' \| 'sunset' \| ThemeConfig` | `'light'` | Theme to use |
172
+ | `mode` | `'add' \| 'update'` | `'add'` | Component mode |
173
+ | `defaultImages` | `string[]` | `[]` | Existing image URLs |
259
174
  | `uploadText` | `string` | `'Drop images here...'` | Upload area text |
260
- | `typeText` | `string` | `'PNG, JPG,...'` | File type hint text |
261
- | `maxSize` | `number` | `10485760` | Max file size in bytes (10MB) |
262
- | `allowedTypes` | `string[]` | `['image/jpeg', ...]` | Allowed MIME types |
263
- | `showFileSize` | `boolean` | `true` | Show file size on preview |
264
- | `dragAndDrop` | `boolean` | `true` | Enable drag and drop |
265
- | `previewWidth` | `number` | `150` | Preview image width in px |
266
- | `previewHeight` | `number` | `150` | Preview image height in px |
267
- | `className` | `string` | `''` | Additional CSS classes |
268
- | `autoUpload` | `boolean` | `false` | Auto-upload on file selection |
269
- | `uploadConfig` | `{ provider, config }` | `undefined` | Upload configuration |
270
- | `onUploadComplete` | `(urls: string[]) => void` | `undefined` | Callback on upload success |
271
- | `onUploadError` | `(error: Error) => void` | `undefined` | Callback on upload error |
272
-
273
- ## Upload Providers
274
-
275
- ### ImgBB
276
-
277
- Free image hosting with simple API:
278
-
279
- ```tsx
280
- import { uploadImagesToImageBB } from "ultra-image-uploader";
281
-
282
- const result = await uploadImagesToImageBB(
283
- images,
284
- "your-imgbb-api-key"
285
- );
286
- console.log(result.urls);
287
- ```
175
+ | `maxSize` | `number` | `10485760` | Max file size (bytes) |
176
+ | `allowedTypes` | `string[]` | Image types | Allowed MIME types |
177
+ | `showFileSize` | `boolean` | `true` | Show file size |
178
+ | `dragAndDrop` | `boolean` | `true` | Enable drag-drop |
179
+ | `previewWidth` | `number` | `140` | Preview width (px) |
180
+ | `previewHeight` | `number` | `140` | Preview height (px) |
181
+ | `autoUpload` | `boolean` | `false` | Auto upload files |
182
+ | `uploadConfig` | `{ provider, config }` | `undefined` | Upload config |
183
+ | `onUploadComplete` | `(urls: string[]) => void` | `undefined` | Upload success callback |
184
+ | `onUploadError` | `(error: Error) => void` | `undefined` | Upload error callback |
185
+ | `className` | `string` | `''` | Extra CSS classes |
288
186
 
289
- **Get API Key:** [imgbb.com/settings/api](https://imgbb.com/settings/api)
187
+ ## Upload Functions
290
188
 
291
- ### Cloudinary
189
+ ### `uploadImage(file, provider, config, options?)`
292
190
 
293
- Enterprise-grade image hosting with transformations:
191
+ Upload a single image.
294
192
 
295
193
  ```tsx
296
- import { uploadImagesToCloudinary } from "ultra-image-uploader";
194
+ import { uploadImage } from "ultra-image-uploader";
297
195
 
298
- const results = await uploadImagesToCloudinary(
299
- images,
196
+ const result = await uploadImage(
197
+ file,
198
+ 'imgbb',
199
+ { apiKey: 'your-key' },
300
200
  {
301
- cloudName: "your-cloud-name",
302
- uploadPreset: "your-upload-preset", // optional
303
- },
304
- {
305
- onProgress: (progress) => console.log(progress.percentage),
306
- transformOptions: {
307
- width: 800,
308
- height: 600,
309
- quality: 85,
310
- crop: "limit",
311
- },
201
+ onProgress: (p) => console.log(p.percentage + '%'),
312
202
  }
313
203
  );
204
+ console.log(result.url);
314
205
  ```
315
206
 
316
- **Get Credentials:**
317
- 1. Sign up at [cloudinary.com](https://cloudinary.com)
318
- 2. Get your cloud name from dashboard
319
- 3. Create an upload preset (Settings → Upload → Upload presets)
320
-
321
- ## Advanced Usage
322
-
323
- ### Custom Provider
207
+ ### `uploadImages(files, provider, config, options?)`
324
208
 
325
- You can create custom upload providers:
209
+ Upload multiple images.
326
210
 
327
211
  ```tsx
328
- import { BaseImageProvider } from "ultra-image-uploader";
329
-
330
- class CustomProvider extends BaseImageProvider {
331
- name = 'custom' as const;
332
-
333
- async upload(file: File, config: ProviderConfig) {
334
- // Your upload logic here
335
- return {
336
- url: "https://...",
337
- provider: "custom",
338
- originalFile: file,
339
- };
340
- }
341
-
342
- async uploadMultiple(files: File[], config: ProviderConfig) {
343
- return Promise.all(files.map(f => this.upload(f, config)));
344
- }
345
- }
346
-
347
- // Register and use
348
- import { providerRegistry } from "ultra-image-uploader";
349
- providerRegistry.register(new CustomProvider());
212
+ const results = await uploadImages(files, 'cloudinary', {
213
+ cloudName: 'your-cloud',
214
+ });
350
215
  ```
351
216
 
352
- ### File Validation
217
+ ### `uploadImagesToImageBB(images, apiKey)`
218
+
219
+ Upload to ImgBB (shorthand).
353
220
 
354
221
  ```tsx
355
- import {
356
- validateImageFile,
357
- validateFileComplete,
358
- formatFileSize,
359
- } from "ultra-image-uploader";
222
+ const { urls } = await uploadImagesToImageBB(images, 'api-key');
223
+ ```
360
224
 
361
- // Quick validation
362
- const validation = validateImageFile(file, {
363
- maxSize: 5 * 1024 * 1024, // 5MB
364
- allowedTypes: ["image/jpeg", "image/png"],
365
- });
225
+ ### `uploadImagesToCloudinary(files, config, options?)`
366
226
 
367
- if (!validation.valid) {
368
- console.error("Errors:", validation.errors);
369
- }
227
+ Upload to Cloudinary (shorthand).
370
228
 
371
- // Complete validation (with dimensions)
372
- const completeValidation = await validateFileComplete(file, {
373
- maxSize: 10 * 1024 * 1024,
374
- minWidth: 800,
375
- maxWidth: 4000,
376
- minHeight: 600,
377
- maxHeight: 3000,
229
+ ```tsx
230
+ const results = await uploadImagesToCloudinary(images, {
231
+ cloudName: 'your-cloud',
232
+ uploadPreset: 'your-preset',
378
233
  });
379
234
  ```
380
235
 
381
- ### Transforming Cloudinary Images
382
-
383
- Generate transformed URLs for existing Cloudinary images:
236
+ ## Get API Keys
384
237
 
385
- ```tsx
386
- import { CloudinaryProvider } from "ultra-image-uploader";
238
+ ### ImgBB
239
+ 1. Go to [imgbb.com/settings/api](https://imgbb.com/settings/api)
240
+ 2. Copy your API key
387
241
 
388
- const transformedUrl = CloudinaryProvider.generateTransformedUrl(
389
- "https://res.cloudinary.com/.../image.jpg",
390
- {
391
- width: 400,
392
- height: 300,
393
- crop: "fill",
394
- quality: 80,
395
- format: "webp",
396
- }
397
- );
398
- ```
242
+ ### Cloudinary
243
+ 1. Sign up at [cloudinary.com](https://cloudinary.com)
244
+ 2. Get your cloud name from dashboard
245
+ 3. Create upload preset (Settings → Upload)
399
246
 
400
- ## TypeScript Support
247
+ ## TypeScript
401
248
 
402
- The package is fully typed. Import types as needed:
249
+ All types are exported:
403
250
 
404
251
  ```tsx
405
252
  import type {
406
253
  UploadProvider,
407
254
  UploadResult,
408
- ProviderConfig,
409
- UploadOptions,
255
+ ThemeConfig,
410
256
  ImageUploaderProps,
411
- UploaderTheme,
412
- ValidationResult,
413
257
  FileValidationOptions,
258
+ // ... more
414
259
  } from "ultra-image-uploader";
415
260
  ```
416
261
 
417
262
  ## Examples
418
263
 
419
- ### E-commerce Product Image Upload
264
+ ### Profile Picture
420
265
 
421
266
  ```tsx
422
- function ProductImageUpload() {
423
- const [images, setImages] = useState<File[]>([]);
424
- const [existingImages, setExistingImages] = useState<string[]>([
425
- "https://example.com/product1.jpg",
426
- ]);
427
-
428
- return (
429
- <ImageUploader
430
- images={images}
431
- setImages={setImages}
432
- mode="update"
433
- defaultImages={existingImages}
434
- multiple={true}
435
- maxSize={5 * 1024 * 1024} // 5MB
436
- allowedTypes={["image/jpeg", "image/webp"]}
437
- theme="modern"
438
- previewWidth={200}
439
- previewHeight={200}
440
- />
441
- );
442
- }
267
+ <ImageUploader
268
+ images={avatar}
269
+ setImages={setAvatar}
270
+ multiple={false}
271
+ maxSize={2 * 1024 * 1024}
272
+ theme="modern"
273
+ />
443
274
  ```
444
275
 
445
- ### Profile Picture Upload
276
+ ### Product Gallery
446
277
 
447
278
  ```tsx
448
- function ProfilePicUpload() {
449
- const [avatar, setAvatar] = useState<File[]>([]);
450
-
451
- return (
452
- <ImageUploader
453
- images={avatar}
454
- setImages={setAvatar}
455
- multiple={false}
456
- maxSize={2 * 1024 * 1024} // 2MB
457
- previewWidth={180}
458
- previewHeight={180}
459
- theme="minimal"
460
- />
461
- );
462
- }
279
+ <ImageUploader
280
+ images={products}
281
+ setImages={setProducts}
282
+ multiple
283
+ mode="update"
284
+ defaultImages={existingImages}
285
+ allowedTypes={['image/jpeg', 'image/webp']}
286
+ theme="ocean"
287
+ />
463
288
  ```
464
289
 
465
- ## Migration from v0.0.x
466
-
467
- If you're upgrading from version 0.0.x, the API is backward compatible:
290
+ ### Custom Colors
468
291
 
469
292
  ```tsx
470
- // Old API still works
471
- import { uploadImagesToImageBB } from "ultra-image-uploader";
472
- const { urls } = await uploadImagesToImageBB(images, apiKey);
473
-
474
- // But you can now use the new provider-agnostic API
475
- import { uploadImages } from "ultra-image-uploader";
476
- const results = await uploadImages(images, "imgbb", { apiKey });
477
- const urls = results.map(r => r.url);
293
+ <ImageUploader
294
+ images={images}
295
+ setImages={setImages}
296
+ theme={{
297
+ primary: '#00d9ff',
298
+ background: '#0a0a0a',
299
+ border: '#333',
300
+ text: '#fff',
301
+ textSecondary: '#999',
302
+ error: '#ff4757',
303
+ success: '#2ed573',
304
+ radius: '16px',
305
+ }}
306
+ />
478
307
  ```
479
308
 
480
- ## Browser Support
481
-
482
- - Chrome/Edge (latest)
483
- - Firefox (latest)
484
- - Safari (latest)
485
- - Mobile browsers
486
-
487
309
  ## License
488
310
 
489
311
  MIT © Digontha Das
490
312
 
491
- ## Support & Contributing
313
+ ## Links
492
314
 
493
- - **Issues:** [GitHub Issues](https://github.com/digontha/ultra-image-uploader/issues)
494
- - **Contributing:** Pull requests are welcome!
495
- - **Discussions:** Ask questions and share ideas
315
+ - [GitHub](https://github.com/digontha/ultra-image-uploader)
316
+ - [NPM](https://www.npmjs.com/package/ultra-image-uploader)
317
+ - [Issues](https://github.com/digontha/ultra-image-uploader/issues)
496
318
 
497
319
  ---
498
320