@livechat/design-system-react-components 2.15.2 → 2.16.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.
@@ -12,5 +12,9 @@ export interface CheckboxProps extends React.HTMLAttributes<HTMLInputElement> {
12
12
  * Set the checkbox description
13
13
  */
14
14
  description?: React.ReactNode;
15
+ /**
16
+ * Specify whether the checkbox should be in indeterminate state
17
+ */
18
+ indeterminate?: boolean;
15
19
  }
16
20
  export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
@@ -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, onSelect, children, }: IRangeDatePickerProps): ReactElement;
5
+ ({ options, initialSelectedItemKey, initialFromDate, initialToDate, customTempFromDate, customTempToDate, toMonth, today, onChange, onRangeSelect, onSelect, onCustomTempDateRangeChange, children, }: IRangeDatePickerProps): ReactElement;
6
6
  defaultProps: {
7
7
  options: {
8
8
  id: string;
@@ -5,6 +5,6 @@ export declare const isDateWithinRange: (date: Date, range: {
5
5
  to?: Date;
6
6
  }) => boolean;
7
7
  export declare const calculateDatePickerMonth: (initialFromDate?: Date, initialToDate?: Date, toMonth?: Date) => Date;
8
- export declare const getSelectedOption: (itemId: string | null, options: IRangeDatePickerOption[]) => IRangeDatePickerOption | undefined;
8
+ export declare const getSelectedOption: (itemId: string | null, options?: IRangeDatePickerOption[]) => IRangeDatePickerOption | undefined;
9
9
  export declare const isSelectingFirstDay: (from?: Date, to?: Date) => boolean;
10
10
  export declare const getInitialStateFromProps: (props: IRangeDatePickerProps) => Partial<IRangeDatePickerState>;
@@ -19,7 +19,8 @@ export declare enum RangeDatePickerAction {
19
19
  SELECT_FIRST_DAY = "SELECT_FIRST_DAY",
20
20
  SELECT_SECOND_DAY_AS_FROM = "SELECT_SECOND_DAY_AS_FROM",
21
21
  SELECT_SECOND_DAY_AS_TO = "SELECT_SECOND_DAY_AS_TO",
22
- CURRENT_MONTH_CHANGE = "CURRENT_MONTH_CHANGE"
22
+ CURRENT_MONTH_CHANGE = "CURRENT_MONTH_CHANGE",
23
+ SET_CUSTOM_TEMP_RANGE = "SET_CUSTOM_TEMP_RANGE"
23
24
  }
24
25
  export type IRangeDatePickerReducerAction = {
25
26
  type: RangeDatePickerAction.NEW_SELECTED_ITEM;
@@ -36,6 +37,12 @@ export type IRangeDatePickerReducerAction = {
36
37
  payload: {
37
38
  date?: Date;
38
39
  };
40
+ } | {
41
+ type: RangeDatePickerAction.SET_CUSTOM_TEMP_RANGE;
42
+ payload: {
43
+ customTempFrom?: Date;
44
+ customTempTo?: Date;
45
+ };
39
46
  };
40
47
  export interface IRangeDatePickerState {
41
48
  selectedItem: string | null;
@@ -44,6 +51,8 @@ export interface IRangeDatePickerState {
44
51
  temporaryFrom?: Date;
45
52
  temporaryTo?: Date;
46
53
  currentMonth: Date;
54
+ customTempFrom?: Date;
55
+ customTempTo?: Date;
47
56
  }
48
57
  export type RangeDatePickerReducer = Reducer<IRangeDatePickerState, IRangeDatePickerReducerAction>;
49
58
  export interface IRangeDatePickerOption {
@@ -67,13 +76,30 @@ export interface IRangeDatePickerChildrenPayload {
67
76
  datepicker: DayPickerProps;
68
77
  selectedOption?: IRangeDatePickerOption;
69
78
  }
70
- export interface IRangeDatePickerProps {
79
+ export interface IRangeDatePickerV1CoreProps {
80
+ onChange: (selected: IRangeDatePickerOption | null) => void;
71
81
  options: IRangeDatePickerOption[];
72
82
  initialSelectedItemKey?: string;
83
+ onRangeSelect?: never;
84
+ onCustomTempDateRangeChange?: never;
85
+ customTempFromDate?: never;
86
+ customTempToDate?: never;
87
+ }
88
+ export interface IRangeDatePickerV2CoreProps {
89
+ onRangeSelect: (selected: DateRange | null) => void;
90
+ onCustomTempDateRangeChange: (date: DateRange | undefined) => void;
91
+ customTempFromDate?: Date;
92
+ customTempToDate?: Date;
93
+ options?: never;
94
+ onChange?: never;
95
+ initialSelectedItemKey?: never;
96
+ }
97
+ export interface IRangeDatePickerCoreProps {
98
+ today?: Date;
73
99
  initialFromDate?: Date;
74
100
  initialToDate?: Date;
75
101
  toMonth?: Date;
76
- onChange: (selected: IRangeDatePickerOption | null) => void;
77
102
  onSelect?: (selected: DateRange | null) => void;
78
103
  children(payload: IRangeDatePickerChildrenPayload): ReactElement;
79
104
  }
105
+ export type IRangeDatePickerProps = IRangeDatePickerCoreProps & (IRangeDatePickerV1CoreProps | IRangeDatePickerV2CoreProps);
@@ -28,7 +28,6 @@ export interface IChecklistItemProps {
28
28
  export interface ICheckListItem extends Omit<IChecklistItemProps, 'placeholder'> {
29
29
  isActive: boolean;
30
30
  isChecked: boolean;
31
- isLastElement: boolean;
32
31
  onClick: (id: string) => void;
33
32
  }
34
33
  export type ICompletionMessageDataProps = {
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { IRangeDatePickerV2Props } from './types';
3
+
4
+ export declare const RangeDatePickerV2: FC<IRangeDatePickerV2Props>;
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { DateRange } from 'react-day-picker';
3
+
4
+ interface IRangeDatePickerV2LabelProps {
5
+ tempDate?: DateRange;
6
+ date?: DateRange;
7
+ }
8
+ export declare const RangeDatePickerV2Label: FC<IRangeDatePickerV2LabelProps>;
9
+ export {};
@@ -0,0 +1,15 @@
1
+ import { DateRange } from 'react-day-picker';
2
+ import { RANGE_DATE_PICKER_OPTION_ID } from './types';
3
+
4
+ type RangeDatePickerSelectOptions = {
5
+ id: RANGE_DATE_PICKER_OPTION_ID;
6
+ label: string;
7
+ value: {
8
+ from: Date;
9
+ to: Date;
10
+ };
11
+ };
12
+ export declare const OPTIONS: RangeDatePickerSelectOptions[];
13
+ type IsSameDate = (range?: DateRange, date?: DateRange) => boolean;
14
+ export declare const isSameDate: IsSameDate;
15
+ export {};
@@ -0,0 +1 @@
1
+ export { RangeDatePickerV2 } from './RangeDatePickerV2';
@@ -0,0 +1,11 @@
1
+ import { DateRange } from 'react-day-picker';
2
+ import { IRangeDatePickerCoreProps } from '../DatePicker/types';
3
+
4
+ export type RANGE_DATE_PICKER_OPTION_ID = 'today' | 'yesterday' | 'last7days' | 'last30days' | 'lastMonth' | 'currentMonth';
5
+ export interface IRangeDatePickerV2Props extends Omit<IRangeDatePickerCoreProps, 'children'> {
6
+ triggerClassName?: string;
7
+ rangeDatePickerClassName?: string;
8
+ initiallyOpen?: boolean;
9
+ initialSelectedOptionId?: RANGE_DATE_PICKER_OPTION_ID;
10
+ onRangeSelect: (selected: DateRange | null, id?: RANGE_DATE_PICKER_OPTION_ID) => void;
11
+ }
@@ -372,5 +372,21 @@ export declare const DesignToken: {
372
372
  ContentBasicPlaceholder: string;
373
373
  InputPromoBorderDefault: string;
374
374
  InputPromoBorderHover: string;
375
+ SurfaceAiCopilotBasicDefault: string;
376
+ SurfaceAiCopilotBasicHover: string;
377
+ SurfaceAiCopilotBasicActive: string;
378
+ SurfaceAiCopilotInvert01: string;
379
+ SurfaceAiCopilotInvert02: string;
380
+ SurfaceAiOther01Default: string;
381
+ SurfaceAiOther01Hover: string;
382
+ SurfaceAiOther01Active: string;
383
+ SurfaceAiOther02Default: string;
384
+ BorderAiCopilotBasicDefault: string;
385
+ BorderAiCopilotBasicHover: string;
386
+ BorderAiCopilotBasicActive: string;
387
+ BorderAiOther01: string;
388
+ ContentAiCopilotBasic: string;
389
+ ContentAiCopilotInvert: string;
390
+ ContentAiOther1Default: string;
375
391
  };
376
392
  export type DesignTokenKey = keyof typeof DesignToken;
@@ -22,5 +22,12 @@ export declare const ShadowToken: {
22
22
  FixedLeft: string;
23
23
  FixedTop: string;
24
24
  FixedBottom: string;
25
+ ShadowAiCopilotAnimationStart: string;
26
+ ShadowAiCopilotAnimationMedium1: string;
27
+ ShadowAiCopilotAnimationMedium2: string;
28
+ ShadowAiCopilotAnimationMedium3: string;
29
+ ShadowAiCopilotAnimationEnd: string;
30
+ ShadowAiOtherFloat: string;
31
+ ShadowAiOtherActiveField: string;
25
32
  };
26
33
  export type ShadowTokenKey = keyof typeof ShadowToken;