@livechat/design-system-react-components 1.0.0-beta.0 → 1.0.0-beta.2

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 (32) hide show
  1. package/dist/components/ActionMenu/ActionMenu.d.ts +4 -0
  2. package/dist/components/ActionMenu/ActionMenu.stories.d.ts +2 -1
  3. package/dist/components/Alert/Alert.stories.d.ts +3 -3
  4. package/dist/components/Avatar/Avatar.d.ts +1 -1
  5. package/dist/components/Avatar/Avatar.stories.d.ts +10 -10
  6. package/dist/components/Badge/Badge.stories.d.ts +3 -3
  7. package/dist/components/DatePicker/helpers.d.ts +2 -25
  8. package/dist/components/DatePicker/types.d.ts +3 -3
  9. package/dist/components/FormField/FormField.stories.d.ts +1 -1
  10. package/dist/components/Input/Input.stories.d.ts +4 -4
  11. package/dist/components/Modal/ModalHeader.d.ts +1 -1
  12. package/dist/components/NumericInput/NumericInput.d.ts +2 -4
  13. package/dist/components/NumericInput/NumericInput.stories.d.ts +20 -0
  14. package/dist/components/Picker/Picker.d.ts +7 -3
  15. package/dist/components/Picker/TriggerBody.d.ts +3 -2
  16. package/dist/components/Picker/constants.d.ts +1 -0
  17. package/dist/components/Picker/index.d.ts +1 -0
  18. package/dist/components/Switch/Switch.d.ts +30 -0
  19. package/dist/components/Tab/Tab.stories.d.ts +2 -2
  20. package/dist/components/TagInput/EmailTagInput.d.ts +1 -1
  21. package/dist/components/TagInput/TagInput.stories.d.ts +1 -1
  22. package/dist/components/Textarea/Textarea.stories.d.ts +1 -1
  23. package/dist/components/Toast/Toast.stories.d.ts +1 -1
  24. package/dist/components/Tooltip/Tooltip.stories.d.ts +4 -4
  25. package/dist/components/Tooltip/components/UserGuide/SpotlightOverlay.d.ts +2 -1
  26. package/dist/dsrc.cjs.js +10 -10
  27. package/dist/dsrc.es.js +1449 -1434
  28. package/dist/dsrc.umd.js +9 -9
  29. package/dist/index.d.ts +0 -1
  30. package/dist/preview-stats.json +550 -550
  31. package/dist/style.css +1 -1
  32. package/package.json +14 -14
@@ -27,5 +27,9 @@ export interface ActionMenuProps {
27
27
  * Will open menu on component initialization
28
28
  */
29
29
  openedOnInit?: boolean;
30
+ /**
31
+ * Menu will stay open after option click
32
+ */
33
+ keepOpenOnClick?: boolean;
30
34
  }
31
35
  export declare const ActionMenu: React.FC<ActionMenuProps>;
@@ -7,4 +7,5 @@ declare const _default: {
7
7
  };
8
8
  };
9
9
  export default _default;
10
- export declare const Default: () => JSX.Element;
10
+ export declare const Default: () => React.ReactElement;
11
+ export declare const KeepOpenOnItemClick: () => React.ReactElement;
@@ -4,6 +4,6 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
4
4
  children?: React.ReactNode;
5
5
  }>;
6
6
  export default _default;
7
- export declare const Default: (args: AlertProps) => JSX.Element;
8
- export declare const Kinds: () => JSX.Element;
9
- export declare const WithCTA: () => JSX.Element;
7
+ export declare const Default: (args: AlertProps) => React.ReactElement;
8
+ export declare const Kinds: () => React.ReactElement;
9
+ export declare const WithCTA: () => React.ReactElement;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  type AvatarShape = 'circle' | 'rounded-square';
3
- type AvatarSize = 'xxxsmall' | 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
3
+ type AvatarSize = 'xxxsmall' | 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge';
4
4
  type AvatarStatus = 'available' | 'unavailable' | 'unknown';
5
5
  type AvatarType = 'image' | 'text';
6
6
  export interface AvatarProps {
@@ -5,18 +5,18 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
5
5
  }>;
6
6
  export default _default;
7
7
  export declare const Default: {
8
- (args: AvatarProps): JSX.Element;
8
+ (args: AvatarProps): React.ReactElement;
9
9
  args: {
10
10
  type: string;
11
11
  text: string;
12
12
  };
13
13
  };
