braid-ui 1.0.22 → 1.0.24

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
@@ -18,10 +18,10 @@ var zod = require('zod');
18
18
  var reactCollapsible = require('@radix-ui/react-collapsible');
19
19
  var SeparatorPrimitive = require('@radix-ui/react-separator');
20
20
  var TooltipPrimitive = require('@radix-ui/react-tooltip');
21
- var LabelPrimitive = require('@radix-ui/react-label');
22
21
  var dateFns = require('date-fns');
23
22
  var reactDayPicker = require('react-day-picker');
24
23
  var PopoverPrimitive = require('@radix-ui/react-popover');
24
+ var LabelPrimitive = require('@radix-ui/react-label');
25
25
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
26
26
  var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
27
27
  var nextThemes = require('next-themes');
@@ -53,8 +53,8 @@ var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPr
53
53
  var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
54
54
  var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
55
55
  var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
56
- var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
57
56
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
57
+ var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
58
58
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
59
59
  var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
60
60
  var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
@@ -3097,86 +3097,710 @@ function AppSidebar() {
3097
3097
  var MainLayout = ({ children }) => {
3098
3098
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-screen w-full", children: /* @__PURE__ */ jsxRuntime.jsx("main", { className: "flex-1", children }) });
3099
3099
  };
3100
- var useEditState = ({ initialEditing = false, onToggleEdit, onSave, onCancel }) => {
3101
- const [localEditing, setLocalEditing] = React15.useState(initialEditing);
3102
- const [isLoading, setIsLoading] = React15.useState(false);
3103
- React15.useEffect(() => {
3104
- setLocalEditing(initialEditing);
3105
- }, [initialEditing]);
3106
- const isEditing = onToggleEdit !== void 0 ? initialEditing : localEditing;
3107
- const handleToggleEdit = React15.useCallback(() => {
3108
- if (onToggleEdit) {
3109
- onToggleEdit();
3110
- } else {
3111
- setLocalEditing((prev) => !prev);
3100
+ function Calendar({
3101
+ className,
3102
+ classNames,
3103
+ showOutsideDays = true,
3104
+ ...props
3105
+ }) {
3106
+ return /* @__PURE__ */ jsxRuntime.jsx(
3107
+ reactDayPicker.DayPicker,
3108
+ {
3109
+ showOutsideDays,
3110
+ className: cn("p-3 pointer-events-auto", className),
3111
+ classNames: {
3112
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
3113
+ month: "space-y-4",
3114
+ caption: "flex justify-center pt-1 relative items-center",
3115
+ caption_label: "text-sm font-medium",
3116
+ nav: "space-x-1 flex items-center",
3117
+ button_previous: "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
3118
+ button_next: "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
3119
+ month_grid: "w-full border-collapse space-y-1",
3120
+ weekdays: "flex",
3121
+ weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
3122
+ week: "flex w-full mt-2",
3123
+ day: "h-9 w-9 text-center text-sm p-0 relative hover:bg-accent hover:text-accent-foreground rounded-md",
3124
+ day_button: cn(
3125
+ buttonVariants({ variant: "ghost" }),
3126
+ "h-9 w-9 p-0 font-normal"
3127
+ ),
3128
+ selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
3129
+ today: "bg-accent text-accent-foreground",
3130
+ outside: "text-muted-foreground opacity-50",
3131
+ disabled: "text-muted-foreground opacity-50",
3132
+ hidden: "invisible",
3133
+ ...classNames
3134
+ },
3135
+ ...props
3112
3136
  }
3113
- }, [onToggleEdit]);
3114
- const handleSave = React15.useCallback(async () => {
3115
- setIsLoading(true);
3116
- try {
3117
- if (onSave) {
3118
- await onSave();
3137
+ );
3138
+ }
3139
+ Calendar.displayName = "Calendar";
3140
+ var Popover = PopoverPrimitive__namespace.Root;
3141
+ var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
3142
+ var PopoverContent = React15__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
3143
+ PopoverPrimitive__namespace.Content,
3144
+ {
3145
+ ref,
3146
+ align,
3147
+ sideOffset,
3148
+ className: cn(
3149
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
3150
+ className
3151
+ ),
3152
+ ...props
3153
+ }
3154
+ ) }));
3155
+ PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
3156
+ function DatePicker({
3157
+ date,
3158
+ onDateChange,
3159
+ placeholder = "Pick a date",
3160
+ disabled = false,
3161
+ className,
3162
+ buttonClassName,
3163
+ calendarClassName,
3164
+ align = "start",
3165
+ disabledDates,
3166
+ label,
3167
+ wrapperClassName
3168
+ }) {
3169
+ const [open, setOpen] = React15__namespace.useState(false);
3170
+ const handleSelect = (selectedDate) => {
3171
+ onDateChange?.(selectedDate);
3172
+ setOpen(false);
3173
+ };
3174
+ const picker = /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
3175
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
3176
+ Button,
3177
+ {
3178
+ variant: "outline",
3179
+ disabled,
3180
+ className: cn(
3181
+ "justify-start text-left font-normal",
3182
+ !date && "text-muted-foreground",
3183
+ buttonClassName
3184
+ ),
3185
+ children: [
3186
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "mr-2 h-4 w-4" }),
3187
+ date ? dateFns.format(date, "MM/dd/yyyy") : placeholder
3188
+ ]
3119
3189
  }
3120
- if (onToggleEdit) {
3121
- onToggleEdit();
3122
- } else {
3123
- setLocalEditing(false);
3190
+ ) }),
3191
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: cn("w-auto p-0", className), align, children: /* @__PURE__ */ jsxRuntime.jsx(
3192
+ Calendar,
3193
+ {
3194
+ mode: "single",
3195
+ selected: date,
3196
+ onSelect: handleSelect,
3197
+ disabled: disabledDates,
3198
+ initialFocus: true,
3199
+ className: cn("pointer-events-auto", calendarClassName)
3124
3200
  }
3125
- } catch (error) {
3126
- console.error("Save error:", error);
3127
- } finally {
3128
- setIsLoading(false);
3129
- }
3130
- }, [onSave, onToggleEdit]);
3131
- const handleCancel = React15.useCallback(() => {
3132
- if (onCancel) {
3133
- onCancel();
3134
- }
3135
- if (onToggleEdit) {
3136
- onToggleEdit();
3137
- } else {
3138
- setLocalEditing(false);
3139
- }
3140
- }, [onCancel, onToggleEdit]);
3141
- return {
3142
- isEditing,
3143
- isLoading,
3144
- handleToggleEdit,
3145
- handleSave,
3146
- handleCancel
3201
+ ) })
3202
+ ] });
3203
+ if (label) {
3204
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-2", wrapperClassName), children: [
3205
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label }),
3206
+ picker
3207
+ ] });
3208
+ }
3209
+ return picker;
3210
+ }
3211
+ var BusinessFiltersSheet = ({
3212
+ filters,
3213
+ onFilterChange,
3214
+ onResetFilters
3215
+ }) => {
3216
+ return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
3217
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
3218
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
3219
+ "Filters"
3220
+ ] }) }),
3221
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
3222
+ /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Business Filters" }) }),
3223
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
3224
+ /* @__PURE__ */ jsxRuntime.jsx(
3225
+ EnhancedInput,
3226
+ {
3227
+ label: "Name",
3228
+ value: filters.name,
3229
+ onChange: (e) => onFilterChange("name", e.target.value),
3230
+ placeholder: "Enter business name"
3231
+ }
3232
+ ),
3233
+ /* @__PURE__ */ jsxRuntime.jsx(
3234
+ EnhancedInput,
3235
+ {
3236
+ label: "Product Name",
3237
+ value: filters.productName,
3238
+ onChange: (e) => onFilterChange("productName", e.target.value),
3239
+ placeholder: "Enter product name"
3240
+ }
3241
+ ),
3242
+ /* @__PURE__ */ jsxRuntime.jsx(
3243
+ EnhancedSelect,
3244
+ {
3245
+ label: "Status",
3246
+ value: filters.status,
3247
+ onValueChange: (value) => onFilterChange("status", value),
3248
+ placeholder: "Select status",
3249
+ options: [
3250
+ { value: "active", label: "Active" },
3251
+ { value: "inactive", label: "Inactive" },
3252
+ { value: "suspended", label: "Suspended" }
3253
+ ]
3254
+ }
3255
+ ),
3256
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3257
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
3258
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
3259
+ /* @__PURE__ */ jsxRuntime.jsx(
3260
+ DatePicker,
3261
+ {
3262
+ date: filters.createdDateStart,
3263
+ onDateChange: (date) => onFilterChange("createdDateStart", date),
3264
+ placeholder: "MM/DD/YYYY",
3265
+ buttonClassName: "w-full",
3266
+ className: "bg-background z-50"
3267
+ }
3268
+ )
3269
+ ] }),
3270
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
3271
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
3272
+ /* @__PURE__ */ jsxRuntime.jsx(
3273
+ DatePicker,
3274
+ {
3275
+ date: filters.createdDateEnd,
3276
+ onDateChange: (date) => onFilterChange("createdDateEnd", date),
3277
+ placeholder: "MM/DD/YYYY",
3278
+ buttonClassName: "w-full",
3279
+ className: "bg-background z-50"
3280
+ }
3281
+ )
3282
+ ] })
3283
+ ] })
3284
+ ] }),
3285
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
3286
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: onResetFilters, children: "Reset Filters" }),
3287
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: () => {
3288
+ }, children: "Apply Filters" })
3289
+ ] })
3290
+ ] })
3291
+ ] });
3292
+ };
3293
+ var maxWidthClasses = {
3294
+ sm: "max-w-2xl",
3295
+ md: "max-w-4xl",
3296
+ lg: "max-w-6xl",
3297
+ xl: "max-w-7xl",
3298
+ "2xl": "max-w-screen-2xl",
3299
+ full: "max-w-none"
3300
+ };
3301
+ var getGridClasses = (gridCols, responsive) => {
3302
+ const colsMap = {
3303
+ 1: "grid-cols-1",
3304
+ 2: "grid-cols-2",
3305
+ 3: "grid-cols-3",
3306
+ 4: "grid-cols-4"
3147
3307
  };
3308
+ if (!responsive) {
3309
+ return colsMap[gridCols] || "grid-cols-1";
3310
+ }
3311
+ switch (gridCols) {
3312
+ case 1:
3313
+ return "grid-cols-1";
3314
+ case 2:
3315
+ return "grid-cols-1 lg:grid-cols-2";
3316
+ case 3:
3317
+ return "grid-cols-1 md:grid-cols-2 lg:grid-cols-3";
3318
+ case 4:
3319
+ return "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4";
3320
+ default:
3321
+ return "grid-cols-1 lg:grid-cols-2";
3322
+ }
3148
3323
  };
