@true-tech-team/react-components 0.0.4 → 0.0.6

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 (213) hide show
  1. package/index.css +1 -1
  2. package/index.d.ts +10 -0
  3. package/index.js +1 -1
  4. package/index.mjs +15961 -6871
  5. package/lib/components/buttons/ButtonToggleGroup/ButtonToggleGroup.d.ts +79 -0
  6. package/lib/components/buttons/ButtonToggleGroup/ButtonToggleGroupContext.d.ts +38 -0
  7. package/lib/components/buttons/ButtonToggleGroup/ButtonToggleGroupItem.d.ts +37 -0
  8. package/lib/components/buttons/ButtonToggleGroup/index.d.ts +7 -0
  9. package/lib/components/buttons/ToggleButton/ToggleButton.d.ts +96 -0
  10. package/lib/components/buttons/ToggleButton/index.d.ts +3 -0
  11. package/lib/components/display/Icon/icons/BookmarkFilled.d.ts +3 -0
  12. package/lib/components/display/Icon/icons/ChevronsLeft.d.ts +3 -0
  13. package/lib/components/display/Icon/icons/ChevronsRight.d.ts +3 -0
  14. package/lib/components/display/Icon/icons/HeartFilled.d.ts +3 -0
  15. package/lib/components/display/Icon/icons/More.d.ts +3 -0
  16. package/lib/components/display/Icon/icons/StarFilled.d.ts +3 -0
  17. package/lib/components/display/Icon/icons/ThumbsUpFilled.d.ts +3 -0
  18. package/lib/components/display/Icon/icons/index.d.ts +15 -1
  19. package/lib/components/display/List/List.d.ts +6 -0
  20. package/lib/components/display/List/ListContext.d.ts +15 -0
  21. package/lib/components/display/List/ListEmpty.d.ts +25 -0
  22. package/lib/components/display/List/ListGroup.d.ts +36 -0
  23. package/lib/components/display/List/ListHeader.d.ts +62 -0
  24. package/lib/components/display/List/ListItem.d.ts +19 -0
  25. package/lib/components/display/List/ListSearch.d.ts +32 -0
  26. package/lib/components/display/List/ListSkeleton.d.ts +27 -0
  27. package/lib/components/display/List/hooks/index.d.ts +5 -0
  28. package/lib/components/display/List/hooks/useListExpand.d.ts +6 -0
  29. package/lib/components/display/List/hooks/useListFilter.d.ts +6 -0
  30. package/lib/components/display/List/hooks/useListGroups.d.ts +6 -0
  31. package/lib/components/display/List/hooks/useListKeyboardNav.d.ts +6 -0
  32. package/lib/components/display/List/hooks/useListSelection.d.ts +6 -0
  33. package/lib/components/display/List/index.d.ts +11 -0
  34. package/lib/components/display/List/types.d.ts +485 -0
  35. package/lib/components/display/List/utils.d.ts +47 -0
  36. package/lib/components/display/OverflowText/OverflowText.d.ts +81 -0
  37. package/lib/components/display/OverflowText/index.d.ts +2 -0
  38. package/lib/components/display/ScrollArea/ScrollArea.d.ts +112 -0
  39. package/lib/components/display/ScrollArea/index.d.ts +3 -0
  40. package/lib/components/display/Table/Table.d.ts +6 -0
  41. package/lib/components/display/Table/TableBody.d.ts +4 -0
  42. package/lib/components/display/Table/TableCell.d.ts +12 -0
  43. package/lib/components/display/Table/TableContext.d.ts +10 -0
  44. package/lib/components/display/Table/TableHeader.d.ts +4 -0
  45. package/lib/components/display/Table/TableRow.d.ts +9 -0
  46. package/lib/components/display/Table/TableSearch.d.ts +32 -0
  47. package/lib/components/display/Table/TableSkeleton.d.ts +12 -0
  48. package/lib/components/display/Table/hooks/index.d.ts +10 -0
  49. package/lib/components/display/Table/hooks/useInfiniteScroll.d.ts +11 -0
  50. package/lib/components/display/Table/hooks/useTableExpand.d.ts +10 -0
  51. package/lib/components/display/Table/hooks/useTableFilter.d.ts +22 -0
  52. package/lib/components/display/Table/hooks/useTableSelection.d.ts +16 -0
  53. package/lib/components/display/Table/hooks/useTableSort.d.ts +11 -0
  54. package/lib/components/display/Table/index.d.ts +13 -0
  55. package/lib/components/display/Table/types.d.ts +295 -0
  56. package/lib/components/display/Table/utils.d.ts +37 -0
  57. package/lib/components/display/Tabs/Tab.d.ts +41 -0
  58. package/lib/components/display/Tabs/TabList.d.ts +27 -0
  59. package/lib/components/display/Tabs/TabPanel.d.ts +31 -0
  60. package/lib/components/display/Tabs/Tabs.d.ts +90 -0
  61. package/lib/components/display/Tabs/TabsContext.d.ts +63 -0
  62. package/lib/components/display/Tabs/index.d.ts +11 -0
  63. package/lib/components/display/TruncatedList/TruncatedList.d.ts +69 -0
  64. package/lib/components/display/TruncatedList/index.d.ts +2 -0
  65. package/lib/components/display/index.d.ts +4 -0
  66. package/lib/components/dnd/DndProvider/DndContext.d.ts +91 -0
  67. package/lib/components/dnd/DndProvider/DndProvider.d.ts +37 -0
  68. package/lib/components/dnd/DndProvider/index.d.ts +3 -0
  69. package/lib/components/dnd/DragHandle/DragHandle.d.ts +41 -0
  70. package/lib/components/dnd/DragHandle/index.d.ts +2 -0
  71. package/lib/components/dnd/DragOverlay/DragOverlay.d.ts +39 -0
  72. package/lib/components/dnd/DragOverlay/index.d.ts +2 -0
  73. package/lib/components/dnd/KanbanBoard/KanbanBoard.d.ts +126 -0
  74. package/lib/components/dnd/KanbanBoard/KanbanBoardContext.d.ts +62 -0
  75. package/lib/components/dnd/KanbanBoard/KanbanCard.d.ts +76 -0
  76. package/lib/components/dnd/KanbanBoard/KanbanColumn.d.ts +43 -0
  77. package/lib/components/dnd/KanbanBoard/index.d.ts +5 -0
  78. package/lib/components/dnd/ResizablePanels/ResizablePanel.d.ts +53 -0
  79. package/lib/components/dnd/ResizablePanels/ResizablePanels.d.ts +43 -0
  80. package/lib/components/dnd/ResizablePanels/ResizablePanelsContext.d.ts +64 -0
  81. package/lib/components/dnd/ResizablePanels/ResizeHandle.d.ts +28 -0
  82. package/lib/components/dnd/ResizablePanels/index.d.ts +5 -0
  83. package/lib/components/dnd/SortableGrid/SortableGrid.d.ts +76 -0
  84. package/lib/components/dnd/SortableGrid/SortableGridItem.d.ts +47 -0
  85. package/lib/components/dnd/SortableGrid/index.d.ts +3 -0
  86. package/lib/components/dnd/SortableList/SortableItem.d.ts +76 -0
  87. package/lib/components/dnd/SortableList/SortableList.d.ts +98 -0
  88. package/lib/components/dnd/SortableList/SortableListContext.d.ts +42 -0
  89. package/lib/components/dnd/SortableList/index.d.ts +4 -0
  90. package/lib/components/dnd/hooks/index.d.ts +3 -0
  91. package/lib/components/dnd/hooks/useDraggable.d.ts +66 -0
  92. package/lib/components/dnd/hooks/useDroppable.d.ts +73 -0
  93. package/lib/components/dnd/hooks/useSortable.d.ts +94 -0
  94. package/lib/components/dnd/index.d.ts +8 -0
  95. package/lib/components/filters/FilterContext.d.ts +34 -0
  96. package/lib/components/filters/core/ActiveFilters/ActiveFilters.d.ts +16 -0
  97. package/lib/components/filters/core/ActiveFilters/index.d.ts +2 -0
  98. package/lib/components/filters/core/FilterField/FilterField.d.ts +17 -0
  99. package/lib/components/filters/core/FilterField/index.d.ts +2 -0
  100. package/lib/components/filters/core/FilterProvider/FilterProvider.d.ts +4 -0
  101. package/lib/components/filters/core/FilterProvider/index.d.ts +2 -0
  102. package/lib/components/filters/core/FilterSection/FilterSection.d.ts +16 -0
  103. package/lib/components/filters/core/FilterSection/index.d.ts +2 -0
  104. package/lib/components/filters/core/index.d.ts +7 -0
  105. package/lib/components/filters/fields/CheckboxFilter.d.ts +17 -0
  106. package/lib/components/filters/fields/DateFilter.d.ts +21 -0
  107. package/lib/components/filters/fields/DateRangeFilter.d.ts +19 -0
  108. package/lib/components/filters/fields/ListSelectFilter.d.ts +19 -0
  109. package/lib/components/filters/fields/MultiSelectFilter.d.ts +19 -0
  110. package/lib/components/filters/fields/NumberFilter.d.ts +19 -0
  111. package/lib/components/filters/fields/NumberRangeFilter.d.ts +19 -0
  112. package/lib/components/filters/fields/RatingFilter.d.ts +19 -0
  113. package/lib/components/filters/fields/SelectFilter.d.ts +21 -0
  114. package/lib/components/filters/fields/TextFilter.d.ts +21 -0
  115. package/lib/components/filters/fields/ToggleFilter.d.ts +17 -0
  116. package/lib/components/filters/fields/index.d.ts +25 -0
  117. package/lib/components/filters/hooks/index.d.ts +9 -0
  118. package/lib/components/filters/hooks/useFilter.d.ts +57 -0
  119. package/lib/components/filters/hooks/useFilterDependencies.d.ts +40 -0
  120. package/lib/components/filters/hooks/useFilterOptions.d.ts +70 -0
  121. package/lib/components/filters/index.d.ts +43 -0
  122. package/lib/components/filters/layouts/FilterAccordion/FilterAccordion.d.ts +15 -0
  123. package/lib/components/filters/layouts/FilterAccordion/index.d.ts +2 -0
  124. package/lib/components/filters/layouts/FilterBar/FilterBar.d.ts +18 -0
  125. package/lib/components/filters/layouts/FilterBar/index.d.ts +2 -0
  126. package/lib/components/filters/layouts/FilterModal/FilterModal.d.ts +24 -0
  127. package/lib/components/filters/layouts/FilterModal/index.d.ts +2 -0
  128. package/lib/components/filters/layouts/FilterPopover/FilterPopover.d.ts +19 -0
  129. package/lib/components/filters/layouts/FilterPopover/index.d.ts +2 -0
  130. package/lib/components/filters/layouts/FilterSidebar/FilterSidebar.d.ts +20 -0
  131. package/lib/components/filters/layouts/FilterSidebar/index.d.ts +2 -0
  132. package/lib/components/filters/layouts/index.d.ts +8 -0
  133. package/lib/components/filters/types.d.ts +937 -0
  134. package/lib/components/index.d.ts +52 -0
  135. package/lib/components/inputs/Checkbox/Checkbox.d.ts +2 -2
  136. package/lib/components/inputs/CheckboxGroup/CheckboxGroup.d.ts +122 -0
  137. package/lib/components/inputs/CheckboxGroup/CheckboxGroupContext.d.ts +42 -0
  138. package/lib/components/inputs/CheckboxGroup/CheckboxGroupItem.d.ts +50 -0
  139. package/lib/components/inputs/CheckboxGroup/index.d.ts +7 -0
  140. package/lib/components/inputs/NumberInput/NumberInput.d.ts +3 -1
  141. package/lib/components/layout/AdaptiveGrid/AdaptiveGrid.d.ts +100 -0
  142. package/lib/components/layout/AdaptiveGrid/index.d.ts +2 -0
  143. package/lib/components/layout/MasonryLayout/MasonryLayout.d.ts +74 -0
  144. package/lib/components/layout/MasonryLayout/index.d.ts +2 -0
  145. package/lib/components/layout/Panes/Pane.d.ts +72 -0
  146. package/lib/components/layout/Panes/Panes.d.ts +75 -0
  147. package/lib/components/layout/Panes/PanesContext.d.ts +60 -0
  148. package/lib/components/layout/Panes/index.d.ts +6 -0
  149. package/lib/components/layout/ResponsiveStack/ResponsiveStack.d.ts +99 -0
  150. package/lib/components/layout/ResponsiveStack/index.d.ts +2 -0
  151. package/lib/components/layout/index.d.ts +4 -0
  152. package/lib/components/navigation/BottomNavigation/BottomNavigation.d.ts +53 -0
  153. package/lib/components/navigation/BottomNavigation/BottomNavigationContext.d.ts +27 -0
  154. package/lib/components/navigation/BottomNavigation/BottomNavigationItem.d.ts +59 -0
  155. package/lib/components/navigation/BottomNavigation/index.d.ts +7 -0
  156. package/lib/components/navigation/Breadcrumbs/BreadcrumbItem.d.ts +37 -0
  157. package/lib/components/navigation/Breadcrumbs/BreadcrumbSeparator.d.ts +22 -0
  158. package/lib/components/navigation/Breadcrumbs/Breadcrumbs.d.ts +96 -0
  159. package/lib/components/navigation/Breadcrumbs/index.d.ts +9 -0
  160. package/lib/components/navigation/Breadcrumbs/useBreadcrumbsFromPath.d.ts +73 -0
  161. package/lib/components/navigation/CollapsibleSidebar/CollapsibleSidebar.d.ts +113 -0
  162. package/lib/components/navigation/CollapsibleSidebar/index.d.ts +2 -0
  163. package/lib/components/navigation/NavLink/NavLink.d.ts +74 -0
  164. package/lib/components/navigation/NavLink/index.d.ts +3 -0
  165. package/lib/components/navigation/Navbar/Navbar.d.ts +81 -0
  166. package/lib/components/navigation/Navbar/NavbarActions.d.ts +21 -0
  167. package/lib/components/navigation/Navbar/NavbarBrand.d.ts +29 -0
  168. package/lib/components/navigation/Navbar/NavbarCollapse.d.ts +26 -0
  169. package/lib/components/navigation/Navbar/NavbarContext.d.ts +50 -0
  170. package/lib/components/navigation/Navbar/NavbarNav.d.ts +22 -0
  171. package/lib/components/navigation/Navbar/NavbarToggle.d.ts +21 -0
  172. package/lib/components/navigation/Navbar/index.d.ts +15 -0
  173. package/lib/components/navigation/Pagination/Pagination.d.ts +99 -0
  174. package/lib/components/navigation/Pagination/index.d.ts +3 -0
  175. package/lib/components/navigation/SideNav/SideNav.d.ts +89 -0
  176. package/lib/components/navigation/SideNav/SideNavContext.d.ts +43 -0
  177. package/lib/components/navigation/SideNav/SideNavDivider.d.ts +22 -0
  178. package/lib/components/navigation/SideNav/SideNavGroup.d.ts +44 -0
  179. package/lib/components/navigation/SideNav/SideNavItem.d.ts +71 -0
  180. package/lib/components/navigation/SideNav/index.d.ts +11 -0
  181. package/lib/components/navigation/Stepper/Step.d.ts +57 -0
  182. package/lib/components/navigation/Stepper/Stepper.d.ts +80 -0
  183. package/lib/components/navigation/Stepper/StepperContext.d.ts +58 -0
  184. package/lib/components/navigation/Stepper/index.d.ts +7 -0
  185. package/lib/components/navigation/index.d.ts +16 -0
  186. package/lib/components/overlays/Alert/Alert.d.ts +102 -0
  187. package/lib/components/overlays/Alert/AlertContext.d.ts +94 -0
  188. package/lib/components/overlays/Alert/AlertPresets.d.ts +42 -0
  189. package/lib/components/overlays/Alert/AlertProvider.d.ts +40 -0
  190. package/lib/components/overlays/Alert/index.d.ts +11 -0
  191. package/lib/components/overlays/Dialog/Dialog.d.ts +197 -0
  192. package/lib/components/overlays/Dialog/DialogContext.d.ts +75 -0
  193. package/lib/components/overlays/Dialog/DialogProvider.d.ts +30 -0
  194. package/lib/components/overlays/Dialog/index.d.ts +9 -0
  195. package/lib/components/overlays/Toast/Toast.d.ts +103 -0
  196. package/lib/components/overlays/Toast/ToastContainer.d.ts +37 -0
  197. package/lib/components/overlays/Toast/ToastContext.d.ts +126 -0
  198. package/lib/components/overlays/Toast/ToastProvider.d.ts +71 -0
  199. package/lib/components/overlays/Toast/index.d.ts +11 -0
  200. package/lib/hooks/index.d.ts +10 -0
  201. package/lib/hooks/useAlert/index.d.ts +2 -0
  202. package/lib/hooks/useAlert/useAlert.d.ts +99 -0
  203. package/lib/hooks/useAsyncToast/index.d.ts +2 -0
  204. package/lib/hooks/useAsyncToast/useAsyncToast.d.ts +93 -0
  205. package/lib/hooks/useDialog/index.d.ts +2 -0
  206. package/lib/hooks/useDialog/useDialog.d.ts +58 -0
  207. package/lib/hooks/useResizeObserver/index.d.ts +2 -0
  208. package/lib/hooks/useResizeObserver/useResizeObserver.d.ts +69 -0
  209. package/lib/hooks/useToast/index.d.ts +2 -0
  210. package/lib/hooks/useToast/useToast.d.ts +97 -0
  211. package/lib/providers/GlobalProvider/GlobalProvider.d.ts +16 -1
  212. package/package.json +1 -1
  213. package/README.md +0 -688
