@miden-npm/react 0.0.12 → 0.0.13

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
@@ -1660,6 +1660,7 @@ var BaseInput = ({
1660
1660
  disabled = false,
1661
1661
  loading = false,
1662
1662
  showCopyIcon = false,
1663
+ preventPaste = false,
1663
1664
  value,
1664
1665
  defaultValue,
1665
1666
  onChange,
@@ -1687,17 +1688,18 @@ var BaseInput = ({
1687
1688
  el.selectionStart = el.selectionEnd = el.value.length;
1688
1689
  });
1689
1690
  };
1690
- const handleStringChange = (e) => {
1691
- const incoming = e.replace(/,/g, "");
1692
- if (!isControlled) setRawValue(incoming);
1693
- onChange?.(incoming);
1694
- };
1695
1691
  const handleBlur = () => {
1696
1692
  onBlur?.(rawValue);
1697
1693
  };
1698
1694
  const handleKeyDown = (e) => {
1699
1695
  if (rules.includes("numeric")) restrictToNumericKeys(e);
1700
1696
  };
1697
+ const handlePaste = (e) => {
1698
+ if (preventPaste) {
1699
+ e.preventDefault();
1700
+ setLocalError("Pasting is disabled for this input");
1701
+ }
1702
+ };
1701
1703
  const containerBg = disabled ? "bg-grey-50 cursor-not-allowed" : "bg-white";
1702
1704
  const containerBorder = validationError || localError ? "border-red-300 bg-red-50" : "border-grey-100";
1703
1705
  const copyToClipboard = (text) => {
@@ -1706,7 +1708,7 @@ var BaseInput = ({
1706
1708
  const copyHandler = () => {
1707
1709
  copyToClipboard(rawValue).then(() => {
1708
1710
  setLocalHint("Text copied to clipboard");
1709
- }).catch((err) => {
1711
+ }).catch(() => {
1710
1712
  setLocalError("Failed to copy text to clipboard");
1711
1713
  });
1712
1714
  };
@@ -1730,6 +1732,7 @@ var BaseInput = ({
1730
1732
  onChange: handleChange,
1731
1733
  onBlur: handleBlur,
1732
1734
  onKeyDown: handleKeyDown,
1735
+ onPaste: handlePaste,
1733
1736
  disabled,
1734
1737
  placeholder: placeholder ?? (label ? `Enter ${label.toLowerCase()}` : void 0),
1735
1738
  inputMode: isAmountInput ? "decimal" : void 0,
@@ -1749,10 +1752,7 @@ var BaseInput = ({
1749
1752
  onClick: copyHandler
1750
1753
  }
1751
1754
  )
1752
- ] }) : (
1753
- // Simple loader placeholder; swap for your icon component if desired
1754
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full" })
1755
- )
1755
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "animate-spin h-4 w-4 border-2 border-current border-t-transparent rounded-full" })
1756
1756
  ]
1757
1757
  }
1758
1758
  ),
@@ -1829,7 +1829,7 @@ function BzpCheckoutIframe({
1829
1829
  setMessage("Payment link created successfully");
1830
1830
  if (response.launchUrl) {
1831
1831
  setLoading(false);
1832
- launchIframe(response.launchUrl);
1832
+ launchIframe(`${response.launchUrl}&merchantId=${btoa(secretKey)}`);
1833
1833
  }
1834
1834
  } else {
1835
1835
  setLoading(false);
@@ -2380,6 +2380,7 @@ function PayByCard({
2380
2380
  mask: "0000 0000 0000 0000",
2381
2381
  placeholder: "0000 0000 0000 0000",
2382
2382
  value: payForm.cardNo,
2383
+ preventPaste: true,
2383
2384
  onChange: (e) => {
2384
2385
  setPayForm({ ...payForm, cardNo: e });
2385
2386
  if (payErrors.cardNo)