3149
- var EditableFormCard = React15__namespace.forwardRef(
3324
+ var PageLayout = React15__namespace.forwardRef(
3150
3325
  ({
3151
3326
  title,
3152
3327
  description,
3153
- editContent,
3154
- viewContent,
3155
- isEditing,
3156
- onToggleEdit,
3157
- hideActions = false,
3158
- onSave,
3159
- onCancel,
3328
+ children,
3329
+ actions = [],
3330
+ cards = [],
3331
+ mode = "simple",
3332
+ maxWidth = "xl",
3333
+ gridCols = 2,
3334
+ responsive = true,
3160
3335
  className,
3161
- variant = "subtle",
3162
- isFormValid = true,
3163
- isDirty = false,
3164
- isSubmitting = false,
3165
- ...props
3336
+ headerContent
3166
3337
  }, ref) => {
3167
- const { isEditing: currentlyEditing, handleToggleEdit, handleCancel } = useEditState({
3168
- initialEditing: isEditing ?? false,
3169
- onToggleEdit
3170
- });
3171
- const handleSaveAction = async () => {
3172
- if (onSave) {
3173
- await onSave();
3174
- }
3175
- };
3176
- const handleCancelAction = () => {
3177
- if (onCancel) {
3178
- onCancel();
3179
- } else {
3338
+ const [editingCards, setEditingCards] = React15__namespace.useState(/* @__PURE__ */ new Set());
3339
+ const toggleEdit = (cardKey) => {
3340
+ setEditingCards((prev) => {
3341
+ const next = new Set(prev);
3342
+ if (next.has(cardKey)) {
3343
+ next.delete(cardKey);
3344
+ } else {
3345
+ next.add(cardKey);
3346
+ }
3347
+ return next;
3348
+ });
3349
+ };
3350
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: "flex flex-col h-screen bg-gradient-subtle", children: [
3351
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
3352
+ "container mx-auto px-4 py-6",
3353
+ maxWidthClasses[maxWidth]
3354
+ ), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
3355
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-h-[2.5rem]", children: [
3356
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: title }),
3357
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: description })
3358
+ ] }),
3359
+ headerContent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: headerContent }),
3360
+ actions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: actions.map((action, index) => {
3361
+ const Icon2 = action.icon;
3362
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3363
+ "button",
3364
+ {
3365
+ onClick: action.onClick,
3366
+ className: cn(
3367
+ "inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors",
3368
+ {
3369
+ "bg-primary text-primary-foreground hover:bg-primary/90": action.variant === "default" || !action.variant,
3370
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80": action.variant === "secondary",
3371
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90": action.variant === "destructive",
3372
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground": action.variant === "outline",
3373
+ "hover:bg-accent hover:text-accent-foreground": action.variant === "ghost"
3374
+ }
3375
+ ),
3376
+ children: [
3377
+ Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4" }),
3378
+ action.label
3379
+ ]
3380
+ },
3381
+ index
3382
+ );
3383
+ }) })
3384
+ ] }) }) }),
3385
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
3386
+ "container mx-auto px-4 py-6",
3387
+ maxWidthClasses[maxWidth],
3388
+ className
3389
+ ), children: mode === "cards" && cards.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("grid gap-6", getGridClasses(gridCols, responsive)), children: cards.map((card) => {
3390
+ const isEditing = editingCards.has(card.key);
3391
+ const shouldExpand = card.expandOnEdit && isEditing;
3392
+ return /* @__PURE__ */ jsxRuntime.jsx(
3393
+ "div",
3394
+ {
3395
+ className: cn(
3396
+ "transition-all duration-300",
3397
+ shouldExpand && (gridCols > 1 ? "col-span-full" : "")
3398
+ ),
3399
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3400
+ card.component,
3401
+ {
3402
+ ...card.props,
3403
+ isEditing,
3404
+ onToggleEdit: () => toggleEdit(card.key)
3405
+ }
3406
+ )
3407
+ },
3408
+ card.key
3409
+ );
3410
+ }) }) : children }) })
3411
+ ] });
3412
+ }
3413
+ );
3414
+ PageLayout.displayName = "PageLayout";
3415
+ var typeConfig = {
3416
+ corporation: {
3417
+ variant: "corporation",
3418
+ label: "Corporation",
3419
+ icon: lucideReact.Building
3420
+ },
3421
+ llc: {
3422
+ variant: "llc",
3423
+ label: "LLC",
3424
+ icon: lucideReact.Briefcase
3425
+ },
3426
+ partnership: {
3427
+ variant: "partnership",
3428
+ label: "Partnership",
3429
+ icon: lucideReact.Users
3430
+ },
3431
+ sole_proprietorship: {
3432
+ variant: "sole_proprietorship",
3433
+ label: "Sole Proprietorship",
3434
+ icon: lucideReact.User
3435
+ }
3436
+ };
3437
+ var BusinessTypeBadge = ({ type, className }) => {
3438
+ const config = typeConfig[type];
3439
+ const Icon2 = config.icon;
3440
+ return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: config.variant, className, children: [
3441
+ /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "w-3 h-3 mr-1" }),
3442
+ config.label
3443
+ ] });
3444
+ };
3445
+ var BusinessForm = ({
3446
+ form,
3447
+ businessType,
3448
+ onBusinessTypeChange,
3449
+ onSubmit
3450
+ }) => {
3451
+ return /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-6", children: [
3452
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
3453
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Business Information" }) }),
3454
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
3455
+ /* @__PURE__ */ jsxRuntime.jsx(
3456
+ EnhancedInput,
3457
+ {
3458
+ label: "Legal Name",
3459
+ placeholder: "Enter legal business name",
3460
+ required: true,
3461
+ ...form.register("legalName")
3462
+ }
3463
+ ),
3464
+ /* @__PURE__ */ jsxRuntime.jsx(
3465
+ EnhancedInput,
3466
+ {
3467
+ label: "DBA Name",
3468
+ placeholder: "Enter DBA name",
3469
+ hint: "Doing Business As name",
3470
+ ...form.register("dbaName")
3471
+ }
3472
+ ),
3473
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
3474
+ /* @__PURE__ */ jsxRuntime.jsx(
3475
+ EnhancedSelect,
3476
+ {
3477
+ label: "Business Type",
3478
+ placeholder: "Select business type",
3479
+ value: businessType,
3480
+ onValueChange: onBusinessTypeChange,
3481
+ options: [
3482
+ { value: "corporation", label: "Corporation" },
3483
+ { value: "llc", label: "LLC" },
3484
+ { value: "partnership", label: "Partnership" },
3485
+ { value: "sole_proprietorship", label: "Sole Proprietorship" }
3486
+ ]
3487
+ }
3488
+ ),
3489
+ businessType && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
3490
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "Preview:" }),
3491
+ /* @__PURE__ */ jsxRuntime.jsx(BusinessTypeBadge, { type: businessType })
3492
+ ] })
3493
+ ] }),
3494
+ /* @__PURE__ */ jsxRuntime.jsx(
3495
+ EnhancedInput,
3496
+ {
3497
+ label: "Tax ID (EIN)",
3498
+ placeholder: "12-3456789",
3499
+ hint: "Employer Identification Number",
3500
+ required: true,
3501
+ ...form.register("taxId")
3502
+ }
3503
+ ),
3504
+ /* @__PURE__ */ jsxRuntime.jsx(
3505
+ EnhancedInput,
3506
+ {
3507
+ label: "Formation Date",
3508
+ placeholder: "YYYY-MM-DD",
3509
+ type: "date",
3510
+ ...form.register("formationDate")
3511
+ }
3512
+ ),
3513
+ /* @__PURE__ */ jsxRuntime.jsx(
3514
+ EnhancedInput,
3515
+ {
3516
+ label: "Incorporation State",
3517
+ placeholder: "Enter state",
3518
+ ...form.register("incorporationState")
3519
+ }
3520
+ ),
3521
+ /* @__PURE__ */ jsxRuntime.jsx(
3522
+ EnhancedInput,
3523
+ {
3524
+ label: "Website",
3525
+ placeholder: "https://www.business.com",
3526
+ type: "url",
3527
+ ...form.register("website")
3528
+ }
3529
+ ),
3530
+ /* @__PURE__ */ jsxRuntime.jsx(
3531
+ EnhancedInput,
3532
+ {
3533
+ label: "Email Address",
3534
+ placeholder: "contact@business.com",
3535
+ type: "email",
3536
+ ...form.register("email")
3537
+ }
3538
+ ),
3539
+ /* @__PURE__ */ jsxRuntime.jsx(
3540
+ EnhancedInput,
3541
+ {
3542
+ label: "Mobile Phone",
3543
+ placeholder: "+1 (555) 123-4567",
3544
+ ...form.register("mobilePhone")
3545
+ }
3546
+ ),
3547
+ /* @__PURE__ */ jsxRuntime.jsx(
3548
+ EnhancedInput,
3549
+ {
3550
+ label: "MCC",
3551
+ placeholder: "1234",
3552
+ hint: "4-digit Merchant Category Code",
3553
+ ...form.register("mcc")
3554
+ }
3555
+ ),
3556
+ /* @__PURE__ */ jsxRuntime.jsx(
3557
+ EnhancedInput,
3558
+ {
3559
+ label: "NAICS",
3560
+ placeholder: "123456",
3561
+ hint: "6-digit industry classification",
3562
+ ...form.register("naics")
3563
+ }
3564
+ ),
3565
+ /* @__PURE__ */ jsxRuntime.jsx(
3566
+ EnhancedInput,
3567
+ {
3568
+ label: "ACH Company ID",
3569
+ placeholder: "1234567890",
3570
+ hint: "10-digit ACH identifier",
3571
+ ...form.register("achCompanyId")
3572
+ }
3573
+ ),
3574
+ /* @__PURE__ */ jsxRuntime.jsx(
3575
+ EnhancedInput,
3576
+ {
3577
+ label: "ACH Company Name",
3578
+ placeholder: "Enter ACH company name",
3579
+ ...form.register("achCompanyName")
3580
+ }
3581
+ ),
3582
+ /* @__PURE__ */ jsxRuntime.jsx(
3583
+ EnhancedInput,
3584
+ {
3585
+ label: "External ID",
3586
+ placeholder: "UUID format",
3587
+ hint: "External system identifier",
3588
+ ...form.register("externalId")
3589
+ }
3590
+ )
3591
+ ] })
3592
+ ] }),
3593
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
3594
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Business Address" }) }),
3595
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
3596
+ /* @__PURE__ */ jsxRuntime.jsx(
3597
+ EnhancedInput,
3598
+ {
3599
+ label: "Street Address",
3600
+ placeholder: "Enter street address",
3601
+ required: true,
3602
+ ...form.register("address.streetAddress")
3603
+ }
3604
+ ),
3605
+ /* @__PURE__ */ jsxRuntime.jsx(
3606
+ EnhancedInput,
3607
+ {
3608
+ label: "Apartment/Suite",
3609
+ placeholder: "Enter apartment or suite number",
3610
+ ...form.register("address.apartment")
3611
+ }
3612
+ ),
3613
+ /* @__PURE__ */ jsxRuntime.jsx(
3614
+ EnhancedInput,
3615
+ {
3616
+ label: "City",
3617
+ placeholder: "Enter city",
3618
+ required: true,
3619
+ ...form.register("address.city")
3620
+ }
3621
+ ),
3622
+ /* @__PURE__ */ jsxRuntime.jsx(
3623
+ EnhancedInput,
3624
+ {
3625
+ label: "State",
3626
+ placeholder: "Enter state",
3627
+ required: true,
3628
+ ...form.register("address.state")
3629
+ }
3630
+ ),
3631
+ /* @__PURE__ */ jsxRuntime.jsx(
3632
+ EnhancedInput,
3633
+ {
3634
+ label: "Postal Code",
3635
+ placeholder: "12345",
3636
+ required: true,
3637
+ ...form.register("address.postalCode")
3638
+ }
3639
+ ),
3640
+ /* @__PURE__ */ jsxRuntime.jsx(
3641
+ EnhancedSelect,
3642
+ {
3643
+ label: "Country",
3644
+ placeholder: "Select country",
3645
+ value: form.watch("address.country"),
3646
+ onValueChange: (value) => form.setValue("address.country", value),
3647
+ options: [
3648
+ { value: "US", label: "United States" },
3649
+ { value: "CA", label: "Canada" },
3650
+ { value: "GB", label: "United Kingdom" },
3651
+ { value: "DE", label: "Germany" }
3652
+ ]
3653
+ }
3654
+ )
3655
+ ] })
3656
+ ] }),
3657
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
3658
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Contact Information" }) }),
3659
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
3660
+ /* @__PURE__ */ jsxRuntime.jsx(
3661
+ EnhancedInput,
3662
+ {
3663
+ label: "Contact First Name",
3664
+ placeholder: "Enter first name",
3665
+ ...form.register("contactFirstName")
3666
+ }
3667
+ ),
3668
+ /* @__PURE__ */ jsxRuntime.jsx(
3669
+ EnhancedInput,
3670
+ {
3671
+ label: "Contact Last Name",
3672
+ placeholder: "Enter last name",
3673
+ ...form.register("contactLastName")
3674
+ }
3675
+ ),
3676
+ /* @__PURE__ */ jsxRuntime.jsx(
3677
+ EnhancedInput,
3678
+ {
3679
+ label: "Contact Email",
3680
+ placeholder: "contact@business.com",
3681
+ type: "email",
3682
+ ...form.register("contactEmail")
3683
+ }
3684
+ ),
3685
+ /* @__PURE__ */ jsxRuntime.jsx(
3686
+ EnhancedInput,
3687
+ {
3688
+ label: "Contact Phone",
3689
+ placeholder: "+1 (555) 123-4567",
3690
+ ...form.register("contactPhone")
3691
+ }
3692
+ )
3693
+ ] })
3694
+ ] })
3695
+ ] });
3696
+ };
3697
+ var CreateBusinessView = ({
3698
+ form,
3699
+ businessType,
3700
+ onBusinessTypeChange,
3701
+ onSubmit,
3702
+ onCancel
3703
+ }) => {
3704
+ return /* @__PURE__ */ jsxRuntime.jsx(
3705
+ PageLayout,
3706
+ {
3707
+ title: "Create Business",
3708
+ actions: [
3709
+ { label: "Cancel", variant: "outline", onClick: onCancel },
3710
+ { label: "Create Business", variant: "default", onClick: form.handleSubmit(onSubmit) }
3711
+ ],
3712
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3713
+ BusinessForm,
3714
+ {
3715
+ form,
3716
+ businessType,
3717
+ onBusinessTypeChange,
3718
+ onSubmit
3719
+ }
3720
+ )
3721
+ }
3722
+ );
3723
+ };
3724
+ var useEditState = ({ initialEditing = false, onToggleEdit, onSave, onCancel }) => {
3725
+ const [localEditing, setLocalEditing] = React15.useState(initialEditing);
3726
+ const [isLoading, setIsLoading] = React15.useState(false);
3727
+ React15.useEffect(() => {
3728
+ setLocalEditing(initialEditing);
3729
+ }, [initialEditing]);
3730
+ const isEditing = onToggleEdit !== void 0 ? initialEditing : localEditing;
3731
+ const handleToggleEdit = React15.useCallback(() => {
3732
+ if (onToggleEdit) {
3733
+ onToggleEdit();
3734
+ } else {
3735
+ setLocalEditing((prev) => !prev);
3736
+ }
3737
+ }, [onToggleEdit]);
3738
+ const handleSave = React15.useCallback(async () => {
3739
+ setIsLoading(true);
3740
+ try {
3741
+ if (onSave) {
3742
+ await onSave();
3743
+ }
3744
+ if (onToggleEdit) {
3745
+ onToggleEdit();
3746
+ } else {
3747
+ setLocalEditing(false);
3748
+ }
3749
+ } catch (error) {
3750
+ console.error("Save error:", error);
3751
+ } finally {
3752
+ setIsLoading(false);
3753
+ }
3754
+ }, [onSave, onToggleEdit]);
3755
+ const handleCancel = React15.useCallback(() => {
3756
+ if (onCancel) {
3757
+ onCancel();
3758
+ }
3759
+ if (onToggleEdit) {
3760
+ onToggleEdit();
3761
+ } else {
3762
+ setLocalEditing(false);
3763
+ }
3764
+ }, [onCancel, onToggleEdit]);
3765
+ return {
3766
+ isEditing,
3767
+ isLoading,
3768
+ handleToggleEdit,
3769
+ handleSave,
3770
+ handleCancel
3771
+ };
3772
+ };
3773
+ var EditableFormCard = React15__namespace.forwardRef(
3774
+ ({
3775
+ title,
3776
+ description,
3777
+ editContent,
3778
+ viewContent,
3779
+ isEditing,
3780
+ onToggleEdit,
3781
+ hideActions = false,
3782
+ onSave,
3783
+ onCancel,
3784
+ className,
3785
+ variant = "subtle",
3786
+ isFormValid = true,
3787
+ isDirty = false,
3788
+ isSubmitting = false,
3789
+ ...props
3790
+ }, ref) => {
3791
+ const { isEditing: currentlyEditing, handleToggleEdit, handleCancel } = useEditState({
3792
+ initialEditing: isEditing ?? false,
3793
+ onToggleEdit
3794
+ });
3795
+ const handleSaveAction = async () => {
3796
+ if (onSave) {
3797
+ await onSave();
3798
+ }
3799
+ };
3800
+ const handleCancelAction = () => {
3801
+ if (onCancel) {
3802
+ onCancel();
3803
+ } else {
3180
3804
  handleCancel();
3181
3805
  }
3182
3806
  };
@@ -3755,7 +4379,7 @@ var BankingDetailsCard = ({ isEditing, onToggleEdit, className }) => {
3755
4379
  }
3756
4380
  );
3757
4381
  };
