munza-x-data-grid 1.3.0 → 1.3.3

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 (49) hide show
  1. package/README.md +244 -60
  2. package/dist/components/feedback/NoDataFoundMsg.d.ts +2 -0
  3. package/dist/components/feedback/TableError.d.ts +2 -0
  4. package/dist/components/feedback/TableErrorMsg.d.ts +2 -0
  5. package/dist/components/feedback/TableNoData.d.ts +2 -0
  6. package/dist/components/feedback/TableRowSkeleton.d.ts +7 -0
  7. package/dist/components/feedback/TableSkeleton.d.ts +2 -0
  8. package/dist/components/header/HeaderFilter.d.ts +5 -0
  9. package/dist/components/header/HeaderMenu.d.ts +5 -0
  10. package/dist/components/header/HeaderSort.d.ts +5 -0
  11. package/dist/components/pagination/index.d.ts +4 -0
  12. package/dist/components/table/TBody.d.ts +2 -0
  13. package/dist/components/table/TCell.d.ts +6 -0
  14. package/dist/components/table/THead.d.ts +6 -0
  15. package/dist/components/table/THeader.d.ts +2 -0
  16. package/dist/components/table/TMain.d.ts +2 -0
  17. package/dist/components/toolbar/ToolbarFilter.d.ts +5 -0
  18. package/dist/components/toolbar/index.d.ts +2 -0
  19. package/dist/components/ui/badge.d.ts +9 -0
  20. package/dist/components/ui/button.d.ts +10 -0
  21. package/dist/components/ui/checkbox.d.ts +4 -0
  22. package/dist/components/ui/collapsible.d.ts +5 -0
  23. package/dist/components/ui/debounced-input.d.ts +7 -0
  24. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  25. package/dist/components/ui/empty.d.ts +11 -0
  26. package/dist/components/ui/input.d.ts +3 -0
  27. package/dist/components/ui/label.d.ts +4 -0
  28. package/dist/components/ui/native-select.d.ts +8 -0
  29. package/dist/components/ui/separator.d.ts +4 -0
  30. package/dist/components/ui/skeleton.d.ts +2 -0
  31. package/dist/components/ui/table.d.ts +10 -0
  32. package/dist/contexts/GridContext.d.ts +37 -0
  33. package/dist/core/Grid.d.ts +3 -0
  34. package/dist/data-grid.cjs +44 -0
  35. package/dist/data-grid.js +7946 -179
  36. package/dist/hooks/useGrid.d.ts +2 -0
  37. package/dist/hooks/useGridState.d.ts +16 -0
  38. package/dist/hooks/useSyncScroll.d.ts +7 -0
  39. package/dist/index.css +4 -0
  40. package/dist/index.d.ts +4 -2
  41. package/dist/lib/utils.d.ts +2 -0
  42. package/dist/utils/getPinStyles.d.ts +3 -0
  43. package/package.json +25 -13
  44. package/dist/App.d.ts +0 -2
  45. package/dist/Button.d.ts +0 -7
  46. package/dist/data-grid.umd.cjs +0 -6
  47. package/dist/favicon.svg +0 -1
  48. package/dist/icons.svg +0 -24
  49. package/dist/main.d.ts +0 -0
