@epam/ai-dial-ui-kit 0.3.0-rc.3 → 0.3.0-rc.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/dial-ui-kit.cjs.js +1 -1
  2. package/dist/dial-ui-kit.es.js +5377 -1214
  3. package/dist/index.css +2 -2
  4. package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +41 -0
  5. package/dist/src/components/Breadcrumb/BreadcrumbItem.d.ts +13 -0
  6. package/dist/src/components/Breadcrumb/constants.d.ts +9 -0
  7. package/dist/src/components/Checkbox/Checkbox.d.ts +3 -1
  8. package/dist/src/components/ConfirmationPopup/ConfirmationPopup.d.ts +2 -2
  9. package/dist/src/components/ConfirmationPopup/constants.d.ts +1 -0
  10. package/dist/src/components/DraggableItem/DraggableItem.d.ts +31 -0
  11. package/dist/src/components/DraggableItem/constants.d.ts +3 -0
  12. package/dist/src/components/Dropdown/Dropdown.d.ts +4 -0
  13. package/dist/src/components/EllipsisTooltip/EllipsisTooltip.d.ts +31 -0
  14. package/dist/src/components/EllipsisTooltip/constants.d.ts +1 -0
  15. package/dist/src/components/Field/Field.d.ts +4 -2
  16. package/dist/src/components/FormItem/FormItem.d.ts +69 -0
  17. package/dist/src/components/FormItem/constants.d.ts +3 -0
  18. package/dist/src/components/FormPopup/FormPopup.d.ts +44 -0
  19. package/dist/src/components/FormPopup/constants.d.ts +3 -0
  20. package/dist/src/components/Input/Input.d.ts +4 -1
  21. package/dist/src/components/InputField/InputField.d.ts +1 -1
  22. package/dist/src/components/InputPopup/InputPopup.d.ts +3 -3
  23. package/dist/src/components/RadioGroup/RadioGroup.d.ts +0 -1
  24. package/dist/src/components/RadioGroupPopupField/RadioGroupPopupField.d.ts +2 -1
  25. package/dist/src/components/Select/Select.d.ts +59 -0
  26. package/dist/src/components/Select/constants.d.ts +8 -0
  27. package/dist/src/components/SelectField/SelectField.d.ts +35 -0
  28. package/dist/src/components/Tab/Tab.d.ts +35 -0
  29. package/dist/src/components/Tabs/Tabs.d.ts +48 -0
  30. package/dist/src/components/Tabs/constants.d.ts +1 -0
  31. package/dist/src/components/Tag/Tag.d.ts +6 -2
  32. package/dist/src/components/TextAreaField/TextAreaField.d.ts +4 -2
  33. package/dist/src/components/Textarea/Textarea.d.ts +4 -0
  34. package/dist/src/components/Tooltip/TooltipContext.d.ts +4 -4
  35. package/dist/src/hooks/use-is-tablet-screen.d.ts +15 -0
  36. package/dist/src/index.d.ts +17 -0
  37. package/dist/src/models/breadcrumb.d.ts +9 -0
  38. package/dist/src/models/field-control-props.d.ts +1 -0
  39. package/dist/src/models/select.d.ts +7 -0
  40. package/dist/src/models/tab.d.ts +4 -0
  41. package/dist/src/types/form-item.d.ts +4 -0
  42. package/dist/src/types/tab.d.ts +4 -0
  43. package/dist/src/utils/merge-classes.d.ts +3 -0
  44. package/dist/src/utils/mobile.d.ts +14 -0
  45. package/package.json +8 -3
