@aivex/ui 1.1.0-dev.22 → 1.1.0-dev.24

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.
@@ -0,0 +1,92 @@
1
+ import { type RowData, type TableOptions } from "@tanstack/react-table";
2
+ import type { HTMLAttributes, MouseEvent, ReactNode, Ref } from "react";
3
+ import { type ScrollAreaProps } from "@/components/ScrollArea";
4
+ export type DataGridAlign = "start" | "center" | "end";
5
+ type DataGridValue<TData, TValue> = TValue | ((row: TData, index: number) => TValue);
6
+ declare module "@tanstack/react-table" {
7
+ interface ColumnMeta<TData extends RowData, TValue> {
8
+ align?: DataGridAlign;
9
+ headerAlign?: DataGridAlign;
10
+ cellAlign?: DataGridAlign;
11
+ className?: string;
12
+ headerClassName?: string;
13
+ cellClassName?: DataGridValue<TData, string | undefined>;
14
+ headerSortTrigger?: boolean;
15
+ }
16
+ }
17
+ export interface DataGridRootProps extends HTMLAttributes<HTMLDivElement> {
18
+ ref?: Ref<HTMLDivElement>;
19
+ }
20
+ declare function DataGridRoot({ className, children, ref, ...props }: DataGridRootProps): import("react/jsx-runtime").JSX.Element;
21
+ export interface DataGridViewportProps extends ScrollAreaProps {
22
+ ref?: Ref<HTMLDivElement>;
23
+ }
24
+ declare function DataGridViewport({ className, children, ref, scrollbars, type, ...props }: DataGridViewportProps): import("react/jsx-runtime").JSX.Element;
25
+ export interface DataGridHeaderProps extends HTMLAttributes<HTMLDivElement> {
26
+ sticky?: boolean;
27
+ ref?: Ref<HTMLDivElement>;
28
+ }
29
+ declare function DataGridHeader({ className, children, sticky, ref, ...props }: DataGridHeaderProps): import("react/jsx-runtime").JSX.Element;
30
+ export interface DataGridBodyProps extends HTMLAttributes<HTMLDivElement> {
31
+ ref?: Ref<HTMLDivElement>;
32
+ }
33
+ declare function DataGridBody({ className, children, ref, ...props }: DataGridBodyProps): import("react/jsx-runtime").JSX.Element;
34
+ export interface DataGridRowProps extends HTMLAttributes<HTMLDivElement> {
35
+ asChild?: boolean;
36
+ selected?: boolean;
37
+ disabled?: boolean;
38
+ interactive?: boolean;
39
+ ref?: Ref<HTMLDivElement>;
40
+ }
41
+ declare function DataGridRow({ className, children, asChild, selected, disabled, interactive, ref, onClick, onDoubleClick, onKeyDown, tabIndex, "aria-disabled": ariaDisabled, ...props }: DataGridRowProps): import("react/jsx-runtime").JSX.Element;
42
+ export interface DataGridCellProps extends HTMLAttributes<HTMLDivElement> {
43
+ align?: DataGridAlign;
44
+ asChild?: boolean;
45
+ ref?: Ref<HTMLDivElement>;
46
+ }
47
+ declare function DataGridCell({ className, children, align, asChild, ref, ...props }: DataGridCellProps): import("react/jsx-runtime").JSX.Element;
48
+ export interface DataGridHeaderCellProps extends HTMLAttributes<HTMLDivElement> {
49
+ align?: DataGridAlign;
50
+ asChild?: boolean;
51
+ ref?: Ref<HTMLDivElement>;
52
+ }
53
+ declare function DataGridHeaderCell({ className, children, align, asChild, ref, ...props }: DataGridHeaderCellProps): import("react/jsx-runtime").JSX.Element;
54
+ export interface DataGridEmptyProps extends HTMLAttributes<HTMLDivElement> {
55
+ children?: ReactNode;
56
+ ref?: Ref<HTMLDivElement>;
57
+ }
58
+ declare function DataGridEmpty({ className, children, ref, ...props }: DataGridEmptyProps): import("react/jsx-runtime").JSX.Element;
59
+ export interface DataGridLoadingProps extends HTMLAttributes<HTMLDivElement> {
60
+ rowCount?: number;
61
+ ref?: Ref<HTMLDivElement>;
62
+ }
63
+ declare function DataGridLoading({ className, rowCount, ref, ...props }: DataGridLoadingProps): import("react/jsx-runtime").JSX.Element;
64
+ export interface DataGridInfiniteTriggerProps extends HTMLAttributes<HTMLDivElement> {
65
+ loading?: boolean;
66
+ ref?: Ref<HTMLDivElement>;
67
+ }
68
+ declare function DataGridInfiniteTrigger({ className, children, loading, ref, ...props }: DataGridInfiniteTriggerProps): import("react/jsx-runtime").JSX.Element;
69
+ export interface DataGridProps<TData> extends Omit<TableOptions<TData>, "getCoreRowModel"> {
70
+ getCoreRowModel?: TableOptions<TData>["getCoreRowModel"];
71
+ className?: string;
72
+ ref?: Ref<HTMLDivElement>;
73
+ loading?: boolean;
74
+ loadingRowCount?: number;
75
+ empty?: ReactNode;
76
+ headerSticky?: boolean;
77
+ viewportClassName?: string;
78
+ contentClassName?: string;
79
+ headerClassName?: string;
80
+ bodyClassName?: string;
81
+ rowClassName?: DataGridValue<TData, string | undefined>;
82
+ rowInteractive?: DataGridValue<TData, boolean>;
83
+ isRowSelected?: (row: TData, index: number) => boolean;
84
+ isRowDisabled?: (row: TData, index: number) => boolean;
85
+ onRowClick?: (row: TData, index: number, event: MouseEvent<HTMLDivElement>) => void;
86
+ loadingMore?: boolean;
87
+ loadingMoreContent?: ReactNode;
88
+ infiniteTriggerRef?: Ref<HTMLDivElement>;
89
+ infiniteTriggerClassName?: string;
90
+ }
91
+ declare function DataGrid<TData>({ className, loading, loadingRowCount, empty, headerSticky, viewportClassName, contentClassName, headerClassName, bodyClassName, rowClassName, rowInteractive, isRowSelected, isRowDisabled, onRowClick, loadingMore, loadingMoreContent, infiniteTriggerRef, infiniteTriggerClassName, ref, getCoreRowModel, ...tableOptions }: DataGridProps<TData>): import("react/jsx-runtime").JSX.Element;
92
+ export { DataGrid, DataGridBody, DataGridCell, DataGridEmpty, DataGridHeader, DataGridHeaderCell, DataGridInfiniteTrigger, DataGridLoading, DataGridRoot, DataGridRow, DataGridViewport, };
@@ -0,0 +1,4 @@
1
+ export type { CellContext, ColumnDef, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, ExpandedState, GroupingState, PaginationState, Row, RowSelectionState, SortingState, Table as ReactTableInstance, TableOptions, VisibilityState, } from "@tanstack/react-table";
2
+ export { getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel, } from "@tanstack/react-table";
3
+ export type { DataGridAlign, DataGridBodyProps, DataGridCellProps, DataGridEmptyProps, DataGridHeaderCellProps, DataGridHeaderProps, DataGridInfiniteTriggerProps, DataGridLoadingProps, DataGridProps, DataGridRootProps, DataGridRowProps, DataGridViewportProps, } from "./DataGrid";
4
+ export { DataGrid, DataGridBody, DataGridCell, DataGridEmpty, DataGridHeader, DataGridHeaderCell, DataGridInfiniteTrigger, DataGridLoading, DataGridRoot, DataGridRow, DataGridViewport, } from "./DataGrid";
@@ -1,7 +1,7 @@
1
1
  import { type VariantProps } from "class-variance-authority";
