braid-ui 1.0.51 → 1.0.53
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 +342 -330
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +343 -330
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3067,7 +3067,7 @@ function AppSidebar() {
|
|
|
3067
3067
|
] });
|
|
3068
3068
|
}
|
|
3069
3069
|
var MainLayout = ({ children }) => {
|
|
3070
|
-
return /* @__PURE__ */ jsx("
|
|
3070
|
+
return /* @__PURE__ */ jsx("main", { className: "flex-1 h-full overflow-y-auto", children });
|
|
3071
3071
|
};
|
|
3072
3072
|
var useEditState = ({ initialEditing = false, onToggleEdit, onSave, onCancel }) => {
|
|
3073
3073
|
const [localEditing, setLocalEditing] = useState(initialEditing);
|
|
@@ -8413,11 +8413,6 @@ var ADJUSTMENT_DIRECTION_OPTIONS = [
|
|
|
8413
8413
|
{ value: "debit", label: "Debit" },
|
|
8414
8414
|
{ value: "credit", label: "Credit" }
|
|
8415
8415
|
];
|
|
8416
|
-
var ADJUSTMENT_TYPE_OPTIONS = [
|
|
8417
|
-
{ value: "collection", label: "Collection" },
|
|
8418
|
-
{ value: "transaction_reversal", label: "Transaction Reversal" },
|
|
8419
|
-
{ value: "transaction_adjustment", label: "Transaction Adjustment" }
|
|
8420
|
-
];
|
|
8421
8416
|
var NewTransactionView = ({
|
|
8422
8417
|
form,
|
|
8423
8418
|
accountLookedUp,
|
|
@@ -8451,7 +8446,8 @@ var NewTransactionView = ({
|
|
|
8451
8446
|
isReceiverAccountLoading,
|
|
8452
8447
|
onReceiverAccountLookup,
|
|
8453
8448
|
onEditReceiverAccount,
|
|
8454
|
-
isReviewReady
|
|
8449
|
+
isReviewReady,
|
|
8450
|
+
adjustmentTypeOptions
|
|
8455
8451
|
}) => {
|
|
8456
8452
|
const transactionType = form.watch("transactionType");
|
|
8457
8453
|
const accountNumber = form.watch("accountNumber");
|
|
@@ -8505,7 +8501,7 @@ var NewTransactionView = ({
|
|
|
8505
8501
|
{ label: "Account Number", value: accountNumber || "-" },
|
|
8506
8502
|
...isAdjustment ? [
|
|
8507
8503
|
{ label: "Direction", value: adjustmentDirection === "debit" ? "Debit" : adjustmentDirection === "credit" ? "Credit" : "-" },
|
|
8508
|
-
{ label: "Adjustment Type", value:
|
|
8504
|
+
{ label: "Adjustment Type", value: adjustmentTypeOptions.find((t) => t.value === adjustmentType)?.label || "-" }
|
|
8509
8505
|
] : [],
|
|
8510
8506
|
...isTransfer ? [{ label: "Receiver Account", value: receiverAccountNumber || "-" }] : [],
|
|
8511
8507
|
...requiresCounterparty ? [{ label: "Counterparty", value: counterpartyName || "-" }] : [],
|
|
@@ -8518,364 +8514,362 @@ var NewTransactionView = ({
|
|
|
8518
8514
|
items: reviewItems
|
|
8519
8515
|
}
|
|
8520
8516
|
];
|
|
8521
|
-
return /* @__PURE__ */ jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [
|
|
8517
|
+
return /* @__PURE__ */ jsxs("div", { className: "container mx-auto p-6 space-y-6 max-w-4xl", children: [
|
|
8522
8518
|
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "New Transaction" }) }),
|
|
8523
|
-
/* @__PURE__ */ jsxs("
|
|
8524
|
-
/* @__PURE__ */ jsx(
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
FormInput,
|
|
8528
|
-
{
|
|
8529
|
-
name: "accountNumber",
|
|
8530
|
-
placeholder: "Enter account number"
|
|
8531
|
-
}
|
|
8532
|
-
) }),
|
|
8533
|
-
/* @__PURE__ */ jsx(
|
|
8534
|
-
Button,
|
|
8535
|
-
{
|
|
8536
|
-
onClick: onAccountLookup,
|
|
8537
|
-
disabled: !accountNumber || isAccountLoading,
|
|
8538
|
-
className: "shrink-0 mt-0 w-48",
|
|
8539
|
-
children: isAccountLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8540
|
-
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
8541
|
-
"Looking up..."
|
|
8542
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8543
|
-
/* @__PURE__ */ jsx(Search, { className: "h-4 w-4 mr-2" }),
|
|
8544
|
-
"Lookup Account"
|
|
8545
|
-
] })
|
|
8546
|
-
}
|
|
8547
|
-
)
|
|
8548
|
-
] }) }) : /* @__PURE__ */ jsx(
|
|
8549
|
-
FormCard,
|
|
8519
|
+
/* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("form", { onSubmit: (e) => e.preventDefault(), children: [
|
|
8520
|
+
!accountLookedUp ? /* @__PURE__ */ jsx(FormCard, { title: "Account Lookup", variant: "default", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3 items-start w-full", children: [
|
|
8521
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
8522
|
+
FormInput,
|
|
8550
8523
|
{
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
headerActions: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8554
|
-
/* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 text-success" }),
|
|
8555
|
-
/* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditAccount, children: [
|
|
8556
|
-
/* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-1" }),
|
|
8557
|
-
"Edit"
|
|
8558
|
-
] })
|
|
8559
|
-
] }),
|
|
8560
|
-
children: /* @__PURE__ */ jsx(DataGrid, { data: accountDataGrid, columns: 2 })
|
|
8524
|
+
name: "accountNumber",
|
|
8525
|
+
placeholder: "Enter account number"
|
|
8561
8526
|
}
|
|
8562
|
-
),
|
|
8527
|
+
) }),
|
|
8563
8528
|
/* @__PURE__ */ jsx(
|
|
8564
|
-
|
|
8529
|
+
Button,
|
|
8565
8530
|
{
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
className:
|
|
8569
|
-
children: /* @__PURE__ */
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8531
|
+
onClick: onAccountLookup,
|
|
8532
|
+
disabled: !accountNumber || isAccountLoading,
|
|
8533
|
+
className: "shrink-0 mt-0 w-48",
|
|
8534
|
+
children: isAccountLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8535
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
8536
|
+
"Looking up..."
|
|
8537
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8538
|
+
/* @__PURE__ */ jsx(Search, { className: "h-4 w-4 mr-2" }),
|
|
8539
|
+
"Lookup Account"
|
|
8540
|
+
] })
|
|
8541
|
+
}
|
|
8542
|
+
)
|
|
8543
|
+
] }) }) : /* @__PURE__ */ jsx(
|
|
8544
|
+
FormCard,
|
|
8545
|
+
{
|
|
8546
|
+
title: "Account Information",
|
|
8547
|
+
variant: "subtle",
|
|
8548
|
+
headerActions: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8549
|
+
/* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 text-success" }),
|
|
8550
|
+
/* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditAccount, children: [
|
|
8551
|
+
/* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-1" }),
|
|
8552
|
+
"Edit"
|
|
8553
|
+
] })
|
|
8554
|
+
] }),
|
|
8555
|
+
children: /* @__PURE__ */ jsx(DataGrid, { data: accountDataGrid, columns: 2 })
|
|
8556
|
+
}
|
|
8557
|
+
),
|
|
8558
|
+
/* @__PURE__ */ jsx(
|
|
8559
|
+
FormCard,
|
|
8560
|
+
{
|
|
8561
|
+
title: "Transaction Type",
|
|
8562
|
+
variant: "default",
|
|
8563
|
+
className: cn(!accountLookedUp && "opacity-50 pointer-events-none"),
|
|
8564
|
+
children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-3 lg:gap-4", children: TRANSACTION_TYPES.map((type) => {
|
|
8565
|
+
const Icon2 = type.icon;
|
|
8566
|
+
const isSelected = transactionType === type.value;
|
|
8567
|
+
return /* @__PURE__ */ jsxs(
|
|
8568
|
+
"button",
|
|
8569
|
+
{
|
|
8570
|
+
type: "button",
|
|
8571
|
+
onClick: () => onTransactionTypeChange(type.value),
|
|
8572
|
+
disabled: !accountLookedUp,
|
|
8573
|
+
className: cn(
|
|
8574
|
+
"flex flex-col items-center justify-center p-4 lg:p-3 rounded-lg border-2 transition-all",
|
|
8575
|
+
"hover:border-primary/50 hover:shadow-md",
|
|
8576
|
+
isSelected ? "border-primary bg-primary/5 shadow-sm" : "border-border bg-card"
|
|
8577
|
+
),
|
|
8578
|
+
children: [
|
|
8579
|
+
/* @__PURE__ */ jsx(Icon2, { className: cn(
|
|
8580
|
+
"h-6 w-6 lg:h-5 lg:w-5 mb-2",
|
|
8581
|
+
isSelected ? "text-primary" : "text-muted-foreground"
|
|
8582
|
+
) }),
|
|
8583
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
8584
|
+
"text-sm font-medium",
|
|
8585
|
+
isSelected ? "text-primary" : "text-foreground"
|
|
8586
|
+
), children: type.label })
|
|
8587
|
+
]
|
|
8588
|
+
},
|
|
8589
|
+
type.value
|
|
8590
|
+
);
|
|
8591
|
+
}) })
|
|
8592
|
+
}
|
|
8593
|
+
),
|
|
8594
|
+
requiresCounterparty && (!counterpartyLookedUp ? /* @__PURE__ */ jsxs(
|
|
8595
|
+
FormCard,
|
|
8596
|
+
{
|
|
8597
|
+
title: "Counterparty Search",
|
|
8598
|
+
variant: "default",
|
|
8599
|
+
className: cn(!transactionType && "opacity-50 pointer-events-none"),
|
|
8600
|
+
children: [
|
|
8601
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
8602
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
8603
|
+
/* @__PURE__ */ jsx(
|
|
8604
|
+
"input",
|
|
8605
|
+
{
|
|
8606
|
+
type: "text",
|
|
8607
|
+
placeholder: "Start typing to search counterparties...",
|
|
8608
|
+
value: counterpartyName,
|
|
8609
|
+
onChange: (e) => onCounterpartySearchChange(e.target.value),
|
|
8610
|
+
disabled: !transactionType,
|
|
8611
|
+
className: cn(
|
|
8612
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
8613
|
+
"ring-offset-background placeholder:text-muted-foreground",
|
|
8614
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
8615
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
8616
|
+
isCounterpartySearching && "pr-10"
|
|
8617
|
+
)
|
|
8618
|
+
}
|
|
8619
|
+
),
|
|
8620
|
+
isCounterpartySearching && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin text-muted-foreground" }) })
|
|
8621
|
+
] }),
|
|
8622
|
+
showCounterpartyDropdown && counterpartySearchResults.length > 0 && /* @__PURE__ */ jsx("div", { className: "absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg max-h-60 overflow-auto", children: counterpartySearchResults.map((result) => /* @__PURE__ */ jsxs(
|
|
8573
8623
|
"button",
|
|
8574
8624
|
{
|
|
8575
8625
|
type: "button",
|
|
8576
|
-
onClick: () =>
|
|
8577
|
-
|
|
8578
|
-
className: cn(
|
|
8579
|
-
"flex flex-col items-center justify-center p-4 lg:p-3 rounded-lg border-2 transition-all",
|
|
8580
|
-
"hover:border-primary/50 hover:shadow-md",
|
|
8581
|
-
isSelected ? "border-primary bg-primary/5 shadow-sm" : "border-border bg-card"
|
|
8582
|
-
),
|
|
8626
|
+
onClick: () => onCounterpartySelect(result),
|
|
8627
|
+
className: "w-full px-3 py-2 text-left hover:bg-accent transition-colors",
|
|
8583
8628
|
children: [
|
|
8584
|
-
/* @__PURE__ */ jsx(
|
|
8585
|
-
|
|
8586
|
-
isSelected ? "text-primary" : "text-muted-foreground"
|
|
8587
|
-
) }),
|
|
8588
|
-
/* @__PURE__ */ jsx("span", { className: cn(
|
|
8589
|
-
"text-sm font-medium",
|
|
8590
|
-
isSelected ? "text-primary" : "text-foreground"
|
|
8591
|
-
), children: type.label })
|
|
8629
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children: result.name }),
|
|
8630
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: result.id })
|
|
8592
8631
|
]
|
|
8593
8632
|
},
|
|
8594
|
-
|
|
8595
|
-
)
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
{
|
|
8602
|
-
title: "Counterparty Search",
|
|
8603
|
-
variant: "default",
|
|
8604
|
-
className: cn(!transactionType && "opacity-50 pointer-events-none"),
|
|
8605
|
-
children: [
|
|
8606
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
8607
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
8608
|
-
/* @__PURE__ */ jsx(
|
|
8609
|
-
"input",
|
|
8610
|
-
{
|
|
8611
|
-
type: "text",
|
|
8612
|
-
placeholder: "Start typing to search counterparties...",
|
|
8613
|
-
value: counterpartyName,
|
|
8614
|
-
onChange: (e) => onCounterpartySearchChange(e.target.value),
|
|
8615
|
-
disabled: !transactionType,
|
|
8616
|
-
className: cn(
|
|
8617
|
-
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
8618
|
-
"ring-offset-background placeholder:text-muted-foreground",
|
|
8619
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
8620
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
8621
|
-
isCounterpartySearching && "pr-10"
|
|
8622
|
-
)
|
|
8623
|
-
}
|
|
8624
|
-
),
|
|
8625
|
-
isCounterpartySearching && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin text-muted-foreground" }) })
|
|
8626
|
-
] }),
|
|
8627
|
-
showCounterpartyDropdown && counterpartySearchResults.length > 0 && /* @__PURE__ */ jsx("div", { className: "absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg max-h-60 overflow-auto", children: counterpartySearchResults.map((result) => /* @__PURE__ */ jsxs(
|
|
8628
|
-
"button",
|
|
8629
|
-
{
|
|
8630
|
-
type: "button",
|
|
8631
|
-
onClick: () => onCounterpartySelect(result),
|
|
8632
|
-
className: "w-full px-3 py-2 text-left hover:bg-accent transition-colors",
|
|
8633
|
-
children: [
|
|
8634
|
-
/* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children: result.name }),
|
|
8635
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: result.id })
|
|
8636
|
-
]
|
|
8637
|
-
},
|
|
8638
|
-
result.id
|
|
8639
|
-
)) }),
|
|
8640
|
-
showCounterpartyDropdown && counterpartySearchResults.length === 0 && !isCounterpartySearching && counterpartyName.length >= 2 && /* @__PURE__ */ jsx("div", { className: "absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg p-3", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
8641
|
-
'No counterparties found matching "',
|
|
8642
|
-
counterpartyName,
|
|
8643
|
-
'"'
|
|
8644
|
-
] }) })
|
|
8645
|
-
] }),
|
|
8646
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2", children: "Type at least 2 characters to search" })
|
|
8647
|
-
]
|
|
8648
|
-
}
|
|
8649
|
-
) : /* @__PURE__ */ jsx(
|
|
8650
|
-
FormCard,
|
|
8651
|
-
{
|
|
8652
|
-
title: "Counterparty Information",
|
|
8653
|
-
variant: "subtle",
|
|
8654
|
-
headerActions: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8655
|
-
/* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 text-success" }),
|
|
8656
|
-
/* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditCounterparty, children: [
|
|
8657
|
-
/* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-1" }),
|
|
8658
|
-
"Edit"
|
|
8659
|
-
] })
|
|
8633
|
+
result.id
|
|
8634
|
+
)) }),
|
|
8635
|
+
showCounterpartyDropdown && counterpartySearchResults.length === 0 && !isCounterpartySearching && counterpartyName.length >= 2 && /* @__PURE__ */ jsx("div", { className: "absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg p-3", children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
8636
|
+
'No counterparties found matching "',
|
|
8637
|
+
counterpartyName,
|
|
8638
|
+
'"'
|
|
8639
|
+
] }) })
|
|
8660
8640
|
] }),
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8641
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2", children: "Type at least 2 characters to search" })
|
|
8642
|
+
]
|
|
8643
|
+
}
|
|
8644
|
+
) : /* @__PURE__ */ jsx(
|
|
8645
|
+
FormCard,
|
|
8646
|
+
{
|
|
8647
|
+
title: "Counterparty Information",
|
|
8648
|
+
variant: "subtle",
|
|
8649
|
+
headerActions: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8650
|
+
/* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 text-success" }),
|
|
8651
|
+
/* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditCounterparty, children: [
|
|
8652
|
+
/* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-1" }),
|
|
8653
|
+
"Edit"
|
|
8654
|
+
] })
|
|
8655
|
+
] }),
|
|
8656
|
+
children: /* @__PURE__ */ jsx(DataGrid, { data: counterpartyDataGrid, columns: 2 })
|
|
8657
|
+
}
|
|
8658
|
+
)),
|
|
8659
|
+
isTransfer && (!receiverAccountLookedUp ? /* @__PURE__ */ jsx(
|
|
8660
|
+
FormCard,
|
|
8661
|
+
{
|
|
8662
|
+
title: "Receiver Account",
|
|
8663
|
+
variant: "default",
|
|
8664
|
+
className: cn(!transactionType && "opacity-50 pointer-events-none"),
|
|
8665
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3 items-start w-full", children: [
|
|
8666
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
8667
|
+
FormInput,
|
|
8668
|
+
{
|
|
8669
|
+
name: "receiverAccountNumber",
|
|
8670
|
+
placeholder: "Enter receiver account number",
|
|
8671
|
+
disabled: !transactionType
|
|
8672
|
+
}
|
|
8673
|
+
) }),
|
|
8674
|
+
/* @__PURE__ */ jsx(
|
|
8675
|
+
Button,
|
|
8676
|
+
{
|
|
8677
|
+
onClick: onReceiverAccountLookup,
|
|
8678
|
+
disabled: !receiverAccountNumber || isReceiverAccountLoading,
|
|
8679
|
+
className: "shrink-0 mt-0 w-48",
|
|
8680
|
+
children: isReceiverAccountLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8681
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
8682
|
+
"Looking up..."
|
|
8683
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8684
|
+
/* @__PURE__ */ jsx(Search, { className: "h-4 w-4 mr-2" }),
|
|
8685
|
+
"Lookup Receiver"
|
|
8686
|
+
] })
|
|
8687
|
+
}
|
|
8688
|
+
)
|
|
8689
|
+
] })
|
|
8690
|
+
}
|
|
8691
|
+
) : /* @__PURE__ */ jsx(
|
|
8692
|
+
FormCard,
|
|
8693
|
+
{
|
|
8694
|
+
title: "Receiver Account Information",
|
|
8695
|
+
variant: "subtle",
|
|
8696
|
+
headerActions: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8697
|
+
/* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 text-success" }),
|
|
8698
|
+
/* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditReceiverAccount, children: [
|
|
8699
|
+
/* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-1" }),
|
|
8700
|
+
"Edit"
|
|
8701
|
+
] })
|
|
8702
|
+
] }),
|
|
8703
|
+
children: /* @__PURE__ */ jsx(DataGrid, { data: receiverAccountDataGrid, columns: 2 })
|
|
8704
|
+
}
|
|
8705
|
+
)),
|
|
8706
|
+
/* @__PURE__ */ jsx(
|
|
8707
|
+
FormCard,
|
|
8708
|
+
{
|
|
8709
|
+
title: "Transaction Details",
|
|
8710
|
+
variant: "default",
|
|
8711
|
+
className: cn(
|
|
8712
|
+
requiresCounterparty ? !counterpartyLookedUp && "opacity-50 pointer-events-none" : isTransfer ? !receiverAccountLookedUp && "opacity-50 pointer-events-none" : !transactionType && "opacity-50 pointer-events-none"
|
|
8713
|
+
),
|
|
8714
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
8715
|
+
isAdjustment && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
8716
|
+
/* @__PURE__ */ jsx(
|
|
8717
|
+
FormSelect,
|
|
8673
8718
|
{
|
|
8674
|
-
name: "
|
|
8675
|
-
|
|
8719
|
+
name: "adjustmentDirection",
|
|
8720
|
+
label: "Direction",
|
|
8721
|
+
placeholder: "Select direction",
|
|
8722
|
+
options: ADJUSTMENT_DIRECTION_OPTIONS,
|
|
8676
8723
|
disabled: !transactionType
|
|
8677
8724
|
}
|
|
8678
|
-
)
|
|
8725
|
+
),
|
|
8679
8726
|
/* @__PURE__ */ jsx(
|
|
8680
|
-
|
|
8727
|
+
FormSelect,
|
|
8681
8728
|
{
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
"Looking up..."
|
|
8688
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8689
|
-
/* @__PURE__ */ jsx(Search, { className: "h-4 w-4 mr-2" }),
|
|
8690
|
-
"Lookup Receiver"
|
|
8691
|
-
] })
|
|
8729
|
+
name: "adjustmentType",
|
|
8730
|
+
label: "Adjustment Type",
|
|
8731
|
+
placeholder: "Select type",
|
|
8732
|
+
options: adjustmentTypeOptions,
|
|
8733
|
+
disabled: !transactionType || !adjustmentDirection
|
|
8692
8734
|
}
|
|
8693
8735
|
)
|
|
8694
|
-
] })
|
|
8695
|
-
}
|
|
8696
|
-
) : /* @__PURE__ */ jsx(
|
|
8697
|
-
FormCard,
|
|
8698
|
-
{
|
|
8699
|
-
title: "Receiver Account Information",
|
|
8700
|
-
variant: "subtle",
|
|
8701
|
-
headerActions: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8702
|
-
/* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 text-success" }),
|
|
8703
|
-
/* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditReceiverAccount, children: [
|
|
8704
|
-
/* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-1" }),
|
|
8705
|
-
"Edit"
|
|
8706
|
-
] })
|
|
8707
8736
|
] }),
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8737
|
+
/* @__PURE__ */ jsx(
|
|
8738
|
+
Controller,
|
|
8739
|
+
{
|
|
8740
|
+
name: "amount",
|
|
8741
|
+
control: form.control,
|
|
8742
|
+
render: ({ field }) => /* @__PURE__ */ jsx(
|
|
8743
|
+
CurrencyInput,
|
|
8744
|
+
{
|
|
8745
|
+
label: "Amount",
|
|
8746
|
+
value: field.value,
|
|
8747
|
+
onChange: field.onChange,
|
|
8748
|
+
disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType,
|
|
8749
|
+
error: form.formState.errors.amount?.message
|
|
8750
|
+
}
|
|
8751
|
+
)
|
|
8752
|
+
}
|
|
8718
8753
|
),
|
|
8719
|
-
|
|
8720
|
-
|
|
8754
|
+
/* @__PURE__ */ jsx(
|
|
8755
|
+
FormInput,
|
|
8756
|
+
{
|
|
8757
|
+
name: "description",
|
|
8758
|
+
label: "Description (Optional)",
|
|
8759
|
+
placeholder: "Enter transaction description",
|
|
8760
|
+
disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType
|
|
8761
|
+
}
|
|
8762
|
+
)
|
|
8763
|
+
] })
|
|
8764
|
+
}
|
|
8765
|
+
),
|
|
8766
|
+
/* @__PURE__ */ jsx(FormCard, { title: "Review & Submit", variant: "default", className: cn(!isReviewReady && "opacity-50 pointer-events-none"), children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
8767
|
+
/* @__PURE__ */ jsx(DataGrid, { data: reviewData, columns: 2 }),
|
|
8768
|
+
/* @__PURE__ */ jsx("div", { className: "bg-muted/30 rounded-lg p-4 border border-border/50", children: /* @__PURE__ */ jsx(
|
|
8769
|
+
Controller,
|
|
8770
|
+
{
|
|
8771
|
+
name: "certifyInformation",
|
|
8772
|
+
control: form.control,
|
|
8773
|
+
render: ({ field }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
8774
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
8721
8775
|
/* @__PURE__ */ jsx(
|
|
8722
|
-
|
|
8776
|
+
Checkbox,
|
|
8723
8777
|
{
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
options: ADJUSTMENT_DIRECTION_OPTIONS,
|
|
8728
|
-
disabled: !transactionType
|
|
8778
|
+
id: "certifyInformation",
|
|
8779
|
+
checked: field.value,
|
|
8780
|
+
onCheckedChange: field.onChange
|
|
8729
8781
|
}
|
|
8730
8782
|
),
|
|
8731
8783
|
/* @__PURE__ */ jsx(
|
|
8732
|
-
|
|
8784
|
+
"label",
|
|
8733
8785
|
{
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
options: ADJUSTMENT_TYPE_OPTIONS,
|
|
8738
|
-
disabled: !transactionType
|
|
8786
|
+
htmlFor: "certifyInformation",
|
|
8787
|
+
className: "text-sm font-medium leading-relaxed cursor-pointer select-none",
|
|
8788
|
+
children: "I certify that all information entered is correct and accurate to the best of my knowledge"
|
|
8739
8789
|
}
|
|
8740
8790
|
)
|
|
8741
8791
|
] }),
|
|
8742
|
-
/* @__PURE__ */ jsx(
|
|
8743
|
-
Controller,
|
|
8744
|
-
{
|
|
8745
|
-
name: "amount",
|
|
8746
|
-
control: form.control,
|
|
8747
|
-
render: ({ field }) => /* @__PURE__ */ jsx(
|
|
8748
|
-
CurrencyInput,
|
|
8749
|
-
{
|
|
8750
|
-
label: "Amount",
|
|
8751
|
-
value: field.value,
|
|
8752
|
-
onChange: field.onChange,
|
|
8753
|
-
disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType,
|
|
8754
|
-
error: form.formState.errors.amount?.message
|
|
8755
|
-
}
|
|
8756
|
-
)
|
|
8757
|
-
}
|
|
8758
|
-
),
|
|
8759
|
-
/* @__PURE__ */ jsx(
|
|
8760
|
-
FormInput,
|
|
8761
|
-
{
|
|
8762
|
-
name: "description",
|
|
8763
|
-
label: "Description (Optional)",
|
|
8764
|
-
placeholder: "Enter transaction description",
|
|
8765
|
-
disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType
|
|
8766
|
-
}
|
|
8767
|
-
)
|
|
8792
|
+
form.formState.errors.certifyInformation && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive ml-7", children: form.formState.errors.certifyInformation.message })
|
|
8768
8793
|
] })
|
|
8769
8794
|
}
|
|
8770
|
-
),
|
|
8771
|
-
/* @__PURE__ */
|
|
8772
|
-
/* @__PURE__ */ jsx(
|
|
8773
|
-
/* @__PURE__ */ jsx("div", { className: "bg-muted/30 rounded-lg p-4 border border-border/50", children: /* @__PURE__ */ jsx(
|
|
8774
|
-
Controller,
|
|
8775
|
-
{
|
|
8776
|
-
name: "certifyInformation",
|
|
8777
|
-
control: form.control,
|
|
8778
|
-
render: ({ field }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
8779
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
8780
|
-
/* @__PURE__ */ jsx(
|
|
8781
|
-
Checkbox,
|
|
8782
|
-
{
|
|
8783
|
-
id: "certifyInformation",
|
|
8784
|
-
checked: field.value,
|
|
8785
|
-
onCheckedChange: field.onChange
|
|
8786
|
-
}
|
|
8787
|
-
),
|
|
8788
|
-
/* @__PURE__ */ jsx(
|
|
8789
|
-
"label",
|
|
8790
|
-
{
|
|
8791
|
-
htmlFor: "certifyInformation",
|
|
8792
|
-
className: "text-sm font-medium leading-relaxed cursor-pointer select-none",
|
|
8793
|
-
children: "I certify that all information entered is correct and accurate to the best of my knowledge"
|
|
8794
|
-
}
|
|
8795
|
-
)
|
|
8796
|
-
] }),
|
|
8797
|
-
form.formState.errors.certifyInformation && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive ml-7", children: form.formState.errors.certifyInformation.message })
|
|
8798
|
-
] })
|
|
8799
|
-
}
|
|
8800
|
-
) }),
|
|
8801
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-3 justify-end pt-4 border-t border-border", children: [
|
|
8802
|
-
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onCancel, className: "w-32", children: "Cancel" }),
|
|
8803
|
-
/* @__PURE__ */ jsx(
|
|
8804
|
-
Button,
|
|
8805
|
-
{
|
|
8806
|
-
type: "button",
|
|
8807
|
-
onClick: onSubmit,
|
|
8808
|
-
className: "w-48",
|
|
8809
|
-
disabled: !transactionType || !accountNumber || requiresCounterparty && !counterpartyName || isTransfer && !receiverAccountLookedUp || isAdjustment && (!adjustmentDirection || !adjustmentType) || !amount || !form.watch("certifyInformation") || isSubmitting,
|
|
8810
|
-
children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8811
|
-
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
8812
|
-
"Submitting..."
|
|
8813
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8814
|
-
/* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4 mr-2" }),
|
|
8815
|
-
"Submit Transaction"
|
|
8816
|
-
] })
|
|
8817
|
-
}
|
|
8818
|
-
)
|
|
8819
|
-
] })
|
|
8820
|
-
] }) })
|
|
8821
|
-
] }) }),
|
|
8822
|
-
/* @__PURE__ */ jsx(Dialog, { open: confirmationOpen, onOpenChange: () => {
|
|
8823
|
-
}, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md", hideCloseButton: true, children: [
|
|
8824
|
-
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
8825
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
8826
|
-
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" }) }),
|
|
8827
|
-
/* @__PURE__ */ jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Successful" : "Transaction Failed" })
|
|
8828
|
-
] }),
|
|
8829
|
-
/* @__PURE__ */ jsx(DialogDescription, { className: "text-left", children: submissionStatus === "success" ? /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
8830
|
-
/* @__PURE__ */ jsx("p", { className: "text-foreground", children: "Your transaction has been successfully submitted and is being processed." }),
|
|
8831
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-muted/50 rounded-lg p-4 space-y-2", children: [
|
|
8832
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8833
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Transaction ID:" }),
|
|
8834
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono font-medium", children: transactionId })
|
|
8835
|
-
] }),
|
|
8836
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8837
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
|
|
8838
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
|
|
8839
|
-
] }),
|
|
8840
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8841
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Type:" }),
|
|
8842
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: TRANSACTION_TYPES.find((t) => t.value === transactionType)?.label })
|
|
8843
|
-
] }),
|
|
8844
|
-
requiresCounterparty && counterpartyName && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8845
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Counterparty:" }),
|
|
8846
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: counterpartyName })
|
|
8847
|
-
] })
|
|
8848
|
-
] }),
|
|
8849
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
|
|
8850
|
-
/* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5 text-blue-500 mt-0.5 flex-shrink-0" }),
|
|
8851
|
-
/* @__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." })
|
|
8852
|
-
] })
|
|
8853
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
8854
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-lg", children: [
|
|
8855
|
-
/* @__PURE__ */ jsx(XCircle, { className: "h-5 w-5 text-destructive mt-0.5 flex-shrink-0" }),
|
|
8856
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
8857
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-destructive", children: "Error Processing Transaction" }),
|
|
8858
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: errorMessage })
|
|
8859
|
-
] })
|
|
8860
|
-
] }),
|
|
8861
|
-
/* @__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." })
|
|
8862
|
-
] }) })
|
|
8863
|
-
] }),
|
|
8864
|
-
/* @__PURE__ */ jsxs(DialogFooter, { className: "sm:justify-end gap-2", children: [
|
|
8865
|
-
submissionStatus === "error" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "Edit" }),
|
|
8866
|
-
submissionStatus === "success" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onNewTransaction, children: "New Transaction" }),
|
|
8795
|
+
) }),
|
|
8796
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3 justify-end pt-4 border-t border-border", children: [
|
|
8797
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onCancel, className: "w-32", children: "Cancel" }),
|
|
8867
8798
|
/* @__PURE__ */ jsx(
|
|
8868
8799
|
Button,
|
|
8869
8800
|
{
|
|
8870
8801
|
type: "button",
|
|
8871
|
-
onClick:
|
|
8872
|
-
|
|
8873
|
-
|
|
8802
|
+
onClick: onSubmit,
|
|
8803
|
+
className: "w-48",
|
|
8804
|
+
disabled: !transactionType || !accountNumber || requiresCounterparty && !counterpartyName || isTransfer && !receiverAccountLookedUp || isAdjustment && (!adjustmentDirection || !adjustmentType) || !amount || !form.watch("certifyInformation") || isSubmitting,
|
|
8805
|
+
children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8806
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
8807
|
+
"Submitting..."
|
|
8808
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8809
|
+
/* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4 mr-2" }),
|
|
8810
|
+
"Submit Transaction"
|
|
8811
|
+
] })
|
|
8874
8812
|
}
|
|
8875
8813
|
)
|
|
8876
8814
|
] })
|
|
8877
8815
|
] }) })
|
|
8878
|
-
] })
|
|
8816
|
+
] }) }),
|
|
8817
|
+
/* @__PURE__ */ jsx(Dialog, { open: confirmationOpen, onOpenChange: () => {
|
|
8818
|
+
}, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md", hideCloseButton: true, children: [
|
|
8819
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
8820
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
8821
|
+
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" }) }),
|
|
8822
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Successful" : "Transaction Failed" })
|
|
8823
|
+
] }),
|
|
8824
|
+
/* @__PURE__ */ jsx(DialogDescription, { className: "text-left", children: submissionStatus === "success" ? /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
8825
|
+
/* @__PURE__ */ jsx("p", { className: "text-foreground", children: "Your transaction has been successfully submitted and is being processed." }),
|
|
8826
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-muted/50 rounded-lg p-4 space-y-2", children: [
|
|
8827
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8828
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Transaction ID:" }),
|
|
8829
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono font-medium", children: transactionId })
|
|
8830
|
+
] }),
|
|
8831
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8832
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
|
|
8833
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
|
|
8834
|
+
] }),
|
|
8835
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8836
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Type:" }),
|
|
8837
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: TRANSACTION_TYPES.find((t) => t.value === transactionType)?.label })
|
|
8838
|
+
] }),
|
|
8839
|
+
requiresCounterparty && counterpartyName && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8840
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Counterparty:" }),
|
|
8841
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: counterpartyName })
|
|
8842
|
+
] })
|
|
8843
|
+
] }),
|
|
8844
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
|
|
8845
|
+
/* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5 text-blue-500 mt-0.5 flex-shrink-0" }),
|
|
8846
|
+
/* @__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." })
|
|
8847
|
+
] })
|
|
8848
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
8849
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-lg", children: [
|
|
8850
|
+
/* @__PURE__ */ jsx(XCircle, { className: "h-5 w-5 text-destructive mt-0.5 flex-shrink-0" }),
|
|
8851
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
8852
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-destructive", children: "Error Processing Transaction" }),
|
|
8853
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: errorMessage })
|
|
8854
|
+
] })
|
|
8855
|
+
] }),
|
|
8856
|
+
/* @__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." })
|
|
8857
|
+
] }) })
|
|
8858
|
+
] }),
|
|
8859
|
+
/* @__PURE__ */ jsxs(DialogFooter, { className: "sm:justify-end gap-2", children: [
|
|
8860
|
+
submissionStatus === "error" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "Edit" }),
|
|
8861
|
+
submissionStatus === "success" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onNewTransaction, children: "New Transaction" }),
|
|
8862
|
+
/* @__PURE__ */ jsx(
|
|
8863
|
+
Button,
|
|
8864
|
+
{
|
|
8865
|
+
type: "button",
|
|
8866
|
+
onClick: onConfirmationClose,
|
|
8867
|
+
variant: submissionStatus === "success" ? "default" : "outline",
|
|
8868
|
+
children: submissionStatus === "success" ? "View Transaction" : "Close"
|
|
8869
|
+
}
|
|
8870
|
+
)
|
|
8871
|
+
] })
|
|
8872
|
+
] }) })
|
|
8879
8873
|
] });
|
|
8880
8874
|
};
|
|
8881
8875
|
var typeIcons = {
|
|
@@ -14395,11 +14389,29 @@ function NewTransaction() {
|
|
|
14395
14389
|
amount: "",
|
|
14396
14390
|
description: "",
|
|
14397
14391
|
certifyInformation: false,
|
|
14398
|
-
adjustmentDirection: "",
|
|
14392
|
+
adjustmentDirection: "debit",
|
|
14399
14393
|
adjustmentType: "",
|
|
14400
14394
|
receiverAccountNumber: ""
|
|
14401
14395
|
}
|
|
14402
14396
|
});
|
|
14397
|
+
const adjustmentDirection = form.watch("adjustmentDirection");
|
|
14398
|
+
const adjustmentTypeOptions = useMemo(() => {
|
|
14399
|
+
if (adjustmentDirection === "credit") {
|
|
14400
|
+
return [
|
|
14401
|
+
{ value: "interest_credit", label: "Interest Credit" },
|
|
14402
|
+
{ value: "fee_reversal", label: "Fee Reversal" },
|
|
14403
|
+
{ value: "promotional_credit", label: "Promotional Credit" }
|
|
14404
|
+
];
|
|
14405
|
+
}
|
|
14406
|
+
return [
|
|
14407
|
+
{ value: "collection", label: "Collection" },
|
|
14408
|
+
{ value: "transaction_reversal", label: "Transaction Reversal" },
|
|
14409
|
+
{ value: "transaction_adjustment", label: "Transaction Adjustment" }
|
|
14410
|
+
];
|
|
14411
|
+
}, [adjustmentDirection]);
|
|
14412
|
+
useEffect(() => {
|
|
14413
|
+
form.setValue("adjustmentType", "");
|
|
14414
|
+
}, [adjustmentDirection, form]);
|
|
14403
14415
|
const handleAccountLookup = async () => {
|
|
14404
14416
|
const accNum = form.getValues("accountNumber");
|
|
14405
14417
|
if (!accNum) {
|
|
@@ -14604,7 +14616,7 @@ function NewTransaction() {
|
|
|
14604
14616
|
setIsSubmitting(true);
|
|
14605
14617
|
try {
|
|
14606
14618
|
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
14607
|
-
const hasError = Math.random() > 0.
|
|
14619
|
+
const hasError = Math.random() > 0.1;
|
|
14608
14620
|
if (hasError) {
|
|
14609
14621
|
const errorScenarios = [
|
|
14610
14622
|
"Insufficient funds. Current balance: $125,450.00, Required: $" + parseFloat(data.amount).toFixed(2),
|
|
@@ -14710,7 +14722,8 @@ function NewTransaction() {
|
|
|
14710
14722
|
isReceiverAccountLoading,
|
|
14711
14723
|
onReceiverAccountLookup: handleReceiverAccountLookup,
|
|
14712
14724
|
onEditReceiverAccount: handleEditReceiverAccount,
|
|
14713
|
-
isReviewReady
|
|
14725
|
+
isReviewReady,
|
|
14726
|
+
adjustmentTypeOptions
|
|
14714
14727
|
}
|
|
14715
14728
|
);
|
|
14716
14729
|
}
|
|
@@ -16743,6 +16756,6 @@ function ReconExceptions() {
|
|
|
16743
16756
|
] }) });
|
|
16744
16757
|
}
|
|
16745
16758
|
|
|
16746
|
-
export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, ADJUSTMENT_DIRECTION_OPTIONS,
|
|
16759
|
+
export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, ADJUSTMENT_DIRECTION_OPTIONS, AccountCard, AccountDetail_default as AccountDetail, Accounts_default as Accounts, AddressForm, AlertDetail_default as AlertDetail, AlertDetailRouter, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts_default as Alerts, AppSidebar, Badge, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, BusinessDetail_default as BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses_default as Businesses, Button, CIPStatusBadge, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cases_default as Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties_default as Counterparties, CounterpartiesView, CounterpartyBasicInfo, CounterpartyDetail_default as CounterpartyDetail, CounterpartyDetailView, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, CreateBusinessView, Create_default2 as CreateCounterparty, CreateCounterpartyView, Create_default3 as CreateIndividual, CreateVelocityLimit, Dashboard_default as Dashboard, DashboardDemo, DataGrid, DataTable, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail_default as IndividualDetail, Individuals_default as Individuals, InfoField, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NewTransactionView, NotFound_default as NotFound, OFACAlertView, OriginatorCard, OriginatorFI, OriginatorFIAddress, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, ReconExceptions, ReconUpload, ResolveAlertDialog, ResponsiveGrid, ScrollArea, ScrollBar, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stack, Statement, StatementHeader, StatementView, StatusBadge, TRANSACTION_TYPES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail_default as TransactionDetail, TransactionHistory_default as TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, VelocityLimitDetail, VelocityLimits, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, newTransactionSchema, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
|
|
16747
16760
|
//# sourceMappingURL=index.js.map
|
|
16748
16761
|
//# sourceMappingURL=index.js.map
|