3758
- var typeConfig = {
4382
+ var typeConfig2 = {
3759
4383
  BUSINESS: {
3760
4384
  variant: "business",
3761
4385
  label: "Business",
@@ -3778,7 +4402,7 @@ var typeConfig = {
3778
4402
  }
3779
4403
  };
3780
4404
  var CounterpartyTypeBadge = ({ type, className }) => {
3781
- const config = typeConfig[type];
4405
+ const config = typeConfig2[type];
3782
4406
  if (!config) {
3783
4407
  return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className, children: [
3784
4408
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { className: "w-3 h-3 mr-1" }),
@@ -4109,7 +4733,7 @@ var columnClasses = {
4109
4733
  4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
4110
4734
  };
4111
4735
  var DataGrid = React15__namespace.forwardRef(
4112
- ({ data, columns: columns2 = 2, gap = "md", className }, ref) => {
4736
+ ({ data, columns: columns3 = 2, gap = "md", className }, ref) => {
4113
4737
  const isItemArray = data.length > 0 && "label" in data[0];
4114
4738
  if (isItemArray) {
4115
4739
  const items = data;
@@ -4119,7 +4743,7 @@ var DataGrid = React15__namespace.forwardRef(
4119
4743
  ref,
4120
4744
  className: cn(
4121
4745
  "grid",
4122
- columnClasses[columns2],
4746
+ columnClasses[columns3],
4123
4747
  gapClasses2[gap],
4124
4748
  className
4125
4749
  ),
@@ -4140,7 +4764,7 @@ var DataGrid = React15__namespace.forwardRef(
4140
4764
  section.title && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: section.title }),
4141
4765
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
4142
4766
  "grid",
4143
- columnClasses[columns2],
4767
+ columnClasses[columns3],
4144
4768
  gapClasses2[gap]
4145
4769
  ), children: section.items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsx(
4146
4770
  InfoField,
@@ -4885,7 +5509,7 @@ var FormSection = React15__namespace.forwardRef(
4885
5509
  className,
4886
5510
  spacing: spacing2 = "md",
4887
5511
  layout = "vertical",
4888
- columns: columns2 = 2
5512
+ columns: columns3 = 2
4889
5513
  }, ref) => {
4890
5514
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-4", className), children: [
4891
5515
  (title || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
@@ -4893,7 +5517,7 @@ var FormSection = React15__namespace.forwardRef(
4893
5517
  description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description })
4894
5518
  ] }),
4895
5519
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
4896
- layout === "grid" ? `grid gap-4 ${gridClasses[columns2]}` : spacingClasses[spacing2]
5520
+ layout === "grid" ? `grid gap-4 ${gridClasses[columns3]}` : spacingClasses[spacing2]
4897
5521
  ), children })
4898
5522
  ] });
4899
5523
  }