14
- export declare const Types: () => JSX.Element;
15
- export declare const Shapes: () => JSX.Element;
16
- export declare const Sizes: () => JSX.Element;
17
- export declare const Statuses: () => JSX.Element;
18
- export declare const Colors: () => JSX.Element;
19
- export declare const FallbackAvatar: () => JSX.Element;
20
- export declare const Rim: () => JSX.Element;
21
- export declare const SizesWithStatus: () => JSX.Element;
22
- export declare const SizesWithRim: () => JSX.Element;
14
+ export declare const Types: () => React.ReactElement;
15
+ export declare const Shapes: () => React.ReactElement;
16
+ export declare const Sizes: () => React.ReactElement;
17
+ export declare const Statuses: () => React.ReactElement;
18
+ export declare const Colors: () => React.ReactElement;
19
+ export declare const FallbackAvatar: () => React.ReactElement;
20
+ export declare const Rim: () => React.ReactElement;
21
+ export declare const SizesWithStatus: () => React.ReactElement;
22
+ export declare const SizesWithRim: () => React.ReactElement;
@@ -7,6 +7,6 @@ declare const _default: {
7
7
  };
8
8
  export default _default;
9
9
  export declare const Default: Story<BadgeProps>;
10
- export declare const Sizes: () => JSX.Element;
11
- export declare const Kinds: () => JSX.Element;
12
- export declare const Types: () => JSX.Element;
10
+ export declare const Sizes: () => React.ReactElement;
11
+ export declare const Kinds: () => React.ReactElement;
12
+ export declare const Types: () => React.ReactElement;
@@ -1,6 +1,6 @@
1
1
  import { Modifiers } from 'react-day-picker';
2
- import { IRangeDatePickerProps, IRangeDatePickerState, IRangeDatePickerOption } from './types';
3
2
  import { ClassNames } from 'react-day-picker/types/ClassNames';
