@epam/ai-dial-ui-kit 0.4.0-rc.6 → 0.4.0-rc.60

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 (73) hide show
  1. package/dist/dial-ui-kit.cjs.js +28 -28
  2. package/dist/dial-ui-kit.es.js +9418 -8150
  3. package/dist/index.css +2 -2
  4. package/dist/src/components/AutocompleteInput/AutocompleteInputValue.d.ts +2 -0
  5. package/dist/src/components/Breadcrumb/BreadcrumbItem.d.ts +2 -2
  6. package/dist/src/components/Breadcrumb/constants.d.ts +4 -1
  7. package/dist/src/components/Checkbox/Checkbox.d.ts +2 -2
  8. package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +2 -2
  9. package/dist/src/components/FileManager/FileManager.d.ts +60 -14
  10. package/dist/src/components/FileManager/FileManagerContext.d.ts +63 -0
  11. package/dist/src/components/FileManager/FileManagerProvider.d.ts +18 -0
  12. package/dist/src/components/FileManager/components/FileManagerBulkActionsToolbar/FileManagerBulkActionsToolbar.d.ts +53 -0
  13. package/dist/src/components/FileManager/components/FileManagerBulkActionsToolbar/constants.d.ts +3 -0
  14. package/dist/src/components/FileManager/components/FileManagerDeleteConfirmationPopup/FileManagerDeleteConfirmationPopup.d.ts +26 -0
  15. package/dist/src/components/FileManager/components/FileManagerItemIcon/FileManagerItemIcon.d.ts +46 -0
  16. package/dist/src/components/FileManager/components/FileManagerItemName/FileManagerItemName.d.ts +48 -0
  17. package/dist/src/components/FileManager/components/FileManagerItemNameInput/FileManagerItemNameInput.d.ts +65 -0
  18. package/dist/src/components/FileManager/components/FileManagerNavigationPanel/FileManagerNavigationPanel.d.ts +2 -0
  19. package/dist/src/components/FileManager/components/FileManagerToolbar/DialFileManagerToolbar.d.ts +27 -24
  20. package/dist/src/components/FileManager/components/FoldersTree/FoldersTree.d.ts +23 -3
  21. package/dist/src/components/FileManager/constants.d.ts +1 -1
  22. package/dist/src/components/FileManager/hooks/__tests__/use-current-path.spec.d.ts +1 -0
  23. package/dist/src/components/FileManager/hooks/__tests__/use-file-clipboard.spec.d.ts +1 -0
  24. package/dist/src/components/FileManager/hooks/__tests__/use-file-delete.spec.d.ts +1 -0
  25. package/dist/src/components/FileManager/hooks/__tests__/use-show-hidden-files.spec.d.ts +1 -0
  26. package/dist/src/components/FileManager/hooks/use-collapse-tree.d.ts +9 -0
  27. package/dist/src/components/FileManager/hooks/use-current-path.d.ts +10 -0
  28. package/dist/src/components/FileManager/hooks/use-file-clipboard.d.ts +20 -0
  29. package/dist/src/components/FileManager/hooks/use-file-delete.d.ts +13 -0
  30. package/dist/src/components/FileManager/hooks/use-file-manager-context.d.ts +5 -0
  31. package/dist/src/components/FileManager/hooks/use-item-renaming.d.ts +13 -0
  32. package/dist/src/components/FileManager/hooks/use-show-hidden-files.d.ts +5 -0
  33. package/dist/src/components/FileManager/utils.d.ts +1 -0
  34. package/dist/src/components/Grid/Grid.d.ts +9 -1
  35. package/dist/src/components/Grid/comparators/base-column-comparator.spec.d.ts +1 -0
  36. package/dist/src/components/Grid/constants.d.ts +0 -1
  37. package/dist/src/components/Grid/renderers/DateCellRenderer.d.ts +32 -0
  38. package/dist/src/components/Grid/renderers/constants.d.ts +3 -0
  39. package/dist/src/components/Grid/renderers/utils.d.ts +2 -0
  40. package/dist/src/components/Grid/renderers/utils.spec.d.ts +1 -0
  41. package/dist/src/components/Input/Input.d.ts +4 -1
  42. package/dist/src/components/InputPopup/InputPopup.d.ts +6 -2
  43. package/dist/src/components/NoDataContent/NoDataContent.d.ts +3 -0
  44. package/dist/src/components/Search/Search.d.ts +2 -0
  45. package/dist/src/components/Select/MultiSelectTags.d.ts +2 -2
  46. package/dist/src/components/Select/Select.d.ts +37 -22
  47. package/dist/src/components/Select/constants.d.ts +1 -2
  48. package/dist/src/components/SelectField/SelectField.d.ts +5 -0
  49. package/dist/src/components/Steps/tests/utils.spec.d.ts +1 -0
  50. package/dist/src/components/Tab/Tab.d.ts +1 -4
  51. package/dist/src/components/Tabs/Tabs.d.ts +27 -14
  52. package/dist/src/components/Tag/Tag.d.ts +2 -2
  53. package/dist/src/components/Tooltip/Tooltip.d.ts +2 -2
  54. package/dist/src/components/Tooltip/TooltipContent.d.ts +5 -2
  55. package/dist/src/components/Tooltip/TooltipTrigger.d.ts +6 -4
  56. package/dist/src/hooks/use-editable-item.d.ts +64 -0
  57. package/dist/src/hooks/use-flexible-actions.d.ts +86 -0
  58. package/dist/src/hooks/use-is-mobile-screen.d.ts +15 -0
  59. package/dist/src/hooks/use-screen-type.d.ts +19 -0
  60. package/dist/src/index.d.ts +10 -4
  61. package/dist/src/models/dropdown.d.ts +2 -2
  62. package/dist/src/models/file.d.ts +3 -0
  63. package/dist/src/models/select.d.ts +1 -0
  64. package/dist/src/models/tab.d.ts +1 -0
  65. package/dist/src/types/file-manager.d.ts +18 -0
  66. package/dist/src/types/flexible-actions.d.ts +4 -0
  67. package/dist/src/types/item.d.ts +4 -0
  68. package/dist/src/types/screen.d.ts +6 -0
  69. package/dist/src/types/select.d.ts +8 -0
  70. package/dist/src/types/tab.d.ts +4 -0
  71. package/dist/src/utils/merge-classes.spec.d.ts +1 -0
  72. package/dist/src/utils/mobile.d.ts +35 -0
  73. package/package.json +8 -8
