braid-ui 1.0.55 → 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.d.cts CHANGED
@@ -1065,8 +1065,10 @@ interface NewTransactionViewProps {
1065
1065
  isReviewReady: boolean;
1066
1066
  adjustmentTypeOptions: AdjustmentTypeOption[];
1067
1067
  transactionTypeOptions: TransactionTypeOption[];
1068
+ showSuccessInfoBox?: boolean;
1069
+ successInfoMessage?: string;
1068
1070
  }
1069
- declare const NewTransactionView: ({ form, accountLookedUp, accountData, counterpartyLookedUp, counterpartyData, confirmationOpen, submissionStatus, errorMessage, transactionId, isAccountLoading, isCounterpartyLoading, isSubmitting, counterpartySearchResults, isCounterpartySearching, showCounterpartyDropdown, onAccountLookup, onEditAccount, onEditCounterparty, onTransactionTypeChange, onSubmit, onCancel, onConfirmationClose, onConfirmationOpenChange, onNewTransaction, onCounterpartySearchChange, onCounterpartySelect, onCounterpartyDropdownClose, counterpartyHasMore, counterpartyTotalResults, isLoadingMoreCounterparties, onLoadMoreCounterparties, receiverAccountLookedUp, receiverAccountData, isReceiverAccountLoading, onReceiverAccountLookup, onEditReceiverAccount, isReviewReady, adjustmentTypeOptions, transactionTypeOptions, }: NewTransactionViewProps) => react_jsx_runtime.JSX.Element;
1071
+ declare const NewTransactionView: ({ form, accountLookedUp, accountData, counterpartyLookedUp, counterpartyData, confirmationOpen, submissionStatus, errorMessage, transactionId, isAccountLoading, isCounterpartyLoading, isSubmitting, counterpartySearchResults, isCounterpartySearching, showCounterpartyDropdown, onAccountLookup, onEditAccount, onEditCounterparty, onTransactionTypeChange, onSubmit, onCancel, onConfirmationClose, onConfirmationOpenChange, onNewTransaction, onCounterpartySearchChange, onCounterpartySelect, onCounterpartyDropdownClose, counterpartyHasMore, counterpartyTotalResults, isLoadingMoreCounterparties, onLoadMoreCounterparties, receiverAccountLookedUp, receiverAccountData, isReceiverAccountLoading, onReceiverAccountLookup, onEditReceiverAccount, isReviewReady, adjustmentTypeOptions, transactionTypeOptions, showSuccessInfoBox, successInfoMessage, }: NewTransactionViewProps) => react_jsx_runtime.JSX.Element;
1070
1072
 
