braid-ui 1.0.35 → 1.0.37

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.d.cts CHANGED
@@ -358,6 +358,22 @@ interface CreateBusinessViewProps {
358
358
  }
359
359
  declare const CreateBusinessView: ({ form, businessType, onBusinessTypeChange, onSubmit, onCancel }: CreateBusinessViewProps) => react_jsx_runtime.JSX.Element;
360
360
 
361
+ interface CounterpartiesViewProps {
362
+ table: React.ReactNode;
363
+ filters: {
364
+ name: string;
365
+ type: string;
366
+ status: string;
367
+ createdDateStart?: Date;
368
+ createdDateEnd?: Date;
369
+ };
370
+ onFilterChange: (field: string, value: string | Date | undefined) => void;
371
+ onResetFilters: () => void;
372
+ onApplyFilters: () => void;
373
+ onCreateCounterparty: () => void;
374
+ }
375
+ declare const CounterpartiesView: ({ table, filters, onFilterChange, onResetFilters, onApplyFilters, onCreateCounterparty }: CounterpartiesViewProps) => react_jsx_runtime.JSX.Element;
376
+
361
377
  declare const achTransferSchema: z.ZodObject<{
362
378
  basicInfo: z.ZodObject<{
363
379
  counterpartyName: z.ZodString;
@@ -1657,4 +1673,4 @@ declare function generateStatementCSV(header: StatementHeader, transactions: Sta
1657
1673
  */
1658
1674
  declare function downloadCSV(content: string, filename: string): void;
1659
1675
 
1660
- export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail, Accounts, AddressForm, AlertDetail, AlertDetailRouter, type AlertDetailRouterProps, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts, AppSidebar, Badge, type BadgeProps, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, type BreadcrumbItem, BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses, Button, type ButtonProps, CIPStatusBadge, Calendar, type CalendarProps, Card, CardContent, type CardContentProps, CardDescription, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties, CounterpartyBasicInfo, CounterpartyDetail, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, type CounterpartyWithEntity, CreateBusiness, CreateBusinessView, CreateCounterparty, CreateIndividual, Dashboard, DashboardDemo, DataGrid, type DataGridItem, type DataGridSection, DataTable, type DataTableColumn, type DataTableProps, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, type FormCardProps, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail, Individuals, InfoField, type InputProps, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound, OFACAlertView, type OFACAlertViewProps, OriginatorCard, OriginatorFI, OriginatorFIAddress, type PageAction, type PageCard, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, 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, type StatementHeader, type StatementTransaction, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail, TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, type UseAlertDetailReturn, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
1676
+ export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail, Accounts, AddressForm, AlertDetail, AlertDetailRouter, type AlertDetailRouterProps, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts, AppSidebar, Badge, type BadgeProps, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, type BreadcrumbItem, BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses, Button, type ButtonProps, CIPStatusBadge, Calendar, type CalendarProps, Card, CardContent, type CardContentProps, CardDescription, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties, CounterpartiesView, CounterpartyBasicInfo, CounterpartyDetail, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, type CounterpartyWithEntity, CreateBusiness, CreateBusinessView, CreateCounterparty, CreateIndividual, Dashboard, DashboardDemo, DataGrid, type DataGridItem, type DataGridSection, DataTable, type DataTableColumn, type DataTableProps, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, type FormCardProps, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail, Individuals, InfoField, type InputProps, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound, OFACAlertView, type OFACAlertViewProps, OriginatorCard, OriginatorFI, OriginatorFIAddress, type PageAction, type PageCard, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, 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, type StatementHeader, type StatementTransaction, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail, TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, type UseAlertDetailReturn, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
package/dist/index.d.ts CHANGED
@@ -358,6 +358,22 @@ interface CreateBusinessViewProps {
358
358
  }
359
359
  declare const CreateBusinessView: ({ form, businessType, onBusinessTypeChange, onSubmit, onCancel }: CreateBusinessViewProps) => react_jsx_runtime.JSX.Element;
360
360
 
361
+ interface CounterpartiesViewProps {
362
+ table: React.ReactNode;
363
+ filters: {
364
+ name: string;
365
+ type: string;
366
+ status: string;
367
+ createdDateStart?: Date;
368
+ createdDateEnd?: Date;
369
+ };
370
+ onFilterChange: (field: string, value: string | Date | undefined) => void;
371
+ onResetFilters: () => void;
372
+ onApplyFilters: () => void;
373
+ onCreateCounterparty: () => void;
374
+ }
375
+ declare const CounterpartiesView: ({ table, filters, onFilterChange, onResetFilters, onApplyFilters, onCreateCounterparty }: CounterpartiesViewProps) => react_jsx_runtime.JSX.Element;
376
+
361
377
  declare const achTransferSchema: z.ZodObject<{
362
378
  basicInfo: z.ZodObject<{
363
379
  counterpartyName: z.ZodString;
@@ -1657,4 +1673,4 @@ declare function generateStatementCSV(header: StatementHeader, transactions: Sta
1657
1673
  */
1658
1674
  declare function downloadCSV(content: string, filename: string): void;
1659
1675
 
1660
- export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail, Accounts, AddressForm, AlertDetail, AlertDetailRouter, type AlertDetailRouterProps, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts, AppSidebar, Badge, type BadgeProps, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, type BreadcrumbItem, BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses, Button, type ButtonProps, CIPStatusBadge, Calendar, type CalendarProps, Card, CardContent, type CardContentProps, CardDescription, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties, CounterpartyBasicInfo, CounterpartyDetail, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, type CounterpartyWithEntity, CreateBusiness, CreateBusinessView, CreateCounterparty, CreateIndividual, Dashboard, DashboardDemo, DataGrid, type DataGridItem, type DataGridSection, DataTable, type DataTableColumn, type DataTableProps, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, type FormCardProps, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail, Individuals, InfoField, type InputProps, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound, OFACAlertView, type OFACAlertViewProps, OriginatorCard, OriginatorFI, OriginatorFIAddress, type PageAction, type PageCard, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, 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, type StatementHeader, type StatementTransaction, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail, TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, type UseAlertDetailReturn, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
1676
+ export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail, Accounts, AddressForm, AlertDetail, AlertDetailRouter, type AlertDetailRouterProps, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts, AppSidebar, Badge, type BadgeProps, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, type BreadcrumbItem, BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses, Button, type ButtonProps, CIPStatusBadge, Calendar, type CalendarProps, Card, CardContent, type CardContentProps, CardDescription, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties, CounterpartiesView, CounterpartyBasicInfo, CounterpartyDetail, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, type CounterpartyWithEntity, CreateBusiness, CreateBusinessView, CreateCounterparty, CreateIndividual, Dashboard, DashboardDemo, DataGrid, type DataGridItem, type DataGridSection, DataTable, type DataTableColumn, type DataTableProps, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, type FormCardProps, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail, Individuals, InfoField, type InputProps, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound, OFACAlertView, type OFACAlertViewProps, OriginatorCard, OriginatorFI, OriginatorFIAddress, type PageAction, type PageCard, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, 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, type StatementHeader, type StatementTransaction, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail, TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, type UseAlertDetailReturn, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
package/dist/index.js CHANGED
@@ -5223,6 +5223,104 @@ var CreateBusinessView = ({
5223
5223
  }
5224
5224
  );
5225
5225
  };
5226
+ var CounterpartiesView = ({
5227
+ table,
5228
+ filters,
5229
+ onFilterChange,
5230
+ onResetFilters,
5231
+ onApplyFilters,
5232
+ onCreateCounterparty
5233
+ }) => {
5234
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
5235
+ /* @__PURE__ */ jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
5236
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: "Counterparties" }) }),
5237
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
5238
+ /* @__PURE__ */ jsxs(Sheet, { children: [
5239
+ /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", className: "gap-2", children: [
5240
+ /* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" }),
5241
+ "Filters"
5242
+ ] }) }),
5243
+ /* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
5244
+ /* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Counterparty Filters" }) }),
5245
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6 py-6", children: [
5246
+ /* @__PURE__ */ jsx(
5247
+ EnhancedInput,
5248
+ {
5249
+ label: "Name",
5250
+ value: filters.name,
5251
+ onChange: (e) => onFilterChange("name", e.target.value),
5252
+ placeholder: "Enter counterparty name"
5253
+ }
5254
+ ),
5255
+ /* @__PURE__ */ jsx(
5256
+ EnhancedSelect,
5257
+ {
5258
+ label: "Type",
5259
+ value: filters.type,
5260
+ onValueChange: (value) => onFilterChange("type", value),
5261
+ placeholder: "Select type",
5262
+ options: [
5263
+ { value: "BUSINESS", label: "Business" },
5264
+ { value: "INDIVIDUAL", label: "Individual" }
5265
+ ]
5266
+ }
5267
+ ),
5268
+ /* @__PURE__ */ jsx(
5269
+ EnhancedSelect,
5270
+ {
5271
+ label: "Status",
5272
+ value: filters.status,
5273
+ onValueChange: (value) => onFilterChange("status", value),
5274
+ placeholder: "Select status",
5275
+ options: [
5276
+ { value: "ACTIVE", label: "Active" },
5277
+ { value: "INACTIVE", label: "Inactive" },
5278
+ { value: "PENDING", label: "Pending" },
5279
+ { value: "SUSPENDED", label: "Suspended" }
5280
+ ]
5281
+ }
5282
+ ),
5283
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5284
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5285
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
5286
+ /* @__PURE__ */ jsx(
5287
+ DatePicker,
5288
+ {
5289
+ date: filters.createdDateStart,
5290
+ onDateChange: (date) => onFilterChange("createdDateStart", date),
5291
+ placeholder: "MM/DD/YYYY",
5292
+ buttonClassName: "w-full",
5293
+ className: "bg-background z-50"
5294
+ }
5295
+ )
5296
+ ] }),
5297
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5298
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
5299
+ /* @__PURE__ */ jsx(
5300
+ DatePicker,
5301
+ {
5302
+ date: filters.createdDateEnd,
5303
+ onDateChange: (date) => onFilterChange("createdDateEnd", date),
5304
+ placeholder: "MM/DD/YYYY",
5305
+ buttonClassName: "w-full",
5306
+ className: "bg-background z-50"
5307
+ }
5308
+ )
5309
+ ] })
5310
+ ] })
5311
+ ] }),
5312
+ /* @__PURE__ */ jsxs(SheetFooter, { className: "gap-2", children: [
5313
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onResetFilters, children: "Reset Filters" }),
5314
+ /* @__PURE__ */ jsx(Button, { onClick: onApplyFilters, children: "Apply Filters" })
5315
+ ] })
5316
+ ] })
5317
+ ] }),
5318
+ /* @__PURE__ */ jsx(Button, { onClick: onCreateCounterparty, children: "Create Counterparty" })
5319
+ ] })
5320
+ ] }) }) }),
5321
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex-1 mt-4 overflow-auto", children: table }) }) })
5322
+ ] });
5323
+ };
5226
5324
 