@@ -5663,216 +6287,105 @@ var mockPrograms = [
5663
6287
  { value: "PROG-0094", label: "Premium Rewards Program 6" },
5664
6288
  { value: "PROG-00104", label: "Consumer Banking Program" },
5665
6289
  { value: "PROG-00114", label: "Business Banking Program" },
5666
- { value: "PROG-00134", label: "Premium Rewards Program" },
5667
- { value: "PROG-00414", label: "Premium Rewards Program 1" },
5668
- { value: "PROG-00514", label: "Premium Rewards Program 2" },
5669
- { value: "PROG-00614", label: "Premium Rewards Program 3" },
5670
- { value: "PROG-00714", label: "Premium Rewards Program 4" },
5671
- { value: "PROG-00814", label: "Premium Rewards Program 5" },
5672
- { value: "PROG-00914", label: "Premium Rewards Program 6" }
5673
- ];
5674
- var mockProducts = [
5675
- { value: "PROD-001", label: "Checking Account" },
5676
- { value: "PROD-002", label: "Savings Account" },
5677
- { value: "PROD-003", label: "Money Market Account" },
5678
- { value: "PROD-004", label: "Business Checking" }
5679
- ];
5680
- var StatementHeader = ({ data, onEdit }) => {
5681
- const hasValue = (value) => {
5682
- if (value === void 0 || value === null) return false;
5683
- if (typeof value === "string" && value.trim() === "") return false;
5684
- return true;
5685
- };
5686
- const balanceChange = data.startingBalance && data.endingBalance ? calculateBalanceChange(data.startingBalance, data.endingBalance) : null;
5687
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
5688
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { direction: "row", children: [
5689
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: "Statement Summary" }),
5690
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: onEdit, children: [
5691
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-2" }),
5692
- "Edit"
5693
- ] })
5694
- ] }),
5695
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
5696
- hasValue(data.account) && /* @__PURE__ */ jsxRuntime.jsx(
5697
- InfoField,
5698
- {
5699
- label: "Account",
5700
- value: data.account,
5701
- layout: "horizontal"
5702
- }
5703
- ),
5704
- hasValue(data.productId) && /* @__PURE__ */ jsxRuntime.jsx(
5705
- InfoField,
5706
- {
5707
- label: "Product ID",
5708
- value: data.productId,
5709
- layout: "horizontal"
5710
- }
5711
- ),
5712
- hasValue(data.programId) && /* @__PURE__ */ jsxRuntime.jsx(
5713
- InfoField,
5714
- {
5715
- label: "Program ID",
5716
- value: data.programId,
5717
- layout: "horizontal"
5718
- }
5719
- ),
5720
- hasValue(data.startDate) && /* @__PURE__ */ jsxRuntime.jsx(
5721
- InfoField,
5722
- {
5723
- label: "Start Date",
5724
- value: data.startDate,
5725
- layout: "horizontal"
5726
- }
5727
- ),
5728
- hasValue(data.endDate) && /* @__PURE__ */ jsxRuntime.jsx(
5729
- InfoField,
5730
- {
5731
- label: "End Date",
5732
- value: data.endDate,
5733
- layout: "horizontal"
5734
- }
5735
- ),
5736
- hasValue(data.startingBalance) && /* @__PURE__ */ jsxRuntime.jsx(
5737
- InfoField,
5738
- {
5739
- label: "Starting Balance",
5740
- value: data.startingBalance,
5741
- layout: "horizontal"
5742
- }
5743
- ),
5744
- hasValue(data.endingBalance) && /* @__PURE__ */ jsxRuntime.jsx(
5745
- InfoField,
5746
- {
5747
- label: "Ending Balance",
5748
- value: data.endingBalance,
5749
- layout: "horizontal"
5750
- }
5751
- ),
5752
- balanceChange && /* @__PURE__ */ jsxRuntime.jsx(
5753
- InfoField,
5754
- {
5755
- label: "Balance Change",
5756
- value: /* @__PURE__ */ jsxRuntime.jsx("span", { className: balanceChange.isPositive ? "text-green-600 font-medium" : "text-red-600 font-medium", children: balanceChange.formatted }),
5757
- layout: "horizontal"
5758
- }
5759
- )
5760
- ] }) })
5761
- ] });
5762
- };
5763
- function Calendar({
5764
- className,
5765
- classNames,
5766
- showOutsideDays = true,
5767
- ...props
5768
- }) {
5769
- return /* @__PURE__ */ jsxRuntime.jsx(
5770
- reactDayPicker.DayPicker,
5771
- {
5772
- showOutsideDays,
5773
- className: cn("p-3 pointer-events-auto", className),
5774
- classNames: {
5775
- months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
5776
- month: "space-y-4",
5777
- caption: "flex justify-center pt-1 relative items-center",
5778
- caption_label: "text-sm font-medium",
5779
- nav: "space-x-1 flex items-center",
5780
- button_previous: "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
5781
- button_next: "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
5782
- month_grid: "w-full border-collapse space-y-1",
5783
- weekdays: "flex",
5784
- weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
5785
- week: "flex w-full mt-2",
5786
- day: "h-9 w-9 text-center text-sm p-0 relative hover:bg-accent hover:text-accent-foreground rounded-md",
5787
- day_button: cn(
5788
- buttonVariants({ variant: "ghost" }),
5789
- "h-9 w-9 p-0 font-normal"
5790
- ),
5791
- selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
5792
- today: "bg-accent text-accent-foreground",
5793
- outside: "text-muted-foreground opacity-50",
5794
- disabled: "text-muted-foreground opacity-50",
5795
- hidden: "invisible",
5796
- ...classNames
5797
- },
5798
- ...props
5799
- }
5800
- );
5801
- }
5802
- Calendar.displayName = "Calendar";
5803
- var Popover = PopoverPrimitive__namespace.Root;
5804
- var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
5805
- var PopoverContent = React15__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
5806
- PopoverPrimitive__namespace.Content,
5807
- {
5808
- ref,
5809
- align,
5810
- sideOffset,
5811
- className: cn(
5812
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
5813
- className
5814
- ),
5815
- ...props
5816
- }
5817
- ) }));
5818
- PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
5819
- function DatePicker({
5820
- date,
5821
- onDateChange,
5822
- placeholder = "Pick a date",
5823
- disabled = false,
5824
- className,
5825
- buttonClassName,
5826
- calendarClassName,
5827
- align = "start",
5828
- disabledDates,
5829
- label,
5830
- wrapperClassName
5831
- }) {
5832
- const [open, setOpen] = React15__namespace.useState(false);
5833
- const handleSelect = (selectedDate) => {
5834
- onDateChange?.(selectedDate);
5835
- setOpen(false);
5836
- };
5837
- const picker = /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
5838
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
5839
- Button,
5840
- {
5841
- variant: "outline",
5842
- disabled,
5843
- className: cn(
5844
- "justify-start text-left font-normal",
5845
- !date && "text-muted-foreground",
5846
- buttonClassName
5847
- ),
5848
- children: [
5849
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "mr-2 h-4 w-4" }),
5850
- date ? dateFns.format(date, "MM/dd/yyyy") : placeholder
5851
- ]
5852
- }
5853
- ) }),
5854
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: cn("w-auto p-0", className), align, children: /* @__PURE__ */ jsxRuntime.jsx(
5855
- Calendar,
5856
- {
5857
- mode: "single",
5858
- selected: date,
5859
- onSelect: handleSelect,
5860
- disabled: disabledDates,
5861
- initialFocus: true,
5862
- className: cn("pointer-events-auto", calendarClassName)
5863
- }
5864
- ) })
6290
+ { value: "PROG-00134", label: "Premium Rewards Program" },
6291
+ { value: "PROG-00414", label: "Premium Rewards Program 1" },
6292
+ { value: "PROG-00514", label: "Premium Rewards Program 2" },
6293
+ { value: "PROG-00614", label: "Premium Rewards Program 3" },
6294
+ { value: "PROG-00714", label: "Premium Rewards Program 4" },
6295
+ { value: "PROG-00814", label: "Premium Rewards Program 5" },
6296
+ { value: "PROG-00914", label: "Premium Rewards Program 6" }
6297
+ ];
6298
+ var mockProducts = [
6299
+ { value: "PROD-001", label: "Checking Account" },
6300
+ { value: "PROD-002", label: "Savings Account" },
6301
+ { value: "PROD-003", label: "Money Market Account" },
6302
+ { value: "PROD-004", label: "Business Checking" }
6303
+ ];
6304
+ var StatementHeader = ({ data, onEdit }) => {
6305
+ const hasValue = (value) => {
6306
+ if (value === void 0 || value === null) return false;
6307
+ if (typeof value === "string" && value.trim() === "") return false;
6308
+ return true;
6309
+ };
6310
+ const balanceChange = data.startingBalance && data.endingBalance ? calculateBalanceChange(data.startingBalance, data.endingBalance) : null;
6311
+ return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
6312
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { direction: "row", children: [
6313
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: "Statement Summary" }),
6314
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: onEdit, children: [
6315
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-2" }),
6316
+ "Edit"
6317
+ ] })
6318
+ ] }),
6319
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
6320
+ hasValue(data.account) && /* @__PURE__ */ jsxRuntime.jsx(
6321
+ InfoField,
6322
+ {
6323
+ label: "Account",
6324
+ value: data.account,
6325
+ layout: "horizontal"
6326
+ }
6327
+ ),
6328
+ hasValue(data.productId) && /* @__PURE__ */ jsxRuntime.jsx(
6329
+ InfoField,
6330
+ {
6331
+ label: "Product ID",
6332
+ value: data.productId,
6333
+ layout: "horizontal"
6334
+ }
6335
+ ),
6336
+ hasValue(data.programId) && /* @__PURE__ */ jsxRuntime.jsx(
6337
+ InfoField,
6338
+ {
6339
+ label: "Program ID",
6340
+ value: data.programId,
6341
+ layout: "horizontal"
6342
+ }
6343
+ ),
6344
+ hasValue(data.startDate) && /* @__PURE__ */ jsxRuntime.jsx(
6345
+ InfoField,
6346
+ {
6347
+ label: "Start Date",
6348
+ value: data.startDate,
6349
+ layout: "horizontal"
6350
+ }
6351
+ ),
6352
+ hasValue(data.endDate) && /* @__PURE__ */ jsxRuntime.jsx(
6353
+ InfoField,
6354
+ {
6355
+ label: "End Date",
6356
+ value: data.endDate,
6357
+ layout: "horizontal"
6358
+ }
6359
+ ),
6360
+ hasValue(data.startingBalance) && /* @__PURE__ */ jsxRuntime.jsx(
6361
+ InfoField,
6362
+ {
6363
+ label: "Starting Balance",
6364
+ value: data.startingBalance,
6365
+ layout: "horizontal"
6366
+ }
6367
+ ),
6368
+ hasValue(data.endingBalance) && /* @__PURE__ */ jsxRuntime.jsx(
6369
+ InfoField,
6370
+ {
6371
+ label: "Ending Balance",
6372
+ value: data.endingBalance,
6373
+ layout: "horizontal"
6374
+ }
6375
+ ),
6376
+ balanceChange && /* @__PURE__ */ jsxRuntime.jsx(
6377
+ InfoField,
6378
+ {
6379
+ label: "Balance Change",
6380
+ value: /* @__PURE__ */ jsxRuntime.jsx("span", { className: balanceChange.isPositive ? "text-green-600 font-medium" : "text-red-600 font-medium", children: balanceChange.formatted }),
6381
+ layout: "horizontal"
6382
+ }
6383
+ )
6384
+ ] }) })
5865
6385
  ] });
