@livechat/design-system-react-components 2.12.0 → 2.14.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,3 +1,2 @@
1
1
  export { ActionMenu } from './ActionMenu';
2
- export { ActionMenuItem } from './ActionMenuItem';
3
2
  export type { IActionMenuOption } from './types';
@@ -64,17 +64,3 @@ export interface IActionMenuProps extends ComponentCoreProps {
64
64
  */
65
65
  footer?: React.ReactNode;
66
66
  }
67
- export interface ActionMenuItemProps {
68
- /**
69
- * Renders given element on the left of element
70
- */
71
- leftNode?: React.ReactNode;
72
- /**
73
- * Renders given element on the right of element
74
- */
75
- rightNode?: React.ReactNode;
76
- /**
77
- * Specify the kind of menu item
78
- */
79
- kind?: 'warning' | undefined;
80
- }
@@ -1,4 +1,3 @@
1
- import { default as ReactDayPicker } from 'react-day-picker';
2
1
  import { IDatePickerProps } from './types';
3
2
  import * as React from 'react';
4
- export declare const DatePicker: React.ForwardRefExoticComponent<IDatePickerProps & React.RefAttributes<ReactDayPicker>>;
3
+ export declare const DatePicker: React.FC<IDatePickerProps>;
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
2
2
  import { IRangeDatePickerProps } from './types';
3
3
 
