@bitrise/bitkit 10.23.0-alpha-chakra.1 → 10.23.1

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": "10.23.0-alpha-chakra.1",
4
+ "version": "10.23.1",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -70,7 +70,7 @@
70
70
  "@types/enzyme": "^3.10.12",
71
71
  "@types/jest": "^28.1.6",
72
72
  "@types/luxon": "^2.4.0",
73
- "@types/react": "18.0.15",
73
+ "@types/react": "18.0.18",
74
74
  "@types/react-dom": "^18.0.6",
75
75
  "@types/vfile-message": "^2.0.0",
76
76
  "@typescript-eslint/eslint-plugin": "^5.30.7",
@@ -104,7 +104,7 @@
104
104
  "ts-jest": "^28.0.7",
105
105
  "ts-node": "^10.9.1",
106
106
  "tsconfig-paths-webpack-plugin": "^3.5.2",
107
- "typescript": "^4.7.4",
107
+ "typescript": "^4.8.2",
108
108
  "webpack": "^5.73.0"
109
109
  },
110
110
  "files": [
@@ -15,12 +15,12 @@ function isNodeMatch(node: ReactNode, filter: string): boolean {
15
15
  return node.toLowerCase().includes(filter.toLowerCase());
16
16
  }
17
17
  if (Array.isArray(node)) {
18
- return node.some((child) => isNodeMatch(child, filter));
18
+ return Array.from(node).some((child) => isNodeMatch(child, filter));
19
19
  }
20
20
  if ('children' in node) {
21
21
  return isNodeMatch(node.children, filter);
22
22
  }
23
- if (React.isValidElement(node)) {
23
+ if (React.isValidElement<any>(node)) {
24
24
  if (node.type === 'svg') {
25
25
  return false;
26
26
  }
@@ -30,10 +30,7 @@ function isNodeMatch(node: ReactNode, filter: string): boolean {
30
30
  }
31
31
  return isNodeMatch(node.props.children, filter);
32
32
  }
33
- if (Symbol.iterator in node) {
34
- return isNodeMatch(Array.from(node), filter);
35
- }
36
- return false;
33
+ return isNodeMatch(Array.from(node), filter);
37
34
  }
38
35
 
39
36
  export default isNodeMatch;
@@ -14,7 +14,7 @@ const TextareaTheme: ComponentStyleConfig = {
14
14
  appearance: 'none',
15
15
  lineHeight: 'short',
16
16
  verticalAlign: 'top',
17
- transition: '100ms',
17
+ transition: '200ms',
18
18
  _placeholder: {
19
19
  fontStyle: 'italic',
20
20
  },
@@ -24,6 +24,7 @@ const TextareaTheme: ComponentStyleConfig = {
24
24
  },
25
25
  _focusVisible: {
26
26
  boxShadow: 'formFocus',
27
+ borderColor: 'purple.50',
27
28
  },
28
29
  _invalid: {
29
30
  color: 'red.50',
@@ -10,15 +10,15 @@ import {
10
10
  forwardRef,
11
11
  } from '@chakra-ui/react';
12
12
 
13
- export interface TextareaProps extends Omit<FormControlProps, 'label' | 'onChange' | 'onBlur'> {
13
+ export interface TextareaProps extends Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'> {
14
14
  'data-testid'?: string;
15
15
  errorText?: string;
16
16
  isLoading?: boolean;
17
17
  helperText?: string;
18
18
  label?: ReactNode;
19
19
  name?: string;
20
- onChange?: ChakraTextareaProps['onChange'];
21
20
  onBlur?: ChakraTextareaProps['onBlur'];
21
+ onChange?: ChakraTextareaProps['onChange'];
22
22
  value?: ChakraTextareaProps['value'];
23
23
  }
24
24
 
@@ -35,14 +35,13 @@ const Textarea = forwardRef<TextareaProps, 'div'>((props, ref) => {
35
35
  isLoading,
36
36
  label,
37
37
  placeholder,
38
- onChange,
39
38
  onBlur,
39
+ onChange,
40
40
  name,
41
41
  value,
42
42
  ...rest
43
43
  } = props;
44
44
  const formControlProps = {
45
- display: label || errorText || helperText ? 'block' : 'inline-block',
46
45
  isDisabled: isDisabled || isLoading,
47
46
  isInvalid: isInvalid || !!errorText,
48
47
  ...rest,
@@ -50,8 +49,8 @@ const Textarea = forwardRef<TextareaProps, 'div'>((props, ref) => {
50
49
  };
51
50
  const textareaProps = {
52
51
  'data-testid': dataTestid,
53
- onChange,
54
52
  onBlur,
53
+ onChange,
55
54
  name,
56
55
  placeholder,
57
56
  value,
@@ -12,13 +12,14 @@ import {
12
12
  } from '@chakra-ui/react';
13
13
  import Icon from '../Icon/Icon';
14
14
 
15
- export interface SelectProps extends Omit<FormControlProps, 'label' | 'onChange'> {
15
+ export interface SelectProps extends Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'> {
16
16
  'data-testid'?: string;
17
17
  errorText?: string;
18
18
  helperText?: string;
19
19
  isLoading?: boolean;
20
20
  label?: ReactNode;
21
21
  name?: string;
22
+ onBlur?: ChakraSelectProps['onBlur'];
22
23
  onChange?: ChakraSelectProps['onChange'];
23
24
  size?: 'small' | 'medium';
24
25
  value?: ChakraSelectProps['value'];
@@ -35,6 +36,7 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
35
36
  isLoading,
36
37
  label,
37
38
  name,
39
+ onBlur,
38
40
  onChange,
39
41
  placeholder,
40
42
  size,
@@ -43,7 +45,6 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
43
45
  } = props;
44
46
  const iconSize = size === 'medium' ? '24' : '16';
45
47
  const formControlProps = {
46
- display: label || errorText || helperText ? 'block' : 'inline-block',
47
48
  isDisabled: isDisabled || isLoading,
48
49
  isInvalid: isInvalid || !!errorText,
49
50
  ...rest,
@@ -56,6 +57,7 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
56
57
  <Icon name="DropdownArrows" fontSize={iconSize} size={iconSize} />
57
58
  ),
58
59
  name,
60
+ onBlur,
59
61
  onChange,
60
62
  size,
61
63
  value,
@@ -13,7 +13,7 @@ import {
13
13
  } from '@chakra-ui/react';
14
14
  import Box from '../Box/Box';
15
15
 
16
- export interface ToggleProps extends Omit<FormControlProps, 'label'> {
16
+ export interface ToggleProps extends Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'> {
17
17
  'data-testid'?: string;
18
18
  defaultChecked?: SwitchProps['defaultChecked'];
19
19
  errorText?: string;
@@ -24,6 +24,7 @@ export interface ToggleProps extends Omit<FormControlProps, 'label'> {
24
24
  helperText?: string;
25
25
  label?: ReactNode;
26
26
  name?: string;
27
+ onBlur?: SwitchProps['onBlur'];
27
28
  onChange?: SwitchProps['onChange'];
28
29
  value?: SwitchProps['value'];
29
30
  }
@@ -44,12 +45,12 @@ const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
44
45
  isLoading,
45
46
  label,
46
47
  name,
48
+ onBlur,
47
49
  onChange,
48
50
  value,
49
51
  ...rest
50
52
  } = props;
51
53
  const formControlProps = {
52
- display: label || errorText || helperText ? 'block' : 'inline-block',
53
54
  isDisabled: isDisabled || isLoading,
54
55
  isInvalid: isInvalid || !!errorText,
55
56
  ...rest,
@@ -62,6 +63,7 @@ const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
62
63
  isChecked,
63
64
  isDisabled: isDisabled || isLoading,
64
65
  name,
66
+ onBlur,
65
67
  onChange,
66
68
  value,
67
69
  };
@@ -5,7 +5,7 @@ const shadows = {
5
5
  inner: '0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset',
6
6
  outline: '0 0 0 3px #C289E6',
7
7
  tooltip: '0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.2)',
8
- formFocus: '0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset, 0 0 0 3px rgba(146, 71, 194, 0.3)',
8
+ formFocus: '0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset, inset 0 0 0 3px rgba(146, 71, 194, 0.3)',
9
9
  none: 'none',
10
10
  };
11
11