1071
1073
  interface AccountCardProps {
1072
1074
  account: {
package/dist/index.d.ts CHANGED
@@ -1065,8 +1065,10 @@ interface NewTransactionViewProps {
1065
1065
  isReviewReady: boolean;
1066
1066
  adjustmentTypeOptions: AdjustmentTypeOption[];
1067
1067
  transactionTypeOptions: TransactionTypeOption[];
1068
+ showSuccessInfoBox?: boolean;
1069
+ successInfoMessage?: string;
1068
1070
  }
1069
- declare const NewTransactionView: ({ form, accountLookedUp, accountData, counterpartyLookedUp, counterpartyData, confirmationOpen, submissionStatus, errorMessage, transactionId, isAccountLoading, isCounterpartyLoading, isSubmitting, counterpartySearchResults, isCounterpartySearching, showCounterpartyDropdown, onAccountLookup, onEditAccount, onEditCounterparty, onTransactionTypeChange, onSubmit, onCancel, onConfirmationClose, onConfirmationOpenChange, onNewTransaction, onCounterpartySearchChange, onCounterpartySelect, onCounterpartyDropdownClose, counterpartyHasMore, counterpartyTotalResults, isLoadingMoreCounterparties, onLoadMoreCounterparties, receiverAccountLookedUp, receiverAccountData, isReceiverAccountLoading, onReceiverAccountLookup, onEditReceiverAccount, isReviewReady, adjustmentTypeOptions, transactionTypeOptions, }: NewTransactionViewProps) => react_jsx_runtime.JSX.Element;
1071
+ declare const NewTransactionView: ({ form, accountLookedUp, accountData, counterpartyLookedUp, counterpartyData, confirmationOpen, submissionStatus, errorMessage, transactionId, isAccountLoading, isCounterpartyLoading, isSubmitting, counterpartySearchResults, isCounterpartySearching, showCounterpartyDropdown, onAccountLookup, onEditAccount, onEditCounterparty, onTransactionTypeChange, onSubmit, onCancel, onConfirmationClose, onConfirmationOpenChange, onNewTransaction, onCounterpartySearchChange, onCounterpartySelect, onCounterpartyDropdownClose, counterpartyHasMore, counterpartyTotalResults, isLoadingMoreCounterparties, onLoadMoreCounterparties, receiverAccountLookedUp, receiverAccountData, isReceiverAccountLoading, onReceiverAccountLookup, onEditReceiverAccount, isReviewReady, adjustmentTypeOptions, transactionTypeOptions, showSuccessInfoBox, successInfoMessage, }: NewTransactionViewProps) => react_jsx_runtime.JSX.Element;
1070
1072
 
1071
1073
  interface AccountCardProps {
1072
1074
  account: {
package/dist/index.js CHANGED
@@ -8446,7 +8446,9 @@ var NewTransactionView = ({
8446
8446
  onEditReceiverAccount,
8447
8447
  isReviewReady,
8448
8448
  adjustmentTypeOptions,
8449
- transactionTypeOptions
8449
+ transactionTypeOptions,
8450
+ showSuccessInfoBox = false,
8451
+ successInfoMessage = ""
8450
8452
  }) => {
8451
8453
  const transactionType = form.watch("transactionType");
8452
8454
  const accountNumber = form.watch("accountNumber");
@@ -8455,6 +8457,7 @@ var NewTransactionView = ({
8455
8457
  const receiverAccountNumber = form.watch("receiverAccountNumber");
8456
8458
  const adjustmentDirection = form.watch("adjustmentDirection");
8457
8459
  const adjustmentType = form.watch("adjustmentType");
8460
+ const description = form.watch("description");
8458
8461
  const requiresCounterparty = ["ach", "wire"].includes(transactionType);
8459
8462
  const isTransfer = transactionType === "transfer";
8460
8463
  const isAdjustment = transactionType === "adjustment";
@@ -8837,48 +8840,64 @@ var NewTransactionView = ({
8837
8840
  ] }) })
8838
8841
  ] }) }),
8839
8842
  /* @__PURE__ */ jsx(Dialog, { open: confirmationOpen, onOpenChange: () => {
8840
- }, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md", hideCloseButton: true, children: [
8841
- /* @__PURE__ */ jsxs(DialogHeader, { children: [
8842
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
8843
- 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" }) }),
8844
- /* @__PURE__ */ jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Successful" : "Transaction Failed" })
8845
- ] }),
8846
- /* @__PURE__ */ jsx(DialogDescription, { className: "text-left", children: submissionStatus === "success" ? /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
8847
- /* @__PURE__ */ jsx("p", { className: "text-foreground", children: "Your transaction has been successfully submitted and is being processed." }),
8848
- /* @__PURE__ */ jsxs("div", { className: "bg-muted/50 rounded-lg p-4 space-y-2", children: [
8849
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8850
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Transaction ID:" }),
8851
- /* @__PURE__ */ jsx("span", { className: "font-mono font-medium", children: transactionId })
8852
- ] }),
8843
+ }, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md flex flex-col max-h-[85vh]", hideCloseButton: true, children: [
8844
+ /* @__PURE__ */ jsx(DialogHeader, { className: "flex-shrink-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
8845
+ 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" }) }),
8846
+ /* @__PURE__ */ jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Submitted" : "Transaction Failed" })
8847
+ ] }) }),
8848
+ /* @__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: [
8849
+ /* @__PURE__ */ jsx("p", { className: "text-foreground", children: "Your transaction has been successfully submitted and is being processed." }),
8850
+ /* @__PURE__ */ jsxs("div", { className: "bg-muted/50 rounded-lg p-4 space-y-2", children: [
8851
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8852
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Payment ID:" }),
8853
+ /* @__PURE__ */ jsx("span", { className: "font-mono font-medium text-xs", children: crypto.randomUUID() })
8854
+ ] }),
8855
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8856
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Account:" }),
8857
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: accountData ? `${accountData.accountName} (${accountData.accountNumber})` : "N/A" })
8858
+ ] }),
8859
+ transactionType === "transfer" && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8860
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Receiver Account:" }),
8861
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: receiverAccountData ? `${receiverAccountData.accountName} (${receiverAccountData.accountNumber})` : "N/A" })
8862
+ ] }),
8863
+ transactionType === "adjustment" && /* @__PURE__ */ jsxs(Fragment, { children: [
8853
8864
  /* @__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) })
8865
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Direction:" }),
8866
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: adjustmentDirection === "debit" ? "Debit" : "Credit" })
8856
8867
  ] }),
8857
8868
  /* @__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 })
8869
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Adjustment Type:" }),
8870
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: adjustmentTypeOptions.find((t) => t.value === adjustmentType)?.label || "N/A" })
8864
8871
  ] })
8865
8872
  ] }),
8866
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
8867
- /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5 text-blue-500 mt-0.5 flex-shrink-0" }),
8868
- /* @__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." })
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
- ] })
8873
+ (transactionType === "wire" || transactionType === "ach") && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8874
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Customer Name:" }),
8875
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: counterpartyName || "N/A" })
8877
8876
  ] }),
8878
- /* @__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." })
8879
- ] }) })
8880
- ] }),
8881
- /* @__PURE__ */ jsxs(DialogFooter, { className: "sm:justify-end gap-2", children: [
8877
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8878
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
8879
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
8880
+ ] }),
8881
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8882
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Description:" }),
8883
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: description || "N/A" })
8884
+ ] })
8885
+ ] }),
8886
+ showSuccessInfoBox && successInfoMessage && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
8887
+ /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5 text-blue-500 mt-0.5 flex-shrink-0" }),
8888
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-blue-700 dark:text-blue-300", children: successInfoMessage })
8889
+ ] })
8890
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
8891
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-lg", children: [
8892
+ /* @__PURE__ */ jsx(XCircle, { className: "h-5 w-5 text-destructive mt-0.5 flex-shrink-0" }),
8893
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1 min-w-0 flex-1", children: [
8894
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-destructive", children: "Error Processing Transaction" }),
8895
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground break-words whitespace-pre-wrap", children: errorMessage })
8896
+ ] })
8897
+ ] }),
8898
+ /* @__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." })
8899
+ ] }) }),
8900
+ /* @__PURE__ */ jsxs(DialogFooter, { className: "sm:justify-end gap-2 flex-shrink-0", children: [
8882
8901
  submissionStatus === "error" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "Edit" }),
8883
8902
  submissionStatus === "success" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onNewTransaction, children: "New Transaction" }),
