@bitrise/bitkit 11.0.0 → 11.1.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": "11.0.0",
4
+ "version": "11.1.0",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -1,5 +1,15 @@
1
1
  import type { ComponentStyleConfig } from '@chakra-ui/theme';
2
2
 
3
+ type ColorObj = {
4
+ [key: string]: {
5
+ enabledButton: string;
6
+ disabledButton: string;
7
+ enabledIcon: string;
8
+ disabledIcon: string;
9
+ hover: string;
10
+ };
11
+ };
12
+
3
13
  const buttonStyle = {
4
14
  display: 'flex',
5
15
  alignItems: 'center',
@@ -17,6 +27,30 @@ const iconStyle = {
17
27
  marginLeft: '16',
18
28
  };
19
29
 
30
+ const colors: ColorObj = {
31
+ white: {
32
+ enabledButton: 'neutral.100',
33
+ disabledButton: 'neutral.100',
34
+ enabledIcon: 'currentColor',
35
+ disabledIcon: 'currentColor',
36
+ hover: 'purple.95',
37
+ },
38
+ gray: {
39
+ enabledButton: 'neutral.95',
40
+ disabledButton: 'neutral.95',
41
+ enabledIcon: 'currentColor',
42
+ disabledIcon: 'currentColor',
43
+ hover: 'purple.95',
44
+ },
45
+ orange: {
46
+ enabledButton: 'orange.93',
47
+ disabledButton: 'orange.93',
48
+ enabledIcon: 'orange.10',
49
+ disabledIcon: 'orange.80',
50
+ hover: 'orange.90',
51
+ },
52
+ };
53
+
20
54
  const AccordionTheme: ComponentStyleConfig = {
21
55
  baseStyle: ({ colorScheme }) => ({
22
56
  item: {
@@ -28,9 +62,9 @@ const AccordionTheme: ComponentStyleConfig = {
28
62
  },
29
63
  enabledButton: {
30
64
  ...buttonStyle,
31
- background: colorScheme === 'gray' ? 'neutral.95' : 'neutral.100',
65
+ background: colors[colorScheme].enabledButton,
32
66
  _hover: {
33
- background: 'purple.95',
67
+ background: colors[colorScheme].hover,
34
68
  },
35
69
  _expanded: {
36
70
  borderBottomLeftRadius: '0',
@@ -39,16 +73,18 @@ const AccordionTheme: ComponentStyleConfig = {
39
73
  },
40
74
  disabledButton: {
41
75
  ...buttonStyle,
42
- background: colorScheme === 'gray' ? 'neutral.95' : 'neutral.100',
76
+ background: colors[colorScheme].disabledButton,
43
77
  cursor: 'default',
44
78
  },
45
79
  enabledIcon: {
46
80
  ...iconStyle,
81
+ color: colors[colorScheme].enabledIcon,
47
82
  },
48
83
  disabledIcon: {
49
84
  ...iconStyle,
50
85
  opacity: '0.4',
51
86
  transform: 'none',
87
+ color: colors[colorScheme].disabledIcon,
52
88
  },
53
89
  panel: {
54
90
  padding: '16',
@@ -7,7 +7,7 @@ import {
7
7
  } from '@chakra-ui/react';
8
8
 
9
9
  export interface AccordionProps extends Omit<ChakraAccordionProps, 'onChange'> {
10
- colorScheme?: 'white' | 'gray';
10
+ colorScheme?: 'white' | 'gray' | 'orange';
11
11
  onChange?: (ids: string[], indexes: number[]) => void;
12
12
  }
13
13
 
@@ -11,8 +11,8 @@ const BreadcrumbTheme: SystemStyleObject = {
11
11
  item: {
12
12
  _last: {
13
13
  minWidth: 0,
14
- '.chakra-breadcrumb__link': {
15
- maxWidth: '100%',
14
+
15
+ '.breadcrumbLinkText': {
16
16
  overflow: 'hidden',
17
17
  textOverflow: 'ellipsis',
18
18
  },
@@ -23,6 +23,7 @@ const BreadcrumbTheme: SystemStyleObject = {
23
23
  alignItems: 'center',
24
24
  gap: '8',
25
25
  whiteSpace: 'nowrap',
26
+ minWidth: 0,
26
27
  },
27
28
  separator: {
28
29
  display: 'flex',
@@ -5,6 +5,7 @@ import {
5
5
  } from '@chakra-ui/react';
6
6
  import Avatar from '../Avatar/Avatar';
7
7
  import { useResponsive } from '../../hooks';
8
+ import Box from '../Box/Box';
8
9
 
9
10
  export interface BreadcrumbLinkProps extends ChakraBreadcrumbLinkProps {
10
11
  avatarName?: string;
@@ -25,7 +26,9 @@ const BreadcrumbLink = forwardRef<BreadcrumbLinkProps, 'a'>((props, ref) => {
25
26
  {!isMobile && (avatarName || avatarUrl) && (
26
27
  <Avatar name={avatarName || children?.toString()} src={avatarUrl} borderRadius="4" />
27
28
  )}
28
- {children}
29
+ <Box as="span" className="breadcrumbLinkText">
30
+ {children}
31
+ </Box>
29
32
  </ChakraBreadcrumbLink>
30
33
  );
31
34
  });