braid-ui 1.0.37 → 1.0.38
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 +121 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +121 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5255,98 +5255,137 @@ var CreateBusinessView = ({
|
|
|
5255
5255
|
}
|
|
5256
5256
|
);
|
|
5257
5257
|
};
|
|
5258
|
+
var CounterpartyFiltersSheet = ({
|
|
5259
|
+
filters,
|
|
5260
|
+
onFilterChange,
|
|
5261
|
+
onResetFilters
|
|
5262
|
+
}) => {
|
|
5263
|
+
const [localFilters, setLocalFilters] = React15.useState(filters);
|
|
5264
|
+
const [open, setOpen] = React15.useState(false);
|
|
5265
|
+
React15.useEffect(() => {
|
|
5266
|
+
setLocalFilters(filters);
|
|
5267
|
+
}, [filters]);
|
|
5268
|
+
const handleLocalFilterChange = (field, value) => {
|
|
5269
|
+
setLocalFilters((prev) => ({ ...prev, [field]: value }));
|
|
5270
|
+
};
|
|
5271
|
+
const handleApplyFilters = () => {
|
|
5272
|
+
Object.entries(localFilters).forEach(([key, value]) => {
|
|
5273
|
+
onFilterChange(key, value);
|
|
5274
|
+
});
|
|
5275
|
+
setOpen(false);
|
|
5276
|
+
};
|
|
5277
|
+
const handleResetFilters = () => {
|
|
5278
|
+
const resetFilters = {
|
|
5279
|
+
name: "",
|
|
5280
|
+
type: "",
|
|
5281
|
+
status: "",
|
|
5282
|
+
createdDateStart: void 0,
|
|
5283
|
+
createdDateEnd: void 0
|
|
5284
|
+
};
|
|
5285
|
+
setLocalFilters(resetFilters);
|
|
5286
|
+
onResetFilters();
|
|
5287
|
+
setOpen(false);
|
|
5288
|
+
};
|
|
5289
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open, onOpenChange: setOpen, children: [
|
|
5290
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
|
|
5291
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
|
|
5292
|
+
"Filters"
|
|
5293
|
+
] }) }),
|
|
5294
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
|
|
5295
|
+
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Counterparty Filters" }) }),
|
|
5296
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
|
|
5297
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5298
|
+
EnhancedInput,
|
|
5299
|
+
{
|
|
5300
|
+
label: "Name",
|
|
5301
|
+
value: localFilters.name,
|
|
5302
|
+
onChange: (e) => handleLocalFilterChange("name", e.target.value),
|
|
5303
|
+
placeholder: "Enter counterparty name"
|
|
5304
|
+
}
|
|
5305
|
+
),
|
|
5306
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5307
|
+
EnhancedSelect,
|
|
5308
|
+
{
|
|
5309
|
+
label: "Type",
|
|
5310
|
+
value: localFilters.type,
|
|
5311
|
+
onValueChange: (value) => handleLocalFilterChange("type", value),
|
|
5312
|
+
placeholder: "Select type",
|
|
5313
|
+
options: [
|
|
5314
|
+
{ value: "BUSINESS", label: "Business" },
|
|
5315
|
+
{ value: "INDIVIDUAL", label: "Individual" }
|
|
5316
|
+
]
|
|
5317
|
+
}
|
|
5318
|
+
),
|
|
5319
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5320
|
+
EnhancedSelect,
|
|
5321
|
+
{
|
|
5322
|
+
label: "Status",
|
|
5323
|
+
value: localFilters.status,
|
|
5324
|
+
onValueChange: (value) => handleLocalFilterChange("status", value),
|
|
5325
|
+
placeholder: "Select status",
|
|
5326
|
+
options: [
|
|
5327
|
+
{ value: "ACTIVE", label: "Active" },
|
|
5328
|
+
{ value: "INACTIVE", label: "Inactive" },
|
|
5329
|
+
{ value: "PENDING", label: "Pending" },
|
|
5330
|
+
{ value: "SUSPENDED", label: "Suspended" }
|
|
5331
|
+
]
|
|
5332
|
+
}
|
|
5333
|
+
),
|
|
5334
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
5335
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
5336
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
|
|
5337
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5338
|
+
DatePicker,
|
|
5339
|
+
{
|
|
5340
|
+
date: localFilters.createdDateStart,
|
|
5341
|
+
onDateChange: (date) => handleLocalFilterChange("createdDateStart", date),
|
|
5342
|
+
placeholder: "MM/DD/YYYY",
|
|
5343
|
+
buttonClassName: "w-full",
|
|
5344
|
+
className: "bg-background z-50"
|
|
5345
|
+
}
|
|
5346
|
+
)
|
|
5347
|
+
] }),
|
|
5348
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
5349
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
|
|
5350
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5351
|
+
DatePicker,
|
|
5352
|
+
{
|
|
5353
|
+
date: localFilters.createdDateEnd,
|
|
5354
|
+
onDateChange: (date) => handleLocalFilterChange("createdDateEnd", date),
|
|
5355
|
+
placeholder: "MM/DD/YYYY",
|
|
5356
|
+
buttonClassName: "w-full",
|
|
5357
|
+
className: "bg-background z-50"
|
|
5358
|
+
}
|
|
5359
|
+
)
|
|
5360
|
+
] })
|
|
5361
|
+
] })
|
|
5362
|
+
] }),
|
|
5363
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "flex gap-2", children: [
|
|
5364
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleResetFilters, className: "flex-1", children: "Reset Filters" }),
|
|
5365
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleApplyFilters, className: "flex-1", children: "Apply Filters" })
|
|
5366
|
+
] })
|
|
5367
|
+
] })
|
|
5368
|
+
] });
|
|
5369
|
+
};
|
|
5258
5370
|
var CounterpartiesView = ({
|
|
5259
5371
|
table,
|
|
5260
5372
|
filters,
|
|
5261
5373
|
onFilterChange,
|
|
5262
5374
|
onResetFilters,
|
|
5263
|
-
onApplyFilters,
|
|
5264
5375
|
onCreateCounterparty
|
|
5265
5376
|
}) => {
|
|
5266
5377
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
|
|
5267
5378
|
/* @__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: [
|
|
5268
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground
|
|
5379
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground", children: "Counterparties" }) }),
|
|
5269
5380
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5270
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5279
|
-
EnhancedInput,
|
|
5280
|
-
{
|
|
5281
|
-
label: "Name",
|
|
5282
|
-
value: filters.name,
|
|
5283
|
-
onChange: (e) => onFilterChange("name", e.target.value),
|
|
5284
|
-
placeholder: "Enter counterparty name"
|
|
5285
|
-
}
|
|
5286
|
-
),
|
|
5287
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5288
|
-
EnhancedSelect,
|
|
5289
|
-
{
|
|
5290
|
-
label: "Type",
|
|
5291
|
-
value: filters.type,
|
|
5292
|
-
onValueChange: (value) => onFilterChange("type", value),
|
|
5293
|
-
placeholder: "Select type",
|
|
5294
|
-
options: [
|
|
5295
|
-
{ value: "BUSINESS", label: "Business" },
|
|
5296
|
-
{ value: "INDIVIDUAL", label: "Individual" }
|
|
5297
|
-
]
|
|
5298
|
-
}
|
|
5299
|
-
),
|
|
5300
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5301
|
-
EnhancedSelect,
|
|
5302
|
-
{
|
|
5303
|
-
label: "Status",
|
|
5304
|
-
value: filters.status,
|
|
5305
|
-
onValueChange: (value) => onFilterChange("status", value),
|
|
5306
|
-
placeholder: "Select status",
|
|
5307
|
-
options: [
|
|
5308
|
-
{ value: "ACTIVE", label: "Active" },
|
|
5309
|
-
{ value: "INACTIVE", label: "Inactive" },
|
|
5310
|
-
{ value: "PENDING", label: "Pending" },
|
|
5311
|
-
{ value: "SUSPENDED", label: "Suspended" }
|
|
5312
|
-
]
|
|
5313
|
-
}
|
|
5314
|
-
),
|
|
5315
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
5316
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
5317
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
|
|
5318
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5319
|
-
DatePicker,
|
|
5320
|
-
{
|
|
5321
|
-
date: filters.createdDateStart,
|
|
5322
|
-
onDateChange: (date) => onFilterChange("createdDateStart", date),
|
|
5323
|
-
placeholder: "MM/DD/YYYY",
|
|
5324
|
-
buttonClassName: "w-full",
|
|
5325
|
-
className: "bg-background z-50"
|
|
5326
|
-
}
|
|
5327
|
-
)
|
|
5328
|
-
] }),
|
|
5329
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
5330
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
|
|
5331
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5332
|
-
DatePicker,
|
|
5333
|
-
{
|
|
5334
|
-
date: filters.createdDateEnd,
|
|
5335
|
-
onDateChange: (date) => onFilterChange("createdDateEnd", date),
|
|
5336
|
-
placeholder: "MM/DD/YYYY",
|
|
5337
|
-
buttonClassName: "w-full",
|
|
5338
|
-
className: "bg-background z-50"
|
|
5339
|
-
}
|
|
5340
|
-
)
|
|
5341
|
-
] })
|
|
5342
|
-
] })
|
|
5343
|
-
] }),
|
|
5344
|
-
/* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
|
|
5345
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: onResetFilters, children: "Reset Filters" }),
|
|
5346
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onApplyFilters, children: "Apply Filters" })
|
|
5347
|
-
] })
|
|
5348
|
-
] })
|
|
5349
|
-
] }),
|
|
5381
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5382
|
+
CounterpartyFiltersSheet,
|
|
5383
|
+
{
|
|
5384
|
+
filters,
|
|
5385
|
+
onFilterChange,
|
|
5386
|
+
onResetFilters
|
|
5387
|
+
}
|
|
5388
|
+
),
|
|
5350
5389
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onCreateCounterparty, children: "Create Counterparty" })
|
|
5351
5390
|
] })
|
|
5352
5391
|
] }) }) }),
|
|
@@ -10867,8 +10906,6 @@ var Counterparties = () => {
|
|
|
10867
10906
|
createdDateEnd: void 0
|
|
10868
10907
|
});
|
|
10869
10908
|
}, []);
|
|
10870
|
-
const handleApplyFilters = React15.useCallback(() => {
|
|
10871
|
-
}, []);
|
|
10872
10909
|
const handleSort = React15.useCallback((key) => {
|
|
10873
10910
|
if (sortBy === key) {
|
|
10874
10911
|
setSortDirection((prev) => prev === "asc" ? "desc" : "asc");
|
|
@@ -10953,7 +10990,6 @@ var Counterparties = () => {
|
|
|
10953
10990
|
filters,
|
|
10954
10991
|
onFilterChange: handleFilterChange,
|
|
10955
10992
|
onResetFilters: handleResetFilters,
|
|
10956
|
-
onApplyFilters: handleApplyFilters,
|
|
10957
10993
|
onCreateCounterparty: handleCreateCounterparty
|
|
10958
10994
|
}
|
|
10959
10995
|
);
|