@chekinapp/ui 0.0.101 → 0.0.102
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/dist/index.cjs +47 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +48 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6034,7 +6034,9 @@ var translation_default2 = {
|
|
|
6034
6034
|
},
|
|
6035
6035
|
clear: "Clear",
|
|
6036
6036
|
show_less: "Show less",
|
|
6037
|
-
show_more: "Show more"
|
|
6037
|
+
show_more: "Show more",
|
|
6038
|
+
tap_here_to_sign: "Tap here to sign",
|
|
6039
|
+
click_here_to_sign: "Click here to sign"
|
|
6038
6040
|
};
|
|
6039
6041
|
|
|
6040
6042
|
// src/locales/es/translation.json
|
|
@@ -9290,6 +9292,7 @@ function getTrimmedCanvasData(canvas, padding = 10) {
|
|
|
9290
9292
|
var SignatureCanvas = (0, import_react74.forwardRef)(
|
|
9291
9293
|
({ onClear, onEnd, onEnable, className, enabled }, ref) => {
|
|
9292
9294
|
const { t } = (0, import_react_i18next17.useTranslation)();
|
|
9295
|
+
const isMobile3 = useIsMobile();
|
|
9293
9296
|
const canvasRef = (0, import_react74.useRef)(null);
|
|
9294
9297
|
const containerRef = (0, import_react74.useRef)(null);
|
|
9295
9298
|
const [size, setSize] = (0, import_react74.useState)({ width: 330, height: 190 });
|
|
@@ -9344,7 +9347,7 @@ var SignatureCanvas = (0, import_react74.forwardRef)(
|
|
|
9344
9347
|
setHasSignature(false);
|
|
9345
9348
|
},
|
|
9346
9349
|
isEmpty: () => canvasRef.current?.isEmpty() ?? true,
|
|
9347
|
-
fromDataURL: canvasRef.current?.fromDataURL,
|
|
9350
|
+
fromDataURL: (...args) => canvasRef.current?.fromDataURL(...args),
|
|
9348
9351
|
toDataURL: (type, encoderOptions) => canvasRef.current?.toDataURL(type, encoderOptions) ?? "",
|
|
9349
9352
|
toTrimmedDataURL: (type = "image/png", encoderOptions, padding = 10) => {
|
|
9350
9353
|
const canvas = canvasRef.current?.getCanvas();
|
|
@@ -9353,7 +9356,7 @@ var SignatureCanvas = (0, import_react74.forwardRef)(
|
|
|
9353
9356
|
if (!trimmed) return "";
|
|
9354
9357
|
return trimmed.canvas.toDataURL(type, encoderOptions);
|
|
9355
9358
|
},
|
|
9356
|
-
getCanvas: () => canvasRef.current?.getCanvas()
|
|
9359
|
+
getCanvas: (...args) => canvasRef.current?.getCanvas(...args)
|
|
9357
9360
|
}));
|
|
9358
9361
|
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
|
|
9359
9362
|
"div",
|
|
@@ -9361,53 +9364,52 @@ var SignatureCanvas = (0, import_react74.forwardRef)(
|
|
|
9361
9364
|
ref: containerRef,
|
|
9362
9365
|
className: cn("relative flex w-full flex-col items-center", className),
|
|
9363
9366
|
children: [
|
|
9364
|
-
|
|
9365
|
-
"button",
|
|
9366
|
-
{
|
|
9367
|
-
type: "button",
|
|
9368
|
-
className: cn(
|
|
9369
|
-
"absolute left-1/2 top-0 z-10 flex -translate-x-1/2 flex-col items-center",
|
|
9370
|
-
"justify-center rounded-xl border-2 border-[var(--signature-canvas-border)] bg-transparent",
|
|
9371
|
-
"cursor-pointer select-none"
|
|
9372
|
-
),
|
|
9373
|
-
style: { width: size.width, height: size.height },
|
|
9374
|
-
onClick: onEnable,
|
|
9375
|
-
"data-testid": "signature-placeholder",
|
|
9376
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
9377
|
-
"span",
|
|
9378
|
-
{
|
|
9379
|
-
className: cn(
|
|
9380
|
-
"mx-auto max-w-[200px] break-words text-center text-base font-medium",
|
|
9381
|
-
"text-[var(--signature-canvas-placeholder-text)] opacity-55"
|
|
9382
|
-
),
|
|
9383
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_react_i18next17.Trans, { i18nKey: "tap_here_to_sign" })
|
|
9384
|
-
}
|
|
9385
|
-
)
|
|
9386
|
-
}
|
|
9387
|
-
),
|
|
9388
|
-
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
9367
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
|
|
9389
9368
|
"div",
|
|
9390
9369
|
{
|
|
9391
9370
|
className: cn(
|
|
9392
|
-
"overflow-hidden rounded-xl border-2",
|
|
9393
|
-
"border-[var(--signature-canvas-border)] bg-[var(--signature-canvas-bg)]"
|
|
9394
|
-
{ hidden: !enabled }
|
|
9371
|
+
"relative overflow-hidden rounded-xl border-2",
|
|
9372
|
+
"border-[var(--signature-canvas-border)] bg-[var(--signature-canvas-bg)]"
|
|
9395
9373
|
),
|
|
9396
9374
|
style: { width: size.width, height: size.height },
|
|
9397
|
-
children:
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9375
|
+
children: [
|
|
9376
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
9377
|
+
import_react_signature_canvas.default,
|
|
9378
|
+
{
|
|
9379
|
+
ref: canvasRef,
|
|
9380
|
+
"data-testid": "canvas",
|
|
9381
|
+
canvasProps: {
|
|
9382
|
+
width: size.width,
|
|
9383
|
+
height: size.height,
|
|
9384
|
+
style: { width: size.width, height: size.height }
|
|
9385
|
+
},
|
|
9386
|
+
onEnd: handleEnd,
|
|
9387
|
+
...SIGNATURE_PROPS
|
|
9388
|
+
}
|
|
9389
|
+
),
|
|
9390
|
+
!enabled && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
9391
|
+
"button",
|
|
9392
|
+
{
|
|
9393
|
+
type: "button",
|
|
9394
|
+
className: cn(
|
|
9395
|
+
"absolute inset-0 flex cursor-pointer items-center justify-center",
|
|
9396
|
+
"bg-transparent"
|
|
9397
|
+
),
|
|
9398
|
+
onClick: onEnable,
|
|
9399
|
+
"data-testid": "signature-placeholder",
|
|
9400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
9401
|
+
"span",
|
|
9402
|
+
{
|
|
9403
|
+
className: cn(
|
|
9404
|
+
"max-w-[200px] break-words text-center text-lg font-medium",
|
|
9405
|
+
"text-[var(--signature-canvas-placeholder-text)] opacity-60"
|
|
9406
|
+
),
|
|
9407
|
+
children: isMobile3 ? t("tap_here_to_sign") : t("click_here_to_sign")
|
|
9408
|
+
}
|
|
9409
|
+
)
|
|
9410
|
+
}
|
|
9411
|
+
)
|
|
9412
|
+
]
|
|
9411
9413
|
}
|
|
9412
9414
|
),
|
|
9413
9415
|
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|