@skalfa/skalfa-component 1.0.7 → 1.0.9

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 (107) hide show
  1. package/dist/accordion/Accordion.component.js +2 -3
  2. package/dist/breadcrumb/Breadcrumb.component.js +2 -3
  3. package/dist/button/Button.component.d.ts +2 -1
  4. package/dist/button/Button.component.js +2 -2
  5. package/dist/carousel/Carousel.component.js +2 -3
  6. package/dist/chip/Chip.component.js +2 -3
  7. package/dist/contexts-mock.d.ts +2 -0
  8. package/dist/contexts-mock.js +10 -0
  9. package/dist/input/Checkbox.component.js +2 -3
  10. package/dist/input/Input.component.d.ts +3 -2
  11. package/dist/input/Input.component.js +3 -3
  12. package/dist/input/InputCheckbox.component.js +1 -1
  13. package/dist/input/InputCurrency.component.d.ts +3 -2
  14. package/dist/input/InputCurrency.component.js +3 -3
  15. package/dist/input/InputDate.component.js +4 -5
  16. package/dist/input/InputDatetime.component.d.ts +3 -2
  17. package/dist/input/InputDatetime.component.js +3 -3
  18. package/dist/input/InputDocument.component.js +7 -8
  19. package/dist/input/InputImage.component.js +3 -4
  20. package/dist/input/InputNumber.component.js +3 -4
  21. package/dist/input/InputPassword.component.js +3 -3
  22. package/dist/input/InputRadio.component.js +1 -1
  23. package/dist/input/InputTime.component.js +3 -3
  24. package/dist/input/InputValues.component.js +3 -4
  25. package/dist/input/Select.component.js +6 -7
  26. package/dist/modal/FloatingPage.component.d.ts +3 -1
  27. package/dist/modal/FloatingPage.component.js +7 -3
  28. package/dist/modal/Modal.component.js +1 -2
  29. package/dist/modal/ModalConfirm.component.d.ts +2 -2
  30. package/dist/modal/ModalConfirm.component.js +14 -12
  31. package/dist/modal/Toast.component.js +1 -2
  32. package/dist/nav/Bottombar.component.d.ts +2 -2
  33. package/dist/nav/Bottombar.component.js +7 -8
  34. package/dist/nav/Footer.component.d.ts +2 -2
  35. package/dist/nav/Footer.component.js +6 -7
  36. package/dist/nav/Headbar.component.js +2 -3
  37. package/dist/nav/Navbar.component.d.ts +2 -2
  38. package/dist/nav/Navbar.component.js +3 -4
  39. package/dist/nav/Sidebar.component.d.ts +3 -7
  40. package/dist/nav/Sidebar.component.js +14 -17
  41. package/dist/supervision/FormSupervision.component.d.ts +4 -29
  42. package/dist/supervision/FormSupervision.component.js +84 -136
  43. package/dist/supervision/TableSupervision.component.d.ts +17 -26
  44. package/dist/supervision/TableSupervision.component.js +207 -193
  45. package/dist/table/ControlBar.component.js +15 -16
  46. package/dist/table/FilterComponent.js +4 -6
  47. package/dist/table/Pagination.component.js +2 -3
  48. package/dist/table/Table.component.js +3 -4
  49. package/dist/wrap/Swipe.component.js +2 -2
  50. package/package.json +18 -10
  51. package/src/accordion/Accordion.component.tsx +87 -0
  52. package/src/breadcrumb/Breadcrumb.component.tsx +79 -0
  53. package/src/button/Button.component.tsx +89 -0
  54. package/src/card/AlertCard.component.tsx +69 -0
  55. package/src/card/Card.component.tsx +25 -0
  56. package/src/card/DashboardCard.component.tsx +44 -0
  57. package/src/card/GalleryCard.component.tsx +50 -0
  58. package/src/card/ProductCard.component.tsx +65 -0
  59. package/src/card/ProfileCard.component.tsx +71 -0
  60. package/src/carousel/Carousel.component.tsx +111 -0
  61. package/src/chip/Chip.component.tsx +38 -0
  62. package/src/contexts-mock.ts +6 -0
  63. package/src/index.ts +70 -0
  64. package/src/input/Checkbox.component.tsx +102 -0
  65. package/src/input/Input.component.tsx +334 -0
  66. package/src/input/InputCheckbox.component.tsx +174 -0
  67. package/src/input/InputCurrency.component.tsx +165 -0
  68. package/src/input/InputDate.component.tsx +355 -0
  69. package/src/input/InputDatetime.component.tsx +267 -0
  70. package/src/input/InputDocument.component.tsx +360 -0
  71. package/src/input/InputImage.component.tsx +534 -0
  72. package/src/input/InputNumber.component.tsx +193 -0
  73. package/src/input/InputOtp.component.tsx +169 -0
  74. package/src/input/InputPassword.component.tsx +245 -0
  75. package/src/input/InputRadio.component.tsx +174 -0
  76. package/src/input/InputTime.component.tsx +280 -0
  77. package/src/input/InputValues.component.tsx +70 -0
  78. package/src/input/Radio.component.tsx +98 -0
  79. package/src/input/Select.component.tsx +557 -0
  80. package/src/modal/BottomSheet.component.tsx +246 -0
  81. package/src/modal/FloatingPage.component.tsx +133 -0
  82. package/src/modal/Modal.component.tsx +94 -0
  83. package/src/modal/ModalConfirm.component.tsx +204 -0
  84. package/src/modal/Toast.component.tsx +124 -0
  85. package/src/nav/Bottombar.component.tsx +71 -0
  86. package/src/nav/Footer.component.tsx +176 -0
  87. package/src/nav/Headbar.component.tsx +33 -0
  88. package/src/nav/Navbar.component.tsx +137 -0
  89. package/src/nav/Sidebar.component.tsx +307 -0
  90. package/src/nav/Tabbar.component.tsx +61 -0
  91. package/src/nav/Wizard.component.tsx +80 -0
  92. package/src/supervision/FormSupervision.component.tsx +404 -0
  93. package/src/supervision/TableSupervision.component.tsx +653 -0
  94. package/src/table/ControlBar.component.tsx +501 -0
  95. package/src/table/FilterComponent.tsx +517 -0
  96. package/src/table/Pagination.component.tsx +152 -0
  97. package/src/table/Table.component.tsx +436 -0
  98. package/src/typography/TypographyArticle.component.tsx +26 -0
  99. package/src/typography/TypographyColumn.component.tsx +20 -0
  100. package/src/typography/TypographyContent.component.tsx +20 -0
  101. package/src/typography/TypographyTips.component.tsx +20 -0
  102. package/src/wrap/Draggable.component.tsx +303 -0
  103. package/src/wrap/Image.component.tsx +10 -0
  104. package/src/wrap/OutsideClick.component.tsx +48 -0
  105. package/src/wrap/ScrollContainer.component.tsx +107 -0
  106. package/src/wrap/ShortcutProvider.tsx +57 -0
  107. package/src/wrap/Swipe.component.tsx +121 -0