5227
5325
  // src/lib/mock-data/banking-data.ts
5228
5326
  var defaultACHBankDetails = {
@@ -10631,11 +10729,23 @@ var mockCounterpartiesList = [
10631
10729
  modified: "2023-12-28"
10632
10730
  }
10633
10731
  ];
10732
+ var mockProducts3 = {
10733
+ "prod-001": "Business Banking Pro",
10734
+ "prod-002": "Premium Banking",
10735
+ "prod-003": "Business Banking Plus"
10736
+ };
10737
+ var mockBusinesses2 = {
10738
+ "bus-001": "Tech Solutions LLC",
10739
+ "bus-002": "Digital Ventures"
10740
+ };
10741
+ var mockIndividuals2 = {
10742
+ "ind-001": "Cloud Services Corp",
10743
+ "ind-002": "Wealth Management"
10744
+ };
10634
10745
  var Counterparties = () => {
10635
10746
  const navigate = useNavigate();
10636
10747
  const [searchParams] = useSearchParams();
10637
- const { counterparties: enrichedCounterparties, loading: loadingEntities } = useCounterpartyEntity(mockCounterpartiesList);
10638
- const [filteredCounterparties, setFilteredCounterparties] = useState([]);
10748
+ const [counterparties, setCounterparties] = useState([]);
10639
10749
  const [sortBy, setSortBy] = useState("created");
10640
10750
  const [sortDirection, setSortDirection] = useState("desc");
10641
10751
  const [filters, setFilters] = useState({
@@ -10645,43 +10755,78 @@ var Counterparties = () => {
10645
10755
  createdDateStart: void 0,
10646
10756
  createdDateEnd: void 0
10647
10757
  });
10648
- const handleFilterChange = (field, value) => {
10649
- setFilters((prev) => ({ ...prev, [field]: value }));
10650
- };
10651
- const applyFilters = () => {
10652
- let filtered = enrichedCounterparties;
10758
+ useEffect(() => {
10759
+ const enrichCounterparties = async () => {
10760
+ const enriched = await Promise.all(
10761
+ mockCounterpartiesList.map(async (counterparty) => {
10762
+ let associatedEntity = "";
10763
+ let entityType = null;
10764
+ if (counterparty.productId) {
10765
+ associatedEntity = mockProducts3[counterparty.productId] || counterparty.productId;
10766
+ entityType = "product";
10767
+ } else if (counterparty.businessId) {
10768
+ associatedEntity = mockBusinesses2[counterparty.businessId] || counterparty.businessId;
10769
+ entityType = "business";
10770
+ } else if (counterparty.individualId) {
10771
+ associatedEntity = mockIndividuals2[counterparty.individualId] || counterparty.individualId;
10772
+ entityType = "individual";
10773
+ } else if (counterparty.accountNumber) {
10774
+ associatedEntity = counterparty.accountNumber;
10775
+ entityType = "account";
10776
+ }
10777
+ return {
10778
+ ...counterparty,
10779
+ associatedEntity,
10780
+ entityType
10781
+ };
10782
+ })
10783
+ );
10784
+ setCounterparties(enriched);
10785
+ };
10786
+ enrichCounterparties();
10787
+ }, []);
10788
+ const filteredCounterparties = useMemo(() => {
10789
+ const customerId = searchParams.get("customerId");
10790
+ let filtered = counterparties;
10791
+ if (customerId) {
10792
+ filtered = filtered.filter((cp) => cp.customerId === customerId);
10793
+ }
10653
10794
  if (filters.name) {
10654
10795
  filtered = filtered.filter(
10655
- (counterparty) => counterparty.name.toLowerCase().includes(filters.name.toLowerCase())
10796
+ (cp) => cp.name.toLowerCase().includes(filters.name.toLowerCase())
10656
10797
  );
10657
10798
  }
10658
10799
  if (filters.type) {
10659
- filtered = filtered.filter((counterparty) => counterparty.type === filters.type);
10800
+ filtered = filtered.filter((cp) => cp.type === filters.type);
10660
10801
  }
10661
10802
  if (filters.status) {
10662
- filtered = filtered.filter((counterparty) => counterparty.status === filters.status);
10803
+ filtered = filtered.filter((cp) => cp.status === filters.status);
10663
10804
  }
10664
10805
  if (filters.createdDateStart) {
10665
10806
  filtered = filtered.filter(
10666
- (counterparty) => new Date(counterparty.created) >= filters.createdDateStart
10807
+ (cp) => new Date(cp.created) >= filters.createdDateStart
10667
10808
  );
10668
10809
  }
10669
10810
  if (filters.createdDateEnd) {
10670
10811
  filtered = filtered.filter(
10671
- (counterparty) => new Date(counterparty.created) <= filters.createdDateEnd
10812
+ (cp) => new Date(cp.created) <= filters.createdDateEnd
10672
10813
  );
10673
10814
  }
10674
- setFilteredCounterparties(filtered);
10675
- };
10676
- useEffect(() => {
10677
- const customerId = searchParams.get("customerId");
10678
- let filtered = enrichedCounterparties;
10679
- if (customerId) {
10680
- filtered = filtered.filter((cp) => cp.customerId === customerId);
10681
- }
10682
- setFilteredCounterparties(filtered);
10683
- }, [enrichedCounterparties, searchParams]);
10684
- const resetFilters = () => {
10815
+ return filtered;
10816
+ }, [counterparties, filters, searchParams]);
10817
+ const sortedCounterparties = useMemo(() => {
10818
+ return [...filteredCounterparties].sort((a, b) => {
10819
+ const aValue = a[sortBy];
10820
+ const bValue = b[sortBy];
10821
+ if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
10822
+ if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
10823
+ return 0;
10824
+ });
10825
+ }, [filteredCounterparties, sortBy, sortDirection]);
10826
+ const handleFilterChange = useCallback((field, value) => {
10827
+ setFilters((prev) => ({ ...prev, [field]: value }));
10828
+ }, []);
10829
+ const handleResetFilters = useCallback(() => {
10685
10830
  setFilters({
10686
10831
  name: "",
10687
10832
  type: "",
@@ -10689,19 +10834,23 @@ var Counterparties = () => {
10689
10834
  createdDateStart: void 0,
10690
10835
  createdDateEnd: void 0
10691
10836
  });
10692
- setFilteredCounterparties(enrichedCounterparties);
10693
- };
10694
- const handleSort = (key) => {
10837
+ }, []);
10838
+ const handleApplyFilters = useCallback(() => {
10839
+ }, []);
10840
+ const handleSort = useCallback((key) => {
10695
10841
  if (sortBy === key) {
10696
- setSortDirection(sortDirection === "asc" ? "desc" : "asc");
10842
+ setSortDirection((prev) => prev === "asc" ? "desc" : "asc");
10697
10843
  } else {
10698
10844
  setSortBy(key);
10699
10845
  setSortDirection("asc");
10700
10846
  }
10701
- };
10702
- const handleRowClick = (counterparty) => {
10847
+ }, [sortBy]);
10848
+ const handleRowClick = useCallback((counterparty) => {
10703
10849
  navigate(`/counterparty/${counterparty.id}`);
10704
- };
10850
+ }, [navigate]);
10851
+ const handleCreateCounterparty = useCallback(() => {
10852
+ navigate("/counterparty/create");
10853
+ }, [navigate]);
10705
10854
  const columns3 = [
10706
10855
  {
10707
10856
  key: "name",
@@ -10754,112 +10903,28 @@ var Counterparties = () => {
10754
10903
  sortable: true
10755
10904
  }
10756
10905
  ];
10757
- const sortedCounterparties = [...filteredCounterparties].sort((a, b) => {
10758
- const aValue = a[sortBy];
10759
- const bValue = b[sortBy];
10760
- if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
10761
- if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
10762
- return 0;
10763
- });
10764
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
10765
- /* @__PURE__ */ jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
10766
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: "Counterparties" }) }),
10767
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
10768
- /* @__PURE__ */ jsxs(Sheet, { children: [
10769
- /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", className: "gap-2", children: [
10770
- /* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" }),
10771
- "Filters"
10772
- ] }) }),
10773
- /* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
10774
- /* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Counterparty Filters" }) }),
10775
- /* @__PURE__ */ jsxs("div", { className: "space-y-6 py-6", children: [
10776
- /* @__PURE__ */ jsx(
10777
- EnhancedInput,
10778
- {
10779
- label: "Name",
10780
- value: filters.name,
10781
- onChange: (e) => handleFilterChange("name", e.target.value),
10782
- placeholder: "Enter counterparty name"
10783
- }
10784
- ),
10785
- /* @__PURE__ */ jsx(
10786
- EnhancedSelect,
10787
- {
10788
- label: "Type",
10789
- value: filters.type,
10790
- onValueChange: (value) => handleFilterChange("type", value),
10791
- placeholder: "Select type",
10792
- options: [
10793
- { value: "BUSINESS", label: "Business" },
10794
- { value: "INDIVIDUAL", label: "Individual" }
10795
- ]
10796
- }
10797
- ),
10798
- /* @__PURE__ */ jsx(
10799
- EnhancedSelect,
10800
- {
10801
- label: "Status",
10802
- value: filters.status,
10803
- onValueChange: (value) => handleFilterChange("status", value),
10804
- placeholder: "Select status",
10805
- options: [
10806
- { value: "ACTIVE", label: "Active" },
10807
- { value: "INACTIVE", label: "Inactive" },
10808
- { value: "PENDING", label: "Pending" },
10809
- { value: "SUSPENDED", label: "Suspended" }
10810
- ]
10811
- }
10812
- ),
10813
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10814
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
10815
- /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
10816
- /* @__PURE__ */ jsx(
10817
- DatePicker,
10818
- {
10819
- date: filters.createdDateStart,
10820
- onDateChange: (date) => handleFilterChange("createdDateStart", date),
10821
- placeholder: "MM/DD/YYYY",
10822
- buttonClassName: "w-full",
10823
- className: "bg-background z-50"
10824
- }
10825
- )
10826
- ] }),
10827
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
10828
- /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
10829
- /* @__PURE__ */ jsx(
10830
- DatePicker,
10831
- {
10832
- date: filters.createdDateEnd,
10833
- onDateChange: (date) => handleFilterChange("createdDateEnd", date),
10834
- placeholder: "MM/DD/YYYY",
10835
- buttonClassName: "w-full",
10836
- className: "bg-background z-50"
10837
- }
10838
- )
10839
- ] })
10840
- ] })
10841
- ] }),
10842
- /* @__PURE__ */ jsxs(SheetFooter, { className: "gap-2", children: [
10843
- /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: resetFilters, children: "Reset Filters" }),
10844
- /* @__PURE__ */ jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
10845
- ] })
10846
- ] })
10847
- ] }),
10848
- /* @__PURE__ */ jsx(Button, { onClick: () => navigate("/counterparty/create"), children: "Create Counterparty" })
10849
- ] })
10850
- ] }) }) }),
10851
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsx(
10852
- DataTable,
10853
- {
10854
- columns: columns3,
10855
- data: sortedCounterparties,
10856
- sortBy,
10857
- sortDirection,
10858
- onSort: handleSort,
10859
- onRowClick: handleRowClick
10860
- }
10861
- ) }) }) })
10862
- ] });
10906
+ const table = useMemo(() => /* @__PURE__ */ jsx(
10907
+ DataTable,
10908
+ {
10909
+ columns: columns3,
10910
+ data: sortedCounterparties,
10911
+ sortBy,
10912
+ sortDirection,
10913
+ onSort: handleSort,
10914
+ onRowClick: handleRowClick
10915
+ }
10916
+ ), [columns3, sortedCounterparties, sortBy, sortDirection, handleSort, handleRowClick]);
10917
+ return /* @__PURE__ */ jsx(
10918
+ CounterpartiesView,
10919
+ {
10920
+ table,
10921
+ filters,
10922
+ onFilterChange: handleFilterChange,
10923
+ onResetFilters: handleResetFilters,
10924
+ onApplyFilters: handleApplyFilters,
10925
+ onCreateCounterparty: handleCreateCounterparty
10926
+ }
10927
+ );
10863
10928
  };
10864
10929
  var Counterparties_default = Counterparties;
10865
10930
  var mockCounterpartyTimeline = [
@@ -13912,6 +13977,6 @@ function UIKit() {
13912
13977
  ] }) }) });
13913
13978
  }
13914
13979
 
13915
- 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, CounterpartyBasicInfo, CounterpartyDetail_default as CounterpartyDetail, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, CreateBusinessView, Create_default2 as CreateCounterparty, Create_default3 as CreateIndividual, 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, 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, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
13980
+ 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, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, CreateBusinessView, Create_default2 as CreateCounterparty, Create_default3 as CreateIndividual, 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, 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, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
13916
13981
  //# sourceMappingURL=index.js.map
13917
13982
  //# sourceMappingURL=index.js.map