@livechat/design-system-react-components 1.17.1-alpha.3 → 1.17.1

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,27 +1,37 @@
1
1
  import * as React from 'react';
2
+ import { TagKind, TagSize } from './types';
2
3
  export interface TagProps extends React.HTMLAttributes<HTMLDivElement> {
3
4
  /**
4
5
  * Specify the tag kind
5
6
  */
6
- kind?: 'default' | 'info' | 'warning' | 'success' | 'error' | 'purple' | 'black';
7
+ kind?: TagKind;
7
8
  /**
8
9
  * Specify the tag size
9
10
  */
10
- size?: 'small' | 'medium' | 'large' | 'xlarge';
11
+ size?: TagSize;
11
12
  /**
12
13
  * Set the tag custom color
13
14
  */
14
15
  customColor?: string;
15
16
  /**
16
17
  * Set to show close icon
18
+ * @deprecated The close icon will be visible by providing the `onRemove` prop and this flag will no longer be needed
17
19
  */
18
20
  dismissible?: boolean;
21
+ /**
22
+ * Set to show close icon on hover only if the `onRemove` prop is provided
23
+ */
24
+ dismissibleOnHover?: boolean;
25
+ /**
26
+ * Set to hide close icon if the `onRemove` prop is provided
27
+ */
28
+ disabled?: boolean;
19
29
  /**
20
30
  * Outlined version of tag
21
31
  */
22
32
  outline?: boolean;
23
33
  /**
24
- * The event handler for close icon click
34
+ * The event handler for close icon click, if provided the close icon will be visible
25
35
  */
26
36
  onRemove?(e: React.MouseEvent): void;
27
37
  /**
@@ -32,5 +42,9 @@ export interface TagProps extends React.HTMLAttributes<HTMLDivElement> {
32
42
  * React node element to show on the right
33
43
  */
34
44
  rightNode?: React.ReactElement;
45
+ /**
46
+ * Set to show the tag as square (only if you want use icon without text)
47
+ */
48
+ iconOnly?: boolean;
35
49
  }
36
50
  export declare const Tag: React.FC<React.PropsWithChildren<TagProps>>;
@@ -0,0 +1,2 @@
1
+ export declare const kinds: readonly ["default", "info", "warning", "success", "error", "purple", "black", "gray", "gradient01", "gradient02", "gradient03", "gradient04", "gradient05", "gradient06", "gradient07", "gradient08", "gradient09", "gradient10", "gradient11"];
2
+ export declare const sizes: readonly ["small", "medium", "large", "xlarge"];
@@ -1,2 +1,3 @@
1
1
  export { Tag } from './Tag';
2
2
  export type { TagProps } from './Tag';
3
+ export type { TagKind, TagSize } from './types';
@@ -0,0 +1,3 @@
1
+ import { kinds, sizes } from './constants';
2
+ export type TagKind = (typeof kinds)[number];
3
+ export type TagSize = (typeof sizes)[number];