@epam/ai-dial-ui-kit 0.5.0-rc.1 → 0.5.0-rc.11
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/dial-ui-kit.cjs.js +62 -2
- package/dist/dial-ui-kit.es.js +44154 -4000
- package/dist/src/components/FileManager/FileManager.d.ts +30 -1
- package/dist/src/components/FileManager/FileManagerContext.d.ts +3 -1
- package/dist/src/components/FileManager/constants.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-bulk-actions.d.ts +22 -0
- package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +20 -0
- package/dist/src/components/FileManager/hooks/use-item-renaming.d.ts +4 -1
- package/dist/src/components/FileManager/utils.d.ts +1 -0
- package/dist/src/components/FileName/FileName.d.ts +2 -0
- package/dist/src/components/FolderName/FolderName.d.ts +4 -1
- package/dist/src/components/Grid/Grid.d.ts +14 -3
- package/dist/src/components/Grid/hooks/use-grid-selection.d.ts +7 -4
- package/dist/src/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -39,14 +39,36 @@ export interface GridOptions extends Omit<DialGridProps<GridRow>, 'rowData' | 'c
|
|
|
39
39
|
filterable?: boolean;
|
|
40
40
|
dateLocale?: Intl.LocalesArgument;
|
|
41
41
|
dateOptions?: Intl.DateTimeFormatOptions;
|
|
42
|
+
actionLabels?: {
|
|
43
|
+
[DialFileManagerActions.Duplicate]?: string;
|
|
44
|
+
[DialFileManagerActions.Copy]?: string;
|
|
45
|
+
[DialFileManagerActions.Rename]?: string;
|
|
46
|
+
[DialFileManagerActions.Download]?: string;
|
|
47
|
+
[DialFileManagerActions.Delete]?: string;
|
|
48
|
+
[DialFileManagerActions.Move]?: string;
|
|
49
|
+
};
|
|
42
50
|
}
|
|
43
51
|
export type ToolbarOptions = Omit<DialFileManagerToolbarProps, 'areHiddenFilesVisible' | 'onToggleHiddenFiles'>;
|
|
44
|
-
export type BulkActionsToolbarOptions = Omit<DialFileManagerBulkActionsToolbarProps, 'onClearSelection'
|
|
52
|
+
export type BulkActionsToolbarOptions = Omit<DialFileManagerBulkActionsToolbarProps, 'onClearSelection' | 'actions'> & {
|
|
53
|
+
actionLabels?: {
|
|
54
|
+
[DialFileManagerActions.Duplicate]?: string;
|
|
55
|
+
[DialFileManagerActions.Copy]?: string;
|
|
56
|
+
[DialFileManagerActions.Download]?: string;
|
|
57
|
+
[DialFileManagerActions.Delete]?: string;
|
|
58
|
+
[DialFileManagerActions.Move]?: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export interface CreateFolderValidationMessages {
|
|
62
|
+
emptyName?: string;
|
|
63
|
+
duplicateName?: string;
|
|
64
|
+
forbiddenChars?: string;
|
|
65
|
+
}
|
|
45
66
|
export interface DialFileManagerProps {
|
|
46
67
|
path?: string;
|
|
47
68
|
cssClass?: string;
|
|
48
69
|
items?: DialFile[];
|
|
49
70
|
rootItem?: DialRootFolder;
|
|
71
|
+
filesLoading?: boolean;
|
|
50
72
|
showHiddenFiles?: boolean;
|
|
51
73
|
onShowHiddenFilesChange?: (value: boolean) => void;
|
|
52
74
|
treeOptions?: FileTreeOptions;
|
|
@@ -66,6 +88,9 @@ export interface DialFileManagerProps {
|
|
|
66
88
|
onRenameSave?: (value: string) => void;
|
|
67
89
|
onRenameCancel?: () => void;
|
|
68
90
|
onRenameValidate?: (value: string, item: DialFile) => string | null;
|
|
91
|
+
onCreateFolder?: (folderPath: string, file: File, name: string, bucket?: string) => void;
|
|
92
|
+
onCreateFolderValidate?: (name: string, parentFolder: DialFile) => string | null;
|
|
93
|
+
createFolderValidationMessages?: CreateFolderValidationMessages;
|
|
69
94
|
}
|
|
70
95
|
/**
|
|
71
96
|
* File Manager layout with a collapsible folders tree, breadcrumb/search header, and a data grid.
|
|
@@ -82,6 +107,9 @@ export interface DialFileManagerProps {
|
|
|
82
107
|
* // Minimal usage
|
|
83
108
|
* <DialFileManager items={files} path="/All files" />
|
|
84
109
|
*
|
|
110
|
+
* // With loading state
|
|
111
|
+
* <DialFileManager items={files} path="/All files" filesLoading={true} />
|
|
112
|
+
*
|
|
85
113
|
* // With controlled search and disabled grid filters
|
|
86
114
|
* const [query, setQuery] = useState('');
|
|
87
115
|
* <DialFileManager
|
|
@@ -113,6 +141,7 @@ export interface DialFileManagerProps {
|
|
|
113
141
|
* @param [cssClass] - Additional classes for the root container
|
|
114
142
|
* @param [items] - Full hierarchical list of files and folders used by both tree and grid
|
|
115
143
|
* @param [rootItem] - Optional root folder item to represent the top-level container in the tree
|
|
144
|
+
* @param [filesLoading=false] - When true, shows skeleton loading state in the grid
|
|
116
145
|
*
|
|
117
146
|
* @param [treeOptions] - Options that configure the collapsible sidebar and folders tree
|
|
118
147
|
* @param [navigationPanelOptions] - Options for the breadcrumb and search panel (value/onSearchChange for controlled search)
|
|
@@ -15,6 +15,7 @@ export interface FileManagerContextValue {
|
|
|
15
15
|
cssClass?: string;
|
|
16
16
|
items: DialFile[];
|
|
17
17
|
rootItem?: DialRootFolder;
|
|
18
|
+
filesLoading?: boolean;
|
|
18
19
|
treeOptions?: FileTreeOptions;
|
|
19
20
|
navigationPanelOptions?: NavigationPanelOptions;
|
|
20
21
|
gridOptions?: GridOptions;
|
|
@@ -33,7 +34,8 @@ export interface FileManagerContextValue {
|
|
|
33
34
|
toggleTreeCollapse: () => void;
|
|
34
35
|
setIsTreeCollapsed: (value: boolean) => void;
|
|
35
36
|
selectedIds: Set<string>;
|
|
36
|
-
|
|
37
|
+
selectedFiles: Map<string, DialFile>;
|
|
38
|
+
setSelectedFiles: (next: Map<string, DialFile>) => void;
|
|
37
39
|
clearSelection: () => void;
|
|
38
40
|
currentFolder?: DialFile;
|
|
39
41
|
gridRows: FileManagerGridRow[];
|
|
@@ -7,3 +7,4 @@ export declare const treeBaseClasses = "w-full h-full rounded bg-layer-3 text-se
|
|
|
7
7
|
export declare const gridBaseClasses = "flex-1 w-full rounded text-secondary overflow-auto min-h-0 min-w-0";
|
|
8
8
|
export declare const sidebarWidth = 280;
|
|
9
9
|
export declare const sidebarTitleDefault = "Files";
|
|
10
|
+
export declare const BASE_FILE_MANAGER_ICON_SIZE = 20;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialFileManagerActions } from '../../../types/file-manager';
|
|
3
|
+
import { DialActionDropdownItem } from '../components/FileManagerBulkActionsToolbar/FileManagerBulkActionsToolbar';
|
|
4
|
+
export interface UseBulkActionsProps {
|
|
5
|
+
selectedFiles: Map<string, DialFile>;
|
|
6
|
+
actionLabels?: {
|
|
7
|
+
[DialFileManagerActions.Duplicate]?: string;
|
|
8
|
+
[DialFileManagerActions.Copy]?: string;
|
|
9
|
+
[DialFileManagerActions.Rename]?: string;
|
|
10
|
+
[DialFileManagerActions.Download]?: string;
|
|
11
|
+
[DialFileManagerActions.Delete]?: string;
|
|
12
|
+
[DialFileManagerActions.Move]?: string;
|
|
13
|
+
};
|
|
14
|
+
onDuplicate: (files: DialFile[]) => void;
|
|
15
|
+
onCopy: (files: DialFile[]) => void;
|
|
16
|
+
onMove: (files: DialFile[]) => void;
|
|
17
|
+
onDownload: (files: DialFile[]) => void;
|
|
18
|
+
onRename: (filePath: string) => void;
|
|
19
|
+
onDelete: (files: DialFile[], parentFolderPath: string) => void;
|
|
20
|
+
getCurrentFolderPath: () => string;
|
|
21
|
+
}
|
|
22
|
+
export declare const useBulkActions: ({ selectedFiles, actionLabels, onDuplicate, onCopy, onMove, onDownload, onDelete, getCurrentFolderPath, }: UseBulkActionsProps) => DialActionDropdownItem[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialFileManagerActions } from '../../../types/file-manager';
|
|
3
|
+
import { DropdownItem } from '../../../models/dropdown';
|
|
4
|
+
export interface UseGridContextMenuProps {
|
|
5
|
+
actionLabels?: {
|
|
6
|
+
[DialFileManagerActions.Duplicate]?: string;
|
|
7
|
+
[DialFileManagerActions.Copy]?: string;
|
|
8
|
+
[DialFileManagerActions.Rename]?: string;
|
|
9
|
+
[DialFileManagerActions.Download]?: string;
|
|
10
|
+
[DialFileManagerActions.Delete]?: string;
|
|
11
|
+
[DialFileManagerActions.Move]?: string;
|
|
12
|
+
};
|
|
13
|
+
onDuplicate: (file: DialFile) => void;
|
|
14
|
+
onCopy: (file: DialFile) => void;
|
|
15
|
+
onMove: (file: DialFile) => void;
|
|
16
|
+
onDownload: (file: DialFile) => void;
|
|
17
|
+
onRename: (filePath: string) => void;
|
|
18
|
+
onDelete: (file: DialFile, parentFolderPath: string) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const useGridContextMenu: ({ actionLabels, onDuplicate, onCopy, onMove, onDownload, onRename, onDelete, }: UseGridContextMenuProps) => (file: DialFile) => DropdownItem[];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { DialFile } from '../../../models/file';
|
|
2
|
-
|
|
2
|
+
import { DialCopiedItem } from '../../../types/file-manager';
|
|
3
|
+
export declare const useItemRenaming: ({ items, onRename, onRenameSave, onRenameCancel, onRenameValidate, onMoveToFiles, }: {
|
|
4
|
+
items?: DialFile[];
|
|
3
5
|
onRename?: (path: string) => void;
|
|
4
6
|
onRenameSave?: (value: string) => void;
|
|
5
7
|
onRenameCancel?: () => void;
|
|
6
8
|
onRenameValidate?: (value: string, item: DialFile) => string | null;
|
|
9
|
+
onMoveToFiles?: (items: DialCopiedItem[], sourceFolder: string, destinationFolder: string) => void;
|
|
7
10
|
}) => {
|
|
8
11
|
renamedPath: string | undefined;
|
|
9
12
|
renameHandler: (path: string) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DialFile } from '../../models/file';
|
|
2
|
+
export declare const findNodeByPath: (nodes: DialFile[] | undefined, path?: string) => DialFile | undefined;
|
|
2
3
|
export declare const findFolderForPath: (root: DialFile[] | undefined, path?: string) => DialFile | undefined;
|
|
3
4
|
export declare const normalizeToLowerCase: (input?: string) => string;
|
|
4
5
|
export declare const normalizeExtensionWithoutDot: (input?: string) => string;
|
|
@@ -3,6 +3,7 @@ export interface DialFileNameProps {
|
|
|
3
3
|
name: string;
|
|
4
4
|
cssClass?: string;
|
|
5
5
|
shared?: boolean;
|
|
6
|
+
iconSize?: number;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Component to display a file name with a file icon and shared indicator.
|
|
@@ -16,5 +17,6 @@ export interface DialFileNameProps {
|
|
|
16
17
|
* @param name - Full file name with or without extension
|
|
17
18
|
* @param cssClass - Additional CSS classes for the root container
|
|
18
19
|
* @param shared - Whether the file is shared
|
|
20
|
+
* @param iconSize - Icon size in px. Default: BASE_ICON_SIZE.
|
|
19
21
|
*/
|
|
20
22
|
export declare const DialFileName: FC<DialFileNameProps>;
|
|
@@ -4,6 +4,7 @@ export interface DialFolderNameProps {
|
|
|
4
4
|
cssClass?: string;
|
|
5
5
|
shared?: boolean;
|
|
6
6
|
loading?: boolean;
|
|
7
|
+
iconSize?: number;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
* Component to display a folder name with a folder icon and shared indicator.
|
|
@@ -16,6 +17,8 @@ export interface DialFolderNameProps {
|
|
|
16
17
|
*
|
|
17
18
|
* @param name - Folder name
|
|
18
19
|
* @param cssClass - Additional CSS classes for the root container
|
|
19
|
-
* @param shared -
|
|
20
|
+
* @param shared - If true, shows shared indicator. Default: false.
|
|
21
|
+
* @param loading - If true, shows loading state. Default: false.
|
|
22
|
+
* @param iconSize - Icon size in px. Default: BASE_ICON_SIZE.
|
|
20
23
|
*/
|
|
21
24
|
export declare const DialFolderName: FC<DialFolderNameProps>;
|
|
@@ -11,13 +11,16 @@ export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
|
11
11
|
withSelectionColumn?: boolean;
|
|
12
12
|
wrapCustomCellRenderers?: boolean | ((col: ColDef<T>) => boolean);
|
|
13
13
|
selectedRowIds?: Set<string>;
|
|
14
|
+
selectedRows?: Map<string, T>;
|
|
14
15
|
onSelectionChange?: (selectedRowIds: Set<string>, selectedRows: T[]) => void;
|
|
16
|
+
onSelectionChangeWithMap?: (selectedRows: Map<string, T>) => void;
|
|
15
17
|
getRowId?: (row: T) => string;
|
|
16
18
|
alternateOddRowColors?: boolean;
|
|
17
19
|
filterPlaceholder?: string;
|
|
18
20
|
emptyStateIcon?: ReactNode;
|
|
19
21
|
emptyStateTitle?: string;
|
|
20
22
|
emptyStateDescription?: string;
|
|
23
|
+
loading?: boolean;
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
* DialGrid — A feature-rich data grid wrapper built on ag-Grid with dark theme support.
|
|
@@ -30,6 +33,7 @@ export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
|
30
33
|
* - Controlled or uncontrolled selection modes
|
|
31
34
|
* - Automatic column sizing and responsive behavior
|
|
32
35
|
* - Full accessibility support with ARIA attributes
|
|
36
|
+
* - Loading state with native AG-Grid overlay
|
|
33
37
|
*
|
|
34
38
|
* @example
|
|
35
39
|
* ```tsx
|
|
@@ -48,7 +52,13 @@ export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
|
48
52
|
* <DialGrid<Product>
|
|
49
53
|
* columnDefs={columns}
|
|
50
54
|
* rowData={products}
|
|
51
|
-
*
|
|
55
|
+
* />
|
|
56
|
+
*
|
|
57
|
+
* // With loading state
|
|
58
|
+
* <DialGrid<Product>
|
|
59
|
+
* columnDefs={columns}
|
|
60
|
+
* rowData={products}
|
|
61
|
+
* loading={true}
|
|
52
62
|
* />
|
|
53
63
|
*
|
|
54
64
|
* // With context menu
|
|
@@ -93,6 +103,7 @@ export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
|
93
103
|
* @param [emptyStateIcon] - Optional icon for empty state
|
|
94
104
|
* @param [emptyStateTitle] - Optional title text displayed when the grid has no rows to show.
|
|
95
105
|
* @param [emptyStateDescription] - Optional description text displayed below the empty state title,
|
|
96
|
-
* providing additional context or instructions (e.g.,
|
|
106
|
+
* providing additional context or instructions (e.g., "No data found" or "Try adjusting your filters").
|
|
107
|
+
* @param [loading=false] - When true, shows AG-Grid's native loading overlay
|
|
97
108
|
*/
|
|
98
|
-
export declare const DialGrid: <T extends object>({ columnDefs, rowData, additionalGridOptions, getContextMenuItems, cssClass, ariaLabel, withSelectionColumn, wrapCustomCellRenderers, selectedRowIds, onSelectionChange, getRowId, alternateOddRowColors, filterPlaceholder, emptyStateIcon, emptyStateTitle, emptyStateDescription, }: DialGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
export declare const DialGrid: <T extends object>({ columnDefs, rowData, additionalGridOptions, getContextMenuItems, cssClass, ariaLabel, withSelectionColumn, wrapCustomCellRenderers, selectedRowIds, selectedRows, onSelectionChange, onSelectionChangeWithMap, getRowId, alternateOddRowColors, filterPlaceholder, emptyStateIcon, emptyStateTitle, emptyStateDescription, loading, }: DialGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
export interface UseGridSelectionProps<T> {
|
|
1
|
+
export interface UseGridSelectionProps<T extends object> {
|
|
2
2
|
selectedRowIds?: Set<string>;
|
|
3
|
+
selectedRows?: Map<string, T>;
|
|
3
4
|
onSelectionChange?: (selectedRowIds: Set<string>, selectedRows: T[]) => void;
|
|
5
|
+
onSelectionChangeWithMap?: (selectedRows: Map<string, T>) => void;
|
|
4
6
|
rowData?: T[];
|
|
5
7
|
getRowId: (row: T) => string;
|
|
6
8
|
}
|
|
7
|
-
export declare const useGridSelection: <T extends object>({ selectedRowIds, onSelectionChange, rowData, getRowId, }: UseGridSelectionProps<T>) => {
|
|
9
|
+
export declare const useGridSelection: <T extends object>({ selectedRowIds, selectedRows, onSelectionChange, onSelectionChangeWithMap, rowData, getRowId, }: UseGridSelectionProps<T>) => {
|
|
8
10
|
currentSelectedIds: Set<string>;
|
|
9
|
-
|
|
11
|
+
currentSelectedRows: Map<string, T>;
|
|
12
|
+
handleSelectionToggle: (row: T, checked: boolean) => void;
|
|
10
13
|
headerCheckboxState: string;
|
|
11
|
-
handleHeaderCheckboxChange: () => void;
|
|
14
|
+
handleHeaderCheckboxChange: (checked?: boolean) => void;
|
|
12
15
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export { DialSelectField } from './components/SelectField/SelectField';
|
|
|
49
49
|
export { DialLoadFileAreaField } from './components/LoadFileArea/LoadFileAreaField';
|
|
50
50
|
export { DialDropdown } from './components/Dropdown/Dropdown';
|
|
51
51
|
export { DialButtonDropdown } from './components/ButtonDropdown/ButtonDropdown';
|
|
52
|
+
export { DialFileManager } from './components/FileManager/FileManager';
|
|
52
53
|
export { AlertVariant } from './types/alert';
|
|
53
54
|
export { ButtonVariant } from './types/button';
|
|
54
55
|
export { RadioGroupOrientation } from './types/radio-group';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-ui-kit",
|
|
3
|
-
"version": "0.5.0-rc.
|
|
3
|
+
"version": "0.5.0-rc.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "A modern UI kit for building AI DIAL interfaces with React",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@floating-ui/react": "^0.27.15",
|
|
68
68
|
"@monaco-editor/react": "^4.7.0",
|
|
69
|
-
"@tabler/icons-react": "^3.
|
|
69
|
+
"@tabler/icons-react": "^3.35.0",
|
|
70
70
|
"classnames": "^2.5.1",
|
|
71
71
|
"monaco-editor": "^0.52.2",
|
|
72
72
|
"react": "^19.1.0",
|