@chekinapp/ui 0.0.98 → 0.0.100

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 CHANGED
@@ -7517,11 +7517,13 @@ var RadioGroup2 = React25.forwardRef(({ className, ...props }, ref) => /* @__PUR
7517
7517
  RadioGroup2.displayName = RadioGroupPrimitive.Root.displayName;
7518
7518
  var radioSizeClasses = {
7519
7519
  default: "h-4 w-4",
7520
- m: "h-5 w-5"
7520
+ m: "h-5 w-5",
7521
+ l: "h-6 w-6"
7521
7522
  };
7522
7523
  var indicatorSizeClasses = {
7523
7524
  default: "h-2 w-2",
7524
- m: "h-2.5 w-2.5"
7525
+ m: "h-2.5 w-2.5",
7526
+ l: "h-3 w-3"
7525
7527
  };
7526
7528
  var RadioGroupItem = React25.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
7527
7529
  RadioGroupPrimitive.Item,
@@ -9232,21 +9234,37 @@ var sign_finger_default = SvgSignFinger;
9232
9234
 
9233
9235
  // src/signature-canvas/SignatureCanvas.tsx
9234
9236
  var import_jsx_runtime109 = require("react/jsx-runtime");
9235
- var CANVAS_PROPS = {
9236
- width: "250px",
9237
- height: "174px"
9238
- };
9239
9237
  var SIGNATURE_PROPS = {
9240
9238
  penColor: "#161643",
9241
9239
  minWidth: 1.5,
9242
9240
  maxWidth: 1.5,
9243
9241
  dotSize: 1
9244
9242
  };
9243
+ var ASPECT_RATIO = 330 / 190;
9245
9244
  var SignatureCanvas = (0, import_react74.forwardRef)(
9246
9245
  ({ onClear, hasSignature, onEnd, onEnable, className, enabled }, ref) => {
9247
9246
  const { t } = (0, import_react_i18next17.useTranslation)();
9248
9247
  const internalRef = (0, import_react74.useRef)(null);
9248
+ const containerRef = (0, import_react74.useRef)(null);
9249
9249
  const combinedRef = useCombinedRef(ref, internalRef);
9250
+ const [size, setSize] = (0, import_react74.useState)({ width: 330, height: 190 });
9251
+ const calculateSize = (0, import_react74.useCallback)((containerWidth) => {
9252
+ const width = Math.min(containerWidth, 646);
9253
+ const height = Math.round(width / ASPECT_RATIO);
9254
+ setSize({ width, height });
9255
+ }, []);
9256
+ (0, import_react74.useEffect)(() => {
9257
+ const container = containerRef.current;
9258
+ if (!container) return;
9259
+ const observer = new ResizeObserver((entries) => {
9260
+ const entry = entries[0];
9261
+ if (entry) {
9262
+ calculateSize(entry.contentRect.width);
9263
+ }
9264
+ });
9265
+ observer.observe(container);
9266
+ return () => observer.disconnect();
9267
+ }, [calculateSize]);
9250
9268
  (0, import_react74.useEffect)(() => {
9251
9269
  if (!onEnd) return;
9252
9270
  const signPad = internalRef.current?.instance;
@@ -9255,73 +9273,85 @@ var SignatureCanvas = (0, import_react74.forwardRef)(
9255
9273
  signPad?.removeEventListener("endStroke", onEnd);
9256
9274
  };
9257
9275
  }, [onEnd]);
9258
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: cn("relative inline-flex flex-col", className), children: [
9259
- !enabled && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
9260
- "button",
9261
- {
9262
- type: "button",
9263
- className: cn(
9264
- "absolute left-0 top-0 z-10 flex h-[174px] w-[250px] flex-col items-center",
9265
- "justify-between rounded border-0 bg-[var(--signature-canvas-placeholder-bg)] px-0 pb-7 pt-10",
9266
- "cursor-pointer select-none"
9267
- ),
9268
- onClick: onEnable,
9269
- "data-testid": "signature-placeholder",
9270
- children: [
9271
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(SvgIcon, { as: sign_finger_default, size: 41, className: "w-[37px] opacity-[0.55]" }),
9272
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9273
- "span",
9274
- {
9275
- className: cn(
9276
- "mx-auto mt-2 max-w-[154px] break-words text-center text-sm font-medium uppercase",
9277
- "text-[var(--signature-canvas-placeholder-text)] opacity-[0.55]"
9278
- ),
9279
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_react_i18next17.Trans, { i18nKey: "signature_placeholder_text" })
9280
- }
9281
- )
9282
- ]
9283
- }
9284
- ),
9285
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9286
- "div",
9287
- {
9288
- className: cn(
9289
- "inline-flex h-[174px] w-[250px] cursor-pointer justify-center rounded border",
9290
- "border-[var(--signature-canvas-border)] shadow-[var(--signature-canvas-shadow)]",
9291
- "box-border max-[320px]:overflow-hidden"
9292
- ),
9293
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9294
- import_react_signature_pad_wrapper.default,
9276
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
9277
+ "div",
9278
+ {
9279
+ ref: containerRef,
9280
+ className: cn("relative flex w-full flex-col items-center", className),
9281
+ children: [
9282
+ !enabled && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
9283
+ "button",
9295
9284
  {
9296
- ref: combinedRef,
9297
- "data-testid": "canvas",
9298
- ...SIGNATURE_PROPS,
9299
- canvasProps: CANVAS_PROPS
9285
+ type: "button",
9286
+ className: cn(
9287
+ "absolute left-1/2 top-0 z-10 flex -translate-x-1/2 flex-col items-center",
9288
+ "justify-center rounded-xl border-2 border-[var(--signature-canvas-border)] bg-transparent",
9289
+ "cursor-pointer select-none"
9290
+ ),
9291
+ style: { width: size.width, height: size.height },
9292
+ onClick: onEnable,
9293
+ "data-testid": "signature-placeholder",
9294
+ children: [
9295
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(SvgIcon, { as: sign_finger_default, size: 41, className: "w-[37px] opacity-55" }),
9296
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9297
+ "span",
9298
+ {
9299
+ className: cn(
9300
+ "mx-auto mt-4 max-w-[200px] break-words text-center text-base font-medium",
9301
+ "text-[var(--signature-canvas-placeholder-text)] opacity-55"
9302
+ ),
9303
+ children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_react_i18next17.Trans, { i18nKey: "tap_here_to_sign" })
9304
+ }
9305
+ )
9306
+ ]
9300
9307
  }
9301
- )
9302
- }
9303
- ),
9304
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9305
- "div",
9306
- {
9307
- className: cn("text-right", {
9308
- invisible: !enabled || !hasSignature
9309
- }),
9310
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9311
- Button,
9308
+ ),
9309
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9310
+ "div",
9312
9311
  {
9313
- variant: "link",
9314
9312
  className: cn(
9315
- "ml-auto mt-2 h-[30px] min-w-[70px] select-none rounded-sm px-2 py-0.5 text-right",
9316
- "text-xs uppercase hover:opacity-[0.88] active:opacity-100"
9313
+ "inline-flex cursor-pointer justify-center rounded-xl border-2",
9314
+ "border-[var(--signature-canvas-border)] bg-[var(--signature-canvas-bg)]",
9315
+ { hidden: !enabled }
9317
9316
  ),
9318
- onClick: onClear,
9319
- children: t("clear")
9317
+ style: { width: size.width, height: size.height },
9318
+ children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9319
+ import_react_signature_pad_wrapper.default,
9320
+ {
9321
+ ref: combinedRef,
9322
+ "data-testid": "canvas",
9323
+ options: SIGNATURE_PROPS,
9324
+ canvasProps: {
9325
+ style: { width: `${size.width}px`, height: `${size.height}px` }
9326
+ }
9327
+ }
9328
+ )
9329
+ }
9330
+ ),
9331
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9332
+ "div",
9333
+ {
9334
+ className: cn("w-full text-right", {
9335
+ invisible: !enabled || !hasSignature
9336
+ }),
9337
+ style: { maxWidth: size.width },
9338
+ children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
9339
+ Button,
9340
+ {
9341
+ variant: "link",
9342
+ className: cn(
9343
+ "ml-auto mt-2 h-[30px] min-w-[70px] select-none rounded-sm px-2 py-0.5 text-right",
9344
+ "text-xs uppercase hover:opacity-[0.88] active:opacity-100"
9345
+ ),
9346
+ onClick: onClear,
9347
+ children: t("clear")
9348
+ }
9349
+ )
9320
9350
  }
9321
9351
  )
9322
- }
9323
- )
9324
- ] });
9352
+ ]
9353
+ }
9354
+ );
9325
9355
  }
9326
9356
  );
9327
9357
  SignatureCanvas.displayName = "SignatureCanvas";
@@ -11680,7 +11710,7 @@ function DeviceCamera({ onChange, facingMode, className }) {
11680
11710
  ),
11681
11711
  children: [
11682
11712
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { children: t("camera_errors.experiencing_camera_issues") }),
11683
- /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("label", { className: "text-[16px] font-semibold uppercase leading-6 text-[var(--text-button-color)]", children: [
11713
+ /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("label", { className: "text-[16px] font-semibold uppercase leading-6", children: [
11684
11714
  t("open_devices_camera"),
11685
11715
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
11686
11716
  "input",