@epam/ai-dial-ui-kit 0.4.0-rc.5 → 0.4.0-rc.50
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 +28 -28
- package/dist/dial-ui-kit.es.js +8559 -7743
- package/dist/index.css +2 -2
- package/dist/src/components/AutocompleteInput/AutocompleteInputValue.d.ts +2 -0
- package/dist/src/components/Breadcrumb/BreadcrumbItem.d.ts +2 -2
- package/dist/src/components/Breadcrumb/constants.d.ts +4 -1
- package/dist/src/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +7 -3
- package/dist/src/components/FileManager/FileManager.d.ts +43 -14
- package/dist/src/components/FileManager/FileManagerContext.d.ts +51 -0
- package/dist/src/components/FileManager/FileManagerProvider.d.ts +17 -0
- package/dist/src/components/FileManager/components/FileManagerBulkActionsToolbar/FileManagerBulkActionsToolbar.d.ts +53 -0
- package/dist/src/components/FileManager/components/FileManagerBulkActionsToolbar/constants.d.ts +3 -0
- package/dist/src/components/FileManager/components/FileManagerToolbar/DialFileManagerToolbar.d.ts +27 -24
- package/dist/src/components/FileManager/components/FoldersTree/FoldersTree.d.ts +2 -0
- package/dist/src/components/FileManager/constants.d.ts +1 -1
- package/dist/src/components/FileManager/hooks/__tests__/use-current-path.spec.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/__tests__/use-file-clipboard.spec.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/__tests__/use-show-hidden-files.spec.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-collapse-tree.d.ts +9 -0
- package/dist/src/components/FileManager/hooks/use-current-path.d.ts +10 -0
- package/dist/src/components/FileManager/hooks/use-file-clipboard.d.ts +20 -0
- package/dist/src/components/FileManager/hooks/use-file-manager-context.d.ts +5 -0
- package/dist/src/components/FileManager/hooks/use-show-hidden-files.d.ts +5 -0
- package/dist/src/components/FileManager/utils.d.ts +1 -0
- package/dist/src/components/Grid/Grid.d.ts +9 -1
- package/dist/src/components/Grid/comparators/base-column-comparator.spec.d.ts +1 -0
- package/dist/src/components/Grid/constants.d.ts +0 -1
- package/dist/src/components/Grid/renderers/DateCellRenderer.d.ts +32 -0
- package/dist/src/components/Grid/renderers/constants.d.ts +3 -0
- package/dist/src/components/Grid/renderers/utils.d.ts +2 -0
- package/dist/src/components/Grid/renderers/utils.spec.d.ts +1 -0
- package/dist/src/components/Input/Input.d.ts +2 -0
- package/dist/src/components/InputPopup/InputPopup.d.ts +6 -2
- package/dist/src/components/NoDataContent/NoDataContent.d.ts +3 -0
- package/dist/src/components/Search/Search.d.ts +2 -0
- package/dist/src/components/Select/MultiSelectTags.d.ts +2 -2
- package/dist/src/components/Select/Select.d.ts +7 -0
- package/dist/src/components/Select/constants.d.ts +1 -1
- package/dist/src/components/SelectField/SelectField.d.ts +5 -0
- package/dist/src/components/Steps/tests/utils.spec.d.ts +1 -0
- package/dist/src/components/Tab/Tab.d.ts +1 -4
- package/dist/src/components/Tabs/Tabs.d.ts +27 -14
- package/dist/src/components/Tag/Tag.d.ts +2 -2
- package/dist/src/components/Tooltip/TooltipContent.d.ts +5 -2
- package/dist/src/components/Tooltip/TooltipTrigger.d.ts +6 -4
- package/dist/src/hooks/use-flexible-actions.d.ts +86 -0
- package/dist/src/hooks/use-is-mobile-screen.d.ts +15 -0
- package/dist/src/hooks/use-screen-type.d.ts +19 -0
- package/dist/src/index.d.ts +8 -4
- package/dist/src/models/dropdown.d.ts +2 -2
- package/dist/src/models/select.d.ts +1 -0
- package/dist/src/models/tab.d.ts +1 -0
- package/dist/src/types/file-manager.d.ts +13 -0
- package/dist/src/types/flexible-actions.d.ts +4 -0
- package/dist/src/types/screen.d.ts +6 -0
- package/dist/src/types/select.d.ts +8 -0
- package/dist/src/types/tab.d.ts +4 -0
- package/dist/src/utils/merge-classes.spec.d.ts +1 -0
- package/dist/src/utils/mobile.d.ts +35 -0
- package/package.json +8 -8
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DialFile } from '../../../models/file';
|
|
2
|
+
import { DialCopiedItem } from '../../../types/file-manager';
|
|
3
|
+
export interface UseFileClipboardOptions {
|
|
4
|
+
getDestination: () => string;
|
|
5
|
+
getDestinationFiles: () => DialFile[];
|
|
6
|
+
getSourceFiles: () => DialFile[];
|
|
7
|
+
onCopyFiles?: (items: DialCopiedItem[]) => void;
|
|
8
|
+
onMoveToFiles?: (items: DialCopiedItem[]) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const useFileClipboard: ({ getDestination, getDestinationFiles, getSourceFiles, onCopyFiles, onMoveToFiles, }: UseFileClipboardOptions) => {
|
|
11
|
+
state: {
|
|
12
|
+
copied: Set<string>;
|
|
13
|
+
cut: Set<string>;
|
|
14
|
+
hasItems: boolean;
|
|
15
|
+
};
|
|
16
|
+
copy: (files: string[]) => void;
|
|
17
|
+
cut: (files: string[]) => void;
|
|
18
|
+
paste: (overwrite?: boolean) => void;
|
|
19
|
+
clear: () => void;
|
|
20
|
+
};
|
|
@@ -3,3 +3,4 @@ export declare const findFolderForPath: (root: DialFile[] | undefined, path?: st
|
|
|
3
3
|
export declare const normalizeToLowerCase: (input?: string) => string;
|
|
4
4
|
export declare const normalizeExtensionWithoutDot: (input?: string) => string;
|
|
5
5
|
export declare const collectAllDescendants: (folder?: DialFile) => DialFile[];
|
|
6
|
+
export declare const isHiddenDotFile: (node: DialFile) => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ColDef, GridOptions } from 'ag-grid-community';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { DropdownItem } from '../../models/dropdown';
|
|
3
4
|
export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
4
5
|
columnDefs?: ColDef<T>[];
|
|
@@ -14,6 +15,9 @@ export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
|
14
15
|
getRowId?: (row: T) => string;
|
|
15
16
|
alternateOddRowColors?: boolean;
|
|
16
17
|
filterPlaceholder?: string;
|
|
18
|
+
emptyStateIcon?: ReactNode;
|
|
19
|
+
emptyStateTitle?: string;
|
|
20
|
+
emptyStateDescription?: string;
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* DialGrid — A feature-rich data grid wrapper built on ag-Grid with dark theme support.
|
|
@@ -86,5 +90,9 @@ export interface DialGridProps<T extends object = Record<string, unknown>> {
|
|
|
86
90
|
* @param [getRowId] - Function to extract unique ID from a row object (defaults to 'id' field)
|
|
87
91
|
* @param [alternateOddRowColors=false] - Whether to alternate background colors for odd/even rows
|
|
88
92
|
* @param [filterPlaceholder='Enter value'] - Placeholder text for column filter inputs
|
|
93
|
+
* @param [emptyStateIcon] - Optional icon for empty state
|
|
94
|
+
* @param [emptyStateTitle] - Optional title text displayed when the grid has no rows to show.
|
|
95
|
+
* @param [emptyStateDescription] - Optional description text displayed below the empty state title,
|
|
96
|
+
* providing additional context or instructions (e.g., “No data found” or “Try adjusting your filters”).
|
|
89
97
|
*/
|
|
90
|
-
export declare const DialGrid: <T extends object>({ columnDefs, rowData, additionalGridOptions, getContextMenuItems, cssClass, ariaLabel, withSelectionColumn, wrapCustomCellRenderers, selectedRowIds, onSelectionChange, getRowId, alternateOddRowColors, filterPlaceholder, }: DialGridProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ICellRendererParams } from 'ag-grid-community';
|
|
3
|
+
export type DateValue = string | number | Date;
|
|
4
|
+
export interface DialDateCellRendererProps extends Partial<ICellRendererParams<Record<string, unknown>, DateValue>> {
|
|
5
|
+
value?: DateValue | null;
|
|
6
|
+
locale?: string;
|
|
7
|
+
options?: Intl.DateTimeFormatOptions;
|
|
8
|
+
emptyPlaceholder?: string;
|
|
9
|
+
cssClass?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Minimal date cell renderer (ag-Grid compatible).
|
|
13
|
+
*
|
|
14
|
+
* Renders the value in the **"MMM dd, yyyy"** format (e.g., "Jul 20, 2025"),
|
|
15
|
+
* wrapped in `DialEllipsisTooltip` (tooltip only appears if truncated).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // ag-Grid colDef
|
|
20
|
+
* { field: 'createdAt', cellRenderer: DateCellRenderer, cellRendererParams: { options: { timeZone: 'UTC' } } }
|
|
21
|
+
*
|
|
22
|
+
* // Direct usage
|
|
23
|
+
* <DateCellRenderer value="2025-07-20T00:00:00Z" options={{ timeZone: 'UTC' }} />
|
|
24
|
+
* <DateCellRenderer value={1752969600000} options={{ timeZone: 'UTC' }} /> // milliseconds
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param [locale='en-US'] - Locale fixed to U.S. English by default to enforce "Jul 20, 2025".
|
|
28
|
+
* @param [options={ year: 'numeric', month: 'numeric', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', timeZone: 'UTC' }] - Options for date formatting (e.g., timeZone).
|
|
29
|
+
* @param [emptyPlaceholder='—'] - Placeholder when value is empty/invalid.
|
|
30
|
+
* @param [cssClass] - Additional classes merged into the wrapper.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DialDateCellRenderer: FC<DialDateCellRendererProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,6 +7,7 @@ export interface DialInputProps extends InputBaseProps, Partial<NumberInputBaseP
|
|
|
7
7
|
hideBorder?: boolean;
|
|
8
8
|
tooltipText?: string;
|
|
9
9
|
tooltipTriggerClassName?: string;
|
|
10
|
+
hideTooltip?: boolean;
|
|
10
11
|
onChange?: (value?: string) => void;
|
|
11
12
|
onBlur?: (event: FocusEvent<HTMLInputElement, Element>) => void;
|
|
12
13
|
}
|
|
@@ -34,6 +35,7 @@ export interface DialInputProps extends InputBaseProps, Partial<NumberInputBaseP
|
|
|
34
35
|
* @param hideBorder - Whether to hide the input border styling
|
|
35
36
|
* @param tooltipText - The text to display inside the tooltip. If empty, the tooltip will display the value prop.
|
|
36
37
|
* @param tooltipTriggerClassName - Additional CSS classes to apply to the tooltip
|
|
38
|
+
* @param hideTooltip - Whether to hide the tooltip
|
|
37
39
|
* @param onChange - Callback function called when the input value changes
|
|
38
40
|
* @param onBlur - Callback function called when the input blurs
|
|
39
41
|
*/
|
|
@@ -7,9 +7,11 @@ export interface DialInputPopupProps {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
valueCssClasses?: string;
|
|
9
9
|
inputCssClasses?: string;
|
|
10
|
+
placeholder?: string;
|
|
10
11
|
elementId?: string;
|
|
11
12
|
errorText?: string;
|
|
12
|
-
|
|
13
|
+
invalid?: boolean;
|
|
14
|
+
emptyValueText?: string;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* An input field that opens a popup when clicked, displaying a selected value or a list of values.
|
|
@@ -35,6 +37,7 @@ export interface DialInputPopupProps {
|
|
|
35
37
|
*
|
|
36
38
|
* @param [open] - The current state of the modal, indicating whether it is opened or closed.
|
|
37
39
|
* @param [selectedValue] - The currently selected value(s). Can be a string for a single value or an array of strings for multiple values.
|
|
40
|
+
* @param [placeholder] - Placeholder text displayed when no value is selected.
|
|
38
41
|
* @param children - The content to render inside the modal when it is opened.
|
|
39
42
|
* @param onOpen - A callback function triggered when the modal open button is clicked.
|
|
40
43
|
* @param [disabled=false] - Whether the input is disabled, preventing user interaction.
|
|
@@ -42,6 +45,7 @@ export interface DialInputPopupProps {
|
|
|
42
45
|
* @param [inputCssClasses] - Additional CSS classes applied to the input container.
|
|
43
46
|
* @param [elementId] - A unique identifier for the input element, useful for accessibility and testing.
|
|
44
47
|
* @param [errorText] - An optional error message displayed below the input when an error state is present.
|
|
45
|
-
* @param
|
|
48
|
+
* @param [invalid] - Whether the input is in an invalid state, affecting styling. Applyed automatically if errorText is provided.
|
|
49
|
+
* @param [emptyValueText] - The text displayed when no value is selected and placeholder is not provided.
|
|
46
50
|
*/
|
|
47
51
|
export declare const DialInputPopup: FC<DialInputPopupProps>;
|
|
@@ -3,6 +3,9 @@ export interface DialNoDataContentProps {
|
|
|
3
3
|
icon?: ReactNode;
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
containerCssClass?: string;
|
|
7
|
+
titleCssClass?: string;
|
|
8
|
+
descriptionCssClass?: string;
|
|
6
9
|
}
|
|
7
10
|
/**
|
|
8
11
|
* A component for displaying a message and icon when there is no data to show.
|
|
@@ -11,6 +11,7 @@ export interface DialSearchProps {
|
|
|
11
11
|
containerCssClass?: string;
|
|
12
12
|
onChange?: (value: string) => void;
|
|
13
13
|
size?: SearchSize;
|
|
14
|
+
allowClear?: boolean;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* A search input component with a customizable placeholder, icons, flexible props, and the ability
|
|
@@ -38,5 +39,6 @@ export interface DialSearchProps {
|
|
|
38
39
|
* @param [containerCssClass] - Additional CSS classes applied to the container
|
|
39
40
|
* @param [onChange] - Callback fired when the input value changes
|
|
40
41
|
* @param [size=SearchSize.Base] - The size of the search input. Uses the {@link SearchSize} enum.
|
|
42
|
+
* @param [allowClear=true] - Whether to show a clear button when there is a value
|
|
41
43
|
*/
|
|
42
44
|
export declare const DialSearch: FC<DialSearchProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SelectOption } from '../../models/select';
|
|
2
|
-
import { MouseEvent } from 'react';
|
|
2
|
+
import { FC, MouseEvent } from 'react';
|
|
3
3
|
export interface DialMultiSelectTagsProps {
|
|
4
4
|
options: SelectOption[];
|
|
5
5
|
selectedValues: string[];
|
|
6
6
|
handleRemoveTag?: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, val: string) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare const DialMultiSelectTags:
|
|
8
|
+
export declare const DialMultiSelectTags: FC<DialMultiSelectTagsProps>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { FC, ReactNode, MouseEvent } from 'react';
|
|
2
2
|
import { SelectOption } from '../../models/select';
|
|
3
|
+
import { SelectSize, SelectVariant } from '../../types/select';
|
|
3
4
|
export interface DialSelectProps {
|
|
4
5
|
options: SelectOption[];
|
|
5
6
|
multiple?: boolean;
|
|
7
|
+
size?: SelectSize;
|
|
8
|
+
variant?: SelectVariant;
|
|
6
9
|
value?: string | string[];
|
|
10
|
+
prefix?: string;
|
|
7
11
|
defaultValue?: string | string[];
|
|
8
12
|
placeholder?: string;
|
|
9
13
|
searchable?: boolean;
|
|
@@ -16,6 +20,8 @@ export interface DialSelectProps {
|
|
|
16
20
|
disabled?: boolean;
|
|
17
21
|
cssClass?: string;
|
|
18
22
|
closable?: boolean;
|
|
23
|
+
header?: ReactNode | (() => ReactNode);
|
|
24
|
+
footer?: ReactNode | (() => ReactNode);
|
|
19
25
|
onClose?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
20
26
|
onChange?: (next: string | string[]) => void;
|
|
21
27
|
}
|
|
@@ -43,6 +49,7 @@ export interface DialSelectProps {
|
|
|
43
49
|
* @param options - Array of options to select from.
|
|
44
50
|
* @param [multiple] - Whether multiple selections are allowed.
|
|
45
51
|
* @param [value] - Controlled selected value(s).
|
|
52
|
+
* @param [prefix] - Prefix for selected value(s).
|
|
46
53
|
* @param [defaultValue] - Uncontrolled initial selected value(s).
|
|
47
54
|
* @param [placeholder] - Placeholder text when no selection is made.
|
|
48
55
|
* @param [searchable] - Whether to show a search input to filter options.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const selectTriggerBaseClasses = "dial-input flex
|
|
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";
|
|
@@ -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`
|
|
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
|
|
12
|
-
*
|
|
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
|
-
*
|
|
16
|
-
*
|
|
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
|
-
*
|
|
19
|
-
*
|
|
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
|
|
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] -
|
|
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
|
|
42
|
-
*
|
|
43
|
-
* -
|
|
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:
|
|
6
|
+
remove?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
7
7
|
variant?: TagVariant;
|
|
8
8
|
iconBefore?: ReactNode;
|
|
9
9
|
bordered?: boolean;
|
|
@@ -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:
|
|
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:
|
|
9
|
-
|
|
10
|
-
}, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
11
|
+
export declare const DialTooltipTrigger: FC<TooltipTriggerProps>;
|
|
12
|
+
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;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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,18 @@ 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 {
|
|
65
|
+
export { SelectSize, SelectVariant } from './types/select';
|
|
66
|
+
export { DialFileManagerTabs, DialFileManagerActions, type DialCopiedItem, } from './types/file-manager';
|
|
67
|
+
export { FlexibleActionsDirection } from './types/flexible-actions';
|
|
66
68
|
export { useDialFileManagerTabs } from './components/FileManager/hooks/use-file-manager-tabs';
|
|
69
|
+
export { FileManagerProvider } from './components/FileManager/FileManagerProvider';
|
|
70
|
+
export { useFileManagerContext } from './components/FileManager/hooks/use-file-manager-context';
|
|
67
71
|
export { StepStatus } from './models/step';
|
|
68
72
|
export type { Step } from './models/step';
|
|
69
73
|
export type { RadioButtonWithContent } from './models/radio';
|
|
@@ -72,5 +76,5 @@ export type { TabModel } from './models/tab';
|
|
|
72
76
|
export type { DropdownItem } from './models/dropdown';
|
|
73
77
|
export type { DialModifiedEntity } from './models/base-entity';
|
|
74
78
|
export type { DialFile } from './models/file';
|
|
75
|
-
export
|
|
79
|
+
export { DialFileNodeType, DialFilePermission, DialFileResourceType, } from './models/file';
|
|
76
80
|
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:
|
|
12
|
+
domEvent: MouseEvent<Element, MouseEvent>;
|
|
13
13
|
}) => void;
|
|
14
14
|
}
|
package/dist/src/models/tab.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
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
|
+
}
|
|
13
|
+
export interface DialCopiedItem {
|
|
14
|
+
sourceUrl: string;
|
|
15
|
+
destinationUrl: string;
|
|
16
|
+
overwrite?: boolean;
|
|
17
|
+
nodeType: DialFileNodeType;
|
|
18
|
+
}
|