@livechat/design-system-react-components 2.4.6 → 2.5.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,6 +1,11 @@
1
1
  import { ComponentCoreProps } from '../../utils/types';
2
+ import { ButtonProps } from '../Button';
2
3
  import * as React from 'react';
3
4
  type AlertKind = 'info' | 'warning' | 'success' | 'error';
5
+ type OldButtonProps = {
6
+ handleClick: () => void;
7
+ label: string;
8
+ };
4
9
  export interface AlertProps extends ComponentCoreProps {
5
10
  /**
6
11
  * Specify the kind of Alert
@@ -9,17 +14,11 @@ export interface AlertProps extends ComponentCoreProps {
9
14
  /**
10
15
  * Shows the primary CTA button
11
16
  */
12
- primaryButton?: {
13
- handleClick: () => void;
14
- label: string;
15
- };
17
+ primaryButton?: ButtonProps & OldButtonProps;
16
18
  /**
17
19
  * Shows the secondary CTA button
18
20
  */
19
- secondaryButton?: {
20
- handleClick: () => void;
21
- label: string;
22
- };
21
+ secondaryButton?: ButtonProps & OldButtonProps;
23
22
  /**
24
23
  * The optional event handler for close button
25
24
  */
@@ -1,7 +1,7 @@
1
1
  import { IPickerListItem } from '../Picker';
2
2
  import { AutoCompleteProps, IAutoCompleteListItem } from './types';
3
3
 
4
- export declare const areAllOptionsStrings: (options: AutoCompleteProps['options']) => options is string[];
4
+ export declare const areAllOptionsStrings: (options: AutoCompleteProps["options"]) => options is string[];
5
5
  export declare const buildOptionsFromStrings: (options: string[]) => IPickerListItem[];
6
6
  export declare const buildOptionsFromAutoCompleteListItems: (options: IAutoCompleteListItem[]) => IPickerListItem[];
7
7
  export declare const getFilteredPickerItems: (items: IPickerListItem[], single: boolean, hideIfExactMatch: boolean, inputValue: string) => IPickerListItem[];
@@ -38,33 +38,33 @@ export declare const Button: React.ForwardRefExoticComponent<{
38
38
  /**
39
39
  * Specify the button kind
40
40
  */
41
- kind?: ButtonKind | undefined;
41
+ kind?: ButtonKind;
42
42
  /**
43
43
  * Specify the button size
44
44
  */
45
- size?: ButtonSize | undefined;
45
+ size?: ButtonSize;
46
46
  /**
47
47
  * Set the loading state
48
48
  */
49
- loading?: boolean | undefined;
49
+ loading?: boolean;
50
50
  /**
51
51
  * Set the button for full width
52
52
  */
53
- fullWidth?: boolean | undefined;
53
+ fullWidth?: boolean;
54
54
  /**
55
55
  * Text displayed in loading state
56
56
  */
57
- loaderLabel?: string | undefined;
57
+ loaderLabel?: string;
58
58
  /**
59
59
  * Renders given element
60
60
  */
61
- icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
61
+ icon?: React.ReactElement;
62
62
  /**
63
63
  * Specify the place to render element given in `icon` prop
64
64
  */
65
- iconPosition?: "left" | "right" | undefined;
65
+ iconPosition?: "left" | "right";
66
66
  /**
67
67
  * Set to enable animation that will show label on button hover if icon is present
68
68
  */
69
- animatedLabel?: boolean | undefined;
69
+ animatedLabel?: boolean;
70
70
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLButtonElement & HTMLAnchorElement>>;
@@ -1,7 +1,4 @@
1
1
  import { Dispatch, ReducerAction, ReducerState } from 'react';
2
2
  import { IRangeDatePickerProps, RangeDatePickerReducer } from './types';
3
3
 
4
- export declare const useRangeDatePickerState: (props: IRangeDatePickerProps) => [
5
- ReducerState<RangeDatePickerReducer>,
6
- Dispatch<ReducerAction<RangeDatePickerReducer>>
7
- ];
4
+ export declare const useRangeDatePickerState: (props: IRangeDatePickerProps) => [ReducerState<RangeDatePickerReducer>, Dispatch<ReducerAction<RangeDatePickerReducer>>];
@@ -0,0 +1,3 @@
1
+ import { FloatingPortalProps } from '@floating-ui/react';
2
+
3
+ export declare const FloatingPortal: ({ children, id, root, preserveTabOrder, }: FloatingPortalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { FloatingPortal } from './FloatingPortal';
2
+
3
+ export { FloatingPortal };
@@ -1,5 +1,10 @@
1
1
  import { ButtonKind, ButtonProps } from '../Button';
2
2
  import * as React from 'react';
3
+ type OldButtonProps = {
4
+ handleClick: () => void;
5
+ label: string;
6
+ kind?: ButtonKind;
7
+ };
3
8
  export interface IPromoBannerV2Props {
4
9
  /**
5
10
  * Specify an optional className to be applied to the main container node
@@ -12,19 +17,11 @@ export interface IPromoBannerV2Props {
12
17
  /**
13
18
  * Shows the primary CTA button
14
19
  */
15
- primaryButton?: {
16
- handleClick: () => void;
17
- label: string;
18
- kind?: ButtonKind;
19
- } & ButtonProps;
20
+ primaryButton?: OldButtonProps & ButtonProps;
20
21
  /**
21
22
  * Shows the secondary CTA button
22
23
  */
23
- secondaryButton?: {
24
- handleClick: () => void;
25
- label: string;
26
- kind?: ButtonKind;
27
- };
24
+ secondaryButton?: OldButtonProps & ButtonProps;
28
25
  /**
29
26
  * Set to true to display the banner vertically
30
27
  */
@@ -48,3 +45,4 @@ export interface IPromoBannerV2Props {
48
45
  kind?: 'default' | 'dark';
49
46
  }
50
47
  export declare const PromoBannerV2: React.FC<React.PropsWithChildren<IPromoBannerV2Props>>;
48
+ export {};
@@ -1,4 +1,4 @@
1
- import { Placement, VirtualElement, UseDismissProps, Strategy, UseClickProps } from '@floating-ui/react';
1
+ import { Placement, VirtualElement, UseDismissProps, Strategy, UseClickProps, FloatingPortalProps } from '@floating-ui/react';
2
2
  import { ButtonProps } from '../Button';
3
3
  import * as React from 'react';
4
4
  export type TooltipTheme = 'invert' | 'important' | undefined;
@@ -133,6 +133,19 @@ export interface ITooltipProps {
133
133
  * https://floating-ui.com/docs/usefloating#strategy
134
134
  */
135
135
  floatingStrategy?: Strategy;
136
+ /**
137
+ * Set to render the tooltip in a portal
138
+ */
139
+ portal?: boolean;
140
+ /**
141
+ * Props for the FloatingPortal component, see FloatingPortal docs or https://floating-ui.com/docs/FloatingPortal
142
+ */
143
+ portalProps?: FloatingPortalProps;
144
+ /**
145
+ * Set to hide the tooltip when reference element is hidden
146
+ * IMPORTANT: This prop enables the `hide` middleware from `floating-ui` library: https://floating-ui.com/docs/hide. But for some reason, it doesn't work in tests because always returns `true` in `referenceHidden` check.
147
+ */
148
+ hideWhenReferenceHidden?: boolean;
136
149
  }
137
150
  export interface ITooltipInfoProps {
138
151
  /**