@bitrise/bitkit 12.39.1 → 12.40.0
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,11 +1,12 @@
|
|
|
1
1
|
import { IconButton as ChakraIconButton, IconButtonProps as ChakraIconButtonProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
-
import Icon, { TypeIconName } from '../Icon/Icon';
|
|
2
|
+
import Icon, { IconProps, TypeIconName } from '../Icon/Icon';
|
|
3
3
|
import Tooltip, { TooltipProps } from '../Tooltip/Tooltip';
|
|
4
4
|
|
|
5
5
|
export interface IconButtonProps extends ChakraIconButtonProps {
|
|
6
6
|
as?: 'a' | 'button';
|
|
7
7
|
iconName: TypeIconName;
|
|
8
8
|
isDanger?: boolean;
|
|
9
|
+
iconSize?: IconProps['size'];
|
|
9
10
|
isTooltipDisabled?: boolean;
|
|
10
11
|
label?: string;
|
|
11
12
|
size?: 'small' | 'medium';
|
|
@@ -21,6 +22,7 @@ const IconButton = forwardRef<IconButtonProps, 'button'>((props, ref) => {
|
|
|
21
22
|
const {
|
|
22
23
|
as,
|
|
23
24
|
iconName,
|
|
25
|
+
iconSize,
|
|
24
26
|
isDanger,
|
|
25
27
|
isDisabled,
|
|
26
28
|
isTooltipDisabled,
|
|
@@ -33,7 +35,7 @@ const IconButton = forwardRef<IconButtonProps, 'button'>((props, ref) => {
|
|
|
33
35
|
} = props;
|
|
34
36
|
const properties: ChakraIconButtonProps = {
|
|
35
37
|
as: isDisabled ? 'button' : as,
|
|
36
|
-
icon: <Icon name={iconName} size={size === 'small' ? '16' : '24'} />,
|
|
38
|
+
icon: <Icon name={iconName} size={iconSize || (size === 'small' ? '16' : '24')} />,
|
|
37
39
|
isDisabled,
|
|
38
40
|
size,
|
|
39
41
|
variant: isDanger ? `${variant}--danger` : variant,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { forwardRef } from '@chakra-ui/react';
|
|
2
|
+
import IconButton, { IconButtonProps } from '../IconButton/IconButton';
|
|
3
|
+
|
|
4
|
+
export type TableIconButtonProps = Omit<IconButtonProps, 'iconSize' | 'size' | 'variant'>;
|
|
5
|
+
|
|
6
|
+
const TableIconButton = forwardRef<TableIconButtonProps, 'button'>((props, ref) => (
|
|
7
|
+
<IconButton {...props} iconSize="24" size="small" variant="tertiary" ref={ref} />
|
|
8
|
+
));
|
|
9
|
+
|
|
10
|
+
export default TableIconButton;
|
package/src/index.ts
CHANGED
|
@@ -295,3 +295,6 @@ export { default as LinkBox } from './Components/LinkBox/LinkBox';
|
|
|
295
295
|
|
|
296
296
|
export type { LinkOverlayProps } from './Components/LinkOverlay/LinkOverlay';
|
|
297
297
|
export { default as LinkOverlay } from './Components/LinkOverlay/LinkOverlay';
|
|
298
|
+
|
|
299
|
+
export type { TableIconButtonProps } from './Components/Table/TableIconButton';
|
|
300
|
+
export { default as TableIconButton } from './Components/Table/TableIconButton';
|