@@ -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'> {
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,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,48 @@
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
+ jsonEditorEnabled?: boolean;
9
+ orientation?: TabOrientation;
10
+ }
11
+ /**
12
+ * A responsive and overflow-aware tabs component that adapts between horizontal and dropdown (mobile) layouts
13
+ * based on screen size and available space. When there are too many tabs to fit in one line,
14
+ * the component automatically adds a dropdown button for accessing hidden tabs and enables smooth horizontal scrolling.
15
+ *
16
+ * Supports both horizontal and vertical orientations and can integrate with JSON editor states to toggle
17
+ * visibility when needed. Automatically keeps the active tab in view when navigating through scrollable tabs.
18
+ *
19
+ * On larger screens, tabs are displayed horizontally or vertically according to the {@link TabOrientation} prop.
20
+ * On smaller screens, tabs collapse into a dropdown menu for better usability.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <DialTabs
25
+ * tabs={[
26
+ * { id: 'overview', label: 'Overview' },
27
+ * { id: 'details', label: 'Details' },
28
+ * { id: 'settings', label: 'Settings' },
29
+ * ]}
30
+ * activeTab="overview"
31
+ * onClick={(id) => setActiveTab(id)}
32
+ * orientation={TabOrientation.Horizontal}
33
+ * />
34
+ * ```
35
+ *
36
+ * @param tabs - Array of tab models to render. Each tab should include an `id` and `label`.
37
+ * @param activeTab - The identifier of the currently active tab.
38
+ * @param onClick - Callback fired when a tab is selected. Receives the tab's `id` as an argument.
39
+ * @param [jsonEditorEnabled=false] - If true, hides the tab UI to integrate with JSON editor layouts.
40
+ * @param [orientation=TabOrientation.Horizontal] - The layout direction of the tabs. Uses the {@link TabOrientation} enum.
41
+ *
42
+ * @remarks
43
+ * - Automatically detects overflow using a `ResizeObserver` and toggles a dropdown button when tabs exceed
44
+ * available width.
45
+ * - Smoothly scrolls the tab row to keep the active tab visible.
46
+ * - Switches to a dedicated dropdown interface on mobile and tablet screens via the `useIsTabletScreen` hook.
47
+ */
48
+ 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 [elementContainerCssClass] - Additional CSS classes to apply to the input container
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;
@@ -11,6 +11,13 @@ 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 { DialFormItem } from './components/FormItem/FormItem';
17
+ export { DialTabs } from './components/Tabs/Tabs';
18
+ export { DialTab } from './components/Tab/Tab';
19
+ export { DialBreadcrumb } from './components/Breadcrumb/Breadcrumb';
20
+ export { DialBreadcrumbItem } from './components/Breadcrumb/BreadcrumbItem';
14
21
  export { DialButton } from './components/Button/Button';
15
22
  export { DialCloseButton } from './components/CloseButton/CloseButton';
16
23
  export { DialTextarea } from './components/Textarea/Textarea';
@@ -20,7 +27,9 @@ export { DialSwitch } from './components/Switch/Switch';
20
27
  export { DialPopup } from './components/Popup/Popup';
21
28
  export { DialConfirmationPopup } from './components/ConfirmationPopup/ConfirmationPopup';
22
29
  export { DialRadioGroupPopupField } from './components/RadioGroupPopupField/RadioGroupPopupField';
30
+ export { DialFormPopup } from './components/FormPopup/FormPopup';
23
31
  export { DialInput } from './components/Input/Input';
32
+ export type { DialInputProps } from './components/Input/Input';
24
33
  export { DialNumberInputField } from './components/InputField/InputField';
25
34
  export { DialTextInputField } from './components/InputField/InputField';
26
35
  export { DialPasswordInputField } from './components/PasswordInput/PasswordInputField';
@@ -30,6 +39,7 @@ export { DialInputPopup } from './components/InputPopup/InputPopup';
30
39
  export { DialAutocompleteInput } from './components/AutocompleteInput/AutocompleteInput';
31
40
  export { DialAutocompleteInputValue } from './components/AutocompleteInput/AutocompleteInputValue';
32
41
  export { DialTagInput } from './components/TagInput/TagInput';
42
+ export { DialSelect } from './components/Select/Select';
33
43
  export { DialDropdown } from './components/Dropdown/Dropdown';
34
44
  export { AlertVariant } from './types/alert';
35
45
  export { ButtonVariant } from './types/button';
@@ -39,6 +49,13 @@ export { ConfirmationPopupVariant } from './types/confirmation-popup';
39
49
  export { DropdownType } from './types/dropdown';
40
50
  export { SearchSize } from './types/search';