@@ -1,8 +1,7 @@
1
- export declare const selectTriggerBaseClasses = "dial-input flex px-3 py-2 w-full items-center justify-between gap-2 dial-small min-h-[38px]";
1
+ export declare const selectTriggerBaseClasses = "dial-input flex w-full items-center justify-between gap-2 dial-small";
2
2
  export declare const selectOverlayBaseClasses = "w-full rounded";
3
3
  export declare const selectOptionBaseClasses = "flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none";
4
4
  export declare const selectOptionSelectedClasses = "bg-accent-primary-alpha";
5
5
  export declare const selectOptionSingleSelectedClasses = "bg-accent-primary-alpha border-l border-accent-primary border-1";
6
6
  export declare const selectOptionDisabledClasses = "opacity-75";
7
7
  export declare const selectChevronIcon: import("react/jsx-runtime").JSX.Element;
8
- export declare const selectCheckIcon: import("react/jsx-runtime").JSX.Element;
@@ -25,6 +25,11 @@ export interface DialSelectFieldProps extends Omit<DialSelectProps, 'cssClass'>,
25
25
  * onChange={(v) => setTransport(v as string)}
26
26
  * />
27
27
  *
28
+ * @params - Component properties extending:
29
+ * - {@link DialSelectProps} for select options and props, except for cssClass
30
+ * - {@link DialFormItemProps} for form item props, except for htmlFor
31
+ * - {@link DialFieldLabelProps} for label props, except for label, children, value
32
+ *
28
33
  * @param selectCssClass CSS class for the select element
29
34
  * @param containerCssClass CSS class for the form item container
30
35
  * @param emptyStateTitle Title to show when there are no options
