braid-ui 1.0.50 → 1.0.52
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 +131 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +131 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1279,7 +1279,7 @@ var DialogOverlay = React15__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
1279
1279
|
}
|
|
1280
1280
|
));
|
|
1281
1281
|
DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
|
|
1282
|
-
var DialogContent = React15__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
1282
|
+
var DialogContent = React15__namespace.forwardRef(({ className, children, hideCloseButton, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
1283
1283
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
1284
1284
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1285
1285
|
DialogPrimitive__namespace.Content,
|
|
@@ -1292,7 +1292,7 @@ var DialogContent = React15__namespace.forwardRef(({ className, children, ...pro
|
|
|
1292
1292
|
...props,
|
|
1293
1293
|
children: [
|
|
1294
1294
|
children,
|
|
1295
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
1295
|
+
!hideCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
1296
1296
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
|
|
1297
1297
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
1298
1298
|
] })
|
|
@@ -3099,7 +3099,7 @@ function AppSidebar() {
|
|
|
3099
3099
|
] });
|
|
3100
3100
|
}
|
|
3101
3101
|
var MainLayout = ({ children }) => {
|
|
3102
|
-
return /* @__PURE__ */ jsxRuntime.jsx("
|
|
3102
|
+
return /* @__PURE__ */ jsxRuntime.jsx("main", { className: "flex-1 h-full overflow-y-auto", children });
|
|
3103
3103
|
};
|
|
3104
3104
|
var useEditState = ({ initialEditing = false, onToggleEdit, onSave, onCancel }) => {
|
|
3105
3105
|
const [localEditing, setLocalEditing] = React15.useState(initialEditing);
|
|
@@ -8257,7 +8257,7 @@ var StatementView = ({
|
|
|
8257
8257
|
] });
|
|
8258
8258
|
};
|
|
8259
8259
|
var ACHDetailsSection = ({ data }) => {
|
|
8260
|
-
const
|
|
8260
|
+
const formatCurrency3 = (value) => {
|
|
8261
8261
|
return new Intl.NumberFormat("en-US", {
|
|
8262
8262
|
style: "currency",
|
|
8263
8263
|
currency: "USD",
|
|
@@ -8293,7 +8293,7 @@ var ACHDetailsSection = ({ data }) => {
|
|
|
8293
8293
|
layout: "horizontal"
|
|
8294
8294
|
}
|
|
8295
8295
|
),
|
|
8296
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Amount", value:
|
|
8296
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Amount", value: formatCurrency3(data.amount), layout: "horizontal" }),
|
|
8297
8297
|
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "SEC Code", value: data.secCode, layout: "horizontal" }),
|
|
8298
8298
|
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Company Entry Description", value: data.companyEntryDescription, layout: "horizontal" }),
|
|
8299
8299
|
data.companyDiscretionaryData && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Company Discretionary Data", value: data.companyDiscretionaryData, layout: "horizontal" }),
|
|
@@ -8376,6 +8376,37 @@ var WireDetailsSection = ({ data }) => {
|
|
|
8376
8376
|
) })
|
|
8377
8377
|
] });
|
|
8378
8378
|
};
|
|
8379
|
+
var formatCurrency = (value) => {
|
|
8380
|
+
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
8381
|
+
if (isNaN(numValue)) return "";
|
|
8382
|
+
return new Intl.NumberFormat("en-US", {
|
|
8383
|
+
style: "currency",
|
|
8384
|
+
currency: "USD",
|
|
8385
|
+
minimumFractionDigits: 2
|
|
8386
|
+
}).format(numValue);
|
|
8387
|
+
};
|
|
8388
|
+
var CurrencyInput = ({ value, onChange, ...props }) => {
|
|
8389
|
+
const [isFocused, setIsFocused] = React15__namespace.useState(false);
|
|
8390
|
+
const displayValue = value ? isFocused ? value : formatCurrency(value) : "";
|
|
8391
|
+
const handleChange = (e) => {
|
|
8392
|
+
const rawValue = e.target.value.replace(/[^0-9.]/g, "");
|
|
8393
|
+
const parts = rawValue.split(".");
|
|
8394
|
+
const sanitized = parts[0] + (parts.length > 1 ? "." + parts[1]?.slice(0, 2) : "");
|
|
8395
|
+
onChange(sanitized);
|
|
8396
|
+
};
|
|
8397
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8398
|
+
EnhancedInput,
|
|
8399
|
+
{
|
|
8400
|
+
...props,
|
|
8401
|
+
value: displayValue,
|
|
8402
|
+
onChange: handleChange,
|
|
8403
|
+
onFocus: () => setIsFocused(true),
|
|
8404
|
+
onBlur: () => setIsFocused(false),
|
|
8405
|
+
inputMode: "decimal",
|
|
8406
|
+
placeholder: props.placeholder || "$0.00"
|
|
8407
|
+
}
|
|
8408
|
+
);
|
|
8409
|
+
};
|
|
8379
8410
|
var Checkbox = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8380
8411
|
CheckboxPrimitive__namespace.Root,
|
|
8381
8412
|
{
|
|
@@ -8395,6 +8426,15 @@ var Checkbox = React15__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
8395
8426
|
}
|
|
8396
8427
|
));
|
|
8397
8428
|
Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
|
|
8429
|
+
var formatCurrency2 = (value) => {
|
|
8430
|
+
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
8431
|
+
if (isNaN(numValue)) return "-";
|
|
8432
|
+
return new Intl.NumberFormat("en-US", {
|
|
8433
|
+
style: "currency",
|
|
8434
|
+
currency: "USD",
|
|
8435
|
+
minimumFractionDigits: 2
|
|
8436
|
+
}).format(numValue);
|
|
8437
|
+
};
|
|
8398
8438
|
var TRANSACTION_TYPES = [
|
|
8399
8439
|
{ value: "transfer", label: "Transfer", icon: lucideReact.ArrowLeftRight },
|
|
8400
8440
|
{ value: "adjustment", label: "Adjustment", icon: lucideReact.Settings },
|
|
@@ -8434,6 +8474,7 @@ var NewTransactionView = ({
|
|
|
8434
8474
|
onCancel,
|
|
8435
8475
|
onConfirmationClose,
|
|
8436
8476
|
onConfirmationOpenChange,
|
|
8477
|
+
onNewTransaction,
|
|
8437
8478
|
onCounterpartySearchChange,
|
|
8438
8479
|
onCounterpartySelect,
|
|
8439
8480
|
onCounterpartyDropdownClose,
|
|
@@ -8441,7 +8482,8 @@ var NewTransactionView = ({
|
|
|
8441
8482
|
receiverAccountData,
|
|
8442
8483
|
isReceiverAccountLoading,
|
|
8443
8484
|
onReceiverAccountLookup,
|
|
8444
|
-
onEditReceiverAccount
|
|
8485
|
+
onEditReceiverAccount,
|
|
8486
|
+
isReviewReady
|
|
8445
8487
|
}) => {
|
|
8446
8488
|
const transactionType = form.watch("transactionType");
|
|
8447
8489
|
const accountNumber = form.watch("accountNumber");
|
|
@@ -8499,7 +8541,7 @@ var NewTransactionView = ({
|
|
|
8499
8541
|
] : [],
|
|
8500
8542
|
...isTransfer ? [{ label: "Receiver Account", value: receiverAccountNumber || "-" }] : [],
|
|
8501
8543
|
...requiresCounterparty ? [{ label: "Counterparty", value: counterpartyName || "-" }] : [],
|
|
8502
|
-
{ label: "Amount", value: amount ?
|
|
8544
|
+
{ label: "Amount", value: amount ? formatCurrency2(amount) : "-" },
|
|
8503
8545
|
{ label: "Description", value: form.watch("description") || "N/A" }
|
|
8504
8546
|
];
|
|
8505
8547
|
const reviewData = [
|
|
@@ -8508,7 +8550,8 @@ var NewTransactionView = ({
|
|
|
8508
8550
|
items: reviewItems
|
|
8509
8551
|
}
|
|
8510
8552
|
];
|
|
8511
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
8553
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "container mx-auto p-6 space-y-6 max-w-4xl", children: [
|
|
8554
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "New Transaction" }) }),
|
|
8512
8555
|
/* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => e.preventDefault(), children: [
|
|
8513
8556
|
!accountLookedUp ? /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Account Lookup", variant: "default", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 items-start w-full", children: [
|
|
8514
8557
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8728,13 +8771,20 @@ var NewTransactionView = ({
|
|
|
8728
8771
|
)
|
|
8729
8772
|
] }),
|
|
8730
8773
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8731
|
-
|
|
8774
|
+
reactHookForm.Controller,
|
|
8732
8775
|
{
|
|
8733
8776
|
name: "amount",
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8777
|
+
control: form.control,
|
|
8778
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8779
|
+
CurrencyInput,
|
|
8780
|
+
{
|
|
8781
|
+
label: "Amount",
|
|
8782
|
+
value: field.value,
|
|
8783
|
+
onChange: field.onChange,
|
|
8784
|
+
disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType,
|
|
8785
|
+
error: form.formState.errors.amount?.message
|
|
8786
|
+
}
|
|
8787
|
+
)
|
|
8738
8788
|
}
|
|
8739
8789
|
),
|
|
8740
8790
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8749,7 +8799,7 @@ var NewTransactionView = ({
|
|
|
8749
8799
|
] })
|
|
8750
8800
|
}
|
|
8751
8801
|
),
|
|
8752
|
-
/* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Review & Submit", variant: "default", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
8802
|
+
/* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Review & Submit", variant: "default", className: cn(!isReviewReady && "opacity-50 pointer-events-none"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
8753
8803
|
/* @__PURE__ */ jsxRuntime.jsx(DataGrid, { data: reviewData, columns: 2 }),
|
|
8754
8804
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted/30 rounded-lg p-4 border border-border/50", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8755
8805
|
reactHookForm.Controller,
|
|
@@ -8800,7 +8850,8 @@ var NewTransactionView = ({
|
|
|
8800
8850
|
] })
|
|
8801
8851
|
] }) })
|
|
8802
8852
|
] }) }),
|
|
8803
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: confirmationOpen, onOpenChange:
|
|
8853
|
+
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: confirmationOpen, onOpenChange: () => {
|
|
8854
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-md", hideCloseButton: true, children: [
|
|
8804
8855
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
8805
8856
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
8806
8857
|
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" }) }),
|
|
@@ -8815,10 +8866,7 @@ var NewTransactionView = ({
|
|
|
8815
8866
|
] }),
|
|
8816
8867
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8817
8868
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
|
|
8818
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8819
|
-
"$",
|
|
8820
|
-
amount
|
|
8821
|
-
] })
|
|
8869
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
|
|
8822
8870
|
] }),
|
|
8823
8871
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8824
8872
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Type:" }),
|
|
@@ -8845,19 +8893,20 @@ var NewTransactionView = ({
|
|
|
8845
8893
|
] }) })
|
|
8846
8894
|
] }),
|
|
8847
8895
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { className: "sm:justify-end gap-2", children: [
|
|
8848
|
-
submissionStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "
|
|
8896
|
+
submissionStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "Edit" }),
|
|
8897
|
+
submissionStatus === "success" && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: onNewTransaction, children: "New Transaction" }),
|
|
8849
8898
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8850
8899
|
Button,
|
|
8851
8900
|
{
|
|
8852
8901
|
type: "button",
|
|
8853
8902
|
onClick: onConfirmationClose,
|
|
8854
8903
|
variant: submissionStatus === "success" ? "default" : "outline",
|
|
8855
|
-
children: submissionStatus === "success" ? "View
|
|
8904
|
+
children: submissionStatus === "success" ? "View Transaction" : "Close"
|
|
8856
8905
|
}
|
|
8857
8906
|
)
|
|
8858
8907
|
] })
|
|
8859
8908
|
] }) })
|
|
8860
|
-
] })
|
|
8909
|
+
] });
|
|
8861
8910
|
};
|
|
8862
8911
|
var typeIcons = {
|
|
8863
8912
|
checking: lucideReact.CreditCard,
|
|
@@ -13946,7 +13995,7 @@ var TransactionHistory = () => {
|
|
|
13946
13995
|
setRowsPerPage(value);
|
|
13947
13996
|
setCurrentPage(1);
|
|
13948
13997
|
};
|
|
13949
|
-
const
|
|
13998
|
+
const formatCurrency3 = (value) => {
|
|
13950
13999
|
const formatted = new Intl.NumberFormat("en-US", {
|
|
13951
14000
|
style: "currency",
|
|
13952
14001
|
currency: "USD",
|
|
@@ -14123,23 +14172,19 @@ var TransactionHistory = () => {
|
|
|
14123
14172
|
),
|
|
14124
14173
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
14125
14174
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14126
|
-
|
|
14175
|
+
CurrencyInput,
|
|
14127
14176
|
{
|
|
14128
14177
|
label: "Min Amount",
|
|
14129
|
-
type: "number",
|
|
14130
14178
|
value: filters.minAmount,
|
|
14131
|
-
onChange: (
|
|
14132
|
-
placeholder: "0.00"
|
|
14179
|
+
onChange: (value) => handleFilterChange("minAmount", value)
|
|
14133
14180
|
}
|
|
14134
14181
|
),
|
|
14135
14182
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14136
|
-
|
|
14183
|
+
CurrencyInput,
|
|
14137
14184
|
{
|
|
14138
14185
|
label: "Max Amount",
|
|
14139
|
-
type: "number",
|
|
14140
14186
|
value: filters.maxAmount,
|
|
14141
|
-
onChange: (
|
|
14142
|
-
placeholder: "0.00"
|
|
14187
|
+
onChange: (value) => handleFilterChange("maxAmount", value)
|
|
14143
14188
|
}
|
|
14144
14189
|
)
|
|
14145
14190
|
] }),
|
|
@@ -14239,7 +14284,7 @@ var TransactionHistory = () => {
|
|
|
14239
14284
|
children: [
|
|
14240
14285
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs", children: transaction.created }),
|
|
14241
14286
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs", children: transaction.accountNumber }),
|
|
14242
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs text-right", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: transaction.amount < 0 ? "text-destructive" : "", children:
|
|
14287
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs text-right", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: transaction.amount < 0 ? "text-destructive" : "", children: formatCurrency3(transaction.amount) }) }),
|
|
14243
14288
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "link", className: "h-auto p-0 font-normal text-xs", children: transaction.customer }) }),
|
|
14244
14289
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "link", className: "h-auto p-0 font-normal text-xs", children: transaction.counterparty }) }),
|
|
14245
14290
|
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs truncate", children: transaction.description }),
|
|
@@ -14609,15 +14654,57 @@ function NewTransaction() {
|
|
|
14609
14654
|
setIsSubmitting(false);
|
|
14610
14655
|
}
|
|
14611
14656
|
};
|
|
14657
|
+
const resetForm = () => {
|
|
14658
|
+
form.reset({
|
|
14659
|
+
transactionType: "",
|
|
14660
|
+
accountNumber: "",
|
|
14661
|
+
counterpartyName: "",
|
|
14662
|
+
amount: "",
|
|
14663
|
+
description: "",
|
|
14664
|
+
certifyInformation: false,
|
|
14665
|
+
adjustmentDirection: "",
|
|
14666
|
+
adjustmentType: "",
|
|
14667
|
+
receiverAccountNumber: ""
|
|
14668
|
+
});
|
|
14669
|
+
setAccountLookedUp(false);
|
|
14670
|
+
setAccountData(null);
|
|
14671
|
+
setCounterpartyLookedUp(false);
|
|
14672
|
+
setCounterpartyData(null);
|
|
14673
|
+
setCounterpartySearchResults([]);
|
|
14674
|
+
setShowCounterpartyDropdown(false);
|
|
14675
|
+
setReceiverAccountLookedUp(false);
|
|
14676
|
+
setReceiverAccountData(null);
|
|
14677
|
+
setSubmissionStatus(null);
|
|
14678
|
+
setErrorMessage("");
|
|
14679
|
+
setTransactionId("");
|
|
14680
|
+
};
|
|
14612
14681
|
const handleConfirmationClose = () => {
|
|
14613
14682
|
setConfirmationOpen(false);
|
|
14614
14683
|
if (submissionStatus === "success") {
|
|
14615
|
-
navigate(
|
|
14684
|
+
navigate(`/transactions/${transactionId}`);
|
|
14616
14685
|
}
|
|
14617
14686
|
};
|
|
14687
|
+
const handleNewTransaction = () => {
|
|
14688
|
+
setConfirmationOpen(false);
|
|
14689
|
+
resetForm();
|
|
14690
|
+
};
|
|
14618
14691
|
const handleCancel = () => {
|
|
14619
14692
|
navigate("/dashboard");
|
|
14620
14693
|
};
|
|
14694
|
+
const isReviewReady = React15.useMemo(() => {
|
|
14695
|
+
const data = form.watch();
|
|
14696
|
+
const requiresCounterparty = ["ach", "wire"].includes(data.transactionType);
|
|
14697
|
+
if (!data.transactionType || !data.accountNumber || !data.amount) return false;
|
|
14698
|
+
if (requiresCounterparty && (!data.counterpartyName || !counterpartyLookedUp)) return false;
|
|
14699
|
+
if (!accountLookedUp) return false;
|
|
14700
|
+
if (data.transactionType === "adjustment") {
|
|
14701
|
+
if (!data.adjustmentDirection || !data.adjustmentType) return false;
|
|
14702
|
+
}
|
|
14703
|
+
if (data.transactionType === "transfer") {
|
|
14704
|
+
if (!data.receiverAccountNumber || !receiverAccountLookedUp) return false;
|
|
14705
|
+
}
|
|
14706
|
+
return true;
|
|
14707
|
+
}, [form.watch(), accountLookedUp, counterpartyLookedUp, receiverAccountLookedUp]);
|
|
14621
14708
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14622
14709
|
NewTransactionView,
|
|
14623
14710
|
{
|
|
@@ -14647,11 +14734,13 @@ function NewTransaction() {
|
|
|
14647
14734
|
onCancel: handleCancel,
|
|
14648
14735
|
onConfirmationClose: handleConfirmationClose,
|
|
14649
14736
|
onConfirmationOpenChange: setConfirmationOpen,
|
|
14737
|
+
onNewTransaction: handleNewTransaction,
|
|
14650
14738
|
receiverAccountLookedUp,
|
|
14651
14739
|
receiverAccountData,
|
|
14652
14740
|
isReceiverAccountLoading,
|
|
14653
14741
|
onReceiverAccountLookup: handleReceiverAccountLookup,
|
|
14654
|
-
onEditReceiverAccount: handleEditReceiverAccount
|
|
14742
|
+
onEditReceiverAccount: handleEditReceiverAccount,
|
|
14743
|
+
isReviewReady
|
|
14655
14744
|
}
|
|
14656
14745
|
);
|
|
14657
14746
|
}
|
|
@@ -14702,7 +14791,7 @@ var TransactionDetail = () => {
|
|
|
14702
14791
|
return "outline";
|
|
14703
14792
|
}
|
|
14704
14793
|
};
|
|
14705
|
-
const
|
|
14794
|
+
const formatCurrency3 = (value) => {
|
|
14706
14795
|
return new Intl.NumberFormat("en-US", {
|
|
14707
14796
|
style: "currency",
|
|
14708
14797
|
currency: "USD",
|
|
@@ -14718,7 +14807,7 @@ var TransactionDetail = () => {
|
|
|
14718
14807
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
14719
14808
|
"font-semibold",
|
|
14720
14809
|
transaction.amount < 0 ? "text-destructive" : "text-success"
|
|
14721
|
-
), children:
|
|
14810
|
+
), children: formatCurrency3(transaction.amount) }),
|
|
14722
14811
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14723
14812
|
TransactionTypeBadge,
|
|
14724
14813
|
{
|
|
@@ -15340,11 +15429,11 @@ function CreateVelocityLimit() {
|
|
|
15340
15429
|
case "round_number":
|
|
15341
15430
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
15342
15431
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15343
|
-
|
|
15432
|
+
CurrencyInput,
|
|
15344
15433
|
{
|
|
15345
15434
|
label: "Amount Threshold",
|
|
15346
|
-
|
|
15347
|
-
onChange: (
|
|
15435
|
+
value: formData.amountThreshold || "",
|
|
15436
|
+
onChange: (value) => handleFieldChange("amountThreshold", value)
|
|
15348
15437
|
}
|
|
15349
15438
|
),
|
|
15350
15439
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15457,11 +15546,11 @@ function CreateVelocityLimit() {
|
|
|
15457
15546
|
}
|
|
15458
15547
|
),
|
|
15459
15548
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15460
|
-
|
|
15549
|
+
CurrencyInput,
|
|
15461
15550
|
{
|
|
15462
15551
|
label: "Max Transaction Amount",
|
|
15463
|
-
|
|
15464
|
-
onChange: (
|
|
15552
|
+
value: formData.maxAmount || "",
|
|
15553
|
+
onChange: (value) => handleFieldChange("maxAmount", value)
|
|
15465
15554
|
}
|
|
15466
15555
|
),
|
|
15467
15556
|
formData.aggregationLevel !== "transaction" && /* @__PURE__ */ jsxRuntime.jsx(
|