@bitrise/bitkit 13.57.1-alpha.0 → 13.57.1-alpha.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": "13.57.1-alpha.0",
4
+ "version": "13.57.1-alpha.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -6,7 +6,7 @@ export interface ButtonProps extends ChakraButtonProps {
6
6
  disabled?: never;
7
7
  isDanger?: boolean;
8
8
  leftIconName?: TypeIconName;
9
- rightIconName?: 'ArrowRight' | 'ChevronDown' | 'ChevronUp' | 'OpenInBrowser';
9
+ rightIconName?: 'ArrowRight' | 'ChevronDown' | 'ChevronUp' | 'SelectChevron' | 'OpenInBrowser';
10
10
  size?: 'sm' | 'md' | 'lg';
11
11
  variant?: 'primary' | 'secondary' | 'tertiary' | 'danger-primary' | 'danger-secondary' | 'danger-tertiary';
12
12
  }
@@ -2,7 +2,7 @@ import { StyleConfig } from '@chakra-ui/styled-system';
2
2
  import { rem } from '../../utils/utils';
3
3
 
4
4
  const SelectTheme: StyleConfig = {
5
- baseStyle: ({ isPlaceholderShown }) => ({
5
+ baseStyle: ({ hasStateIcon, isPlaceholderShown }) => ({
6
6
  field: {
7
7
  appearance: 'none',
8
8
  background: 'background/primary',
@@ -13,6 +13,12 @@ const SelectTheme: StyleConfig = {
13
13
  cursor: 'pointer',
14
14
  position: 'relative',
15
15
  width: '100%',
16
+ overflow: 'hidden',
17
+ textOverflow: 'ellipsis',
18
+ paddingRight: hasStateIcon ? '64' : '40',
19
+ _hover: {
20
+ borderColor: 'border/hover',
21
+ },
16
22
  _disabled: {
17
23
  background: 'background/disabled',
18
24
  borderColor: 'border/disabled',
@@ -29,6 +35,12 @@ const SelectTheme: StyleConfig = {
29
35
  icon: {
30
36
  color: 'icon/secondary',
31
37
  right: rem(11),
38
+ _groupHover: {
39
+ color: 'icon/primary',
40
+ _disabled: {
41
+ color: 'icon/on-disabled',
42
+ },
43
+ },
32
44
  _disabled: {
33
45
  color: 'icon/on-disabled',
34
46
  },
@@ -51,7 +63,6 @@ const SelectTheme: StyleConfig = {
51
63
  gap: '0.625rem',
52
64
  height: '48',
53
65
  paddingLeft: '16',
54
- paddingRight: '16',
55
66
  },
56
67
  },
57
68
  md: {
@@ -60,7 +71,6 @@ const SelectTheme: StyleConfig = {
60
71
  gap: '0.375rem',
61
72
  height: '40',
62
73
  paddingLeft: '12',
63
- paddingRight: '12',
64
74
  },
65
75
  },
66
76
  },
@@ -47,7 +47,7 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
47
47
  onBlur,
48
48
  onChange,
49
49
  placeholder,
50
- size,
50
+ size = 'lg',
51
51
  value,
52
52
  ...rest
53
53
  } = props;
@@ -67,7 +67,6 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
67
67
  onChange,
68
68
  size,
69
69
  value,
70
- variant: 'select',
71
70
  };
72
71
  if (placeholder) {
73
72
  if ('value' in props) {
@@ -78,7 +77,10 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
78
77
  }
79
78
 
80
79
  const iconSize = size === 'lg' ? '24' : '16';
81
- const style = useMultiStyleConfig('Select', { isPlaceholderShown: !value });
80
+ const style = useMultiStyleConfig('Select', {
81
+ hasStateIcon: isSelectInvalid || isWarning,
82
+ isPlaceholderShown: !!placeholder && !value,
83
+ });
82
84
 
83
85
  return (
84
86
  <FormControl {...formControlProps}>
@@ -123,8 +125,4 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
123
125
  );
124
126
  });
125
127
 
126
- Select.defaultProps = {
127
- size: 'lg',
128
- } as SelectProps;
129
-
130
128
  export default Select;