braid-ui 1.0.51 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3099,7 +3099,7 @@ function AppSidebar() {
3099
3099
  ] });
3100
3100
  }
3101
3101
  var MainLayout = ({ children }) => {
3102
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-screen w-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("main", { className: "flex-1 overflow-hidden", children }) });
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);
@@ -8445,11 +8445,6 @@ var ADJUSTMENT_DIRECTION_OPTIONS = [
8445
8445
  { value: "debit", label: "Debit" },
8446
8446
  { value: "credit", label: "Credit" }
8447
8447
  ];
8448
- var ADJUSTMENT_TYPE_OPTIONS = [
8449
- { value: "collection", label: "Collection" },
8450
- { value: "transaction_reversal", label: "Transaction Reversal" },
8451
- { value: "transaction_adjustment", label: "Transaction Adjustment" }
8452
- ];
8453
8448
  var NewTransactionView = ({
8454
8449
  form,
8455
8450
  accountLookedUp,
@@ -8483,7 +8478,8 @@ var NewTransactionView = ({
8483
8478
  isReceiverAccountLoading,
8484
8479
  onReceiverAccountLookup,
8485
8480
  onEditReceiverAccount,
8486
- isReviewReady
8481
+ isReviewReady,
8482
+ adjustmentTypeOptions
8487
8483
  }) => {
8488
8484
  const transactionType = form.watch("transactionType");
8489
8485
  const accountNumber = form.watch("accountNumber");
@@ -8537,7 +8533,7 @@ var NewTransactionView = ({
8537
8533
  { label: "Account Number", value: accountNumber || "-" },
8538
8534
  ...isAdjustment ? [
8539
8535
  { label: "Direction", value: adjustmentDirection === "debit" ? "Debit" : adjustmentDirection === "credit" ? "Credit" : "-" },
8540
- { label: "Adjustment Type", value: ADJUSTMENT_TYPE_OPTIONS.find((t) => t.value === adjustmentType)?.label || "-" }
8536
+ { label: "Adjustment Type", value: adjustmentTypeOptions.find((t) => t.value === adjustmentType)?.label || "-" }
8541
8537
  ] : [],
8542
8538
  ...isTransfer ? [{ label: "Receiver Account", value: receiverAccountNumber || "-" }] : [],
8543
8539
  ...requiresCounterparty ? [{ label: "Counterparty", value: counterpartyName || "-" }] : [],
@@ -8550,364 +8546,362 @@ var NewTransactionView = ({
8550
8546
  items: reviewItems
8551
8547
  }
8552
8548
  ];
8553
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [
8549
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "container mx-auto p-6 space-y-6 max-w-4xl", children: [
8554
8550
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "New Transaction" }) }),
8555
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-4xl space-y-6", children: [
8556
- /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => e.preventDefault(), children: [
8557
- !accountLookedUp ? /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Account Lookup", variant: "default", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 items-start w-full", children: [
8558
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
8559
- FormInput,
8560
- {
8561
- name: "accountNumber",
8562
- placeholder: "Enter account number"
8563
- }
8564
- ) }),
8565
- /* @__PURE__ */ jsxRuntime.jsx(
8566
- Button,
8567
- {
8568
- onClick: onAccountLookup,
8569
- disabled: !accountNumber || isAccountLoading,
8570
- className: "shrink-0 mt-0 w-48",
8571
- children: isAccountLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8572
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8573
- "Looking up..."
8574
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8575
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "h-4 w-4 mr-2" }),
8576
- "Lookup Account"
8577
- ] })
8578
- }
8579
- )
8580
- ] }) }) : /* @__PURE__ */ jsxRuntime.jsx(
8581
- FormCard,
8551
+ /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => e.preventDefault(), children: [
8552
+ !accountLookedUp ? /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Account Lookup", variant: "default", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 items-start w-full", children: [
8553
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
8554
+ FormInput,
8582
8555
  {
8583
- title: "Account Information",
8584
- variant: "subtle",
8585
- headerActions: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8586
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-5 w-5 text-success" }),
8587
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditAccount, children: [
8588
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-1" }),
8589
- "Edit"
8590
- ] })
8591
- ] }),
8592
- children: /* @__PURE__ */ jsxRuntime.jsx(DataGrid, { data: accountDataGrid, columns: 2 })
8556
+ name: "accountNumber",
8557
+ placeholder: "Enter account number"
8593
8558
  }
