@livechat/design-system-react-components 1.0.0-alpha.51 → 1.0.0-alpha.53
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.
- package/dist/dsrc.cjs.js +5 -5
- package/dist/dsrc.es.js +268 -173
- package/dist/dsrc.umd.js +5 -5
- package/dist/src/components/ActionMenu/ActionMenu.d.ts +27 -0
- package/dist/src/components/ActionMenu/index.d.ts +1 -0
- package/dist/src/components/Alert/Alert.d.ts +9 -0
- package/dist/src/components/Avatar/Avatar.d.ts +30 -0
- package/dist/src/components/Badge/Badge.d.ts +15 -0
- package/dist/src/components/Button/Button.d.ts +44 -2
- package/dist/src/components/Picker/Picker.d.ts +49 -0
- package/dist/src/components/Picker/Trigger.d.ts +1 -0
- package/dist/src/components/Popover/Popover.d.ts +22 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Placement } from '@floating-ui/react-dom';
|
|
3
|
+
export interface ActionMenuProps {
|
|
4
|
+
/**
|
|
5
|
+
* The CSS class for menu container
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Array of menu options
|
|
10
|
+
*/
|
|
11
|
+
options: Array<{
|
|
12
|
+
key: string;
|
|
13
|
+
element: string | React.ReactElement;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
withDivider?: boolean;
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Trigger element
|
|
20
|
+
*/
|
|
21
|
+
triggerRenderer: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* The menu placement
|
|
24
|
+
*/
|
|
25
|
+
placement?: Placement;
|
|
26
|
+
}
|
|
27
|
+
export declare const ActionMenu: React.FC<ActionMenuProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ActionMenu } from './ActionMenu';
|
|
@@ -1,8 +1,17 @@
|
|
|
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
|
+
* The optional event handler for close button
|
|
14
|
+
*/
|
|
6
15
|
onClose?: () => void;
|
|
7
16
|
}
|
|
8
17
|
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';
|
|
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;
|
|
20
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Specify the place to render element given in `icon` prop
|
|
61
|
+
*/
|
|
62
|
+
iconPosition?: "right" | "left" | undefined;
|
|
21
63
|
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLButtonElement & HTMLAnchorElement>>;
|
|
@@ -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>;
|
|
@@ -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>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { DesignToken } from './themes/design-token';
|
|
|
2
2
|
export { SpacingToken } from './foundations/spacing-token';
|
|
3
3
|
export { ShadowToken } from './foundations/shadow-token';
|
|
4
4
|
export type { Size } from './utils';
|
|
5
|
+
export * from './components/ActionMenu';
|
|
5
6
|
export * from './components/Alert';
|
|
6
7
|
export * from './components/Avatar';
|
|
7
8
|
export * from './components/Badge';
|