5866
- if (label) {
5867
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-2", wrapperClassName), children: [
5868
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label }),
5869
- picker
5870
- ] });
5871
- }
5872
- return picker;
5873
- }
6386
+ };
5874
6387
  function DataTable({
5875
- columns: columns2,
6388
+ columns: columns3,
5876
6389
  data,
5877
6390
  sortBy,
5878
6391
  sortDirection,
@@ -5911,7 +6424,7 @@ function DataTable({
5911
6424
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-md border", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-8 text-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-pulse text-muted-foreground", children: "Loading..." }) }) });
5912
6425
  }
5913
6426
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-md border", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
5914
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b bg-muted/50", children: columns2.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
6427
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b bg-muted/50", children: columns3.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
5915
6428
  "th",
5916
6429
  {
5917
6430
  style: column.width ? { width: column.width } : void 0,
@@ -5936,7 +6449,7 @@ function DataTable({
5936
6449
  },
5937
6450
  column.key
5938
6451
  )) }) }),
5939
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: columns2.length, className: "h-24 text-center text-muted-foreground", children: emptyMessage }) }) : data.map((row, index) => /* @__PURE__ */ jsxRuntime.jsx(
6452
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: columns3.length, className: "h-24 text-center text-muted-foreground", children: emptyMessage }) }) : data.map((row, index) => /* @__PURE__ */ jsxRuntime.jsx(
5940
6453
  "tr",
5941
6454
  {
5942
6455
  className: cn(
@@ -5944,7 +6457,7 @@ function DataTable({
5944
6457
  onRowClick && "cursor-pointer"
5945
6458
  ),
5946
6459
  onClick: () => onRowClick?.(row),
5947
- children: columns2.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
6460
+ children: columns3.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
5948
6461
  "td",
5949
6462
  {
5950
6463
  style: column.width ? { width: column.width } : void 0,
@@ -6347,36 +6860,6 @@ var AccountCard = React15__namespace.forwardRef(
6347
6860
  }
6348
6861
  );
6349
6862
  AccountCard.displayName = "AccountCard";
6350
- var typeConfig2 = {
6351
- corporation: {
6352
- variant: "corporation",
6353
- label: "Corporation",
6354
- icon: lucideReact.Building
6355
- },
6356
- llc: {
6357
- variant: "llc",
6358
- label: "LLC",
6359
- icon: lucideReact.Briefcase
6360
- },
6361
- partnership: {
6362
- variant: "partnership",
6363
- label: "Partnership",
6364
- icon: lucideReact.Users
6365
- },
6366
- sole_proprietorship: {
6367
- variant: "sole_proprietorship",
6368
- label: "Sole Proprietorship",
6369
- icon: lucideReact.User
6370
- }
6371
- };
6372
- var BusinessTypeBadge = ({ type, className }) => {
6373
- const config = typeConfig2[type];
6374
- const Icon2 = config.icon;
6375
- return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: config.variant, className, children: [
6376
- /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "w-3 h-3 mr-1" }),
6377
- config.label
6378
- ] });
6379
- };
6380
6863
  var Checkbox = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
6381
6864
  CheckboxPrimitive__namespace.Root,
6382
6865
  {
@@ -6394,130 +6877,8 @@ var Checkbox = React15__namespace.forwardRef(({ className, ...props }, ref) => /
6394
6877
  }
6395
6878
  )
6396
6879
  }
