braid-ui 1.0.56 → 1.0.57

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
@@ -8478,7 +8478,9 @@ var NewTransactionView = ({
8478
8478
  onEditReceiverAccount,
8479
8479
  isReviewReady,
8480
8480
  adjustmentTypeOptions,
8481
- transactionTypeOptions
8481
+ transactionTypeOptions,
8482
+ showSuccessInfoBox = false,
8483
+ successInfoMessage = ""
8482
8484
  }) => {
8483
8485
  const transactionType = form.watch("transactionType");
8484
8486
  const accountNumber = form.watch("accountNumber");
@@ -8487,6 +8489,7 @@ var NewTransactionView = ({
8487
8489
  const receiverAccountNumber = form.watch("receiverAccountNumber");
8488
8490
  const adjustmentDirection = form.watch("adjustmentDirection");
8489
8491
  const adjustmentType = form.watch("adjustmentType");
8492
+ const description = form.watch("description");
8490
8493
  const requiresCounterparty = ["ach", "wire"].includes(transactionType);
8491
8494
  const isTransfer = transactionType === "transfer";
8492
8495
  const isAdjustment = transactionType === "adjustment";
@@ -8872,31 +8875,49 @@ var NewTransactionView = ({
8872
8875
  }, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-md flex flex-col max-h-[85vh]", hideCloseButton: true, children: [
8873
8876
  /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
8874
8877
  submissionStatus === "success" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-12 w-12 rounded-full bg-success/10 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-6 w-6 text-success" }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-12 w-12 rounded-full bg-destructive/10 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-6 w-6 text-destructive" }) }),
8875
- /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Successful" : "Transaction Failed" })
8878
+ /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Submitted" : "Transaction Failed" })
8876
8879
  ] }) }),
8877
8880
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto min-h-0", children: submissionStatus === "success" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 pt-2", children: [
8878
8881
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground", children: "Your transaction has been successfully submitted and is being processed." }),
8879
8882
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted/50 rounded-lg p-4 space-y-2", children: [
8880
8883
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8881
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Transaction ID:" }),
8882
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-medium", children: transactionId })
8884
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Payment ID:" }),
8885
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-medium text-xs", children: crypto.randomUUID() })
8886
+ ] }),
8887
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8888
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Account:" }),
8889
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: accountData ? `${accountData.accountName} (${accountData.accountNumber})` : "N/A" })
8890
+ ] }),
8891
+ transactionType === "transfer" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8892
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Receiver Account:" }),
8893
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: receiverAccountData ? `${receiverAccountData.accountName} (${receiverAccountData.accountNumber})` : "N/A" })
8894
+ ] }),
8895
+ transactionType === "adjustment" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8896
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8897
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Direction:" }),
8898
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: adjustmentDirection === "debit" ? "Debit" : "Credit" })
8899
+ ] }),
8900
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8901
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Adjustment Type:" }),
8902
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: adjustmentTypeOptions.find((t) => t.value === adjustmentType)?.label || "N/A" })
8903
+ ] })
8904
+ ] }),
8905
+ (transactionType === "wire" || transactionType === "ach") && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8906
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Customer Name:" }),
8907
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: counterpartyName || "N/A" })
8883
8908
  ] }),
8884
8909
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8885
8910
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
8886
8911
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
8887
8912
  ] }),
8888
8913
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8889
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Type:" }),
8890
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: transactionTypeOptions.find((t) => t.value === transactionType)?.label })
8891
- ] }),
8892
- requiresCounterparty && counterpartyName && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8893
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Counterparty:" }),
8894
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: counterpartyName })
8914
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Description:" }),
8915
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: description || "N/A" })
8895
8916
  ] })
8896
8917
  ] }),
8897
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
8918
+ showSuccessInfoBox && successInfoMessage && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
8898
8919
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-5 w-5 text-blue-500 mt-0.5 flex-shrink-0" }),
8899
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-blue-700 dark:text-blue-300", children: "You will receive a confirmation email once the transaction is completed." })
8920
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-blue-700 dark:text-blue-300", children: successInfoMessage })
8900
8921
  ] })
8901
8922
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 pt-2", children: [
8902
8923
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-lg", children: [
@@ -14729,7 +14750,7 @@ function NewTransaction() {
14729
14750
  };
14730
14751
  console.log("Transaction submission payload:", submissionPayload);
14731
14752
  await new Promise((resolve) => setTimeout(resolve, 1500));
14732
- const hasError = Math.random() > 0.1;
14753
+ const hasError = Math.random() > 0.7;
14733
14754
  if (hasError) {
14734
14755
  const errorScenarios = [
14735
14756
  "Insufficient funds. Current balance: $125,450.00, Required: $" + parseFloat(data.amount).toFixed(2),
@@ -14738,9 +14759,7 @@ function NewTransaction() {
14738
14759
  "Invalid routing number for the selected transaction type."
14739
14760
  ];
14740
14761
  setSubmissionStatus("error");
14741
- setErrorMessage(
14742
- 'JSON parse error: Cannot deserialize value of type `io.ropechain.api.enums.TransactionEnums$DebitAdjustmentTypes` from String "mapSubTypeStringToEnum(data.adjustmentType ?? "")": not one of the values accepted for Enum class: [COLLECTION, TRANSACTION_REVERSAL, TRANSACTION_ADJUSTMENT]; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `io.ropechain.api.enums.TransactionEnums$DebitAdjustmentTypes` from String "mapSubTypeStringToEnum(data.adjustmentType ?? "")": not one of the values accepted for Enum class: [COLLECTION, TRANSACTION_REVERSAL, TRANSACTION_ADJUSTMENT]\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 51] (through reference chain: io.ropechain.api.model.transaction.internal.TransactionDebitAdjustmentRequest["subType"])'
14743
- );
14762
+ setErrorMessage(errorScenarios[Math.floor(Math.random() * errorScenarios.length)]);
14744
14763
  } else {
14745
14764
  const txId = "TXN-" + Math.random().toString(36).substr(2, 9).toUpperCase();
14746
14765
  setTransactionId(txId);