@paubox/ui 0.2.0 → 0.3.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/icons/ChevronDown.d.ts +4 -0
- package/icons/ChevronLeft.d.ts +4 -0
- package/icons/ChevronRight.d.ts +4 -0
- package/icons/ChevronUp.d.ts +4 -0
- package/icons/Delete.d.ts +4 -0
- package/icons/Edit.d.ts +4 -0
- package/icons/MoreVertical.d.ts +4 -0
- package/icons/index.d.ts +8 -2
- package/index.d.ts +3 -0
- package/index.js +353 -217
- package/index.mjs +1269 -991
- package/lib/Button/BaseButton.d.ts +2 -2
- package/lib/Checkbox/Checkbox.d.ts +9 -0
- package/lib/Pagination/Pagination.d.ts +14 -0
- package/lib/Table/Table.d.ts +43 -0
- package/lib/Table/tableComponents.d.ts +72 -0
- package/package.json +1 -1
- package/icons/KeyboardArrowDown.d.ts +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
1
|
+
import { CSSProperties, MouseEventHandler } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface BaseButtonProps {
|
|
4
4
|
color?: 'primary' | 'secondary' | 'danger';
|
|
@@ -6,7 +6,7 @@ export interface BaseButtonProps {
|
|
|
6
6
|
size?: 'large' | 'small';
|
|
7
7
|
round?: boolean;
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
-
onClick?:
|
|
9
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
}
|
|
12
12
|
declare const BaseButton: import('@emotion/styled').StyledComponent<{
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React, ChangeEvent } from 'react';
|
|
2
|
+
|
|
3
|
+
interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
indeterminate?: boolean;
|
|
6
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const Checkbox: ({ checked, indeterminate, onChange, ...props }: CheckboxProps) => JSX.Element;
|
|
9
|
+
export default Checkbox;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface PageInfo {
|
|
2
|
+
pageCount: number;
|
|
3
|
+
itemCount: number;
|
|
4
|
+
currentPage: number;
|
|
5
|
+
items: number;
|
|
6
|
+
}
|
|
7
|
+
interface PaginationProps {
|
|
8
|
+
pageInfo: PageInfo;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
onPageSizeChange: (size: number) => void;
|
|
11
|
+
onPageChange: (page: number) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const Pagination: ({ pageInfo, isLoading, onPageSizeChange, onPageChange, }: PaginationProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default Pagination;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PageInfo } from '../Pagination/Pagination';
|
|
2
|
+
import { ColumnDef, OnChangeFn, Row } from '@tanstack/react-table';
|
|
3
|
+
|
|
4
|
+
export type TableColumn<T> = ColumnDef<T> & {
|
|
5
|
+
key: string;
|
|
6
|
+
header: string;
|
|
7
|
+
width?: number;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export interface TableSort {
|
|
11
|
+
id: string;
|
|
12
|
+
desc: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface RowSelectState {
|
|
15
|
+
[x: string]: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface RowAction<T> {
|
|
18
|
+
label: string;
|
|
19
|
+
onClick: (row: T) => void;
|
|
20
|
+
icon?: React.ReactNode;
|
|
21
|
+
disabled?: boolean | ((row: T) => boolean);
|
|
22
|
+
show?: (row: T) => boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface TableProps<T extends object> {
|
|
25
|
+
height?: number;
|
|
26
|
+
data: T[];
|
|
27
|
+
columns: TableColumn<T>[];
|
|
28
|
+
pageInfo: PageInfo;
|
|
29
|
+
getRowId: (originalRow: T, index: number, parent?: Row<T> | undefined) => string;
|
|
30
|
+
isLoading?: boolean;
|
|
31
|
+
onPageSizeChange: (size: number) => void;
|
|
32
|
+
onPageChange: (page: number) => void;
|
|
33
|
+
sorting?: TableSort;
|
|
34
|
+
onSortChange?: (sorting: TableSort) => void;
|
|
35
|
+
enableRowSelection?: boolean;
|
|
36
|
+
selectedRows?: RowSelectState;
|
|
37
|
+
onRowSelectionChange?: OnChangeFn<RowSelectState>;
|
|
38
|
+
onRowClick?: (row: T) => void;
|
|
39
|
+
rowActions?: RowAction<T>[];
|
|
40
|
+
dense?: boolean;
|
|
41
|
+
}
|
|
42
|
+
declare const Table: <T extends object>({ height, data, pageInfo, columns, getRowId, isLoading, sorting, onPageSizeChange, onPageChange, onSortChange, enableRowSelection, selectedRows, onRowSelectionChange, onRowClick, rowActions, dense, }: TableProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
43
|
+
export default Table;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { RowAction } from './Table';
|
|
2
|
+
import { Row } from '@tanstack/react-table';
|
|
3
|
+
|
|
4
|
+
export declare const TableContainer: import('@emotion/styled').StyledComponent<{
|
|
5
|
+
theme?: import('@emotion/react').Theme;
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export declare const TableWrapper: import('@emotion/styled').StyledComponent<{
|
|
9
|
+
theme?: import('@emotion/react').Theme;
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const StyledTable: import('@emotion/styled').StyledComponent<{
|
|
13
|
+
theme?: import('@emotion/react').Theme;
|
|
14
|
+
as?: React.ElementType;
|
|
15
|
+
}, import('react').DetailedHTMLProps<import('react').TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {}>;
|
|
16
|
+
export declare const TableHeader: import('@emotion/styled').StyledComponent<{
|
|
17
|
+
theme?: import('@emotion/react').Theme;
|
|
18
|
+
as?: React.ElementType;
|
|
19
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
20
|
+
export declare const Th: import('@emotion/styled').StyledComponent<{
|
|
21
|
+
variant: "headline100Regular" | "headline100Semibold" | "headline200Regular" | "headline200Semibold" | "headline300Regular" | "headline300Semibold" | "paragraph100Regular" | "paragraph100Semibold" | "paragraph200Regular" | "paragraph200Semibold" | "paragraph300Regular" | "paragraph300Medium" | "paragraph300Semibold" | "paragraph300Bold" | "button100Medium" | "button200Medium" | "label100Regular" | "label100Medium" | "label100Semibold" | "label200Regular" | "label200Medium" | "label200Semibold";
|
|
22
|
+
color?: "primary" | "secondary" | string;
|
|
23
|
+
css?: import('@emotion/utils').SerializedStyles;
|
|
24
|
+
as?: keyof import("react").JSX.IntrinsicElements;
|
|
25
|
+
} & import('react').HTMLAttributes<HTMLDivElement> & {
|
|
26
|
+
theme?: import('@emotion/react').Theme;
|
|
27
|
+
}, {}, {}>;
|
|
28
|
+
export declare const Tr: import('@emotion/styled').StyledComponent<{
|
|
29
|
+
theme?: import('@emotion/react').Theme;
|
|
30
|
+
as?: React.ElementType;
|
|
31
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, {}>;
|
|
32
|
+
export declare const Td: import('@emotion/styled').StyledComponent<{
|
|
33
|
+
variant: "headline100Regular" | "headline100Semibold" | "headline200Regular" | "headline200Semibold" | "headline300Regular" | "headline300Semibold" | "paragraph100Regular" | "paragraph100Semibold" | "paragraph200Regular" | "paragraph200Semibold" | "paragraph300Regular" | "paragraph300Medium" | "paragraph300Semibold" | "paragraph300Bold" | "button100Medium" | "button200Medium" | "label100Regular" | "label100Medium" | "label100Semibold" | "label200Regular" | "label200Medium" | "label200Semibold";
|
|
34
|
+
color?: "primary" | "secondary" | string;
|
|
35
|
+
css?: import('@emotion/utils').SerializedStyles;
|
|
36
|
+
as?: keyof import("react").JSX.IntrinsicElements;
|
|
37
|
+
} & import('react').HTMLAttributes<HTMLDivElement> & {
|
|
38
|
+
theme?: import('@emotion/react').Theme;
|
|
39
|
+
}, {}, {}>;
|
|
40
|
+
export declare const HeaderContent: import('@emotion/styled').StyledComponent<{
|
|
41
|
+
theme?: import('@emotion/react').Theme;
|
|
42
|
+
as?: React.ElementType;
|
|
43
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
44
|
+
export declare const ResizeHandle: import('@emotion/styled').StyledComponent<{
|
|
45
|
+
theme?: import('@emotion/react').Theme;
|
|
46
|
+
as?: React.ElementType;
|
|
47
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
48
|
+
export declare const SortIcon: import('@emotion/styled').StyledComponent<{
|
|
49
|
+
theme?: import('@emotion/react').Theme;
|
|
50
|
+
as?: React.ElementType;
|
|
51
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
52
|
+
export declare const LoadingOverlay: import('@emotion/styled').StyledComponent<{
|
|
53
|
+
theme?: import('@emotion/react').Theme;
|
|
54
|
+
as?: React.ElementType;
|
|
55
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
56
|
+
export declare const ContextMenuButton: import('@emotion/styled').StyledComponent<import('../Button/Button').ButtonProps & import('react').RefAttributes<HTMLButtonElement> & {
|
|
57
|
+
theme?: import('@emotion/react').Theme;
|
|
58
|
+
}, {}, {}>;
|
|
59
|
+
export declare const MenuItem: import('@emotion/styled').StyledComponent<{
|
|
60
|
+
theme?: import('@emotion/react').Theme;
|
|
61
|
+
as?: React.ElementType;
|
|
62
|
+
} & {
|
|
63
|
+
disabled?: boolean;
|
|
64
|
+
}, import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
65
|
+
interface ContextMenuCellProps {
|
|
66
|
+
row: Row<any>;
|
|
67
|
+
setOpenMenuId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
68
|
+
openMenuId: string | null;
|
|
69
|
+
rowActions: RowAction<any>[];
|
|
70
|
+
}
|
|
71
|
+
export declare const ContextMenuCell: ({ row, setOpenMenuId, openMenuId, rowActions, }: ContextMenuCellProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
72
|
+
export {};
|
package/package.json
CHANGED