@epam/ai-dial-ui-kit 0.7.0-rc.8 → 0.7.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.
Files changed (34) hide show
  1. package/dist/dial-ui-kit.cjs.js +28 -28
  2. package/dist/dial-ui-kit.es.js +17999 -17309
  3. package/dist/index.css +2 -2
  4. package/dist/src/components/Checkbox/constants.d.ts +1 -0
  5. package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +1 -1
  6. package/dist/src/components/FileIcon/FileIcon.d.ts +1 -1
  7. package/dist/src/components/FileManager/FileManager.d.ts +15 -1
  8. package/dist/src/components/FileManager/FileManagerContext.d.ts +9 -0
  9. package/dist/src/components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup.d.ts +1 -0
  10. package/dist/src/components/FileManager/components/FileManagerToolbar/DialFileManagerToolbar.d.ts +1 -1
  11. package/dist/src/components/FileManager/constants.d.ts +3 -1
  12. package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +7 -1
  13. package/dist/src/components/Grid/Grid.d.ts +2 -6
  14. package/dist/src/components/Grid/constants.d.ts +7 -1
  15. package/dist/src/components/Grid/renderers/constants.d.ts +4 -0
  16. package/dist/src/components/IconButton/IconButton.d.ts +5 -2
  17. package/dist/src/components/LoadFileArea/EmptyFileArea.d.ts +6 -0
  18. package/dist/src/components/LoadFileArea/LoadFileAreaField.d.ts +2 -0
  19. package/dist/src/components/RadioButton/RadioButton.d.ts +2 -0
  20. package/dist/src/components/Switch/Switch.d.ts +3 -0
  21. package/dist/src/components/Tab/Tab.d.ts +1 -1
  22. package/dist/src/components/Tooltip/Tooltip.d.ts +1 -1
  23. package/dist/src/constants/file-grid-columns.d.ts +4 -38
  24. package/dist/src/hooks/use-width-breakpoint.d.ts +4 -2
  25. package/dist/src/index.d.ts +3 -1
  26. package/dist/src/models/radio.d.ts +1 -0
  27. package/dist/src/models/selection-mode.d.ts +2 -2
  28. package/dist/src/models/tab.d.ts +1 -0
  29. package/dist/src/types/file-manager.d.ts +3 -1
  30. package/dist/src/utils/debounce.d.ts +1 -0
  31. package/dist/src/utils/flat-to-hierarchy-convertor.d.ts +45 -0
  32. package/package.json +1 -1
  33. package/dist/src/components/AutocompleteInput/AutocompleteInput.d.ts +0 -35
  34. package/dist/src/components/Grid/hooks/use-grid-selection.d.ts +0 -16
@@ -8,6 +8,7 @@ export { DialSteps } from './components/Steps/Steps';
8
8
  export { DialRadioButton } from './components/RadioButton/RadioButton';
9
9
  export { DialRadioGroup } from './components/RadioGroup/RadioGroup';
10
10
  export { DialNoDataContent } from './components/NoDataContent/NoDataContent';
11
+ export type { DialNoDataContentProps } from './components/NoDataContent/NoDataContent';
11
12
  export { DialCollapsibleSidebar } from './components/CollapsibleSidebar/CollapsibleSidebar';
12
13
  export { DialLabelledText } from './components/LabelledText/LabelledText';
13
14
  export { DialTag } from './components/Tag/Tag';
@@ -47,11 +48,11 @@ export { DialPasswordInputField } from './components/PasswordInput/PasswordInput
47
48
  export { DialPasswordInput } from './components/PasswordInput/PasswordInput';
48
49
  export { DialSearch } from './components/Search/Search';
49
50
  export { DialInputPopup } from './components/InputPopup/InputPopup';
50
- export { DialAutocompleteInput } from './components/AutocompleteInput/AutocompleteInput';
51
51
  export { DialAutocompleteInputValue } from './components/AutocompleteInput/AutocompleteInputValue';
52
52
  export { DialTagInput } from './components/TagInput/TagInput';
53
53
  export { DialSelect } from './components/Select/Select';
54
54
  export { DialSelectField } from './components/SelectField/SelectField';
55
+ export { DialLoadFileArea } from './components/LoadFileArea/LoadFileArea';
55
56
  export { DialLoadFileAreaField } from './components/LoadFileArea/LoadFileAreaField';
56
57
  export { DialDropdown } from './components/Dropdown/Dropdown';
57
58
  export { DialButtonDropdown } from './components/ButtonDropdown/ButtonDropdown';
@@ -90,4 +91,5 @@ export { DialFileNodeType, DialFilePermission, DialFileResourceType, } from './m
90
91
  export { type DialCopiedItem, type DialDeletedItem, type DialUploadFileItem, type DialFileManagerActionsRef, type DialFileAcceptType, } from './models/file-manager';
91
92
  export { GridSelectionMode } from './models/selection-mode';
92
93
  export { mergeClasses } from './utils/merge-classes';
94
+ export { wrapInRootFolder } from './utils/flat-to-hierarchy-convertor.ts';
93
95
  export { NAME_COLUMN, SIZE_COLUMN, UPDATED_AT_COLUMN, } from './constants/file-grid-columns';
@@ -3,4 +3,5 @@ export interface RadioButtonWithContent {
3
3
  id: string;
4
4
  name: string;
5
5
  content?: ReactNode;
6
+ caption?: ReactNode;
6
7
  }
@@ -1,4 +1,4 @@
1
1
  export declare enum GridSelectionMode {
2
- CHECKBOX = "CHECKBOX",
3
- RADIO_BUTTON = "RADIO_BUTTON"
2
+ MULTIPLE = "MULTIPLE",
3
+ SINGLE = "SINGLE"
4
4
  }
