@bitrise/bitkit 10.19.0-alpha-chakra.1 → 10.20.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": "10.19.0-alpha-chakra.1",
4
+ "version": "10.20.0",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -0,0 +1,5 @@
1
+ import { Collapse, CollapseProps } from '@chakra-ui/react';
2
+
3
+ export type { CollapseProps };
4
+
5
+ export default Collapse;
@@ -6,25 +6,47 @@ import {
6
6
  FormHelperText,
7
7
  FormLabel,
8
8
  Textarea as ChakraTextarea,
9
+ TextareaProps as ChakraTextareaProps,
9
10
  forwardRef,
10
11
  } from '@chakra-ui/react';
11
12
 
12
- export interface TextareaProps extends Omit<FormControlProps, 'label'> {
13
+ export interface TextareaProps extends Omit<FormControlProps, 'label' | 'onChange'> {
14
+ dataTestid?: string;
13
15
  errorText?: string;
14
16
  isLoading?: boolean;
15
17
  helpherText?: string;
16
18
  label?: ReactNode;
19
+ onChange?: ChakraTextareaProps['onChange'];
20
+ value?: ChakraTextareaProps['value'];
17
21
  }
18
22
 
19
23
  /**
20
24
  * The Textarea component allows you to easily create multi-line text inputs.
21
25
  */
22
26
  const Textarea = forwardRef<TextareaProps, 'div'>((props, ref) => {
23
- const { errorText, helpherText, isDisabled, isInvalid, isLoading, label, placeholder, ...rest } = props;
27
+ const {
28
+ dataTestid,
29
+ errorText,
30
+ helpherText,
31
+ isDisabled,
32
+ isInvalid,
33
+ isLoading,
34
+ label,
35
+ placeholder,
36
+ onChange,
37
+ value,
38
+ ...rest
39
+ } = props;
40
+ const textareaProps = {
41
+ dataTestid,
42
+ onChange,
43
+ placeholder,
44
+ value,
45
+ };
24
46
  return (
25
47
  <FormControl isDisabled={isDisabled || isLoading} isInvalid={isInvalid || !!errorText} {...rest} ref={ref}>
26
48
  {label && <FormLabel>{label}</FormLabel>}
27
- <ChakraTextarea placeholder={placeholder} />
49
+ <ChakraTextarea {...textareaProps} />
28
50
  {errorText && <FormErrorMessage as="p">{errorText}</FormErrorMessage>}
29
51
  {helpherText && <FormHelperText as="p">{helpherText}</FormHelperText>}
30
52
  </FormControl>
package/src/index.ts CHANGED
@@ -196,5 +196,8 @@ export { default as Tr } from './Components/Table/Tr';
196
196
  export type { ToggleProps } from './Components/Toggle/Toggle';
197
197
  export { default as Toggle } from './Components/Toggle/Toggle';
198
198
 
199
+ export type { CollapseProps } from './Components/Collapse/Collapse';
200
+ export { default as Collapse } from './Components/Collapse/Collapse';
201
+
199
202
  export type { TextareaProps } from './Components/Form/Textarea/Textarea';
200
203
  export { default as Textarea } from './Components/Form/Textarea/Textarea';
package/src/old.ts CHANGED
@@ -24,9 +24,6 @@ export { default as DropdownMenuItem } from './Old/Dropdown/DropdownMenuItem';
24
24
  export type { Props as DropdownMenuItemGroupProps } from './Old/Dropdown/DropdownMenuItemGroup';
25
25
  export { default as DropdownMenuItemGroup } from './Old/Dropdown/DropdownMenuItemGroup';
26
26
 
27
- export type { Props as ExpandProps } from './Old/Expand/Expand';
28
- export { default as Expand } from './Old/Expand/Expand';
29
-
30
27
  export type { Props as FlexProps } from './Old/Flex/Flex';
31
28
  export { default as Flex } from './Old/Flex/Flex';
32
29