@livechat/design-system-react-components 2.11.0 → 2.13.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,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 {};