4
4
  export declare const RangeDatePicker: {
5
- ({ options, initialSelectedItemKey, initialFromDate, initialToDate, toMonth, onChange, children, }: IRangeDatePickerProps): ReactElement;
5
+ ({ options, initialSelectedItemKey, initialFromDate, initialToDate, toMonth, onChange, onSelect, children, }: IRangeDatePickerProps): ReactElement;
6
6
  defaultProps: {
7
7
  options: {
8
8
  id: string;
@@ -0,0 +1,3 @@
1
+ import { IDatePickerCustomNavigationProps } from '../types';
2
+ import * as React from 'react';
3
+ export declare const DatePickerCustomNavigation: React.FC<IDatePickerCustomNavigationProps>;
@@ -1,5 +1,3 @@
1
- import { Modifiers } from 'react-day-picker';
2
- import { ClassNames } from 'react-day-picker/types/ClassNames';
3
1
  import { IRangeDatePickerProps, IRangeDatePickerState, IRangeDatePickerOption } from './types';
4
2
 
5
3
  export declare const isDateWithinRange: (date: Date, range: {
@@ -7,11 +5,6 @@ export declare const isDateWithinRange: (date: Date, range: {
7
5
  to?: Date;
8
6
  }) => boolean;
9
7
  export declare const calculateDatePickerMonth: (initialFromDate?: Date, initialToDate?: Date, toMonth?: Date) => Date;
10
- export declare const getRangeDatePickerModifiers: (from?: Date, to?: Date) => Partial<Modifiers>;
11
8
  export declare const getSelectedOption: (itemId: string | null, options: IRangeDatePickerOption[]) => IRangeDatePickerOption | undefined;
12
9
  export declare const isSelectingFirstDay: (from?: Date, to?: Date) => boolean;
13
10
  export declare const getInitialStateFromProps: (props: IRangeDatePickerProps) => Partial<IRangeDatePickerState>;
14
- export declare const getDatePickerClassNames: (range?: boolean, classNames?: ClassNames) => ClassNames & {
15
- start: string;
16
- end: string;
17
- };
@@ -1,23 +1,13 @@
1
- import { Reducer, Ref, ReactElement } from 'react';
2
- import { default as ReactDayPicker, DayPickerProps } from 'react-day-picker';
3
- import { ClassNames } from 'react-day-picker/types/ClassNames';
1
+ import { Reducer, ReactElement } from 'react';
2
+ import { DayPickerProps, DateRange } from 'react-day-picker';
4
3
 
5
- export interface IDatePickerProps extends Omit<DayPickerProps, 'todayButton' | 'showWeekNumbers'> {
6
- innerRef?: Ref<ReactDayPicker>;
7
- range?: boolean;
8
- }
9
- export interface IDatePickerNavbarProps {
10
- showPreviousButton?: boolean;
11
- showNextButton?: boolean;
12
- month: Date;
13
- fromMonth?: Date;
14
- toMonth?: Date;
4
+ export type IDatePickerProps = DayPickerProps;
5
+ export interface IDatePickerCustomNavigationProps {
6
+ currentMonth: Date;
7
+ setMonth: (date: Date) => void;
8
+ startMonth?: Date;
9
+ endMonth?: Date;
15
10
  numberOfMonths?: number;
16
- className?: string;
17
- classNames: ClassNames;
18
- onPreviousClick?: () => void;
19
- onNextClick?: () => void;
20
- onMonthChange: (newMonth: Date) => void;
21
11
  }
22
12
  export declare enum RangeDatePickerAction {
23
13
  NEW_SELECTED_ITEM = "NEW_SELECTED_ITEM",
@@ -63,20 +53,6 @@ export interface IRangeDatePickerOption {
63
53
  to?: Date;
64
54
  } | null;
65
55
  }
66
- interface IRangeDatePickerChildrenPayloadDatePicker {
67
- modifiers?: DayPickerProps['modifiers'];
68
- initialMonth?: Date;
69
- month: Date;
70
- range?: boolean;
71
- numberOfMonths: number;
72
- fromMonth?: Date;
73
- toMonth?: Date;
74
- selectedDays?: DayPickerProps['selectedDays'];
75
- disabledDays?: DayPickerProps['disabledDays'];
76
- onDayMouseEnter: DayPickerProps['onDayMouseEnter'];
77
- onDayClick(day: Date): void;
78
- onMonthChange(month: Date): void;
79
- }
80
56
  export interface IRangeDatePickerChildrenPayload {
81
57
  select: {
82
58
  selected: string | number;
@@ -86,7 +62,7 @@ export interface IRangeDatePickerChildrenPayload {
86
62
  fromDate?: Date;
87
63
  toDate?: Date;
88
64
  };
89
- datepicker: IRangeDatePickerChildrenPayloadDatePicker;
65
+ datepicker: DayPickerProps;
90
66
  selectedOption?: IRangeDatePickerOption;
91
67
  }
92
68
  export interface IRangeDatePickerProps {
@@ -96,6 +72,6 @@ export interface IRangeDatePickerProps {
96
72
  initialToDate?: Date;
97
73
  toMonth?: Date;
98
74
  onChange: (selected: IRangeDatePickerOption | null) => void;
75
+ onSelect?: (selected: DateRange | null) => void;
99
76
  children(payload: IRangeDatePickerChildrenPayload): ReactElement;
100
77
  }
101
- export {};
@@ -0,0 +1,8 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { ListItemProps } from './types';
3
+
4
+ export declare const ListItem: FC<PropsWithChildren<ListItemProps>>;
5
+ /**
6
+ * @deprecated Use `ListItem` instead. This will be removed in a future release.
7
+ */
8
+ export declare const ActionMenuItem: FC<PropsWithChildren<ListItemProps>>;
@@ -0,0 +1 @@
1
+ export { ListItem, ActionMenuItem } from './ListItem';
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface ListItemProps {
4
+ /**
5
+ * Renders given element on the left of element
6
+ */
7
+ leftNode?: ReactNode;
8
+ /**
9
+ * Renders given element on the right of element
10
+ */
11
+ rightNode?: ReactNode;
12
+ /**
13
+ * Specify the kind of menu item
14
+ */
15
+ kind?: 'warning' | undefined;
16
+ }
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { OverflowTooltipTextProps } from './types';
3
+
4
+ export declare const OverflowTooltipText: FC<OverflowTooltipTextProps>;
@@ -0,0 +1 @@
1
+ export { OverflowTooltipText } from './OverflowTooltipText';
@@ -0,0 +1,3 @@
1
+ export interface OverflowTooltipTextProps {
2
+ text: string;
3
+ }
@@ -1,5 +1,5 @@
1
1
  import { OffsetOptions } from '@floating-ui/core';
2
- import { Placement, UseClickProps, UseDismissProps, FlipOptions, Strategy } from '@floating-ui/react';
2
+ import { Placement, UseClickProps, UseDismissProps, FlipOptions, Strategy, UseTransitionStylesProps } from '@floating-ui/react';
3
3
  import * as React from 'react';
4
4
  export interface IPopoverProps {
5
5
  children?: React.ReactNode;
@@ -62,4 +62,10 @@ export interface IPopoverProps {
62
62
  * https://floating-ui.com/docs/usefloating#strategy
63
63
  */
64
64
  floatingStrategy?: Strategy;
65
+ /**
66
+ * Options to define or customize the transition styles for the popover's appearance and disappearance.
67
+ * Uses the default transition styles if not specified.
68
+ * @see https://floating-ui.com/docs/usetransition
69
+ */
70
+ transitionOptions?: UseTransitionStylesProps;
65
71
  }
@@ -2,3 +2,5 @@ export { useAnimations } from './useAnimations';
2
2
  export { useHeightResizer } from './useHeightResizer';
3
3
  export { useMobileViewDetector } from './useMobileViewDetector';
4
4
  export { useInteractive } from './useInteractive';
5
+ export { useOnHover } from './useOnHover';
6
+ export { useIsOverflow } from './useIsOverflow';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- export type NODE = HTMLDivElement | null;
2
+ export type NODE = HTMLElement | null;
3
3
  export type CALLBACK = (newSize: DOMRectReadOnly) => void;
4
4
  export interface IUseHeightResizer {
5
5
  size: number;
@@ -18,3 +18,8 @@ export interface UseInteractiveProps {
18
18
  export interface IUseInteractive {
19
19
  handleInteractiveClick: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
20
20
  }
21
+ export interface IUseOnHover {
22
+ isHovered: boolean;
23
+ handleMouseOver: () => void;
24
+ handleMouseOut: () => void;
25
+ }
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+
3
+ export declare const useIsOverflow: <T extends HTMLElement>(ref: RefObject<T>) => boolean;
@@ -0,0 +1,3 @@
1
+ import { IUseOnHover } from './types';
2
+
3
+ export declare const useOnHover: (initialState?: boolean) => IUseOnHover;