8594
- ),
8559
+ ) }),
8595
8560
  /* @__PURE__ */ jsxRuntime.jsx(
8596
- FormCard,
8561
+ Button,
8597
8562
  {
8598
- title: "Transaction Type",
8599
- variant: "default",
8600
- className: cn(!accountLookedUp && "opacity-50 pointer-events-none"),
8601
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-3 lg:gap-4", children: TRANSACTION_TYPES.map((type) => {
8602
- const Icon2 = type.icon;
8603
- const isSelected = transactionType === type.value;
8604
- return /* @__PURE__ */ jsxRuntime.jsxs(
8563
+ onClick: onAccountLookup,
8564
+ disabled: !accountNumber || isAccountLoading,
8565
+ className: "shrink-0 mt-0 w-48",
8566
+ children: isAccountLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8567
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8568
+ "Looking up..."
8569
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8570
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "h-4 w-4 mr-2" }),
8571
+ "Lookup Account"
8572
+ ] })
8573
+ }
8574
+ )
8575
+ ] }) }) : /* @__PURE__ */ jsxRuntime.jsx(
8576
+ FormCard,
8577
+ {
8578
+ title: "Account Information",
8579
+ variant: "subtle",
8580
+ headerActions: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8581
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-5 w-5 text-success" }),
8582
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditAccount, children: [
8583
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-1" }),
8584
+ "Edit"
8585
+ ] })
8586
+ ] }),
8587
+ children: /* @__PURE__ */ jsxRuntime.jsx(DataGrid, { data: accountDataGrid, columns: 2 })
8588
+ }
8589
+ ),
8590
+ /* @__PURE__ */ jsxRuntime.jsx(
8591
+ FormCard,
8592
+ {
8593
+ title: "Transaction Type",
8594
+ variant: "default",
8595
+ className: cn(!accountLookedUp && "opacity-50 pointer-events-none"),
8596
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 lg:grid-cols-4 gap-3 lg:gap-4", children: TRANSACTION_TYPES.map((type) => {
8597
+ const Icon2 = type.icon;
8598
+ const isSelected = transactionType === type.value;
8599
+ return /* @__PURE__ */ jsxRuntime.jsxs(
8600
+ "button",
8601
+ {
8602
+ type: "button",
8603
+ onClick: () => onTransactionTypeChange(type.value),
8604
+ disabled: !accountLookedUp,
8605
+ className: cn(
8606
+ "flex flex-col items-center justify-center p-4 lg:p-3 rounded-lg border-2 transition-all",
8607
+ "hover:border-primary/50 hover:shadow-md",
8608
+ isSelected ? "border-primary bg-primary/5 shadow-sm" : "border-border bg-card"
8609
+ ),
8610
+ children: [
8611
+ /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: cn(
8612
+ "h-6 w-6 lg:h-5 lg:w-5 mb-2",
8613
+ isSelected ? "text-primary" : "text-muted-foreground"
8614
+ ) }),
8615
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
8616
+ "text-sm font-medium",
8617
+ isSelected ? "text-primary" : "text-foreground"
8618
+ ), children: type.label })
8619
+ ]
8620
+ },
8621
+ type.value
8622
+ );
8623
+ }) })
8624
+ }
8625
+ ),
8626
+ requiresCounterparty && (!counterpartyLookedUp ? /* @__PURE__ */ jsxRuntime.jsxs(
8627
+ FormCard,
8628
+ {
8629
+ title: "Counterparty Search",
8630
+ variant: "default",
8631
+ className: cn(!transactionType && "opacity-50 pointer-events-none"),
8632
+ children: [
8633
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
8634
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
8635
+ /* @__PURE__ */ jsxRuntime.jsx(
8636
+ "input",
8637
+ {
8638
+ type: "text",
8639
+ placeholder: "Start typing to search counterparties...",
8640
+ value: counterpartyName,
8641
+ onChange: (e) => onCounterpartySearchChange(e.target.value),
8642
+ disabled: !transactionType,
8643
+ className: cn(
8644
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
8645
+ "ring-offset-background placeholder:text-muted-foreground",
8646
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
8647
+ "disabled:cursor-not-allowed disabled:opacity-50",
8648
+ isCounterpartySearching && "pr-10"
8649
+ )
8650
+ }
8651
+ ),
8652
+ isCounterpartySearching && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin text-muted-foreground" }) })
8653
+ ] }),
8654
+ showCounterpartyDropdown && counterpartySearchResults.length > 0 && /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs(
8605
8655
  "button",
8606
8656
  {
8607
8657
  type: "button",
8608
- onClick: () => onTransactionTypeChange(type.value),
8609
- disabled: !accountLookedUp,
8610
- className: cn(
8611
- "flex flex-col items-center justify-center p-4 lg:p-3 rounded-lg border-2 transition-all",
8612
- "hover:border-primary/50 hover:shadow-md",
8613
- isSelected ? "border-primary bg-primary/5 shadow-sm" : "border-border bg-card"
8614
- ),
8658
+ onClick: () => onCounterpartySelect(result),
8659
+ className: "w-full px-3 py-2 text-left hover:bg-accent transition-colors",
8615
8660
  children: [
8616
- /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: cn(
8617
- "h-6 w-6 lg:h-5 lg:w-5 mb-2",
8618
- isSelected ? "text-primary" : "text-muted-foreground"
8619
- ) }),
8620
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
8621
- "text-sm font-medium",
8622
- isSelected ? "text-primary" : "text-foreground"
8623
- ), children: type.label })
8661
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-sm", children: result.name }),
8662
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: result.id })
8624
8663
  ]
