braid-ui 1.0.21 → 1.0.23
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 +662 -498
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -1
- package/dist/index.d.ts +44 -1
- package/dist/index.js +661 -499
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/tailwind.config.standalone.d.ts +0 -1
- package/tailwind.preset.d.ts +0 -1
package/dist/index.cjs
CHANGED
|
@@ -4109,7 +4109,7 @@ var columnClasses = {
|
|
|
4109
4109
|
4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
|
|
4110
4110
|
};
|
|
4111
4111
|
var DataGrid = React15__namespace.forwardRef(
|
|
4112
|
-
({ data, columns:
|
|
4112
|
+
({ data, columns: columns3 = 2, gap = "md", className }, ref) => {
|
|
4113
4113
|
const isItemArray = data.length > 0 && "label" in data[0];
|
|
4114
4114
|
if (isItemArray) {
|
|
4115
4115
|
const items = data;
|
|
@@ -4119,7 +4119,7 @@ var DataGrid = React15__namespace.forwardRef(
|
|
|
4119
4119
|
ref,
|
|
4120
4120
|
className: cn(
|
|
4121
4121
|
"grid",
|
|
4122
|
-
columnClasses[
|
|
4122
|
+
columnClasses[columns3],
|
|
4123
4123
|
gapClasses2[gap],
|
|
4124
4124
|
className
|
|
4125
4125
|
),
|
|
@@ -4140,7 +4140,7 @@ var DataGrid = React15__namespace.forwardRef(
|
|
|
4140
4140
|
section.title && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: section.title }),
|
|
4141
4141
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
4142
4142
|
"grid",
|
|
4143
|
-
columnClasses[
|
|
4143
|
+
columnClasses[columns3],
|
|
4144
4144
|
gapClasses2[gap]
|
|
4145
4145
|
), children: section.items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4146
4146
|
InfoField,
|
|
@@ -4885,7 +4885,7 @@ var FormSection = React15__namespace.forwardRef(
|
|
|
4885
4885
|
className,
|
|
4886
4886
|
spacing: spacing2 = "md",
|
|
4887
4887
|
layout = "vertical",
|
|
4888
|
-
columns:
|
|
4888
|
+
columns: columns3 = 2
|
|
4889
4889
|
}, ref) => {
|
|
4890
4890
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-4", className), children: [
|
|
4891
4891
|
(title || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
@@ -4893,7 +4893,7 @@ var FormSection = React15__namespace.forwardRef(
|
|
|
4893
4893
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description })
|
|
4894
4894
|
] }),
|
|
4895
4895
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
4896
|
-
layout === "grid" ? `grid gap-4 ${gridClasses[
|
|
4896
|
+
layout === "grid" ? `grid gap-4 ${gridClasses[columns3]}` : spacingClasses[spacing2]
|
|
4897
4897
|
), children })
|
|
4898
4898
|
] });
|
|
4899
4899
|
}
|
|
@@ -5872,7 +5872,7 @@ function DatePicker({
|
|
|
5872
5872
|
return picker;
|
|
5873
5873
|
}
|
|
5874
5874
|
function DataTable({
|
|
5875
|
-
columns:
|
|
5875
|
+
columns: columns3,
|
|
5876
5876
|
data,
|
|
5877
5877
|
sortBy,
|
|
5878
5878
|
sortDirection,
|
|
@@ -5911,7 +5911,7 @@ function DataTable({
|
|
|
5911
5911
|
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
5912
|
}
|
|
5913
5913
|
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:
|
|
5914
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b bg-muted/50", children: columns3.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5915
5915
|
"th",
|
|
5916
5916
|
{
|
|
5917
5917
|
style: column.width ? { width: column.width } : void 0,
|
|
@@ -5936,7 +5936,7 @@ function DataTable({
|
|
|
5936
5936
|
},
|
|
5937
5937
|
column.key
|
|
5938
5938
|
)) }) }),
|
|
5939
|
-
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan:
|
|
5939
|
+
/* @__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
5940
|
"tr",
|
|
5941
5941
|
{
|
|
5942
5942
|
className: cn(
|
|
@@ -5944,7 +5944,7 @@ function DataTable({
|
|
|
5944
5944
|
onRowClick && "cursor-pointer"
|
|
5945
5945
|
),
|
|
5946
5946
|
onClick: () => onRowClick?.(row),
|
|
5947
|
-
children:
|
|
5947
|
+
children: columns3.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5948
5948
|
"td",
|
|
5949
5949
|
{
|
|
5950
5950
|
style: column.width ? { width: column.width } : void 0,
|
|
@@ -7805,6 +7805,90 @@ var useAlertDetail = (id) => {
|
|
|
7805
7805
|
handleResolveAlert
|
|
7806
7806
|
};
|
|
7807
7807
|
};
|
|
7808
|
+
var useBusinessFilters = ({ initialData }) => {
|
|
7809
|
+
const [filteredData, setFilteredData] = React15.useState(initialData);
|
|
7810
|
+
const [filters, setFilters] = React15.useState({
|
|
7811
|
+
name: "",
|
|
7812
|
+
productName: "",
|
|
7813
|
+
status: "",
|
|
7814
|
+
createdDateStart: void 0,
|
|
7815
|
+
createdDateEnd: void 0
|
|
7816
|
+
});
|
|
7817
|
+
const handleFilterChange = React15.useCallback((field, value) => {
|
|
7818
|
+
setFilters((prev) => ({ ...prev, [field]: value }));
|
|
7819
|
+
}, []);
|
|
7820
|
+
const applyFilters = React15.useCallback(() => {
|
|
7821
|
+
let filtered = initialData;
|
|
7822
|
+
if (filters.name) {
|
|
7823
|
+
filtered = filtered.filter(
|
|
7824
|
+
(business) => business.businessName.toLowerCase().includes(filters.name.toLowerCase())
|
|
7825
|
+
);
|
|
7826
|
+
}
|
|
7827
|
+
if (filters.productName) {
|
|
7828
|
+
filtered = filtered.filter(
|
|
7829
|
+
(business) => business.productName.toLowerCase().includes(filters.productName.toLowerCase())
|
|
7830
|
+
);
|
|
7831
|
+
}
|
|
7832
|
+
if (filters.status) {
|
|
7833
|
+
filtered = filtered.filter((business) => business.status === filters.status);
|
|
7834
|
+
}
|
|
7835
|
+
if (filters.createdDateStart) {
|
|
7836
|
+
filtered = filtered.filter(
|
|
7837
|
+
(business) => new Date(business.created) >= filters.createdDateStart
|
|
7838
|
+
);
|
|
7839
|
+
}
|
|
7840
|
+
if (filters.createdDateEnd) {
|
|
7841
|
+
filtered = filtered.filter(
|
|
7842
|
+
(business) => new Date(business.created) <= filters.createdDateEnd
|
|
7843
|
+
);
|
|
7844
|
+
}
|
|
7845
|
+
setFilteredData(filtered);
|
|
7846
|
+
}, [filters, initialData]);
|
|
7847
|
+
const resetFilters = React15.useCallback(() => {
|
|
7848
|
+
setFilters({
|
|
7849
|
+
name: "",
|
|
7850
|
+
productName: "",
|
|
7851
|
+
status: "",
|
|
7852
|
+
createdDateStart: void 0,
|
|
7853
|
+
createdDateEnd: void 0
|
|
7854
|
+
});
|
|
7855
|
+
setFilteredData(initialData);
|
|
7856
|
+
}, [initialData]);
|
|
7857
|
+
return {
|
|
7858
|
+
filters,
|
|
7859
|
+
filteredData,
|
|
7860
|
+
handleFilterChange,
|
|
7861
|
+
applyFilters,
|
|
7862
|
+
resetFilters
|
|
7863
|
+
};
|
|
7864
|
+
};
|
|
7865
|
+
var useBusinessSort = ({ data }) => {
|
|
7866
|
+
const [sortBy, setSortBy] = React15.useState("created");
|
|
7867
|
+
const [sortDirection, setSortDirection] = React15.useState("desc");
|
|
7868
|
+
const handleSort = React15.useCallback((key) => {
|
|
7869
|
+
if (sortBy === key) {
|
|
7870
|
+
setSortDirection((prev) => prev === "asc" ? "desc" : "asc");
|
|
7871
|
+
} else {
|
|
7872
|
+
setSortBy(key);
|
|
7873
|
+
setSortDirection("asc");
|
|
7874
|
+
}
|
|
7875
|
+
}, [sortBy]);
|
|
7876
|
+
const sortedData = React15.useMemo(() => {
|
|
7877
|
+
return [...data].sort((a, b) => {
|
|
7878
|
+
const aValue = a[sortBy];
|
|
7879
|
+
const bValue = b[sortBy];
|
|
7880
|
+
if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
|
|
7881
|
+
if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
|
|
7882
|
+
return 0;
|
|
7883
|
+
});
|
|
7884
|
+
}, [data, sortBy, sortDirection]);
|
|
7885
|
+
return {
|
|
7886
|
+
sortBy,
|
|
7887
|
+
sortDirection,
|
|
7888
|
+
sortedData,
|
|
7889
|
+
handleSort
|
|
7890
|
+
};
|
|
7891
|
+
};
|
|
7808
7892
|
var AlertDetail = () => {
|
|
7809
7893
|
const { id } = reactRouterDom.useParams();
|
|
7810
7894
|
const navigate = reactRouterDom.useNavigate();
|
|
@@ -8253,212 +8337,530 @@ var mockBusinessesList = [
|
|
|
8253
8337
|
modified: "2025-10-01"
|
|
8254
8338
|
}
|
|
8255
8339
|
];
|
|
8256
|
-
var
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
}
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
}
|
|
8340
|
+
var BusinessFiltersSheet = ({
|
|
8341
|
+
filters,
|
|
8342
|
+
onFilterChange,
|
|
8343
|
+
onResetFilters
|
|
8344
|
+
}) => {
|
|
8345
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
|
|
8346
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
|
|
8347
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
|
|
8348
|
+
"Filters"
|
|
8349
|
+
] }) }),
|
|
8350
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
|
|
8351
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Business Filters" }) }),
|
|
8352
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
|
|
8353
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8354
|
+
EnhancedInput,
|
|
8355
|
+
{
|
|
8356
|
+
label: "Name",
|
|
8357
|
+
value: filters.name,
|
|
8358
|
+
onChange: (e) => onFilterChange("name", e.target.value),
|
|
8359
|
+
placeholder: "Enter business name"
|
|
8360
|
+
}
|
|
8361
|
+
),
|
|
8362
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8363
|
+
EnhancedInput,
|
|
8364
|
+
{
|
|
8365
|
+
label: "Product Name",
|
|
8366
|
+
value: filters.productName,
|
|
8367
|
+
onChange: (e) => onFilterChange("productName", e.target.value),
|
|
8368
|
+
placeholder: "Enter product name"
|
|
8369
|
+
}
|
|
8370
|
+
),
|
|
8371
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8372
|
+
EnhancedSelect,
|
|
8373
|
+
{
|
|
8374
|
+
label: "Status",
|
|
8375
|
+
value: filters.status,
|
|
8376
|
+
onValueChange: (value) => onFilterChange("status", value),
|
|
8377
|
+
placeholder: "Select status",
|
|
8378
|
+
options: [
|
|
8379
|
+
{ value: "active", label: "Active" },
|
|
8380
|
+
{ value: "inactive", label: "Inactive" },
|
|
8381
|
+
{ value: "suspended", label: "Suspended" }
|
|
8382
|
+
]
|
|
8383
|
+
}
|
|
8384
|
+
),
|
|
8385
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
8386
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
8387
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
|
|
8388
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8389
|
+
DatePicker,
|
|
8390
|
+
{
|
|
8391
|
+
date: filters.createdDateStart,
|
|
8392
|
+
onDateChange: (date) => onFilterChange("createdDateStart", date),
|
|
8393
|
+
placeholder: "MM/DD/YYYY",
|
|
8394
|
+
buttonClassName: "w-full",
|
|
8395
|
+
className: "bg-background z-50"
|
|
8396
|
+
}
|
|
8397
|
+
)
|
|
8398
|
+
] }),
|
|
8399
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
8400
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
|
|
8401
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8402
|
+
DatePicker,
|
|
8403
|
+
{
|
|
8404
|
+
date: filters.createdDateEnd,
|
|
8405
|
+
onDateChange: (date) => onFilterChange("createdDateEnd", date),
|
|
8406
|
+
placeholder: "MM/DD/YYYY",
|
|
8407
|
+
buttonClassName: "w-full",
|
|
8408
|
+
className: "bg-background z-50"
|
|
8409
|
+
}
|
|
8410
|
+
)
|
|
8411
|
+
] })
|
|
8412
|
+
] })
|
|
8413
|
+
] }),
|
|
8414
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
|
|
8415
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: onResetFilters, children: "Reset Filters" }),
|
|
8416
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: () => {
|
|
8417
|
+
}, children: "Apply Filters" })
|
|
8418
|
+
] })
|
|
8419
|
+
] })
|
|
8420
|
+
] });
|
|
8421
|
+
};
|
|
8422
|
+
var columns2 = [
|
|
8423
|
+
{
|
|
8424
|
+
key: "id",
|
|
8425
|
+
title: "Business ID",
|
|
8426
|
+
sortable: true
|
|
8427
|
+
},
|
|
8428
|
+
{
|
|
8429
|
+
key: "businessName",
|
|
8430
|
+
title: "Business Name",
|
|
8431
|
+
sortable: true
|
|
8432
|
+
},
|
|
8433
|
+
{
|
|
8434
|
+
key: "productName",
|
|
8435
|
+
title: "Product Name",
|
|
8436
|
+
sortable: true,
|
|
8437
|
+
render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary hover:underline cursor-pointer", children: value })
|
|
8438
|
+
},
|
|
8439
|
+
{
|
|
8440
|
+
key: "cipStatus",
|
|
8441
|
+
title: "CIP status",
|
|
8442
|
+
sortable: true,
|
|
8443
|
+
render: (value) => /* @__PURE__ */ jsxRuntime.jsx(CIPStatusBadge, { status: value })
|
|
8444
|
+
},
|
|
8445
|
+
{
|
|
8446
|
+
key: "status",
|
|
8447
|
+
title: "Status",
|
|
8448
|
+
sortable: true,
|
|
8449
|
+
render: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value?.toUpperCase() })
|
|
8450
|
+
},
|
|
8451
|
+
{
|
|
8452
|
+
key: "created",
|
|
8453
|
+
title: "Created",
|
|
8454
|
+
sortable: true
|
|
8455
|
+
},
|
|
8456
|
+
{
|
|
8457
|
+
key: "modified",
|
|
8458
|
+
title: "Modified",
|
|
8459
|
+
sortable: true
|
|
8460
|
+
}
|
|
8461
|
+
];
|
|
8462
|
+
var BusinessesView = ({
|
|
8463
|
+
filters,
|
|
8464
|
+
sortedData,
|
|
8465
|
+
sortBy,
|
|
8466
|
+
sortDirection,
|
|
8467
|
+
onFilterChange,
|
|
8468
|
+
onResetFilters,
|
|
8469
|
+
onSort,
|
|
8470
|
+
onRowClick,
|
|
8471
|
+
onCreateBusiness
|
|
8472
|
+
}) => {
|
|
8367
8473
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
|
|
8368
8474
|
/* @__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
8475
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: "Businesses" }) }),
|
|
8370
8476
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8371
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8441
|
-
|
|
8442
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
|
|
8443
|
-
] })
|
|
8477
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8478
|
+
BusinessFiltersSheet,
|
|
8479
|
+
{
|
|
8480
|
+
filters,
|
|
8481
|
+
onFilterChange,
|
|
8482
|
+
onResetFilters
|
|
8483
|
+
}
|
|
8484
|
+
),
|
|
8485
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onCreateBusiness, children: "Create Business" })
|
|
8486
|
+
] })
|
|
8487
|
+
] }) }) }),
|
|
8488
|
+
/* @__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(
|
|
8489
|
+
DataTable,
|
|
8490
|
+
{
|
|
8491
|
+
columns: columns2,
|
|
8492
|
+
data: sortedData,
|
|
8493
|
+
sortBy,
|
|
8494
|
+
sortDirection,
|
|
8495
|
+
onSort,
|
|
8496
|
+
onRowClick
|
|
8497
|
+
}
|
|
8498
|
+
) }) }) })
|
|
8499
|
+
] });
|
|
8500
|
+
};
|
|
8501
|
+
var BusinessForm = ({
|
|
8502
|
+
form,
|
|
8503
|
+
businessType,
|
|
8504
|
+
onBusinessTypeChange,
|
|
8505
|
+
onSubmit
|
|
8506
|
+
}) => {
|
|
8507
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-6", children: [
|
|
8508
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
|
|
8509
|
+
/* @__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" }) }),
|
|
8510
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
|
|
8511
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8512
|
+
EnhancedInput,
|
|
8513
|
+
{
|
|
8514
|
+
label: "Legal Name",
|
|
8515
|
+
placeholder: "Enter legal business name",
|
|
8516
|
+
required: true,
|
|
8517
|
+
...form.register("legalName")
|
|
8518
|
+
}
|
|
8519
|
+
),
|
|
8520
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8521
|
+
EnhancedInput,
|
|
8522
|
+
{
|
|
8523
|
+
label: "DBA Name",
|
|
8524
|
+
placeholder: "Enter DBA name",
|
|
8525
|
+
hint: "Doing Business As name",
|
|
8526
|
+
...form.register("dbaName")
|
|
8527
|
+
}
|
|
8528
|
+
),
|
|
8529
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
8530
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8531
|
+
EnhancedSelect,
|
|
8532
|
+
{
|
|
8533
|
+
label: "Business Type",
|
|
8534
|
+
placeholder: "Select business type",
|
|
8535
|
+
value: businessType,
|
|
8536
|
+
onValueChange: onBusinessTypeChange,
|
|
8537
|
+
options: [
|
|
8538
|
+
{ value: "corporation", label: "Corporation" },
|
|
8539
|
+
{ value: "llc", label: "LLC" },
|
|
8540
|
+
{ value: "partnership", label: "Partnership" },
|
|
8541
|
+
{ value: "sole_proprietorship", label: "Sole Proprietorship" }
|
|
8542
|
+
]
|
|
8543
|
+
}
|
|
8544
|
+
),
|
|
8545
|
+
businessType && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8546
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "Preview:" }),
|
|
8547
|
+
/* @__PURE__ */ jsxRuntime.jsx(BusinessTypeBadge, { type: businessType })
|
|
8444
8548
|
] })
|
|
8445
8549
|
] }),
|
|
8446
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8550
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8551
|
+
EnhancedInput,
|
|
8552
|
+
{
|
|
8553
|
+
label: "Tax ID (EIN)",
|
|
8554
|
+
placeholder: "12-3456789",
|
|
8555
|
+
hint: "Employer Identification Number",
|
|
8556
|
+
required: true,
|
|
8557
|
+
...form.register("taxId")
|
|
8558
|
+
}
|
|
8559
|
+
),
|
|
8560
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8561
|
+
EnhancedInput,
|
|
8562
|
+
{
|
|
8563
|
+
label: "Formation Date",
|
|
8564
|
+
placeholder: "YYYY-MM-DD",
|
|
8565
|
+
type: "date",
|
|
8566
|
+
...form.register("formationDate")
|
|
8567
|
+
}
|
|
8568
|
+
),
|
|
8569
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8570
|
+
EnhancedInput,
|
|
8571
|
+
{
|
|
8572
|
+
label: "Incorporation State",
|
|
8573
|
+
placeholder: "Enter state",
|
|
8574
|
+
...form.register("incorporationState")
|
|
8575
|
+
}
|
|
8576
|
+
),
|
|
8577
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8578
|
+
EnhancedInput,
|
|
8579
|
+
{
|
|
8580
|
+
label: "Website",
|
|
8581
|
+
placeholder: "https://www.business.com",
|
|
8582
|
+
type: "url",
|
|
8583
|
+
...form.register("website")
|
|
8584
|
+
}
|
|
8585
|
+
),
|
|
8586
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8587
|
+
EnhancedInput,
|
|
8588
|
+
{
|
|
8589
|
+
label: "Email Address",
|
|
8590
|
+
placeholder: "contact@business.com",
|
|
8591
|
+
type: "email",
|
|
8592
|
+
...form.register("email")
|
|
8593
|
+
}
|
|
8594
|
+
),
|
|
8595
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8596
|
+
EnhancedInput,
|
|
8597
|
+
{
|
|
8598
|
+
label: "Mobile Phone",
|
|
8599
|
+
placeholder: "+1 (555) 123-4567",
|
|
8600
|
+
...form.register("mobilePhone")
|
|
8601
|
+
}
|
|
8602
|
+
),
|
|
8603
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8604
|
+
EnhancedInput,
|
|
8605
|
+
{
|
|
8606
|
+
label: "MCC",
|
|
8607
|
+
placeholder: "1234",
|
|
8608
|
+
hint: "4-digit Merchant Category Code",
|
|
8609
|
+
...form.register("mcc")
|
|
8610
|
+
}
|
|
8611
|
+
),
|
|
8612
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8613
|
+
EnhancedInput,
|
|
8614
|
+
{
|
|
8615
|
+
label: "NAICS",
|
|
8616
|
+
placeholder: "123456",
|
|
8617
|
+
hint: "6-digit industry classification",
|
|
8618
|
+
...form.register("naics")
|
|
8619
|
+
}
|
|
8620
|
+
),
|
|
8621
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8622
|
+
EnhancedInput,
|
|
8623
|
+
{
|
|
8624
|
+
label: "ACH Company ID",
|
|
8625
|
+
placeholder: "1234567890",
|
|
8626
|
+
hint: "10-digit ACH identifier",
|
|
8627
|
+
...form.register("achCompanyId")
|
|
8628
|
+
}
|
|
8629
|
+
),
|
|
8630
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8631
|
+
EnhancedInput,
|
|
8632
|
+
{
|
|
8633
|
+
label: "ACH Company Name",
|
|
8634
|
+
placeholder: "Enter ACH company name",
|
|
8635
|
+
...form.register("achCompanyName")
|
|
8636
|
+
}
|
|
8637
|
+
),
|
|
8638
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8639
|
+
EnhancedInput,
|
|
8640
|
+
{
|
|
8641
|
+
label: "External ID",
|
|
8642
|
+
placeholder: "UUID format",
|
|
8643
|
+
hint: "External system identifier",
|
|
8644
|
+
...form.register("externalId")
|
|
8645
|
+
}
|
|
8646
|
+
)
|
|
8647
|
+
] })
|
|
8648
|
+
] }),
|
|
8649
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
|
|
8650
|
+
/* @__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" }) }),
|
|
8651
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
|
|
8652
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8653
|
+
EnhancedInput,
|
|
8654
|
+
{
|
|
8655
|
+
label: "Street Address",
|
|
8656
|
+
placeholder: "Enter street address",
|
|
8657
|
+
required: true,
|
|
8658
|
+
...form.register("address.streetAddress")
|
|
8659
|
+
}
|
|
8660
|
+
),
|
|
8661
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8662
|
+
EnhancedInput,
|
|
8663
|
+
{
|
|
8664
|
+
label: "Apartment/Suite",
|
|
8665
|
+
placeholder: "Enter apartment or suite number",
|
|
8666
|
+
...form.register("address.apartment")
|
|
8667
|
+
}
|
|
8668
|
+
),
|
|
8669
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8670
|
+
EnhancedInput,
|
|
8671
|
+
{
|
|
8672
|
+
label: "City",
|
|
8673
|
+
placeholder: "Enter city",
|
|
8674
|
+
required: true,
|
|
8675
|
+
...form.register("address.city")
|
|
8676
|
+
}
|
|
8677
|
+
),
|
|
8678
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8679
|
+
EnhancedInput,
|
|
8680
|
+
{
|
|
8681
|
+
label: "State",
|
|
8682
|
+
placeholder: "Enter state",
|
|
8683
|
+
required: true,
|
|
8684
|
+
...form.register("address.state")
|
|
8685
|
+
}
|
|
8686
|
+
),
|
|
8687
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8688
|
+
EnhancedInput,
|
|
8689
|
+
{
|
|
8690
|
+
label: "Postal Code",
|
|
8691
|
+
placeholder: "12345",
|
|
8692
|
+
required: true,
|
|
8693
|
+
...form.register("address.postalCode")
|
|
8694
|
+
}
|
|
8695
|
+
),
|
|
8696
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8697
|
+
EnhancedSelect,
|
|
8698
|
+
{
|
|
8699
|
+
label: "Country",
|
|
8700
|
+
placeholder: "Select country",
|
|
8701
|
+
value: form.watch("address.country"),
|
|
8702
|
+
onValueChange: (value) => form.setValue("address.country", value),
|
|
8703
|
+
options: [
|
|
8704
|
+
{ value: "US", label: "United States" },
|
|
8705
|
+
{ value: "CA", label: "Canada" },
|
|
8706
|
+
{ value: "GB", label: "United Kingdom" },
|
|
8707
|
+
{ value: "DE", label: "Germany" }
|
|
8708
|
+
]
|
|
8709
|
+
}
|
|
8710
|
+
)
|
|
8447
8711
|
] })
|
|
8448
|
-
] })
|
|
8449
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8450
|
-
|
|
8451
|
-
{
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8712
|
+
] }),
|
|
8713
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
|
|
8714
|
+
/* @__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" }) }),
|
|
8715
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
|
|
8716
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8717
|
+
EnhancedInput,
|
|
8718
|
+
{
|
|
8719
|
+
label: "Contact First Name",
|
|
8720
|
+
placeholder: "Enter first name",
|
|
8721
|
+
...form.register("contactFirstName")
|
|
8722
|
+
}
|
|
8723
|
+
),
|
|
8724
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8725
|
+
EnhancedInput,
|
|
8726
|
+
{
|
|
8727
|
+
label: "Contact Last Name",
|
|
8728
|
+
placeholder: "Enter last name",
|
|
8729
|
+
...form.register("contactLastName")
|
|
8730
|
+
}
|
|
8731
|
+
),
|
|
8732
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8733
|
+
EnhancedInput,
|
|
8734
|
+
{
|
|
8735
|
+
label: "Contact Email",
|
|
8736
|
+
placeholder: "contact@business.com",
|
|
8737
|
+
type: "email",
|
|
8738
|
+
...form.register("contactEmail")
|
|
8739
|
+
}
|
|
8740
|
+
),
|
|
8741
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8742
|
+
EnhancedInput,
|
|
8743
|
+
{
|
|
8744
|
+
label: "Contact Phone",
|
|
8745
|
+
placeholder: "+1 (555) 123-4567",
|
|
8746
|
+
...form.register("contactPhone")
|
|
8747
|
+
}
|
|
8748
|
+
)
|
|
8749
|
+
] })
|
|
8750
|
+
] })
|
|
8460
8751
|
] });
|
|
8461
8752
|
};
|
|
8753
|
+
var CreateBusinessView = ({
|
|
8754
|
+
form,
|
|
8755
|
+
businessType,
|
|
8756
|
+
onBusinessTypeChange,
|
|
8757
|
+
onSubmit,
|
|
8758
|
+
onCancel
|
|
8759
|
+
}) => {
|
|
8760
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8761
|
+
PageLayout,
|
|
8762
|
+
{
|
|
8763
|
+
title: "Create Business",
|
|
8764
|
+
actions: [
|
|
8765
|
+
{ label: "Cancel", variant: "outline", onClick: onCancel },
|
|
8766
|
+
{ label: "Create Business", variant: "default", onClick: form.handleSubmit(onSubmit) }
|
|
8767
|
+
],
|
|
8768
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8769
|
+
BusinessForm,
|
|
8770
|
+
{
|
|
8771
|
+
form,
|
|
8772
|
+
businessType,
|
|
8773
|
+
onBusinessTypeChange,
|
|
8774
|
+
onSubmit
|
|
8775
|
+
}
|
|
8776
|
+
)
|
|
8777
|
+
}
|
|
8778
|
+
);
|
|
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
|
|
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:
|
|
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
|
-
|
|
9589
|
+
CreateBusinessView,
|
|
9180
9590
|
{
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
10524
|
+
columns: columns3,
|
|
10363
10525
|
data: sortedIndividuals,
|
|
10364
10526
|
sortBy,
|
|
10365
10527
|
sortDirection,
|
|
@@ -12985,6 +13147,8 @@ exports.reducer = reducer;
|
|
|
12985
13147
|
exports.textareaVariants = textareaVariants;
|
|
12986
13148
|
exports.toast = toast;
|
|
12987
13149
|
exports.useAlertDetail = useAlertDetail;
|
|
13150
|
+
exports.useBusinessFilters = useBusinessFilters;
|
|
13151
|
+
exports.useBusinessSort = useBusinessSort;
|
|
12988
13152
|
exports.useEditState = useEditState;
|
|
12989
13153
|
exports.useFormWithEditState = useFormWithEditState;
|
|
12990
13154
|
exports.useIsMobile = useIsMobile;
|