@dust-tt/sparkle 0.2.196 → 0.2.197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/DataTable.d.ts +40 -10
- package/dist/cjs/index.js +3363 -52
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stories/DataTable.stories.d.ts +9 -0
- package/dist/esm/components/DataTable.d.ts +40 -10
- package/dist/esm/index.js +3363 -52
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stories/DataTable.stories.d.ts +9 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/src/components/DataTable.tsx +263 -101
- package/src/stories/DataTable.stories.tsx +110 -21
|
@@ -1,12 +1,42 @@
|
|
|
1
|
+
import { type ColumnDef } from "@tanstack/react-table";
|
|
1
2
|
import React, { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
interface DataTableProps<TData, TValue> {
|
|
4
|
+
data: TData[];
|
|
5
|
+
columns: ColumnDef<TData, TValue>[];
|
|
6
|
+
className?: string;
|
|
7
|
+
filter?: string;
|
|
8
|
+
filterColumn?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function DataTable<TData, TValue>({ data, columns, className, filter, filterColumn, }: DataTableProps<TData, TValue>): React.JSX.Element;
|
|
11
|
+
export declare namespace DataTable {
|
|
12
|
+
var Root: ({ children, className, ...props }: DataTableRootProps) => React.JSX.Element;
|
|
13
|
+
var Header: ({ children, className, ...props }: HeaderProps) => React.JSX.Element;
|
|
14
|
+
var Head: ({ children, className, ...props }: HeadProps) => React.JSX.Element;
|
|
15
|
+
var Body: ({ children, className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>) => React.JSX.Element;
|
|
16
|
+
var Row: ({ children, className, clickable, onClick, ...props }: RowProps) => React.JSX.Element;
|
|
17
|
+
var Cell: ({ children, className, avatarUrl, icon, description, ...props }: CellProps) => React.JSX.Element;
|
|
18
|
+
var Caption: ({ children, className, ...props }: React.HTMLAttributes<HTMLTableCaptionElement>) => React.JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
interface DataTableRootProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
interface HeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
interface HeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
clickable?: boolean;
|
|
32
|
+
onClick?: () => void;
|
|
33
|
+
}
|
|
34
|
+
interface CellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
35
|
+
avatarUrl?: string;
|
|
36
|
+
icon?: React.ComponentType<{
|
|
37
|
+
className?: string;
|
|
38
|
+
}>;
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
12
42
|
export {};
|