6397
- ));
6398
- Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
6399
- var maxWidthClasses = {
6400
- sm: "max-w-2xl",
6401
- md: "max-w-4xl",
6402
- lg: "max-w-6xl",
6403
- xl: "max-w-7xl",
6404
- "2xl": "max-w-screen-2xl",
6405
- full: "max-w-none"
6406
- };
6407
- var getGridClasses = (gridCols, responsive) => {
6408
- const colsMap = {
6409
- 1: "grid-cols-1",
6410
- 2: "grid-cols-2",
6411
- 3: "grid-cols-3",
6412
- 4: "grid-cols-4"
6413
- };
6414
- if (!responsive) {
6415
- return colsMap[gridCols] || "grid-cols-1";
6416
- }
6417
- switch (gridCols) {
6418
- case 1:
6419
- return "grid-cols-1";
6420
- case 2:
6421
- return "grid-cols-1 lg:grid-cols-2";
6422
- case 3:
6423
- return "grid-cols-1 md:grid-cols-2 lg:grid-cols-3";
6424
- case 4:
6425
- return "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4";
6426
- default:
6427
- return "grid-cols-1 lg:grid-cols-2";
6428
- }
6429
- };
6430
- var PageLayout = React15__namespace.forwardRef(
6431
- ({
6432
- title,
6433
- description,
6434
- children,
6435
- actions = [],
6436
- cards = [],
6437
- mode = "simple",
6438
- maxWidth = "xl",
6439
- gridCols = 2,
6440
- responsive = true,
6441
- className,
6442
- headerContent
6443
- }, ref) => {
6444
- const [editingCards, setEditingCards] = React15__namespace.useState(/* @__PURE__ */ new Set());
6445
- const toggleEdit = (cardKey) => {
6446
- setEditingCards((prev) => {
6447
- const next = new Set(prev);
6448
- if (next.has(cardKey)) {
6449
- next.delete(cardKey);
6450
- } else {
6451
- next.add(cardKey);
6452
- }
6453
- return next;
6454
- });
6455
- };
6456
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: "flex flex-col h-screen bg-gradient-subtle", children: [
6457
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
6458
- "container mx-auto px-4 py-6",
6459
- maxWidthClasses[maxWidth]
6460
- ), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
6461
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-h-[2.5rem]", children: [
6462
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: title }),
6463
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: description })
6464
- ] }),
6465
- headerContent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: headerContent }),
6466
- actions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: actions.map((action, index) => {
6467
- const Icon2 = action.icon;
6468
- return /* @__PURE__ */ jsxRuntime.jsxs(
6469
- "button",
6470
- {
6471
- onClick: action.onClick,
6472
- className: cn(
6473
- "inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors",
6474
- {
6475
- "bg-primary text-primary-foreground hover:bg-primary/90": action.variant === "default" || !action.variant,
6476
- "bg-secondary text-secondary-foreground hover:bg-secondary/80": action.variant === "secondary",
6477
- "bg-destructive text-destructive-foreground hover:bg-destructive/90": action.variant === "destructive",
6478
- "border border-input bg-background hover:bg-accent hover:text-accent-foreground": action.variant === "outline",
6479
- "hover:bg-accent hover:text-accent-foreground": action.variant === "ghost"
6480
- }
6481
- ),
6482
- children: [
6483
- Icon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4" }),
6484
- action.label
6485
- ]
6486
- },
6487
- index
6488
- );
6489
- }) })
6490
- ] }) }) }),
6491
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
6492
- "container mx-auto px-4 py-6",
6493
- maxWidthClasses[maxWidth],
6494
- className
6495
- ), children: mode === "cards" && cards.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("grid gap-6", getGridClasses(gridCols, responsive)), children: cards.map((card) => {
6496
- const isEditing = editingCards.has(card.key);
6497
- const shouldExpand = card.expandOnEdit && isEditing;
6498
- return /* @__PURE__ */ jsxRuntime.jsx(
6499
- "div",
6500
- {
6501
- className: cn(
6502
- "transition-all duration-300",
6503
- shouldExpand && (gridCols > 1 ? "col-span-full" : "")
6504
- ),
6505
- children: /* @__PURE__ */ jsxRuntime.jsx(
6506
- card.component,
6507
- {
6508
- ...card.props,
6509
- isEditing,
6510
- onToggleEdit: () => toggleEdit(card.key)
6511
- }
6512
- )
6513
- },
6514
- card.key
6515
- );
6516
- }) }) : children }) })
6517
- ] });
6518
- }
6519
- );
6520
- PageLayout.displayName = "PageLayout";
6880
+ ));
6881
+ Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
6521
6882
  var DetailPageLayout = ({
6522
6883
  title,
6523
6884
  description,
@@ -7805,6 +8166,90 @@ var useAlertDetail = (id) => {
7805
8166
  handleResolveAlert
7806
8167
  };
7807
8168
  };
8169
+ var useBusinessFilters = ({ initialData }) => {
8170
+ const [filteredData, setFilteredData] = React15.useState(initialData);
8171
+ const [filters, setFilters] = React15.useState({
8172
+ name: "",
8173
+ productName: "",
8174
+ status: "",
8175
+ createdDateStart: void 0,
8176
+ createdDateEnd: void 0
8177
+ });
8178
+ const handleFilterChange = React15.useCallback((field, value) => {
8179
+ setFilters((prev) => ({ ...prev, [field]: value }));
8180
+ }, []);
8181
+ const applyFilters = React15.useCallback(() => {
8182
+ let filtered = initialData;
8183
+ if (filters.name) {
8184
+ filtered = filtered.filter(
8185
+ (business) => business.businessName.toLowerCase().includes(filters.name.toLowerCase())
8186
+ );
8187
+ }
8188
+ if (filters.productName) {
8189
+ filtered = filtered.filter(
8190
+ (business) => business.productName.toLowerCase().includes(filters.productName.toLowerCase())
8191
+ );
8192
+ }
8193
+ if (filters.status) {
8194
+ filtered = filtered.filter((business) => business.status === filters.status);
8195
+ }
8196
+ if (filters.createdDateStart) {
8197
+ filtered = filtered.filter(
8198
+ (business) => new Date(business.created) >= filters.createdDateStart
8199
+ );
8200
+ }
8201
+ if (filters.createdDateEnd) {
8202
+ filtered = filtered.filter(
8203
+ (business) => new Date(business.created) <= filters.createdDateEnd
8204
+ );
8205
+ }
8206
+ setFilteredData(filtered);
8207
+ }, [filters, initialData]);
8208
+ const resetFilters = React15.useCallback(() => {
8209
+ setFilters({
8210
+ name: "",
8211
+ productName: "",
8212
+ status: "",
8213
+ createdDateStart: void 0,
8214
+ createdDateEnd: void 0
8215
+ });
8216
+ setFilteredData(initialData);
8217
+ }, [initialData]);
8218
+ return {
8219
+ filters,
8220
+ filteredData,
8221
+ handleFilterChange,
8222
+ applyFilters,
8223
+ resetFilters
8224
+ };
8225
+ };
8226
+ var useBusinessSort = ({ data }) => {
8227
+ const [sortBy, setSortBy] = React15.useState("created");
8228
+ const [sortDirection, setSortDirection] = React15.useState("desc");
8229
+ const handleSort = React15.useCallback((key) => {
8230
+ if (sortBy === key) {
8231
+ setSortDirection((prev) => prev === "asc" ? "desc" : "asc");
8232
+ } else {
8233
+ setSortBy(key);
8234
+ setSortDirection("asc");
8235
+ }
8236
+ }, [sortBy]);
8237
+ const sortedData = React15.useMemo(() => {
8238
+ return [...data].sort((a, b) => {
8239
+ const aValue = a[sortBy];
8240
+ const bValue = b[sortBy];
8241
+ if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
8242
+ if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
8243
+ return 0;
8244
+ });
8245
+ }, [data, sortBy, sortDirection]);
8246
+ return {
8247
+ sortBy,
8248
+ sortDirection,
8249
+ sortedData,
8250
+ handleSort
8251
+ };
8252
+ };
7808
8253
  var AlertDetail = () => {
7809
8254
  const { id } = reactRouterDom.useParams();
7810
8255
  const navigate = reactRouterDom.useNavigate();
@@ -8228,237 +8673,194 @@ var mockBusinessesList = [
8228
8673
  id: "8110892",
8229
8674
  businessName: "Tech Solutions Corp",
8230
8675
  productName: "Digital Finance Inc FBO Tech Solutions",
8231
- cipStatus: "IN_REVIEW",
8232
- status: "PENDING_APPROVAL",
8233
- type: "Business",
8234
- subType: "Customer",
8235
- isDeveloperInitiated: false,
8236
- provider: "Alloy",
8237
- result: 'vendor:KYC_VENDOR status:in_progress data:"kyc_id:\\"kyc-345\\" business_id:\\"biz-678\\" initiated:{seconds:1761333700 nanos:111222000}"',
8238
- created: "2025-10-02",
8239
- modified: "2025-10-02"
8240
- },
8241
- {
8242
- id: "8110654",
8243
- businessName: "Global Trade Partners LLC",
8244
- productName: "Swift Transfer FBO Global Trade",
8245
- cipStatus: "PASS",
8246
- status: "ACTIVE",
8247
- type: "Individual",
8248
- subType: "UBO",
8249
- isDeveloperInitiated: true,
8250
- provider: "Plaid",
8251
- result: 'vendor:VERIFICATION_VENDOR status:completed data:"account_verified:true holder_verified:true timestamp:{seconds:1761333600 nanos:333444000}"',
8252
- created: "2025-10-01",
8253
- modified: "2025-10-01"
8254
- }
8255
- ];
8256
- var Businesses = () => {
8257
- const navigate = reactRouterDom.useNavigate();
8258
- const [businesses, setBusinesses] = React15.useState(mockBusinessesList);
8259
- const [filteredBusinesses, setFilteredBusinesses] = React15.useState(mockBusinessesList);
8260
- const [sortBy, setSortBy] = React15.useState("created");
8261
- const [sortDirection, setSortDirection] = React15.useState("desc");
8262
- const [filters, setFilters] = React15.useState({
8263
- name: "",
8264
- productName: "",
8265
- status: "",
8266
- createdDateStart: void 0,
8267
- createdDateEnd: void 0
8268
- });
8269
- const handleFilterChange = (field, value) => {
8270
- setFilters((prev) => ({ ...prev, [field]: value }));
8271
- };
8272
- const applyFilters = () => {
8273
- let filtered = businesses;
8274
- if (filters.name) {
8275
- filtered = filtered.filter(
8276
- (business) => business.businessName.toLowerCase().includes(filters.name.toLowerCase())
8277
- );
8278
- }
8279
- if (filters.productName) {
8280
- filtered = filtered.filter(
8281
- (business) => business.productName.toLowerCase().includes(filters.productName.toLowerCase())
8282
- );
8283
- }
8284
- if (filters.status) {
8285
- filtered = filtered.filter((business) => business.status === filters.status);
8286
- }
8287
- if (filters.createdDateStart) {
8288
- filtered = filtered.filter(
8289
- (business) => new Date(business.created) >= filters.createdDateStart
8290
- );
8291
- }
8292
- if (filters.createdDateEnd) {
8293
- filtered = filtered.filter(
8294
- (business) => new Date(business.created) <= filters.createdDateEnd
8295
- );
8296
- }
8297
- setFilteredBusinesses(filtered);
8298
- };
8299
- const resetFilters = () => {
8300
- setFilters({
8301
- name: "",
8302
- productName: "",
8303
- status: "",
8304
- createdDateStart: void 0,
8305
- createdDateEnd: void 0
8306
- });
8307
- setFilteredBusinesses(businesses);
8308
- };
8309
- const handleSort = (key) => {
8310
- if (sortBy === key) {
8311
- setSortDirection(sortDirection === "asc" ? "desc" : "asc");
8312
- } else {
8313
- setSortBy(key);
8314
- setSortDirection("asc");
8315
- }
8316
- };
8317
- const handleRowClick = (business) => {
8318
- navigate(`/business/${business.id}`);
8319
- };
8320
- const columns2 = [
8321
- {
8322
- key: "id",
8323
- title: "Business ID",
8324
- sortable: true
8325
- },
8326
- {
8327
- key: "businessName",
8328
- title: "Business Name",
8329
- sortable: true
8330
- },
8331
- {
8332
- key: "productName",
8333
- title: "Product Name",
8334
- sortable: true,
8335
- render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary hover:underline cursor-pointer", children: value })
8336
- },
8337
- {
8338
- key: "cipStatus",
8339
- title: "CIP status",
8340
- sortable: true,
8341
- render: (value) => /* @__PURE__ */ jsxRuntime.jsx(CIPStatusBadge, { status: value })
8342
- },
8343
- {
8344
- key: "status",
8345
- title: "Status",
8346
- sortable: true,
8347
- render: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value?.toUpperCase() })
8348
- },
8349
- {
8350
- key: "created",
8351
- title: "Created",
8352
- sortable: true
8353
- },
8354
- {
8355
- key: "modified",
8356
- title: "Modified",
8357
- sortable: true
8358
- }
8359
- ];
8360
- const sortedBusinesses = [...filteredBusinesses].sort((a, b) => {
8361
- const aValue = a[sortBy];
8362
- const bValue = b[sortBy];
8363
- if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
8364
- if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
8365
- return 0;
8366
- });
8367
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
8368
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
8369
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: "Businesses" }) }),
8370
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8371
- /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
8372
- /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
8373
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
8374
- "Filters"
8375
- ] }) }),
8376
- /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
8377
- /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Business Filters" }) }),
8378
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
8379
- /* @__PURE__ */ jsxRuntime.jsx(
8380
- EnhancedInput,
8381
- {
8382
- label: "Name",
8383
- value: filters.name,
8384
- onChange: (e) => handleFilterChange("name", e.target.value),
8385
- placeholder: "Enter business name"
8386
- }
8387
- ),
8388
- /* @__PURE__ */ jsxRuntime.jsx(
8389
- EnhancedInput,
8390
- {
8391
- label: "Product Name",
8392
- value: filters.productName,
8393
- onChange: (e) => handleFilterChange("productName", e.target.value),
8394
- placeholder: "Enter product name"
8395
- }
8396
- ),
8397
- /* @__PURE__ */ jsxRuntime.jsx(
8398
- EnhancedSelect,
8399
- {
8400
- label: "Status",
8401
- value: filters.status,
8402
- onValueChange: (value) => handleFilterChange("status", value),
8403
- placeholder: "Select status",
8404
- options: [
8405
- { value: "active", label: "Active" },
8406
- { value: "inactive", label: "Inactive" },
8407
- { value: "suspended", label: "Suspended" }
8408
- ]
8409
- }
8410
- ),
8411
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
8412
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
8413
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
8414
- /* @__PURE__ */ jsxRuntime.jsx(
8415
- DatePicker,
8416
- {
8417
- date: filters.createdDateStart,
8418
- onDateChange: (date) => handleFilterChange("createdDateStart", date),
8419
- placeholder: "MM/DD/YYYY",
8420
- buttonClassName: "w-full",
8421
- className: "bg-background z-50"
8422
- }
8423
- )
8424
- ] }),
8425
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
8426
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
8427
- /* @__PURE__ */ jsxRuntime.jsx(
8428
- DatePicker,
8429
- {
8430
- date: filters.createdDateEnd,
8431
- onDateChange: (date) => handleFilterChange("createdDateEnd", date),
8432
- placeholder: "MM/DD/YYYY",
8433
- buttonClassName: "w-full",
8434
- className: "bg-background z-50"
8435
- }
8436
- )
8437
- ] })
8438
- ] })
8439
- ] }),
8440
- /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
8441
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: resetFilters, children: "Reset Filters" }),
8442
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
8443
- ] })
8444
- ] })
8445
- ] }),
8446
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: () => navigate("/business/create"), children: "Create Business" })
8676
+ cipStatus: "IN_REVIEW",
8677
+ status: "PENDING_APPROVAL",
8678
+ type: "Business",
8679
+ subType: "Customer",
8680
+ isDeveloperInitiated: false,
8681
+ provider: "Alloy",
8682
+ result: 'vendor:KYC_VENDOR status:in_progress data:"kyc_id:\\"kyc-345\\" business_id:\\"biz-678\\" initiated:{seconds:1761333700 nanos:111222000}"',
8683
+ created: "2025-10-02",
8684
+ modified: "2025-10-02"
8685
+ },
8686
+ {
8687
+ id: "8110654",
8688
+ businessName: "Global Trade Partners LLC",
8689
+ productName: "Swift Transfer FBO Global Trade",
8690
+ cipStatus: "PASS",
8691
+ status: "ACTIVE",
8692
+ type: "Individual",
8693
+ subType: "UBO",
8694
+ isDeveloperInitiated: true,
8695
+ provider: "Plaid",
8696
+ result: 'vendor:VERIFICATION_VENDOR status:completed data:"account_verified:true holder_verified:true timestamp:{seconds:1761333600 nanos:333444000}"',
8697
+ created: "2025-10-01",
8698
+ modified: "2025-10-01"
8699
+ }
8700
+ ];
8701
+ var columns2 = [
8702
+ {
8703
+ key: "id",
8704
+ title: "Business ID",
8705
+ sortable: true
8706
+ },
8707
+ {
8708
+ key: "businessName",
8709
+ title: "Business Name",
8710
+ sortable: true
8711
+ },
8712
+ {
8713
+ key: "productName",
8714
+ title: "Product Name",
8715
+ sortable: true,
8716
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary hover:underline cursor-pointer", children: value })
8717
+ },
8718
+ {
8719
+ key: "cipStatus",
8720
+ title: "CIP status",
8721
+ sortable: true,
8722
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx(CIPStatusBadge, { status: value })
8723
+ },
8724
+ {
8725
+ key: "status",
8726
+ title: "Status",
8727
+ sortable: true,
8728
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value?.toUpperCase() })
8729
+ },
8730
+ {
8731
+ key: "created",
8732
+ title: "Created",
8733
+ sortable: true
8734
+ },
8735
+ {
8736
+ key: "modified",
8737
+ title: "Modified",
8738
+ sortable: true
8739
+ }
8740
+ ];
8741
+ var BusinessesView = ({
8742
+ filters,
8743
+ sortedData,
8744
+ sortBy,
8745
+ sortDirection,
8746
+ onFilterChange,
8747
+ onResetFilters,
8748
+ onSort,
8749
+ onRowClick,
8750
+ onCreateBusiness
8751
+ }) => {
8752
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
8753
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
8754
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: "Businesses" }) }),
8755
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8756
+ /* @__PURE__ */ jsxRuntime.jsx(
8757
+ BusinessFiltersSheet,
8758
+ {
8759
+ filters,
8760
+ onFilterChange,
8761
+ onResetFilters
8762
+ }
8763
+ ),
8764
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onCreateBusiness, children: "Create Business" })
8447
8765
  ] })