8625
8664
  },
8626
- type.value
8627
- );
8628
- }) })
8629
- }
8630
- ),
8631
- requiresCounterparty && (!counterpartyLookedUp ? /* @__PURE__ */ jsxRuntime.jsxs(
8632
- FormCard,
8633
- {
8634
- title: "Counterparty Search",
8635
- variant: "default",
8636
- className: cn(!transactionType && "opacity-50 pointer-events-none"),
8637
- children: [
8638
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
8639
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
8640
- /* @__PURE__ */ jsxRuntime.jsx(
8641
- "input",
8642
- {
8643
- type: "text",
8644
- placeholder: "Start typing to search counterparties...",
8645
- value: counterpartyName,
8646
- onChange: (e) => onCounterpartySearchChange(e.target.value),
8647
- disabled: !transactionType,
8648
- className: cn(
8649
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
8650
- "ring-offset-background placeholder:text-muted-foreground",
8651
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
8652
- "disabled:cursor-not-allowed disabled:opacity-50",
8653
- isCounterpartySearching && "pr-10"
8654
- )
8655
- }
8656
- ),
8657
- isCounterpartySearching && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin text-muted-foreground" }) })
8658
- ] }),
8659
- showCounterpartyDropdown && counterpartySearchResults.length > 0 && /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs(
8660
- "button",
8661
- {
8662
- type: "button",
8663
- onClick: () => onCounterpartySelect(result),
8664
- className: "w-full px-3 py-2 text-left hover:bg-accent transition-colors",
8665
- children: [
8666
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-sm", children: result.name }),
8667
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: result.id })
8668
- ]
8669
- },
8670
- result.id
8671
- )) }),
8672
- showCounterpartyDropdown && counterpartySearchResults.length === 0 && !isCounterpartySearching && counterpartyName.length >= 2 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg p-3", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground", children: [
8673
- 'No counterparties found matching "',
8674
- counterpartyName,
8675
- '"'
8676
- ] }) })
8677
- ] }),
8678
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-2", children: "Type at least 2 characters to search" })
8679
- ]
8680
- }
8681
- ) : /* @__PURE__ */ jsxRuntime.jsx(
8682
- FormCard,
8683
- {
8684
- title: "Counterparty Information",
8685
- variant: "subtle",
8686
- headerActions: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8687
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-5 w-5 text-success" }),
8688
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditCounterparty, children: [
8689
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-1" }),
8690
- "Edit"
8691
- ] })
8665
+ result.id
8666
+ )) }),
8667
+ showCounterpartyDropdown && counterpartySearchResults.length === 0 && !isCounterpartySearching && counterpartyName.length >= 2 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg p-3", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground", children: [
8668
+ 'No counterparties found matching "',
8669
+ counterpartyName,
8670
+ '"'
8671
+ ] }) })
8692
8672
  ] }),
