@janovix/blocks 1.0.0-rc.6 → 1.0.0-rc.7

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/README.md CHANGED
@@ -232,31 +232,49 @@ interface AvatarEditorProps {
232
232
 
233
233
  ### AvatarEditorDialog
234
234
 
235
- A dialog wrapper for the AvatarEditor component with upload functionality.
235
+ A complete avatar editing experience with preview display and edit dialog.
236
236
 
237
237
  **Features:**
238
238
 
239
- - File upload with drag & drop
240
- - Image preview
241
- - Integrated AvatarEditor
242
- - Cancel/Save actions
243
- - File type validation (image/\*)
239
+ - Large avatar display with edit button
240
+ - Opens fullscreen drawer on mobile, modal on desktop
241
+ - Integrated AvatarEditor with all controls
242
+ - Controlled component (value/onChange)
243
+ - Optional async save handler with feedback
244
+ - Success/error feedback messages
245
+ - Customizable sizes and labels
246
+ - Accessibility optimized
244
247
 
245
248
  **Usage:**
246
249
 
247
250
  ```tsx
248
251
  import { AvatarEditorDialog } from "@janovix/blocks";
249
252
 
253
+ // Basic usage with value/onChange
254
+ <AvatarEditorDialog value={avatar} onChange={setAvatar} />;
255
+
256
+ // With async save handler
250
257
  <AvatarEditorDialog
251
- isOpen={isOpen}
252
- onOpenChange={setIsOpen}
253
- onSave={(editedImage) => {
254
- console.log("Saving image:", editedImage);
258
+ value={avatar}
259
+ onChange={setAvatar}
260
+ onSave={async (dataUrl) => {
261
+ const result = await uploadAvatar(dataUrl);
262
+ return result.success;
255
263
  }}
256
- title="Edit Avatar"
257
- uploadLabel="Upload Image"
258
- cancelLabel="Cancel"
259
- saveLabel="Save"
264
+ dialogTitle="Edit Profile Picture"
265
+ acceptText="Save"
266
+ cancelText="Cancel"
267
+ successMessage="Avatar saved successfully!"
268
+ errorMessage="Failed to save avatar"
269
+ />;
270
+
271
+ // With custom sizes
272
+ <AvatarEditorDialog
273
+ value={avatar}
274
+ onChange={setAvatar}
275
+ displaySize={120}
276
+ editorSize={280}
277
+ outputSize={512}
260
278
  />;
261
279
  ```
262
280
 
@@ -264,13 +282,20 @@ import { AvatarEditorDialog } from "@janovix/blocks";
264
282
 
265
283
  ```typescript
266
284
  interface AvatarEditorDialogProps {
267
- isOpen: boolean;
268
- onOpenChange: (open: boolean) => void;
269
- onSave: (editedImage: string) => void;
270
- title?: string;
271
- uploadLabel?: string;
272
- cancelLabel?: string;
273
- saveLabel?: string;
285
+ value?: string | null;
286
+ onChange?: (dataUrl: string | null) => void;
287
+ onSave?: (dataUrl: string) => Promise<boolean> | boolean;
288
+ displaySize?: number;
289
+ editorSize?: number;
290
+ outputSize?: number;
291
+ placeholder?: string;
292
+ editLabel?: string;
293
+ dialogTitle?: string;
294
+ acceptText?: string;
295
+ cancelText?: string;
296
+ successMessage?: string;
297
+ errorMessage?: string;
298
+ className?: string;
274
299
  }
275
300
  ```
276
301