react-shadcn-table 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +219 -0
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/debounced-input.d.ts +6 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/native-select.d.ts +8 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/index.cjs +37 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5173 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/package/contexts/grid/GridContext.d.ts +4 -0
- package/dist/package/contexts/grid/types/index.d.ts +58 -0
- package/dist/package/core/index.d.ts +4 -0
- package/dist/package/core/types/index.d.ts +342 -0
- package/dist/package/features/index.d.ts +41 -0
- package/dist/package/hooks/useGrid.d.ts +3 -0
- package/dist/package/hooks/useGridState.d.ts +57 -0
- package/dist/package/hooks/useQueryArgs.d.ts +12 -0
- package/dist/package/hooks/useSyncScroll.d.ts +7 -0
- package/dist/package/index.d.ts +11 -0
- package/dist/package/state/rowDensity.d.ts +28 -0
- package/dist/package/state/useColumnOrderState.d.ts +4 -0
- package/dist/package/state/useColumnPinningState.d.ts +5 -0
- package/dist/package/state/useColumnSizingState.d.ts +5 -0
- package/dist/package/state/useColumnVisibilityState.d.ts +5 -0
- package/dist/package/state/useDensityState.d.ts +5 -0
- package/dist/package/state/useRowPinningState.d.ts +5 -0
- package/dist/package/state/useSplitViewState.d.ts +4 -0
- package/dist/package/ui/grid/sections/center/GridCenter.d.ts +3 -0
- package/dist/package/ui/grid/sections/center/GridCenterBody.d.ts +3 -0
- package/dist/package/ui/grid/sections/center/GridCenterHeader.d.ts +2 -0
- package/dist/package/ui/grid/sections/center/GridCenterRowPin.d.ts +3 -0
- package/dist/package/ui/grid/sections/center/feedback/GridCenterEmpty.d.ts +2 -0
- package/dist/package/ui/grid/sections/center/feedback/GridCenterEmptyMessage.d.ts +2 -0
- package/dist/package/ui/grid/sections/center/feedback/GridCenterError.d.ts +2 -0
- package/dist/package/ui/grid/sections/center/feedback/GridCenterErrorMessage.d.ts +2 -0
- package/dist/package/ui/grid/sections/center/feedback/GridCenterSkeleton.d.ts +2 -0
- package/dist/package/ui/grid/sections/end/GridEnd.d.ts +2 -0
- package/dist/package/ui/grid/sections/end/GridEndBody.d.ts +3 -0
- package/dist/package/ui/grid/sections/end/GridEndHeader.d.ts +2 -0
- package/dist/package/ui/grid/sections/end/GridEndRowPin.d.ts +5 -0
- package/dist/package/ui/grid/sections/end/feedback/GridEndEmpty.d.ts +2 -0
- package/dist/package/ui/grid/sections/end/feedback/GridEndSkeleton.d.ts +2 -0
- package/dist/package/ui/grid/sections/start/GridStart.d.ts +2 -0
- package/dist/package/ui/grid/sections/start/GridStartBody.d.ts +3 -0
- package/dist/package/ui/grid/sections/start/GridStartHeader.d.ts +2 -0
- package/dist/package/ui/grid/sections/start/GridStartRowPin.d.ts +5 -0
- package/dist/package/ui/grid/sections/start/feedback/GridStartEmpty.d.ts +2 -0
- package/dist/package/ui/grid/sections/start/feedback/GridStartSkeleton.d.ts +2 -0
- package/dist/package/ui/grid/shared/GridCell.d.ts +6 -0
- package/dist/package/ui/grid/shared/GridHead.d.ts +6 -0
- package/dist/package/ui/grid/shared/feedback/GridRowSkeleton.d.ts +8 -0
- package/dist/package/ui/header/HeaderFilter.d.ts +6 -0
- package/dist/package/ui/header/HeaderMenu.d.ts +6 -0
- package/dist/package/ui/header/HeaderResizing.d.ts +6 -0
- package/dist/package/ui/header/HeaderSort.d.ts +6 -0
- package/dist/package/ui/pagination/index.d.ts +2 -0
- package/dist/package/ui/toolbar/right/ToolbarRightColumns.d.ts +3 -0
- package/dist/package/ui/toolbar/right/ToolbarRightDnd.d.ts +2 -0
- package/dist/package/ui/toolbar/right/ToolbarRightFilter.d.ts +3 -0
- package/dist/package/ui/toolbar/right/ToolbarRightRows.d.ts +2 -0
- package/dist/package/ui/toolbar/right/ToolbarRightSettings.d.ts +2 -0
- package/dist/package/ui/toolbar/right/index.d.ts +4 -0
- package/dist/package/ui/toolbar/top/index.d.ts +2 -0
- package/dist/package/utils/URLSearch.d.ts +57 -0
- package/dist/package/utils/buildQueryString.d.ts +2 -0
- package/dist/package/utils/buildSortString.d.ts +4 -0
- package/dist/package/utils/getPinStyles.d.ts +4 -0
- package/dist/package/utils/pluckSelected.d.ts +40 -0
- package/dist/package/utils/printTable.d.ts +1 -0
- package/dist/package/utils/toTsv.d.ts +2 -0
- package/package.json +94 -0
package/README.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# react-shadcn-table
|
|
2
|
+
|
|
3
|
+
A feature-rich, headless-powered data grid for React — built on [TanStack Table v9](https://tanstack.com/table) and [shadcn/ui](https://ui.shadcn.com/). Sorting, filtering, pagination, row selection, column/row pinning, resizing, drag-and-drop column ordering, expandable rows, and split (frozen) columns — all out of the box.
|
|
4
|
+
|
|
5
|
+
**Live Demo:** [https://react-shadcn-table.jsdevs.xyz/](https://react-shadcn-table.jsdevs.xyz/)
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Global search + per-column filtering (text, range)
|
|
10
|
+
- Multi-column sorting
|
|
11
|
+
- Client-side & manual (server-side) pagination
|
|
12
|
+
- Row selection with checkboxes
|
|
13
|
+
- Column pinning (left / right) and row pinning (top / bottom)
|
|
14
|
+
- Resizable & drag-to-reorder columns (`@dnd-kit`)
|
|
15
|
+
- Split view for frozen left/right columns
|
|
16
|
+
- Expandable rows with custom sub-components
|
|
17
|
+
- Cell selection and cell spanning support
|
|
18
|
+
- Persists per-grid layout (column order, sizing, visibility, pinning) via a storage key
|
|
19
|
+
- Built-in loading, error, and empty states
|
|
20
|
+
- Fully styled with Tailwind CSS + shadcn/ui — themeable out of the box
|
|
21
|
+
- Export to Excel and PDF (`xlsx`, `jspdf`)
|
|
22
|
+
- Bring your own toolbar actions via `topRightSlot`
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install react-shadcn-table
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Peer Dependencies
|
|
31
|
+
|
|
32
|
+
Make sure the following are installed in your project:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install react react-dom
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Tailwind CSS must also be configured in your project, since the grid ships unstyled utility classes rather than a separate CSS bundle.
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { useMemo } from 'react';
|
|
44
|
+
import {
|
|
45
|
+
Grid,
|
|
46
|
+
useGridState,
|
|
47
|
+
type GridFeatures,
|
|
48
|
+
type ColumnDef,
|
|
49
|
+
} from 'react-shadcn-table';
|
|
50
|
+
|
|
51
|
+
interface User {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
email: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const columns = useMemo<ColumnDef<GridFeatures, User, unknown>[]>(
|
|
58
|
+
() => [
|
|
59
|
+
{ id: 'id', accessorKey: 'id', header: () => 'ID' },
|
|
60
|
+
{ id: 'name', accessorKey: 'name', header: () => 'Name' },
|
|
61
|
+
{ id: 'email', accessorKey: 'email', header: () => 'Email' },
|
|
62
|
+
],
|
|
63
|
+
[],
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const App = () => {
|
|
67
|
+
const { state, handlers } = useGridState();
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Grid
|
|
71
|
+
payload={{ data: users, total: users.length }}
|
|
72
|
+
columns={columns}
|
|
73
|
+
state={state}
|
|
74
|
+
{...handlers}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Server-Side (Manual) Pagination, Sorting & Filtering
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
const { state, handlers, rowSelection } = useGridState();
|
|
84
|
+
|
|
85
|
+
const { data, isLoading, isError, refetch, isFetching } = useUsersQuery({
|
|
86
|
+
queryString: URLSearch(state),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
<Grid
|
|
90
|
+
payload={{ data: data?.rows ?? [], total: data?.total ?? 0 }}
|
|
91
|
+
columns={columns}
|
|
92
|
+
manualPagination
|
|
93
|
+
manualFiltering
|
|
94
|
+
manualSorting
|
|
95
|
+
isLoading={isLoading}
|
|
96
|
+
isError={isError}
|
|
97
|
+
isFetching={isFetching}
|
|
98
|
+
refetch={refetch}
|
|
99
|
+
state={state}
|
|
100
|
+
{...handlers}
|
|
101
|
+
height="55vh"
|
|
102
|
+
/>;
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Toolbar Actions
|
|
106
|
+
|
|
107
|
+
Add custom action buttons to the toolbar via `topRightSlot`:
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
import { Plus, RefreshCw } from 'lucide-react';
|
|
111
|
+
import { Button } from '@/components/ui/button';
|
|
112
|
+
|
|
113
|
+
<Grid
|
|
114
|
+
columns={columns}
|
|
115
|
+
payload={{ data, total }}
|
|
116
|
+
state={state}
|
|
117
|
+
{...handlers}
|
|
118
|
+
topRightSlot={
|
|
119
|
+
<div className="flex items-center gap-2">
|
|
120
|
+
<Button variant="ghost" size="icon" onClick={refetch}>
|
|
121
|
+
<RefreshCw className="size-4" />
|
|
122
|
+
</Button>
|
|
123
|
+
<Button variant="default" size="icon" onClick={handleAdd}>
|
|
124
|
+
<Plus className="size-4" />
|
|
125
|
+
</Button>
|
|
126
|
+
</div>
|
|
127
|
+
}
|
|
128
|
+
/>;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Working with Row Selection
|
|
132
|
+
|
|
133
|
+
Use the `pluckSelected` utility to extract a field from all selected rows:
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { pluckSelected } from 'react-shadcn-table';
|
|
137
|
+
|
|
138
|
+
const { rowSelection } = useGridState();
|
|
139
|
+
|
|
140
|
+
const selectedIds = pluckSelected(data, rowSelection, 'id');
|
|
141
|
+
// => ["V001", "V003", "V004"]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## API Reference
|
|
145
|
+
|
|
146
|
+
### `<Grid />` Props
|
|
147
|
+
|
|
148
|
+
| Prop | Type | Default | Description |
|
|
149
|
+
| ----------------------- | ------------------------------------------------------------ | --------- | ---------------------------------------------------------------- |
|
|
150
|
+
| `payload` | `{ data: TData[]; total: number }` | — | Row data and total row count |
|
|
151
|
+
| `columns` | `ColumnDef<GridFeatures, TData, unknown>[]` | — | Column definitions (required) |
|
|
152
|
+
| `state` | `Partial<TableState<GridFeatures>>` | — | Controlled table state (from `useGridState`) |
|
|
153
|
+
| `onColumnFiltersChange` | `OnChangeFn<ColumnFiltersState>` | — | Column filter change handler |
|
|
154
|
+
| `onPaginationChange` | `OnChangeFn<PaginationState>` | — | Pagination change handler |
|
|
155
|
+
| `onSortingChange` | `OnChangeFn<SortingState>` | — | Sorting change handler |
|
|
156
|
+
| `onRowSelectionChange` | `OnChangeFn<RowSelectionState>` | — | Row selection change handler |
|
|
157
|
+
| `setGlobalFilter` | `Dispatch<SetStateAction<string>>` | — | Global search setter |
|
|
158
|
+
| `manualPagination` | `boolean` | `false` | Enables server-side pagination |
|
|
159
|
+
| `manualFiltering` | `boolean` | `false` | Enables server-side column filtering |
|
|
160
|
+
| `manualSorting` | `boolean` | `false` | Enables server-side sorting |
|
|
161
|
+
| `isLoading` | `boolean` | — | Shows skeleton loading rows |
|
|
162
|
+
| `isError` | `boolean` | — | Shows the error state |
|
|
163
|
+
| `isFetching` | `boolean` | — | Shows a background refetch indicator |
|
|
164
|
+
| `refetch` | `() => void` | — | Retry/refresh callback |
|
|
165
|
+
| `renderSubComponent` | `(props: { row: Row<GridFeatures, TData> }) => ReactElement` | — | Custom content for expanded rows |
|
|
166
|
+
| `getRowCanExpand` | `(row: Row<GridFeatures, TData>) => boolean` | — | Controls whether a row can expand |
|
|
167
|
+
| `enableCellSelection` | `boolean` | `false` | Enables Excel-like cell range selection |
|
|
168
|
+
| `enableCellSpanning` | `boolean` | `false` | Enables merged/spanning cells |
|
|
169
|
+
| `enableRowSelection` | `boolean` | `true` | Enables/disables row selection |
|
|
170
|
+
| `height` | `string` | `'65vh'` | Fixed height of the scrollable table body |
|
|
171
|
+
| `name` | `string` | `'munza'` | Storage key for persisting per-grid layout |
|
|
172
|
+
| `topRightSlot` | `React.ReactNode` | — | Custom content on the right of the toolbar (e.g. action buttons) |
|
|
173
|
+
|
|
174
|
+
### `useGridState()`
|
|
175
|
+
|
|
176
|
+
Manages all controlled state required by `<Grid />`.
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
const { state, handlers, rowSelection } = useGridState();
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
|
|
184
|
+
- `state` — `{ columnFilters, globalFilter, pagination, sorting, rowSelection }`
|
|
185
|
+
- `handlers` — `{ onColumnFiltersChange, onPaginationChange, onSortingChange, setGlobalFilter, onRowSelectionChange }`
|
|
186
|
+
- `rowSelection` — the current selection map, exposed directly for convenience
|
|
187
|
+
|
|
188
|
+
### `pluckSelected(data, rowSelection, field)`
|
|
189
|
+
|
|
190
|
+
Extracts a field's value from every currently selected row.
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
pluckSelected(data, rowSelection, 'id'); // => string[]
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### `URLSearch(queryArgs)`
|
|
197
|
+
|
|
198
|
+
Serializes TanStack Table state into a MongoDB/Express-style query string.
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
URLSearch({
|
|
202
|
+
pagination: { pageIndex: 0, pageSize: 20 },
|
|
203
|
+
columnFilters: [{ id: 'status', value: 'active' }],
|
|
204
|
+
sorting: [{ id: 'year', desc: true }],
|
|
205
|
+
globalFilter: 'toyota',
|
|
206
|
+
});
|
|
207
|
+
// => "?page=1&limit=20&status=active&sort=-year&q=toyota"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Peer Dependency Versions
|
|
211
|
+
|
|
212
|
+
| Package | Version |
|
|
213
|
+
| --------------------- | ------------ |
|
|
214
|
+
| `react` / `react-dom` | `^18 \| ^19` |
|
|
215
|
+
| `tailwindcss` | `^4.x` |
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Separator } from './separator';
|
|
3
|
+
declare const buttonGroupVariants: (props?: ({
|
|
4
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react").JSX.Element;
|
|
7
|
+
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): import("react").JSX.Element;
|
|
11
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, };
|
|
@@ -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?: "sm" | "lg" | "default" | "xs" | "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
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -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.Element;
|
|
3
|
+
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react").JSX.Element;
|
|
4
|
+
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react").JSX.Element;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare function 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'>): React.JSX.Element;
|
|
@@ -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>): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: "default" | "destructive";
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
16
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
23
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
25
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
29
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare function Empty({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
3
|
+
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): import("react").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.Element;
|
|
8
|
+
declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
9
|
+
declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): import("react").JSX.Element;
|
|
10
|
+
declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
11
|
+
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
6
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
9
|
+
declare const inputGroupButtonVariants: (props?: ({
|
|
10
|
+
size?: "sm" | "xs" | "icon-xs" | "icon-sm" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
12
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): React.JSX.Element;
|
|
13
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
14
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
15
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
|
|
16
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Separator } from './separator';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
6
|
+
declare const itemVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
8
|
+
size?: "sm" | "default" | "xs" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
declare const itemMediaVariants: (props?: ({
|
|
14
|
+
variant?: "default" | "icon" | "image" | null | undefined;
|
|
15
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
16
|
+
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): React.JSX.Element;
|
|
17
|
+
declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
18
|
+
declare function ItemTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
|
+
declare function ItemDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
20
|
+
declare function ItemActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
21
|
+
declare function ItemHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
22
|
+
declare function ItemFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
23
|
+
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
|
@@ -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): React.JSX.Element;
|
|
6
|
+
declare function NativeSelectOption({ className, ...props }: React.ComponentProps<"option">): React.JSX.Element;
|
|
7
|
+
declare function NativeSelectOptGroup({ className, ...props }: React.ComponentProps<"optgroup">): React.JSX.Element;
|
|
8
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
|
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
|
|
6
|
+
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: "sm" | "default";
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
|
|
10
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
|
|
11
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
|
|
12
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
|
|
13
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
|
|
14
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
|
|
15
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<'table'>): React.JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): React.JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): React.JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): React.JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): React.JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): React.JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): React.JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): React.JSX.Element;
|
|
10
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, };
|