8448
8766
  ] }) }) }),
8449
8767
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
8450
8768
  DataTable,
8451
8769
  {
8452
8770
  columns: columns2,
8453
- data: sortedBusinesses,
8771
+ data: sortedData,
8454
8772
  sortBy,
8455
8773
  sortDirection,
8456
- onSort: handleSort,
8457
- onRowClick: handleRowClick
8774
+ onSort,
8775
+ onRowClick
8458
8776
  }
8459
8777
  ) }) }) })
8460
8778
  ] });
8461
8779
  };
8780
+ var Businesses = () => {
8781
+ const navigate = reactRouterDom.useNavigate();
8782
+ const [filters, setFilters] = React15.useState({
8783
+ name: "",
8784
+ productName: "",
8785
+ status: "",
8786
+ createdDateStart: void 0,
8787
+ createdDateEnd: void 0
8788
+ });
8789
+ const [sortBy, setSortBy] = React15.useState("created");
8790
+ const [sortDirection, setSortDirection] = React15.useState("desc");
8791
+ const filteredData = React15.useMemo(() => {
8792
+ return mockBusinessesList.filter((business) => {
8793
+ if (filters.name && !business.businessName.toLowerCase().includes(filters.name.toLowerCase())) {
8794
+ return false;
8795
+ }
8796
+ if (filters.productName && !business.productName.toLowerCase().includes(filters.productName.toLowerCase())) {
8797
+ return false;
8798
+ }
8799
+ if (filters.status && business.status.toLowerCase() !== filters.status.toLowerCase()) {
8800
+ return false;
8801
+ }
8802
+ if (filters.createdDateStart || filters.createdDateEnd) {
8803
+ const created = new Date(business.created);
8804
+ if (filters.createdDateStart && created < filters.createdDateStart) {
8805
+ return false;
8806
+ }
8807
+ if (filters.createdDateEnd && created > filters.createdDateEnd) {
8808
+ return false;
8809
+ }
8810
+ }
8811
+ return true;
8812
+ });
8813
+ }, [filters]);
8814
+ const sortedData = React15.useMemo(() => {
8815
+ return [...filteredData].sort((a, b) => {
8816
+ const aValue = a[sortBy];
8817
+ const bValue = b[sortBy];
8818
+ if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
8819
+ if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
8820
+ return 0;
8821
+ });
8822
+ }, [filteredData, sortBy, sortDirection]);
8823
+ const handleFilterChange = React15.useCallback((field, value) => {
8824
+ setFilters((prev) => ({ ...prev, [field]: value }));
8825
+ }, []);
8826
+ const resetFilters = React15.useCallback(() => {
8827
+ setFilters({
8828
+ name: "",
8829
+ productName: "",
8830
+ status: "",
8831
+ createdDateStart: void 0,
8832
+ createdDateEnd: void 0
8833
+ });
8834
+ }, []);
8835
+ const handleSort = React15.useCallback((key) => {
8836
+ if (sortBy === key) {
8837
+ setSortDirection((prev) => prev === "asc" ? "desc" : "asc");
8838
+ } else {
8839
+ setSortBy(key);
8840
+ setSortDirection("asc");
8841
+ }
8842
+ }, [sortBy]);
8843
+ const handleRowClick = React15.useCallback((business) => {
8844
+ navigate(`/business/${business.id}`);
8845
+ }, [navigate]);
8846
+ const handleCreateBusiness = React15.useCallback(() => {
8847
+ navigate("/business/create");
8848
+ }, [navigate]);
8849
+ return /* @__PURE__ */ jsxRuntime.jsx(
8850
+ BusinessesView,
8851
+ {
8852
+ filters,
8853
+ sortedData,
8854
+ sortBy,
8855
+ sortDirection,
8856
+ onFilterChange: handleFilterChange,
8857
+ onResetFilters: resetFilters,
8858
+ onSort: handleSort,
8859
+ onRowClick: handleRowClick,
8860
+ onCreateBusiness: handleCreateBusiness
8861
+ }
8862
+ );
8863
+ };
8462
8864
  var Businesses_default = Businesses;
8463
8865
  var typeConfig3 = {
8464
8866
  Individual: {
@@ -8684,7 +9086,7 @@ var mockBusinessAccounts = {
8684
9086
  ]
8685
9087
  };
8686
9088
  var UBOCard = ({ ubos }) => {
8687
- const columns2 = [
9089
+ const columns3 = [
8688
9090
  {
8689
9091
  key: "name",
8690
9092
  title: "Name",
@@ -8728,7 +9130,7 @@ var UBOCard = ({ ubos }) => {
8728
9130
  ] }) : /* @__PURE__ */ jsxRuntime.jsx(
8729
9131
  DataTable,
8730
9132
  {
8731
- columns: columns2,
9133
+ columns: columns3,
8732
9134
  data: ubos
8733
9135
  }
8734
9136
  ) })
@@ -9135,302 +9537,62 @@ var Business = () => {
9135
9537
  );
9136
9538
  };
9137
9539
  var BusinessDetail_default = Business;
