@true-tech-team/react-components 0.0.5 → 0.0.7

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.
Files changed (111) hide show
  1. package/index.css +1 -1
  2. package/index.js +1 -1
  3. package/index.mjs +14032 -8735
  4. package/lib/components/display/List/List.d.ts +6 -0
  5. package/lib/components/display/List/ListContext.d.ts +15 -0
  6. package/lib/components/display/List/ListEmpty.d.ts +25 -0
  7. package/lib/components/display/List/ListGroup.d.ts +36 -0
  8. package/lib/components/display/List/ListHeader.d.ts +62 -0
  9. package/lib/components/display/List/ListItem.d.ts +19 -0
  10. package/lib/components/display/List/ListSearch.d.ts +32 -0
  11. package/lib/components/display/List/ListSkeleton.d.ts +27 -0
  12. package/lib/components/display/List/hooks/index.d.ts +5 -0
  13. package/lib/components/display/List/hooks/useListExpand.d.ts +6 -0
  14. package/lib/components/display/List/hooks/useListFilter.d.ts +6 -0
  15. package/lib/components/display/List/hooks/useListGroups.d.ts +6 -0
  16. package/lib/components/display/List/hooks/useListKeyboardNav.d.ts +6 -0
  17. package/lib/components/display/List/hooks/useListSelection.d.ts +6 -0
  18. package/lib/components/display/List/index.d.ts +11 -0
  19. package/lib/components/display/List/types.d.ts +485 -0
  20. package/lib/components/display/List/utils.d.ts +47 -0
  21. package/lib/components/display/Table/Table.d.ts +6 -0
  22. package/lib/components/display/Table/TableBody.d.ts +4 -0
  23. package/lib/components/display/Table/TableCell.d.ts +12 -0
  24. package/lib/components/display/Table/TableContext.d.ts +10 -0
  25. package/lib/components/display/Table/TableHeader.d.ts +4 -0
  26. package/lib/components/display/Table/TableRow.d.ts +9 -0
  27. package/lib/components/display/Table/TableSearch.d.ts +32 -0
  28. package/lib/components/display/Table/TableSkeleton.d.ts +12 -0
  29. package/lib/components/display/Table/hooks/index.d.ts +10 -0
  30. package/lib/components/display/Table/hooks/useInfiniteScroll.d.ts +11 -0
  31. package/lib/components/display/Table/hooks/useTableExpand.d.ts +10 -0
  32. package/lib/components/display/Table/hooks/useTableFilter.d.ts +22 -0
  33. package/lib/components/display/Table/hooks/useTableSelection.d.ts +16 -0
  34. package/lib/components/display/Table/hooks/useTableSort.d.ts +11 -0
  35. package/lib/components/display/Table/index.d.ts +13 -0
  36. package/lib/components/display/Table/types.d.ts +295 -0
  37. package/lib/components/display/Table/utils.d.ts +37 -0
  38. package/lib/components/display/index.d.ts +1 -0
  39. package/lib/components/dnd/DndProvider/DndContext.d.ts +91 -0
  40. package/lib/components/dnd/DndProvider/DndProvider.d.ts +37 -0
  41. package/lib/components/dnd/DndProvider/index.d.ts +3 -0
  42. package/lib/components/dnd/DragHandle/DragHandle.d.ts +41 -0
  43. package/lib/components/dnd/DragHandle/index.d.ts +2 -0
  44. package/lib/components/dnd/DragOverlay/DragOverlay.d.ts +39 -0
  45. package/lib/components/dnd/DragOverlay/index.d.ts +2 -0
  46. package/lib/components/dnd/KanbanBoard/KanbanBoard.d.ts +126 -0
  47. package/lib/components/dnd/KanbanBoard/KanbanBoardContext.d.ts +62 -0
  48. package/lib/components/dnd/KanbanBoard/KanbanCard.d.ts +76 -0
  49. package/lib/components/dnd/KanbanBoard/KanbanColumn.d.ts +43 -0
  50. package/lib/components/dnd/KanbanBoard/index.d.ts +5 -0
  51. package/lib/components/dnd/ResizablePanels/ResizablePanel.d.ts +53 -0
  52. package/lib/components/dnd/ResizablePanels/ResizablePanels.d.ts +43 -0
  53. package/lib/components/dnd/ResizablePanels/ResizablePanelsContext.d.ts +64 -0
  54. package/lib/components/dnd/ResizablePanels/ResizeHandle.d.ts +28 -0
  55. package/lib/components/dnd/ResizablePanels/index.d.ts +5 -0
  56. package/lib/components/dnd/SortableGrid/SortableGrid.d.ts +76 -0
  57. package/lib/components/dnd/SortableGrid/SortableGridItem.d.ts +47 -0
  58. package/lib/components/dnd/SortableGrid/index.d.ts +3 -0
  59. package/lib/components/dnd/SortableList/SortableItem.d.ts +76 -0
  60. package/lib/components/dnd/SortableList/SortableList.d.ts +98 -0
  61. package/lib/components/dnd/SortableList/SortableListContext.d.ts +42 -0
  62. package/lib/components/dnd/SortableList/index.d.ts +4 -0
  63. package/lib/components/dnd/hooks/index.d.ts +3 -0
  64. package/lib/components/dnd/hooks/useDraggable.d.ts +66 -0
  65. package/lib/components/dnd/hooks/useDroppable.d.ts +73 -0
  66. package/lib/components/dnd/hooks/useSortable.d.ts +94 -0
  67. package/lib/components/dnd/index.d.ts +8 -0
  68. package/lib/components/filters/FilterContext.d.ts +34 -0
  69. package/lib/components/filters/core/ActiveFilters/ActiveFilters.d.ts +16 -0
  70. package/lib/components/filters/core/ActiveFilters/index.d.ts +2 -0
  71. package/lib/components/filters/core/FilterField/FilterField.d.ts +17 -0
  72. package/lib/components/filters/core/FilterField/index.d.ts +2 -0
  73. package/lib/components/filters/core/FilterProvider/FilterProvider.d.ts +4 -0
  74. package/lib/components/filters/core/FilterProvider/index.d.ts +2 -0
  75. package/lib/components/filters/core/FilterSection/FilterSection.d.ts +16 -0
  76. package/lib/components/filters/core/FilterSection/index.d.ts +2 -0
  77. package/lib/components/filters/core/index.d.ts +7 -0
  78. package/lib/components/filters/fields/CheckboxFilter.d.ts +17 -0
  79. package/lib/components/filters/fields/DateFilter.d.ts +21 -0
  80. package/lib/components/filters/fields/DateRangeFilter.d.ts +19 -0
  81. package/lib/components/filters/fields/ListSelectFilter.d.ts +19 -0
  82. package/lib/components/filters/fields/MultiSelectFilter.d.ts +19 -0
  83. package/lib/components/filters/fields/NumberFilter.d.ts +19 -0
  84. package/lib/components/filters/fields/NumberRangeFilter.d.ts +19 -0
  85. package/lib/components/filters/fields/RatingFilter.d.ts +19 -0
  86. package/lib/components/filters/fields/SelectFilter.d.ts +21 -0
  87. package/lib/components/filters/fields/TextFilter.d.ts +21 -0
  88. package/lib/components/filters/fields/ToggleFilter.d.ts +17 -0
  89. package/lib/components/filters/fields/index.d.ts +25 -0
  90. package/lib/components/filters/hooks/index.d.ts +9 -0
  91. package/lib/components/filters/hooks/useFilter.d.ts +57 -0
  92. package/lib/components/filters/hooks/useFilterDependencies.d.ts +40 -0
  93. package/lib/components/filters/hooks/useFilterOptions.d.ts +70 -0
  94. package/lib/components/filters/index.d.ts +43 -0
  95. package/lib/components/filters/layouts/FilterAccordion/FilterAccordion.d.ts +15 -0
  96. package/lib/components/filters/layouts/FilterAccordion/index.d.ts +2 -0
  97. package/lib/components/filters/layouts/FilterBar/FilterBar.d.ts +18 -0
  98. package/lib/components/filters/layouts/FilterBar/index.d.ts +2 -0
  99. package/lib/components/filters/layouts/FilterModal/FilterModal.d.ts +24 -0
  100. package/lib/components/filters/layouts/FilterModal/index.d.ts +2 -0
  101. package/lib/components/filters/layouts/FilterPopover/FilterPopover.d.ts +19 -0
  102. package/lib/components/filters/layouts/FilterPopover/index.d.ts +2 -0
  103. package/lib/components/filters/layouts/FilterSidebar/FilterSidebar.d.ts +20 -0
  104. package/lib/components/filters/layouts/FilterSidebar/index.d.ts +2 -0
  105. package/lib/components/filters/layouts/index.d.ts +8 -0
  106. package/lib/components/filters/types.d.ts +937 -0
  107. package/lib/components/index.d.ts +8 -0
  108. package/lib/components/inputs/Checkbox/Checkbox.d.ts +2 -2
  109. package/lib/components/inputs/NumberInput/NumberInput.d.ts +3 -1
  110. package/package.json +1 -2
  111. package/README.md +0 -826
