@bitrise/bitkit 13.69.0 → 13.71.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,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "13.69.0",
4
+ "version": "13.71.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -0,0 +1,35 @@
1
+ import { forwardRef } from '@chakra-ui/react';
2
+ import IconButton, { IconButtonProps } from '../IconButton/IconButton';
3
+
4
+ export interface ControlButtonProps extends Omit<IconButtonProps, 'iconSize' | 'size' | 'variant'> {
5
+ size?: 'xs' | 'sm' | 'md' | 'lg';
6
+ }
7
+
8
+ const colors: ControlButtonProps['sx'] = {
9
+ color: 'button/secondary/fg',
10
+ _hover: {
11
+ backgroundColor: 'button/tertiary/bg-hover',
12
+ color: 'button/secondary/fg-hover',
13
+ },
14
+ _active: {
15
+ backgroundColor: 'button/tertiary/bg-active',
16
+ color: 'button/secondary/fg-active',
17
+ },
18
+ };
19
+
20
+ const ControlButton = forwardRef<ControlButtonProps, 'button'>((props, ref) => {
21
+ const { isDanger, size = 'sm', ...rest } = props;
22
+ return (
23
+ <IconButton
24
+ iconSize={size === 'xs' ? '16' : '24'}
25
+ isDanger={isDanger}
26
+ ref={ref}
27
+ size={size === 'xs' ? 'sm' : size}
28
+ sx={!isDanger ? colors : undefined}
29
+ variant="tertiary"
30
+ {...rest}
31
+ />
32
+ );
33
+ });
34
+
35
+ export default ControlButton;
@@ -8,8 +8,8 @@ import {
8
8
  useTableStyles,
9
9
  } from '@chakra-ui/react';
10
10
  import Box from '../Box/Box';
11
+ import ControlButton from '../ControlButton/ControlButton';
11
12
  import Td from './Td';
12
- import TableIconButton from './TableIconButton';
13
13
 
14
14
  export type RowProps = ChakraTableRowProps;
15
15
 
@@ -49,7 +49,7 @@ const Tr = forwardRef<TableRowProps, 'tr'>((props, ref) => {
49
49
  <>
50
50
  <ChakraTr {...properties} ref={ref}>
51
51
  <Td sx={css.expandTd}>
52
- <TableIconButton
52
+ <ControlButton
53
53
  aria-label={isOpen ? 'Collapse row' : 'Expand row'}
54
54
  iconName="ChevronDown"
55
55
  isTooltipDisabled
package/src/index.ts CHANGED
@@ -294,9 +294,6 @@ export { default as LinkBox } from './Components/LinkBox/LinkBox';
294
294
  export type { LinkOverlayProps } from './Components/LinkOverlay/LinkOverlay';
295
295
  export { default as LinkOverlay } from './Components/LinkOverlay/LinkOverlay';
296
296
 
297
- export type { TableIconButtonProps } from './Components/Table/TableIconButton';
298
- export { default as TableIconButton } from './Components/Table/TableIconButton';
299
-
300
297
  export type { ExpandableCardProps } from './Components/ExpandableCard/ExpandableCard';
301
298
  export { default as ExpandableCard } from './Components/ExpandableCard/ExpandableCard';
302
299
 
@@ -329,3 +326,6 @@ export { default as TagsInput } from './Components/Form/TagsInput/TagsInput';
329
326
 
330
327
  export type { DraggableCardProps } from './Components/DraggableCard/DraggableCard';
331
328
  export { default as DraggableCard } from './Components/DraggableCard/DraggableCard';
329
+
330
+ export type { ControlButtonProps } from './Components/ControlButton/ControlButton';
331
+ export { default as ControlButton } from './Components/ControlButton/ControlButton';
@@ -1,27 +0,0 @@
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
- const { isDanger } = props;
8
- return (
9
- <IconButton
10
- ref={ref}
11
- _active={{
12
- backgroundColor: 'pal.neutral.80',
13
- }}
14
- _hover={{
15
- backgroundColor: 'pal.neutral.90',
16
- }}
17
- color={isDanger ? undefined : 'pal.purple.10'}
18
- iconSize="24"
19
- isDanger={isDanger}
20
- size="sm"
21
- variant="tertiary"
22
- {...props}
23
- />
24
- );
25
- });
26
-
27
- export default TableIconButton;