@@ -3,5 +3,6 @@ export interface TabModel {
3
3
  id: string;
4
4
  label: ReactNode;
5
5
  invalid?: boolean;
6
+ warning?: boolean;
6
7
  disabled?: boolean;
7
8
  }
@@ -13,7 +13,9 @@ export declare enum DialFileManagerActions {
13
13
  Delete = "delete",
14
14
  Rename = "rename",
15
15
  Info = "info",
16
- Unshare = "unshare"
16
+ Unshare = "unshare",
17
+ ManagePermissions = "managePermissions",
18
+ Preview = "preview"
17
19
  }
18
20
  export declare enum DialFileManagerConflictActions {
19
21
  Replace = "replace",
@@ -0,0 +1 @@
1
+ export declare function debounceFn<T extends (...args: any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
@@ -0,0 +1,45 @@
1
+ import { DialFile } from '../models/file.ts';
2
+ interface FlatFileItem {
3
+ name: string;
4
+ parentPath?: string | null;
5
+ bucket?: string;
6
+ url?: string;
7
+ path?: string;
8
+ nodeType: string;
9
+ resourceType?: string;
10
+ updatedAt?: number;
11
+ items?: unknown;
12
+ contentLength?: number;
13
+ contentType?: string;
14
+ }
15
+ export declare const DEFAULT_CONTENT_TYPE = "application/octet-stream";
16
+ /**
17
+ * Converts a flat list of file items into a hierarchical DialFile structure.
18
+ * Handles both `url` and `path` fields, properly decodes URL-encoded paths.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const flat = [
23
+ * { name: 'public', path: 'prompts/public/', nodeType: 'FOLDER', parentPath: '' },
24
+ * { name: 'AI-Assisted Engineering', url: 'prompts/public/AI-Assisted%20Engineering/', nodeType: 'FOLDER', parentPath: null }
25
+ * ];
26
+ * const hierarchical = convertFlatToHierarchical(flat);
27
+ * ```
28
+ */
29
+ export declare function convertFlatToHierarchical(flatItems: FlatFileItem[], rootFolderId: string): DialFile[];
30
+ /**
31
+ * Helper to create a root folder wrapping flat items.
32
+ * Useful when you want the entire tree to be nested under a single root.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const wrapped = wrapInRootFolder(
37
+ * prompts,
38
+ * 'Prompts',
39
+ * 'prompts/public/',
40
+ * 'prompts-root'
41
+ * );
42
+ * ```
43
+ */
44
+ export declare function wrapInRootFolder(flatItems: FlatFileItem[], rootName?: string, rootPath?: string, rootFolderId?: string): DialFile[];
45
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.7.0-rc.8",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",
@@ -1,35 +0,0 @@
1
- import { FC } from 'react';
2
- import { DialAutocompleteInputValueProps } from './AutocompleteInputValue';
3
- export interface DialAutocompleteInputProps extends DialAutocompleteInputValueProps {
4
- containerClassName?: string;
5
- inputClassName?: string;
6
- onChange: (items: string[]) => void;
7
- }
8
- /**
9
- * A component that provides an interactive input field with autocomplete functionality. Users can
10
- * add items to a list by typing and pressing "Enter" or remove items using "Backspace" or "Delete"
11
- * when the input is empty. The component supports customizable styling for the container, input,
12
- * and list elements.
13
- *
14
- * @example
15
- * ```tsx
16
- * <DialAutocompleteInput
17
- * placeholder="Type to add items"
18
- * selectedItems={['Item 1', 'Item 2']}
19
- * onChange={(items) => console.log(items)}
20
- * containerClassName="custom-container-class"
21
- * inputClassName="custom-input-class"
22
- * listClassName="custom-list-class"
23
- * listElementClassName="custom-item-class"
24
- * />
25
- * ```
26
- *
27
- * @param [placeholder] - The placeholder text displayed in the input field when no items are selected.
28
- * @param [selectedItems=[]] - An array of strings representing the currently selected items.
29
- * @param onChange - A callback function that updates the list of selected items. Called when items are added or removed.
30
- * @param [listClassName] - Additional CSS classes applied to the `<ul>` element containing the list of selected items.
31
- * @param [listElementClassName] - Additional CSS classes applied to each `<li>` element representing an individual selected item.
32
- * @param [containerClassName] - Additional CSS classes applied to the container `<div>` element wrapping the input and list.
33
- * @param [inputClassName] - Additional CSS classes applied to the `<input>` element.
34
- */
35
- export declare const DialAutocompleteInput: FC<DialAutocompleteInputProps>;
@@ -1,16 +0,0 @@
1
- export interface UseGridSelectionProps<T extends object> {
2
- selectedRowIds?: Set<string>;
3
- selectedRows?: Map<string, T>;
4
- onSelectionChange?: (selectedRowIds: Set<string>, selectedRows: T[]) => void;
5
- onSelectionChangeWithMap?: (selectedRows: Map<string, T>) => void;
6
- rowData?: T[];
7
- getRowId: (row: T) => string;
8
- disabledRowIds?: Set<string>;
9
- }
10
- export declare const useGridSelection: <T extends object>({ selectedRowIds, selectedRows, onSelectionChange, onSelectionChangeWithMap, rowData, getRowId, disabledRowIds, }: UseGridSelectionProps<T>) => {
11
- currentSelectedIds: Set<string>;
12
- currentSelectedRows: Map<string, T>;
13
- handleSelectionToggle: (row: T, checked: boolean, isSingleSelect?: boolean) => void;
14
- headerCheckboxState: string;
15
- handleHeaderCheckboxChange: (checked?: boolean) => void;
16
- };