braid-ui 1.0.50 → 1.0.51

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.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("div", { className: "flex min-h-screen w-full", children: /* @__PURE__ */ jsx("main", { className: "flex-1", children }) });
3070
+ return /* @__PURE__ */ jsx("div", { className: "flex h-screen w-full overflow-hidden", children: /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-hidden", 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 formatCurrency = (value) => {
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: formatCurrency(data.amount), layout: "horizontal" }),
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 ? `$${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,356 +8518,365 @@ var NewTransactionView = ({
8476
8518
  items: reviewItems
8477
8519
  }
8478
8520
  ];
8479
- return /* @__PURE__ */ jsx(PageLayout, { title: "New Transaction", children: /* @__PURE__ */ jsxs("div", { className: "max-w-4xl mx-auto space-y-6", children: [
8480
- /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("form", { onSubmit: (e) => e.preventDefault(), children: [
8481
- !accountLookedUp ? /* @__PURE__ */ jsx(FormCard, { title: "Account Lookup", variant: "default", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3 items-start w-full", children: [
8482
- /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
8483
- FormInput,
8521
+ return /* @__PURE__ */ jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [
8522
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "New Transaction" }) }),
8523
+ /* @__PURE__ */ jsxs("div", { className: "max-w-4xl space-y-6", children: [
8524
+ /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("form", { onSubmit: (e) => e.preventDefault(), children: [
8525
+ !accountLookedUp ? /* @__PURE__ */ jsx(FormCard, { title: "Account Lookup", variant: "default", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3 items-start w-full", children: [
8526
+ /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
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,
8484
8550
  {
8485
- name: "accountNumber",
8486
- placeholder: "Enter account number"
8551
+ title: "Account Information",
8552
+ variant: "subtle",
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 })
8487
8561
  }
8488
- ) }),
8562
+ ),
8489
8563
  /* @__PURE__ */ jsx(
8490
- Button,
8564
+ FormCard,
8491
8565
  {
8492
- onClick: onAccountLookup,
8493
- disabled: !accountNumber || isAccountLoading,
8494
- className: "shrink-0 mt-0 w-48",
8495
- children: isAccountLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
8496
- /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8497
- "Looking up..."
8498
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
8499
- /* @__PURE__ */ jsx(Search, { className: "h-4 w-4 mr-2" }),
8500
- "Lookup Account"
8501
- ] })
8502
- }
8503
- )
8504
- ] }) }) : /* @__PURE__ */ jsx(
8505
- FormCard,
8506
- {
8507
- title: "Account Information",
8508
- variant: "subtle",
8509
- headerActions: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
8510
- /* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 text-success" }),
8511
- /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditAccount, children: [
8512
- /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-1" }),
8513
- "Edit"
8514
- ] })
8515
- ] }),
8516
- children: /* @__PURE__ */ jsx(DataGrid, { data: accountDataGrid, columns: 2 })
8517
- }
8518
- ),
8519
- /* @__PURE__ */ jsx(
8520
- FormCard,
8521
- {
8522
- title: "Transaction Type",
8523
- variant: "default",
8524
- className: cn(!accountLookedUp && "opacity-50 pointer-events-none"),
8525
- children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-3 lg:gap-4", children: TRANSACTION_TYPES.map((type) => {
8526
- const Icon2 = type.icon;
8527
- const isSelected = transactionType === type.value;
8528
- return /* @__PURE__ */ jsxs(
8529
- "button",
8530
- {
8531
- type: "button",
8532
- onClick: () => onTransactionTypeChange(type.value),
8533
- disabled: !accountLookedUp,
8534
- className: cn(
8535
- "flex flex-col items-center justify-center p-4 lg:p-3 rounded-lg border-2 transition-all",
8536
- "hover:border-primary/50 hover:shadow-md",
8537
- isSelected ? "border-primary bg-primary/5 shadow-sm" : "border-border bg-card"
8538
- ),
8539
- children: [
8540
- /* @__PURE__ */ jsx(Icon2, { className: cn(
8541
- "h-6 w-6 lg:h-5 lg:w-5 mb-2",
8542
- isSelected ? "text-primary" : "text-muted-foreground"
8543
- ) }),
8544
- /* @__PURE__ */ jsx("span", { className: cn(
8545
- "text-sm font-medium",
8546
- isSelected ? "text-primary" : "text-foreground"
8547
- ), children: type.label })
8548
- ]
8549
- },
8550
- type.value
8551
- );
8552
- }) })
8553
- }
8554
- ),
8555
- requiresCounterparty && (!counterpartyLookedUp ? /* @__PURE__ */ jsxs(
8556
- FormCard,
8557
- {
8558
- title: "Counterparty Search",
8559
- variant: "default",
8560
- className: cn(!transactionType && "opacity-50 pointer-events-none"),
8561
- children: [
8562
- /* @__PURE__ */ jsxs("div", { className: "relative", children: [
8563
- /* @__PURE__ */ jsxs("div", { className: "relative", children: [
8564
- /* @__PURE__ */ jsx(
8565
- "input",
8566
- {
8567
- type: "text",
8568
- placeholder: "Start typing to search counterparties...",
8569
- value: counterpartyName,
8570
- onChange: (e) => onCounterpartySearchChange(e.target.value),
8571
- disabled: !transactionType,
8572
- className: cn(
8573
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
8574
- "ring-offset-background placeholder:text-muted-foreground",
8575
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
8576
- "disabled:cursor-not-allowed disabled:opacity-50",
8577
- isCounterpartySearching && "pr-10"
8578
- )
8579
- }
8580
- ),
8581
- 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" }) })
8582
- ] }),
8583
- 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(
8566
+ title: "Transaction Type",
8567
+ variant: "default",
8568
+ className: cn(!accountLookedUp && "opacity-50 pointer-events-none"),
8569
+ children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-3 lg:gap-4", children: TRANSACTION_TYPES.map((type) => {
8570
+ const Icon2 = type.icon;
8571
+ const isSelected = transactionType === type.value;
8572
+ return /* @__PURE__ */ jsxs(
8584
8573
  "button",
8585
8574
  {
8586
8575
  type: "button",
8587
- onClick: () => onCounterpartySelect(result),
8588
- className: "w-full px-3 py-2 text-left hover:bg-accent transition-colors",
8576
+ onClick: () => onTransactionTypeChange(type.value),
8577
+ disabled: !accountLookedUp,
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
+ ),
8589
8583
  children: [
8590
- /* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children: result.name }),
8591
- /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: result.id })
8584
+ /* @__PURE__ */ jsx(Icon2, { className: cn(
8585
+ "h-6 w-6 lg:h-5 lg:w-5 mb-2",
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 })
8592
8592
  ]
8593
8593
  },
8594
- result.id
8595
- )) }),
8596
- 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: [
8597
- 'No counterparties found matching "',
8598
- counterpartyName,
8599
- '"'
8600
- ] }) })
8594
+ type.value
8595
+ );
8596
+ }) })
8597
+ }
8598
+ ),
8599
+ requiresCounterparty && (!counterpartyLookedUp ? /* @__PURE__ */ jsxs(
8600
+ FormCard,
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
+ ] })
8601
8660
  ] }),
8602
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2", children: "Type at least 2 characters to search" })
8603
- ]
8604
- }
8605
- ) : /* @__PURE__ */ jsx(
8606
- FormCard,
8607
- {
8608
- title: "Counterparty Information",
8609
- variant: "subtle",
8610
- headerActions: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
8611
- /* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 text-success" }),
8612
- /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditCounterparty, children: [
8613
- /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-1" }),
8614
- "Edit"
8615
- ] })
8616
- ] }),
8617
- children: /* @__PURE__ */ jsx(DataGrid, { data: counterpartyDataGrid, columns: 2 })
8618
- }
8619
- )),
8620
- isTransfer && (!receiverAccountLookedUp ? /* @__PURE__ */ jsx(
8621
- FormCard,
8622
- {
8623
- title: "Receiver Account",
8624
- variant: "default",
8625
- className: cn(!transactionType && "opacity-50 pointer-events-none"),
8626
- children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3 items-start w-full", children: [
8627
- /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
8628
- FormInput,
8629
- {
8630
- name: "receiverAccountNumber",
8631
- placeholder: "Enter receiver account number",
8632
- disabled: !transactionType
8633
- }
8634
- ) }),
8635
- /* @__PURE__ */ jsx(
8636
- Button,
8637
- {
8638
- onClick: onReceiverAccountLookup,
8639
- disabled: !receiverAccountNumber || isReceiverAccountLoading,
8640
- className: "shrink-0 mt-0 w-48",
8641
- children: isReceiverAccountLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
8642
- /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8643
- "Looking up..."
8644
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
8645
- /* @__PURE__ */ jsx(Search, { className: "h-4 w-4 mr-2" }),
8646
- "Lookup Receiver"
8647
- ] })
8648
- }
8649
- )
8650
- ] })
8651
- }
8652
- ) : /* @__PURE__ */ jsx(
8653
- FormCard,
8654
- {
8655
- title: "Receiver Account Information",
8656
- variant: "subtle",
8657
- headerActions: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
8658
- /* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 text-success" }),
8659
- /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditReceiverAccount, children: [
8660
- /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4 mr-1" }),
8661
- "Edit"
8662
- ] })
8663
- ] }),
8664
- children: /* @__PURE__ */ jsx(DataGrid, { data: receiverAccountDataGrid, columns: 2 })
8665
- }
8666
- )),
8667
- /* @__PURE__ */ jsx(
8668
- FormCard,
8669
- {
8670
- title: "Transaction Details",
8671
- variant: "default",
8672
- className: cn(
8673
- requiresCounterparty ? !counterpartyLookedUp && "opacity-50 pointer-events-none" : isTransfer ? !receiverAccountLookedUp && "opacity-50 pointer-events-none" : !transactionType && "opacity-50 pointer-events-none"
8674
- ),
8675
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
8676
- isAdjustment && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
8677
- /* @__PURE__ */ jsx(
8678
- FormSelect,
8661
+ children: /* @__PURE__ */ jsx(DataGrid, { data: counterpartyDataGrid, columns: 2 })
8662
+ }
8663
+ )),
8664
+ isTransfer && (!receiverAccountLookedUp ? /* @__PURE__ */ jsx(
8665
+ FormCard,
8666
+ {
8667
+ title: "Receiver Account",
8668
+ variant: "default",
8669
+ className: cn(!transactionType && "opacity-50 pointer-events-none"),
8670
+ children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3 items-start w-full", children: [
8671
+ /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
8672
+ FormInput,
8679
8673
  {
8680
- name: "adjustmentDirection",
8681
- label: "Direction",
8682
- placeholder: "Select direction",
8683
- options: ADJUSTMENT_DIRECTION_OPTIONS,
8674
+ name: "receiverAccountNumber",
8675
+ placeholder: "Enter receiver account number",
8684
8676
  disabled: !transactionType
8685
8677
  }
8686
- ),
8678
+ ) }),
8687
8679
  /* @__PURE__ */ jsx(
8688
- FormSelect,
8680
+ Button,
8689
8681
  {
8690
- name: "adjustmentType",
8691
- label: "Adjustment Type",
8692
- placeholder: "Select type",
8693
- options: ADJUSTMENT_TYPE_OPTIONS,
8694
- disabled: !transactionType
8682
+ onClick: onReceiverAccountLookup,
8683
+ disabled: !receiverAccountNumber || isReceiverAccountLoading,
8684
+ className: "shrink-0 mt-0 w-48",
8685
+ children: isReceiverAccountLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
8686
+ /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8687
+ "Looking up..."
8688
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
8689
+ /* @__PURE__ */ jsx(Search, { className: "h-4 w-4 mr-2" }),
8690
+ "Lookup Receiver"
8691
+ ] })
8695
8692
  }
8696
8693
  )
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
+ ] })
8697
8707
  ] }),
8698
- /* @__PURE__ */ jsx(
8699
- FormInput,
8700
- {
8701
- name: "amount",
8702
- label: "Amount",
8703
- placeholder: "0.00",
8704
- type: "number",
8705
- disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType
8706
- }
8707
- ),
8708
- /* @__PURE__ */ jsx(
8709
- FormInput,
8710
- {
8711
- name: "description",
8712
- label: "Description (Optional)",
8713
- placeholder: "Enter transaction description",
8714
- disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType
8715
- }
8716
- )
8717
- ] })
8718
- }
8719
- ),
8720
- /* @__PURE__ */ jsx(FormCard, { title: "Review & Submit", variant: "default", children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
8721
- /* @__PURE__ */ jsx(DataGrid, { data: reviewData, columns: 2 }),
8722
- /* @__PURE__ */ jsx("div", { className: "bg-muted/30 rounded-lg p-4 border border-border/50", children: /* @__PURE__ */ jsx(
8723
- Controller,
8708
+ children: /* @__PURE__ */ jsx(DataGrid, { data: receiverAccountDataGrid, columns: 2 })
8709
+ }
8710
+ )),
8711
+ /* @__PURE__ */ jsx(
8712
+ FormCard,
8724
8713
  {
8725
- name: "certifyInformation",
8726
- control: form.control,
8727
- render: ({ field }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
8728
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
8714
+ title: "Transaction Details",
8715
+ variant: "default",
8716
+ className: cn(
8717
+ requiresCounterparty ? !counterpartyLookedUp && "opacity-50 pointer-events-none" : isTransfer ? !receiverAccountLookedUp && "opacity-50 pointer-events-none" : !transactionType && "opacity-50 pointer-events-none"
8718
+ ),
8719
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
8720
+ isAdjustment && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
8729
8721
  /* @__PURE__ */ jsx(
8730
- Checkbox,
8722
+ FormSelect,
8731
8723
  {
8732
- id: "certifyInformation",
8733
- checked: field.value,
8734
- onCheckedChange: field.onChange
8724
+ name: "adjustmentDirection",
8725
+ label: "Direction",
8726
+ placeholder: "Select direction",
8727
+ options: ADJUSTMENT_DIRECTION_OPTIONS,
8728
+ disabled: !transactionType
8735
8729
  }
8736
8730
  ),
8737
8731
  /* @__PURE__ */ jsx(
8738
- "label",
8732
+ FormSelect,
8739
8733
  {
8740
- htmlFor: "certifyInformation",
8741
- className: "text-sm font-medium leading-relaxed cursor-pointer select-none",
8742
- children: "I certify that all information entered is correct and accurate to the best of my knowledge"
8734
+ name: "adjustmentType",
8735
+ label: "Adjustment Type",
8736
+ placeholder: "Select type",
8737
+ options: ADJUSTMENT_TYPE_OPTIONS,
8738
+ disabled: !transactionType
8743
8739
  }
8744
8740
  )
8745
8741
  ] }),
8746
- form.formState.errors.certifyInformation && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive ml-7", children: form.formState.errors.certifyInformation.message })
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
+ )
8747
8768
  ] })
8748
8769
  }
8749
- ) }),
8750
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3 justify-end pt-4 border-t border-border", children: [
8751
- /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onCancel, className: "w-32", children: "Cancel" }),
8770
+ ),
8771
+ /* @__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: [
8772
+ /* @__PURE__ */ jsx(DataGrid, { data: reviewData, columns: 2 }),
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" }),
8752
8867
  /* @__PURE__ */ jsx(
8753
8868
  Button,
8754
8869
  {
8755
8870
  type: "button",
8756
- onClick: onSubmit,
8757
- className: "w-48",
8758
- disabled: !transactionType || !accountNumber || requiresCounterparty && !counterpartyName || isTransfer && !receiverAccountLookedUp || isAdjustment && (!adjustmentDirection || !adjustmentType) || !amount || !form.watch("certifyInformation") || isSubmitting,
8759
- children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [
8760
- /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8761
- "Submitting..."
8762
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
8763
- /* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4 mr-2" }),
8764
- "Submit Transaction"
8765
- ] })
8871
+ onClick: onConfirmationClose,
8872
+ variant: submissionStatus === "success" ? "default" : "outline",
8873
+ children: submissionStatus === "success" ? "View Transaction" : "Close"
8766
8874
  }
8767
8875
  )
8768
8876
  ] })
8769
8877
  ] }) })
8770
- ] }) }),
8771
- /* @__PURE__ */ jsx(Dialog, { open: confirmationOpen, onOpenChange: onConfirmationOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md", children: [
8772
- /* @__PURE__ */ jsxs(DialogHeader, { children: [
8773
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
8774
- 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" }) }),
8775
- /* @__PURE__ */ jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Successful" : "Transaction Failed" })
8776
- ] }),
8777
- /* @__PURE__ */ jsx(DialogDescription, { className: "text-left", children: submissionStatus === "success" ? /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
8778
- /* @__PURE__ */ jsx("p", { className: "text-foreground", children: "Your transaction has been successfully submitted and is being processed." }),
8779
- /* @__PURE__ */ jsxs("div", { className: "bg-muted/50 rounded-lg p-4 space-y-2", children: [
8780
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8781
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Transaction ID:" }),
8782
- /* @__PURE__ */ jsx("span", { className: "font-mono font-medium", children: transactionId })
8783
- ] }),
8784
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8785
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
8786
- /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
8787
- "$",
8788
- amount
8789
- ] })
8790
- ] }),
8791
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8792
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Type:" }),
8793
- /* @__PURE__ */ jsx("span", { className: "font-medium", children: TRANSACTION_TYPES.find((t) => t.value === transactionType)?.label })
8794
- ] }),
8795
- requiresCounterparty && counterpartyName && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
8796
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Counterparty:" }),
8797
- /* @__PURE__ */ jsx("span", { className: "font-medium", children: counterpartyName })
8798
- ] })
8799
- ] }),
8800
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
8801
- /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5 text-blue-500 mt-0.5 flex-shrink-0" }),
8802
- /* @__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." })
8803
- ] })
8804
- ] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-4 pt-2", children: [
8805
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-lg", children: [
8806
- /* @__PURE__ */ jsx(XCircle, { className: "h-5 w-5 text-destructive mt-0.5 flex-shrink-0" }),
8807
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
8808
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-destructive", children: "Error Processing Transaction" }),
8809
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: errorMessage })
8810
- ] })
8811
- ] }),
8812
- /* @__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." })
8813
- ] }) })
8814
- ] }),
8815
- /* @__PURE__ */ jsxs(DialogFooter, { className: "sm:justify-end gap-2", children: [
8816
- submissionStatus === "error" && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "Try Again" }),
8817
- /* @__PURE__ */ jsx(
8818
- Button,
8819
- {
8820
- type: "button",
8821
- onClick: onConfirmationClose,
8822
- variant: submissionStatus === "success" ? "default" : "outline",
8823
- children: submissionStatus === "success" ? "View Transactions" : "Close"
8824
- }
8825
- )
8826
- ] })
8827
- ] }) })
8828
- ] }) });
8878
+ ] })
8879
+ ] });
8829
8880
  };
8830
8881
  var typeIcons = {
8831
8882
  checking: CreditCard,
@@ -13914,7 +13965,7 @@ var TransactionHistory = () => {
13914
13965
  setRowsPerPage(value);
13915
13966
  setCurrentPage(1);
13916
13967
  };
13917
- const formatCurrency = (value) => {
13968
+ const formatCurrency3 = (value) => {
13918
13969
  const formatted = new Intl.NumberFormat("en-US", {
13919
13970
  style: "currency",
13920
13971
  currency: "USD",
@@ -14091,23 +14142,19 @@ var TransactionHistory = () => {
14091
14142
  ),
14092
14143
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
14093
14144
  /* @__PURE__ */ jsx(
14094
- EnhancedInput,
14145
+ CurrencyInput,
14095
14146
  {
14096
14147
  label: "Min Amount",
14097
- type: "number",
14098
14148
  value: filters.minAmount,
14099
- onChange: (e) => handleFilterChange("minAmount", e.target.value),
14100
- placeholder: "0.00"
14149
+ onChange: (value) => handleFilterChange("minAmount", value)
14101
14150
  }
14102
14151
  ),
14103
14152
  /* @__PURE__ */ jsx(
14104
- EnhancedInput,
14153
+ CurrencyInput,
14105
14154
  {
14106
14155
  label: "Max Amount",
14107
- type: "number",
14108
14156
  value: filters.maxAmount,
14109
- onChange: (e) => handleFilterChange("maxAmount", e.target.value),
14110
- placeholder: "0.00"
14157
+ onChange: (value) => handleFilterChange("maxAmount", value)
14111
14158
  }
14112
14159
  )
14113
14160
  ] }),
@@ -14207,7 +14254,7 @@ var TransactionHistory = () => {
14207
14254
  children: [
14208
14255
  /* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs", children: transaction.created }),
14209
14256
  /* @__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: formatCurrency(transaction.amount) }) }),
14257
+ /* @__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
14258
  /* @__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
14259
  /* @__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
14260
  /* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-xs truncate", children: transaction.description }),
@@ -14577,15 +14624,57 @@ function NewTransaction() {
14577
14624
  setIsSubmitting(false);
14578
14625
  }
14579
14626
  };
14627
+ const resetForm = () => {
14628
+ form.reset({
14629
+ transactionType: "",
14630
+ accountNumber: "",
14631
+ counterpartyName: "",
14632
+ amount: "",
14633
+ description: "",
14634
+ certifyInformation: false,
14635
+ adjustmentDirection: "",
14636
+ adjustmentType: "",
14637
+ receiverAccountNumber: ""
14638
+ });
14639
+ setAccountLookedUp(false);
14640
+ setAccountData(null);
14641
+ setCounterpartyLookedUp(false);
14642
+ setCounterpartyData(null);
14643
+ setCounterpartySearchResults([]);
14644
+ setShowCounterpartyDropdown(false);
14645
+ setReceiverAccountLookedUp(false);
14646
+ setReceiverAccountData(null);
14647
+ setSubmissionStatus(null);
14648
+ setErrorMessage("");
14649
+ setTransactionId("");
14650
+ };
14580
14651
  const handleConfirmationClose = () => {
14581
14652
  setConfirmationOpen(false);
14582
14653
  if (submissionStatus === "success") {
14583
- navigate("/transactions/history");
14654
+ navigate(`/transactions/${transactionId}`);
14584
14655
  }
14585
14656
  };
14657
+ const handleNewTransaction = () => {
14658
+ setConfirmationOpen(false);
14659
+ resetForm();
14660
+ };
14586
14661
  const handleCancel = () => {
14587
14662
  navigate("/dashboard");
14588
14663
  };
14664
+ const isReviewReady = useMemo(() => {
14665
+ const data = form.watch();
14666
+ const requiresCounterparty = ["ach", "wire"].includes(data.transactionType);
14667
+ if (!data.transactionType || !data.accountNumber || !data.amount) return false;
14668
+ if (requiresCounterparty && (!data.counterpartyName || !counterpartyLookedUp)) return false;
14669
+ if (!accountLookedUp) return false;
14670
+ if (data.transactionType === "adjustment") {
14671
+ if (!data.adjustmentDirection || !data.adjustmentType) return false;
14672
+ }
14673
+ if (data.transactionType === "transfer") {
14674
+ if (!data.receiverAccountNumber || !receiverAccountLookedUp) return false;
14675
+ }
14676
+ return true;
14677
+ }, [form.watch(), accountLookedUp, counterpartyLookedUp, receiverAccountLookedUp]);
14589
14678
  return /* @__PURE__ */ jsx(
14590
14679
  NewTransactionView,
14591
14680
  {
@@ -14615,11 +14704,13 @@ function NewTransaction() {
14615
14704
  onCancel: handleCancel,
14616
14705
  onConfirmationClose: handleConfirmationClose,
14617
14706
  onConfirmationOpenChange: setConfirmationOpen,
14707
+ onNewTransaction: handleNewTransaction,
14618
14708
  receiverAccountLookedUp,
14619
14709
  receiverAccountData,
14620
14710
  isReceiverAccountLoading,
14621
14711
  onReceiverAccountLookup: handleReceiverAccountLookup,
14622
- onEditReceiverAccount: handleEditReceiverAccount
14712
+ onEditReceiverAccount: handleEditReceiverAccount,
14713
+ isReviewReady
14623
14714
  }
14624
14715
  );
14625
14716
  }
@@ -14670,7 +14761,7 @@ var TransactionDetail = () => {
14670
14761
  return "outline";
14671
14762
  }
14672
14763
  };
14673
- const formatCurrency = (value) => {
14764
+ const formatCurrency3 = (value) => {
14674
14765
  return new Intl.NumberFormat("en-US", {
14675
14766
  style: "currency",
14676
14767
  currency: "USD",
@@ -14686,7 +14777,7 @@ var TransactionDetail = () => {
14686
14777
  /* @__PURE__ */ jsx("span", { className: cn(
14687
14778
  "font-semibold",
14688
14779
  transaction.amount < 0 ? "text-destructive" : "text-success"
14689
- ), children: formatCurrency(transaction.amount) }),
14780
+ ), children: formatCurrency3(transaction.amount) }),
14690
14781
  /* @__PURE__ */ jsx(
14691
14782
  TransactionTypeBadge,
14692
14783
  {
@@ -15308,11 +15399,11 @@ function CreateVelocityLimit() {
15308
15399
  case "round_number":
15309
15400
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
15310
15401
  /* @__PURE__ */ jsx(
15311
- EnhancedInput,
15402
+ CurrencyInput,
15312
15403
  {
15313
15404
  label: "Amount Threshold",
15314
- placeholder: "Enter amount",
15315
- onChange: (e) => handleFieldChange("amountThreshold", e.target.value)
15405
+ value: formData.amountThreshold || "",
15406
+ onChange: (value) => handleFieldChange("amountThreshold", value)
15316
15407
  }
15317
15408
  ),
15318
15409
  /* @__PURE__ */ jsx(
@@ -15425,11 +15516,11 @@ function CreateVelocityLimit() {
15425
15516
  }
15426
15517
  ),
15427
15518
  /* @__PURE__ */ jsx(
15428
- EnhancedInput,
15519
+ CurrencyInput,
15429
15520
  {
15430
15521
  label: "Max Transaction Amount",
15431
- placeholder: "Enter amount",
15432
- onChange: (e) => handleFieldChange("maxAmount", e.target.value)
15522
+ value: formData.maxAmount || "",
15523
+ onChange: (value) => handleFieldChange("maxAmount", value)
15433
15524
  }
15434
15525
  ),
15435
15526
  formData.aggregationLevel !== "transaction" && /* @__PURE__ */ jsx(