braid-ui 1.0.55 → 1.0.56
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/css/braid-ui.css +8 -0
- package/dist/css/braid-ui.min.css +1 -1
- package/dist/index.cjs +86 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +86 -83
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8837,48 +8837,46 @@ var NewTransactionView = ({
|
|
|
8837
8837
|
] }) })
|
|
8838
8838
|
] }) }),
|
|
8839
8839
|
/* @__PURE__ */ jsx(Dialog, { open: confirmationOpen, onOpenChange: () => {
|
|
8840
|
-
}, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md", hideCloseButton: true, children: [
|
|
8841
|
-
/* @__PURE__ */
|
|
8842
|
-
/* @__PURE__ */
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
/* @__PURE__ */ jsx(
|
|
8847
|
-
|
|
8848
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
8849
|
-
/* @__PURE__ */
|
|
8850
|
-
|
|
8851
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono font-medium", children: transactionId })
|
|
8852
|
-
] }),
|
|
8853
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8854
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
|
|
8855
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
|
|
8856
|
-
] }),
|
|
8857
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8858
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Type:" }),
|
|
8859
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: transactionTypeOptions.find((t) => t.value === transactionType)?.label })
|
|
8860
|
-
] }),
|
|
8861
|
-
requiresCounterparty && counterpartyName && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8862
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Counterparty:" }),
|
|
8863
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: counterpartyName })
|
|
8864
|
-
] })
|
|
8840
|
+
}, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md flex flex-col max-h-[85vh]", hideCloseButton: true, children: [
|
|
8841
|
+
/* @__PURE__ */ jsx(DialogHeader, { className: "flex-shrink-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
8842
|
+
submissionStatus === "success" ? /* @__PURE__ */ jsx("div", { className: "h-12 w-12 rounded-full bg-success/10 flex items-center justify-center", children: /* @__PURE__ */ jsx(CheckCircle2, { className: "h-6 w-6 text-success" }) }) : /* @__PURE__ */ jsx("div", { className: "h-12 w-12 rounded-full bg-destructive/10 flex items-center justify-center", children: /* @__PURE__ */ jsx(XCircle, { className: "h-6 w-6 text-destructive" }) }),
|
|
8843
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Successful" : "Transaction Failed" })
|
|
8844
|
+
] }) }),
|
|
8845
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto min-h-0", children: submissionStatus === "success" ? /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
8846
|
+
/* @__PURE__ */ jsx("p", { className: "text-foreground", children: "Your transaction has been successfully submitted and is being processed." }),
|
|
8847
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-muted/50 rounded-lg p-4 space-y-2", children: [
|
|
8848
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8849
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Transaction ID:" }),
|
|
8850
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono font-medium", children: transactionId })
|
|
8865
8851
|
] }),
|
|
8866
|
-
/* @__PURE__ */ jsxs("div", { className: "flex
|
|
8867
|
-
/* @__PURE__ */ jsx(
|
|
8868
|
-
/* @__PURE__ */ jsx("
|
|
8869
|
-
] })
|
|
8870
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
8871
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-lg", children: [
|
|
8872
|
-
/* @__PURE__ */ jsx(XCircle, { className: "h-5 w-5 text-destructive mt-0.5 flex-shrink-0" }),
|
|
8873
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
8874
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-destructive", children: "Error Processing Transaction" }),
|
|
8875
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: errorMessage })
|
|
8876
|
-
] })
|
|
8852
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8853
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
|
|
8854
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
|
|
8877
8855
|
] }),
|
|
8878
|
-
/* @__PURE__ */
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8856
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8857
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Type:" }),
|
|
8858
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: transactionTypeOptions.find((t) => t.value === transactionType)?.label })
|
|
8859
|
+
] }),
|
|
8860
|
+
requiresCounterparty && counterpartyName && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8861
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Counterparty:" }),
|
|
8862
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: counterpartyName })
|
|
8863
|
+
] })
|
|
8864
|
+
] }),
|
|
8865
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
|
|
8866
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5 text-blue-500 mt-0.5 flex-shrink-0" }),
|
|
8867
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-blue-700 dark:text-blue-300", children: "You will receive a confirmation email once the transaction is completed." })
|
|
8868
|
+
] })
|
|
8869
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
8870
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-lg", children: [
|
|
8871
|
+
/* @__PURE__ */ jsx(XCircle, { className: "h-5 w-5 text-destructive mt-0.5 flex-shrink-0" }),
|
|
8872
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1 min-w-0 flex-1", children: [
|
|
8873
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-destructive", children: "Error Processing Transaction" }),
|
|
8874
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground break-words whitespace-pre-wrap", children: errorMessage })
|
|
8875
|
+
] })
|
|
8876
|
+
] }),
|
|
8877
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Please review the error message above and try again. If the problem persists, contact support." })
|
|
8878
|
+
] }) }),
|
|
8879
|
+
/* @__PURE__ */ jsxs(DialogFooter, { className: "sm:justify-end gap-2 flex-shrink-0", children: [
|
|
8882
8880
|
submissionStatus === "error" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "Edit" }),
|
|
8883
8881
|
submissionStatus === "success" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onNewTransaction, children: "New Transaction" }),
|
|
8884
8882
|
/* @__PURE__ */ jsx(
|
|
@@ -14348,32 +14346,41 @@ var newTransactionSchema = z.object({
|
|
|
14348
14346
|
adjustmentType: z.string().optional(),
|
|
14349
14347
|
// Transfer-specific fields
|
|
14350
14348
|
receiverAccountNumber: z.string().optional()
|
|
14351
|
-
}).refine(
|
|
14352
|
-
|
|
14353
|
-
|
|
14354
|
-
|
|
14349
|
+
}).refine(
|
|
14350
|
+
(data) => {
|
|
14351
|
+
const requiresCounterparty = ["ach", "wire"].includes(data.transactionType);
|
|
14352
|
+
if (requiresCounterparty && !data.counterpartyName) {
|
|
14353
|
+
return false;
|
|
14354
|
+
}
|
|
14355
|
+
return true;
|
|
14356
|
+
},
|
|
14357
|
+
{
|
|
14358
|
+
message: "Counterparty is required for ACH and Wire transactions",
|
|
14359
|
+
path: ["counterpartyName"]
|
|
14355
14360
|
}
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
}
|
|
14361
|
-
|
|
14362
|
-
|
|
14361
|
+
).refine(
|
|
14362
|
+
(data) => {
|
|
14363
|
+
if (data.transactionType === "adjustment") {
|
|
14364
|
+
if (!data.adjustmentDirection || !data.adjustmentType) return false;
|
|
14365
|
+
}
|
|
14366
|
+
return true;
|
|
14367
|
+
},
|
|
14368
|
+
{
|
|
14369
|
+
message: "Direction and Type are required for Adjustment transactions",
|
|
14370
|
+
path: ["adjustmentDirection"]
|
|
14363
14371
|
}
|
|
14364
|
-
|
|
14365
|
-
|
|
14366
|
-
|
|
14367
|
-
|
|
14368
|
-
}
|
|
14369
|
-
|
|
14370
|
-
|
|
14372
|
+
).refine(
|
|
14373
|
+
(data) => {
|
|
14374
|
+
if (data.transactionType === "transfer") {
|
|
14375
|
+
if (!data.receiverAccountNumber) return false;
|
|
14376
|
+
}
|
|
14377
|
+
return true;
|
|
14378
|
+
},
|
|
14379
|
+
{
|
|
14380
|
+
message: "Receiver account number is required for Transfer transactions",
|
|
14381
|
+
path: ["receiverAccountNumber"]
|
|
14371
14382
|
}
|
|
14372
|
-
|
|
14373
|
-
}, {
|
|
14374
|
-
message: "Receiver account number is required for Transfer transactions",
|
|
14375
|
-
path: ["receiverAccountNumber"]
|
|
14376
|
-
});
|
|
14383
|
+
);
|
|
14377
14384
|
var mockAccountData = {
|
|
14378
14385
|
accountNumber: "****1234",
|
|
14379
14386
|
accountName: "Business Checking",
|
|
@@ -14421,12 +14428,15 @@ function NewTransaction() {
|
|
|
14421
14428
|
receiverAccountNumber: ""
|
|
14422
14429
|
}
|
|
14423
14430
|
});
|
|
14424
|
-
const transactionTypeOptions = useMemo(
|
|
14425
|
-
|
|
14426
|
-
|
|
14427
|
-
|
|
14428
|
-
|
|
14429
|
-
|
|
14431
|
+
const transactionTypeOptions = useMemo(
|
|
14432
|
+
() => [
|
|
14433
|
+
{ value: "transfer", label: "Transfer", icon: ArrowLeftRight, disabled: false },
|
|
14434
|
+
{ value: "adjustment", label: "Adjustment", icon: Settings, disabled: false },
|
|
14435
|
+
{ value: "ach", label: "ACH", icon: Building2, disabled: true },
|
|
14436
|
+
{ value: "wire", label: "Wire", icon: Zap, disabled: false }
|
|
14437
|
+
],
|
|
14438
|
+
[]
|
|
14439
|
+
);
|
|
14430
14440
|
const adjustmentDirection = form.watch("adjustmentDirection");
|
|
14431
14441
|
const adjustmentTypeOptions = useMemo(() => {
|
|
14432
14442
|
if (adjustmentDirection === "credit") {
|
|
@@ -14484,13 +14494,9 @@ function NewTransaction() {
|
|
|
14484
14494
|
};
|
|
14485
14495
|
const filterByTransactionType = (results, txType) => {
|
|
14486
14496
|
if (txType === "ach") {
|
|
14487
|
-
return results.filter(
|
|
14488
|
-
(cp) => cp.paymentInstrumentType === "ach" || cp.paymentInstrumentType === "both"
|
|
14489
|
-
);
|
|
14497
|
+
return results.filter((cp) => cp.paymentInstrumentType === "ach" || cp.paymentInstrumentType === "both");
|
|
14490
14498
|
} else if (txType === "wire") {
|
|
14491
|
-
return results.filter(
|
|
14492
|
-
(cp) => cp.paymentInstrumentType === "wire" || cp.paymentInstrumentType === "both"
|
|
14493
|
-
);
|
|
14499
|
+
return results.filter((cp) => cp.paymentInstrumentType === "wire" || cp.paymentInstrumentType === "both");
|
|
14494
14500
|
}
|
|
14495
14501
|
return results;
|
|
14496
14502
|
};
|
|
@@ -14508,9 +14514,7 @@ function NewTransaction() {
|
|
|
14508
14514
|
}
|
|
14509
14515
|
try {
|
|
14510
14516
|
await new Promise((resolve) => setTimeout(resolve, 350));
|
|
14511
|
-
let filteredResults = mockSearchResults.filter(
|
|
14512
|
-
(cp) => cp.name.toLowerCase().includes(query.toLowerCase())
|
|
14513
|
-
);
|
|
14517
|
+
let filteredResults = mockSearchResults.filter((cp) => cp.name.toLowerCase().includes(query.toLowerCase()));
|
|
14514
14518
|
filteredResults = filterByTransactionType(filteredResults, txType);
|
|
14515
14519
|
const startIndex = (page - 1) * PAGE_SIZE;
|
|
14516
14520
|
const paginatedResults = filteredResults.slice(startIndex, startIndex + PAGE_SIZE);
|
|
@@ -14555,10 +14559,7 @@ function NewTransaction() {
|
|
|
14555
14559
|
if (counterpartyData && counterpartyLookedUp) {
|
|
14556
14560
|
const requiresCounterparty = ["ach", "wire"].includes(newType);
|
|
14557
14561
|
if (requiresCounterparty) {
|
|
14558
|
-
const isCompatible = isCounterpartyCompatible(
|
|
14559
|
-
counterpartyData.paymentInstrumentType,
|
|
14560
|
-
newType
|
|
14561
|
-
);
|
|
14562
|
+
const isCompatible = isCounterpartyCompatible(counterpartyData.paymentInstrumentType, newType);
|
|
14562
14563
|
if (!isCompatible) {
|
|
14563
14564
|
setCounterpartyLookedUp(false);
|
|
14564
14565
|
setCounterpartyData(null);
|
|
@@ -14705,7 +14706,9 @@ function NewTransaction() {
|
|
|
14705
14706
|
"Invalid routing number for the selected transaction type."
|
|
14706
14707
|
];
|
|
14707
14708
|
setSubmissionStatus("error");
|
|
14708
|
-
setErrorMessage(
|
|
14709
|
+
setErrorMessage(
|
|
14710
|
+
'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"])'
|
|
14711
|
+
);
|
|
14709
14712
|
} else {
|
|
14710
14713
|
const txId = "TXN-" + Math.random().toString(36).substr(2, 9).toUpperCase();
|
|
14711
14714
|
setTransactionId(txId);
|