@bitrise/bitkit 12.52.3 → 12.52.5

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.52.3",
4
+ "version": "12.52.5",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -78,6 +78,9 @@ const Tabletheme: SystemStyleObject = {
78
78
  paddingX: '16',
79
79
  paddingY: '8',
80
80
  textAlign: 'left',
81
+ _groupHover: {
82
+ backgroundColor: 'neutral.95',
83
+ },
81
84
  },
82
85
  expandTd: {
83
86
  borderBottomColor: 'transparent',
@@ -24,10 +24,10 @@ type ExpandableProps = ChakraTableRowProps & {
24
24
  onExpandedChanged?(isExpanded: boolean): void;
25
25
  };
26
26
 
27
- export type TableRowProps = RowProps & (NonExpandableProps | ExpandableProps);
27
+ export type TableRowProps = RowProps & (NonExpandableProps | ExpandableProps) & { visualHover?: boolean };
28
28
 
29
29
  const Tr = forwardRef<TableRowProps, 'tr'>((props, ref) => {
30
- const { children, defaultIsExpanded, onExpandedChanged, expandableContent, onClick, ...rest } = props;
30
+ const { children, defaultIsExpanded, onExpandedChanged, expandableContent, onClick, visualHover, ...rest } = props;
31
31
 
32
32
  const { isOpen, onToggle } = useDisclosure({ defaultIsOpen: defaultIsExpanded });
33
33
  const css = useTableStyles();
@@ -46,7 +46,7 @@ const Tr = forwardRef<TableRowProps, 'tr'>((props, ref) => {
46
46
  const colSpan = Children.count(children) + 1;
47
47
  return (
48
48
  <>
49
- <ChakraTr {...properties} ref={ref}>
49
+ <ChakraTr role={visualHover ? 'group' : undefined} {...properties} ref={ref}>
50
50
  <Td sx={css.expandTd}>
51
51
  <TableIconButton
52
52
  iconName="ChevronDown"
@@ -80,7 +80,7 @@ const Tr = forwardRef<TableRowProps, 'tr'>((props, ref) => {
80
80
  );
81
81
  }
82
82
  return (
83
- <ChakraTr {...properties} ref={ref}>
83
+ <ChakraTr role={visualHover ? 'group' : undefined} {...properties} ref={ref}>
84
84
  {children}
85
85
  </ChakraTr>
86
86
  );
@@ -1,5 +1,6 @@
1
1
  import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system';
2
2
  import { rem } from '../../utils/utils';
3
+ import { TagProps } from './Tag';
3
4
 
4
5
  const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers([
5
6
  'container',
@@ -10,35 +11,46 @@ const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpe
10
11
  ]);
11
12
 
12
13
  const sizes = {
13
- sm: definePartsStyle({
14
- container: {
15
- paddingX: rem(7),
16
- paddingY: rem(1),
17
- },
18
- label: {
19
- fontSize: '1',
20
- lineHeight: rem(16),
21
- },
22
- closeButton: {
23
- height: '20',
24
- width: '20',
25
- marginRight: rem(-6),
26
- },
14
+ sm: definePartsStyle((props) => {
15
+ const { onClose, iconName, withIcon } = props as TagProps;
16
+ const leftIcon = iconName || withIcon;
17
+
18
+ return {
19
+ container: {
20
+ paddingLeft: leftIcon ? rem(4) : rem(8),
21
+ paddingRight: onClose ? rem(2) : rem(8),
22
+ paddingY: onClose ? rem(2) : rem(4),
23
+ },
24
+ label: {
25
+ fontSize: rem(12),
26
+ lineHeight: rem(16),
27
+ },
28
+ closeButton: {
29
+ height: '20',
30
+ width: '20',
31
+ },
32
+ };
27
33
  }),
28
- md: definePartsStyle({
29
- container: {
30
- paddingX: rem(11),
31
- paddingY: rem(3),
32
- },
33
- label: {
34
- fontSize: '2',
35
- lineHeight: rem(24),
36
- },
37
- closeButton: {
38
- height: '24',
39
- width: '24',
40
- marginRight: rem(-7),
41
- },
34
+ md: definePartsStyle((props) => {
35
+ const { onClose, iconName, withIcon } = props as TagProps;
36
+ const leftIcon = iconName || withIcon;
37
+
38
+ return {
39
+ container: {
40
+ paddingLeft: leftIcon ? rem(6) : rem(12),
41
+ paddingRight: onClose ? rem(4) : rem(12),
42
+ paddingY: leftIcon || onClose ? rem(4) : rem(6),
43
+ },
44
+ label: {
45
+ fontSize: '2',
46
+ lineHeight: rem(20),
47
+ },
48
+ closeButton: {
49
+ height: '24',
50
+ width: '24',
51
+ marginLeft: '8',
52
+ },
53
+ };
42
54
  }),
43
55
  };
44
56
 
@@ -48,9 +60,7 @@ const baseStyle = definePartsStyle(({ colorScheme }) => {
48
60
  backgroundColor: `${colorScheme}.93`,
49
61
  borderColor: `${colorScheme}.80`,
50
62
  };
51
- if (colorScheme === 'neutral') {
52
- scheme.color = 'purple.10';
53
- }
63
+
54
64
  return {
55
65
  container: {
56
66
  border: '1px solid',
@@ -21,7 +21,7 @@ export interface TagProps extends Omit<ChakraTagProps, 'colorScheme' | 'size' |
21
21
  const Tag = (props: TagProps) => {
22
22
  const { children, closeButtonTooltip, iconColor, iconName, isDisabled, isLoading, onClose, withIcon, ...tagProps } =
23
23
  props;
24
- const style = useMultiStyleConfig('Tag', tagProps);
24
+ const style = useMultiStyleConfig('Tag', props);
25
25
 
26
26
  return (
27
27
  <ChakraTag
@@ -29,6 +29,7 @@ const Tag = (props: TagProps) => {
29
29
  data-disabled={isDisabled || undefined}
30
30
  aria-busy={isLoading}
31
31
  data-loading={isLoading || undefined}
32
+ sx={style.container}
32
33
  {...tagProps}
33
34
  >
34
35
  {(withIcon || !!iconName) && (