@bitrise/bitkit 13.104.1-alpha.2 → 13.104.1-alpha.3
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
|
@@ -45,15 +45,8 @@ const baseStyleContainer = defineStyle({
|
|
|
45
45
|
marginInlineStart: '16',
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
const baseStyleIcon = defineStyle({
|
|
49
|
-
marginEnd: rem(6),
|
|
50
|
-
display: 'inline',
|
|
51
|
-
verticalAlign: `-${rem(2)}`,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
48
|
const baseStyle = definePartsStyle({
|
|
55
49
|
container: baseStyleContainer,
|
|
56
|
-
icon: baseStyleIcon,
|
|
57
50
|
});
|
|
58
51
|
|
|
59
52
|
const variantOrdered = defineStyle((props) => {
|
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
forwardRef,
|
|
3
|
-
ListItem as ChakraListItem,
|
|
4
|
-
ListItemProps as ChakraListItemProps,
|
|
5
|
-
ListIcon,
|
|
6
|
-
} from '@chakra-ui/react';
|
|
1
|
+
import { forwardRef, ListItem as ChakraListItem, ListItemProps as ChakraListItemProps } from '@chakra-ui/react';
|
|
7
2
|
import { BoxProps } from '../Box/Box';
|
|
8
|
-
import { TypeIconName } from '../Icon/Icon';
|
|
9
|
-
import * as Icons from '../Icons/24x24';
|
|
3
|
+
import Icon, { IconProps, TypeIconName } from '../Icon/Icon';
|
|
10
4
|
|
|
11
5
|
export interface ListItemProps extends ChakraListItemProps {
|
|
12
6
|
iconColor?: BoxProps['color'];
|
|
13
7
|
iconName?: TypeIconName;
|
|
8
|
+
iconSize?: IconProps['size'];
|
|
14
9
|
}
|
|
15
10
|
|
|
16
11
|
/**
|
|
17
12
|
* ListItem is the valid children of List. It renders a <li> element by default.
|
|
18
13
|
*/
|
|
19
14
|
const ListItem = forwardRef<ListItemProps, 'li'>((props, ref) => {
|
|
20
|
-
const { children, iconColor, iconName, ...rest } = props;
|
|
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
|
+
}
|
|
21
26
|
return (
|
|
22
27
|
<ChakraListItem {...rest} ref={ref}>
|
|
23
|
-
{!!iconName &&
|
|
28
|
+
{!!iconName && (
|
|
29
|
+
<Icon name={iconName} color={iconColor} marginEnd="6" size={iconSize} verticalAlign={iconVerticalAlign} />
|
|
30
|
+
)}
|
|
24
31
|
{children}
|
|
25
32
|
</ChakraListItem>
|
|
26
33
|
);
|