@bitrise/bitkit 9.21.0-alpha-chakra.1 → 9.21.0-alpha-chakra.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.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit",
|
|
3
3
|
"description": "Bitrise React component library",
|
|
4
|
-
"version": "9.21.0-alpha-chakra.
|
|
4
|
+
"version": "9.21.0-alpha-chakra.2",
|
|
5
5
|
"repository": "git@github.com:bitrise-io/bitkit.git",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"license": "UNLICENSED",
|
|
@@ -9,6 +9,7 @@ export interface IconButtonProps extends ChakraIconButtonProps {
|
|
|
9
9
|
isDanger?: boolean;
|
|
10
10
|
label?: string;
|
|
11
11
|
size?: 'small' | 'medium';
|
|
12
|
+
tooltipCloseDelay?: number;
|
|
12
13
|
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -16,7 +17,7 @@ export interface IconButtonProps extends ChakraIconButtonProps {
|
|
|
16
17
|
* IconButton composes the `Button` component except that it renders only an icon.
|
|
17
18
|
*/
|
|
18
19
|
const IconButton = forwardRef<IconButtonProps, 'button'>((props, ref) => {
|
|
19
|
-
const { as, iconName, isDanger, isDisabled, label, variant, ...rest } = props;
|
|
20
|
+
const { as, iconName, isDanger, isDisabled, label, tooltipCloseDelay, variant, ...rest } = props;
|
|
20
21
|
const properties: ChakraIconButtonProps = {
|
|
21
22
|
as: isDisabled ? 'button' : as,
|
|
22
23
|
icon: <Icon name={iconName} />,
|
|
@@ -25,7 +26,7 @@ const IconButton = forwardRef<IconButtonProps, 'button'>((props, ref) => {
|
|
|
25
26
|
...rest,
|
|
26
27
|
};
|
|
27
28
|
return (
|
|
28
|
-
<Tooltip label={label || rest['aria-label']} shouldWrapChildren={isDisabled}>
|
|
29
|
+
<Tooltip closeDelay={tooltipCloseDelay} label={label || rest['aria-label']} shouldWrapChildren={isDisabled}>
|
|
29
30
|
<ChakraIconButton {...properties} ref={ref} />
|
|
30
31
|
</Tooltip>
|
|
31
32
|
);
|
|
@@ -34,6 +35,7 @@ const IconButton = forwardRef<IconButtonProps, 'button'>((props, ref) => {
|
|
|
34
35
|
IconButton.defaultProps = {
|
|
35
36
|
as: 'button',
|
|
36
37
|
size: 'medium',
|
|
38
|
+
tooltipCloseDelay: 0,
|
|
37
39
|
variant: 'primary',
|
|
38
40
|
} as IconButtonProps;
|
|
39
41
|
|