41
51
  export { TagVariant } from './types/tag';
52
+ export { TabOrientation } from './types/tab';
53
+ export type { DialBreadcrumbPathItem } from './models/breadcrumb';
54
+ export { FormItemOrientation } from './types/form-item';
42
55
  export { StepStatus } from './models/step';
43
56
  export type { Step } from './models/step';
44
57
  export type { RadioButtonWithContent } from './models/radio';
58
+ export type { SelectOption } from './models/select';
59
+ export type { TabModel } from './models/tab';
60
+ export type { DropdownItem } from './models/dropdown';
61
+ export { mergeClasses } from './utils/merge-classes';
@@ -0,0 +1,9 @@
1
+ import { ReactNode, MouseEvent } from 'react';
2
+ export interface DialBreadcrumbPathItem {
3
+ title: ReactNode;
4
+ href?: string;
5
+ onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
6
+ disabled?: boolean;
7
+ cssClass?: string;
8
+ iconBefore?: ReactNode;
9
+ }
@@ -6,6 +6,7 @@ export interface FieldControlProps {
6
6
  export interface InputBaseProps {
7
7
  elementId: string;
8
8
  value?: string | number | null;
9
+ defaultValue?: string | number;
9
10
  placeholder?: string;
10
11
  disabled?: boolean;
11
12
  readonly?: boolean;
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SelectOption {
3
+ value: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ icon?: ReactNode;
7
+ }
@@ -0,0 +1,4 @@
1
+ export interface TabModel {
2
+ id: string;
3
+ name: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum FormItemOrientation {
2
+ Vertical = "vertical",
3
+ Horizontal = "horizontal"
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum TabOrientation {
2
+ Horizontal = "horizontal",
3
+ Vertical = "vertical"
4
+ }
@@ -0,0 +1,3 @@
1
+ import { default as classNames } from 'classnames';
2
+ /** Merge class names (classnames → tailwind-merge). */
3
+ export declare function mergeClasses(...inputs: Parameters<typeof classNames>): string;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Checks if the current viewport width is within the "medium" (tablet) screen range.
3
+ *
4
+ * Specifically, it returns `true` if the window width is less than 1024 pixels.
5
+ * Safely handles server-side rendering by verifying that `window` is defined.
6
+ *
7
+ * @returns {boolean} `true` if the viewport width is less than 1024px, otherwise `false`.
8
+ *
9
+ * @example
10
+ * if (isMediumScreen()) {
11
+ * console.log('Tablet or smaller screen detected');
12
+ * }
13
+ */
14
+ export declare const isMediumScreen: () => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.3.0-rc.3",
3
+ "version": "0.3.0-rc.31",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",
@@ -37,9 +37,9 @@
37
37
  "format": "prettier --check .",
38
38
  "format-fix": "prettier --write .",
39
39
  "preview": "vite preview",
40
- "storybook": "concurrently 'npm run storybook:css' 'storybook dev -p 6006'",
40
+ "storybook": "concurrently \"npm run storybook:css\" \"storybook dev -p 6006\"",
41
41
  "storybook:css": "tailwindcss -w -i ./src/styles/tailwind-entry.scss -o ./src/index.css",
42
- "build-storybook": "concurrently 'npm run build-storybook:css' 'storybook build'",
42
+ "build-storybook": "concurrently \"npm run build-storybook:css\" \"storybook build\"",
43
43
  "build-storybook:css": "tailwindcss -m -i ./src/styles/tailwind-entry.scss -o ./src/index.css",
44
44
  "prepare": "husky",
45
45
  "publish": "node tools/publish-lib.mjs",
@@ -56,6 +56,11 @@
56
56
  "overrides": {
57
57
  "esbuild": "0.25.9"
58
58
  },
59
+ "dependencies": {
60
+ "react-dnd": "^16.0.1",
61
+ "react-dnd-html5-backend": "^16.0.1",
62
+ "tailwind-merge": "^3.3.1"
63
+ },
59
64
  "peerDependencies": {
60
65
  "@floating-ui/react": "^0.27.15",
61
66
  "@monaco-editor/react": "^4.7.0",