@bitrise/bitkit 13.180.0 → 13.182.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.180.0",
4
+ "version": "13.182.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -33,12 +33,12 @@
33
33
  "@chakra-ui/theme": "^3.4.7",
34
34
  "@chakra-ui/theme-tools": "^2.2.7",
35
35
  "@chakra-ui/utils": "^2.2.3",
36
- "@emotion/react": "^11.13.3",
37
- "@emotion/styled": "^11.13.0",
36
+ "@emotion/react": "^11.13.5",
37
+ "@emotion/styled": "^11.13.5",
38
38
  "@floating-ui/react-dom-interactions": "^0.8.1",
39
39
  "@fontsource/figtree": "^5.1.1",
40
40
  "@fontsource/source-code-pro": "^5.1.0",
41
- "framer-motion": "^11.11.15",
41
+ "framer-motion": "^11.11.17",
42
42
  "luxon": "^3.5.0",
43
43
  "react": "^18.3.1",
44
44
  "react-dom": "^18.3.1",
@@ -58,15 +58,15 @@
58
58
  "@bitrise/eslint-plugin": "^2.12.0",
59
59
  "@chakra-ui/cli": "^2.5.6",
60
60
  "@google-cloud/storage": "^7.14.0",
61
- "@storybook/addon-actions": "^8.4.3",
62
- "@storybook/addon-essentials": "^8.4.3",
63
- "@storybook/addon-interactions": "^8.4.3",
64
- "@storybook/addon-links": "^8.4.3",
61
+ "@storybook/addon-actions": "^8.4.5",
62
+ "@storybook/addon-essentials": "^8.4.5",
63
+ "@storybook/addon-interactions": "^8.4.5",
64
+ "@storybook/addon-links": "^8.4.5",
65
65
  "@storybook/addon-webpack5-compiler-swc": "^1.0.5",
66
- "@storybook/blocks": "^8.4.3",
67
- "@storybook/react": "^8.4.3",
68
- "@storybook/react-webpack5": "^8.4.3",
69
- "@storybook/theming": "^8.4.3",
66
+ "@storybook/blocks": "^8.4.5",
67
+ "@storybook/react": "^8.4.5",
68
+ "@storybook/react-webpack5": "^8.4.5",
69
+ "@storybook/theming": "^8.4.5",
70
70
  "@testing-library/dom": "^10.4.0",
71
71
  "@testing-library/jest-dom": "6.6.3",
72
72
  "@testing-library/react": "16.0.1",
@@ -87,9 +87,9 @@
87
87
  "prettier": "^3.3.3",
88
88
  "react-hook-form": "^7.53.2",
89
89
  "release-it": "^17.10.0",
90
- "storybook": "^8.4.3",
90
+ "storybook": "^8.4.5",
91
91
  "ts-jest": "^29.2.5",
92
- "typescript": "^5.6.3"
92
+ "typescript": "^5.7.2"
93
93
  },
