@epam/ai-dial-ui-kit 0.6.0-rc.98 → 0.6.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, HTMLAttributes } from 'react';
|
|
1
|
+
import { FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { DialSkeletonVariant, DialSkeletonAvatarSize, DialSkeletonAvatarShape } from '../../types/skeleton';
|
|
3
3
|
export interface DialSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
active?: boolean;
|
|
@@ -14,7 +14,7 @@ export interface DialSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
14
14
|
width?: string;
|
|
15
15
|
};
|
|
16
16
|
loading?: boolean;
|
|
17
|
-
children?:
|
|
17
|
+
children?: ReactNode;
|
|
18
18
|
variant?: DialSkeletonVariant;
|
|
19
19
|
width?: string | number;
|
|
20
20
|
height?: string | number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
1
2
|
export interface UseEditableItemOptions {
|
|
2
3
|
value: string;
|
|
3
4
|
isEditing: boolean;
|
|
@@ -7,7 +8,7 @@ export interface UseEditableItemOptions {
|
|
|
7
8
|
restoreOnCancel?: boolean;
|
|
8
9
|
}
|
|
9
10
|
interface UseEditableItemResult {
|
|
10
|
-
inputRef:
|
|
11
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
11
12
|
value: string;
|
|
12
13
|
onChange: (newValue?: string) => void;
|
|
13
14
|
invalid: boolean;
|
|
@@ -27,7 +28,7 @@ interface UseEditableItemResult {
|
|
|
27
28
|
* @param {boolean} [options.restoreOnCancel=true] - Whether to restore the original value on cancel.
|
|
28
29
|
*
|
|
29
30
|
* @returns {Object} An object containing state and handlers for editable input.
|
|
30
|
-
* @returns {
|
|
31
|
+
* @returns {RefObject<HTMLInputElement>} return.inputRef - Ref to the editable input element.
|
|
31
32
|
* @returns {string} return.value - Current input value.
|
|
32
33
|
* @returns {(newValue?: string) => void} return.onChange - Change handler for the input value.
|
|
33
34
|
* @returns {boolean} return.invalid - Whether the current value is invalid.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* The value updates automatically when the element is resized.
|
|
7
7
|
*
|
|
8
8
|
* @param {number} breakpoint - The width in pixels used as the threshold. `isBelowBreakpoint` is true when the element's width is less than this value.
|
|
9
|
-
* @returns {{ containerRef:
|
|
9
|
+
* @returns {{ containerRef: RefObject<HTMLElement>, isBelowBreakpoint: boolean }} An object containing the ref to attach to your element and the boolean indicating if it is smaller than the breakpoint.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* const { containerRef, isBelowBreakpoint } = useWidthBreakpoint(600);
|