@epam/ai-dial-ui-kit 0.5.0-rc.22 → 0.5.0-rc.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.
@@ -52,7 +52,13 @@ export interface GridOptions extends Omit<DialGridProps<GridRow>, 'rowData' | 'c
52
52
  [DialFileManagerActions.Move]?: string;
53
53
  };
54
54
  }
55
- export type ToolbarOptions = Omit<DialFileManagerToolbarProps, 'areHiddenFilesVisible' | 'onToggleHiddenFiles'>;
55
+ export type ToolbarOptions = Omit<DialFileManagerToolbarProps, 'areHiddenFilesVisible' | 'onToggleHiddenFiles'> & {
56
+ newActionLabels?: {
57
+ uploadFiles?: string;
58
+ newFolder?: string;
59
+ uploadArchive?: string;
60
+ };
61
+ };
56
62
  export type BulkActionsToolbarOptions = Omit<DialFileManagerBulkActionsToolbarProps, 'onClearSelection' | 'actions'> & {
57
63
  actionLabels?: {
58
64
  [DialFileManagerActions.Duplicate]?: string;
@@ -1,8 +1,9 @@
1
- import { DragEvent } from 'react';
1
+ import { DragEvent, RefObject } from 'react';
2
2
  import { DialFile, DialRootFolder, DialFileNodeType } from '../../models/file';
3
3
  import { FileTreeOptions, NavigationPanelOptions, GridOptions, ToolbarOptions, BulkActionsToolbarOptions, DialFileManagerProps, DeleteConfirmationOptions, DialFileManagerDestinationFolderPopupOptions } from './FileManager';
4
4
  import { DestinationFolderMode } from './hooks/use-file-clipboard';
5
5
  import { FileUploadValidationMessages } from './hooks/use-file-upload';
6
+ import { DropdownItem } from '../../models/dropdown';
6
7
  export interface FileManagerGridRow {
7
8
  id: string;
8
9
  name: string;
@@ -79,5 +80,9 @@ export interface FileManagerContextValue {
79
80
  onValidateUpload?: DialFileManagerProps['onValidateUpload'];
80
81
  maxFileSize?: number;
81
82
  uploadValidationMessages?: FileUploadValidationMessages;
83
+ newActions: DropdownItem[];
84
+ isNewButtonVisible: boolean;
85
+ openFileDialog: () => void;
86
+ fileInputRef: RefObject<HTMLInputElement | null>;
82
87
  }
83
88
  export declare const FileManagerContext: import('react').Context<FileManagerContextValue | undefined>;
@@ -13,6 +13,7 @@ export interface FileManagerProviderProps extends Omit<DialFileManagerProps, 'ch
13
13
  * - clipboard (copy / cut / paste)
14
14
  * - delete confirmation state
15
15
  * - computed grid rows
16
+ * - new actions
16
17
  *
17
18
  */
18
19
  export declare const FileManagerProvider: FC<FileManagerProviderProps>;
@@ -10,10 +10,10 @@ export interface DialFileManagerToolbarProps {
10
10
  hiddenFilesSwitcherLabel?: string;
11
11
  showHiddenFilesLabel?: string;
12
12
  hideHiddenFilesLabel?: string;
13
- isCreateButtonVisible?: boolean;
14
- createButtonVariant?: ButtonVariant;
15
- createButtonDropdownItems?: DropdownItem[];
16
- createButtonLabel?: string;
13
+ isNewButtonVisible?: boolean;
14
+ newButtonVariant?: ButtonVariant;
15
+ newButtonDropdownItems?: DropdownItem[];
16
+ newButtonLabel?: string;
17
17
  onTabChange?: (id: DialFileManagerTabs) => void;
18
18
  onToggleHiddenFiles?: (value: boolean) => void;
19
19
  }
@@ -24,7 +24,7 @@ export interface DialFileManagerToolbarProps {
24
24
  * - Tab navigation for switching between file sections or views
25
25
  * - A toggle for showing or hiding hidden files
26
26
  * - A refresh button for reloading content
27
- * - An optional "Create" button or dropdown for creating new files or folders
27
+ * - An optional "New" button or dropdown for creating new files or folders
28
28
  *
29
29
  * @example
30
30
  * ```tsx
@@ -40,8 +40,8 @@ export interface DialFileManagerToolbarProps {
40
40
  * onTabChange={(id) => console.log('Switched to tab:', id)}
41
41
  * onToggleHiddenFiles={(visible) => console.log('Hidden files visible:', visible)}
42
42
  * onRefresh={() => console.log('Refreshed')}
43
- * isCreateButtonVisible
44
- * createButtonDropdownItems={[
43
+ * isNewButtonVisible
44
+ * newButtonDropdownItems={[
45
45
  * { key: 'folder', label: 'New Folder' },
46
46
  * { key: 'file', label: 'Upload File' },
47
47
  * ]}
@@ -56,16 +56,16 @@ export interface DialFileManagerToolbarProps {
56
56
  * @param [hideHiddenFilesLabel='Hide hidden'] - Label shown when hidden files are visible.
57
57
  * @param [onTabChange] - Callback fired when the user switches between tabs. Receives the selected tab ID.
58
58
  * @param [onToggleHiddenFiles] - Callback fired when the hidden files visibility is toggled. Receives the new visibility state.
59
- * @param [isCreateButtonVisible] - Whether the "Create" button or dropdown should be displayed.
60
- * @param [createButtonVariant=ButtonVariant.Secondary] - Visual style variant for the create button.
61
- * @param [createButtonDropdownItems=[]] - Dropdown items available under the create button. If empty, a single create button is shown instead.
62
- * @param [createButtonLabel='Create'] - Label text for the create button.
59
+ * @param [isNewButtonVisible] - Whether the "New" button or dropdown should be displayed.
60
+ * @param [newButtonVariant=ButtonVariant.Secondary] - Visual style variant for the new button.
61
+ * @param [newButtonDropdownItems=[]] - Dropdown items available under the new button. If empty, a single new button is shown instead.
62
+ * @param [newButtonLabel='New'] - Label text for the new button.
63
63
  *
64
64
  * @remarks
65
65
  * - Tabs are rendered via `DialTabs`.
66
66
  * - The hidden files toggle uses `DialSwitch`.
67
- * - The refresh and create actions use `DialButton` or dropdown variants for consistency.
67
+ * - The refresh and new actions use `DialButton` or dropdown variants for consistency.
68
68
  * - The toolbar automatically adapts its layout for different screen sizes.
69
- * - When `createButtonDropdownItems` is provided, the create button becomes a dropdown menu.
69
+ * - When `newButtonDropdownItems` is provided, the new button becomes a dropdown menu.
70
70
  */
71
71
  export declare const DialFileManagerToolbar: FC<DialFileManagerToolbarProps>;
@@ -26,4 +26,7 @@ export declare const useFileUpload: ({ onUploadFiles, onValidateUpload, maxFileS
26
26
  handleDragOver: (e: DragEvent) => void;
27
27
  handleDrop: (e: DragEvent, destinationFolder: string, existingFiles: DialFile[]) => Promise<void>;
28
28
  clearError: () => void;
29
+ handleUpload: (files: DialUploadFileItem[], destinationFolder: string, existingFiles: DialFile[]) => Promise<boolean>;
30
+ openFileDialog: (destinationFolder: string, existingFiles: DialFile[]) => void;
31
+ fileInputRef: import('react').RefObject<HTMLInputElement | null>;
29
32
  };
@@ -0,0 +1,16 @@
1
+ import { DropdownItem } from '../../../models/dropdown';
2
+ export interface UseNewActionsProps {
3
+ newActionLabels?: {
4
+ uploadFiles?: string;
5
+ newFolder?: string;
6
+ uploadArchive?: string;
7
+ };
8
+ onUploadFiles?: () => void;
9
+ onCreateFolder?: () => void;
10
+ onUploadArchive?: () => void;
11
+ }
12
+ export interface UseNewActionsResult {
13
+ newActions: DropdownItem[];
14
+ isNewButtonVisible: boolean;
15
+ }
16
+ export declare const useNewActions: ({ newActionLabels, onUploadFiles, onCreateFolder, onUploadArchive, }: UseNewActionsProps) => UseNewActionsResult;
@@ -4,6 +4,7 @@ import { SelectSize, SelectVariant } from '../../types/select';
4
4
  export interface DialSelectProps {
5
5
  options: SelectOption[];
6
6
  multiple?: boolean;
7
+ elementId: string;
7
8
  size?: SelectSize;
8
9
  variant?: SelectVariant;
9
10
  value?: string | string[];
@@ -53,6 +54,7 @@ export interface DialSelectProps {
53
54
  * ```
54
55
  *
55
56
  * @param options - Array of options to select from.
57
+ * @param elementId - The id attribute for the select element.
56
58
  * @param [multiple] - Whether multiple selections are allowed.
57
59
  * @param [size=SelectSize.Md] - Size of the control.
58
60
  * @param [variant=SelectVariant.Primary] - Visual variant.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.5.0-rc.22",
3
+ "version": "0.5.0-rc.24",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",