@epam/ai-dial-ui-kit 0.3.0-rc.8 → 0.3.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.
- package/dist/dial-ui-kit.cjs.js +2 -1
- package/dist/dial-ui-kit.es.js +5796 -2050
- package/dist/index.css +2 -2
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +41 -0
- package/dist/src/components/Breadcrumb/BreadcrumbItem.d.ts +13 -0
- package/dist/src/components/Breadcrumb/constants.d.ts +9 -0
- package/dist/src/components/ButtonDropdown/ButtonDropdown.d.ts +23 -0
- package/dist/src/components/ButtonDropdown/constants.d.ts +2 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/src/components/ConfirmationPopup/ConfirmationPopup.d.ts +2 -2
- package/dist/src/components/ConfirmationPopup/constants.d.ts +1 -0
- package/dist/src/components/DraggableItem/DraggableItem.d.ts +31 -0
- package/dist/src/components/DraggableItem/constants.d.ts +3 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts +8 -0
- package/dist/src/components/Dropdown/constants.d.ts +1 -1
- package/dist/src/components/EllipsisTooltip/EllipsisTooltip.d.ts +31 -0
- package/dist/src/components/EllipsisTooltip/constants.d.ts +1 -0
- package/dist/src/components/Field/Field.d.ts +4 -2
- package/dist/src/components/FileIcon/FileIcon.d.ts +31 -0
- package/dist/src/components/FileIcon/constants.d.ts +9 -0
- package/dist/src/components/FileManagerNavigationPanel/FileManagerNavigationPanel.d.ts +58 -0
- package/dist/src/components/FileManagerNavigationPanel/constants.d.ts +3 -0
- package/dist/src/components/FileName/FileName.d.ts +20 -0
- package/dist/src/components/FolderName/FolderName.d.ts +21 -0
- package/dist/src/components/FoldersTree/FoldersTree.d.ts +92 -0
- package/dist/src/components/FoldersTree/constants.d.ts +5 -0
- package/dist/src/components/FormItem/FormItem.d.ts +64 -0
- package/dist/src/components/FormItem/constants.d.ts +3 -0
- package/dist/src/components/FormPopup/FormPopup.d.ts +44 -0
- package/dist/src/components/FormPopup/constants.d.ts +3 -0
- package/dist/src/components/Grid/Grid.d.ts +90 -0
- package/dist/src/components/Grid/comparators/base-column-comparator.d.ts +3 -0
- package/dist/src/components/Grid/constants.d.ts +26 -0
- package/dist/src/components/Grid/hooks/use-grid-selection.d.ts +12 -0
- package/dist/src/components/Icon/Icon.d.ts +1 -0
- package/dist/src/components/Input/Input.d.ts +18 -24
- package/dist/src/components/InputField/InputField.d.ts +23 -47
- package/dist/src/components/JsonEditor/JsonEditor.d.ts +2 -2
- package/dist/src/components/LoadFileArea/EmptyFileArea.d.ts +52 -0
- package/dist/src/components/LoadFileArea/FilledInput.d.ts +30 -0
- package/dist/src/components/LoadFileArea/LoadFileArea.d.ts +46 -0
- package/dist/src/components/LoadFileArea/LoadFileAreaField.d.ts +51 -0
- package/dist/src/components/PasswordInput/PasswordInputField.d.ts +1 -1
- package/dist/src/components/RadioGroup/RadioGroup.d.ts +19 -4
- package/dist/src/components/RemoveButton/RemoveButton.d.ts +24 -0
- package/dist/src/components/Select/MultiSelectTags.d.ts +8 -0
- package/dist/src/components/Select/Select.d.ts +61 -0
- package/dist/src/components/Select/constants.d.ts +8 -0
- package/dist/src/components/SelectField/SelectField.d.ts +35 -0
- package/dist/src/components/SharedEntityIndicator/SharedEntityIndicator.d.ts +25 -0
- package/dist/src/components/Tab/Tab.d.ts +35 -0
- package/dist/src/components/Tabs/Tabs.d.ts +46 -0
- package/dist/src/components/Tabs/constants.d.ts +1 -0
- package/dist/src/components/Tag/Tag.d.ts +4 -1
- package/dist/src/components/TextAreaField/TextAreaField.d.ts +4 -2
- package/dist/src/components/Textarea/Textarea.d.ts +4 -0
- package/dist/src/components/Tooltip/TooltipContext.d.ts +4 -4
- package/dist/src/constants/storybook/form-item.d.ts +3 -0
- package/dist/src/constants/storybook/input.d.ts +5 -0
- package/dist/src/hooks/use-is-tablet-screen.d.ts +15 -0
- package/dist/src/index.d.ts +28 -0
- package/dist/src/models/base-entity.d.ts +4 -0
- package/dist/src/models/breadcrumb.d.ts +9 -0
- package/dist/src/models/field-control-props.d.ts +34 -2
- package/dist/src/models/file.d.ts +35 -0
- package/dist/src/models/select.d.ts +7 -0
- package/dist/src/models/tab.d.ts +5 -0
- package/dist/src/types/form-item.d.ts +33 -0
- package/dist/src/types/tab.d.ts +4 -0
- package/dist/src/utils/merge-classes.d.ts +3 -0
- package/dist/src/utils/mobile.d.ts +14 -0
- package/package.json +14 -10
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { DialEmptyFileAreaProps } from './EmptyFileArea';
|
|
3
|
+
export interface DialLoadFileAreaProps extends DialEmptyFileAreaProps {
|
|
4
|
+
files?: File[];
|
|
5
|
+
dynamicIcon?: (name: string) => ReactNode;
|
|
6
|
+
iconBeforeInput?: ReactNode;
|
|
7
|
+
isInvalid?: (file: File) => boolean;
|
|
8
|
+
errorText?: string;
|
|
9
|
+
removeButtonAriaLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A drag-and-drop file upload area component that allows users to upload files
|
|
13
|
+
* either by dragging them into the area or by selecting them through the file picker.
|
|
14
|
+
* Displays helpful text, button prompts, and validation errors for file format or count limits.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <DialEmptyFileArea
|
|
19
|
+
* onChange={(files) => console.log(files)}
|
|
20
|
+
* emptyTextFirstLine="Drag & drop your files here"
|
|
21
|
+
* emptyTextSecondLine="or click the button below to upload"
|
|
22
|
+
* emptyButtonLabel="Upload files"
|
|
23
|
+
* acceptTypes="application/pdf, application/txt, image/svg+xml"
|
|
24
|
+
* maxFilesCount={5}
|
|
25
|
+
* isMultiple
|
|
26
|
+
* fileFormatError="Unsupported file format"
|
|
27
|
+
* fileCountError="You can upload up to 5 files only"
|
|
28
|
+
* getIsFileFormatError={(files) => files.some(file => !file.name.endsWith('.jpg') && !file.name.endsWith('.png'))}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param {DialEmptyFileAreaProps} props - The properties for the empty file area component.
|
|
33
|
+
* @param {(files: File[]) => void} props.onChange - Callback fired when valid files are selected or dropped.
|
|
34
|
+
* @param {string} [props.emptyTextFirstLine] - Optional text displayed as the first line in the empty area.
|
|
35
|
+
* @param {string} [props.emptyTextSecondLine] - Optional text displayed as the second line in the empty area.
|
|
36
|
+
* @param {string} [props.emptyButtonLabel] - Label text for the upload button.
|
|
37
|
+
* @param {string} [props.acceptTypes] - Comma-separated list of accepted file MIME types (e.g., "application/pdf").
|
|
38
|
+
* @param {number} [props.maxFilesCount] - Maximum allowed number of files to upload at once.
|
|
39
|
+
* @param {boolean} [props.multiple=false] - Whether multiple file uploads are allowed.
|
|
40
|
+
* @param {string} [props.fileFormatError] - Error message displayed when an invalid file format is detected.
|
|
41
|
+
* @param {string} [props.fileCountError] - Error message displayed when the file count exceeds the limit.
|
|
42
|
+
* @param {(files: File[]) => boolean} [props.getIsFileFormatError] - Optional validation callback that checks whether selected files have valid formats.
|
|
43
|
+
*
|
|
44
|
+
* @returns {JSX.Element} The rendered drag-and-drop file upload area with optional validation feedback.
|
|
45
|
+
*/
|
|
46
|
+
export declare const DialLoadFileArea: FC<DialLoadFileAreaProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DialLoadFileAreaProps } from './LoadFileArea';
|
|
3
|
+
export interface DialLoadFileAreaFieldProps extends DialLoadFileAreaProps {
|
|
4
|
+
fieldTitle: string;
|
|
5
|
+
elementId: string;
|
|
6
|
+
deleteAllButtonLabel?: string;
|
|
7
|
+
addButtonLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A composite file upload field that combines a label, file list management,
|
|
11
|
+
* and a drag-and-drop upload area. Allows users to add, remove, and validate files
|
|
12
|
+
* with customizable restrictions on file types and count.
|
|
13
|
+
*
|
|
14
|
+
* The component displays a header showing the field title and file count,
|
|
15
|
+
* along with "Add" and "Delete All" buttons (when multiple uploads are enabled).
|
|
16
|
+
* It integrates with `DialLoadFileArea` for drag-and-drop functionality and
|
|
17
|
+
* provides file validation for both format and maximum file count.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <DialLoadFileAreaField
|
|
22
|
+
* fieldTitle="Attachments"
|
|
23
|
+
* elementId="attachments"
|
|
24
|
+
* files={uploadedFiles}
|
|
25
|
+
* onChange={setUploadedFiles}
|
|
26
|
+
* maxFilesCount={5}
|
|
27
|
+
* acceptTypes="image/png,image/jpeg"
|
|
28
|
+
* fileFormatError="Only PNG and JPEG images are allowed"
|
|
29
|
+
* fileCountError="You can upload up to 5 files"
|
|
30
|
+
* deleteAllButtonLabel="Remove all"
|
|
31
|
+
* addButtonLabel="Add more"
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param {DialLoadFileAreaFieldProps} props - The properties for the file area field component.
|
|
36
|
+
* @param {(files: File[]) => void} props.onChange - Callback fired when files are added or removed.
|
|
37
|
+
* @param {string} props.fieldTitle - The label displayed above the file upload area.
|
|
38
|
+
* @param {string} props.elementId - The unique `id` used for accessibility and input association.
|
|
39
|
+
* @param {File[]} [props.files] - The list of currently selected or uploaded files.
|
|
40
|
+
* @param {number} [props.maxFilesCount] - The maximum number of files allowed.
|
|
41
|
+
* @param {string} [props.fileFormatError] - Error message shown for invalid file formats.
|
|
42
|
+
* @param {string} [props.fileCountError] - Error message shown when exceeding the file count limit.
|
|
43
|
+
* @param {boolean} [props.multiple=true] - Whether multiple file uploads are allowed.
|
|
44
|
+
* @param {string} [props.acceptTypes] - Comma-separated list of allowed MIME types or file extensions.
|
|
45
|
+
* @param {string} [props.deleteAllButtonLabel] - Label for the "Delete All" button shown when files exist.
|
|
46
|
+
* @param {string} [props.addButtonLabel] - Label for the "Add" button used to select additional files.
|
|
47
|
+
* @param {object} [props.props] - Additional props passed to the underlying `DialLoadFileArea`.
|
|
48
|
+
*
|
|
49
|
+
* @returns {JSX.Element} A file upload field with label, action buttons, and a drag-and-drop area.
|
|
50
|
+
*/
|
|
51
|
+
export declare const DialLoadFileAreaField: FC<DialLoadFileAreaFieldProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { DialInputFieldBaseProps } from '../InputField/InputField';
|
|
3
3
|
export interface DialPasswordInputFieldProps extends DialInputFieldBaseProps {
|
|
4
|
-
onChange?: (value
|
|
4
|
+
onChange?: (value?: string) => void;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* A password input field component with label, error text, and show/hide functionality.
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { RadioGroupOrientation } from '../../types/radio-group';
|
|
3
2
|
import { RadioButtonWithContent } from '../../models/radio';
|
|
3
|
+
import { RadioGroupOrientation } from '../../types/radio-group';
|
|
4
4
|
export interface DialRadioGroupProps {
|
|
5
5
|
fieldTitle?: string;
|
|
6
6
|
elementId: string;
|
|
7
|
-
radioCssClass?: string;
|
|
8
|
-
labelCssClass?: string;
|
|
9
7
|
disabled?: boolean;
|
|
10
8
|
radioButtons: RadioButtonWithContent[];
|
|
11
9
|
activeRadioButton: string;
|
|
12
10
|
orientation: RadioGroupOrientation;
|
|
13
11
|
onChange: (radioId: string) => void;
|
|
12
|
+
radioCssClass?: string;
|
|
13
|
+
groupLabelCssClass?: string;
|
|
14
|
+
labelCssClass?: string;
|
|
15
|
+
containerCssClass?: string;
|
|
16
|
+
formItemChildrenCssClass?: string;
|
|
17
|
+
selectedItemCssClass?: string;
|
|
18
|
+
selectedLabelCssClass?: string;
|
|
19
|
+
radioGroupCssClass?: string;
|
|
20
|
+
inputContainerCssClass?: string;
|
|
21
|
+
selectedInputContainerCssClass?: string;
|
|
14
22
|
}
|
|
15
23
|
/**
|
|
16
24
|
* Groups multiple `DialRadio` options and renders custom content for the active option.
|
|
@@ -36,7 +44,15 @@ export interface DialRadioGroupProps {
|
|
|
36
44
|
* @param [fieldTitle] - Optional label rendered by `DialField`
|
|
37
45
|
* @param elementId - Name for the underlying radio group; also used for input `name`
|
|
38
46
|
* @param [radioCssClass] - Additional classes applied to each radio input
|
|
47
|
+
* @param [inputContainerCssClass] - Additional classes applied to each radio input's container
|
|
48
|
+
* @param [selectedInputContainerCssClass] - Additional classes applied to the selected radio input's container
|
|
49
|
+
* @param [groupLabelCssClass] - Optional classes applied to the group label. If not provided, `labelCssClass` will be used.
|
|
50
|
+
* @param [formItemChildrenCssClass] - Additional classes applied to the DialFormItem's children container
|
|
39
51
|
* @param [labelCssClass] - Additional classes applied to each radio label
|
|
52
|
+
* @param [containerCssClass] - Additional classes applied to the outer container
|
|
53
|
+
* @param [selectedItemCssClass] - Additional classes applied to the selected option's content container
|
|
54
|
+
* @param [selectedLabelCssClass] - Additional classes applied to the selected option's label
|
|
55
|
+
* @param [radioGroupCssClass] - Additional classes applied to the radio group container
|
|
40
56
|
* @param [disabled] - Disables all child radios when set
|
|
41
57
|
* @param radioButtons - Array of options with ids, labels, and optional content
|
|
42
58
|
* @param activeRadioButton - The id of the currently selected radio
|
|
@@ -44,4 +60,3 @@ export interface DialRadioGroupProps {
|
|
|
44
60
|
* @param onChange - Callback fired with the selected radio id
|
|
45
61
|
*/
|
|
46
62
|
export declare const DialRadioGroup: FC<DialRadioGroupProps>;
|
|
47
|
-
export default DialRadioGroup;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC, MouseEvent } from 'react';
|
|
2
|
+
export interface DialRemoveButtonProps {
|
|
3
|
+
iconClass?: string;
|
|
4
|
+
cssClass?: string;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
onClick: (e: MouseEvent) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A specialized button component for removal or delete actions.
|
|
10
|
+
*
|
|
11
|
+
* Renders a `DialButton` with a predefined trash icon (`IconTrashX`) as the leading icon.
|
|
12
|
+
* Additional props are passed directly to the underlying `DialButton`.
|
|
13
|
+
* @example
|
|
14
|
+
* <DialRemoveButton
|
|
15
|
+
* label="Delete item"
|
|
16
|
+
* onClick={handleDelete}
|
|
17
|
+
* iconClass="text-error"
|
|
18
|
+
* />
|
|
19
|
+
* @component
|
|
20
|
+
* @param {DialRemoveButtonProps} props - The properties for the remove button component.
|
|
21
|
+
* @param {string} [props.iconClass] - Optional CSS class applied to the trash icon for styling or sizing.
|
|
22
|
+
* @returns {JSX.Element} The rendered remove button component.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DialRemoveButton: FC<DialRemoveButtonProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SelectOption } from '../../models/select';
|
|
2
|
+
import { MouseEvent } from 'react';
|
|
3
|
+
export interface DialMultiSelectTagsProps {
|
|
4
|
+
options: SelectOption[];
|
|
5
|
+
selectedValues: string[];
|
|
6
|
+
handleRemoveTag?: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, val: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const DialMultiSelectTags: React.FC<DialMultiSelectTagsProps>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { FC, ReactNode, MouseEvent } from 'react';
|
|
2
|
+
import { SelectOption } from '../../models/select';
|
|
3
|
+
export interface DialSelectProps {
|
|
4
|
+
options: SelectOption[];
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
value?: string | string[];
|
|
7
|
+
defaultValue?: string | string[];
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
searchable?: boolean;
|
|
10
|
+
searchPlaceholder?: string;
|
|
11
|
+
selectAll?: boolean;
|
|
12
|
+
selectAllLabel?: string;
|
|
13
|
+
emptyStateTitle?: string;
|
|
14
|
+
emptyStateDescription?: string;
|
|
15
|
+
emptyStateIcon?: ReactNode;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
cssClass?: string;
|
|
18
|
+
closable?: boolean;
|
|
19
|
+
onClose?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
20
|
+
onChange?: (next: string | string[]) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A versatile select supporting single and multiple selections.
|
|
24
|
+
*
|
|
25
|
+
* Single mode mirrors the legacy visual:
|
|
26
|
+
* - Trigger shows the selected option's leading icon + label.
|
|
27
|
+
* - In the list, the selected option is indicated by a LEFT border and tinted background
|
|
28
|
+
* (no check icon).
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <DialSelect
|
|
33
|
+
* options={[
|
|
34
|
+
* { value: 'option-1', label: 'Option 1' },
|
|
35
|
+
* { value: 'option-2', label: 'Option 2' },
|
|
36
|
+
* ]}
|
|
37
|
+
* multiple
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* Multiple mode uses checkboxes (including Select All with indeterminate state).
|
|
42
|
+
*
|
|
43
|
+
* @param options - Array of options to select from.
|
|
44
|
+
* @param [multiple] - Whether multiple selections are allowed.
|
|
45
|
+
* @param [value] - Controlled selected value(s).
|
|
46
|
+
* @param [defaultValue] - Uncontrolled initial selected value(s).
|
|
47
|
+
* @param [placeholder] - Placeholder text when no selection is made.
|
|
48
|
+
* @param [searchable] - Whether to show a search input to filter options.
|
|
49
|
+
* @param [searchPlaceholder] - Search Placeholder text shown when search input is empty
|
|
50
|
+
* @param [selectAll] - Whether to show a "Select All" checkbox in multiple mode.
|
|
51
|
+
* @param [selectAllLabel] - Label for the "Select All" checkbox.
|
|
52
|
+
* @param [emptyStateTitle] - Title text when there are no options to display.
|
|
53
|
+
* @param [emptyStateDescription] - Optional description text when there are no options.
|
|
54
|
+
* @param [emptyStateIcon] - Optional icon to display when there are no options.
|
|
55
|
+
* @param [disabled] - Whether the select is disabled.
|
|
56
|
+
* @param [cssClass] - Additional CSS classes to apply to the select trigger.
|
|
57
|
+
* @param [closable] - Whether to show a close button in the dropdown header.
|
|
58
|
+
* @param [onClose] - Callback when the dropdown is closed via the close button.
|
|
59
|
+
* @param [onChange] - Callback when the selection changes.
|
|
60
|
+
*/
|
|
61
|
+
export declare const DialSelect: FC<DialSelectProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
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]";
|
|
2
|
+
export declare const selectOverlayBaseClasses = "w-full rounded";
|
|
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
|
+
export declare const selectOptionSelectedClasses = "bg-accent-primary-alpha";
|
|
5
|
+
export declare const selectOptionSingleSelectedClasses = "bg-accent-primary-alpha border-l border-accent-primary border-1";
|
|
6
|
+
export declare const selectOptionDisabledClasses = "opacity-75";
|
|
7
|
+
export declare const selectChevronIcon: import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const selectCheckIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DialFormItemProps } from '../FormItem/FormItem';
|
|
3
|
+
import { DialSelectProps } from '../Select/Select';
|
|
4
|
+
import { DialFieldLabelProps } from '../Field/Field';
|
|
5
|
+
export interface DialSelectFieldProps extends Omit<DialSelectProps, 'cssClass'>, Omit<DialFieldLabelProps, 'htmlFor'>, Omit<DialFormItemProps, 'label' | 'children' | 'value'> {
|
|
6
|
+
selectCssClass?: string;
|
|
7
|
+
containerCssClass?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A Select field wrapper that composes `DialFormItem` and `DialSelect`.
|
|
11
|
+
*
|
|
12
|
+
* Provides unified label, description, error rendering and a readonly view that shows
|
|
13
|
+
* the selected option labels (comma-separated in single mode, list in multiple).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <DialSelectField
|
|
18
|
+
* elementId="transport"
|
|
19
|
+
* fieldTitle="Transport"
|
|
20
|
+
* options={[
|
|
21
|
+
* { value: 'SSE', label: 'Server-Sent Events (SSE)' },
|
|
22
|
+
* { value: 'WS', label: 'WebSocket' },
|
|
23
|
+
* ]}
|
|
24
|
+
* value="WS"
|
|
25
|
+
* onChange={(v) => setTransport(v as string)}
|
|
26
|
+
* />
|
|
27
|
+
*
|
|
28
|
+
* @param selectCssClass CSS class for the select element
|
|
29
|
+
* @param containerCssClass CSS class for the form item container
|
|
30
|
+
* @param emptyStateTitle Title to show when there are no options
|
|
31
|
+
* @param restSelectProps All other DialSelect props
|
|
32
|
+
* @param restFormItemProps All other DialFormItem props
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const DialSelectField: FC<DialSelectFieldProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface DialSharedEntityIndicatorProps {
|
|
3
|
+
label?: string;
|
|
4
|
+
size?: number;
|
|
5
|
+
cssClass?: string;
|
|
6
|
+
stroke?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A compact icon-only indicator to denote a "shared" entity.
|
|
10
|
+
*
|
|
11
|
+
* Renders a small arrow-up-right icon with token-based colors.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <DialSharedEntityIndicator />
|
|
16
|
+
* <DialSharedEntityIndicator size={12} label="Opens in new window" />
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param [label="Shared entity"] - Accessible label for assistive tech
|
|
20
|
+
* @param [size=10] - Pixel size for the icon
|
|
21
|
+
* @param [cssClass] - Additional Tailwind classes appended to the container
|
|
22
|
+
* @param [stroke=2] - Stroke width for the icon
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
export declare const DialSharedEntityIndicator: FC<DialSharedEntityIndicatorProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TabModel } from '../../models/tab';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export interface DialTabProps {
|
|
4
|
+
tab: TabModel;
|
|
5
|
+
active: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
horizontal?: boolean;
|
|
9
|
+
cssClass?: string;
|
|
10
|
+
onClick: (id: string) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A single tab element used within the {@link DialTabs} component.
|
|
14
|
+
* Supports active, disabled, and invalid states, and can render in
|
|
15
|
+
* horizontal or vertical orientations. Displays an optional error icon
|
|
16
|
+
* when marked as invalid.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <DialTab
|
|
21
|
+
* tab={{ id: 'overview', name: 'Overview' }}
|
|
22
|
+
* isActive={true}
|
|
23
|
+
* onClick={(id) => console.log('Selected tab:', id)}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param tab - The tab model containing its `id` and `name`.
|
|
28
|
+
* @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
|
+
* @param [horizontal=false] - Whether the tab is displayed in horizontal orientation.
|
|
32
|
+
* @param [cssClass] - Additional CSS classes applied to the tab element.
|
|
33
|
+
* @param onClick - Callback fired when the tab is clicked. Receives the tab’s `id`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const DialTab: FC<DialTabProps>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { TabModel } from '../../models/tab';
|
|
3
|
+
import { TabOrientation } from '../../types/tab';
|
|
4
|
+
export interface DialTabsProps {
|
|
5
|
+
tabs: TabModel[];
|
|
6
|
+
activeTab: string;
|
|
7
|
+
onClick: (id: string) => void;
|
|
8
|
+
orientation?: TabOrientation;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
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
|
+
*
|
|
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
|
+
*
|
|
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.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <DialTabs
|
|
24
|
+
* tabs={[
|
|
25
|
+
* { id: 'overview', label: 'Overview' },
|
|
26
|
+
* { id: 'details', label: 'Details' },
|
|
27
|
+
* { id: 'settings', label: 'Settings', invalid: true },
|
|
28
|
+
* ]}
|
|
29
|
+
* activeTab="overview"
|
|
30
|
+
* onClick={(id) => setActiveTab(id)}
|
|
31
|
+
* orientation={TabOrientation.Horizontal}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param tabs - Array of tab models to render. Each tab should include an `id` and `label`.
|
|
36
|
+
* @param activeTab - The identifier of the currently active tab.
|
|
37
|
+
* @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.
|
|
39
|
+
*
|
|
40
|
+
* @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.
|
|
45
|
+
*/
|
|
46
|
+
export declare const DialTabs: FC<DialTabsProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DESKTOP_TABS_GAP_PX = 12;
|
|
@@ -3,9 +3,10 @@ import { FC, ReactNode } from 'react';
|
|
|
3
3
|
export interface DialTagProps {
|
|
4
4
|
tag: string;
|
|
5
5
|
cssClass?: string;
|
|
6
|
-
remove?: () => void;
|
|
6
|
+
remove?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
7
7
|
variant?: TagVariant;
|
|
8
8
|
iconBefore?: ReactNode;
|
|
9
|
+
bordered?: boolean;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* A small tag component used to display labeled items such as categories, filters, or selections.
|
|
@@ -25,5 +26,7 @@ export interface DialTagProps {
|
|
|
25
26
|
* @param [remove] - Optional callback invoked when the remove button is clicked.
|
|
26
27
|
* If not provided, the remove button will not be rendered.
|
|
27
28
|
* @param [variant=TagVariant.Default] - Visual style of the tag. Uses the {@link TagVariant} enum.
|
|
29
|
+
* @param [iconBefore] - Optional icon or element to display before the tag text.
|
|
30
|
+
* @param [bordered=true] - When true, adds a border to the tag for better visibility on light backgrounds.
|
|
28
31
|
*/
|
|
29
32
|
export declare const DialTag: FC<DialTagProps>;
|
|
@@ -2,6 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { DialInputFieldBaseProps } from '../InputField/InputField';
|
|
3
3
|
export interface DialTextAreaFieldProps extends DialInputFieldBaseProps {
|
|
4
4
|
onChange?: (value: string) => void;
|
|
5
|
+
disableTooltip?: boolean;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* A complete textarea field component that combines a field label, textarea input, and error text
|
|
@@ -26,14 +27,15 @@ export interface DialTextAreaFieldProps extends DialInputFieldBaseProps {
|
|
|
26
27
|
* @param [errorText] - Error message to display below the textarea
|
|
27
28
|
* @param [optional=false] - Whether to show optional indicator next to the label
|
|
28
29
|
* @param [readonly=false] - Whether the textarea is read-only (no user input allowed)
|
|
29
|
-
* @param [elementCssClass] - Additional CSS classes to apply to the textarea element
|
|
30
30
|
* @param [disabled=false] - Whether the input is disabled and cannot be interacted with
|
|
31
31
|
* @param [invalid=false] - Whether the input has validation errors (applies error styling)
|
|
32
32
|
* @param [defaultEmptyText="None"] - Text to display when readonly and value is empty
|
|
33
33
|
* @param [iconBefore] - Icon or element to display before the input
|
|
34
34
|
* @param [iconAfter] - Icon or element to display after the input
|
|
35
35
|
* @param [textBeforeInput] - Text to display before the input
|
|
36
|
-
* @param [
|
|
36
|
+
* @param [elementCssClass] - Additional CSS classes to apply to the textarea element
|
|
37
37
|
* @param [containerCssClass] - Additional CSS classes to apply to the outer container
|
|
38
|
+
* @param [elementContainerCssClass] - Additional CSS classes to apply to the textarea container
|
|
39
|
+
* @param [disableTooltip] - Whether to disable the tooltip that shows the full value on hover
|
|
38
40
|
*/
|
|
39
41
|
export declare const DialTextAreaField: FC<DialTextAreaFieldProps>;
|
|
@@ -4,9 +4,11 @@ export interface DialTextareaProps {
|
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
textareaId: string;
|
|
6
6
|
cssClass?: string;
|
|
7
|
+
containerCssClass?: string;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
invalid?: boolean;
|
|
9
10
|
readonly?: boolean;
|
|
11
|
+
disableTooltip?: boolean;
|
|
10
12
|
onChange?: (value: string) => void;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
@@ -27,8 +29,10 @@ export interface DialTextareaProps {
|
|
|
27
29
|
* @param [onChange] - Callback function called when the textarea value changes
|
|
28
30
|
* @param [placeholder] - Placeholder text displayed when textarea is empty
|
|
29
31
|
* @param [cssClass=""] - Additional CSS classes to apply to the textarea element
|
|
32
|
+
* @param [containerCssClass=""] - Additional CSS classes to apply to the container div
|
|
30
33
|
* @param [disabled=false] - Whether the textarea is disabled
|
|
31
34
|
* @param [readonly=false] - Whether the textarea is read-only (no user input allowed)
|
|
32
35
|
* @param [invalid=false] - Whether the textarea has validation errors (applies error styling)
|
|
36
|
+
* @param [disableTooltip] - Whether to disable the tooltip that shows the full value on hover
|
|
33
37
|
*/
|
|
34
38
|
export declare const DialTextarea: FC<DialTextareaProps>;
|
|
@@ -28,10 +28,10 @@ export declare const useTooltipContext: () => {
|
|
|
28
28
|
floating: HTMLElement | null;
|
|
29
29
|
} & import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
|
|
30
30
|
context: {
|
|
31
|
-
x: number;
|
|
32
|
-
y: number;
|
|
33
31
|
placement: Placement;
|
|
34
32
|
strategy: import('@floating-ui/utils').Strategy;
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
35
|
middlewareData: import('@floating-ui/core').MiddlewareData;
|
|
36
36
|
isPositioned: boolean;
|
|
37
37
|
update: () => void;
|
|
@@ -75,10 +75,10 @@ export declare const useTooltip: ({ initialOpen, placement, isTriggerClickable,
|
|
|
75
75
|
floating: HTMLElement | null;
|
|
76
76
|
} & import('@floating-ui/react').ExtendedElements<import('@floating-ui/react').ReferenceType>;
|
|
77
77
|
context: {
|
|
78
|
-
x: number;
|
|
79
|
-
y: number;
|
|
80
78
|
placement: Placement;
|
|
81
79
|
strategy: import('@floating-ui/utils').Strategy;
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
82
|
middlewareData: import('@floating-ui/core').MiddlewareData;
|
|
83
83
|
isPositioned: boolean;
|
|
84
84
|
update: () => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldControlProps, InputBaseProps, NumberInputBaseProps } from '../../models/field-control-props';
|
|
2
|
+
import { ArgTypes } from '@storybook/react';
|
|
3
|
+
export declare const fieldControlArgTypes: Partial<ArgTypes<FieldControlProps>>;
|
|
4
|
+
export declare const inputBaseArgTypes: Partial<ArgTypes<InputBaseProps>>;
|
|
5
|
+
export declare const numberInputBaseArgTypes: Partial<ArgTypes<NumberInputBaseProps>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A React hook that determines whether the current window size matches a tablet screen width.
|
|
3
|
+
*
|
|
4
|
+
* It initializes based on the current screen size using `isMediumScreen()` and updates its value
|
|
5
|
+
* whenever the window is resized.
|
|
6
|
+
*
|
|
7
|
+
* @returns {boolean} `true` if the viewport width matches the tablet breakpoint, otherwise `false`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const isTablet = useIsTabletScreen();
|
|
11
|
+
* if (isTablet) {
|
|
12
|
+
* console.log('Tablet layout active');
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
export declare const useIsTabletScreen: () => boolean;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,8 +11,20 @@ export { DialNoDataContent } from './components/NoDataContent/NoDataContent';
|
|
|
11
11
|
export { DialCollapsibleSidebar } from './components/CollapsibleSidebar/CollapsibleSidebar';
|
|
12
12
|
export { DialLabelledText } from './components/LabelledText/LabelledText';
|
|
13
13
|
export { DialTag } from './components/Tag/Tag';
|
|
14
|
+
export { DialEllipsisTooltip } from './components/EllipsisTooltip/EllipsisTooltip';
|
|
15
|
+
export { DialDraggableItem } from './components/DraggableItem/DraggableItem';
|
|
16
|
+
export { DialFileIcon } from './components/FileIcon/FileIcon';
|
|
17
|
+
export { DialFormItem } from './components/FormItem/FormItem';
|
|
18
|
+
export { DialSharedEntityIndicator } from './components/SharedEntityIndicator/SharedEntityIndicator';
|
|
19
|
+
export { DialFileName } from './components/FileName/FileName';
|
|
20
|
+
export { DialFolderName } from './components/FolderName/FolderName';
|
|
21
|
+
export { DialTabs } from './components/Tabs/Tabs';
|
|
22
|
+
export { DialTab } from './components/Tab/Tab';
|
|
23
|
+
export { DialBreadcrumb } from './components/Breadcrumb/Breadcrumb';
|
|
24
|
+
export { DialBreadcrumbItem } from './components/Breadcrumb/BreadcrumbItem';
|
|
14
25
|
export { DialButton } from './components/Button/Button';
|
|
15
26
|
export { DialCloseButton } from './components/CloseButton/CloseButton';
|
|
27
|
+
export { DialRemoveButton } from './components/RemoveButton/RemoveButton';
|
|
16
28
|
export { DialTextarea } from './components/Textarea/Textarea';
|
|
17
29
|
export { DialTextAreaField } from './components/TextAreaField/TextAreaField';
|
|
18
30
|
export { DialTooltip } from './components/Tooltip/Tooltip';
|
|
@@ -20,6 +32,8 @@ export { DialSwitch } from './components/Switch/Switch';
|
|
|
20
32
|
export { DialPopup } from './components/Popup/Popup';
|
|
21
33
|
export { DialConfirmationPopup } from './components/ConfirmationPopup/ConfirmationPopup';
|
|
22
34
|
export { DialRadioGroupPopupField } from './components/RadioGroupPopupField/RadioGroupPopupField';
|
|
35
|
+
export { DialFormPopup } from './components/FormPopup/FormPopup';
|
|
36
|
+
export { DialFileManagerNavigationPanel } from './components/FileManagerNavigationPanel/FileManagerNavigationPanel';
|
|
23
37
|
export { DialInput } from './components/Input/Input';
|
|
24
38
|
export type { DialInputProps } from './components/Input/Input';
|
|
25
39
|
export { DialNumberInputField } from './components/InputField/InputField';
|
|
@@ -31,7 +45,11 @@ export { DialInputPopup } from './components/InputPopup/InputPopup';
|
|
|
31
45
|
export { DialAutocompleteInput } from './components/AutocompleteInput/AutocompleteInput';
|
|
32
46
|
export { DialAutocompleteInputValue } from './components/AutocompleteInput/AutocompleteInputValue';
|
|
33
47
|
export { DialTagInput } from './components/TagInput/TagInput';
|
|
48
|
+
export { DialSelect } from './components/Select/Select';
|
|
49
|
+
export { DialSelectField } from './components/SelectField/SelectField';
|
|
50
|
+
export { DialLoadFileAreaField } from './components/LoadFileArea/LoadFileAreaField';
|
|
34
51
|
export { DialDropdown } from './components/Dropdown/Dropdown';
|
|
52
|
+
export { DialButtonDropdown } from './components/ButtonDropdown/ButtonDropdown';
|
|
35
53
|
export { AlertVariant } from './types/alert';
|
|
36
54
|
export { ButtonVariant } from './types/button';
|
|
37
55
|
export { RadioGroupOrientation } from './types/radio-group';
|
|
@@ -40,6 +58,16 @@ export { ConfirmationPopupVariant } from './types/confirmation-popup';
|
|
|
40
58
|
export { DropdownType } from './types/dropdown';
|
|
41
59
|
export { SearchSize } from './types/search';
|
|
42
60
|
export { TagVariant } from './types/tag';
|
|
61
|
+
export { TabOrientation } from './types/tab';
|
|
62
|
+
export type { DialBreadcrumbPathItem } from './models/breadcrumb';
|
|
63
|
+
export { FormItemOrientation } from './types/form-item';
|
|
43
64
|
export { StepStatus } from './models/step';
|
|
44
65
|
export type { Step } from './models/step';
|
|
45
66
|
export type { RadioButtonWithContent } from './models/radio';
|
|
67
|
+
export type { SelectOption } from './models/select';
|
|
68
|
+
export type { TabModel } from './models/tab';
|
|
69
|
+
export type { DropdownItem } from './models/dropdown';
|
|
70
|
+
export type { DialModifiedEntity } from './models/base-entity';
|
|
71
|
+
export type { DialFile } from './models/file';
|
|
72
|
+
export type { DialFileNodeType, DialFilePermission, DialFileResourceType, } from './models/file';
|
|
73
|
+
export { mergeClasses } from './utils/merge-classes';
|