@epam/ai-dial-ui-kit 0.3.0-rc.4 → 0.3.0-rc.41
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 +7482 -1206
- 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/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/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/FormItem/FormItem.d.ts +75 -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/Icon/Icon.d.ts +1 -0
- package/dist/src/components/Input/Input.d.ts +6 -1
- package/dist/src/components/InputField/InputField.d.ts +1 -1
- package/dist/src/components/InputPopup/InputPopup.d.ts +3 -3
- 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/RadioGroup/RadioGroup.d.ts +0 -1
- package/dist/src/components/RadioGroupPopupField/RadioGroupPopupField.d.ts +2 -1
- 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 +6 -2
- 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/hooks/use-is-tablet-screen.d.ts +15 -0
- package/dist/src/index.d.ts +22 -0
- package/dist/src/models/breadcrumb.d.ts +9 -0
- package/dist/src/models/field-control-props.d.ts +1 -0
- package/dist/src/models/select.d.ts +7 -0
- package/dist/src/models/tab.d.ts +4 -0
- package/dist/src/types/form-item.d.ts +4 -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 +8 -3
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { EDITOR_THEMES } from '../../types/editor';
|
|
3
3
|
import { OnValidate } from '@monaco-editor/react';
|
|
4
4
|
import { editor } from 'monaco-editor';
|
|
5
|
-
export interface
|
|
5
|
+
export interface DialJsonEditorProps {
|
|
6
6
|
value?: string | undefined;
|
|
7
7
|
currentTheme: string;
|
|
8
8
|
themesConfig?: Record<EDITOR_THEMES, editor.IStandaloneThemeData>;
|
|
@@ -21,4 +21,4 @@ export interface Props {
|
|
|
21
21
|
* @param [onValidateJSON] - Callback fired when JSON validation occurs
|
|
22
22
|
* @param [options] - Additional Monaco editor options
|
|
23
23
|
*/
|
|
24
|
-
export declare const DialJsonEditor: FC<
|
|
24
|
+
export declare const DialJsonEditor: FC<DialJsonEditorProps>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface DialEmptyFileAreaProps {
|
|
3
|
+
emptyTextFirstLine?: string;
|
|
4
|
+
emptyTextSecondLine?: string;
|
|
5
|
+
emptyButtonLabel?: string;
|
|
6
|
+
acceptTypes: string;
|
|
7
|
+
maxFilesCount?: number;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
fileFormatError?: string;
|
|
10
|
+
fileCountError?: string;
|
|
11
|
+
getIsFileFormatError?: (fileItems: File[] | DataTransferItem[]) => boolean;
|
|
12
|
+
onChange: (files: File[]) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A drag-and-drop file upload area component that allows users to upload files
|
|
16
|
+
* either by dragging them into the drop zone or selecting them via the file picker.
|
|
17
|
+
* Displays customizable helper text, an upload button, and validation messages for file format
|
|
18
|
+
* or maximum file count errors. Integrates with `react-dnd` for drag-and-drop behavior.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <DialEmptyFileArea
|
|
23
|
+
* onChange={(files) => console.log('Selected files:', files)}
|
|
24
|
+
* emptyTextFirstLine="Drag & drop files here"
|
|
25
|
+
* emptyTextSecondLine="or click below to select files"
|
|
26
|
+
* emptyButtonLabel="Choose files"
|
|
27
|
+
* acceptTypes="application/pdf, application/txt, image/svg+xml"
|
|
28
|
+
* maxFilesCount={3}
|
|
29
|
+
* multiple
|
|
30
|
+
* fileFormatError="Only PNG and JPG files are allowed"
|
|
31
|
+
* fileCountError="You can upload up to 3 files"
|
|
32
|
+
* getIsFileFormatError={(files) =>
|
|
33
|
+
* files.some(file => !file.name.endsWith('.png') && !file.name.endsWith('.jpg'))
|
|
34
|
+
* }
|
|
35
|
+
* />
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param {DialEmptyFileAreaProps} props - The properties for the empty file area component.
|
|
39
|
+
* @param {(files: File[]) => void} props.onChange - Callback fired when valid files are selected or dropped.
|
|
40
|
+
* @param {string} [props.emptyTextFirstLine] - Text displayed as the first line inside the drop area.
|
|
41
|
+
* @param {string} [props.emptyTextSecondLine] - Text displayed as the second line inside the drop area.
|
|
42
|
+
* @param {string} [props.emptyButtonLabel] - Label for the upload button shown below the text.
|
|
43
|
+
* @param {string} [props.acceptTypes] - Comma-separated list of accepted file MIME types (e.g., "application/pdf").
|
|
44
|
+
* @param {number} [props.maxFilesCount] - Maximum allowed number of files that can be uploaded at once.
|
|
45
|
+
* @param {boolean} [props.multiple=false] - Whether multiple file uploads are allowed.
|
|
46
|
+
* @param {string} [props.fileFormatError] - Error message shown when an invalid file format is detected.
|
|
47
|
+
* @param {string} [props.fileCountError] - Error message shown when the selected files exceed the limit.
|
|
48
|
+
* @param {(files: File[] | DataTransferItem[]) => boolean} [props.getIsFileFormatError] - Optional validation function that returns `true` if selected files have invalid formats.
|
|
49
|
+
*
|
|
50
|
+
* @returns {JSX.Element} The rendered drag-and-drop upload area with file validation feedback.
|
|
51
|
+
*/
|
|
52
|
+
export declare const DialEmptyFileArea: FC<DialEmptyFileAreaProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DialInputProps } from '../Input/Input';
|
|
3
|
+
interface DialFilledInputProps extends DialInputProps {
|
|
4
|
+
errorText?: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A styled input component that wraps `DialInput` and provides built-in
|
|
9
|
+
* error handling and icon display.
|
|
10
|
+
*
|
|
11
|
+
* - Displays an error icon (`IconExclamationCircle`) when the input is invalid.
|
|
12
|
+
* - Supports an optional `errorText` tooltip shown on hover when invalid.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <DialFilledInput
|
|
16
|
+
* value={username}
|
|
17
|
+
* onChange={handleChange}
|
|
18
|
+
* invalid={!username}
|
|
19
|
+
* errorText="Username is required"
|
|
20
|
+
* iconBefore={<UserIcon />}
|
|
21
|
+
* />
|
|
22
|
+
*
|
|
23
|
+
* @component
|
|
24
|
+
* @param {DialFilledInputProps} props - The properties for the filled input component.
|
|
25
|
+
* @param {string} [props.errorText] - Optional text to display in a tooltip when the input is invalid.
|
|
26
|
+
* @param {() => void} [props.onClick] - Optional click handler for the input container.
|
|
27
|
+
* @returns {JSX.Element} The rendered filled input component.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DialFilledInput: FC<DialFilledInputProps>;
|
|
30
|
+
export {};
|
|
@@ -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>;
|
|
@@ -3,7 +3,7 @@ import { DialFieldLabelProps } from '../Field/Field';
|
|
|
3
3
|
import { DialInputPopupProps } from '../InputPopup/InputPopup';
|
|
4
4
|
import { DialRadioGroupProps } from '../RadioGroup/RadioGroup';
|
|
5
5
|
import { DialPopupProps } from '../Popup/Popup';
|
|
6
|
-
export interface RadioGroupPopupFieldProps extends Pick<DialFieldLabelProps, 'fieldTitle' | 'htmlFor'>, Omit<DialInputPopupProps, 'onOpen' | 'children'>, Pick<DialRadioGroupProps, 'radioButtons'>, Pick<DialPopupProps, 'onClose' | 'portalId'> {
|
|
6
|
+
export interface RadioGroupPopupFieldProps extends Pick<DialFieldLabelProps, 'fieldTitle' | 'htmlFor'>, Omit<DialInputPopupProps, 'onOpen' | 'children'>, Pick<DialRadioGroupProps, 'radioButtons'>, Pick<DialPopupProps, 'onClose' | 'portalId' | 'size'> {
|
|
7
7
|
customInputValue?: string;
|
|
8
8
|
title: string;
|
|
9
9
|
cancelButtonTitle?: string;
|
|
@@ -64,5 +64,6 @@ export interface RadioGroupPopupFieldProps extends Pick<DialFieldLabelProps, 'fi
|
|
|
64
64
|
* @param selectedRadioValue - Currently selected radio id inside the popup
|
|
65
65
|
* @param onChangeRadioField - Handler for radio selection changes
|
|
66
66
|
* @param id - Element id used for the internal radio group
|
|
67
|
+
* @param [size=PopupSize.Md] - Size of the popup
|
|
67
68
|
*/
|
|
68
69
|
export declare const DialRadioGroupPopupField: FC<RadioGroupPopupFieldProps>;
|
|
@@ -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' },
|
|
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;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { TagVariant } from '../../types/tag';
|
|
2
|
-
import { FC } from 'react';
|
|
2
|
+
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
|
+
iconBefore?: ReactNode;
|
|
9
|
+
bordered?: boolean;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* A small tag component used to display labeled items such as categories, filters, or selections.
|
|
@@ -24,5 +26,7 @@ export interface DialTagProps {
|
|
|
24
26
|
* @param [remove] - Optional callback invoked when the remove button is clicked.
|
|
25
27
|
* If not provided, the remove button will not be rendered.
|
|
26
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.
|
|
27
31
|
*/
|
|
28
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,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,18 @@ 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 { DialTabs } from './components/Tabs/Tabs';
|
|
20
|
+
export { DialTab } from './components/Tab/Tab';
|
|
21
|
+
export { DialBreadcrumb } from './components/Breadcrumb/Breadcrumb';
|
|
22
|
+
export { DialBreadcrumbItem } from './components/Breadcrumb/BreadcrumbItem';
|
|
14
23
|
export { DialButton } from './components/Button/Button';
|
|
15
24
|
export { DialCloseButton } from './components/CloseButton/CloseButton';
|
|
25
|
+
export { DialRemoveButton } from './components/RemoveButton/RemoveButton';
|
|
16
26
|
export { DialTextarea } from './components/Textarea/Textarea';
|
|
17
27
|
export { DialTextAreaField } from './components/TextAreaField/TextAreaField';
|
|
18
28
|
export { DialTooltip } from './components/Tooltip/Tooltip';
|
|
@@ -20,7 +30,9 @@ export { DialSwitch } from './components/Switch/Switch';
|
|
|
20
30
|
export { DialPopup } from './components/Popup/Popup';
|
|
21
31
|
export { DialConfirmationPopup } from './components/ConfirmationPopup/ConfirmationPopup';
|
|
22
32
|
export { DialRadioGroupPopupField } from './components/RadioGroupPopupField/RadioGroupPopupField';
|
|
33
|
+
export { DialFormPopup } from './components/FormPopup/FormPopup';
|
|
23
34
|
export { DialInput } from './components/Input/Input';
|
|
35
|
+
export type { DialInputProps } from './components/Input/Input';
|
|
24
36
|
export { DialNumberInputField } from './components/InputField/InputField';
|
|
25
37
|
export { DialTextInputField } from './components/InputField/InputField';
|
|
26
38
|
export { DialPasswordInputField } from './components/PasswordInput/PasswordInputField';
|
|
@@ -30,6 +42,9 @@ export { DialInputPopup } from './components/InputPopup/InputPopup';
|
|
|
30
42
|
export { DialAutocompleteInput } from './components/AutocompleteInput/AutocompleteInput';
|
|
31
43
|
export { DialAutocompleteInputValue } from './components/AutocompleteInput/AutocompleteInputValue';
|
|
32
44
|
export { DialTagInput } from './components/TagInput/TagInput';
|
|
45
|
+
export { DialSelect } from './components/Select/Select';
|
|
46
|
+
export { DialSelectField } from './components/SelectField/SelectField';
|
|
47
|
+
export { DialLoadFileAreaField } from './components/LoadFileArea/LoadFileAreaField';
|
|
33
48
|
export { DialDropdown } from './components/Dropdown/Dropdown';
|
|
34
49
|
export { AlertVariant } from './types/alert';
|
|
35
50
|
export { ButtonVariant } from './types/button';
|
|
@@ -39,6 +54,13 @@ export { ConfirmationPopupVariant } from './types/confirmation-popup';
|
|
|
39
54
|
export { DropdownType } from './types/dropdown';
|
|
40
55
|
export { SearchSize } from './types/search';
|
|
41
56
|
export { TagVariant } from './types/tag';
|
|
57
|
+
export { TabOrientation } from './types/tab';
|
|
58
|
+
export type { DialBreadcrumbPathItem } from './models/breadcrumb';
|
|
59
|
+
export { FormItemOrientation } from './types/form-item';
|
|
42
60
|
export { StepStatus } from './models/step';
|
|
43
61
|
export type { Step } from './models/step';
|
|
44
62
|
export type { RadioButtonWithContent } from './models/radio';
|
|
63
|
+
export type { SelectOption } from './models/select';
|
|
64
|
+
export type { TabModel } from './models/tab';
|
|
65
|
+
export type { DropdownItem } from './models/dropdown';
|
|
66
|
+
export { mergeClasses } from './utils/merge-classes';
|