@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.d.cts CHANGED
@@ -21,6 +21,7 @@ import * as RadixPopover from '@radix-ui/react-popover';
21
21
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
22
22
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
23
23
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
24
+ import ReactSignatureCanvas from 'react-signature-canvas';
24
25
  import * as SliderPrimitive from '@radix-ui/react-slider';
25
26
  import * as SwitchPrimitives from '@radix-ui/react-switch';
26
27
  import { ToastT } from 'sonner';
@@ -861,6 +862,8 @@ declare const uiKitTranslations: {
861
862
  clear: string;
862
863
  show_less: string;
863
864
  show_more: string;
865
+ tap_here_to_sign: string;
866
+ click_here_to_sign: string;
864
867
  };
865
868
  readonly es: {
866
869
  verified: string;
@@ -1315,6 +1318,8 @@ declare const uiKitI18nResources: {
1315
1318
  clear: string;
1316
1319
  show_less: string;
1317
1320
  show_more: string;
1321
+ tap_here_to_sign: string;
1322
+ click_here_to_sign: string;
1318
1323
  };
1319
1324
  };
1320
1325
  readonly es: {
@@ -2177,12 +2182,10 @@ type SignatureCanvasProps = {
2177
2182
  className?: string;
2178
2183
  enabled?: boolean;
2179
2184
  };
2180
- type SignatureCanvasRef = {
2181
- clear: () => void;
2182
- isEmpty: () => boolean;
2183
- toDataURL: (type?: string, encoderOptions?: number) => string;
2185
+ type SignatureCanvasRef = Pick<ReactSignatureCanvas, 'clear' | 'isEmpty' | 'toDataURL'> & {
2186
+ fromDataURL: (...args: Parameters<ReactSignatureCanvas['fromDataURL']>) => ReturnType<ReactSignatureCanvas['fromDataURL']> | undefined;
2187
+ getCanvas: () => ReturnType<ReactSignatureCanvas['getCanvas']> | undefined;
2184
2188
  toTrimmedDataURL: (type?: string, encoderOptions?: number, padding?: number) => string;
2185
- getCanvas: () => HTMLCanvasElement | null;
2186
2189
  };
2187
2190
  declare const SignatureCanvas: React$1.ForwardRefExoticComponent<SignatureCanvasProps & React$1.RefAttributes<SignatureCanvasRef>>;
2188
2191
 
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ import * as RadixPopover from '@radix-ui/react-popover';
21
21
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
22
22
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
23
23
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
24
+ import ReactSignatureCanvas from 'react-signature-canvas';
24
25
  import * as SliderPrimitive from '@radix-ui/react-slider';
25
26
  import * as SwitchPrimitives from '@radix-ui/react-switch';
26
27
  import { ToastT } from 'sonner';
@@ -861,6 +862,8 @@ declare const uiKitTranslations: {
861
862
  clear: string;
862
863
  show_less: string;
863
864
  show_more: string;
865
+ tap_here_to_sign: string;
866
+ click_here_to_sign: string;
864
867
  };
865
868
  readonly es: {
866
869
  verified: string;
@@ -1315,6 +1318,8 @@ declare const uiKitI18nResources: {
1315
1318
  clear: string;
1316
1319
  show_less: string;
1317
1320
  show_more: string;
1321
+ tap_here_to_sign: string;
1322
+ click_here_to_sign: string;
1318
1323
  };
1319
1324
  };
1320
1325
  readonly es: {
@@ -2177,12 +2182,10 @@ type SignatureCanvasProps = {
2177
2182
  className?: string;
2178
2183
  enabled?: boolean;
2179
2184
  };
2180
- type SignatureCanvasRef = {
2181
- clear: () => void;
2182
- isEmpty: () => boolean;
2183
- toDataURL: (type?: string, encoderOptions?: number) => string;
2185
+ type SignatureCanvasRef = Pick<ReactSignatureCanvas, 'clear' | 'isEmpty' | 'toDataURL'> & {
2186
+ fromDataURL: (...args: Parameters<ReactSignatureCanvas['fromDataURL']>) => ReturnType<ReactSignatureCanvas['fromDataURL']> | undefined;
2187
+ getCanvas: () => ReturnType<ReactSignatureCanvas['getCanvas']> | undefined;
2184
2188
  toTrimmedDataURL: (type?: string, encoderOptions?: number, padding?: number) => string;
2185
- getCanvas: () => HTMLCanvasElement | null;
2186
2189
  };
2187
2190
  declare const SignatureCanvas: React$1.ForwardRefExoticComponent<SignatureCanvasProps & React$1.RefAttributes<SignatureCanvasRef>>;
2188
2191
 
package/dist/index.js CHANGED
@@ -5652,7 +5652,9 @@ var translation_default2 = {
5652
5652
  },
5653
5653
  clear: "Clear",
5654
5654
  show_less: "Show less",
5655
- show_more: "Show more"
5655
+ show_more: "Show more",
5656
+ tap_here_to_sign: "Tap here to sign",
5657
+ click_here_to_sign: "Click here to sign"
5656
5658
  };
5657
5659
 
5658
5660
  // src/locales/es/translation.json
@@ -8850,7 +8852,7 @@ import {
8850
8852
  useImperativeHandle,
8851
8853
  useLayoutEffect as useLayoutEffect4
8852
8854
  } from "react";
8853
- import { Trans, useTranslation as useTranslation17 } from "react-i18next";
8855
+ import { useTranslation as useTranslation17 } from "react-i18next";
8854
8856
  import ReactSignatureCanvas from "react-signature-canvas";
8855
8857
  import { jsx as jsx106, jsxs as jsxs65 } from "react/jsx-runtime";
8856
8858
  var SIGNATURE_PROPS = {
@@ -8916,6 +8918,7 @@ function getTrimmedCanvasData(canvas, padding = 10) {
8916
8918
  var SignatureCanvas = forwardRef41(
8917
8919
  ({ onClear, onEnd, onEnable, className, enabled }, ref) => {
8918
8920
  const { t } = useTranslation17();
8921
+ const isMobile3 = useIsMobile();
8919
8922
  const canvasRef = useRef21(null);
8920
8923
  const containerRef = useRef21(null);
8921
8924
  const [size, setSize] = useState32({ width: 330, height: 190 });
@@ -8970,7 +8973,7 @@ var SignatureCanvas = forwardRef41(
8970
8973
  setHasSignature(false);
8971
8974
  },
8972
8975
  isEmpty: () => canvasRef.current?.isEmpty() ?? true,
8973
- fromDataURL: canvasRef.current?.fromDataURL,
8976
+ fromDataURL: (...args) => canvasRef.current?.fromDataURL(...args),
8974
8977
  toDataURL: (type, encoderOptions) => canvasRef.current?.toDataURL(type, encoderOptions) ?? "",
8975
8978
  toTrimmedDataURL: (type = "image/png", encoderOptions, padding = 10) => {
8976
8979
  const canvas = canvasRef.current?.getCanvas();
@@ -8979,7 +8982,7 @@ var SignatureCanvas = forwardRef41(
8979
8982
  if (!trimmed) return "";
8980
8983
  return trimmed.canvas.toDataURL(type, encoderOptions);
8981
8984
  },
8982
- getCanvas: () => canvasRef.current?.getCanvas() ?? null
8985
+ getCanvas: (...args) => canvasRef.current?.getCanvas(...args)
8983
8986
  }));
8984
8987
  return /* @__PURE__ */ jsxs65(
8985
8988
  "div",
@@ -8987,53 +8990,52 @@ var SignatureCanvas = forwardRef41(
8987
8990
  ref: containerRef,
8988
8991
  className: cn("relative flex w-full flex-col items-center", className),
8989
8992
  children: [
8990
- !enabled && /* @__PURE__ */ jsx106(
8991
- "button",
8992
- {
8993
- type: "button",
8994
- className: cn(
8995
- "absolute left-1/2 top-0 z-10 flex -translate-x-1/2 flex-col items-center",
8996
- "justify-center rounded-xl border-2 border-[var(--signature-canvas-border)] bg-transparent",
8997
- "cursor-pointer select-none"
8998
- ),
8999
- style: { width: size.width, height: size.height },
9000
- onClick: onEnable,
9001
- "data-testid": "signature-placeholder",
9002
- children: /* @__PURE__ */ jsx106(
9003
- "span",
9004
- {
9005
- className: cn(
9006
- "mx-auto max-w-[200px] break-words text-center text-base font-medium",
9007
- "text-[var(--signature-canvas-placeholder-text)] opacity-55"
9008
- ),
9009
- children: /* @__PURE__ */ jsx106(Trans, { i18nKey: "tap_here_to_sign" })
9010
- }
9011
- )
9012
- }
9013
- ),
9014
- /* @__PURE__ */ jsx106(
8993
+ /* @__PURE__ */ jsxs65(
9015
8994
  "div",
9016
8995
  {
9017
8996
  className: cn(
9018
- "overflow-hidden rounded-xl border-2",
9019
- "border-[var(--signature-canvas-border)] bg-[var(--signature-canvas-bg)]",
9020
- { hidden: !enabled }
8997
+ "relative overflow-hidden rounded-xl border-2",
8998
+ "border-[var(--signature-canvas-border)] bg-[var(--signature-canvas-bg)]"
9021
8999
  ),
9022
9000
  style: { width: size.width, height: size.height },
9023
- children: /* @__PURE__ */ jsx106(
9024
- ReactSignatureCanvas,
9025
- {
9026
- ref: canvasRef,
9027
- "data-testid": "canvas",
9028
- canvasProps: {
9029
- width: size.width,
9030
- height: size.height,
9031
- style: { width: size.width, height: size.height }
9032
- },
9033
- onEnd: handleEnd,
9034
- ...SIGNATURE_PROPS
9035
- }
9036
- )
9001
+ children: [
9002
+ /* @__PURE__ */ jsx106(
9003
+ ReactSignatureCanvas,
9004
+ {
9005
+ ref: canvasRef,
9006
+ "data-testid": "canvas",
9007
+ canvasProps: {
9008
+ width: size.width,
9009
+ height: size.height,
9010
+ style: { width: size.width, height: size.height }
9011
+ },
9012
+ onEnd: handleEnd,
9013
+ ...SIGNATURE_PROPS
9014
+ }
9015
+ ),
9016
+ !enabled && /* @__PURE__ */ jsx106(
9017
+ "button",
9018
+ {
9019
+ type: "button",
9020
+ className: cn(
9021
+ "absolute inset-0 flex cursor-pointer items-center justify-center",
9022
+ "bg-transparent"
9023
+ ),
9024
+ onClick: onEnable,
9025
+ "data-testid": "signature-placeholder",
9026
+ children: /* @__PURE__ */ jsx106(
9027
+ "span",
9028
+ {
9029
+ className: cn(
9030
+ "max-w-[200px] break-words text-center text-lg font-medium",
9031
+ "text-[var(--signature-canvas-placeholder-text)] opacity-60"
9032
+ ),
9033
+ children: isMobile3 ? t("tap_here_to_sign") : t("click_here_to_sign")
9034
+ }
9035
+ )
9036
+ }
9037
+ )
9038
+ ]
9037
9039
  }
9038
9040
  ),
9039
9041
  /* @__PURE__ */ jsx106(