allaw-ui 3.0.4 → 3.0.5

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.
@@ -5,7 +5,7 @@ export interface FileUploaderProps {
5
5
  maxFileSizeMB: number;
6
6
  enableDragAndDrop?: boolean;
7
7
  enableCropping?: boolean;
8
- cropShape?: "circle" | "square";
8
+ cropShape?: "circle" | "square" | "banner";
9
9
  iconUrl?: string;
10
10
  descriptionParts?: {
11
11
  beforeLink: string;
@@ -202,7 +202,9 @@ var FileUploader = function (_a) {
202
202
  var isSelectedImage = selectedFile && isImageFile(selectedFile);
203
203
  return (React.createElement("div", { className: styles.upload_main_container },
204
204
  enableDragAndDrop ? (React.createElement("div", { className: "".concat(styles.upload_container, " ").concat(isHovering ? styles.drag_over : "", " ").concat(previewUrl ? styles.upload_container_with_preview : ""), onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: function () { var _a; return !previewUrl && ((_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click()); } },
205
- previewUrl ? (React.createElement("div", { className: styles.preview_container, onClick: function (e) {
205
+ previewUrl ? (React.createElement("div", { className: "".concat(styles.preview_container, " ").concat((cropMetadata === null || cropMetadata === void 0 ? void 0 : cropMetadata.shape) === "banner" || cropShape === "banner"
206
+ ? styles.preview_container_banner
207
+ : ""), onClick: function (e) {
206
208
  var _a;
207
209
  // Ne pas déclencher si on clique sur le conteneur d'image
208
210
  if (!e.target.closest(".".concat(styles.preview_image_container))) {
@@ -323,6 +323,11 @@
323
323
  cursor: pointer;
324
324
  }
325
325
 
326
+ /* Ajuste la hauteur du conteneur pour la bannière */
327
+ .preview_container.preview_container_banner {
328
+ height: 120px;
329
+ }
330
+
326
331
  .preview_image_container {
327
332
  position: relative;
328
333
  width: 280px;
@@ -341,6 +346,12 @@
341
346
  border-radius: 8px;
342
347
  }
343
348
 
349
+ .preview_image_banner {
350
+ width: 320px;
351
+ height: 60px;
352
+ border-radius: 4px;
353
+ }
354
+
344
355
  .preview_image_wrapper {
345
356
  position: absolute;
346
357
  width: auto;
@@ -3,11 +3,11 @@ export interface CropMetadata {
3
3
  zoom: number;
4
4
  offsetX: number;
5
5
  offsetY: number;
6
- shape: "circle" | "square";
6
+ shape: "circle" | "square" | "banner";
7
7
  }
8
8
  interface ImageCropperModalProps {
9
9
  file: File;
10
- shape: "circle" | "square";
10
+ shape: "circle" | "square" | "banner";
11
11
  onCancel: () => void;
12
12
  onConfirm: (cropMetadata: CropMetadata) => void;
13
13
  }
@@ -78,6 +78,12 @@
78
78
  border-radius: 50%;
79
79
  }
80
80
 
81
+ .crop_area_banner {
82
+ width: 320px;
83
+ height: 60px;
84
+ border-radius: 4px;
85
+ }
86
+
81
87
  .crop_area::before {
82
88
  content: "";
83
89
  position: absolute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",