@bitrise/bitkit 9.15.0-alpha-chakra.1 → 9.15.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": "9.15.0-alpha-chakra.1",
4
+ "version": "9.15.0",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -38,11 +38,10 @@
38
38
  "@juggle/resize-observer": "^3.3.1",
39
39
  "@popperjs/core": "^2.11.5",
40
40
  "@types/react-transition-group": "^4.4.4",
41
- "chakra-react-select": "3.3.3",
42
41
  "classnames": "^2.3.1",
43
42
  "clipboard": "^2.0.11",
44
43
  "framer-motion": "^6.3.3",
45
- "luxon": "^2.4.0",
44
+ "luxon": "^2.3.2",
46
45
  "react": "^17.0.2",
47
46
  "react-dom": "^17.0.2",
48
47
  "react-popper": "^2.3.0",
@@ -78,19 +77,19 @@
78
77
  "@types/clipboard": "^2.0.1",
79
78
  "@types/enzyme": "^3.10.12",
80
79
  "@types/fscreen": "^1.0.1",
81
- "@types/jest": "^27.5.1",
80
+ "@types/jest": "^27.5.0",
82
81
  "@types/lodash.sample": "^4.2.7",
83
82
  "@types/lodash.shuffle": "^4.2.7",
84
83
  "@types/luxon": "^2.3.2",
85
84
  "@types/prismjs": "^1.26.0",
86
- "@types/react": "17.0.45",
87
- "@types/react-dom": "^17.0.17",
85
+ "@types/react": "17.0.44",
86
+ "@types/react-dom": "^17.0.16",
88
87
  "@types/react-router": "^5.1.18",
89
88
  "@types/react-router-dom": "^5.3.3",
90
89
  "@types/react-transition-group": "^4.4.4",
91
90
  "@types/vfile-message": "^2.0.0",
92
- "@typescript-eslint/eslint-plugin": "^5.23.0",
93
- "@typescript-eslint/parser": "^5.23.0",
91
+ "@typescript-eslint/eslint-plugin": "^5.22.0",
92
+ "@typescript-eslint/parser": "^5.22.0",
94
93
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
95
94
  "axios": "^0.27.2",
96
95
  "babel-eslint": "^10.0.1",
@@ -100,7 +99,7 @@
100
99
  "concurrently": "^7.1.0",
101
100
  "enzyme": "^3.11.0",
102
101
  "enzyme-to-json": "^3.6.2",
103
- "eslint": "^8.15.0",
102
+ "eslint": "^8.14.0",
104
103
  "eslint-plugin-import": "^2.26.0",
105
104
  "eslint-plugin-jest": "^26.1.5",
106
105
  "eslint-plugin-jsx-a11y": "^6.5.1",
@@ -108,9 +107,9 @@
108
107
  "eslint-plugin-react": "^7.29.4",
109
108
  "eslint-plugin-react-hooks": "^4.5.0",
110
109
  "eslint-plugin-storybook": "^0.5.11",
111
- "eslint-plugin-testing-library": "^5.5.0",
110
+ "eslint-plugin-testing-library": "^5.3.1",
112
111
  "fscreen": "^1.2.0",
113
- "glob": "^8.0.2",
112
+ "glob": "^8.0.1",
114
113
  "husky": "^7.0.4",
115
114
  "identity-obj-proxy": "^3.0.0",
116
115
  "jest": "^27.5.1",
@@ -132,7 +131,7 @@
132
131
  "ts-node": "^10.7.0",
133
132
  "tsconfig-paths-webpack-plugin": "^3.5.2",
134
133
  "typescript": "^4.6.4",
135
- "webpack": "^5.72.1"
134
+ "webpack": "^5.72.0"
136
135
  },
