@livechat/design-system-react-components 1.0.0-alpha.52 → 1.0.0-alpha.54

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 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../src/foundations/spacing.css"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"spacing.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../src/foundations/spacing.css"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"spacing.css"}
@@ -9,6 +9,7 @@
9
9
  --spacing-6: 24px;
10
10
  --spacing-8: 32px;
11
11
  --spacing-12: 48px;
12
+ --spacing-14: 56px;
12
13
  --spacing-16: 64px;
13
14
  --spacing-18: 72px;
14
15
  --spacing-20: 80px;
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../src/foundations/spacing.css"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"spacing.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../src/foundations/spacing.css"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"spacing.css"}
@@ -1,8 +1,31 @@
1
1
  import * as React from 'react';
2
2
  declare type AlertKind = 'info' | 'warning' | 'success' | 'error';
3
3
  export interface AlertProps {
4
+ /**
5
+ * The CSS class for container
6
+ */
4
7
  className?: string;
8
+ /**
9
+ * Specify the kind of Alert
10
+ */
5
11
  kind?: AlertKind;
12
+ /**
13
+ * Shows the primary CTA button
14
+ */
15
+ primaryButton?: {
16
+ handleClick: () => void;
17
+ label: string;
18
+ };
19
+ /**
20
+ * Shows the secondary CTA button
21
+ */
22
+ secondaryButton?: {
23
+ handleClick: () => void;
24
+ label: string;
25
+ };
26
+ /**
27
+ * The optional event handler for close button
28
+ */
6
29
  onClose?: () => void;
7
30
  }
8
31
  export declare const Alert: React.FC<React.PropsWithChildren<AlertProps>>;
@@ -4,15 +4,45 @@ declare type AvatarSize = 'xxxsmall' | 'xxsmall' | 'xsmall' | 'small' | 'medium'
4
4
  declare type AvatarStatus = 'available' | 'unavailable' | 'unknown';
5
5
  declare type AvatarType = 'image' | 'text';
6
6
  export interface AvatarProps {
7
+ /**
8
+ * Alternate text for an image avatar
9
+ */
7
10
  alt?: string;
11
+ /**
12
+ * The CSS class for container
13
+ */
8
14
  className?: string;
15
+ /**
16
+ * Specify the background color
17
+ */
9
18
  color?: string;
19
+ /**
20
+ * Specify the avatar shape
21
+ */
10
22
  shape?: AvatarShape;
23
+ /**
24
+ * Specify the avatar size
25
+ */
11
26
  size?: AvatarSize;
27
+ /**
28
+ * Image source for the image avatar
29
+ */
12
30
  src?: string;
31
+ /**
32
+ * Displays status dot
33
+ */
13
34
  status?: AvatarStatus;
35
+ /**
36
+ * Text for an text avatar
37
+ */
14
38
  text?: string;
39
+ /**
40
+ * Specify the avatar type
41
+ */
15
42
  type: AvatarType;
43
+ /**
44
+ * Displays rim
45
+ */
16
46
  withRim?: boolean;
17
47
  }
18
48
  export declare const Avatar: React.FC<AvatarProps>;
@@ -1,9 +1,24 @@
1
1
  import * as React from 'react';
2
2
  export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
3
+ /**
4
+ * Value to display
5
+ */
3
6
  count?: number;
7
+ /**
8
+ * Specify the badge kind
9
+ */
4
10
  kind?: 'primary' | 'secondary' | 'tertiary';
11
+ /**
12
+ * The maximum value after which a "+" will be displayed next to the number
13
+ */
5
14
  max?: number;
15
+ /**
16
+ * Specify the badge size
17
+ */
6
18
  size?: 'large' | 'medium' | 'compact';
19
+ /**
20
+ * Specify the badge type
21
+ */
7
22
  type?: 'counter' | 'alert' | 'dot';
8
23
  }
9
24
  export declare const Badge: React.FC<BadgeProps>;
@@ -1,21 +1,63 @@
1
1
  import * as React from 'react';
2
2
  import { Size } from 'utils';
