braid-ui 1.0.45 → 1.0.47
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 +474 -471
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +474 -472
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5808,6 +5808,7 @@ var CounterpartyProfileCard = ({
|
|
|
5808
5808
|
/* @__PURE__ */ jsx(
|
|
5809
5809
|
FormSelect,
|
|
5810
5810
|
{
|
|
5811
|
+
disabled: true,
|
|
5811
5812
|
name: "idType",
|
|
5812
5813
|
label: "Associated with",
|
|
5813
5814
|
placeholder: "Select association type",
|
|
@@ -5822,6 +5823,7 @@ var CounterpartyProfileCard = ({
|
|
|
5822
5823
|
/* @__PURE__ */ jsx(
|
|
5823
5824
|
FormInput,
|
|
5824
5825
|
{
|
|
5826
|
+
disabled: true,
|
|
5825
5827
|
name: "idValue",
|
|
5826
5828
|
label: form.watch("idType") === "product_id" ? "Product ID" : form.watch("idType") === "business_id" ? "Business ID" : form.watch("idType") === "individual_id" ? "Individual ID" : "Account Number",
|
|
5827
5829
|
placeholder: "Enter ID value"
|
|
@@ -6273,6 +6275,447 @@ var CounterpartyDetailView = ({
|
|
|
6273
6275
|
}
|
|
6274
6276
|
);
|
|
6275
6277
|
};
|
|
6278
|
+
var SimpleACHForm = () => {
|
|
6279
|
+
return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6280
|
+
/* @__PURE__ */ jsx(
|
|
6281
|
+
EnhancedInput,
|
|
6282
|
+
{
|
|
6283
|
+
label: "Routing Number",
|
|
6284
|
+
placeholder: "Enter 9-digit routing number",
|
|
6285
|
+
pattern: "[0-9]{9}",
|
|
6286
|
+
maxLength: 9,
|
|
6287
|
+
hint: "9-digit routing number",
|
|
6288
|
+
required: true
|
|
6289
|
+
}
|
|
6290
|
+
),
|
|
6291
|
+
/* @__PURE__ */ jsx(
|
|
6292
|
+
EnhancedInput,
|
|
6293
|
+
{
|
|
6294
|
+
label: "Account Number",
|
|
6295
|
+
placeholder: "Enter account number",
|
|
6296
|
+
required: true
|
|
6297
|
+
}
|
|
6298
|
+
),
|
|
6299
|
+
/* @__PURE__ */ jsx(
|
|
6300
|
+
EnhancedSelect,
|
|
6301
|
+
{
|
|
6302
|
+
label: "Account Type",
|
|
6303
|
+
placeholder: "Select account type",
|
|
6304
|
+
options: [
|
|
6305
|
+
{ value: "checking", label: "Checking" },
|
|
6306
|
+
{ value: "savings", label: "Savings" }
|
|
6307
|
+
]
|
|
6308
|
+
}
|
|
6309
|
+
)
|
|
6310
|
+
] });
|
|
6311
|
+
};
|
|
6312
|
+
var SimpleWireForm = () => {
|
|
6313
|
+
const [wireType, setWireType] = useState("domestic");
|
|
6314
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6315
|
+
/* @__PURE__ */ jsx(
|
|
6316
|
+
EnhancedSelect,
|
|
6317
|
+
{
|
|
6318
|
+
label: "Wire Type",
|
|
6319
|
+
placeholder: "Select wire type",
|
|
6320
|
+
value: wireType,
|
|
6321
|
+
onValueChange: setWireType,
|
|
6322
|
+
options: [
|
|
6323
|
+
{ value: "domestic", label: "Domestic" },
|
|
6324
|
+
{ value: "international", label: "International" }
|
|
6325
|
+
]
|
|
6326
|
+
}
|
|
6327
|
+
),
|
|
6328
|
+
wireType === "domestic" ? /* @__PURE__ */ jsx(
|
|
6329
|
+
EnhancedInput,
|
|
6330
|
+
{
|
|
6331
|
+
label: "Routing Number",
|
|
6332
|
+
placeholder: "Enter 9-digit routing number",
|
|
6333
|
+
pattern: "[0-9]{9}",
|
|
6334
|
+
maxLength: 9,
|
|
6335
|
+
hint: "9-digit routing number",
|
|
6336
|
+
required: true
|
|
6337
|
+
}
|
|
6338
|
+
) : /* @__PURE__ */ jsx(
|
|
6339
|
+
EnhancedInput,
|
|
6340
|
+
{
|
|
6341
|
+
label: "BIC Number",
|
|
6342
|
+
placeholder: "Enter BIC/SWIFT code",
|
|
6343
|
+
hint: "Bank Identifier Code",
|
|
6344
|
+
required: true
|
|
6345
|
+
}
|
|
6346
|
+
),
|
|
6347
|
+
/* @__PURE__ */ jsx(
|
|
6348
|
+
EnhancedInput,
|
|
6349
|
+
{
|
|
6350
|
+
label: "Account Number",
|
|
6351
|
+
placeholder: "Enter account number",
|
|
6352
|
+
required: true
|
|
6353
|
+
}
|
|
6354
|
+
)
|
|
6355
|
+
] }) });
|
|
6356
|
+
};
|
|
6357
|
+
var PaymentInformationSection = ({ onPaymentMethodsChange } = {}) => {
|
|
6358
|
+
const [paymentMethods, setPaymentMethods] = useState([]);
|
|
6359
|
+
const [showAddMenu, setShowAddMenu] = useState(false);
|
|
6360
|
+
const addPaymentMethod = (type) => {
|
|
6361
|
+
const newMethod = {
|
|
6362
|
+
id: `${type}-${Date.now()}`,
|
|
6363
|
+
type,
|
|
6364
|
+
name: type === "ach" ? "ACH Payment" : "Wire Transfer",
|
|
6365
|
+
collapsed: false
|
|
6366
|
+
};
|
|
6367
|
+
const updatedMethods = [...paymentMethods, newMethod];
|
|
6368
|
+
setPaymentMethods(updatedMethods);
|
|
6369
|
+
onPaymentMethodsChange?.(updatedMethods);
|
|
6370
|
+
setShowAddMenu(false);
|
|
6371
|
+
};
|
|
6372
|
+
const removePaymentMethod = (id) => {
|
|
6373
|
+
const updatedMethods = paymentMethods.filter((method) => method.id !== id);
|
|
6374
|
+
setPaymentMethods(updatedMethods);
|
|
6375
|
+
onPaymentMethodsChange?.(updatedMethods);
|
|
6376
|
+
};
|
|
6377
|
+
const toggleCollapse = (id) => {
|
|
6378
|
+
setPaymentMethods(paymentMethods.map(
|
|
6379
|
+
(method) => method.id === id ? { ...method, collapsed: !method.collapsed } : method
|
|
6380
|
+
));
|
|
6381
|
+
};
|
|
6382
|
+
const renderPaymentMethodContent = (method) => {
|
|
6383
|
+
if (method.type === "ach") {
|
|
6384
|
+
return /* @__PURE__ */ jsx(SimpleACHForm, {});
|
|
6385
|
+
} else {
|
|
6386
|
+
return /* @__PURE__ */ jsx(SimpleWireForm, {});
|
|
6387
|
+
}
|
|
6388
|
+
};
|
|
6389
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
6390
|
+
paymentMethods.map((method) => /* @__PURE__ */ jsxs(Card, { className: "relative", children: [
|
|
6391
|
+
/* @__PURE__ */ jsx(CardHeader, { className: "pb-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
6392
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
6393
|
+
/* @__PURE__ */ jsx(
|
|
6394
|
+
Button,
|
|
6395
|
+
{
|
|
6396
|
+
variant: "ghost",
|
|
6397
|
+
size: "icon",
|
|
6398
|
+
onClick: () => toggleCollapse(method.id),
|
|
6399
|
+
className: "h-6 w-6",
|
|
6400
|
+
children: method.collapsed ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
6401
|
+
}
|
|
6402
|
+
),
|
|
6403
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-base", children: method.name }),
|
|
6404
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs bg-muted px-2 py-1 rounded-md uppercase font-medium", children: method.type })
|
|
6405
|
+
] }),
|
|
6406
|
+
/* @__PURE__ */ jsx(
|
|
6407
|
+
Button,
|
|
6408
|
+
{
|
|
6409
|
+
variant: "ghost",
|
|
6410
|
+
size: "icon",
|
|
6411
|
+
onClick: () => removePaymentMethod(method.id),
|
|
6412
|
+
className: "h-6 w-6 text-destructive hover:text-destructive/80 hover:bg-destructive/10",
|
|
6413
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
|
|
6414
|
+
}
|
|
6415
|
+
)
|
|
6416
|
+
] }) }),
|
|
6417
|
+
!method.collapsed && /* @__PURE__ */ jsx(CardContent, { children: renderPaymentMethodContent(method) })
|
|
6418
|
+
] }, method.id)),
|
|
6419
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
6420
|
+
paymentMethods.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-2", children: "At least one payment method is required *" }),
|
|
6421
|
+
/* @__PURE__ */ jsxs(
|
|
6422
|
+
Button,
|
|
6423
|
+
{
|
|
6424
|
+
variant: "outline",
|
|
6425
|
+
onClick: () => setShowAddMenu(!showAddMenu),
|
|
6426
|
+
className: "w-full border-dashed",
|
|
6427
|
+
children: [
|
|
6428
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2" }),
|
|
6429
|
+
"Add Payment Information"
|
|
6430
|
+
]
|
|
6431
|
+
}
|
|
6432
|
+
),
|
|
6433
|
+
showAddMenu && /* @__PURE__ */ jsx("div", { className: "absolute top-full left-0 right-0 mt-2 bg-background border border-border rounded-md shadow-lg z-10", children: /* @__PURE__ */ jsxs("div", { className: "p-2 space-y-1", children: [
|
|
6434
|
+
/* @__PURE__ */ jsx(
|
|
6435
|
+
Button,
|
|
6436
|
+
{
|
|
6437
|
+
variant: "ghost",
|
|
6438
|
+
onClick: () => addPaymentMethod("ach"),
|
|
6439
|
+
className: "w-full justify-start",
|
|
6440
|
+
children: "Add ACH Payment"
|
|
6441
|
+
}
|
|
6442
|
+
),
|
|
6443
|
+
/* @__PURE__ */ jsx(
|
|
6444
|
+
Button,
|
|
6445
|
+
{
|
|
6446
|
+
variant: "ghost",
|
|
6447
|
+
onClick: () => addPaymentMethod("wire"),
|
|
6448
|
+
className: "w-full justify-start",
|
|
6449
|
+
children: "Add Wire Transfer"
|
|
6450
|
+
}
|
|
6451
|
+
)
|
|
6452
|
+
] }) })
|
|
6453
|
+
] })
|
|
6454
|
+
] });
|
|
6455
|
+
};
|
|
6456
|
+
var AddressForm = ({
|
|
6457
|
+
title,
|
|
6458
|
+
description,
|
|
6459
|
+
fieldPrefix = "",
|
|
6460
|
+
showAddressType = true,
|
|
6461
|
+
addressTypeOptions = ADDRESS_TYPE_OPTIONS.FI,
|
|
6462
|
+
fieldOverrides = {},
|
|
6463
|
+
showApartment = false
|
|
6464
|
+
}) => {
|
|
6465
|
+
const addressTypeLabel = fieldPrefix ? `${fieldPrefix} Address Type` : "Address Type";
|
|
6466
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
6467
|
+
/* @__PURE__ */ jsx(
|
|
6468
|
+
EnhancedInput,
|
|
6469
|
+
{
|
|
6470
|
+
label: "Street Address",
|
|
6471
|
+
placeholder: "Enter street address",
|
|
6472
|
+
hint: fieldPrefix ? `${fieldPrefix} street address` : "Primary street address",
|
|
6473
|
+
...fieldOverrides.streetAddress
|
|
6474
|
+
}
|
|
6475
|
+
),
|
|
6476
|
+
showApartment && /* @__PURE__ */ jsx(
|
|
6477
|
+
EnhancedInput,
|
|
6478
|
+
{
|
|
6479
|
+
label: "Apt, Building etc",
|
|
6480
|
+
placeholder: "Additional address information",
|
|
6481
|
+
hint: "Additional address information",
|
|
6482
|
+
...fieldOverrides.apartment
|
|
6483
|
+
}
|
|
6484
|
+
),
|
|
6485
|
+
/* @__PURE__ */ jsx(
|
|
6486
|
+
EnhancedInput,
|
|
6487
|
+
{
|
|
6488
|
+
label: "City",
|
|
6489
|
+
placeholder: "Enter city",
|
|
6490
|
+
required: true,
|
|
6491
|
+
...fieldOverrides.city
|
|
6492
|
+
}
|
|
6493
|
+
),
|
|
6494
|
+
/* @__PURE__ */ jsx(
|
|
6495
|
+
EnhancedInput,
|
|
6496
|
+
{
|
|
6497
|
+
label: "State",
|
|
6498
|
+
placeholder: "Enter state",
|
|
6499
|
+
hint: "State or province",
|
|
6500
|
+
...fieldOverrides.state
|
|
6501
|
+
}
|
|
6502
|
+
),
|
|
6503
|
+
/* @__PURE__ */ jsx(
|
|
6504
|
+
EnhancedInput,
|
|
6505
|
+
{
|
|
6506
|
+
label: "Postal Code",
|
|
6507
|
+
placeholder: "12345",
|
|
6508
|
+
...fieldOverrides.postalCode
|
|
6509
|
+
}
|
|
6510
|
+
),
|
|
6511
|
+
/* @__PURE__ */ jsx(
|
|
6512
|
+
EnhancedSelect,
|
|
6513
|
+
{
|
|
6514
|
+
label: "Country Code",
|
|
6515
|
+
placeholder: "Select country",
|
|
6516
|
+
options: COUNTRY_OPTIONS
|
|
6517
|
+
}
|
|
6518
|
+
),
|
|
6519
|
+
showAddressType && /* @__PURE__ */ jsx(
|
|
6520
|
+
EnhancedSelect,
|
|
6521
|
+
{
|
|
6522
|
+
label: addressTypeLabel,
|
|
6523
|
+
placeholder: "Select type",
|
|
6524
|
+
options: addressTypeOptions
|
|
6525
|
+
}
|
|
6526
|
+
)
|
|
6527
|
+
] }) });
|
|
6528
|
+
};
|
|
6529
|
+
var labelVariants = cva(
|
|
6530
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
6531
|
+
);
|
|
6532
|
+
var Label = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6533
|
+
LabelPrimitive.Root,
|
|
6534
|
+
{
|
|
6535
|
+
ref,
|
|
6536
|
+
className: cn(labelVariants(), className),
|
|
6537
|
+
...props
|
|
6538
|
+
}
|
|
6539
|
+
));
|
|
6540
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
6541
|
+
var CounterpartyBasicInfo = ({ value = {
|
|
6542
|
+
name: "",
|
|
6543
|
+
type: "business",
|
|
6544
|
+
email: "",
|
|
6545
|
+
phone: "",
|
|
6546
|
+
dateOfBirth: "",
|
|
6547
|
+
idNumber: "",
|
|
6548
|
+
idType: "product_id",
|
|
6549
|
+
idValue: ""
|
|
6550
|
+
}, onDataChange }) => {
|
|
6551
|
+
const handleInputChange = (field, newValue) => {
|
|
6552
|
+
const updatedData = { ...value, [field]: newValue };
|
|
6553
|
+
onDataChange?.(updatedData);
|
|
6554
|
+
};
|
|
6555
|
+
const handleTypeChange = (type) => {
|
|
6556
|
+
handleInputChange("type", type);
|
|
6557
|
+
};
|
|
6558
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
6559
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
6560
|
+
/* @__PURE__ */ jsx(
|
|
6561
|
+
EnhancedInput,
|
|
6562
|
+
{
|
|
6563
|
+
label: "Counterparty Name",
|
|
6564
|
+
value: value.name,
|
|
6565
|
+
onChange: (e) => handleInputChange("name", e.target.value),
|
|
6566
|
+
placeholder: "Enter counterparty name",
|
|
6567
|
+
required: true
|
|
6568
|
+
}
|
|
6569
|
+
),
|
|
6570
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
6571
|
+
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium", children: "Counterparty Type" }),
|
|
6572
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-6 h-10 items-center", children: [
|
|
6573
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
6574
|
+
/* @__PURE__ */ jsx(
|
|
6575
|
+
"input",
|
|
6576
|
+
{
|
|
6577
|
+
type: "radio",
|
|
6578
|
+
name: "counterpartyType",
|
|
6579
|
+
value: "business",
|
|
6580
|
+
checked: value.type === "business",
|
|
6581
|
+
onChange: () => handleTypeChange("business"),
|
|
6582
|
+
className: "w-4 h-4 text-primary border-border focus:ring-primary focus:ring-2"
|
|
6583
|
+
}
|
|
6584
|
+
),
|
|
6585
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-foreground", children: "Business" })
|
|
6586
|
+
] }),
|
|
6587
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
6588
|
+
/* @__PURE__ */ jsx(
|
|
6589
|
+
"input",
|
|
6590
|
+
{
|
|
6591
|
+
type: "radio",
|
|
6592
|
+
name: "counterpartyType",
|
|
6593
|
+
value: "individual",
|
|
6594
|
+
checked: value.type === "individual",
|
|
6595
|
+
onChange: () => handleTypeChange("individual"),
|
|
6596
|
+
className: "w-4 h-4 text-primary border-border focus:ring-primary focus:ring-2"
|
|
6597
|
+
}
|
|
6598
|
+
),
|
|
6599
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-foreground", children: "Individual" })
|
|
6600
|
+
] })
|
|
6601
|
+
] })
|
|
6602
|
+
] }),
|
|
6603
|
+
/* @__PURE__ */ jsx(
|
|
6604
|
+
EnhancedSelect,
|
|
6605
|
+
{
|
|
6606
|
+
label: "Associated with",
|
|
6607
|
+
value: value.idType,
|
|
6608
|
+
onValueChange: (val) => handleInputChange("idType", val),
|
|
6609
|
+
options: [
|
|
6610
|
+
{ value: "product_id", label: "Product ID" },
|
|
6611
|
+
{ value: "business_id", label: "Business ID" },
|
|
6612
|
+
{ value: "individual_id", label: "Individual ID" },
|
|
6613
|
+
{ value: "account_number", label: "Account Number" }
|
|
6614
|
+
]
|
|
6615
|
+
}
|
|
6616
|
+
),
|
|
6617
|
+
/* @__PURE__ */ jsx(
|
|
6618
|
+
EnhancedInput,
|
|
6619
|
+
{
|
|
6620
|
+
label: value.idType === "product_id" ? "Product ID" : value.idType === "business_id" ? "Business ID" : value.idType === "individual_id" ? "Individual ID" : "Account Number",
|
|
6621
|
+
value: value.idValue,
|
|
6622
|
+
onChange: (e) => handleInputChange("idValue", e.target.value),
|
|
6623
|
+
placeholder: `Enter ${value.idType === "product_id" ? "product ID" : value.idType === "business_id" ? "business ID" : value.idType === "individual_id" ? "individual ID" : "account number"}`,
|
|
6624
|
+
required: true
|
|
6625
|
+
}
|
|
6626
|
+
)
|
|
6627
|
+
] }),
|
|
6628
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
6629
|
+
/* @__PURE__ */ jsx(
|
|
6630
|
+
EnhancedInput,
|
|
6631
|
+
{
|
|
6632
|
+
label: "Email",
|
|
6633
|
+
type: "email",
|
|
6634
|
+
value: value.email,
|
|
6635
|
+
onChange: (e) => handleInputChange("email", e.target.value),
|
|
6636
|
+
placeholder: "Enter email address"
|
|
6637
|
+
}
|
|
6638
|
+
),
|
|
6639
|
+
/* @__PURE__ */ jsx(
|
|
6640
|
+
EnhancedInput,
|
|
6641
|
+
{
|
|
6642
|
+
label: "Phone Number",
|
|
6643
|
+
type: "tel",
|
|
6644
|
+
value: value.phone,
|
|
6645
|
+
onChange: (e) => handleInputChange("phone", e.target.value),
|
|
6646
|
+
placeholder: "Enter phone number"
|
|
6647
|
+
}
|
|
6648
|
+
),
|
|
6649
|
+
/* @__PURE__ */ jsx(
|
|
6650
|
+
EnhancedInput,
|
|
6651
|
+
{
|
|
6652
|
+
label: "Date of Birth",
|
|
6653
|
+
type: "date",
|
|
6654
|
+
value: value.dateOfBirth,
|
|
6655
|
+
onChange: (e) => handleInputChange("dateOfBirth", e.target.value),
|
|
6656
|
+
placeholder: "Select date of birth"
|
|
6657
|
+
}
|
|
6658
|
+
),
|
|
6659
|
+
/* @__PURE__ */ jsx(
|
|
6660
|
+
EnhancedInput,
|
|
6661
|
+
{
|
|
6662
|
+
label: "ID Number",
|
|
6663
|
+
value: value.idNumber,
|
|
6664
|
+
onChange: (e) => handleInputChange("idNumber", e.target.value),
|
|
6665
|
+
placeholder: "Enter ID number"
|
|
6666
|
+
}
|
|
6667
|
+
)
|
|
6668
|
+
] })
|
|
6669
|
+
] });
|
|
6670
|
+
};
|
|
6671
|
+
var CreateCounterpartyView = ({
|
|
6672
|
+
counterpartyData,
|
|
6673
|
+
paymentMethods,
|
|
6674
|
+
onPaymentMethodsChange,
|
|
6675
|
+
onBasicInfoChange,
|
|
6676
|
+
onCancel,
|
|
6677
|
+
onSubmit
|
|
6678
|
+
}) => {
|
|
6679
|
+
return /* @__PURE__ */ jsx(
|
|
6680
|
+
PageLayout,
|
|
6681
|
+
{
|
|
6682
|
+
title: "Create Counterparty",
|
|
6683
|
+
description: "Create a new counterparty with all required information",
|
|
6684
|
+
actions: [
|
|
6685
|
+
{ label: "Cancel", variant: "outline", onClick: onCancel },
|
|
6686
|
+
{ label: "Create Counterparty", variant: "default", onClick: onSubmit }
|
|
6687
|
+
],
|
|
6688
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
6689
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
6690
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Basic Information" }) }),
|
|
6691
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(CounterpartyBasicInfo, { value: counterpartyData, onDataChange: onBasicInfoChange }) })
|
|
6692
|
+
] }),
|
|
6693
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
6694
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, { children: [
|
|
6695
|
+
"Address",
|
|
6696
|
+
paymentMethods.some((m) => m.type === "wire") && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
6697
|
+
] }) }),
|
|
6698
|
+
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
6699
|
+
paymentMethods.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4", children: "Optional for ACH payments, required for wire transfers" }),
|
|
6700
|
+
paymentMethods.some((m) => m.type === "wire") && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4", children: "Required because you have wire payment methods" }),
|
|
6701
|
+
/* @__PURE__ */ jsx(
|
|
6702
|
+
AddressForm,
|
|
6703
|
+
{
|
|
6704
|
+
title: "",
|
|
6705
|
+
description: "",
|
|
6706
|
+
showApartment: true
|
|
6707
|
+
}
|
|
6708
|
+
)
|
|
6709
|
+
] })
|
|
6710
|
+
] }),
|
|
6711
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
6712
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Payment Configuration" }) }),
|
|
6713
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(PaymentInformationSection, { onPaymentMethodsChange }) })
|
|
6714
|
+
] })
|
|
6715
|
+
] })
|
|
6716
|
+
}
|
|
6717
|
+
);
|
|
6718
|
+
};
|
|
6276
6719
|
|
|
6277
6720
|
// src/lib/mock-data/banking-data.ts
|
|
6278
6721
|
var defaultACHBankDetails = {
|
|
@@ -6558,79 +7001,6 @@ var ACHTransferSection = ({ isEditing, onToggleEdit, className, hideActions }) =
|
|
|
6558
7001
|
}
|
|
6559
7002
|
);
|
|
6560
7003
|
};
|
|
6561
|
-
var AddressForm = ({
|
|
6562
|
-
title,
|
|
6563
|
-
description,
|
|
6564
|
-
fieldPrefix = "",
|
|
6565
|
-
showAddressType = true,
|
|
6566
|
-
addressTypeOptions = ADDRESS_TYPE_OPTIONS.FI,
|
|
6567
|
-
fieldOverrides = {},
|
|
6568
|
-
showApartment = false
|
|
6569
|
-
}) => {
|
|
6570
|
-
const addressTypeLabel = fieldPrefix ? `${fieldPrefix} Address Type` : "Address Type";
|
|
6571
|
-
return /* @__PURE__ */ jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
6572
|
-
/* @__PURE__ */ jsx(
|
|
6573
|
-
EnhancedInput,
|
|
6574
|
-
{
|
|
6575
|
-
label: "Street Address",
|
|
6576
|
-
placeholder: "Enter street address",
|
|
6577
|
-
hint: fieldPrefix ? `${fieldPrefix} street address` : "Primary street address",
|
|
6578
|
-
...fieldOverrides.streetAddress
|
|
6579
|
-
}
|
|
6580
|
-
),
|
|
6581
|
-
showApartment && /* @__PURE__ */ jsx(
|
|
6582
|
-
EnhancedInput,
|
|
6583
|
-
{
|
|
6584
|
-
label: "Apt, Building etc",
|
|
6585
|
-
placeholder: "Additional address information",
|
|
6586
|
-
hint: "Additional address information",
|
|
6587
|
-
...fieldOverrides.apartment
|
|
6588
|
-
}
|
|
6589
|
-
),
|
|
6590
|
-
/* @__PURE__ */ jsx(
|
|
6591
|
-
EnhancedInput,
|
|
6592
|
-
{
|
|
6593
|
-
label: "City",
|
|
6594
|
-
placeholder: "Enter city",
|
|
6595
|
-
required: true,
|
|
6596
|
-
...fieldOverrides.city
|
|
6597
|
-
}
|
|
6598
|
-
),
|
|
6599
|
-
/* @__PURE__ */ jsx(
|
|
6600
|
-
EnhancedInput,
|
|
6601
|
-
{
|
|
6602
|
-
label: "State",
|
|
6603
|
-
placeholder: "Enter state",
|
|
6604
|
-
hint: "State or province",
|
|
6605
|
-
...fieldOverrides.state
|
|
6606
|
-
}
|
|
6607
|
-
),
|
|
6608
|
-
/* @__PURE__ */ jsx(
|
|
6609
|
-
EnhancedInput,
|
|
6610
|
-
{
|
|
6611
|
-
label: "Postal Code",
|
|
6612
|
-
placeholder: "12345",
|
|
6613
|
-
...fieldOverrides.postalCode
|
|
6614
|
-
}
|
|
6615
|
-
),
|
|
6616
|
-
/* @__PURE__ */ jsx(
|
|
6617
|
-
EnhancedSelect,
|
|
6618
|
-
{
|
|
6619
|
-
label: "Country Code",
|
|
6620
|
-
placeholder: "Select country",
|
|
6621
|
-
options: COUNTRY_OPTIONS
|
|
6622
|
-
}
|
|
6623
|
-
),
|
|
6624
|
-
showAddressType && /* @__PURE__ */ jsx(
|
|
6625
|
-
EnhancedSelect,
|
|
6626
|
-
{
|
|
6627
|
-
label: addressTypeLabel,
|
|
6628
|
-
placeholder: "Select type",
|
|
6629
|
-
options: addressTypeOptions
|
|
6630
|
-
}
|
|
6631
|
-
)
|
|
6632
|
-
] }) });
|
|
6633
|
-
};
|
|
6634
7004
|
var BankingDetailsCard = ({ isEditing, onToggleEdit, className }) => {
|
|
6635
7005
|
return /* @__PURE__ */ jsx(
|
|
6636
7006
|
FormCard,
|
|
@@ -6919,178 +7289,36 @@ var ContactInfoCard = ({ isEditing, onToggleEdit, className }) => {
|
|
|
6919
7289
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
6920
7290
|
/* @__PURE__ */ jsx(InfoField, { label: "First Name", value: "", layout: "horizontal" }),
|
|
6921
7291
|
/* @__PURE__ */ jsx(InfoField, { label: "Last Name", value: "", layout: "horizontal" })
|
|
6922
|
-
] }),
|
|
6923
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
6924
|
-
/* @__PURE__ */ jsx(InfoField, { label: "Email", value: "", layout: "horizontal" }),
|
|
6925
|
-
/* @__PURE__ */ jsx(InfoField, { label: "Phone Number", value: "", layout: "horizontal" })
|
|
6926
|
-
] }),
|
|
6927
|
-
/* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Mailing Address" }),
|
|
6928
|
-
isEditing ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6929
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3", children: [
|
|
6930
|
-
/* @__PURE__ */ jsx(InfoField, { label: "Street Address", value: "", layout: "horizontal" }),
|
|
6931
|
-
/* @__PURE__ */ jsx(InfoField, { label: "Apartment, suite, or floor", value: "", layout: "horizontal" })
|
|
6932
|
-
] }),
|
|
6933
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
6934
|
-
/* @__PURE__ */ jsx(InfoField, { label: "City", value: "", layout: "horizontal" }),
|
|
6935
|
-
/* @__PURE__ */ jsx(InfoField, { label: "State", value: "Alabama", layout: "horizontal" })
|
|
6936
|
-
] }),
|
|
6937
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
6938
|
-
/* @__PURE__ */ jsx(InfoField, { label: "Postal Code", value: "", layout: "horizontal" }),
|
|
6939
|
-
/* @__PURE__ */ jsx(InfoField, { label: "Country Code", value: "US", layout: "horizontal" })
|
|
6940
|
-
] })
|
|
6941
|
-
] }) : /* @__PURE__ */ jsx(
|
|
6942
|
-
InfoField,
|
|
6943
|
-
{
|
|
6944
|
-
label: "Address",
|
|
6945
|
-
value: "123 Business Avenue, Suite 100, New York, NY 10001, US",
|
|
6946
|
-
layout: "horizontal"
|
|
6947
|
-
}
|
|
6948
|
-
)
|
|
6949
|
-
] })
|
|
6950
|
-
}
|
|
6951
|
-
);
|
|
6952
|
-
};
|
|
6953
|
-
var labelVariants = cva(
|
|
6954
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
6955
|
-
);
|
|
6956
|
-
var Label = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6957
|
-
LabelPrimitive.Root,
|
|
6958
|
-
{
|
|
6959
|
-
ref,
|
|
6960
|
-
className: cn(labelVariants(), className),
|
|
6961
|
-
...props
|
|
6962
|
-
}
|
|
6963
|
-
));
|
|
6964
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
6965
|
-
var CounterpartyBasicInfo = ({ value = {
|
|
6966
|
-
name: "",
|
|
6967
|
-
type: "business",
|
|
6968
|
-
email: "",
|
|
6969
|
-
phone: "",
|
|
6970
|
-
dateOfBirth: "",
|
|
6971
|
-
idNumber: "",
|
|
6972
|
-
idType: "product_id",
|
|
6973
|
-
idValue: ""
|
|
6974
|
-
}, onDataChange }) => {
|
|
6975
|
-
const handleInputChange = (field, newValue) => {
|
|
6976
|
-
const updatedData = { ...value, [field]: newValue };
|
|
6977
|
-
onDataChange?.(updatedData);
|
|
6978
|
-
};
|
|
6979
|
-
const handleTypeChange = (type) => {
|
|
6980
|
-
handleInputChange("type", type);
|
|
6981
|
-
};
|
|
6982
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
6983
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
6984
|
-
/* @__PURE__ */ jsx(
|
|
6985
|
-
EnhancedInput,
|
|
6986
|
-
{
|
|
6987
|
-
label: "Counterparty Name",
|
|
6988
|
-
value: value.name,
|
|
6989
|
-
onChange: (e) => handleInputChange("name", e.target.value),
|
|
6990
|
-
placeholder: "Enter counterparty name",
|
|
6991
|
-
required: true
|
|
6992
|
-
}
|
|
6993
|
-
),
|
|
6994
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
6995
|
-
/* @__PURE__ */ jsx(Label, { className: "text-sm font-medium", children: "Counterparty Type" }),
|
|
6996
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-6 h-10 items-center", children: [
|
|
6997
|
-
/* @__PURE__ */ jsxs("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
6998
|
-
/* @__PURE__ */ jsx(
|
|
6999
|
-
"input",
|
|
7000
|
-
{
|
|
7001
|
-
type: "radio",
|
|
7002
|
-
name: "counterpartyType",
|
|
7003
|
-
value: "business",
|
|
7004
|
-
checked: value.type === "business",
|
|
7005
|
-
onChange: () => handleTypeChange("business"),
|
|
7006
|
-
className: "w-4 h-4 text-primary border-border focus:ring-primary focus:ring-2"
|
|
7007
|
-
}
|
|
7008
|
-
),
|
|
7009
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-foreground", children: "Business" })
|
|
7010
|
-
] }),
|
|
7011
|
-
/* @__PURE__ */ jsxs("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
7012
|
-
/* @__PURE__ */ jsx(
|
|
7013
|
-
"input",
|
|
7014
|
-
{
|
|
7015
|
-
type: "radio",
|
|
7016
|
-
name: "counterpartyType",
|
|
7017
|
-
value: "individual",
|
|
7018
|
-
checked: value.type === "individual",
|
|
7019
|
-
onChange: () => handleTypeChange("individual"),
|
|
7020
|
-
className: "w-4 h-4 text-primary border-border focus:ring-primary focus:ring-2"
|
|
7021
|
-
}
|
|
7022
|
-
),
|
|
7023
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-foreground", children: "Individual" })
|
|
7024
|
-
] })
|
|
7025
|
-
] })
|
|
7026
|
-
] }),
|
|
7027
|
-
/* @__PURE__ */ jsx(
|
|
7028
|
-
EnhancedSelect,
|
|
7029
|
-
{
|
|
7030
|
-
label: "Associated with",
|
|
7031
|
-
value: value.idType,
|
|
7032
|
-
onValueChange: (val) => handleInputChange("idType", val),
|
|
7033
|
-
options: [
|
|
7034
|
-
{ value: "product_id", label: "Product ID" },
|
|
7035
|
-
{ value: "business_id", label: "Business ID" },
|
|
7036
|
-
{ value: "individual_id", label: "Individual ID" },
|
|
7037
|
-
{ value: "account_number", label: "Account Number" }
|
|
7038
|
-
]
|
|
7039
|
-
}
|
|
7040
|
-
),
|
|
7041
|
-
/* @__PURE__ */ jsx(
|
|
7042
|
-
EnhancedInput,
|
|
7043
|
-
{
|
|
7044
|
-
label: value.idType === "product_id" ? "Product ID" : value.idType === "business_id" ? "Business ID" : value.idType === "individual_id" ? "Individual ID" : "Account Number",
|
|
7045
|
-
value: value.idValue,
|
|
7046
|
-
onChange: (e) => handleInputChange("idValue", e.target.value),
|
|
7047
|
-
placeholder: `Enter ${value.idType === "product_id" ? "product ID" : value.idType === "business_id" ? "business ID" : value.idType === "individual_id" ? "individual ID" : "account number"}`,
|
|
7048
|
-
required: true
|
|
7049
|
-
}
|
|
7050
|
-
)
|
|
7051
|
-
] }),
|
|
7052
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
7053
|
-
/* @__PURE__ */ jsx(
|
|
7054
|
-
EnhancedInput,
|
|
7055
|
-
{
|
|
7056
|
-
label: "Email",
|
|
7057
|
-
type: "email",
|
|
7058
|
-
value: value.email,
|
|
7059
|
-
onChange: (e) => handleInputChange("email", e.target.value),
|
|
7060
|
-
placeholder: "Enter email address"
|
|
7061
|
-
}
|
|
7062
|
-
),
|
|
7063
|
-
/* @__PURE__ */ jsx(
|
|
7064
|
-
EnhancedInput,
|
|
7065
|
-
{
|
|
7066
|
-
label: "Phone Number",
|
|
7067
|
-
type: "tel",
|
|
7068
|
-
value: value.phone,
|
|
7069
|
-
onChange: (e) => handleInputChange("phone", e.target.value),
|
|
7070
|
-
placeholder: "Enter phone number"
|
|
7071
|
-
}
|
|
7072
|
-
),
|
|
7073
|
-
/* @__PURE__ */ jsx(
|
|
7074
|
-
EnhancedInput,
|
|
7075
|
-
{
|
|
7076
|
-
label: "Date of Birth",
|
|
7077
|
-
type: "date",
|
|
7078
|
-
value: value.dateOfBirth,
|
|
7079
|
-
onChange: (e) => handleInputChange("dateOfBirth", e.target.value),
|
|
7080
|
-
placeholder: "Select date of birth"
|
|
7081
|
-
}
|
|
7082
|
-
),
|
|
7083
|
-
/* @__PURE__ */ jsx(
|
|
7084
|
-
EnhancedInput,
|
|
7085
|
-
{
|
|
7086
|
-
label: "ID Number",
|
|
7087
|
-
value: value.idNumber,
|
|
7088
|
-
onChange: (e) => handleInputChange("idNumber", e.target.value),
|
|
7089
|
-
placeholder: "Enter ID number"
|
|
7090
|
-
}
|
|
7091
|
-
)
|
|
7092
|
-
] })
|
|
7093
|
-
] });
|
|
7292
|
+
] }),
|
|
7293
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
7294
|
+
/* @__PURE__ */ jsx(InfoField, { label: "Email", value: "", layout: "horizontal" }),
|
|
7295
|
+
/* @__PURE__ */ jsx(InfoField, { label: "Phone Number", value: "", layout: "horizontal" })
|
|
7296
|
+
] }),
|
|
7297
|
+
/* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Mailing Address" }),
|
|
7298
|
+
isEditing ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7299
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3", children: [
|
|
7300
|
+
/* @__PURE__ */ jsx(InfoField, { label: "Street Address", value: "", layout: "horizontal" }),
|
|
7301
|
+
/* @__PURE__ */ jsx(InfoField, { label: "Apartment, suite, or floor", value: "", layout: "horizontal" })
|
|
7302
|
+
] }),
|
|
7303
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
7304
|
+
/* @__PURE__ */ jsx(InfoField, { label: "City", value: "", layout: "horizontal" }),
|
|
7305
|
+
/* @__PURE__ */ jsx(InfoField, { label: "State", value: "Alabama", layout: "horizontal" })
|
|
7306
|
+
] }),
|
|
7307
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
7308
|
+
/* @__PURE__ */ jsx(InfoField, { label: "Postal Code", value: "", layout: "horizontal" }),
|
|
7309
|
+
/* @__PURE__ */ jsx(InfoField, { label: "Country Code", value: "US", layout: "horizontal" })
|
|
7310
|
+
] })
|
|
7311
|
+
] }) : /* @__PURE__ */ jsx(
|
|
7312
|
+
InfoField,
|
|
7313
|
+
{
|
|
7314
|
+
label: "Address",
|
|
7315
|
+
value: "123 Business Avenue, Suite 100, New York, NY 10001, US",
|
|
7316
|
+
layout: "horizontal"
|
|
7317
|
+
}
|
|
7318
|
+
)
|
|
7319
|
+
] })
|
|
7320
|
+
}
|
|
7321
|
+
);
|
|
7094
7322
|
};
|
|
7095
7323
|
var IntermediaryFI = () => {
|
|
7096
7324
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
@@ -7304,184 +7532,6 @@ var OriginatorCard = ({ isEditing, onToggleEdit, className, hideActions }) => {
|
|
|
7304
7532
|
}
|
|
7305
7533
|
);
|
|
7306
7534
|
};
|
|
7307
|
-
var SimpleACHForm = () => {
|
|
7308
|
-
return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
7309
|
-
/* @__PURE__ */ jsx(
|
|
7310
|
-
EnhancedInput,
|
|
7311
|
-
{
|
|
7312
|
-
label: "Routing Number",
|
|
7313
|
-
placeholder: "Enter 9-digit routing number",
|
|
7314
|
-
pattern: "[0-9]{9}",
|
|
7315
|
-
maxLength: 9,
|
|
7316
|
-
hint: "9-digit routing number",
|
|
7317
|
-
required: true
|
|
7318
|
-
}
|
|
7319
|
-
),
|
|
7320
|
-
/* @__PURE__ */ jsx(
|
|
7321
|
-
EnhancedInput,
|
|
7322
|
-
{
|
|
7323
|
-
label: "Account Number",
|
|
7324
|
-
placeholder: "Enter account number",
|
|
7325
|
-
required: true
|
|
7326
|
-
}
|
|
7327
|
-
),
|
|
7328
|
-
/* @__PURE__ */ jsx(
|
|
7329
|
-
EnhancedSelect,
|
|
7330
|
-
{
|
|
7331
|
-
label: "Account Type",
|
|
7332
|
-
placeholder: "Select account type",
|
|
7333
|
-
options: [
|
|
7334
|
-
{ value: "checking", label: "Checking" },
|
|
7335
|
-
{ value: "savings", label: "Savings" }
|
|
7336
|
-
]
|
|
7337
|
-
}
|
|
7338
|
-
)
|
|
7339
|
-
] });
|
|
7340
|
-
};
|
|
7341
|
-
var SimpleWireForm = () => {
|
|
7342
|
-
const [wireType, setWireType] = useState("domestic");
|
|
7343
|
-
return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
7344
|
-
/* @__PURE__ */ jsx(
|
|
7345
|
-
EnhancedSelect,
|
|
7346
|
-
{
|
|
7347
|
-
label: "Wire Type",
|
|
7348
|
-
placeholder: "Select wire type",
|
|
7349
|
-
value: wireType,
|
|
7350
|
-
onValueChange: setWireType,
|
|
7351
|
-
options: [
|
|
7352
|
-
{ value: "domestic", label: "Domestic" },
|
|
7353
|
-
{ value: "international", label: "International" }
|
|
7354
|
-
]
|
|
7355
|
-
}
|
|
7356
|
-
),
|
|
7357
|
-
wireType === "domestic" ? /* @__PURE__ */ jsx(
|
|
7358
|
-
EnhancedInput,
|
|
7359
|
-
{
|
|
7360
|
-
label: "Routing Number",
|
|
7361
|
-
placeholder: "Enter 9-digit routing number",
|
|
7362
|
-
pattern: "[0-9]{9}",
|
|
7363
|
-
maxLength: 9,
|
|
7364
|
-
hint: "9-digit routing number",
|
|
7365
|
-
required: true
|
|
7366
|
-
}
|
|
7367
|
-
) : /* @__PURE__ */ jsx(
|
|
7368
|
-
EnhancedInput,
|
|
7369
|
-
{
|
|
7370
|
-
label: "BIC Number",
|
|
7371
|
-
placeholder: "Enter BIC/SWIFT code",
|
|
7372
|
-
hint: "Bank Identifier Code",
|
|
7373
|
-
required: true
|
|
7374
|
-
}
|
|
7375
|
-
),
|
|
7376
|
-
/* @__PURE__ */ jsx(
|
|
7377
|
-
EnhancedInput,
|
|
7378
|
-
{
|
|
7379
|
-
label: "Account Number",
|
|
7380
|
-
placeholder: "Enter account number",
|
|
7381
|
-
required: true
|
|
7382
|
-
}
|
|
7383
|
-
)
|
|
7384
|
-
] }) });
|
|
7385
|
-
};
|
|
7386
|
-
var PaymentInformationSection = ({ onPaymentMethodsChange } = {}) => {
|
|
7387
|
-
const [paymentMethods, setPaymentMethods] = useState([]);
|
|
7388
|
-
const [showAddMenu, setShowAddMenu] = useState(false);
|
|
7389
|
-
const addPaymentMethod = (type) => {
|
|
7390
|
-
const newMethod = {
|
|
7391
|
-
id: `${type}-${Date.now()}`,
|
|
7392
|
-
type,
|
|
7393
|
-
name: type === "ach" ? "ACH Payment" : "Wire Transfer",
|
|
7394
|
-
collapsed: false
|
|
7395
|
-
};
|
|
7396
|
-
const updatedMethods = [...paymentMethods, newMethod];
|
|
7397
|
-
setPaymentMethods(updatedMethods);
|
|
7398
|
-
onPaymentMethodsChange?.(updatedMethods);
|
|
7399
|
-
setShowAddMenu(false);
|
|
7400
|
-
};
|
|
7401
|
-
const removePaymentMethod = (id) => {
|
|
7402
|
-
const updatedMethods = paymentMethods.filter((method) => method.id !== id);
|
|
7403
|
-
setPaymentMethods(updatedMethods);
|
|
7404
|
-
onPaymentMethodsChange?.(updatedMethods);
|
|
7405
|
-
};
|
|
7406
|
-
const toggleCollapse = (id) => {
|
|
7407
|
-
setPaymentMethods(paymentMethods.map(
|
|
7408
|
-
(method) => method.id === id ? { ...method, collapsed: !method.collapsed } : method
|
|
7409
|
-
));
|
|
7410
|
-
};
|
|
7411
|
-
const renderPaymentMethodContent = (method) => {
|
|
7412
|
-
if (method.type === "ach") {
|
|
7413
|
-
return /* @__PURE__ */ jsx(SimpleACHForm, {});
|
|
7414
|
-
} else {
|
|
7415
|
-
return /* @__PURE__ */ jsx(SimpleWireForm, {});
|
|
7416
|
-
}
|
|
7417
|
-
};
|
|
7418
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
7419
|
-
paymentMethods.map((method) => /* @__PURE__ */ jsxs(Card, { className: "relative", children: [
|
|
7420
|
-
/* @__PURE__ */ jsx(CardHeader, { className: "pb-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
7421
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
7422
|
-
/* @__PURE__ */ jsx(
|
|
7423
|
-
Button,
|
|
7424
|
-
{
|
|
7425
|
-
variant: "ghost",
|
|
7426
|
-
size: "icon",
|
|
7427
|
-
onClick: () => toggleCollapse(method.id),
|
|
7428
|
-
className: "h-6 w-6",
|
|
7429
|
-
children: method.collapsed ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
7430
|
-
}
|
|
7431
|
-
),
|
|
7432
|
-
/* @__PURE__ */ jsx(CardTitle, { className: "text-base", children: method.name }),
|
|
7433
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs bg-muted px-2 py-1 rounded-md uppercase font-medium", children: method.type })
|
|
7434
|
-
] }),
|
|
7435
|
-
/* @__PURE__ */ jsx(
|
|
7436
|
-
Button,
|
|
7437
|
-
{
|
|
7438
|
-
variant: "ghost",
|
|
7439
|
-
size: "icon",
|
|
7440
|
-
onClick: () => removePaymentMethod(method.id),
|
|
7441
|
-
className: "h-6 w-6 text-destructive hover:text-destructive/80 hover:bg-destructive/10",
|
|
7442
|
-
children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
|
|
7443
|
-
}
|
|
7444
|
-
)
|
|
7445
|
-
] }) }),
|
|
7446
|
-
!method.collapsed && /* @__PURE__ */ jsx(CardContent, { children: renderPaymentMethodContent(method) })
|
|
7447
|
-
] }, method.id)),
|
|
7448
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
7449
|
-
paymentMethods.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-2", children: "At least one payment method is required *" }),
|
|
7450
|
-
/* @__PURE__ */ jsxs(
|
|
7451
|
-
Button,
|
|
7452
|
-
{
|
|
7453
|
-
variant: "outline",
|
|
7454
|
-
onClick: () => setShowAddMenu(!showAddMenu),
|
|
7455
|
-
className: "w-full border-dashed",
|
|
7456
|
-
children: [
|
|
7457
|
-
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2" }),
|
|
7458
|
-
"Add Payment Information"
|
|
7459
|
-
]
|
|
7460
|
-
}
|
|
7461
|
-
),
|
|
7462
|
-
showAddMenu && /* @__PURE__ */ jsx("div", { className: "absolute top-full left-0 right-0 mt-2 bg-background border border-border rounded-md shadow-lg z-10", children: /* @__PURE__ */ jsxs("div", { className: "p-2 space-y-1", children: [
|
|
7463
|
-
/* @__PURE__ */ jsx(
|
|
7464
|
-
Button,
|
|
7465
|
-
{
|
|
7466
|
-
variant: "ghost",
|
|
7467
|
-
onClick: () => addPaymentMethod("ach"),
|
|
7468
|
-
className: "w-full justify-start",
|
|
7469
|
-
children: "Add ACH Payment"
|
|
7470
|
-
}
|
|
7471
|
-
),
|
|
7472
|
-
/* @__PURE__ */ jsx(
|
|
7473
|
-
Button,
|
|
7474
|
-
{
|
|
7475
|
-
variant: "ghost",
|
|
7476
|
-
onClick: () => addPaymentMethod("wire"),
|
|
7477
|
-
className: "w-full justify-start",
|
|
7478
|
-
children: "Add Wire Transfer"
|
|
7479
|
-
}
|
|
7480
|
-
)
|
|
7481
|
-
] }) })
|
|
7482
|
-
] })
|
|
7483
|
-
] });
|
|
7484
|
-
};
|
|
7485
7535
|
var receiverSchema = z.object({
|
|
7486
7536
|
routingNumber: z.string().min(9, "Routing number must be 9 digits").max(9, "Routing number must be 9 digits"),
|
|
7487
7537
|
bankShortName: z.string().min(1, "Bank short name is required")
|
|
@@ -11670,54 +11720,6 @@ var CounterpartyDetail = () => {
|
|
|
11670
11720
|
);
|
|
11671
11721
|
};
|
|
11672
11722
|
var CounterpartyDetail_default = CounterpartyDetail;
|
|
11673
|
-
var CreateCounterpartyView = ({
|
|
11674
|
-
counterpartyData,
|
|
11675
|
-
paymentMethods,
|
|
11676
|
-
onPaymentMethodsChange,
|
|
11677
|
-
onBasicInfoChange,
|
|
11678
|
-
onCancel,
|
|
11679
|
-
onSubmit
|
|
11680
|
-
}) => {
|
|
11681
|
-
return /* @__PURE__ */ jsx(
|
|
11682
|
-
PageLayout,
|
|
11683
|
-
{
|
|
11684
|
-
title: "Create Counterparty",
|
|
11685
|
-
description: "Create a new counterparty with all required information",
|
|
11686
|
-
actions: [
|
|
11687
|
-
{ label: "Cancel", variant: "outline", onClick: onCancel },
|
|
11688
|
-
{ label: "Create Counterparty", variant: "default", onClick: onSubmit }
|
|
11689
|
-
],
|
|
11690
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
11691
|
-
/* @__PURE__ */ jsxs(Card, { children: [
|
|
11692
|
-
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Basic Information" }) }),
|
|
11693
|
-
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(CounterpartyBasicInfo, { value: counterpartyData, onDataChange: onBasicInfoChange }) })
|
|
11694
|
-
] }),
|
|
11695
|
-
/* @__PURE__ */ jsxs(Card, { children: [
|
|
11696
|
-
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, { children: [
|
|
11697
|
-
"Address",
|
|
11698
|
-
paymentMethods.some((m) => m.type === "wire") && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
11699
|
-
] }) }),
|
|
11700
|
-
/* @__PURE__ */ jsxs(CardContent, { children: [
|
|
11701
|
-
paymentMethods.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4", children: "Optional for ACH payments, required for wire transfers" }),
|
|
11702
|
-
paymentMethods.some((m) => m.type === "wire") && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4", children: "Required because you have wire payment methods" }),
|
|
11703
|
-
/* @__PURE__ */ jsx(
|
|
11704
|
-
AddressForm,
|
|
11705
|
-
{
|
|
11706
|
-
title: "",
|
|
11707
|
-
description: "",
|
|
11708
|
-
showApartment: true
|
|
11709
|
-
}
|
|
11710
|
-
)
|
|
11711
|
-
] })
|
|
11712
|
-
] }),
|
|
11713
|
-
/* @__PURE__ */ jsxs(Card, { children: [
|
|
11714
|
-
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Payment Configuration" }) }),
|
|
11715
|
-
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(PaymentInformationSection, { onPaymentMethodsChange }) })
|
|
11716
|
-
] })
|
|
11717
|
-
] })
|
|
11718
|
-
}
|
|
11719
|
-
);
|
|
11720
|
-
};
|
|
11721
11723
|
var CreateCounterparty = () => {
|
|
11722
11724
|
const navigate = useNavigate();
|
|
11723
11725
|
const [counterpartyData, setCounterpartyData] = useState({
|
|
@@ -16346,6 +16348,6 @@ function ReconExceptions() {
|
|
|
16346
16348
|
] }) });
|
|
16347
16349
|
}
|
|
16348
16350
|
|
|
16349
|
-
export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail_default as AccountDetail, Accounts_default as Accounts, AddressForm, AlertDetail_default as AlertDetail, AlertDetailRouter, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts_default as Alerts, AppSidebar, Badge, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, BusinessDetail_default as BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses_default as Businesses, Button, CIPStatusBadge, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cases_default as Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties_default as Counterparties, CounterpartiesView, CounterpartyBasicInfo, CounterpartyDetail_default as CounterpartyDetail, CounterpartyDetailView, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, CreateBusinessView, Create_default2 as CreateCounterparty, Create_default3 as CreateIndividual, CreateVelocityLimit, Dashboard_default as Dashboard, DashboardDemo, DataGrid, DataTable, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail_default as IndividualDetail, Individuals_default as Individuals, InfoField, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound_default as NotFound, OFACAlertView, OriginatorCard, OriginatorFI, OriginatorFIAddress, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, ReconExceptions, ReconUpload, ResolveAlertDialog, ResponsiveGrid, ScrollArea, ScrollBar, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stack, Statement, StatementHeader, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail_default as TransactionDetail, TransactionHistory_default as TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, VelocityLimitDetail, VelocityLimits, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
|
|
16351
|
+
export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail_default as AccountDetail, Accounts_default as Accounts, AddressForm, AlertDetail_default as AlertDetail, AlertDetailRouter, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts_default as Alerts, AppSidebar, Badge, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, BusinessDetail_default as BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses_default as Businesses, Button, CIPStatusBadge, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cases_default as Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties_default as Counterparties, CounterpartiesView, CounterpartyBasicInfo, CounterpartyDetail_default as CounterpartyDetail, CounterpartyDetailView, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, CreateBusinessView, Create_default2 as CreateCounterparty, CreateCounterpartyView, Create_default3 as CreateIndividual, CreateVelocityLimit, Dashboard_default as Dashboard, DashboardDemo, DataGrid, DataTable, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail_default as IndividualDetail, Individuals_default as Individuals, InfoField, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound_default as NotFound, OFACAlertView, OriginatorCard, OriginatorFI, OriginatorFIAddress, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, ReconExceptions, ReconUpload, ResolveAlertDialog, ResponsiveGrid, ScrollArea, ScrollBar, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stack, Statement, StatementHeader, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail_default as TransactionDetail, TransactionHistory_default as TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, VelocityLimitDetail, VelocityLimits, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
|
|
16350
16352
|
//# sourceMappingURL=index.js.map
|
|
16351
16353
|
//# sourceMappingURL=index.js.map
|