@epam/ai-dial-ui-kit 0.3.0-rc.53 → 0.3.0-rc.54

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.
@@ -1,21 +1,13 @@
1
1
  import { FC, ReactNode } from 'react';
2
- import { FormItemOrientation } from '../../types/form-item';
3
- export interface DialFormItemProps {
2
+ import { DialFormItemBaseProps } from '../../types/form-item';
3
+ export interface DialFormItemProps extends DialFormItemBaseProps {
4
4
  elementId: string;
5
- label?: string | ReactNode;
6
- optional?: boolean;
7
- optionalText?: string;
8
- description?: string;
9
- error?: string | ReactNode | boolean;
10
- orientation?: FormItemOrientation;
11
5
  labelVisuallyHidden?: boolean;
12
6
  cssClass?: string;
13
7
  childrenCssClass?: string;
14
8
  labelCssClass?: string;
15
9
  errorCssClass?: string;
16
10
  children: ReactNode;
17
- captionDescription?: string;
18
- readonly?: boolean;
19
11
  value?: ReactNode | string;
20
12
  defaultEmptyText?: string;
21
13
  }
@@ -56,22 +48,17 @@ export interface DialFormItemProps {
56
48
  * </DialFormItem>
57
49
  * ```
58
50
  *
51
+ * @params - Component properties extending:
52
+ * - {@link DialFormItemBaseProps} - Form item properties (label, error, description, orientation, etc.)
53
+ *
59
54
  * @param elementId - Unique identifier for the form control element (used for accessibility)
60
- * @param [label] - The label text or ReactNode to display above the form control
61
- * @param [optional=false] - Whether the field is optional (displays "(Optional)" indicator)
62
- * @param [optionalText="(Optional)"] - Custom text for optional indicator
63
- * @param [description] - Additional description text, displayed below the label.
64
- * @param [error] - Error message text or ReactNode to display below the form control (replaces description when present)
65
- * @param [orientation='vertical'] - Layout orientation, either 'vertical' (label above control) or 'horizontal' (label to the left)
66
- * @param [labelVisuallyHidden=false] - Whether to visually hide the label (still accessible to screen readers)
67
- * @param [cssClass] - Additional CSS classes to apply to the container div
68
- * @param [childrenCssClass] - Additional CSS classes to apply to the children container div
69
- * @param [labelCssClass] - Additional CSS classes to apply to the label element
70
- * @param [errorCssClass] - Additional CSS classes to apply to the error message element
71
- * @param [captionDescription] - Additional caption description text, displayed below the form control.
72
- * @param [readonly=false] - Whether the form control is read-only (displays value as text, no input element)
73
- * @param [value] - The current value of the form control
74
- * @param [defaultEmptyText="None"] - Text to display when readonly and value is empty
55
+ * @param labelVisuallyHidden - Whether to visually hide the label (still accessible to screen readers, default: false)
56
+ * @param cssClass - Additional CSS classes to apply to the container div
57
+ * @param childrenCssClass - Additional CSS classes to apply to the children container div
58
+ * @param labelCssClass - Additional CSS classes to apply to the label element
59
+ * @param errorCssClass - Additional CSS classes to apply to the error message element
75
60
  * @param children - The form control element(s) to render inside the DialFormItem
61
+ * @param value - The current value of the form control (for readonly mode)
62
+ * @param defaultEmptyText - Text to display when readonly and value is empty (default: "None")
76
63
  */
77
64
  export declare const DialFormItem: FC<DialFormItemProps>;
@@ -1,6 +1,6 @@
1
1
  import { FC, FocusEvent } from 'react';
2
- import { InputBaseProps } from '../../models/field-control-props';
3
- export interface DialInputProps extends InputBaseProps {
2
+ import { InputBaseProps, NumberInputBaseProps } from '../../models/field-control-props';
3
+ export interface DialInputProps extends InputBaseProps, Partial<NumberInputBaseProps> {
4
4
  type?: string;
5
5
  containerCssClass?: string;
6
6
  cssClass?: string;
@@ -24,28 +24,17 @@ export interface DialInputProps extends InputBaseProps {
24
24
  * />
25
25
  * ```
26
26
  *
27
- * @param elementId - Unique identifier for the input element
28
- * @param [value] - The current value of the input
29
- * @param [defaultValue] - The initial value of the input
30
- * @param [onChange] - Callback function called when the input value changes
31
- * @param [onBlur] - Callback function called when the input blurs
32
- * @param [iconBefore] - Icon or element to display before the input
33
- * @param [iconAfter] - Icon or element to display after the input
34
- * @param [placeholder] - Placeholder text displayed when input is empty
35
- * @param [containerCssClass] - Additional CSS classes to apply to the container div
36
- * @param [cssClass] - Additional CSS classes to apply to the input element
37
- * @param [type="text"] - The type of input (text, password, email, etc.)
38
- * @param [disabled=false] - Whether the input is disabled
39
- * @param [readonly=false] - Whether the input is read-only (prevents onChange from firing)
40
- * @param [invalid=false] - Whether the input has validation errors (applies error styling)
41
- * @param [hideBorder=false] - Whether to hide the input border styling
42
- * @param [min] - Minimum value for number inputs
43
- * @param [max] - Maximum value for number inputs
44
- * @param [prefix] - Text to display inside the input on the left
45
- * @param [suffix] - Text to display inside the input on the right
46
- * @param [textBeforeInput] - Text to display before the input in a separate field
47
- * @param [tooltipText] - The text to display inside the tooltip. If empty, the tooltip will display the value prop.
48
- * @param [tooltipTriggerClassName] - Additional CSS classes to apply to the tooltip
49
- * @param [textAfterInput] - Text to display after the input in a separate field
27
+ * @params Component properties extending:
28
+ * - {@link InputBaseProps} - Base input properties (elementId, value, placeholder, disabled, readonly, invalid, icons, etc.)
29
+ * - {@link NumberInputBaseProps} - Number input properties (min, max) - partial
30
+ *
31
+ * @param type - The HTML input type (text, password, email, number, etc.)
32
+ * @param containerCssClass - Additional CSS classes to apply to the container div
33
+ * @param cssClass - Additional CSS classes to apply to the input element
34
+ * @param hideBorder - Whether to hide the input border styling
35
+ * @param tooltipText - The text to display inside the tooltip. If empty, the tooltip will display the value prop.
36
+ * @param tooltipTriggerClassName - Additional CSS classes to apply to the tooltip
37
+ * @param onChange - Callback function called when the input value changes
38
+ * @param onBlur - Callback function called when the input blurs
50
39
  */
51
40
  export declare const DialInput: FC<DialInputProps>;
@@ -1,6 +1,7 @@
1
1
  import { FC } from 'react';
2
- import { FieldControlProps, InputBaseProps } from '../../models/field-control-props';
3
- export interface DialInputFieldBaseProps extends FieldControlProps, InputBaseProps {
2
+ import { FieldControlProps, InputBaseProps, NumberInputBaseProps } from '../../models/field-control-props';
3
+ import { DialFormItemBaseProps } from '../../types/form-item';
4
+ export interface DialInputFieldBaseProps extends FieldControlProps, DialFormItemBaseProps, InputBaseProps {
4
5
  value?: string | number;
5
6
  defaultEmptyText?: string;
6
7
  errorText?: string;
@@ -8,16 +9,12 @@ export interface DialInputFieldBaseProps extends FieldControlProps, InputBasePro
8
9
  elementContainerCssClass?: string;
9
10
  containerCssClass?: string;
10
11
  }
11
- export interface DialInputFieldProps extends DialInputFieldBaseProps {
12
+ export interface DialInputFieldProps extends DialInputFieldBaseProps, Partial<NumberInputBaseProps> {
12
13
  type: string;
13
14
  onChange?: (value?: string | number) => void;
14
- min?: number;
15
- max?: number;
16
15
  }
17
- export interface DialNumberInputFieldProps extends DialInputFieldBaseProps {
16
+ export interface DialNumberInputFieldProps extends DialInputFieldBaseProps, Partial<NumberInputBaseProps> {
18
17
  onChange?: (value?: number | string) => void;
19
- min?: number;
20
- max?: number;
21
18
  }
22
19
  /**
23
20
  * A number input field component
@@ -33,25 +30,14 @@ export interface DialNumberInputFieldProps extends DialInputFieldBaseProps {
33
30
  * />
34
31
  * ```
35
32
  *
36
- * @param elementId - Unique identifier for the input element
37
- * @param [fieldTitle] - The label text to display above the input
38
- * @param [placeholder] - Placeholder text shown when input is empty
39
- * @param [value] - The current numeric value of the input
40
- * @param [onChange] - Callback function called when the input value changes.
41
- * Returns either a number (for most values) or a string (for decimal values < 1 with leading zeros)
42
- * @param [optional=false] - Whether the field is optional
43
- * @param [disabled=false] - Whether the input is disabled
44
- * @param [readonly=false] - Whether the input is read-only
45
- * @param [invalid=false] - Whether the input has validation errors (applies error styling)
46
- * @param [errorText] - Error message text to display below the input
47
- * @param [defaultEmptyText="None"] - Text to display when readonly and value is empty
48
- * @param [iconBefore] - Icon or element to display before the input
49
- * @param [iconAfter] - Icon or element to display after the input
50
- * @param [elementCssClass] - Additional CSS classes to apply to the input element
51
- * @param [elementContainerCssClass] - Additional CSS classes to apply to the input container
52
- * @param [containerCssClass] - Additional CSS classes to apply to the DialNumberInputField container
53
- * @param [min] - Minimum allowed value for the number input
54
- * @param [max] - Maximum allowed value for the number input
33
+ * @params - Component properties extending:
34
+ * - {@link FieldControlProps} - Field control properties (fieldTitle, optional)
35
+ * - {@link DialFormItemBaseProps} - Form item properties (label, error, description, etc.)
36
+ * - {@link InputBaseProps} - Base input properties (elementId, value, placeholder, disabled, readonly, invalid, icons, etc.)
37
+ * - {@link NumberInputBaseProps} - Number input properties (min, max) - partial
38
+ *
39
+ * @param onChange - Callback function called when the input value changes.
40
+ * Returns either a number (for most values) or a string (for decimal values < 1 with leading zeros)
55
41
  */
56
42
  export declare const DialNumberInputField: FC<DialNumberInputFieldProps>;
57
43
  export interface DialTextInputFieldProps extends DialInputFieldBaseProps {
@@ -72,21 +58,11 @@ export interface DialTextInputFieldProps extends DialInputFieldBaseProps {
72
58
  * />
73
59
  * ```
74
60
  *
75
- * @param elementId - Unique identifier for the input element
76
- * @param [fieldTitle] - The label text to display above the input
77
- * @param [placeholder] - Placeholder text shown when input is empty
78
- * @param [value] - The current text value of the input
79
- * @param [onChange] - Callback function called when the input value changes, receives the new string value
80
- * @param [optional=false] - Whether the field is optional (displays "(Optional)" indicator)
81
- * @param [disabled=false] - Whether the input is disabled and cannot be interacted with
82
- * @param [readonly=false] - Whether the input is read-only (displays value as text, no input element)
83
- * @param [invalid=false] - Whether the input has validation errors (applies error styling)
84
- * @param [errorText] - Error message text to display below the input
85
- * @param [defaultEmptyText="None"] - Text to display when readonly and value is empty
86
- * @param [iconBefore] - Icon or element to display before the input
87
- * @param [iconAfter] - Icon or element to display after the input
88
- * @param [elementCssClass] - Additional CSS classes to apply to the input element
89
- * @param [elementContainerCssClass] - Additional CSS classes to apply to the input container
90
- * @param [containerCssClass] - Additional CSS classes to apply to the outer container
61
+ * @params - Component properties extending:
62
+ * - {@link FieldControlProps} - Field control properties (fieldTitle, optional)
63
+ * - {@link DialFormItemBaseProps} - Form item properties (label, error, description, etc.)
64
+ * - {@link InputBaseProps} - Base input properties (elementId, value, placeholder, disabled, readonly, invalid, icons, etc.)
65
+ *
66
+ * @param onChange - Callback function called when the input value changes, receives the new string value
91
67
  */
92
68
  export declare const DialTextInputField: FC<DialTextInputFieldProps>;
@@ -0,0 +1,3 @@
1
+ import { DialFormItemBaseProps } from '../../types/form-item';
2
+ import { ArgTypes } from '@storybook/react';
3
+ export declare const dialFormItemBaseArgTypes: Partial<ArgTypes<DialFormItemBaseProps>>;
@@ -0,0 +1,5 @@
1
+ import { FieldControlProps, InputBaseProps, NumberInputBaseProps } from '../../models/field-control-props';
2
+ import { ArgTypes } from '@storybook/react';
3
+ export declare const fieldControlArgTypes: Partial<ArgTypes<FieldControlProps>>;
4
+ export declare const inputBaseArgTypes: Partial<ArgTypes<InputBaseProps>>;
5
+ export declare const numberInputBaseArgTypes: Partial<ArgTypes<NumberInputBaseProps>>;
@@ -1,8 +1,31 @@
1
1
  import { ReactNode } from 'react';
2
+ /**
3
+ * Base properties for field controls providing label and optional status
4
+ *
5
+ * @param fieldTitle - The label text to display above the input field
6
+ * @param optional - Whether the field is optional (displays "(Optional)" indicator when true)
7
+ */
2
8
  export interface FieldControlProps {
3
9
  fieldTitle?: string;
4
10
  optional?: boolean;
5
11
  }
12
+ /**
13
+ * Base properties for input elements providing core input functionality
14
+ *
15
+ * @param elementId - Unique identifier for the input element
16
+ * @param value - The current value of the input (string, number, or null)
17
+ * @param defaultValue - The default value for the input
18
+ * @param placeholder - Placeholder text shown when input is empty
19
+ * @param disabled - Whether the input is disabled and cannot be interacted with
20
+ * @param readonly - Whether the input is read-only (displays value as text, no input element)
21
+ * @param invalid - Whether the input has validation errors (applies error styling)
22
+ * @param iconAfter - Icon or element to display after the input
23
+ * @param iconBefore - Icon or element to display before the input
24
+ * @param textBeforeInput - Text to display before the input
25
+ * @param textAfterInput - Text to display after the input
26
+ * @param prefix - Text to display inside the input on the left
27
+ * @param suffix - Text to display inside the input on the right
28
+ */
6
29
  export interface InputBaseProps {
7
30
  elementId: string;
8
31
  value?: string | number | null;
@@ -13,10 +36,18 @@ export interface InputBaseProps {
13
36
  invalid?: boolean;
14
37
  iconAfter?: ReactNode;
15
38
  iconBefore?: ReactNode;
16
- min?: number;
17
- max?: number;
18
39
  textBeforeInput?: string;
19
40
  textAfterInput?: string;
20
41
  prefix?: string;
21
42
  suffix?: string;
22
43
  }
44
+ /**
45
+ * Properties specific to numeric input controls for validation and formatting
46
+ *
47
+ * @param min - Minimum allowed value for the number input
48
+ * @param max - Maximum allowed value for the number input
49
+ */
50
+ export interface NumberInputBaseProps {
51
+ min?: number;
52
+ max?: number;
53
+ }
@@ -1,4 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Orientation options for form item layout
4
+ *
5
+ * @param Vertical - Vertical layout with label above the input
6
+ * @param Horizontal - Horizontal layout with label beside the input
7
+ */
1
8
  export declare enum FormItemOrientation {
2
9
  Vertical = "vertical",
3
10
  Horizontal = "horizontal"
4
11
  }
12
+ /**
13
+ * Base properties for form item components providing layout, labeling, and validation display
14
+ *
15
+ * @param label - The label text or element to display for the form item
16
+ * @param optional - Whether the field is optional (displays optional indicator)
17
+ * @param optionalText - Custom text to display for optional fields (default: "(Optional)")
18
+ * @param description - Description text to display below the label
19
+ * @param error - Error message, element, or boolean indicating validation state
20
+ * @param captionDescription - Additional caption or description text
21
+ * @param readonly - Whether the form item is in read-only mode
22
+ * @param orientation - Layout orientation for the form item
23
+ */
24
+ export interface DialFormItemBaseProps {
25
+ label?: string | ReactNode;
26
+ optional?: boolean;
27
+ optionalText?: string;
28
+ description?: string;
29
+ error?: string | ReactNode | boolean;
30
+ captionDescription?: string;
31
+ readonly?: boolean;
32
+ orientation?: FormItemOrientation;
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.3.0-rc.53",
3
+ "version": "0.3.0-rc.54",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",