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.d.cts CHANGED
@@ -369,10 +369,9 @@ interface CounterpartiesViewProps {
369
369
  };
370
370
  onFilterChange: (field: string, value: string | Date | undefined) => void;
371
371
  onResetFilters: () => void;
372
- onApplyFilters: () => void;
373
372
  onCreateCounterparty: () => void;
374
373
  }
375
- declare const CounterpartiesView: ({ table, filters, onFilterChange, onResetFilters, onApplyFilters, onCreateCounterparty }: CounterpartiesViewProps) => react_jsx_runtime.JSX.Element;
374
+ declare const CounterpartiesView: ({ table, filters, onFilterChange, onResetFilters, onCreateCounterparty }: CounterpartiesViewProps) => react_jsx_runtime.JSX.Element;
376
375
 
377
376
  declare const achTransferSchema: z.ZodObject<{
378
377
  basicInfo: z.ZodObject<{
package/dist/index.d.ts CHANGED
@@ -369,10 +369,9 @@ interface CounterpartiesViewProps {
369
369
  };
370
370
  onFilterChange: (field: string, value: string | Date | undefined) => void;
371
371
  onResetFilters: () => void;
372
- onApplyFilters: () => void;
373
372
  onCreateCounterparty: () => void;
374
373
  }
375
- declare const CounterpartiesView: ({ table, filters, onFilterChange, onResetFilters, onApplyFilters, onCreateCounterparty }: CounterpartiesViewProps) => react_jsx_runtime.JSX.Element;
374
+ declare const CounterpartiesView: ({ table, filters, onFilterChange, onResetFilters, onCreateCounterparty }: CounterpartiesViewProps) => react_jsx_runtime.JSX.Element;
376
375
 
377
376
  declare const achTransferSchema: z.ZodObject<{
378
377
  basicInfo: z.ZodObject<{
package/dist/index.js CHANGED
@@ -5223,98 +5223,137 @@ var CreateBusinessView = ({
5223
5223
  }
5224
5224
  );
5225
5225
  };
5226
+ var CounterpartyFiltersSheet = ({
5227
+ filters,
5228
+ onFilterChange,
5229
+ onResetFilters
5230
+ }) => {
5231
+ const [localFilters, setLocalFilters] = useState(filters);
5232
+ const [open, setOpen] = useState(false);
5233
+ useEffect(() => {
5234
+ setLocalFilters(filters);
5235
+ }, [filters]);
5236
+ const handleLocalFilterChange = (field, value) => {
5237
+ setLocalFilters((prev) => ({ ...prev, [field]: value }));
5238
+ };
5239
+ const handleApplyFilters = () => {
5240
+ Object.entries(localFilters).forEach(([key, value]) => {
5241
+ onFilterChange(key, value);
5242
+ });
5243
+ setOpen(false);
5244
+ };
5245
+ const handleResetFilters = () => {
5246
+ const resetFilters = {
5247
+ name: "",
5248
+ type: "",
5249
+ status: "",
5250
+ createdDateStart: void 0,
5251
+ createdDateEnd: void 0
5252
+ };
5253
+ setLocalFilters(resetFilters);
5254
+ onResetFilters();
5255
+ setOpen(false);
5256
+ };
5257
+ return /* @__PURE__ */ jsxs(Sheet, { open, onOpenChange: setOpen, children: [
5258
+ /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", className: "gap-2", children: [
5259
+ /* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" }),
5260
+ "Filters"
5261
+ ] }) }),
5262
+ /* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
5263
+ /* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Counterparty Filters" }) }),
5264
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6 py-6", children: [
5265
+ /* @__PURE__ */ jsx(
5266
+ EnhancedInput,
5267
+ {
5268
+ label: "Name",
5269
+ value: localFilters.name,
5270
+ onChange: (e) => handleLocalFilterChange("name", e.target.value),
5271
+ placeholder: "Enter counterparty name"
5272
+ }
5273
+ ),
5274
+ /* @__PURE__ */ jsx(
5275
+ EnhancedSelect,
5276
+ {
5277
+ label: "Type",
5278
+ value: localFilters.type,
5279
+ onValueChange: (value) => handleLocalFilterChange("type", value),
5280
+ placeholder: "Select type",
5281
+ options: [
5282
+ { value: "BUSINESS", label: "Business" },
5283
+ { value: "INDIVIDUAL", label: "Individual" }
5284
+ ]
5285
+ }
5286
+ ),
5287
+ /* @__PURE__ */ jsx(
5288
+ EnhancedSelect,
5289
+ {
5290
+ label: "Status",
5291
+ value: localFilters.status,
5292
+ onValueChange: (value) => handleLocalFilterChange("status", value),
5293
+ placeholder: "Select status",
5294
+ options: [
5295
+ { value: "ACTIVE", label: "Active" },
5296
+ { value: "INACTIVE", label: "Inactive" },
5297
+ { value: "PENDING", label: "Pending" },
5298
+ { value: "SUSPENDED", label: "Suspended" }
5299
+ ]
5300
+ }
5301
+ ),
5302
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5303
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5304
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
5305
+ /* @__PURE__ */ jsx(
5306
+ DatePicker,
5307
+ {
5308
+ date: localFilters.createdDateStart,
5309
+ onDateChange: (date) => handleLocalFilterChange("createdDateStart", date),
5310
+ placeholder: "MM/DD/YYYY",
5311
+ buttonClassName: "w-full",
5312
+ className: "bg-background z-50"
5313
+ }
5314
+ )
5315
+ ] }),
5316
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5317
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
5318
+ /* @__PURE__ */ jsx(
5319
+ DatePicker,
5320
+ {
5321
+ date: localFilters.createdDateEnd,
5322
+ onDateChange: (date) => handleLocalFilterChange("createdDateEnd", date),
5323
+ placeholder: "MM/DD/YYYY",
5324
+ buttonClassName: "w-full",
5325
+ className: "bg-background z-50"
5326
+ }
5327
+ )
5328
+ ] })
5329
+ ] })
5330
+ ] }),
5331
+ /* @__PURE__ */ jsxs(SheetFooter, { className: "flex gap-2", children: [
5332
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: handleResetFilters, className: "flex-1", children: "Reset Filters" }),
5333
+ /* @__PURE__ */ jsx(Button, { onClick: handleApplyFilters, className: "flex-1", children: "Apply Filters" })
5334
+ ] })
5335
+ ] })
5336
+ ] });
5337
+ };
5226
5338
  var CounterpartiesView = ({
5227
5339
  table,
5228
5340
  filters,
5229
5341
  onFilterChange,
5230
5342
  onResetFilters,
5231
- onApplyFilters,
5232
5343
  onCreateCounterparty
5233
5344
  }) => {
5234
5345
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
5235
5346
  /* @__PURE__ */ jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
5236
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: "Counterparties" }) }),
5347
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold text-foreground", children: "Counterparties" }) }),
5237
5348
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
5238
- /* @__PURE__ */ jsxs(Sheet, { children: [
5239
- /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", className: "gap-2", children: [
5240
- /* @__PURE__ */ jsx(Filter, { className: "h-4 w-4" }),
5241
- "Filters"
5242
- ] }) }),
5243
- /* @__PURE__ */ jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
5244
- /* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Counterparty Filters" }) }),
5245
- /* @__PURE__ */ jsxs("div", { className: "space-y-6 py-6", children: [
5246
- /* @__PURE__ */ jsx(
5247
- EnhancedInput,
5248
- {
5249
- label: "Name",
5250
- value: filters.name,
5251
- onChange: (e) => onFilterChange("name", e.target.value),
5252
- placeholder: "Enter counterparty name"
5253
- }
5254
- ),
5255
- /* @__PURE__ */ jsx(
5256
- EnhancedSelect,
5257
- {
5258
- label: "Type",
5259
- value: filters.type,
5260
- onValueChange: (value) => onFilterChange("type", value),
5261
- placeholder: "Select type",
5262
- options: [
5263
- { value: "BUSINESS", label: "Business" },
5264
- { value: "INDIVIDUAL", label: "Individual" }
5265
- ]
5266
- }
5267
- ),
5268
- /* @__PURE__ */ jsx(
5269
- EnhancedSelect,
5270
- {
5271
- label: "Status",
5272
- value: filters.status,
5273
- onValueChange: (value) => onFilterChange("status", value),
5274
- placeholder: "Select status",
5275
- options: [
5276
- { value: "ACTIVE", label: "Active" },
5277
- { value: "INACTIVE", label: "Inactive" },
5278
- { value: "PENDING", label: "Pending" },
5279
- { value: "SUSPENDED", label: "Suspended" }
5280
- ]
5281
- }
5282
- ),
5283
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5284
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5285
- /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
5286
- /* @__PURE__ */ jsx(
5287
- DatePicker,
5288
- {
5289
- date: filters.createdDateStart,
5290
- onDateChange: (date) => onFilterChange("createdDateStart", date),
5291
- placeholder: "MM/DD/YYYY",
5292
- buttonClassName: "w-full",
5293
- className: "bg-background z-50"
5294
- }
5295
- )
5296
- ] }),
5297
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
5298
- /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
5299
- /* @__PURE__ */ jsx(
5300
- DatePicker,
5301
- {
5302
- date: filters.createdDateEnd,
5303
- onDateChange: (date) => onFilterChange("createdDateEnd", date),
5304
- placeholder: "MM/DD/YYYY",
5305
- buttonClassName: "w-full",
5306
- className: "bg-background z-50"
5307
- }
5308
- )
5309
- ] })
5310
- ] })
5311
- ] }),
5312
- /* @__PURE__ */ jsxs(SheetFooter, { className: "gap-2", children: [
5313
- /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onResetFilters, children: "Reset Filters" }),
5314
- /* @__PURE__ */ jsx(Button, { onClick: onApplyFilters, children: "Apply Filters" })
5315
- ] })
5316
- ] })
5317
- ] }),
5349
+ /* @__PURE__ */ jsx(
5350
+ CounterpartyFiltersSheet,
5351
+ {
5352
+ filters,
5353
+ onFilterChange,
5354
+ onResetFilters
5355
+ }
5356
+ ),
5318
5357
  /* @__PURE__ */ jsx(Button, { onClick: onCreateCounterparty, children: "Create Counterparty" })
5319
5358
  ] })
5320
5359
  ] }) }) }),
@@ -10835,8 +10874,6 @@ var Counterparties = () => {
10835
10874
  createdDateEnd: void 0
10836
10875
  });
10837
10876
  }, []);
10838
- const handleApplyFilters = useCallback(() => {
10839
- }, []);
10840
10877
  const handleSort = useCallback((key) => {
10841
10878
  if (sortBy === key) {
10842
10879
  setSortDirection((prev) => prev === "asc" ? "desc" : "asc");
@@ -10921,7 +10958,6 @@ var Counterparties = () => {
10921
10958
  filters,
10922
10959
  onFilterChange: handleFilterChange,
10923
10960
  onResetFilters: handleResetFilters,
10924
- onApplyFilters: handleApplyFilters,
10925
10961
  onCreateCounterparty: handleCreateCounterparty
10926
10962
  }
10927
10963
  );