@bitrise/bitkit 13.154.0 → 13.156.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.154.0",
4
+ "version": "13.156.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -1,13 +1,13 @@
1
1
  import { Fragment } from 'react';
2
2
  import { Portal } from '@chakra-ui/react';
3
- import IconButton, { IconButtonProps } from '../IconButton/IconButton';
3
+ import ControlButton, { ControlButtonProps } from '../ControlButton/ControlButton';
4
4
  import Menu, { MenuProps } from '../Menu/Menu';
5
5
  import MenuButton from '../Menu/MenuButton';
6
6
  import MenuList, { MenuListProps } from '../Menu/MenuList';
7
7
 
8
8
  export interface OverflowMenuProps extends MenuProps {
9
9
  children: MenuListProps['children'];
10
- buttonSize?: IconButtonProps['size'];
10
+ buttonSize?: ControlButtonProps['size'];
11
11
  triggerLabel?: string;
12
12
  withPortal?: boolean;
13
13
  }
@@ -18,11 +18,10 @@ const OverflowMenu = ({ buttonSize = 'sm', children, triggerLabel = 'Open menu',
18
18
  <Menu isLazy>
19
19
  <MenuButton
20
20
  aria-label={triggerLabel}
21
- as={IconButton}
21
+ as={ControlButton}
22
22
  iconName="MoreVertical"
23
23
  isTooltipDisabled
24
24
  size={buttonSize}
25
- variant="tertiary"
26
25
  />
27
26
  <Wrapper>
28
27
  <MenuList>{children}</MenuList>
@@ -13,8 +13,8 @@ export type PaginationProps = {
13
13
  perPage: number;
14
14
  totalCount: number;
15
15
  setPage: (newPage: number) => void;
16
- setPerPage: (newPerPage: number) => void;
17
16
  itemsPerPageOptions?: number[];
17
+ setPerPage?: (newPerPage: number) => void;
18
18
  };
19
19
 
20
20
  const Pagination = ({
@@ -31,23 +31,27 @@ const Pagination = ({
31
31
 
32
32
  return (
33
33
  <Box alignItems="center" display="flex" gap="1rem">
34
- <Box alignItems="center" display="flex" gap="0.5rem">
35
- <Text textStyle="body/md/regular">Items per page:</Text>
36
- <Dropdown
37
- onChange={({ target }) => setPerPage(Number(target.value))}
38
- search={false}
39
- size="md"
40
- value={perPage.toString()}
41
- width="auto"
42
- >
43
- {itemsPerPageOptions.map((perPageOption) => (
44
- <DropdownOption key={perPageOption} value={perPageOption.toString()}>
45
- {perPageOption}
46
- </DropdownOption>
47
- ))}
48
- </Dropdown>
49
- </Box>
50
- <Divider color="pal.neutral.90" height="3rem" orientation="vertical" />
34
+ {setPerPage && (
35
+ <>
36
+ <Box alignItems="center" display="flex" gap="0.5rem">
37
+ <Text textStyle="body/md/regular">Items per page:</Text>
38
+ <Dropdown
39
+ onChange={({ target }) => setPerPage(Number(target.value))}
40
+ search={false}
41
+ size="md"
42
+ value={perPage.toString()}
43
+ width="auto"
44
+ >
45
+ {itemsPerPageOptions.map((perPageOption) => (
46
+ <DropdownOption key={perPageOption} value={perPageOption.toString()}>
47
+ {perPageOption}
48
+ </DropdownOption>
49
+ ))}
50
+ </Dropdown>
51
+ </Box>
52
+ <Divider color="pal.neutral.90" height="3rem" orientation="vertical" />
53
+ </>
54
+ )}
51
55
  <Text as="span" marginRight="auto" textStyle="body/md/regular">
52
56
  {itemsStartIndex}-{itemsEndIndex} of {totalCount} items
53
57
  </Text>