8693
- children: /* @__PURE__ */ jsxRuntime.jsx(DataGrid, { data: counterpartyDataGrid, columns: 2 })
8694
- }
8695
- )),
8696
- isTransfer && (!receiverAccountLookedUp ? /* @__PURE__ */ jsxRuntime.jsx(
8697
- FormCard,
8698
- {
8699
- title: "Receiver Account",
8700
- variant: "default",
8701
- className: cn(!transactionType && "opacity-50 pointer-events-none"),
8702
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 items-start w-full", children: [
8703
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
8704
- FormInput,
8673
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-2", children: "Type at least 2 characters to search" })
8674
+ ]
8675
+ }
8676
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
8677
+ FormCard,
8678
+ {
8679
+ title: "Counterparty Information",
8680
+ variant: "subtle",
8681
+ headerActions: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8682
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-5 w-5 text-success" }),
8683
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditCounterparty, children: [
8684
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-1" }),
8685
+ "Edit"
8686
+ ] })
8687
+ ] }),
8688
+ children: /* @__PURE__ */ jsxRuntime.jsx(DataGrid, { data: counterpartyDataGrid, columns: 2 })
8689
+ }
8690
+ )),
8691
+ isTransfer && (!receiverAccountLookedUp ? /* @__PURE__ */ jsxRuntime.jsx(
8692
+ FormCard,
8693
+ {
8694
+ title: "Receiver Account",
8695
+ variant: "default",
8696
+ className: cn(!transactionType && "opacity-50 pointer-events-none"),
8697
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 items-start w-full", children: [
8698
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
8699
+ FormInput,
8700
+ {
8701
+ name: "receiverAccountNumber",
8702
+ placeholder: "Enter receiver account number",
8703
+ disabled: !transactionType
8704
+ }
8705
+ ) }),
8706
+ /* @__PURE__ */ jsxRuntime.jsx(
8707
+ Button,
8708
+ {
8709
+ onClick: onReceiverAccountLookup,
8710
+ disabled: !receiverAccountNumber || isReceiverAccountLoading,
8711
+ className: "shrink-0 mt-0 w-48",
8712
+ children: isReceiverAccountLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8713
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8714
+ "Looking up..."
8715
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8716
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "h-4 w-4 mr-2" }),
8717
+ "Lookup Receiver"
8718
+ ] })
8719
+ }
8720
+ )
8721
+ ] })
8722
+ }
8723
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
8724
+ FormCard,
8725
+ {
8726
+ title: "Receiver Account Information",
8727
+ variant: "subtle",
8728
+ headerActions: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8729
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-5 w-5 text-success" }),
8730
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditReceiverAccount, children: [
8731
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-1" }),
8732
+ "Edit"
8733
+ ] })
8734
+ ] }),
8735
+ children: /* @__PURE__ */ jsxRuntime.jsx(DataGrid, { data: receiverAccountDataGrid, columns: 2 })
8736
+ }
8737
+ )),
8738
+ /* @__PURE__ */ jsxRuntime.jsx(
8739
+ FormCard,
8740
+ {
8741
+ title: "Transaction Details",
8742
+ variant: "default",
8743
+ className: cn(
8744
+ requiresCounterparty ? !counterpartyLookedUp && "opacity-50 pointer-events-none" : isTransfer ? !receiverAccountLookedUp && "opacity-50 pointer-events-none" : !transactionType && "opacity-50 pointer-events-none"
8745
+ ),
8746
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
8747
+ isAdjustment && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
8748
+ /* @__PURE__ */ jsxRuntime.jsx(
8749
+ FormSelect,
8705
8750
  {
8706
- name: "receiverAccountNumber",
8707
- placeholder: "Enter receiver account number",
8751
+ name: "adjustmentDirection",
8752
+ label: "Direction",
8753
+ placeholder: "Select direction",
8754
+ options: ADJUSTMENT_DIRECTION_OPTIONS,
8708
8755
  disabled: !transactionType
8709
8756
  }
8710
- ) }),
8757
+ ),
8711
8758
  /* @__PURE__ */ jsxRuntime.jsx(
8712
- Button,
8759
+ FormSelect,
8713
8760
  {
8714
- onClick: onReceiverAccountLookup,
8715
- disabled: !receiverAccountNumber || isReceiverAccountLoading,
8716
- className: "shrink-0 mt-0 w-48",
8717
- children: isReceiverAccountLoading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8718
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8719
- "Looking up..."
8720
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8721
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "h-4 w-4 mr-2" }),
8722
- "Lookup Receiver"
8723
- ] })
8761
+ name: "adjustmentType",
8762
+ label: "Adjustment Type",
8763
+ placeholder: "Select type",
8764
+ options: adjustmentTypeOptions,
8765
+ disabled: !transactionType || !adjustmentDirection
8724
8766
  }