9540
+ var defaultBusinessFormValues = {
9541
+ legalName: "",
9542
+ dbaName: "",
9543
+ businessType: "",
9544
+ taxId: "",
9545
+ formationDate: "",
9546
+ idType: "EIN",
9547
+ incorporationState: "",
9548
+ website: "",
9549
+ email: "",
9550
+ mobilePhone: "",
9551
+ mcc: "",
9552
+ naics: "",
9553
+ achCompanyId: "",
9554
+ achCompanyName: "",
9555
+ externalId: "",
9556
+ contactFirstName: "",
9557
+ contactLastName: "",
9558
+ contactEmail: "",
9559
+ contactPhone: "",
9560
+ address: {
9561
+ streetAddress: "",
9562
+ apartment: "",
9563
+ city: "",
9564
+ state: "",
9565
+ postalCode: "",
9566
+ country: "US",
9567
+ addressType: "business"
9568
+ }
9569
+ };
9138
9570
  var CreateBusiness = () => {
9139
9571
  const navigate = reactRouterDom.useNavigate();
9140
9572
  const [businessType, setBusinessType] = React15.useState("");
9141
9573
  const form = reactHookForm.useForm({
9142
9574
  resolver: zod$1.zodResolver(businessProfileSchema),
9143
- defaultValues: {
9144
- legalName: "",
9145
- dbaName: "",
9146
- businessType: "",
9147
- taxId: "",
9148
- formationDate: "",
9149
- idType: "EIN",
9150
- incorporationState: "",
9151
- website: "",
9152
- email: "",
9153
- mobilePhone: "",
9154
- mcc: "",
9155
- naics: "",
9156
- achCompanyId: "",
9157
- achCompanyName: "",
9158
- externalId: "",
9159
- contactFirstName: "",
9160
- contactLastName: "",
9161
- contactEmail: "",
9162
- contactPhone: "",
9163
- address: {
9164
- streetAddress: "",
9165
- apartment: "",
9166
- city: "",
9167
- state: "",
9168
- postalCode: "",
9169
- country: "US",
9170
- addressType: "business"
9171
- }
9172
- }
9575
+ defaultValues: defaultBusinessFormValues
9173
9576
  });
9174
- const onSubmit = (data) => {
9577
+ const onSubmit = React15.useCallback((data) => {
9175
9578
  console.log("Business data:", data);
9176
9579
  navigate("/business");
9177
- };
9580
+ }, [navigate]);
9581
+ const handleCancel = React15.useCallback(() => {
9582
+ navigate("/business");
9583
+ }, [navigate]);
9584
+ const handleBusinessTypeChange = React15.useCallback((value) => {
9585
+ setBusinessType(value);
9586
+ form.setValue("businessType", value);
9587
+ }, [form]);
9178
9588
  return /* @__PURE__ */ jsxRuntime.jsx(
9179
- PageLayout,
9589
+ CreateBusinessView,
9180
9590
  {
9181
- title: "Create Business",
9182
- actions: [
9183
- { label: "Cancel", variant: "outline", onClick: () => navigate("/business") },
9184
- { label: "Create Business", variant: "default", onClick: form.handleSubmit(onSubmit) }
9185
- ],
9186
- children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-6", children: [
9187
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
9188
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Business Information" }) }),
9189
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
9190
- /* @__PURE__ */ jsxRuntime.jsx(
9191
- EnhancedInput,
9192
- {
9193
- label: "Legal Name",
9194
- placeholder: "Enter legal business name",
9195
- required: true,
9196
- ...form.register("legalName")
9197
- }
9198
- ),
9199
- /* @__PURE__ */ jsxRuntime.jsx(
9200
- EnhancedInput,
9201
- {
9202
- label: "DBA Name",
9203
- placeholder: "Enter DBA name",
9204
- hint: "Doing Business As name",
9205
- ...form.register("dbaName")
9206
- }
9207
- ),
9208
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
9209
- /* @__PURE__ */ jsxRuntime.jsx(
9210
- EnhancedSelect,
9211
- {
9212
- label: "Business Type",
9213
- placeholder: "Select business type",
9214
- value: businessType,
9215
- onValueChange: (value) => {
9216
- setBusinessType(value);
9217
- form.setValue("businessType", value);
9218
- },
9219
- options: [
9220
- { value: "corporation", label: "Corporation" },
9221
- { value: "llc", label: "LLC" },
9222
- { value: "partnership", label: "Partnership" },
9223
- { value: "sole_proprietorship", label: "Sole Proprietorship" }
9224
- ]
9225
- }
9226
- ),
9227
- businessType && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
9228
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "Preview:" }),
9229
- /* @__PURE__ */ jsxRuntime.jsx(BusinessTypeBadge, { type: businessType })
9230
- ] })
9231
- ] }),
9232
- /* @__PURE__ */ jsxRuntime.jsx(
9233
- EnhancedInput,
9234
- {
9235
- label: "Tax ID (EIN)",
9236
- placeholder: "12-3456789",
9237
- hint: "Employer Identification Number",
9238
- required: true,
9239
- ...form.register("taxId")
9240
- }
9241
- ),
9242
- /* @__PURE__ */ jsxRuntime.jsx(
9243
- EnhancedInput,
9244
- {
9245
- label: "Formation Date",
9246
- placeholder: "YYYY-MM-DD",
9247
- type: "date",
9248
- ...form.register("formationDate")
9249
- }
9250
- ),
9251
- /* @__PURE__ */ jsxRuntime.jsx(
9252
- EnhancedInput,
9253
- {
9254
- label: "Incorporation State",
9255
- placeholder: "Enter state",
9256
- ...form.register("incorporationState")
9257
- }
9258
- ),
9259
- /* @__PURE__ */ jsxRuntime.jsx(
9260
- EnhancedInput,
9261
- {
9262
- label: "Website",
9263
- placeholder: "https://www.business.com",
9264
- type: "url",
9265
- ...form.register("website")
9266
- }
9267
- ),
9268
- /* @__PURE__ */ jsxRuntime.jsx(
9269
- EnhancedInput,
9270
- {
9271
- label: "Email Address",
9272
- placeholder: "contact@business.com",
9273
- type: "email",
9274
- ...form.register("email")
9275
- }
9276
- ),
9277
- /* @__PURE__ */ jsxRuntime.jsx(
9278
- EnhancedInput,
9279
- {
9280
- label: "Mobile Phone",
9281
- placeholder: "+1 (555) 123-4567",
9282
- ...form.register("mobilePhone")
9283
- }
9284
- ),
9285
- /* @__PURE__ */ jsxRuntime.jsx(
9286
- EnhancedInput,
9287
- {
9288
- label: "MCC",
9289
- placeholder: "1234",
9290
- hint: "4-digit Merchant Category Code",
9291
- ...form.register("mcc")
9292
- }
9293
- ),
9294
- /* @__PURE__ */ jsxRuntime.jsx(
9295
- EnhancedInput,
9296
- {
9297
- label: "NAICS",
9298
- placeholder: "123456",
9299
- hint: "6-digit industry classification",
9300
- ...form.register("naics")
9301
- }
9302
- ),
9303
- /* @__PURE__ */ jsxRuntime.jsx(
9304
- EnhancedInput,
9305
- {
9306
- label: "ACH Company ID",
9307
- placeholder: "1234567890",
9308
- hint: "10-digit ACH identifier",
9309
- ...form.register("achCompanyId")
9310
- }
9311
- ),
9312
- /* @__PURE__ */ jsxRuntime.jsx(
9313
- EnhancedInput,
9314
- {
9315
- label: "ACH Company Name",
9316
- placeholder: "Enter ACH company name",
9317
- ...form.register("achCompanyName")
9318
- }
9319
- ),
9320
- /* @__PURE__ */ jsxRuntime.jsx(
9321
- EnhancedInput,
9322
- {
9323
- label: "External ID",
9324
- placeholder: "UUID format",
9325
- hint: "External system identifier",
9326
- ...form.register("externalId")
9327
- }
9328
- )
9329
- ] })
9330
- ] }),
9331
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
9332
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Business Address" }) }),
9333
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
9334
- /* @__PURE__ */ jsxRuntime.jsx(
9335
- EnhancedInput,
9336
- {
9337
- label: "Street Address",
9338
- placeholder: "Enter street address",
9339
- required: true,
9340
- ...form.register("address.streetAddress")
9341
- }
9342
- ),
9343
- /* @__PURE__ */ jsxRuntime.jsx(
9344
- EnhancedInput,
9345
- {
9346
- label: "Apartment/Suite",
9347
- placeholder: "Enter apartment or suite number",
9348
- ...form.register("address.apartment")
9349
- }
9350
- ),
9351
- /* @__PURE__ */ jsxRuntime.jsx(
9352
- EnhancedInput,
9353
- {
9354
- label: "City",
9355
- placeholder: "Enter city",
9356
- required: true,
9357
- ...form.register("address.city")
9358
- }
9359
- ),
9360
- /* @__PURE__ */ jsxRuntime.jsx(
9361
- EnhancedInput,
9362
- {
9363
- label: "State",
9364
- placeholder: "Enter state",
9365
- required: true,
9366
- ...form.register("address.state")
9367
- }
9368
- ),
9369
- /* @__PURE__ */ jsxRuntime.jsx(
9370
- EnhancedInput,
9371
- {
9372
- label: "Postal Code",
9373
- placeholder: "12345",
9374
- required: true,
9375
- ...form.register("address.postalCode")
9376
- }
9377
- ),
9378
- /* @__PURE__ */ jsxRuntime.jsx(
9379
- EnhancedSelect,
9380
- {
9381
- label: "Country",
9382
- placeholder: "Select country",
9383
- value: form.watch("address.country"),
9384
- onValueChange: (value) => form.setValue("address.country", value),
9385
- options: [
9386
- { value: "US", label: "United States" },
9387
- { value: "CA", label: "Canada" },
9388
- { value: "GB", label: "United Kingdom" },
9389
- { value: "DE", label: "Germany" }
9390
- ]
9391
- }
9392
- )
9393
- ] })
9394
- ] }),
9395
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
9396
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Contact Information" }) }),
9397
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
9398
- /* @__PURE__ */ jsxRuntime.jsx(
9399
- EnhancedInput,
9400
- {
9401
- label: "Contact First Name",
9402
- placeholder: "Enter first name",
9403
- ...form.register("contactFirstName")
9404
- }
9405
- ),
9406
- /* @__PURE__ */ jsxRuntime.jsx(
9407
- EnhancedInput,
9408
- {
9409
- label: "Contact Last Name",
9410
- placeholder: "Enter last name",
9411
- ...form.register("contactLastName")
9412
- }
9413
- ),
9414
- /* @__PURE__ */ jsxRuntime.jsx(
9415
- EnhancedInput,
9416
- {
9417
- label: "Contact Email",
9418
- placeholder: "contact@business.com",
9419
- type: "email",
9420
- ...form.register("contactEmail")
9421
- }
9422
- ),
9423
- /* @__PURE__ */ jsxRuntime.jsx(
9424
- EnhancedInput,
9425
- {
9426
- label: "Contact Phone",
9427
- placeholder: "+1 (555) 123-4567",
9428
- ...form.register("contactPhone")
9429
- }
9430
- )
9431
- ] })
9432
- ] })
9433
- ] })
9591
+ form,
9592
+ businessType,
9593
+ onBusinessTypeChange: handleBusinessTypeChange,
9594
+ onSubmit,
9595
+ onCancel: handleCancel
9434
9596
  }
9435
9597
  );
9436
9598
  };
@@ -9602,7 +9764,7 @@ var Counterparties = () => {
9602
9764
  const handleRowClick = (counterparty) => {
9603
9765
  navigate(`/counterparty/${counterparty.id}`);
9604
9766
  };
9605
- const columns2 = [
9767
+ const columns3 = [
9606
9768
  {
9607
9769
  key: "id",
9608
9770
  title: "Counterparty ID",
@@ -9741,7 +9903,7 @@ var Counterparties = () => {
9741
9903
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
9742
9904
  DataTable,
9743
9905
  {
9744
- columns: columns2,
9906
+ columns: columns3,
9745
9907
  data: sortedCounterparties,
9746
9908
  sortBy,
9747
9909
  sortDirection,
@@ -10225,7 +10387,7 @@ var Individuals = () => {
10225
10387
  const handleRowClick = (row) => {
10226
10388
  navigate(`/individual/${row.id}`);
10227
10389
  };
10228
- const columns2 = [
10390
+ const columns3 = [
10229
10391
  {
10230
10392
  key: "id",
10231
10393
  title: "Individual ID",
@@ -10359,7 +10521,7 @@ var Individuals = () => {
10359
10521
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
10360
10522
  DataTable,
10361
10523
  {
10362
- columns: columns2,
10524
+ columns: columns3,
10363
10525
  data: sortedIndividuals,
10364
10526
  sortBy,
10365
10527
  sortDirection,
@@ -12817,6 +12979,7 @@ exports.BeneficiaryCard = BeneficiaryCard;
12817
12979
  exports.BeneficiaryDomesticWire = BeneficiaryDomesticWire;
12818
12980
  exports.Breadcrumb = Breadcrumb;
12819
12981
  exports.BusinessDetail = BusinessDetail_default;
12982
+ exports.BusinessFiltersSheet = BusinessFiltersSheet;
12820
12983
  exports.BusinessProfileCard = BusinessProfileCard;
12821
12984
  exports.BusinessStatusCard = BusinessStatusCard;
12822
12985
  exports.BusinessTypeBadge = BusinessTypeBadge;
@@ -12842,6 +13005,7 @@ exports.CounterpartyProfileCard = CounterpartyProfileCard;
12842
13005
  exports.CounterpartyRecordsCard = CounterpartyRecordsCard;
12843
13006
  exports.CounterpartyTypeBadge = CounterpartyTypeBadge;
12844
13007
  exports.CreateBusiness = Create_default;
13008
+ exports.CreateBusinessView = CreateBusinessView;
12845
13009
  exports.CreateCounterparty = Create_default2;
12846
13010
  exports.CreateIndividual = Create_default3;
12847
13011
  exports.Dashboard = Dashboard_default;
@@ -12985,6 +13149,8 @@ exports.reducer = reducer;
12985
13149
  exports.textareaVariants = textareaVariants;
12986
13150
  exports.toast = toast;
12987
13151
  exports.useAlertDetail = useAlertDetail;
13152
+ exports.useBusinessFilters = useBusinessFilters;
13153
+ exports.useBusinessSort = useBusinessSort;
12988
13154
  exports.useEditState = useEditState;
12989
13155
  exports.useFormWithEditState = useFormWithEditState;
12990
13156
  exports.useIsMobile = useIsMobile;