@@ -0,0 +1,112 @@
1
+ import { default as React } from 'react';
2
+ import { BaseComponentProps } from '../../../types';
3
+ export interface ScrollAreaRef {
4
+ /**
5
+ * Scroll to specific position
6
+ */
7
+ scrollTo: (options: ScrollToOptions) => void;
8
+ /**
9
+ * Scroll to top
10
+ */
11
+ scrollToTop: (behavior?: ScrollBehavior) => void;
12
+ /**
13
+ * Scroll to bottom
14
+ */
15
+ scrollToBottom: (behavior?: ScrollBehavior) => void;
16
+ /**
17
+ * Scroll to left
18
+ */
19
+ scrollToLeft: (behavior?: ScrollBehavior) => void;
20
+ /**
21
+ * Scroll to right
22
+ */
23
+ scrollToRight: (behavior?: ScrollBehavior) => void;
24
+ /**
25
+ * Get current scroll position
26
+ */
27
+ getScrollPosition: () => {
28
+ scrollTop: number;
29
+ scrollLeft: number;
30
+ };
31
+ /**
32
+ * Get the viewport element
33
+ */
34
+ getElement: () => HTMLDivElement | null;
35
+ }
36
+ export interface ScrollAreaProps extends BaseComponentProps {
37
+ /**
38
+ * Scroll direction
39
+ * @default 'vertical'
40
+ */
41
+ direction?: 'vertical' | 'horizontal' | 'both';
42
+ /**
43
+ * Maximum height (enables vertical scroll)
44
+ */
45
+ maxHeight?: string | number;
46
+ /**
47
+ * Maximum width (enables horizontal scroll)
48
+ */
49
+ maxWidth?: string | number;
50
+ /**
51
+ * Whether to show shadow indicators at scroll edges
52
+ * @default false
53
+ */
54
+ showShadows?: boolean;
55
+ /**
56
+ * Callback when scroll position changes
57
+ */
58
+ onScroll?: (event: React.UIEvent<HTMLDivElement>) => void;
59
+ /**
60
+ * Callback when scrolled to top
61
+ */
62
+ onScrollToTop?: () => void;
63
+ /**
64
+ * Callback when scrolled to bottom
65
+ */
66
+ onScrollToBottom?: () => void;
67
+ /**
68
+ * Callback when scrolled to left edge
69
+ */
70
+ onScrollToLeft?: () => void;
71
+ /**
72
+ * Callback when scrolled to right edge
73
+ */
74
+ onScrollToRight?: () => void;
75
+ /**
76
+ * Threshold in pixels for scroll end callbacks
77
+ * @default 10
78
+ */
79
+ scrollEndThreshold?: number;
80
+ /**
81
+ * Content to render inside scrollable area
82
+ */
83
+ children: React.ReactNode;
84
+ }
85
+ /**
86
+ * ScrollArea component - a custom scrollbar container
87
+ *
88
+ * Provides styled scrollbars with various visibility modes and
89
+ * programmatic scroll control.
90
+ *
91
+ * @example
92
+ * Basic vertical scroll:
93
+ * ```tsx
94
+ * <ScrollArea maxHeight={300}>
95
+ * <p>Long content here...</p>
96
+ * </ScrollArea>
97
+ * ```
98
+ *
99
+ * @example
100
+ * With scroll callbacks:
101
+ * ```tsx
102
+ * <ScrollArea
103
+ * maxHeight={400}
104
+ * onScrollToBottom={() => loadMore()}
105
+ * showShadows
106
+ * >
107
+ * {items.map(item => <Item key={item.id} {...item} />)}
108
+ * </ScrollArea>
109
+ * ```
110
+ */
111
+ export declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<ScrollAreaRef>>;
112
+ export default ScrollArea;
@@ -0,0 +1,3 @@
1
+ export { ScrollArea } from './ScrollArea';
2
+ export type { ScrollAreaProps, ScrollAreaRef } from './ScrollArea';
3
+ export { default } from './ScrollArea';
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { TableProps } from './types';
3
+ export declare const Table: <T extends Record<string, unknown> = Record<string, unknown>>(props: TableProps<T> & {
4
+ ref?: React.ForwardedRef<HTMLDivElement>;
5
+ }) => React.ReactElement;
6
+ export default Table;
@@ -0,0 +1,4 @@
1
+ export declare function TableBody(): import("react/jsx-runtime").JSX.Element;
2
+ export declare namespace TableBody {
3
+ var displayName: string;
4
+ }
@@ -0,0 +1,12 @@
1
+ import { ColumnConfig } from './types';
2
+ interface TableCellProps<T = Record<string, unknown>> {
3
+ column: ColumnConfig<T>;
4
+ row: T;
5
+ rowIndex: number;
6
+ isFirstColumn: boolean;
7
+ }
8
+ export declare function TableCell<T extends Record<string, unknown>>({ column, row, rowIndex, isFirstColumn, }: TableCellProps<T>): import("react/jsx-runtime").JSX.Element;
9
+ export declare namespace TableCell {
10
+ var displayName: string;
11
+ }
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import { TableContextValue } from './types';
2
+ export declare const TableContext: import('react').Context<TableContextValue<Record<string, unknown>> | null>;
3
+ /**
4
+ * Hook to optionally access Table context
5
+ */
6
+ export declare function useTableContext<T = Record<string, unknown>>(): TableContextValue<T> | null;
7
+ /**
8
+ * Hook that throws if not within Table
9
+ */
10
+ export declare function useTableContextStrict<T = Record<string, unknown>>(): TableContextValue<T>;
@@ -0,0 +1,4 @@
1
+ export declare function TableHeader(): import("react/jsx-runtime").JSX.Element;
2
+ export declare namespace TableHeader {
3
+ var displayName: string;
4
+ }
@@ -0,0 +1,9 @@
1
+ interface TableRowProps<T = Record<string, unknown>> {
2
+ row: T;
3
+ rowIndex: number;
4
+ }
5
+ export declare function TableRow<T extends Record<string, unknown>>({ row, rowIndex, }: TableRowProps<T>): import("react/jsx-runtime").JSX.Element;
6
+ export declare namespace TableRow {
7
+ var displayName: string;
8
+ }
9
+ export {};
@@ -0,0 +1,32 @@
1
+ export interface TableSearchProps {
2
+ /**
3
+ * Current search query
4
+ */
5
+ value: string;
6
+ /**
7
+ * Callback when search query changes
8
+ */
9
+ onChange: (value: string) => void;
10
+ /**
11
+ * Placeholder text
12
+ * @default 'Search...'
13
+ */
14
+ placeholder?: string;
15
+ /**
16
+ * Whether the search is currently filtering (debounce active)
17
+ */
18
+ isFiltering?: boolean;
19
+ /**
20
+ * Auto focus the input on mount
21
+ */
22
+ autoFocus?: boolean;
23
+ /**
24
+ * Callback when input is cleared
25
+ */
26
+ onClear?: () => void;
27
+ }
28
+ export declare function TableSearch({ value, onChange, placeholder, isFiltering, autoFocus, onClear, }: TableSearchProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare namespace TableSearch {
30
+ var displayName: string;
31
+ }
32
+ export default TableSearch;
@@ -0,0 +1,12 @@
1
+ import { ColumnConfig } from './types';
2
+ interface TableSkeletonProps {
3
+ rows: number;
4
+ columns: Array<ColumnConfig<any>>;
5
+ hasExpandColumn?: boolean;
6
+ hasSelectionColumn?: boolean;
7
+ }
8
+ export declare function TableSkeleton({ rows, columns, hasExpandColumn, hasSelectionColumn, }: TableSkeletonProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare namespace TableSkeleton {
10
+ var displayName: string;
11
+ }
12
+ export {};
@@ -0,0 +1,10 @@
1
+ export { useTableSelection } from './useTableSelection';
2
+ export type { UseTableSelectionOptions, UseTableSelectionReturn } from './useTableSelection';
3
+ export { useTableSort } from './useTableSort';
4
+ export type { UseTableSortOptions, UseTableSortReturn } from './useTableSort';
5
+ export { useTableExpand } from './useTableExpand';
6
+ export type { UseTableExpandOptions, UseTableExpandReturn } from './useTableExpand';
7
+ export { useInfiniteScroll } from './useInfiniteScroll';
8
+ export type { UseInfiniteScrollOptions, UseInfiniteScrollReturn } from './useInfiniteScroll';
9
+ export { useTableFilter } from './useTableFilter';
10
+ export type { UseTableFilterOptions, UseTableFilterReturn } from './useTableFilter';
@@ -0,0 +1,11 @@
1
+ export interface UseInfiniteScrollOptions {
2
+ onLoadMore: () => void;
3
+ hasMore: boolean;
4
+ loading?: boolean;
5
+ threshold?: number;
6
+ rootMargin?: string;
7
+ }
8
+ export interface UseInfiniteScrollReturn {
9
+ sentinelRef: React.RefObject<HTMLDivElement>;
10
+ }
11
+ export declare function useInfiniteScroll({ onLoadMore, hasMore, loading, threshold, rootMargin, }: UseInfiniteScrollOptions): UseInfiniteScrollReturn;
@@ -0,0 +1,10 @@
1
+ export interface UseTableExpandOptions {
2
+ expandedKeys?: string[];
3
+ defaultExpandedKeys?: string[];
4
+ onExpandChange?: (keys: string[]) => void;
5
+ }
6
+ export interface UseTableExpandReturn {
7
+ expandedKeys: Set<string>;
8
+ onExpand: (key: string, expanded: boolean) => void;
9
+ }
10
+ export declare function useTableExpand({ expandedKeys: controlledKeys, defaultExpandedKeys, onExpandChange, }: UseTableExpandOptions): UseTableExpandReturn;
@@ -0,0 +1,22 @@
1
+ import { ColumnConfig } from '../types';
2
+ export interface UseTableFilterOptions<T> {
3
+ data: T[];
4
+ columns: Array<ColumnConfig<T>>;
5
+ searchQuery?: string;
6
+ defaultSearchQuery?: string;
7
+ onSearchChange?: (query: string) => void;
8
+ searchFields?: Array<keyof T>;
9
+ searchFn?: (item: T, query: string) => boolean;
10
+ debounceMs?: number;
11
+ }
12
+ export interface UseTableFilterReturn<T> {
13
+ filteredData: T[];
14
+ searchQuery: string;
15
+ setSearchQuery: (query: string) => void;
16
+ isFiltering: boolean;
17
+ }
18
+ /**
19
+ * Hook for filtering table data with optional debounce
20
+ * Supports controlled/uncontrolled patterns and custom filter functions
21
+ */
22
+ export declare function useTableFilter<T extends Record<string, unknown>>({ data, columns, searchQuery: controlledQuery, defaultSearchQuery, onSearchChange, searchFields, searchFn, debounceMs, }: UseTableFilterOptions<T>): UseTableFilterReturn<T>;
@@ -0,0 +1,16 @@
1
+ import { SelectionMode } from '../types';
2
+ export interface UseTableSelectionOptions {
3
+ selectionMode: SelectionMode;
4
+ selectedKeys?: string[];
5
+ defaultSelectedKeys?: string[];
6
+ onSelectionChange?: (keys: string[]) => void;
7
+ allRowKeys: string[];
8
+ }
9
+ export interface UseTableSelectionReturn {
10
+ selectedKeys: Set<string>;
11
+ onSelectRow: (key: string, selected: boolean) => void;
12
+ onSelectAll: (selected: boolean) => void;
13
+ isAllSelected: boolean;
14
+ isIndeterminate: boolean;
15
+ }
16
+ export declare function useTableSelection({ selectionMode, selectedKeys: controlledKeys, defaultSelectedKeys, onSelectionChange, allRowKeys, }: UseTableSelectionOptions): UseTableSelectionReturn;
@@ -0,0 +1,11 @@
1
+ import { SortState } from '../types';
2
+ export interface UseTableSortOptions {
3
+ sort?: SortState;
4
+ defaultSort?: SortState;
5
+ onSortChange?: (sort: SortState) => void;
6
+ }
7
+ export interface UseTableSortReturn {
8
+ sort: SortState;
9
+ onSort: (column: string) => void;
10
+ }
11
+ export declare function useTableSort({ sort: controlledSort, defaultSort, onSortChange, }: UseTableSortOptions): UseTableSortReturn;
@@ -0,0 +1,13 @@
1
+ export { Table, default } from './Table';
2
+ export { TableHeader } from './TableHeader';
3
+ export { TableBody } from './TableBody';
4
+ export { TableRow } from './TableRow';
5
+ export { TableCell } from './TableCell';
6
+ export { TableSkeleton } from './TableSkeleton';
7
+ export { TableSearch } from './TableSearch';
8
+ export type { TableSearchProps } from './TableSearch';
9
+ export { TableContext, useTableContext, useTableContextStrict } from './TableContext';
10
+ export type { TableProps, TableContextValue, ColumnConfig, ColumnAlign, SortState, SortDirection, SelectionMode, TablePaginationConfig, TableInfiniteScrollConfig, TableSkeletonConfig, } from './types';
11
+ export { autoGenerateColumns, getCellValue, sortData, formatCellValue } from './utils';
12
+ export { useTableSelection, useTableSort, useTableExpand, useInfiniteScroll, useTableFilter, } from './hooks';
13
+ export type { UseTableSelectionOptions, UseTableSelectionReturn, UseTableSortOptions, UseTableSortReturn, UseTableExpandOptions, UseTableExpandReturn, UseInfiniteScrollOptions, UseInfiniteScrollReturn, UseTableFilterOptions, UseTableFilterReturn, } from './hooks';
@@ -0,0 +1,295 @@
1
+ import { ReactNode, MouseEvent } from 'react';
2
+ import { BaseComponentProps, ComponentSize } from '../../../types';
3
+ export type ColumnAlign = 'left' | 'center' | 'right';
4
+ export type SortDirection = 'asc' | 'desc' | null;
5
+ export interface ColumnConfig<T = Record<string, unknown>> {
6
+ /**
7
+ * Data key to access row data (supports dot notation for nested properties)
8
+ */
9
+ key: keyof T | string;
10
+ /**
11
+ * Header content - string or ReactNode
12
+ */
13
+ header: ReactNode;
14
+ /**
15
+ * Column width using CSS grid template value
16
+ * @example 'auto', '1fr', '320px', 'minmax(100px, 1fr)'
17
+ * @default 'auto'
18
+ */
19
+ width?: string;
20
+ /**
21
+ * Content alignment
22
+ * @default auto-detected based on data type (numbers right, text left)
23
+ */
24
+ align?: ColumnAlign;
25
+ /**
26
+ * Whether column is sortable
27
+ * @default false
28
+ */
29
+ sortable?: boolean;
30
+ /**
31
+ * Custom render function for cell content
32
+ */
33
+ render?: (value: unknown, row: T, rowIndex: number) => ReactNode;
34
+ /**
35
+ * Whether column is sticky (for horizontal scrolling)
36
+ * @default false
37
+ */
38
+ sticky?: boolean;
39
+ /**
40
+ * Custom sort comparison function
41
+ */
42
+ sortFn?: (a: T, b: T, direction: 'asc' | 'desc') => number;
43
+ }
44
+ export interface SortState {
45
+ column: string | null;
46
+ direction: SortDirection;
47
+ }
48
+ export type SelectionMode = 'none' | 'single' | 'multiple';
49
+ export interface TablePaginationConfig {
50
+ /**
51
+ * Number of items per page
52
+ */
53
+ pageSize: number;
54
+ /**
55
+ * Current page number (1-indexed)
56
+ */
57
+ currentPage: number;
58
+ /**
59
+ * Total number of items
60
+ */
61
+ totalItems: number;
62
+ /**
63
+ * Callback when page changes
64
+ */
65
+ onPageChange: (page: number) => void;
66
+ /**
67
+ * Available page size options for the select dropdown
68
+ * If provided, shows a page size selector
69
+ * @example [10, 25, 50, 100]
70
+ */
71
+ pageSizeOptions?: number[];
72
+ /**
73
+ * Callback when page size changes
74
+ */
75
+ onPageSizeChange?: (pageSize: number) => void;
76
+ }
77
+ export interface TableInfiniteScrollConfig {
78
+ /**
79
+ * Callback to load more data
80
+ */
81
+ onLoadMore: () => void;
82
+ /**
83
+ * Whether there is more data to load
84
+ */
85
+ hasMore: boolean;
86
+ /**
87
+ * Whether currently loading more data
88
+ * @default false
89
+ */
90
+ loading?: boolean;
91
+ /**
92
+ * Intersection observer threshold (0-1)
93
+ * @default 0.1
94
+ */
95
+ threshold?: number;
96
+ }
97
+ export interface TableSkeletonConfig {
98
+ /**
99
+ * Number of skeleton rows to display
100
+ * @default 5
101
+ */
102
+ rows?: number;
103
+ /**
104
+ * Whether to show skeleton state
105
+ * @default false
106
+ */
107
+ enabled?: boolean;
108
+ }
109
+ export interface TableProps<T extends Record<string, unknown> = Record<string, unknown>> extends Omit<BaseComponentProps, 'children'> {
110
+ /**
111
+ * Table data array
112
+ */
113
+ data: T[];
114
+ /**
115
+ * Column configurations
116
+ * If not provided, columns are auto-generated from data keys
117
+ */
118
+ columns?: Array<ColumnConfig<T>>;
119
+ /**
120
+ * Unique key for each row
121
+ * @default 'id'
122
+ */
123
+ rowKey?: keyof T | ((row: T, index: number) => string);
124
+ /**
125
+ * Table size variant
126
+ * @default 'md'
127
+ */
128
+ size?: ComponentSize;
129
+ /**
130
+ * Table visual variant
131
+ * @default 'default'
132
+ */
133
+ variant?: 'default' | 'striped' | 'bordered';
134
+ /**
135
+ * Current sort state (controlled)
136
+ */
137
+ sort?: SortState;
138
+ /**
139
+ * Default sort state (uncontrolled)
140
+ */
141
+ defaultSort?: SortState;
142
+ /**
143
+ * Callback when sort changes
144
+ */
145
+ onSortChange?: (sort: SortState) => void;
146
+ /**
147
+ * Selection mode
148
+ * @default 'none'
149
+ */
150
+ selectionMode?: SelectionMode;
151
+ /**
152
+ * Selected row keys (controlled)
153
+ */
154
+ selectedKeys?: string[];
155
+ /**
156
+ * Default selected keys (uncontrolled)
157
+ */
158
+ defaultSelectedKeys?: string[];
159
+ /**
160
+ * Callback when selection changes
161
+ */
162
+ onSelectionChange?: (selectedKeys: string[]) => void;
163
+ /**
164
+ * Whether to show selection controls (checkbox/radio)
165
+ * When false, rows can still be selected by clicking but no visual control is shown
166
+ * @default true
167
+ */
168
+ showSelectionControls?: boolean;
169
+ /**
170
+ * Callback when row is clicked
171
+ */
172
+ onRowClick?: (row: T, index: number, event: MouseEvent) => void;
173
+ /**
174
+ * Render function for expandable content
175
+ * If provided, rows become expandable
176
+ */
177
+ expandedRowRender?: (row: T, index: number) => ReactNode;
178
+ /**
179
+ * Expanded row keys (controlled)
180
+ */
181
+ expandedKeys?: string[];
182
+ /**
183
+ * Default expanded keys (uncontrolled)
184
+ */
185
+ defaultExpandedKeys?: string[];
186
+ /**
187
+ * Callback when expand state changes
188
+ */
189
+ onExpandChange?: (expandedKeys: string[]) => void;
190
+ /**
191
+ * Pagination configuration
192
+ */
193
+ pagination?: TablePaginationConfig;
194
+ /**
195
+ * Infinite scroll configuration (mutually exclusive with pagination)
196
+ */
197
+ infiniteScroll?: TableInfiniteScrollConfig;
198
+ /**
199
+ * Enable built-in search
200
+ * @default false
201
+ */
202
+ searchable?: boolean;
203
+ /**
204
+ * Search placeholder text
205
+ * @default 'Search...'
206
+ */
207
+ searchPlaceholder?: string;
208
+ /**
209
+ * Fields to search (for default search behavior).
210
+ * If not provided, searches all column keys.
211
+ */
212
+ searchFields?: Array<keyof T>;
213
+ /**
214
+ * Custom search function
215
+ */
216
+ searchFn?: (item: T, query: string) => boolean;
217
+ /**
218
+ * Search query (controlled)
219
+ */
220
+ searchQuery?: string;
221
+ /**
222
+ * Callback when search changes
223
+ */
224
+ onSearchChange?: (query: string) => void;
225
+ /**
226
+ * Debounce delay for search in milliseconds
227
+ * @default 300
228
+ */
229
+ searchDebounce?: number;
230
+ /**
231
+ * Enable sticky header
232
+ * @default false
233
+ */
234
+ stickyHeader?: boolean;
235
+ /**
236
+ * Enable sticky first column
237
+ * @default false
238
+ */
239
+ stickyFirstColumn?: boolean;
240
+ /**
241
+ * Maximum height for scrollable table
242
+ */
243
+ maxHeight?: string | number;
244
+ /**
245
+ * Empty state content
246
+ * @default 'No data available'
247
+ */
248
+ emptyContent?: ReactNode;
249
+ /**
250
+ * Loading state
251
+ * @default false
252
+ */
253
+ loading?: boolean;
254
+ /**
255
+ * Loading indicator content
256
+ */
257
+ loadingContent?: ReactNode;
258
+ /**
259
+ * Skeleton loader configuration
260
+ * Shows skeleton rows instead of a spinner when loading
261
+ */
262
+ skeleton?: TableSkeletonConfig;
263
+ /**
264
+ * Caption for the table
265
+ */
266
+ caption?: string;
267
+ /**
268
+ * Whether caption is visually hidden
269
+ * @default false
270
+ */
271
+ captionHidden?: boolean;
272
+ }
273
+ export interface TableContextValue<T = Record<string, unknown>> {
274
+ data: T[];
275
+ columns: Array<ColumnConfig<T>>;
276
+ getRowKey: (row: T, index: number) => string;
277
+ size: ComponentSize;
278
+ variant: 'default' | 'striped' | 'bordered';
279
+ sort: SortState;
280
+ onSort: (column: string) => void;
281
+ selectionMode: SelectionMode;
282
+ selectedKeys: Set<string>;
283
+ onSelectRow: (key: string, selected: boolean) => void;
284
+ onSelectAll: (selected: boolean) => void;
285
+ isAllSelected: boolean;
286
+ isIndeterminate: boolean;
287
+ showSelectionControls: boolean;
288
+ expandedKeys: Set<string>;
289
+ onExpand: (key: string, expanded: boolean) => void;
290
+ hasExpandableRows: boolean;
291
+ expandedRowRender?: (row: T, index: number) => ReactNode;
292
+ onRowClick?: (row: T, index: number, event: MouseEvent) => void;
293
+ stickyHeader: boolean;
294
+ stickyFirstColumn: boolean;
295
+ }
@@ -0,0 +1,37 @@
1
+ import { ReactNode } from 'react';
2
+ import { ColumnConfig, ColumnAlign, SortState } from './types';
3
+ /**
4
+ * Column width validation rules:
5
+ * 1. All columns must have a minimum width > 0
6
+ * 2. Only one column can have a dynamic width (1fr) to prevent uneven column widths
7
+ * 3. If no width is specified, use the average size of data to calculate width
8
+ */
9
+ export declare function calculateColumnWidths<T extends Record<string, unknown>>(columns: Array<ColumnConfig<T>>, data: T[]): string[];
10
+ /**
11
+ * Auto-generate columns from the first data item's keys
12
+ */
13
+ export declare function autoGenerateColumns<T extends Record<string, unknown>>(data: T[]): Array<ColumnConfig<T>>;
14
+ /**
15
+ * Format header text from key (camelCase/snake_case -> Title Case)
16
+ */
17
+ export declare function formatHeaderFromKey(key: string): string;
18
+ /**
19
+ * Detect column alignment based on data type
20
+ */
21
+ export declare function detectAlignment(value: unknown): ColumnAlign;
22
+ /**
23
+ * Get cell value by column key (supports dot notation for nested properties)
24
+ */
25
+ export declare function getCellValue<T>(row: T, key: string): unknown;
26
+ /**
27
+ * Default sort comparison function
28
+ */
29
+ export declare function defaultSortFn<T>(a: T, b: T, column: string, direction: 'asc' | 'desc'): number;
30
+ /**
31
+ * Sort data by column
32
+ */
33
+ export declare function sortData<T>(data: T[], sort: SortState, columns: Array<ColumnConfig<T>>): T[];
34
+ /**
35
+ * Format cell value for display
36
+ */
37
+ export declare function formatCellValue(value: unknown): ReactNode;