@bitrise/bitkit 9.37.0 → 9.38.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,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "9.37.0",
4
+ "version": "9.38.1",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -0,0 +1,24 @@
1
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
2
+ import List from './List';
3
+ import ListItem from './ListItem';
4
+
5
+ export default {
6
+ title: 'Components/List',
7
+ component: List,
8
+ } as ComponentMeta<typeof List>;
9
+
10
+ export const WithProps: ComponentStory<typeof List> = (props) => (
11
+ <List {...props}>
12
+ <ListItem>Lorem ipsum dolor sit amet</ListItem>
13
+ <ListItem>Consectetur adipiscing elit</ListItem>
14
+ <ListItem>
15
+ Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo.
16
+ </ListItem>
17
+ <ListItem>Facilisis in pretium nisl aliquet</ListItem>
18
+ </List>
19
+ );
20
+
21
+ WithProps.args = {
22
+ ...List.defaultProps,
23
+ isOrdered: false,
24
+ };
@@ -0,0 +1,20 @@
1
+ import type { ComponentStyleConfig } from '@chakra-ui/theme';
2
+
3
+ const ListTheme: ComponentStyleConfig = {
4
+ parts: ['container', 'item'],
5
+ baseStyle: ({ as }) => {
6
+ if (as === 'ul') {
7
+ return {
8
+ item: {
9
+ '::marker': {
10
+ fontSize: '12px',
11
+ },
12
+ },
13
+ };
14
+ }
15
+
16
+ return {};
17
+ },
18
+ };
19
+
20
+ export default ListTheme;
@@ -0,0 +1,20 @@
1
+ import { ListProps as ChakraListProps, forwardRef, OrderedList, UnorderedList } from '@chakra-ui/react';
2
+
3
+ export interface ListProps extends ChakraListProps {
4
+ isOrdered?: boolean;
5
+ }
6
+
7
+ /**
8
+ * List is used to display list items. It renders a <ul> or <ol> element by default.
9
+ */
10
+ const List = forwardRef<ListProps, 'ul'>((props, ref) => {
11
+ const { isOrdered, ...rest } = props;
12
+ const Component = isOrdered ? OrderedList : UnorderedList;
13
+ return <Component {...rest} ref={ref} />;
14
+ });
15
+
16
+ List.defaultProps = {
17
+ spacing: '8',
18
+ };
19
+
20
+ export default List;
@@ -0,0 +1,12 @@
1
+ import { ListItem as ChakraListItem, ListItemProps, forwardRef } from '@chakra-ui/react';
2
+
3
+ /**
4
+ * ListItem is the valid children of List. It renders a <li> element by default.
5
+ */
6
+ const ListItem = forwardRef<ListItemProps, 'li'>((props, ref) => {
7
+ return <ChakraListItem {...props} ref={ref} />;
8
+ });
9
+
10
+ export type { ListItemProps };
11
+
12
+ export default ListItem;
@@ -10,6 +10,7 @@ const TooltipTheme: SystemStyleObject = {
10
10
  paddingY: '8',
11
11
  borderRadius: '8',
12
12
  boxShadow: 'tooltip',
13
+ zIndex: 'tooltip',
13
14
  },
14
15
  };
15
16
 
@@ -8,6 +8,7 @@ const zIndices = {
8
8
  dialogOverlay: 1299,
9
9
  dialog: 1300,
10
10
  popover: 1400,
11
+ tooltip: 1500,
11
12
  };
12
13
 
13
14
  export default zIndices;
package/src/index.ts CHANGED
@@ -112,3 +112,9 @@ export { default as PopoverContent } from './Components/Popover/PopoverContent';
112
112
 
113
113
  export type { AvatarProps } from './Components/Avatar/Avatar';
114
114
  export { default as Avatar } from './Components/Avatar/Avatar';
115
+
116
+ export type { ListProps } from './Components/List/List';
117
+ export { default as List } from './Components/List/List';
118
+
119
+ export type { ListItemProps } from './Components/List/ListItem';
120
+ export { default as ListItem } from './Components/List/ListItem';
package/src/old.ts CHANGED
@@ -100,12 +100,6 @@ export { default as InputInlineHelp } from './Old/Input/InputInlineHelp';
100
100
  export type { Props as InputLabelProps } from './Old/Input/InputLabel';
101
101
  export { default as InputLabel } from './Old/Input/InputLabel';
102
102
 
103
- export type { Props as ListProps } from './Old/List/List';
104
- export { default as List } from './Old/List/List';
105
-
106
- export type { Props as ListItemProps } from './Old/List/ListItem';
107
- export { default as ListItem } from './Old/List/ListItem';
108
-
109
103
  export type { Props as LogoProps } from './Old/Logo/Logo';
110
104
  export { default as Logo } from './Old/Logo/Logo';
111
105
 
package/src/theme.ts CHANGED
@@ -7,6 +7,7 @@ import Dialog from './Components/Dialog/Dialog.theme';
7
7
  import Divider from './Components/Divider/Divider.theme';
8
8
  import EmptyState from './Components/EmptyState/EmptyState.theme';
9
9
  import Link from './Components/Link/Link.theme';
10
+ import List from './Components/List/List.theme';
10
11
  import Menu from './Components/Menu/Menu.theme';
11
12
  import Select from './Components/Select/Select.theme';
12
13
  import Tabs from './Components/Tabs/Tabs.theme';
@@ -68,6 +69,7 @@ const theme = {
68
69
  Divider,
69
70
  EmptyState,
70
71
  Link,
72
+ List,
71
73
  Menu,
72
74
  Modal: Dialog,
73
75
  Select,