3
+ import { IRangeDatePickerProps, IRangeDatePickerState, IRangeDatePickerOption } from './types';
4
4
  export declare const isDateWithinRange: (date: Date, range: {
5
5
  from?: Date;
6
6
  to?: Date;
@@ -10,30 +10,7 @@ export declare const getRangeDatePickerModifiers: (from?: Date, to?: Date) => Pa
10
10
  export declare const getSelectedOption: (itemId: string | null, options: IRangeDatePickerOption[]) => IRangeDatePickerOption | undefined;
11
11
  export declare const isSelectingFirstDay: (from?: Date, to?: Date) => boolean;
12
12
  export declare const getInitialStateFromProps: (props: IRangeDatePickerProps) => Partial<IRangeDatePickerState>;
13
- export declare const getDatePickerClassNames: (range?: boolean, classNames?: ClassNames) => {
14
- container: string;
15
- wrapper: string;
16
- interactionDisabled: string;
17
- navBar: string;
18
- navButtonPrev: string;
19
- navButtonNext: string;
20
- navButtonInteractionDisabled: string;
21
- months: string;
22
- month: string;
23
- caption: string;
24
- weekdays: string;
25
- weekdaysRow: string;
26
- weekday: string;
27
- weekNumber: string;
28
- body: string;
29
- week: string;
30
- day: string;
31
- footer: string;
32
- todayButton: string;
33
- today: string;
34
- selected: string;
35
- disabled: string;
36
- outside: string;
13
+ export declare const getDatePickerClassNames: (range?: boolean, classNames?: ClassNames) => ClassNames & {
37
14
  start: string;
38
15
  end: string;
39
16
  };
@@ -1,8 +1,8 @@
1
- import { Reducer } from 'react';
1
+ import { Reducer, Ref, ReactElement } from 'react';
2
2
  import ReactDayPicker, { DayPickerProps } from 'react-day-picker';
3
3
  import { ClassNames } from 'react-day-picker/types/ClassNames';
4
4
  export interface IDatePickerProps extends Omit<DayPickerProps, 'todayButton' | 'showWeekNumbers'> {
5
- innerRef?: React.Ref<ReactDayPicker>;
5
+ innerRef?: Ref<ReactDayPicker>;
6
6
  range?: boolean;
7
7
  }
8
8
  export interface IDatePickerNavbarProps {
@@ -95,6 +95,6 @@ export interface IRangeDatePickerProps {
95
95
  initialToDate?: Date;
96
96
  toMonth?: Date;
97
97
  onChange: (selected: IRangeDatePickerOption | null) => void;
98
- children(payload: IRangeDatePickerChildrenPayload): React.ReactElement;
98
+ children(payload: IRangeDatePickerChildrenPayload): ReactElement;
99
99
  }
100
100
  export {};
@@ -5,5 +5,5 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
5
5
  }>;
6
6
  export default _default;
7
7
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, FormFieldProps>;
8
- export declare const Examples: () => JSX.Element;
8
+ export declare const Examples: () => React.ReactElement;
9
9
  export declare const TextFieldWithError: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, FormFieldProps>;
@@ -4,7 +4,7 @@ import { InputProps } from './Input';
4
4
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, InputProps & React.RefAttributes<HTMLInputElement>>;
5
5
  export default _default;
6
6
  export declare const Default: Story<InputProps>;
7
- export declare const Sizes: () => JSX.Element;
8
- export declare const States: () => JSX.Element;
9
- export declare const Types: () => JSX.Element;
10
- export declare const WithIcons: () => JSX.Element;
7
+ export declare const Sizes: () => React.ReactElement;
8
+ export declare const States: () => React.ReactElement;
9
+ export declare const Types: () => React.ReactElement;
10
+ export declare const WithIcons: () => React.ReactElement;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { IconProps } from '../Icon';
3
3
  export interface ModalHeaderProps {
4
4
  title?: React.ReactNode;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- interface Props {
2
+ export type NumericInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
3
3
  className?: string;
4
4
  error?: string;
5
5
  value: string;
@@ -8,7 +8,5 @@ interface Props {
8
8
  disabled?: boolean;
9
9
  noControls?: boolean;
10
10
  onChange: (value: string) => void;
11
- }
12
- export type NumericInputProps = React.InputHTMLAttributes<HTMLInputElement> & Props;
11
+ };
13
12
  export declare const NumericInput: React.FC<NumericInputProps>;
14
- export {};
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { NumericInputProps } from './NumericInput';
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, React.InputHTMLAttributes<HTMLInputElement> & {
4
+ className?: string | undefined;
5
+ error?: string | undefined;
6
+ value: string;
7
+ max?: number | undefined;
8
+ min?: number | undefined;
9
+ disabled?: boolean | undefined;
10
+ noControls?: boolean | undefined;
11
+ onChange: (value: string) => void;
12
+ } & {
13
+ children?: React.ReactNode;
14
+ }>;
15
+ export default _default;
16
+ export declare const NumericInput: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, NumericInputProps>;
17
+ export declare const NumericInputWithMinAndMaxValues: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, NumericInputProps>;
18
+ export declare const NumericInputWithNoControls: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, NumericInputProps>;
19
+ export declare const NumericInputWithDisabled: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, NumericInputProps>;
20
+ export declare const NumericInputWithError: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, NumericInputProps>;
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { IPickerListItem } from './PickerList';
3
- import { IconSize } from '../Icon';
4
2
  import { Size } from 'utils';
5
- export type PickerType = 'single' | 'multi';
3
+ import { IconSize } from '../Icon';
4
+ import { PickerType } from './constants';
5
+ import { IPickerListItem } from './PickerList';
6
6
  export interface IPickerProps {
7
7
  /**
8
8
  * Specify the custom id
@@ -76,5 +76,9 @@ export interface IPickerProps {
76
76
  * Callback called after item selection
77
77
  */
78
78
  onSelect: (selectedItems: IPickerListItem[] | null) => void;
79
+ /**
80
+ * Clears the search input after item select
81
+ */
82
+ clearSearchAfterSelection?: boolean;
79
83
  }
80
84
  export declare const Picker: React.FC<IPickerProps>;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { IconSize } from '../Icon';
3
+ import { PickerType } from './constants';
2
4
  import { IPickerListItem } from './PickerList';
3
- import { PickerType } from './Picker';
4
- import { IconSize } from 'index';
5
5
  export interface ITriggerBodyProps {
6
6
  isOpen: boolean;
7
7
  isSearchDisabled?: boolean;
@@ -10,6 +10,7 @@ export interface ITriggerBodyProps {
10
10
  items?: IPickerListItem[] | null;
11
11
  type: PickerType;
12
12
  iconSize?: IconSize;
13
+ clearSearchAfterSelection?: boolean;
13
14
  onItemRemove: (item: IPickerListItem) => void;
14
15
  onFilter: (text: string) => void;
15
16
  }
@@ -19,3 +19,4 @@ export declare const defaultExtendedOptions: ({
19
19
  groupHeader?: undefined;
20
20
  })[];
21
21
  export declare const SELECT_ALL_OPTION_KEY = "select-all";
22
+ export type PickerType = 'single' | 'multi';
@@ -1,2 +1,3 @@
1
1
  export * from './Picker';
2
2
  export * from './PickerList';
3
+ export type { PickerType } from './constants';
@@ -3,15 +3,45 @@ export declare const baseClass = "switch";
3
3
  export type SwitchSize = 'compact' | 'medium' | 'large';
4
4
  export type SwitchState = 'regular' | 'loading' | 'locked';
5
5
  export interface SwitchProps {
6
+ /**
7
+ * Specify the label for the switch input
8
+ */
6
9
  ariaLabel?: string;
10
+ /**
11
+ * The CSS class for switch container
12
+ */
7
13
  className?: string;
14
+ /**
15
+ * Will set the switch to "on" on component initialization
16
+ */
8
17
  defaultOn?: boolean;
18
+ /**
19
+ * Specify whether the switch should be disabled
20
+ */
9
21
  disabled?: boolean;
22
+ /**
23
+ * Ref object
24
+ */
10
25
  innerRef?: React.LegacyRef<HTMLInputElement> | undefined;
26
+ /**
27
+ * Specify the switch input name
28
+ */
11
29
  name?: string;
30
+ /**
31
+ * Define if switch is "on"
32
+ */
12
33
  on?: boolean;
34
+ /**
35
+ * The event handler for onChange
36
+ */
13
37
  onChange?(e: React.FormEvent, value: boolean): void;
38
+ /**
39
+ * Specify the switch size
40
+ */
14
41
  size?: SwitchSize;
42
+ /**
43
+ * Specify the switch state
44
+ */
15
45
  state?: SwitchState;
16
46
  }
17
47
  export declare const Switch: React.FC<SwitchProps>;
@@ -25,5 +25,5 @@ export declare const Tab: {
25
25
  (args: ITabArgs): React.ReactElement;
26
26
  args: TabProps;
27
27
  };
28
- export declare const StatesAndVariants: () => JSX.Element;
29
- export declare const Sizes: () => JSX.Element;
28
+ export declare const StatesAndVariants: () => React.ReactElement;
29
+ export declare const Sizes: () => React.ReactElement;
@@ -1,5 +1,5 @@
1
- import { TagInputProps } from './TagInput';
2
1
  import * as React from 'react';
2
+ import { TagInputProps } from './TagInput';
3
3
  export type EmailTagInputProps = Omit<TagInputProps, 'validator'>;
4
4
  export declare const emailRegex: RegExp;
5
5
  export declare const EmailTagInput: React.FC<EmailTagInputProps>;
@@ -7,4 +7,4 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
7
7
  export default _default;
8
8
  export declare const DefaultTagInput: Story<TagInputProps>;
9
9
  export declare const DefaultEmailTagInput: Story<EmailTagInputProps>;
10
- export declare const Sizes: () => JSX.Element;
10
+ export declare const Sizes: () => React.ReactElement;
@@ -4,4 +4,4 @@ import { TextareaProps } from './Textarea';
4
4
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
5
5
  export default _default;
6
6
  export declare const Default: Story<TextareaProps>;
7
- export declare const States: () => JSX.Element;
7
+ export declare const States: () => React.ReactElement;
@@ -9,6 +9,6 @@ export declare const Default: Story<ToastProps>;
9
9
  export declare const Kinds: Story;
10
10
  export declare const WithCloseIcon: Story;
11
11
  export declare const WithCustomAction: {
12
- (): JSX.Element;
12
+ (): React.ReactElement;
13
13
  parameters: import("@storybook/types").Parameters;
14
14
  };
@@ -20,11 +20,11 @@ export declare const Default: {
20
20
  hoverOutDelayTimeout: number;
21
21
  };
22
22
  };
23
- export declare const TooltipInfo: () => JSX.Element;
24
- export declare const TooltipInteractive: () => JSX.Element;
25
- export declare const TooltipReports: () => JSX.Element;
23
+ export declare const TooltipInfo: () => React.ReactElement;
24
+ export declare const TooltipInteractive: () => React.ReactElement;
25
+ export declare const TooltipReports: () => React.ReactElement;
26
26
  export declare const TooltipUserGuide: {
27
- (args: ITooltipProps): JSX.Element;
27
+ (args: ITooltipProps): React.ReactElement;
28
28
  args: {
29
29
  placement: string;
30
30
  isVisible: boolean;
@@ -1,7 +1,8 @@
1
+ import * as React from 'react';
1
2
  declare const SpotlightOverlay: ({ gap, isVisible, slide, disablePointerEvents, }: {
2
3
  gap: DOMRect | null;
3
4
  isVisible: boolean;
4
5
  slide: boolean;
5
6
  disablePointerEvents: boolean;
6
- }) => JSX.Element | null;
7
+ }) => React.ReactElement | null;
7
8
  export default SpotlightOverlay;