94
94
  "files": [
95
95
  "src",
@@ -1,4 +1,5 @@
1
1
  import type { SystemStyleObject } from '@chakra-ui/theme-tools';
2
+ import { defineStyleConfig } from '@chakra-ui/styled-system';
2
3
  import { rem } from '../../utils/utils';
3
4
 
4
5
  const disabledItem: SystemStyleObject = {
@@ -9,55 +10,76 @@ const disabledItem: SystemStyleObject = {
9
10
  },
10
11
  };
11
12
 
12
- const MenuTheme: SystemStyleObject = {
13
- baseStyle: {
14
- groupTitle: {
15
- _after: {
16
- backgroundColor: 'separator.primary',
17
- content: `''`,
18
- flexGrow: '1',
19
- height: rem(1),
20
- position: 'relative',
21
- top: '-1px',
22
- },
23
- alignItems: 'center',
24
- color: 'neutral.60',
25
- cursor: 'default',
26
- display: 'flex',
27
- fontSize: '1',
28
- fontWeight: 'bold',
29
- gap: '16',
30
- lineHeight: rem(16),
31
- paddingX: '16',
32
- paddingY: '12',
13
+ const baseStyle: SystemStyleObject = {
14
+ groupTitle: {
15
+ _after: {
16
+ backgroundColor: 'separator.primary',
17
+ content: `''`,
18
+ flexGrow: '1',
19
+ height: rem(1),
33
20
  position: 'relative',
34
- textTransform: 'uppercase',
21
+ top: '-1px',
35
22
  },
36
- item: {
37
- _active: {
38
- backgroundColor: 'neutral.90',
39
- ...disabledItem,
40
- },
41
- _focus: {
42
- backgroundColor: 'neutral.93',
43
- boxShadow: 'none',
44
- ...disabledItem,
45
- },
46
- color: 'purple.10',
47
- paddingX: '16',
48
- paddingY: '12',
23
+ alignItems: 'center',
24
+ color: 'neutral.60',
25
+ cursor: 'default',
26
+ display: 'flex',
27
+ fontSize: '1',
28
+ fontWeight: 'bold',
29
+ gap: '16',
30
+ lineHeight: rem(16),
31
+ paddingX: '16',
32
+ paddingY: '12',
33
+ position: 'relative',
34
+ textTransform: 'uppercase',
35
+ },
36
+ icon: {
37
+ size: '24',
38
+ },
39
+ item: {
40
+ _active: {
41
+ backgroundColor: 'neutral.90',
49
42
  ...disabledItem,
50
43
  },
51
- list: {
52
- backgroundColor: 'neutral.100',
53
- border: '1px solid',
54
- borderColor: 'neutral.93',
55
- borderRadius: '4',
56
- boxShadow: 'large',
57
- paddingY: '8',
58
- zIndex: '1',
44
+ _focus: {
45
+ backgroundColor: 'neutral.93',
46
+ boxShadow: 'none',
47
+ ...disabledItem,
59
48
  },
49
+ color: 'purple.10',
50
+ paddingX: '16',
51
+ paddingY: '12',
52
+ textStyle: 'body/lg/regular',
53
+ ...disabledItem,
54
+ },
55
+ list: {
56
+ backgroundColor: 'neutral.100',
57
+ border: '1px solid',
58
+ borderColor: 'neutral.93',
59
+ borderRadius: '4',
60
+ boxShadow: 'large',
61
+ paddingY: '8',
62
+ zIndex: '1',
60
63
  },
61
64
  };
62
65
 
66
+ const MenuTheme = defineStyleConfig({
67
+ baseStyle,
68
+ defaultProps: {
69
+ size: 'lg',
70
+ },
71
+ sizes: {
72
+ md: {
73
+ icon: {
74
+ size: '16',
75
+ },
76
+ item: {
77
+ paddingY: '8',
78
+ textStyle: 'body/md/regular',
79
+ },
80
+ },
81
+ lg: {},
82
+ },
83
+ });
84
+
63
85
  export default MenuTheme;
@@ -1,6 +1,8 @@
1
1
  import { Menu as ChakraMenu, MenuProps as ChakraMenuProps } from '@chakra-ui/react';
2
2
 
3
- export type MenuProps = ChakraMenuProps;
3
+ export type MenuProps = ChakraMenuProps & {
4
+ size?: 'lg' | 'md';
5
+ };
4
6
 
5
7
  const Menu = (props: MenuProps) => <ChakraMenu {...props} />;
6
8
 
@@ -1,4 +1,10 @@
1
- import { forwardRef, MenuItem as ChakraMenuItem, MenuItemProps as ChakraMenuItemProps } from '@chakra-ui/react';
1
+ import {
2
+ forwardRef,
3
+ MenuItem as ChakraMenuItem,
4
+ MenuItemProps as ChakraMenuItemProps,
5
+ useMenuStyles,
6
+ SystemStyleObject,
7
+ } from '@chakra-ui/react';
2
8
  import { TypeColors } from '../../types/bitkit';
3
9
  import Box from '../Box/Box';
4
10
  import Icon, { TypeIconName } from '../Icon/Icon';
@@ -25,6 +31,10 @@ export interface MenuItemProps extends Omit<ChakraMenuItemProps, 'icon'> {
25
31
  }
26
32
 
27
33
  const MenuItem = forwardRef<MenuItemProps, 'button'>((props, ref) => {
34
+ const styles = useMenuStyles();
35
+
36
+ const { size: iconSize, ...restIconStyles } = styles.icon as SystemStyleObject & { size: '16' | '24' };
37
+
28
38
  const {
29
39
  as,
30
40
  children,
@@ -46,10 +56,25 @@ const MenuItem = forwardRef<MenuItemProps, 'button'>((props, ref) => {
46
56
 
47
57
  if (iconName || leftIconName || rightIconName) {
48
58
  properties.children = (
49
- <Box display="flex" gap={properties.iconSpacing} width="100%">
50
- {(iconName || leftIconName) && <Icon color={leftIconColor} name={iconName || leftIconName || 'Bitbot'} />}
59
+ <Box alignItems="center" display="flex" gap={properties.iconSpacing} width="100%">
60
+ {(iconName || leftIconName) && (
61
+ <Icon
62
+ color={leftIconColor}
63
+ name={iconName || leftIconName || 'Bitbot'}
64
+ size={iconSize}
65
+ __css={restIconStyles}
66
+ />
67
+ )}
51
68
  {children}
52
- {rightIconName && <Icon color={rightIconColor} marginInlineStart="auto" name={rightIconName} />}
69
+ {rightIconName && (
70
+ <Icon
71
+ color={rightIconColor}
72
+ marginInlineStart="auto"
73
+ name={rightIconName}
74
+ size={iconSize}
75
+ __css={restIconStyles}
76
+ />
77
+ )}
53
78
  </Box>
54
79
  );
55
80
  } else {
@@ -12,10 +12,17 @@ export interface OverflowMenuProps extends MenuProps {
12
12
  withPortal?: boolean;
13
13
  }
14
14
 
15
- const OverflowMenu = ({ buttonSize = 'sm', children, triggerLabel = 'Open menu', withPortal }: OverflowMenuProps) => {
15
+ const OverflowMenu = ({
16
+ buttonSize = 'sm',
17
+ children,
18
+ triggerLabel = 'Open menu',
19
+ withPortal,
20
+ ...rest
21
+ }: OverflowMenuProps) => {
16
22
  const Wrapper = withPortal ? Portal : Fragment;
23
+
17
24
  return (
18
- <Menu isLazy>
25
+ <Menu isLazy {...rest}>
19
26
  <MenuButton
20
27
  aria-label={triggerLabel}
21
28
  as={ControlButton}
@@ -75,6 +75,7 @@ const Tabletheme = {
75
75
  paddingX: '16',
76
76
  paddingY: '8',
77
77
  textAlign: 'left',
78
+ textStyle: 'body/md/regular',
78
79
  },
79
80
  th: {
80
81
  fontWeight: 'bold',