@bitrise/bitkit 12.69.0 → 12.69.2

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": "12.69.0",
4
+ "version": "12.69.2",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -12,7 +12,10 @@ const getInitials = (name: string) => {
12
12
  if (name.length < 3) {
13
13
  return name;
14
14
  }
15
- return `${name.charAt(0)}${name.charAt(name.length - 1)}`;
15
+
16
+ const nameArray = Array.from(name);
17
+
18
+ return `${nameArray[0]}${nameArray[nameArray.length - 1]}`;
16
19
  };
17
20
 
18
21
  const Avatar = forwardRef<AvatarProps, 'span'>((props, ref) => (
@@ -4,9 +4,6 @@ const { defineMultiStyleConfig } = createMultiStyleConfigHelpers(['button', 'che
4
4
 
5
5
  const ExpandableCardTheme = defineMultiStyleConfig({
6
6
  baseStyle: ({ isOpen }) => ({
7
- box: {
8
- zIndex: 1,
9
- },
10
7
  button: {
11
8
  borderTopStartRadius: '8',
12
9
  borderTopEndRadius: '8',
@@ -1,3 +1,5 @@
1
+ import { Fragment } from 'react';
2
+ import { Portal } from '@chakra-ui/react';
1
3
  import IconButton, { IconButtonProps } from '../IconButton/IconButton';
2
4
  import Menu, { MenuProps } from '../Menu/Menu';
3
5
  import MenuButton from '../Menu/MenuButton';
@@ -7,9 +9,11 @@ export interface OverflowMenuProps extends MenuProps {
7
9
  children: MenuListProps['children'];
8
10
  buttonSize?: IconButtonProps['size'];
9
11
  triggerLabel?: string;
12
+ withPortal?: boolean;
10
13
  }
11
14
 
12
- const OverflowMenu = ({ buttonSize = 'small', children, triggerLabel }: OverflowMenuProps) => {
15
+ const OverflowMenu = ({ buttonSize = 'small', children, triggerLabel, withPortal }: OverflowMenuProps) => {
16
+ const Wrapper = withPortal ? Portal : Fragment;
13
17
  return (
14
18
  <Menu isLazy>
15
19
  <MenuButton
@@ -20,13 +24,16 @@ const OverflowMenu = ({ buttonSize = 'small', children, triggerLabel }: Overflow
20
24
  size={buttonSize}
21
25
  variant="tertiary"
22
26
  />
23
- <MenuList>{children}</MenuList>
27
+ <Wrapper>
28
+ <MenuList>{children}</MenuList>
29
+ </Wrapper>
24
30
  </Menu>
25
31
  );
26
32
  };
27
33
 
28
34
  OverflowMenu.defaultProps = {
29
35
  triggerLabel: 'Open menu',
36
+ withPortal: false,
30
37
  };
31
38
 
32
39
  export default OverflowMenu;