@@ -0,0 +1,937 @@
1
+ import { ReactNode } from 'react';
2
+ import { BaseComponentProps, ComponentSize } from '../../types';
3
+ import { PopoverPosition } from '../../utils/positioning';
4
+ /**
5
+ * Supported filter types
6
+ */
7
+ export type FilterType = 'select' | 'multi-select' | 'checkbox' | 'toggle' | 'text' | 'number' | 'number-range' | 'date' | 'date-range' | 'rating' | 'list-select';
8
+ /**
9
+ * Number range value
10
+ */
11
+ export interface NumberRangeValue {
12
+ min?: number;
13
+ max?: number;
14
+ }
15
+ /**
16
+ * Date range value
17
+ */
18
+ export interface DateRangeValue {
19
+ startDate?: Date | null;
20
+ endDate?: Date | null;
21
+ }
22
+ /**
23
+ * Possible filter values by type
24
+ */
25
+ export type FilterValue = string | string[] | number | boolean | Date | null | NumberRangeValue | DateRangeValue;
26
+ /**
27
+ * Filter value with metadata for display
28
+ */
29
+ export interface FilterValueWithMeta<T extends FilterValue = FilterValue> {
30
+ value: T;
31
+ label?: string;
32
+ displayValue?: string;
33
+ isEmpty?: boolean;
34
+ }
35
+ /**
36
+ * Filter option for select-based filters
37
+ */
38
+ export interface FilterOption<T = string> {
39
+ value: T;
40
+ label: ReactNode;
41
+ disabled?: boolean;
42
+ group?: string;
43
+ count?: number;
44
+ icon?: ReactNode;
45
+ description?: string;
46
+ }
47
+ /**
48
+ * Parameters passed to async options loader
49
+ */
50
+ export interface FilterOptionsLoaderParams {
51
+ searchQuery?: string;
52
+ page?: number;
53
+ pageSize?: number;
54
+ dependencyValues?: Record<string, FilterValue>;
55
+ }
56
+ /**
57
+ * Result from async options loader
58
+ */
59
+ export interface FilterOptionsLoadResult<T = string> {
60
+ options: Array<FilterOption<T>>;
61
+ hasMore?: boolean;
62
+ totalCount?: number;
63
+ }
64
+ /**
65
+ * Async options loader configuration
66
+ */
67
+ export interface FilterOptionsLoader<T = string> {
68
+ /**
69
+ * Function to load options (can be async)
70
+ */
71
+ load: (params: FilterOptionsLoaderParams) => Promise<FilterOptionsLoadResult<T>>;
72
+ /**
73
+ * Debounce delay for search input (ms)
74
+ * @default 300
75
+ */
76
+ debounceMs?: number;
77
+ /**
78
+ * Enable pagination for options
79
+ */
80
+ paginated?: boolean;
81
+ /**
82
+ * Page size for pagination
83
+ * @default 20
84
+ */
85
+ pageSize?: number;
86
+ /**
87
+ * Cache options after loading
88
+ * @default true
89
+ */
90
+ cache?: boolean;
91
+ /**
92
+ * Cache TTL in milliseconds
93
+ * @default 300000 (5 minutes)
94
+ */
95
+ cacheTtl?: number;
96
+ }
97
+ /**
98
+ * Dependency action types
99
+ */
100
+ export type FilterDependencyAction = 'show' | 'hide' | 'enable' | 'disable' | 'reload-options';
101
+ /**
102
+ * Filter dependency configuration
103
+ */
104
+ export interface FilterDependency {
105
+ /**
106
+ * Field name(s) this filter depends on
107
+ */
108
+ dependsOn: string | string[];
109
+ /**
110
+ * Condition to evaluate (receives dependent field values)
111
+ */
112
+ condition?: (dependencyValues: Record<string, FilterValue>) => boolean;
113
+ /**
114
+ * Action when condition is met
115
+ * @default 'show'
116
+ */
117
+ action?: FilterDependencyAction;
118
+ /**
119
+ * Whether to reset this filter's value when dependencies change
120
+ * @default false
121
+ */
122
+ resetOnChange?: boolean;
123
+ /**
124
+ * Transform options based on dependency values
125
+ */
126
+ transformOptions?: (options: FilterOption[], dependencyValues: Record<string, FilterValue>) => FilterOption[];
127
+ }
128
+ /**
129
+ * Select filter configuration
130
+ */
131
+ export interface SelectFilterConfig {
132
+ searchable?: boolean;
133
+ searchPlaceholder?: string;
134
+ showClearButton?: boolean;
135
+ scrollToSelected?: boolean;
136
+ }
137
+ /**
138
+ * Multi-select filter display modes
139
+ */
140
+ export type MultiSelectDisplayMode = 'checkbox-group' | 'dropdown' | 'list';
141
+ /**
142
+ * Multi-select filter configuration
143
+ */
144
+ export interface MultiSelectFilterConfig {
145
+ displayMode?: MultiSelectDisplayMode;
146
+ orientation?: 'horizontal' | 'vertical';
147
+ min?: number;
148
+ max?: number;
149
+ showSelectAll?: boolean;
150
+ selectAllLabel?: string;
151
+ }
152
+ /**
153
+ * Text filter configuration
154
+ */
155
+ export interface TextFilterConfig {
156
+ debounceMs?: number;
157
+ minLength?: number;
158
+ maxLength?: number;
159
+ inputType?: 'text' | 'search' | 'email' | 'tel' | 'url';
160
+ showClearButton?: boolean;
161
+ startIcon?: ReactNode;
162
+ }
163
+ /**
164
+ * Number filter configuration
165
+ */
166
+ export interface NumberFilterConfig {
167
+ min?: number;
168
+ max?: number;
169
+ step?: number;
170
+ showButtons?: boolean;
171
+ prefix?: string;
172
+ suffix?: string;
173
+ }
174
+ /**
175
+ * Number range filter display modes
176
+ */
177
+ export type NumberRangeDisplayMode = 'inputs' | 'slider' | 'both';
178
+ /**
179
+ * Number range filter configuration
180
+ */
181
+ export interface NumberRangeFilterConfig extends NumberFilterConfig {
182
+ displayMode?: NumberRangeDisplayMode;
183
+ showLabels?: boolean;
184
+ minLabel?: string;
185
+ maxLabel?: string;
186
+ }
187
+ /**
188
+ * Date filter configuration
189
+ */
190
+ export interface DateFilterConfig {
191
+ minDate?: Date;
192
+ maxDate?: Date;
193
+ format?: string;
194
+ showCalendar?: boolean;
195
+ showClearButton?: boolean;
196
+ }
197
+ /**
198
+ * Date range preset
199
+ */
200
+ export interface DateRangePreset {
201
+ label: string;
202
+ getValue: () => {
203
+ startDate: Date;
204
+ endDate: Date;
205
+ };
206
+ }
207
+ /**
208
+ * Date range filter configuration
209
+ */
210
+ export interface DateRangeFilterConfig extends DateFilterConfig {
211
+ showPresets?: boolean;
212
+ presets?: DateRangePreset[];
213
+ minDays?: number;
214
+ maxDays?: number;
215
+ }
216
+ /**
217
+ * Rating filter configuration
218
+ */
219
+ export interface RatingFilterConfig {
220
+ max?: number;
221
+ allowClear?: boolean;
222
+ icon?: ReactNode;
223
+ emptyIcon?: ReactNode;
224
+ }
225
+ /**
226
+ * List select filter configuration
227
+ */
228
+ export interface ListSelectFilterConfig {
229
+ selectionMode?: 'single' | 'multiple';
230
+ searchable?: boolean;
231
+ searchPlaceholder?: string;
232
+ showCounts?: boolean;
233
+ maxHeight?: number | string;
234
+ virtualized?: boolean;
235
+ groupBy?: string;
236
+ sortBy?: string;
237
+ sortDirection?: 'asc' | 'desc';
238
+ }
239
+ /**
240
+ * Union of all filter type configs
241
+ */
242
+ export type FilterTypeConfig = SelectFilterConfig | MultiSelectFilterConfig | TextFilterConfig | NumberFilterConfig | NumberRangeFilterConfig | DateFilterConfig | DateRangeFilterConfig | RatingFilterConfig | ListSelectFilterConfig;
243
+ /**
244
+ * Complete filter definition
245
+ */
246
+ export interface FilterDefinition<T extends FilterValue = FilterValue> {
247
+ /**
248
+ * Unique filter identifier
249
+ */
250
+ id: string;
251
+ /**
252
+ * Filter type
253
+ */
254
+ type: FilterType;
255
+ /**
256
+ * Display label
257
+ */
258
+ label: string;
259
+ /**
260
+ * Short label for compact displays (e.g., active filters)
261
+ */
262
+ shortLabel?: string;
263
+ /**
264
+ * Placeholder text
265
+ */
266
+ placeholder?: string;
267
+ /**
268
+ * Helper text
269
+ */
270
+ helperText?: string;
271
+ /**
272
+ * Default value
273
+ */
274
+ defaultValue?: T;
275
+ /**
276
+ * Static options (for select-based filters)
277
+ */
278
+ options?: FilterOption[];
279
+ /**
280
+ * Async options loader
281
+ */
282
+ optionsLoader?: FilterOptionsLoader;
283
+ /**
284
+ * Filter dependencies
285
+ */
286
+ dependencies?: FilterDependency[];
287
+ /**
288
+ * Whether filter is required
289
+ * @default false
290
+ */
291
+ required?: boolean;
292
+ /**
293
+ * Whether filter is disabled
294
+ * @default false
295
+ */
296
+ disabled?: boolean;
297
+ /**
298
+ * Whether filter is hidden
299
+ * @default false
300
+ */
301
+ hidden?: boolean;
302
+ /**
303
+ * Group/section this filter belongs to
304
+ */
305
+ group?: string;
306
+ /**
307
+ * Sort order within group
308
+ */
309
+ order?: number;
310
+ /**
311
+ * Custom render function for the filter value display
312
+ */
313
+ renderValue?: (value: T) => ReactNode;
314
+ /**
315
+ * Custom empty value check
316
+ */
317
+ isEmpty?: (value: T) => boolean;
318
+ /**
319
+ * Validation function
320
+ */
321
+ validate?: (value: T) => string | null;
322
+ /**
323
+ * Type-specific configuration
324
+ */
325
+ config?: FilterTypeConfig;
326
+ }
327
+ /**
328
+ * Filter group definition
329
+ */
330
+ export interface FilterGroup {
331
+ /**
332
+ * Unique group identifier
333
+ */
334
+ id: string;
335
+ /**
336
+ * Group label
337
+ */
338
+ label: string;
339
+ /**
340
+ * Group description
341
+ */
342
+ description?: string;
343
+ /**
344
+ * Group icon
345
+ */
346
+ icon?: ReactNode;
347
+ /**
348
+ * Whether group is collapsible
349
+ * @default true
350
+ */
351
+ collapsible?: boolean;
352
+ /**
353
+ * Default collapsed state
354
+ * @default false
355
+ */
356
+ defaultCollapsed?: boolean;
357
+ /**
358
+ * Sort order
359
+ */
360
+ order?: number;
361
+ }
362
+ /**
363
+ * Complete filter state
364
+ */
365
+ export interface FilterState {
366
+ /**
367
+ * Current filter values by filter ID
368
+ */
369
+ values: Record<string, FilterValue>;
370
+ /**
371
+ * Filters that are currently loading options
372
+ */
373
+ loadingFilters: Set<string>;
374
+ /**
375
+ * Filters with errors
376
+ */
377
+ errors: Record<string, string>;
378
+ /**
379
+ * Filters that have been touched/interacted with
380
+ */
381
+ touched: Set<string>;
382
+ /**
383
+ * Whether any filter has been modified from default
384
+ */
385
+ isDirty: boolean;
386
+ /**
387
+ * Count of active (non-empty) filters
388
+ */
389
+ activeCount: number;
390
+ }
391
+ /**
392
+ * Filter actions for state management
393
+ */
394
+ export interface FilterActions {
395
+ /**
396
+ * Set a single filter value
397
+ */
398
+ setFilterValue: (filterId: string, value: FilterValue) => void;
399
+ /**
400
+ * Set multiple filter values at once
401
+ */
402
+ setFilterValues: (values: Record<string, FilterValue>) => void;
403
+ /**
404
+ * Clear a single filter (reset to default)
405
+ */
406
+ clearFilter: (filterId: string) => void;
407
+ /**
408
+ * Clear all filters (reset to defaults)
409
+ */
410
+ clearAllFilters: () => void;
411
+ /**
412
+ * Reset filters to initial values
413
+ */
414
+ resetFilters: () => void;
415
+ /**
416
+ * Mark a filter as touched
417
+ */
418
+ touchFilter: (filterId: string) => void;
419
+ /**
420
+ * Set filter error
421
+ */
422
+ setFilterError: (filterId: string, error: string | null) => void;
423
+ /**
424
+ * Validate all filters
425
+ */
426
+ validateFilters: () => boolean;
427
+ /**
428
+ * Get filter value with metadata
429
+ */
430
+ getFilterMeta: (filterId: string) => FilterValueWithMeta | undefined;
431
+ /**
432
+ * Check if a filter is active (has non-default value)
433
+ */
434
+ isFilterActive: (filterId: string) => boolean;
435
+ /**
436
+ * Get all active filter values (for API calls)
437
+ */
438
+ getActiveFilters: () => Record<string, FilterValue>;
439
+ /**
440
+ * Get URL search params from current filters
441
+ */
442
+ toSearchParams: () => URLSearchParams;
443
+ /**
444
+ * Load filters from URL search params
445
+ */
446
+ fromSearchParams: (params: URLSearchParams) => void;
447
+ }
448
+ /**
449
+ * Options loading state
450
+ */
451
+ export interface FilterOptionsState {
452
+ options: FilterOption[];
453
+ loading: boolean;
454
+ error: string | null;
455
+ hasMore: boolean;
456
+ loadMore: () => void;
457
+ }
458
+ /**
459
+ * Filter context value
460
+ */
461
+ export interface FilterContextValue extends FilterState, FilterActions {
462
+ /**
463
+ * All filter definitions
464
+ */
465
+ filters: FilterDefinition[];
466
+ /**
467
+ * Filter groups
468
+ */
469
+ groups: FilterGroup[];
470
+ /**
471
+ * Get filter definition by ID
472
+ */
473
+ getFilter: (filterId: string) => FilterDefinition | undefined;
474
+ /**
475
+ * Get filters by group
476
+ */
477
+ getFiltersByGroup: (groupId: string) => FilterDefinition[];
478
+ /**
479
+ * Get ungrouped filters
480
+ */
481
+ getUngroupedFilters: () => FilterDefinition[];
482
+ /**
483
+ * Check if filter is visible (considering dependencies)
484
+ */
485
+ isFilterVisible: (filterId: string) => boolean;
486
+ /**
487
+ * Check if filter is enabled (considering dependencies)
488
+ */
489
+ isFilterEnabled: (filterId: string) => boolean;
490
+ /**
491
+ * Get options for a filter (handles async loading)
492
+ */
493
+ getFilterOptions: (filterId: string) => FilterOptionsState;
494
+ /**
495
+ * Reload options for a filter
496
+ */
497
+ reloadFilterOptions: (filterId: string) => void;
498
+ /**
499
+ * Size variant
500
+ */
501
+ size: ComponentSize;
502
+ /**
503
+ * Apply filters (for non-immediate apply mode)
504
+ */
505
+ applyFilters: () => void;
506
+ /**
507
+ * Whether changes are pending (for non-immediate apply mode)
508
+ */
509
+ hasPendingChanges: boolean;
510
+ }
511
+ /**
512
+ * FilterProvider props
513
+ */
514
+ export interface FilterProviderProps extends Omit<BaseComponentProps, 'children'> {
515
+ /**
516
+ * Filter definitions
517
+ */
518
+ filters: FilterDefinition[];
519
+ /**
520
+ * Filter groups
521
+ */
522
+ groups?: FilterGroup[];
523
+ /**
524
+ * Controlled filter values
525
+ */
526
+ values?: Record<string, FilterValue>;
527
+ /**
528
+ * Default filter values (uncontrolled)
529
+ */
530
+ defaultValues?: Record<string, FilterValue>;
531
+ /**
532
+ * Callback when filter values change
533
+ */
534
+ onChange?: (values: Record<string, FilterValue>, changedFilterId: string) => void;
535
+ /**
536
+ * Callback when filters are applied (e.g., user clicks Apply button)
537
+ */
538
+ onApply?: (values: Record<string, FilterValue>) => void;
539
+ /**
540
+ * Callback when filters are cleared
541
+ */
542
+ onClear?: () => void;
543
+ /**
544
+ * Callback when filters are reset
545
+ */
546
+ onReset?: () => void;
547
+ /**
548
+ * Apply filters immediately on change
549
+ * @default true
550
+ */
551
+ applyOnChange?: boolean;
552
+ /**
553
+ * Debounce delay for apply (ms)
554
+ * @default 0
555
+ */
556
+ applyDebounceMs?: number;
557
+ /**
558
+ * Sync filter values with URL
559
+ * @default false
560
+ */
561
+ syncWithUrl?: boolean;
562
+ /**
563
+ * URL parameter prefix
564
+ * @default 'filter_'
565
+ */
566
+ urlParamPrefix?: string;
567
+ /**
568
+ * Size variant for all filters
569
+ * @default 'md'
570
+ */
571
+ size?: ComponentSize;
572
+ /**
573
+ * Children components
574
+ */
575
+ children: ReactNode;
576
+ }
577
+ /**
578
+ * ActiveFilters component props
579
+ */
580
+ export interface ActiveFiltersProps extends BaseComponentProps {
581
+ /**
582
+ * Maximum number of chips to show before collapsing
583
+ */
584
+ maxVisible?: number;
585
+ /**
586
+ * Show "Clear All" button
587
+ * @default true
588
+ */
589
+ showClearAll?: boolean;
590
+ /**
591
+ * Clear all button label
592
+ * @default 'Clear all'
593
+ */
594
+ clearAllLabel?: string;
595
+ /**
596
+ * Empty state content
597
+ */
598
+ emptyContent?: ReactNode;
599
+ /**
600
+ * Chip variant
601
+ * @default 'secondary'
602
+ */
603
+ chipVariant?: 'primary' | 'secondary' | 'neutral';
604
+ /**
605
+ * Chip size
606
+ * @default 'sm'
607
+ */
608
+ chipSize?: 'sm' | 'md';
609
+ /**
610
+ * Custom render for filter chip
611
+ */
612
+ renderChip?: (filter: FilterDefinition, value: FilterValue, onRemove: () => void) => ReactNode;
613
+ }
614
+ /**
615
+ * FilterSection props
616
+ */
617
+ export interface FilterSectionProps extends BaseComponentProps {
618
+ /**
619
+ * Section ID (links to group)
620
+ */
621
+ id?: string;
622
+ /**
623
+ * Section title
624
+ */
625
+ title?: string;
626
+ /**
627
+ * Section description
628
+ */
629
+ description?: string;
630
+ /**
631
+ * Section icon
632
+ */
633
+ icon?: ReactNode;
634
+ /**
635
+ * Whether section is collapsible
636
+ * @default true
637
+ */
638
+ collapsible?: boolean;
639
+ /**
640
+ * Default collapsed state
641
+ * @default false
642
+ */
643
+ defaultCollapsed?: boolean;
644
+ /**
645
+ * Controlled collapsed state
646
+ */
647
+ collapsed?: boolean;
648
+ /**
649
+ * Callback when collapsed state changes
650
+ */
651
+ onCollapsedChange?: (collapsed: boolean) => void;
652
+ /**
653
+ * Show active filter count badge
654
+ * @default true
655
+ */
656
+ showActiveCount?: boolean;
657
+ /**
658
+ * Section children (filter components)
659
+ */
660
+ children: ReactNode;
661
+ }
662
+ /**
663
+ * FilterField props (unified wrapper)
664
+ */
665
+ export interface FilterFieldProps extends BaseComponentProps {
666
+ /**
667
+ * Filter ID (references FilterDefinition)
668
+ */
669
+ filterId: string;
670
+ /**
671
+ * Override label
672
+ */
673
+ label?: string;
674
+ /**
675
+ * Override placeholder
676
+ */
677
+ placeholder?: string;
678
+ /**
679
+ * Show label
680
+ * @default true
681
+ */
682
+ showLabel?: boolean;
683
+ /**
684
+ * Additional props to pass to underlying component
685
+ */
686
+ componentProps?: Record<string, unknown>;
687
+ }
688
+ /**
689
+ * Layout component base props
690
+ */
691
+ export interface FilterLayoutProps extends BaseComponentProps {
692
+ /**
693
+ * Show active filters display
694
+ * @default true
695
+ */
696
+ showActiveFilters?: boolean;
697
+ /**
698
+ * Active filters position
699
+ * @default 'top'
700
+ */
701
+ activeFiltersPosition?: 'top' | 'bottom' | 'inline';
702
+ /**
703
+ * Show apply button (for non-immediate apply mode)
704
+ */
705
+ showApplyButton?: boolean;
706
+ /**
707
+ * Apply button label
708
+ * @default 'Apply'
709
+ */
710
+ applyButtonLabel?: string;
711
+ /**
712
+ * Show clear button
713
+ * @default true
714
+ */
715
+ showClearButton?: boolean;
716
+ /**
717
+ * Clear button label
718
+ * @default 'Clear'
719
+ */
720
+ clearButtonLabel?: string;
721
+ /**
722
+ * Show reset button
723
+ * @default false
724
+ */
725
+ showResetButton?: boolean;
726
+ /**
727
+ * Reset button label
728
+ * @default 'Reset'
729
+ */
730
+ resetButtonLabel?: string;
731
+ /**
732
+ * Filter children
733
+ */
734
+ children: ReactNode;
735
+ }
736
+ /**
737
+ * FilterSidebar props
738
+ */
739
+ export interface FilterSidebarProps extends FilterLayoutProps {
740
+ /**
741
+ * Sidebar width when expanded
742
+ * @default 280
743
+ */
744
+ width?: number;
745
+ /**
746
+ * Whether sidebar is collapsible
747
+ * @default false
748
+ */
749
+ collapsible?: boolean;
750
+ /**
751
+ * Controlled collapsed state
752
+ */
753
+ collapsed?: boolean;
754
+ /**
755
+ * Default collapsed state
756
+ * @default false
757
+ */
758
+ defaultCollapsed?: boolean;
759
+ /**
760
+ * Callback when collapsed state changes
761
+ */
762
+ onCollapsedChange?: (collapsed: boolean) => void;
763
+ /**
764
+ * Sidebar header content
765
+ */
766
+ header?: ReactNode;
767
+ /**
768
+ * Sidebar footer content
769
+ */
770
+ footer?: ReactNode;
771
+ /**
772
+ * Position of sidebar
773
+ * @default 'left'
774
+ */
775
+ position?: 'left' | 'right';
776
+ }
777
+ /**
778
+ * FilterBar props (horizontal inline filters)
779
+ */
780
+ export interface FilterBarProps extends FilterLayoutProps {
781
+ /**
782
+ * Filter IDs to show in the bar (others go to "More" dropdown)
783
+ */
784
+ visibleFilters?: string[];
785
+ /**
786
+ * Show "More Filters" dropdown for overflow
787
+ * @default true
788
+ */
789
+ showMoreFilters?: boolean;
790
+ /**
791
+ * "More Filters" label
792
+ * @default 'More Filters'
793
+ */
794
+ moreFiltersLabel?: string;
795
+ /**
796
+ * Wrap filters on overflow
797
+ * @default true
798
+ */
799
+ wrap?: boolean;
800
+ /**
801
+ * Gap between filters
802
+ * @default 'md'
803
+ */
804
+ gap?: 'sm' | 'md' | 'lg';
805
+ }
806
+ /**
807
+ * FilterPopover props
808
+ */
809
+ export interface FilterPopoverProps extends FilterLayoutProps {
810
+ /**
811
+ * Trigger element/button
812
+ */
813
+ trigger?: ReactNode;
814
+ /**
815
+ * Trigger button label (if no custom trigger)
816
+ * @default 'Filters'
817
+ */
818
+ triggerLabel?: string;
819
+ /**
820
+ * Show active count on trigger
821
+ * @default true
822
+ */
823
+ showTriggerBadge?: boolean;
824
+ /**
825
+ * Popover position
826
+ * @default 'bottom-start'
827
+ */
828
+ position?: PopoverPosition;
829
+ /**
830
+ * Popover width
831
+ * @default 320
832
+ */
833
+ width?: number | string;
834
+ /**
835
+ * Maximum height
836
+ */
837
+ maxHeight?: number | string;
838
+ /**
839
+ * Controlled open state
840
+ */
841
+ isOpen?: boolean;
842
+ /**
843
+ * Default open state
844
+ * @default false
845
+ */
846
+ defaultOpen?: boolean;
847
+ /**
848
+ * Callback when open state changes
849
+ */
850
+ onOpenChange?: (open: boolean) => void;
851
+ /**
852
+ * Close on apply
853
+ * @default true
854
+ */
855
+ closeOnApply?: boolean;
856
+ /**
857
+ * Close on click outside
858
+ * @default true
859
+ */
860
+ closeOnClickOutside?: boolean;
861
+ }
862
+ /**
863
+ * FilterModal props
864
+ */
865
+ export interface FilterModalProps extends FilterLayoutProps {
866
+ /**
867
+ * Modal title
868
+ * @default 'Filters'
869
+ */
870
+ title?: string;
871
+ /**
872
+ * Modal size
873
+ * @default 'md'
874
+ */
875
+ size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
876
+ /**
877
+ * Controlled open state
878
+ */
879
+ isOpen?: boolean;
880
+ /**
881
+ * Default open state
882
+ * @default false
883
+ */
884
+ defaultOpen?: boolean;
885
+ /**
886
+ * Callback when open state changes
887
+ */
888
+ onOpenChange?: (open: boolean) => void;
889
+ /**
890
+ * Close on apply
891
+ * @default true
892
+ */
893
+ closeOnApply?: boolean;
894
+ /**
895
+ * Show footer with action buttons
896
+ * @default true
897
+ */
898
+ showFooter?: boolean;
899
+ /**
900
+ * Render function for trigger button
901
+ */
902
+ renderTrigger?: (props: {
903
+ onClick: () => void;
904
+ activeCount: number;
905
+ }) => ReactNode;
906
+ }
907
+ /**
908
+ * FilterAccordion props
909
+ */
910
+ export interface FilterAccordionProps extends Omit<FilterLayoutProps, 'children'> {
911
+ /**
912
+ * Filter children (optional - auto-generates from groups if not provided)
913
+ */
914
+ children?: ReactNode;
915
+ /**
916
+ * Accordion mode
917
+ * @default 'multiple'
918
+ */
919
+ mode?: 'single' | 'multiple';
920
+ /**
921
+ * Default expanded groups
922
+ */
923
+ defaultExpandedGroups?: string[];
924
+ /**
925
+ * Controlled expanded groups
926
+ */
927
+ expandedGroups?: string[];
928
+ /**
929
+ * Callback when expanded groups change
930
+ */
931
+ onExpandedGroupsChange?: (groups: string[]) => void;
932
+ /**
933
+ * Show group active counts
934
+ * @default true
935
+ */
936
+ showGroupCounts?: boolean;
937
+ }