package/README.md CHANGED
@@ -1,73 +1,257 @@
1
- # React + TypeScript + Vite
1
+ # munza-x-data-grid
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ A flexible, feature-rich React data grid component built on top of [@tanstack/react-table](https://tanstack.com/table), with Tailwind CSS v4 styling and shadcn/ui primitives.
4
4
 
5
- Currently, two official plugins are available:
5
+ ---
6
6
 
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
7
+ ## Installation
9
8
 
10
- ## React Compiler
9
+ ```bash
10
+ npm install munza-x-data-grid
11
+ ```
11
12
 
12
- The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13
+ Import the stylesheet in your app entry point:
13
14
 
14
- ## Expanding the ESLint configuration
15
+ ```js
16
+ import 'munza-x-data-grid/style.css';
17
+ ```
15
18
 
16
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
19
+ ### Peer Dependencies
17
20
 
18
- ```js
19
- export default defineConfig([
20
- globalIgnores(['dist']),
21
- {
22
- files: ['**/*.{ts,tsx}'],
23
- extends: [
24
- // Other configs...
25
-
26
- // Remove tseslint.configs.recommended and replace with this
27
- tseslint.configs.recommendedTypeChecked,
28
- // Alternatively, use this for stricter rules
29
- tseslint.configs.strictTypeChecked,
30
- // Optionally, add this for stylistic rules
31
- tseslint.configs.stylisticTypeChecked,
32
-
33
- // Other configs...
34
- ],
35
- languageOptions: {
36
- parserOptions: {
37
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
38
- tsconfigRootDir: import.meta.dirname,
39
- },
40
- // other options...
41
- },
42
- },
43
- ])
21
+ ```bash
22
+ npm install react react-dom
44
23
  ```
45
24
 
46
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
25
+ Requires **React 18 or 19**.
47
26
 
48
- ```js
49
- // eslint.config.js
50
- import reactX from 'eslint-plugin-react-x'
51
- import reactDom from 'eslint-plugin-react-dom'
52
-
53
- export default defineConfig([
54
- globalIgnores(['dist']),
55
- {
56
- files: ['**/*.{ts,tsx}'],
57
- extends: [
58
- // Other configs...
59
- // Enable lint rules for React
60
- reactX.configs['recommended-typescript'],
61
- // Enable lint rules for React DOM
62
- reactDom.configs.recommended,
63
- ],
64
- languageOptions: {
65
- parserOptions: {
66
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
67
- tsconfigRootDir: import.meta.dirname,
68
- },
69
- // other options...
70
- },
27
+ ---
28
+
29
+ ## Basic Usage
30
+
31
+ ```tsx
32
+ import { Grid, useGridState, type ColumnDef } from 'munza-x-data-grid';
33
+ import 'munza-x-data-grid/style.css';
34
+
35
+ type Person = {
36
+ firstName: string;
37
+ lastName: string;
38
+ age: number;
39
+ };
40
+
41
+ const columns: ColumnDef<Person>[] = [
42
+ { accessorKey: 'firstName', header: 'First Name' },
43
+ { accessorKey: 'lastName', header: 'Last Name' },
44
+ { accessorKey: 'age', header: 'Age' },
45
+ ];
46
+
47
+ const data: Person[] = [{ firstName: 'Alice', lastName: 'Smith', age: 30 }];
48
+
49
+ export default function App() {
50
+ const { state, handlers } = useGridState();
51
+
52
+ return (
53
+ <Grid
54
+ columns={columns}
55
+ payload={{ data, total: data.length }}
56
+ state={state}
57
+ {...handlers}
58
+ />
59
+ );
60
+ }
61
+ ```
62
+
63
+ ---
64
+
65
+ ## API Reference
66
+
67
+ ### `<Grid />`
68
+
69
+ The top-level component that renders the full data grid.
70
+
71
+ | Prop | Type | Required | Description |
72
+ | ----------------------- | ------------------------------------------ | -------- | -------------------------------------------------------- |
73
+ | `columns` | `ColumnDef<T>[]` | ✅ | Column definitions (TanStack Table format) |
74
+ | `payload` | `{ data: T[], total: number }` | ✅ | Row data and total count for pagination |
75
+ | `state` | `Partial<TableState>` | ✅ | Controlled table state (from `useGridState`) |
76
+ | `onColumnFiltersChange` | `OnChangeFn<ColumnFiltersState>` | — | Callback for column filter changes |
77
+ | `onPaginationChange` | `OnChangeFn<PaginationState>` | — | Callback for pagination changes |
78
+ | `onSortingChange` | `OnChangeFn<SortingState>` | — | Callback for sort changes |
79
+ | `setGlobalFilter` | `Dispatch<SetStateAction<string>>` | — | Callback to update the global search filter |
80
+ | `isLoading` | `boolean` | — | Displays a loading state |
81
+ | `isError` | `boolean` | — | Displays an error state |
82
+ | `manualPagination` | `boolean` | — | Set `true` for server-side pagination (default: `false`) |
83
+ | `getRowCanExpand` | `(row: Row<T>) => boolean` | — | Controls which rows are expandable |
84
+ | `renderSubComponent` | `(props: { row: Row<T> }) => ReactElement` | — | Renders expanded row content |
85
+
86
+ ---
87
+
88
+ ### `useGridState()`
89
+
90
+ Hook that provides controlled state and event handlers to pass into `<Grid />`.
91
+
92
+ ```tsx
93
+ const { state, handlers } = useGridState();
94
+ ```
95
+
96
+ **Returns:**
97
+
98
+ | Key | Description |
99
+ | ---------- | ----------------------------------------------------------------------------------------------------- |
100
+ | `state` | Partial `TableState` object (sorting, pagination, filters, etc.) |
101
+ | `handlers` | Object containing `onSortingChange`, `onPaginationChange`, `onColumnFiltersChange`, `setGlobalFilter` |
102
+
103
+ Spread `handlers` directly onto `<Grid />`:
104
+
105
+ ```tsx
106
+ <Grid state={state} {...handlers} columns={columns} payload={payload} />
107
+ ```
108
+
109
+ ---
110
+
111
+ ## Column Definitions
112
+
113
+ Columns follow the standard [TanStack Table `ColumnDef`](https://tanstack.com/table/latest/docs/api/core/column-def) format with an additional `meta` field for filter configuration.
114
+
115
+ ### Filter Variants
116
+
117
+ Set `meta.filterVariant` on a column to control its filter UI:
118
+
119
+ ```tsx
120
+ {
121
+ accessorKey: 'status',
122
+ header: 'Status',
123
+ meta: {
124
+ filterVariant: 'select', // dropdown filter
71
125
  },
72
- ])
126
+ }
127
+
128
+ {
129
+ accessorKey: 'age',
130
+ header: 'Age',
131
+ meta: {
132
+ filterVariant: 'text', // text input filter
133
+ },
134
+ }
135
+ ```
136
+
137
+ ### Row Number Column
138
+
139
+ ```tsx
140
+ {
141
+ accessorFn: (_row, index) => index + 1,
142
+ cell: ({ row }) => row.index + 1,
143
+ id: 'rowNumber',
144
+ header: '',
145
+ size: 54,
146
+ maxSize: 54,
147
+ enableColumnFilter: false,
148
+ }
149
+ ```
150
+
151
+ ### Checkbox Selection Column
152
+
153
+ ```tsx
154
+ {
155
+ id: 'select',
156
+ header: ({ table }) => (
157
+ <Checkbox
158
+ checked={
159
+ table.getIsAllPageRowsSelected() ||
160
+ (table.getIsSomePageRowsSelected() && 'indeterminate')
161
+ }
162
+ onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
163
+ aria-label="Select all"
164
+ />
165
+ ),
166
+ cell: ({ row }) => (
167
+ <Checkbox
168
+ checked={row.getIsSelected()}
169
+ onCheckedChange={(value) => row.toggleSelected(!!value)}
170
+ aria-label="Select row"
171
+ />
172
+ ),
173
+ size: 40,
174
+ maxSize: 40,
175
+ enableColumnFilter: false,
176
+ }
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Server-Side Pagination
182
+
183
+ Set `manualPagination` to `true` and pass `payload.total` as the full server-side count.
184
+
185
+ ```tsx
186
+ <Grid
187
+ columns={columns}
188
+ payload={{ data: serverData, total: serverTotal }}
189
+ state={state}
190
+ {...handlers}
191
+ manualPagination={true}
192
+ />
73
193
  ```
194
+
195
+ The built-in pagination UI supports the following page sizes:
196
+
197
+ ```
198
+ 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Expandable Rows
204
+
205
+ ```tsx
206
+ <Grid
207
+ columns={columns}
208
+ payload={payload}
209
+ state={state}
210
+ {...handlers}
211
+ getRowCanExpand={(row) => !!row.original.subRows?.length}
212
+ renderSubComponent={({ row }) => (
213
+ <div className="p-4">
214
+ <pre>{JSON.stringify(row.original, null, 2)}</pre>
215
+ </div>
216
+ )}
217
+ />
218
+ ```
219
+
220
+ ---
221
+
222
+ ## Column Pinning
223
+
224
+ Column pinning is managed internally by the grid. No additional configuration is required — use the built-in toolbar UI to pin columns left or right.
225
+
226
+ ---
227
+
228
+ ## Default Column Sizing
229
+
230
+ | Property | Default |
231
+ | --------- | ------- |
232
+ | `size` | `180px` |
233
+ | `minSize` | `180px` |
234
+ | `maxSize` | `180px` |
235
+
236
+ Override per-column:
237
+
238
+ ```tsx
239
+ {
240
+ accessorKey: 'id',
241
+ size: 60,
242
+ minSize: 60,
243
+ maxSize: 60,
244
+ }
245
+ ```
246
+
247
+ ---
248
+
249
+ ## TypeScript
250
+
251
+ All props and hooks are fully typed. Import types directly from the package:
252
+
253
+ ```ts
254
+ import type { ColumnDef } from 'munza-x-data-grid';
255
+ ```
256
+
257
+ TanStack Table types (`Row`, `TableState`, `PaginationState`, etc.) are re-exported and available from `@tanstack/react-table`.
@@ -0,0 +1,2 @@
1
+ declare const NoDataFoundMsg: () => import("react/jsx-runtime").JSX.Element;
2
+ export default NoDataFoundMsg;
@@ -0,0 +1,2 @@
1
+ declare const TableError: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TableError;
@@ -0,0 +1,2 @@
1
+ declare const TableErrorMsg: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TableErrorMsg;
@@ -0,0 +1,2 @@
1
+ declare const TableNoData: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TableNoData;
@@ -0,0 +1,7 @@
1
+ import { Column } from '@tanstack/react-table';
2
+ declare const TableRowSkeleton: ({ column, i, j, }: {
3
+ column: Column<unknown, unknown>;
4
+ i: number;
5
+ j: number;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export default TableRowSkeleton;
@@ -0,0 +1,2 @@
1
+ declare const TableSkeleton: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TableSkeleton;
@@ -0,0 +1,5 @@
1
+ import { Column } from '@tanstack/react-table';
2
+ declare const HeaderFilter: <T>({ column }: {
3
+ column: Column<T, unknown>;
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
5
+ export default HeaderFilter;
@@ -0,0 +1,5 @@
1
+ import { Header } from '@tanstack/react-table';
2
+ declare const HeaderMenu: <T>({ header }: {
3
+ header: Header<T, unknown>;
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
5
+ export default HeaderMenu;
@@ -0,0 +1,5 @@
1
+ import { Header } from '@tanstack/react-table';
2
+ declare const HeaderSort: <T>({ header }: {
3
+ header: Header<T, unknown>;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default HeaderSort;
@@ -0,0 +1,4 @@
1
+ declare const Pagination: ({ pagination }: {
2
+ pagination: number[];
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default Pagination;
@@ -0,0 +1,2 @@
1
+ declare const TBody: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TBody;
@@ -0,0 +1,6 @@
1
+ import { Cell } from '@tanstack/react-table';
2
+ interface TCellProps<T> {
3
+ cell: Cell<T, unknown>;
4
+ }
5
+ declare const TCell: <T>({ cell }: TCellProps<T>) => import("react/jsx-runtime").JSX.Element;
6
+ export default TCell;
@@ -0,0 +1,6 @@
1
+ import { Header } from '@tanstack/react-table';
2
+ interface THeadProps<T> {
3
+ header: Header<T, unknown>;
4
+ }
5
+ declare const THead: <T>({ header }: THeadProps<T>) => import("react/jsx-runtime").JSX.Element;
6
+ export default THead;
@@ -0,0 +1,2 @@
1
+ declare const THeader: () => import("react/jsx-runtime").JSX.Element;
2
+ export default THeader;
@@ -0,0 +1,2 @@
1
+ declare const TMain: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TMain;
@@ -0,0 +1,5 @@
1
+ import { Column } from '@tanstack/react-table';
2
+ declare const ToolbarFilter: <T>({ column }: {
3
+ column: Column<T, unknown>;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default ToolbarFilter;
@@ -0,0 +1,2 @@
1
+ declare const Toolbar: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Toolbar;
@@ -0,0 +1,9 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
+ asChild?: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export { Badge };
@@ -0,0 +1,10 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Button };
@@ -0,0 +1,4 @@
1
+ import { Checkbox as CheckboxPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Checkbox };
@@ -0,0 +1,5 @@
1
+ import { Collapsible as CollapsiblePrimitive } from 'radix-ui';
2
+ declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
4
+ declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
5
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger };
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ declare const DebouncedInput: ({ value: initialValue, onChange, debounce, ...props }: {
3
+ value: string | number;
4
+ onChange: (value: string | number) => void;
5
+ debounce?: number;
6
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange">) => import("react/jsx-runtime").JSX.Element;
7
+ export default DebouncedInput;
@@ -0,0 +1,29 @@
1
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
8
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
9
+ inset?: boolean;
10
+ variant?: 'default' | 'destructive';
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
13
+ inset?: boolean;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
16
+ declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
17
+ inset?: boolean;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
20
+ inset?: boolean;
21
+ }): import("react/jsx-runtime").JSX.Element;
22
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
23
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
24
+ declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
25
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
26
+ inset?: boolean;
27
+ }): import("react/jsx-runtime").JSX.Element;
28
+ declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
29
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
@@ -0,0 +1,11 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ declare function Empty({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
3
+ declare function EmptyHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
4
+ declare const emptyMediaVariants: (props?: ({
5
+ variant?: "default" | "icon" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>): import("react/jsx-runtime").JSX.Element;
8
+ declare function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
9
+ declare function EmptyDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
10
+ declare function EmptyContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
11
+ export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, };
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<'input'>): import("react/jsx-runtime").JSX.Element;
3
+ export { Input };
@@ -0,0 +1,4 @@
1
+ import { Label as LabelPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Label };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ type NativeSelectProps = Omit<React.ComponentProps<'select'>, 'size'> & {
3
+ size?: 'sm' | 'default';
4
+ };
5
+ declare function NativeSelect({ className, size, ...props }: NativeSelectProps): import("react/jsx-runtime").JSX.Element;
6
+ declare function NativeSelectOption({ ...props }: React.ComponentProps<'option'>): import("react/jsx-runtime").JSX.Element;
7
+ declare function NativeSelectOptGroup({ className, ...props }: React.ComponentProps<'optgroup'>): import("react/jsx-runtime").JSX.Element;
8
+ export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
@@ -0,0 +1,4 @@
1
+ import { Separator as SeparatorPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Separator };
@@ -0,0 +1,2 @@
1
+ declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
2
+ export { Skeleton };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ declare function Table({ className, ...props }: React.ComponentProps<'table'>): import("react/jsx-runtime").JSX.Element;
3
+ declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): import("react/jsx-runtime").JSX.Element;
4
+ declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): import("react/jsx-runtime").JSX.Element;
7
+ declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): import("react/jsx-runtime").JSX.Element;
8
+ declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): import("react/jsx-runtime").JSX.Element;
9
+ declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): import("react/jsx-runtime").JSX.Element;
10
+ export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, };
@@ -0,0 +1,37 @@
1
+ import { ColumnDef, ColumnFiltersState, OnChangeFn, PaginationState, Row, SortingState, Table, TableState } from '@tanstack/react-table';
2
+ import { default as React } from 'react';
3
+ export interface GridContextProps<T> {
4
+ table: Table<T>;
5
+ isLoading?: boolean;
6
+ isError?: boolean;
7
+ paneRef1: React.RefObject<HTMLDivElement | null>;
8
+ paneRef2: React.RefObject<HTMLDivElement | null>;
9
+ globalFilter?: string;
10
+ setGlobalFilter?: React.Dispatch<React.SetStateAction<string>>;
11
+ renderSubComponent?: (props: {
12
+ row: Row<T>;
13
+ }) => React.ReactElement;
14
+ }
15
+ declare const GridContext: React.Context<GridContextProps<any> | undefined>;
16
+ interface GridContextProviderProps<T> {
17
+ children: React.ReactNode;
18
+ payload?: {
19
+ data: T[];
20
+ total: number;
21
+ };
22
+ columns: ColumnDef<T>[];
23
+ state?: Partial<TableState>;
24
+ onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>;
25
+ onPaginationChange?: OnChangeFn<PaginationState>;
26
+ onSortingChange?: OnChangeFn<SortingState>;
27
+ manualPagination?: boolean;
28
+ isLoading?: boolean;
29
+ isError?: boolean;
30
+ setGlobalFilter?: React.Dispatch<React.SetStateAction<string>>;
31
+ renderSubComponent?: (props: {
32
+ row: Row<T>;
33
+ }) => React.ReactElement;
34
+ getRowCanExpand?: (row: Row<T>) => boolean;
35
+ }
36
+ export declare const GridContextProvider: <T>({ children, payload, columns, state, onColumnFiltersChange, onPaginationChange, onSortingChange, setGlobalFilter, manualPagination, isError, isLoading, getRowCanExpand, renderSubComponent, }: GridContextProviderProps<T>) => import("react/jsx-runtime").JSX.Element;
37
+ export default GridContext;
@@ -0,0 +1,3 @@
1
+ import { GridProps } from '../types';
2
+ declare const Grid: <T>({ columns, payload, state, onColumnFiltersChange, onPaginationChange, onSortingChange, isLoading, isError, setGlobalFilter, getRowCanExpand, renderSubComponent, manualPagination, }: GridProps<T>) => import("react/jsx-runtime").JSX.Element;
3
+ export { Grid };