3
- export declare type ButtonKind = 'basic' | 'primary' | 'secondary' | 'destructive' | 'text' | 'plain' | 'plain-light' | 'subtle';
3
+ export declare type ButtonKind = 'basic' | 'primary' | 'secondary' | 'destructive' | 'text' | 'plain' | 'plain-light' | 'subtle' | 'float' | 'dotted';
4
4
  export declare type ButtonProps = {
5
+ /**
6
+ * Specify the button kind
7
+ */
5
8
  kind?: ButtonKind;
9
+ /**
10
+ * Specify the button size
11
+ */
6
12
  size?: Size;
13
+ /**
14
+ * Set the loading state
15
+ */
7
16
  loading?: boolean;
17
+ /**
18
+ * Set the button for full width
19
+ */
8
20
  fullWidth?: boolean;
21
+ /**
22
+ * Text displayed in loading state
23
+ */
9
24
  loaderLabel?: string;
25
+ /**
26
+ * Renders given element
27
+ */
10
28
  icon?: React.ReactElement;
29
+ /**
30
+ * Specify the place to render element given in `icon` prop
31
+ */
11
32
  iconPosition?: 'left' | 'right';
12
33
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>;
13
34
  export declare const Button: React.ForwardRefExoticComponent<{
35
+ /**
36
+ * Specify the button kind
37
+ */
14
38
  kind?: ButtonKind | undefined;
39
+ /**
40
+ * Specify the button size
41
+ */
15
42
  size?: Size | undefined;
43
+ /**
44
+ * Set the loading state
45
+ */
16
46
  loading?: boolean | undefined;
47
+ /**
48
+ * Set the button for full width
49
+ */
17
50
  fullWidth?: boolean | undefined;
51
+ /**
52
+ * Text displayed in loading state
53
+ */
18
54
  loaderLabel?: string | undefined;
55
+ /**
56
+ * Renders given element
57
+ */
19
58
  icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
59
+ /**
60
+ * Specify the place to render element given in `icon` prop
61
+ */
20
62
  iconPosition?: "right" | "left" | undefined;
21
63
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLButtonElement & HTMLAnchorElement>>;
@@ -2,11 +2,29 @@ import * as React from 'react';
2
2
  import { ButtonProps } from '../Button';
3
3
  export declare type CardButtonOptions = Pick<ButtonProps, 'children' | 'kind' | 'onClick'>;
4
4
  export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /**
6
+ * Alternate text for an image card
7
+ */
5
8
  alt?: string;
9
+ /**
10
+ * Array of card buttons
11
+ */
6
12
  buttonsOptions?: CardButtonOptions[];
13
+ /**
14
+ * Card description
15
+ */
7
16
  description?: string;
17
+ /**
18
+ * Element to display in the expandable area
19
+ */
8
20
  expandableContent?: React.ReactNode;
21
+ /**
22
+ * Image source for the image card
23
+ */
9
24
  src?: string;
25
+ /**
26
+ * Card title
27
+ */
10
28
  title?: string;
11
29
  }
12
30
  export declare const Card: React.FC<CardProps>;
@@ -4,20 +4,69 @@ import { IconSize } from '../Icon';
4
4
  import { Size } from 'utils';
5
5
  export declare type PickerType = 'single' | 'multi';
6
6
  export interface IPickerProps {
7
+ /**
8
+ * Specify the custom id
9
+ */
7
10
  id?: string;
11
+ /**
12
+ * The CSS class for picker container
13
+ */
8
14
  className?: string;
15
+ /**
16
+ * Specify whether the picker should be disabled
17
+ */
9
18
  disabled?: boolean;
19
+ /**
20
+ * Specify whether the picker should be in error state
21
+ */
10
22
  error?: boolean;
23
+ /**
24
+ * Array of picker options
25
+ */
11
26
  options: IPickerListItem[];
27
+ /**
28
+ * Array of picker selected options
29
+ */
12
30
  selected?: IPickerListItem[] | null;
31
+ /**
32
+ * Specify the picker size
33
+ */
13
34
  size?: Size;
35
+ /**
36
+ * Set the dismiss icon size in tags when `multi` type is enabled
37
+ */
14
38
  tagIconSize?: IconSize;
39
+ /**
40
+ * Specify the placeholder for search input
41
+ */
15
42
  placeholder?: string;
43
+ /**
44
+ * Specify whether the option select is required
45
+ */
16
46
  isRequired?: boolean;
47
+ /**
48
+ * Text if no search result were found
49
+ */
17
50
  noSearchResultText?: string;
51
+ /**
52
+ * Text for `select all` option which will be visible if defined in multi select mode
53
+ */
18
54
  selectAllOptionText?: string;
55
+ /**
56
+ * Set `multi` to specify whether the picker should allow to multi selection
57
+ */
19
58
  type?: PickerType;
59
+ /**
60
+ * Set to disable search input
61
+ */
20
62
  searchDisabled?: boolean;
63
+ /**
64
+ * Set to hide clear selection button
65
+ */
66
+ hideClearButton?: boolean;
67
+ /**
68
+ * Callback called after item selection
69
+ */
21
70
  onSelect: (selectedItems: IPickerListItem[] | null) => void;
22
71
  }
23
72
  export declare const Picker: React.FC<IPickerProps>;
@@ -9,6 +9,7 @@ export interface ITriggerProps {
9
9
  isRequired?: boolean;
10
10
  isMultiSelect?: boolean;
11
11
  size?: Size;
12
+ hideClearButton?: boolean;
12
13
  onTrigger: (e: React.MouseEvent | KeyboardEvent) => void;
13
14
  onClear: () => void;
14
15
  }
@@ -2,11 +2,33 @@ import * as React from 'react';
2
2
  import { Placement, flip } from '@floating-ui/react-dom';
3
3
  export interface IPopoverProps {
4
4
  children?: React.ReactNode;
5
+ /**
6
+ * The CSS class for popover container
7
+ */
5
8
  className?: string;
9
+ /**
10
+ * The popover placement related to the trigger element
11
+ */
6
12
  placement?: Placement;
13
+ /**
14
+ * Set popover visibility
15
+ */
7
16
  isVisible?: boolean;
17
+ /**
18
+ * Set the popover placement to keep it in view
19
+ */
8
20
  flipOptions?: Parameters<typeof flip>[0];
21
+ /**
22
+ * Set `false` if the menu is not to be closed with a esc press
23
+ */
24
+ closeOnEsc?: boolean;
25
+ /**
26
+ * Trigger element
27
+ */
9
28
  triggerRenderer: () => React.ReactNode;
29
+ /**
30
+ * Optional callback called after popover close
31
+ */
10
32
  onClose?: () => void;
11
33
  }
12
34
  export declare const Popover: React.FC<IPopoverProps>;
@@ -9,6 +9,7 @@ export declare const SpacingToken: {
9
9
  Spacing6: string;
10
10
  Spacing8: string;
11
11
  Spacing12: string;
12
+ Spacing14: string;
12
13
  Spacing16: string;
13
14
  Spacing18: string;
14
15
  Spacing20: string;