8884
8903
  /* @__PURE__ */ jsx(
@@ -14348,32 +14367,41 @@ var newTransactionSchema = z.object({
14348
14367
  adjustmentType: z.string().optional(),
14349
14368
  // Transfer-specific fields
14350
14369
  receiverAccountNumber: z.string().optional()
14351
- }).refine((data) => {
14352
- const requiresCounterparty = ["ach", "wire"].includes(data.transactionType);
14353
- if (requiresCounterparty && !data.counterpartyName) {
14354
- return false;
14370
+ }).refine(
14371
+ (data) => {
14372
+ const requiresCounterparty = ["ach", "wire"].includes(data.transactionType);
14373
+ if (requiresCounterparty && !data.counterpartyName) {
14374
+ return false;
14375
+ }
14376
+ return true;
14377
+ },
14378
+ {
14379
+ message: "Counterparty is required for ACH and Wire transactions",
14380
+ path: ["counterpartyName"]
14355
14381
  }
14356
- return true;
14357
- }, {
14358
- message: "Counterparty is required for ACH and Wire transactions",
14359
- path: ["counterpartyName"]
14360
- }).refine((data) => {
14361
- if (data.transactionType === "adjustment") {
14362
- if (!data.adjustmentDirection || !data.adjustmentType) return false;
14382
+ ).refine(
14383
+ (data) => {
14384
+ if (data.transactionType === "adjustment") {
14385
+ if (!data.adjustmentDirection || !data.adjustmentType) return false;
14386
+ }
14387
+ return true;
14388
+ },
14389
+ {
14390
+ message: "Direction and Type are required for Adjustment transactions",
14391
+ path: ["adjustmentDirection"]
14363
14392
  }
14364
- return true;
14365
- }, {
14366
- message: "Direction and Type are required for Adjustment transactions",
14367
- path: ["adjustmentDirection"]
14368
- }).refine((data) => {
14369
- if (data.transactionType === "transfer") {
14370
- if (!data.receiverAccountNumber) return false;
14393
+ ).refine(
14394
+ (data) => {
14395
+ if (data.transactionType === "transfer") {
14396
+ if (!data.receiverAccountNumber) return false;
14397
+ }
14398
+ return true;
14399
+ },
14400
+ {
14401
+ message: "Receiver account number is required for Transfer transactions",
14402
+ path: ["receiverAccountNumber"]
14371
14403
  }
14372
- return true;
14373
- }, {
14374
- message: "Receiver account number is required for Transfer transactions",
14375
- path: ["receiverAccountNumber"]
14376
- });
14404
+ );
14377
14405
  var mockAccountData = {
14378
14406
  accountNumber: "****1234",
14379
14407
  accountName: "Business Checking",
@@ -14421,12 +14449,15 @@ function NewTransaction() {
14421
14449
  receiverAccountNumber: ""
14422
14450
  }
14423
14451
  });
14424
- const transactionTypeOptions = useMemo(() => [
14425
- { value: "transfer", label: "Transfer", icon: ArrowLeftRight, disabled: false },
14426
- { value: "adjustment", label: "Adjustment", icon: Settings, disabled: false },
14427
- { value: "ach", label: "ACH", icon: Building2, disabled: true },
14428
- { value: "wire", label: "Wire", icon: Zap, disabled: false }
14429
- ], []);
14452
+ const transactionTypeOptions = useMemo(
14453
+ () => [
14454
+ { value: "transfer", label: "Transfer", icon: ArrowLeftRight, disabled: false },
14455
+ { value: "adjustment", label: "Adjustment", icon: Settings, disabled: false },
14456
+ { value: "ach", label: "ACH", icon: Building2, disabled: true },
14457
+ { value: "wire", label: "Wire", icon: Zap, disabled: false }
14458
+ ],
14459
+ []
14460
+ );
14430
14461
  const adjustmentDirection = form.watch("adjustmentDirection");
14431
14462
  const adjustmentTypeOptions = useMemo(() => {
14432
14463
  if (adjustmentDirection === "credit") {
@@ -14484,13 +14515,9 @@ function NewTransaction() {
14484
14515
  };
14485
14516
  const filterByTransactionType = (results, txType) => {
14486
14517
  if (txType === "ach") {
14487
- return results.filter(
14488
- (cp) => cp.paymentInstrumentType === "ach" || cp.paymentInstrumentType === "both"
14489
- );
14518
+ return results.filter((cp) => cp.paymentInstrumentType === "ach" || cp.paymentInstrumentType === "both");
14490
14519
  } else if (txType === "wire") {
14491
- return results.filter(
14492
- (cp) => cp.paymentInstrumentType === "wire" || cp.paymentInstrumentType === "both"
14493
- );
14520
+ return results.filter((cp) => cp.paymentInstrumentType === "wire" || cp.paymentInstrumentType === "both");
14494
14521
  }
14495
14522
  return results;
14496
14523
  };
@@ -14508,9 +14535,7 @@ function NewTransaction() {
14508
14535
  }
14509
14536
  try {
14510
14537
  await new Promise((resolve) => setTimeout(resolve, 350));
14511
- let filteredResults = mockSearchResults.filter(
14512
- (cp) => cp.name.toLowerCase().includes(query.toLowerCase())
14513
- );
14538
+ let filteredResults = mockSearchResults.filter((cp) => cp.name.toLowerCase().includes(query.toLowerCase()));
14514
14539
  filteredResults = filterByTransactionType(filteredResults, txType);
14515
14540
  const startIndex = (page - 1) * PAGE_SIZE;
14516
14541
  const paginatedResults = filteredResults.slice(startIndex, startIndex + PAGE_SIZE);
@@ -14555,10 +14580,7 @@ function NewTransaction() {
14555
14580
  if (counterpartyData && counterpartyLookedUp) {
14556
14581
  const requiresCounterparty = ["ach", "wire"].includes(newType);
14557
14582
  if (requiresCounterparty) {
14558
- const isCompatible = isCounterpartyCompatible(
14559
- counterpartyData.paymentInstrumentType,
14560
- newType
14561
- );
14583
+ const isCompatible = isCounterpartyCompatible(counterpartyData.paymentInstrumentType, newType);
14562
14584
  if (!isCompatible) {
14563
14585
  setCounterpartyLookedUp(false);
14564
14586
  setCounterpartyData(null);
@@ -14696,7 +14718,7 @@ function NewTransaction() {
14696
14718
  };
14697
14719
  console.log("Transaction submission payload:", submissionPayload);
14698
14720
  await new Promise((resolve) => setTimeout(resolve, 1500));
14699
- const hasError = Math.random() > 0.1;
14721
+ const hasError = Math.random() > 0.7;
14700
14722
  if (hasError) {
14701
14723
  const errorScenarios = [
14702
14724
  "Insufficient funds. Current balance: $125,450.00, Required: $" + parseFloat(data.amount).toFixed(2),