8725
8767
  )
8726
- ] })
8727
- }
8728
- ) : /* @__PURE__ */ jsxRuntime.jsx(
8729
- FormCard,
8730
- {
8731
- title: "Receiver Account Information",
8732
- variant: "subtle",
8733
- headerActions: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8734
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-5 w-5 text-success" }),
8735
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", onClick: onEditReceiverAccount, children: [
8736
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-1" }),
8737
- "Edit"
8738
- ] })
8739
8768
  ] }),
8740
- children: /* @__PURE__ */ jsxRuntime.jsx(DataGrid, { data: receiverAccountDataGrid, columns: 2 })
8741
- }
8742
- )),
8743
- /* @__PURE__ */ jsxRuntime.jsx(
8744
- FormCard,
8745
- {
8746
- title: "Transaction Details",
8747
- variant: "default",
8748
- className: cn(
8749
- requiresCounterparty ? !counterpartyLookedUp && "opacity-50 pointer-events-none" : isTransfer ? !receiverAccountLookedUp && "opacity-50 pointer-events-none" : !transactionType && "opacity-50 pointer-events-none"
8769
+ /* @__PURE__ */ jsxRuntime.jsx(
8770
+ reactHookForm.Controller,
8771
+ {
8772
+ name: "amount",
8773
+ control: form.control,
8774
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(
8775
+ CurrencyInput,
8776
+ {
8777
+ label: "Amount",
8778
+ value: field.value,
8779
+ onChange: field.onChange,
8780
+ disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType,
8781
+ error: form.formState.errors.amount?.message
8782
+ }
8783
+ )
8784
+ }
8750
8785
  ),
8751
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
8752
- isAdjustment && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
8786
+ /* @__PURE__ */ jsxRuntime.jsx(
8787
+ FormInput,
8788
+ {
8789
+ name: "description",
8790
+ label: "Description (Optional)",
8791
+ placeholder: "Enter transaction description",
8792
+ disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType
8793
+ }
8794
+ )
8795
+ ] })
8796
+ }
8797
+ ),
8798
+ /* @__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: [
8799
+ /* @__PURE__ */ jsxRuntime.jsx(DataGrid, { data: reviewData, columns: 2 }),
8800
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted/30 rounded-lg p-4 border border-border/50", children: /* @__PURE__ */ jsxRuntime.jsx(
8801
+ reactHookForm.Controller,
8802
+ {
8803
+ name: "certifyInformation",
8804
+ control: form.control,
8805
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
8806
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
8753
8807
  /* @__PURE__ */ jsxRuntime.jsx(
8754
- FormSelect,
8808
+ Checkbox,
8755
8809
  {
8756
- name: "adjustmentDirection",
8757
- label: "Direction",
8758
- placeholder: "Select direction",
8759
- options: ADJUSTMENT_DIRECTION_OPTIONS,
8760
- disabled: !transactionType
8810
+ id: "certifyInformation",
8811
+ checked: field.value,
8812
+ onCheckedChange: field.onChange
8761
8813
  }
8762
8814
  ),
8763
8815
  /* @__PURE__ */ jsxRuntime.jsx(
8764
- FormSelect,
8816
+ "label",
8765
8817
  {
8766
- name: "adjustmentType",
8767
- label: "Adjustment Type",
8768
- placeholder: "Select type",
8769
- options: ADJUSTMENT_TYPE_OPTIONS,
8770
- disabled: !transactionType
8818
+ htmlFor: "certifyInformation",
8819
+ className: "text-sm font-medium leading-relaxed cursor-pointer select-none",
8820
+ children: "I certify that all information entered is correct and accurate to the best of my knowledge"
8771
8821
  }
8772
8822
  )
8773
8823
  ] }),