@@ -0,0 +1,534 @@
1
+ "use client"
2
+
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { Icon } from "@skalfa/skalfa-icon";
5
+ import { cn, pcn, useInputHandler, useInputRandomId, useResponsive, useValidation, validation, ValidationRules } from "@utils";
6
+ import { BottomSheetComponent } from "../modal/BottomSheet.component";
7
+ import { ButtonComponent } from "../button/Button.component";
8
+ import { ModalComponent } from "../modal/Modal.component";
9
+
10
+
11
+ type CT = "label" | "error" | "input" | "tip";
12
+
13
+ export interface InputImageProps {
14
+ name : string;
15
+ label ?: string;
16
+ tip ?: string;
17
+
18
+ value ?: string | File;
19
+ aspect ?: string;
20
+ invalid ?: string;
21
+ disabled ?: boolean;
22
+ validations ?: ValidationRules;
23
+
24
+ onChange?: (file?: File | null) => void;
25
+ register?: (name: string, validations?: ValidationRules) => void;
26
+ unregister?: (name: string) => void;
27
+
28
+ className?: string;
29
+ }
30
+
31
+
32
+
33
+ export const InputImageComponent: React.FC<InputImageProps> = ({
34
+ name,
35
+ label,
36
+ tip,
37
+
38
+ value,
39
+ disabled,
40
+ aspect = "1/1",
41
+ invalid,
42
+ validations,
43
+
44
+ onChange,
45
+ register,
46
+ unregister,
47
+ className = "",
48
+ }) => {
49
+ const { isSm } = useResponsive();
50
+
51
+ const randomId = useInputRandomId();
52
+ const inputRef = useRef<HTMLInputElement>(null);
53
+
54
+ const [preview, setPreview] = useState("");
55
+ const [drag, setDrag] = useState(false);
56
+ const [cropSrc, setCropSrc] = useState<string | null>(null);
57
+ const [openCrop, setOpenCrop] = useState(false);
58
+
59
+ const inputHandler = useInputHandler(name, value, validations, register, true);
60
+ const [invalidMessage, setInvalidMessage] = useValidation(inputHandler.value, validations, invalid, inputHandler.idle);
61
+
62
+ useEffect(() => {
63
+ if (value) {
64
+ const url = typeof value === "object" ? URL.createObjectURL(value) : value;
65
+ setPreview(url);
66
+
67
+ return () => {
68
+ typeof value === "object" && URL.revokeObjectURL(url);
69
+ };
70
+ } else {
71
+ setPreview("");
72
+ }
73
+ }, [value]);
74
+
75
+ const openCropper = (file: File) => {
76
+ const reader = new FileReader();
77
+ reader.onload = () => {
78
+ setCropSrc(reader.result as string);
79
+ setOpenCrop(true);
80
+ };
81
+ reader.readAsDataURL(file);
82
+ };
83
+
84
+ const onUpload = (e: React.ChangeEvent<HTMLInputElement>) => {
85
+ const file = e.target.files?.[0];
86
+ if (!file) return;
87
+
88
+ const allowed = ["image/jpeg", "image/jpg", "image/png", "image/webp"];
89
+ if (!allowed.includes(file.type)) {
90
+ setInvalidMessage("Format gambar tidak diperbolehkan (JPG/PNG/WebP)");
91
+ return;
92
+ }
93
+
94
+ openCropper(file);
95
+ };
96
+
97
+ const onCropDone = (file: File) => {
98
+ const url = URL.createObjectURL(file);
99
+ setPreview(url);
100
+ onChange?.(file);
101
+ setOpenCrop(false);
102
+ };
103
+
104
+ const onCropCancel = () => {
105
+ setOpenCrop(false);
106
+ inputRef.current!.value = "";
107
+ };
108
+
109
+ const remove = () => {
110
+ setPreview("");
111
+ onChange?.(null);
112
+ inputRef.current && (inputRef.current.value = "");
113
+ };
114
+
115
+ const onDropFile = (e: React.DragEvent<HTMLDivElement>) => {
116
+ e.preventDefault();
117
+ setDrag(false);
118
+
119
+ const file = e.dataTransfer.files?.[0];
120
+ file && openCropper(file);
121
+ };
122
+
123
+ return (
124
+ <div className="input-container w-full">
125
+ {label && (
126
+ <label
127
+ htmlFor={randomId}
128
+ className={cn(
129
+ "input-label",
130
+ disabled && "input-label-disabled",
131
+ inputHandler.focus && "input-label-focus",
132
+ !!invalidMessage && "input-label-error",
133
+ pcn<CT>(className, "label"),
134
+ )}
135
+ >
136
+ {label}
137
+ {validations && validation.hasRules(validations, "required") && <span className="text-danger ml-1">*</span>}
138
+ </label>
139
+ )}
140
+
141
+ {tip && (
142
+ <small
143
+ className={cn(
144
+ "input-tip",
145
+ disabled && "input-tip-disabled",
146
+ pcn<CT>(className, "tip"),
147
+ )}
148
+ >{tip}</small>
149
+ )}
150
+
151
+ <label htmlFor={randomId}>
152
+ <div
153
+ className={cn(
154
+ "input-image-dropzone",
155
+ drag ? "input-image-dropzone-drag" : "",
156
+ invalidMessage && "input-image-dropzone-error",
157
+ pcn<CT>(className, "input")
158
+ )}
159
+ style={{
160
+ aspectRatio: aspect,
161
+ backgroundImage: preview ? `url(${preview})` : undefined,
162
+ backgroundSize: "cover",
163
+ backgroundPosition: "center",
164
+ }}
165
+ onDragOver={(e) => e.preventDefault()}
166
+ onDragEnter={(e) => {
167
+ e.preventDefault();
168
+ setDrag(true);
169
+ }}
170
+ onDragLeave={() => setDrag(false)}
171
+ onDrop={onDropFile}
172
+ >
173
+ <div className="input-image-dropzone-content">
174
+ <Icon icon={drag ? "solid/hand-holding" : "solid/images"} className="text-3xl" />
175
+ <p className="input-image-dropzone-text">{drag ? "Letakkan di sini" : preview ? "Klik atau seret untuk ganti Gambar" : "Klik atau seret gambar"}</p>
176
+ </div>
177
+
178
+ <input
179
+ id={randomId}
180
+ ref={inputRef}
181
+ type="file"
182
+ accept="image/*"
183
+ className="hidden"
184
+ disabled={disabled}
185
+ onChange={onUpload}
186
+ />
187
+ </div>
188
+ </label>
189
+
190
+ {preview && !disabled && (
191
+ <ButtonComponent
192
+ icon="solid/times"
193
+ paint="danger"
194
+ size="sm"
195
+ className="absolute top-10 right-4"
196
+ onClick={remove}
197
+ />
198
+ )}
199
+
200
+ {invalidMessage && (
201
+ <small className={cn("input-error-message", pcn<CT>(className, "error"))}>
202
+ {invalidMessage}
203
+ </small>
204
+ )}
205
+
206
+ {!isSm ? (
207
+ <ModalComponent show={openCrop} onClose={onCropCancel} title="Sesuaikan Gambar" className="w-max max-w-[350px]">
208
+ {cropSrc && (
209
+ <div className="p-4">
210
+ <CanvasCropper
211
+ src={cropSrc}
212
+ aspect={eval(aspect.replace(":", "/"))}
213
+ onDone={onCropDone}
214
+ />
215
+ </div>
216
+ )}
217
+ </ModalComponent>
218
+ ) : (
219
+ <BottomSheetComponent show={openCrop} onClose={onCropCancel} size={400}>
220
+ {cropSrc && (
221
+ <div className="p-4">
222
+ <CanvasCropper
223
+ src={cropSrc}
224
+ aspect={eval(aspect.replace(":", "/"))}
225
+ onDone={onCropDone}
226
+ />
227
+ </div>
228
+ )}
229
+ </BottomSheetComponent>
230
+ )}
231
+
232
+ </div>
233
+ );
234
+ };
235
+
236
+
237
+
238
+ interface CropperProps {
239
+ src : string;
240
+ aspect : number;
241
+ onDone ?: (file: File) => void;
242
+ }
243
+
244
+ export const CanvasCropper: React.FC<CropperProps> = ({
245
+ src,
246
+ aspect,
247
+ onDone,
248
+ }) => {
249
+ const canvasRef = useRef<HTMLCanvasElement>(null);
250
+ const previewRef = useRef<HTMLCanvasElement>(null);
251
+ const pinchDistRef = useRef(0);
252
+ const pinchStartZoomRef = useRef(1);
253
+
254
+ const [img, setImg] = useState<HTMLImageElement | null>(null);
255
+ const [zoom, setZoom] = useState(1);
256
+ const [minZoom, setMinZoom] = useState(1);
257
+ const [maxZoom, setMaxZoom] = useState(4);
258
+ const [pos, setPos] = useState({ x: 0, y: 0 });
259
+ const [dragging, setDragging] = useState(false);
260
+ const [start, setStart] = useState({ x: 0, y: 0 });
261
+
262
+ const CROP_SIZE = 280;
263
+ const CROP_W = CROP_SIZE * aspect;
264
+
265
+ const clamp = (v: number, min: number, max: number) => Math.max(min, Math.min(max, v));
266
+
267
+ useEffect(() => {
268
+ const i = new Image();
269
+ i.onload = () => setImg(i);
270
+ i.src = src;
271
+ }, [src]);
272
+
273
+ const renderCanvas = () => {
274
+ if (!img) return;
275
+
276
+ const canvas = canvasRef.current!;
277
+ const ctx = canvas.getContext("2d")!;
278
+
279
+ canvas.width = CROP_W;
280
+ canvas.height = CROP_SIZE;
281
+
282
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
283
+
284
+ const scaledW = img.width * zoom;
285
+ const scaledH = img.height * zoom;
286
+
287
+ const x = pos.x - scaledW / 2 + CROP_W / 2;
288
+ const y = pos.y - scaledH / 2 + CROP_SIZE / 2;
289
+
290
+ ctx.drawImage(img, x, y, scaledW, scaledH);
291
+ };
292
+
293
+ useEffect(() => {
294
+ renderCanvas();
295
+ }, [img, zoom, pos]);
296
+
297
+ useEffect(() => {
298
+ if (!img) return;
299
+
300
+ const imgW = img.naturalWidth;
301
+ const imgH = img.naturalHeight;
302
+
303
+ const scaleW = CROP_W / imgW;
304
+ const scaleH = CROP_SIZE / imgH;
305
+
306
+ const base = Math.max(scaleW, scaleH);
307
+
308
+ setMinZoom(base);
309
+ setZoom(base);
310
+ setMaxZoom(base * 4);
311
+
312
+ }, [img]);
313
+
314
+ const handleDown = (e: React.MouseEvent) => {
315
+ setDragging(true);
316
+ setStart({ x: e.clientX, y: e.clientY });
317
+ };
318
+
319
+ const handleUp = () => setDragging(false);
320
+
321
+ const handleMove = (e: React.MouseEvent) => {
322
+ if (!dragging) return;
323
+ const dx = e.clientX - start.x;
324
+ const dy = e.clientY - start.y;
325
+
326
+ setStart({ x: e.clientX, y: e.clientY });
327
+ setPos((p) => {
328
+ const scaledW = img!.naturalWidth * zoom;
329
+ const scaledH = img!.naturalHeight * zoom;
330
+
331
+ const minX = (scaledW - CROP_W) / 2;
332
+ const maxX = -(scaledW - CROP_W) / 2;
333
+ const minY = (scaledH - CROP_SIZE) / 2;
334
+ const maxY = -(scaledH - CROP_SIZE) / 2;
335
+
336
+ return {
337
+ x: clamp(p.x + dx, maxX, minX),
338
+ y: clamp(p.y + dy, maxY, minY),
339
+ };
340
+ });
341
+ };
342
+
343
+ const performCrop = () => {
344
+ if (!img) return;
345
+
346
+ const preview = previewRef.current!;
347
+ const pctx = preview.getContext("2d")!;
348
+
349
+ preview.width = CROP_W;
350
+ preview.height = CROP_SIZE;
351
+
352
+ const scaledW = img.width * zoom;
353
+ const scaledH = img.height * zoom;
354
+
355
+ const x = pos.x - scaledW / 2 + CROP_W / 2;
356
+ const y = pos.y - scaledH / 2 + CROP_SIZE / 2;
357
+
358
+ pctx.drawImage(img, x, y, scaledW, scaledH);
359
+
360
+ preview.toBlob((blob) => {
361
+ const file = new File([blob!], "cropped.png", { type: "image/png" });
362
+ onDone?.(file);
363
+ });
364
+ };
365
+
366
+
367
+ const handleWheel = (e: React.WheelEvent) => {
368
+ e.preventDefault();
369
+
370
+ setZoom((z) => {
371
+ let next = z - e.deltaY * 0.002;
372
+ next = Math.max(minZoom, Math.min(maxZoom, next));
373
+
374
+ const scaledW = img!.naturalWidth * next;
375
+ const scaledH = img!.naturalHeight * next;
376
+
377
+ const minX = (scaledW - CROP_W) / 2;
378
+ const maxX = -(scaledW - CROP_W) / 2;
379
+
380
+ const minY = (scaledH - CROP_SIZE) / 2;
381
+ const maxY = -(scaledH - CROP_SIZE) / 2;
382
+
383
+ setPos((p) => ({
384
+ x: clamp(p.x, maxX, minX),
385
+ y: clamp(p.y, maxY, minY),
386
+ }));
387
+
388
+ return next;
389
+ });
390
+ };
391
+
392
+
393
+ const handleTouchStart = (e: React.TouchEvent) => {
394
+ if (e.touches.length === 2) {
395
+ const t1 = e.touches[0];
396
+ const t2 = e.touches[1];
397
+
398
+ const dist = Math.hypot(
399
+ t2.clientX - t1.clientX,
400
+ t2.clientY - t1.clientY
401
+ );
402
+
403
+ pinchDistRef.current = dist;
404
+ pinchStartZoomRef.current = zoom;
405
+
406
+ e.preventDefault();
407
+ }
408
+
409
+ // Jika satu jari → drag
410
+ if (e.touches.length === 1) {
411
+ setDragging(true);
412
+ setStart({
413
+ x: e.touches[0].clientX,
414
+ y: e.touches[0].clientY,
415
+ });
416
+ }
417
+ };
418
+
419
+
420
+ const handleTouchMove = (e: React.TouchEvent) => {
421
+ if (e.touches.length === 2) {
422
+ const t1 = e.touches[0];
423
+ const t2 = e.touches[1];
424
+ const currDist = Math.hypot(t2.clientX - t1.clientX, t2.clientY - t1.clientY);
425
+
426
+ const diff = currDist - pinchDistRef.current;
427
+ let nextZoom = pinchStartZoomRef.current + diff * 0.005;
428
+
429
+ nextZoom = Math.max(minZoom, Math.min(maxZoom, nextZoom));
430
+
431
+ setZoom(nextZoom);
432
+
433
+ setPos((p) => {
434
+ const scaledW = img!.naturalWidth * nextZoom;
435
+ const scaledH = img!.naturalHeight * nextZoom;
436
+
437
+ const minX = (scaledW - CROP_W) / 2;
438
+ const maxX = -(scaledW - CROP_W) / 2;
439
+
440
+ const minY = (scaledH - CROP_SIZE) / 2;
441
+ const maxY = -(scaledH - CROP_SIZE) / 2;
442
+
443
+ return {
444
+ x: Math.max(maxX, Math.min(minX, p.x)),
445
+ y: Math.max(maxY, Math.min(minY, p.y)),
446
+ };
447
+ });
448
+
449
+ e.preventDefault();
450
+ return;
451
+ }
452
+
453
+ if (dragging && e.touches.length === 1) {
454
+ const { clientX, clientY } = e.touches[0];
455
+
456
+ const dx = clientX - start.x;
457
+ const dy = clientY - start.y;
458
+
459
+ setStart({ x: clientX, y: clientY });
460
+
461
+ setPos((p) => {
462
+ const scaledW = img!.naturalWidth * zoom;
463
+ const scaledH = img!.naturalHeight * zoom;
464
+
465
+ const minX = (scaledW - CROP_W) / 2;
466
+ const maxX = -(scaledW - CROP_W) / 2;
467
+
468
+ const minY = (scaledH - CROP_SIZE) / 2;
469
+ const maxY = -(scaledH - CROP_SIZE) / 2;
470
+
471
+ return {
472
+ x: Math.max(maxX, Math.min(minX, p.x + dx)),
473
+ y: Math.max(maxY, Math.min(minY, p.y + dy)),
474
+ };
475
+ });
476
+
477
+ e.preventDefault();
478
+ }
479
+ };
480
+
481
+
482
+ const handleTouchEnd = () => {
483
+ setDragging(false);
484
+ pinchDistRef.current = 0;
485
+ };
486
+
487
+ return (
488
+ <div style={{ touchAction: "none" }}>
489
+ <div
490
+ className="input-image-cropper-wrapper"
491
+ style={{ width: CROP_W, height: CROP_SIZE }}
492
+ onMouseMove={handleMove}
493
+ onMouseUp={handleUp}
494
+ onMouseLeave={handleUp}
495
+ onWheel={handleWheel}
496
+ onTouchStart={handleTouchStart}
497
+ onTouchMove={handleTouchMove}
498
+ onTouchEnd={handleTouchEnd}
499
+ >
500
+ <canvas
501
+ ref={canvasRef}
502
+ width={CROP_W}
503
+ height={CROP_SIZE}
504
+ onMouseDown={handleDown}
505
+ className="cursor-move"
506
+ />
507
+
508
+ <div className="input-image-cropper-grid-container" style={{ width: CROP_W, height: CROP_SIZE }}>
509
+ <div className="input-image-cropper-grid-border"></div>
510
+ <div className="absolute inset-0">
511
+ <div className="input-image-cropper-grid-line-h input-image-cropper-grid-line-h-1"></div>
512
+ <div className="input-image-cropper-grid-line-h input-image-cropper-grid-line-h-2"></div>
513
+ <div className="input-image-cropper-grid-line-v input-image-cropper-grid-line-v-1"></div>
514
+ <div className="input-image-cropper-grid-line-v input-image-cropper-grid-line-v-2"></div>
515
+ </div>
516
+ </div>
517
+ </div>
518
+
519
+ <div className="p-4 pb-2">
520
+ <ButtonComponent
521
+ label="Selesai"
522
+ variant="outline"
523
+ onClick={performCrop}
524
+ block
525
+ />
526
+ </div>
527
+
528
+ <canvas ref={previewRef} className="hidden" />
529
+ </div>
530
+ );
531
+ };
532
+
533
+
534
+