2
2
  import type { HTMLAttributes, ReactNode, Ref } from "react";
3
3
  declare const messageboxVariants: (props?: ({
4
- type?: "danger" | "warning" | "basic" | "info" | "success" | null | undefined;
4
+ type?: "danger" | "basic" | "warning" | "info" | "success" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export interface MessageboxProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof messageboxVariants> {
7
7
  message: string;
@@ -1 +1,2 @@
1
+ export type { PanelProps } from "./Panel";
1
2
  export { Panel } from "./Panel";
@@ -1,5 +1,5 @@
1
1
  import type { HTMLAttributes, Ref } from "react";
2
- export type ProgressBarColor = "success" | "warning" | "info" | "danger" | "neutral" | "green" | "yellow" | "blue" | "gray";
2
+ export type ProgressBarColor = "success" | "warning" | "info" | "danger";
3
3
  export interface ProgressBarProps extends Omit<HTMLAttributes<HTMLDivElement>, "color"> {
4
4
  current: number;
5
5
  total: number;
@@ -1,8 +1,14 @@
1
1
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
2
- import type { ComponentProps } from "react";
3
- type ScrollAreaProps = ComponentProps<typeof ScrollAreaPrimitive.Root>;
2
+ import type { ComponentProps, Ref, UIEventHandler } from "react";
3
+ type ScrollAreaScrollbars = "both" | "horizontal" | "vertical";
4
+ type ScrollAreaProps = ComponentProps<typeof ScrollAreaPrimitive.Root> & {
5
+ onViewportScroll?: UIEventHandler<HTMLDivElement>;
6
+ scrollbars?: ScrollAreaScrollbars;
7
+ viewportClassName?: string;
8
+ viewportRef?: Ref<HTMLDivElement>;
9
+ };
4
10
  type ScrollBarProps = ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>;
5
- declare function ScrollArea({ className, children, ref, type, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function ScrollArea({ className, children, onViewportScroll, ref, scrollbars, type, viewportClassName, viewportRef, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
6
12
  declare function ScrollBar({ className, orientation, ref, ...props }: ScrollBarProps): import("react/jsx-runtime").JSX.Element;
7
- export type { ScrollAreaProps, ScrollBarProps };
13
+ export type { ScrollAreaProps, ScrollAreaScrollbars, ScrollBarProps };
8
14
  export { ScrollArea, ScrollBar };
@@ -1,2 +1,2 @@
1
- export type { ScrollAreaProps, ScrollBarProps } from "./ScrollArea";
1
+ export type { ScrollAreaProps, ScrollAreaScrollbars, ScrollBarProps } from "./ScrollArea";
2
2
  export { ScrollArea, ScrollBar } from "./ScrollArea";
@@ -1,29 +1,61 @@
1
- import type { HTMLAttributes, Ref, TdHTMLAttributes, ThHTMLAttributes } from "react";
1
+ import type { HTMLAttributes, ReactNode, Ref, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from "react";
2
+ type TableSize = "sm" | "md";
2
3
  export interface TableProps extends HTMLAttributes<HTMLDivElement> {
4
+ size?: TableSize;
5
+ tableClassName?: string;
3
6
  ref?: Ref<HTMLDivElement>;
4
7
  }
5
- declare function Table({ className, children, ref, ...props }: TableProps): import("react/jsx-runtime").JSX.Element;
8
+ declare function Table({ className, tableClassName, size, children, ref, ...props }: TableProps): import("react/jsx-runtime").JSX.Element;
6
9
  export interface TableHeaderProps extends HTMLAttributes<HTMLTableSectionElement> {
7
10
  ref?: Ref<HTMLTableSectionElement>;
8
11
  }
9
12
  declare function TableHeader({ className, children, ref, ...props }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
13
+ export interface TableFooterProps extends HTMLAttributes<HTMLTableSectionElement> {
14
+ ref?: Ref<HTMLTableSectionElement>;
15
+ }
16
+ declare function TableFooter({ className, children, ref, ...props }: TableFooterProps): import("react/jsx-runtime").JSX.Element;
17
+ export interface TableCaptionProps extends HTMLAttributes<HTMLTableCaptionElement> {
18
+ ref?: Ref<HTMLTableCaptionElement>;
19
+ }
20
+ declare function TableCaption({ className, children, ref, ...props }: TableCaptionProps): import("react/jsx-runtime").JSX.Element;
10
21
  export interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
11
22
  ref?: Ref<HTMLTableSectionElement>;
12
23
  }
13
24
  declare function TableBody({ className, children, ref, ...props }: TableBodyProps): import("react/jsx-runtime").JSX.Element;
14
25
  export interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
26
+ size?: TableSize;
27
+ selected?: boolean;
28
+ disabled?: boolean;
29
+ interactive?: boolean;
30
+ asChild?: boolean;
15
31
  ref?: Ref<HTMLTableRowElement>;
16
32
  }
17
- declare function TableRow({ className, children, ref, ...props }: TableRowProps): import("react/jsx-runtime").JSX.Element;
33
+ declare function TableRow({ className, children, size, selected, disabled, interactive, asChild, ref, onClick, onDoubleClick, onKeyDown, tabIndex, "aria-disabled": ariaDisabled, ...props }: TableRowProps): import("react/jsx-runtime").JSX.Element;
18
34
  export interface TableHeadProps extends ThHTMLAttributes<HTMLTableCellElement> {
35
+ size?: TableSize;
19
36
  sortable?: boolean;
20
37
  sortDirection?: "asc" | "desc" | null;
21
38
  onSort?: () => void;
39
+ asChild?: boolean;
22
40
  ref?: Ref<HTMLTableCellElement>;
23
41
  }
24
- declare function TableHead({ className, children, sortable, sortDirection, onSort, ref, ...props }: TableHeadProps): import("react/jsx-runtime").JSX.Element;
42
+ declare function TableHead({ className, children, size, sortable, sortDirection, onSort, asChild, ref, ...props }: TableHeadProps): import("react/jsx-runtime").JSX.Element;
25
43
  export interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
44
+ size?: TableSize;
45
+ asChild?: boolean;
26
46
  ref?: Ref<HTMLTableCellElement>;
27
47
  }
28
- declare function TableCell({ className, children, ref, ...props }: TableCellProps): import("react/jsx-runtime").JSX.Element;
29
- export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow };
48
+ declare function TableCell({ className, children, size, asChild, ref, ...props }: TableCellProps): import("react/jsx-runtime").JSX.Element;
49
+ export interface TableEmptyProps extends TdHTMLAttributes<HTMLTableCellElement> {
50
+ colSpan: number;
51
+ children?: ReactNode;
52
+ ref?: Ref<HTMLTableCellElement>;
53
+ }
54
+ declare function TableEmpty({ className, children, colSpan, ref, ...props }: TableEmptyProps): import("react/jsx-runtime").JSX.Element;
55
+ export interface TableLoadingProps extends TableHTMLAttributes<HTMLTableSectionElement> {
56
+ colSpan: number;
57
+ rowCount?: number;
58
+ ref?: Ref<HTMLTableSectionElement>;
59
+ }
60
+ declare function TableLoading({ className, colSpan, rowCount, ref, ...props }: TableLoadingProps): import("react/jsx-runtime").JSX.Element;
61
+ export { Table, TableBody, TableCaption, TableCell, TableEmpty, TableFooter, TableHead, TableHeader, TableLoading, TableRow, };
@@ -1,2 +1,2 @@
1
- export type { TableBodyProps, TableCellProps, TableHeaderProps, TableHeadProps, TableProps, TableRowProps, } from "./Table";
2
- export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "./Table";
1
+ export type { TableBodyProps, TableCaptionProps, TableCellProps, TableEmptyProps, TableFooterProps, TableHeaderProps, TableHeadProps, TableLoadingProps, TableProps, TableRowProps, } from "./Table";
2
+ export { Table, TableBody, TableCaption, TableCell, TableEmpty, TableFooter, TableHead, TableHeader, TableLoading, TableRow, } from "./Table";