@bitrise/bitkit 9.13.1 → 9.13.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": "9.13.1",
4
+ "version": "9.13.2",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -15,4 +15,5 @@ WithProps.args = sortObjectByKey({
15
15
  children: 'Button',
16
16
  isDanger: false,
17
17
  isDisabled: false,
18
+ isLoading: false,
18
19
  });
@@ -1,9 +1,37 @@
1
+ const disabledStates = {
2
+ primary: {
3
+ _disabled: {
4
+ bgGradient: 'linear(to-b, neutral.80, neutral.70)',
5
+ borderColor: 'neutral.70',
6
+ },
7
+ },
8
+ secondary: {
9
+ _disabled: {
10
+ bgGradient: 'linear(to-b, neutral.100, neutral.93)',
11
+ borderColor: 'neutral.90',
12
+ color: 'neutral.70',
13
+ },
14
+ },
15
+ tertiary: {
16
+ _disabled: {
17
+ background: 'transparent',
18
+ borderColor: 'transparent',
19
+ color: 'neutral.70',
20
+ },
21
+ },
22
+ };
23
+
1
24
  const ButtonTheme = {
2
25
  baseStyle: {
3
26
  border: '0.0625rem solid',
4
27
  borderRadius: '4',
5
28
  _disabled: {
6
- pointerEvents: 'none',
29
+ cursor: 'not-allowed',
30
+ },
31
+ _hover: {
32
+ _disabled: {
33
+ bg: 'initial',
34
+ },
7
35
  },
8
36
  },
9
37
  variants: {
@@ -14,14 +42,13 @@ const ButtonTheme = {
14
42
  fontWeight: 'bold',
15
43
  _hover: {
16
44
  bgGradient: 'linear(to-b, purple.30, purple.10)',
45
+ ...disabledStates.primary,
17
46
  },
18
47
  _active: {
19
48
  bgGradient: 'linear(to-b, purple.10, purple.10)',
49
+ ...disabledStates.primary,
20
50
  },
21
- _disabled: {
22
- bgGradient: 'linear(to-b, neutral.80, neutral.70)',
23
- borderColor: 'neutral.70',
24
- },
51
+ ...disabledStates.primary,
25
52
  },
26
53
  secondary: {
27
54
  bgGradient: 'linear(to-b, neutral.100, neutral.93)',
@@ -29,14 +56,14 @@ const ButtonTheme = {
29
56
  color: 'purple.10',
30
57
  _hover: {
31
58
  bgGradient: 'linear(to-b, neutral.93, neutral.93)',
59
+ ...disabledStates.secondary,
32
60
  },
33
61
  _active: {
34
62
  bgGradient: 'linear(to-b, neutral.90, neutral.90)',
35
63
  borderColor: 'neutral.80',
64
+ ...disabledStates.secondary,
36
65
  },
37
- _disabled: {
38
- color: 'neutral.70',
39
- },
66
+ ...disabledStates.secondary,
40
67
  },
41
68
  tertiary: {
42
69
  background: 'transparent',
@@ -45,14 +72,14 @@ const ButtonTheme = {
45
72
  _hover: {
46
73
  background: 'neutral.93',
47
74
  borderColor: 'neutral.93',
75
+ ...disabledStates.tertiary,
48
76
  },
49
77
  _active: {
50
78
  background: 'neutral.90',
51
79
  borderColor: 'neutral.90',
80
+ ...disabledStates.tertiary,
52
81
  },
53
- _disabled: {
54
- color: 'neutral.70',
55
- },
82
+ ...disabledStates.tertiary,
56
83
  },
57
84
  'primary--danger': {
58
85
  bgGradient: 'linear(to-b, red.50, red.30)',
@@ -62,15 +89,14 @@ const ButtonTheme = {
62
89
  _hover: {
63
90
  bgGradient: 'linear(to-b, red.40, red.20)',
64
91
  borderColor: 'red.40',
92
+ ...disabledStates.primary,
65
93
  },
66
94
  _active: {
67
95
  bgGradient: 'linear(to-b, red.20, red.20)',
68
96
  borderColor: 'red.20',
97
+ ...disabledStates.primary,
69
98
  },
70
- _disabled: {
71
- bgGradient: 'linear(to-b, neutral.80, neutral.70)',
72
- borderColor: 'neutral.70',
73
- },
99
+ ...disabledStates.primary,
74
100
  },
75
101
  'secondary--danger': {
76
102
  bgGradient: 'linear(to-b, neutral.100, neutral.93)',
@@ -79,14 +105,14 @@ const ButtonTheme = {
79
105
  _hover: {
80
106
  bgGradient: 'linear(to-b, red.93, red.93)',
81
107
  borderColor: 'red.70',
108
+ ...disabledStates.secondary,
82
109
  },
83
110
  _active: {
84
111
  bgGradient: 'linear(to-b, red.90, red.90)',
85
112
  borderColor: 'red.70',
113
+ ...disabledStates.secondary,
86
114
  },
87
- _disabled: {
88
- color: 'neutral.70',
89
- },
115
+ ...disabledStates.secondary,
90
116
  },
91
117
  'tertiary--danger': {
92
118
  background: 'transparent',
@@ -95,14 +121,14 @@ const ButtonTheme = {
95
121
  _hover: {
96
122
  background: 'red.93',
97
123
  borderColor: 'red.93',
124
+ ...disabledStates.tertiary,
98
125
  },
99
126
  _active: {
100
127
  background: 'red.90',
101
128
  borderColor: 'red.90',
129
+ ...disabledStates.tertiary,
102
130
  },
103
- _disabled: {
104
- color: 'neutral.70',
105
- },
131
+ ...disabledStates.tertiary,
106
132
  },
107
133
  },
108
134
  sizes: {
@@ -16,13 +16,17 @@ export interface ButtonProps extends ChakraButtonProps {
16
16
  * The Button component is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.
17
17
  */
18
18
  const Button = forwardRef<ButtonProps, 'button'>((props, ref) => {
19
- const { as, isDanger, leftIconName, rightIconName, size, variant, ...rest } = props;
19
+ const { as, isDanger, isDisabled, leftIconName, rightIconName, size, variant, ...rest } = props;
20
20
  const properties: ChakraButtonProps = {
21
21
  as,
22
+ isDisabled,
22
23
  size,
23
24
  variant: isDanger ? `${variant}--danger` : variant,
24
25
  ...rest,
25
26
  };
27
+ if (isDisabled) {
28
+ properties.as = 'button';
29
+ }
26
30
  if (leftIconName) {
27
31
  properties.leftIcon = <Icon name={leftIconName} />;
28
32
  }
package/src/old.ts CHANGED
@@ -165,9 +165,6 @@ export { default as Portal } from './Old/Portal/Portal';
165
165
  export type { Props as ProgressBarProps } from './Old/Progress/ProgressBar';
166
166
  export { default as ProgressBar } from './Old/Progress/ProgressBar';
167
167
 
168
- export type { Props as ProgressButtonProps } from './Old/Progress/ProgressButton';
169
- export { default as ProgressButton } from './Old/Progress/ProgressButton';
170
-
171
168
  export type { Props as ProgressBitbotProps } from './Old/Progress/ProgressBitbot';
172
169
  export { default as ProgressBitbot } from './Old/Progress/ProgressBitbot';
173
170