8774
- /* @__PURE__ */ jsxRuntime.jsx(
8775
- reactHookForm.Controller,
8776
- {
8777
- name: "amount",
8778
- control: form.control,
8779
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(
8780
- CurrencyInput,
8781
- {
8782
- label: "Amount",
8783
- value: field.value,
8784
- onChange: field.onChange,
8785
- disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType,
8786
- error: form.formState.errors.amount?.message
8787
- }
8788
- )
8789
- }
8790
- ),
8791
- /* @__PURE__ */ jsxRuntime.jsx(
8792
- FormInput,
8793
- {
8794
- name: "description",
8795
- label: "Description (Optional)",
8796
- placeholder: "Enter transaction description",
8797
- disabled: requiresCounterparty ? !counterpartyLookedUp : isTransfer ? !receiverAccountLookedUp : !transactionType
8798
- }
8799
- )
8824
+ form.formState.errors.certifyInformation && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive ml-7", children: form.formState.errors.certifyInformation.message })
8800
8825
  ] })
8801
8826
  }
8802
- ),
8803
- /* @__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: [
8804
- /* @__PURE__ */ jsxRuntime.jsx(DataGrid, { data: reviewData, columns: 2 }),
8805
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted/30 rounded-lg p-4 border border-border/50", children: /* @__PURE__ */ jsxRuntime.jsx(
8806
- reactHookForm.Controller,
8807
- {
8808
- name: "certifyInformation",
8809
- control: form.control,
8810
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
8811
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
8812
- /* @__PURE__ */ jsxRuntime.jsx(
8813
- Checkbox,
8814
- {
8815
- id: "certifyInformation",
8816
- checked: field.value,
8817
- onCheckedChange: field.onChange
8818
- }
8819
- ),
8820
- /* @__PURE__ */ jsxRuntime.jsx(
8821
- "label",
8822
- {
8823
- htmlFor: "certifyInformation",
8824
- className: "text-sm font-medium leading-relaxed cursor-pointer select-none",
8825
- children: "I certify that all information entered is correct and accurate to the best of my knowledge"
8826
- }
8827
- )
8828
- ] }),
8829
- form.formState.errors.certifyInformation && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive ml-7", children: form.formState.errors.certifyInformation.message })
8830
- ] })
8831
- }
8832
- ) }),
8833
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 justify-end pt-4 border-t border-border", children: [
8834
- /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: onCancel, className: "w-32", children: "Cancel" }),
8835
- /* @__PURE__ */ jsxRuntime.jsx(
8836
- Button,
8837
- {
8838
- type: "button",
8839
- onClick: onSubmit,
8840
- className: "w-48",
8841
- disabled: !transactionType || !accountNumber || requiresCounterparty && !counterpartyName || isTransfer && !receiverAccountLookedUp || isAdjustment && (!adjustmentDirection || !adjustmentType) || !amount || !form.watch("certifyInformation") || isSubmitting,
8842
- children: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8843
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8844
- "Submitting..."
8845
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8846
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-4 w-4 mr-2" }),
8847
- "Submit Transaction"
8848
- ] })
8849
- }
8850
- )
8851
- ] })
8852
- ] }) })
8853
- ] }) }),
8854
- /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: confirmationOpen, onOpenChange: () => {
8855
- }, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-md", hideCloseButton: true, children: [
8856
- /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
8857
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
8858
- 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" }) }),
8859
- /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Successful" : "Transaction Failed" })
8860
- ] }),
8861
- /* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { className: "text-left", children: submissionStatus === "success" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 pt-2", children: [
8862
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground", children: "Your transaction has been successfully submitted and is being processed." }),
8863
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted/50 rounded-lg p-4 space-y-2", children: [
8864
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8865
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Transaction ID:" }),
8866
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-medium", children: transactionId })
8867
- ] }),
8868
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8869
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
8870
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
8871
- ] }),
8872
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8873
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Type:" }),
8874
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: TRANSACTION_TYPES.find((t) => t.value === transactionType)?.label })
8875
- ] }),
8876
- requiresCounterparty && counterpartyName && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8877
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Counterparty:" }),
8878
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: counterpartyName })
8879
- ] })
8880
- ] }),
8881
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
8882
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-5 w-5 text-blue-500 mt-0.5 flex-shrink-0" }),
8883
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-blue-700 dark:text-blue-300", children: "You will receive a confirmation email once the transaction is completed." })
8884
- ] })
8885
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 pt-2", children: [
8886
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-lg", children: [
8887
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-5 w-5 text-destructive mt-0.5 flex-shrink-0" }),
8888
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
8889
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-destructive", children: "Error Processing Transaction" }),
8890
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: errorMessage })
8891
- ] })
8892
- ] }),
8893
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Please review the error message above and try again. If the problem persists, contact support." })
8894
- ] }) })
8895
- ] }),
8896
- /* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { className: "sm:justify-end gap-2", children: [
8897
- submissionStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "Edit" }),
8898
- submissionStatus === "success" && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: onNewTransaction, children: "New Transaction" }),
8827
+ ) }),
8828
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 justify-end pt-4 border-t border-border", children: [
8829
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: onCancel, className: "w-32", children: "Cancel" }),
8899
8830
  /* @__PURE__ */ jsxRuntime.jsx(
8900
8831
  Button,
8901
8832
  {
8902
8833
  type: "button",
8903
- onClick: onConfirmationClose,
8904
- variant: submissionStatus === "success" ? "default" : "outline",
8905
- children: submissionStatus === "success" ? "View Transaction" : "Close"
8834
+ onClick: onSubmit,
8835
+ className: "w-48",
8836
+ disabled: !transactionType || !accountNumber || requiresCounterparty && !counterpartyName || isTransfer && !receiverAccountLookedUp || isAdjustment && (!adjustmentDirection || !adjustmentType) || !amount || !form.watch("certifyInformation") || isSubmitting,
8837
+ children: isSubmitting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8838
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
8839
+ "Submitting..."
8840
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8841
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-4 w-4 mr-2" }),
8842
+ "Submit Transaction"
8843
+ ] })
8906
8844
  }
