@bitrise/bitkit 13.297.0 → 13.298.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.297.0",
4
+ "version": "13.298.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -1,28 +1,18 @@
1
1
  import { forwardRef, ListItem as ChakraListItem, ListItemProps as ChakraListItemProps } from 'chakra-ui-2--react';
2
2
  import Box, { BoxProps } from '../Box/Box';
3
- import Icon, { IconProps, TypeIconName } from '../Icon/Icon';
3
+ import Icon, { TypeIconName } from '../Icon/Icon';
4
4
 
5
5
  export interface ListItemProps extends ChakraListItemProps {
6
6
  iconColor?: BoxProps['color'];
7
7
  iconName?: TypeIconName;
8
- iconSize?: IconProps['size'];
8
+ iconSize?: '16' | '24';
9
9
  }
10
10
 
11
11
  /**
12
12
  * ListItem is the valid children of List. It renders a <li> element by default.
13
13
  */
14
14
  const ListItem = forwardRef<ListItemProps, 'li'>((props, ref) => {
15
- const { children, iconColor, iconName, iconSize, ...rest } = props;
16
- let iconVerticalAlign = 'middle';
17
- if (iconSize === '16') {
18
- iconVerticalAlign = '-3px';
19
- }
20
- if (iconSize === '24') {
21
- iconVerticalAlign = '-6px';
22
- }
23
- if (iconSize === '32') {
24
- iconVerticalAlign = '-11px';
25
- }
15
+ const { children, iconColor, iconName, iconSize, textStyle, ...rest } = props;
26
16
 
27
17
  if (!iconName) {
28
18
  return (
@@ -40,9 +30,10 @@ const ListItem = forwardRef<ListItemProps, 'li'>((props, ref) => {
40
30
  name={iconName}
41
31
  height="100%"
42
32
  color={iconColor}
43
- marginEnd="6"
33
+ marginBlockStart={iconSize === '16' ? '2' : undefined}
34
+ marginInlineEnd="8"
44
35
  size={iconSize}
45
- verticalAlign={iconVerticalAlign}
36
+ verticalAlign="middle"
46
37
  />
47
38
  )}
48
39
  <Box flexGrow={1}>{children}</Box>