@livechat/design-system-react-components 2.18.0 → 2.19.1

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.
Files changed (43) hide show
  1. package/dist/components/AnimatedTextContainer/AnimatedTextContainer.d.ts +4 -0
  2. package/dist/components/AnimatedTextContainer/index.d.ts +1 -0
  3. package/dist/components/AnimatedTextContainer/types.d.ts +22 -0
  4. package/dist/components/AppFrame/components/NavigationTopBar/NavigationTopBar.d.ts +1 -1
  5. package/dist/components/AppFrame/components/NavigationTopBar/examples.d.ts +1 -0
  6. package/dist/components/AppFrame/stories-helpers.d.ts +1 -0
  7. package/dist/components/AutoComplete/types.d.ts +4 -0
  8. package/dist/components/Checkbox/Checkbox.d.ts +4 -0
  9. package/dist/components/FormField/FormField.d.ts +4 -0
  10. package/dist/components/Input/types.d.ts +4 -0
  11. package/dist/components/NumericInput/NumericInput.d.ts +1 -0
  12. package/dist/components/Picker/types.d.ts +4 -0
  13. package/dist/components/RadioButton/RadioButton.d.ts +1 -0
  14. package/dist/components/ReadOnlyText/ReadOnlyText.d.ts +11 -0
  15. package/dist/components/ReadOnlyText/index.d.ts +2 -0
  16. package/dist/components/TagInput/TagInput.d.ts +1 -1
  17. package/dist/components/TagInput/types.d.ts +4 -0
  18. package/dist/components/Textarea/Textarea.d.ts +1 -0
  19. package/dist/components/Tooltip/components/index.d.ts +0 -1
  20. package/dist/components/Tooltip/index.d.ts +0 -1
  21. package/dist/components/Typography/index.d.ts +1 -0
  22. package/dist/components/Typography/types.d.ts +2 -1
  23. package/dist/components/UserGuide/UserGuide.d.ts +4 -0
  24. package/dist/components/UserGuide/components/UserGuideBubbleStep/UserGuideBubbleStep.d.ts +4 -0
  25. package/dist/components/UserGuide/components/UserGuideBubbleStep/types.d.ts +32 -0
  26. package/dist/components/UserGuide/components/UserGuideStep/UserGuideStep.d.ts +4 -0
  27. package/dist/components/UserGuide/components/UserGuideStep/types.d.ts +50 -0
  28. package/dist/components/UserGuide/components/index.d.ts +2 -0
  29. package/dist/components/UserGuide/index.d.ts +3 -0
  30. package/dist/components/UserGuide/stories-helpers.d.ts +5 -0
  31. package/dist/components/UserGuide/types.d.ts +42 -0
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.js +4388 -3973
  35. package/dist/providers/ReadOnlyFormFieldProvider.d.ts +16 -0
  36. package/dist/style.css +1 -1
  37. package/dist/utils/types.d.ts +4 -0
  38. package/package.json +3 -3
  39. package/dist/components/Tooltip/components/UserGuide/SpotlightOverlay.d.ts +0 -8
  40. package/dist/components/Tooltip/components/UserGuide/UserGuide.d.ts +0 -12
  41. package/dist/components/Tooltip/components/UserGuide/UserGuideStep.d.ts +0 -16
  42. package/dist/components/Tooltip/components/UserGuide/index.d.ts +0 -1
  43. /package/dist/components/{Tooltip/components/UserGuide → UserGuide}/virtualElementReference.d.ts +0 -0
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { IAnimatedTextContainerProps } from './types';
3
+
4
+ export declare const AnimatedTextContainer: FC<IAnimatedTextContainerProps>;
@@ -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
  };
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  export declare const DisconnectedAlert: React.FC<{
3
3
  show: boolean;
4
4
  onClose: () => void;
5
+ id?: string;
5
6
  }>;
6
7
  export declare const ChameleonAlert: React.FC<{
7
8
  show: boolean;
@@ -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
  */
@@ -40,5 +40,9 @@ export interface FormFieldProps {
40
40
  * Renders given element above the filed
41
41
  */
42
42
  labelRightNode?: React.ReactNode;
43
+ /**
44
+ * Whether the form field is read-only
45
+ */
46
+ readOnly?: boolean;
43
47
  }
44
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,2 @@
1
+ export { ReadOnlyText } from './ReadOnlyText';
2
+ export type { ReadOnlyTextProps } from './ReadOnlyText';
@@ -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,5 +1,4 @@
1
1
  export { Simple } from './Simple';
2
2
  export { Info } from './Info';
3
3
  export { Interactive } from './Interactive';
4
- export { UserGuide } from './UserGuide';
5
4
  export { Reports } from './Reports';
@@ -1,4 +1,3 @@
1
1
  export { Tooltip } from './Tooltip';
2
2
  export { Simple, Info, Interactive, Reports } from './components';
3
- export { UserGuide } from './components/UserGuide';
4
3
  export type { ITooltipProps, ITooltipInfoProps, ITooltipInteractiveProps, TooltipButton, } from './types';
@@ -2,3 +2,4 @@ export { Heading } from './Heading';
2
2
  export { Text } from './Text';
3
3
  export { Display } from './Display';
4
4
  export type { THeadingSize, TTextSize, TDisplaySize } from './types';
5
+ export { HEADING_SIZES } from './types';
@@ -1,4 +1,5 @@
1
1
  export type TTextSize = 'xs' | 'sm' | 'md' | 'lg';
2
- export type THeadingSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
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,4 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { IUserGuide } from './types';
3
+
4
+ export declare const UserGuide: FC<PropsWithChildren<IUserGuide>>;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { IUserGuideBubbleStepProps } from './types';
3
+
4
+ export declare const UserGuideBubbleStep: FC<IUserGuideBubbleStepProps>;
@@ -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,4 @@
1
+ import { FC } from 'react';
2
+ import { IUserGuideStepProps } from './types';
3
+
4
+ export declare const UserGuideStep: FC<IUserGuideStepProps>;
@@ -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,2 @@
1
+ export { UserGuideBubbleStep } from './UserGuideBubbleStep/UserGuideBubbleStep';
2
+ export { UserGuideStep } from './UserGuideStep/UserGuideStep';
@@ -0,0 +1,3 @@
1
+ export { UserGuide } from './UserGuide';
2
+ export { UserGuideStep, UserGuideBubbleStep } from './components/';
3
+ export type { IUserGuide } from './types';
@@ -0,0 +1,5 @@
1
+ import { ReactElement } from 'react';
2
+
3
+ export declare const AppContent: ({ onStartGuideClick, }: {
4
+ onStartGuideClick: () => void;
5
+ }) => ReactElement;
@@ -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
+ }