8907
8845
  )
8908
8846
  ] })
8909
8847
  ] }) })
8910
- ] })
8848
+ ] }) }),
8849
+ /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: confirmationOpen, onOpenChange: () => {
8850
+ }, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-md", hideCloseButton: true, children: [
8851
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
8852
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 mb-2", children: [
8853
+ 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" }) }),
8854
+ /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "text-xl", children: submissionStatus === "success" ? "Transaction Successful" : "Transaction Failed" })
8855
+ ] }),
8856
+ /* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { className: "text-left", children: submissionStatus === "success" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 pt-2", children: [
8857
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground", children: "Your transaction has been successfully submitted and is being processed." }),
8858
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted/50 rounded-lg p-4 space-y-2", children: [
8859
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8860
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Transaction ID:" }),
8861
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono font-medium", children: transactionId })
8862
+ ] }),
8863
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8864
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Amount:" }),
8865
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: formatCurrency2(amount) })
8866
+ ] }),
8867
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8868
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Type:" }),
8869
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: TRANSACTION_TYPES.find((t) => t.value === transactionType)?.label })
8870
+ ] }),
8871
+ requiresCounterparty && counterpartyName && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
8872
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Counterparty:" }),
8873
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: counterpartyName })
8874
+ ] })
8875
+ ] }),
8876
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg", children: [
8877
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-5 w-5 text-blue-500 mt-0.5 flex-shrink-0" }),
8878
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-blue-700 dark:text-blue-300", children: "You will receive a confirmation email once the transaction is completed." })
8879
+ ] })
8880
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 pt-2", children: [
8881
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 p-4 bg-destructive/10 border border-destructive/20 rounded-lg", children: [
8882
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-5 w-5 text-destructive mt-0.5 flex-shrink-0" }),
8883
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
8884
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-destructive", children: "Error Processing Transaction" }),
8885
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: errorMessage })
8886
+ ] })
8887
+ ] }),
8888
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Please review the error message above and try again. If the problem persists, contact support." })
8889
+ ] }) })
8890
+ ] }),
8891
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { className: "sm:justify-end gap-2", children: [
8892
+ submissionStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: () => onConfirmationOpenChange(false), children: "Edit" }),
8893
+ submissionStatus === "success" && /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: onNewTransaction, children: "New Transaction" }),
8894
+ /* @__PURE__ */ jsxRuntime.jsx(
8895
+ Button,
8896
+ {
8897
+ type: "button",
8898
+ onClick: onConfirmationClose,
8899
+ variant: submissionStatus === "success" ? "default" : "outline",
8900
+ children: submissionStatus === "success" ? "View Transaction" : "Close"
8901
+ }
8902
+ )
8903
+ ] })
8904
+ ] }) })
8911
8905
  ] });
