@bitrise/bitkit 13.104.0 → 13.104.1-alpha.1
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,20 +1,55 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createMultiStyleConfigHelpers, defineStyle } from '@chakra-ui/styled-system';
|
|
2
|
+
import { rem } from '../../utils/utils';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers(['container', 'icon', 'item']);
|
|
5
|
+
|
|
6
|
+
const baseStyleContainer = defineStyle({
|
|
7
|
+
marginInlineStart: 16,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const baseStyleIcon = defineStyle({
|
|
11
|
+
marginEnd: '6',
|
|
12
|
+
display: 'inline',
|
|
13
|
+
verticalAlign: `-${rem(2)}`,
|
|
14
|
+
});
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
const baseStyle = definePartsStyle({
|
|
17
|
+
container: baseStyleContainer,
|
|
18
|
+
icon: baseStyleIcon,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const ListTheme = defineMultiStyleConfig({
|
|
22
|
+
baseStyle,
|
|
23
|
+
variants: {
|
|
24
|
+
ordered: {
|
|
25
|
+
container: {
|
|
26
|
+
counterReset: 'count',
|
|
27
|
+
marginInlineStart: rem(28),
|
|
28
|
+
},
|
|
29
|
+
item: {
|
|
30
|
+
position: 'relative',
|
|
31
|
+
counterIncrement: 'count',
|
|
32
|
+
_before: {
|
|
33
|
+
content: 'counter(count)',
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
left: `-${rem(28)}`,
|
|
36
|
+
top: '2',
|
|
37
|
+
paddingY: '2',
|
|
38
|
+
color: 'sys/neutral/strong',
|
|
39
|
+
backgroundColor: 'sys/neutral/subtle',
|
|
40
|
+
textAlign: 'center',
|
|
41
|
+
textStyle: 'comp/badge/sm',
|
|
42
|
+
width: '20',
|
|
43
|
+
borderRadius: '50%',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
unstyled: {
|
|
48
|
+
container: {
|
|
49
|
+
marginInlineStart: 0,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
16
52
|
},
|
|
17
|
-
|
|
18
|
-
};
|
|
53
|
+
});
|
|
19
54
|
|
|
20
55
|
export default ListTheme;
|
|
@@ -1,16 +1,32 @@
|
|
|
1
|
-
import { forwardRef,
|
|
1
|
+
import { forwardRef, List as ChakraList, ListProps as ChakraListProps } from '@chakra-ui/react';
|
|
2
2
|
|
|
3
3
|
export interface ListProps extends ChakraListProps {
|
|
4
|
-
|
|
4
|
+
variant?: 'simple-ordered' | 'ordered' | 'unordered' | 'unstyled';
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* List is used to display list items. It renders a <ul> or <ol> element by default.
|
|
9
9
|
*/
|
|
10
10
|
const List = forwardRef<ListProps, 'ul'>((props, ref) => {
|
|
11
|
-
const {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const { spacing = '8', variant = 'unordered', ...rest } = props;
|
|
12
|
+
|
|
13
|
+
let styleType: ListProps['styleType'] = 'none';
|
|
14
|
+
if (variant === 'unordered') {
|
|
15
|
+
styleType = 'initial';
|
|
16
|
+
}
|
|
17
|
+
if (variant === 'simple-ordered') {
|
|
18
|
+
styleType = 'decimal';
|
|
19
|
+
}
|
|
20
|
+
return (
|
|
21
|
+
<ChakraList
|
|
22
|
+
as={variant === 'ordered' || variant === 'simple-ordered' ? 'ol' : 'ul'}
|
|
23
|
+
spacing={spacing}
|
|
24
|
+
styleType={styleType}
|
|
25
|
+
variant={variant}
|
|
26
|
+
{...rest}
|
|
27
|
+
ref={ref}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
14
30
|
});
|
|
15
31
|
|
|
16
32
|
export default List;
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
ListItem as ChakraListItem,
|
|
4
|
+
ListItemProps as ChakraListItemProps,
|
|
5
|
+
ListIcon,
|
|
6
|
+
} from '@chakra-ui/react';
|
|
7
|
+
import { BoxProps } from '../Box/Box';
|
|
8
|
+
import { TypeIconName } from '../Icon/Icon';
|
|
9
|
+
import * as Icons from '../Icons/24x24';
|
|
10
|
+
|
|
11
|
+
export interface ListItemProps extends ChakraListItemProps {
|
|
12
|
+
iconColor?: BoxProps['color'];
|
|
13
|
+
iconName?: TypeIconName;
|
|
14
|
+
}
|
|
2
15
|
|
|
3
16
|
/**
|
|
4
17
|
* ListItem is the valid children of List. It renders a <li> element by default.
|
|
5
18
|
*/
|
|
6
19
|
const ListItem = forwardRef<ListItemProps, 'li'>((props, ref) => {
|
|
7
|
-
|
|
20
|
+
const { children, iconColor, iconName, ...rest } = props;
|
|
21
|
+
return (
|
|
22
|
+
<ChakraListItem {...rest} ref={ref}>
|
|
23
|
+
{!!iconName && <ListIcon as={Icons[iconName]} color={iconColor} />}
|
|
24
|
+
{children}
|
|
25
|
+
</ChakraListItem>
|
|
26
|
+
);
|
|
8
27
|
});
|
|
9
28
|
|
|
10
|
-
export type { ListItemProps };
|
|
11
|
-
|
|
12
29
|
export default ListItem;
|
|
@@ -42,7 +42,7 @@ const defaultComponents = (size: 'sm' | 'md' | 'lg', gap: GapType = '16'): Compo
|
|
|
42
42
|
h6: ({ node, ...props }) => <Text as="h6" textStyle="heading/h6" {...props} />,
|
|
43
43
|
hr: () => <Divider borderColor="separator.primary" my={gap} size="2" />,
|
|
44
44
|
li: ({ node, ...props }) => <ListItem {...props} />,
|
|
45
|
-
ol: ({ node, ...props }) => <List
|
|
45
|
+
ol: ({ node, ...props }) => <List variant="simple-ordered" {...props} />,
|
|
46
46
|
p: ({ node, ...props }) => <Text {...props} />,
|
|
47
47
|
pre: ({ node, ...props }) => (
|
|
48
48
|
<CodeSnippet variant="multi" size={codeSize}>
|