@epam/ai-dial-ui-kit 0.12.0-dev.3 → 0.12.0-dev.30
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/CHANGELOG.md +9 -0
- package/dist/{JsonEditor-BChf7gyY.js → JsonEditor-BqKutzC3.js} +3 -4
- package/dist/JsonEditor-DiUgycbj.cjs +1 -0
- package/dist/MarkdownEditor-BECxx9cj.js +35 -0
- package/dist/MarkdownEditor-C8FS2irR.cjs +1 -0
- package/dist/components-manifest.json +421 -3
- package/dist/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +137 -126
- package/dist/{index-Cq70XHZ5.js → index-9yzOzks2.js} +12119 -11473
- package/dist/index-mhZPfHnD.cjs +71 -0
- package/dist/index.css +2 -2
- package/dist/migration-guides/0.12.0/legacy-typography-classes-removal.md +57 -0
- package/dist/migration-guides/README.md +1 -0
- package/dist/src/components/Accordion/Accordion.d.ts +56 -0
- package/dist/src/components/Analytics/Bar/Bar.d.ts +81 -0
- package/dist/src/components/Analytics/Bar/utils.d.ts +20 -0
- package/dist/src/components/Analytics/Bar/utils.spec.d.ts +1 -0
- package/dist/src/components/Analytics/BarGroup/BarGroup.d.ts +63 -0
- package/dist/src/components/Analytics/Card/Card.d.ts +55 -0
- package/dist/src/components/Analytics/ErrorTag/ErrorTag.d.ts +21 -0
- package/dist/src/components/Analytics/Histogram/Histogram.d.ts +47 -0
- package/dist/src/components/Analytics/Histogram/utils.d.ts +37 -0
- package/dist/src/components/Analytics/Histogram/utils.spec.d.ts +1 -0
- package/dist/src/components/Analytics/index.d.ts +13 -0
- package/dist/src/components/Breadcrumb/BreadcrumbItem.d.ts +1 -0
- package/dist/src/components/Breadcrumb/constants.d.ts +2 -3
- package/dist/src/components/ConfirmationPopup/constants.d.ts +1 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/src/components/FileManager/FileManager.d.ts +3 -0
- package/dist/src/components/FileManager/errors.d.ts +3 -0
- package/dist/src/components/FileManager/hooks/use-file-upload.d.ts +2 -1
- package/dist/src/components/FileManager/hooks/use-folder-creation.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-item-renaming.d.ts +1 -0
- package/dist/src/components/InfoButton/constants.d.ts +1 -1
- package/dist/src/components/RadioGroup/RadioGroup.d.ts +2 -0
- package/dist/src/components/RadioGroupPopupField/RadioGroupPopupField.d.ts +1 -0
- package/dist/src/components/SchemaRenderer/SchemaRenderer.d.ts +1 -0
- package/dist/src/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.d.ts +20 -0
- package/dist/src/components/SchemaRenderer/types.d.ts +6 -0
- package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +39 -0
- package/dist/src/components/SegmentedControl/constants.d.ts +5 -0
- package/dist/src/components/Slider/Slider.d.ts +3 -0
- package/dist/src/components/Tab/Tab.d.ts +4 -0
- package/dist/src/components/Tabs/Tabs.d.ts +7 -1
- package/dist/src/index.d.ts +20 -1
- package/dist/src/models/analytics.d.ts +8 -0
- package/dist/src/models/segmented-control.d.ts +7 -0
- package/dist/src/models/select.d.ts +6 -0
- package/dist/src/types/analytics.d.ts +4 -0
- package/dist/src/types/tab.d.ts +4 -0
- package/package.json +3 -2
- package/dist/JsonEditor-BS0ggIlL.cjs +0 -1
- package/dist/MarkdownEditor-BSlmBmbj.js +0 -36
- package/dist/MarkdownEditor-D7SqU1MB.cjs +0 -1
- package/dist/editor-Ba3vCFHk.cjs +0 -1
- package/dist/editor-Cu1dRT39.js +0 -4
- package/dist/index-5EdIfkh9.cjs +0 -71
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { AnalyticsBarColorStop } from '../../../models/analytics';
|
|
3
|
+
export interface DialAnalyticsHistogramProps {
|
|
4
|
+
/** Title rendered above the histogram. */
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/** Values to distribute across the columns. */
|
|
7
|
+
values: number[];
|
|
8
|
+
/**
|
|
9
|
+
* Ordered color bands defining the columns (and their colors), keyed by value.
|
|
10
|
+
* Defaults to {@link DEFAULT_ANALYTICS_BAR_COLOR_MAP}.
|
|
11
|
+
*/
|
|
12
|
+
colorMap?: AnalyticsBarColorStop[];
|
|
13
|
+
/** Noun used in the hover tooltip: `"{n} out of {k} {valueTitle}"`. */
|
|
14
|
+
valueTitle?: string;
|
|
15
|
+
/** When `true`, renders each column's count inside its bar. */
|
|
16
|
+
showCount?: boolean;
|
|
17
|
+
/** Renders a loader in place of the histogram while the data is being fetched. */
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
/** Additional CSS classes for the outer container. */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A histogram that distributes `values` across the bands of a color map and draws a
|
|
24
|
+
* column per band. Each column's height is relative to the most populated band; empty
|
|
25
|
+
* columns are outlined, populated columns are filled with their band color. A baseline
|
|
26
|
+
* separates the columns from the interval labels, and hovering a column reveals a
|
|
27
|
+
* tooltip with its share of the total.
|
|
28
|
+
* aliases: Distribution|ColumnChart|FrequencyChart
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <DialAnalyticsHistogram
|
|
33
|
+
* title="Score distribution"
|
|
34
|
+
* values={[0.1, 0.15, 0.4, 0.42, 0.43, 0.9, 1]}
|
|
35
|
+
* valueTitle="responses"
|
|
36
|
+
* />
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @param title - Title rendered above the histogram.
|
|
40
|
+
* @param values - Values to distribute across the columns.
|
|
41
|
+
* @param [colorMap=DEFAULT_ANALYTICS_BAR_COLOR_MAP] - Color bands defining the columns.
|
|
42
|
+
* @param [valueTitle='values'] - Noun used in the hover tooltip.
|
|
43
|
+
* @param [showCount] - When `true`, renders each column's count inside its bar.
|
|
44
|
+
* @param [isLoading] - Renders a loader in place of the histogram while the data is being fetched.
|
|
45
|
+
* @param [className] - Additional CSS classes for the outer container.
|
|
46
|
+
*/
|
|
47
|
+
export declare const DialAnalyticsHistogram: FC<DialAnalyticsHistogramProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AnalyticsBarColorStop } from '../../../models/analytics';
|
|
2
|
+
export interface AnalyticsHistogramColumn {
|
|
3
|
+
/** Lower bound of the column's interval. */
|
|
4
|
+
from: number;
|
|
5
|
+
/** Upper bound of the column's interval. */
|
|
6
|
+
to: number;
|
|
7
|
+
/** Fill color for the column, or `undefined` for the empty zero bucket. */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Number of values that fall into this column's interval. */
|
|
10
|
+
count: number;
|
|
11
|
+
/** Column height as a ratio of the tallest column (0–1). */
|
|
12
|
+
ratio: number;
|
|
13
|
+
/** Whether this is the leading empty bucket for values of exactly `0`. */
|
|
14
|
+
isZeroBucket: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns the index of the color-map band a positive value belongs to, or `-1`
|
|
18
|
+
* when no band matches (including an empty map or a value of `0`, which is handled
|
|
19
|
+
* by the dedicated zero bucket). A band's lower bound is exclusive and its upper
|
|
20
|
+
* bound inclusive, so boundary values belong to the lower band; the last matching
|
|
21
|
+
* band wins, which lets an exact full band (`{ from: 1, to: 1 }`) capture the maximum.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getHistogramColumnIndex: (value: number, colorMap: AnalyticsBarColorStop[]) => number;
|
|
24
|
+
/**
|
|
25
|
+
* Builds the histogram columns: a leading empty zero bucket (values of exactly `0`)
|
|
26
|
+
* followed by one column per color-map band. Counts how many `values` fall into each
|
|
27
|
+
* column and computes each column's height as a ratio of the tallest column.
|
|
28
|
+
*/
|
|
29
|
+
export declare const buildHistogramColumns: (values: number[], colorMap: AnalyticsBarColorStop[]) => AnalyticsHistogramColumn[];
|
|
30
|
+
/** Formats a column's interval bound for the axis label (trims float noise). */
|
|
31
|
+
export declare const formatHistogramInterval: (value: number) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Builds the legend label for a column: a single number for an exact band
|
|
34
|
+
* (`from === to`, e.g. the full band), otherwise a `from-to` range.
|
|
35
|
+
* For the default map this yields `0-0.1, 0.1-0.2, …, 0.9-1, 1`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const formatHistogramColumnLabel: (from: number, to: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { DialAnalyticsCard } from './Card/Card';
|
|
2
|
+
export type { DialAnalyticsCardProps } from './Card/Card';
|
|
3
|
+
export { AnalyticsCardVariant } from '../../types/analytics';
|
|
4
|
+
export { DialAnalyticsBar } from './Bar/Bar';
|
|
5
|
+
export type { DialAnalyticsBarProps } from './Bar/Bar';
|
|
6
|
+
export { DEFAULT_ANALYTICS_BAR_COLOR_MAP } from './Bar/utils';
|
|
7
|
+
export type { AnalyticsBarColorStop } from '../../models/analytics';
|
|
8
|
+
export { DialAnalyticsErrorTag } from './ErrorTag/ErrorTag';
|
|
9
|
+
export type { DialAnalyticsErrorTagProps } from './ErrorTag/ErrorTag';
|
|
10
|
+
export { DialAnalyticsBarGroup } from './BarGroup/BarGroup';
|
|
11
|
+
export type { DialAnalyticsBarGroupProps } from './BarGroup/BarGroup';
|
|
12
|
+
export { DialAnalyticsHistogram } from './Histogram/Histogram';
|
|
13
|
+
export type { DialAnalyticsHistogramProps } from './Histogram/Histogram';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export declare const breadcrumbBaseClassName = "w-full overflow-hidden";
|
|
3
3
|
export declare const breadcrumbListClassName = "flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap";
|
|
4
|
-
export declare const breadcrumbItemBaseClassName = "flex items-center gap-2 min-w-0 dial-small-text";
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const breadcrumbItemLastClassName = "flex-1 min-w-0";
|
|
4
|
+
export declare const breadcrumbItemBaseClassName = "flex items-center gap-2 min-w-0 shrink dial-small-text";
|
|
5
|
+
export declare const breadcrumbItemWidthClassName: Record<'first' | 'middle' | 'last', string>;
|
|
7
6
|
export declare const breadcrumbLinkBaseClassName = "flex flex-1 items-center gap-1 min-w-0 transition-colors";
|
|
8
7
|
export declare const breadcrumbLinkInteractiveClassName = "text-secondary hover:text-accent-primary";
|
|
9
8
|
export declare const breadcrumbCurrentClassName = "text-primary cursor-default";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ButtonAppearance, ButtonVariant } from '../../types/button';
|
|
2
2
|
import { ConfirmationPopupVariant } from '../../types/confirmation-popup';
|
|
3
3
|
export declare const actionsBaseClassName = "flex justify-end gap-2 px-6 py-4 border-t border-tertiary";
|
|
4
|
-
export declare const descriptionBaseClassName = "text-secondary dial-small-
|
|
4
|
+
export declare const descriptionBaseClassName = "text-secondary dial-small-text px-6 pb-4";
|
|
5
5
|
export declare const defaultCancelLabel = "Cancel";
|
|
6
6
|
export declare const defaultConfirmLabel = "Ok";
|
|
7
7
|
export declare const variantConfig: Record<ConfirmationPopupVariant, {
|
|
@@ -22,6 +22,8 @@ export interface DialDropdownProps {
|
|
|
22
22
|
closable?: boolean;
|
|
23
23
|
onClose?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
24
24
|
className?: string;
|
|
25
|
+
overlayContentClassName?: string;
|
|
26
|
+
separatorClassName?: string;
|
|
25
27
|
listClassName?: string;
|
|
26
28
|
outsidePressIgnoreRef?: RefObject<HTMLElement | null>;
|
|
27
29
|
outsideClosable?: boolean;
|
|
@@ -164,6 +164,7 @@ export interface DialFileManagerProps {
|
|
|
164
164
|
fileTooLargeTooltip?: string;
|
|
165
165
|
unsupportedFileTypeTooltip?: string;
|
|
166
166
|
onUploadFiles?: (files: DialUploadFileItem[], destinationFolder: string) => void;
|
|
167
|
+
prepareUploadFileName?: (name: string) => string;
|
|
167
168
|
onValidateUpload?: (files: DialUploadFileItem[], existingFiles: DialFile[], destinationFolder: string) => FileUploadValidationResult | Promise<FileUploadValidationResult>;
|
|
168
169
|
maxFileSize?: number;
|
|
169
170
|
uploadValidationMessages?: FileUploadValidationMessages;
|
|
@@ -201,6 +202,7 @@ export interface DialFileManagerProps {
|
|
|
201
202
|
autoSelectUploadedItems?: boolean;
|
|
202
203
|
maxNewFolderDepth?: number;
|
|
203
204
|
onNewFolderDepthExceeded?: () => void;
|
|
205
|
+
initialUploadFilesOpen?: boolean;
|
|
204
206
|
}
|
|
205
207
|
/**
|
|
206
208
|
* File Manager layout with a collapsible folders tree, breadcrumb/search header, and a data grid.
|
|
@@ -285,6 +287,7 @@ export interface DialFileManagerProps {
|
|
|
285
287
|
*
|
|
286
288
|
* @param [onUploadArchive] - Callback fired when archive files are uploaded
|
|
287
289
|
* @param [onUploadFiles] - Callback fired when files are uploaded
|
|
290
|
+
* @param [prepareUploadFileName] - Optional mapper applied to each uploaded item's name before conflict resolution runs and before `onUploadFiles`/`onUploadArchive` are called. Use it to sanitize or normalize names (e.g. stripping forbidden symbols). Conflict detection is performed against the mapped names, so renames take place before the conflict check.
|
|
288
291
|
* @param [onValidateUpload] - Callback to validate files before upload
|
|
289
292
|
* @param [maxFileSize] - Maximum allowed file size for uploads in bytes
|
|
290
293
|
* @param [uploadValidationMessages] - Custom validation messages for file uploads. Consumers can customize these strings for a11y and copy consistency.
|
|
@@ -34,9 +34,10 @@ export interface UseFileUploadOptions {
|
|
|
34
34
|
allowedFileTypes?: DialFileAcceptType[];
|
|
35
35
|
validationMessages?: FileUploadValidationMessages;
|
|
36
36
|
onUploadArchive?: (file: File, name: string, destinationFolder: string) => void;
|
|
37
|
+
prepareUploadFileName?: (name: string) => string;
|
|
37
38
|
currentFolder?: DialFile;
|
|
38
39
|
}
|
|
39
|
-
export declare const useFileUpload: ({ onUploadFiles, onValidateUpload, maxFileSize, allowedFileTypes, validationMessages, onUploadArchive, uploadEnabled, currentFolder, }?: UseFileUploadOptions) => {
|
|
40
|
+
export declare const useFileUpload: ({ onUploadFiles, onValidateUpload, maxFileSize, allowedFileTypes, validationMessages, onUploadArchive, prepareUploadFileName, uploadEnabled, currentFolder, }?: UseFileUploadOptions) => {
|
|
40
41
|
isDragging: boolean;
|
|
41
42
|
isDraggingOverWindow: boolean;
|
|
42
43
|
uploadError: string | undefined;
|
|
@@ -4,6 +4,7 @@ export interface RenameValidationMessages {
|
|
|
4
4
|
emptyName?: string;
|
|
5
5
|
duplicateName?: string;
|
|
6
6
|
hiddenItemWarning?: string;
|
|
7
|
+
consecutiveDotsError?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare const useItemRenaming: ({ items, onRenameValidate, validationMessages, onMoveToFiles, }: {
|
|
9
10
|
items?: DialFile[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const infoButtonClassName = "w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active
|
|
1
|
+
export declare const infoButtonClassName = "w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active";
|
|
@@ -8,6 +8,7 @@ export interface DialRadioGroupProps {
|
|
|
8
8
|
radioButtons: RadioButtonWithContent[];
|
|
9
9
|
activeRadioButton: string;
|
|
10
10
|
orientation: RadioGroupOrientation;
|
|
11
|
+
labelDescription?: string;
|
|
11
12
|
onChange: (radioId: string) => void;
|
|
12
13
|
radioClassName?: string;
|
|
13
14
|
groupLabelClassName?: string;
|
|
@@ -55,6 +56,7 @@ export interface DialRadioGroupProps {
|
|
|
55
56
|
* @param [selectedLabelClassName] - Additional classes applied to the selected option's label
|
|
56
57
|
* @param [radioGroupClassName] - Additional classes applied to the radio group container
|
|
57
58
|
* @param [disabled] - Disables all child radios when set
|
|
59
|
+
* @param [labelDescription] - Optional description rendered by `DialFormItem`
|
|
58
60
|
* @param radioButtons - Array of options with ids, labels, and optional content
|
|
59
61
|
* @param activeRadioButton - The id of the currently selected radio
|
|
60
62
|
* @param orientation - Layout direction of radios: row or column
|
|
@@ -53,6 +53,7 @@ export interface RadioGroupPopupFieldProps extends Pick<DialLabelProps, 'label'
|
|
|
53
53
|
* @param [selectedValue] - Current value id used to resolve the displayed option name
|
|
54
54
|
* @param radioButtons - Collection of radio options (id/name)
|
|
55
55
|
* @param [customInputValue] - Custom value text to display instead of a radio option name
|
|
56
|
+
* @param [placeholder] - Placeholder text shown in the field when no value is selected; unlike `emptyValueText`, it suppresses the tooltip
|
|
56
57
|
* @param [valueClassName] - Extra classes applied to the value text in the collapsed field
|
|
57
58
|
* @param [inputClassName] - Extra classes applied to the collapsed input container
|
|
58
59
|
* @param emptyValueText - Placeholder text when no value is selected
|
|
@@ -24,5 +24,6 @@ import { DialSchemaRendererProps } from './types';
|
|
|
24
24
|
* @param [onChange] - Called with the full form value on every change
|
|
25
25
|
* @param [onPropertyChange] - Called with `(path, value)` for each individual property change
|
|
26
26
|
* @param [onDefaultValues] - Called once on mount with the resolved default values
|
|
27
|
+
* @param [jsonEditorTheme] - Theme for the JSON editor shown for value keys absent from the schema
|
|
27
28
|
*/
|
|
28
29
|
export declare const DialSchemaRenderer: FC<DialSchemaRendererProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { EditorThemes } from '../../../types/editor';
|
|
3
|
+
export interface SchemaAdditionalPropertiesEditorProps {
|
|
4
|
+
value: unknown;
|
|
5
|
+
onChange: (value: unknown) => void;
|
|
6
|
+
theme?: EditorThemes;
|
|
7
|
+
height?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders a single value key that is not declared in the schema's `properties` as a raw JSON
|
|
11
|
+
* editor, letting users inspect and manually edit it. The Monaco-based editor is dynamically
|
|
12
|
+
* imported on the client only, keeping the parent SchemaRenderer SSR-safe.
|
|
13
|
+
* aliases: SchemaExtraPropertyEditor|SchemaUnknownPropertyEditor
|
|
14
|
+
*
|
|
15
|
+
* @param value - The current value of the property (any JSON type)
|
|
16
|
+
* @param onChange - Called with the parsed value whenever the edited JSON is valid
|
|
17
|
+
* @param [theme=EditorThemes.dark] - Theme applied to the JSON editor
|
|
18
|
+
* @param [height=240] - Editor height in pixels
|
|
19
|
+
*/
|
|
20
|
+
export declare const SchemaAdditionalPropertiesEditor: FC<SchemaAdditionalPropertiesEditorProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { EditorThemes } from '../../types/editor';
|
|
2
3
|
export declare enum SchemaRendererVariant {
|
|
3
4
|
Sections = "sections",
|
|
4
5
|
Flat = "flat",
|
|
@@ -94,6 +95,11 @@ export interface DialSchemaRendererProps {
|
|
|
94
95
|
* with a field. When `false` (default), all unfilled required fields are highlighted immediately.
|
|
95
96
|
*/
|
|
96
97
|
skipUntouched?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Theme applied to the JSON editor shown for value keys that are not declared in the
|
|
100
|
+
* schema's `properties`. Defaults to `EditorThemes.dark`.
|
|
101
|
+
*/
|
|
102
|
+
jsonEditorTheme?: EditorThemes;
|
|
97
103
|
onChange?: (value: Record<string, unknown>) => void;
|
|
98
104
|
onPropertyChange?: (path: string, value: unknown) => void;
|
|
99
105
|
onDefaultValues?: (value: Record<string, unknown>) => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SegmentedControlOption } from '../../models/segmented-control';
|
|
2
|
+
export interface DialSegmentedControlProps<T extends string> {
|
|
3
|
+
options: SegmentedControlOption<T>[];
|
|
4
|
+
value: T;
|
|
5
|
+
onChange: (value: T) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A single-select control for switching between a small set of mutually exclusive,
|
|
12
|
+
* equally-sized options (e.g. view switchers).
|
|
13
|
+
* aliases: SegmentedButton|ViewSwitcher
|
|
14
|
+
*
|
|
15
|
+
* Renders a horizontal group of segments where every option is always visible and
|
|
16
|
+
* equally sized. Supports 2 or more segments, optional per-option icons, and
|
|
17
|
+
* keyboard navigation (Arrow keys, Home, End).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <DialSegmentedControl
|
|
22
|
+
* ariaLabel="View"
|
|
23
|
+
* value={view}
|
|
24
|
+
* onChange={setView}
|
|
25
|
+
* options={[
|
|
26
|
+
* { value: 'list', label: 'List' },
|
|
27
|
+
* { value: 'grid', label: 'Grid' },
|
|
28
|
+
* ]}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param options - Segments to render. Each option needs a unique `value` and may include a `label`, `icon`, and `disabled` flag.
|
|
33
|
+
* @param value - The currently selected option `value`.
|
|
34
|
+
* @param onChange - Callback fired with the selected option `value`.
|
|
35
|
+
* @param [disabled] - Disables the entire control when set.
|
|
36
|
+
* @param [className] - Additional classes applied to the container.
|
|
37
|
+
* @param [ariaLabel] - Accessible label for the control (applied to the `tablist`).
|
|
38
|
+
*/
|
|
39
|
+
export declare const DialSegmentedControl: <T extends string>({ options, value, onChange, disabled, className, ariaLabel, }: DialSegmentedControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const containerBaseClassName = "inline-flex items-center rounded bg-layer-3";
|
|
2
|
+
export declare const segmentBaseClassName = "flex flex-1 items-center justify-center gap-2 h-7 px-3 py-1 border border-primary dial-small-text whitespace-nowrap focus-visible:outline outline-offset-0 focus-visible:relative focus-visible:z-10";
|
|
3
|
+
export declare const segmentSelectedClassName = "relative z-10 bg-controls-accent-primary-alpha-active text-primary";
|
|
4
|
+
export declare const segmentUnselectedClassName = "text-secondary hover:text-primary";
|
|
5
|
+
export declare const segmentDisabledClassName = "text-controls-disable-accent cursor-not-allowed hover:text-controls-disable-accent";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { DialLabelProps } from '../Label/Label';
|
|
2
3
|
export interface DialSliderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
4
|
value: number;
|
|
4
5
|
min?: number;
|
|
5
6
|
max?: number;
|
|
6
7
|
step?: number;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
labelProps?: DialLabelProps;
|
|
8
10
|
/** 2-element or 3-element label tuple rendered below the track */
|
|
9
11
|
labels?: [string, string] | [string, string, string];
|
|
10
12
|
/** Custom formatter for the thumb value; defaults to fixed-decimal based on step */
|
|
@@ -41,6 +43,7 @@ export interface DialSliderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'o
|
|
|
41
43
|
* @param [max=1] - Maximum value
|
|
42
44
|
* @param [step=0.1] - Step increment
|
|
43
45
|
* @param [disabled=false] - Disables interaction
|
|
46
|
+
* @param [labelProps] - Props forwarded to DialLabel rendered above the slider
|
|
44
47
|
* @param [labels] - 2 or 3 strings rendered below the track (start, [middle,] end)
|
|
45
48
|
* @param [formatValue] - Custom value formatter for the thumb display
|
|
46
49
|
* @param [onChange] - Callback fired with the new value on interaction
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, FC } from 'react';
|
|
2
2
|
import { TabModel } from '../../models/tab';
|
|
3
|
+
import { TabView } from '../../types/tab';
|
|
3
4
|
type NativeButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'children' | 'type' | 'role' | 'disabled'>;
|
|
4
5
|
export interface DialTabProps extends NativeButtonProps {
|
|
5
6
|
tab: TabModel;
|
|
6
7
|
active: boolean;
|
|
7
8
|
invalid?: boolean;
|
|
8
9
|
horizontal?: boolean;
|
|
10
|
+
view?: TabView;
|
|
9
11
|
onClick: (id: string) => void;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
@@ -26,6 +28,8 @@ export interface DialTabProps extends NativeButtonProps {
|
|
|
26
28
|
* @param tab - The tab model containing its `id`, `name`, [`disabled`], [`invalid`], [`warning`].
|
|
27
29
|
* @param active - Whether the tab is currently active.
|
|
28
30
|
* @param [horizontal=false] - Whether the tab is displayed in horizontal orientation.
|
|
31
|
+
* @param [view=TabView.Default] - Visual style of the tab. Uses the {@link TabView} enum.
|
|
32
|
+
* `Inline` renders a compact pill with a leading check icon when active.
|
|
29
33
|
* @param onClick - Callback fired when the tab is clicked. Receives the tab’s `id`.
|
|
30
34
|
*/
|
|
31
35
|
export declare const DialTab: FC<DialTabProps>;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { TabModel } from '../../models/tab';
|
|
3
|
-
import { ScreenResolution, TabOrientation } from '../../types/tab';
|
|
3
|
+
import { ScreenResolution, TabOrientation, TabView } from '../../types/tab';
|
|
4
4
|
export interface DialTabsProps {
|
|
5
5
|
tabs: TabModel[];
|
|
6
6
|
activeTab: string;
|
|
7
7
|
onClick: (id: string) => void;
|
|
8
8
|
orientation?: TabOrientation;
|
|
9
|
+
view?: TabView;
|
|
9
10
|
className?: string;
|
|
10
11
|
screenThreshold?: ScreenResolution;
|
|
11
12
|
smallScreenContainerClassName?: string;
|
|
12
13
|
smallScreenDropdownItemClassName?: string;
|
|
13
14
|
desktopDropdownClassName?: string;
|
|
14
15
|
desktopTabClassName?: string;
|
|
16
|
+
inlineContainerClassName?: string;
|
|
17
|
+
inlineTabClassName?: string;
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
20
|
* A responsive and overflow-aware tabs component that automatically adapts its layout
|
|
@@ -48,6 +51,9 @@ export interface DialTabsProps {
|
|
|
48
51
|
* @param activeTab - The identifier of the currently active tab.
|
|
49
52
|
* @param onClick - Callback fired when a tab is selected. Receives the tab's `id` as an argument.
|
|
50
53
|
* @param [orientation=TabOrientation.Horizontal] - Layout direction of the tabs. Uses the {@link TabOrientation} enum.
|
|
54
|
+
* @param [view=TabView.Default] - Visual style of the tabs. Uses the {@link TabView} enum.
|
|
55
|
+
* `Inline` renders a compact segmented control where the active tab is marked with a
|
|
56
|
+
* leading check icon. The inline view is not responsive and ignores overflow/dropdown logic.
|
|
51
57
|
* @param [screenThreshold=ScreenResolution.Tablet] - Defines the screen size threshold
|
|
52
58
|
* below which tabs collapse into a dropdown. Uses the {@link ScreenRelosution} enum.
|
|
53
59
|
* When set to `Tablet`, both mobile and tablet screens will trigger dropdown mode.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
export { DialCaptionText, DialErrorText, } from './components/CaptionText/CaptionText';
|
|
2
|
+
export { DialAnalyticsCard } from './components/Analytics';
|
|
3
|
+
export type { DialAnalyticsCardProps } from './components/Analytics';
|
|
4
|
+
export { AnalyticsCardVariant } from './types/analytics';
|
|
5
|
+
export { DialAnalyticsBar } from './components/Analytics';
|
|
6
|
+
export type { DialAnalyticsBarProps } from './components/Analytics';
|
|
7
|
+
export { DEFAULT_ANALYTICS_BAR_COLOR_MAP } from './components/Analytics';
|
|
8
|
+
export type { AnalyticsBarColorStop } from './models/analytics';
|
|
9
|
+
export { DialAnalyticsErrorTag } from './components/Analytics';
|
|
10
|
+
export type { DialAnalyticsErrorTagProps } from './components/Analytics';
|
|
11
|
+
export { DialAnalyticsBarGroup } from './components/Analytics';
|
|
12
|
+
export type { DialAnalyticsBarGroupProps } from './components/Analytics';
|
|
13
|
+
export { DialAnalyticsHistogram } from './components/Analytics';
|
|
14
|
+
export type { DialAnalyticsHistogramProps } from './components/Analytics';
|
|
2
15
|
export { DialLabel } from './components/Label/Label';
|
|
16
|
+
export { DialAccordion } from './components/Accordion/Accordion';
|
|
17
|
+
export type { DialAccordionProps } from './components/Accordion/Accordion';
|
|
3
18
|
export { DialIcon } from './components/Icon/Icon';
|
|
4
19
|
export { DialNotification } from './components/Notification/Notification.tsx';
|
|
5
20
|
export { DialLoader } from './components/Loader/Loader';
|
|
@@ -47,6 +62,8 @@ export type { DialFabButtonProps } from './components/FabButton/FabButton';
|
|
|
47
62
|
export { DialTextarea } from './components/Textarea/Textarea';
|
|
48
63
|
export { DialTooltip } from './components/Tooltip/Tooltip';
|
|
49
64
|
export { DialSwitch } from './components/Switch/Switch';
|
|
65
|
+
export { DialSegmentedControl } from './components/SegmentedControl/SegmentedControl';
|
|
66
|
+
export type { DialSegmentedControlProps } from './components/SegmentedControl/SegmentedControl';
|
|
50
67
|
export { DialPopup } from './components/Popup/Popup';
|
|
51
68
|
export { DialConfirmationPopup } from './components/ConfirmationPopup/ConfirmationPopup';
|
|
52
69
|
export { DialRadioGroupPopupField } from './components/RadioGroupPopupField/RadioGroupPopupField';
|
|
@@ -72,6 +89,7 @@ export { DialFileManager } from './components/FileManager/FileManager';
|
|
|
72
89
|
export type { FileManagerGridRow } from './components/FileManager/FileManagerContext';
|
|
73
90
|
export type { GridOptions, ToolbarOptions, BulkActionsToolbarOptions, } from './components/FileManager/FileManager';
|
|
74
91
|
export { DialDestinationFolderPopup } from './components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup';
|
|
92
|
+
export { DialFoldersTree } from './components/FileManager/components/FoldersTree/FoldersTree.tsx';
|
|
75
93
|
export { NotificationVariant } from './types/notification.ts';
|
|
76
94
|
export { ButtonVariant, ButtonAppearance } from './types/button';
|
|
77
95
|
export { RadioGroupOrientation } from './types/radio-group';
|
|
@@ -79,7 +97,7 @@ export { PopupSize } from './types/popup';
|
|
|
79
97
|
export { ConfirmationPopupVariant } from './types/confirmation-popup';
|
|
80
98
|
export { DropdownType, DropdownTrigger, DropdownItemType, } from './types/dropdown';
|
|
81
99
|
export { ElementSize } from './types/size';
|
|
82
|
-
export { TabOrientation } from './types/tab';
|
|
100
|
+
export { TabOrientation, TabView } from './types/tab';
|
|
83
101
|
export type { DialBreadcrumbPathItem } from './models/breadcrumb';
|
|
84
102
|
export { FormItemOrientation } from './types/form-item';
|
|
85
103
|
export { SelectSize, SelectVariant } from './types/select';
|
|
@@ -96,6 +114,7 @@ export { StepStatus } from './models/step';
|
|
|
96
114
|
export type { Step } from './models/step';
|
|
97
115
|
export type { RadioButtonWithContent } from './models/radio';
|
|
98
116
|
export type { SelectOption } from './models/select';
|
|
117
|
+
export type { SegmentedControlOption } from './models/segmented-control';
|
|
99
118
|
export type { TabModel } from './models/tab';
|
|
100
119
|
export type { DropdownItem } from './models/dropdown';
|
|
101
120
|
export type { DialModifiedEntity } from './models/base-entity';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface AnalyticsBarColorStop {
|
|
2
|
+
/** Lower bound of the band (exclusive), as a ratio of value to maxValue (0–1). */
|
|
3
|
+
from: number;
|
|
4
|
+
/** Upper bound of the band (inclusive), as a ratio of value to maxValue (0–1). */
|
|
5
|
+
to: number;
|
|
6
|
+
/** CSS color applied to the fill when the ratio falls within this band. */
|
|
7
|
+
color: string;
|
|
8
|
+
}
|
|
@@ -2,6 +2,12 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export interface SelectOption {
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
5
|
+
/**
|
|
6
|
+
* Custom node rendered in place of `label` in the option list, trigger and
|
|
7
|
+
* submenu. `label` is still used for filtering/search matching and as the
|
|
8
|
+
* accessible name, so keep it as a plain-text representation of `labelNode`.
|
|
9
|
+
*/
|
|
10
|
+
labelNode?: ReactNode;
|
|
5
11
|
description?: string;
|
|
6
12
|
disabled?: boolean;
|
|
7
13
|
icon?: ReactNode;
|
package/dist/src/types/tab.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-ui-kit",
|
|
3
|
-
"version": "0.12.0-dev.
|
|
3
|
+
"version": "0.12.0-dev.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "A modern UI kit for building AI DIAL interfaces with React",
|
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
"lodash": "4.18.1",
|
|
72
72
|
"dompurify": "3.4.10",
|
|
73
73
|
"shell-quote": "1.8.4",
|
|
74
|
-
"esbuild": "0.28.1"
|
|
74
|
+
"esbuild": "0.28.1",
|
|
75
|
+
"undici": "^6.27.0"
|
|
75
76
|
},
|
|
76
77
|
"dependencies": {
|
|
77
78
|
"ag-grid-community": "^35.2.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-5EdIfkh9.cjs"),o=require("./editor-Ba3vCFHk.cjs"),u=require("@monaco-editor/react"),c={[o.EditorThemes.dark]:{base:"vs-dark",inherit:!1,rules:[{token:"string.key.json",foreground:"#37BABC"},{token:"string.value.json",foreground:"#5C8DEA"},{token:"number",foreground:"#D97C27"},{token:"keyword.json",foreground:"#F4CE46"},{token:"delimiter",foreground:"#EEF1F7"},{token:"delimiter.bracket.json",foreground:"#A972FF"},{token:"delimiter.parenthesis",foreground:"#A972FF"}],colors:{"editor.foreground":"#F76464","editor.background":"#161B2D","editorCursor.foreground":"#EEF1F7","editor.selectionBackground":"#5C8DEA2B","editorLineNumber.foreground":"#242C42","scrollbarSlider.background":"#242C42","scrollbarSlider.hoverBackground":"#242C42","scrollbarSlider.activeBackground":"#242C42"}},[o.EditorThemes.light]:{base:"vs",inherit:!1,rules:[{token:"string.key.json",foreground:"#009D9F"},{token:"string.value.json",foreground:"#2764D9"},{token:"number",foreground:"#B25500"},{token:"keyword.json",foreground:"#3F3D25"},{token:"delimiter",foreground:"#161B2D"},{token:"delimiter.bracket.json",foreground:"#7E39EC"},{token:"delimiter.parenthesis",foreground:"#7E39EC"}],colors:{"editor.foreground":"#AE2F2F","editor.background":"#EEF1F7","editorCursor.foreground":"#161B2D","editor.selectionBackground":"#5C8DEA2B","editorLineNumber.foreground":"#242C42","scrollbarSlider.background":"#242C42","scrollbarSlider.hoverBackground":"#242C42","scrollbarSlider.activeBackground":"#242C42"}}},g=({value:t,onChange:n,onValidateJSON:i,options:s,currentTheme:e,themesConfig:d=c})=>{function a(r){r?.editor?.defineTheme(e,d[e]),r.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:[{uri:"http://custom-schema/object-required.json",fileMatch:["*"],schema:{type:"object",description:"Top-level value must be an object",additionalProperties:!0}}]})}return l.jsxRuntimeExports.jsx(u.Editor,{beforeMount:a,height:"100%",defaultLanguage:"json",value:t,onChange:n,theme:e,onValidate:i,options:{minimap:{enabled:!1},formatOnType:!0,formatOnPaste:!0,selectOnLineNumbers:!1,automaticLayout:!0,scrollBeyondLastLine:!1,wordWrap:"on",smoothScrolling:!0,overviewRulerLanes:0,scrollbar:{horizontal:"hidden",verticalScrollbarSize:4,verticalSliderSize:4},...s??{}}})};exports.DialJsonEditor=g;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { j as o, m as l } from "./index-Cq70XHZ5.js";
|
|
2
|
-
import c from "@uiw/react-md-editor";
|
|
3
|
-
import { E as x } from "./editor-Cu1dRT39.js";
|
|
4
|
-
const E = ({
|
|
5
|
-
value: e,
|
|
6
|
-
onChange: s,
|
|
7
|
-
height: r = 300,
|
|
8
|
-
preview: a = "edit",
|
|
9
|
-
theme: i = x.dark,
|
|
10
|
-
className: d,
|
|
11
|
-
placeholder: t
|
|
12
|
-
}) => {
|
|
13
|
-
const m = t !== void 0 && !e;
|
|
14
|
-
return /* @__PURE__ */ o.jsxs(
|
|
15
|
-
"div",
|
|
16
|
-
{
|
|
17
|
-
"data-color-mode": i,
|
|
18
|
-
className: l("relative", d),
|
|
19
|
-
children: [
|
|
20
|
-
/* @__PURE__ */ o.jsx(
|
|
21
|
-
c,
|
|
22
|
-
{
|
|
23
|
-
value: e,
|
|
24
|
-
onChange: (n) => s?.(n || ""),
|
|
25
|
-
height: r,
|
|
26
|
-
preview: a
|
|
27
|
-
}
|
|
28
|
-
),
|
|
29
|
-
m && /* @__PURE__ */ o.jsx("div", { className: "pointer-events-none absolute left-0 top-8 px-2 dial-small-text text-secondary opacity-40", children: t })
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
E as DialMarkdownEditor
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-5EdIfkh9.cjs"),c=require("@uiw/react-md-editor"),x=require("./editor-Ba3vCFHk.cjs"),m=({value:t,onChange:r,height:s=300,preview:i="edit",theme:n=x.EditorThemes.dark,className:d,placeholder:o})=>{const a=o!==void 0&&!t;return e.jsxRuntimeExports.jsxs("div",{"data-color-mode":n,className:e.mergeClasses("relative",d),children:[e.jsxRuntimeExports.jsx(c,{value:t,onChange:l=>r?.(l||""),height:s,preview:i}),a&&e.jsxRuntimeExports.jsx("div",{className:"pointer-events-none absolute left-0 top-8 px-2 dial-small-text text-secondary opacity-40",children:o})]})};exports.DialMarkdownEditor=m;
|
package/dist/editor-Ba3vCFHk.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var t=(r=>(r.dark="dark",r.light="light",r))(t||{});exports.EditorThemes=t;
|
package/dist/editor-Cu1dRT39.js
DELETED