@bitrise/bitkit 13.79.1-alpha.0 → 13.80.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": "13.79.1-alpha.0",
4
+ "version": "13.80.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -1,4 +1,4 @@
1
- import { Children } from 'react';
1
+ import React, { Children } from 'react';
2
2
  import {
3
3
  Breadcrumb as ChakraBreadcrumb,
4
4
  BreadcrumbItem,
@@ -24,6 +24,10 @@ const Breadcrumb = forwardRef<BreadcrumbProps, 'nav'>((props, ref) => {
24
24
 
25
25
  const childrenCount = Children.count(children);
26
26
  const items = Children.map(children, (child, index) => {
27
+ if (!React.isValidElement(child)) {
28
+ return null;
29
+ }
30
+
27
31
  return (
28
32
  <BreadcrumbItem>
29
33
  {hasSeparatorBeforeFirst && index === 0 && <BreadcrumbSeparator marginLeft="0" />}
@@ -1,46 +1,45 @@
1
1
  import { defineStyle } from '@chakra-ui/styled-system';
2
- import { rem } from '../../../utils/utils';
3
2
 
4
3
  const InputTheme = defineStyle({
5
4
  baseStyle: {
6
5
  field: {
7
6
  _disabled: {
8
7
  _hover: {
9
- borderColor: 'border.disabled',
8
+ borderColor: 'neutral.90',
10
9
  },
11
10
  _placeholder: {
12
- color: 'text.disabled',
11
+ color: 'neutral.80',
13
12
  },
14
- color: 'text.disabled',
15
- background: 'background.disabled',
13
+ background: 'neutral.93',
16
14
  cursor: 'not-allowed',
17
15
  },
18
16
  _focusVisible: {
17
+ borderColor: 'purple.50',
19
18
  boxShadow: 'formFocus',
20
19
  },
21
20
  _hover: {
22
- borderColor: 'border.hover',
21
+ borderColor: 'neutral.70',
23
22
  },
24
23
  _invalid: {
25
24
  _hover: {
26
- borderColor: 'border.error',
25
+ borderColor: 'red.50',
27
26
  },
28
- borderColor: 'border.error',
29
- color: 'input.text.error',
27
+ borderColor: 'red.50',
28
+ color: 'red.50',
30
29
  },
31
30
  _placeholder: {
32
- color: 'input.text.placeholder',
31
+ color: 'neutral.60',
33
32
  },
34
33
  _readOnly: {
35
34
  _hover: {
36
- borderColor: 'border.regular',
35
+ borderColor: 'neutral.90',
37
36
  },
38
- background: 'background.disabled',
37
+ background: 'neutral.93',
39
38
  },
40
39
  appearance: 'none',
41
- background: 'background.primary',
40
+ background: 'neutral.100',
42
41
  border: '1px solid',
43
- borderColor: 'border.regular',
42
+ borderColor: 'neutral.90',
44
43
  borderRadius: '4',
45
44
  boxShadow: 'inner',
46
45
  outline: 0,
@@ -48,47 +47,6 @@ const InputTheme = defineStyle({
48
47
  transition: '200ms',
49
48
  width: '100%',
50
49
  },
51
- icon: {
52
- color: 'icon.tertiary',
53
- right: rem(11),
54
- _groupHover: {
55
- color: 'icon.primary',
56
- _disabled: {
57
- color: 'icon.on-disabled',
58
- },
59
- },
60
- _disabled: {
61
- color: 'icon.on-disabled',
62
- },
63
- },
64
- inputContainer: {
65
- position: 'relative',
66
- },
67
- stateIcon: {
68
- position: 'absolute',
69
- right: rem(16),
70
- top: '50%',
71
- transform: 'translateY(-50%)',
72
- pointerEvents: 'none',
73
- },
74
- },
75
- sizes: {
76
- lg: {
77
- field: {
78
- fontSize: '3',
79
- gap: '0.625rem',
80
- height: '48',
81
- paddingLeft: '16',
82
- },
83
- },
84
- md: {
85
- field: {
86
- fontSize: '2',
87
- gap: '0.375rem',
88
- height: '40',
89
- paddingLeft: '12',
90
- },
91
- },
92
50
  },
93
51
  });
94
52
 
@@ -15,7 +15,6 @@ import {
15
15
  InputRightElement,
16
16
  SystemStyleObject,
17
17
  IconProps,
18
- useMultiStyleConfig,
19
18
  } from '@chakra-ui/react';
20
19
  import Icon, { TypeIconName } from '../../Icon/Icon';
21
20
  import Text from '../../Text/Text';
@@ -47,7 +46,6 @@ export interface InputProps extends UsedFormControlProps, UsedChakraInputProps {
47
46
  infoText?: string;
48
47
  infoTooltipProps?: TooltipProps;
49
48
  isLoading?: boolean;
50
- isWarning?: boolean;
51
49
  helperText?: ReactNode;
52
50
  inputHeight?: number;
53
51
  inputRef?: Ref<HTMLInputElement>;
@@ -62,9 +60,7 @@ export interface InputProps extends UsedFormControlProps, UsedChakraInputProps {
62
60
  rightAddonPlacement?: 'inside' | 'outside';
63
61
  rightIconName?: TypeIconName;
64
62
  rightIconColor?: IconProps['color'];
65
- size?: 'lg' | 'md';
66
63
  withCounter?: boolean;
67
- warningText?: ReactNode;
68
64
  }
69
65
 
70
66
  /**
@@ -86,7 +82,6 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
86
82
  isDisabled,
87
83
  isInvalid,
88
84
  isLoading,
89
- isWarning,
90
85
  label,
91
86
  leftAddon,
92
87
  leftAddonPlacement,
@@ -106,11 +101,9 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
106
101
  rightIconName,
107
102
  rightIconColor,
108
103
  role,
109
- size = 'lg',
110
104
  step,
111
105
  type,
112
106
  value,
113
- warningText,
114
107
  withCounter,
115
108
  ...rest
116
109
  } = props;
@@ -136,8 +129,7 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
136
129
  ref: inputRef,
137
130
  role,
138
131
  step,
139
- size,
140
- // sx: { height: inputHeight, ...inputStyle },
132
+ sx: { height: inputHeight, ...inputStyle },
141
133
  type,
142
134
  value,
143
135
  };
@@ -170,14 +162,7 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
170
162
  };
171
163
 
172
164
  const showLabel = label || !!infoText || (withCounter && maxLength);
173
-
174
- const iconNumber = inputHeight && inputHeight < 40 ? 16 : 24;
175
-
176
- const iconSize = size === 'lg' ? '24' : '16';
177
- const style = useMultiStyleConfig('Input', {
178
- hasStateIcon: isInvalid || isWarning,
179
- isPlaceholderShown: !!placeholder && !value,
180
- });
165
+ const iconSize = inputHeight && inputHeight < 40 ? 16 : 24;
181
166
 
182
167
  return (
183
168
  <FormControl {...formControlProps}>
@@ -185,7 +170,7 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
185
170
  {label && (
186
171
  <FormLabel
187
172
  optionalIndicator={
188
- <Text as="span" color="text.secondary" fontSize="2" fontWeight="normal" marginLeft="4">
173
+ <Text as="span" color="neutral.40" fontSize="2" fontWeight="normal" marginLeft="4px">
189
174
  (Optional)
190
175
  </Text>
191
176
  }
@@ -196,14 +181,14 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
196
181
  )}
197
182
  {!!infoText && (
198
183
  <Tooltip label={infoText} placement="right" {...infoTooltipProps}>
199
- <Icon color="icon.tertiary" name="Info" size="16" />
184
+ <Icon color="neutral.50" name="Info" size="16" />
200
185
  </Tooltip>
201
186
  )}
202
187
 
203
188
  {withCounter && maxLength && (
204
189
  <Text
205
190
  as="span"
206
- color="text.secondary"
191
+ color="neutral.40"
207
192
  marginInlineStart="auto"
208
193
  size="2"
209
194
  sx={{ fontVariantNumeric: 'tabular-nums' }}
@@ -213,16 +198,16 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
213
198
  )}
214
199
  </Box>
215
200
 
216
- <InputWrapper sx={style.inputContainer}>
201
+ <InputWrapper {...inputWrapperProps}>
217
202
  {leftAddon && <LeftContentWrapper>{leftAddon}</LeftContentWrapper>}
218
203
  {!leftAddon && leftIconName && (
219
204
  <InputLeftElement
220
- marginLeft={inputHeight ? (inputHeight - iconNumber) / 2 : 12}
205
+ marginLeft={inputHeight ? (inputHeight - iconSize) / 2 : 12}
221
206
  pointerEvents="none"
222
207
  top="50%"
223
208
  transform="translateY(-50%)"
224
209
  >
225
- <Icon color={leftIconColor} name={leftIconName} size={iconSize} data-disabled={isDisabled || undefined} />
210
+ <Icon color={leftIconColor} name={leftIconName} size={`${iconSize}`} />
226
211
  </InputLeftElement>
227
212
  )}
228
213
  <ChakraInput
@@ -231,47 +216,20 @@ const Input = forwardRef<InputProps, 'div'>((props, ref) => {
231
216
  {...inputProps}
232
217
  onChange={onInputChange}
233
218
  />
234
- {!isInvalid && (isWarning || warningText) && (
235
- <Icon aria-hidden="true" name="WarningColored" size={iconSize} sx={style.stateIcon} />
236
- )}
237
- {isInvalid && (
238
- <Icon
239
- aria-hidden="true"
240
- color="icon.negative"
241
- name="ErrorCircleFilled"
242
- size={iconSize}
243
- sx={style.stateIcon}
244
- />
245
- )}
246
219
  {rightAddon && <RightContentWrapper>{rightAddon}</RightContentWrapper>}
247
220
  {!rightAddon && rightIconName && (
248
221
  <InputRightElement
249
- marginRight={inputHeight ? (inputHeight - iconNumber) / 2 : 12}
222
+ marginRight={inputHeight ? (inputHeight - iconSize) / 2 : 12}
250
223
  pointerEvents="none"
251
224
  top="50%"
252
225
  transform="translateY(-50%)"
253
226
  >
254
- <Icon
255
- color={rightIconColor}
256
- name={rightIconName}
257
- size={iconSize}
258
- sx={style.icon}
259
- data-disabled={isDisabled || undefined}
260
- />
227
+ <Icon color={rightIconColor} name={rightIconName} size={`${iconSize}`} />
261
228
  </InputRightElement>
262
229
  )}
263
230
  </InputWrapper>
264
231
  {errorText && <FormErrorMessage as="p">{errorText}</FormErrorMessage>}
265
- {!errorText && warningText && (
266
- <FormHelperText color="text.body" as="p">
267
- {warningText}
268
- </FormHelperText>
269
- )}
270
- {!errorText && !warningText && helperText && (
271
- <FormHelperText as="p" data-disabled={isDisabled || undefined}>
272
- {helperText}
273
- </FormHelperText>
274
- )}
232
+ {helperText && <FormHelperText as="p">{helperText}</FormHelperText>}
275
233
  </FormControl>
276
234
  );
277
235
  });
@@ -120,11 +120,7 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
120
120
  )}
121
121
  </Box>
122
122
  {errorText && <FormErrorMessage as="p">{errorText}</FormErrorMessage>}
123
- {!errorText && helperText && (
124
- <FormHelperText as="p" data-disabled={isDisabled || undefined}>
125
- {helperText}
126
- </FormHelperText>
127
- )}
123
+ {helperText && <FormHelperText as="p">{helperText}</FormHelperText>}
128
124
  </FormControl>
129
125
  );
130
126
  });