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.d.cts
CHANGED
|
@@ -1013,7 +1013,7 @@ interface NewTransactionFormValues {
|
|
|
1013
1013
|
declare const TRANSACTION_TYPES: {
|
|
1014
1014
|
value: string;
|
|
1015
1015
|
label: string;
|
|
1016
|
-
icon:
|
|
1016
|
+
icon: React__default.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
|
|
1017
1017
|
}[];
|
|
1018
1018
|
declare const ADJUSTMENT_DIRECTION_OPTIONS: {
|
|
1019
1019
|
value: string;
|
|
@@ -1047,6 +1047,7 @@ interface NewTransactionViewProps {
|
|
|
1047
1047
|
onCancel: () => void;
|
|
1048
1048
|
onConfirmationClose: () => void;
|
|
1049
1049
|
onConfirmationOpenChange: (open: boolean) => void;
|
|
1050
|
+
onNewTransaction: () => void;
|
|
1050
1051
|
onCounterpartySearchChange: (value: string) => void;
|
|
1051
1052
|
onCounterpartySelect: (result: CounterpartySearchResult) => void;
|
|
1052
1053
|
onCounterpartyDropdownClose: () => void;
|
|
@@ -1055,8 +1056,9 @@ interface NewTransactionViewProps {
|
|
|
1055
1056
|
isReceiverAccountLoading: boolean;
|
|
1056
1057
|
onReceiverAccountLookup: () => void;
|
|
1057
1058
|
onEditReceiverAccount: () => void;
|
|
1059
|
+
isReviewReady: boolean;
|
|
1058
1060
|
}
|
|
1059
|
-
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, onCounterpartySearchChange, onCounterpartySelect, onCounterpartyDropdownClose, receiverAccountLookedUp, receiverAccountData, isReceiverAccountLoading, onReceiverAccountLookup, onEditReceiverAccount, }: NewTransactionViewProps) => react_jsx_runtime.JSX.Element;
|
|
1061
|
+
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, receiverAccountLookedUp, receiverAccountData, isReceiverAccountLoading, onReceiverAccountLookup, onEditReceiverAccount, isReviewReady, }: NewTransactionViewProps) => react_jsx_runtime.JSX.Element;
|
|
1060
1062
|
|
|
1061
1063
|
interface AccountCardProps {
|
|
1062
1064
|
account: {
|
|
@@ -1235,7 +1237,10 @@ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.D
|
|
|
1235
1237
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
1236
1238
|
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1237
1239
|
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1238
|
-
|
|
1240
|
+
interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
1241
|
+
hideCloseButton?: boolean;
|
|
1242
|
+
}
|
|
1243
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1239
1244
|
declare const DialogHeader: {
|
|
1240
1245
|
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1241
1246
|
displayName: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1013,7 +1013,7 @@ interface NewTransactionFormValues {
|
|
|
1013
1013
|
declare const TRANSACTION_TYPES: {
|
|
1014
1014
|
value: string;
|
|
1015
1015
|
label: string;
|
|
1016
|
-
icon:
|
|
1016
|
+
icon: React__default.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React__default.RefAttributes<SVGSVGElement>>;
|
|
1017
1017
|
}[];
|
|
1018
1018
|
declare const ADJUSTMENT_DIRECTION_OPTIONS: {
|
|
1019
1019
|
value: string;
|
|
@@ -1047,6 +1047,7 @@ interface NewTransactionViewProps {
|
|
|
1047
1047
|
onCancel: () => void;
|
|
1048
1048
|
onConfirmationClose: () => void;
|
|
1049
1049
|
onConfirmationOpenChange: (open: boolean) => void;
|
|
1050
|
+
onNewTransaction: () => void;
|
|
1050
1051
|
onCounterpartySearchChange: (value: string) => void;
|
|
1051
1052
|
onCounterpartySelect: (result: CounterpartySearchResult) => void;
|
|
1052
1053
|
onCounterpartyDropdownClose: () => void;
|
|
@@ -1055,8 +1056,9 @@ interface NewTransactionViewProps {
|
|
|
1055
1056
|
isReceiverAccountLoading: boolean;
|
|
1056
1057
|
onReceiverAccountLookup: () => void;
|
|
1057
1058
|
onEditReceiverAccount: () => void;
|
|
1059
|
+
isReviewReady: boolean;
|
|
1058
1060
|
}
|
|
1059
|
-
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, onCounterpartySearchChange, onCounterpartySelect, onCounterpartyDropdownClose, receiverAccountLookedUp, receiverAccountData, isReceiverAccountLoading, onReceiverAccountLookup, onEditReceiverAccount, }: NewTransactionViewProps) => react_jsx_runtime.JSX.Element;
|
|
1061
|
+
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, receiverAccountLookedUp, receiverAccountData, isReceiverAccountLoading, onReceiverAccountLookup, onEditReceiverAccount, isReviewReady, }: NewTransactionViewProps) => react_jsx_runtime.JSX.Element;
|
|
1060
1062
|
|
|
1061
1063
|
interface AccountCardProps {
|
|
1062
1064
|
account: {
|
|
@@ -1235,7 +1237,10 @@ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.D
|
|
|
1235
1237
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
1236
1238
|
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1237
1239
|
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1238
|
-
|
|
1240
|
+
interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
1241
|
+
hideCloseButton?: boolean;
|
|
1242
|
+
}
|
|
1243
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1239
1244
|
declare const DialogHeader: {
|
|
1240
1245
|
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1241
1246
|
displayName: string;
|
package/dist/index.js
CHANGED
|
@@ -1247,7 +1247,7 @@ var DialogOverlay = React15.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1247
1247
|
}
|
|
1248
1248
|
));
|
|
1249
1249
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1250
|
-
var DialogContent = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
1250
|
+
var DialogContent = React15.forwardRef(({ className, children, hideCloseButton, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
1251
1251
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
1252
1252
|
/* @__PURE__ */ jsxs(
|
|
1253
1253
|
DialogPrimitive.Content,
|
|
@@ -1260,7 +1260,7 @@ var DialogContent = React15.forwardRef(({ className, children, ...props }, ref)
|
|
|
1260
1260
|
...props,
|
|
1261
1261
|
children: [
|
|
1262
1262
|
children,
|
|
1263
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.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: [
|
|
1263
|
+
!hideCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.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: [
|
|
1264
1264
|
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
1265
1265
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1266
1266
|
] })
|
|
@@ -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);
|
|
@@ -8225,7 +8225,7 @@ var StatementView = ({
|
|
|
8225
8225
|
] });
|
|
8226
8226
|
};
|
|
8227
8227
|
var ACHDetailsSection = ({ data }) => {
|
|
8228
|
-
const
|
|
8228
|
+
const formatCurrency3 = (value) => {
|
|
8229
8229
|
return new Intl.NumberFormat("en-US", {
|
|
8230
8230
|
style: "currency",
|
|
8231
8231
|
currency: "USD",
|
|
@@ -8261,7 +8261,7 @@ var ACHDetailsSection = ({ data }) => {
|
|
|
8261
8261
|
layout: "horizontal"
|
|
8262
8262
|
}
|
|
8263
8263
|
),
|
|
8264
|
-
/* @__PURE__ */ jsx(InfoField, { label: "Amount", value:
|
|
8264
|
+
/* @__PURE__ */ jsx(InfoField, { label: "Amount", value: formatCurrency3(data.amount), layout: "horizontal" }),
|
|
8265
8265
|
/* @__PURE__ */ jsx(InfoField, { label: "SEC Code", value: data.secCode, layout: "horizontal" }),
|
|
8266
8266
|
/* @__PURE__ */ jsx(InfoField, { label: "Company Entry Description", value: data.companyEntryDescription, layout: "horizontal" }),
|
|
8267
8267
|
data.companyDiscretionaryData && /* @__PURE__ */ jsx(InfoField, { label: "Company Discretionary Data", value: data.companyDiscretionaryData, layout: "horizontal" }),
|
|
@@ -8344,6 +8344,37 @@ var WireDetailsSection = ({ data }) => {
|
|
|
8344
8344
|
) })
|
|
8345
8345
|
] });
|
|
8346
8346
|
};
|
|
8347
|
+
var formatCurrency = (value) => {
|
|
8348
|
+
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
8349
|
+
if (isNaN(numValue)) return "";
|
|
8350
|
+
return new Intl.NumberFormat("en-US", {
|
|
8351
|
+
style: "currency",
|
|
8352
|
+
currency: "USD",
|
|
8353
|
+
minimumFractionDigits: 2
|
|
8354
|
+
}).format(numValue);
|
|
8355
|
+
};
|
|
8356
|
+
var CurrencyInput = ({ value, onChange, ...props }) => {
|
|
8357
|
+
const [isFocused, setIsFocused] = React15.useState(false);
|
|
8358
|
+
const displayValue = value ? isFocused ? value : formatCurrency(value) : "";
|
|
8359
|
+
const handleChange = (e) => {
|
|
8360
|
+
const rawValue = e.target.value.replace(/[^0-9.]/g, "");
|
|
8361
|
+
const parts = rawValue.split(".");
|
|
8362
|
+
const sanitized = parts[0] + (parts.length > 1 ? "." + parts[1]?.slice(0, 2) : "");
|
|
8363
|
+
onChange(sanitized);
|
|
8364
|
+
};
|
|
8365
|
+
return /* @__PURE__ */ jsx(
|
|
8366
|
+
EnhancedInput,
|
|
8367
|
+
{
|
|
8368
|
+
...props,
|
|
8369
|
+
value: displayValue,
|
|
8370
|
+
onChange: handleChange,
|
|
8371
|
+
onFocus: () => setIsFocused(true),
|
|
8372
|
+
onBlur: () => setIsFocused(false),
|
|
8373
|
+
inputMode: "decimal",
|
|
8374
|
+
placeholder: props.placeholder || "$0.00"
|
|
8375
|
+
}
|
|
8376
|
+
);
|
|
8377
|
+
};
|
|
8347
8378
|
var Checkbox = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8348
8379
|
CheckboxPrimitive.Root,
|
|
8349
8380
|
{
|
|
@@ -8363,6 +8394,15 @@ var Checkbox = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
8363
8394
|
}
|
|
8364
8395
|
));
|
|
8365
8396
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
8397
|
+
var formatCurrency2 = (value) => {
|
|
8398
|
+
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
8399
|
+
if (isNaN(numValue)) return "-";
|
|
8400
|
+
return new Intl.NumberFormat("en-US", {
|
|
8401
|
+
style: "currency",
|
|
8402
|
+
currency: "USD",
|
|
8403
|
+
minimumFractionDigits: 2
|
|
8404
|
+
}).format(numValue);
|
|
8405
|
+
};
|
|
8366
8406
|
var TRANSACTION_TYPES = [
|
|
8367
8407
|
{ value: "transfer", label: "Transfer", icon: ArrowLeftRight },
|
|
8368
8408
|
{ value: "adjustment", label: "Adjustment", icon: Settings },
|
|
@@ -8402,6 +8442,7 @@ var NewTransactionView = ({
|
|
|
8402
8442
|
onCancel,
|
|
8403
8443
|
onConfirmationClose,
|
|
8404
8444
|
onConfirmationOpenChange,
|
|
8445
|
+
onNewTransaction,
|
|
8405
8446
|
onCounterpartySearchChange,
|
|
8406
8447
|
onCounterpartySelect,
|
|
8407
8448
|
onCounterpartyDropdownClose,
|
|
@@ -8409,7 +8450,8 @@ var NewTransactionView = ({
|
|
|
8409
8450
|
receiverAccountData,
|
|
8410
8451
|
isReceiverAccountLoading,
|
|
8411
8452
|
onReceiverAccountLookup,
|
|
8412
|
-
onEditReceiverAccount
|
|
8453
|
+
onEditReceiverAccount,
|
|
8454
|
+
isReviewReady
|
|
8413
8455
|
}) => {
|
|
8414
8456
|
const transactionType = form.watch("transactionType");
|
|
8415
8457
|
const accountNumber = form.watch("accountNumber");
|
|
@@ -8467,7 +8509,7 @@ var NewTransactionView = ({
|
|
|
8467
8509
|
] : [],
|
|
8468
8510
|
...isTransfer ? [{ label: "Receiver Account", value: receiverAccountNumber || "-" }] : [],
|
|
8469
8511
|
...requiresCounterparty ? [{ label: "Counterparty", value: counterpartyName || "-" }] : [],
|
|
8470
|
-
{ label: "Amount", value: amount ?
|
|
8512
|
+
{ label: "Amount", value: amount ? formatCurrency2(amount) : "-" },
|
|
8471
8513
|
{ label: "Description", value: form.watch("description") || "N/A" }
|
|
8472
8514
|
];
|
|
8473
8515
|
const reviewData = [
|
|
@@ -8476,7 +8518,8 @@ var NewTransactionView = ({
|
|
|
8476
8518
|
items: reviewItems
|
|
8477
8519
|
}
|
|
8478
8520
|
];
|
|
8479
|
-
return /* @__PURE__ */
|
|
8521
|
+
return /* @__PURE__ */ jsxs("div", { className: "container mx-auto p-6 space-y-6 max-w-4xl", children: [
|
|
8522
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "New Transaction" }) }),
|
|
8480
8523
|
/* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("form", { onSubmit: (e) => e.preventDefault(), children: [
|
|
8481
8524
|
!accountLookedUp ? /* @__PURE__ */ jsx(FormCard, { title: "Account Lookup", variant: "default", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3 items-start w-full", children: [
|
|
8482
8525
|
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
@@ -8696,13 +8739,20 @@ var NewTransactionView = ({
|
|
|
8696
8739
|
)
|
|
8697
8740
|
] }),
|
|
8698
8741
|
/* @__PURE__ */ jsx(
|
|
8699
|
-
|
|
8742
|
+
Controller,
|
|
8700
8743
|
{
|
|
8701
8744
|
name: "amount",
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8745
|
+
control: form.control,
|
|
8746
|
+
render: ({ field }) => /* @__PURE__ */ jsx(
|
|
8747
|
+
CurrencyInput,
|
|
8748
|
+
{
|
|
8749
|
+
label: "Amount",
|
|
8750
|
+
value: field.value,
|
|
8751
|
+
onChange: field.onChange,
|
|
8752
|
+
disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType,
|
|
8753
|
+
error: form.formState.errors.amount?.message
|
|
8754
|
+
}
|
|
8755
|
+
)
|
|
8706
8756
|
}
|
|
8707
8757
|
),
|
|
8708
8758
|
/* @__PURE__ */ jsx(
|
|
@@ -8717,7 +8767,7 @@ var NewTransactionView = ({
|
|
|
8717
8767
|
] })
|
|
8718
8768
|
}
|
|
8719
8769
|
),
|
|
8720
|
-
/* @__PURE__ */ jsx(FormCard, { title: "Review & Submit", variant: "default", children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
8770
|
+
/* @__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: [
|
|
8721
8771
|
/* @__PURE__ */ jsx(DataGrid, { data: reviewData, columns: 2 }),
|
|
8722
8772
|
/* @__PURE__ */ jsx("div", { className: "bg-muted/30 rounded-lg p-4 border border-border/50", children: /* @__PURE__ */ jsx(
|
|
8723
8773
|
Controller,
|
|
@@ -8768,7 +8818,8 @@ var NewTransactionView = ({
|
|
|
8768
8818
|
] })
|
|
8769
8819
|
] }) })
|
|
8770
8820
|
] }) }),
|
|
8771
|
-
/* @__PURE__ */ jsx(Dialog, { open: confirmationOpen, onOpenChange:
|
|
8821
|
+
/* @__PURE__ */ jsx(Dialog, { open: confirmationOpen, onOpenChange: () => {
|
|
8822
|
+
}, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md", hideCloseButton: true, children: [
|
|
8772
8823
|
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
8773
8824
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
8774
8825
|
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" }) }),
|
|
@@ -8783,10 +8834,7 @@ var NewTransactionView = ({
|
|
|
8783
8834
|
] }),
|
|
8784
8835
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8785
8836
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
|
|
8786
|
-
/* @__PURE__ */
|
|
8787
|
-
"$",
|
|
8788
|
-
amount
|
|
8789
|
-
] })
|
|
8837
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
|
|
8790
8838
|
] }),
|
|
8791
8839
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
8792
8840
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Type:" }),
|
|
@@ -8813,19 +8861,20 @@ var NewTransactionView = ({
|
|
|
8813
8861
|
] }) })
|
|
8814
8862
|
] }),
|
|
8815
8863
|
/* @__PURE__ */ jsxs(DialogFooter, { className: "sm:justify-end gap-2", children: [
|
|
8816
|
-
submissionStatus === "error" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "
|
|
8864
|
+
submissionStatus === "error" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "Edit" }),
|
|
8865
|
+
submissionStatus === "success" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onNewTransaction, children: "New Transaction" }),
|
|
8817
8866
|
/* @__PURE__ */ jsx(
|
|
8818
8867
|
Button,
|
|
8819
8868
|
{
|
|
8820
8869
|
type: "button",
|
|
8821
8870
|
onClick: onConfirmationClose,
|
|
8822
8871
|
variant: submissionStatus === "success" ? "default" : "outline",
|
|
8823
|
-
children: submissionStatus === "success" ? "View
|
|
8872
|
+
children: submissionStatus === "success" ? "View Transaction" : "Close"
|
|
8824
8873
|
}
|
|
8825
8874
|
)
|
|
8826
8875
|
] })
|
|
8827
8876
|
] }) })
|
|
8828
|
-
] })
|
|
8877
|
+
] });
|
|
8829
8878
|
};
|
|
8830
8879
|
var typeIcons = {
|
|
8831
8880
|
checking: CreditCard,
|
|
@@ -13914,7 +13963,7 @@ var TransactionHistory = () => {
|
|
|
13914
13963
|
setRowsPerPage(value);
|
|
13915
13964
|
setCurrentPage(1);
|
|
13916
13965
|
};
|
|
13917
|
-
const
|
|
13966
|
+
const formatCurrency3 = (value) => {
|
|
13918
13967
|
const formatted = new Intl.NumberFormat("en-US", {
|
|
13919
13968
|
style: "currency",
|
|
13920
13969
|
currency: "USD",
|
|
@@ -14091,23 +14140,19 @@ var TransactionHistory = () => {
|
|
|
14091
14140
|
),
|
|
14092
14141
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
14093
14142
|
/* @__PURE__ */ jsx(
|
|
14094
|
-
|
|
14143
|
+
CurrencyInput,
|
|
14095
14144
|
{
|
|
14096
14145
|
label: "Min Amount",
|
|
14097
|
-
type: "number",
|
|
14098
14146
|
value: filters.minAmount,
|
|
14099
|
-
onChange: (
|
|
14100
|
-
placeholder: "0.00"
|
|
14147
|
+
onChange: (value) => handleFilterChange("minAmount", value)
|
|
14101
14148
|
}
|
|
14102
14149
|
),
|
|
14103
14150
|
/* @__PURE__ */ jsx(
|
|
14104
|
-
|
|
14151
|
+
CurrencyInput,
|
|
14105
14152
|
{
|
|
14106
14153
|
label: "Max Amount",
|
|
14107
|
-
type: "number",
|
|
14108
14154
|
value: filters.maxAmount,
|
|
14109
|
-
onChange: (
|
|
14110
|
-
placeholder: "0.00"
|
|
14155
|
+
onChange: (value) => handleFilterChange("maxAmount", value)
|
|
14111
14156
|
}
|
|
14112
14157
|
)
|
|
14113
14158
|
] }),
|
|
@@ -14207,7 +14252,7 @@ var TransactionHistory = () => {
|
|
|
14207
14252
|
children: [
|
|
14208
14253
|
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs", children: transaction.created }),
|
|
14209
14254
|
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs", children: transaction.accountNumber }),
|
|
14210
|
-
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs text-right", children: /* @__PURE__ */ jsx("span", { className: transaction.amount < 0 ? "text-destructive" : "", children:
|
|
14255
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs text-right", children: /* @__PURE__ */ jsx("span", { className: transaction.amount < 0 ? "text-destructive" : "", children: formatCurrency3(transaction.amount) }) }),
|
|
14211
14256
|
/* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(Button, { variant: "link", className: "h-auto p-0 font-normal text-xs", children: transaction.customer }) }),
|
|
14212
14257
|
/* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(Button, { variant: "link", className: "h-auto p-0 font-normal text-xs", children: transaction.counterparty }) }),
|
|
14213
14258
|
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs truncate", children: transaction.description }),
|
|
@@ -14577,15 +14622,57 @@ function NewTransaction() {
|
|
|
14577
14622
|
setIsSubmitting(false);
|
|
14578
14623
|
}
|
|
14579
14624
|
};
|
|
14625
|
+
const resetForm = () => {
|
|
14626
|
+
form.reset({
|
|
14627
|
+
transactionType: "",
|
|
14628
|
+
accountNumber: "",
|
|
14629
|
+
counterpartyName: "",
|
|
14630
|
+
amount: "",
|
|
14631
|
+
description: "",
|
|
14632
|
+
certifyInformation: false,
|
|
14633
|
+
adjustmentDirection: "",
|
|
14634
|
+
adjustmentType: "",
|
|
14635
|
+
receiverAccountNumber: ""
|
|
14636
|
+
});
|
|
14637
|
+
setAccountLookedUp(false);
|
|
14638
|
+
setAccountData(null);
|
|
14639
|
+
setCounterpartyLookedUp(false);
|
|
14640
|
+
setCounterpartyData(null);
|
|
14641
|
+
setCounterpartySearchResults([]);
|
|
14642
|
+
setShowCounterpartyDropdown(false);
|
|
14643
|
+
setReceiverAccountLookedUp(false);
|
|
14644
|
+
setReceiverAccountData(null);
|
|
14645
|
+
setSubmissionStatus(null);
|
|
14646
|
+
setErrorMessage("");
|
|
14647
|
+
setTransactionId("");
|
|
14648
|
+
};
|
|
14580
14649
|
const handleConfirmationClose = () => {
|
|
14581
14650
|
setConfirmationOpen(false);
|
|
14582
14651
|
if (submissionStatus === "success") {
|
|
14583
|
-
navigate(
|
|
14652
|
+
navigate(`/transactions/${transactionId}`);
|
|
14584
14653
|
}
|
|
14585
14654
|
};
|
|
14655
|
+
const handleNewTransaction = () => {
|
|
14656
|
+
setConfirmationOpen(false);
|
|
14657
|
+
resetForm();
|
|
14658
|
+
};
|
|
14586
14659
|
const handleCancel = () => {
|
|
14587
14660
|
navigate("/dashboard");
|
|
14588
14661
|
};
|
|
14662
|
+
const isReviewReady = useMemo(() => {
|
|
14663
|
+
const data = form.watch();
|
|
14664
|
+
const requiresCounterparty = ["ach", "wire"].includes(data.transactionType);
|
|
14665
|
+
if (!data.transactionType || !data.accountNumber || !data.amount) return false;
|
|
14666
|
+
if (requiresCounterparty && (!data.counterpartyName || !counterpartyLookedUp)) return false;
|
|
14667
|
+
if (!accountLookedUp) return false;
|
|
14668
|
+
if (data.transactionType === "adjustment") {
|
|
14669
|
+
if (!data.adjustmentDirection || !data.adjustmentType) return false;
|
|
14670
|
+
}
|
|
14671
|
+
if (data.transactionType === "transfer") {
|
|
14672
|
+
if (!data.receiverAccountNumber || !receiverAccountLookedUp) return false;
|
|
14673
|
+
}
|
|
14674
|
+
return true;
|
|
14675
|
+
}, [form.watch(), accountLookedUp, counterpartyLookedUp, receiverAccountLookedUp]);
|
|
14589
14676
|
return /* @__PURE__ */ jsx(
|
|
14590
14677
|
NewTransactionView,
|
|
14591
14678
|
{
|
|
@@ -14615,11 +14702,13 @@ function NewTransaction() {
|
|
|
14615
14702
|
onCancel: handleCancel,
|
|
14616
14703
|
onConfirmationClose: handleConfirmationClose,
|
|
14617
14704
|
onConfirmationOpenChange: setConfirmationOpen,
|
|
14705
|
+
onNewTransaction: handleNewTransaction,
|
|
14618
14706
|
receiverAccountLookedUp,
|
|
14619
14707
|
receiverAccountData,
|
|
14620
14708
|
isReceiverAccountLoading,
|
|
14621
14709
|
onReceiverAccountLookup: handleReceiverAccountLookup,
|
|
14622
|
-
onEditReceiverAccount: handleEditReceiverAccount
|
|
14710
|
+
onEditReceiverAccount: handleEditReceiverAccount,
|
|
14711
|
+
isReviewReady
|
|
14623
14712
|
}
|
|
14624
14713
|
);
|
|
14625
14714
|
}
|
|
@@ -14670,7 +14759,7 @@ var TransactionDetail = () => {
|
|
|
14670
14759
|
return "outline";
|
|
14671
14760
|
}
|
|
14672
14761
|
};
|
|
14673
|
-
const
|
|
14762
|
+
const formatCurrency3 = (value) => {
|
|
14674
14763
|
return new Intl.NumberFormat("en-US", {
|
|
14675
14764
|
style: "currency",
|
|
14676
14765
|
currency: "USD",
|
|
@@ -14686,7 +14775,7 @@ var TransactionDetail = () => {
|
|
|
14686
14775
|
/* @__PURE__ */ jsx("span", { className: cn(
|
|
14687
14776
|
"font-semibold",
|
|
14688
14777
|
transaction.amount < 0 ? "text-destructive" : "text-success"
|
|
14689
|
-
), children:
|
|
14778
|
+
), children: formatCurrency3(transaction.amount) }),
|
|
14690
14779
|
/* @__PURE__ */ jsx(
|
|
14691
14780
|
TransactionTypeBadge,
|
|
14692
14781
|
{
|
|
@@ -15308,11 +15397,11 @@ function CreateVelocityLimit() {
|
|
|
15308
15397
|
case "round_number":
|
|
15309
15398
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
15310
15399
|
/* @__PURE__ */ jsx(
|
|
15311
|
-
|
|
15400
|
+
CurrencyInput,
|
|
15312
15401
|
{
|
|
15313
15402
|
label: "Amount Threshold",
|
|
15314
|
-
|
|
15315
|
-
onChange: (
|
|
15403
|
+
value: formData.amountThreshold || "",
|
|
15404
|
+
onChange: (value) => handleFieldChange("amountThreshold", value)
|
|
15316
15405
|
}
|
|
15317
15406
|
),
|
|
15318
15407
|
/* @__PURE__ */ jsx(
|
|
@@ -15425,11 +15514,11 @@ function CreateVelocityLimit() {
|
|
|
15425
15514
|
}
|
|
15426
15515
|
),
|
|
15427
15516
|
/* @__PURE__ */ jsx(
|
|
15428
|
-
|
|
15517
|
+
CurrencyInput,
|
|
15429
15518
|
{
|
|
15430
15519
|
label: "Max Transaction Amount",
|
|
15431
|
-
|
|
15432
|
-
onChange: (
|
|
15520
|
+
value: formData.maxAmount || "",
|
|
15521
|
+
onChange: (value) => handleFieldChange("maxAmount", value)
|
|
15433
15522
|
}
|
|
15434
15523
|
),
|
|
15435
15524
|
formData.aggregationLevel !== "transaction" && /* @__PURE__ */ jsx(
|