@livechat/design-system-react-components 2.17.0 → 2.19.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/components/AnimatedTextContainer/AnimatedTextContainer.d.ts +4 -0
- package/dist/components/AnimatedTextContainer/index.d.ts +1 -0
- package/dist/components/AnimatedTextContainer/types.d.ts +22 -0
- package/dist/components/AppFrame/components/NavigationTopBar/NavigationTopBar.d.ts +1 -1
- package/dist/components/AppFrame/components/NavigationTopBar/examples.d.ts +1 -0
- package/dist/components/AppFrame/stories-helpers.d.ts +1 -0
- package/dist/components/AutoComplete/types.d.ts +4 -0
- package/dist/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/components/FormField/FormField.d.ts +8 -0
- package/dist/components/Input/types.d.ts +4 -0
- package/dist/components/NumericInput/NumericInput.d.ts +1 -0
- package/dist/components/Picker/types.d.ts +4 -0
- package/dist/components/RadioButton/RadioButton.d.ts +1 -0
- package/dist/components/ReadOnlyText/ReadOnlyText.d.ts +11 -0
- package/dist/components/ReadOnlyText/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.d.ts +3 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Stepper/types.d.ts +19 -0
- package/dist/components/TagInput/TagInput.d.ts +1 -1
- package/dist/components/TagInput/types.d.ts +4 -0
- package/dist/components/Textarea/Textarea.d.ts +1 -0
- package/dist/components/Tooltip/components/index.d.ts +0 -1
- package/dist/components/Tooltip/index.d.ts +0 -1
- package/dist/components/Typography/index.d.ts +1 -0
- package/dist/components/Typography/types.d.ts +2 -1
- package/dist/components/UserGuide/UserGuide.d.ts +4 -0
- package/dist/components/UserGuide/components/UserGuideBubbleStep/UserGuideBubbleStep.d.ts +4 -0
- package/dist/components/UserGuide/components/UserGuideBubbleStep/types.d.ts +32 -0
- package/dist/components/UserGuide/components/UserGuideStep/UserGuideStep.d.ts +4 -0
- package/dist/components/UserGuide/components/UserGuideStep/types.d.ts +50 -0
- package/dist/components/UserGuide/components/index.d.ts +2 -0
- package/dist/components/UserGuide/index.d.ts +3 -0
- package/dist/components/UserGuide/stories-helpers.d.ts +5 -0
- package/dist/components/UserGuide/types.d.ts +42 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3583 -3553
- package/dist/providers/ReadOnlyFormFieldProvider.d.ts +16 -0
- package/dist/style.css +1 -1
- package/dist/utils/types.d.ts +4 -0
- package/package.json +3 -3
- package/dist/components/Tooltip/components/UserGuide/SpotlightOverlay.d.ts +0 -8
- package/dist/components/Tooltip/components/UserGuide/UserGuide.d.ts +0 -12
- package/dist/components/Tooltip/components/UserGuide/UserGuideStep.d.ts +0 -16
- package/dist/components/Tooltip/components/UserGuide/index.d.ts +0 -1
- /package/dist/components/{Tooltip/components/UserGuide → UserGuide}/virtualElementReference.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AnimatedTextContainer } from './AnimatedTextContainer';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface IAnimatedTextContainerProps {
|
|
2
|
+
/**
|
|
3
|
+
* Simple text to display
|
|
4
|
+
*/
|
|
5
|
+
text: string;
|
|
6
|
+
/**
|
|
7
|
+
* Should the text typing be animated
|
|
8
|
+
*/
|
|
9
|
+
typingAnimation?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Delay before typing starts
|
|
12
|
+
*/
|
|
13
|
+
typingDelay?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Typing animation speed
|
|
16
|
+
*/
|
|
17
|
+
typingSpeed?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Callback when typing animation ends
|
|
20
|
+
*/
|
|
21
|
+
onTypingEnd?: () => void;
|
|
22
|
+
}
|
|
@@ -10,7 +10,7 @@ import * as React from 'react';
|
|
|
10
10
|
* </NavigationTopBar>
|
|
11
11
|
*/
|
|
12
12
|
export declare const NavigationTopBar: {
|
|
13
|
-
({ children, className, additionalNodes, }: INavigationTopBarProps): React.ReactElement;
|
|
13
|
+
({ children, className, additionalNodes, id, }: INavigationTopBarProps): React.ReactElement;
|
|
14
14
|
Alert: React.FC<ITopBarAlertProps>;
|
|
15
15
|
Title: React.FC<ITopBarTitleProps>;
|
|
16
16
|
};
|
|
@@ -12,6 +12,7 @@ export declare const ExampleTopBar: React.FC<{
|
|
|
12
12
|
topBarVisible: boolean;
|
|
13
13
|
visibleAlert: number | null;
|
|
14
14
|
setVisibleAlert: (index: number | null) => void;
|
|
15
|
+
id?: string;
|
|
15
16
|
}>;
|
|
16
17
|
export declare const getBadgeContent: (item: string) => "dot" | "alert" | 5 | undefined;
|
|
17
18
|
export declare const getChatsMenu: (activeSubItem: number, handler: (o: number) => void) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,4 +24,8 @@ export interface AutoCompleteProps extends Omit<IInputProps, 'type'> {
|
|
|
24
24
|
single?: boolean;
|
|
25
25
|
/** If true, the option list will be hidden if there is only one option and it is an exact match to the input value. */
|
|
26
26
|
hideIfExactMatch?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Set the text to display with read-only state when there is no data. Default to 'No data'
|
|
29
|
+
*/
|
|
30
|
+
noDataFallbackText?: string;
|
|
27
31
|
}
|
|
@@ -4,6 +4,10 @@ export interface CheckboxProps extends React.HTMLAttributes<HTMLInputElement> {
|
|
|
4
4
|
* Specify whether the checkbox should be disabled
|
|
5
5
|
*/
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Specify whether the checkbox should be read only
|
|
9
|
+
*/
|
|
10
|
+
readOnly?: boolean;
|
|
7
11
|
/**
|
|
8
12
|
* Specify whether the checkbox should be checked
|
|
9
13
|
*/
|
|
@@ -12,6 +12,10 @@ export interface FormFieldProps {
|
|
|
12
12
|
* Define to associate the label with the field
|
|
13
13
|
*/
|
|
14
14
|
labelFor?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Makes the label text bold. Note: This prop should only be used together with PromoInput.
|
|
17
|
+
*/
|
|
18
|
+
boldLabel?: boolean;
|
|
15
19
|
/**
|
|
16
20
|
* The CSS class for field container
|
|
17
21
|
*/
|
|
@@ -36,5 +40,9 @@ export interface FormFieldProps {
|
|
|
36
40
|
* Renders given element above the filed
|
|
37
41
|
*/
|
|
38
42
|
labelRightNode?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the form field is read-only
|
|
45
|
+
*/
|
|
46
|
+
readOnly?: boolean;
|
|
39
47
|
}
|
|
40
48
|
export declare const FormField: React.FC<React.PropsWithChildren<FormFieldProps>>;
|
|
@@ -20,6 +20,10 @@ export interface IInputGlobalProps extends React.InputHTMLAttributes<HTMLInputEl
|
|
|
20
20
|
* Set to enable ellipsis
|
|
21
21
|
*/
|
|
22
22
|
cropOnBlur?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Set the text to display with read-only state when there is no data. Default to 'No data'
|
|
25
|
+
*/
|
|
26
|
+
noDataFallbackText?: string;
|
|
23
27
|
}
|
|
24
28
|
export interface IInputProps extends IInputGlobalProps {
|
|
25
29
|
/**
|
|
@@ -8,5 +8,6 @@ export type NumericInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
noControls?: boolean;
|
|
10
10
|
onChange: (value: string) => void;
|
|
11
|
+
noDataFallbackText?: string;
|
|
11
12
|
};
|
|
12
13
|
export declare const NumericInput: React.FC<React.PropsWithChildren<NumericInputProps>>;
|
|
@@ -146,4 +146,8 @@ export interface IPickerProps extends ComponentCoreProps {
|
|
|
146
146
|
* Additional props for the input element
|
|
147
147
|
*/
|
|
148
148
|
inputProps?: InputHTMLAttributes<HTMLInputElement> | Record<string, unknown>;
|
|
149
|
+
/**
|
|
150
|
+
* Set the text to display with read-only state when there is no data. Default to 'No data'
|
|
151
|
+
*/
|
|
152
|
+
noDataFallbackText?: string;
|
|
149
153
|
}
|
|
@@ -3,5 +3,6 @@ export interface RadioButtonProps extends React.HTMLAttributes<HTMLInputElement>
|
|
|
3
3
|
description?: React.ReactNode;
|
|
4
4
|
checked?: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
readOnly?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ReadOnlyTextProps {
|
|
2
|
+
/**
|
|
3
|
+
* The value to display
|
|
4
|
+
*/
|
|
5
|
+
value?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Text to show when no value is provided
|
|
8
|
+
*/
|
|
9
|
+
noDataFallbackText?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const ReadOnlyText: ({ value, noDataFallbackText, }: ReadOnlyTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Current active step (1-based)
|
|
5
|
+
*/
|
|
6
|
+
activeStep: number;
|
|
7
|
+
/**
|
|
8
|
+
* Total number of steps
|
|
9
|
+
*/
|
|
10
|
+
steps: number;
|
|
11
|
+
/**
|
|
12
|
+
* Custom class name
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional test id for testing
|
|
17
|
+
*/
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TagInputProps, TagInputValues } from './types';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
export declare const TagInput: <T extends TagInputValues>({ id, tags, onChange, validator, error, placeholder, size, className, inputClassName, onBlur, addOnBlur, ...props }: TagInputProps<T>) => React.ReactElement;
|
|
3
|
+
export declare const TagInput: <T extends TagInputValues>({ id, tags, onChange, validator, error, placeholder, size, className, inputClassName, onBlur, addOnBlur, readOnly, noDataFallbackText, ...props }: TagInputProps<T>) => React.ReactElement;
|
|
@@ -37,5 +37,9 @@ export interface TagInputProps<T> extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
37
37
|
* Add Tag on blur
|
|
38
38
|
*/
|
|
39
39
|
addOnBlur?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Set the text to display with read-only state when there is no data. Default to 'No data'
|
|
42
|
+
*/
|
|
43
|
+
noDataFallbackText?: string;
|
|
40
44
|
}
|
|
41
45
|
export type TagInputValues = string | Omit<TagProps, 'onRemove' | 'dismissible'>;
|
|
@@ -2,5 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
3
|
className?: string;
|
|
4
4
|
error?: boolean;
|
|
5
|
+
noDataFallbackText?: string;
|
|
5
6
|
}
|
|
6
7
|
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type TTextSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
2
|
-
export
|
|
2
|
+
export declare const HEADING_SIZES: readonly ["xl", "lg", "md", "sm", "xs", "2xs", "3xs"];
|
|
3
|
+
export type THeadingSize = (typeof HEADING_SIZES)[number];
|
|
3
4
|
export type TDisplaySize = 'sm' | 'md' | 'lg' | 'max';
|
|
4
5
|
export type TTextAlign = 'left' | 'right' | 'center' | 'justify';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IUserGuideBubbleStepProps {
|
|
4
|
+
/**
|
|
5
|
+
* The message for the first bubble
|
|
6
|
+
*/
|
|
7
|
+
headerMessage: string;
|
|
8
|
+
/**
|
|
9
|
+
* The optional icon for the first bubble
|
|
10
|
+
*/
|
|
11
|
+
headerIcon?: ReactElement;
|
|
12
|
+
/**
|
|
13
|
+
* The message for the second bubble
|
|
14
|
+
*/
|
|
15
|
+
message: string;
|
|
16
|
+
/**
|
|
17
|
+
* The cta for the third bubble
|
|
18
|
+
*/
|
|
19
|
+
cta: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Set to true to show the completed state
|
|
22
|
+
*/
|
|
23
|
+
isCompleted?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The function to be called when the all bubbles animations complete
|
|
26
|
+
*/
|
|
27
|
+
handleAnimationComplete?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Set to true to disable typing animations
|
|
30
|
+
*/
|
|
31
|
+
disableTypingAnimations?: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IUserGuideStepProps {
|
|
4
|
+
/**
|
|
5
|
+
* The header of the step
|
|
6
|
+
*/
|
|
7
|
+
header: string;
|
|
8
|
+
/**
|
|
9
|
+
* The text of the step
|
|
10
|
+
*/
|
|
11
|
+
text: string;
|
|
12
|
+
/**
|
|
13
|
+
* Set to enable typing animation for the text
|
|
14
|
+
*/
|
|
15
|
+
typingAnimation?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The image of the step
|
|
18
|
+
*/
|
|
19
|
+
image?: {
|
|
20
|
+
src: string;
|
|
21
|
+
alt: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The video of the step. It will be rendered if there is no image
|
|
25
|
+
*/
|
|
26
|
+
video?: {
|
|
27
|
+
src: string;
|
|
28
|
+
playsInline?: boolean;
|
|
29
|
+
autoPlay?: boolean;
|
|
30
|
+
muted?: boolean;
|
|
31
|
+
loop?: boolean;
|
|
32
|
+
controls?: boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The current step number
|
|
36
|
+
*/
|
|
37
|
+
currentStep: number;
|
|
38
|
+
/**
|
|
39
|
+
* The maximum number of steps
|
|
40
|
+
*/
|
|
41
|
+
stepMax: number;
|
|
42
|
+
/**
|
|
43
|
+
* The function to be called when the primary button is clicked
|
|
44
|
+
*/
|
|
45
|
+
handleClickPrimary: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* The function to be called when the the skip button is clicked
|
|
48
|
+
*/
|
|
49
|
+
handleCloseAction?: (ev: KeyboardEvent | MouseEvent) => void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { Placement } from '@floating-ui/react';
|
|
3
|
+
|
|
4
|
+
export type CursorTiming = 'fast1' | 'fast2' | 'moderate1' | 'moderate2';
|
|
5
|
+
export interface IUserGuide {
|
|
6
|
+
/**
|
|
7
|
+
* The class name for the floating container
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The CSS properties for the highlighted element
|
|
12
|
+
*/
|
|
13
|
+
elementStyles?: CSSProperties;
|
|
14
|
+
/**
|
|
15
|
+
* The position for the floating element which sets the cursor position
|
|
16
|
+
*/
|
|
17
|
+
cursorPosition?: Placement;
|
|
18
|
+
/**
|
|
19
|
+
* The timing for the floating element transition
|
|
20
|
+
*/
|
|
21
|
+
cursorTiming?: CursorTiming;
|
|
22
|
+
/**
|
|
23
|
+
* The id of the element to highlight
|
|
24
|
+
*/
|
|
25
|
+
parentElementName?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The visibility of the user guide
|
|
28
|
+
*/
|
|
29
|
+
isVisible?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The custom z-index value for the overlay
|
|
32
|
+
*/
|
|
33
|
+
zIndex?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The first step of the user guide, rendered on the center of the screen
|
|
36
|
+
*/
|
|
37
|
+
isFirstStep?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The last step of the user guide, rendered on the center of the screen
|
|
40
|
+
*/
|
|
41
|
+
isLastStep?: boolean;
|
|
42
|
+
}
|