@epam/ai-dial-ui-kit 0.12.0-dev.8 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +9 -0
- package/dist/JsonEditor-ClTI8-LY.cjs +1 -0
- package/dist/{JsonEditor-C5I5sYht.js → JsonEditor-DjEsE74s.js} +3 -4
- package/dist/MarkdownEditor-BMApEDVP.cjs +1 -0
- package/dist/MarkdownEditor-DlKjo9LA.js +35 -0
- package/dist/components-manifest.json +442 -3
- package/dist/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +137 -126
- package/dist/{index-CwuDpFCz.cjs → index-Bl2M9QgI.cjs} +31 -31
- package/dist/{index-BB-aX52k.js → index-bLYIiSd_.js} +12664 -11833
- 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 +89 -0
- package/dist/src/components/Analytics/Card/Card.d.ts +80 -0
- package/dist/src/components/Analytics/ErrorTag/ErrorTag.d.ts +21 -0
- package/dist/src/components/Analytics/Histogram/Histogram.d.ts +56 -0
- package/dist/src/components/Analytics/Histogram/utils.d.ts +39 -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 +2 -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/context.d.ts +3 -0
- package/dist/src/components/SchemaRenderer/types.d.ts +14 -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/Select/Select.d.ts +3 -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 +15 -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 +1 -1
- package/dist/JsonEditor-BJZNbUaI.cjs +0 -1
- package/dist/MarkdownEditor-V1kWnFFC.js +0 -36
- package/dist/MarkdownEditor-_e6afNxe.cjs +0 -1
- package/dist/editor-Ba3vCFHk.cjs +0 -1
- package/dist/editor-Cu1dRT39.js +0 -4
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { AnalyticsCardCompareItem } from '../../../models/analytics';
|
|
3
|
+
import { AnalyticsCardVariant } from '../../../types/analytics';
|
|
4
|
+
export interface DialAnalyticsCardProps {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
value?: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
variant?: AnalyticsCardVariant;
|
|
9
|
+
/** Renders an error tag in place of the value when the value is unavailable. */
|
|
10
|
+
error?: boolean;
|
|
11
|
+
/** Renders a loader in place of the value while the value is being fetched. */
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
/** Additional CSS classes for the outer container. */
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* When provided, shows a delta badge next to the title.
|
|
17
|
+
* Values ≥ 0 use `bg-success text-success`; negative values use error styles.
|
|
18
|
+
* Positive values are prefixed with `+`.
|
|
19
|
+
*/
|
|
20
|
+
delta?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Overrides the automatic sign-based style of the delta badge.
|
|
23
|
+
* Use when a positive delta is semantically bad (e.g. response time went up)
|
|
24
|
+
* or a negative delta is semantically good (e.g. error rate went down).
|
|
25
|
+
* When omitted, `delta ≥ 0` → success, `delta < 0` → error.
|
|
26
|
+
*/
|
|
27
|
+
deltaPositive?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* When provided, enables compare mode: the value area is split 50/50 with a
|
|
30
|
+
* vertical divider and each side shows its own sub-title and value.
|
|
31
|
+
* `value` is ignored when `compareValues` is set.
|
|
32
|
+
*/
|
|
33
|
+
compareValues?: [AnalyticsCardCompareItem, AnalyticsCardCompareItem];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A simple analytics summary card that displays a single metric as a title,
|
|
37
|
+
* a prominent value, and an optional description.
|
|
38
|
+
* aliases: MetricCard|StatCard|KpiCard
|
|
39
|
+
*
|
|
40
|
+
* Two visual variants are available via the {@link AnalyticsCardVariant} enum:
|
|
41
|
+
* - `Default` — `bg-layer-3`, large `dial-display2-text` value, supports a description.
|
|
42
|
+
* - `Compact` — denser `bg-layer-2` card with a `dial-body-semi-text` value and no
|
|
43
|
+
* description (the `description` prop is ignored in this variant).
|
|
44
|
+
*
|
|
45
|
+
* **Compare mode** — pass `compareValues` to split the value area 50/50 between two
|
|
46
|
+
* metrics, each with its own sub-title. Pair with `delta` to show a change badge next
|
|
47
|
+
* to the card title.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <DialAnalyticsCard
|
|
52
|
+
* title="Total requests"
|
|
53
|
+
* value="12,480"
|
|
54
|
+
* description="+12% vs last week"
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <DialAnalyticsCard
|
|
61
|
+
* title="Response time"
|
|
62
|
+
* delta={12}
|
|
63
|
+
* compareValues={[
|
|
64
|
+
* { title: 'This week', value: '248ms' },
|
|
65
|
+
* { title: 'Last week', value: '220ms' },
|
|
66
|
+
* ]}
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @param title - Short label describing the metric, rendered above the value.
|
|
71
|
+
* @param [value] - The primary metric value. Ignored when `compareValues` is set.
|
|
72
|
+
* @param [description] - Optional supporting text. Ignored when `variant` is `Compact`.
|
|
73
|
+
* @param [variant=AnalyticsCardVariant.Default] - Visual style of the card.
|
|
74
|
+
* @param [error] - Renders an error tag in place of the value.
|
|
75
|
+
* @param [isLoading] - Renders a loader in place of the value.
|
|
76
|
+
* @param [className] - Additional CSS classes for the card container.
|
|
77
|
+
* @param [delta] - Numeric change shown as a badge next to the title. ≥0 = success, <0 = error.
|
|
78
|
+
* @param [compareValues] - Enables compare mode with two side-by-side metrics.
|
|
79
|
+
*/
|
|
80
|
+
export declare const DialAnalyticsCard: FC<DialAnalyticsCardProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface DialAnalyticsErrorTagProps {
|
|
3
|
+
/** Text shown inside the tag. Defaults to `'Error'`. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Additional CSS classes applied to the tag. */
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A non-interactive error tag used across analytics components to indicate that a
|
|
10
|
+
* metric value could not be provided. Renders a {@link DialTag} styled with the
|
|
11
|
+
* error palette (`bg-error`, `text-error`, `border-error`).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <DialAnalyticsErrorTag />
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @param [label='Error'] - Text shown inside the tag.
|
|
19
|
+
* @param [className] - Additional CSS classes applied to the tag.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DialAnalyticsErrorTag: FC<DialAnalyticsErrorTagProps>;
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
/** Second set of values to overlay in compare mode. Each column renders as a paired striped bar. */
|
|
22
|
+
compareValues?: number[];
|
|
23
|
+
/** Label for the primary values set, shown on the first tooltip line in compare mode. */
|
|
24
|
+
valueSetLabel?: string;
|
|
25
|
+
/** Label for the compare values set, shown on the first tooltip line in compare mode. */
|
|
26
|
+
compareValueSetLabel?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A histogram that distributes `values` across the bands of a color map and draws a
|
|
30
|
+
* column per band. Each column's height is relative to the most populated band; empty
|
|
31
|
+
* columns are outlined, populated columns are filled with their band color. A baseline
|
|
32
|
+
* separates the columns from the interval labels, and hovering a column reveals a
|
|
33
|
+
* tooltip with its share of the total.
|
|
34
|
+
* aliases: Distribution|ColumnChart|FrequencyChart
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <DialAnalyticsHistogram
|
|
39
|
+
* title="Score distribution"
|
|
40
|
+
* values={[0.1, 0.15, 0.4, 0.42, 0.43, 0.9, 1]}
|
|
41
|
+
* valueTitle="responses"
|
|
42
|
+
* />
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @param title - Title rendered above the histogram.
|
|
46
|
+
* @param values - Values to distribute across the columns.
|
|
47
|
+
* @param [colorMap=DEFAULT_ANALYTICS_BAR_COLOR_MAP] - Color bands defining the columns.
|
|
48
|
+
* @param [valueTitle='values'] - Noun used in the hover tooltip.
|
|
49
|
+
* @param [showCount] - When `true`, renders each column's count inside its bar.
|
|
50
|
+
* @param [isLoading] - Renders a loader in place of the histogram while the data is being fetched.
|
|
51
|
+
* @param [className] - Additional CSS classes for the outer container.
|
|
52
|
+
* @param [compareValues] - Second set of values; enables compare mode with paired striped columns.
|
|
53
|
+
* @param [valueSetLabel] - Label for the primary values set (compare mode tooltip).
|
|
54
|
+
* @param [compareValueSetLabel] - Label for the compare values set (compare mode tooltip).
|
|
55
|
+
*/
|
|
56
|
+
export declare const DialAnalyticsHistogram: FC<DialAnalyticsHistogramProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AnalyticsBarColorStop } from '../../../models/analytics';
|
|
2
|
+
/** Fill color for the zero-bucket column (values of exactly `0`). */
|
|
3
|
+
export declare const ZERO_BUCKET_COLOR = "#FF4E50";
|
|
4
|
+
export interface AnalyticsHistogramColumn {
|
|
5
|
+
/** Lower bound of the column's interval. */
|
|
6
|
+
from: number;
|
|
7
|
+
/** Upper bound of the column's interval. */
|
|
8
|
+
to: number;
|
|
9
|
+
/** Fill color for the column, or `undefined` for the empty zero bucket. */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** Number of values that fall into this column's interval. */
|
|
12
|
+
count: number;
|
|
13
|
+
/** Column height as a ratio of the tallest column (0–1). */
|
|
14
|
+
ratio: number;
|
|
15
|
+
/** Whether this is the leading empty bucket for values of exactly `0`. */
|
|
16
|
+
isZeroBucket: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Returns the index of the color-map band a positive value belongs to, or `-1`
|
|
20
|
+
* when no band matches (including an empty map or a value of `0`, which is handled
|
|
21
|
+
* by the dedicated zero bucket). A band's lower bound is exclusive and its upper
|
|
22
|
+
* bound inclusive, so boundary values belong to the lower band; the last matching
|
|
23
|
+
* band wins, which lets an exact full band (`{ from: 1, to: 1 }`) capture the maximum.
|
|
24
|
+
*/
|
|
25
|
+
export declare const getHistogramColumnIndex: (value: number, colorMap: AnalyticsBarColorStop[]) => number;
|
|
26
|
+
/**
|
|
27
|
+
* Builds the histogram columns: a leading empty zero bucket (values of exactly `0`)
|
|
28
|
+
* followed by one column per color-map band. Counts how many `values` fall into each
|
|
29
|
+
* column and computes each column's height as a ratio of the tallest column.
|
|
30
|
+
*/
|
|
31
|
+
export declare const buildHistogramColumns: (values: number[], colorMap: AnalyticsBarColorStop[]) => AnalyticsHistogramColumn[];
|
|
32
|
+
/** Formats a column's interval bound for the axis label (trims float noise). */
|
|
33
|
+
export declare const formatHistogramInterval: (value: number) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Builds the legend label for a column: a single number for an exact band
|
|
36
|
+
* (`from === to`, e.g. the full band), otherwise a `from-to` range.
|
|
37
|
+
* For the default map this yields `0-0.1, 0.1-0.2, …, 0.9-1, 1`.
|
|
38
|
+
*/
|
|
39
|
+
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, AnalyticsCardCompareItem, } 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
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const breadcrumbItemLastClassName = "flex-1 min-w-0";
|
|
4
|
+
export declare const breadcrumbItemBaseClassName = "flex items-center gap-2 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;
|
|
@@ -286,6 +287,7 @@ export interface DialFileManagerProps {
|
|
|
286
287
|
*
|
|
287
288
|
* @param [onUploadArchive] - Callback fired when archive files are uploaded
|
|
288
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.
|
|
289
291
|
* @param [onValidateUpload] - Callback to validate files before upload
|
|
290
292
|
* @param [maxFileSize] - Maximum allowed file size for uploads in bytes
|
|
291
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,11 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { JsonSchema, JsonSchemaDef, SchemaRendererTexts } from './types';
|
|
3
|
+
import { EditorThemes } from '../../types/editor';
|
|
3
4
|
interface SchemaRendererContextValue {
|
|
4
5
|
rootSchema: JsonSchema;
|
|
5
6
|
texts: SchemaRendererTexts;
|
|
6
7
|
readonly?: boolean;
|
|
7
8
|
defaultExpanded?: boolean;
|
|
8
9
|
inputClassName?: string;
|
|
10
|
+
jsonEditorTheme?: EditorThemes;
|
|
11
|
+
acceptableResourceTypes?: Record<string, unknown>;
|
|
9
12
|
renderField?: (path: string[], schema: JsonSchemaDef, defaultElement: React.ReactElement) => React.ReactNode;
|
|
10
13
|
touchedPaths?: ReadonlySet<string>;
|
|
11
14
|
markTouched?: (path: string) => void;
|
|
@@ -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",
|
|
@@ -46,6 +47,7 @@ export interface JsonSchemaDef {
|
|
|
46
47
|
};
|
|
47
48
|
'dial:meta'?: Record<string, unknown>;
|
|
48
49
|
'dial:resource'?: boolean;
|
|
50
|
+
acceptableResourceTypes?: string[];
|
|
49
51
|
[key: string]: unknown;
|
|
50
52
|
}
|
|
51
53
|
export interface JsonSchema extends JsonSchemaDef {
|
|
@@ -94,6 +96,18 @@ export interface DialSchemaRendererProps {
|
|
|
94
96
|
* with a field. When `false` (default), all unfilled required fields are highlighted immediately.
|
|
95
97
|
*/
|
|
96
98
|
skipUntouched?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Theme applied to the JSON editor shown for value keys that are not declared in the
|
|
101
|
+
* schema's `properties`. Defaults to `EditorThemes.dark`.
|
|
102
|
+
*/
|
|
103
|
+
jsonEditorTheme?: EditorThemes;
|
|
104
|
+
/**
|
|
105
|
+
* Live resource options for schema properties flagged with `dial:resource: true`.
|
|
106
|
+
* Keyed by the resource type name referenced in a property's `acceptableResourceTypes`
|
|
107
|
+
* array; each value provides the selectable entries for that resource type (a string
|
|
108
|
+
* array for string-typed properties).
|
|
109
|
+
*/
|
|
110
|
+
acceptableResourceTypes?: Record<string, unknown>;
|
|
97
111
|
onChange?: (value: Record<string, unknown>) => void;
|
|
98
112
|
onPropertyChange?: (path: string, value: unknown) => void;
|
|
99
113
|
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,6 +1,7 @@
|
|
|
1
1
|
import { FC, ReactNode, MouseEvent, Ref } from 'react';
|
|
2
2
|
import { SelectOption } from '../../models/select';
|
|
3
3
|
import { SelectSize, SelectVariant } from '../../types/select';
|
|
4
|
+
import { ElementSize } from '../../types/size';
|
|
4
5
|
export interface DialSelectProps {
|
|
5
6
|
options: SelectOption[];
|
|
6
7
|
multiple?: boolean;
|
|
@@ -13,6 +14,7 @@ export interface DialSelectProps {
|
|
|
13
14
|
defaultValue?: string | string[];
|
|
14
15
|
placeholder?: string;
|
|
15
16
|
searchable?: boolean;
|
|
17
|
+
searchSize?: ElementSize;
|
|
16
18
|
searchPlaceholder?: string;
|
|
17
19
|
selectAll?: boolean;
|
|
18
20
|
selectAllLabel?: string;
|
|
@@ -71,6 +73,7 @@ export interface DialSelectProps {
|
|
|
71
73
|
* @param [defaultValue] - Uncontrolled initial selected value(s).
|
|
72
74
|
* @param [placeholder="Select..."] - Placeholder text when no selection is made.
|
|
73
75
|
* @param [searchable=false] - Show a search field in the overlay header.
|
|
76
|
+
* @param [searchSize=ElementSize.Standard] - Size of the overlay search input when `searchable` is enabled.
|
|
74
77
|
* @param [searchPlaceholder] - Placeholder for the search input (overlay/inline).
|
|
75
78
|
* @param [selectAll=false] - Show a "Select All" checkbox in multiple mode.
|
|
76
79
|
* @param [selectAllLabel="Select all"] - Label for the "Select All" checkbox.
|
|
@@ -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, AnalyticsCardCompareItem, } 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';
|