@veritone-ce/design-system 2.3.13 → 2.4.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/dist/cjs/StatusChip/index.js +65 -0
- package/dist/cjs/StatusChip/styles.module.scss.js +7 -0
- package/dist/cjs/Table/AutoTable/common.js +144 -0
- package/dist/cjs/Table/AutoTable/controlled.js +102 -0
- package/dist/cjs/Table/AutoTable/index.js +110 -0
- package/dist/cjs/Table/AutoTable/virtual.js +177 -0
- package/dist/cjs/Table/TableCell/index.js +50 -0
- package/dist/cjs/Table/TableCell/styles.module.scss.js +7 -0
- package/dist/cjs/Table/TableRow/index.js +34 -0
- package/dist/cjs/Table/TableRow/styles.module.scss.js +7 -0
- package/dist/cjs/Table/index.js +76 -0
- package/dist/cjs/Table/styles.module.scss.js +7 -0
- package/dist/cjs/Tooltip/index.js +38 -26
- package/dist/cjs/Tooltip/styles.module.scss.js +1 -1
- package/dist/cjs/Typography/index.js +4 -2
- package/dist/cjs/Typography/variants.module.scss.js +1 -1
- package/dist/cjs/index.js +27 -10
- package/dist/cjs/styles/createPalette.js +24 -4
- package/dist/cjs/styles/typography.js +9 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/StatusChip/index.js +61 -0
- package/dist/esm/StatusChip/styles.module.scss.js +3 -0
- package/dist/esm/Table/AutoTable/common.js +138 -0
- package/dist/esm/Table/AutoTable/controlled.js +98 -0
- package/dist/esm/Table/AutoTable/index.js +106 -0
- package/dist/esm/Table/AutoTable/virtual.js +172 -0
- package/dist/esm/Table/TableCell/index.js +46 -0
- package/dist/esm/Table/TableCell/styles.module.scss.js +3 -0
- package/dist/esm/Table/TableRow/index.js +30 -0
- package/dist/esm/Table/TableRow/styles.module.scss.js +3 -0
- package/dist/esm/Table/index.js +69 -0
- package/dist/esm/Table/styles.module.scss.js +3 -0
- package/dist/esm/Tooltip/index.js +38 -26
- package/dist/esm/Tooltip/styles.module.scss.js +1 -1
- package/dist/esm/Typography/index.js +4 -2
- package/dist/esm/Typography/variants.module.scss.js +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/styles/createPalette.js +24 -4
- package/dist/esm/styles/scss/theme.generated.scss +83 -17
- package/dist/esm/styles/typography.js +9 -1
- package/dist/esm/styles.css +1 -1
- package/dist/types/Checkbox/index.d.ts +2 -0
- package/dist/types/Dialog/components.d.ts +50 -6
- package/dist/types/Drawer/components.d.ts +50 -5
- package/dist/types/StatusChip/index.d.ts +12 -0
- package/dist/types/Table/AutoTable/common.d.ts +31 -0
- package/dist/types/Table/AutoTable/controlled.d.ts +13 -0
- package/dist/types/Table/AutoTable/index.d.ts +47 -0
- package/dist/types/Table/AutoTable/types.d.ts +106 -0
- package/dist/types/Table/AutoTable/virtual.d.ts +23 -0
- package/dist/types/Table/TableCell/index.d.ts +14 -0
- package/dist/types/Table/TableRow/index.d.ts +10 -0
- package/dist/types/Table/index.d.ts +68 -0
- package/dist/types/Typography/index.d.ts +11 -3
- package/dist/types/index.d.ts +10 -0
- package/dist/types/styles/createPalette.d.ts +2 -0
- package/dist/types/styles/palette.d.ts +2 -0
- package/dist/types/styles/typography.d.ts +1 -1
- package/package.json +2 -1
|
@@ -34,9 +34,27 @@ declare const Drawer: React.ForwardRefExoticComponent<Omit<DrawerOptions, "dismi
|
|
|
34
34
|
'data-testid'?: string | undefined;
|
|
35
35
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
36
36
|
export default Drawer;
|
|
37
|
-
export declare const DrawerStart: React.ForwardRefExoticComponent<
|
|
37
|
+
export declare const DrawerStart: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
38
|
+
as?: keyof React.JSX.IntrinsicElements | undefined;
|
|
39
|
+
variant?: "title" | "h1" | "h2" | "h3" | "h4" | "label" | "paragraph1" | "paragraph2" | "paragraph3" | "button" | "buttonSmall" | "input" | "statusChip" | undefined;
|
|
40
|
+
color?: "inherit" | "disabled" | keyof import("../styles/palette.js").PaletteText | undefined;
|
|
41
|
+
leadingTrim?: boolean | undefined;
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
'data-testid'?: string | undefined;
|
|
44
|
+
style?: React.CSSProperties | undefined;
|
|
45
|
+
className?: string | undefined;
|
|
46
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
38
47
|
export declare const DrawerContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
-
export declare const DrawerEnd: React.ForwardRefExoticComponent<
|
|
48
|
+
export declare const DrawerEnd: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
49
|
+
as?: keyof React.JSX.IntrinsicElements | undefined;
|
|
50
|
+
variant?: "title" | "h1" | "h2" | "h3" | "h4" | "label" | "paragraph1" | "paragraph2" | "paragraph3" | "button" | "buttonSmall" | "input" | "statusChip" | undefined;
|
|
51
|
+
color?: "inherit" | "disabled" | keyof import("../styles/palette.js").PaletteText | undefined;
|
|
52
|
+
leadingTrim?: boolean | undefined;
|
|
53
|
+
children?: React.ReactNode;
|
|
54
|
+
'data-testid'?: string | undefined;
|
|
55
|
+
style?: React.CSSProperties | undefined;
|
|
56
|
+
className?: string | undefined;
|
|
57
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
40
58
|
export type DrawerTitleContainerVariant = 'text' | 'bar';
|
|
41
59
|
export type DrawerTitlePalette = ResolvablePaletteValue<PaletteSurfaceColors>;
|
|
42
60
|
export type DrawerTitleProps = TypographyProps & {
|
|
@@ -44,13 +62,40 @@ export type DrawerTitleProps = TypographyProps & {
|
|
|
44
62
|
actions?: React.ReactNode;
|
|
45
63
|
container?: DrawerTitleContainerVariant;
|
|
46
64
|
};
|
|
47
|
-
export declare const DrawerTitle: React.ForwardRefExoticComponent<
|
|
65
|
+
export declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
66
|
+
as?: keyof React.JSX.IntrinsicElements | undefined;
|
|
67
|
+
variant?: "title" | "h1" | "h2" | "h3" | "h4" | "label" | "paragraph1" | "paragraph2" | "paragraph3" | "button" | "buttonSmall" | "input" | "statusChip" | undefined;
|
|
68
|
+
color?: "inherit" | "disabled" | keyof import("../styles/palette.js").PaletteText | undefined;
|
|
69
|
+
leadingTrim?: boolean | undefined;
|
|
70
|
+
children?: React.ReactNode;
|
|
71
|
+
'data-testid'?: string | undefined;
|
|
72
|
+
style?: React.CSSProperties | undefined;
|
|
73
|
+
className?: string | undefined;
|
|
74
|
+
} & {
|
|
48
75
|
palette?: PaletteSurfaceColors | import("../styles/css-vars.js").RecursiveStringObject<PaletteSurfaceColors> | undefined;
|
|
49
76
|
actions?: React.ReactNode;
|
|
50
77
|
container?: DrawerTitleContainerVariant | undefined;
|
|
51
78
|
} & React.RefAttributes<HTMLHeadingElement>>;
|
|
52
|
-
export declare const DrawerTypography: React.ForwardRefExoticComponent<
|
|
53
|
-
|
|
79
|
+
export declare const DrawerTypography: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
80
|
+
as?: keyof React.JSX.IntrinsicElements | undefined;
|
|
81
|
+
variant?: "title" | "h1" | "h2" | "h3" | "h4" | "label" | "paragraph1" | "paragraph2" | "paragraph3" | "button" | "buttonSmall" | "input" | "statusChip" | undefined;
|
|
82
|
+
color?: "inherit" | "disabled" | keyof import("../styles/palette.js").PaletteText | undefined;
|
|
83
|
+
leadingTrim?: boolean | undefined;
|
|
84
|
+
children?: React.ReactNode;
|
|
85
|
+
'data-testid'?: string | undefined;
|
|
86
|
+
style?: React.CSSProperties | undefined;
|
|
87
|
+
className?: string | undefined;
|
|
88
|
+
} & React.RefAttributes<HTMLParagraphElement>>;
|
|
89
|
+
export declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
90
|
+
as?: keyof React.JSX.IntrinsicElements | undefined;
|
|
91
|
+
variant?: "title" | "h1" | "h2" | "h3" | "h4" | "label" | "paragraph1" | "paragraph2" | "paragraph3" | "button" | "buttonSmall" | "input" | "statusChip" | undefined;
|
|
92
|
+
color?: "inherit" | "disabled" | keyof import("../styles/palette.js").PaletteText | undefined;
|
|
93
|
+
leadingTrim?: boolean | undefined;
|
|
94
|
+
children?: React.ReactNode;
|
|
95
|
+
'data-testid'?: string | undefined;
|
|
96
|
+
style?: React.CSSProperties | undefined;
|
|
97
|
+
className?: string | undefined;
|
|
98
|
+
} & React.RefAttributes<HTMLParagraphElement>>;
|
|
54
99
|
export declare const DrawerActions: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
55
100
|
export declare const DrawerCloseButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
56
101
|
variant?: import("../Button/index.js").ButtonVariant | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PaletteActionVariantsColors } from '../styles/index.js';
|
|
3
|
+
export type StatusChipPalette = PaletteActionVariantsColors;
|
|
4
|
+
export type StatusChipProps = {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
palette?: StatusChipPalette;
|
|
7
|
+
'data-testid'?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
};
|
|
11
|
+
declare const StatusChip: ({ children, palette: palette, ...props }: StatusChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default StatusChip;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ColumnDef as RTColumnDef, PaginationState, Row, RowSelectionState, SortingState, RowData } from '@tanstack/react-table';
|
|
2
|
+
import type { ColumnDef, ColumnHelper } from './types.js';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export declare function createColumnHelper<TData extends RowData, TMeta = unknown>(): ColumnHelper<TData, TMeta>;
|
|
5
|
+
export type AutoTableHookOptions<TData, TMeta = unknown> = {
|
|
6
|
+
data: TData[];
|
|
7
|
+
columns: ColumnDef<TData, TMeta>[];
|
|
8
|
+
meta?: TMeta;
|
|
9
|
+
getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string;
|
|
10
|
+
sorting: SortingState;
|
|
11
|
+
enableSorting: boolean;
|
|
12
|
+
onSortingChange(newSorting: SortingState): void;
|
|
13
|
+
manualSorting?: boolean;
|
|
14
|
+
rowSelection: RowSelectionState;
|
|
15
|
+
enableRowSelection: boolean;
|
|
16
|
+
onRowSelectionChange(newRowSelection: RowSelectionState): void;
|
|
17
|
+
pagination: PaginationState;
|
|
18
|
+
enablePagination: boolean;
|
|
19
|
+
onPageChange(newPage: number): void;
|
|
20
|
+
onRowsPerPageChange(newRowsPerPage: number): void;
|
|
21
|
+
manualPagination?: boolean;
|
|
22
|
+
manualRowCount?: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function useAutoTable<TData, TMeta = unknown>(options: AutoTableHookOptions<TData, TMeta>): import("@tanstack/react-table").Table<TData>;
|
|
25
|
+
export declare function mapColumnDefs<TData, TMeta>(columnDefs: ColumnDef<TData, TMeta>[]): RTColumnDef<TData>[];
|
|
26
|
+
export declare function mapColumnDef<TData, TMeta, VData = unknown>(columnDef: ColumnDef<TData, TMeta, VData>): RTColumnDef<TData, VData>;
|
|
27
|
+
export type ErrorContainerProps = {
|
|
28
|
+
error: boolean | string;
|
|
29
|
+
};
|
|
30
|
+
export type ErrorContainer = React.ComponentType<ErrorContainerProps>;
|
|
31
|
+
export declare const DefaultErrorContainer: ErrorContainer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutoTableHookOptions, type ErrorContainer as ErrorContainerType } from './common.js';
|
|
3
|
+
export type ControlledAutoTableProps<TData, TMeta = unknown> = AutoTableHookOptions<TData, TMeta> & {
|
|
4
|
+
stickyHeader?: boolean | {
|
|
5
|
+
offset: number;
|
|
6
|
+
};
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
zeroStateMessage?: React.ReactNode;
|
|
9
|
+
error?: boolean | string;
|
|
10
|
+
ErrorContainer?: ErrorContainerType;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export default function ControlledAutoTable<TData, TMeta = unknown>({ stickyHeader, loading, zeroStateMessage, error, ErrorContainer, className, ...options }: ControlledAutoTableProps<TData, TMeta>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { SortingState, RowSelectionState, Row } from '@tanstack/react-table';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
import type { ColumnDef } from './types.js';
|
|
5
|
+
import { type ErrorContainer as ErrorContainerType } from './common.js';
|
|
6
|
+
export { createColumnHelper } from './common.js';
|
|
7
|
+
export type AutoTableProps<TData, TMeta = unknown> = {
|
|
8
|
+
data: TData[];
|
|
9
|
+
columns: ColumnDef<TData, TMeta>[];
|
|
10
|
+
meta?: TMeta;
|
|
11
|
+
getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string;
|
|
12
|
+
/** controlled sorting */
|
|
13
|
+
sorting?: SortingState;
|
|
14
|
+
/** uncontrolled sorting */
|
|
15
|
+
defaultSorting?: SortingState;
|
|
16
|
+
enableSorting?: boolean;
|
|
17
|
+
onSortingChange?(newSorting: SortingState): void;
|
|
18
|
+
manualSorting?: boolean;
|
|
19
|
+
rowSelection?: RowSelectionState;
|
|
20
|
+
enableRowSelection?: boolean;
|
|
21
|
+
onRowSelectionChange?(newRowSelection: RowSelectionState): void;
|
|
22
|
+
page?: number;
|
|
23
|
+
rowsPerPage?: number;
|
|
24
|
+
enablePagination?: boolean;
|
|
25
|
+
onPageChange?(newPage: number): void;
|
|
26
|
+
onRowsPerPageChange?(newRowsPerPage: number): void;
|
|
27
|
+
manualRowCount?: number;
|
|
28
|
+
virtualizer?: {
|
|
29
|
+
scrollOffset?: number;
|
|
30
|
+
getScrollElement: () => Element | null;
|
|
31
|
+
renderWhenNotVisible?: boolean;
|
|
32
|
+
rowSize: number;
|
|
33
|
+
headerSize?: number;
|
|
34
|
+
overscan?: number;
|
|
35
|
+
};
|
|
36
|
+
stickyHeader?: boolean | {
|
|
37
|
+
offset: number;
|
|
38
|
+
};
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
zeroStateMessage?: React.ReactNode;
|
|
41
|
+
error?: boolean | string;
|
|
42
|
+
ErrorContainer?: ErrorContainerType;
|
|
43
|
+
sx?: SxProps<Theme>;
|
|
44
|
+
className?: string;
|
|
45
|
+
};
|
|
46
|
+
declare function AutoTable<TData, TMeta = unknown>(props: AutoTableProps<TData, TMeta>): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export default AutoTable;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export { type SortingState } from '@tanstack/react-table';
|
|
2
|
+
import { AccessorFn, Cell, Column, ColumnDefTemplate, ColumnMeta, DeepKeys, DeepValue, Getter, Header, Row, RowData, SortingFnOption, Table } from '@tanstack/react-table';
|
|
3
|
+
export type InternalColumnMeta = {
|
|
4
|
+
noVerticalPadding?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type ColumnHelper<TData extends RowData, TMeta> = {
|
|
7
|
+
accessor: <TAccessor extends AccessorFn<TData> | DeepKeys<TData>, TValue extends TAccessor extends AccessorFn<TData, infer TReturn> ? TReturn : TAccessor extends DeepKeys<TData> ? DeepValue<TData, TAccessor> : never>(accessor: TAccessor, column: TAccessor extends AccessorFn<TData> ? DisplayColumnDef<TData, TMeta, TValue> : IdentifiedColumnDef<TData, TMeta, TValue>) => AccessorColumnDef<TData, TMeta, TValue>;
|
|
8
|
+
display: (column: DisplayColumnDef<TData, TMeta>) => ColumnDef<TData, TMeta, unknown>;
|
|
9
|
+
};
|
|
10
|
+
export interface HeaderContext<TData, TMeta, TValue> {
|
|
11
|
+
/**
|
|
12
|
+
* An instance of a column.
|
|
13
|
+
*/
|
|
14
|
+
column: Column<TData, TValue>;
|
|
15
|
+
/**
|
|
16
|
+
* An instance of a header.
|
|
17
|
+
*/
|
|
18
|
+
header: Header<TData, TValue>;
|
|
19
|
+
/**
|
|
20
|
+
* The table instance.
|
|
21
|
+
*/
|
|
22
|
+
table: Table<TData>;
|
|
23
|
+
meta: TMeta;
|
|
24
|
+
}
|
|
25
|
+
export type StringOrTemplateHeader<TData, TMeta, TValue> = string | ColumnDefTemplate<HeaderContext<TData, TMeta, TValue>>;
|
|
26
|
+
interface StringHeaderIdentifier {
|
|
27
|
+
header: string;
|
|
28
|
+
id?: string;
|
|
29
|
+
}
|
|
30
|
+
interface IdIdentifier<TData extends RowData, TMeta, TValue> {
|
|
31
|
+
id: string;
|
|
32
|
+
header?: StringOrTemplateHeader<TData, TMeta, TValue>;
|
|
33
|
+
}
|
|
34
|
+
type ColumnIdentifiers<TData extends RowData, TMeta, TValue> = IdIdentifier<TData, TMeta, TValue> | StringHeaderIdentifier;
|
|
35
|
+
export interface IdentifiedColumnDef<TData extends RowData, TMeta = unknown, TValue = unknown> extends ColumnDefBase<TData, TMeta, TValue> {
|
|
36
|
+
id?: string;
|
|
37
|
+
header?: StringOrTemplateHeader<TData, TMeta, TValue>;
|
|
38
|
+
}
|
|
39
|
+
export interface CellContext<TData extends RowData, TMeta, TValue> {
|
|
40
|
+
cell: Cell<TData, TValue>;
|
|
41
|
+
column: Column<TData, TValue>;
|
|
42
|
+
getValue: Getter<TValue>;
|
|
43
|
+
renderValue: Getter<TValue | null>;
|
|
44
|
+
row: Row<TData>;
|
|
45
|
+
table: Table<TData>;
|
|
46
|
+
meta: TMeta;
|
|
47
|
+
}
|
|
48
|
+
export interface ColumnDefBase<TData extends RowData, TMeta = unknown, TValue = unknown> {
|
|
49
|
+
getUniqueValues?: AccessorFn<TData, unknown[]>;
|
|
50
|
+
meta?: ColumnMeta<TData, TValue>;
|
|
51
|
+
cell?: ColumnDefTemplate<CellContext<TData, TMeta, TValue>>;
|
|
52
|
+
noVerticalPadding?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Enables/Disables multi-sorting for this column.
|
|
55
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablemultisort)
|
|
56
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting)
|
|
57
|
+
*/
|
|
58
|
+
enableMultiSort?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Enables/Disables sorting for this column.
|
|
61
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablesorting)
|
|
62
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting)
|
|
63
|
+
*/
|
|
64
|
+
enableSorting?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Inverts the order of the sorting for this column. This is useful for values that have an inverted best/worst scale where lower numbers are better, eg. a ranking (1st, 2nd, 3rd) or golf-like scoring
|
|
67
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#invertsorting)
|
|
68
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting)
|
|
69
|
+
*/
|
|
70
|
+
invertSorting?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Set to `true` for sorting toggles on this column to start in the descending direction.
|
|
73
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#sortdescfirst)
|
|
74
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting)
|
|
75
|
+
*/
|
|
76
|
+
sortDescFirst?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The sorting function to use with this column.
|
|
79
|
+
* - A `string` referencing a built-in sorting function
|
|
80
|
+
* - A custom sorting function
|
|
81
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#sortingfn)
|
|
82
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting)
|
|
83
|
+
*/
|
|
84
|
+
sortingFn?: SortingFnOption<TData>;
|
|
85
|
+
/**
|
|
86
|
+
* - `false`
|
|
87
|
+
* - Undefined values will be considered tied and need to be sorted by the next column filter or original index (whichever applies)
|
|
88
|
+
* - `-1`
|
|
89
|
+
* - Undefined values will be sorted with higher priority (ascending) (if ascending, undefined will appear on the beginning of the list)
|
|
90
|
+
* - `1`
|
|
91
|
+
* - Undefined values will be sorted with lower priority (descending) (if ascending, undefined will appear on the end of the list)
|
|
92
|
+
*/
|
|
93
|
+
sortUndefined?: false | -1 | 1;
|
|
94
|
+
}
|
|
95
|
+
export type DisplayColumnDef<TData extends RowData, TMeta = unknown, TValue = unknown> = ColumnDefBase<TData, TMeta, TValue> & ColumnIdentifiers<TData, TMeta, TValue>;
|
|
96
|
+
interface AccessorFnColumnDefBase<TData extends RowData, TMeta, TValue = unknown> extends ColumnDefBase<TData, TMeta, TValue> {
|
|
97
|
+
accessorFn: AccessorFn<TData, TValue>;
|
|
98
|
+
}
|
|
99
|
+
export type AccessorFnColumnDef<TData extends RowData, TMeta = unknown, TValue = unknown> = AccessorFnColumnDefBase<TData, TMeta, TValue> & ColumnIdentifiers<TData, TMeta, TValue>;
|
|
100
|
+
interface AccessorKeyColumnDefBase<TData extends RowData, TMeta, TValue = unknown> extends ColumnDefBase<TData, TMeta, TValue> {
|
|
101
|
+
id?: string;
|
|
102
|
+
accessorKey: (string & {}) | keyof TData;
|
|
103
|
+
}
|
|
104
|
+
export type AccessorKeyColumnDef<TData extends RowData, TMeta = unknown, TValue = unknown> = AccessorKeyColumnDefBase<TData, TMeta, TValue> & Partial<ColumnIdentifiers<TData, TMeta, TValue>>;
|
|
105
|
+
export type AccessorColumnDef<TData extends RowData, TMeta, TValue = unknown> = AccessorKeyColumnDef<TData, TMeta, TValue> | AccessorFnColumnDef<TData, TMeta, TValue>;
|
|
106
|
+
export type ColumnDef<TData extends RowData, TMeta = unknown, TValue = unknown> = DisplayColumnDef<TData, TMeta, TValue> | AccessorColumnDef<TData, TMeta, TValue>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import { AutoTableHookOptions, type ErrorContainer as ErrorContainerType } from './common.js';
|
|
4
|
+
export type VirtualControlledAutoTableProps<TData, TMeta = unknown> = AutoTableHookOptions<TData, TMeta> & {
|
|
5
|
+
stickyHeader?: boolean | {
|
|
6
|
+
offset: number;
|
|
7
|
+
};
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
zeroStateMessage?: React.ReactNode;
|
|
10
|
+
error?: boolean | string;
|
|
11
|
+
ErrorContainer?: ErrorContainerType;
|
|
12
|
+
scrollOffset?: number;
|
|
13
|
+
getScrollElement: () => Element | null;
|
|
14
|
+
renderWhenNotVisible?: boolean;
|
|
15
|
+
rowSize: number;
|
|
16
|
+
headerSize?: number;
|
|
17
|
+
overscan?: number;
|
|
18
|
+
debug?: boolean;
|
|
19
|
+
sx?: SxProps<Theme>;
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const TableMessageMaxHeight = 100;
|
|
23
|
+
export default function VirtualControlledAutoTable<TData, TMeta = unknown>({ stickyHeader, loading, zeroStateMessage, error, ErrorContainer, scrollOffset, getScrollElement, renderWhenNotVisible, rowSize, headerSize, overscan, debug, sx, className, ...options }: VirtualControlledAutoTableProps<TData, TMeta>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TableCellProps = React.ComponentPropsWithoutRef<'td'> & {
|
|
3
|
+
'data-testid'?: string | undefined;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
noVerticalPadding?: boolean;
|
|
6
|
+
variant?: 'header' | 'data';
|
|
7
|
+
};
|
|
8
|
+
declare const TableCell: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref"> & {
|
|
9
|
+
'data-testid'?: string | undefined;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
noVerticalPadding?: boolean | undefined;
|
|
12
|
+
variant?: "data" | "header" | undefined;
|
|
13
|
+
} & React.RefAttributes<HTMLTableCellElement>>;
|
|
14
|
+
export default TableCell;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TableRowProps = React.ComponentPropsWithoutRef<'tr'> & {
|
|
3
|
+
'data-testid'?: string | undefined;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
declare const TableRow: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & {
|
|
7
|
+
'data-testid'?: string | undefined;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
} & React.RefAttributes<HTMLTableRowElement>>;
|
|
10
|
+
export default TableRow;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { MouseEventHandler } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
export type TableProps = {
|
|
4
|
+
'data-testid'?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Set the header sticky.
|
|
7
|
+
*
|
|
8
|
+
* ⚠️ It doesn't work with IE11.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
stickyHeader?: boolean;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
sx?: SxProps<Theme>;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const Table: (props: TableProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export type TableBodyProps = {
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
sx?: SxProps<Theme>;
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const TableBody: (props: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export type TableFooterProps = {
|
|
25
|
+
'data-testid'?: string;
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
sx?: SxProps<Theme>;
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const TableFooter: (props: TableFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export type TableHeadProps = {
|
|
32
|
+
'data-testid'?: string;
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
sx?: SxProps<Theme>;
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const TableHead: (props: TableHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export type TableSortLabelProps = {
|
|
39
|
+
'data-testid'?: string;
|
|
40
|
+
/**
|
|
41
|
+
* If `true`, the label will have the active styling (should be true for the sorted column).
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
active?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Label contents, the arrow will be appended automatically.
|
|
47
|
+
*/
|
|
48
|
+
children?: React.ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* The current sort direction.
|
|
51
|
+
* @default 'asc'
|
|
52
|
+
*/
|
|
53
|
+
direction?: 'asc' | 'desc';
|
|
54
|
+
/**
|
|
55
|
+
* Hide sort icon when active is false.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
hideSortIcon?: boolean;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
onClick?: MouseEventHandler<HTMLSpanElement>;
|
|
61
|
+
sx?: SxProps<Theme>;
|
|
62
|
+
className?: string;
|
|
63
|
+
};
|
|
64
|
+
export declare const TableSortLabel: (props: TableSortLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export type TableZeroStateProps = {
|
|
66
|
+
children: React.ReactNode;
|
|
67
|
+
};
|
|
68
|
+
export declare const TableMessage: (props: TableZeroStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type PaletteTextVariant, type TypographyVariant } from '../styles/index.js';
|
|
3
|
-
export type TypographyProps = {
|
|
3
|
+
export type TypographyProps = React.ComponentPropsWithoutRef<'p'> & {
|
|
4
4
|
as?: keyof React.JSX.IntrinsicElements;
|
|
5
5
|
variant?: TypographyVariant;
|
|
6
6
|
color?: PaletteTextVariant | 'disabled' | 'inherit';
|
|
7
7
|
leadingTrim?: boolean;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
-
id?: string;
|
|
10
9
|
'data-testid'?: string;
|
|
11
10
|
style?: React.CSSProperties;
|
|
12
11
|
className?: string;
|
|
13
12
|
};
|
|
14
|
-
declare const Typography: React.ForwardRefExoticComponent<
|
|
13
|
+
declare const Typography: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
14
|
+
as?: keyof React.JSX.IntrinsicElements | undefined;
|
|
15
|
+
variant?: "title" | "h1" | "h2" | "h3" | "h4" | "label" | "paragraph1" | "paragraph2" | "paragraph3" | "button" | "buttonSmall" | "input" | "statusChip" | undefined;
|
|
16
|
+
color?: "inherit" | "disabled" | keyof import("../styles/palette.js").PaletteText | undefined;
|
|
17
|
+
leadingTrim?: boolean | undefined;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
'data-testid'?: string | undefined;
|
|
20
|
+
style?: React.CSSProperties | undefined;
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
15
23
|
export default Typography;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -39,6 +39,16 @@ export { default as RadioButton } from './RadioButton/index.js';
|
|
|
39
39
|
export * from './RadioButton/index.js';
|
|
40
40
|
export { default as Select } from './Select/index.js';
|
|
41
41
|
export * from './Select/index.js';
|
|
42
|
+
export { default as StatusChip } from './StatusChip/index.js';
|
|
43
|
+
export * from './StatusChip/index.js';
|
|
44
|
+
export * from './Table/index.js';
|
|
45
|
+
export { default as AutoTable } from './Table/AutoTable/index.js';
|
|
46
|
+
export * from './Table/AutoTable/index.js';
|
|
47
|
+
export type * from './Table/AutoTable/types.js';
|
|
48
|
+
export { default as TableCell } from './Table/TableCell/index.js';
|
|
49
|
+
export type * from './Table/TableCell/index.js';
|
|
50
|
+
export { default as TableRow } from './Table/TableRow/index.js';
|
|
51
|
+
export type * from './Table/TableRow/index.js';
|
|
42
52
|
export { default as TablePagination } from './TablePagination/index.js';
|
|
43
53
|
export * from './TablePagination/index.js';
|
|
44
54
|
export { default as Textarea } from './Textarea/index.js';
|
|
@@ -31,6 +31,8 @@ export type PaletteIndicatorOptions = {
|
|
|
31
31
|
info?: PaletteActionVariantsColorsOptions;
|
|
32
32
|
warning?: PaletteActionVariantsColorsOptions;
|
|
33
33
|
error?: PaletteActionVariantsColorsOptions;
|
|
34
|
+
pending?: PaletteActionVariantsColorsOptions;
|
|
35
|
+
processing?: PaletteActionVariantsColorsOptions;
|
|
34
36
|
};
|
|
35
37
|
export type PaletteTableOptions = PaletteActionVariantsColorsOptions;
|
|
36
38
|
export type PaletteTooltipOptions = PaletteSurfaceColorsOptions;
|
|
@@ -31,6 +31,8 @@ export interface PaletteIndicator {
|
|
|
31
31
|
info: PaletteActionVariantsColors;
|
|
32
32
|
warning: PaletteActionVariantsColors;
|
|
33
33
|
error: PaletteActionVariantsColors;
|
|
34
|
+
pending: PaletteActionVariantsColors;
|
|
35
|
+
processing: PaletteActionVariantsColors;
|
|
34
36
|
}
|
|
35
37
|
export type PaletteTable = PaletteActionVariantsColors;
|
|
36
38
|
export type PaletteTooltip = PaletteSurfaceColors;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type FontMetrics } from '@capsizecss/core';
|
|
3
|
-
export declare const TypographyVariantKeys: readonly ["title", "h1", "h2", "h3", "h4", "label", "paragraph1", "paragraph2", "paragraph3", "button", "buttonSmall", "input"];
|
|
3
|
+
export declare const TypographyVariantKeys: readonly ["title", "h1", "h2", "h3", "h4", "label", "paragraph1", "paragraph2", "paragraph3", "button", "buttonSmall", "input", "statusChip"];
|
|
4
4
|
export type TypographyVariant = (typeof TypographyVariantKeys)[number];
|
|
5
5
|
export type TypographyStyle = {
|
|
6
6
|
fontFamily: React.CSSProperties['fontFamily'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veritone-ce/design-system",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Design System for Veritone CE",
|
|
6
6
|
"keywords": [
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"@commitlint/config-conventional": "^17.7.0",
|
|
95
95
|
"@emotion/react": "^11.10.4",
|
|
96
96
|
"@emotion/styled": "^11.10.4",
|
|
97
|
+
"@faker-js/faker": "^8.4.1",
|
|
97
98
|
"@fontsource/dosis": "^5.0.5",
|
|
98
99
|
"@fontsource/nunito-sans": "^5.0.5",
|
|
99
100
|
"@mui/icons-material": "^5.10.6",
|