@@ -0,0 +1 @@
1
+ export {};
@@ -3,7 +3,6 @@ import { FC } from 'react';
3
3
  export interface DialTabProps {
4
4
  tab: TabModel;
5
5
  active: boolean;
6
- disabled?: boolean;
7
6
  invalid?: boolean;
8
7
  horizontal?: boolean;
9
8
  cssClass?: string;
@@ -24,10 +23,8 @@ export interface DialTabProps {
24
23
  * />
25
24
  * ```
26
25
  *
27
- * @param tab - The tab model containing its `id` and `name`.
26
+ * @param tab - The tab model containing its `id`, `name`, [`disabled`], [`invalid`].
28
27
  * @param active - Whether the tab is currently active.
29
- * @param [disabled=false] - Whether the tab is disabled and non-interactive.
30
- * @param [invalid=false] - Whether the tab is marked as invalid, displaying an error icon.
31
28
  * @param [horizontal=false] - Whether the tab is displayed in horizontal orientation.
32
29
  * @param [cssClass] - Additional CSS classes applied to the tab element.
33
30
  * @param onClick - Callback fired when the tab is clicked. Receives the tab’s `id`.
@@ -1,22 +1,29 @@
1
1
  import { FC } from 'react';
2
2
  import { TabModel } from '../../models/tab';
3
- import { TabOrientation } from '../../types/tab';
3
+ import { SmallScreenThreshold, TabOrientation } from '../../types/tab';
4
4
  export interface DialTabsProps {
5
5
  tabs: TabModel[];
6
6
  activeTab: string;
7
7
  onClick: (id: string) => void;
8
8
  orientation?: TabOrientation;
9
+ smallScreenThreshold?: SmallScreenThreshold;
10
+ smallScreenContainerCssClass?: string;
11
+ smallScreenDropdownItemCssClass?: string;
9
12
  }
10
13
  /**
11
- * A responsive and overflow-aware tabs component that adapts between horizontal and dropdown (mobile) layouts
12
- * based on screen size and available space. When there are too many tabs to fit in one line,
13
- * the component automatically adds a dropdown button for accessing hidden tabs and enables smooth horizontal scrolling.
14
+ * A responsive and overflow-aware tabs component that automatically adapts its layout
15
+ * between a scrollable tab bar and a dropdown menu on smaller screens.
14
16
  *
15
- * Supports both horizontal and vertical orientations and can integrate with JSON editor states to toggle
16
- * visibility when needed. Automatically keeps the active tab in view when navigating through scrollable tabs.
17
+ * When there are too many tabs to fit in a single line, it introduces a dropdown button
18
+ * for accessing hidden tabs and ensures smooth horizontal scrolling. The component also
19
+ * automatically keeps the active tab in view.
17
20
  *
18
- * On larger screens, tabs are displayed horizontally or vertically according to the {@link TabOrientation} prop.
19
- * On smaller screens, tabs collapse into a dropdown menu for better usability.
21
+ * Supports both horizontal and vertical orientations and dynamically adjusts layout
22
+ * based on screen size and available space.
23
+ *
24
+ * On larger screens, tabs are displayed according to the `orientation` prop
25
+ * (horizontal or vertical). On smaller screens (mobile or tablet), the tabs collapse
26
+ * into a dropdown menu for better usability.
20
27
  *
21
28
  * @example
22
29
  * ```tsx
@@ -32,15 +39,21 @@ export interface DialTabsProps {
32
39
  * />
33
40
  * ```
34
41
  *
35
- * @param tabs - Array of tab models to render. Each tab should include an `id` and `label`.
42
+ * @param tabs - Array of tab models to render. Each tab must include an `id` and a display `name`.
36
43
  * @param activeTab - The identifier of the currently active tab.
37
44
  * @param onClick - Callback fired when a tab is selected. Receives the tab's `id` as an argument.
38
- * @param [orientation=TabOrientation.Horizontal] - The layout direction of the tabs. Uses the {@link TabOrientation} enum.
45
+ * @param [orientation=TabOrientation.Horizontal] - Layout direction of the tabs. Uses the {@link TabOrientation} enum.
46
+ * @param [smallScreenThreshold=SmallScreenThreshold.Tablet] - Defines the screen size threshold
47
+ * below which tabs collapse into a dropdown. Uses the {@link SmallScreenThreshold} enum.
48
+ * When set to `Tablet`, both mobile and tablet screens will trigger dropdown mode.
49
+ * @param [smallScreenContainerCssClass] - Optional CSS class applied to the dropdown container
50
+ * in small-screen (collapsed) mode.
51
+ * @param [smallScreenDropdownItemCssClass] - Optional CSS class applied to individual dropdown
52
+ * items in small-screen mode.
39
53
  *
40
54
  * @remarks
41
- * - Automatically detects overflow using a `ResizeObserver` and toggles a dropdown button when tabs exceed
42
- * available width.
43
- * - Smoothly scrolls the tab row to keep the active tab visible.
44
- * - Switches to a dedicated dropdown interface on mobile and tablet screens via the `useIsTabletScreen` hook.
55
+ * - Automatically detects horizontal overflow via `ResizeObserver` and shows a dropdown when needed.
56
+ * - Smoothly scrolls to keep the active tab visible when navigating.
57
+ * - Switches layout responsively based on `smallScreenThreshold`.
45
58
  */
46
59
  export declare const DialTabs: FC<DialTabsProps>;
@@ -1,9 +1,9 @@
1
1
  import { TagVariant } from '../../types/tag';
2
- import { FC, ReactNode } from 'react';
2
+ import { FC, MouseEvent, ReactNode } from 'react';
3
3
  export interface DialTagProps {
4
4
  tag: string;
5
5
  cssClass?: string;
6
- remove?: (event: React.MouseEvent<HTMLButtonElement>) => void;
6
+ remove?: (event: MouseEvent<HTMLButtonElement>) => void;
7
7
  variant?: TagVariant;
8
8
  iconBefore?: ReactNode;
9
9
  bordered?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { DialTooltipContainerOptions } from './TooltipContext';
3
- export interface Props extends DialTooltipContainerOptions {
3
+ export interface DialTooltipProps extends DialTooltipContainerOptions {
4
4
  hideTooltip?: boolean;
5
5
  tooltip: ReactNode;
6
6
  children: ReactNode;
@@ -28,4 +28,4 @@ export interface Props extends DialTooltipContainerOptions {
28
28
  * @param [open] - Controlled open state for the tooltip
29
29
  * @param [onOpenChange] - Callback fired when the tooltip open state changes
30
30
  */
31
- export declare const DialTooltip: FC<Props>;
31
+ export declare const DialTooltip: FC<DialTooltipProps>;
@@ -1,8 +1,11 @@
1
- import { HTMLProps } from 'react';
1
+ import { CSSProperties, FC, HTMLProps } from 'react';
2
+ export interface Props extends HTMLProps<HTMLDivElement> {
3
+ style?: CSSProperties;
4
+ }
2
5
  /**
3
6
  * The content area of a tooltip that displays the tooltip information
4
7
  *
5
8
  * @param children - The content to display inside the tooltip
6
9
  * @param [style] - Additional inline styles for the tooltip content
7
10
  */
8
- export declare const DialTooltipContent: import('react').ForwardRefExoticComponent<Omit<HTMLProps<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
11
+ export declare const DialTooltipContent: FC<Props>;
@@ -1,10 +1,12 @@
1
- import { HTMLProps } from 'react';
1
+ import { FC, HTMLProps } from 'react';
2
+ interface TooltipTriggerProps extends HTMLProps<HTMLElement> {
3
+ asChild?: boolean;
4
+ }
2
5
  /**
3
6
  * The trigger element for a tooltip that can be clicked or hovered
4
7
  *
5
8
  * @param children - The element that will trigger the tooltip
6
9
  * @param [asChild=false] - Whether to render as a child element instead of wrapping in a span
7
10
  */
8
- export declare const DialTooltipTrigger: import('react').ForwardRefExoticComponent<Omit<HTMLProps<HTMLElement> & {
9
- asChild?: boolean;
10
- }, "ref"> & import('react').RefAttributes<HTMLElement>>;
11
+ export declare const DialTooltipTrigger: FC<TooltipTriggerProps>;
12
+ export {};
@@ -0,0 +1,64 @@
1
+ export interface UseEditableItemOptions {
2
+ value: string;
3
+ isEditing: boolean;
4
+ onValidate?: (value: string) => string | null;
5
+ onSave?: (value: string) => void;
6
+ onCancel?: () => void;
7
+ restoreOnCancel?: boolean;
8
+ }
9
+ interface UseEditableItemResult {
10
+ inputRef: React.RefObject<HTMLInputElement | null>;
11
+ value: string;
12
+ onChange: (newValue?: string) => void;
13
+ invalid: boolean;
14
+ invalidMessage: string;
15
+ }
16
+ /**
17
+ * A React hook that manages the behavior of an inline-editable text input.
18
+ * It provides validation handling, cancel/restore logic, auto-focus behavior,
19
+ * keyboard shortcuts, and outside-click detection.
20
+ *
21
+ * @param {Object} options - Hook configuration options.
22
+ * @param {string} options.value - Initial value for the editable input.
23
+ * @param {boolean} options.isEditing - Whether the item is currently in edit mode.
24
+ * @param {(value: string) => string | null} [options.onValidate] - Optional validation function returning an error message or `null` if valid.
25
+ * @param {(value: string) => void} [options.onSave] - Callback invoked when saving a valid value.
26
+ * @param {() => void} [options.onCancel] - Callback invoked when canceling editing.
27
+ * @param {boolean} [options.restoreOnCancel=true] - Whether to restore the original value on cancel.
28
+ *
29
+ * @returns {Object} An object containing state and handlers for editable input.
30
+ * @returns {React.RefObject<HTMLInputElement>} return.inputRef - Ref to the editable input element.
31
+ * @returns {string} return.value - Current input value.
32
+ * @returns {(newValue?: string) => void} return.onChange - Change handler for the input value.
33
+ * @returns {boolean} return.invalid - Whether the current value is invalid.
34
+ * @returns {string} return.invalidMessage - Validation error message, if any.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * const {
39
+ * inputRef,
40
+ * value,
41
+ * onChange,
42
+ * invalid,
43
+ * invalidMessage
44
+ * } = useEditableItem({
45
+ * value: 'example.txt',
46
+ * isEditing,
47
+ * onValidate: (v) => v.trim() ? null : 'Name cannot be empty',
48
+ * onSave: (v) => console.log('Saved', v),
49
+ * onCancel: () => console.log('Canceled'),
50
+ * });
51
+ *
52
+ * return (
53
+ * <input
54
+ * ref={inputRef}
55
+ * value={value}
56
+ * onChange={(e) => onChange(e.target.value)}
57
+ * aria-invalid={invalid}
58
+ * />
59
+ * {invalid && <span>{invalidMessage}</span>}
60
+ * );
61
+ * ```
62
+ */
63
+ export declare function useEditableItem({ value: initialValue, isEditing, restoreOnCancel, onValidate, onSave, onCancel, }: UseEditableItemOptions): UseEditableItemResult;
64
+ export {};
@@ -0,0 +1,86 @@
1
+ import { FlexibleActionsDirection } from '../types/flexible-actions';
2
+ interface UseFlexibleActionsOptions<T> {
3
+ actions: T[];
4
+ direction?: FlexibleActionsDirection;
5
+ moreButtonWidth?: number;
6
+ actionsGap?: number;
7
+ containerPadding?: number;
8
+ dependencies?: unknown[];
9
+ }
10
+ /**
11
+ * A responsive layout hook that automatically determines how many action buttons
12
+ * can fit within a container and moves overflowing ones into a hidden list (e.g. a dropdown).
13
+ *
14
+ * It measures each action's width and dynamically recalculates visible and hidden actions
15
+ * whenever the container resizes or dependencies change.
16
+ *
17
+ * This hook is reusable for toolbars or action strips that can have:
18
+ * - a **left fixed section** (e.g., selection info),
19
+ * - a **right fixed section** (e.g., metadata or pagination),
20
+ * - and a **flexible central section** where actions may overflow.
21
+ *
22
+ * @template T - Type of the action item. Each action must have a unique `key` property.
23
+ *
24
+ * @param {Object} options - Hook configuration options.
25
+ * @param {T[]} options.actions - Array of all available actions.
26
+ * @param {FlexibleActionsDirection} [options.direction=FlexibleActionsDirection.Normal] -
27
+ * Defines the fill direction:
28
+ * - `Normal`: Fills actions from left to right.
29
+ * - `Reverse`: Fills actions from right to left (useful when the "More" button is on the right).
30
+ * @param {number} [options.moreButtonWidth=BASE_ICON_SIZE] - Reserved width for the “more” or overflow button.
31
+ * @param {number} [options.actionsGap=8] - Horizontal gap (in pixels) between action buttons.
32
+ * @param {number} [options.containerPadding=8] - Horizontal padding (in pixels) inside the container.
33
+ * @param {unknown[]} [options.dependencies=[]] - Dependency array to trigger recalculation when external layout-affecting
34
+ * values (like screen size or visibility) change.
35
+ *
36
+ * @returns Result object containing the calculated visible and hidden actions and all relevant refs.
37
+ *
38
+ * @property {T[]} visibleActions - Actions that currently fit into the available width.
39
+ * @property {T[]} hiddenActions - Actions that do not fit and should be rendered inside a dropdown.
40
+ *
41
+ * @property {Object} refs - A set of refs used for layout measurement.
42
+ * @property {RefObject<HTMLDivElement>} refs.containerRef - Ref for the outer container. Must wrap the entire toolbar area.
43
+ * @property {RefObject<HTMLDivElement>} refs.measureRef - Ref for a hidden measurement container (used to measure action widths).
44
+ * @property {RefObject<HTMLDivElement>} refs.leftSectionRef - Ref for the left fixed section (optional).
45
+ * @property {RefObject<HTMLDivElement>} refs.rightSectionRef - Ref for the right fixed section (optional).
46
+ *
47
+ * @example
48
+ * // Example usage inside a toolbar component:
49
+ * const { visibleActions, hiddenActions, refs } = useFlexibleActions({
50
+ * actions,
51
+ * direction: FlexibleActionsDirection.Reverse,
52
+ * dependencies: [isMobile],
53
+ * });
54
+ *
55
+ * return (
56
+ * <>
57
+ * <div ref={refs.measureRef} className="invisible absolute top-0 left-0 flex gap-2">
58
+ * {actions.map(a => <ActionButton key={a.key} {...a} />)}
59
+ * </div>
60
+ *
61
+ * <div ref={refs.containerRef} className="flex justify-between items-center">
62
+ * <div ref={refs.leftSectionRef}>Left section</div>
63
+ *
64
+ * <div className="flex gap-2 items-center">
65
+ * {hiddenActions.length > 0 && <MoreMenu items={hiddenActions} />}
66
+ * {visibleActions.map(a => <ActionButton key={a.key} {...a} />)}
67
+ * </div>
68
+ *
69
+ * <div ref={refs.rightSectionRef}>Right section</div>
70
+ * </div>
71
+ * </>
72
+ * );
73
+ */
74
+ export declare function useFlexibleActions<T extends {
75
+ key: string;
76
+ }>({ actions, direction, moreButtonWidth, actionsGap, containerPadding, dependencies, }: UseFlexibleActionsOptions<T>): {
77
+ visibleActions: T[];
78
+ hiddenActions: T[];
79
+ refs: {
80
+ containerRef: import('react').RefObject<HTMLDivElement | null>;
81
+ measureRef: import('react').RefObject<HTMLDivElement | null>;
82
+ leftSectionRef: import('react').RefObject<HTMLDivElement | null>;
83
+ rightSectionRef: import('react').RefObject<HTMLDivElement | null>;
84
+ };
85
+ };
86
+ export {};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * A React hook that determines whether the current window size matches a mobile screen width.
3
+ *
4
+ * It initializes based on the current screen size using `isSmallScreen()` and updates its value
5
+ * whenever the window is resized.
6
+ *
7
+ * @returns {boolean} `true` if the viewport width matches the mobile breakpoint, otherwise `false`.
8
+ *
9
+ * @example
10
+ * const isMobile = useIsMobileScreen();
11
+ * if (isMobile) {
12
+ * console.log('Mobile layout active');
13
+ * }
14
+ */
15
+ export declare const useIsMobileScreen: () => boolean;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * A React hook that determines the current screen type based on the viewport width.
3
+ *
4
+ * It uses `getScreenType()` to categorize the screen as `Desktop`, `Tablet`, or `Mobile`,
5
+ * and automatically updates the value when the window is resized.
6
+ *
7
+ * This hook is useful for implementing responsive layouts that adapt
8
+ * their UI or behavior depending on screen type.
9
+ *
10
+ * @returns {ScreenType} The current screen type (`Desktop`, `Tablet`, `Mobile`, or `Undefined` for SSR).
11
+ *
12
+ * @example
13
+ * const screenType = useScreenType();
14
+ *
15
+ * if (screenType === ScreenType.Desktop) {
16
+ * console.log('Desktop layout active');
17
+ * }
18
+ */
19
+ export declare const useScreenType: () => import('../types/screen').ScreenType;
@@ -18,8 +18,8 @@ export { DialFormItem } from './components/FormItem/FormItem';
18
18
  export { DialSharedEntityIndicator } from './components/SharedEntityIndicator/SharedEntityIndicator';
19
19
  export { DialFileName } from './components/FileName/FileName';
20
20
  export { DialFolderName } from './components/FolderName/FolderName';
21
+ export { DialDateCellRenderer } from './components/Grid/renderers/DateCellRenderer';
21
22
  export { DialTabs } from './components/Tabs/Tabs';
22
- export { DialTab } from './components/Tab/Tab';
23
23
  export { DialBreadcrumb } from './components/Breadcrumb/Breadcrumb';
24
24
  export { DialBreadcrumbItem } from './components/Breadcrumb/BreadcrumbItem';
25
25
  export { DialButton } from './components/Button/Button';
@@ -56,14 +56,20 @@ export { ButtonVariant } from './types/button';
56
56
  export { RadioGroupOrientation } from './types/radio-group';
57
57
  export { PopupSize } from './types/popup';
58
58
  export { ConfirmationPopupVariant } from './types/confirmation-popup';
59
- export { DropdownType } from './types/dropdown';
59
+ export { DropdownType, DropdownTrigger, DropdownItemType, } from './types/dropdown';
60
60
  export { SearchSize } from './types/search';
61
61
  export { TagVariant } from './types/tag';
62
62
  export { TabOrientation } from './types/tab';
63
63
  export type { DialBreadcrumbPathItem } from './models/breadcrumb';
64
64
  export { FormItemOrientation } from './types/form-item';
65
- export { DialFileManagerTabs } from './types/file-manager';
65
+ export { SelectSize, SelectVariant } from './types/select';
66
+ export { DialFileManagerTabs, DialFileManagerActions, type DialCopiedItem, type DialDeletedItem, } from './types/file-manager';
67
+ export { FlexibleActionsDirection } from './types/flexible-actions';
68
+ export { DialItemType } from './types/item';
66
69
  export { useDialFileManagerTabs } from './components/FileManager/hooks/use-file-manager-tabs';
70
+ export { useEditableItem } from './hooks/use-editable-item';
71
+ export { FileManagerProvider } from './components/FileManager/FileManagerProvider';
72
+ export { useFileManagerContext } from './components/FileManager/hooks/use-file-manager-context';
67
73
  export { StepStatus } from './models/step';
68
74
  export type { Step } from './models/step';
69
75
  export type { RadioButtonWithContent } from './models/radio';
@@ -72,5 +78,5 @@ export type { TabModel } from './models/tab';
72
78
  export type { DropdownItem } from './models/dropdown';
73
79
  export type { DialModifiedEntity } from './models/base-entity';
74
80
  export type { DialFile } from './models/file';
75
- export type { DialFileNodeType, DialFilePermission, DialFileResourceType, } from './models/file';
81
+ export { DialFileNodeType, DialFilePermission, DialFileResourceType, } from './models/file';
76
82
  export { mergeClasses } from './utils/merge-classes';
@@ -1,5 +1,5 @@
1
1
  import { DropdownItemType } from '../types/dropdown';
2
- import { ReactNode } from 'react';
2
+ import { ReactNode, MouseEvent } from 'react';
3
3
  export interface DropdownItem {
4
4
  key: string;
5
5
  label?: ReactNode;
@@ -9,6 +9,6 @@ export interface DropdownItem {
9
9
  type?: DropdownItemType;
10
10
  onClick?: (info: {
11
11
  key: string;
12
- domEvent: React.MouseEvent<Element, MouseEvent>;
12
+ domEvent: MouseEvent;
13
13
  }) => void;
14
14
  }
@@ -33,3 +33,6 @@ export declare enum DialFilePermission {
33
33
  WRITE = "WRITE",
34
34
  SHARE = "SHARE"
35
35
  }
36
+ export interface DialRootFolder extends DialFile {
37
+ breadcrumbLabel: string;
38
+ }
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  export interface SelectOption {
3
3
  value: string;
4
4
  label: string;
5
+ description?: string;
5
6
  disabled?: boolean;
6
7
  icon?: ReactNode;
7
8
  }
@@ -2,4 +2,5 @@ export interface TabModel {
2
2
  id: string;
3
3
  name: string;
4
4
  invalid?: boolean;
5
+ disabled?: boolean;
5
6
  }
@@ -1,5 +1,23 @@
1
+ import { DialFileNodeType } from '../models/file';
1
2
  export declare enum DialFileManagerTabs {
2
3
  MyFiles = "my_files",
3
4
  Shared = "shared",
4
5
  Organization = "organization"
5
6
  }
7
+ export declare enum DialFileManagerActions {
8
+ Copy = "copy",
9
+ Cut = "cut",
10
+ Paste = "paste",
11
+ Rename = "rename",
12
+ Delete = "delete"
13
+ }
14
+ export interface DialCopiedItem {
15
+ sourceUrl: string;
16
+ destinationUrl: string;
17
+ overwrite?: boolean;
18
+ nodeType: DialFileNodeType;
19
+ }
20
+ export interface DialDeletedItem {
21
+ sourceUrl: string;
22
+ nodeType: DialFileNodeType;
23
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum FlexibleActionsDirection {
2
+ Normal = "normal",
3
+ Reverse = "reverse"
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum DialItemType {
2
+ File = "file",
3
+ Folder = "folder"
4
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum ScreenType {
2
+ Undefined = "undefined",
3
+ Mobile = "mobile",
4
+ Tablet = "tablet",
5
+ Desktop = "desktop"
6
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum SelectSize {
2
+ Sm = "sm",
3
+ Md = "md"
4
+ }
5
+ export declare enum SelectVariant {
6
+ Primary = "Primary",
7
+ Secondary = "Secondary"
8
+ }
@@ -2,3 +2,7 @@ export declare enum TabOrientation {
2
2
  Horizontal = "horizontal",
3
3
  Vertical = "vertical"
4
4
  }
5
+ export declare enum SmallScreenThreshold {
6
+ Mobile = "mobile",
7
+ Tablet = "tablet"
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ import { ScreenType } from '../types/screen';
1
2
  /**
2
3
  * Checks if the current viewport width is within the "medium" (tablet) screen range.
3
4
  *
@@ -12,3 +13,37 @@
12
13
  * }
13
14
  */
14
15
  export declare const isMediumScreen: () => boolean;
16
+ /**
17
+ * Checks if the current viewport width is within the "small" (mobile) screen range.
18
+ *
19
+ * Specifically, it returns `true` if the window width is less than 640 pixels.
20
+ * Safely handles server-side rendering by verifying that `window` is defined.
21
+ *
22
+ * @returns {boolean} `true` if the viewport width is less than 640px, otherwise `false`.
23
+ *
24
+ * @example
25
+ * if (isSmallScreen()) {
26
+ * console.log('Mobile screen detected');
27
+ * }
28
+ */
29
+ export declare const isSmallScreen: () => boolean;
30
+ /**
31
+ * Determines the current screen type based on the viewport width.
32
+ *
33
+ * Categorizes the screen into one of three types defined by `ScreenType`:
34
+ * - `ScreenType.Desktop` for widths **≥ 1024px**
35
+ * - `ScreenType.Tablet` for widths **between 640px and 1023px**
36
+ * - `ScreenType.Mobile` for widths **< 640px**
37
+ *
38
+ * If executed in a non-browser environment (where `window` is undefined),
39
+ * it returns `ScreenType.Undefined`.
40
+ *
41
+ * @returns {ScreenType} The detected screen type (`Desktop`, `Tablet`, `Mobile`, or `Undefined`).
42
+ *
43
+ * @example
44
+ * const screenType = getScreenType();
45
+ * if (screenType === ScreenType.Mobile) {
46
+ * console.log('Mobile layout activated');
47
+ * }
48
+ */
49
+ export declare const getScreenType: () => ScreenType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.4.0-rc.6",
3
+ "version": "0.4.0-rc.60",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",
@@ -77,10 +77,10 @@
77
77
  "@eslint/compat": "^1.3.1",
78
78
  "@eslint/eslintrc": "^3.3.1",
79
79
  "@eslint/js": "^9.31.0",
80
- "@storybook/addon-a11y": "^9.1.13",
81
- "@storybook/addon-docs": "^9.1.13",
82
- "@storybook/addon-vitest": "^9.1.13",
83
- "@storybook/react-vite": "^9.1.13",
80
+ "@storybook/addon-a11y": "^10.0.0",
81
+ "@storybook/addon-docs": "^10.0.0",
82
+ "@storybook/addon-vitest": "^10.0.0",
83
+ "@storybook/react-vite": "^10.0.0",
84
84
  "@testing-library/dom": "^10.4.0",
85
85
  "@testing-library/react": "^16.3.0",
86
86
  "@types/jsdom": "^21.1.7",
@@ -99,7 +99,7 @@
99
99
  "eslint-plugin-react": "7.37.5",
100
100
  "eslint-plugin-react-hooks": "^5.2.0",
101
101
  "eslint-plugin-react-refresh": "^0.4.20",
102
- "eslint-plugin-storybook": "^9.1.13",
102
+ "eslint-plugin-storybook": "^10.0.0",
103
103
  "eslint-plugin-tailwindcss": "^3.18.2",
104
104
  "globals": "^16.3.0",
105
105
  "husky": "^9.1.7",
@@ -110,8 +110,8 @@
110
110
  "prettier": "3.6.2",
111
111
  "sass": "^1.89.2",
112
112
  "sass-embedded": "^1.89.2",
113
- "storybook": "^9.1.13",
114
- "storybook-addon-pseudo-states": "^9.1.13",
113
+ "storybook": "^10.0.0",
114
+ "storybook-addon-pseudo-states": "^10.0.0",
115
115
  "tailwindcss": "^3.4.17",
116
116
  "typescript": "~5.8.3",
117
117
  "typescript-eslint": "^8.35.1",