8912
8906
  };
8913
8907
  var typeIcons = {
@@ -14427,11 +14421,29 @@ function NewTransaction() {
14427
14421
  amount: "",
14428
14422
  description: "",
14429
14423
  certifyInformation: false,
14430
- adjustmentDirection: "",
14424
+ adjustmentDirection: "debit",
14431
14425
  adjustmentType: "",
14432
14426
  receiverAccountNumber: ""
14433
14427
  }
14434
14428
  });
14429
+ const adjustmentDirection = form.watch("adjustmentDirection");
14430
+ const adjustmentTypeOptions = React15.useMemo(() => {
14431
+ if (adjustmentDirection === "credit") {
14432
+ return [
14433
+ { value: "interest_credit", label: "Interest Credit" },
14434
+ { value: "fee_reversal", label: "Fee Reversal" },
14435
+ { value: "promotional_credit", label: "Promotional Credit" }
14436
+ ];
14437
+ }
14438
+ return [
14439
+ { value: "collection", label: "Collection" },
14440
+ { value: "transaction_reversal", label: "Transaction Reversal" },
14441
+ { value: "transaction_adjustment", label: "Transaction Adjustment" }
14442
+ ];
14443
+ }, [adjustmentDirection]);
14444
+ React15.useEffect(() => {
14445
+ form.setValue("adjustmentType", "");
14446
+ }, [adjustmentDirection, form]);
14435
14447
  const handleAccountLookup = async () => {
14436
14448
  const accNum = form.getValues("accountNumber");
14437
14449
  if (!accNum) {
@@ -14636,7 +14648,7 @@ function NewTransaction() {
14636
14648
  setIsSubmitting(true);
14637
14649
  try {
14638
14650
  await new Promise((resolve) => setTimeout(resolve, 1500));
14639
- const hasError = Math.random() > 0.7;
14651
+ const hasError = Math.random() > 0.1;
14640
14652
  if (hasError) {
14641
14653
  const errorScenarios = [
14642
14654
  "Insufficient funds. Current balance: $125,450.00, Required: $" + parseFloat(data.amount).toFixed(2),
@@ -14742,7 +14754,8 @@ function NewTransaction() {
14742
14754
  isReceiverAccountLoading,
14743
14755
  onReceiverAccountLookup: handleReceiverAccountLookup,
14744
14756
  onEditReceiverAccount: handleEditReceiverAccount,
14745
- isReviewReady
14757
+ isReviewReady,
14758
+ adjustmentTypeOptions
14746
14759
  }
14747
14760
  );
14748
14761
  }
@@ -16780,7 +16793,6 @@ exports.ACHBasicInfoCard = ACHBasicInfoCard;
16780
16793
  exports.ACHDetailsSection = ACHDetailsSection;
16781
16794
  exports.ACHTransferSection = ACHTransferSection;
16782
16795
  exports.ADJUSTMENT_DIRECTION_OPTIONS = ADJUSTMENT_DIRECTION_OPTIONS;
16783
- exports.ADJUSTMENT_TYPE_OPTIONS = ADJUSTMENT_TYPE_OPTIONS;
16784
16796
  exports.AccountCard = AccountCard;
16785
16797
  exports.AccountDetail = AccountDetail_default;
16786
16798
  exports.Accounts = Accounts_default;