137
136
  "files": [
138
137
  "src",
@@ -5,6 +5,12 @@ import Button from './Button';
5
5
  export default {
6
6
  title: 'Components/Button',
7
7
  component: Button,
8
+ argTypes: {
9
+ as: {
10
+ control: 'inline-radio',
11
+ options: ['a', 'button'],
12
+ },
13
+ },
8
14
  } as ComponentMeta<typeof Button>;
9
15
 
10
16
  const Template: ComponentStory<typeof Button> = (props) => <Button {...props} />;
@@ -0,0 +1,25 @@
1
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
2
+ import { sortObjectByKey } from '../../utils/storyUtils';
3
+ import ColorButton from './ColorButton';
4
+
5
+ export default {
6
+ title: 'Components/ColorButton',
7
+ component: ColorButton,
8
+ argTypes: {
9
+ as: {
10
+ control: 'inline-radio',
11
+ options: ['a', 'button'],
12
+ },
13
+ },
14
+ } as ComponentMeta<typeof ColorButton>;
15
+
16
+ const Template: ComponentStory<typeof ColorButton> = (props) => <ColorButton {...props} />;
17
+
18
+ export const WithProps = Template.bind({});
19
+ WithProps.args = sortObjectByKey({
20
+ ...ColorButton.defaultProps,
21
+ children: 'ColorButton',
22
+ colorScheme: 'blue',
23
+ isDisabled: false,
24
+ isLoading: false,
25
+ });
@@ -0,0 +1,22 @@
1
+ const schemeColors = {
2
+ default: { backgroundColor: 'inherit', color: 'inherit' },
3
+ blue: { backgroundColor: 'blue.93', color: 'blue.40' },
4
+ red: { backgroundColor: 'red.93', color: 'red.40' },
5
+ green: { backgroundColor: 'green.95', color: 'green.50' },
6
+ yellow: { backgroundColor: 'yellow.95', color: 'yellow.40' },
7
+ purple: { backgroundColor: 'purple.95', color: 'purple.40' },
8
+ };
9
+
10
+ const ColorButtonTheme = {
11
+ baseStyle: ({ colorScheme: c }: { colorScheme?: 'blue' | 'red' | 'green' | 'yellow' | 'purple' }) => {
12
+ return {
13
+ display: 'inline-flex',
14
+ alignItems: 'center',
15
+ justifyContent: 'center',
16
+ ...schemeColors[c || 'default'],
17
+ _hover: schemeColors[c || 'default'],
18
+ };
19
+ },
20
+ };
21
+
22
+ export default ColorButtonTheme;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { Button as ChakraButton, ButtonProps as ChakraButtonProps, forwardRef, useStyleConfig } from '@chakra-ui/react';
3
+
4
+ export interface ColorButtonProps extends ChakraButtonProps {
5
+ as?: 'a' | 'button';
6
+ colorScheme?: 'blue' | 'red' | 'green' | 'yellow' | 'purple';
7
+ }
8
+
9
+ /**
10
+ * The ColorButton 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.
11
+ */
12
+ const ColorButton = forwardRef<ColorButtonProps, 'button'>((props, ref) => {
13
+ const { as, colorScheme, isDisabled, isLoading, ...rest } = props;
14
+ const styles = {
15
+ ...useStyleConfig('Button', { size: 'small' }),
16
+ ...useStyleConfig('ColorButton', { colorScheme }),
17
+ };
18
+
19
+ const properties: ChakraButtonProps = {
20
+ as,
21
+ __css: styles,
22
+ isDisabled,
23
+ isLoading,
24
+ ...rest,
25
+ };
26
+ if (isDisabled) {
27
+ properties.as = 'button';
28
+ }
29
+ return <ChakraButton {...properties} size="small" ref={ref} />;
30
+ });
31
+
32
+ ColorButton.defaultProps = {
33
+ as: 'button',
34
+ } as ColorButtonProps;
35
+
36
+ export default ColorButton;
@@ -3,7 +3,7 @@ import type { SystemStyleObject } from '@chakra-ui/theme-tools';
3
3
  const MenuTheme: SystemStyleObject = {
4
4
  baseStyle: {
5
5
  list: {
6
- bg: 'neutral.100',
6
+ backgroundColor: 'neutral.100',
7
7
  border: '1px solid',
8
8
  borderColor: 'neutral.93',
9
9
  borderRadius: '4',
@@ -15,11 +15,11 @@ const MenuTheme: SystemStyleObject = {
15
15
  padding: '12',
16
16
  paddingRight: '16',
17
17
  _focus: {
18
- bg: 'neutral.95',
18
+ backgroundColor: 'neutral.93',
19
19
  boxShadow: 'none',
20
20
  },
21
21
  _active: {
22
- bg: 'neutral.93',
22
+ backgroundColor: 'neutral.90',
23
23
  },
24
24
  },
25
25
  },
package/src/index.ts CHANGED
@@ -29,8 +29,5 @@ export { default as Card } from './Components/Card/Card';
29
29
  export type { CardContentProps } from './Components/Card/CardContent';
30
30
  export { default as CardContent } from './Components/Card/CardContent';
31
31
 
32
- export type { SelectProps } from './Components/Select/Select';
33
- export { default as Select } from './Components/Select/Select';
34
-
35
- export type { DropdownProps } from './Components/Dropdown/Dropdown';
36
- export { default as Dropdown } from './Components/Dropdown/Dropdown';
32
+ export type { ColorButtonProps } from './Components/ColorButton/ColorButton';
33
+ export { default as ColorButton } from './Components/ColorButton/ColorButton';
package/src/old.ts CHANGED
@@ -52,16 +52,14 @@ export { default as Bounds } from './Old/Bounds/Bounds';
52
52
  export type { Props as CheckboxProps } from './Old/Checkbox/Checkbox';
53
53
  export { default as Checkbox } from './Old/Checkbox/Checkbox';
54
54
 
55
- export type { Props as ColorButtonProps } from './Old/Button/ColorButton';
56
- export { default as ColorButton } from './Old/Button/ColorButton';
57
-
58
55
  export type { Props as DatePickerProps } from './Old/DatePicker/DatePicker';
59
56
  export { default as DatePicker } from './Old/DatePicker/DatePicker';
60
57
 
61
58
  export type { Props as DotProps } from './Old/Dot/Dot';
62
59
  export { default as Dot } from './Old/Dot/Dot';
63
60
 
64
- export type { Props as OldDropdownProps } from './Old/Dropdown/Dropdown';
61
+ export type { Props as DropdownProps } from './Old/Dropdown/Dropdown';
62
+ export { default as Dropdown } from './Old/Dropdown/Dropdown';
65
63
 
66
64
  export type { Props as DropdownButtonProps } from './Old/Dropdown/DropdownButton';
67
65
  export { default as DropdownButton } from './Old/Dropdown/DropdownButton';
@@ -167,9 +165,6 @@ export { default as ProgressBar } from './Old/Progress/ProgressBar';
167
165
  export type { Props as ProgressBitbotProps } from './Old/Progress/ProgressBitbot';
168
166
  export { default as ProgressBitbot } from './Old/Progress/ProgressBitbot';
169
167
 
170
- export type { Props as ProgressColorButtonProps } from './Old/Progress/ProgressColorButton';
171
- export { default as ProgressColorButton } from './Old/Progress/ProgressColorButton';
172
-
173
168
  export type { Props as ProgressSpinnerProps } from './Old/Progress/ProgressSpinner';
174
169
  export { default as ProgressSpinner } from './Old/Progress/ProgressSpinner';
175
170
 
package/src/theme.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import Button from './Components/Button/Button.theme';
2
2
  import Card from './Components/Card/Card.theme';
3
+ import ColorButton from './Components/ColorButton/ColorButton.theme';
3
4
  import Divider from './Components/Divider/Divider.theme';
4
5
  import Link from './Components/Link/Link.theme';
5
6
  import Menu from './Components/Menu/Menu.theme';
6
- import Select from './Components/Select/Select.theme';
7
7
  import Text from './Components/Text/Text.theme';
8
8
 
9
9
  import colors from './Foundations/Colors/Colors';
@@ -48,10 +48,10 @@ const theme = {
48
48
  components: {
49
49
  Button,
50
50
  Card,
51
+ ColorButton,
51
52
  Divider,
52
53
  Link,
53
54
  Menu,
54
- Select,
55
55
  Text,
56
56
  },
57
57
  };