@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 +46 -21
- package/dist/index.cjs +182 -6013
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +128 -5961
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -232,31 +232,49 @@ interface AvatarEditorProps {
|
|
|
232
232
|
|
|
233
233
|
### AvatarEditorDialog
|
|
234
234
|
|
|
235
|
-
A
|
|
235
|
+
A complete avatar editing experience with preview display and edit dialog.
|
|
236
236
|
|
|
237
237
|
**Features:**
|
|
238
238
|
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
- Integrated AvatarEditor
|
|
242
|
-
-
|
|
243
|
-
-
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
onSave={(
|
|
254
|
-
|
|
258
|
+
value={avatar}
|
|
259
|
+
onChange={setAvatar}
|
|
260
|
+
onSave={async (dataUrl) => {
|
|
261
|
+
const result = await uploadAvatar(dataUrl);
|
|
262
|
+
return result.success;
|
|
255
263
|
}}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
onSave
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
|